Documentation

CslibFrontier.Computability.Complexity.Classes.Oracle.Space

Polynomial time relative to an oracle in polynomial space #

Relative to an oracle language decided within polynomial space, polynomial time and nondeterministic polynomial time are within polynomial space Arora and Barak, Theorem 3.7: NP^A ⊆ NPSPACE = PSPACE for A ∈ PSPACE.

A computation in polynomial time relative to A is the clocked run, with every coin fixed to false, of a finite oracle machine (Cslib.Probability.IsOraclePPTOn.exists_fin_run_pure_false). The run is simulated instruction by instruction, answering each query with the decider of A on the request, which is no longer than the clock (Turing.MultiTapePTM.exists_computableInO_run). So the space is polynomial, while the time charges the decider of A once per instruction (Cslib.Complexity.ComputableInPolyTimeWithOracle.exists_computableInO, Cslib.Complexity.PWithOracle_subset_PSPACE).

For NP relative to A, Cslib.Complexity.mem_PSPACE_of_isVerifier and Cslib.Complexity.NPWithOracle_subset_PSPACE follow from closure of PSPACE under polynomially bounded existential quantification (Cslib.Complexity.setOf_exists_mem_PSPACE).

Main results #

References #

PSPACE through explicit time and space bounds #

theorem Cslib.Complexity.exists_computableInO_of_mem_PSPACE {α : Type} {enc : α ↪ List Bool} {L : Set α} (hL : L ∈ PSPACE enc) :
∃ (T : α → ℕ) (S : α → ℕ), Turing.MultiTapeTM.PolyBounded (fun (a : α) => (enc a).length) S ∧ ∃ (f : α → Bool), Turing.MultiTapeTM.ComputableInO f enc Turing.MultiTapeTM.encBool T S ∧ ∀ (a : α), a ∈ L ↔ f a = true

A problem in PSPACE has a decider within explicit bounds, the space polynomial in the length of the encoded instance.

theorem Cslib.Complexity.mem_PSPACE_of_computableInO {α : Type} {enc : α ↪ List Bool} {L : Set α} {f : α → Bool} {T S : α → ℕ} (hf : Turing.MultiTapeTM.ComputableInO f enc Turing.MultiTapeTM.encBool T S) (hS : Turing.MultiTapeTM.PolyBounded (fun (a : α) => (enc a).length) S) (hL : ∀ (a : α), a ∈ L ↔ f a = true) :
L ∈ PSPACE enc

A decider within polynomial space puts a problem in PSPACE.

Certificate search in polynomial space. A problem with a verifier decidable within polynomial space and certificates of polynomial length is in PSPACE, by closure of PSPACE under polynomially bounded existential quantification (Cslib.Complexity.setOf_exists_mem_PSPACE).

Oracles in polynomial space #

theorem Cslib.Complexity.ComputableInPolyTimeWithOracle.exists_computableInO {α β : Type} {enc : α ↪ List Bool} {A : Set (List Bool)} {f : α → β} {output : β ↪ List Bool} (hA : A ∈ PSPACE Turing.MultiTapeTM.encBits) (hf : ComputableInPolyTimeWithOracle A f enc output) :
∃ (T : α → ℕ) (S : α → ℕ), Turing.MultiTapeTM.PolyBounded (fun (a : α) => (enc a).length) S ∧ Turing.MultiTapeTM.ComputableInO f enc output T S

Oracle polynomial time within polynomial space. Relative to an oracle language in PSPACE, a function computable in polynomial time relative to it is computable within space polynomial in the length of the encoded input.

P relative to an oracle in PSPACE is within PSPACE.

NP relative to an oracle in PSPACE is within PSPACE Arora and Barak, Theorem 3.7: the verifier runs within polynomial space, and its certificates are searched within polynomial space.