Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.LogSpace.ConfigurationGraph.Correctness

Exact reachability of the compact configuration graph #

The invariant is an actual finite view whose radix registers equal the current ID. Arithmetic steps preserve this invariant, so malformed IDs cannot create spurious accepting paths. The forward implication only requires that source-reachable views fit the selected radix.

The overflow test (Turing.MultiTapeNTM.ConfigurationGraph.overflow) detects the represented views with a step leaving the radix. When no reachable vertex overflows, every source-reachable view fits the radix, so the graph is exact without any space bound on the source.

Main results #

theorem Turing.MultiTapeNTM.ConfigurationGraph.pos_of_fits {k B : ℕ} {r : Register k → ℕ} (hf : Fits B r) :
0 < B

A radix that fits some registers is positive.

The arithmetic input move agrees with native clamping.

The arithmetic tuple update agrees with the summarized finite view step.

theorem Turing.MultiTapeNTM.ConfigurationGraph.vertexID_lt {k B : ℕ} {State : Type} [Fintype State] {v : FiniteCfg k Bool State} (hf : Fits B (registers v)) :

The sole queried symbol agrees with the native input head, including both blank boundaries.

theorem Turing.MultiTapeNTM.ConfigurationGraph.matchesEntry_iff {k : ℕ} {State : Type} [Fintype State] (v : FiniteCfg k Bool State) (symbol : Option Bool) (t : Instruction k State) :
matchesEntry v.input.length (registers v) symbol t = true ↔ v.state = some t.1 ∧ inputSymbol v.input.length (↑v.inputPos) symbol = t.2.1 ∧ v.workTapeSymbols = t.2.2.1
theorem Turing.MultiTapeNTM.ConfigurationGraph.lt_vertexBound_of_valid {k : ℕ} {State : Type} [Fintype State] {B n u : ℕ} (h : valid B n u = true) :

Validity rejects every ID outside the ambient vertex range.

theorem Turing.MultiTapeNTM.ConfigurationGraph.lt_vertexBound_of_edgeWithSymbol {k : ℕ} {State : Type} [Fintype State] {ntm : MultiTapeNTM k Bool State} {B n u v : ℕ} {symbol : Option Bool} (h : edgeWithSymbol ntm B n u v symbol = true) :

Every successful local edge query stays inside the finite ambient graph.

theorem Turing.MultiTapeNTM.ConfigurationGraph.edge_sound {k B : ℕ} {State : Type} [Fintype State] {ntm : MultiTapeNTM k Bool State} {v : FiniteCfg k Bool State} {u : ℕ} (hf : Fits B (registers v)) (he : Edge ntm B v.input (vertexID B v) u) :
∃ (v' : FiniteCfg k Bool State), ntm.ViewStep v v' ∧ v'.input = v.input ∧ u = vertexID B v' ∧ Fits B (registers v')

An edge out of a represented vertex has an actual native view successor.

theorem Turing.MultiTapeNTM.ConfigurationGraph.edge_complete {k B : ℕ} {State : Type} [Fintype State] {ntm : MultiTapeNTM k Bool State} {v v' : FiniteCfg k Bool State} (hf : Fits B (registers v)) (hf' : Fits B (registers v')) (he : ntm.ViewStep v v') :
Edge ntm B v.input (vertexID B v) (vertexID B v')

Every fitting native view edge is an edge of the compact graph.

theorem Turing.MultiTapeNTM.ConfigurationGraph.vertexID_init {k : ℕ} {State : Type} [Fintype State] (ntm : MultiTapeNTM k Bool State) (B : ℕ) (w : List Bool) :
vertexID B (ntm.initView w) = startID ntm B

Initial storage has an input-length-only ID.

theorem Turing.MultiTapeNTM.ConfigurationGraph.input_of_reachable {k : ℕ} {State : Type} {ntm : MultiTapeNTM k Bool State} {w : List Bool} {v : FiniteCfg k Bool State} (h : Relation.ReflTransGen ntm.ViewStep (ntm.initView w) v) :
v.input = w

Views reachable on one input retain precisely that input.

theorem Turing.MultiTapeNTM.ConfigurationGraph.reachable_iff {k B : ℕ} {State : Type} [Fintype State] {ntm : MultiTapeNTM k Bool State} {w : List Bool} (hfit : ∀ (v : FiniteCfg k Bool State), Relation.ReflTransGen ntm.ViewStep (ntm.initView w) v → Fits B (registers v)) (u : ℕ) :
Relation.ReflTransGen (Edge ntm B w) (startID ntm B) u ↔ ∃ (v : FiniteCfg k Bool State), Relation.ReflTransGen ntm.ViewStep (ntm.initView w) v ∧ u = vertexID B v

Exact graph reachability, provided all source-reachable views fit the radix.

bad has exactly the native accepting-halt meaning on represented vertices.

theorem Turing.MultiTapeNTM.ConfigurationGraph.accepts_iff_reachable_bad {k B : ℕ} {State : Type} [Fintype State] {ntm : MultiTapeNTM k Bool State} {w : List Bool} (hfit : ∀ (v : FiniteCfg k Bool State), Relation.ReflTransGen ntm.ViewStep (ntm.initView w) v → Fits B (registers v)) :
ntm.Accepts w ↔ ∃ (u : ℕ), Relation.ReflTransGen (Edge ntm B w) (startID ntm B) u ∧ bad B w.length u = true

Native acceptance is exactly reachability of a bad vertex. No totality or time bound on the source machine is used; the only assumption is that its reachable registers fit the radix.

theorem Turing.MultiTapeNTM.ConfigurationGraph.overflow_vertexID {k B : ℕ} {State : Type} [Fintype State] {ntm : MultiTapeNTM k Bool State} {v : FiniteCfg k Bool State} (hf : Fits B (registers v)) :
Overflow ntm B v.input (vertexID B v) ↔ ∃ (v' : FiniteCfg k Bool State), ntm.ViewStep v v' ∧ ¬Fits B (registers v')

Overflow means a step leaving the radix: a represented view overflows exactly when one of its source steps reaches a view that does not fit.

theorem Turing.MultiTapeNTM.ConfigurationGraph.fits_of_not_overflow {k B : ℕ} {State : Type} [Fintype State] {ntm : MultiTapeNTM k Bool State} {w : List Bool} (hstart : Fits B (registers (ntm.initView w))) (hno : ∀ (u : ℕ), Relation.ReflTransGen (Edge ntm B w) (startID ntm B) u → ¬Overflow ntm B w u) (v : FiniteCfg k Bool State) (hv : Relation.ReflTransGen ntm.ViewStep (ntm.initView w) v) :

A graph without reachable overflow is exact: if the start view fits and no vertex reachable in the graph overflows, then every source-reachable view fits the radix.

theorem Turing.MultiTapeNTM.ConfigurationGraph.not_overflow_of_fits {k B : ℕ} {State : Type} [Fintype State] {ntm : MultiTapeNTM k Bool State} {w : List Bool} (hfit : ∀ (v : FiniteCfg k Bool State), Relation.ReflTransGen ntm.ViewStep (ntm.initView w) v → Fits B (registers v)) (u : ℕ) (hu : Relation.ReflTransGen (Edge ntm B w) (startID ntm B) u) :
¬Overflow ntm B w u

Conversely, when every source-reachable view fits the radix, no reachable vertex overflows.