Savitch's Theorem

For every space-constructible function $S(n) \geq \log n$,

$$ \mathbf{NSPACE}(S(n)) \subseteq \mathbf{SPACE}((S(n))^2). $$

As a corollary, $\mathbf{NPSPACE} = \mathbf{PSPACE}$.


Let $L \in \mathbf{NSPACE}(S(n))$ be a language decided by a non-deterministic Turing machine $M$ such that for any $x \in \{0, 1\}^n$, $M(x)$ uses at most $S(n)$ cells on its work tapes.

One can construct a configuration graph with at most $N = 2^{O(S(n))}$ vertices for the execution of $M$ on a fixed input $x$, where each vertex represents a configuration of $M$. This is because each configuration can be encoded in $O(S(n))$ bits: one only needs to store the contents of the $S(n)$ work-tape cells, the position of the input-tape head, the positions of the work-tape heads and the state register, using $O(S(n)) + O(\log n) + O(\log S(n)) + O(1) = O(S(n))$ bits in total. There is a directed edge from configuration $u$ to configuration $v$ if and only if $M$ can transition from $u$ to $v$ in a single step. One can assume without loss of generality that the graph has only one accepting configuration, by stipulating that $M$ must accept in a specific state.

Under these assumptions, whether $M$ has an accepting branch on $x$ is equivalent to whether $C_{\text{accept}}$ is reachable from $C_{\text{start}}$ in the graph.

Consider the recursive procedure $\operatorname{REACH?}(u, v, i)$ that returns true if there exists a path from $u$ to $v$ of length at most $2^i$ and false otherwise. Note the recursive relation

$$ \operatorname{REACH?}(u, v, i) = \exists w (\operatorname{REACH?}(u, w, i - 1) \land \operatorname{REACH?}(w, v, i - 1)). $$

Let $S_{N, i}$ denote the space complexity of $\operatorname{REACH?}(u, v, i)$ on a graph of $N$ vertices. This gives $S_{N, i} = S_{N, i - 1} + O(\log N)$, and hence $S_{N, \log N} = O(\log^2 N) = O((S(n))^2)$.