Alphabeta Math
LemmaStatement: Literature-sourcedProof: AI-generatedprecheck passaudited 2026-08-30
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

Eliminating immediate left recursion preserves the language

Statement

Suppose the productions of a variable A in a context-free grammar are exactly A→Au1,…,A→Aur,A→v1,…,A→vs, where none of the words vj begins with A. Introduce a fresh variable R and replace those productions by A→v1,…,A→vs,A→v1R,…,A→vsR, R→u1,…,R→ur,R→u1R,…,R→urR, leaving every other production unchanged.

Then the resulting grammar generates the same language as the original grammar.

Facts & Assumptions

Given: The original grammar and the rewritten grammar related by the displayed immediate-left-recursion elimination step.

[L1]

Leftmost derivations always rewrite the leftmost remaining variable, by Leftmost and rightmost derivations.

[L2]

The language of a grammar is determined by the terminal words derivable from its start symbol, by The language generated by a CFG.

Proof

technique · direct
1.1L1given

Consider a leftmost derivation segment in the original grammar beginning with A. Because every left-recursive rule has the form A→Aui, any maximal initial block of left-recursive steps must look like A⇒Aui1⇒Aui2ui1⇒⋯⇒Auik⋯ui1⇒vjuik⋯ui1. So the contribution of this segment is always one non-left-recursive word vj followed by a finite concatenation of the ui.

2.1constructstep 1.1

The new variable R generates exactly the nonempty finite concatenations of the ui: use R→ui for a one-term concatenation and R→uiR to prepend further ui's. Therefore the segment in step 1.1 is reproduced in the rewritten grammar either by A→vj when k=0 or by A→vjR followed by a derivation of the same tail from R when k≥1.

3.1step 2.1

Conversely, any derivation segment in the rewritten grammar beginning with A either uses A→vj directly or uses A→vjR followed by a derivation of a finite concatenation of the ui from R. Reversing the regrouping in step 1.1 turns that segment back into a block of left-recursive uses of A→Aui ending with A→vj in the original grammar.

4.1L2step 2.1step 3.1∎

Since all other productions are unchanged, steps 2.1 and 3.1 convert derivations of terminal words back and forth without changing the yield. Hence [L2] gives equality of the generated languages.

Depends on

Used by

Dependency tree · two levels

3 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources