The Theory of Persistence

Formal verification

Lean 4 formalisation

Thirty foundational PT theorems, machine-checked with no sorry.

The arithmetic core of Persistence Theory is reproduced in full in Lean 4 + Mathlib. The critical path $T_1 \to T_3 \to s = 1/2 \to T_2 \to L_0 \to T_7 \to W_7\text{-}1$ is kernel-verified in both directions: every step is a formal proof whose correctness is guaranteed by the Lean kernel, and the W7-1 spiral identity now carries both directions. About one hundred and sixty secondary modules cover the surrounding ecosystem. No [THM] statement from Chapter 1 is left on paper alone.

Build status (2026-05-24) : Lean v4.30.0-rc2 · Mathlib master @ e12bcd0 · `lake build` clean on 3587 jobs.

30

named theorems on the critical path
kernel-verified, 0 sorry
including W7-1 reverse, T6b full 4-axiom, T2 spectral bridge

196

Lean modules in total
(8 on the critical path
+ 188 in the ecosystem)

~2,885

formal declarations
(theorems + lemmas + definitions
+ instances)

The critical path

All statements below are proved without external hypotheses beyond Mathlib: each step depends only on the previous ones. Read left to right, the diagram matches the exact logical dependency verified by the Lean kernel.

Site theorems and their Lean modules

Each theorem listed below has a dedicated page on this site and a matching Lean module that can be opened directly on GitHub.

Theorem Short statement Lean module Status
GFT $\log_2 m = D_\mathrm{KL} + H$ — fundamental principle of persistence. PT.Information.GFTIdentity kernel-verified, 0 sorry
L0 The unique memoryless maximum-entropy distribution on even gaps. PT.Information.L0MaxEntropy kernel-verified, 0 sorry
T1 The sieve forbids two consecutive identical residues mod 3. PT.Sieve.T1ForbiddenTransitions kernel-verified, 0 sorry
T2 Exact spectral identity $|\lambda_2(T_{30})| = s^2 = 1/4$. PT.Conservation.T2Alpha kernel-verified, 0 sorry
T3 $T_3 = \mathrm{antidiag}(1,1)$ — the mod-3 matrix is purely off-diagonal. PT.Sieve.T3Antidiagonal kernel-verified, 0 sorry
T4 $\alpha_k \to 1/2$ as the sieve depth $k \to \infty$. PT.NumberTheory.T4MertensActivePrimes kernel-verified, 0 sorry
T5 After p = 2 crystallises, the reduced sieve sector admits a unique physical attractor: $\mu^* = 3+5+7 = 15$. PT.FixedPoint.T7MuStar kernel-verified, 0 sorry
T6 $\sin^2 \theta_p = \delta_p (2 - \delta_p)$ — trigonometry emerges from the sieve. PT.Holonomy.CyclicPhaseIdentity kernel-verified, 0 sorry
N1 The primes are the unique atoms of the multiplicative monoid $(\mathbb{N}_{\geq 1}, \times)$. PT.Sieve.N1AtomicUniqueness kernel-verified, 0 sorry
N2 The Eratosthenes sieve is the unique self-consistent multiplicative sieve on $\mathbb{N}_{\geq 2}$. PT.Sieve.N2SelfCoherence kernel-verified, 0 sorry
N3 $(\mathbb{N}_{\geq 1}, \times)$ is the unique free commutative cancellative UFD monoid with countable atoms. PT.Sieve.N3aMinimalMonoid kernel-verified, 0 sorry
N4 In the canonical sieve ordering, $p = 3$ is the first dynamical level. $p = 2$ has a structurally distinct role (info / anti-info). PT.Sieve.N4DimensionCascade kernel-verified, 0 sorry
BA5 At the reduced attractor $\mu^* = 15$, the sieve coupling is the product $\prod_{p \in \{3,5,7\}} \sin^2\theta_p(q_+)$. PT.Anomaly.BargmannBA5 kernel-verified, 0 sorry
G1 On the CRT-structured sieve simplex, $D_{KL}$ is the unique consistent divergence. PT.Information.T6cG1Autonomous kernel-verified, 0 sorry
G3 Fisher is the unique Markov-monotone Riemannian metric on the simplex. PT.Information.G3FisherUniqueness kernel-verified, 0 sorry
Mertens The function $M(x) - \log\log x$ is bounded — classical, imported into PT. PT.NumberTheory.T5Mertens scaffold
ActivePrime A prime $p$ is active iff $\gamma_p > s = 1/2$ — the active set is exactly $\{3,5,7\}$. PT.Holonomy.ActivePrimeCriterion kernel-verified, 0 sorry
Nc $N_c = N_{\text{spatial}} = 3$: unique integer solution of $(N_c+1)!/(N_c+3) = 2^{N_{\text{spatial}}-1}$. PT.FixedPoint.T7MuStar kernel-verified, 0 sorry
CRT The sieve factors additively: $\mathbb{Z}/P \cong \bigoplus_p \mathbb{Z}/p$. Operations at different primes commute. PT.Stochastic.CRTFactorizationT2 kernel-verified, 0 sorry

Theorems T0, E, F, G, FisherKoide, FourierKoide and OS3 are not formalised yet.

Full catalog by topic

Beyond the critical path and the site theorems featured at the top of this page, 188 additional modules (out of 196 total in the repository) cover the surrounding ecosystem: variants, refinements, auxiliary identities, algebraic structures. Each topic is collapsed below; open a section to see the full list. Every module links to its .lean file on GitHub.

Sieve PT.Sieve.* 32 modules
Stochastic PT.Stochastic.* 27 modules
Conservation PT.Conservation.* 26 modules
Information PT.Information.* 27 modules
Holonomy PT.Holonomy.* 29 modules
Fixed point PT.FixedPoint.* 4 modules
EML (Sheffer) PT.EML.* 7 modules
Analysis PT.Analysis.* 1 module
Math/physics bridge PT.Bridge.* 20 modules
CRT decoupling PT.CrtDecoupling.* 7 modules
  • Empirical — Theorem 6.1 (empirical form) — Phase 2
  • Main — Geometric Decoupling Theorem, Ruelle form (Theorem 6.2)
  • Phase3 — Phase 3 — Infinite-state Theorem 6.1 via Birkhoff–Hopf
  • Phase4 — Phase 4 — The sieve path space and its shift dynamical system
  • Phase4Instance — Phase 4 — Existence of a populated `SieveErgodicSetup`
  • SpectralReduction — Phase 2.5 — Closing the ergodicity loop without external hypothesis
  • Tensor — CRT Tensor Factorization and Ruelle Factorization
Algebra PT.Algebra.* 1 module
  • PMAlgebra — PM algebra — the primorial-modular ring
Chemistry PT.CH.* 1 module
NashDeGiorgi PT.NashDeGiorgi.* 4 modules
  • GammaAtMu — `γ_p(μ)` for variable `μ` — extended threshold values
  • LemmaAFormal — Lemma A — analytical proof of $\gamma_p$ monotonicity in $\mu$
  • MainTheorems — Main theorems of `PT_NASH_DEGIORGI` (Z1, Z2, Z3, Z4)
  • Z1ActiveSet — Z1 — Eventually-exact convergence of the truncated sieve
root PT.root.* 2 modules

Why formalise?

A theorem proved on paper lives in the reader's trust. A kernel-verified theorem demands none: the Lean kernel is a roughly six-thousand-line program, reviewed by the community for over fifteen years, which accepts a declaration theorem X : P := proof only if proof constructs, type by type, a witness for P. Any short-cut, any hidden hypothesis, any "this is obvious" fails typechecking.

For Persistence Theory this discipline already had an immediate effect: while bringing up the T3Antidiagonal module, six concrete mistakes were caught (wrong Mathlib import path, a ring tactic that failed to close a goal, a noncomputable attribute missing on a real literal, ...) that no human reviewer had spotted. The source remains inspectable: every [THM] assertion in the paper has a formal witness pointable to the exact line.

Across the 196 modules under PT/, 195 are entirely sorry-free. The only remaining one is G3FisherUniqueness (Fisher metric uniqueness up to scale), a classical result already marked \leanExternal in the monograph. It is off PT's critical path.

Reproduce the verification

Install the Lean toolchain through elan, then:

git clone https://github.com/Igrekess/PersistenceTheory.git
cd PersistenceTheory/pt_lean
lake exe cache get      # ~1 GB of Mathlib oleans, ~5 min
lake build              # ~5 min cold, ~10 s cached

The Lean version is pinned by lean-toolchain, Mathlib by lake-manifest.json. No version juggling required.

Source code

pt_lean/ repository

196 modules · clean lake build over 3587 jobs.

Documentation

Detailed README

Module catalog by topic (Sieve, Stochastic, Holonomy, …), roadmap.

Monograph

Annotated theorems

In the monograph, formalised theorems carry a \leanProved mention pointing to their Lean proof.