Asymptotic upper bound: g is O(f) in the sense that there exist constants c > 0 and
n₀ such that g n ≤ c * f n for all n ≥ n₀.
Instances For
Space used by TM M on input w within n steps: the number of distinct tape cells
visited by the head during the first n + 1 steps of execution.
Instances For
TM M runs in space f(n) if it is a decider and uses at most f(|w|) tape cells on
every input w of length n, whenever it has reached a halting configuration.
Instances For
A nondeterministic Turing machine: a 7-tuple (Q, Σ, Γ, δ, q₀, qAccept, qReject) where
the transition function δ : Q × Γ → 𝒫(Q × Γ × Direction) may yield multiple successor
configurations.
- blank : Γ
- inputAlpha : Set Γ
- blank_not_in_inputAlpha : self.blank ∉ self.inputAlpha
- δ : Q → Γ → Set (Q × Γ × TuringMachine.Direction)
- q₀ : Q
- qAccept : Q
- qReject : Q
Instances For
Initial configuration of NTM M on input w: state q₀, head at position 0, and
tape containing w followed by blanks.
Instances For
A configuration is accepting if its state equals qAccept.
Instances For
A configuration is rejecting if its state equals qReject.
Instances For
A configuration is halting if it is either accepting or rejecting.
Instances For
Single-step nondeterministic transition relation: c₁ is non-halting, and c₂ arises
from some (q', b, d) ∈ δ(state, symbol) by updating state, head position (left/right),
and writing b to the current cell.
Instances For
branch is a valid computation branch for M on w: it starts at the initial
configuration, takes a valid nondeterministic step whenever non-halting, and stays put
once halted.
Instances For
Space used along a single NTM branch within n steps: number of distinct tape cell
positions visited by the head.
Instances For
The language of NTM M: all strings over inputAlpha that are accepted.
Instances For
A technical lifting lemma: even if the NTM M does not a priori have a finite state
type, we can still witness InNSPACE f A. (Placeholder; the proof is deferred.)
Two equal-length strings x and y differ in exactly one symbol: there is a unique
position i where they disagree, and they agree elsewhere.
Instances For
LADDER_DFA B u v holds iff there is a ladder from u to v whose every entry is
accepted by DFA B. This is the language LADDER_DFA from Sipser, used as an example of
a problem in NSPACE(n) hence in PSPACE.
Instances For
A halting configuration is a fixed point of the TM step function.
Once a TM run reaches a halting configuration at step k, all subsequent steps
remain in that same halting configuration.
A TM running for n steps cannot use more than n + 1 tape cells (it visits at most
one new cell per step, plus the starting cell).
After the machine has halted at step k, the space used does not grow with
additional steps n ≥ k.
Time–Space relationship (1/2) (Sipser, Theorem 8.5): for t(n) ≥ n,
TIME(t(n)) ⊆ SPACE(t(n)). A TM that runs in time t cannot use more than t + 1
cells of tape.
Corollary (Sipser): P ⊆ PSPACE. Any language decidable in polynomial time is
decidable in polynomial space.
If a TM returns to the same configuration at two distinct steps i < j, then its
computation is periodic with period j - i from step i onward.
If a TM enters a non-halting configuration repetition (same config at distinct steps
i < j), then it loops forever and never halts.
A tape cell p that the head has never visited during the first n steps still
contains its original symbol.
Two configurations at steps i and j are equal whenever they agree on state, head
position, and tape contents at every cell in the visited region S. (Outside S the
tape contents agree because no cell was ever visited.)
Time–Space relationship (2/2) (Sipser, Theorem 8.5): for t(n) ≥ n,
SPACE(t(n)) ⊆ ⋃_c TIME(c^{t(n)}) = TIME(2^{O(t(n))}). The bound comes from the fact
that there are at most |Q| · t(n) · |Γ|^{t(n)} distinct configurations of a TM using
t(n) cells, so any halting machine must halt within that many steps.
Theorem (Time–Space relationships, Sipser Theorem 8.5). For t(n) ≥ n:
TIME(t(n)) ⊆ SPACE(t(n)), andSPACE(t(n)) ⊆ ⋃_c TIME(c^{t(n)}) = TIME(2^{O(t(n))}).
NTIME(t(n)) ⊆ SPACE(t(n)) (Sipser): a nondeterministic machine running in time
t can be simulated by a deterministic machine using space t. (Placeholder; proof
deferred.)
The free (unquantified) variables of a QBF: the variables of the body that are not
captured by any enclosing ∃ or ∀.
Instances For
A QBF is fully quantified (a sentence) when it has no free variables.
Instances For
Boolean semantics for QBF: ∃ x ψ evaluates to ψ[x:=true] ∨ ψ[x:=false], and
∀ x ψ evaluates to ψ[x:=true] ∧ ψ[x:=false].
Instances For
A QBF is True when it evaluates to true under the (irrelevant for fully
quantified formulas) default assignment.
Instances For
The language TQBF = {ψ | ψ is a fully-quantified Boolean formula that is true}.
TQBF is the canonical PSPACE-complete problem.
Instances For
Monotonicity of O(·): if f is O(g₁) and eventually g₁ ≤ g₂, then f is also
O(g₂).
NP ⊆ PSPACE (Sipser, Lecture 17). Every NP language is in PSPACE: combine
NP ⊆ NTIME(n^k) with NTIME ⊆ SPACE.
The "formula game" semantics of a QBF: the existential player wins on ψ from
assignment σ iff at each ∃ x she can pick a value of x, and at each ∀ x she wins
for both values of x, ultimately making the body true.
Instances For
Formula Game ↔ QBF evaluation: the existential player wins on ψ from σ
exactly when ψ.eval σ = true.
Specialization of existsPlayerWins_iff_eval to the default assignment: the
existential player wins on ψ iff ψ is true.
Claim (Sipser, Lecture 19): the language {⟨ψ⟩ | the ∃-player has a forced win on ψ} equals TQBF.
Reachability in at most b steps (used in Savitch's theorem proof): c₁ can
yield c₂ in at most b nondeterministic steps.
Instances For
CanYield c₁ c₂ 0 is exactly c₁ = c₂.
CanYield is monotone in the step budget: enlarging the budget by one preserves
reachability.
General monotonicity: if b ≤ b', then CanYield … b implies CanYield … b'.
Core of Savitch's theorem (Sipser, Theorem 8.5): given an NTM N running in
space g, construct a deterministic TM M recognizing the same language that decides
membership using space O(g²) via the recursive CANYIELD procedure. (Placeholder.)
Packaging of can_yield_dtm: from an NTM in space g we obtain a DTM in space g²
that decides the same language.
An encoding of QBFs as strings over alphabet Γ: an injective encoder/decoder pair
that uses non-blank symbols, with the standard round-trip laws.
- encode_injective : Function.Injective self.encode
Instances For
The TQBF language encoded over Γ: the set of strings that encode a fully
quantified true Boolean formula.
Instances For
State type for the TQBF-recognizing NTM: a control bit (scan/accept/reject) paired with a buffer storing the input read so far.
Instances For
Decidable equality on TQBFState Γ, inherited from Fin 3 × List Γ.
A (degenerate) NTM that reads its input into a buffer, decodes it as a QBF, and
accepts iff the QBF is fully quantified and true. Used as a witness that
tqbfLanguage ∈ NSPACE(n).
Instances For
The NTM tqbfNTM enc recognizes exactly the encoded TQBF language.
The TQBF-recognizing NTM runs in linear space O(n): it only sweeps over the input
once. Combined with tqbfNTM_language this places TQBF in NSPACE(n).
TQBF ∈ PSPACE (Sipser, Lecture 17). Since TQBF is in NSPACE(n) and
NPSPACE = PSPACE by Savitch, TQBF lies in PSPACE.
Number of bits needed to encode a configuration of a spacebound-space TM running
on input w: state + tape contents + head position.
Instances For
Number of recursion levels in the TQBF reduction: one level per bit of space.
Instances For
A trivial conjunction x_{n-1} ∧ x_{n-2} ∧ … ∧ x_0 ∧ True used as a placeholder
body when building the TQBF formula.
Instances For
The variables of tqbfBaseBody n are exactly {0, 1, …, n-1}.
Quantifying q with quantifyHalving … n removes the variables 0, …, n-1 from
the free-variable set.
Given a TM M, input w, and a space bound, construct a QBF whose truth is
equivalent to M accepting w in space spacebound. This is the Sipser construction
underlying the reduction A ≤ₚ TQBF for the PSPACE-hardness of TQBF.
Instances For
The constructed QBF buildTQBFFormula M w spacebound is a sentence: every variable
is quantified.
Correctness of the TQBF reduction: the QBF buildTQBFFormula M w spacebound is
true iff M accepts w, under the assumption that M halts within spacebound tape
cells. (Placeholder.)
The reduction function w ↦ ⟨φ_{M,w}⟩ mapping inputs of a PSPACE machine M to
encoded QBFs.
Instances For
The TQBF reduction function is polynomial-time computable when M runs in
polynomial space. This is the key efficiency lemma for PSPACE-hardness of TQBF.
Restatement: tqbfReductionFn enc M g is polynomial-time computable.
TQBF is PSPACE-hard (Sipser, Theorem 8.9): every PSPACE language polynomial-time
reduces to TQBF via the construction w ↦ ⟨φ_{M,w}⟩.
Theorem (TQBF is PSPACE-complete) (Sipser, Theorem 8.9). TQBF is in PSPACE and every PSPACE language reduces to it in polynomial time.
An encoding of Generalized Geography instances (G, a) (a digraph with a starting
node) as strings over alphabet Γ.
- V : Type
- decEqV : DecidableEq self.V
- encode_injective : Function.Injective self.encode
Instances For
The Generalized Geography language GG = {⟨G, a⟩ | Player I has a forced win on G starting at a}, encoded over Γ.
Instances For
State type for the GG-recognizing NTM: a control bit plus a buffer holding the input read so far.
Instances For
The GG-recognizing NTM: scans the input, decodes it as a digraph (G, a), and
accepts iff Player I has a forced win in Generalized Geography on G from a.
Instances For
The NTM ggNTM enc recognizes exactly the encoded GG language.
The GG-recognizing NTM runs in linear space (just stores its input). (Placeholder.)
GG ∈ PSPACE (Sipser, Lecture 19). Generalized Geography is in PSPACE, by the NSPACE(n) recognizer combined with Savitch.
The Sipser TQBF→GG reduction: build a Generalized Geography instance whose Player-I
forced wins correspond exactly to truth of the QBF ψ. (Uses choice to witness the
existence of an appropriate digraph.)
Instances For
Correctness of the TQBF→GG reduction: Player I has a forced win on the
constructed graph iff ψ is a true sentence. (Placeholder.)
The string-level reduction from encoded QBFs to encoded GG instances.
Instances For
The TQBF→GG reduction function is polynomial-time computable. (Placeholder.)
The TQBF→GG reduction is correct on the language level: w ∈ TQBF ↔ f(w) ∈ GG.
TQBF ≤ₚ GG: TQBF polynomial-time reduces to Generalized Geography.
GG is PSPACE-hard (Sipser, Lecture 19). Every PSPACE language reduces to GG via
TQBF.
Theorem (GG is PSPACE-complete) (Sipser, Lecture 19). Generalized Geography is in PSPACE and is PSPACE-hard.