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

| 1 | module |
| 2 | |
| 3 | public import Lib.GaloisRep.Main.SelmerModules |
| 4 | public import Lib.General.Algebra.BlockFittingBound |
| 5 | |
| 6 | /-! |
| 7 | # Selmer modules with divisible coefficients |
| 8 | |
| 9 | `O` is a discrete valuation ring and `New.Selmer.DivisibleQuot O` is the module `Frac(O) / O`. For a |
| 10 | matrix-valued function `ρ` on the Galois group `Gal(Ω/E)` of `Ω` over the number field `E` |
| 11 | (`EmbeddedNumberField E`) with entries in `O` and `a ≠ 0`, the Selmer module with coefficients in |
| 12 | `O / a` is identified with the `a`-torsion of the Selmer module with coefficients in `Frac(O) / O`, |
| 13 | so it is no longer than the latter. |
| 14 | |
| 15 | ## Main definitions and results |
| 16 | |
| 17 | * `New.Selmer.comp_mem_selmerModule_iff`, `New.Selmer.selmerModuleMapOfInjective`: an injective map |
| 18 | of coefficient modules preserves and reflects the Selmer conditions, and so maps Selmer modules |
| 19 | injectively. |
| 20 | * `New.Selmer.length_torsionBy_selmerModule`: if the map identifies `O / a` with the `a`-torsion of |
| 21 | the coefficients, the Selmer module with coefficients in `O / a` has the length of the `a`-torsion |
| 22 | of the other. |
| 23 | * `New.Selmer.divisibleSelmerLength`, `New.Selmer.length_le_divisibleSelmerLength`: the length of |
| 24 | the Selmer module with coefficients in `Frac(O) / O` (for an embedded number field `E`), which |
| 25 | bounds the lengths of those with coefficients in `O / a`. |
| 26 | |
| 27 | Notions from other files: |
| 28 | * `New.selmerModule ρ S L B`: the locally constant cocycles for `ρ` with values in `B ^ n` that are |
| 29 | unramified outside `S` and obey the linear relations `L`. |
| 30 | |
| 31 | ## Relation to the literature |
| 32 | |
| 33 | Known. The comparison of Selmer groups with coefficients in `O / a` and in `Frac(O) / O` is |
| 34 | standard; here it is immediate, because cocycles are counted and not classes. |
| 35 | -/ |
| 36 | |
| 37 | @[expose] public section |
| 38 | |
| 39 | noncomputable section |
| 40 | |
| 41 | namespace New.Selmer |
| 42 | |
| 43 | section SelmerLevels |
| 44 | |
| 45 | open Module Submodule Ideal IsDiscreteValuationRing LinearMap |
| 46 | |
| 47 | variable {O : Type} [CommRing O] |
| 48 | {E n : Type} [Field E] [EmbeddedNumberField E] [Fintype n] [DecidableEq n] |
| 49 | (ρ : Gal(Ω/E) → Matrix n n O) (S : Set (FinPlace E)) (L : Set (Gal(Ω/E) →₀ Matrix n n O)) |
| 50 | {B B' : Type} [AddCommGroup B] [Module O B] [AddCommGroup B'] [Module O B'] |
| 51 | |
| 52 | /-- An injective map `f` of coefficient modules preserves and reflects the Selmer conditions: |
| 53 | `f ∘ z` is in the Selmer module (the locally constant cocycles for `ρ` that are unramified outside |
| 54 | the set `S` of finite places and obey the relations `L`) if and only if `z` is. -/ |
| 55 | lemma comp_mem_selmerModule_iff {f : B →ₗ[O] B'} (hf : Function.Injective f) |
| 56 | {z : Gal(Ω/E) → n → B} : |
| 57 | (fun (g : Gal(Ω/E)) (i : n) ↦ f (z g i)) ∈ selmerModule ρ S L B' ↔ |
| 58 | z ∈ selmerModule ρ S L B := by |
| 59 | have h_locallyConstant : |
| 60 | IsLocallyConstant (fun (g : Gal(Ω/E)) (i : n) ↦ f (z g i)) ↔ IsLocallyConstant z := |
| 61 | ⟨fun h ↦ IsLocallyConstant.desc z (fun v : n → B ↦ f ∘ v) h hf.comp_left, |
| 62 | fun h ↦ h.comp fun v : n → B ↦ f ∘ v⟩ |
| 63 | -- The Selmer module is cut out by a set of relations and by local constancy. |
| 64 | simp only [selmerModule, Submodule.mem_inf] |
| 65 | exact and_congr (comp_mem_obeying_iff_of_injective f hf) h_locallyConstant |
| 66 | |
| 67 | /-- The map of Selmer modules `z ↦ f ∘ z` induced by an injective map `f` of coefficient |
| 68 | modules. -/ |
| 69 | def selmerModuleMapOfInjective {f : B →ₗ[O] B'} (hf : Function.Injective f) : |
| 70 | selmerModule ρ S L B →ₗ[O] selmerModule ρ S L B' := |
| 71 | ((f.compLeft n).compLeft Gal(Ω/E)).restrict fun (_ : Gal(Ω/E) → n → B) hz ↦ |
| 72 | (comp_mem_selmerModule_iff ρ S L hf).2 hz |
| 73 | |
| 74 | /-- An injective map of coefficient modules induces an injective map of Selmer modules. -/ |
| 75 | lemma selmerModuleMapOfInjective_injective {f : B →ₗ[O] B'} (hf : Function.Injective f) : |
| 76 | Function.Injective (selmerModuleMapOfInjective ρ S L hf) := |
| 77 | fun _ _ h ↦ Subtype.ext (hf.comp_left.comp_left (congrArg Subtype.val h)) |
| 78 | |
| 79 | /-- If `f` identifies `O / a` (that is, `QuotSpan a`) with the `a`-torsion of `B`, then composition |
| 80 | with `f` maps the Selmer module (cocycles for `ρ` unramified outside `S` that obey the relations |
| 81 | `L`) with coefficients in `O / a` onto the `a`-torsion of the one with coefficients in `B`. -/ |
| 82 | lemma range_selmerModuleMapOfInjective {a : O} {f : QuotSpan a →ₗ[O] B} |
| 83 | (hf : Function.Injective f) (h_onto : ∀ y : B, a • y = 0 → ∃ x : QuotSpan a, f x = y) : |
| 84 | (selmerModuleMapOfInjective ρ S L hf).range = torsionBy O (selmerModule ρ S L B) a := |
| 85 | range_restrict_compLeft_eq_torsionBy f h_onto fun _ ↦ comp_mem_selmerModule_iff ρ S L hf |
| 86 | |
| 87 | /-- If `f` identifies `O / a` (that is, `QuotSpan a`) with the `a`-torsion of `B`, then the Selmer |
| 88 | module (cocycles for `ρ` unramified outside `S` that obey the relations `L`, not classes) with |
| 89 | coefficients in `O / a` has the length of the `a`-torsion of the one with coefficients in `B`. -/ |
| 90 | lemma length_torsionBy_selmerModule {a : O} {f : QuotSpan a →ₗ[O] B} |
| 91 | (hf : Function.Injective f) (h_onto : ∀ y : B, a • y = 0 → ∃ x : QuotSpan a, f x = y) : |
| 92 | length O (torsionBy O (selmerModule ρ S L B) a) = |
| 93 | length O (selmerModule ρ S L (QuotSpan a)) := by |
| 94 | rw [← range_selmerModuleMapOfInjective ρ S L hf h_onto, |
| 95 | ← (LinearEquiv.ofInjective _ (selmerModuleMapOfInjective_injective ρ S L hf)).length_eq] |
| 96 | |
| 97 | variable [DVR O] |
| 98 | |
| 99 | /-- For `a ≠ 0`, the Selmer module (cocycles for `ρ` unramified outside `S` that obey the relations |
| 100 | `L`) with coefficients in `O / a` has the length of the `a`-torsion of the Selmer module with |
| 101 | coefficients in `DivisibleQuot O = Frac(O) / O`. -/ |
| 102 | lemma length_torsionBy_selmerModule_divisibleQuot {a : O} (ha : a ≠ 0) : |
| 103 | length O (torsionBy O (selmerModule ρ S L (DivisibleQuot O)) a) = |
| 104 | length O (selmerModule ρ S L (QuotSpan a)) := |
| 105 | length_torsionBy_selmerModule ρ S L (divQuot_injective ha) fun _ hy ↦ exists_divQuot_eq ha hy |
| 106 | |
| 107 | /-- For `a ≠ 0`, the Selmer module (cocycles for `ρ` unramified outside `S` that obey the relations |
| 108 | `L`) with coefficients in `O / a` is no longer than the one with coefficients in |
| 109 | `DivisibleQuot O = Frac(O) / O`, by the injective map on coefficients. -/ |
| 110 | lemma length_selmerModule_le_divisibleQuot {a : O} (ha : a ≠ 0) : |
| 111 | length O (selmerModule ρ S L (QuotSpan a)) ≤ |
| 112 | length O (selmerModule ρ S L (DivisibleQuot O)) := |
| 113 | length_le_of_injective _ (selmerModuleMapOfInjective_injective ρ S L (divQuot_injective ha)) |
| 114 | |
| 115 | end SelmerLevels |
| 116 | |
| 117 | section DivisibleLength |
| 118 | |
| 119 | variable {E O n : Type} [Field E] [EmbeddedNumberField E] [CommRing O] [DVR O] [Fintype n] |
| 120 | [DecidableEq n] |
| 121 | {ρ : Gal(Ω/E) → Matrix n n O} {S : Set (FinPlace E)} {L : Set (Gal(Ω/E) →₀ Matrix n n O)} |
| 122 | |
| 123 | omit [DVR O] in |
| 124 | variable (ρ S L) in |
| 125 | /-- For an embedded number field `E`, the length over `O` of the Selmer module with coefficients |
| 126 | in `Frac(O) / O`: the locally constant cocycles for `ρ` |
| 127 | that are unramified outside `S` and obey the relations `L`. -/ |
| 128 | noncomputable def divisibleSelmerLength : ℕ∞ := |
| 129 | Module.length O (selmerModule ρ S L (DivisibleQuot O)) |
| 130 | |
| 131 | /-- Let `E` be an embedded number field and `a ≠ 0`. The Selmer module (cocycles for `ρ` unramified |
| 132 | outside `S` that obey the relations `L`) with coefficients in `O / a` has length at most |
| 133 | `divisibleSelmerLength ρ S L`, the length of the one with coefficients in `Frac(O) / O`. -/ |
| 134 | lemma length_le_divisibleSelmerLength {a : O} (ha : a ≠ 0) : |
| 135 | Module.length O (selmerModule ρ S L (QuotSpan a)) ≤ divisibleSelmerLength ρ S L := |
| 136 | length_selmerModule_le_divisibleQuot ρ S L ha |
| 137 | |
| 138 | end DivisibleLength |
| 139 | |
| 140 | end New.Selmer |
| 141 | |
| 142 | end |