Every recording step preserves its natural-domain invariant
ProvedMonodromy.Counter.Reversible.Recording.valid_stepFor arbitrary natural n,m and source n-counter program P, every successful step of its reversible recording table from a Valid state reaches another Valid state. Valid requires nonnegative original registers and the history/workspace radix conditions at copied ports; at decrement middle ports it requires nonnegative history, zero workspace and positivity of the register awaiting decrement.
Statement dependencies: Monodromy.Counter.Program, Monodromy.Counter.Reversible.Recording.Valid, Monodromy.Counter.Reversible.Recording.edges, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.Recording.table, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.step.
Original proof dependencies: Monodromy.Counter.Program, Monodromy.Counter.Reversible.Action, Monodromy.Counter.Reversible.Action.apply, Monodromy.Counter.Reversible.Action.enabled, Monodromy.Counter.Reversible.Edge, Monodromy.Counter.Reversible.Edge.enabled, Monodromy.Counter.Reversible.Edge.execute, Monodromy.Counter.Reversible.Radix.edges, Monodromy.Counter.Reversible.Recording.Arc, Monodromy.Counter.Reversible.Recording.Extra, Monodromy.Counter.Reversible.Recording.Valid, Monodromy.Counter.Reversible.Recording.arcEdge, Monodromy.Counter.Reversible.Recording.arcEquiv, Monodromy.Counter.Reversible.Recording.base, Monodromy.Counter.Reversible.Recording.deterministic, Monodromy.Counter.Reversible.Recording.edges, Monodromy.Counter.Reversible.Recording.extra_valid_edge, Monodromy.Counter.Reversible.Recording.packing_valid_edge, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.Recording.table, Monodromy.Counter.Reversible.Recording.table_arc, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.StepRel, Monodromy.Counter.Reversible.step, Monodromy.Counter.Reversible.step_iff.
Statement elaboration dependencies: Monodromy.Counter.Program, Monodromy.Counter.Reversible.Recording.Valid, Monodromy.Counter.Reversible.Recording.edges, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.Recording.table, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.step.
Proof elaboration dependencies: Monodromy.Counter.Program, Monodromy.Counter.Reversible.Action, Monodromy.Counter.Reversible.Action.apply, Monodromy.Counter.Reversible.Action.enabled, Monodromy.Counter.Reversible.Edge, Monodromy.Counter.Reversible.Edge.enabled, Monodromy.Counter.Reversible.Edge.execute, Monodromy.Counter.Reversible.Radix.edges, Monodromy.Counter.Reversible.Recording.Arc, Monodromy.Counter.Reversible.Recording.Extra, Monodromy.Counter.Reversible.Recording.Valid, Monodromy.Counter.Reversible.Recording.arcEdge, Monodromy.Counter.Reversible.Recording.arcEquiv, Monodromy.Counter.Reversible.Recording.base, Monodromy.Counter.Reversible.Recording.deterministic, Monodromy.Counter.Reversible.Recording.edges, Monodromy.Counter.Reversible.Recording.extra_valid_edge, Monodromy.Counter.Reversible.Recording.packing_valid_edge, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.Recording.table, Monodromy.Counter.Reversible.Recording.table_arc, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.StepRel, Monodromy.Counter.Reversible.step, Monodromy.Counter.Reversible.step_iff.
module
public import Definitions.Def_Monodromy_Counter
public import Lean.Elab.Tactic.Omega
public import Mathlib.Analysis.Analytic.Constructions
public import Mathlib.Analysis.Analytic.IsolatedZeros
public import Mathlib.Analysis.Analytic.Linear
public import Mathlib.Analysis.Calculus.DSlope
public import Mathlib.Analysis.Calculus.Deriv.Add
public import Mathlib.Analysis.Calculus.Deriv.Comp
public import Mathlib.Analysis.Calculus.Deriv.Mul
public import Mathlib.Analysis.Calculus.Deriv.Pow
public import Mathlib.Analysis.Complex.Basic
public import Mathlib.Analysis.Complex.CoveringMap
public import Mathlib.Analysis.Real.Pi.Bounds
public import Mathlib.Analysis.SpecialFunctions.Complex.Analytic
public import Mathlib.Analysis.SpecialFunctions.Complex.Circle
public import Mathlib.Computability.StateTransition
public import Mathlib.Computability.TuringMachine.PostTuringMachine
public import Mathlib.Data.Fin.Basic
public import Mathlib.Data.Fintype.Card
public import Mathlib.Data.Fintype.EquivFin
public import Mathlib.Data.Nat.Digits.Lemmas
public import Mathlib.Data.Nat.Factorization.Basic
public import Mathlib.Logic.Equiv.Fin.Basic
public import Mathlib.Logic.Equiv.Fin.Rotate
public import Mathlib.Logic.Function.Basic
public import Mathlib.Logic.Function.Conjugate
public import Mathlib.RingTheory.RootsOfUnity.Complex
public import Mathlib.Tactic.FieldSimp
public import Mathlib.Tactic.FinCases
public import Mathlib.Tactic.FunProp
public import Mathlib.Tactic.Linarith
public import Mathlib.Tactic.Ring
public import Mathlib.Topology.Homotopy.Lifting
@[expose] public section
open Monodromy
open Monodromy.Counter
open Monodromy.Counter.Reversible
open Monodromy.Counter.Reversible.Recording
variable {n m : ℕ}
theorem Monodromy.Counter.Reversible.Recording.valid_step (program : Counter.Program n m) {first last : State (n + 2) (size m)}
(valid : Valid program first) (transition : step (table program) first = some last) :
Valid program last := by sorry
Read-back
What the Lean code literally says, in plain math · OpenAI Codex (independent agent)
Let and let be a natural-counter program with controls and registers, whose instructions are increment-and-jump, zero-test with a nonzero decrement-and-jump, and halt. Put . The recording table uses integer registers: the original registers, a history register and a workspace register . For each source row it contains a copy of the reversed graph on , with dispatch at that graph's input and port at its finish ; it also has a middle control for every row. A source increment of register to row gives an extra edge shifting register by . A decrement/test on register with zero target and nonzero target gives with test , with test , and shifting by . Halt rows have no extra edges. Copies of the reversed radix edges act only on ; reversal swaps endpoints, negates shifts and preserves tests. A table step chooses the least enumerated enabled edge, or has no successor when none is enabled. Write for control , original registers coerced to integers, history and workspace . For all integer-register states of , validity of and the equality of its table step to the defined successor imply validity of . This is preservation along any defined step; there is no hypothesis or conclusion asserting that a successor exists at every valid state. A state is valid precisely when all original registers are nonnegative and the following further condition holds: at a copy control corresponding to radix vertex , the history/workspace pair is nonnegative and satisfies the radix admissibility condition at ; at middle control , history is nonnegative, workspace is , the source instruction at is a decrement/test and its tested original register is positive. Radix admissibility on is at , unrestricted at , at , and, at phases of , respectively unrestricted, , , unrestricted, , unrestricted, , unrestricted. The two-integer-counter graph has global vertices and vertices for , , with input and finishes . Its global edges are , , ; for each its other edges are , , , , , , , and , where if and otherwise. Tests leave the counters unchanged, shifts are unconditionally enabled, and a step takes the least enumerated enabled edge or is undefined if none is enabled.
Confirmed by the mission captain (proposal self-audit).