Documentation

Linglib.Theories.FormalLanguageTheory.PumpingLemma

Pumping Lemma Proofs #

Key results:

These are used by:

inductive FourSymbol :

Alphabet for cross-serial dependency patterns.

Instances For
    Equations
    Equations
    Instances For
      @[reducible, inline]
      Equations
      Instances For

        The language {aⁿbⁿcⁿdⁿ | n ≥ 0}, modeling Dutch cross-serial dependencies.

        Equations
        Instances For

          The CFL pumping property for languages over FourSymbol. Every context-free language has this property (pumping lemma). Showing a language lacks it proves it's not context-free.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            makeString_anbncndn n is always in the language {aⁿbⁿcⁿdⁿ}.

            theorem pump_breaks_anbncndn (p : ) (_hp : p > 0) :
            have w := makeString_anbncndn p; ∀ (u v x y z : FourString), w = u ++ v ++ x ++ y ++ zList.length (v ++ x ++ y) pList.length v + List.length y 1 (i : ), isInLanguage_anbncndn (u ++ (List.replicate i v).flatten ++ x ++ (List.replicate i y).flatten ++ z) = false

            Pumping breaks membership in {aⁿbⁿcⁿdⁿ}: for any decomposition of aᵖbᵖcᵖdᵖ into uvxyz with |vxy| ≤ p and |vy| ≥ 1, pumping at i=0 breaks membership.

            Key insight: |vxy| ≤ p means vxy can't contain both.a and.d (they're separated by 2p positions). Pumping down (i=0) preserves one count at p while reducing the total, making counts unequal.

            {aⁿbⁿcⁿdⁿ} does NOT have the CFL pumping property, hence is not context-free.

            Proof: for any pumping constant p, the word aᵖbᵖcᵖdᵖ ∈ L witnesses failure. By pump_breaks_anbncndn, every valid decomposition can be pumped down (i=0) to break membership, contradicting the pumping property's ∀ i guarantee.

            inductive ThreeSymbol :

            Alphabet for {aⁿbⁿcⁿ}.

            Instances For
              Equations
              Instances For

                The language {aⁿbⁿcⁿ | n ≥ 0}.

                Equations
                Instances For

                  The CFL pumping property for languages over ThreeSymbol.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    {aⁿbⁿcⁿ} does NOT have the CFL pumping property, hence is not context-free. Same structure as the four-symbol case: contiguity forces either.a or.c absent from vxy, preserving one count at p while the total decreases.