Skip to content
DAH

Computability, diagonalization and relativization

Turing machines, universality and undecidability; hierarchy theorems by diagonalization; oracles and the relativization, natural-proofs and algebrization barriers that limit what diagonalization can prove.

On this page16 sections
Why other work relies on it

The P versus NP problem, ACC⁰ lower bounds beyond NQP and the whole computational-complexity entry rely on these tools: every unconditional class separation known is a diagonalization, and the barrier results say which separations need something more.

Some questions no program can ever answer, and the same trick shows that more time lets you solve more.

  1. 1Programs can be written as data
  2. 2A program can run another program
  3. 3Flip its answer on its own code
  4. 4No program can decide halting
  5. 5Same trick separates time classes

Machines as data. A Turing machine is a simple, precise model of a computer. Its description can be written as a string, so a machine can be given another machine's description as input. A universal machine reads a description and an input and simulates the described machine. Simulation costs only a modest slowdown: a universal machine can simulate tt steps with roughly tlog⁡tt\log t steps (Hennie and Stearns).

Diagonalization. List all machines in a row and all inputs in a column, and write the output of each machine on each input in a table. Build a new machine DD that, on input MM (a machine's description), runs MM on itself and outputs the opposite. DD differs from the MM-th row at the diagonal entry, so DD is not in the list. Cantor used the same shape of argument to show that the real numbers cannot be listed.

Undecidability. Turing applied this to the halting set: the set of pairs (machine, input) such that the machine halts. It can be listed by running machines (so it is computably enumerable) but no machine decides it. Using reductions (translating one problem into another) one transfers undecidability to many questions. Rice's theorem says any nontrivial question about what a program computes, such as "does it ever output 5?", is undecidable.

Hierarchies. Diagonalization also separates resource classes. The time hierarchy theorem says that if gg grows a bit faster than ff (by more than a logarithmic factor), then there are problems solvable in time gg but not in time ff. There is a similar theorem for memory (space). Consequences include that P is strictly smaller than EXP (exponential time). The nondeterministic version is harder because a nondeterministic machine cannot cheaply flip its answer, so it needs a delayed form of the argument.

Ladner's theorem (1975) says that if P is not equal to NP, then there are problems in NP that are neither easy nor NP-complete, built by delayed diagonalization.

Barriers. An oracle is a black box that answers questions about a fixed set for free. Baker, Gill and Solovay (1975) showed there are oracles under which P equals NP and others under which it does not. Since diagonalization arguments typically still work when every machine gets the same oracle, they cannot resolve P versus NP. Related barriers are natural proofs (Razborov and Rudich, 1994) and algebrization (Aaronson and Wigderson, 2008). These explain why new ideas are needed, rather than saying the question is hopeless.

Go deeper

The full technical text.

What it is

A Turing machine MM computes a partial function on {0,1}∗\{0,1\}^*. Machines can be encoded as strings ⟨M⟩\langle M\rangle, and there is a universal machine UU with U(⟨M⟩,x)=M(x)U(\langle M\rangle,x)=M(x) that simulates tt steps of a multitape MM in O(tlog⁡t)O(t\log t) steps (Hennie–Stearns). Universality makes diagonalization possible: if a machine DD on input ⟨M⟩\langle M\rangle runs U(⟨M⟩,⟨M⟩)U(\langle M\rangle,\langle M\rangle) and flips the answer, then DD differs from every machine in the enumerated class. Turing (1936) used this to show the halting set HALT={⟨M,x⟩:M halts on x}\mathrm{HALT}=\{\langle M,x\rangle : M \text{ halts on } x\} is computably enumerable but undecidable.

Core results

  • Reductions and Rice's theorem. Many-one reductions A≤mBA\le_m B transfer undecidability; Rice's theorem says every nontrivial property of the partial function computed by a machine is undecidable. The recursion theorem (Kleene) lets a machine obtain its own description.
  • Hierarchy theorems. For time-constructible f,gf,g with f(n)log⁡f(n)=o(g(n))f(n)\log f(n)=o(g(n)), DTIME(f)⊊DTIME(g)\mathsf{DTIME}(f)\subsetneq\mathsf{DTIME}(g) (Hartmanis–Stearns 1965, sharpened by Hennie–Stearns). For space-constructible g≥log⁡ng\ge\log n and f=o(g)f=o(g), DSPACE(f)⊊DSPACE(g)\mathsf{DSPACE}(f)\subsetneq\mathsf{DSPACE}(g). The nondeterministic time hierarchy (Cook; Seiferas–Fischer–Meyer; Žák) needs lazy diagonalization, since a nondeterministic machine cannot cheaply flip a nondeterministic answer. Consequences: P≠EXP\mathsf{P}\ne\mathsf{EXP}, NL≠PSPACE\mathsf{NL}\ne\mathsf{PSPACE}, NP≠NEXP\mathsf{NP}\ne\mathsf{NEXP}.
  • Ladner's theorem (1975). If P≠NP\mathsf{P}\ne\mathsf{NP}, there are languages in NP∖P\mathsf{NP}\setminus\mathsf{P} that are not NP\mathsf{NP}-complete, built by "blowing holes" in SAT through a delayed diagonalization against all polynomial-time machines and reductions.

Barriers

An oracle machine MAM^A may query membership in AA at unit cost. Almost every diagonalization argument relativizes: it remains valid when all machines get the same oracle. Baker, Gill and Solovay (1975) built oracles with PA=NPA\mathsf{P}^A=\mathsf{NP}^A (take AA to be PSPACE\mathsf{PSPACE}-complete) and PB≠NPB\mathsf{P}^B\ne\mathsf{NP}^B, so no relativizing proof settles P versus NP. Two later barriers address the non-relativizing techniques. Razborov and Rudich (JCSS 1997) showed that a circuit lower bound proved via a property that is constructive and large (a "natural" property) against P/poly\mathsf{P/poly} would break pseudorandom functions of 2nε2^{n^{\varepsilon}} hardness. Aaronson and Wigderson (2009) defined algebrization, relativization with access to a low-degree extension A~\tilde A of the oracle, and showed that arithmetization-based results such as IP=PSPACE\mathsf{IP}=\mathsf{PSPACE} algebrize while resolving P versus NP, or proving NEXP⊄P/poly\mathsf{NEXP}\not\subset\mathsf{P/poly}, does not.

Williams' algorithmic method (2011) combines diagonalization with algorithms: a 2n−nδ2^{n-n^{\delta}}-time satisfiability algorithm for ACC0\mathsf{ACC}^0 circuits, together with the nondeterministic time hierarchy, gives NEXP⊄ACC0\mathsf{NEXP}\not\subset\mathsf{ACC}^0. The argument does not relativize and is not natural, and Murray and Williams (2018) extended it to NQP\mathsf{NQP}.

Techniques to master

Encoding machines and the universal simulation with its overhead; diagonalization, padding (translating separations upward and collapses downward); lazy and delayed diagonalization; oracle constructions by stage-wise diagonalization; the formal statements of each barrier and which known theorems evade which (for example IP=PSPACE\mathsf{IP}=\mathsf{PSPACE} does not relativize, while MAEXP⊄P/poly\mathsf{MA_{EXP}}\not\subset\mathsf{P/poly} does not relativize but does algebrize).

Standard references / Reading path

Sipser, Introduction to the Theory of Computation (Cengage, 3rd ed.), Parts 2–3 for computability, reductions and hierarchies; Arora–Barak, Computational Complexity: A Modern Approach (CUP 2009), Chapters 1–3 and 23 for diagonalization, Ladner's theorem, relativization and natural proofs; Soare, Turing Computability (Springer 2016) for the recursion-theoretic side (priority arguments, degrees). Then the original Baker–Gill–Solovay, Razborov–Rudich, Aaronson–Wigderson and Williams papers.

Where it bites

P versus NP is open in part because every technique known to separate classes relativizes, is natural, or algebrizes. The ACC⁰ problem, a super-polynomial ACC0\mathsf{ACC}^0 lower bound for a language in NP\mathsf{NP}, asks whether the diagonalization-plus-algorithms method can close the quasi-polynomial gap between NQP\mathsf{NQP} and NP\mathsf{NP} in the nondeterministic time hierarchy. Both are hosted under the computational-complexity entry.

Words on this page (12)
Words on this page
Turing machine
A very simple theoretical computer, a tape and a read-write head following fixed rules, used to define what computing means.
halting problem
The question of whether a given program will eventually stop on a given input; no program can answer it for all cases.
diagonalization
A proof technique that builds an object differing from every item in a list by changing the diagonal entries of a table.
undecidable
A yes/no question for which no program is guaranteed to always give the correct answer.
universal Turing machine
One machine that can simulate any other machine when given its description, like a general-purpose computer.
Rice's theorem
Any nontrivial question about what a program computes (as opposed to how it is written) is undecidable.
time hierarchy theorem
Given noticeably more time, a computer can solve problems it provably could not solve before.
oracle
A hypothetical black box that instantly answers questions about some fixed set, used to test which proof methods are robust.
P versus NP
The question of whether every problem whose answer can be checked quickly can also be solved quickly.
complexity class
A set of problems solvable within a given resource budget, such as polynomial time.
reduction
A translation of one problem into another, so that solving the second would solve the first; used to spread undecidability or hardness.
computably enumerable
A set whose members can be listed one by one by some program, even if no program can rule non-members out.
New to this? Read first (4)
New to this? Read first

Understanding map

map of the whole wiki →

What to read before Computability, diagonalization and relativization (left), and what builds on it: entries that depend on it and its open problems (right). Every box links to its page.

  1. Start with
  2. Then

Open problems & questions

No open problems or questions on this entry.

Progress timeline

  1. Jun 8, 2011
    NEXP ⊄ ACC⁰ by diagonalization plus algorithms

    Williams combined a faster ACC⁰-SAT algorithm with the nondeterministic time hierarchy (CCC 2011; J. ACM 2014; day approximate, as in the P versus NP entry).

    source
  2. Feb 1, 2009
    Algebrization barrier

    Aaronson and Wigderson showed that techniques relativizing with respect to low-degree extensions cannot resolve P versus NP (STOC 2008; ACM TOCT, February 2009).

    source
  3. Dec 1, 1975
    Relativization barrier

    Baker, Gill and Solovay gave oracles A, B with P^A = NP^A and P^B ≠ NP^B, so relativizing proofs cannot settle P versus NP.

    source
  4. Jan 1, 1975
    Ladner's theorem

    Ladner showed that if P ≠ NP there are NP-intermediate languages, via delayed diagonalization (J. ACM, January 1975).

    source
  5. May 1, 1965
    Time hierarchy theorem

    Hartmanis and Stearns defined time complexity classes and proved by diagonalization that more time decides more languages (Trans. AMS 117, 1965; month approximate).

    source