Alphabeta Math
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.

✓ 11 results · all verified · 2 also independently AI-judged
Every result on this page is machine-checked by a proof checker and read in full and owner-audited; the judge is an additional, independent cross-model AI review of the proofs. The 9 not AI-judged were verified by owner audit (typically over a confirmed judge false positive), not failures.

Pushdown Automata and Context-Free Languages

1 · Prerequisites

2 · Summary

This page defines PDA runs and the two standard acceptance modes, proves the two machine-translation theorems connecting PDA's and context-free grammars, and then isolates the deterministic branch through unique computations, unambiguity, and complement closure after the endmarker and loop repairs.

3 · Logical flowchart

4 · Definitions, theorems and proofs

DefinitionDefinition: Literature-sourcedProof: Not applicablejudge pass (gpt-5.6-terra)audited 2026-09-12Open item page →

Nondeterministic pushdown automata

Definition

Let Σ be an input alphabet. A nondeterministic pushdown automaton (PDA) over Σ is a septuple M=(Q,Σ,Γ,δ,q0,Z0,F) such that:

  • Q is a finite set of states.
  • Γ is a finite stack alphabet.
  • q0∈Q is the start state.
  • Z0∈Γ is the initial stack symbol.
  • F⊆Q is the set of accepting states.
  • δ assigns to each triple (q,x,Z)∈Q×(Σ∪{ε})×Γ a finite set of pairs (p,β)∈Q×Γ∗.

The intended meaning of (p,β)∈δ(q,x,Z) is that, when the machine is in state q with top stack symbol Z, it may read x if x∈Σ or read nothing if x=ε, pop Z, replace it by the word β, and move to state p.

Remarks

  • The stack is the extra memory absent from finite automata.

  • Nondeterminism means that several pairs (p,β) may be enabled from the same triple (q,x,Z).

DefinitionDefinition: Literature-sourcedProof: Not applicableaudited 2026-09-12Open item page →

PDA configurations and one-step moves

Definition

Fix a PDA M=(Q,Σ,Γ,δ,q0,Z0,F).

A configuration of M is a triple (q,w,α)∈Q×Σ∗×Γ∗ where q is the current state, w is the unread input, and α is the current stack content. We read the leftmost symbol of α as the top of the stack.

There is a one-step move (q,aw,Zγ)⊢M(p,w,βγ) when (p,β)∈δ(q,a,Z), and there is a one-step move (q,w,Zγ)⊢M(p,w,βγ) when (p,β)∈δ(q,ε,Z).

Write ⊢M∗ for the reflexive-transitive closure of ⊢M.

DefinitionDefinition: Literature-sourcedProof: Not applicablejudge pass (gpt-5.6-terra)audited 2026-09-12Open item page →

Acceptance by final state for a PDA

Definition

Let M=(Q,Σ,Γ,δ,q0,Z0,F) be a PDA.

A word w∈Σ∗ is accepted by final state when there exist q∈F and α∈Γ∗ such that (q0,w,Z0)⊢M∗(q,ε,α).

The set of words accepted in this sense is denoted T(M).

DefinitionDefinition: Literature-sourcedProof: Not applicablejudge pass (gpt-5.6-terra)audited 2026-09-12Open item page →

Acceptance by empty stack for a PDA

Definition

Let M=(Q,Σ,Γ,δ,q0,Z0,F) be a PDA.

A word w∈Σ∗ is accepted by empty stack when there exists a state q∈Q such that (q0,w,Z0)⊢M∗(q,ε,ε).

The set of words accepted in this sense is denoted N(M).

TheoremStatement: Literature-sourcedProof: AI-generatedprecheck passaudited 2026-09-12Open item page →

Acceptance by final state and by empty stack are equivalent for PDAs

Statement

For every PDA, the language it accepts by final state is accepted by some PDA by empty stack, and the language it accepts by empty stack is accepted by some PDA by final state.

Facts & Assumptions

Given: A PDA M over Σ.

[L1]

By Acceptance by final state for a PDA, final-state acceptance means that some computation consumes the whole input and ends in an accepting state.

[L2]

By Acceptance by empty stack for a PDA, empty-stack acceptance means that some computation consumes the whole input and empties the stack.

Proof

technique · cases
1.1L1L2givenconstruct

For final-state to empty-stack, adjoin a fresh bottom marker B below the original stack and a fresh drain state d. Whenever the simulated machine reaches an accepting state after consuming all input, the new machine takes an ε-move to d and in state d repeatedly pops the entire remaining stack, including B. By [L1] and [L2], the new machine accepts exactly the same words, now by empty stack.

1.2L1L2givenconstruct

For empty-stack to final-state, adjoin a fresh start state s, a fresh bottom marker B, and a fresh accepting state f. The new machine first pushes the old initial symbol above B, then simulates M, and the only way to enter f is by an ε-move that pops B after the simulated stack has become empty and the input has been fully consumed. By [L1] and [L2], this converts empty-stack acceptance into equivalent final-state acceptance.

2.1step 1.1step 1.2∎

The two constructions from steps 1.1 and 1.2 prove both directions of the equivalence.

TheoremStatement: Literature-sourcedProof: AI-generatedprecheck passaudited 2026-09-12Open item page →

Every context-free grammar has an equivalent PDA

Statement

Let G=(V,Σ,P,S) be a context-free grammar. Then there exists a PDA MG such that N(MG)=L(G).

Facts & Assumptions

Given: A context-free grammar G=(V,Σ,P,S).

[L1]

By The language generated by a CFG, L(G) is the set of terminal words derivable from the start variable S.

[L2]

By Leftmost and rightmost derivations, a leftmost derivation rewrites the leftmost variable at each production step.

[L3]

By Acceptance by empty stack for a PDA, a PDA accepts by empty stack exactly when some full computation consumes the input and empties the stack.

Proof

technique · direct
1.1givenconstruct

Define a one-state PDA MG whose initial stack symbol is S. If the top stack symbol is a variable A and A→α is a production of G, the machine has an ε-move replacing A by α; if the top stack symbol is a terminal a, the machine may read an input symbol a and pop it.

2.1L1L2L3step 1.1

Every leftmost derivation of a word w in G yields an accepting computation of MG: keep the current sentential form on the stack, use the step from 1.1 to expand its leftmost variable exactly as the derivation does, and then match terminals against the input once only terminals remain on top. Therefore [L1], [L2], and [L3] give L(G)⊆N(MG).

2.2L1L2L3step 1.1

Conversely, every accepting computation of MG determines a leftmost derivation in G, because the only ε-moves replace the current top variable by the right-hand side of one production and the only input-consuming moves match the current top terminal against the next input symbol. Reading those stack-replacement moves in order reconstructs a leftmost derivation of the accepted word. Hence N(MG)⊆L(G).

3.1step 2.1step 2.2∎

Steps 2.1 and 2.2 prove N(MG)=L(G).

DefinitionDefinition: Literature-sourcedProof: Not applicablejudge pass (gpt-5.6-terra)audited 2026-09-12Open item page →

The PDA fragment variable [p,Z,q]

Definition

Let M=(Q,Σ,Γ,δ,q0,Z0,F) be a PDA that accepts by empty stack.

For states p,q∈Q and a stack symbol Z∈Γ, the fragment variable [p,Z,q] denotes the language of words x∈Σ∗ such that for every stack suffix α∈Γ∗, (p,x,Zα)⊢M∗(q,ε,α).

Thus [p,Z,q] describes exactly the words that remove the top symbol Z, change state from p to q, and leave the rest of the stack untouched.

LemmaStatement: Literature-sourcedProof: AI-generatedprecheck passaudited 2026-09-12Open item page →

PDA fragment variables compose

Statement

Let M be a PDA that accepts by empty stack.

  1. If x is in the language of [p,Z,r] and y is in the language of [r,Y,q], then xy removes the stack prefix ZY while changing state from p to q and leaving the remaining stack untouched.
  2. Conversely, consider a computation starting at (p,w,ZYα), and let (q,v,α) be its first configuration whose stack is exactly α. Then there are words x,y∈Σ∗ and a state r∈Q such that w=xyv, x∈[p,Z,r], and y∈[r,Y,q]. The two split points are the first moments when Yα and then α are exposed.

Facts & Assumptions

Given: A PDA M that accepts by empty stack.

[L1]

By The PDA fragment variable [p,Z,q], x∈[p,Z,r] means that for every stack suffix α one has (p,x,Zα)⊢M∗(r,ε,α).

Proof

technique · direct
1.1L1given

Assume x∈[p,Z,r] and y∈[r,Y,q], and let α be any stack suffix. Then [L1] gives (p,x,ZYα)⊢M∗(r,ε,Yα) and also (r,y,Yα)⊢M∗(q,ε,α). Concatenating these two computations yields (p,xy,ZYα)⊢M∗(q,ε,α).

1.2L1construct

Conversely, let (q,v,α) be the first configuration with stack α in a computation starting at (p,w,ZYα). Before that point there is a first configuration whose stack is Yα; write it as (r,yv,Yα) and write w=xyv, where x is the input prefix consumed before it is reached and y is consumed between the two first-exposure configurations. The computation therefore contains (p,xyv,ZYα)⊢M∗(r,yv,Yα)⊢M∗(q,v,α). Neither segment inspects the suffix α before its endpoint. Hence the same transition sequences work above every stack suffix β, giving (p,x,Zβ)⊢M∗(r,ε,β) and (r,y,Yβ)⊢M∗(q,ε,β). By [L1], x∈[p,Z,r] and y∈[r,Y,q].

2.1step 1.1step 1.2∎

Therefore fragment computations compose exactly by concatenating the consumed words and, conversely, by splitting at the first moment when the lower stacked symbol is exposed.

TheoremStatement: Literature-sourcedProof: AI-generatedprecheck passaudited 2026-09-12Open item page →

Every PDA has an equivalent context-free grammar

Statement

For every PDA M there exists a context-free grammar GM built from fragment variables [p,Z,q] such that L(GM)=N(M′)=T(M), where M′ is the empty-stack PDA obtained from M by the acceptance-mode conversion.

Facts & Assumptions

Given: A PDA M.

[L1]

By Acceptance by final state and by empty stack are equivalent for PDAs, there is an empty-stack PDA M′ with the same accepted language as M.

[L2]

By The PDA fragment variable [p,Z,q], the variable [p,Z,q] denotes the words that remove Z while taking the machine from state p to state q and leaving the lower stack unchanged.

[L3]

By PDA fragment variables compose, fragment computations concatenate to remove a stacked pair, and conversely a computation removing a stacked pair splits at the first moment when the lower symbol is exposed.

[L4]

By The language generated by a CFG, a grammar generates exactly the terminal words derivable from its start symbol.

Proof

technique · direct
1.1L1givenconstruct

By [L1], replace M by an equivalent empty-stack PDA M′. Refining its transitions if necessary, we may assume that every move of M′ pops one symbol, reads either one input symbol or ε, and pushes either nothing, one symbol, or two symbols; a longer push is replaced by a short chain of fresh intermediate states.

2.1L2step 1.1construct

Build a grammar GM whose variables are the fragment symbols [p,Z,q] for states p,q and stack symbols Z, and whose start symbol branches over all variables [q0,Z0,q]. For each normalized transition (r,β)∈δ(p,a,Z) of M′ with a∈Σ∪{ε}, add the matching productions: if β=ε, add [p,Z,r]→a; if β=Y, add [p,Z,q]→a[r,Y,q] for every state q; if β=YW, add [p,Z,t]→a[r,Y,s][s,W,t] for every pair of states s,t. When a=ε, omit that leading terminal.

3.1L2L3L4step 2.1induction

Every derivation in GM yields an accepting computation of M′ by induction on the derivation tree of a fragment variable [p,Z,q]. The production chosen at the root records the first normalized move from state p with top symbol Z. If the production is terminal or ε, that move already removes Z. If it has one fragment variable, the induction hypothesis supplies the computation removing the pushed symbol. If it has two fragment variables, the induction hypotheses supply computations removing the two pushed symbols, and [L3] composes them into one computation removing the original pushed pair. Therefore every word derived from [p,Z,q] lies in that fragment language, and the start productions give L(GM)⊆N(M′).

3.2L2L3L4step 2.1induction

Conversely, consider a fragment computation (p,w,Zα)⊢M′∗(q,ε,α) and induct on its number of steps. Let its first normalized move be determined by a transition (r,β)∈δ(p,a,Z) with a∈Σ∪{ε} and β∈{ε,Y,YW}. If β=ε, that one move already removes Z, so step 2.1 contributes the corresponding terminal or ε production. If β=Y, the remaining computation removes Y above α, so the induction hypothesis derives the remaining input from [r,Y,q], and step 2.1 prepends the production [p,Z,q]→a[r,Y,q] with the leading terminal omitted when a=ε. If β=YW, then [L3] splits the remaining computation at the first moment when W is exposed on top of α, yielding a state s and a decomposition of the remaining input into words u and v with (r,u,YWα)⊢M′∗(s,v,Wα) and (s,v,Wα)⊢M′∗(q,ε,α). The induction hypothesis derives u from [r,Y,s] and v from [s,W,q], so step 2.1 gives a derivation of w from [p,Z,q]. Applying this to start configurations shows N(M′)⊆L(GM).

4.1L1step 3.1step 3.2∎

Steps 3.1 and 3.2 give L(GM)=N(M′), and [L1] then yields L(GM)=T(M).

TheoremStatement: Literature-sourcedProof: AI-generatedprecheck passaudited 2026-09-12Open item page →

PDAs recognize exactly the context-free languages

Statement

A language over a finite alphabet is context-free if and only if some PDA recognizes it.

Facts & Assumptions

Given: A language L over a finite alphabet Σ.

[L1]

By Every context-free grammar has an equivalent PDA, every context-free grammar has an equivalent PDA.

[L2]

By Every PDA has an equivalent context-free grammar, every PDA has an equivalent context-free grammar.

Proof

technique · direct
1.1L1given

If L is context-free, choose a grammar generating L. Then [L1] gives a PDA recognizing the same language.

1.2L2given

If some PDA recognizes L, then [L2] gives a context-free grammar generating that same language.

2.1step 1.1step 1.2∎

Therefore L is context-free if and only if some PDA recognizes it.

DefinitionDefinition: Literature-sourcedProof: Not applicablejudge pass (gpt-5.6-terra)audited 2026-09-12Open item page →

Deterministic pushdown automata and deterministic context-free languages

Definition

A deterministic pushdown automaton (DPDA) is a PDA M=(Q,Σ∪{⊣},Γ,δ,q0,Z0,F) with a distinguished endmarker ⊣∉Σ such that:

  • for each state q, stack symbol Z, and a∈Σ∪{⊣,ε}, at most one pair (p,β) lies in δ(q,a,Z);
  • if some ε-move is enabled from (q,Z), then no input-reading move is enabled from that same pair (q,Z).

The machine recognizes a language L⊆Σ∗ by final state when it accepts exactly the marked inputs w⊣ in the sense of Acceptance by final state for a PDA.

A language is deterministic context-free when some DPDA recognizes it.

Remarks

  • The endmarker is not part of the language alphabet. It is an auxiliary symbol used to force the machine to detect the end of the real input.

  • Determinism forbids branching on an input symbol or on ε, as well as the simultaneous availability of an ε-move and an input-reading move from the same state/top-of-stack pair.

LemmaStatement: Literature-sourcedProof: AI-generatedprecheck passaudited 2026-09-12Open item page →

A DPDA has at most one computation on each input

Statement

Let M be a DPDA. For every marked input w⊣, any two finite computations of M starting from the initial configuration on w⊣ are comparable by extension. Consequently, there is at most one maximal computation on that marked input.

Facts & Assumptions

Given: A DPDA M and an input word w⊣.

[L1]

By Deterministic pushdown automata and deterministic context-free languages, once the current state and top stack symbol are fixed, there is at most one enabled move, and an enabled ε-move excludes all simultaneous input-reading moves.

[L2]

By PDA configurations and one-step moves, a computation is a sequence of one-step moves between configurations.

Proof

technique · direct
1.1L1given

From any configuration of M, the pair consisting of the current state and top stack symbol determines at most one legal next step by [L1].

2.1L1L2step 1.1induction

Therefore two computations on the same input and with the same initial configuration must agree on their first move whenever either has a first move. Repeating the same argument after each common prefix shows inductively that they agree step by step for as long as both are defined.

3.1L2step 2.1∎

Thus any two finite computations from the initial configuration are comparable by extension. Their union, when the computation continues indefinitely, or their common terminal extension, when it halts, is the unique maximal computation on w⊣.

PropositionStatement: Literature-sourcedProof: AI-generatedprecheck passaudited 2026-09-12Open item page →

If a PDA has at most one accepting computation on each word, the standard PDA-to-CFG construction is unambiguous

Statement

Let M be a PDA such that every word has at most one accepting computation in M. Then the fragment-variable grammar GM from the standard PDA-to-CFG construction is unambiguous.

Facts & Assumptions

Given: A PDA M with at most one accepting computation on each word.

[L1]

By Ambiguous grammars, unambiguous grammars, and inherently ambiguous languages, a grammar is unambiguous when each generated word has exactly one leftmost derivation.

[L2]

By Every PDA has an equivalent context-free grammar, the standard grammar GM is built from fragment variables and generates exactly the language of M.

Proof

technique · direct
1.1L2given

In the grammar GM, every production choice records one concrete local decision in an accepting computation of M: either one normalized PDA move, or one split state used to divide a two-symbol fragment into two smaller fragments. Thus a leftmost derivation of a word in GM determines an accepting computation of M on that word.

2.1L2step 1.1

Conversely, the accepting computation of a word determines all of those local choices uniquely, because the first moment when each top stack symbol disappears fixes the fragment split and therefore fixes the next production in the fragment-variable grammar. So one accepting computation determines exactly one leftmost derivation in GM.

3.1L1step 1.1step 2.1∎

If some generated word had two different leftmost derivations in GM, steps 1.1 and 2.1 would yield two different accepting computations of M on that word, contradicting the hypothesis. Therefore [L1] shows that GM is unambiguous.

PropositionStatement: Literature-sourcedProof: AI-generatedprecheck passaudited 2026-09-12Open item page →

Deterministic context-free languages are unambiguous

Statement

Every deterministic context-free language has an unambiguous context-free grammar.

Facts & Assumptions

Given: A deterministic context-free language L.

[L2]

By A DPDA has at most one computation on each input, computations of a DPDA on one marked input are linearly ordered by extension and have at most one maximal computation.

[L3]

By If a PDA has at most one accepting computation on each word, the standard PDA-to-CFG construction is unambiguous, a PDA with at most one accepting computation on each word yields an unambiguous fragment-variable grammar for the same language.

Proof

technique · direct
1.1L1givenchoose

Choose a DPDA M recognizing L by [L1].

2.1L1step 1.1

Form an equivalent DPDA M^ that records whether the endmarker has been consumed. Before ⊣ it simulates M in a pre-endmarker copy of the state set; a transition consuming ⊣ enters the post-endmarker copy; and all subsequent ε-moves remain in that copy. Declare a post-endmarker copy accepting exactly when its underlying state lies in F, and delete every outgoing move from those accepting copies. This preserves determinism by [L1]: it only duplicates states and removes moves.

3.1L1step 2.1

The machine M^ recognizes the same language as M. Indeed, an accepting computation of M has consumed the marked input and hence reaches a post-endmarker accepting copy in M^; conversely, every accepting copy projects to an accepting configuration of M. Halting at the first such copy does not change whether that configuration is reachable.

3.2L2step 2.1

Every accepting computation of M^ is maximal because its accepting states have no outgoing moves. By [L2], there is therefore at most one accepting computation on each marked input.

4.1L3step 3.1step 3.2∎

Applying [L3] to M^ yields an unambiguous context-free grammar generating its language, which is L by step 3.1. Therefore every deterministic context-free language is unambiguous.

PropositionStatement: Literature-sourcedProof: AI-generatedprecheck passjudge pass (gpt-5.6-terra)audited 2026-09-12Open item page →

Deterministic context-free languages are closed under complement

Statement

If L⊆Σ∗ is deterministic context-free, then Σ∗∖L is also deterministic context-free.

Facts & Assumptions

Given: A deterministic context-free language L⊆Σ∗.

[L1]

By Deterministic pushdown automata and deterministic context-free languages, some DPDA recognizes L on marked inputs w⊣.

[F1]

The standard DPDA complementation construction first modifies a DPDA so that it reads the endmarker before accepting and has no dead-end or spurious-loop behavior, and then swaps the terminal accept/reject outcomes; the resulting DPDA recognizes exactly the marked complement. This is the construction proved in Kozen's Supplementary Lecture F and in Lewis-Papadimitriou Theorem 3.7.1.

Proof

technique · direct
1.1L1givenchoose

Choose a DPDA M recognizing L by [L1].

2.1F1step 1.1construct

Apply the complementation construction from [F1] to M. It produces a DPDA Mc over the same alphabet that accepts exactly the marked words w⊣ not accepted by M.

3.1L1F1step 2.1∎

Because Mc recognizes exactly the marked complement of the language of M, it recognizes Σ∗∖L. Therefore Σ∗∖L is deterministic context-free.

False statementConstruction: Literature-sourcedVerification: AI-generatedprecheck passaudited 2026-09-12Open item page →

FALSE: swapping the accepting states of a DPDA automatically complements its language

Statement

False claim: once a language is recognized by a DPDA, one complements the language simply by declaring the old nonaccepting states to be accepting and the old accepting states to be nonaccepting.

Facts & Assumptions

Given: A DPDA with one state q, bottom marker Z0, no accepting states, and one transition (q,Z0)→ε(q,Z0), so the machine loops forever without reading input.

[A1]

The statement refuted is: swapping the accepting states of a DPDA automatically complements its language.

[L1]

By Deterministic pushdown automata and deterministic context-free languages, a DPDA may have an enabled ε-move as its unique move from a configuration.

[L2]

By Deterministic context-free languages are closed under complement, complementation of DPDA languages requires an explicit construction, not merely a relabeling of states.

Refutation

technique · direct
1.1L1given

The displayed machine recognizes the empty language, because on every marked input it follows the unique ε-loop forever and never reaches an accepting final state.

2.1L1step 1.1

If we merely declare the state q to be accepting, the machine still follows exactly the same infinite ε-loop on every marked input, so it still recognizes the empty language. In particular, it does not recognize the complement Σ∗.

3.1A1L2step 2.1∎

This contradicts [A1]. The complement theorem [L2] needs the endmarker and loop repairs; naive state swapping does not suffice.

False statementConstruction: Literature-sourcedVerification: AI-generatedprecheck passjudge pass (gpt-5.6-terra)audited 2026-09-12Open item page →

FALSE: acceptance by final state and by empty stack are literally identical

Statement

False claim: for a fixed PDA, acceptance by final state and acceptance by empty stack are the same condition with no machine conversion.

Facts & Assumptions

Given: A PDA whose start state q0 is accepting, whose initial stack symbol is Z0, and which has no transitions at all.

[A1]

The statement refuted is: for one fixed PDA, final-state acceptance and empty-stack acceptance are literally identical.

[L1]

By Acceptance by final state for a PDA, the empty word is accepted by final state whenever the start state is already accepting.

[L2]

By Acceptance by empty stack for a PDA, empty-stack acceptance requires a computation that consumes the input and empties the stack.

[L3]

By Acceptance by final state and by empty stack are equivalent for PDAs, every language accepted in either mode is accepted by some PDA in the other mode; this language-class equivalence does not assert that the two modes agree for one fixed PDA.

Refutation

technique · direct
1.1L1given

In the displayed PDA, the empty word is accepted by final state in zero moves because the start state is accepting.

2.1L2step 1.1

The same machine does not accept the empty word by empty stack, because the stack begins with Z0 and there is no transition that removes it. So the required empty-stack configuration never occurs.

3.1A1L3step 2.1∎

Thus the two acceptance notions differ on this fixed machine, contradicting [A1]. The correct general statement is the language-class equivalence from [L3].

5 · Examples, counterexamples and false statements

None yet.

Sources