Stable nonnegative unmarked runs lift through prime compression
ProvedMonodromy.Counter.Reversible.PrimeCompression.integer_internal_reachesFor arbitrary natural n,q,e, distinct-prime basis, source table with complementary same-register tests at shared sources and targets, and shift amounts restricted to ±1, choose a Boolean source-address marking and an invariant preserved by every successful source step. Suppose the invariant makes every register nonnegative. Any finite possibly empty integer source run from an invariant-satisfying state u to v, with a false mark at every departure address, induces a finite compressed-table run between the prime encodings of the configurations obtained by applying Int.toNat to their counters. Every compressed departure state avoids the marked retained source boundaries; no marking or halting assumption is imposed on v.
Statement dependencies: Monodromy.Counter.Reversible.Action.UnitShift, Monodromy.Counter.Reversible.Deterministic, Monodromy.Counter.Reversible.Edge, Monodromy.Counter.Reversible.PrimeCompression.InternalMarkedReaches, Monodromy.Counter.Reversible.PrimeCompression.encode, Monodromy.Counter.Reversible.PrimeCompression.toNatural, Monodromy.Counter.Reversible.Stable, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.Table, Monodromy.Counter.Reversible.TargetCompatible, Monodromy.Counter.Reversible.step, Monodromy.PrimeCode.Basis.
Original proof dependencies: Monodromy.Counter.Reversible.Action.UnitShift, Monodromy.Counter.Reversible.Deterministic, Monodromy.Counter.Reversible.Edge, Monodromy.Counter.Reversible.PrimeCompression.InternalMarkedReaches, Monodromy.Counter.Reversible.PrimeCompression.InternalMarkedStep, Monodromy.Counter.Reversible.PrimeCompression.encode, Monodromy.Counter.Reversible.PrimeCompression.integer_unmarked_step, Monodromy.Counter.Reversible.PrimeCompression.size, Monodromy.Counter.Reversible.PrimeCompression.toNatural, Monodromy.Counter.Reversible.Stable, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.Table, Monodromy.Counter.Reversible.TargetCompatible, Monodromy.Counter.Reversible.step, Monodromy.PrimeCode.Basis.
Statement elaboration dependencies: Monodromy.Counter.Reversible.Action.UnitShift, Monodromy.Counter.Reversible.Deterministic, Monodromy.Counter.Reversible.Edge, Monodromy.Counter.Reversible.PrimeCompression.InternalMarkedReaches, Monodromy.Counter.Reversible.PrimeCompression.encode, Monodromy.Counter.Reversible.PrimeCompression.toNatural, Monodromy.Counter.Reversible.Stable, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.Table, Monodromy.Counter.Reversible.TargetCompatible, Monodromy.Counter.Reversible.step, Monodromy.PrimeCode.Basis.
Proof elaboration dependencies: Monodromy.Counter.Reversible.Action.UnitShift, Monodromy.Counter.Reversible.Deterministic, Monodromy.Counter.Reversible.Edge, Monodromy.Counter.Reversible.PrimeCompression.InternalMarkedReaches, Monodromy.Counter.Reversible.PrimeCompression.InternalMarkedStep, Monodromy.Counter.Reversible.PrimeCompression.encode, Monodromy.Counter.Reversible.PrimeCompression.integer_unmarked_step, Monodromy.Counter.Reversible.PrimeCompression.size, Monodromy.Counter.Reversible.PrimeCompression.toNatural, Monodromy.Counter.Reversible.Stable, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.Table, Monodromy.Counter.Reversible.TargetCompatible, Monodromy.Counter.Reversible.step, Monodromy.PrimeCode.Basis.
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.PrimeCompression
variable {n q e : ℕ}
theorem Monodromy.Counter.Reversible.PrimeCompression.integer_internal_reaches (basis : PrimeCode.Basis n) (source : Table n q e)
(deterministic : Deterministic source) (compatible : TargetCompatible source)
(unit : ∀ edge, Action.UnitShift (source edge).action) (mark : Fin q → Bool)
(valid : State n q → Prop) (stable : Stable source valid)
(nonnegative : ∀ state, valid state → ∀ index, 0 ≤ state.2 index)
{first last : State n q}
(run : Relation.ReflTransGen (fun current next : State n q =>
step source current = some next ∧ mark current.1 = false) first last)
(first_valid : valid first) :
InternalMarkedReaches basis source deterministic compatible mark
(encode basis source deterministic compatible (toNatural first))
(encode basis source deterministic compatible (toNatural last)) := by sorry
Read-back
What the Lean code literally says, in plain math · OpenAI Codex (independent agent)
Let , let be an injective family of natural primes, and let be an -edge table on control positions and integer registers. An edge is a source, a target, and either an unconditional register shift by an integer or a zero/nonzero test leaving all registers unchanged; a step chooses the least enabled edge at the current control. Assume distinct edges with a common source, and distinct edges with a common target, are in each case complementary tests on the same register; these are the two stated compatibility hypotheses. Put for natural register vectors. The encoding has counters and control . Here is the retained control of the following finite two-counter table : for each control with outgoing edges, take a source module using the register of its least outgoing edge, reverse that module exactly when that edge is a shift by , and use the finish of remainder as input in the reversed case and the usual input otherwise; for each target of a test edge, also take a reversed restoration module using its least incoming test's register; controls without outgoing edges are separate vertices. A shift module's output is glued to its source edge's target control; a test source's finish of remainder is glued to the restoration input of an edge testing that register with Boolean flag and having that target; restoration outputs are glued to their target controls. Gluing replaces each linked exit by its designated entry and preserves the original module edges and their actions. The control is the image of the source-module input for row , or its separate stopped vertex. Suppose furthermore that every shift in has amount or (tests impose no further condition), and let be any marking. Let be any predicate on integer source states, preserved by every defined step, such that implies for every register . For integer states , assume and a finite, possibly zero-length, chain from to in which each transition is a defined step and its source control has . Then there is a finite, possibly zero-length, chain of defined steps from to in which no step's source has control with . Here converts each integer to its natural part; the invariant hypotheses ensure that no negative value occurs along the stated source run. The conclusion neither requires its endpoints to be marked nor forbids passing through unmarked source controls; a final endpoint may be marked. 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).