OAI/MathematicalPhysics/NavierStokes/ForcedComputation/Programs/Recorder.lean
30 declarations, 0 contain sorry, 0 declared as axioms
The seven-row reversible recording table in Section 2 of Finite Instructions
and Solenoidal Shear Flows (2026), Lemma lem:recorder.
The inverse below is valid on the entire guarded domain, including tapes that do not satisfy the checkpoint invariant. The record is the pair consisting of the original state and the symbol read, as in Bennett, Logical reversibility of computation (1973), equations (9)--(11); the concrete seven-row construction and its proof are supplied here rather than assumed from that reference.
- structure
OAI.ForcedComputation.Recorder.Machineline 20 - abbrev
OAI.ForcedComputation.Recorder.Recordline 27 - inductive
OAI.ForcedComputation.Recorder.Historyline 29 - inductive
OAI.ForcedComputation.Recorder.Controlline 35 - abbrev
OAI.ForcedComputation.Recorder.Symbolline 43 - inductive
OAI.ForcedComputation.Recorder.LocalStepline 48Source documentation
Exactly the seven rows of the manuscript's guarded local table.
inductive LocalStep (M : Machine Q A) : Control Q A → Symbol Q A → Control Q A → Symbol Q A → ℤ → Prop | work (q : Q) (a : A) (l : History Q A) (hq : M.halting q = false) (hl : l ≠ frontier) : LocalStep M (checkpoint q) (a, l, false) (mark (q, a)) (M.write q a, l, false) (M.move q a) | setMark (r : Record Q A) (c : A) (l : History Q A) (hl : l ≠ frontier) : LocalStep M (mark r) (c, l, false) (scanRight r) (c, l, true) 1 | right (r : Record Q A) (c : A) (l : History Q A) (hl : l ≠ frontier) : LocalStep M (scanRight r) (c, l, false) (scanRight r) (c, l, false) 1 | record (r : Record Q A) (c : A) : LocalStep M (scanRight r) (c, frontier, false) …Mentions: OAI.ForcedComputation.Recorder.Machine, OAI.ForcedComputation.Recorder.Control, OAI.ForcedComputation.Recorder.Symbol, OAI.ForcedComputation.Recorder.History, OAI.ForcedComputation.Recorder.Record
- def
OAI.ForcedComputation.Recorder.incomingline 69 - theorem
OAI.ForcedComputation.Recorder.LocalStep.incoming_eqline 76 - def
OAI.ForcedComputation.Recorder.undoLocalline 83Source documentation
Reconstruct the preceding control and read symbol from the new control and the complete symbol that was written. No checkpoint invariant is consulted.
def undoLocal : Control Q A → Symbol Q A → Option (Control Q A × Symbol Q A) | checkpoint q, (c, l, _) => some (scanLeft q, (c, l, true)) | mark r, (_, l, _) => some (checkpoint r.1, (r.2, l, false)) | scanRight r, (c, l, true) => some (mark r, (c, l, false)) | scanRight r, (c, l, false) => some (scanRight r, (c, l, false)) | advance _, (c, History.record r, _) => some (scanRight r, (c, frontier, false)) | advance _, _ => none | scanLeft q, (c, History.frontier, _) => some (advance q, (c, empty, false)) | scanLeft q, (c, l, _) => some (scanLeft q, (c, l, false))
Mentions: OAI.ForcedComputation.Recorder.Control, OAI.ForcedComputation.Recorder.Symbol
- theorem
OAI.ForcedComputation.Recorder.LocalStep.undoline 93 - theorem
OAI.ForcedComputation.Recorder.LocalStep.predecessor_uniqueline 105 - def
OAI.ForcedComputation.Recorder.evalLocalline 114Source documentation
A terminating local interpreter for the finite table.
def evalLocal [DecidableEq Q] [DecidableEq A] (M : Machine Q A) (q : Control Q A) (s : Symbol Q A) : Option (Control Q A × Symbol Q A × ℤ) := …Mentions: OAI.ForcedComputation.Recorder.Machine, OAI.ForcedComputation.Recorder.Control, OAI.ForcedComputation.Recorder.Symbol
- theorem
OAI.ForcedComputation.Recorder.LocalStep.evalline 133 - theorem
OAI.ForcedComputation.Recorder.LocalStep.successor_uniqueline 138 - structure
OAI.ForcedComputation.Recorder.Configurationline 145 - def
OAI.ForcedComputation.Recorder.Stepline 150 - def
OAI.ForcedComputation.Recorder.undoline 154 - theorem
OAI.ForcedComputation.Recorder.Step.undoline 160Source documentation
The entire predecessor tape, head, and control are recovered.
theorem Step.undo {M : Machine Q A} {C D : Configuration Q A} (h : Step M C D) : undo M D = some C := by …Mentions: OAI.ForcedComputation.Recorder.Machine, OAI.ForcedComputation.Recorder.Configuration, OAI.ForcedComputation.Recorder.Step
- theorem
OAI.ForcedComputation.Recorder.Step.predecessor_uniqueline 179 - theorem
OAI.ForcedComputation.Recorder.Step.scan_rightline 183 - theorem
OAI.ForcedComputation.Recorder.Step.scan_leftline 192 - inductive
OAI.ForcedComputation.Recorder.Stepsline 203Source documentation
Execution with an exact finite number of local transitions.
inductive Steps (M : Machine Q A) : ℕ → Configuration Q A → Configuration Q A → Prop | zero (C) : Steps M 0 C C | next {n C D E} : Steps M n C D → Step M D E → Steps M (n + 1) C EMentions: OAI.ForcedComputation.Recorder.Machine, OAI.ForcedComputation.Recorder.Configuration, OAI.ForcedComputation.Recorder.Step
- theorem
OAI.ForcedComputation.Recorder.Steps.transline 207 - theorem
OAI.ForcedComputation.Recorder.scan_right_stepsline 213 - theorem
OAI.ForcedComputation.Recorder.scan_left_stepsline 226 - def
OAI.ForcedComputation.Recorder.tracksline 239 - theorem
OAI.ForcedComputation.Recorder.tracks_update_workline 242 - theorem
OAI.ForcedComputation.Recorder.tracks_update_historyline 249 - theorem
OAI.ForcedComputation.Recorder.tracks_update_markline 256 - theorem
OAI.ForcedComputation.Recorder.checkpoint_cycleline 266Source documentation
A complete recorder cycle. There are
kright-scan steps andk + 1left-scan steps, in addition to the five non-scan transitions. The hypotheses describe the actual work/history tracks, not a pre-assumed simulation.theorem checkpoint_cycle (M : Machine Q A) (q : Q) (w : ℤ → A) (history : ℤ → History Q A) (head : ℤ) (k : ℕ) (hq : M.halting q = false) (hhead : history head ≠ frontier) (hbefore : ∀ j < head + M.move q (w head) + (k : ℤ) + 1, history j ≠ frontier) (hfront : history (head + M.move q (w head) + (k : ℤ) + 1) = frontier) (hempty : history (head + M.move q (w head) + (k : ℤ) + 1 + 1) = empty) : let r : Record Q A := (q, w head) …Mentions: OAI.ForcedComputation.Recorder.Machine, OAI.ForcedComputation.Recorder.History, OAI.ForcedComputation.Recorder.Record