A blank auxiliary tape simulates fixed initial contents step for step
ProvedPvsNP.initialized_tape_run_eq_shadow_runcomplexity-theoryformal-verification
A tape starts with fixed initial symbols. On a second tape a blank tag denotes an untouched position and a nonblank tag represents a written symbol. A driver reads the stored value at a tagged position and otherwise reads the fixed initial symbol, then updates at most the current position. Interpreting the auxiliary tape this way after any number of steps gives the original configuration after the same number of steps.
Preamble
import Mathlib.Logic.Function.Iterate import Mathlib.Logic.Function.Basic set_option autoImplicit false
Formal statement
theorem PvsNP.initialized_tape_run_eq_shadow_run {State Cell Symbol : Type*}
[DecidableEq Cell] (initial : Cell → Symbol)
(driver : State → Cell → Symbol → State × Cell × Option Symbol)
(control : State) (origin : Cell) (ticks : ℕ) :
let materialize : State × Cell × (Cell → Option Symbol) → State × Cell × (Cell → Symbol) :=
fun (q, head, stored) => (q, head, fun i => (stored i).getD (initial i))
let native : State × Cell × (Cell → Symbol) → State × Cell × (Cell → Symbol) :=
fun (q, head, tape) =>
let (next, target, write) := driver q head (tape head)
(next, target, write.elim tape fun value => Function.update tape head value)
let shadow : State × Cell × (Cell → Option Symbol) → State × Cell × (Cell → Option Symbol) :=
fun (q, head, stored) =>
let (next, target, write) := driver q head ((stored head).getD (initial head))
(next, target, write.elim stored fun value => Function.update stored head (some value))
materialize (shadow^[ticks] (control, origin, fun _ => none)) =
native^[ticks] (control, origin, initial) := by sorrySource
Exact continuation simulation after the shared prefix in the local-generator lower bound.