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.
Post Correspondence and Language Undecidability
1 · Prerequisites
- Computable Reductions and Rice's Theorem
- Construction of the Natural Numbers
- Construction of the Real Numbers via Cauchy Sequences
- Construction of the Real Numbers via Dedekind Cuts
- Context-Free Grammars and Normal Forms
- Context-Free Pumping, Ogden's Lemma, and Parsing
- Countability and Uncountability
- Decidable, Recognizable, and Enumerable Languages
- Deterministic Finite Automata and Regular Languages
- Diagonalization and the Halting Problem
- Finite Counting, Factorials and Binomial Coefficients
- Formal Languages, Encodings, and Decision Problems
- Foundations of the Real Numbers for Analysis
- Linear Recurrences and Rational Generating Functions
- Myhill--Nerode Theory and DFA Minimization
- Ramsey Theory
- Relations, Functions, and Quotients
- Robust Machine Models and Universal Computation
- Roots, Rational Powers, and Classical Inequalities
- The ZFC Axioms and the Basic Set Constructions
- Turing Machines, Configurations, and Computation
2 · Summary
This page follows the standard undecidability spine through Post correspondence. Modified PCP is obtained from accepting computation histories, ordinary PCP inherits undecidability from modified PCP, and the resulting tile matching problem is then re-used to force undecidability for several grammar questions.
The closing hierarchy theorem packages the comparison points prepared by the
preceding automata and computability pages. The witnesses are kept separate:
{a^n b^n} for regular versus context-free, a decidable non-context-free
language for context-free versus decidable, and A_{TM} for decidable versus
computably enumerable.
3 · Logical flowchart
4 · Definitions, theorems and proofs
The Post correspondence problem
Definition
Fix a finite alphabet . A Post correspondence problem instance over is a finite list of pairs of nonempty words
A match for that instance is a nonempty finite index sequence such that
The Post correspondence problem asks, given such a finite list of dominoes, whether a match exists.
Remarks
-
The chosen sequence may repeat dominoes.
-
The equality compares the two concatenated words exactly as written. One may choose dominoes and their order, but one may not reorder symbols inside a domino.
The modified Post correspondence problem
Definition
An instance of the modified Post correspondence problem is a PCP instance with the extra requirement that a permitted match must start with the first domino.
Thus a modified-PCP match is a nonempty sequence such that
Remarks
-
Modified PCP differs from ordinary PCP only by fixing the first chosen tile.
-
Every modified-PCP match is a PCP match, but not conversely.
Accepting computation histories can be encoded by modified-PCP domino matches
Statement
For every coded deterministic one-tape Turing machine and every input word , one can effectively construct a modified-PCP instance such that has a match if and only if has an accepting computation history on . The construction may be chosen so that every match spells a separator-delimited accepting history before its forced cleanup suffix and uses only start, copier, local-transition, boundary-extension, accepting-cleanup, and terminal tiles.
Facts & Assumptions
Given: A coded deterministic one-tape Turing machine and an input word .
A modified-PCP solution is a PCP match that starts with the designated first domino, by The modified Post correspondence problem.
accepts exactly when has an accepting computation history on , by Finite computation histories, halting computations, and divergence.
The chosen machine coding is effective and gives one finite transition table and one chosen start configuration for the pair , by A fixed effective binary encoding of deterministic one-tape Turing machines.
For a fixed machine-input pair, accepting computation histories admit an effective configuration coding and form a decidable language, by For a fixed machine and input, valid accepting computation histories form a decidable language.
Proof
For a concrete version of the effective configuration coding in [L4], tag the finite state and tape alphabets disjointly. For and any padding bound , put and encode the padded representative as where is a fresh left-end marker. This word contains exactly one state symbol and decodes unambiguously to even when some final are blank; different amounts of trailing blank padding may represent the same configuration. We also permit the right-blank abbreviation when and every cell from onward is blank; it records the same configuration with the scanned blank left implicit. Adjoin a second fresh symbol # as a block separator. Starting with the least explicit bound for , the intended history prefix has the form
Write a domino as with top word and bottom word . Let contain the designated start domino Add copier dominoes for , but not for state symbols. For every transition add . Add the boundary-padding domino : it supplies the newly scanned blank when a right move passes the last displayed tape cell, and otherwise merely permits one additional trailing blank in the next padded representative. For every and add , and add the separate clamped-left domino . Finally, for each add the accepting-cleanup dominoes and , and add the terminal domino . These are finitely many pairs of nonempty words and are computed directly from the finite alphabet, transition table, and start configuration in [L3].
If has an accepting history , choose padding bounds recursively. Having chosen , keep the same bound for unless a right move from cell requires ; in particular, retain a now-trailing blank when a left move erases the last nonblank cell. Begin with the start domino. For each , use copier dominoes up to the head window, the unique right-, interior-left-, or clamped-left transition domino from step 2.1 at that window, copier dominoes after it, and then if or if . At every separator the top row has thereby copied while the bottom row has appended , so the bottom remains exactly one padded configuration block ahead. In the final accepting block, repeated whole-block passes use copiers together with to delete the symbol immediately left of the accepting state, or with to delete the symbol immediately right of it. These passes eventually leave the one-block lag , which the terminal domino closes because its top is and its bottom is #. The two full concatenations are then equal, giving a modified-PCP match.
Conversely, let a modified-PCP match be given. Its first domino is the designated start domino by [L1], so the unmatched bottom suffix initially is exactly . Induct over the separators subsequently matched by the top row. Copier dominoes cannot copy a state symbol. Before appears, the unique state symbol in the current block must therefore be consumed by one transition domino from step 2.1. The symbol immediately before it distinguishes an interior left move from the special -boundary move. All other tape symbols are copied, while the choice between and either preserves the displayed length or adds one trailing blank. If a right move has put a nonaccepting state just beyond the last displayed cell, choosing would leave that state immediately before the separator, where no transition or cleanup top can consume it, so a complete match must choose the boundary-padding tile. If the new state is , the shorter choice is precisely the right-blank abbreviation from step 1.1. Consequently every pre-cleanup bottom block decodes to the unique configuration with , although its harmless trailing-blank padding need not be unique. Cleanup dominoes contain and cannot begin this suffix before an accepting block has been reached; after they begin, their shorter bottom words and the terminal anchor can remove the remaining offset. Hence every match has a prefix decoding to an accepting computation history of the original machine on .
Steps 3.1 and 3.2 prove that has a match if and only if has an accepting computation history on . Step 2.1 constructs its finite domino list effectively from .
The modified Post correspondence problem is undecidable
Statement
The modified Post correspondence problem is undecidable.
Facts & Assumptions
Given: The language of modified-PCP instances with a match.
From every machine-input pair one can compute a modified-PCP instance such that has a match if and only if accepts , by Accepting computation histories can be encoded by modified-PCP domino matches.
The Turing-machine acceptance problem is undecidable, by The Turing-machine acceptance problem is undecidable.
If and is decidable, then is decidable, by Computable many-one reductions transfer decidability and recognizability backward.
Proof
Define a map on coded machine-input pairs by By [L1], this map is total and computable and satisfies Thus .
If modified PCP were decidable, then [L3] and step 1.1 would imply that is decidable. This contradicts [L2].
Therefore modified PCP is undecidable.
Modified PCP many-one reduces to PCP
Statement
There is a computable many-one reduction from modified PCP to ordinary PCP.
Facts & Assumptions
Given: A modified-PCP instance
A modified-PCP match is an index sequence beginning with the first domino, by The modified Post correspondence problem.
An ordinary PCP match is any nonempty domino sequence whose top and bottom concatenations are equal, by The Post correspondence problem.
Proof
Introduce fresh symbols * and !. For a word , write Construct a PCP instance consisting of one special start tile, one shifted tile for each original domino, and one end tile: The extra leading * appears only on the special start tile, and ! appears only on the end tile.
If is a modified-PCP match, choose the special start tile, then the ordinary shifted tiles for , and finally the end tile. The top concatenation is while the bottom concatenation is Because the original match satisfies , these two shifted strings agree symbol by symbol: the leading * on top supplies the one-symbol offset, every interior * matches the next boundary marker on the bottom, and the end tile matches the final extra *. Hence the transformed PCP instance has a match.
Conversely, let a PCP match be given for the transformed instance. The common concatenated word begins with *, and among the available top words only the special start tile begins with *, so the first chosen tile is the special start tile. Equality cannot be completed without an end tile. Consider the prefix ending at the first use of that tile. The fresh symbol ! occurs nowhere else, so its two first occurrences align and this prefix already has equal top and bottom concatenations. Delete the initial *, the terminal !, and all separator symbols * from this matched prefix. The remaining equality is Thus the recovered sequence begins with the original first domino and is a modified-PCP match. Later repetitions of the start or end tiles, if present in the original PCP match, are irrelevant because the first completed prefix has already supplied the required modified-PCP match.
Steps 2.1 and 2.2 prove the required equivalence, and the construction in step 1.1 is effective. Therefore modified PCP many-one reduces to PCP.
The Post correspondence problem is undecidable
Statement
The Post correspondence problem is undecidable.
Facts & Assumptions
Given: The language of PCP instances with a match.
Modified PCP many-one reduces to PCP, by Modified PCP many-one reduces to PCP.
Modified PCP is undecidable, by The modified Post correspondence problem is undecidable.
If and is decidable, then is decidable, by Computable many-one reductions transfer decidability and recognizability backward.
Proof
By [L1], there is a total computable map sending each modified-PCP instance to a PCP instance with the same yes-or-no answer.
If PCP were decidable, then [L3] and step 1.1 would imply that modified PCP is decidable. This contradicts [L2].
Therefore PCP is undecidable.
The Post correspondence problem is recognizable
Statement
The language of PCP instances that have a match is recognizable.
Facts & Assumptions
Given: A PCP instance
A yes-instance of PCP is exactly a nonempty finite index sequence with by The Post correspondence problem.
Proof
Enumerate all nonempty finite sequences over in length-lexicographic order: For each sequence , compute the two concatenations and and compare them.
If the instance has a match, [L1] supplies some witnessing sequence , and the enumeration from step 1.1 eventually reaches it and accepts. If the instance has no match, every tested sequence fails and the search runs forever.
Therefore there is a Turing machine that accepts exactly the PCP yes-instances, so PCP is recognizable.
Emptiness of the intersection of two CFGs is undecidable
Statement
The problem of deciding, from two context-free grammars and , whether is undecidable.
Facts & Assumptions
Given: A PCP instance
A PCP match is a nonempty index sequence with equal top and bottom concatenations, by The Post correspondence problem.
PCP is undecidable, by The Post correspondence problem is undecidable.
If and is decidable, then is decidable, by Computable many-one reductions transfer decidability and recognizability backward.
Proof
From the PCP instance build two context-free grammars over the alphabet consisting of the original symbols together with index symbols : Thus generates exactly the words , and generates exactly the words , for nonempty index sequences .
If is a PCP match, then so that common word lies in . Conversely, if a word lies in , its reversed index suffix uniquely determines the same index sequence on both sides, and removing that suffix leaves Hence the original PCP instance has a match if and only if .
The map from the PCP instance to the pair is total and computable by step 1.1. If intersection-emptiness for pairs of CFGs were decidable, step 2.1 and [L3] would make PCP decidable, contradicting [L2].
Therefore emptiness of the intersection of two CFGs is undecidable.
CFG universality is undecidable
Statement
The problem of deciding whether a context-free grammar generates all words over its terminal alphabet is undecidable.
Facts & Assumptions
Given: A coded deterministic one-tape Turing machine and an input word .
accepts exactly when it has an accepting computation history on , by Finite computation histories, halting computations, and divergence.
For the fixed pair , accepting computation histories admit an effective encoding, by For a fixed machine and input, valid accepting computation histories form a decidable language.
The acceptance problem is undecidable, by The Turing-machine acceptance problem is undecidable.
If and is decidable, then is decidable, by Computable many-one reductions transfer decidability and recognizability backward.
Proof
Choose the explicit finite configuration alphabet allowed by [L2], and encode a candidate history as alternating ordinary and reversed configuration words. Let be the set of words that are not accepting histories in this encoding. Malformed words and words with the wrong initial or accepting endpoint form regular languages. For an alleged adjacent pair , a pushdown automaton nondeterministically chooses that pair, pushes the first configuration, and compares it with the oppositely oriented second configuration while allowing exactly one of the finitely many local windows prescribed by a transition of . It accepts when no legal window explains the pair. Taking separate machines for the two parities and their finite union handles every adjacent pair. Thus histories containing an illegal transition form a context-free language, and so does their union with the two regular error languages. The construction is effective in the finite transition table, hence produces a CFG with .
By the definition of , the grammar is universal exactly when there is no accepting computation history of on . Using [L1], this is equivalent to
The construction of is effective by step 1.1. If CFG universality were decidable, then step 2.1 would decide , and hence decide by complementing the answer. That contradicts [L3].
Therefore CFG universality is undecidable.
CFG equivalence is undecidable
Statement
The CFG equivalence problem is undecidable.
Facts & Assumptions
Given: A context-free grammar over a terminal alphabet .
The CFG equivalence problem asks whether two CFGs generate the same language, by The CFG equivalence and ambiguity problems.
CFG universality is undecidable, by CFG universality is undecidable.
Proof
Let be a fixed grammar generating . Such a grammar is easy to write, for example with productions Then
Therefore a decision procedure for CFG equivalence would decide whether by comparing with the fixed universal grammar . That would decide CFG universality, contradicting [L2].
Hence CFG equivalence is undecidable.
CFG ambiguity is undecidable
Statement
The CFG ambiguity problem is undecidable.
Facts & Assumptions
Given: A PCP instance
A grammar is ambiguous exactly when some word in its language has two distinct leftmost derivations, by Ambiguous grammars, unambiguous grammars, and inherently ambiguous languages.
A PCP match is a nonempty index sequence with equal top and bottom concatenations, by The Post correspondence problem.
PCP is undecidable, by The Post correspondence problem is undecidable.
If and is decidable, then is decidable, by Computable many-one reductions transfer decidability and recognizability backward.
Proof
Choose fresh terminal symbols disjoint from the PCP alphabet, and build one grammar with start symbol and two branches: A leftmost derivation from yields exactly the words , and a derivation from yields the analogous words with the . The fresh reversed suffix uniquely determines the entire index sequence, so each branch is unambiguous.
If is a PCP match, then the word has one leftmost derivation beginning with and another beginning with . Hence the grammar is ambiguous by [L1].
Conversely, if the grammar is ambiguous, [L1] gives a word with two distinct leftmost derivations. Step 1.1 proves that neither the branch nor the branch has two derivations of one word, so one derivation begins with and the other with . The common terminal word has the form Freshness and unique parsing of the reversed suffix force and for every , so is a PCP match.
Steps 2.1 and 2.2 show that the constructed grammar is ambiguous if and only if the original PCP instance has a match. If CFG ambiguity were decidable, then [L4] and this equivalence would make PCP decidable, contradicting [L3].
Therefore CFG ambiguity is undecidable.
The regular, context-free, decidable, and recognizable language-class ladder
Definition
For a fixed finite alphabet , the language-class ladder used on this page records the containments
Here:
- regular means recognized by some DFA, by Regular languages;
- context-free means generated by some CFG, by The language generated by a CFG;
- decidable means decided by some Turing machine, and
- computably enumerable means recognizable by some Turing machine, by Languages recognized and decided by a Turing machine.
Remarks
-
On this page, "computably enumerable" and "recognizable" are synonymous.
-
This four-class ladder is not the classical Chomsky hierarchy. The classical hierarchy inserts the context-sensitive languages as its type- class; decidable languages are used here instead as a broader comparison class.
-
The hierarchy concerns classes of languages, not classes of machine descriptions.
The inclusions in the language-class ladder are proper
Statement
For every fixed finite alphabet with at least two symbols, the containments in The regular, context-free, decidable, and recognizable language-class ladder are all strict:
Facts & Assumptions
Given: The classes from The regular, context-free, decidable, and recognizable language-class ladder over a finite alphabet containing distinct symbols .
Every regular language satisfies the pumping property from The pumping lemma for regular languages.
Membership in a context-free language is decidable, by Context-free-language membership is decidable.
Every context-free language satisfies the pumping property from The pumping lemma for context-free languages.
is computably enumerable, by The Turing-machine acceptance problem is computably enumerable complete.
is undecidable, by The Turing-machine acceptance problem is undecidable.
Proof
If a language is regular, choose a DFA recognizing it. Make one CFG whose variables are the states of , whose start variable is the start state, whose productions are for each transition, and whose accepting states also have productions . Then the grammar generates exactly the words accepted by . Hence every regular language is context-free.
Every decidable language is recognizable by running its decider and accepting exactly when the decider accepts. Thus
The language is context-free, for example via the grammar . It is not regular: if it were regular, [L1] would give a pumping length , but cannot be pumped inside the first symbols without changing the number of 's and leaving the number of 's fixed. Therefore
Relabel the binary alphabet of injectively by the two chosen symbols . This computable letter-by-letter bijection preserves recognizability and decidability. By [L5] and [L6], the relabeled language over is computably enumerable but not decidable. Therefore
Every context-free language is decidable by [L2], so
The language is decidable by checking the three blocks and comparing their lengths. It is not context-free: if were a pumping length from [L3], then a pumping window of length at most in could meet at most two consecutive blocks and could not meet both -blocks. Pumping a nonempty part therefore changes at least one of the three required counts without changing all three equally, or destroys the block order. This contradicts [L3]. Hence
Steps 2.1, 4.1, and 2.2 prove that all three containments are strict over the fixed alphabet .
5 · Examples, counterexamples and false statements
FALSE: PCP permits reordering symbols inside a domino
Statement
In a PCP match, one may reorder the symbols inside a chosen domino before concatenating it.
Facts & Assumptions
Given: The one-domino PCP instance
A PCP match must satisfy equality of the literal top and bottom concatenations of the chosen domino sequence, by The Post correspondence problem.
Refutation
If one were allowed to reorder symbols inside the domino, the unique tile could be changed from to by swapping the bottom symbols, and then a one-tile sequence would look like a match.
In actual PCP, [L1] forbids that operation. The only nonempty sequences use the same domino some number of times, yielding top word and bottom word . Their first symbols are always different, so these words are never equal.
Therefore the claimed permission is false: PCP concatenates whole dominoes in the chosen order and does not allow symbol reordering within a tile.
FALSE: decidable CFLs have a decidable intersection-emptiness problem
Statement
Because every context-free language has decidable membership, there is an algorithm that decides from two CFGs whether their intersection is empty.
Facts & Assumptions
Given: Two context-free grammars and .
Membership in each context-free language is decidable, by Context-free-language membership is decidable.
The problem of deciding whether is undecidable, by Emptiness of the intersection of two CFGs is undecidable.
Refutation
Fact [L1] says that for any fixed word , one can decide separately whether and whether . That is a pointwise membership statement about the two languages themselves.
The claim in the statement is stronger: it asks for one algorithm that, from the grammar descriptions alone, decides whether some word lies in both languages. But [L2] says that this description-level problem is undecidable.
Hence the statement is false. Decidable membership for each individual CFL does not make the intersection-emptiness problem for pairs of CFGs decidable.