Documentation

CslibFrontier.Computability.Complexity.Classes.Hierarchy.NondeterministicSpace

The nondeterministic space hierarchy theorem #

Cslib.Complexity.nspaceDiagonal G is the set of words x of length n on which the description cut from the start of x (Cslib.Complexity.Diagonal.tinyCut) does not accept x, under the coding Turing.MultiTapeTM.Universal.eBit of bits, within the budget of G n bits for its encoded configurations (Turing.MultiTapeTM.Universal.BAccepts). Acceptance within a budget is reachability between configurations of bounded size, so the diagonal needs no clock.

A machine within S work-tape cells accepts exactly when its description accepts within the size bound Turing.MultiTapeTM.Universal.cfgSpaceBound of its configurations (Turing.MultiTapeTM.Universal.accepts_iff_bAccepts_descN). Let a nondeterministic machine recognize the diagonal within space c₁ * f n + c₂, where every c * f n + c is eventually below G n, and let 4 * log₂ n ≤ G n. That size bound is O(f n + log n), with a factor linear in the description, so it is eventually below G n (Cslib.Complexity.Diagonal.eventually_cfgSpaceBound_le). On its own description, padded to a doubly exponential length where it is tiny (Cslib.Complexity.Diagonal.tinyDesc), the machine accepts exactly when the diagonal rejects (Cslib.Complexity.nspaceDiagonal_notMem_NSPACE). This is the diagonal argument of Sipser, Theorem 9.3 for nondeterministic machines.

Conversely, the universal recognizer within a budget (Turing.MultiTapeTM.Universal.exists_recognizesInSpace_bAccepts) guesses a run of the decoded description, reading the input in place, and so recognizes the complement of the diagonal within space O(G n + log n) for a space-constructible G. By the Immerman–Szelepcsényi theorem [Imm88] [Sze87] the diagonal itself is then in NSPACE G when log₂ n ≤ G n (Cslib.Complexity.nspaceDiagonal_mem_NSPACE). Hence the nondeterministic space hierarchy Immerman, Corollary 4:

The gap f = o(g) and the lower bound log n ≤ g n are those of the deterministic theorem (Cslib.Complexity.DSPACE_ssubset_DSPACE).

Main definitions #

Main results #

References #

The nondeterministic diagonal within space G. The words x of length n on which the description cut from the start of x (Cslib.Complexity.Diagonal.tinyCut) does not accept x, under the coding Turing.MultiTapeTM.Universal.eBit of bits, within the budget of G n bits for its encoded configurations (Turing.MultiTapeTM.Universal.BAccepts).

theorem Cslib.Complexity.not_recognizesInSpace_nspaceDiagonal {f G : ℕ → ℕ} (hlog : ∀ (n : ℕ), 4 * n.log2 ≤ G n) (hfG : ∀ (c : ℕ), ∀ᶠ (n : ℕ) in Filter.atTop, c * f n + c ≤ G n) {k : ℕ} {State : Type} [Finite State] (ntm : Turing.MultiTapeNTM k Bool State) (c₁ c₂ : ℕ) :

The nondeterministic diagonal argument for space. If every c * f n + c is eventually below G n and 4 * log₂ n ≤ G n, no nondeterministic machine recognizes the diagonal within space c₁ * f n + c₂. The configurations of its description take O(f n + log n) bits, eventually within the budget G n; so on its own description, padded to a tiny one beyond that point, it accepts exactly when the diagonal rejects.

theorem Cslib.Complexity.nspaceDiagonal_notMem_NSPACE {f G : ℕ → ℕ} (hlog : ∀ (n : ℕ), 4 * n.log2 ≤ G n) (hfG : ∀ (c : ℕ), ∀ᶠ (n : ℕ) in Filter.atTop, c * f n + c ≤ G n) :

The nondeterministic diagonal within space G is not in NSPACE f when every c * f n + c is eventually below G n and 4 * log₂ n ≤ G n: a decider within space O(f) recognizes the diagonal within that space (Cslib.Complexity.not_recognizesInSpace_nspaceDiagonal).

The nondeterministic diagonal within space G is in NSPACE G, for a space-constructible G with log₂ n ≤ G n. The universal recognizer within a budget (Turing.MultiTapeTM.Universal.exists_recognizesInSpace_bAccepts) recognizes its complement within space O(G n + log n): the tiny description is decoded in logarithmic space and the budget G n written in unary within space O(G n). By the Immerman–Szelepcsényi theorem the complement of a problem so recognized is decided within the same space (Cslib.Complexity.compl_mem_NSPACE_of_recognizesInSpace).

The nondeterministic space hierarchy theorem #

theorem Cslib.Complexity.NSPACE_ssubset_NSPACE {f g : ℕ → ℕ} (hg : SpaceConstructible g) (hlog : ∀ (n : ℕ), n.log2 ≤ g n) (hfg : ∀ (c : ℕ), ∀ᶠ (n : ℕ) in Filter.atTop, c * f n + c ≤ g n) :

The nondeterministic space hierarchy theorem. If g is space-constructible, log₂ n ≤ g n, and every c * f n + c is eventually below g n, then NSPACE f is strictly contained in NSPACE g Immerman, Corollary 4, which Immerman credits to Fischer. The nondeterministic diagonal within space 4 * g separates the classes: it is in NSPACE g by the Immerman–Szelepcsényi theorem (Cslib.Complexity.nspaceDiagonal_mem_NSPACE), and not in NSPACE f by the diagonal argument (Cslib.Complexity.nspaceDiagonal_notMem_NSPACE).

Nondeterministic polylogarithmic space has a strict hierarchy: NSPACE (log₂ n ^ (k + 1)) ⊂ NSPACE (log₂ n ^ (k + 2)).

Nondeterministic logarithmic space is strictly within nondeterministic space log² n: NL = NSPACE (log₂ n) (Cslib.Complexity.NL_eq_NSPACE), and the nondeterministic diagonal within space 4 * log₂ n ^ 2 separates them.

Nondeterministic polynomial space has a strict hierarchy: NSPACE (n ^ k) ⊂ NSPACE (n ^ (k + 1)). The nondeterministic diagonal within space 4 * (n + 1) ^ (k + 1) separates them.

Nondeterministic logarithmic space is strictly within polynomial space Sipser, Corollary 9.6: NL ⊆ DSPACE (log₂ n ^ 2) by Savitch's theorem (Cslib.Complexity.NL_subset_DSPACE_log2_sq), which is strictly within DSPACE (log₂ n ^ 3) ⊆ PSPACE by the deterministic space hierarchy.