Multiport visit replay using cell handoffs
ProvedPvsNP.PortStreamReplay.run_of_live_cell_handoffscomplexity-theoryformal-verification
Take a sequence of local visits with possibly different work-cell masks and prescribed control, head, and port-counter stamps. Assume that the hybrid streams agree on all positions read by the visits. On each work cell, its first use must agree with the initial tape and each later use with the exit of the most recent visit using that cell. Then these visits give a run with the prescribed initial and terminal stamps.
Preamble
import Lean.Elab.Tactic.Omega import Definitions.Def_MultiplePortTiledTrace set_option autoImplicit false open PvsNP PvsNP.PortStreamReplay PvsNP.WorkBoundarySplice
Formal statement
theorem PvsNP.PortStreamReplay.run_of_live_cell_handoffs {Port Read Q Γ : Type}
[DecidableEq Port] (M : Program Port Read Q Γ) (horizon : ℕ)
(scope : ℕ → ℤ → Bool) (stamp : ℕ → Stamp Port Q)
(entry exit : ℕ → Cursor Port Q Γ) (initial : ℤ → Γ)
(source : ℕ → Word Port Read) (target : Word Port Read)
(entryStamp : ∀ i < horizon, (entry i).stamp = stamp i)
(exitStamp : ∀ i < horizon, (exit i).stamp = stamp (i + 1))
(visits : ∀ i < horizon, ∃ reads, Segment M (source i) (scope i) true (entry i) (exit i) reads)
(agree : ∀ i < horizon, ∀ port j, (stamp i).next port ≤ j → j < (stamp (i + 1)).next port →
source i port j = target port j)
(first : ∀ i < horizon, ∀ p, scope i p = true →
(∀ k < i, scope k p = false) → initial p = (entry i).work.tape p)
(handoff : ∀ i < horizon, ∀ k < i, ∀ p, scope k p = true → scope i p = true →
(∀ j, k < j → j < i → scope j p = false) → (exit k).work.tape p = (entry i).work.tape p) :
∃ finalTape : ℤ → Γ,
Run M target ⟨⟨(stamp 0).control, (stamp 0).head, initial⟩, (stamp 0).next⟩
⟨⟨(stamp horizon).control, (stamp horizon).head, finalTape⟩, (stamp horizon).next⟩ := by sorrySource
Original live-cell argument for variable-width work-window replay.