Infinite Language from Long CNF Derivations

Infinite Language from Long CNF Derivations

Verified Sources
Sep 13, 2026

Let G=(V,Σ,R,S)G=(V,\Sigma,R,S) be a context-free grammar in Chomsky normal form (CNF), with V=b|V|=b variables. Assume GG generates some string wL(G)w\in L(G) using a derivation (equivalently, a parse tree) that has at least 2b2^b steps. We show that L(G)L(G) 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 L(G)L(G).

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

  1. (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.

  2. (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 “2b2^b steps” implies

In CNF, every non-start variable expands in one step as either:

  • ABCA \to BC (two variables), or
  • AaA \to a (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 AaA\to a 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 hh forces at least 2h2^h leaves/expansion steps up to constant factors; conversely, if the derivation has at least 2b2^b steps, the parse tree height is at least on the order of bb (at least b+1b+1 variable-nodes along some root-to-leaf path suffices for pumping). The standard pumping approach uses “height >b> b” rather than an exact 2b2^b constant; the 2b2^b bound is a convenient way to guarantee such a height excess by pigeonhole/size arguments. 2

So from the assumption “at least 2b2^b steps,” we can extract a root-to-leaf path containing at least b+1b+1 variable occurrences.

Footnotes

  1. (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.

  2. (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)

  1. 1
    Step 1

    Take the given derivation of ww and form its parse tree TT; internal nodes correspond to variables and leaves to terminals (per CNF structure).

  2. 2
    Step 2

    Use the binary nature of CNF expansions to deduce that TT has root-to-leaf height at least b+1b+1 (the 2b2^b steps assumption is more than enough to force this).

  3. 3
    Step 3

    There are only bb variables. A root-to-leaf path with at least b+1b+1 variable-nodes must contain the same variable at least twice: XuXvX \Rightarrow^* uXv along that path.

  4. 4
    Step 4

    Let the lower and upper occurrences of XX on the path define a decomposition of ww as w=xyzw=xyz, where the middle part yy corresponds to the yield produced between those two XX’s.

  5. 5
    Step 5

    For every k0k\ge 0, replace the lower XX expansion by the same subtree-expansion pattern used between the two occurrences, effectively generating strings xykzxy^kz.

  6. 6
    Step 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 xykz|xy^kz| grows with kk.

  7. 7
    Step 7

    Since xykzL(G)xy^kz\in L(G) for all k0k\ge 0 and the lengths are distinct for different kk, L(G)L(G) contains infinitely many strings.

Why the pumped strings must differ in length

Because CNF derivations use only:

  • binary variable productions AtoBCA\\to BC, and
  • terminal productions AtoaA\\to a,

the subtree “between” the two repeated occurrences of XX 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 XX). Therefore, pumping increases the number of variable-expansion levels, and hence increases the number of terminal leaves in the derived yield, so xykz|xy^kz| is strictly increasing for kk (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

  1. (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.

  2. (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

2b2^b 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 b+1b+1 (for bb variables), then some variable XX labels two nodes on the same root-to-leaf path. That repetition gives a decomposition w=xyzw=xyz with:

  • y>0|y|>0
  • xykzinL(G)xy^kz\\in L(G) for all kge0k\\ge 0
  • and xykz|xy^kz| strictly increases with kk,

so L(G)L(G) is infinite. 2

Given the assumption that the derivation has at least 2b2^b steps, the binary branching of CNF expansions ensures the parse tree height exceeds bb. Hence the height repetition lemma applies, completing the proof.

Footnotes

  1. (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.

  2. (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

1

Convert the given derivation of ww into a CNF parse tree TT."

Relate step-count to height

2

Use CNF’s binary branching to infer height b+1\ge b+1 on some path."

Pigeonhole on variables

3

Some variable XX appears at least twice on that path."

Extract pumping decomposition

4

Define w=xyzw=xyz using the segment between the two XX occurrences."

Pump and conclude infiniteness

5

Show xykzL(G)xy^kz\in L(G) for all kk and lengths differ, so L(G)L(G) is infinite."

Conceptual dependencies in the proof

Each ingredient supports the next step in the argument.

Common questions / edge cases

Knowledge Check

Question 1 of 3
Q1Single choice

In a CNF parse tree, what property allows pumping when a variable repeats on a root-to-leaf path?