Documentation

Linglib.Core.Computability.NonContextFree.AnBnCnDn

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

The single-parameter four-symbol witness anbncndn = {aⁿbⁿcⁿdⁿ | n ≥ 0}.

Non-context-freeness is derived by closure, not re-proved by pumping: the erasing homomorphism dropD : d ↦ ε maps anbncndn exactly onto the counting core anbnc = {aⁿbⁿcⁿ}, so anbncndn_not_contextFree follows from anbnc_not_contextFree through Language.IsContextFree.stringMap. aⁿbⁿcⁿdⁿ is the nested-counting case; the genuinely crossing witness is the two-parameter ambncmdn sibling, which does not reduce by single-symbol erasure.

This file also hosts the FourSymbol substrate shared with NonContextFree.AmBnCmDn: the alphabet, the witness-form bridge to BlockWitness, and the two adjacency consequences.

Main definitions #

Main results #

inductive FourSymbol :

Alphabet for the four-symbol counting witness languages.

Instances For
    @[instance_reducible]
    Equations
    def instReprFourSymbol.repr :
    FourSymbolStd.Format
    Equations
    Instances For
      @[instance_reducible]
      Equations
      @[reducible, inline]

      Words over the four-symbol alphabet.

      Equations
      Instances For

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

        Equations
        Instances For
          def anbncndn :
          Language FourSymbol

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

          Equations
          Instances For
            theorem mem_anbncndn_iff (w : FourString) :
            w anbncndn ∃ (n : ), w = makeString_anbncndn n

            Membership characterization: every string in anbncndn is makeString_anbncndn n for some n.

            @[simp]
            theorem count_makeString_anbncndn (n : ) (s : FourSymbol) :
            List.count s (makeString_anbncndn n) = n

            Each of the four symbols occurs exactly n times in the witness. Shared with AmBnCmDn, which pumps over the same diagonal witness.

            @[simp]
            theorem length_makeString_anbncndn (n : ) :
            List.length (makeString_anbncndn n) = 4 * n
            theorem fourSymbol_count_total (l : FourString) :
            List.count FourSymbol.a l + List.count FourSymbol.b l + List.count FourSymbol.c l + List.count FourSymbol.d l = List.length l

            The four symbol counts of a word sum to its length.

            The four-symbol witness is structurally BlockWitness [a, b, c, d] n.

            theorem not_a_and_c_in_vxy (p : ) (u vxy z : FourString) (hw : makeString_anbncndn p = u ++ vxy ++ z) (hvxy : List.length vxy p) :
            ¬(FourSymbol.a vxy FourSymbol.c vxy)
            theorem not_b_and_d_in_vxy (p : ) (u vxy z : FourString) (hw : makeString_anbncndn p = u ++ vxy ++ z) (hvxy : List.length vxy p) :
            ¬(FourSymbol.b vxy FourSymbol.d vxy)

            Non-context-freeness by homomorphic reduction to {aⁿbⁿcⁿ} #

            The erasing homomorphism d ↦ ε (a per-symbol map; the string action is List.flatMap dropD, the free-monoid lift), relabelling the surviving a/b/c into the ThreeSymbol alphabet.

            Equations
            Instances For
              @[simp]
              theorem dropD_makeString (n : ) :

              dropD erases the dⁿ block and relabels, sending the witness to makeString_anbnc n.

              dropD maps anbncndn exactly onto the counting core anbnc. This image equality is what powers the closure reduction.

              theorem anbncndn_not_contextFree :
              ¬anbncndn.IsContextFree

              {aⁿbⁿcⁿdⁿ} is not context-free — derived by closure from anbnc_not_contextFree via the erasing homomorphism dropD, rather than re-proved by pumping.