Context-Free Closure Converses Fail #
This file proves that the closure properties of context-free languages under union, concatenation, and substitution are strict implications, not biconditionals. That is, while:
is_CF L₁ ∧ is_CF L₂ → is_CF (L₁ + L₂)(closure under union),is_CF L₁ ∧ is_CF L₂ → is_CF (L₁ * L₂)(closure under concatenation),is_CF L ∧ (∀ a, is_CF (f a)) → is_CF (L.subst f)(closure under substitution), the converses of all three fail.
Proof sketch #
All counterexamples derive from the existence of a non-context-free language,
which is obtained from nnyCF_of_CF_i_CF (non-closure under intersection):
there exist CF languages L₁, L₂ whose intersection L₁ ⊓ L₂ is not CF.
- Union: Take
A = L₁ ⊓ L₂(not CF) andB = L₁(CF). ThenA + B = (L₁ ⊓ L₂) ⊔ L₁ = L₁is CF, butAis not CF. - Concatenation: Take
A = L₁ ⊓ L₂(not CF) andB = 0(empty language, CF). ThenA * B = 0is CF, butAis not CF. - Substitution: Take
L = 0 : Language Unitandf () = L₁ ⊓ L₂(not CF). ThenL.subst f = 0is CF, butfmaps to a non-CF language.