An unmarked counter run lifts with nondecreasing history
ProvedMonodromy.Counter.Reversible.Recording.counter_internal_reachesFor arbitrary natural n,m, n-counter program P and Boolean marking of its addresses, suppose a finite possibly empty source run u→*v consists of successful source steps with a false mark at every departure configuration. For every initial natural history h, there is a final natural history H≥h and a finite recording-table run from encode(u,h) to encode(v,H) whose departure states avoid all marked recording dispatches. The final source configuration need not be unmarked or halted.
Statement dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Program, Monodromy.Counter.Reversible.Recording.InternalMarkedReaches, Monodromy.Counter.Reversible.Recording.encode, Monodromy.Counter.step.
Original proof dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Program, Monodromy.Counter.Recorded.State, Monodromy.Counter.Recorded.history_lt, Monodromy.Counter.Recorded.push, Monodromy.Counter.Recorded.step, Monodromy.Counter.Recorded.tag, Monodromy.Counter.Reversible.Recording.InternalMarkedReaches, Monodromy.Counter.Reversible.Recording.InternalMarkedStep, Monodromy.Counter.Reversible.Recording.counter_internal_step, Monodromy.Counter.Reversible.Recording.encode, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.State, Monodromy.Counter.step.
Statement elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Program, Monodromy.Counter.Reversible.Recording.InternalMarkedReaches, Monodromy.Counter.Reversible.Recording.encode, Monodromy.Counter.step.
Proof elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Program, Monodromy.Counter.Recorded.State, Monodromy.Counter.Recorded.history_lt, Monodromy.Counter.Recorded.push, Monodromy.Counter.Recorded.step, Monodromy.Counter.Recorded.tag, Monodromy.Counter.Reversible.Recording.InternalMarkedReaches, Monodromy.Counter.Reversible.Recording.InternalMarkedStep, Monodromy.Counter.Reversible.Recording.counter_internal_step, Monodromy.Counter.Reversible.Recording.encode, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.State, Monodromy.Counter.step.
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.counter_internal_reaches (program : Counter.Program n m) (mark : Fin m → Bool)
{first last : Counter.Configuration n m}
(run : Relation.ReflTransGen (fun current next : Counter.Configuration n m =>
Counter.step program current = some next ∧ mark current.pc = false) first last)
(history : ℕ) :
∃ finalHistory, history ≤ finalHistory ∧
InternalMarkedReaches program mark (encode first history) (encode last finalHistory) := 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 . Let be arbitrary. If source configurations are joined by a finite, possibly zero-length, chain in which each transition is a defined step and each step's source row has , then for every natural initial history there exists a natural final history and a finite, possibly zero-length, chain of defined steps from to such that no step's source has control with . No exact value of is specified in this conclusion. The compiled chain may pass through unmarked dispatches; its last state may be marked, and when its length is zero its first state may also be marked. The source and compiled chain conditions constrain step sources, not final endpoints. 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).