Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Probabilistic.PrefixLocality

Input-tape prefix locality of bounded machine runs #

In fuel instructions from the initial configuration (inputPos = 1), the input head moves by at most one cell per instruction, so it never reads an input index at or beyond fuel and never clamps at the right boundary input.length + 1 when at least fuel symbols are present. Consequently, a fuel-step run of a MultiTapeMachine on input produces the exact same OracleComp output program as on input.take m for any m ≥ fuel, and in particular a fuel-step run on u ++ v depends only on u ++ v.take fuel.

Because this equality holds at the level of the uninterpreted OracleComp program, it applies to every choice and query handler, including closed fair-coin runs (MultiTapePTM.runClosed) and stateful external-oracle runs (MultiTapePTM.runOracle).

Main results #

theorem Turing.MultiTapeMachine.runFrom_eq_of_prefix_agree {k : ℕ} {Symbol State Oracle : Type} {Query : Type u} {Choose : Type → Type v} {spec : Cslib.OracleSpec Query} [DecidableEq Oracle] (machine : MultiTapeMachine k Symbol State Oracle Choose) (choose : Choose (Action k Symbol State Oracle) → Cslib.OracleComp spec (Action k Symbol State Oracle)) (query : Oracle → List Symbol → Cslib.OracleComp spec (List Symbol)) {input₁ input₂ : List Symbol} {m : ℕ} (hm₁ : m ≤ input₁.length) (hm₂ : m ≤ input₂.length) (hagree : ∀ j < m, input₁[j]? = input₂[j]?) (fuel : ℕ) (cfg₁ : Config k Symbol State Oracle input₁) (cfg₂ : Config k Symbol State Oracle input₂) (hstate : cfg₁.tapes.state = cfg₂.tapes.state) (hpos : ↑cfg₁.tapes.inputPos = ↑cfg₂.tapes.inputPos) (hwork : cfg₁.tapes.workTapes = cfg₂.tapes.workTapes) (hworkPos : cfg₁.tapes.workTapePos = cfg₂.tapes.workTapePos) (hout : cfg₁.tapes.output = cfg₂.tapes.output) (hchan : cfg₁.channels = cfg₂.channels) (hbound : ↑cfg₁.tapes.inputPos + fuel ≤ m + 1) :
machine.runFrom choose query fuel cfg₁ = machine.runFrom choose query fuel cfg₂

Two configurations whose input words agree on the first m symbols (m ≤ input₁.length, m ≤ input₂.length) and whose input head starts at a position pos with pos + fuel ≤ m + 1 produce the exact same output program over fuel steps: the input head never visits or clamps at a cell beyond index m - 1.

theorem Turing.MultiTapeMachine.run_take_of_le {k : ℕ} {Symbol State Oracle : Type} {Query : Type u} {Choose : Type → Type v} {spec : Cslib.OracleSpec Query} [DecidableEq Oracle] (machine : MultiTapeMachine k Symbol State Oracle Choose) (choose : Choose (Action k Symbol State Oracle) → Cslib.OracleComp spec (Action k Symbol State Oracle)) (query : Oracle → List Symbol → Cslib.OracleComp spec (List Symbol)) {fuel m : ℕ} (hm : fuel ≤ m) (input : List Symbol) :
machine.run choose query fuel (List.take m input) = machine.run choose query fuel input

A fuel-step run from the initial configuration depends only on the first m input symbols whenever fuel ≤ m: starting at inputPos = 1, the input head reads only indices below fuel.

theorem Turing.MultiTapeMachine.run_take {k : ℕ} {Symbol State Oracle : Type} {Query : Type u} {Choose : Type → Type v} {spec : Cslib.OracleSpec Query} [DecidableEq Oracle] (machine : MultiTapeMachine k Symbol State Oracle Choose) (choose : Choose (Action k Symbol State Oracle) → Cslib.OracleComp spec (Action k Symbol State Oracle)) (query : Oracle → List Symbol → Cslib.OracleComp spec (List Symbol)) (fuel : ℕ) (input : List Symbol) :
machine.run choose query fuel (List.take fuel input) = machine.run choose query fuel input

A fuel-step run from the initial configuration depends only on input.take fuel.

theorem Turing.MultiTapeMachine.run_append_take_of_le {k : ℕ} {Symbol State Oracle : Type} {Query : Type u} {Choose : Type → Type v} {spec : Cslib.OracleSpec Query} [DecidableEq Oracle] (machine : MultiTapeMachine k Symbol State Oracle Choose) (choose : Choose (Action k Symbol State Oracle) → Cslib.OracleComp spec (Action k Symbol State Oracle)) (query : Oracle → List Symbol → Cslib.OracleComp spec (List Symbol)) {fuel m : ℕ} (hm : fuel ≤ m) (u v : List Symbol) :
machine.run choose query fuel (u ++ List.take m v) = machine.run choose query fuel (u ++ v)

A fuel-step run on u ++ v depends only on u ++ v.take m whenever fuel ≤ m.

theorem Turing.MultiTapeMachine.run_append_take {k : ℕ} {Symbol State Oracle : Type} {Query : Type u} {Choose : Type → Type v} {spec : Cslib.OracleSpec Query} [DecidableEq Oracle] (machine : MultiTapeMachine k Symbol State Oracle Choose) (choose : Choose (Action k Symbol State Oracle) → Cslib.OracleComp spec (Action k Symbol State Oracle)) (query : Oracle → List Symbol → Cslib.OracleComp spec (List Symbol)) (fuel : ℕ) (u v : List Symbol) :
machine.run choose query fuel (u ++ List.take fuel v) = machine.run choose query fuel (u ++ v)

Prefix locality on u ++ v. A fuel-step run on u ++ v depends only on u ++ v.take fuel.

theorem Turing.MultiTapePTM.runClosed_take_of_le {k : ℕ} {Symbol State : Type} (machine : MultiTapePTM k Symbol State) {fuel m : ℕ} (hm : fuel ≤ m) (input : List Symbol) :
machine.runClosed fuel (List.take m input) = machine.runClosed fuel input

A fuel-step closed run depends only on the first m input symbols whenever fuel ≤ m.

theorem Turing.MultiTapePTM.runClosed_take {k : ℕ} {Symbol State : Type} (machine : MultiTapePTM k Symbol State) (fuel : ℕ) (input : List Symbol) :
machine.runClosed fuel (List.take fuel input) = machine.runClosed fuel input

A fuel-step closed run depends only on input.take fuel.

theorem Turing.MultiTapePTM.runClosed_append_take_of_le {k : ℕ} {Symbol State : Type} (machine : MultiTapePTM k Symbol State) {fuel m : ℕ} (hm : fuel ≤ m) (u v : List Symbol) :
machine.runClosed fuel (u ++ List.take m v) = machine.runClosed fuel (u ++ v)

A fuel-step closed run on u ++ v depends only on u ++ v.take m whenever fuel ≤ m.

theorem Turing.MultiTapePTM.runClosed_append_take {k : ℕ} {Symbol State : Type} (machine : MultiTapePTM k Symbol State) (fuel : ℕ) (u v : List Symbol) :
machine.runClosed fuel (u ++ List.take fuel v) = machine.runClosed fuel (u ++ v)

Prefix locality for closed probabilistic runs. A fuel-step closed run on u ++ v depends only on u ++ v.take fuel.

theorem Turing.MultiTapePTM.runOracle_take_of_le {k : ℕ} {Symbol State Operation : Type} [DecidableEq Operation] (machine : MultiTapePTM k Symbol State Operation) {fuel m : ℕ} (hm : fuel ≤ m) (input : List Symbol) :
machine.runOracle fuel (List.take m input) = machine.runOracle fuel input

A fuel-step oracle run depends only on the first m input symbols whenever fuel ≤ m.

theorem Turing.MultiTapePTM.runOracle_take {k : ℕ} {Symbol State Operation : Type} [DecidableEq Operation] (machine : MultiTapePTM k Symbol State Operation) (fuel : ℕ) (input : List Symbol) :
machine.runOracle fuel (List.take fuel input) = machine.runOracle fuel input

A fuel-step oracle run depends only on input.take fuel.

theorem Turing.MultiTapePTM.runOracle_append_take_of_le {k : ℕ} {Symbol State Operation : Type} [DecidableEq Operation] (machine : MultiTapePTM k Symbol State Operation) {fuel m : ℕ} (hm : fuel ≤ m) (u v : List Symbol) :
machine.runOracle fuel (u ++ List.take m v) = machine.runOracle fuel (u ++ v)

A fuel-step oracle run on u ++ v depends only on u ++ v.take m whenever fuel ≤ m.

theorem Turing.MultiTapePTM.runOracle_append_take {k : ℕ} {Symbol State Operation : Type} [DecidableEq Operation] (machine : MultiTapePTM k Symbol State Operation) (fuel : ℕ) (u v : List Symbol) :
machine.runOracle fuel (u ++ List.take fuel v) = machine.runOracle fuel (u ++ v)

Prefix locality for oracle probabilistic runs. A fuel-step oracle run on u ++ v depends only on u ++ v.take fuel.