Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The finite Turing configuration encoding is injective

Proved
Monodromy.Counter.TuringCompiler.encode_injective

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

computabilitycovering-spacesmonodromy-computation

For every positive alphabet size a and arbitrary natural state count q, the three-counter encoding of a TM0 configuration is injective. It stores the machine state and current tape symbol in the dispatch address, the left and right blank-tailed tape codes in counters 0 and 1 using base a+1, and 0 in the scratch counter. No nonzero assumption on q is required.

Statement dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.TuringCompiler.encode, Monodromy.Counter.TuringCompiler.size.

Original proof dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.TuringCompiler.Row, Monodromy.Counter.TuringCompiler.dispatch_injective, Monodromy.Counter.TuringCompiler.encode, Monodromy.Counter.TuringCompiler.size, Monodromy.TapeCode.encode, Monodromy.TapeCode.encode_injective.

Statement elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.TuringCompiler.encode, Monodromy.Counter.TuringCompiler.size.

Proof elaboration dependencies: Monodromy.Counter.Configuration, Monodromy.Counter.TuringCompiler.Row, Monodromy.Counter.TuringCompiler.dispatch_injective, Monodromy.Counter.TuringCompiler.encode, Monodromy.Counter.TuringCompiler.size, Monodromy.TapeCode.encode, Monodromy.TapeCode.encode_injective.

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.TuringCompiler
open Turing
variable (a q : ℕ) [NeZero a] [NeZero q]
omit [NeZero q] 


Formal statement
theorem Monodromy.Counter.TuringCompiler.encode_injective : Function.Injective (encode a q) := 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.TuringCompiler.encode_injective at L1537-L1561 [UTF-8 72553:73469].
Read-back

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

For every positive natural number aaa and every natural number qqq, the following map is injective on all configurations of the Turing model with alphabet {0,…,a−1}\{0,\ldots,a-1\}{0,…,a−1}, blank symbol 000, and controls {0,…,q−1}\{0,\ldots,q-1\}{0,…,q−1}. A configuration consists of its control uuu, scanned symbol hhh, and two half-tapes that are finite lists modulo adjoining trailing blanks. Encode each half-tape with digits d0,d1,…d_0,d_1,\ldotsd0​,d1​,… by the natural number ∑jdj(a+1)j\sum_j d_j(a+1)^j∑j​dj​(a+1)j, put the left and right codes in registers 000 and 111, put 000 in register 222, and use the dispatch control tagged by (u,h)(u,h)(u,h) in the finite control set ({0,…,q−1}×{0,…,a−1})×(1+((a+5)+(a+(4(a+1)+1))))(\{0,\ldots,q-1\}\times\{0,\ldots,a-1\})\times(1+((a+5)+(a+(4(a+1)+1))))({0,…,q−1}×{0,…,a−1})×(1+((a+5)+(a+(4(a+1)+1)))), identified with its cardinality by a fixed finite enumeration. Equality of these encoded configurations implies equality of the complete original configurations, including both blank-padded half-tapes. There is no nonzero assumption on qqq in this declaration: at q=0q=0q=0 there are no source configurations and injectivity is vacuous. The case a=1a=1a=1, in which every tape cell is blank, is included.

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