Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Agreement on live instructions preserves a renamed step

Proved
Monodromy.Counter.step_map_live

by Xiaoyang Liu · Nov 5, 2026 · Mathlib 0df444a (Lean v4.33.1)

computabilitycovering-spacesmonodromy-computation

For arbitrary natural register and control counts n,m,k, let a map the m old control addresses into k new addresses; a need not be injective. Suppose two n-counter programs agree, after renaming every destination by a, on each old instruction that is not halt. Every successful old step s→t then becomes a successful new step from the configuration with control a(s.pc) and unchanged counters to the similarly renamed t. No agreement is required at old halt addresses.

Statement dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Instruction, Monodromy.Counter.Program, Monodromy.Counter.mapConfiguration, Monodromy.Counter.mapInstruction, Monodromy.Counter.step.

Original proof dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Instruction, Monodromy.Counter.Program, Monodromy.Counter.mapConfiguration, Monodromy.Counter.mapInstruction, Monodromy.Counter.step.

Statement elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Instruction, Monodromy.Counter.Program, Monodromy.Counter.mapConfiguration, Monodromy.Counter.mapInstruction, Monodromy.Counter.step.

Proof elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Instruction, Monodromy.Counter.Program, Monodromy.Counter.mapConfiguration, Monodromy.Counter.mapInstruction, Monodromy.Counter.step.

Preamble
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
variable {n m k : ℕ}

Formal statement
theorem Monodromy.Counter.step_map_live (address : Fin m → Fin k)
    (oldProgram : Program n m) (newProgram : Program n k)
    (agrees : ∀ label, oldProgram label ≠ .halt →
      newProgram (address label) = mapInstruction address (oldProgram label))
    {state result : Configuration n m} (running : step oldProgram state = some result) :
    step newProgram (mapConfiguration address state) = some (mapConfiguration address result) := by sorry
Source
Authoritative local working-tree snapshot SHA-256 e03ce2d08e07ee663140bec213fb21e995f44153a3c556c908fcf1c8d6fefe6c; repository https://github.com/ERHUTUZI123/monodromy. The remote Git base is incomplete and is not asserted to contain these declarations. src/Monodromy/Counter.lean (file SHA-256 40536289575067aae1ed4154805e219805a1c786ccfdfcbe632ea7478a40636a): Monodromy.Counter.step_map_live at L844-L864 [UTF-8 39055:40123].
Read-back

What the Lean code literally says, in plain math · OpenAI Codex (independent agent)

For all natural numbers n,m,kn,m,kn,m,k, let PPP be an mmm-label program on nnn natural-number counters, let QQQ be a kkk-label program on the same counters, and let f:{0,…,m−1}→{0,…,k−1}f:\{0,\ldots,m-1\}\to\{0,\ldots,k-1\}f:{0,…,m−1}→{0,…,k−1} be any function, with no injectivity assumption. An instruction either increments a specified register and jumps, branches on a specified register being zero and otherwise decrements it before jumping, or halts; an increment always has a successor, a zero decrement leaves all counters unchanged, a positive decrement reduces that counter by one, and halt has no successor. Suppose that for every label ℓ\ellℓ at which P(ℓ)P(\ell)P(ℓ) is not halt, Q(f(ℓ))Q(f(\ell))Q(f(ℓ)) is the instruction obtained from P(ℓ)P(\ell)P(ℓ) by applying fff to each target label and retaining the register and instruction kind. For arbitrary source configurations s,ts,ts,t, if one PPP-step returns ttt from sss, then one QQQ-step from (f(s.pc),s.counters)(f(s.\mathrm{pc}),s.\mathrm{counters})(f(s.pc),s.counters) returns (f(t.pc),t.counters)(f(t.\mathrm{pc}),t.\mathrm{counters})(f(t.pc),t.counters). No condition is imposed on QQQ at images of halting labels beyond any constraints inherited from other live preimages. Zero sizes are allowed; m=0m=0m=0 leaves no source configurations, and a successful transition cannot exist for a zero-register program, whose only available instruction is halt.

Human review
  • Endorsed by marwahaha · Nov 6, 2026

  • Endorsed by Xiaoyang Liu · Nov 6, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me