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.
Diagonalization and the Halting Problem
1 · Prerequisites
- Construction of the Natural Numbers
- Countability and Uncountability
- Decidable, Recognizable, and Enumerable Languages
- Finite Counting, Factorials and Binomial Coefficients
- Formal Languages, Encodings, and Decision Problems
- Linear Recurrences and Rational Generating Functions
- Relations, Functions, and Quotients
- Robust Machine Models and Universal Computation
- The ZFC Axioms and the Basic Set Constructions
- Turing Machines, Configurations, and Computation
2 · Summary
This page isolates the first sharp gap between recognition and decision. It starts with the coded acceptance language , proves that acceptance is recognizable, and then turns the same coding machinery against any putative decider by a type-correct diagonal self-application argument. That produces the standard acceptance undecidability theorem and then the halting problem itself by a direct reduction.
The second half records three consequences that matter later. The complement of halting gives an explicit unrecognizable language, the busy beaver function captures the qualitative outgrowth of computable running-time bounds, and two further direct reductions show that total halting and language equivalence of machines already sit beyond the decidable frontier without appealing yet to Rice's theorem.
3 · Logical flowchart
4 · Definitions, theorems and proofs
The Turing-machine acceptance problem
Definition
Fix the chosen machine code from A fixed effective binary encoding of deterministic one-tape Turing machines. For a binary word , write For binary words , write If , where each , put
The Turing-machine acceptance problem is the language
Remarks
-
The member of is the binary code of a machine/input pair, not the machine or word themselves.
-
The empty input word is allowed: if , then .
The Turing-machine acceptance problem is recognizable
Statement
The language of The Turing-machine acceptance problem is recognizable.
Facts & Assumptions
Given: The coded language .
A binary word lies in exactly when it has the form for some coded deterministic one-tape Turing machine and some input word that accepts, by The Turing-machine acceptance problem .
The chosen machine encoding has a total decoder that either reconstructs the unique coded machine or reports malformed input, by A fixed effective binary encoding of deterministic one-tape Turing machines.
There is a deterministic one-tape interpreter that, from a valid pair consisting of a machine code and a configuration code, returns the same configuration code in the halting case and the unique one-step successor in the nonhalting case, by A fixed interpreter can execute one encoded machine step.
The well-formed machine-description language is decidable, by Well-formed deterministic one-tape Turing machine descriptions form a decidable language.
A language is recognizable when some deterministic Turing machine accepts exactly its members, while nonmembers may be rejected or may diverge, by Decidable and recognizable languages.
Proof
Build a deterministic one-tape machine that, on input , first parses as a candidate pair . If the pair parse fails, it rejects. It next runs the decider from [L4] on ; if is not a well-formed machine code, it rejects. If is valid, it uses [L2] to recover the coded machine . It then parses as a candidate word code , rejects if that parse fails, and also rejects if some recovered symbol lies outside the input alphabet . From the recovered word , the machine writes the canonical initial configuration code of on input .
The machine now repeatedly invokes the one-step interpreter from [L3] on the pair consisting of the recovered code and the current configuration code. After each return, it reads the decoded state component of that configuration code. If the state is accepting, accepts. If the state is rejecting, rejects. Otherwise it feeds the returned successor configuration back into the next interpreter call.
By [L3], each iteration in step 2.1 maintains exactly the current configuration of on . Therefore accepts precisely when eventually reaches an accepting configuration on , rejects when reaches a rejecting configuration, and diverges when diverges. By [L1] and [L5], this means that recognizes .
A hypothetical decider for yields a diagonal self-application machine
Statement
Assume that some deterministic one-tape Turing machine decides . For a binary word , let be the word over obtained by replacing each bit by and each bit by . Then there exists a deterministic one-tape Turing machine with input alphabet such that, for every coded deterministic one-tape Turing machine whose input alphabet contains ,
Facts & Assumptions
Given: A deterministic one-tape Turing machine deciding .
A binary word belongs to exactly when it is a coded pair whose decoded machine accepts the decoded input word , by The Turing-machine acceptance problem .
The chosen machine encoding has a total decoder, so machine codes can be checked and decoded effectively, by A fixed effective binary encoding of deterministic one-tape Turing machines.
A decider halts on every input and answers membership correctly, by Decidable and recognizable languages.
Proof
Construct a deterministic one-tape machine with input alphabet as follows. On input a word , first check whether every symbol is or and, if so, recover the unique binary word obtained by replacing by and by . Use [L2] to decode as a candidate machine code. If is malformed or decodes to a machine whose input alphabet does not contain both symbols and , reject. Otherwise form the coded pair and run on that binary input. If accepts, then loop forever; if rejects, then accept. This machine is effective because the recoding , the machine-code decoder, and the call to are all effective, and [L3] guarantees that the call to halts.
Let be any coded deterministic one-tape Turing machine whose input alphabet contains , and put . On input , the preliminary checks in step 1.1 succeed, and the query sent to is exactly . By [L1] and the correctness of the decider from [L3], accepts that query exactly when accepts . Because does the opposite of 's answer, accepts exactly when does not accept .
Step 2.1 is exactly the required diagonal property. Therefore the constructed machine exists.
The Turing-machine acceptance problem is undecidable
Statement
The language of The Turing-machine acceptance problem is not decidable.
Facts & Assumptions
Given: The acceptance language .
A language is decidable exactly when some deterministic Turing machine halts on every input and answers membership correctly, by Decidable and recognizable languages.
If a deterministic Turing machine decides , then there exists a deterministic one-tape machine with input alphabet such that, for every coded machine whose input alphabet contains , by A hypothetical decider for yields a diagonal self-application machine.
Every coded deterministic one-tape machine has one definite chosen code , by A fixed effective binary encoding of deterministic one-tape Turing machines.
Proof
Assume for contradiction that is decidable. Then [L1] gives a deterministic decider for . Apply [L2] to that and obtain the corresponding machine . Because itself has input alphabet , the diagonal equivalence from [L2] applies to .
Let , whose existence is guaranteed by [L3]. Substituting into [L2] yields . That is impossible.
The contradiction in step 2.1 discharges the assumption from step 1.1. Therefore is undecidable.
The halting problem
Definition
Use the same pairing convention and input-word code as in The Turing-machine acceptance problem . The halting problem is the language
Equivalently, when the computation of on has either an accepting or a rejecting halting history in the sense of Finite computation histories, halting computations, and divergence.
Remarks
-
The distinction between and is exactly the distinction between halting and accepting.
-
Because rejection counts as halting, one always has .
The halting problem is recognizable and undecidable
Statement
The language of The halting problem is recognizable but not decidable.
Facts & Assumptions
Given: The halting language .
A binary word lies in exactly when it has the form and the decoded machine halts on the decoded input word , by The halting problem .
The chosen machine encoding has a total decoder that either reconstructs the unique coded machine or reports malformed input, by A fixed effective binary encoding of deterministic one-tape Turing machines.
There is a deterministic one-tape interpreter that, from a valid pair consisting of a machine code and a configuration code, returns the same configuration code in the halting case and the unique one-step successor in the nonhalting case, by A fixed interpreter can execute one encoded machine step.
The well-formed machine-description language is decidable, by Well-formed deterministic one-tape Turing machine descriptions form a decidable language.
A language is recognizable when some deterministic Turing machine accepts exactly its members, and it is decidable when such a machine also halts on every input, by Decidable and recognizable languages.
A machine either halts on an input by reaching an accepting or rejecting configuration, or else diverges on that input, by Finite computation histories, halting computations, and divergence.
The acceptance language is undecidable, by The Turing-machine acceptance problem is undecidable.
Proof
Recognizability: build a deterministic one-tape machine that, on input , first parses as a candidate pair . If the pair parse fails, it rejects. It next runs the decider from [L4] on ; if is not a well-formed machine code, it rejects. If is valid, it uses [L2] to recover the coded machine . It then parses as a candidate word code , rejects if that parse fails, and also rejects if some recovered symbol lies outside the input alphabet . From the recovered word , the machine writes the canonical initial configuration code of on input .
Undecidability: if were decidable, then by [L5] there would be a deterministic decider for . Given an input for , effectively build a machine that ignores its own input, simulates on , halts and accepts if that simulation accepts, and otherwise loops forever. Then . Indeed, halts on the blank input exactly in the case that accepts . So the assumed decider would decide , which [L7] forbids.
The machine now repeatedly invokes the one-step interpreter from [L3] on the pair consisting of the recovered code and the current configuration code. After each return, it reads the decoded state component of that configuration code. If the state is accepting or rejecting, accepts. Otherwise it feeds the returned successor configuration back into the next interpreter call.
By [L3], each iteration in step 2.1 maintains exactly the current configuration of on . Therefore accepts precisely when eventually reaches an accepting or rejecting configuration on , and diverges when diverges. By [L1], [L5], and [L6], this means that recognizes .
Steps 3.1 and 1.2 prove recognizability and undecidability, respectively. Therefore is recognizable and undecidable.
The complement of the halting problem is not recognizable
Statement
The complement of is not recognizable.
Facts & Assumptions
Given: The halting language .
The language is recognizable and undecidable, by The halting problem is recognizable and undecidable.
A language is decidable if and only if both it and its complement are recognizable, by A language is decidable if and only if it and its complement are recognizable.
Proof
Suppose for contradiction that the complement of were recognizable. Then both and its complement would be recognizable, by [L1].
Applying [L2] to step 1.1 would make decidable. That contradicts the undecidability clause of [L1].
Therefore the complement of is not recognizable.
There exists a language that is not recognizable
Statement
There exists a language that is not recognizable.
Facts & Assumptions
Given: The halting language .
The complement of is not recognizable, by The complement of the halting problem is not recognizable.
The symbol names a language, by The halting problem .
Recognizability is a property of languages, by Decidable and recognizable languages.
Proof
By [L2], the complement of is itself a language.
By [L1], that language is not recognizable, and [L3] identifies this as exactly the existence claim wanted.
The step-count busy beaver function relative to the chosen machine coding
Definition
Fix the chosen machine code from A fixed effective binary encoding of deterministic one-tape Turing machines. For , let be the maximum number of steps taken by any coded deterministic one-tape Turing machine such that:
- the code length satisfies , and
- halts on the empty input word .
If no such machine exists, define .
Thus with the empty-set convention above.
Remarks
-
This is a coding-dependent busy beaver function: changing the chosen machine syntax changes the finite search space for each .
-
The maximization is over halting time on the blank input, not over number of nonblank symbols written.
The busy beaver function eventually dominates every total computable function
Statement
For every total computable function , with inputs and outputs encoded by their canonical binary numerals, there exists such that
Facts & Assumptions
Given: A total computable function , with inputs and outputs encoded by their canonical binary numerals.
Under the canonical binary-numeral encodings from the Statement, some deterministic Turing machine halts on every input and outputs the binary numeral , by Computable and partial computable functions and Partial functions computed by a machine under fixed encodings.
is the maximum halting time on blank input among all machines whose chosen code has length at most , by The step-count busy beaver function relative to the chosen machine coding.
The chosen machine code records a finite transition table in a finite tuple of binary words, by A fixed effective binary encoding of deterministic one-tape Turing machines.
Proof
By [L1], choose a deterministic machine that, on input , halts with output . For each , build a new machine that has the binary digits of hard-wired into a straight-line prefix of its finite control, using one additional state per written digit and then handing control to a fixed simulation of . On blank input, writes the binary numeral for onto its tape, runs on that input until halts with output , and then runs a fixed binary-counter routine for iterations before halting. Therefore halts on the blank input, and its total running time is strictly greater than .
Write . The construction in step 1.1 uses at most states and a fixed tape alphabet, for constants depending only on and the fixed routines. In the concrete code of [L3], this gives transition triples, and every state numeral in those triples has length . The self-delimiting tuple encoding therefore gives constants such that . Since , the right-hand side is , so there exists such that whenever . For those , the machine is among the competitors counted by .
If , then step 2.1 puts inside the size budget for , and step 1.1 gives a halting time larger than . By [L2], the maximum is therefore at least that halting time, so . Thus eventually dominates .
The busy beaver function is not computable
Statement
The busy beaver function is not computable.
Facts & Assumptions
Given: The busy beaver function .
Every total computable function is eventually dominated by , by The busy beaver function eventually dominates every total computable function.
"Computable" means total computable in the sense of Computable and partial computable functions.
The function named is the busy beaver function of The step-count busy beaver function relative to the chosen machine coding.
Proof
Suppose for contradiction that were computable in the sense of [L2]. Then the function would also be total computable.
Applying [L1] to the computable function yields an such that for every . That is impossible.
Therefore is not computable.
Halting on every input is not recognizable
Statement
Let Then is not recognizable.
Facts & Assumptions
Given: The totality language .
The complement of is not recognizable, by The complement of the halting problem is not recognizable.
The chosen machine encoding is effective, so from a code one can effectively build a new coded machine whose finite control contains and , by A fixed effective binary encoding of deterministic one-tape Turing machines.
Recognizability means acceptance by some deterministic Turing machine on exactly the language members, by Decidable and recognizable languages.
is the language of coded pairs on which the decoded machine halts on the decoded input, by The halting problem .
Proof
First decide whether the input is a valid code , including whether is over 's input alphabet. This is effective by the chosen decoders. If it is malformed, map to the code of a fixed machine that halts on every input; such a is outside . For a valid pair, effectively build a machine with input alphabet as follows. On input , the machine simulates on for exactly steps. If the simulation has not halted by then, halts and accepts. If the simulation has halted within those steps, then enters an infinite loop. This construction is effective by [L2].
For a valid pair, if never halts on , then every finite step-bounded simulation in step 1.1 remains nonhalting, so halts on every input . Conversely, if halts on after exactly steps, then for every input with the machine detects that halting event during its first simulated steps and therefore loops forever. Thus the reduction preserves membership in the complement of for valid pairs. The fixed total-machine output in the malformed case preserves membership there as well.
Suppose for contradiction that were recognizable. On any input , compute the corresponding total-machine or code from step 1.1 and run the assumed recognizer for on that code. By step 2.1, this would recognize the full complement of , including malformed codes, contradicting [L1]. Therefore is not recognizable, by [L3].
Language equivalence of Turing machines is undecidable
Statement
Let Then is undecidable.
Facts & Assumptions
Given: The machine-equivalence language .
A deterministic machine recognizes a language exactly when it accepts precisely the words in that language, by Languages recognized and decided by a Turing machine.
The chosen machine encoding is effective, so one can effectively build new coded machines from old codes and fixed finite control schemes, by A fixed effective binary encoding of deterministic one-tape Turing machines.
The halting language is undecidable, by The halting problem is recognizable and undecidable.
A language is decidable exactly when some deterministic Turing machine halts on every input and answers membership correctly, by Decidable and recognizable languages.
Proof
Fix once and for all a coded deterministic machine that accepts every input. Given an instance of , use [L2] to build a machine that ignores its own input, simulates on , accepts every input if that simulation ever halts, and otherwise loops forever on every input.
If halts on , then every input to eventually triggers acceptance, so [L1] gives . If does not halt on , then accepts no input at all, so . Therefore .
Suppose for contradiction that were decidable. Then step 2.1 would let that decider decide , contradicting [L3]. Hence is undecidable, by [L4].
5 · Examples, counterexamples and false statements
FALSE: undecidable means no individual instance can be answered
Statement
If a language is undecidable, then no specific instance of it can ever be answered correctly.
Facts & Assumptions
Given: The acceptance problem .
The language is undecidable, by The Turing-machine acceptance problem is undecidable.
A member of is a coded machine/input pair on which the machine accepts the input, by The Turing-machine acceptance problem .
Refutation
Let be the machine that immediately enters its accepting state on every input. Then, by [L2], the specific coded pair lies in , and this yes-answer is completely explicit.
Step 1.1 shows that at least one individual instance of is easy to answer, while [L1] says the whole language is still undecidable. So undecidability cannot mean that every particular instance is beyond analysis; it means only that no single algorithm decides all instances.
FALSE: diagonalization requires a machine to read its physical source text
Statement
The diagonal contradiction needs a machine to read its own physical source text or manuscript.
Facts & Assumptions
Given: The chosen coding and the diagonal construction for .
The library has fixed an explicit binary code for each deterministic one-tape Turing machine, by A fixed effective binary encoding of deterministic one-tape Turing machines.
The diagonal machine against a hypothetical decider works by feeding that decider the coded self-application instance and then doing the opposite, by A hypothetical decider for yields a diagonal self-application machine.
A universal Turing machine exists for the chosen code syntax, so coded machine descriptions can be interpreted mechanically, by A universal Turing machine exists for the chosen coding.
Refutation
By [L1] and [L3], the data needed for self-reference are only a finite description string and a fixed interpreter for that string. Nothing in those items mentions any physical source file, manuscript, or external text artifact.
The actual diagonal step in [L2] uses the coded pair , not a literal reading of source text. So the contradiction is carried entirely by effective encoding and simulation.
Sources
- Richard Zach, Sets, Logic, Computation: An Open Introduction to Metalogic
- EECS 376 Course Notes, Part 6: Computability
- A. M. Turing, On Computable Numbers, with an Application to the Entscheidungsproblem
- Stan Nelson, Computability: Undecidable Problems
- John Watrous, Introduction to the Theory of Computing, Lecture 17: More undecidable languages; reductions
- Adam Yedidia and Scott Aaronson, A Relatively Small Turing Machine Whose Behavior Is Independent of Set Theory