The formalization: what is proved, and how to trust it
The paper's two main theorems are machine-checked in Lean 4 over Mathlib: Theorem 1.1 for every complete discrete valuation ring with finite residue field, and Theorem 1.2 as identities of rational functions. This page says exactly what the Lean statements are, what a reader has to audit to trust them, which certificates exist, and how far the rest of the paper is formalized.
1. The four main theorems
All four depend only on the axioms propext, Classical.choice, Quot.sound
(#print axioms, re-run by tools/release_check_local.sh; log below). The codebase contains no sorry,
admit, axiom or native_decide.
main_dvr — SurfaceBlowup/Main.lean:31–51
theorem main_dvr (O : Type) [CommRing O] [IsDomain O] [IsDiscreteValuationRing O] [IsAdicComplete (IsLocalRing.maximalIdeal O) O] [Finite (IsLocalRing.ResidueField O)] [TopologicalSpace O] [IsTopologicalRing O] [CompactSpace O] [T2Space O] [SecondCountableTopology O] [MeasurableSpace O] [BorelSpace O] (htop : IsAdic (IsLocalRing.maximalIdeal O)) (n : ℕ) (σ : FactorType) : SurfaceBlowup.monicDensity O n σ = densityValue (monicExpr n σ) (Nat.card (IsLocalRing.ResidueField O)) ∧ SurfaceBlowup.projectiveDensity O n σ = densityValue (projectiveExpr n σ) (Nat.card (IsLocalRing.ResidueField O))
main_dvr is Theorem 1.1: for every complete DVR O with finite residue field (any characteristic, any
ramification), with its adic topology, Borel σ-algebra and normalized Haar measure, the monic and projective type probabilities are
the values at q = |k| of the universal expressions monicExpr n σ, projectiveExpr n σ
(defined by the finite recursion of Sections 6–7). The statement has no hypotheses on n and σ.
The certified statement assumed 0 < n, ValidType σ and typeDegree σ = n. The proof never used
them, so the published theorem drops them and implies the certified one.
Tests/NonVacuity.lean instantiates it at 𝔽_q⟦X⟧, Tests/PadicInt.lean at ℤ_p and Tests/Ramified.lean at the ring of integers of the ramified field ℚ_p(√p).
The topological hypotheses are never an extra assumption: main_dvr_adic (2026-11-12) proves that the 𝔪-adic topology of every complete DVR with finite residue field is a compact, Hausdorff, second-countable ring topology, and states main_dvr for it and its Borel σ-algebra with no topological hypothesis; main_field_form_ramified_adic does the same for every finite K/ℚ_p.
recip_main — SurfaceBlowup/Reciprocity/Main.lean:279–300
theorem recip_main (n : ℕ) (hn : 0 < n) (σ : FactorType) : (monicExpr n σ).rational = ((lawCoeff (rootLaw n) σ).subst (.inv .var)).rational ∧ (projectiveExpr n σ).rational = ((projectiveExpr n σ).subst (.inv .var)).rational
recip_main is Theorem 1.2, coefficientwise: A_{n,σ}(q) = B_{n,σ}(1/q) and
R_{n,σ}(1/q) = R_{n,σ}(q) in ℚ(q), where B_{n,σ} is the coefficient of the root law
rootLaw n (the law of S(1;n), which root_cell_law identifies with the Xn-cluster
model). It assumes n > 0.
The two field forms (corollaries of main_dvr)
main_field_form — SurfaceBlowup/Main.lean:53–91
theorem main_field_form (n : ℕ) (σ : FactorType) : ∃ A R : RatFunc ℚ, A = (monicExpr n σ).rational ∧ R = (projectiveExpr n σ).rational ∧ (∀ q : ℕ, PrimePower q → RegularAt A q ∧ RegularAt R q) ∧ (∀ q : ℕ, PrimePower q → RatFunc.eval (RingHom.id ℚ) q A = (monicExpr n σ).eval q ∧ RatFunc.eval (RingHom.id ℚ) q R = (projectiveExpr n σ).eval q) ∧ ∀ (p : ℕ) [Fact p.Prime] (K : Type) [Field K] [Algebra ℚ_[p] K] [Algebra ℤ_[p] K] [IsScalarTower ℤ_[p] ℚ_[p] K] [FiniteDimensional ℚ_[p] K] [TopologicalSpace (padicIntegers p K)] [IsTopologicalRing (padicIntegers p K)] [CompactSpace (padicIntegers p K)] [T2Space (padicIntegers p K)] [SecondCountableTopology (padicIntegers p K)] [MeasurableSpace (padicIntegers p K)] [BorelSpace (padicIntegers p K)], PadicUnramified p K → IsAdic (Ideal.span {(p : padicIntegers p K)}) → monicDensity (padicIntegers p K) n σ = densityValue (monicExpr n σ) (Nat.card (padicIntegers p K ⧸ Ideal.span {(p : padicIntegers p K)})) ∧ projectiveDensity (padicIntegers p K) n σ = densityValue (projectiveExpr n σ) (Nat.card (padicIntegers p K ⧸ Ideal.span {(p : padicIntegers p K)})) ∧ monicDensity (padicIntegers p K) n σ = ENNReal.ofReal ((RatFunc.eval (RingHom.id ℚ) ((Nat.card (padicIntegers p K ⧸ Ideal.span {(p : padicIntegers p K)}) : ℕ) : ℚ) A : ℚ) : ℝ) ∧ projectiveDensity (padicIntegers p K) n σ = ENNReal.ofReal ((RatFunc.eval (RingHom.id ℚ) ((Nat.card (padicIntegers p K ⧸ Ideal.span {(p : padicIntegers p K)}) : ℕ) : ℚ) R : ℚ) : ℝ)
main_field_form_ramified — SurfaceBlowup/Main.lean:93–118
theorem main_field_form_ramified (n : ℕ) (σ : FactorType) (p : ℕ) [Fact p.Prime] (K : Type) [Field K] [Algebra ℚ_[p] K] [Algebra ℤ_[p] K] [IsScalarTower ℤ_[p] ℚ_[p] K] [FiniteDimensional ℚ_[p] K] [TopologicalSpace (padicIntegers p K)] [IsTopologicalRing (padicIntegers p K)] [CompactSpace (padicIntegers p K)] [T2Space (padicIntegers p K)] [SecondCountableTopology (padicIntegers p K)] [MeasurableSpace (padicIntegers p K)] [BorelSpace (padicIntegers p K)] (had : letI := padicIntegers_isDVR p K; IsAdic (IsLocalRing.maximalIdeal (padicIntegers p K))) : letI := padicIntegers_isDVR p K monicDensity (padicIntegers p K) n σ = ENNReal.ofReal ((RatFunc.eval (RingHom.id ℚ) (Nat.card (IsLocalRing.ResidueField (padicIntegers p K)) : ℚ) (monicExpr n σ).rational : ℚ) : ℝ) ∧ projectiveDensity (padicIntegers p K) n σ = ENNReal.ofReal ((RatFunc.eval (RingHom.id ℚ) (Nat.card (IsLocalRing.ResidueField (padicIntegers p K)) : ℚ) (projectiveExpr n σ).rational : ℚ) : ℝ)
Corollaries added in v1.2
An audit of v1.1 found the statements above faithful to the paper but weaker than its prose in four places. Version 1.2 exports the missing corollaries. No existing statement changed. A second model (OpenAI's gpt-6.1-sol, through Codex) read the new statements against the paper and reported no defect. It did not rebuild them.
- Clamping.
main_dvrgives a density asENNReal.ofRealof a rational number, andENNReal.ofRealsends negative numbers to zero.monicExpr_eval_nonneg,projectiveExpr_eval_nonnegandclusterExpr_eval_nonnegprove that the number is never negative at a prime power. - The cluster law as a rational function.
cluster_rational_evalshows thatB_{n,σ}, read as an element of ℚ(q), takes the value of the cluster expression at every prime power.global_rational_evalalready did this forAandR. - Degree zero.
recip_mainassumesn > 0.reciprocity_recipRatholds in every degree. - Mixed characteristic.
Tests/PadicInt.leanappliesmain_dvrtoℤ_pwith Mathlib's own topology, which it proves to be the(p)-adic one. Since 2026-11-12Tests/Ramified.leanalso applies it over a ramified base, the ring of integers ofℚ_p(√p), which it proves ramified (not_padicUnramified).
universal_type_laws is Theorem 1.1 in one statement. Each probability clause has the form
0 ≤ r ∧ density = ENNReal.ofReal r, where r is a value of Mathlib's RatFunc.eval. The two parts
together determine the density.
universal_type_laws — SurfaceBlowup/Corollaries/RationalForm.lean:100–150
theorem universal_type_laws (n : ℕ) (σ : FactorType) : ∃ A B R : RatFunc ℚ, A = (monicExpr n σ).rational ∧ B = (clusterExpr n σ).rational ∧ R = (projectiveExpr n σ).rational ∧ (∀ q : ℕ, PrimePower q → RegularAt A q ∧ RegularAt B q ∧ RegularAt R q) ∧ (∀ q : ℕ, PrimePower q → 0 ≤ RatFunc.eval (RingHom.id ℚ) (q : ℚ) A ∧ 0 ≤ RatFunc.eval (RingHom.id ℚ) (q : ℚ) B ∧ 0 ≤ RatFunc.eval (RingHom.id ℚ) (q : ℚ) R) ∧ ∀ (O : Type) [CommRing O] [IsDomain O] [IsDiscreteValuationRing O] [IsAdicComplete (IsLocalRing.maximalIdeal O) O] [Finite (IsLocalRing.ResidueField O)] [TopologicalSpace O] [IsTopologicalRing O] [CompactSpace O] [T2Space O] [SecondCountableTopology O] [MeasurableSpace O] [BorelSpace O], IsAdic (IsLocalRing.maximalIdeal O) → (0 ≤ RatFunc.eval (RingHom.id ℚ) ((Nat.card (IsLocalRing.ResidueField O) : ℕ) : ℚ) A ∧ monicDensity O n σ = ENNReal.ofReal ((RatFunc.eval (RingHom.id ℚ) ((Nat.card (IsLocalRing.ResidueField O) : ℕ) : ℚ) A : ℚ) : ℝ)) ∧ (0 ≤ RatFunc.eval (RingHom.id ℚ) ((Nat.card (IsLocalRing.ResidueField O) : ℕ) : ℚ) B ∧ clusterDensity O n σ = ENNReal.ofReal ((RatFunc.eval (RingHom.id ℚ) ((Nat.card (IsLocalRing.ResidueField O) : ℕ) : ℚ) B : ℚ) : ℝ)) ∧ (0 ≤ RatFunc.eval (RingHom.id ℚ) ((Nat.card (IsLocalRing.ResidueField O) : ℕ) : ℚ) R ∧ projectiveDensity O n σ = ENNReal.ofReal ((RatFunc.eval (RingHom.id ℚ) ((Nat.card (IsLocalRing.ResidueField O) : ℕ) : ℚ) R : ℚ) : ℝ))
reciprocity_ringHom is Theorem 1.2 in every degree. A ring endomorphism of ℚ(q) is determined by the image of
q, so v is the substitution q ↦ 1/q.
reciprocity_ringHom — SurfaceBlowup/Corollaries/RationalForm.lean:219–228
theorem reciprocity_ringHom (n : ℕ) (σ : FactorType) : ∃ v : RatFunc ℚ →+* RatFunc ℚ, v RatFunc.X = (RatFunc.X)⁻¹ ∧ (monicExpr n σ).rational = v (clusterExpr n σ).rational ∧ v (projectiveExpr n σ).rational = (projectiveExpr n σ).rational
2. The trust boundary
Lean checks proofs, not statements. To trust the theorems above a reader must audit only:
SurfaceBlowup/Basic.lean(~500 lines): factorization types, the rational expressionsExpr, laws, recursion states and tangent patterns, the weights, the recursionstateLaw, the universal expressionsmonicExpr/projectiveExpr, and the densitiesmonicDensity/projectiveDensity. These are, constant for constant, the definitions published as Prove2Me nodes N001–N010 (namespaceSurfaceBlowupV2).Checks/run_checks.shchecked this at kernel level for v1.0.0.- The statements of the four theorems above (in
Main.leanandReciprocity/Main.lean).
Every other file contains only proofs and auxiliary definitions that do not occur in these statements.
The cluster and étale theorems of v1.1 need two more short files of definitions:
Cluster/Defs.lean (clusterCell, clusterExpr,
clusterDensity) and Etale/Defs.lean (IsEtaleForm,
etaleMonicDensity, etaleProjectiveDensity). The v1.2 corollaries add no definition. They are stated with the
definitions above and Mathlib's RatFunc.eval. reciprocity_recipRat also mentions recipRat, the
endomorphism q ↦ q⁻¹ defined in Reciprocity/Defs.lean. reciprocity_ringHom avoids it.
Relation to the certified statements. The published statements of main_dvr,
main_field_form and recip_main are the certified ones with their unused hypotheses on n and
σ removed, so each implies its certified form. Checks/run_checks.sh checked this in the kernel, in
implication form. It passed for v1.0.0, as the note in the v1.1 release log records. The
certified trees no longer exist, so the check cannot be repeated. Since v1.0.0 each release is checked against the one before it.
Section 3 lists those checks. The statements use only the definitions of Basic.lean.
How the proof differs from the paper. The formal proof follows the paper's architecture (recursion on blow-up
states, Gaussian measure identity, Hensel assembly, contact algebra for reciprocity) but works on the concrete surfaces
O⟦T,X⟧/(π − u·T^a·X^b) rather than on all regular surfaces, replaces analytic arguments (analytic normalization,
inverse-function theorem, change of variables) by finite-digit congruence and cylinder-set arguments, replaces the formal-scheme
cohomology of Section 4 by explicit two-chart Čech complexes, and handles inseparability through type predicates with finite
integral closures plus a Haar-null bridge (orig_monicDensity_eq). Nothing is cited from the literature: everything
bottoms out in Mathlib.
3. Certificates
- What a reader can check today. Clone the
public repository and run
tools/release_check_local.sh. The script builds the codebase, checks the axioms of the main theorems, and compares the source text of every statement with v1.2. The development is also on Prove2Me as the public treeTypeDensity, where the platform verified every theorem. Section 4 describes it. The items below record earlier checks. - Release check v1.1 (
tools/release_check.sh, 2026-10-17). Build: 3475 jobs, 0 warnings. Axioms: 12 of 12 theorems use only the three axioms. Forbidden tokens: none. The statement-preservation step reportsFAIL (0/3). The certified trees' build caches had been deleted, so the step could not run. The note in the log gives the substitute evidence:Basic.lean,Main.leanandReciprocity/Main.leanwere byte-identical to tag v1.0.0, for which the note records a 3/3 pass of the kernel-level check. - Release check v1.2 (
tools/release_check_local.sh, 2026-11-11, on a fresh clone of the public repository on another machine). Build: 3480 jobs, 0 warnings. Axioms: 22 of 22 main theorems and all 25 public theorems added in v1.2 use only the three axioms. Forbidden tokens: none. The certified trees were not available, so preservation against them did not run. Insteadtools/StmtDump.leancompared v1.2 with v1.1. All 1853 constants of v1.1 have identical type and value hashes, and 20 constants are new. Docstrings changed in ten files, includingBasic.lean, so that file is no longer byte-identical to v1.0.0. The statement dump is the evidence that its constants are unchanged. - Release check v1.3 (
tools/release_check_local.sh, 2026-11-11). Version 1.3 moves the codebase from Leanv4.33.1to Leanv4.35.0with Mathlib56a0058, and removes sign-off wording from docstrings. Build: 3582 jobs, 0 warnings. Axioms: 22 of 22 main theorems and all 25 theorems added in v1.2 use only the three axioms. Forbidden tokens: none. Kernel-term hashes change with the toolchain, so this check compares source text instead: for a theorem the signature up to its proof, and for a definition the whole declaration. Of 2503 statements, 2465 are identical to v1.2 and 33 differ only in whitespace, because Lean v4.35.0 parses set literals more strictly. Five internal lemmas of the reciprocity proof drop an argument ofPowerSeries.derivativethat Mathlib made implicit. No statement inBasic.lean,Main.leanor the corollaries changed. - Monolith certificates of the trees the codebase was obtained from: the published 1001-theorem tree for
main_field_form, its reciprocity extension (133 theorems) forrecip_main, and the general-DVR tree formain_dvr(with non-vacuity over 𝔽p⟦X⟧ and 𝔽pm⟦X⟧).
Copies: release check v1.3 · axioms of the main theorems (v1.3) · release check v1.2 · axioms of the main theorems (v1.2) · axioms and statements of the v1.2 theorems · statement dumps v1.1.0 and v1.2.0 · release check v1.1 · axioms (v1.1) · monolith certificate: main_field_form · monolith certificate: main_dvr (general DVR) · monolith certificate: recip_main.
'SurfaceBlowup.main_dvr' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.main_field_form' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.main_field_form_ramified' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.recip_main' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.main_dvr_cluster' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.cluster_formula_regular' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.recip_cluster' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.clusterDensity_eq_etale' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.binary_nonEtale_null' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.monicDensity_eq_etale' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.projectiveDensity_eq_etale' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.main_dvr_etale' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.monicExpr_eval_nonneg' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.projectiveExpr_eval_nonneg' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.clusterExpr_eval_nonneg' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.main_dvr_toReal' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.main_dvr_cluster_toReal' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.cluster_rational_eval' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.universal_type_laws' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.reciprocity_recipRat' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.reciprocity_ringHom' depends on axioms: [propext, Classical.choice, Quot.sound] 'SurfaceBlowup.recip_main_all_degrees' depends on axioms: [propext, Classical.choice, Quot.sound]
4. Prove2Me
The complete development is published on Prove2Me under the namespace TypeDensity (37 definition modules and 1059 theorems, every theorem Proved on the platform, including main_dvr, main_field_form, main_field_form_ramified, recip_main, the v1.1 theorems main_dvr_cluster and main_dvr_etale, and the v1.2 theorems universal_type_laws and reciprocity_ringHom); the tree was made public on 2026-10-17. The 25 theorems added in v1.2 were published there on 2026-11-11, together with one more definition module. The tree is in the platform's environment, Lean v4.33.1 with Mathlib 0df444a, so it corresponds to tag v1.2.0 of the repository. Visibility: PUBLIC. Link pattern used on this site: https://prove2.me/theorems/{theorem_id}. These public pages open without a login (last checked 2026-11-11). The platform also exports its public trees as Lean files to a repository, github.com/prove2me/formalpedia. The export is a snapshot and can lag behind the platform. The v1.2 theorems, published on 2026-11-11, are in the export of 2026-11-12. The unified codebase was obtained from those trees by merging along the
usage DAG and three golfing cycles; declarations are matched to Prove2Me nodes by name and a curated alias table.
5. How much of the paper is formalized
The map below lists every numbered statement of the paper (32 theorems, lemmas, propositions, corollaries, examples and remarks), the key displays ((1.1)–(1.4), (G), (H), (S), (T), the recursion and assembly displays, the Section 10–11 formulas), and the key unnumbered definitions — 82 entries in all. Relations: exact / definition — the Lean statement or definition is the paper's; specialization — proved in a special setting (concrete surfaces; a = b = 1); covered by lemmas — no single Lean statement, the listed declarations jointly establish the content, often restructured; instances checked — particular values only; not formalized.
| entries | exact / definition | partial | not formalized | |
|---|---|---|---|---|
| all entries | 82 | 35 | 35 | 12 |
| numbered statements only | 32 | 8 | 20 | 4 |
Not formalized: the totally ramified recursion of Section 10 (only the values A(3,1)(3) = 10/121,
A(4,1)(2) = 107/1533, R(4,1)(2) = 856/15841 are checked, and the projective half of Corollary 10.3 is an
instance of recip_main); the literature comparisons of Section 11 (root moments, the BGMR splitting recursion,
Shmueli's unramified formulas); the crossing reciprocity formula of Theorem 9.3; the scaling identities in (H); and the worked
Example 5.2. The map, as JSON: data/paper_lean_map.json (with the reverse index Lean →
paper); browsable reverse index: declaration index.
6. The full map
Click a column header to sort.