TheoremComplete

Undecidability of the Halting Problem

The undecidability of the halting problem, proved by Turing in 1936, is one of the most fundamental results in mathematical logic and computer science. It establishes absolute limits on what can be computed.


Statement

Theorem5.1Undecidability of the Halting Problem

There is no Turing machine HH that, given an encoding M,w\langle M, w \rangle of a Turing machine MM and input ww, correctly decides whether MM halts on input ww. In other words, the set HALT={M,w:M halts on w}\mathrm{HALT} = \{\langle M, w \rangle : M \text{ halts on } w\} is not decidable.

Proof

Suppose for contradiction that HH is a total Turing machine deciding HALT. Construct a new machine DD: on input M\langle M \rangle, DD runs H(M,M)H(\langle M, \langle M \rangle \rangle); if HH accepts (meaning MM halts on M\langle M \rangle), then DD loops forever; if HH rejects, then DD halts.

Now consider DD running on its own description D\langle D \rangle:

  • If DD halts on D\langle D \rangle, then H(D,D)H(\langle D, \langle D \rangle \rangle) accepts, so DD loops. Contradiction.
  • If DD does not halt on D\langle D \rangle, then H(D,D)H(\langle D, \langle D \rangle \rangle) rejects, so DD halts. Contradiction.

In either case we reach a contradiction, so HH cannot exist. \square


Consequences

ExampleSemantic Properties are Undecidable

The halting problem's undecidability immediately implies that many other questions about Turing machines are undecidable: "Does MM accept any input?", "Is the language of MM finite?", "Do M1M_1 and M2M_2 compute the same function?" All reduce from the halting problem.

RemarkComputational Universality

The proof exploits the ability of Turing machines to simulate other Turing machines (universality). This same self-referential structure appears in Gödel's incompleteness theorems. The connection is deep: undecidable problems correspond to independent statements in formal systems.