Documentation

CslibFrontier.Computability.Complexity.Classes.Alternation.SavitchTime

Nondeterministic space in alternating time for time-constructible bounds #

A play of Savitch's midpoint game on the views of a nondeterministic machine ntm ends with the edge test of two endpoints, each the midpoint of the last level with a given half or, if there is none, the code of the initial view or the accepting code (Cslib.Reachability.midpointGame_eq_reach_lastMidpoint). This file names that last test, Turing.MultiTapeNTM.midpointLeaf, on the width, the input and the two endpoints as options, and assembles a verifier of the midpoint game within time O((n + s n) ^ 2) from the edge test of codes, Turing.MultiTapeNTM.codeEdge: the width and the number of moves in unary (Cslib.Complexity.TimeConstructible.computableInO_unary_of_polyTime), both endpoints (Cslib.Reachability.computableInO_lastMidpoint), the code of the initial view and the accepting code within linear time, and the comparison of the endpoints within quadratic time (Turing.MultiTapeNTM.computableInO_midpointLeaf).

The result, Cslib.Complexity.NSPACE_subset_ATIME_sq_of_timeConstructible, proves NSPACE s ⊆ ATIME ((n + s n) ^ 2) for a time-constructible s: a step toward Chandra, Kozen and Stockmeyer, Theorem 3.1 (NSPACE(S) ⊆ ⋃_{c > 0} ATIME(c * S ^ 2) for S(n) ≥ n without a constructibility hypothesis on S, tracked in #4086). The edge test decodes two views, and compares the second with the results of the finitely many actions the machine permits on the first, within quadratic time (Turing.MultiTapeNTM.computableInO_codeEdge).

The views record the input, so the codes have width linear in n + s n, and the bound is O((n + s n) ^ 2) (Sipser's form) for every s; under the hypothesis s n ≥ n of Theorem 3.1 it is O(s n ^ 2). Unlike Theorem 3.1, s is assumed time-constructible here to write the number of moves in unary (#4086).

Main definitions #

Main results #

References #

noncomputable def Turing.MultiTapeNTM.midpointLeaf {k : ℕ} {State : Type} [Finite State] (ntm : MultiTapeNTM k Bool State) (w : ℕ) (input : List Bool) (u v : Option (List Bool)) :

The leaf test of Savitch's midpoint game on the views of ntm, at width w on input, given the final endpoints u and v of a play as options: the edge test Cslib.Reachability.reach ntm.codeEdge (2 * w + 2) 0 of the left endpoint, by default the code of the initial view on input, and of the right endpoint, by default the accepting code.

theorem Cslib.Complexity.NSPACE_subset_ATIME_sq_of_timeConstructible {α : Type} {enc : α ↪ List Bool} {s : ℕ → ℕ} (hs : TimeConstructible s) :
NSPACE enc s ⊆ ATIME enc fun (n : ℕ) => (n + s n) ^ 2

Time-constructible step toward CKS Theorem 3.1 (NSPACE s ⊆ ATIME ((n + s n) ^ 2)): not the unrestricted Chandra, Kozen and Stockmeyer, Theorem 3.1 (NSPACE(S) ⊆ ⋃_{c > 0} ATIME(c * S ^ 2) for S(n) ≥ n without constructibility, which remains open in #4086), because it restricts s to TimeConstructible s. For a time-constructible s, every problem in NSPACE s is in ATIME ((n + s n) ^ 2): the alternating machine plays Savitch's midpoint game on the views of a machine deciding the problem (Cslib.Complexity.exists_midpointGame_of_mem_NSPACE), and its verifier, including the leaf test (Turing.MultiTapeNTM.computableInO_midpointLeaf), runs within time O((n + s n) ^ 2).

This statement differs from Theorem 3.1 in two ways: s is assumed time-constructible, to write the number of moves of the game in unary (#4086); and the bound is Sipser's form O((n + s n) ^ 2) for every s, which is O(s n ^ 2) under the hypothesis s n ≥ n of Theorem 3.1. Both classes are relative to the encoding enc of instances.