This is a classic theoretical computer science question about Savitch's theorem and the space complexity hierarchy. Let me provide a comprehensive proof and explanation.
Savitch's Theorem and PSPACE = NPSPACE
Main Result
Savitch's theorem states that NPSPACE = PSPACE, or more generally: NSPACE(f(n)) ⊆ SPACE((f(n))²) for f(n) ≥ log n.
Key Insight
The main idea is to convert an NTM (nondeterministic Turing machine) computation into a deterministic one using a recursive path-searching algorithm. Instead of exploring all branches of the computation tree, we use a recursive reachability algorithm that explores paths in a depth-first manner while carefully managing space.
The Recursive Reachability Algorithm
Let me describe this in detail:
Problem Setup:
- Given: NTM M accepting language L in space S(n)
- Goal: Deterministically decide if a string w ∈ L in space (S(n))²
Key Observation:
An NTM M accepts w iff there exists a path from the initial configuration to an accepting configuration in the configuration graph of M on input w.
Algorithm Idea:
We need to check if configuration C_final (accepting configuration) is reachable from C_initial (initial configuration) in the configuration graph.
Recursive Reachability(A, B, k) function:
This function checks whether configuration B is reachable from configuration A in at most 2^k steps of the NTM.
Reachability(A, B, k):
1. If k = 0:
- Check if A = B or A transitions to B in one step
- Return YES if so, NO otherwise
2. If k > 0:
- For each possible configuration M (that fits in S(n) space):
- If Reachability(A, M, k-1) = YES and
Reachability(M, B, k-1) = YES:
- Return YES
- Return NO
Space Analysis
The algorithm works by checking if we can reach the accepting configuration through intermediate configurations. Since an NTM using space S(n) can have at most c^(S(n)) distinct configurations for some constant c, and must halt within 2^(c·S(n)) steps to avoid looping, we need to search through a path of length at most 2^(c·S(n)). The recursive depth is logarithmic in this bound, requiring only O((S(n))²) space to store the recursion stack and intermediate configurations at each level. log₂(2^(c·S(n))) = c·S(n), so the recursion depth is c·S(n). At each recursion level, I store configurations A and B along with a candidate configuration M, each requiring O(S(n)) space. Since I'm enumerating possible configurations rather than storing them all simultaneously, and the recursion depth is linear in c·S(n), the total space needed is O(c·S(n)²) - the depth times the space per level. If k = 0, we check whether A equals B or transitions to B directly, then return. Otherwise, we iterate through each configuration M, first checking if A reaches M in k-1 steps. When that returns, we free its stack space and then check if M reaches B in k-1 steps. Since these calls happen sequentially rather than nested, the space on the recursion stack is reused between them.
The space at each recursion level is therefore O(S(n)) for storing a configuration, plus the space needed by the next recursive call. This gives us d(k) = O(S(n)) + d(k-1), since we only maintain one active branch on the stack at any given depth.
With k starting at O(S(n)) and decreasing by 1 at each level, the total space becomes O(S(n)) × O(S(n)) = O((S(n))²).
For the specific case where S(n) = O(log n), this yields O(log² n) space. The recursion depth is O(log n) and each level uses O(log n) space, giving us the quadratic relationship. To show NPSPACE equals PSPACE, I note that deterministic computation is a subset of nondeterministic computation, so PSPACE ⊆ NPSPACE immediately.
For the reverse direction, any language in NPSPACE accepted by an NTM using space S(n) can be decided using the reachability method, which operates in O((S(n))²) space. Since S(n) ≥ log n, this remains polynomial, placing the language in PSPACE.
The log² n bound becomes particularly important when examining NLOG and LOG, where the quadratic space overhead of the reachability approach becomes the defining factor in the relationship between these classes.
Savitch's Theorem: PSPACE = NPSPACE
Theorem Statement and Main Result
Savitch's Theorem: For any function f(n)≥logn:
NSPACE(f(n))⊆SPACE(f(n)
Corollary: PSPACE=NPSPACE
The key insight: deterministically simulate an NTM using a space-efficient recursive path-finding algorithm instead of exploring all branches.
The Reachability Problem
Configuration Graph Framework
For an NTM M on input w with space bound S(n):
- Configurations: A configuration encodes the tape contents, head position, and state
- Configuration graph: Directed graph where edges represent valid 1-step transitions
- Acceptance problem: Does there exist a path from Cinitial to Caccept?
Key observation: Since M uses space S(n), it has at most cS(n) possible configurations (for constant c depending on alphabet and state set). An NTM halts in at most steps.
Recursive Reachability Algorithm
Algorithm Definition
REACHABILITY(A, B, k):
/* Does a path exist from configuration A to B
in at most 2^k steps? */
Input: configurations A, B; recursion depth k
if k = 0 then
/* Base case: check direct transition */
if A = B or A →_M B (one step) then
return YES
else
return NO
end if
else /* k > 0 */
/* Recursive case: A → M → B in 2^(k-1) steps each */
for each possible configuration M of size ≤ S(n) do
if REACHABILITY(A, M, k-1) = YES then
if REACHABILITY(M, B, k-1) = YES then
return YES
end if
end if
end for
return NO
end if
Main Simulation Algorithm
SIMULATE(w):
/* Deterministically decide if NTM M accepts w */
S := S(|w|) /* Space used by M on w */
k := ⌈log₂(2^(c·S))⌉ = O(S) /* Recursion depth */
return REACHABILITY(C_initial, C_accept, k)
Space Complexity Analysis
Recursion Depth Calculation
For an NTM using space S(n):
\text{# of configurations} \leq c^{S(n)} = 2^{O(S(n))}
Setting kmax to satisfy 2k:
kmax=O(S(n))
We recurse from kmax down to k=0, giving recursion depth =O(S.
Space per Recursion Level
At each level k of recursion, we store:
| Item | Space |
|---|
| Configuration A | O(S(n)) |
| Configuration B | O(S(n)) |
| Configuration (tested) |
Space per level: O(S(n))
Total Space Complexity
By the recursion tree structure, sequential (not nested) recursive calls reuse the same stack space:
d(k)=Space at depth k+Space for deeper recursion
d(k)=O(S(n))+d(k−1)
d(kmax)=k
Total space: O(S(n)2)
Specific Case: LOG² n Space
For S(n) = O(log n) (NLOG)
If the original NTM uses space S(n)=O(logn):
\text{Recursion depth} &= O(\log n)\\
\text{Space per level} &= O(\log n)\\
\text{Total space} &= O(\log n) \times O(\log n) = \boxed{O(\log^2 n)}
\end{align}$$
This demonstrates: $\text{NLOG} \subseteq \text{LOG}^2$ (though equality with LOG is unknown).
---
## Formal Proof of PSPACE = NPSPACE
### Part 1: PSPACE ⊆ NPSPACE
Trivial: every deterministic TM is an NTM that never guesses.
### Part 2: NPSPACE ⊆ PSPACE
**Proof:**
Let $L \in \text{NPSPACE}$. Then $L$ is accepted by some NTM $M$ using space polynomial in $|w|$, say $S(n) = O(n^k)$ for some $k$.
By the reachability algorithm:
- We construct a **deterministic** algorithm using the REACHABILITY procedure
- The algorithm uses space:
$$\text{Space} = O(S(n)^2) = O(n^{2k}) = \text{polynomial}(n)$$
Therefore $L \in \text{PSPACE}$.
$$\Box$$
---
## Why This Approach Works
| Aspect | Explanation |
|--------|-------------|
| **No explosion** | We don't explore all $2^{O(S(n))}$ paths explicitly |
| **Binary search** | Recursively halving the path length reduces exponential to logarithmic overhead |
| **Reusable stack** | Sequential recursive calls don't require simultaneous storage |
| **Deterministic** | Never requires guessing; all configurations are formally tested |
---
## References
- Savitch, W. J. (1970). "Relationships between Nondeterministic and Deterministic Tape Complexities"
- Standard resource: Arora & Barak, *Computational Complexity: A Modern Approach*