In computational complexity theory, the space hierarchy theorems are separation results that show that both deterministic and nondeterministic machines can solve more problems in (asymptotically) more space, subject to certain conditions. For example, a deterministic Turing machine can solve more decision problems in space n log n than in space n. The somewhat weaker analogous theorems for time are the time hierarchy theorems. The foundation for the hierarchy theorems lies in the intuition that with either more time or more space comes the ability to compute more functions (or decide more languages). The hierarchy theorems are used to demonstrate that the time and space complexity classes form a hierarchy where classes with tighter bounds contain fewer languages than those with more relaxed bounds. Here we define and prove the space hierarchy theorem. The space hierarchy theorems rely on the concept of space-constructible functions. The deterministic and nondeterministic space hierarchy theorems state that for all space-constructible functions f(n) and all g(n)∈o(f(n)),
𝖲𝖯𝖠𝖢𝖤(g(n))⊊𝖲𝖯𝖠𝖢𝖤(f(n)), where SPACE stands for either DSPACE or NSPACE, and o refers to the little o notation.
Statement Formally, a function f:ℕ⟶ℕ is space-constructible if f(n)≥log n and there exists a Turing machine which computes the function f(n) in space O(f(n)) when starting with an input 1n, where 1n represents a string of n consecutive 1s. Most of the common functions that we work with are space-constructible, including polynomials, exponents, and logarithms. For every space-constructible function f:ℕ⟶ℕ, there exists a language L that is decidable in space O(f(n)) but not in space o(f(n)).
Proof The goal is to define a language that can be decided in space O(f(n)) but not space o(f(n)). The language is defined as L:
L={ (⟨M⟩,10k):M uses space ≤f(|⟨M⟩,10k|) and time ≤2f(|⟨M⟩,10k|) and M does not accept (⟨M⟩,10k) }
For any machine M that decides a language in space o(f(n)), L will differ in at least one spot from the language of M. Namely, for some large enough k, M will use space ≤f(|⟨M⟩,10k|) on (⟨M⟩,10k) and will therefore differ at its value. On the other hand, L is in 𝖲𝖯𝖠𝖢𝖤(f(n)). The algorithm for deciding the language L is as follows:
On an input x, compute f(|x|) using space-constructibility, and mark off f(|x|) cells of tape. Whenever an attempt is made to use more than f(|x|) cells, reject. If x is not of the form ⟨M⟩,10k for some TM M, reject. Simulate M on input x for at most 2f(|x|) steps (using f(|x|) space). If the simulation tries to use more than f(|x|) space or more than 2f(|x|) operations, then reject. If M accepted x during this simulation, then reject; otherwise, accept. Note on step 3: Execution is limited to 2f(|x|) steps in order to avoid the case where M does not halt on the input x. That is, the case where M consumes space of only O(f(x)) as required, but runs for infinite time. The above proof holds for the case of PSPACE, but some changes need to be made for the case of NPSPACE. The crucial point is that while on a deterministic TM, acceptance and rejection can be inverted (crucial for step 4), this is not possible on a non-deterministic machine. For the case of NPSPACE, L needs to be redefined first:
L={ (⟨M⟩,10k):M uses space ≤f(|⟨M⟩,10k|) and M accepts (⟨M⟩,10k) }
Now, the algorithm needs to be changed to accept L by modifying step 4 to:
If M accepted x during this simulation, then accept; otherwise, reject. L can not be decided by a TM using o(f(n)) cells. Assuming L can be decided by some TM M using o(f(n)) cells, and following from the Immerman–Szelepcsényi theorem, L‾ can also be determined by a TM (called M‾) using o(f(n)) cells. Here lies the contradiction, therefore the assumption must be false:
If w=(⟨M‾⟩,10k) (for some large enough k) is not in L‾ then M will accept it, therefore M‾ rejects w, therefore w is in L‾ (contradiction). If w=(⟨M‾⟩,10k) (for some large enough k) is in L‾ then M will reject it, therefore M‾ accepts w, therefore w is not in L‾ (contradiction).
Comparison and improvements The space hierarchy theorem is stronger than the analogous time hierarchy theorems in several ways:
It only requires s(n) to be at least log n instead of at least n. It can separate classes with any asymptotic difference, whereas the time hierarchy theorem requires them to be separated by a logarithmic factor. It only requires the function to be space-constructible, not time-constructible. It only requires f(n) to be space-constructible, with no constraint on the constructability of g(n). However, it is known from results in axiomatic complexity theory that the theorem is false if f(n) is not required to be space-constructible. It seems to be easier to separate classes in space than in time. Indeed, whereas the time hierarchy theorem has seen little remarkable improvement since its inception, the nondeterministic space hierarchy theorem has seen at least one important improvement by Viliam Geffert in his 2003 paper "Space hierarchy theorem revised". This paper made several generalizations of the theorem:
It relaxes the space-constructibility requirement. Let s be a nondeterministically fully space-constructible function. Let f(n) be an arbitrary Ω(s(n)) function, and g(n) be a computable o(s(n)) function. These functions need not be space-constructible or even monotone increasing. Then 𝖣𝖲𝖯𝖠𝖢𝖤(f(n))⊊𝖣𝖲𝖯𝖠𝖢𝖤(g(n)) and 𝖭𝖲𝖯𝖠𝖢𝖤(f(n))⊊𝖭𝖲𝖯𝖠𝖢𝖤(g(n)). It identifies a unary language, or tally language, which is in one class but not the other. In the original theorem, the separating language was arbitrary. It does not require s(n) to be at least log n; it can be any nondeterministically fully space-constructible function.
Refinement of space hierarchy If space is measured as the number of cells used regardless of alphabet size, then 𝖲𝖯𝖠𝖢𝖤(f(n))=𝖲𝖯𝖠𝖢𝖤(O(f(n))) because one can achieve any linear compression by switching to a larger alphabet. However, by measuring space in bits, a much sharper separation is achievable for deterministic space. Instead of being defined up to a multiplicative constant, space is now defined up to an additive constant. However, because any constant amount of external space can be saved by storing the contents into the internal state, we still have 𝖲𝖯𝖠𝖢𝖤(f(n))=𝖲𝖯𝖠𝖢𝖤(f(n)+O(1)). Assume that f is space-constructible. SPACE is deterministic.
… excerpt ends here. Continue reading the full article.