Math 2.0

Computer science Computational complexity: resources and classes Theorem

Time hierarchy theorem

Builds on Time complexityMultitape Turing machinePBig O notation

Statement

Let f,g ⁣:ℕ→ℕf, g \colon \N \to \N be time-constructible functions. Here ff is time-constructible when f(n)≥nf(n) \ge n and the binary form of f(n)f(n) can be computed from 1n1^n in O(f(n))O(f(n)) steps. Suppose that f(n)log⁡f(n)=o(g(n))f(n) \log f(n) = o(g(n)), in big O notation. Then DTIME(f(n))⊊DTIME(g(n)),\mathrm{DTIME}(f(n)) \subsetneq \mathrm{DTIME}(g(n)), where DTIME(t(n))\mathrm{DTIME}(t(n)) is the class of languages decided by deterministic multitape Turing machines in time O(t(n))O(t(n)).

Remarks

The proof is a diagonalization. A machine DD, on input ww, simulates the machine encoded by ww on input ww for about g(∣w∣)g(\abs{w}) steps and answers the opposite. A universal machine simulates tt steps of any fixed multitape machine in O(tlog⁡t)O(t \log t) steps. So every machine running in time O(f(n))O(f(n)) is fully simulated on long enough inputs, and it cannot decide the same language as DD. Juris Hartmanis and Richard Stearns proved a first version of the theorem in 1965.

Consequence: P is strictly contained in EXPTIME, the class ⋃kDTIME(2nk)\bigcup_k \mathrm{DTIME}(2^{n^k}). Indeed P⊆DTIME(2n)⊊DTIME(22n)\mathrm{P} \subseteq \mathrm{DTIME}(2^n) \subsetneq \mathrm{DTIME}(2^{2n}). Time-constructibility cannot be dropped: the Borodin gap theorem gives computable ff with DTIME(f(n))=DTIME(2f(n))\mathrm{DTIME}(f(n)) = \mathrm{DTIME}(2^{f(n)}).

Going deeper

For a student

The theorem gives the separation P≠EXPTIME\mathrm{P} \ne \mathrm{EXPTIME}, one of few known unconditional separations. It says nothing about P versus NP, since NP is defined by another resource, nondeterministic time. A version for nondeterministic time also holds, with a different and subtler proof. Diagonalization proofs of this kind relativize, which is why the same method cannot settle P versus NP.

Reading path

To understand this page from the ground up, read these 5 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Big O notation concept
  2. Multitape Turing machine concept
  3. P concept
  4. Time complexity concept
  5. Time hierarchy theorem statement

Further reading

  1. Web https://en.wikipedia.org/wiki/Time_hierarchy_theorem
About this page
TagA6D1D67GHA
URIm2://A6D1D67GHA
Kindstatement, theorem
WritingW0 stub
MSC68Q15
StatusThis copy of the site has no build data. Run m2 status A6D1D67GHA.
AboutTime complexity
UsesTime complexity, Multitape Turing machine, P, Big O notation
Same as
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.