Native visited-space PSPACE-completeness of SPACETM (after Arora–Barak Exercise 4 §3) #
Arora and Barak (2007 draft, Chapter 4, Section 4.3, display (2) on printed p. 79 / PDF p. 95 and
Exercise 4 §3 on printed p. 89 / PDF p. 105) define the canonical space-bounded acceptance problem
$$\mathrm{SPACETM} = \{\langle M, w, 1^n \rangle : \text{DTM } M \text{ accepts } w \text{ in space } n\}$$
and show that it is PSPACE-complete under polynomial-time many-one reductions.
This module establishes the native visited-space formalization of SPACETM and its
PSPACE-completeness in this repository's multi-tape Turing machine model, where space counts the
number of distinct work-tape cells visited by the work-tape heads during the run
(Turing.MultiTapeNTM.RunsInSpace and Turing.MultiTapeTM.Universal.simSpace), whereas Arora and
Barak's textbook model counts ever-nonblank cells (see results/arora-barak-2007.md row 4.16).
We represent instances as a structured record Cslib.Complexity.SPACETMInstance with a machine
description machine : Desc, an input bitstring input : List Bool, and a space bound
space : ℕ encoded in unary (encSPACETMInstance).
- Visited-space acceptance (
SPACETMInstance.Accepts,SPACETM.desc_mem_iff): An instancea : SPACETMInstanceaccepts at steptwhensimSpace a.machine (a.input.map eBit) t ≤ a.spaceanduniversal (a.machine, a.input.map eBit, t) = ([eBit true], true)— equivalently, when the visited-cell-budgeted universal simulatorTuring.MultiTapeTM.Universal.spaceBoundedUniversalreturns([eBit true], true). On the descriptiondesc eS eBit tmof any binary machinetm,⟨desc eS eBit tm, x, n⟩ ∈ SPACETMholds unconditionally if and only if at some stept, the run path visits at mostnwork-tape cells andtmhas halted onxwith output[true](SPACETM.desc_mem_iff). - Configuration-count clock and
PSPACEmembership (SPACETM.mem_PSPACE): Any simulation ofa.machineona.input.map eBitvisiting at mosta.spacework-tape cells has configurations encoded withina.cfgBudget = O(|d| · (n + 1) + |x|)bits (SPACETMInstance.cfgSpaceBound_le_cfgBudget), so it can visit at most2 ^ (a.cfgBudget + 1) - 1distinct configurations before repeating a configuration or halting (Turing.MultiTapeTM.Universal.exists_simSpace_le_and_universal_eq_true_iff). RunningspaceBoundedUniversalfor2 ^ (a.cfgBudget + 1)steps within visited-cell budgeta.spacetherefore decidesSPACETMin polynomial space (SPACETM.mem_iff_accepts_clock,SPACETMInstance.computableInPolySpace_decider). PSPACE-hardness and completeness (SPACETM.pspaceHard,SPACETM.pspaceComplete): Every problemA ∈ DSPACE enc pfor a polynomial-time unary functionpreduces toSPACETMin polynomial time viaa ↦ ⟨desc eS eBit tm, enc a, c₁ * p |enc a| + c₂⟩(SPACETM.polyTimeReducible), quantifying over every source typeαand encodingenc : α ↪ List Bool. SincePSPACE enc = ⋃ k, DSPACE enc (· ^ k),SPACETMisPSPACE-complete in the native visited-space model.
Main definitions #
Cslib.Complexity.SPACETMInstance,Cslib.Complexity.encSPACETMInstance: structured instances(machine, input, space)withspaceencoded in unary.Cslib.Complexity.SPACETMInstance.cfgBudget: linear bound on the encoded bit-length of simulated configurations visiting at mostspacework-tape cells.Cslib.Complexity.SPACETMInstance.Accepts,Cslib.Complexity.SPACETM: acceptance within the visited work-tape cell budgeta.spaceand the decision problemSPACETM.Cslib.Complexity.SPACETMInstance.decider: the clocked polynomial-space decider usingspaceBoundedUniversal.
Main results #
Cslib.Complexity.SPACETM.mem_iff_accepts_clock:a ∈ SPACETMiffa.Accepts (2 ^ (a.cfgBudget + 1)).Cslib.Complexity.SPACETM.desc_mem_iff: on the description of any machinetm,⟨desc eS eBit tm, x, n⟩ ∈ SPACETMifftmhalts onxwith output[true]at some steptwhose run path visits at mostnwork-tape cells.Cslib.Complexity.SPACETM.desc_mem_iff_of_runsInSpace: whentm.RunsInSpace x n, membership inSPACETMis halting with output[true].Cslib.Complexity.SPACETM.mem_PSPACE:SPACETM ∈ PSPACE encSPACETMInstance(native visited-space model).Cslib.Complexity.SPACETM.polyTimeReducible,Cslib.Complexity.SPACETM.pspaceHard,Cslib.Complexity.SPACETM.pspaceComplete: native visited-spacePSPACE-completeness ofSPACETMunder polynomial-time many-one reductions.
References #
An instance of the canonical space-bounded acceptance problem SPACETM in the native
visited-space model after Arora and Barak, Chapter 4, Section 4.3, display (2) and
Exercise 4 §3:
machine: a multi-tape Turing machine descriptiond : Desc,input: a binary input wordx : List Bool,space: a visited work-tape cell budgetn : ℕ(encoded in unary byencSPACETMInstance).
- machine : Turing.MultiTapeTM.Universal.Desc
Description of the simulated deterministic multi-tape machine.
Binary input word fed to the machine.
- space : ℕ
Visited work-tape cell budget (encoded in unary).
The tuple of the fields of encSPACETMInstance.
Canonical encoding of SPACETMInstance: machine via eDesc, input via encBits, and
space in unary (encUnary).
Total polynomial-time decoder for encSPACETMInstance.
Upper bound on the encoded bit-length of any simulated configuration of a.machine on
a.input.map eBit that visits at most a.space work-tape cells
(Turing.MultiTapeTM.Universal.length_eCfg_le_space).
The configuration space bound cfgSpaceBound for a.machine on a.input.map eBit within
a.space visited work-tape cells is at most a.cfgBudget.
Whenever the simulation of a.machine on a.input.map eBit up to step t visits at most
a.space work-tape cells, its configuration space bound cfgSpace is at most a.cfgBudget.
a.cfgBudget is computable in polynomial time in unary from encSPACETMInstance.
a.Accepts t is equivalent to spaceBoundedUniversal halting with output [eBit true] at
step t within visited-cell budget a.space.
Unconditional machine-level characterization of Accepts: on the description of any
binary multi-tape machine tm, Accepts ⟨desc eS eBit tm, x, n⟩ t holds if and only if the run
path of tm on x up to step t visits at most n work-tape cells and tm has halted on x
by step t with output [true].
When the simulation up to step t visits at most n work-tape cells,
Accepts ⟨desc eS eBit tm, x, n⟩ t holds if and only if tm has halted on x by step t with
output [true].
The clocked decider SPACETMInstance.decider is computable in polynomial space.
Canonical space-bounded Turing machine acceptance (SPACETM) in the native visited-space
model after Arora and Barak, Chapter 4, Section 4.3, display (2) and
Exercise 4 §3:
the instances a : SPACETMInstance for which the simulation of a.machine on a.input halts with
output [eBit true] at some step t while visiting at most a.space work-tape cells.
SPACETM is decided by SPACETMInstance.decider.
Unconditional machine-level characterization of SPACETM: on the description of any binary
multi-tape machine tm, ⟨desc eS eBit tm, x, n⟩ ∈ SPACETM holds if and only if at some step t,
the run path of tm on x visits at most n work-tape cells and tm has halted on x with
output [true].
On the description of a machine tm that visits at most n work-tape cells on x
(tm.RunsInSpace x n), ⟨desc eS eBit tm, x, n⟩ ∈ SPACETM holds if and only if tm halts on x
with output [true].
SPACETM is in PSPACE in the native visited-space model (after Arora–Barak
Exercise 4 §3, membership).
Space-bounded problems reduce to SPACETM. Every problem decided within visited work-tape
space c₁ * p |enc a| + c₂ for a polynomial-time unary function p reduces to SPACETM in
polynomial time via a ↦ ⟨desc eS eBit tm, enc a, c₁ * p |enc a| + c₂⟩.
SPACETM is PSPACE-complete in the native visited-space model under polynomial-time
many-one reductions (after Arora–Barak Chapter 4, display (2) and Exercise 4 §3).