Unit-shift source transitions survive prime compression as first returns
ProvedMonodromy.Counter.Reversible.PrimeCompression.step_firstReturnFor arbitrary natural n,q,e, distinct-prime basis and source table with complementary same-register tests at shared source or target vertices, assume every shift amount is either +1 or −1; tests are also allowed. Every successful source step between the integer casts of two natural-counter configurations u,v yields a first return between their two-counter prime encodings. Both endpoints are retained source boundaries, and one successful compiled step is followed by a finite possibly empty chain whose departure states avoid those boundaries.
Statement dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Reversible.Action.UnitShift, Monodromy.Counter.Reversible.Deterministic, Monodromy.Counter.Reversible.Edge, Monodromy.Counter.Reversible.PrimeCompression.FirstReturn, Monodromy.Counter.Reversible.PrimeCompression.encode, Monodromy.Counter.Reversible.PrimeCompression.naturalState, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.Table, Monodromy.Counter.Reversible.TargetCompatible, Monodromy.Counter.Reversible.step, Monodromy.PrimeCode.Basis.
Original proof dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Reversible.Action, Monodromy.Counter.Reversible.Action.UnitShift, Monodromy.Counter.Reversible.Action.apply, Monodromy.Counter.Reversible.Action.enabled, Monodromy.Counter.Reversible.Deterministic, Monodromy.Counter.Reversible.Edge, Monodromy.Counter.Reversible.Edge.enabled, Monodromy.Counter.Reversible.Edge.execute, Monodromy.Counter.Reversible.PrimeCompression.FirstReturn, Monodromy.Counter.Reversible.PrimeCompression.decrement_firstReturn, Monodromy.Counter.Reversible.PrimeCompression.encode, Monodromy.Counter.Reversible.PrimeCompression.increment_firstReturn, Monodromy.Counter.Reversible.PrimeCompression.naturalState, Monodromy.Counter.Reversible.PrimeCompression.naturalState_injective, Monodromy.Counter.Reversible.PrimeCompression.naturalState_shift, Monodromy.Counter.Reversible.PrimeCompression.test_firstReturn, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.StepRel, Monodromy.Counter.Reversible.Table, Monodromy.Counter.Reversible.TargetCompatible, Monodromy.Counter.Reversible.step, Monodromy.Counter.Reversible.step_iff, Monodromy.PrimeCode.Basis.
Statement elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Reversible.Action.UnitShift, Monodromy.Counter.Reversible.Deterministic, Monodromy.Counter.Reversible.Edge, Monodromy.Counter.Reversible.PrimeCompression.FirstReturn, Monodromy.Counter.Reversible.PrimeCompression.encode, Monodromy.Counter.Reversible.PrimeCompression.naturalState, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.Table, Monodromy.Counter.Reversible.TargetCompatible, Monodromy.Counter.Reversible.step, Monodromy.PrimeCode.Basis.
Proof elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Reversible.Action, Monodromy.Counter.Reversible.Action.UnitShift, Monodromy.Counter.Reversible.Action.apply, Monodromy.Counter.Reversible.Action.enabled, Monodromy.Counter.Reversible.Deterministic, Monodromy.Counter.Reversible.Edge, Monodromy.Counter.Reversible.Edge.enabled, Monodromy.Counter.Reversible.Edge.execute, Monodromy.Counter.Reversible.PrimeCompression.FirstReturn, Monodromy.Counter.Reversible.PrimeCompression.decrement_firstReturn, Monodromy.Counter.Reversible.PrimeCompression.encode, Monodromy.Counter.Reversible.PrimeCompression.increment_firstReturn, Monodromy.Counter.Reversible.PrimeCompression.naturalState, Monodromy.Counter.Reversible.PrimeCompression.naturalState_injective, Monodromy.Counter.Reversible.PrimeCompression.naturalState_shift, Monodromy.Counter.Reversible.PrimeCompression.test_firstReturn, Monodromy.Counter.Reversible.State, Monodromy.Counter.Reversible.StepRel, Monodromy.Counter.Reversible.Table, Monodromy.Counter.Reversible.TargetCompatible, Monodromy.Counter.Reversible.step, Monodromy.Counter.Reversible.step_iff, 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.step_firstReturn (basis : PrimeCode.Basis n) (source : Table n q e)
(deterministic : Deterministic source) (compatible : TargetCompatible source)
(unit : ∀ edge, Action.UnitShift (source edge).action)
{before after : Counter.Configuration n q}
(transition : step source (naturalState before) = some (naturalState after)) :
FirstReturn basis source deterministic compatible
(encode basis source deterministic compatible before)
(encode basis source deterministic compatible after) := 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. Assume in addition that every shift in is by or , with all tests permitted. For any two natural-counter configurations , if one integer-table step of from is exactly after coercing all counters to integers, then there is a first return under from to . In particular both source endpoints here have nonnegative counters; the theorem does not assert the premise for a decrement of a zero natural counter. By a first return from to is meant that both controls equal for some source row , and that there is one defined step from followed by a finite, possibly empty, chain of defined steps to , every source state in that latter chain having control different from every . Thus the run has positive length, the last state may be a boundary, and only control, not scratch-counter values, defines a boundary. 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).