Riemann hypothesis: the Lean proof, cleaned up together
The 2026 Lean proof of the Riemann hypothesis and GRH, machine-checked by others, not refereed, no word from Clay; cleaned up together: more readable, faster to build, the theorems unchanged

Comparing changes
Choose two branches to see what changed, then open a pull request to bring the work across.
Able to merge. These branches can be merged automatically.
A pull request is already open: #39 refactor(Reduction): state two placeClass lemmas without `q₀ ∣ q₁ s`
3 commits
+57 −0 routes/s5-drop-hdvd-fieldsandplaces/README.md added View file
| @@ -0,0 +1,57 @@ | ||
| 1 | +--- | |
| 2 | +issue: 13 | |
| 3 | +status: done | |
| 4 | +--- | |
| 5 | +# s5-drop-hdvd-fieldsandplaces | |
| 6 | + | |
| 7 | +**Pull request #39**, into `main`, at `3da49be`. | |
| 8 | + | |
| 9 | +Unit: `src/New/Reduction/Data` (with its caller in `src/New/Reduction/PrimeSums.lean`). | |
| 10 | + | |
| 11 | +## What was wrong | |
| 12 | + | |
| 13 | +Two lemmas there carried `(h_dvd : P.q₀ ∣ P.q₁ s)`, a hypothesis about the parameters that is true | |
| 14 | +for every `P` and `s` by definition: `New.Parameters.q₁ s` is the abbreviation `P.q₀ * towerDeg s`, | |
| 15 | +and `New.Parameters.q₀_dvd_q₁` is exactly `P.q₀.dvd_mul_right (towerDeg s)`. Neither proof used the | |
| 16 | +hypothesis except to hand it to `New.Parameters.placeClass`, which takes a divisor of `q₁` as an | |
| 17 | +argument. So both were stated one step less generally than they hold: | |
| 18 | + | |
| 19 | +- `New.Parameters.card_placeClass_eq_one_eq_towerDeg` | |
| 20 | +- `New.Parameters.placeClass_placeOfInt_eq_neg_one_iff` (`@[simp]`) | |
| 21 | + | |
| 22 | +## What changed | |
| 23 | + | |
| 24 | +The binder is dropped in both, `P.q₀_dvd_q₁ s` is what `placeClass` is fed, the docstrings lose their | |
| 25 | +"suppose `q₀ ∣ q₁`", and the caller `New.Data.card_aPlaces` passes no hypothesis. The proof of the | |
| 26 | +`@[simp]` lemma is untouched; the caller that uses it, `New.Data.mem_aPlaces_iff_of_mul_mem_bPlaces`, | |
| 27 | +needs no change, since two proofs of `P.q₀ ∣ P.q₁ D.towerExp` are the same proposition. | |
| 28 | + | |
| 29 | +## Verdicts, on `3da49be` | |
| 30 | + | |
| 31 | +- `challenge`: success — "ok: 3 challenge files and the build configuration as approved; 809 Lean | |
| 32 | + files, 484842 lines, toolchain leanprover/lean4:v4.37.0-rc1". | |
| 33 | +- `build`: success — "ok: lake build passes with no sorry; 5 theorem(s) report propext, | |
| 34 | + Classical.choice, Quot.sound only". | |
| 35 | +- `replay`: pending, as it is for every pull request until the maintainer's round. | |
| 36 | + | |
| 37 | +No Lean on this machine, so nothing was compiled locally: `build` was the first compile of this | |
| 38 | +change, and it is what says the changed modules compile and that no `sorry` came in. | |
| 39 | + | |
| 40 | +## What I looked for, and threw away | |
| 41 | + | |
| 42 | +A scan of every `theorem`/`lemma` in `src/Lib` and `src/New` for an explicit hypothesis whose name | |
| 43 | +occurs nowhere after its binder gave candidates, but most were not hypotheses at all (`∃` witnesses, | |
| 44 | +set-builder subtypes) or were used without being named: `grind`, `simpa` (= `simp` then | |
| 45 | +`assumption`), `simp [*]`, `lia`, `gcongr`, `fun_prop` and `simp`'s own discharger all read the local | |
| 46 | +context, so "the name does not appear" is not enough. | |
| 47 | +`src/New/Congruences/Lifting/LongGap.lean:86` (`h_le`, used by `by grind`) and | |
| 48 | +`src/Lib/Analytic/EntireLFunction.lean:110` (`hE`, used by `by fun_prop`) are two examples of that | |
| 49 | +trap. What survives a scan without a compiler is a hypothesis that follows from the definitions, | |
| 50 | +which is what this route does. | |
| 51 | + | |
| 52 | +## Next | |
| 53 | + | |
| 54 | +Nothing here: the merge waits for the maintainer's replay of #39. Other folders of `src/New/Reduction` | |
| 55 | +are still free under #13 — the three candidates the same scan left in `src/New/Congruences/Lifting` | |
| 56 | +(`SafeMoves.lean`, `LongGap.lean`, `CupProductBound.lean`) need a machine with Lean to settle, since | |
| 57 | +their proofs contain a context-reading tactic. | |
+15 −15 src/New/Reduction/Data/FieldsAndPlaces.lean View file
| @@ -336,17 +336,17 @@ lemma numInfPlaces_E (s : ℕ) : Core.numInfPlaces (P.E s) = towerDeg s * P.q₀ | ||
| 336 | 336 | simp [← natDegree_cyclotomic _ ℂ, ← expand_towerDeg_cyclotomic, natDegree_expand] |
| 337 | 337 | simp [card_congr (P.placeMulEquiv s).toEquiv, h_deg, mul_comm] |
| 338 | 338 | |
| 339 | -/-- Given that `P.q₀` divides `P.q₁ s` (`h_dvd`), exactly `towerDeg s = P.q₁ s / P.q₀` elements `v` | |
| 340 | -of `P.Φ s`, the infinite places of `P.E s`, have class `1` modulo `P.q₀` | |
| 341 | -(`New.Parameters.placeClass`). -/ | |
| 342 | -lemma card_placeClass_eq_one_eq_towerDeg (h_dvd : P.q₀ ∣ P.q₁ s) : | |
| 343 | - #{v : P.Φ s | P.placeClass h_dvd v = 1} = towerDeg s := by | |
| 344 | - -- The homomorphism `P.placeClass h_dvd` is onto `(ZMod q₀)ˣ`, so its kernel has index `φ(q₀)` in | |
| 345 | - -- the group of the `towerDeg s * φ(q₀)` infinite places. | |
| 346 | - have h_index : (P.placeClass h_dvd).ker.index = P.q₀.totient := by | |
| 339 | +/-- Exactly `towerDeg s = P.q₁ s / P.q₀` elements `v` of `P.Φ s`, the infinite places of `P.E s`, | |
| 340 | +have class `1` modulo `P.q₀` (`New.Parameters.placeClass`, whose divisibility hypothesis is | |
| 341 | +`New.Parameters.q₀_dvd_q₁`). -/ | |
| 342 | +lemma card_placeClass_eq_one_eq_towerDeg : | |
| 343 | + #{v : P.Φ s | P.placeClass (P.q₀_dvd_q₁ s) v = 1} = towerDeg s := by | |
| 344 | + -- The homomorphism `P.placeClass` is onto `(ZMod q₀)ˣ`, so its kernel has index `φ(q₀)` in the | |
| 345 | + -- group of the `towerDeg s * φ(q₀)` infinite places. | |
| 346 | + have h_index : (P.placeClass (P.q₀_dvd_q₁ s)).ker.index = P.q₀.totient := by | |
| 347 | 347 | simp [placeClass, Subgroup.index_ker, unitsMap_surjective] |
| 348 | 348 | simpa [h_index, numInfPlaces_E, ne, Fintype.card_subtype] using |
| 349 | - (P.placeClass h_dvd).ker.card_mul_index | |
| 349 | + (P.placeClass (P.q₀_dvd_q₁ s)).ker.card_mul_index | |
| 350 | 350 | |
| 351 | 351 | lemma isPrimitiveRoot_zeta : IsPrimitiveRoot (P.ζ s) (P.q₁ s) := zeta_spec .. |
| 352 | 352 | |
| @@ -413,13 +413,13 @@ and `d` of `d` both differ from `-1`. -/ | ||
| 413 | 413 | lemma d_pow_ne_neg_one (n : ℕ) : (P.d : ZMod P.q₀) ^ n ≠ -1 := |
| 414 | 414 | P.toTauCeti.d_pow_ne_neg_one n |
| 415 | 415 | |
| 416 | -/-- Let `ν` be an integer and suppose `q₀ ∣ q₁`. The place `P.placeOfInt s ν` of `E` is the one that | |
| 417 | -corresponds to `ν mod q₁` under the isomorphism of the group of places with `(ℤ/q₁)ˣ` if `ν` is a | |
| 418 | -unit modulo `q₁`, and the identity place otherwise; `P.placeClass h_dvd` reduces the element of | |
| 419 | -`(ℤ/q₁)ˣ` of a place modulo `q₀`. This class is `-1` if and only if `ν ≡ -1` modulo `q₀`. -/ | |
| 416 | +/-- Let `ν` be an integer. The place `P.placeOfInt s ν` of `E` is the one that corresponds to | |
| 417 | +`ν mod q₁` under the isomorphism of the group of places with `(ℤ/q₁)ˣ` if `ν` is a unit modulo `q₁`, | |
| 418 | +and the identity place otherwise; `P.placeClass (P.q₀_dvd_q₁ s)` reduces the element of `(ℤ/q₁)ˣ` of | |
| 419 | +a place modulo `q₀`. This class is `-1` if and only if `ν ≡ -1` modulo `q₀`. -/ | |
| 420 | 420 | @[simp] |
| 421 | -lemma placeClass_placeOfInt_eq_neg_one_iff {ν : ℤ} (h_dvd : P.q₀ ∣ P.q₁ s) : | |
| 422 | - P.placeClass h_dvd (P.placeOfInt s ν) = -1 ↔ (ν : ZMod P.q₀) = -1 := by | |
| 421 | +lemma placeClass_placeOfInt_eq_neg_one_iff {ν : ℤ} : | |
| 422 | + P.placeClass (P.q₀_dvd_q₁ s) (P.placeOfInt s ν) = -1 ↔ (ν : ZMod P.q₀) = -1 := by | |
| 423 | 423 | refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ |
| 424 | 424 | · -- If `ν` is no unit mod `q₁` then `P.placeOfInt s ν = 1`, whose class is `1 ≠ -1`. |
| 425 | 425 | have h_val : (if IsUnit (ν : ZMod (P.q₁ s)) then (ν : ZMod P.q₀) else 1) = -1 := by |
+1 −1 src/New/Reduction/PrimeSums.lean View file
| @@ -83,7 +83,7 @@ def totalRemainder : ℝ := ∑ τ ∈ D.aPlaces, (D.primeSum D.a τ - D.mainPri | ||
| 83 | 83 | `E = P.E towerExp`, and `q₁ = P.q₁ towerExp` is the order of the root of unity that generates `E` |
| 84 | 84 | over `K`. -/ |
| 85 | 85 | lemma card_aPlaces : #D.aPlaces = towerDeg D.towerExp := |
| 86 | - card_placeClass_eq_one_eq_towerDeg (P.q₀_dvd_q₁ _) | |
| 86 | + card_placeClass_eq_one_eq_towerDeg (s := D.towerExp) | |
| 87 | 87 | |
| 88 | 88 | /-- The number `f` of all places is the number of `a`-places times `φ(q₀)`. -/ |
| 89 | 89 | lemma f_eq_card_aPlaces_mul : D.f = #D.aPlaces * P.q₀.totient := by |