Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Alternating.DeterministicTime

Space-bounded alternation within exponential time #

A space-bounded alternating machine is evaluated by listing the views reachable from its initial view (Turing.MultiTapeNTM.reachableViews, breadth-first search until closed) and marking them bottom-up (Turing.MultiTapeATM.markAccepts) Chandra, Kozen and Stockmeyer, Section 3 Sipser, Section 10.3. Under a space bound s this decides acceptance (Turing.MultiTapeATM.reachableAccepts_iff) within time and space 2 ^ O(log₂ n + s) (Turing.MultiTapeATM.exists_computableInTimeAndSpace_reachableAccepts).

Acceptance is the least fixed point of the labelling (Turing.MultiTapeATM.Accepts), so the machine need not halt on every branch: a branch that runs forever within the space bound never helps a view accept. The space bound need not be computable, since the search stops by itself.

Main definitions #

Main results #

References #

noncomputable def Turing.MultiTapeATM.reachableAccepts {k : ℕ} {State : Type} [Finite State] (atm : MultiTapeATM k Bool State) (input : List Bool) :

Acceptance by marking the reachable views: mark the views found by breadth-first search until closed, and test the initial view.

theorem Turing.MultiTapeATM.reachableAccepts_iff {k : ℕ} {State : Type} [Finite State] {atm : MultiTapeATM k Bool State} {input : List Bool} {s : ℕ} (hs : atm.toPTM.toNTM.RunsInSpace input s) :
atm.reachableAccepts input = true ↔ atm.Accepts input

Marking the reachable views decides acceptance under any space bound.

theorem Turing.MultiTapeATM.exists_computableInTimeAndSpace_reachableAccepts {k : ℕ} {State : Type} [Finite State] {atm : MultiTapeATM k Bool State} {α : Type} {enc : α ↪ List Bool} {s : α → ℕ} (hs : ∀ (a : α), atm.toPTM.toNTM.RunsInSpace (enc a) (s a)) :
∃ (c : ℕ), MultiTapeTM.ComputableInTimeAndSpace (fun (a : α) => atm.reachableAccepts (enc a)) enc MultiTapeTM.encBool (fun (a : α) => 2 ^ (c * ((enc a).length.log2 + s a + 1))) fun (a : α) => 2 ^ (c * ((enc a).length.log2 + s a + 1))

Space-bounded alternation within exponential time: if every computation prefix of atm on every encoded instance stays within space s a, then marking the reachable views is computable within time and space 2 ^ (c * (log₂ n + s a + 1)). The space bound need not be computable.