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 Aesop.BuiltinRules |
| 4 | public import Lib.Adelic.Unitary.Defs |
| 5 | import Lib.Adelic.Adeles.StrongApproximation |
| 6 | import Lib.General.LinearAlgebra.PartnerAlgebra |
| 7 | |
| 8 | /-! |
| 9 | # The Gram matrix of a space is invertible and hermitian; group elements from isometries |
| 10 | |
| 11 | Let `E` be a number field and `s : n → ℤˣ` a family of signs. The standard form `New.stdForm E s` |
| 12 | is its own inverse. It is hermitian when `E` has a CM type (`CMType E`), and then the Gram matrix |
| 13 | of a space is invertible and hermitian. For a CM field, matrices that preserve the standard form |
| 14 | give elements of the adelic unitary group. |
| 15 | |
| 16 | ## Notation |
| 17 | |
| 18 | * `New.𝔸 E`: the adeles of `E`, with the diagonal embedding `New.toAdele : E →+* 𝔸 E`, given at |
| 19 | the infinite places by the chosen CM type of `E`. |
| 20 | * `New.stdForm E s`: the diagonal adelic matrix with the signs `s` at the infinite places and `1` |
| 21 | at the finite places. |
| 22 | * `New.Space E n s`: a matrix `J` over `E` with an invertible adelic matrix `x` such that |
| 23 | `xᴴ * J.map toAdele * x` is `New.stdForm E s`. |
| 24 | * `New.G E s`: the adelic unitary group of the standard form; `New.G.adeleMatrix` is the matrix of |
| 25 | an element. |
| 26 | |
| 27 | ## Main definitions and results |
| 28 | |
| 29 | * `New.Space.isUnit_J`, `New.Space.isHermitian_J`: `J` is invertible and hermitian. |
| 30 | * `New.G.ofMatrix`: the group element given by a matrix that preserves the standard form. |
| 31 | -/ |
| 32 | |
| 33 | @[expose] public section |
| 34 | |
| 35 | section SpaceGram |
| 36 | |
| 37 | open NumberField Matrix |
| 38 | |
| 39 | namespace New |
| 40 | section |
| 41 | |
| 42 | variable {E : Type*} [Field E] [NumberField E] {n : Type*} [Fintype n] [DecidableEq n] {s : n → ℤˣ} |
| 43 | |
| 44 | /-- The standard form `stdForm E s`, which is diagonal with the signs `s` at the infinite places |
| 45 | and `1` at the finite places, is its own inverse. -/ |
| 46 | @[simp] |
| 47 | lemma stdForm_mul_self : stdForm E s * stdForm E s = 1 := by |
| 48 | simp [stdForm, funext_iff, ← Int.cast_mul] |
| 49 | |
| 50 | omit [Fintype n] in |
| 51 | /-- The standard form `stdForm E (1 : n → ℤˣ)` is the identity matrix. -/ |
| 52 | @[simp] |
| 53 | lemma stdForm_one : stdForm E (1 : n → ℤˣ) = 1 := by |
| 54 | rw [stdForm, ← diagonal_one, diagonal_eq_diagonal_iff] |
| 55 | intro i |
| 56 | ext <;> simp |
| 57 | |
| 58 | /-- The standard form `stdForm E s` is a unit in the matrix ring. -/ |
| 59 | @[simp] |
| 60 | lemma isUnit_stdForm : IsUnit (stdForm E s) := .of_mul_eq_one _ stdForm_mul_self |
| 61 | |
| 62 | end |
| 63 | |
| 64 | /-- The standard hermitian form `xᴴ x` over the CM field `E` is anisotropic. -/ |
| 65 | lemma eq_zero_of_star_dotProduct_self {E p : Type*} [Field E] [CMType E] [Fintype p] {x : p → E} |
| 66 | (hx : star x ⬝ᵥ x = 0) : x = 0 := by |
| 67 | -- Any complex embedding `φ` turns the conjugation of `E` into complex conjugation. |
| 68 | obtain ⟨φ⟩ : Nonempty (E →+* ℂ) := inferInstance |
| 69 | have h_image : star (φ ∘ x) ⬝ᵥ (φ ∘ x) = 0 := by |
| 70 | simpa [dotProduct, map_star_complex] using congrArg φ hx |
| 71 | open ComplexOrder in |
| 72 | exact φ.injective.comp_left (by simpa using dotProduct_star_self_eq_zero.1 h_image) |
| 73 | |
| 74 | variable {E : Type*} [Field E] [CMType E] {n : Type*} [Fintype n] [DecidableEq n] {s : n → ℤˣ} |
| 75 | |
| 76 | omit [Fintype n] in |
| 77 | /-- The standard form `stdForm E s`, a diagonal matrix with the signs `s` at the infinite places |
| 78 | and `1` at the finite places, is hermitian. -/ |
| 79 | @[simp] |
| 80 | lemma conjTranspose_stdForm : (stdForm E s)ᴴ = stdForm E s := by |
| 81 | rw [stdForm, diagonal_conjTranspose, diagonal_eq_diagonal_iff] |
| 82 | intro i |
| 83 | ext <;> simp |
| 84 | |
| 85 | /-- The diagonal embedding `toAdele` of `E` in its adeles, given at the infinite places by the CM |
| 86 | type, commutes with the conjugate transpose of matrices. -/ |
| 87 | @[simp] |
| 88 | lemma conjTranspose_map_toAdele {m k : Type*} (a : Matrix m k E) : |
| 89 | (a.map toAdele)ᴴ = aᴴ.map toAdele := by |
| 90 | exact (conjTranspose_map _ fun x ↦ (star_toAdele x).symm).symm |
| 91 | |
| 92 | namespace Space |
| 93 | /-- At the infinite place `w` the frame `V.x` carries the form `V.J` to the diagonal matrix of the |
| 94 | signs `s`. -/ |
| 95 | lemma gram_map_evalInf {E n : Type} [Field E] [CMType E] [Fintype n] [DecidableEq n] {s : n → ℤˣ} |
| 96 | (V : Space E n s) (w : InfinitePlace E) : |
| 97 | (V.x.map (evalInf w)).valᴴ * V.J.map (Φ w) * (V.x.map (evalInf w)).val = signMatrix s := by |
| 98 | have h_map : (V.x.valᴴ * V.J.map toAdele * V.x.val).map (evalInf w) = signMatrix s := by |
| 99 | simp [V.gram_point, stdForm, signMatrix] |
| 100 | rwa [map_conjTranspose_mul_mul (evalInf w) fun _ ↦ rfl, Matrix.map_map] at h_map |
| 101 | |
| 102 | /-- A space `V` is a matrix `J` over `E` with an invertible adelic matrix `x` such that |
| 103 | `xᴴ J x = S`, where `S = stdForm E s` is the diagonal matrix of signs and `toAdele` maps `E` to |
| 104 | its adeles. Over the adeles `J = (x⁻¹)ᴴ S x⁻¹`. -/ |
| 105 | lemma map_J (V : Space E n s) : V.J.map toAdele = V.x⁻¹.valᴴ * stdForm E s * V.x⁻¹.val := |
| 106 | (gram_inv_of_gram_eq V.gram_point).symm |
| 107 | |
| 108 | /-- The Gram matrix `V.J` of a space `V` is a unit in the matrix ring. -/ |
| 109 | @[simp] |
| 110 | lemma isUnit_J (V : Space E n s) : IsUnit V.J := by |
| 111 | have h_adelic : IsUnit (toAdele.mapMatrix V.J) := by simp [map_J] |
| 112 | exact isUnit_of_mapMatrix toAdele h_adelic |
| 113 | |
| 114 | /-- Over the adeles, `V.J⁻¹` is a left inverse to `V.J`. -/ |
| 115 | lemma map_J_inv_mul_map_J (V : Space E n s) : V.J⁻¹.map toAdele * V.J.map toAdele = 1 := by |
| 116 | have h_det : IsUnit V.J.det := (isUnit_iff_isUnit_det V.J).mp V.isUnit_J |
| 117 | simp [← Matrix.map_mul, nonsing_inv_mul V.J h_det] |
| 118 | |
| 119 | /-- Over the adeles, `V.J⁻¹` equals `V.x.val * stdForm E s * V.x.valᴴ`, where |
| 120 | `V.x` is the point of `V`, an invertible adelic matrix. -/ |
| 121 | lemma map_J_inv (V : Space E n s) : |
| 122 | V.J⁻¹.map toAdele = V.x.val * stdForm E s * V.x.valᴴ := by |
| 123 | have h_gram_mul_stdForm : V.x.valᴴ * V.J.map toAdele * V.x.val * stdForm E s = 1 := by |
| 124 | rw [V.gram_point, stdForm_mul_self] |
| 125 | have h_right_inv : V.J.map toAdele * (V.x.val * stdForm E s * V.x.valᴴ) = 1 := by |
| 126 | rw [← mul_assoc, mul_eq_one_comm] |
| 127 | simpa only [mul_assoc] using h_gram_mul_stdForm |
| 128 | exact left_inv_eq_right_inv V.map_J_inv_mul_map_J h_right_inv |
| 129 | |
| 130 | /-- The Gram matrix `V.J` of a space `V` is Hermitian. -/ |
| 131 | lemma isHermitian_J (V : Space E n s) : V.J.IsHermitian := by |
| 132 | have h_adelic : V.Jᴴ.map toAdele = V.J.map toAdele := by |
| 133 | simp [← conjTranspose_map_toAdele, map_J, mul_assoc] |
| 134 | exact map_injective toAdele.injective h_adelic |
| 135 | |
| 136 | /-- The conjugate transpose of the Gram matrix `V.J` equals `V.J`. -/ |
| 137 | lemma conjTranspose_J (V : Space E n s) : V.Jᴴ = V.J := V.isHermitian_J.eq |
| 138 | |
| 139 | /-- The Gram matrix `J` of a space `V` is hermitian, so for matrices `X`, `Y` over `E` with rows |
| 140 | indexed by `n`, the matrix `Yᴴ J X` is the conjugate transpose of `Xᴴ J Y`. -/ |
| 141 | lemma conjTranspose_mul_J_mul_swap (V : Space E n s) {a b : Type*} (X : Matrix n a E) |
| 142 | (Y : Matrix n b E) : |
| 143 | Yᴴ * V.J * X = (Xᴴ * V.J * Y)ᴴ := by |
| 144 | rw [conjTranspose_mul, conjTranspose_mul, conjTranspose_conjTranspose, V.conjTranspose_J, |
| 145 | Matrix.mul_assoc] |
| 146 | |
| 147 | end Space |
| 148 | |
| 149 | end New |
| 150 | |
| 151 | end SpaceGram |
| 152 | |
| 153 | namespace New |
| 154 | |
| 155 | open scoped Matrix |
| 156 | |
| 157 | variable {E : Type*} [Field E] [NumberField E] [NumberField.IsCMField E] |
| 158 | {n : Type*} [Fintype n] [DecidableEq n] {s : n → ℤˣ} |
| 159 | |
| 160 | /-- The element of the adelic unitary group `G E s` given by an adelic matrix `m` with |
| 161 | `mᴴ S m = S`, where `S` is the standard form `stdForm E s`. -/ |
| 162 | noncomputable def G.ofMatrix (m : Matrix n n (𝔸 E)) (h : mᴴ * stdForm E s * m = stdForm E s) : |
| 163 | G E s := |
| 164 | toUnitary.symm (U.of isUnit_stdForm m h) |
| 165 | |
| 166 | /-- For a CM field `E` and signs `s` indexed by a finite type `n`, let `S = stdForm E s` be the |
| 167 | diagonal adelic matrix with the signs `s` at the infinite places and `1` at the finite places. If an |
| 168 | adelic matrix `m` satisfies `mᴴ S m = S`, the element `G.ofMatrix m h` of the adelic unitary group |
| 169 | `G E s` of `S` has matrix `m`. -/ |
| 170 | @[simp] |
| 171 | lemma G.adeleMatrix_ofMatrix (m : Matrix n n (𝔸 E)) (h : mᴴ * stdForm E s * m = stdForm E s) : |
| 172 | (ofMatrix m h).adeleMatrix = m := rfl |
| 173 | |
| 174 | end New |