Many-one completeness of the halting problem Created 2026-09-24 Updated 2026-09-24
Every recursively enumerable set many-one reduces to the diagonal halting set. If a program halts exactly on , the S-m-n theorem produces from an index for a unary program that ignores its input and performs that computation on . Then
Conversely, a computable preimage of a recursively enumerable set is recursively enumerable.
Rice theorem: every nontrivial extensional property of programs computing partial computable functions has an undecidable index set. More precisely, take an acceptable effective enumeration of the unary partial computable functions. If contains some but not all of these functions, then
“Extensional” means that equality of partial functions, including their domains, preserves membership; no syntactic restriction on program codes is being considered.
We use two standard facts, stated explicitly. The diagonal halting set is undecidable. For the associated acceptable enumerations of -ary partial computable functions, with , the S-m-n theorem says that for every there is a total computable function such that
where means equality of defined values and equality of undefinedness. Thus fixed parameters in a program can be compiled into its index effectively.
Let be the nowhere-defined partial computable function. Choose a partial computable function whose membership in is opposite to that of ; this is possible by nontriviality. For each , construct the program
This is a uniform partial computation. Take an index for the binary partial computable function . The S-m-n theorem gives the total computable function with . Crucially,
Even when itself is undefined, the equality of partial functions remains correct. If , this gives a many-one reduction of to ; if , it gives a many-one reduction of to the complement of . A decision procedure for would therefore decide in either case, a contradiction.
The equivalent language formulation says that every nontrivial property of computably enumerable languages depending only on the recognized language has an undecidable index set. Apply the function formulation to the property of a partial computable function that its domain has the specified language property: every computably enumerable language occurs as such a domain.
The S-m-n theorem says that parameters can be compiled effectively into program indices: for a standard effective numbering, there is a total computable function with for partial computable functions of arguments.
Write , a recursively enumerable halting problem. If is recursively enumerable, make a program with parameter which ignores its input and runs a semidecision procedure for , halting when that procedure halts. By the S-m-n theorem its index is total computable and . Conversely, implies that is recursively enumerable by the previous construction. Thus .
Use uniform finite-stage enumerations and . Define a uniformly recursively enumerable set
The S-m-n theorem supplies a total computable index function with . If is finite of size , then , so is recursive. If is infinite, then for every a sufficiently late stage has both and , while no is ever enumerated. Hence , which is not recursive. Therefore . As usual the effective numbering indexes all programs; if malformed codes are included, send them to a fixed index of .
Fix an effective enumeration of the -ary partial recursive functions.
The S-m-n theorem says that program inputs can be compiled into an index: for every there is a total recursive such that
Here means that either both sides are undefined or both are defined and equal.
The recursion theorem says that every total recursive transformation of program indices has a semantic fixed point: some satisfies
The Rice theorem says that every nontrivial extensional property of programs computed by partial recursive functions is undecidable.
By the S-m-n theorem, there is a total recursive function such that
for all . Apply the recursion theorem to . It supplies an index for which
Consequently
Fix an acceptable effective enumeration of the -ary partial computable functions. The S-m-n theorem states that for every there is a total computable function such that
where means that both sides have the same value when defined and are otherwise both undefined.
The recursion theorem states that every total computable transformation of program indices has a semantic fixed point: there is an such that
Rice theorem says that every nontrivial extensional property of programs computing partial functions is undecidable. Equivalently, a nontrivial index set cannot be a computable set.
Let be such an index set. Replacing by its complement if necessary, assume that the nowhere-defined function has no index in . Since the property is nontrivial, choose an index . If membership in were decidable, we could decide the diagonal halting problem as follows. For each , define
By the S-m-n theorem, a total computable function produces an index for . If diverges, then is nowhere defined and . If it halts, then and extensionality gives . A decider for would therefore decide whether halts, a contradiction. Hence is undecidable.
Apply the S-m-n theorem to . It gives a total computable function such that
The recursion theorem supplies an index satisfying . Consequently
For each , let be an effectively obtained index of the partial function
The existence of the total computable index transformation follows from the S-m-n theorem. By the recursion theorem, some satisfies . Therefore its domain is
and hence
For the given effective enumeration of partial computable functions, the diagonal halting set is
A many-one reduction is a total computable function such that
The S-m-n theorem states that for every there is a total computable function satisfying
whenever either side is defined.
Suppose first that is recursively enumerable. Choose a program that halts exactly on inputs in , and let index a two-variable program that, on , ignores and runs that program on . By the S-m-n theorem,
is total computable and indexes the unary function
Therefore
Thus .
Conversely, suppose through a total computable . On input , compute and simulate machine on its own code. This procedure halts exactly when , equivalently exactly when . Hence is recursively enumerable. We have proved the many-one completeness of the halting problem:
Finally, use the stated fact that and define
Then , so . The total computable map satisfies
and therefore . This is a distinct representative of the halting many-one degree.