This lesson proves that the halting problem is not computable, and introduces the main tool for transferring undecidability from one problem to another: many-one reductions. With them, the undecidability of the halting problem propagates to many other questions about programs — halting on a fixed input, totality, emptiness of the domain — and, outside computability theory, to problems of number theory, group theory and logic.
3.1 The halting set
The halting set, or halting problem, is
The set is the general halting set.
The notation , read “zero jump”, comes from the theory of the Turing jump: is the jump of the empty set. The restriction to the diagonal makes the diagonal argument direct; the general halting set has the same degree of difficulty, as shown below.
The set is not computable.
Suppose is computable. Consider the following algorithm : on input , decide whether ; if so, enter an infinite loop; otherwise, halt with output . By Proposition 1.6, computes a partial computable function, so it has an index , and for every ,
For , this gives , a contradiction.
This is Cantor’s diagonal argument applied to the table whose rows are the partial functions : the algorithm differs from row at column , by converging where it diverges and diverging where it converges. The same argument is presented in the course on countability in a slightly different form, through partial functions without total extensions (Corollary 6.8 of “Diagonalization and computation”).
3.2 Many-one reductions
Let . A many-one reduction of to is a total computable function such that for all ,
We write if such an exists, and if and .
The reduction transforms each question ”?” into a question ”?” with the same answer. When is moreover injective, one speaks of a one-one reduction, written .
- The relation is reflexive and transitive.
- if and only if .
- If and is computable, then is computable. Equivalently, if and is not computable, then is not computable.
- The identity reduces to . If reduces to and reduces to , then is total computable and .
- The same works: .
- is total computable.
To show that a set is not computable, it therefore suffices to reduce a non-computable set, typically , to . Most reductions from are built with the SMN theorem: from , one computes the index of a program whose behavior depends on whether converges.
- .
- , and .
- and , where .
In particular, none of these sets is computable.
- reduces to . Conversely, let be the function of Example 2.4, with for all . Then , so reduces to . (The function is total computable, since the inverses of the pairing function are.)
- With the same , the function is total if and nowhere defined otherwise. So reduces to both sets, and also to , which proves the first half of item 3.
- For the second half, let be total computable, given by Corollary 2.3, such that
This is a definition by cases with a computable condition (Proposition 1.4). If , then for every , and is total. If , then for all large , and is not total. So reduces to .
The second half of item 3 is stronger than it looks. The lesson on computably enumerable sets shows that is not computably enumerable, and that sets reducible to a computably enumerable set are computably enumerable. Hence is not computably enumerable; and by item 2 of Proposition 3.4, its complement is not either. Totality is strictly harder than halting, a fact made precise by the arithmetic hierarchy.
3.3 Undecidable problems in mathematics
Reductions from the halting problem show that many natural mathematical problems are undecidable. The following results are admitted; each is proved by coding computations into the problem considered.
- The Entscheidungsproblem. The set of (codes of) valid formulas of first-order logic is not computable (Church, Turing, 1936). Later work showed that a language with a single binary relation symbol suffices.
- The word problem for groups. There is a finitely presented group for which the set of words equal to the identity is not computable (Novikov, 1955; Boone, 1959).
- Hilbert’s tenth problem. The set of polynomial equations with integer coefficients having a solution in integers is not computable (Matiyasevich, 1970, completing work of Davis, Putnam and Robinson). More precisely, every computably enumerable set (in the sense of the next lesson) is Diophantine, and therefore reduces to the solvability of Diophantine equations.
3.4 Exercises
Show that if is computable and , , then . What happens if or ?
Solution
Fix and , and let if and otherwise; is total computable and reduces to . If , then forces , since no lies in ; similarly, forces .
Show that is not computable.
Solution
Let be total computable with if , and undefined otherwise; it exists by Corollary 2.3, since the right-hand side is a partial computable function of . Then , so reduces to the set.
Let . Show that and .
Solution
The reduction of Proposition 3.5 sends to an index of a total function, whose domain is infinite, and to an index of the nowhere defined function. The reduction of item 3 sends to an index of a total function, and to an index of a function whose domain is , a finite initial segment of .
3.5 Notes and references
Turing proved in 1936 that no machine decides whether a given machine is circle-free, and deduced the unsolvability of the Entscheidungsproblem; Church obtained the latter independently with the λ-calculus. Many-one reducibility was introduced by Post in 1944, in the paper that founded the study of computably enumerable sets and their degrees. Davis’ survey and Matiyasevich’s book on Hilbert’s tenth problem, and Lyndon and Schupp’s book on combinatorial group theory, present the undecidability results listed above.
- A. M. Turing, On computable numbers, with an application to the Entscheidungsproblem, Proceedings of the London Mathematical Society (2) 42 (1936), 230–265.
- A. Church, A note on the Entscheidungsproblem, Journal of Symbolic Logic 1 (1936), 40–41.
- E. L. Post, Recursively enumerable sets of positive integers and their decision problems, Bulletin of the American Mathematical Society 50 (1944), 284–316.
- M. Davis, Hilbert’s tenth problem is unsolvable, American Mathematical Monthly 80 (1973), 233–269.
- Y. V. Matiyasevich, Hilbert’s Tenth Problem, MIT Press, 1993.
- R. C. Lyndon and P. E. Schupp, Combinatorial Group Theory, Springer, 1977.