Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Recording into integer registers is injective

Proved
Monodromy.Counter.Reversible.Recording.embed_injective

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

computabilitycovering-spacesmonodromy-computation

For arbitrary natural register and control counts n,m, embedding a recorded state (source configuration, natural history) into the reversible table with n+2 integer registers is injective. The embedding retains the source program counter at its recording dispatch, casts all n natural source counters to integers, places the history in the next register and sets the final workspace register to zero.

Statement dependencies: Monodromy.Counter.Recorded.State, Monodromy.Counter.Reversible.Recording.embed, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.State.

Original proof dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Recorded.State, Monodromy.Counter.Reversible.Radix.entry, Monodromy.Counter.Reversible.Radix.size, Monodromy.Counter.Reversible.Recording.base, Monodromy.Counter.Reversible.Recording.copy, Monodromy.Counter.Reversible.Recording.copy_eq_iff, Monodromy.Counter.Reversible.Recording.dispatch, Monodromy.Counter.Reversible.Recording.embed, Monodromy.Counter.Reversible.Recording.frame_history, Monodromy.Counter.Reversible.Recording.frame_old, Monodromy.Counter.Reversible.Recording.framed, Monodromy.Counter.Reversible.Recording.historyRegister, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.State.

Statement elaboration dependencies: Monodromy.Counter.Recorded.State, Monodromy.Counter.Reversible.Recording.embed, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.State.

Proof elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.Recorded.State, Monodromy.Counter.Reversible.Radix.entry, Monodromy.Counter.Reversible.Radix.size, Monodromy.Counter.Reversible.Recording.base, Monodromy.Counter.Reversible.Recording.copy, Monodromy.Counter.Reversible.Recording.copy_eq_iff, Monodromy.Counter.Reversible.Recording.dispatch, Monodromy.Counter.Reversible.Recording.embed, Monodromy.Counter.Reversible.Recording.frame_history, Monodromy.Counter.Reversible.Recording.frame_old, Monodromy.Counter.Reversible.Recording.framed, Monodromy.Counter.Reversible.Recording.historyRegister, Monodromy.Counter.Reversible.Recording.size, Monodromy.Counter.Reversible.State.

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
open Monodromy.Counter.Reversible
open Monodromy.Counter.Reversible.Recording
variable {n m : ℕ}

Formal statement
theorem Monodromy.Counter.Reversible.Recording.embed_injective : Function.Injective (@embed n m) := 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.Reversible.Recording.embed_injective at L5931-L5946 [UTF-8 295662:296611].
Read-back

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

For every pair of natural numbers n,mn,mn,m, the map from a pair (s,h)(s,h)(s,h) consisting of an nnn-natural-register configuration sss on mmm controls and a natural history hhh to the integer-register state E(s,h)E(s,h)E(s,h) is injective. The image has control Ds.pcD_{s.\mathrm{pc}}Ds.pc​, the first nnn register entries equal to the natural counters of sss coerced to integers, the next entry hhh coerced to an integer, and the last entry 000. Here DjD_jDj​ is the finite control representing (j,G0)(j,G_0)(j,G0​) in the left summand of ({0,…,m−1}×Vb)⊔{0,…,m−1}(\{0,\ldots,m-1\}\times V_b)\sqcup\{0,\ldots,m-1\}({0,…,m−1}×Vb​)⊔{0,…,m−1}, enumerated using the product/sum finite equivalences, where b=2m+1b=2m+1b=2m+1 and VbV_bVb​ consists of three globals G0,G1,G2G_0,G_1,G_2G0​,G1​,G2​ and pairs (r,k)(r,k)(r,k) with r<br<br<b, k<8k<8k<8; in particular its cardinality is m(3+8b)+mm(3+8b)+mm(3+8b)+m. Thus equality of these image states implies equality of both full source configurations and histories. No program is an argument of this embedding. Empty register families n=0n=0n=0 are permitted, and for m=0m=0m=0 there are no source configurations, so injectivity holds on an empty domain.

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