Documentation

Linglib.Core.Computability.NonContextFree.AmBnCmDn

{aᵐbⁿcᵐdⁿ}: a two-parameter four-symbol non-context-free witness #

The two-parameter relaxation of anbncndn: case-sorted strings whose a- and c-counts agree and whose b- and d-counts agree — the diagonal pairs only, not all four counts equal. A strict superset of anbncndn, and the language [Shi85]'s argument that Swiss German is not weakly context-free actually requires.

Pumping runs on the diagonal witness makeString_anbncndn p, which lies in ambncmdn because equal-all-four implies the diagonal pairs match. Deleting the pumped window breaks one of the two diagonal equalities rather than all four — the substantive content beyond AnBnCnDn.

Main definitions #

Main results #

The witness word aᵐbⁿcᵐdⁿ.

Equations
Instances For
    def ambncmdn :
    Language FourSymbol

    The language {aᵐbⁿcᵐdⁿ | m, n ≥ 0}, as the range of makeString_ambncmdn.

    Equations
    Instances For
      theorem mem_ambncmdn_iff (w : FourString) :
      w ambncmdn ∃ (m : ) (n : ), w = makeString_ambncmdn m n

      Membership characterization: every string in ambncmdn equals makeString_ambncmdn m n for some m, n.

      The diagonal witness lies in ambncmdn: aⁿbⁿcⁿdⁿ is aᵐbⁿcᵐdⁿ at m = n.

      @[simp]
      theorem count_a_makeString_ambncmdn (m n : ) :
      List.count FourSymbol.a (makeString_ambncmdn m n) = m
      @[simp]
      theorem count_b_makeString_ambncmdn (m n : ) :
      List.count FourSymbol.b (makeString_ambncmdn m n) = n
      @[simp]
      theorem count_c_makeString_ambncmdn (m n : ) :
      List.count FourSymbol.c (makeString_ambncmdn m n) = m
      @[simp]
      theorem count_d_makeString_ambncmdn (m n : ) :
      List.count FourSymbol.d (makeString_ambncmdn m n) = n
      theorem pump_breaks_ambncmdn (p : ) (_hp : 0 < p) (u v x y z : FourString) :
      makeString_anbncndn p = u ++ v ++ x ++ y ++ zList.length (v ++ x ++ y) pList.length v + List.length y 1∃ (i : ), u ++ (List.replicate i v).flatten ++ x ++ (List.replicate i y).flatten ++ zambncmdn

      Pumping breaks ambncmdn membership. Deleting v and y must break either the a-count = c-count equality or the b-count = d-count equality, depending on which blocks the window meets.

      {aᵐbⁿcᵐdⁿ} does not have the CFL pumping property.

      theorem ambncmdn_not_contextFree :
      ¬ambncmdn.IsContextFree

      {aᵐbⁿcᵐdⁿ} is not context-free — the two-parameter relaxation that [Shi85]'s Swiss German argument requires.