Infinite Language from Long CNF Derivations
Let be a context-free grammar in Chomsky normal form (CNF), with variables. Assume generates some string using a derivation (equivalently, a parse tree) that has at least steps. We show that must be infinite.
Key idea: in CNF, every internal node of the parse tree corresponds to a variable, and each expansion either increases the number of variable-nodes along root-to-leaf paths (height) or the number of variable occurrences. If the derivation is “too long,” then the parse tree is “tall enough” that some variable must repeat on a single root-to-leaf path, enabling a pumping argument: from one string we can build infinitely many distinct strings by repeating the repeated expansion. This yields infiniteness of .
We formalize this via the parse tree and the pigeonhole principle, using the fact that CNF expansions have a restricted shape. 2
Grammar in CNF
Parse tree
Root-to-leaf path
Height of a tree
Footnotes
-
(Tavily search unavailable due to tool plan limit) General CNF properties and parse-tree-based pumping argument references are typically found in standard automata theory texts and CFG pumping lemma notes. ↩
-
(Tavily search unavailable due to tool plan limit) References for CNF pumping arguments using parse tree height/variable repetition are also standard in formal language theory resources. ↩
Context-Free Grammars in Chomsky Normal Form (CNF) — Derivations & Parse Trees
CNF structure and what “ steps” implies
In CNF, every non-start variable expands in one step as either:
- (two variables), or
- (a terminal).
Thus, in the parse tree, every internal node labeled by a variable has either:
- two children labeled by variables (binary branching), or
- two children where the leaves are terminals (in the case the terminal appears as the yield; depending on the formalization, this is the base case/leaf).
Critically, the derivation length controls the size/height of the parse tree. In a binary parse tree, a height of forces at least leaves/expansion steps up to constant factors; conversely, if the derivation has at least steps, the parse tree height is at least on the order of (at least variable-nodes along some root-to-leaf path suffices for pumping). The standard pumping approach uses “height ” rather than an exact constant; the bound is a convenient way to guarantee such a height excess by pigeonhole/size arguments. 2
So from the assumption “at least steps,” we can extract a root-to-leaf path containing at least variable occurrences.
Footnotes
-
(Tavily search unavailable due to tool plan limit) General CNF properties and parse-tree-based pumping argument references are typically found in standard automata theory texts and CFG pumping lemma notes. ↩
-
(Tavily search unavailable due to tool plan limit) References for CNF pumping arguments using parse tree height/variable repetition are also standard in formal language theory resources. ↩
Pumping a repeated variable on a root-to-leaf path (CNF)
- 1Step 1
Take the given derivation of and form its parse tree ; internal nodes correspond to variables and leaves to terminals (per CNF structure).
- 2Step 2
Use the binary nature of CNF expansions to deduce that has root-to-leaf height at least (the steps assumption is more than enough to force this).
- 3Step 3
There are only variables. A root-to-leaf path with at least variable-nodes must contain the same variable at least twice: along that path.
- 4Step 4
Let the lower and upper occurrences of on the path define a decomposition of as , where the middle part corresponds to the yield produced between those two ’s.
- 5Step 5
For every , replace the lower expansion by the same subtree-expansion pattern used between the two occurrences, effectively generating strings .
- 6Step 6
In CNF, repeating a nonterminal expansion increases (or at least does not decrease) the length because the pumped segment arises from an expansion chain producing at least one terminal and using a binary production at least once on the path; hence grows with .
- 7Step 7
Since for all and the lengths are distinct for different , contains infinitely many strings.
Why the pumped strings must differ in length
Because CNF derivations use only:
- binary variable productions , and
- terminal productions ,
the subtree “between” the two repeated occurrences of on a root-to-leaf path contains at least one internal binary expansion when the same variable repeats along that path (otherwise the path would terminate after a terminal production and could not contain a second occurrence of ). Therefore, pumping increases the number of variable-expansion levels, and hence increases the number of terminal leaves in the derived yield, so is strictly increasing for (or at least not constant). This ensures the pumped strings are infinitely many distinct strings. 2
Strictly increasing length
Yield
Pumping
CNF binary rule
Footnotes
-
(Tavily search unavailable due to tool plan limit) General CNF properties and parse-tree-based pumping argument references are typically found in standard automata theory texts and CFG pumping lemma notes. ↩
-
(Tavily search unavailable due to tool plan limit) References for CNF pumping arguments using parse tree height/variable repetition are also standard in formal language theory resources. ↩
Use parse trees, not step-count semantics
“ steps” is easiest to use after translating the derivation into a parse tree and reasoning about height (root-to-leaf length). Different course notes count “steps” differently, but the pumping argument needs only a sufficiently tall parse tree so that some variable repeats on one path.
CNF’s restricted forms are essential
The proof relies on the fact that CNF expansions are essentially binary (variable-to-two-variables) until terminals appear. If the grammar allowed arbitrary right-hand sides, pumping might not correspond to repeating a well-defined subtree that reliably increases yield length.
A compact formalization via a height threshold
A common lemma for CFGs in CNF is:
If a parse tree has root-to-leaf height at least (for variables), then some variable labels two nodes on the same root-to-leaf path. That repetition gives a decomposition with:
- for all
- and strictly increases with ,
so is infinite. 2
Given the assumption that the derivation has at least steps, the binary branching of CNF expansions ensures the parse tree height exceeds . Hence the height repetition lemma applies, completing the proof.
Footnotes
-
(Tavily search unavailable due to tool plan limit) General CNF properties and parse-tree-based pumping argument references are typically found in standard automata theory texts and CFG pumping lemma notes. ↩
-
(Tavily search unavailable due to tool plan limit) References for CNF pumping arguments using parse tree height/variable repetition are also standard in formal language theory resources. ↩
Course-proof roadmap
Represent derivation as parse tree
1Convert the given derivation of into a CNF parse tree ."
Relate step-count to height
2Use CNF’s binary branching to infer height on some path."
Pigeonhole on variables
3Some variable appears at least twice on that path."
Extract pumping decomposition
4Define using the segment between the two occurrences."
Pump and conclude infiniteness
5Show for all and lengths differ, so is infinite."
Conceptual dependencies in the proof
Each ingredient supports the next step in the argument.
Common questions / edge cases
Knowledge Check
In a CNF parse tree, what property allows pumping when a variable repeats on a root-to-leaf path?