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 Mathlib.Algebra.QuadraticAlgebra.Basic |
| 4 | import Mathlib.Algebra.QuadraticAlgebra.NormDeterminant |
| 5 | import Mathlib.Analysis.Complex.HalfPlane |
| 6 | import Mathlib.RingTheory.PicardGroup |
| 7 | public import Lib.Adelic.Unitary.ComponentsAndBlockSums |
| 8 | public import Lib.ClassField.Places.Ideles |
| 9 | public import Lib.GaloisRep.BaseChange.Defs |
| 10 | import Lib.Adelic.Adeles.StrongApproximation |
| 11 | import Lib.Adelic.Unitary.GramMatrix |
| 12 | import Lib.Adelic.Witt.WittTheorem |
| 13 | import Lib.ClassField.Global.AlbertBrauerHasseNoether |
| 14 | import Lib.ClassField.Global.CMSplittingCharacters |
| 15 | import Lib.ClassField.Global.NormTheorems |
| 16 | import Lib.GaloisRep.Hilbert90.TameActions |
| 17 | import Lib.GaloisRep.Hilbert90.UnitaryGroups |
| 18 | import Lib.General.LinearAlgebra.MatrixPolynomials |
| 19 | |
| 20 | /-! |
| 21 | # Sums of two squares, Landherr's theorem and the Hasse principle for unitary cocycles |
| 22 | |
| 23 | Let `E` be a CM field with `New.HasPrimitiveRoot5040 E`, and let `F` be its maximal real subfield. |
| 24 | The file starts with a result on sums of two squares in quadratic algebras over `F`. It then proves |
| 25 | Landherr's theorem: a hermitian space that has an orthonormal frame at the finite places is |
| 26 | determined up to rational isometry by its signs at the infinite places. Finally it proves the Hasse |
| 27 | principle for cocycles of a cyclic Galois group of prime order in the definite unitary group, which |
| 28 | is used for base change. There `E' / E` is a Galois extension of CM fields of prime degree, and |
| 29 | `σ ≠ 1` generates its group. |
| 30 | |
| 31 | ## Main definitions and results |
| 32 | |
| 33 | * `New.exists_sq_add_sq_quadraticAlgebra`: for `E` with a CM type, a totally positive `p` in `F` is |
| 34 | a sum of two squares in `F[X] / (X² - (q p - B²))` for every `B` in `F`. This holds when `p` has |
| 35 | valuation `1` outside a set `S` of finite places of `E`, and `q` has valuation `1` at the places |
| 36 | of `S` and at their complex conjugates. |
| 37 | * `New.Core.exists_form_eq_one`: a hermitian matrix representing `1` over the adeles does so over |
| 38 | `E`. |
| 39 | * `New.Core.exists_rat_frame_of_adelic`: the same for a diagonal matrix of signs, by induction on |
| 40 | the columns. |
| 41 | * `New.Space.landherr`, `New.Space.exists_x_eq_and_ratEmbed_conj_eq`: two spaces with the same signs |
| 42 | differ by a rational change of basis and by moving the point. |
| 43 | * `New.U.hasse_principle_coboundary`: a cocycle that splits over the finite adeles splits |
| 44 | rationally; the proof combines Hilbert 90 for `GL n` with Landherr's theorem `New.Space.landherr`. |
| 45 | |
| 46 | Notions from other files: |
| 47 | * `New.CMType`: makes the field `E` a CM number field with a chosen complex embedding `Φ w` of `E` |
| 48 | for each infinite place `w`. |
| 49 | * `New.𝔸`: the product of one copy of `ℂ` for each infinite place of `E` and the finite adeles |
| 50 | `𝔸f E`; this is the adele ring of `E` when `E` is totally complex. |
| 51 | * `New.Space`: a hermitian space with a point. It is a matrix `J` over `E` and `x : GL n (𝔸 E)` |
| 52 | with `xᴴ J x` equal to `New.stdForm E s`, which is `diag(s)` at the infinite places and `1` at |
| 53 | the finite places. |
| 54 | |
| 55 | ## Relation to the literature |
| 56 | |
| 57 | Known result: Landherr's Hasse principle for hermitian forms. The Hasse principle is proved only |
| 58 | for adelically unimodular spaces of equal signature over a CM field containing the roots of unity of |
| 59 | order 5040. It uses Hasse's norm theorem and strong approximation for the adeles instead of |
| 60 | Hasse-Minkowski. Source: W. |
| 61 | Landherr, Äquivalenz Hermitescher Formen über einem beliebigen algebraischen Zahlkörper, Abh. Math. |
| 62 | Sem. Hamburg 11 (1936) 245-248; M. Kneser, Lectures on Galois cohomology of classical groups, TIFR |
| 63 | 47 (1969), §5.5. |
| 64 | -/ |
| 65 | |
| 66 | @[expose] public section |
| 67 | |
| 68 | /-! |
| 69 | ## A totally positive number as a sum of two squares |
| 70 | |
| 71 | Here `QuadraticAlgebra F μ 0` is `F[X] / (X² - μ)`. |
| 72 | -/ |
| 73 | |
| 74 | section SumOfTwoSquares |
| 75 | |
| 76 | open Algebra QuadraticAlgebra Set NumberField |
| 77 | |
| 78 | /-- Hasse principle for sums of two squares: a totally positive element `x` of a number field `M` |
| 79 | that is a limit of sums of two squares in the completion at each finite place is a sum of two |
| 80 | squares. Sums of two squares are written as norms from `M[X] / (X² + 1)`. -/ |
| 81 | lemma New.exists_norm_eq_of_forall_mem_closure {M : Type} [Field M] [NumberField M] {x : M} |
| 82 | (hx_pos : IsTotallyPositive x) |
| 83 | (h_local : ∀ w : FinPlace M, algebraMap M (LocField w) x ∈ |
| 84 | closure (range fun z : QuadraticAlgebra M (-1) 0 ↦ algebraMap M (LocField w) z.norm)) : |
| 85 | ∃ z : QuadraticAlgebra M (-1) 0, z.norm = x := by |
| 86 | -- If `-1` is a square in `M`, every element is a sum of two squares. |
| 87 | obtain ⟨r, hr⟩ | h_square := Classical.em (∃ r : M, r ^ 2 = -1 + 0 * r) |
| 88 | · refine ⟨⟨x + 4⁻¹, (x - 4⁻¹) * r⟩, ?_⟩ |
| 89 | rw [norm_def] |
| 90 | linear_combination (x - 4⁻¹) ^ 2 * hr |
| 91 | obtain rfl | hx_ne := eq_or_ne x 0 |
| 92 | · exact ⟨0, by simp⟩ |
| 93 | -- Otherwise `M(√-1)` is a quadratic extension of `M`, and Hasse's norm theorem applies. |
| 94 | have : Fact (∀ r : M, r ^ 2 ≠ -1 + 0 * r) := ⟨not_exists.1 h_square⟩ |
| 95 | have : NumberField (QuadraticAlgebra M (-1) 0) := .of_module_finite M _ |
| 96 | have : IsQuadraticExtension M (QuadraticAlgebra M (-1) 0) := .mk (finrank_eq_two (-1 : M) 0) |
| 97 | have norm_eq (z : QuadraticAlgebra M (-1) 0) : norm M z = z.norm := det_toLinearMap_eq_norm z |
| 98 | obtain ⟨z, hz⟩ : ∃ z : (QuadraticAlgebra M (-1) 0)ˣ, z.map (norm M) = .mk0 x hx_ne := |
| 99 | hasse_norm _ (by simpa [norm_eq] using h_local) hx_pos |
| 100 | exact ⟨z, (norm_eq z).symm.trans (congrArg Units.val hz)⟩ |
| 101 | |
| 102 | /-- Let `E` be a CM field with a primitive root of unity of order `5040` and maximal real subfield |
| 103 | `F`. The norm to `F` of an element of `E` is a sum of two squares in `F`. -/ |
| 104 | lemma New.exists_norm_eq_sq_add_sq {E : Type} [Field E] [NumberField E] [IsCMField E] |
| 105 | [HasPrimitiveRoot5040 E] (x : E) : |
| 106 | ∃ a b : maximalRealSubfield E, norm (maximalRealSubfield E) x = a ^ 2 + b ^ 2 := by |
| 107 | -- As `E = F(I)` with `I² = -1`, the norm of `x = a + b I` is `a² + b²`, with `a = T x` and |
| 108 | -- `-b = T (x * I)`. |
| 109 | obtain ⟨I, hI, hI_star⟩ := HasPrimitiveRoot5040.exists_mul_self_eq_neg_one (E := E) |
| 110 | have hI_sq : (I : E) * I = -1 := by simpa using congrArg (algebraMap (𝓞 E) E) hI |
| 111 | have hI_conj : star (I : E) = -I := by simpa using congrArg (algebraMap (𝓞 E) E) hI_star |
| 112 | let T (y : E) : maximalRealSubfield E := trace (maximalRealSubfield E) E (y / 2) |
| 113 | have hT (y : E) : (T y : E) = (y + star y) / 2 := by |
| 114 | simp [T, trace_maximalRealSubfield_eq_add_star, add_div] |
| 115 | refine ⟨T x, T (x * I), Subtype.ext ?_⟩ |
| 116 | push_cast |
| 117 | rw [norm_maximalRealSubfield_eq_mul_star, hT, hT, star_mul', hI_conj] |
| 118 | linear_combination (-(x - star x) ^ 2 / 4) * hI_sq |
| 119 | |
| 120 | /-- Let `E` be a CM field with a primitive root of unity of order `5040` and maximal real subfield |
| 121 | `F`, and let `u` be a finite place of `E` above the place `v` of `F`. Let `a` be a finite adele of |
| 122 | `E` that is fixed by conjugation and is a unit at every place. If the component of `a` at `u` is an |
| 123 | element `s` of `F`, then `s` is a limit of norms from `E` in the completion of `F` at `v`. -/ |
| 124 | lemma New.mem_closure_range_norm_of_apply_eq {E : Type} [Field E] [NumberField E] [IsCMField E] |
| 125 | [HasPrimitiveRoot5040 E] {a : 𝔸f E} (ha_real : star a = a) |
| 126 | (ha_unit : ∀ w : FinPlace E, Valued.v (a w) = 1) {u : FinPlace E} |
| 127 | {v : FinPlace (maximalRealSubfield E)} |
| 128 | (hu : u.comap (algebraMap (maximalRealSubfield E) E) = v) {s : maximalRealSubfield E} |
| 129 | (ha_u : a u = algebraMap E (u.adicCompletion E) (algebraMap (maximalRealSubfield E) E s)) : |
| 130 | algebraMap (maximalRealSubfield E) (LocField v) s ∈ closure (range fun x : E ↦ |
| 131 | algebraMap (maximalRealSubfield E) (LocField v) (norm (maximalRealSubfield E) x)) := by |
| 132 | -- The adele `a` is a norm `ȳ y`, so `s` is the component at `v` of the norm of `ȳ` to `F`. |
| 133 | obtain ⟨y, hy⟩ := exists_unit_star_mul_self_eq ha_real ha_unit |
| 134 | have norm_y : adeleNorm (maximalRealSubfield E) E (star y) v = |
| 135 | algebraMap (maximalRealSubfield E) (LocField v) s := by |
| 136 | apply (locMap _ hu).injective |
| 137 | simp [hy, ha_u, ← adeleMap_apply, Cohomology.finAdeleIncl_adeleNorm_eq_mul_star] |
| 138 | rw [← norm_y] |
| 139 | exact adeleNorm_mem_closure |
| 140 | |
| 141 | /-- Let `E` be a CM field with a CM type and a primitive root of unity of order `5040`, and let `p`, |
| 142 | `q`, `B` lie in its maximal real subfield `F`. Suppose that `p` is totally positive and has |
| 143 | valuation `1` at every finite place of `E` outside `S`. Suppose also that `q` has valuation `1` at |
| 144 | every place of `S` and at its complex conjugate. Then `p` is a sum of two squares in |
| 145 | `F[X] / (X² - (q p - B²))`: it is the norm of an element of the extension of this algebra by a |
| 146 | square root of `-1`. -/ |
| 147 | lemma New.exists_sq_add_sq_quadraticAlgebra {E : Type} [Field E] [CMType E] [HasPrimitiveRoot5040 E] |
| 148 | (p q B : maximalRealSubfield E) {S : Set (FinPlace E)} (hp_pos : IsTotallyPositive p) |
| 149 | (hp_unit : ∀ w ∉ S, w.valuation E p = 1) (hq_unit : ∀ w ∈ S.conjClosure, w.valuation E q = 1) : |
| 150 | ∃ z : QuadraticAlgebra (QuadraticAlgebra (maximalRealSubfield E) (q * p - B ^ 2) 0) (-1) 0, |
| 151 | z.norm = ⟨p, 0⟩ := by |
| 152 | classical |
| 153 | -- In a number field `M` over `E⁺` with a square root of `μ = q p - B²`, the element `p` is |
| 154 | -- everywhere locally a sum of two squares, hence globally by Hasse's norm theorem. |
| 155 | set μ : maximalRealSubfield E := q * p - B ^ 2 |
| 156 | suffices key : ∀ {M : Type} [Field M] [NumberField M] (i : maximalRealSubfield E →+* M) (m : M), |
| 157 | m * m = i μ → ∃ z : QuadraticAlgebra M (-1) 0, z.norm = i p by |
| 158 | -- Apply this to `E⁺` if `μ` is a square there, and to the field `E⁺(√μ)` if not. |
| 159 | obtain ⟨r, hr⟩ | h_square := Classical.em (∃ r : maximalRealSubfield E, r ^ 2 = μ + 0 * r) |
| 160 | · obtain ⟨z, hz⟩ := key (.id _) r (by simpa [sq] using hr) |
| 161 | exact ⟨⟨.C z.re, .C z.im⟩, by ext <;> simp_all [norm_def]⟩ |
| 162 | · have : Fact (∀ r : maximalRealSubfield E, r ^ 2 ≠ μ + 0 * r) := ⟨not_exists.1 h_square⟩ |
| 163 | have : NumberField (QuadraticAlgebra _ μ 0) := .of_module_finite (maximalRealSubfield E) _ |
| 164 | exact key (algebraMap _ (QuadraticAlgebra _ μ 0)) ω omega_mul_omega_eq_mk |
| 165 | intro M _ _ i m hm |
| 166 | refine exists_norm_eq_of_forall_mem_closure (fun σ ↦ hp_pos (σ.comp i)) fun w ↦ ?_ |
| 167 | -- Let `u` be a place of `E` above the place of `E⁺` below `w`. |
| 168 | obtain ⟨u, hu⟩ := FinPlace.comap_surjective (algebraMap (maximalRealSubfield E) E) (w.comap i) |
| 169 | -- The adele `a` that is `q⁻¹` on `S.conjClosure` and `p` elsewhere is a real unit, and its |
| 170 | -- component at `u` is `s`. |
| 171 | let a : 𝔸f E := algebraMap E (𝔸f E) (q⁻¹ - p) * idem S.conjClosure + algebraMap E (𝔸f E) p |
| 172 | have ha_real : star a = a := by simp [a, mem_maximalRealSubfield_iff_star_eq.1] |
| 173 | have ha_unit (v : FinPlace E) : Valued.v (a v) = 1 := by |
| 174 | by_cases hv : v ∈ S.conjClosure |
| 175 | · simp [a, hv, hq_unit v hv] |
| 176 | · simp [a, hv, hp_unit v (hv ∘ .inl)] |
| 177 | let s : maximalRealSubfield E := if u ∈ S.conjClosure then q⁻¹ else p |
| 178 | have ha_u : a u = algebraMap E (u.adicCompletion E) (algebraMap (maximalRealSubfield E) E s) := by |
| 179 | change a u = algebraMap E (𝔸f E) s u |
| 180 | by_cases h : u ∈ S.conjClosure <;> simp [a, s, h] |
| 181 | -- On `S.conjClosure`, `p = (B² + m²) q⁻¹` because `q p = B² + μ`; elsewhere `p = 1 * p`. |
| 182 | obtain ⟨z, hz⟩ : ∃ z : QuadraticAlgebra M (-1) 0, z.norm * i s = i p := by |
| 183 | by_cases h : u ∈ S.conjClosure |
| 184 | · have hq_ne : i q ≠ 0 := (map_ne_zero i).2 fun hq ↦ by simpa [hq] using hq_unit u h |
| 185 | exact ⟨⟨i B, m⟩, by simp [s, h, norm_def, hm, μ, field]⟩ |
| 186 | · exact ⟨1, by simp [s, h]⟩ |
| 187 | -- So `s` is a limit of norms from `E` at the place below `w`. Pass to the completion of `M` at |
| 188 | -- `w` and multiply by `z.norm`: this continuous map sends `s` to `p`, and norms from `E`, which |
| 189 | -- are sums of two squares, to sums of two squares. |
| 190 | let f (t : LocField (w.comap i)) : LocField w := |
| 191 | algebraMap M (LocField w) z.norm * locMap i rfl t |
| 192 | have hf_apply (t : maximalRealSubfield E) : |
| 193 | f (algebraMap _ _ t) = algebraMap M (LocField w) (z.norm * i t) := by simp [f] |
| 194 | rw [← hz, ← hf_apply] |
| 195 | refine map_mem_closure ((continuous_locMap i rfl).const_mul _) |
| 196 | (mem_closure_range_norm_of_apply_eq ha_real ha_unit hu ha_u) ?_ |
| 197 | rintro _ ⟨x, rfl⟩ |
| 198 | obtain ⟨b, c, hbc⟩ := exists_norm_eq_sq_add_sq x |
| 199 | have h_norm : (z * ⟨i b, i c⟩).norm = z.norm * i (norm (maximalRealSubfield E) x) := by |
| 200 | rw [map_mul, hbc] |
| 201 | simp [norm_def, sq] |
| 202 | exact ⟨z * ⟨i b, i c⟩, by simp only [h_norm, hf_apply]⟩ |
| 203 | |
| 204 | end SumOfTwoSquares |
| 205 | |
| 206 | /-! |
| 207 | ## Landherr's theorem |
| 208 | |
| 209 | Vectors are one-column matrices `Matrix n Unit _`. |
| 210 | -/ |
| 211 | |
| 212 | namespace New |
| 213 | |
| 214 | open NumberField Matrix Cohomology Complex Set Function |
| 215 | |
| 216 | -- `s` gives the signs of a space at the infinite places. |
| 217 | variable {E : Type} {n : Type*} {s : n → ℤˣ} [Field E] [CMType E] [Fintype n] [DecidableEq n] |
| 218 | |
| 219 | /-- Let `E` be a CM field and `x` a finite adele of `E`. Then there are finite adeles `a` and |
| 220 | `b = 1 + x a` of the same norm: `ā a = b̄ b`. -/ |
| 221 | private lemma exists_finAdele_norm_eq_norm_one_add_mul (x : 𝔸f E) : |
| 222 | ∃ a b : 𝔸f E, 1 + x * a = b ∧ star a * a = star b * b := by |
| 223 | -- Patch `x (1 - x)` and `1 + x` along an idempotent `e` to an adele `d` dividing both. |
| 224 | obtain ⟨e, d, p, q, he, hd, hp, hq⟩ : ∃ e d p q : 𝔸f E, e * e = e ∧ |
| 225 | d = x * (1 - x) - e * (x * (1 - x) - (1 + x)) ∧ x * (1 - x) = d * p ∧ 1 + x = d * q := by |
| 226 | obtain ⟨e, he, ⟨p, -, hp⟩, -, q, -, hq⟩ := by |
| 227 | simpa [-IsIdempotentElem.mul_one_sub_self] using isValuationPair_Ô (x * (1 - x)) (1 + x) |
| 228 | exact ⟨e, _, p, q, he, rfl, hp, hq⟩ |
| 229 | -- As `(2 - x) (1 + x) - x (1 - x) = 2` is a unit, so is `d`, with inverse `z`. |
| 230 | obtain ⟨t, ht⟩ : ∃ t : 𝔸f E, t * 2 = 1 := |
| 231 | mod_cast (isUnit_natCast_finAdele (E := E) two_ne_zero).exists_left_inv |
| 232 | set z : 𝔸f E := t * ((2 - x) * q - p) |
| 233 | have hz : z * d = 1 := by linear_combination ht - t * (2 - x) * hq + t * hp |
| 234 | refine ⟨z * (x * (1 - e) - star e), z * (x * (1 - star e) + e), ?_, ?_⟩ |
| 235 | · -- The second bracket minus `x` times the first is `d`. |
| 236 | linear_combination (-1 : 𝔸f E) * hz + z * hd |
| 237 | · -- Both brackets have norm `x x̄ (1 - e) (1 - ē) + e ē`, because `e` and `ē` are idempotent. |
| 238 | have he_star : star e * star e = star e := by rw [← star_mul, he] |
| 239 | simp only [star_mul', star_sub, star_add, star_one, star_star] |
| 240 | linear_combination star z * z * (x + star x) * (he_star + he) |
| 241 | |
| 242 | /-- Let `E` be a CM field and `σ` an adele of `E`, written as a `1 × 1` matrix. Then there are |
| 243 | adeles `a` and `b = 1 + σ a` of the same norm: `ā a = b̄ b`. -/ |
| 244 | lemma Core.exists_norm_eq_norm_one_add_mul (σ : Matrix Unit Unit (𝔸 E)) : |
| 245 | ∃ a b : Matrix Unit Unit (𝔸 E), 1 + σ * a = b ∧ aᴴ * a = bᴴ * b := by |
| 246 | -- At a complex place take `a = b = (1 - x)⁻¹`, or `a = -1/2`, `b = 1/2` if `x = 1`. |
| 247 | have h_inf (x : ℂ) : ∃ a b : ℂ, 1 + x * a = b ∧ star a * a = star b * b := by |
| 248 | by_cases hx : x = 1 |
| 249 | · exact ⟨-2⁻¹, 2⁻¹, by norm_num [hx], by simp⟩ |
| 250 | · exact ⟨(1 - x)⁻¹, (1 - x)⁻¹, by field [sub_ne_zero.2 (Ne.symm hx)], rfl⟩ |
| 251 | have h_fin (x : 𝔸f E) : ∃ a b : 𝔸f E, 1 + x * a = b ∧ star a * a = star b * b := |
| 252 | exists_finAdele_norm_eq_norm_one_add_mul x |
| 253 | choose a b hab using h_inf |
| 254 | obtain ⟨a', b', h_shear, h_norm⟩ := h_fin (σ () ()).2 |
| 255 | refine ⟨of fun _ _ ↦ (fun w ↦ a ((σ () ()).1 w), a'), |
| 256 | of fun _ _ ↦ (fun w ↦ b ((σ () ()).1 w), b'), ?_, ?_⟩ |
| 257 | · simp [← ext_iff, Matrix.mul_apply, Prod.ext_iff, hab, h_shear, funext_iff] |
| 258 | · simpa [← ext_iff, Matrix.mul_apply, Prod.ext_iff, h_norm, funext_iff] using fun w ↦ (hab _).2 |
| 259 | |
| 260 | /-- Let `K` be a matrix over `E` that represents `1` over the adeles, into which `toAdele` embeds |
| 261 | `E`, and let `S` be finite. Then the value of `K` at some rational vector has positive real part |
| 262 | under each embedding `Φ w` of the CM type and is a unit at `S.conjClosure`, the places of `S` and |
| 263 | their conjugates. -/ |
| 264 | lemma Core.exists_form_pos_and_unit {K : Matrix n n E} (z : Matrix n Unit (𝔸 E)) |
| 265 | (hz : zᴴ * K.map toAdele * z = 1) {S : Set (FinPlace E)} (hS : S.Finite) : |
| 266 | ∃ u : Matrix n Unit E, |
| 267 | (∀ w : InfinitePlace E, 0 < (Φ w ((uᴴ * (K * u)) () ())).re) ∧ |
| 268 | ∀ w ∈ S.conjClosure, w.valuation E ((uᴴ * (K * u)) () ()) = 1 := by |
| 269 | -- Both conditions define an open set `U` of adeles that contains `1`. |
| 270 | let U : Set (𝔸 E) := (univ.pi fun _ : InfinitePlace E ↦ {c : ℂ | 0 < c.re}) ×ˢ |
| 271 | ⋂ w ∈ S.conjClosure, evalAt w ⁻¹' {x : LocField w | Valued.v.restrict x = 1} |
| 272 | have hU_open : IsOpen U := |
| 273 | (isOpen_set_pi finite_univ fun _ _ ↦ isOpen_re_gt 0).prod <| |
| 274 | hS.conjClosure.isOpen_biInter fun w _ ↦ |
| 275 | (Valued.isOpen_sphere _ one_ne_zero).preimage (continuous_evalAt w) |
| 276 | -- Strong approximation: approximate `z` by a rational `u` plus a term supported off `S` and |
| 277 | -- its conjugate. |
| 278 | obtain ⟨⟨u, y⟩, h_mem⟩ := |
| 279 | (Exchange.denseRange_rat_matrix_add hS.conjClosure.infinite_compl.nonempty 1).exists_mem_open |
| 280 | (hU_open.preimage (f := fun x : Matrix n Unit (𝔸 E) ↦ (xᴴ * K.map toAdele * x) () ()) |
| 281 | (by fun_prop)) ⟨z, by simp [U, hz]⟩ |
| 282 | refine ⟨u, fun w ↦ ?_, fun w hw ↦ ?_⟩ |
| 283 | · -- At the infinite places the second term is `0`. |
| 284 | simpa [U, ← Matrix.map_mul, Matrix.mul_assoc, Matrix.mul_add, Matrix.add_mul] using |
| 285 | h_mem.1 w (mem_univ w) |
| 286 | · -- It is `0` at `w` and at its conjugate as well. |
| 287 | have hw_conj : star w ∈ S.conjClosure := by simpa [conjClosure, or_comm] using hw |
| 288 | simpa [U, hw, hw_conj, idem_apply, -compl_sup, -mem_union, ← Matrix.map_mul, |
| 289 | Matrix.mul_assoc, Matrix.mul_add, Matrix.add_mul] using mem_iInter₂.1 h_mem.2 w hw |
| 290 | |
| 291 | /-- Hasse principle for representing `1`: let `E` satisfy `New.HasPrimitiveRoot5040` and let `K` be |
| 292 | a hermitian matrix over `E`, possibly degenerate. If `zᴴ K z = 1` for an adelic vector `z`, then |
| 293 | `wᴴ K w = 1` for a vector `w` over `E`. -/ |
| 294 | lemma Core.exists_form_eq_one [HasPrimitiveRoot5040 E] |
| 295 | (K : Matrix n n E) (hK : Kᴴ = K) (z : Matrix n Unit (𝔸 E)) |
| 296 | (hz : zᴴ * K.map toAdele * z = 1) : ∃ w : Matrix n Unit E, wᴴ * K * w = 1 := by |
| 297 | let N (u : Matrix n Unit E) : maximalRealSubfield E := |
| 298 | ⟨(uᴴ * (K * u)) () (), mem_maximalRealSubfield_iff_star_eq.2 |
| 299 | (IsHermitian.star_dotProduct_mulVec_comm hK _ _)⟩ |
| 300 | -- First `u` with `N u` positive at infinity, then `v` with `N v` a unit at the finitely many |
| 301 | -- places where `N u` is not, and at their conjugates. |
| 302 | obtain ⟨u, hu_pos, -⟩ := exists_form_pos_and_unit z hz finite_empty |
| 303 | have hu : (N u : E) ≠ 0 := fun h_zero ↦ by |
| 304 | simpa [show (uᴴ * (K * u)) () () = 0 from h_zero] using hu_pos Classical.ofNonempty |
| 305 | let S : Set (FinPlace E) := {w | w.valuation E (N u : E) ≠ 1} |
| 306 | have hS : S.Finite := by simpa [S] using finite_setOf_valued_val_ne_one |
| 307 | (principalIdele (.mk0 _ hu)) |
| 308 | obtain ⟨v, -, hv_unit⟩ := exists_form_pos_and_unit z hz hS |
| 309 | -- Each real embedding of `E⁺` is the restriction of some `Φ w`. |
| 310 | have h_tot : IsTotallyPositive (N u) := fun φ ↦ by |
| 311 | obtain ⟨w, hw⟩ := bijective_cmType_restrict.surjective (ofRealHom.comp φ) |
| 312 | exact (hu_pos w).trans_eq (congrArg re (RingHom.congr_fun hw (N u))) |
| 313 | -- With `2 B = uᴴ K v + vᴴ K u` and `μ = N v * N u - B²`, write `N u` as a sum of the two squares |
| 314 | -- `(p + r √μ)²` and `(q + s √μ)²`. |
| 315 | let B : maximalRealSubfield E := (N (u + v) - N u - N v) / (1 + 1) |
| 316 | let μ : maximalRealSubfield E := N v * N u - B ^ 2 |
| 317 | obtain ⟨p, q, r, s, h_re, h_im⟩ : ∃ p q r s : maximalRealSubfield E, |
| 318 | p * p + q * q + μ * (r * r + s * s) = N u ∧ p * r + q * s = 0 := by |
| 319 | obtain ⟨⟨x, y⟩, hxy⟩ := |
| 320 | exists_sq_add_sq_quadraticAlgebra (N u) (N v) B h_tot (fun _ ↦ not_not.1) hv_unit |
| 321 | obtain ⟨h_re, h_im⟩ : x.re * x.re + μ * x.im * x.im + (y.re * y.re + μ * y.im * y.im) = N u ∧ |
| 322 | x.re * x.im + x.im * x.re + (y.re * y.im + y.im * y.re) = 0 := by |
| 323 | simpa [QuadraticAlgebra.norm_def, QuadraticAlgebra.ext_iff] using hxy |
| 324 | exact ⟨x.re, y.re, x.im, y.im, by linear_combination h_re, by linear_combination h_im / 2⟩ |
| 325 | obtain ⟨i, hi_sq, hi_star⟩ := HasPrimitiveRoot5040.exists_mul_self_eq_neg_one (E := E) |
| 326 | -- Let `α = p + i q` and `β = i (r + i s)`. The vector `(α / N u) u + β (v - (B / N u) u)` has |
| 327 | -- norm `(ᾱ α + μ β̄ β) / N u = 1`. The cross terms cancel because `ᾱ β` is real (as |
| 328 | -- `p r + q s = 0`) and `uᴴ K (v - (B / N u) u)` is skew. |
| 329 | let form (x y : Matrix n Unit E) : E := (xᴴ * (K * y)) () () |
| 330 | have h_expand (a b : E) : form (a • u + b • v) (a • u + b • v) = |
| 331 | star a * a * N u + star a * b * form u v + star b * a * form v u + star b * b * N v := by |
| 332 | simp [form, N, Matrix.add_mul, Matrix.mul_add] |
| 333 | ring |
| 334 | have hB : form u v + form v u = 2 * B := by |
| 335 | simp [form, B, N, Matrix.add_mul, Matrix.mul_add] |
| 336 | ring |
| 337 | have hI_sq : (i : E) * i = -1 := by simpa using congrArg (algebraMap (𝓞 E) E) hi_sq |
| 338 | have hI_star : star (i : E) = -i := by simpa using congrArg (algebraMap (𝓞 E) E) hi_star |
| 339 | have h_real (x : maximalRealSubfield E) : star (x : E) = x := |
| 340 | mem_maximalRealSubfield_iff_star_eq.1 x.property |
| 341 | have h_re_coe : (p * p + q * q + (N v * N u - B ^ 2) * (r * r + s * s) : E) = N u := |
| 342 | congrArg Subtype.val h_re |
| 343 | have h_im_coe : (p * r + q * s : E) = 0 := congrArg Subtype.val h_im |
| 344 | obtain ⟨α, β, hα, hβ, h_cross⟩ : ∃ α β : E, star α * α = p * p + q * q ∧ |
| 345 | star β * β = r * r + s * s ∧ star β * α = star α * β := by |
| 346 | refine ⟨p + q * i, r * i - s, ?_⟩ |
| 347 | simp only [star_add, star_sub, star_mul', h_real, hI_star] |
| 348 | exact ⟨by linear_combination -(q * q : E) * hI_sq, by linear_combination -(r * r : E) * hI_sq, |
| 349 | by linear_combination -(2 * i : E) * h_im_coe⟩ |
| 350 | let w : Matrix n Unit E := ((α - β * B) / N u) • u + β • v |
| 351 | have h_norm : form w w = 1 := by |
| 352 | simp only [w, h_expand, star_div₀, star_sub, star_mul', h_real] |
| 353 | field_simp |
| 354 | linear_combination h_re_coe + hα + (N v * N u - B ^ 2 : E) * hβ |
| 355 | + (star α * β - star β * β * B) * hB + (form v u - B) * h_cross |
| 356 | exact ⟨w, ext fun _ _ ↦ by simpa only [form, Matrix.mul_assoc, Matrix.one_apply_eq] using h_norm⟩ |
| 357 | |
| 358 | /-- If `uᴴ u = 1`, and `u` and `uᴴ` are eigenvectors of `D` with eigenvalue `c`, then shearing by |
| 359 | `1 + u ρ` adds `c (u ρ + (u ρ)ᴴ + ρᴴ ρ)` to `D`. -/ |
| 360 | private lemma Core.conjTranspose_one_add_mul_mul_self {R : Type*} [CommRing R] [StarRing R] {c : R} |
| 361 | {D : Matrix n n R} {u : Matrix n Unit R} (hu : uᴴ * u = 1) (h_column : D * u = c • u) |
| 362 | (h_row : uᴴ * D = c • uᴴ) (ρ : Matrix Unit n R) : |
| 363 | (1 + u * ρ)ᴴ * D * (1 + u * ρ) = D + c • (u * ρ + (u * ρ)ᴴ + ρᴴ * ρ) := by |
| 364 | simp [Matrix.mul_add, Matrix.add_mul, Matrix.mul_assoc, ← Matrix.mul_assoc D u, |
| 365 | ← Matrix.mul_assoc uᴴ u, h_column, h_row, hu] |
| 366 | abel |
| 367 | |
| 368 | /-- Let `J` be hermitian, `c * c = 1`, `wᴴ (c J) w = 1`, and let `J'` be `J` projected to the |
| 369 | orthogonal complement of `w`. For a matrix `A` there is `A'`, namely `A` with its columns projected |
| 370 | to that complement and `w` added to column `j`, with `A'ᴴ J A' = Aᴴ J' A + c eⱼ eⱼᵀ`. -/ |
| 371 | private lemma Core.exists_gram_eq_gram_compl_add_single {J : Matrix n n E} (hJ : Jᴴ = J) {c : E} |
| 372 | (hc_star : star c = c) (hc : c * c = 1) {w : Matrix n Unit E} (hw : wᴴ * (c • J) * w = 1) |
| 373 | (A : Matrix n n E) (j : n) : |
| 374 | ∃ A' : Matrix n n E, |
| 375 | A'ᴴ * J * A' = Aᴴ * (J - c • J * w * wᴴ * J) * A + Matrix.single j j c := by |
| 376 | let J' : Matrix n n E := J - c • J * w * wᴴ * J |
| 377 | let β : Matrix Unit n E := -c • wᴴ * J * A + Matrix.single () j 1 |
| 378 | have hw_norm : wᴴ * J * w = c • 1 := by simp [← hw, smul_smul, hc] |
| 379 | have hJ'_w : J' * w = 0 := by |
| 380 | simp [J', Matrix.sub_mul, Matrix.mul_assoc, hw_norm, smul_smul, hc] |
| 381 | have hw_J' : wᴴ * J' = 0 := by |
| 382 | simp [J', Matrix.mul_sub, ← Matrix.mul_assoc, hw_norm, smul_smul, hc] |
| 383 | have h_pair : wᴴ * J * (A + w * β) = c • Matrix.single () j 1 := by |
| 384 | simp [Matrix.mul_add, ← Matrix.mul_assoc, hw_norm, β, smul_smul, hc] |
| 385 | use A + w * β |
| 386 | calc _ = (A + w * β)ᴴ * J' * (A + w * β) + |
| 387 | c • ((wᴴ * J * (A + w * β))ᴴ * (wᴴ * J * (A + w * β))) := by |
| 388 | simp [J', hJ, Matrix.mul_sub, Matrix.sub_mul, Matrix.mul_assoc] |
| 389 | _ = Aᴴ * J' * A + Matrix.single j j c := by |
| 390 | simp [h_pair, Matrix.mul_add, Matrix.add_mul, Matrix.mul_assoc, hJ'_w, hw_J', hc, hc_star, |
| 391 | ← Matrix.mul_assoc J' w] |
| 392 | |
| 393 | variable [HasPrimitiveRoot5040 E] |
| 394 | |
| 395 | /-- Let `J` be hermitian over `E` and let `Xᴴ J X` be the diagonal matrix with the signs `s i` at |
| 396 | `i ∈ insert j t`, for an adelic matrix `X` and `j ∉ t`. Then some rational vector `w` has norm |
| 397 | `s j` for `J`, and some adelic matrix `X'` has Gram matrix the diagonal of the signs at `i ∈ t` for |
| 398 | `J` projected to the orthogonal complement of `w`. -/ |
| 399 | private lemma Core.exists_adelic_frame_compl {j : n} {t : Finset n} (hj : j ∉ t) |
| 400 | {J : Matrix n n E} {X : Matrix n n (𝔸 E)} (hJ : Jᴴ = J) |
| 401 | (hX : Xᴴ * J.map toAdele * X = ∑ i ∈ insert j t, Matrix.single i i (s i : 𝔸 E)) : |
| 402 | ∃ w : Matrix n Unit E, wᴴ * ((s j : E) • J) * w = 1 ∧ ∃ X' : Matrix n n (𝔸 E), |
| 403 | X'ᴴ * (J - (s j : E) • J * w * wᴴ * J).map toAdele * X' = |
| 404 | ∑ i ∈ t, Matrix.single i i (s i : 𝔸 E) := by |
| 405 | -- `X * u`, column `j` of `X` times the sign `c`, has norm `1` for `c • J`; so has some |
| 406 | -- rational `w`. |
| 407 | let c : E := s j |
| 408 | let u : Matrix n Unit (𝔸 E) := Matrix.single j () (toAdele c) |
| 409 | set D : Matrix n n (𝔸 E) := ∑ i ∈ insert j t, Matrix.single i i (s i : 𝔸 E) |
| 410 | have h_column : D * u = toAdele c • u := by |
| 411 | simp +contextual [D, Matrix.sum_mul, Finset.sum_eq_single j, u, c] |
| 412 | have hu : uᴴ * u = 1 := by simp [u, c, ← ext_iff, ← Int.cast_mul] |
| 413 | have h_Xu_norm : (X * u)ᴴ * (c • J).map toAdele * (X * u) = 1 := |
| 414 | calc _ = toAdele c • (uᴴ * (Xᴴ * J.map toAdele * X * u)) := by |
| 415 | simp [map_smul', Matrix.mul_assoc] |
| 416 | _ = 1 := by simp [hX, h_column, hu, smul_smul, c, ← Int.cast_mul] |
| 417 | obtain ⟨w, hw⟩ : ∃ w : Matrix n Unit E, wᴴ * (c • J) * w = 1 := |
| 418 | exists_form_eq_one (c • J) (by simp [c, hJ]) (X * u) h_Xu_norm |
| 419 | -- Shear `X` to `X'`: column `j` becomes `0`, and `a * r i` times `X * u` is added to column |
| 420 | -- `i ≠ j`. Here `r i` is the product of `w` with that column, and `a` has the same norm as |
| 421 | -- `b = 1 + wᴴ J X u a`. |
| 422 | let v : Matrix Unit n (𝔸 E) := (wᴴ * J).map toAdele |
| 423 | let r : Matrix Unit n (𝔸 E) := v * X * (1 + -u * uᴴ) |
| 424 | obtain ⟨a, b, hb, h_norm⟩ := exists_norm_eq_norm_one_add_mul (v * X * u) |
| 425 | let ρ : Matrix Unit n (𝔸 E) := a * r + -uᴴ |
| 426 | let X' : Matrix n n (𝔸 E) := X + X * u * ρ |
| 427 | have h_pair : v * X' = b * r := by |
| 428 | simp [← hb, X', ρ, r, Matrix.mul_add, Matrix.mul_assoc, Matrix.add_mul] |
| 429 | abel |
| 430 | have h_row : uᴴ * D = toAdele c • uᴴ := by |
| 431 | simpa [D, conjTranspose_sum, c] using congrArg Matrix.conjTranspose h_column |
| 432 | have hD : D = (∑ i ∈ t, Matrix.single i i (s i : 𝔸 E)) + toAdele c • (u * uᴴ) := by |
| 433 | simp [D, u, c, hj, add_comm, ← Int.cast_mul] |
| 434 | have h_shear : X'ᴴ * J.map toAdele * X' = |
| 435 | (∑ i ∈ t, Matrix.single i i (s i : 𝔸 E)) + toAdele c • (rᴴ * (aᴴ * a) * r) := |
| 436 | calc _ = (1 + u * ρ)ᴴ * D * (1 + u * ρ) := by |
| 437 | simp [← hX, X', Matrix.mul_add, Matrix.add_mul, Matrix.mul_assoc] |
| 438 | _ = D + toAdele c • (u * ρ + (u * ρ)ᴴ + ρᴴ * ρ) := |
| 439 | conjTranspose_one_add_mul_mul_self hu h_column h_row ρ |
| 440 | _ = _ := by |
| 441 | simp [hD, ρ, Matrix.mul_add, Matrix.add_mul, Matrix.mul_assoc] |
| 442 | abel |
| 443 | -- Let `J'` be `J` projected to the orthogonal complement of `w`. The shear adds `c rᴴ aᴴ a r` |
| 444 | -- to the Gram matrix for `t`, and the projection subtracts `c rᴴ bᴴ b r`, which is the same. |
| 445 | let J' : Matrix n n E := J - c • J * w * wᴴ * J |
| 446 | have h_frame : X'ᴴ * J'.map toAdele * X' = ∑ i ∈ t, Matrix.single i i (s i : 𝔸 E) := |
| 447 | calc _ = X'ᴴ * J.map toAdele * X' - toAdele c • ((v * X')ᴴ * (v * X')) := by |
| 448 | simp [J', v, hJ, Matrix.map_sub, map_smul', Matrix.mul_sub, Matrix.sub_mul, |
| 449 | Matrix.mul_assoc] |
| 450 | _ = _ := by simp [h_shear, h_pair, h_norm, Matrix.mul_assoc] |
| 451 | exact ⟨w, hw, X', h_frame⟩ |
| 452 | |
| 453 | /-- Hasse principle for partial frames: let `E` satisfy `New.HasPrimitiveRoot5040`, let `J` be |
| 454 | hermitian over `E`, possibly degenerate, let `s` be a family of signs indexed by `n`, and let `D` be |
| 455 | the diagonal matrix with the sign `s i` at `i ∈ t` and `0` elsewhere. If `Xᴴ J X = D` for a square |
| 456 | matrix `X` over the adeles `𝔸 E`, into which `toAdele` embeds `E`, then `Aᴴ J A = D` for a square |
| 457 | matrix `A` over `E`. -/ |
| 458 | lemma Core.exists_rat_frame_of_adelic (t : Finset n) {J : Matrix n n E} {X : Matrix n n (𝔸 E)} |
| 459 | (hJ : Jᴴ = J) (hX : Xᴴ * J.map toAdele * X = ∑ i ∈ t, Matrix.single i i (s i : 𝔸 E)) : |
| 460 | ∃ A : Matrix n n E, Aᴴ * J * A = ∑ i ∈ t, Matrix.single i i (s i : E) := by |
| 461 | -- Induction on `t`: split off a rational vector `w` of norm `s j` and pass to its complement. |
| 462 | induction t using Finset.induction generalizing J X with |
| 463 | | empty => exact ⟨0, by simp⟩ |
| 464 | | insert j t hj ih => |
| 465 | -- Split off a rational vector `w` of norm `s j`; a shear of `X` is then a frame for `J` |
| 466 | -- projected to the orthogonal complement of `w`. |
| 467 | obtain ⟨w, hw, X', h_frame⟩ := exists_adelic_frame_compl hj hJ hX |
| 468 | obtain ⟨A, hA⟩ := ih (by simp [hJ, Matrix.mul_assoc]) h_frame |
| 469 | -- Project the columns of `A` to the orthogonal complement of `w` and add `w` to column `j`. |
| 470 | rw [Finset.sum_insert hj, add_comm, ← hA] |
| 471 | exact exists_gram_eq_gram_compl_add_single hJ (by simp) (by simp [← Int.cast_mul]) hw A j |
| 472 | |
| 473 | /-- A case of Landherr's theorem. Let `E` be a CM field containing a primitive root of unity of |
| 474 | order `5040`, and let a `Space E n s` be a Hermitian matrix `J` over `E` together with an adelic |
| 475 | `x : GL n (𝔸 E)` such that `xᴴ J x` is `diag(s)` at the infinite places and `1` at the finite |
| 476 | places. Then any two such spaces `V`, `W` with the same signs `s` are equivalent over `E`: there is |
| 477 | `a : GL n E` with `aᴴ V.J a = W.J`. -/ |
| 478 | lemma Space.landherr (V W : Space E n s) : ∃ a : GL n E, a.valᴴ * V.J * a = W.J := by |
| 479 | -- The matrix of a space with signs `s` is adelically, so rationally, equivalent to `diag(s)`. |
| 480 | have h_diag (Y : Space E n s) : ∃ a : GL n E, a.valᴴ * Y.J * a = (signedSpace E s).J := by |
| 481 | let X : GL n (𝔸 E) := Y.x * (signedSpace E s).x⁻¹ |
| 482 | have h_adelic : X.valᴴ * Y.J.map toAdele * X.val = (signedSpace E s).J.map toAdele := |
| 483 | gram_mul_of_gram_eq Y.gram_point (gram_inv_of_gram_eq (signedSpace E s).gram_point) |
| 484 | obtain ⟨A, hA⟩ : ∃ A : Matrix n n E, Aᴴ * Y.J * A = (signedSpace E s).J := by |
| 485 | simpa [signedSpace, sum_single_eq_diagonal] using Core.exists_rat_frame_of_adelic (s := s) |
| 486 | Finset.univ Y.isHermitian_J (h_adelic.trans (by simp [signedSpace, sum_single_eq_diagonal])) |
| 487 | exact ⟨(isUnit_of_mul_isUnit_right (x := Aᴴ * Y.J) |
| 488 | (by simp [hA, signedSpace, Pi.isUnit_iff])).unit, hA⟩ |
| 489 | obtain ⟨a, ha⟩ := h_diag V |
| 490 | obtain ⟨b, hb⟩ := h_diag W |
| 491 | exact ⟨a * b⁻¹, gram_mul_of_gram_eq ha (gram_inv_of_gram_eq hb)⟩ |
| 492 | |
| 493 | /-- Landherr's theorem for spaces with a point, for a CM field `E` satisfying |
| 494 | `New.HasPrimitiveRoot5040`. A space `Space E n s` is a Hermitian matrix `J` over `E` with a point |
| 495 | `x : GL n (𝔸 E)` such that `xᴴ J x` is `diag(s)` at the infinite places and `1` at the finite |
| 496 | places. Two spaces `V`, `W` with the same signs `s` differ by a rational change of basis `a` and by |
| 497 | moving the point by some `g` in the adelic unitary group `G E s`: `aᴴ V.J a = W.J`, |
| 498 | `W.x = a⁻¹ V.x g`, and under the embeddings `New.Space.ratEmbed` into `G E s` (sending `γ` to |
| 499 | `x⁻¹ γ x`), the map `γ ↦ a γ a⁻¹` from `U W.J` to `U V.J` becomes conjugation by `g`. Here |
| 500 | `g.toUnitary` is `g` as a matrix over `𝔸 E`, and `toAdele` embeds `E` in `𝔸 E`. -/ |
| 501 | lemma Space.exists_x_eq_and_ratEmbed_conj_eq (V W : Space E n s) : |
| 502 | ∃ (a : GL n E) (g : G E s) (h : a.valᴴ * V.J * a = W.J), |
| 503 | W.x = (a.map toAdele)⁻¹ * V.x * g.toUnitary ∧ |
| 504 | ∀ γ : U W.J, V.ratEmbed (U.conj a h γ) = g * W.ratEmbed γ * g⁻¹ := by |
| 505 | obtain ⟨a, ha⟩ := V.landherr W |
| 506 | -- `a * W.x` is a second frame of `V.J`, so `V.x⁻¹ * a * W.x` preserves the standard form. |
| 507 | have h_unitary : V.x⁻¹ * (a.map toAdele * W.x) ∈ U (stdForm E s) := |
| 508 | mem_unitaryGroupOf_iff.2 <| gram_mul_of_gram_eq (gram_inv_of_gram_eq V.gram_point) |
| 509 | (gram_mul_of_gram_eq (by simp [← ha, Matrix.mul_assoc]) W.gram_point) |
| 510 | refine ⟨a, G.toUnitary.symm ⟨_, h_unitary⟩, ha, by simp [mul_assoc], fun γ ↦ ?_⟩ |
| 511 | simp [ratEmbed, toRatCoords, U.map, MulEquiv.symm_apply_eq, mul_assoc, Subtype.ext_iff] |
| 512 | |
| 513 | end New |
| 514 | |
| 515 | /-! |
| 516 | ## Galois descent and the Hasse principle for unitary cocycles |
| 517 | |
| 518 | `New.twistedNorm τ p δ` is the twisted norm `δ · τ δ ⋯ τ^(p-1) δ`; `New.U.mapEnd` and `New.galoisGf` |
| 519 | are the entrywise actions of `σ` on rational and finite adelic unitary matrices. |
| 520 | -/ |
| 521 | |
| 522 | section UnitaryHassePrinciple |
| 523 | |
| 524 | open NumberField Matrix Polynomial UniqueFactorizationMonoid ComplexOrder ComplexEmbedding |
| 525 | Module Function IsGalois |
| 526 | |
| 527 | namespace New |
| 528 | |
| 529 | variable {E E' n : Type} [Field E] [NumberField E] [Field E'] [NumberField E'] |
| 530 | [Algebra E E'] [IsGalois E E'] [Fintype n] [DecidableEq n] {σ : Gal(E'/E)} |
| 531 | |
| 532 | open scoped Classical in |
| 533 | /-- A normal matrix over a CM field (one commuting with its conjugate transpose) is killed by |
| 534 | the radical of its characteristic polynomial. -/ |
| 535 | @[simp] |
| 536 | lemma aeval_radical_charpoly [IsCMField E] {M : Matrix n n E} [IsStarNormal M] : |
| 537 | aeval M (radical M.charpoly) = 0 := by |
| 538 | -- The value `N` of the radical at `M` is nilpotent (Cayley–Hamilton) and commutes with `Nᴴ`, so |
| 539 | -- the trace of `Nᴴ * N` is nilpotent, hence zero; under a complex embedding it is the sum of the |
| 540 | -- squared norms of the entries of `N`. |
| 541 | set N : Matrix n n E := aeval M (radical M.charpoly) |
| 542 | obtain ⟨k, hk⟩ := exists_dvd_radical_self_pow M.charpoly_monic.ne_zero |
| 543 | have h_nil : IsNilpotent N := ⟨k, by simpa [aeval_self_charpoly] using map_dvd (aeval M) hk⟩ |
| 544 | have h_trace : (Nᴴ * N).trace = 0 := (isNilpotent_trace_of_isNilpotent |
| 545 | ((commute_conjTranspose_aeval M).isNilpotent_mul_left h_nil)).eq_zero |
| 546 | simpa [AddMonoidHom.map_trace, conjTranspose_map _ (map_star_complex _), ← ext_iff, |
| 547 | trace_conjTranspose_mul_self_eq_zero_iff] using congrArg (Φ Classical.ofNonempty) h_trace |
| 548 | |
| 549 | /-- For E'/E a Galois extension of number fields of prime degree and σ ≠ 1 in its Galois group, |
| 550 | every element of E' fixed by σ lies in E. -/ |
| 551 | lemma mem_range_algebraMap_of_fixed_of_prime (hσ : σ ≠ 1) [Fact (finrank E E').Prime] ⦃x : E'⦄ |
| 552 | (hx : σ x = x) : |
| 553 | x ∈ (algebraMap E E').range := by |
| 554 | -- The group has prime order, so every element is a power of `σ`. |
| 555 | rw [RingHom.mem_range, ← Set.mem_range, mem_range_algebraMap_iff_fixed, |
| 556 | (bijective_pow_of_ne_one_of_prime_finrank hσ).surjective.forall] |
| 557 | simp [iterate_fixed hx] |
| 558 | |
| 559 | /-- For E'/E a Galois extension of number fields of prime degree and σ ≠ 1 in its Galois group, |
| 560 | every finite adele of E' fixed by σ comes from a finite adele of E. Here `adeleMap σ` is the action |
| 561 | of σ on the finite adeles `𝔸f E'` and `finAdeleIncl E E'` includes the finite adeles of E in |
| 562 | these. -/ |
| 563 | lemma mem_range_finAdeleIncl_of_adeleMap_eq (hσ : σ ≠ 1) [Fact (finrank E E').Prime] ⦃x : 𝔸f E'⦄ |
| 564 | (hx : adeleMap σ x = x) : x ∈ (finAdeleIncl E E').range := by |
| 565 | rw [mem_range_finAdeleIncl_iff, (bijective_pow_of_ne_one_of_prime_finrank hσ).surjective.forall] |
| 566 | simp [← adeleMap_gal_pow, iterate_fixed hx] |
| 567 | |
| 568 | /-- Hasse principle for `H¹(⟨σ⟩, U(n))`, with `U(n) = {g | gᴴ g = 1}`, where `E' / E` is a Galois |
| 569 | extension of CM fields of prime degree `p` and `σ ≠ 1` is in its Galois group. Let `s` be a point |
| 570 | over `E'` such that `s = u σ(u)⁻¹` for a point `u` over the finite adeles of `E'` and the twisted |
| 571 | norm `s σ(s) ⋯ σ^(p-1)(s)` is `1`. Then `s = g σ(g)⁻¹` for a point `g` over `E'`, written as |
| 572 | `σ(g) = s⁻¹ g`. Here `Gf E' n` is the unitary group over the finite adeles, `map` takes `s` into it, |
| 573 | and `U.mapEnd` and `galoisGf` apply `σ` to each entry, `map_star_CM` saying that `σ` commutes with |
| 574 | complex conjugation. Landherr's theorem needs that `E` has a CM type and a primitive root of unity |
| 575 | of order `5040` (`CMType`, `New.HasPrimitiveRoot5040`). -/ |
| 576 | lemma U.hasse_principle_coboundary [IsCMField E'] |
| 577 | {E : Type} [Field E] [CMType E] [Algebra E E'] [IsGalois E E'] |
| 578 | {σ : Gal(E'/E)} (hσ : σ ≠ 1) [Fact (finrank E E').Prime] |
| 579 | [HasPrimitiveRoot5040 E] {s : U (1 : Matrix n n E')} (u : Gf E' n) |
| 580 | (hs : map (algebraMap E' (𝔸f E')) (fun x : E' ↦ (star_algebraMap_finAdele x).symm) |
| 581 | (one_map_ringHom (algebraMap E' (𝔸f E'))) s = u * (galoisGf σ u)⁻¹) |
| 582 | (hs_norm : twistedNorm (mapEnd (map_star_CM σ)) (finrank E E') s = 1) : |
| 583 | ∃ g : U (1 : Matrix n n E'), mapEnd (map_star_CM σ) g = s⁻¹ * g := by |
| 584 | -- Hilbert 90 for `GL n` gives `s = g σ(g)⁻¹`. The form `gᴴ g` descends to a matrix `J` over `E` |
| 585 | -- that is everywhere locally isometric to the standard form, hence globally (Landherr): |
| 586 | -- `lᴴ J l = 1`. Then `g l` is unitary and still splits `s`. |
| 587 | let a : E' →+* 𝔸f E' := algebraMap E' (𝔸f E') |
| 588 | have h_norm : twistedNorm (GeneralLinearGroup.map (σ : E' →+* E')) (orderOf σ) s.val = 1 := by |
| 589 | rw [orderOf_eq_prime (p := finrank E E') (by simp [← card_aut_eq_finrank]) hσ, |
| 590 | ← map_one (U (1 : Matrix n n E')).subtype, ← hs_norm] |
| 591 | exact (map_twistedNorm (U (1 : Matrix n n E')).subtype (fun _ ↦ rfl) _ s).symm |
| 592 | -- Hilbert 90 at level `1`, where the congruence condition always holds |
| 593 | obtain ⟨g, -, hg : s.val.val * g.val.map (σ : E' →+* E') = g.val, -⟩ := |
| 594 | (isTameAtLevel_gal σ).hilbert90_gl (Y := s.val.val - 1) (.inl inferInstance) s.val |
| 595 | (by simp) h_norm |
| 596 | -- `u⁻¹ g` is fixed by `σ`, since `s` is split by both `u` and `g`; so it comes from `E`. |
| 597 | have hs_mat : s.1.1.map a = (u * (galoisGf σ u)⁻¹).1.1 := congrArg (fun x : Gf E' n ↦ x.1.1) hs |
| 598 | have h_fixed_adelic : (u.val⁻¹ * g.map a).map (adeleMap σ) = u.val⁻¹ * g.map a := by |
| 599 | have hg_adelic : (u⁻¹).val.val * (s.val.val * g.val.map (σ : E' →+* E')).map a = |
| 600 | (u⁻¹).val.val * g.val.map a := by rw [hg] |
| 601 | -- `using!` identifies the inverse in `Gf E' n` with that in `GL n (𝔸f E')`. |
| 602 | exact Units.ext <| by simpa [a, hs_mat, comp_def, mul_assoc] using! hg_adelic |
| 603 | obtain ⟨y, hy⟩ : ∃ y : GL n (𝔸f E), y.map (adeleMap (algebraMap E E')) = u.val⁻¹ * g.map a := |
| 604 | exists_gl_map_eq_of_fixed (adeleMap_injective _) (mem_range_finAdeleIncl_of_adeleMap_eq hσ) |
| 605 | h_fixed_adelic |
| 606 | -- `gᴴ g` is fixed by `σ`, since `s` is unitary; so it comes from `E` too. |
| 607 | have h_fixed_form : (star g * 1 * g).map (σ : E' →+* E') = star g * 1 * g := by |
| 608 | refine Units.ext ?_ |
| 609 | simpa [star, conjTranspose_map _ (map_star_CM _), ← inv_val_eq_conjTranspose, mul_assoc, |
| 610 | -RingHom.coe_coe] using congrArg (fun M : Matrix n n E' ↦ Mᴴ * M) hg |
| 611 | obtain ⟨J, hJ⟩ : ∃ J : GL n E, J.map (algebraMap E E') = star g * 1 * g := |
| 612 | exists_gl_map_eq_of_fixed (RingHom.injective _) (mem_range_algebraMap_of_fixed_of_prime hσ) |
| 613 | h_fixed_form |
| 614 | have hJ_mat : g.valᴴ * 1 * g.val = J.val.map (algebraMap E E') := congrArg Units.val hJ.symm |
| 615 | -- Local isometries: `g` at the infinite places, `y` at the finite places. |
| 616 | have h_infinite (w : InfinitePlace E) : |
| 617 | (g.map (lift E' (Φ w))).valᴴ * signMatrix (1 : n → ℤˣ) * (g.map (lift E' (Φ w))).val = |
| 618 | J.val.map (Φ w) := by |
| 619 | simpa [← ext_iff, Matrix.mul_apply] using congrArg (Matrix.map · (lift E' (Φ w))) hJ_mat |
| 620 | have h_adelic : (g.map a).valᴴ * 1 * (g.map a).val = J.val.map (a ∘ algebraMap E E') := by |
| 621 | simpa [← ext_iff, Matrix.mul_apply, a] using congrArg (Matrix.map · a) hJ_mat |
| 622 | have h_finite : y.valᴴ * 1 * y.val = J.val.map (algebraMap E (𝔸f E)) := by |
| 623 | apply map_injective (adeleMap_injective (algebraMap E E')) |
| 624 | -- `y` becomes `u⁻¹ g` over `E'`, and `u⁻¹` is unitary. |
| 625 | simpa [← hy, comp_def, ↓map_conjTranspose_mul_mul, adeleMap_star] using! |
| 626 | gram_mul_of_gram_eq (mem_unitaryGroupOf_iff.1 u⁻¹.property) h_adelic |
| 627 | -- Landherr's theorem compares the space of `J` with the standard space `stdSpace E n`. |
| 628 | let V : Space E n 1 := ⟨J, _, gram_mkAdelicGL (fun w ↦ gram_inv_of_gram_eq (h_infinite w)) |
| 629 | (gram_inv_of_gram_eq h_finite)⟩ |
| 630 | obtain ⟨l, hl : l.valᴴ * J.val * l.val = (stdSpace E n).J⟩ := V.landherr (stdSpace E n) |
| 631 | refine ⟨⟨g * l.map (algebraMap E E'), mem_unitaryGroupOf_iff.2 (gram_mul_of_gram_eq hJ_mat ?_)⟩, |
| 632 | eq_inv_mul_of_mul_eq ?_⟩ |
| 633 | · simp [← map_conjTranspose_mul_mul, map_star_CM, hl, stdSpace] |
| 634 | · -- `σ` fixes `l`, so `s σ(g l) = s σ(g) l = g l`. |
| 635 | ext |
| 636 | simp only [RingHom.coe_coe] at hg |
| 637 | simp [U.map, ← mul_assoc, comp_def, hg] |
| 638 | |
| 639 | end New |
| 640 | |
| 641 | end UnitaryHassePrinciple |