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 | import Mathlib.RingTheory.PiTensorProduct |
| 4 | import Mathlib.Topology.Algebra.Group.Units |
| 5 | public import Lib.Speed |
| 6 | import Lib.General.LinearAlgebra.MatrixPolynomials |
| 7 | |
| 8 | /-! |
| 9 | # The unipotent radical attached to an idempotent matrix |
| 10 | |
| 11 | For an idempotent matrix `ε`, the matrices `1 + ε Y (1 - ε)` form the unipotent radical of the |
| 12 | parabolic subgroup that keeps the image of `ε`. If a polynomial in `g` is a projection onto the |
| 13 | image of `ε`, then every translate of `g` by the radical is conjugate to `g` under the radical |
| 14 | (`semiconjBy_radicalHom_aeval_sub`). |
| 15 | -/ |
| 16 | |
| 17 | @[expose] public section |
| 18 | |
| 19 | open Matrix Polynomial Multiplicative |
| 20 | |
| 21 | namespace New |
| 22 | |
| 23 | variable {n k : Type*} [Fintype n] [DecidableEq n] [CommRing k] {ε : Matrix n n k} |
| 24 | |
| 25 | variable (ε) in |
| 26 | /-- The upper right blocks with respect to `ε`: the matrices `Z` with `ε Z = Z` and `Z ε = 0`. For |
| 27 | an idempotent `ε` these are the maps that kill the image of `ε` and send everything into it. -/ |
| 28 | def upperBlocks : Submodule k (Matrix n n k) := |
| 29 | LinearMap.eqLocus (LinearMap.mulLeft k ε) .id ⊓ LinearMap.ker (LinearMap.mulRight k ε) |
| 30 | |
| 31 | /-- A matrix `Z` lies in `upperBlocks ε` if and only if `ε * Z = Z` and |
| 32 | `Z * ε = 0`. -/ |
| 33 | lemma mem_upperBlocks_iff {Z : Matrix n n k} : |
| 34 | Z ∈ upperBlocks ε ↔ ε * Z = Z ∧ Z * ε = 0 := |
| 35 | Iff.rfl |
| 36 | |
| 37 | lemma mul_mul_one_sub_mem_upperBlocks (hε : IsIdempotentElem ε) (Y : Matrix n n k) : |
| 38 | ε * Y * (1 - ε) ∈ upperBlocks ε := |
| 39 | mem_upperBlocks_iff.mpr ⟨by rw [← mul_assoc, ← mul_assoc, hε.eq], |
| 40 | by rw [mul_assoc, hε.one_sub_mul_self, mul_zero]⟩ |
| 41 | |
| 42 | /-- An upper right block `Y` (that is, `ε Y = Y` and `Y ε = 0`) satisfies `Y Z = 0` for every matrix |
| 43 | `Z` with `ε Z = Z`. -/ |
| 44 | lemma mul_eq_zero_of_mem_upperBlocks {Y Z : Matrix n n k} (hY : Y ∈ upperBlocks ε) |
| 45 | (hZ : ε * Z = Z) : Y * Z = 0 := by |
| 46 | rw [← hZ, ← mul_assoc, (mem_upperBlocks_iff.mp hY).2, zero_mul] |
| 47 | |
| 48 | /-- The upper right blocks, the matrices `Z` with `ε Z = Z` and `Z ε = 0`, are stable under left |
| 49 | multiplication by a matrix `g` with `ε g ε = g ε` (for an idempotent `ε`: `g` keeps the image of |
| 50 | `ε`). -/ |
| 51 | lemma mul_mem_upperBlocks_left {g Z : Matrix n n k} (hg : ε * (g * ε) = g * ε) |
| 52 | (hZ : Z ∈ upperBlocks ε) : g * Z ∈ upperBlocks ε := by |
| 53 | obtain ⟨hεZ, hZε⟩ := mem_upperBlocks_iff.mp hZ |
| 54 | exact mem_upperBlocks_iff.mpr ⟨by rw [← hεZ, ← mul_assoc g, ← mul_assoc, hg], |
| 55 | by rw [mul_assoc, hZε, mul_zero]⟩ |
| 56 | |
| 57 | /-- The upper right blocks, the matrices `Z` with `ε Z = Z` and `Z ε = 0`, are stable under right |
| 58 | multiplication by a matrix `g` with `ε g ε = g ε`. -/ |
| 59 | lemma mul_mem_upperBlocks_right {g Z : Matrix n n k} (hg : ε * (g * ε) = g * ε) |
| 60 | (hZ : Z ∈ upperBlocks ε) : Z * g ∈ upperBlocks ε := by |
| 61 | obtain ⟨hεZ, -⟩ := mem_upperBlocks_iff.mp hZ |
| 62 | exact mem_upperBlocks_iff.mpr |
| 63 | ⟨by rw [← mul_assoc, hεZ], by rw [mul_assoc, mul_eq_zero_of_mem_upperBlocks hZ hg]⟩ |
| 64 | |
| 65 | /-- The homomorphism `Y ↦ 1 + ε Y (1 - ε)` from the additive group of matrices to `GL n k`. Its |
| 66 | image is the unipotent radical of the parabolic subgroup that keeps the image of the idempotent |
| 67 | `ε`. -/ |
| 68 | noncomputable def radicalHom (hε : IsIdempotentElem ε) : |
| 69 | Multiplicative (Matrix n n k) →* GL n k := |
| 70 | MonoidHom.toHomUnits |
| 71 | { toFun Y := 1 + ε * Y.toAdd * (1 - ε) |
| 72 | map_one' := by rw [toAdd_one, mul_zero, zero_mul, add_zero] |
| 73 | map_mul' Y Z := by |
| 74 | have h_zero : ε * Y.toAdd * (1 - ε) * (ε * Z.toAdd * (1 - ε)) = 0 := |
| 75 | mul_eq_zero_of_mem_upperBlocks (mul_mul_one_sub_mem_upperBlocks hε Y.toAdd) |
| 76 | (mem_upperBlocks_iff.mp (mul_mul_one_sub_mem_upperBlocks hε Z.toAdd)).1 |
| 77 | rw [toAdd_mul] |
| 78 | linear_combination (norm := noncomm_ring) -h_zero } |
| 79 | |
| 80 | lemma coe_radicalHom (hε : IsIdempotentElem ε) (Y : Multiplicative (Matrix n n k)) : |
| 81 | (radicalHom hε Y : Matrix n n k) = 1 + ε * Y.toAdd * (1 - ε) := rfl |
| 82 | |
| 83 | /-- If `ε Z = Z` and `Z ε = 0`, that is, if `Z` is an upper right block, then the matrix |
| 84 | `1 + ε Z (1 - ε)` of `radicalHom` is `1 + Z`. -/ |
| 85 | lemma coe_radicalHom_of_mem (hε : IsIdempotentElem ε) {Z : Matrix n n k} |
| 86 | (hZ : Z ∈ upperBlocks ε) : (radicalHom hε (ofAdd Z) : Matrix n n k) = 1 + Z := by |
| 87 | obtain ⟨hεZ, hZε⟩ := mem_upperBlocks_iff.mp hZ |
| 88 | rw [coe_radicalHom, toAdd_ofAdd, hεZ, mul_sub, mul_one, hZε, sub_zero] |
| 89 | |
| 90 | /-- The elements `1 + ε Y (1 - ε)` of the radical fix the image of `ε` pointwise. -/ |
| 91 | lemma coe_radicalHom_mul_idempotent (hε : IsIdempotentElem ε) (Y : Multiplicative (Matrix n n k)) : |
| 92 | (radicalHom hε Y : Matrix n n k) * ε = ε := by |
| 93 | rw [coe_radicalHom, add_mul, one_mul, mul_assoc (ε * Y.toAdd), hε.one_sub_mul_self, mul_zero, |
| 94 | add_zero] |
| 95 | |
| 96 | /-- Over a topological ring, the map `Y ↦ 1 + ε Y (1 - ε)` into `GL n k` is continuous. -/ |
| 97 | lemma continuous_radicalHom [TopologicalSpace k] [IsTopologicalRing k] (hε : IsIdempotentElem ε) : |
| 98 | Continuous (radicalHom hε) := by |
| 99 | refine Continuous.of_coeHom_comp ?_ |
| 100 | change Continuous fun Y : Multiplicative (Matrix n n k) ↦ 1 + ε * Y.toAdd * (1 - ε) |
| 101 | exact continuous_const.add ((continuous_const.mul continuous_toAdd).mul continuous_const) |
| 102 | |
| 103 | /-- Let `ε g ε = g ε` and let `x - g` be an upper right block (a matrix `Z` with `ε Z = Z` and |
| 104 | `Z ε = 0`). Then `p(x) - p(g)` is an upper right block for every polynomial `p`. -/ |
| 105 | lemma aeval_sub_aeval_mem_upperBlocks {g x : Matrix n n k} (hg : ε * (g * ε) = g * ε) |
| 106 | (hx : x - g ∈ upperBlocks ε) (p : k[X]) : aeval x p - aeval g p ∈ upperBlocks ε := by |
| 107 | -- `x` and `g` induce the same map on the image of `ε`, and the same map on the quotient by it. |
| 108 | obtain ⟨hx_range, hx_ker⟩ := mem_upperBlocks_iff.mp hx |
| 109 | -- By `aeval_semiconj`, `a b = c a` gives `a p(b) = p(c) a`; here `a` is `ε` or `1 - ε`. |
| 110 | have hx_image : ε * (g * ε) = x * ε := by |
| 111 | linear_combination (norm := noncomm_ring) hg - hx_ker |
| 112 | have hg_quot : (1 - ε) * g = (1 - ε) * g * (1 - ε) := by |
| 113 | linear_combination (norm := noncomm_ring) -hg |
| 114 | have hx_quot : (1 - ε) * x = (1 - ε) * g * (1 - ε) := by |
| 115 | linear_combination (norm := noncomm_ring) hg_quot - hx_range |
| 116 | have h_image : aeval x p * ε = aeval g p * ε := |
| 117 | (aeval_semiconj hx_image p).symm.trans (aeval_semiconj hg p) |
| 118 | have h_quot : (1 - ε) * aeval x p = (1 - ε) * aeval g p := |
| 119 | (aeval_semiconj hx_quot p).trans (aeval_semiconj hg_quot p).symm |
| 120 | refine mem_upperBlocks_iff.mpr ⟨?_, by rw [sub_mul, h_image, sub_self]⟩ |
| 121 | linear_combination (norm := noncomm_ring) -h_quot |
| 122 | |
| 123 | /-- If `ε p(g) = p(g)` and `p(g) ε = ε` (that is, `ε` is idempotent and `p(g)` is a projection onto |
| 124 | the image of `ε`), then `ε g ε = g ε` (`g` keeps the image of `ε`). -/ |
| 125 | lemma mul_mul_eq_mul_of_aeval {g : Matrix n n k} {p : k[X]} (h_range : ε * aeval g p = aeval g p) |
| 126 | (h_fix : aeval g p * ε = ε) : ε * (g * ε) = g * ε := by |
| 127 | have h_comm : g * aeval g p = aeval g p * g := aeval_semiconj rfl p |
| 128 | have h_eq : g * ε = aeval g p * (g * ε) := by |
| 129 | rw [← mul_assoc, ← h_comm, mul_assoc, h_fix] |
| 130 | rw [h_eq, ← mul_assoc, h_range] |
| 131 | |
| 132 | /-- Let `p(g)` be a projection onto the image of `ε` (`ε p(g) = p(g)` and `p(g) ε = ε`), and let |
| 133 | `x - g` be an upper right block (a matrix `Z` with `ε Z = Z` and `Z ε = 0`). Then |
| 134 | `D = p(x) - p(g)` satisfies `(1 + D) x = g (1 + D)`. -/ |
| 135 | lemma semiconjBy_one_add_aeval_sub {g x : Matrix n n k} {p : k[X]} |
| 136 | (h_range : ε * aeval g p = aeval g p) (h_fix : aeval g p * ε = ε) |
| 137 | (hx : x - g ∈ upperBlocks ε) : SemiconjBy (1 + (aeval x p - aeval g p)) x g := by |
| 138 | obtain ⟨hεD, -⟩ := mem_upperBlocks_iff.mp |
| 139 | (aeval_sub_aeval_mem_upperBlocks (mul_mul_eq_mul_of_aeval h_range h_fix) hx p) |
| 140 | obtain ⟨hεZ, -⟩ := mem_upperBlocks_iff.mp hx |
| 141 | have hg_comm : g * aeval g p = aeval g p * g := aeval_semiconj rfl p |
| 142 | have hx_comm : x * aeval x p = aeval x p * x := aeval_semiconj rfl p |
| 143 | -- Write `Z = x - g`, `D = p(x) - p(g)` and `e = p(g)`. The claim is `Z = g D - D x`, and |
| 144 | -- `g D - D x = e Z - Z (e + D)`, where `Z e = 0`, `Z D = 0` and `e Z = Z`. |
| 145 | have hZe : (x - g) * aeval g p = 0 := mul_eq_zero_of_mem_upperBlocks hx h_range |
| 146 | have hZD : (x - g) * (aeval x p - aeval g p) = 0 := mul_eq_zero_of_mem_upperBlocks hx hεD |
| 147 | have heZ : aeval g p * (x - g) = x - g := by rw [← hεZ, ← mul_assoc, h_fix] |
| 148 | rw [SemiconjBy] |
| 149 | linear_combination (norm := noncomm_ring) hg_comm - hx_comm + hZe + hZD - heZ |
| 150 | |
| 151 | /-- If `ε g ε = g ε`, then, with `u = radicalHom hε Y` and `u' = radicalHom hε Z`, the difference |
| 152 | `u g u' - g` is an upper right block: it is unchanged by `ε` on the left and killed by `ε` on the |
| 153 | right. -/ |
| 154 | lemma radicalHom_mul_mul_sub_mem_upperBlocks (hε : IsIdempotentElem ε) {g : Matrix n n k} |
| 155 | (hg : ε * (g * ε) = g * ε) (Y Z : Multiplicative (Matrix n n k)) : |
| 156 | (radicalHom hε Y : Matrix n n k) * g * radicalHom hε Z - g ∈ upperBlocks ε := by |
| 157 | rw [coe_radicalHom, coe_radicalHom] |
| 158 | have hA := mul_mul_one_sub_mem_upperBlocks hε Y.toAdd |
| 159 | have hgB := mul_mem_upperBlocks_left hg (mul_mul_one_sub_mem_upperBlocks hε Z.toAdd) |
| 160 | convert add_mem (mul_mem_upperBlocks_right hg hA) hgB using 1 |
| 161 | linear_combination (norm := noncomm_ring) |
| 162 | mul_eq_zero_of_mem_upperBlocks hA (mem_upperBlocks_iff.mp hgB).1 |
| 163 | |
| 164 | /-- Let `ε` be idempotent, let `p(g)` be a projection onto its image (`ε p(g) = p(g)` and |
| 165 | `p(g) ε = ε`), and let `x = u g u'` with `u, u'` in the image of `radicalHom`, the group of the |
| 166 | matrices `1 + ε Y (1 - ε)`. Then the element of that group with parameter `D = p(x) - p(g)` |
| 167 | conjugates `x` to `g`. -/ |
| 168 | lemma semiconjBy_radicalHom_aeval_sub (hε : IsIdempotentElem ε) {g x : GL n k} {p : k[X]} |
| 169 | (h_range : ε * aeval (g : Matrix n n k) p = aeval (g : Matrix n n k) p) |
| 170 | (h_fix : aeval (g : Matrix n n k) p * ε = ε) |
| 171 | (Y Z : Multiplicative (Matrix n n k)) (hx : x = radicalHom hε Y * g * radicalHom hε Z) : |
| 172 | SemiconjBy (radicalHom hε (ofAdd (aeval (x : Matrix n n k) p - aeval (g : Matrix n n k) p))) |
| 173 | x g := by |
| 174 | have hg : ε * ((g : Matrix n n k) * ε) = g * ε := mul_mul_eq_mul_of_aeval h_range h_fix |
| 175 | have h_mem : (x : Matrix n n k) - g ∈ upperBlocks ε := by |
| 176 | rw [hx, Units.val_mul, Units.val_mul] |
| 177 | exact radicalHom_mul_mul_sub_mem_upperBlocks hε hg Y Z |
| 178 | rw [← SemiconjBy.units_val_iff, |
| 179 | coe_radicalHom_of_mem hε (aeval_sub_aeval_mem_upperBlocks hg h_mem p)] |
| 180 | exact semiconjBy_one_add_aeval_sub h_range h_fix h_mem |
| 181 | |
| 182 | end New |