A recorded source step has a first return with its transition tag
ProvedMonodromy.Counter.Reversible.Recording.step_firstReturnFor any natural n,m, n-counter program P, successful source transition u→v and natural history h, the reversible recording table has a first return from encode(u,h) to encode(v,(2m+1)h+2·u.pc+β+1). Here β is 1 exactly for a decrement taking its nonzero branch and is 0 otherwise. Both endpoints are recording dispatches, and the positive run has no intermediate dispatch departure state.
Statement dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Program, Monodromy.Counter.Recorded.push, Monodromy.Counter.Recorded.tag, Monodromy.Counter.Reversible.Recording.FirstReturn, Monodromy.Counter.Reversible.Recording.encode, Monodromy.Counter.step.
Original proof dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Instruction, Monodromy.Counter.Program, Monodromy.Counter.Recorded.branch, Monodromy.Counter.Recorded.push, Monodromy.Counter.Recorded.tag, Monodromy.Counter.Reversible.Recording.FirstReturn, Monodromy.Counter.Reversible.Recording.base, Monodromy.Counter.Reversible.Recording.digit, Monodromy.Counter.Reversible.Recording.encode, Monodromy.Counter.Reversible.Recording.history_digit, Monodromy.Counter.Reversible.Recording.inc_firstReturn, Monodromy.Counter.Reversible.Recording.positive_firstReturn, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.Recording.zero_firstReturn, Monodromy.Counter.Reversible.State, Monodromy.Counter.step, Monodromy.Counter.step_dec_succ, Monodromy.Counter.step_dec_zero, Monodromy.Counter.step_inc.
Statement elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Program, Monodromy.Counter.Recorded.push, Monodromy.Counter.Recorded.tag, Monodromy.Counter.Reversible.Recording.FirstReturn, Monodromy.Counter.Reversible.Recording.encode, Monodromy.Counter.step.
Proof elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Instruction, Monodromy.Counter.Program, Monodromy.Counter.Recorded.branch, Monodromy.Counter.Recorded.push, Monodromy.Counter.Recorded.tag, Monodromy.Counter.Reversible.Recording.FirstReturn, Monodromy.Counter.Reversible.Recording.base, Monodromy.Counter.Reversible.Recording.digit, Monodromy.Counter.Reversible.Recording.encode, Monodromy.Counter.Reversible.Recording.history_digit, Monodromy.Counter.Reversible.Recording.inc_firstReturn, Monodromy.Counter.Reversible.Recording.positive_firstReturn, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.Recording.zero_firstReturn, Monodromy.Counter.Reversible.State, Monodromy.Counter.step, Monodromy.Counter.step_dec_succ, Monodromy.Counter.step_dec_zero, Monodromy.Counter.step_inc.
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.step_firstReturn (program : Counter.Program n m) {before after : Counter.Configuration n m}
(transition : Counter.step program before = some after) (history : ℕ) :
FirstReturn program (encode before history)
(encode after (Counter.Recorded.push (Counter.Recorded.tag program before) history)) := 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 every pair of natural configurations with one defined source step and every natural history , there is a positive finite run of from to with both endpoints at dispatch controls and no intermediate dispatch control. Here for an increment instruction, for the zero branch of a decrement/test, and for its nonzero branch; the tag is the product-enumeration index in and the push operation on tag is . More exactly, the asserted first return is dispatch membership of both endpoints together with one defined step followed by a reflexive transitive chain of defined steps whose source controls are not dispatches; that latter chain may be empty. The counter program's nonzero decrement lowers a positive natural register, and the source-step premise excludes halt instructions. 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).