TheoryVersion 1 — October 2026
Step counts in integrable rational maps as discrete logarithms: a complete, formally verified theory of orbits on every level
Yuta Ogura
For four families of integrable maps, proves in Lean over every field, degenerate levels included, that step counts are discrete logarithms on a group, and turns this into a decision procedure that also covers regularity and questions over ℚ.
Abstract
For a rational map σ of a finite-dimensional space over a field K and two states s, t, we determine the set Id(s, t) = {n ∈ ℤ : σⁿ s = t} of step counts—the hom-set from s to t in the action groupoid of the dynamics—without iterating the map. For the Lyness map, the Kahan–Hirota–Kimura discretisation of the Euler top, area-preserving linear maps and a Kahan discretisation of hyperbolic geodesics, we prove, in Lean 4 with Mathlib and for every field (characteristic ≠ 2 where needed), that on every level set of the conserved quantities the map is a translation by a fixed element P of an abelian group A attached to the level, along an injective coordinate ψ. Hence σⁿ s = t if and only if ψ(t) − ψ(s) = nP: step counts are discrete logarithms, Id(s, t) is empty or a residue class modulo the order of P, and the class of ψ(s) modulo ⟨P⟩ is a complete invariant of the orbits. The theorems also cover the degenerate levels (nodal and reducible curves, and the levels of the Euler top with vanishing coordinates). Two further results make the theory usable as a decision procedure. First, the states at which the map is undefined are finitely many explicit states of each level, so whether an orbit ever meets a division by zero (that is, whether the state is regular) is decided by a few more discrete logarithms, in both time directions, and a non-regular state’s finite chain is read off the same logarithms. Second, a reduction theorem for partial rational maps lifts regularity and the absence of paths from the reductions modulo primes to ℚ and reduces step counts from ℚ modulo primes, so that, given a bound on |n|, questions over ℚ, including the negative answer “never”, are settled by finitely many primes and one exact iteration. The dynamics is also axiomatised as a small Martin-Löf theory with a path constant path : Πx. Id(x, step x) and interpreted in the groupoid model of HoTTLean, where the identity type between s and t is exactly the set Id(s, t). The development comprises 1,146 theorems with no sorry and only the standard axioms, and includes an executable certificate checker whose soundness is itself proved in Lean. It is the mathematical foundation of Structure Computer, which answers these questions with independently checkable certificates: on a 2-core machine, a state 7.9 × 10¹⁵ steps away over 𝔽_{2⁶¹−1} is located in 0.4 s, where iteration would take about a century.