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.
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), where SPACE stands for either DSPACE or NSPACE, and o refers to the little o notation.
and there exists a Turing machine which computes the function
Most of the common functions that we work with are space-constructible, including polynomials, exponents, and logarithms.
The goal is to define a language that can be decided in space
The algorithm for deciding the language L is as follows: Note on step 3: Execution is limited to
steps in order to avoid the case where M does not halt on the input x.
Now, the algorithm needs to be changed to accept L by modifying step 4 to: L can not be decided by a TM using
Here lies the contradiction, therefore the assumption must be false: The space hierarchy theorem is stronger than the analogous time hierarchy theorems in several ways: 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: If space is measured as the number of cells used regardless of alphabet size, then
because one can achieve any linear compression by switching to a larger alphabet.
However, because any constant amount of external space can be saved by storing the contents into the internal state, we still have
The proof is similar to the proof of the space hierarchy theorem, but with two complications: The universal Turing machine has to be space-efficient, and the reversal has to be space-efficient.
One can generally construct universal Turing machines with
For the reversal, the key issue is how to detect if the simulated machine rejects by entering an infinite (space-constrained) loop.
Simply counting the number of steps taken would increase space consumption by about
At the cost of a potentially exponential time increase, loops can be detected space-efficiently as follows:[1] Modify the machine to erase everything and go to a specific configuration A on success.
Use depth-first search to determine whether A is reachable in the space bound from the starting configuration.
It can also be determined whether the machine exceeds a space bound (as opposed to looping within the space bound) by iterating over all configurations about to exceed the space bound and checking (again using depth-first search) whether the initial configuration leads to any of them.
This corollary lets us separate various space complexity classes.
This could also be proven using the non-deterministic space hierarchy theorem to show that NL ⊊ NPSPACE, and using Savitch's theorem to show that PSPACE = NPSPACE.
This last corollary shows the existence of decidable problems that are intractable.
In other words, their decision procedures must use more than polynomial space.
There are problems in PSPACE requiring an arbitrarily large exponent to solve; therefore PSPACE does not collapse to DSPACE(nk) for some constant k. To see it, assume the contrary, thus any problem decided in space
, as to reach a contradiction we used the negation of both sentences, that is we used both inclusions, and can only deduce that at least one fails.