Documentation

Linglib.Core.Computability.NonContextFree.AnBnCn

{aⁿbⁿcⁿ}: a three-symbol non-context-free witness #

The classical three-symbol witness anbnc = {aⁿbⁿcⁿ | n ≥ 0}, shown non-context-free by the CFL pumping lemma together with the adjacency lemma of BlockWitness: a pumped window short enough to fit inside the witness cannot meet both the a-block and the c-block, so pumping down leaves some symbol's count untouched while shortening the word.

Independent of AnBnCnDn and AmBnCmDn: it uses its own ThreeSymbol alphabet.

Main definitions #

Main results #

inductive ThreeSymbol :

Alphabet for {aⁿbⁿcⁿ}.

Instances For
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    def instReprThreeSymbol.repr :
    ThreeSymbolStd.Format
    Equations
    Instances For
      def makeString_anbnc (n : ) :

      The witness word aⁿbⁿcⁿ.

      Equations
      Instances For
        def anbnc :
        Language ThreeSymbol

        The language {aⁿbⁿcⁿ | n ≥ 0}, as the range of makeString_anbnc.

        Equations
        Instances For
          theorem mem_anbnc_iff (w : List ThreeSymbol) :
          w anbnc ∃ (n : ), w = makeString_anbnc n

          Membership characterization: every string in anbnc is makeString_anbnc n for some n. Consumed by the homomorphic reduction aⁿbⁿcⁿdⁿ → aⁿbⁿcⁿ in AnBnCnDn.

          @[simp]
          theorem count_makeString_anbnc (n : ) (s : ThreeSymbol) :
          List.count s (makeString_anbnc n) = n

          Each of the three symbols occurs exactly n times in the witness.

          @[simp]
          theorem length_makeString_anbnc (n : ) :
          (makeString_anbnc n).length = 3 * n

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

          Pumping down to i = 0 gives u ++ x ++ z = makeString_anbnc m, so every symbol occurs m times there. The pumped-out window is too short to meet both the a- and the c-block, so one of those two symbols is absent from v and y — forcing m = p, while the removed window makes the word strictly shorter.

          theorem anbnc_not_contextFree :
          ¬anbnc.IsContextFree

          {aⁿbⁿcⁿ} is not context-free.