Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.LogSpace.Reachability

Breadth-first search through the views of a nondeterministic machine #

A nondeterministic machine accepts exactly when an accepting view (Turing.MultiTapeNTM.acceptingView: halted, with output [true]) is reachable from its initial view (Turing.MultiTapeNTM.accepts_iff_reflTransGen_viewStep). Breadth-first search through the views (Cslib.Reachability.search, along Turing.MultiTapeNTM.viewSucc) finds exactly the reachable views once it has run for as many rounds as there are (Turing.MultiTapeNTM.mem_search_iff). Under a logarithmic space bound there are polynomially many (Turing.MultiTapeNTM.length_le_of_nodup_reachable), so a polynomial number of rounds suffices, each round is polynomial-time in the views found so far, and these are polynomially many views of linear size. The search is therefore polynomial-time (Turing.MultiTapeNTM.exists_computableInPolyTime_search): reachability in the configuration graph, which has polynomially many vertices Sipser, Section 8.4. The search run until no new view appears, under any space bound, is Turing.MultiTapeNTM.reachableViews.

Main definitions #

Main results #

References #

noncomputable def Turing.MultiTapeNTM.viewSucc {k : ℕ} {State : Type} [Finite State] (ntm : MultiTapeNTM k Bool State) (finite : FiniteCfg k Bool State) :
List (FiniteCfg k Bool State)

The views a view steps to, other than itself: none for a halted view, and for a running view the summarized results of the actions its transition relation permits.

Instances For
    def Turing.MultiTapeNTM.acceptingView {k : ℕ} {State : Type} (finite : FiniteCfg k Bool State) :

    An accepting view: halted, with output [true].

    Instances For
      theorem Turing.MultiTapeNTM.viewStep_of_mem_viewSucc {k : ℕ} {State : Type} [Finite State] {ntm : MultiTapeNTM k Bool State} {finite next : FiniteCfg k Bool State} (h : next ∈ ntm.viewSucc finite) :
      ntm.ViewStep finite next

      A view steps to each of its successors.

      theorem Turing.MultiTapeNTM.reflTransGen_viewSucc_iff {k : ℕ} {State : Type} [Finite State] {ntm : MultiTapeNTM k Bool State} {finite next : FiniteCfg k Bool State} :
      Relation.ReflTransGen (fun (a b : FiniteCfg k Bool State) => b ∈ ntm.viewSucc a) finite next ↔ Relation.ReflTransGen ntm.ViewStep finite next

      The successor lists give the reachable views: a halted view steps only to itself, which adds nothing to reachability.

      theorem Turing.MultiTapeNTM.mem_search_iff {k : ℕ} {State : Type} [Finite State] {ntm : MultiTapeNTM k Bool State} {input : List Bool} {s rounds : ℕ} (hs : ntm.RunsInSpace input s) (hrounds : 2 ^ (2 * coreLengthBound k State input.length s + 1) ≤ rounds) {finite : FiniteCfg k Bool State} :
      finite ∈ Cslib.Reachability.search ntm.viewSucc rounds (ntm.initView input) ↔ Relation.ReflTransGen ntm.ViewStep (ntm.initView input) finite

      Enough rounds find every reachable view: under a space bound s, breadth-first search for at least 2 ^ (2 * coreLengthBound k State n s + 1) rounds finds exactly the views reachable from the initial view.

      Breadth-first search in polynomial time #

      Appending an element unless it is already in the list is polynomial-time.

      A round of breadth-first search is polynomial-time when the successors are: the found elements and their successors are at most polynomially many and long.

      theorem Turing.MultiTapeNTM.computableInPolyTime_initView {k : ℕ} {State : Type} [Finite State] {ntm : MultiTapeNTM k Bool State} {α : Type} (enc : α ↪ List Bool) :

      The initial view of an encoded instance is polynomial-time.

      theorem Turing.MultiTapeNTM.length_encList_search_le {k : ℕ} {State : Type} [Finite State] {ntm : MultiTapeNTM k Bool State} {input : List Bool} {s : ℕ} (hs : ntm.RunsInSpace input s) (rounds : ℕ) :

      Breadth-first search finds few short views: under a space bound s, any number of rounds of the search from the initial view finds at most 2 ^ (2 * coreLengthBound + 1) views, each encoded within 2 * viewLengthBound + 1 bits.