Space hierarchy theorem

From testwiki
Jump to navigation Jump to search

Template:Short descriptionIn 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),

𝖲𝖯𝖠𝖒𝖀(o(f(n)))𝖲𝖯𝖠𝖒𝖀(f(n)),

where SPACE stands for either DSPACE or NSPACE, and Template:Mvar refers to the little o notation.

Statement

Formally, a function f:β„•β„• is space-constructible if f(n)logn 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 Template:Mvar 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 Template:Mvar:

L={(M,10k):M uses space f(|M,10k|) and time 2f(|M,10k|) and M does not accept (M,10k)}

For any machine Template:Mvar that decides a language in space o(f(n)), Template:Mvar will differ in at least one spot from the language of Template:Mvar. Namely, for some large enough Template:Mvar, Template:Mvar will use space f(|M,10k|) on (M,10k) and will therefore differ at its value.

On the other hand, Template:Mvar is in 𝖲𝖯𝖠𝖒𝖀(f(n)). The algorithm for deciding the language Template:Mvar is as follows:

  1. On an input Template:Mvar, 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.
  2. If Template:Mvar is not of the form M,10k for some TM Template:Mvar, reject.
  3. Simulate Template:Mvar on input Template:Mvar 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.
  4. If Template:Mvar accepted Template:Mvar 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 Template:Mvar does not halt on the input Template:Mvar. That is, the case where Template:Mvar 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, Template:Mvar 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 Template:Mvar by modifying step 4 to:

Template:Mvar can not be decided by a TM using o(f(n)) cells. Assuming Template:Mvar can be decided by some TM Template:Mvar 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:

  1. If w=(M,10k) (for some large enough Template:Mvar) is not in L then Template:Mvar will accept it, therefore M rejects Template:Mvar, therefore Template:Mvar is in L (contradiction).
  2. If w=(M,10k) (for some large enough Template:Mvar) is in L then Template:Mvar will reject it, therefore M accepts Template:Mvar, therefore Template:Mvar 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 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:

Refinement of space hierarchy

If space is measured as the number of cells used regardless of alphabet size, then Template:Tmath 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 Template:Tmath.

Assume that f is space-constructible. SPACE is deterministic.

  • For a wide variety of sequential computational models, including for Turing machines, SPACE(f(n)-Ο‰(log(f(n)+n))) ⊊ SPACE(f(n)). This holds even if SPACE(f(n)-Ο‰(log(f(n)+n))) is defined using a different computational model than Template:Tmath because the different models can simulate each other with Template:Tmath space overhead.
  • For certain computational models, we even have SPACE(f(n)-Ο‰(1)) ⊊ SPACE(f(n)). In particular, this holds for Turing machines if we fix the alphabet, the number of heads on the input tape, the number of heads on the worktape (using a single worktape), and add delimiters for the visited portion of the worktape (that can be checked without increasing space usage). SPACE(f(n)) does not depend on whether the worktape is infinite or semi-infinite. We can also have a fixed number of worktapes if f(n) is either a SPACE constructible tuple giving the per-tape space usage, or a SPACE(f(n)-Ο‰(log(f(n)))-constructible number giving the total space usage (not counting the overhead for storing the length of each tape).

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 Template:Tmath space overhead, and under appropriate assumptions, just Template:Tmath space overhead (which may depend on the machine being simulated). 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 Template:Tmath. 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. The search starts at A and goes over configurations that lead to A. Because of determinism, this can be done in place and without going into a loop.

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.

Corollaries

Corollary 1

For any two functions f1, f2:β„•β„•, where f1(n) is o(f2(n)) and f2 is space-constructible, 𝖲𝖯𝖠𝖒𝖀(f1(n))𝖲𝖯𝖠𝖒𝖀(f2(n)).

This corollary lets us separate various space complexity classes. For any natural number k, the function nk is space-constructible. Therefore for any two natural numbers k1<k2 we can prove 𝖲𝖯𝖠𝖒𝖀(nk1)𝖲𝖯𝖠𝖒𝖀(nk2).

Corollary 2

NL ⊊ PSPACE.

Proof

Savitch's theorem shows that 𝖭𝖫𝖲𝖯𝖠𝖒𝖀(log2n), while the space hierarchy theorem shows that 𝖲𝖯𝖠𝖒𝖀(log2n)𝖲𝖯𝖠𝖒𝖀(n). The result is this corollary along with the fact that TQBF ∉ NL since TQBF is PSPACE-complete.

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.

Corollary 3

PSPACE ⊊ EXPSPACE.

This last corollary shows the existence of decidable problems that are intractable. In other words, their decision procedures must use more than polynomial space.

Corollary 4

There are problems in Template:Sans-serif requiring an arbitrarily large exponent to solve; therefore Template:Sans-serif does not collapse to Template:Sans-serif(nk) for some constant k.

Corollary 5

SPACE(n) β‰  PTIME.

To see it, assume the contrary, thus any problem decided in space O(n) is decided in time O(nc), and any problem L decided in space O(nb) is decided in time O((nb)c)=O(nbc). Now 𝖯:=kℕ𝖣𝖳𝖨𝖬𝖀(nk), thus P is closed under such a change of bound, that is kℕ𝖣𝖳𝖨𝖬𝖀(nbk)𝖯, so L𝖯. This implies that for all b,𝖲𝖯𝖠𝖒𝖀(nb)𝖯𝖲𝖯𝖠𝖒𝖀(n), but the space hierarchy theorem implies that 𝖲𝖯𝖠𝖒𝖀(n2)⊈𝖲𝖯𝖠𝖒𝖀(n), and Corollary 6 follows. Note that this argument neither proves that 𝖯⊈𝖲𝖯𝖠𝖒𝖀(n) nor that 𝖲𝖯𝖠𝖒𝖀(n)⊈𝖯, 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. It is currently unknown which fail(s) but conjectured that both do, that is that 𝖲𝖯𝖠𝖒𝖀(n) and 𝖯 are incomparable -at least for deterministic space.[2] This question is related to that of the time complexity of (nondeterministic) linear bounded automata which accept the complexity class 𝖭𝖲𝖯𝖠𝖒𝖀(n) (aka as context-sensitive languages, CSL); so by the above CSL is not known to be decidable in polynomial time -see also Kuroda's two problems on LBA.

See also

References

Template:Reflist