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.Algebra.Ring.Divisibility.Lemmas |
| 4 | import Mathlib.RingTheory.PiTensorProduct |
| 5 | public import Lib.GaloisRep.BaseChange.Defs |
| 6 | import Lib.GaloisRep.Hilbert90.TameActions |
| 7 | import Lib.General.LinearAlgebra.MatrixPolynomials |
| 8 | |
| 9 | /-! |
| 10 | # Hilbert 90 for unitary groups over profinite rings and for finite ideles |
| 11 | |
| 12 | This file proves Hilbert 90 for the unitary group over a profinite ring, with a congruence modulo |
| 13 | `m`. On the way it constructs twisted roots in `O[X]/Q` (`New.exists_isTwistedRoot_of_charpoly_eq`) |
| 14 | and orthonormal frames fixed by `τ` for invertible hermitian matrices |
| 15 | (`New.exists_fixed_orthonormal_frame`). It also proves Hilbert 90 for the finite ideles of `L`, for |
| 16 | an automorphism `σ` of `L/K` acting through `New.adeleMap`. This follows from Galois descent for the |
| 17 | semilinear map `x ↦ u * σ x`, together with the fact that two of its fixed points have a common |
| 18 | divisor that is again fixed. |
| 19 | |
| 20 | The main results `New.exists_fixed_orthonormal_frame` and `New.unitary_hilbert90_at_level` share |
| 21 | these hypotheses: `New.IsProfiniteRing O` (`O` is profinite); `New.IsTameAtLevel τ p 0`, which says |
| 22 | that `τ ^ p = 1`, `0 < p` and some element has trace `1`; `τ` commutes with `star` and fixes `c`, |
| 23 | and `c - star c` is a unit. |
| 24 | |
| 25 | The lemmas before them concern the polynomial `X * (-w) ^ k`, for an inverse `w` of `1 + m X` modulo |
| 26 | `Q`, and endomorphisms of `O[X]/Q`; they state their own hypotheses. |
| 27 | |
| 28 | ## Main definitions and results |
| 29 | |
| 30 | * `New.unitary_hilbert90_at_level`: Hilbert 90 for the unitary group, with a congruence modulo `m`. |
| 31 | * `New.hilbert90_finite_idele`: Hilbert 90 for the finite ideles, for an automorphism of `L/K`. |
| 32 | |
| 33 | Notions from other files: |
| 34 | * `New.IsTameAtLevel σ p m`: `σ ^ p = 1` with `0 < p`, `σ m = m`, some element has trace `1` modulo |
| 35 | `m`, and no `σ ^ i` with `0 < i < p` is trivial modulo a prime not containing `m`. |
| 36 | * `New.IsProfiniteRing R`: every sequence has a unique limit modulo each natural number `M ≠ 0`, |
| 37 | along the hyperfilter. |
| 38 | |
| 39 | ## Relation to the literature |
| 40 | |
| 41 | Known; see `Lib.GaloisRep.Hilbert90.TameActions` for sources. |
| 42 | -/ |
| 43 | |
| 44 | @[expose] public section |
| 45 | |
| 46 | open IsDedekindDomain (FiniteAdeleRing) |
| 47 | |
| 48 | /-! |
| 49 | ## Hilbert 90 for unitary groups over profinite rings |
| 50 | -/ |
| 51 | |
| 52 | section UnitaryHilbert90 |
| 53 | |
| 54 | open Matrix Polynomial AdjoinRoot Finset Ideal New.U RingHom |
| 55 | |
| 56 | namespace New |
| 57 | |
| 58 | variable {O n : Type*} [CommRing O] [Fintype n] [DecidableEq n] [StarRing O] {τ : O →+* O} {p : ℕ} |
| 59 | |
| 60 | omit [StarRing O] in |
| 61 | /-- Let `g` be a ring endomorphism of `O` and `s` a polynomial such that `Q` divides |
| 62 | `(Q.map g).comp s`. Then `q ↦ (q.map g).comp s` passes to a ring endomorphism `θ` of `O[X]/Q`. -/ |
| 63 | lemma exists_adjoinRoot_map_comp {Q : O[X]} (g : O →+* O) (s : O[X]) (hs : Q ∣ (Q.map g).comp s) : |
| 64 | ∃ θ : AdjoinRoot Q →+* AdjoinRoot Q, ∀ q : O[X], |
| 65 | θ (AdjoinRoot.mk Q q) = AdjoinRoot.mk Q ((q.map g).comp s) := by |
| 66 | have h_le : span {Q} ≤ (span {Q}).comap (s.compRingHom.comp (mapRingHom g)) := by |
| 67 | simpa [mem_span_singleton] using hs |
| 68 | exact ⟨quotientMap _ _ h_le, fun q ↦ quotientMap_mk⟩ |
| 69 | |
| 70 | omit [StarRing O] in |
| 71 | /-- If `w` inverts `1 + m X` modulo `Q`, that is `a * Q + w * (1 + m X) = 1`, and `k ≤ 1`, then at |
| 72 | a root `B` of `Q` in an `O`-algebra `A`, any `C` with `C * (1 + m B) ^ k = (-1) ^ k * B` is the |
| 73 | value of `X * (-w) ^ k` at `B`. -/ |
| 74 | private lemma aeval_X_mul_neg_pow_eq_of_mul_one_add_smul_pow_eq {A : Type*} [Ring A] [Algebra O A] |
| 75 | {m : O} {Q a w : O[X]} (hw₀ : a * Q + w * (1 + m • X) = 1) {k : ℕ} (hk : k ≤ 1) {B C : A} |
| 76 | (hB : Q.aeval B = 0) (hC : C * (1 + m • B) ^ k = (-1) ^ k * B) : |
| 77 | (X * (-w) ^ k).aeval B = C := by |
| 78 | rw [mul_comm w] at hw₀ |
| 79 | have h_inv : (1 + m • B) * aeval B w = 1 := by simpa [hB] using congrArg (aeval B) hw₀ |
| 80 | interval_cases k |
| 81 | · simpa using hC.symm |
| 82 | · calc (X * (-w) ^ 1).aeval B = (-1) ^ 1 * B * aeval B w := by simp |
| 83 | _ = C * ((1 + m • B) ^ 1 * aeval B w) := by rw [← hC, mul_assoc] |
| 84 | _ = C := by rw [pow_one, h_inv, mul_one] |
| 85 | |
| 86 | omit [StarRing O] in |
| 87 | /-- If `θ` acts on `O[X]/Q` by applying `τ` to the coefficients, then its `i`-th iterate applies |
| 88 | `τ ^ i`. -/ |
| 89 | private lemma iterate_mk_eq_mk_map_pow {Q : O[X]} {θ : AdjoinRoot Q →+* AdjoinRoot Q} |
| 90 | (hθ : ∀ q : O[X], θ (mk Q q) = mk Q (q.map τ)) (i : ℕ) (q : O[X]) : |
| 91 | θ^[i] (mk Q q) = mk Q (q.map (τ ^ i)) := by |
| 92 | induction i generalizing q with |
| 93 | | zero => simp [RingHom.one_def] |
| 94 | | succ i ih => simp [hθ, ih, Polynomial.map_map, pow_succ, RingHom.mul_def] |
| 95 | |
| 96 | universe w in |
| 97 | /-- The polynomials `y`, `z`, `z'` over `O` solve the norm equations of |
| 98 | `New.exists_isTwistedRoot_of_charpoly_eq` at an element `B` of an `O`-algebra `A` with `star`. Write |
| 99 | `T` for the value of `1 + m X ^ (1 - k) y` at `B`. -/ |
| 100 | structure IsTwistedRoot (τ : O →+* O) (p : ℕ) (m : O) (k : ℕ) {A : Type w} [Ring A] [StarRing A] |
| 101 | [Algebra O A] (B : A) (y z z' : O[X]) : Prop where |
| 102 | /-- `y` and `τ y` have the same value at `B`. -/ |
| 103 | aeval_map_eq : (y.map τ).aeval B = y.aeval B |
| 104 | /-- If `τ` is tame at level `m`, then `1 + m z'` is a left inverse of `1 + m z` at `B`. -/ |
| 105 | aeval_mul_eq_one : IsTameAtLevel τ p m → aeval B ((1 + m • z') * (1 + m • z)) = 1 |
| 106 | /-- If `τ` is tame at level `m`, then `T` is the value of the twisted norm of `1 + m z`. -/ |
| 107 | aeval_twistedNorm_eq : IsTameAtLevel τ p m → |
| 108 | aeval B (twistedNorm (Polynomial.map τ) p (1 + m • z)) = aeval B (1 + m • (X ^ (1 - k) * y)) |
| 109 | /-- If `B⋆ (1 + m B) ^ k = (-1) ^ k B`, then `T ^ (1 - k) (1 + m B) T⋆ = T ^ k`. -/ |
| 110 | pow_mul_star_eq_pow : star B * (1 + m • B) ^ k = (-1) ^ k * B → |
| 111 | aeval B (1 + m • (X ^ (1 - k) * y)) ^ (1 - k) * (1 + m • B) * |
| 112 | star (aeval B (1 + m • (X ^ (1 - k) * y))) = aeval B (1 + m • (X ^ (1 - k) * y)) ^ k |
| 113 | |
| 114 | universe w in |
| 115 | /-- Roots in `O[X]/Q`. Let `O` be profinite, let `τ` be tame at level `0` (`τ ^ p = 1`, `0 < p`, |
| 116 | and some element has trace `1`), commute with `star` and fix `c`, with `c - star c` a unit. Let `m` |
| 117 | be fixed by `τ` and `star`, let `1 + m Y` be invertible, with `Y` hermitian (`k = 0`) or with |
| 118 | `Yᴴ (1 + m Y) = -Y` (`k = 1`), and let `Q = charpoly Y` be fixed by `τ`. Then some polynomials |
| 119 | `y`, `z`, `z'` satisfy `New.IsTwistedRoot τ p m k B y z z'` at every root `B` of `Q` in an |
| 120 | `O`-algebra `A` with a compatible `star`. -/ |
| 121 | lemma exists_isTwistedRoot_of_charpoly_eq (hO : IsProfiniteRing O) {m c : O} |
| 122 | (h_tame_zero : IsTameAtLevel τ p 0) (hc : τ c = c) (hc_unit : IsUnit (c - star c)) |
| 123 | (hτ : ∀ x : O, τ (star x) = star (τ x)) {Y : Matrix n n O} (hm_star : star m = m) |
| 124 | (hm : τ m = m) {Q : O[X]} (hQ : Y.charpoly = Q) (hQτ : Q.map τ = Q) {k : ℕ} (hk : k ≤ 1) |
| 125 | (hY_rel : Yᴴ * (1 + m • Y) ^ k = (-1) ^ k * Y) (hY_unit : IsUnit (1 + m • Y)) : |
| 126 | ∃ y z z' : O[X], ∀ ⦃A : Type w⦄ [Ring A] [StarRing A] [Algebra O A] [StarModule O A] ⦃B : A⦄, |
| 127 | Q.aeval B = 0 → IsTwistedRoot τ p m k B y z z' := by |
| 128 | -- Work in `O[X]/Q` with two commuting maps: `θ`, acting by `τ` on coefficients, and an |
| 129 | -- involution `ρ` that becomes `star` at each root `B` obeying the relation of `Y`. Solve for `T` |
| 130 | -- in the `θ`-fixed ring by tame descent along `ρ`, write it as a norm by tame descent along `θ`, |
| 131 | -- and evaluate at `B`. |
| 132 | have h_coprime : IsCoprime Q (1 + m • X) := by |
| 133 | rw [← hQ, ← isUnit_aeval_iff_isCoprime] |
| 134 | simpa using hY_unit |
| 135 | obtain ⟨a, w, hw₀⟩ : ∃ a w : O[X], a * Q + w * (1 + m • X) = 1 := h_coprime |
| 136 | have hQ_monic : Q.Monic := hQ ▸ Y.charpoly_monic |
| 137 | obtain ⟨θ, hθ⟩ : |
| 138 | ∃ θ : AdjoinRoot Q →+* AdjoinRoot Q, ∀ q : O[X], θ (mk Q q) = mk Q (q.map τ) := by |
| 139 | simpa using exists_adjoinRoot_map_comp (Q := Q) τ X (by rw [comp_X, hQτ]) |
| 140 | have hQ_dvd : Q ∣ (Q.map (starRingEnd O)).comp (X * (-w) ^ k) := by |
| 141 | subst hQ |
| 142 | have h_val : (X * (-w) ^ k).aeval Y = Yᴴ := |
| 143 | aeval_X_mul_neg_pow_eq_of_mul_one_add_smul_pow_eq hw₀ hk Y.aeval_self_charpoly hY_rel |
| 144 | have h_char : Yᴴ.charpoly = Y.charpoly.map (starRingEnd O) := by |
| 145 | change (Yᵀ.map (starRingEnd O)).charpoly = _ |
| 146 | rw [charpoly_map, charpoly_transpose] |
| 147 | have h_dvd := charpoly_dvd_charpoly_aeval_comp (Y := Y) (X * (-w) ^ k) |
| 148 | rwa [h_val, h_char] at h_dvd |
| 149 | obtain ⟨ρ, hρ⟩ := exists_adjoinRoot_map_comp (starRingEnd O) (X * (-w) ^ k) hQ_dvd |
| 150 | have hw : mk Q w * (1 + AdjoinRoot.of Q m * root Q) = 1 := by |
| 151 | simpa [smul_eq_C_mul] using congrArg (mk Q) hw₀ |
| 152 | have hθ_of (a : O) : θ (AdjoinRoot.of Q a) = AdjoinRoot.of Q (τ a) := by simp [hθ, ← mk_C] |
| 153 | have hθ_root : θ (root Q) = root Q := by simp [hθ, ← mk_X] |
| 154 | have hρ_of (a : O) : ρ (AdjoinRoot.of Q a) = AdjoinRoot.of Q (star a) := by |
| 155 | rw [← mk_C, hρ, Polynomial.map_C, C_comp, starRingEnd_apply, mk_C] |
| 156 | have hρ_root : ρ (root Q) = root Q * (-mk Q w) ^ k := by |
| 157 | rw [← mk_X, hρ, Polynomial.map_X, X_comp, map_mul, map_pow, map_neg, mk_X] |
| 158 | have h_comm : Commute θ ρ := by |
| 159 | have hθw : θ (mk Q w) = mk Q w := by |
| 160 | refine left_inv_eq_right_inv ?_ ((mul_comm _ _).trans hw) |
| 161 | have h_fix : θ (1 + AdjoinRoot.of Q m * root Q) = 1 + AdjoinRoot.of Q m * root Q := by |
| 162 | simp [hθ_of, hθ_root, hm] |
| 163 | rw [← h_fix, ← map_mul, hw, map_one] |
| 164 | refine (commute_iff_eq θ ρ).mpr ?_ |
| 165 | ext a |
| 166 | · simp [hθ_of, hρ_of, hτ] |
| 167 | · simp [hθ_root, hρ_root, hθw] |
| 168 | have hρ_sq : ρ ^ 2 = 1 := by |
| 169 | have hρ_root_sq : ρ (ρ (root Q)) = root Q := by |
| 170 | interval_cases k |
| 171 | · simp [hρ_root] |
| 172 | · have hρw : ρ (mk Q w) * mk Q w = 1 := by |
| 173 | have h_img : ρ (mk Q w) * (1 + AdjoinRoot.of Q m * (root Q * (-mk Q w) ^ 1)) = 1 := by |
| 174 | rw [← hρ_root, ← hm_star, ← hρ_of, ← map_mul, ← map_one ρ, ← map_add, ← map_mul, hw] |
| 175 | have h_w : 1 + AdjoinRoot.of Q m * (root Q * (-mk Q w) ^ 1) = mk Q w := by |
| 176 | linear_combination (-1 : AdjoinRoot Q) * hw |
| 177 | rwa [h_w] at h_img |
| 178 | rw [hρ_root, map_mul, map_pow, map_neg, hρ_root] |
| 179 | linear_combination root Q * hρw |
| 180 | ext a |
| 181 | · simp [sq, hρ_of] |
| 182 | · simpa [sq] using hρ_root_sq |
| 183 | have h_prof : IsProfiniteRing (AdjoinRoot Q) := |
| 184 | hO.of_addEquiv_pi (powerBasisAux' hQ_monic).equivFun.toAddEquiv |
| 185 | have hθ_tame {x : O} (ht : IsTameAtLevel τ p x) : IsTameAtLevel θ p (AdjoinRoot.of Q x) := |
| 186 | ht.of_semiconj (AdjoinRoot.of Q) (fun a ↦ (hθ_of a).symm) <| RingHom.ext fun z ↦ by |
| 187 | obtain ⟨q, rfl⟩ := mk_surjective z |
| 188 | simp [iterate_mk_eq_mk_map_pow hθ, ht.pow_eq_one, RingHom.one_def] |
| 189 | -- Solve for a `θ`-fixed unit `g ≡ 1 mod m X ^ (1 - k)` by descent along `ρ` in `θ.eqLocus 1`. |
| 190 | let F : Subring (AdjoinRoot Q) := θ.eqLocus 1 |
| 191 | have hρ_mem (x : AdjoinRoot Q) (hx : x ∈ F) : ρ x ∈ F := |
| 192 | (RingHom.congr_fun h_comm.eq x).trans (congrArg ρ hx) |
| 193 | let r : F →+* F := ρ.restrict F F hρ_mem |
| 194 | have hr_val (x : F) : (r x : AdjoinRoot Q) = ρ x := rfl |
| 195 | let N (j : ℕ) : F := |
| 196 | ⟨AdjoinRoot.of Q m, by simp [F, hθ_of, hm]⟩ * ⟨root Q, hθ_root⟩ ^ (1 - j) |
| 197 | have hF_prof : IsProfiniteRing F := h_prof.eqLocus (by simpa using hθ_tame h_tame_zero) |
| 198 | have hr_tame : IsTameAtLevel r 2 (N k) := by |
| 199 | let γ : F := ⟨AdjoinRoot.of Q c, by simp [F, hθ_of, hc]⟩ |
| 200 | have hr_sq : r ^ 2 = 1 := RingHom.ext fun x ↦ Subtype.ext (RingHom.congr_fun hρ_sq x) |
| 201 | have hγ_unit : IsUnit (γ - r γ) := |
| 202 | .of_map F.subtype _ (by simp [γ, hr_val, hρ_of, hc_unit, IsUnit.map, ← map_sub]) |
| 203 | have hr_N : r (N k) = N k := by |
| 204 | interval_cases k |
| 205 | · simp [N, hr_val, hρ_of, hρ_root, hm_star, Subtype.ext_iff] |
| 206 | · simp [N, hr_val, hρ_of, hm_star, Subtype.ext_iff] |
| 207 | exact .of_sq_eq_one_of_isUnit_sub hr_sq hγ_unit hr_N |
| 208 | have hu : IsUnit (1 + N 0) := |
| 209 | .of_map F.subtype _ (.of_mul_eq_one_right _ (by simpa [N] using hw)) |
| 210 | obtain ⟨g, ⟨y₀, hg_lev⟩, hg_rel⟩ : |
| 211 | ∃ g : Fˣ, N k ∣ g - 1 ∧ g ^ (1 - k) * (1 + N 0) * r g = g ^ k := by |
| 212 | interval_cases k |
| 213 | · have hr_fix : r (1 + N 0) = 1 + N 0 := by |
| 214 | simp [N, hr_val, hρ_of, hρ_root, hm_star, Subtype.ext_iff] |
| 215 | obtain ⟨z, -, hz_lev, hz⟩ := hr_tame.exists_prod_range_pow_apply_eq (.inr hF_prof) hu hr_fix |
| 216 | (by simp) |
| 217 | have h_split : ((z⁻¹ : Fˣ) : F) * (1 + N 0) * r ((z⁻¹ : Fˣ) : F) = 1 := by |
| 218 | simp [← hz, prod_range_succ, ← map_mul] |
| 219 | exact ⟨z⁻¹, hz_lev, by simpa using h_split⟩ |
| 220 | · have h_norm_one : (1 + N 0) * r (1 + N 0) = 1 := by |
| 221 | suffices h_val : (1 + AdjoinRoot.of Q m * root Q) * |
| 222 | (1 + -(AdjoinRoot.of Q m * (root Q * mk Q w))) = 1 by |
| 223 | simpa [N, hr_val, hρ_of, hρ_root, hm_star, Subtype.ext_iff] using h_val |
| 224 | linear_combination -(AdjoinRoot.of Q m * root Q) * hw |
| 225 | have h_lev : N 1 ∣ (1 + N 0) - 1 := ⟨⟨root Q, hθ_root⟩, by simp [N]⟩ |
| 226 | have h_prod : ∏ i ∈ range 2, (r ^ i) (1 + N 0) = 1 := by |
| 227 | simpa [prod_range_succ] using h_norm_one |
| 228 | obtain ⟨g, hg_lev, hg⟩ := hr_tame.hilbert90_unit (.inr hF_prof) hu h_lev h_prod |
| 229 | exact ⟨g, hg_lev, by simpa using hg⟩ |
| 230 | obtain ⟨y, hy⟩ : ∃ y : O[X], mk Q y = y₀ := mk_surjective (y₀ : AdjoinRoot Q) |
| 231 | have hy_fix : mk Q (y.map τ) = mk Q y := by |
| 232 | rw [← hθ, hy] |
| 233 | exact y₀.prop |
| 234 | have hg_mk : ((g : F) : AdjoinRoot Q) = mk Q (1 + m • (X ^ (1 - k) * y)) := by |
| 235 | simpa [N, smul_eq_C_mul, mul_assoc, sub_eq_iff_eq_add', Subtype.ext_iff, hy] using hg_lev |
| 236 | -- At tame level `m` the `θ`-fixed unit `g ≡ 1 mod m` is a norm along `θ`. |
| 237 | have hg_lev' : AdjoinRoot.of Q m ∣ ((g : F) : AdjoinRoot Q) - 1 := by simp [hg_mk, ← C_mul'] |
| 238 | have h_norm (ht : IsTameAtLevel τ p m) : ∃ (u : (AdjoinRoot Q)ˣ) (z' z : O[X]), |
| 239 | (u : AdjoinRoot Q) = 1 + mk Q (m • z) ∧ (↑u⁻¹ : AdjoinRoot Q) = 1 + mk Q (m • z') ∧ |
| 240 | ∏ i ∈ range p, (θ ^ i) u = ((g : F) : AdjoinRoot Q) := by |
| 241 | obtain ⟨u, ⟨a₁, ha₁⟩, ⟨b₁, hb₁⟩, hu⟩ := |
| 242 | (hθ_tame ht).exists_prod_range_pow_apply_eq (.inr h_prof) (g.isUnit.map F.subtype) |
| 243 | (g : F).prop hg_lev' |
| 244 | obtain ⟨z, rfl⟩ := mk_surjective a₁ |
| 245 | obtain ⟨z', rfl⟩ := mk_surjective b₁ |
| 246 | refine ⟨u, z', z, ?_, ?_, hu⟩ |
| 247 | · simpa [sub_eq_iff_eq_add', ← C_mul'] using ha₁ |
| 248 | · simpa [sub_eq_iff_eq_add', ← C_mul'] using hb₁ |
| 249 | choose! u z' z hz hz' hu_norm using h_norm |
| 250 | refine ⟨y, z, z', fun A _ _ _ _ B hB ↦ ?_⟩ |
| 251 | -- Evaluate at the root `B` of `Q`, through the map `f` from `O[X]/Q` to `A`. |
| 252 | let f : AdjoinRoot Q →ₐ[O] A := |
| 253 | Quotient.liftₐ _ (aeval B) (by simp [mem_span_singleton', hB]) |
| 254 | have hf (q : O[X]) : f (mk Q q) = q.aeval B := rfl |
| 255 | refine ⟨?_, fun ht ↦ ?_, fun ht ↦ ?_, fun h_rel ↦ ?_⟩ |
| 256 | · rw [← hf, ← hf, hy_fix] |
| 257 | · simp [← hf, ← hz ht, ← hz' ht] |
| 258 | · simp [← hf, ← (hu_norm ht).trans hg_mk, twistedNorm_map_eq_prod, hz ht, |
| 259 | iterate_mk_eq_mk_map_pow hθ] |
| 260 | · have h_star_root : (X * (-w) ^ k).aeval B = star B := |
| 261 | aeval_X_mul_neg_pow_eq_of_mul_one_add_smul_pow_eq hw₀ hk hB h_rel |
| 262 | have hf_ρ (q : O[X]) : f (ρ (mk Q q)) = star (q.aeval B) := by |
| 263 | rw [hρ, hf, aeval_comp, h_star_root, star_aeval] |
| 264 | have hf_g : f ((g : F) : AdjoinRoot Q) = aeval B (1 + m • (X ^ (1 - k) * y)) := by |
| 265 | rw [hg_mk, hf] |
| 266 | have hf_ρ_g : f (ρ ((g : F) : AdjoinRoot Q)) = star (aeval B (1 + m • (X ^ (1 - k) * y))) := by |
| 267 | rw [hg_mk, hf_ρ] |
| 268 | have hg_rel' : ((g : F) : AdjoinRoot Q) ^ (1 - k) * (1 + AdjoinRoot.of Q m * root Q) * |
| 269 | ρ ((g : F) : AdjoinRoot Q) = ((g : F) : AdjoinRoot Q) ^ k := by |
| 270 | simpa [N, hr_val, Subtype.ext_iff] using hg_rel |
| 271 | have h_rel_f := congrArg f hg_rel' |
| 272 | have hf_of (a : O) : f (AdjoinRoot.of Q a) = algebraMap O A a := by rw [← mk_C, hf, aeval_C] |
| 273 | have hf_root : f (root Q) = B := by rw [← mk_X, hf, aeval_X] |
| 274 | simpa [hf_g, hf_ρ_g, hf_of, hf_root, ← Algebra.smul_def] using h_rel_f |
| 275 | |
| 276 | /-- Orthonormal frame. Let `O` be profinite, let `τ` be tame at level `0` (`τ ^ p = 1`, `0 < p`, |
| 277 | and some element has trace `1`), commute with `star` and fix `c`, with `c - star c` a unit. Then an |
| 278 | invertible hermitian matrix `h` fixed by `τ` has an orthonormal frame fixed by `τ`: a matrix `g` |
| 279 | with `gᴴ h g = 1` and `g.map τ = g`, of the form `g = 1 + W (h - 1)`. -/ |
| 280 | lemma exists_fixed_orthonormal_frame (hO : IsProfiniteRing O) {c : O} |
| 281 | (h_tame_zero : IsTameAtLevel τ p 0) (hc : τ c = c) (hc_unit : IsUnit (c - star c)) |
| 282 | (hτ : ∀ x : O, τ (star x) = star (τ x)) |
| 283 | {h : Matrix n n O} (hh_unit : IsUnit h) (h_herm : hᴴ = h) (h_fixed : h.map τ = h) : |
| 284 | ∃ g W : Matrix n n O, g = 1 + W * (h - 1) ∧ g.map τ = g ∧ gᴴ * h * g = 1 := by |
| 285 | -- Apply `exists_isTwistedRoot_of_charpoly_eq` with `m = 1`, `k = 0`, `Y = h - 1` at the root |
| 286 | -- `B = h - 1`: it gives `T = 1 + (h - 1) * y(h - 1)` with `T * h * Tᴴ = 1`, and `g = Tᴴ`. |
| 287 | have h_charpoly : (h - 1).charpoly.map τ = (h - 1).charpoly := by |
| 288 | simp [← charpoly_map, h_fixed, Matrix.map_sub] |
| 289 | have h_rel : (h - 1)ᴴ * (1 + (1 : O) • (h - 1)) ^ 0 = (-1) ^ 0 * (h - 1) := by simpa |
| 290 | obtain ⟨y, _z, _z', hy⟩ := exists_isTwistedRoot_of_charpoly_eq hO h_tame_zero hc hc_unit hτ |
| 291 | (star_one _) τ.map_one |
| 292 | (Y := h - 1) rfl h_charpoly (k := 0) bot_le h_rel (by simpa) |
| 293 | -- `y` is fixed by `τ` at `h - 1`, and `T * h * Tᴴ = 1` |
| 294 | obtain ⟨hy_fix, -, -, h_polar⟩ := hy (h - 1).aeval_self_charpoly |
| 295 | refine ⟨1 + (y.aeval (h - 1))ᴴ * (h - 1), (y.aeval (h - 1))ᴴ, rfl, ?_, ?_⟩ |
| 296 | · simp [conjTranspose_map _ hτ, map_aeval_matrix, h_fixed, hy_fix, Matrix.map_add, Matrix.map_sub] |
| 297 | · -- `g` is `Tᴴ`, as `h - 1` is hermitian |
| 298 | simpa [h_herm, star] using h_polar |
| 299 | |
| 300 | /-- Hilbert 90 for the unitary group `U 1` (matrices with `gᴴ g = 1`) at level `m`. Let `O` be |
| 301 | profinite, let `τ` be tame at level `0` and at level `m`, commute with `star` and fix `c`, with |
| 302 | `c - star c` a unit, and let `star m = m`. Tame at level `m` means: `τ m = m`, `τ ^ p = 1`, `0 < p`, |
| 303 | some `e` has `∑ i < p, τ^i e ≡ 1` mod `m`, and every prime modulo which some `τ^i` with `0 < i < p` |
| 304 | is the identity contains `m`. If the unitary `s` is `1 + m Y` and its twisted norm |
| 305 | `s · τ s ⋯ τ^{p-1} s` is `1` (`mapEnd hτ` applies `τ` to the entries), then `s · τ g = g`, that is |
| 306 | `s = g · (τ g)⁻¹`, for a unitary `g = 1 + m W`. -/ |
| 307 | lemma unitary_hilbert90_at_level (hO : IsProfiniteRing O) {m c : O} |
| 308 | (h_tame_zero : IsTameAtLevel τ p 0) (hc : τ c = c) (hc_unit : IsUnit (c - star c)) |
| 309 | (hτ : ∀ x : O, τ (star x) = star (τ x)) (s : U (1 : Matrix n n O)) {Y : Matrix n n O} |
| 310 | (hm_star : star m = m) (h_tame : IsTameAtLevel τ p m) (hs : (s : Matrix n n O) = 1 + m • Y) |
| 311 | (hs_norm : ((twistedNorm (mapEnd hτ) p s : U (1 : Matrix n n O)) : Matrix n n O) = 1) : |
| 312 | ∃ (g : U (1 : Matrix n n O)) (W : Matrix n n O), |
| 313 | s * mapEnd hτ g = g ∧ (g : Matrix n n O) = 1 + m • W := by |
| 314 | -- Split `s` in `GL n O` by some `k ≡ 1 mod m`, then correct `k` to a unitary `k * g` by a |
| 315 | -- `τ`-fixed orthonormal frame `g` of the hermitian matrix `kᴴ * k`. |
| 316 | have h_norm : twistedNorm (GeneralLinearGroup.map τ) p (s : GL n O) = 1 := |
| 317 | (map_twistedNorm (U 1).subtype (fun g ↦ rfl) p s).symm.trans (Units.ext hs_norm) |
| 318 | obtain ⟨k, W, hk_cob, hk⟩ := h_tame.hilbert90_gl (.inr hO) (s : GL n O) hs h_norm |
| 319 | -- `kᴴ * k` is fixed by `τ` because `sᴴ * s = 1`. |
| 320 | have h_prod : ((s : Matrix n n O) * k.val.map τ)ᴴ * ((s : Matrix n n O) * k.val.map τ) = |
| 321 | k.valᴴ * k.val := by rw [hk_cob] |
| 322 | have h_fix : (k.valᴴ * k.val).map τ = k.valᴴ * k.val := by |
| 323 | simpa [conjTranspose_map _ hτ, ← inv_val_eq_conjTranspose, mul_assoc] using h_prod |
| 324 | have hkk_unit : IsUnit (k.valᴴ * k.val) := (star k * k).isUnit |
| 325 | obtain ⟨g, V, hg, hg_fix, hg_frame⟩ := |
| 326 | exists_fixed_orthonormal_frame hO h_tame_zero hc hc_unit hτ hkk_unit (by simp) h_fix |
| 327 | have h_lev : k.valᴴ * k.val - 1 = m • (W + Wᴴ * k.val) := by |
| 328 | simp [hk, hm_star, mul_add, add_mul, smul_add, smul_smul, add_left_comm, add_assoc, |
| 329 | sub_eq_iff_eq_add'] |
| 330 | refine ⟨of isUnit_one (k.val * g) (by simpa [conjTranspose_mul, Matrix.mul_assoc] using hg_frame), |
| 331 | W + k.val * V * (W + Wᴴ * k.val), ?_, ?_⟩ |
| 332 | · -- on matrices, `s * τ (k g) = (s * τ k) * τ g = k * g` |
| 333 | simp [Units.ext_iff, U.map, ← mul_assoc, hk_cob, hg_fix, Subtype.ext_iff] |
| 334 | · calc k.val * g = k.val + m • (k.val * V * (W + Wᴴ * k.val)) := by |
| 335 | simp [hg, h_lev, mul_add, mul_assoc] |
| 336 | _ = 1 + m • (W + k.val * V * (W + Wᴴ * k.val)) := by rw [smul_add, ← add_assoc, ← hk] |
| 337 | |
| 338 | end New |
| 339 | |
| 340 | end UnitaryHilbert90 |
| 341 | |
| 342 | /-! |
| 343 | ## Hilbert 90 for finite ideles |
| 344 | |
| 345 | `New.hilbert90_finite_idele` is Hilbert's Theorem 90 for the finite adeles of `L` and an |
| 346 | automorphism `σ` of `L/K`, acting through `New.adeleMap`. It follows from Galois descent for the |
| 347 | semilinear map `x ↦ u * σ x`, together with the fact that two of its fixed points have a common |
| 348 | divisor that is again fixed. |
| 349 | -/ |
| 350 | |
| 351 | section IdeleHilbert90 |
| 352 | |
| 353 | open AlgEquiv Valued |
| 354 | |
| 355 | namespace New |
| 356 | |
| 357 | variable {K L : Type*} [Field K] [Field L] [NumberField L] [Algebra K L] {σ : Gal(L/K)} {u : 𝔸f L} |
| 358 | |
| 359 | /-- The `i`-th iterate of the action of `σ` on finite adeles is the action of `σ ^ i`. -/ |
| 360 | lemma adeleMap_gal_pow (i : ℕ) : |
| 361 | adeleMap (σ : L →+* L) ^ i = adeleMap (↑(σ ^ i) : L →+* L) := |
| 362 | (map_pow galAdeleHom σ i).symm |
| 363 | |
| 364 | /-- Let `a` and `b` be finite adeles of `L` that solve `u * σ x = x`, where `σ` acts through |
| 365 | `New.adeleMap`. Then some solution `c` divides both: at each place take whichever of `a`, `b` has |
| 366 | the larger valuation. -/ |
| 367 | lemma exists_dvd_dvd_mul_adeleMap_eq {a b : 𝔸f L} (ha : u * adeleMap (σ : L →+* L) a = a) |
| 368 | (hb : u * adeleMap (σ : L →+* L) b = b) : |
| 369 | ∃ c : 𝔸f L, c ∣ a ∧ c ∣ b ∧ u * adeleMap (σ : L →+* L) c = c := by |
| 370 | let c : 𝔸f L := b + idem {w | v (b w) ≤ v (a w)} * (a - b) |
| 371 | have c_apply (w : FinPlace L) : c w = if v (b w) ≤ v (a w) then a w else b w := by |
| 372 | by_cases h : v (b w) ≤ v (a w) <;> simp [c, h] |
| 373 | have dvd_of_le {x : 𝔸f L} (hx : ∀ w : FinPlace L, v (x w) ≤ v (c w)) : c ∣ x := by |
| 374 | obtain ⟨y, -, hy⟩ := exists_eq_mul_iff_v_le.mpr hx |
| 375 | exact ⟨y, hy⟩ |
| 376 | have ha_le (w : FinPlace L) : v (a w) ≤ v (c w) := by grind |
| 377 | have hb_le (w : FinPlace L) : v (b w) ≤ v (c w) := by simp [c_apply, apply_ite] |
| 378 | refine ⟨c, dvd_of_le ha_le, dvd_of_le hb_le, DFunLike.ext _ _ fun w ↦ ?_⟩ |
| 379 | have haw : u w * adeleMap (σ : L →+* L) a w = a w := by rw [← FiniteAdeleRing.mul_apply, ha] |
| 380 | have hbw : u w * adeleMap (σ : L →+* L) b w = b w := by rw [← FiniteAdeleRing.mul_apply, hb] |
| 381 | change u w * adeleMap (σ : L →+* L) c w = c w |
| 382 | by_cases hw : u w = 0 |
| 383 | · -- both `a` and `b`, hence `c`, vanish at a zero of `u` |
| 384 | have ha_zero : a w = 0 := by rw [← haw, hw, zero_mul] |
| 385 | simp [c_apply, hw, ha_zero, show b w = 0 by rw [← hbw, hw, zero_mul]] |
| 386 | · rw [adeleMap_apply (σ : L →+* L) rfl] at haw hbw ⊢ |
| 387 | -- Since `σ` preserves valuations, the choice at `w` agrees with that at the pullback of `w`. |
| 388 | have h_choice : v (b w) ≤ v (a w) ↔ |
| 389 | v (b (FinPlace.comap (σ : L →+* L) w)) ≤ v (a (FinPlace.comap (σ : L →+* L) w)) := by |
| 390 | rw [← haw, ← hbw] |
| 391 | simp [pos_iff_ne_zero, hw, v_locMap_eq_of_surjective (σ : L →+* L) rfl σ.surjective] |
| 392 | rw [c_apply, c_apply, if_congr h_choice rfl rfl] |
| 393 | split_ifs |
| 394 | exacts [haw, hbw] |
| 395 | |
| 396 | /-- Hilbert's Theorem 90 for finite ideles. Let `σ ∈ Gal(L/K)` have order `n`, and let the finite |
| 397 | adele `u` of `L` have norm `∏_{i < n} σ ^ i u = 1`. Then `u * σ c = c` for some invertible finite |
| 398 | adele `c`. -/ |
| 399 | lemma hilbert90_finite_idele [NumberField K] |
| 400 | (hu : ∏ i ∈ Finset.range (orderOf σ), adeleMap (↑(σ ^ i) : L →+* L) u = 1) : |
| 401 | ∃ c : 𝔸f L, IsUnit c ∧ u * adeleMap (σ : L →+* L) c = c := by |
| 402 | -- By Galois descent `1` lies in the `L`-span of the solutions of `u * σ c = c`. Any two solutions |
| 403 | -- have a common divisor that is a solution, so a single solution divides `1`. |
| 404 | let τ : 𝔸f L →ₛₗ[(σ : L →+* L)] 𝔸f L := |
| 405 | { toFun x := u * adeleMap σ x |
| 406 | map_add' x y := by rw [map_add, mul_add] |
| 407 | map_smul' r x := by simp [Algebra.smul_def, mul_left_comm] } |
| 408 | -- `τ^[n] x = (∏ i < n, σ ^ i u) * σ ^ n x`; for `n = orderOf σ` this is `x`, by `hu`. |
| 409 | have τ_order (x : 𝔸f L) : τ^[orderOf σ] x = x := by |
| 410 | simp [τ, iterate_mul_apply, adeleMap_gal_pow, aut_one, hu] |
| 411 | -- Descent (`σ` is tame at level `1`) at the prime `⊥` of the field `L`. |
| 412 | obtain ⟨r, hr, h_span⟩ := |
| 413 | (isTameAtLevel_gal σ).exists_smul_mem_span_fixedPoints τ τ_order ⊥ one_ne_zero |
| 414 | -- Every element of the span of the solutions is divisible by a solution. |
| 415 | have divisible (x : 𝔸f L) (hx : x ∈ Submodule.span L (Function.fixedPoints τ)) : |
| 416 | ∃ c : 𝔸f L, c ∣ x ∧ u * adeleMap σ c = c := by |
| 417 | induction hx using Submodule.span_induction with |
| 418 | | mem c hc => exact ⟨c, dvd_rfl, hc⟩ |
| 419 | | zero => exact ⟨0, dvd_refl 0, by simp⟩ |
| 420 | | add x y _ _ hx hy => |
| 421 | obtain ⟨a, ha_dvd, ha⟩ := hx |
| 422 | obtain ⟨b, hb_dvd, hb⟩ := hy |
| 423 | obtain ⟨c, hca, hcb, hc⟩ := exists_dvd_dvd_mul_adeleMap_eq ha hb |
| 424 | exact ⟨c, dvd_add (hca.trans ha_dvd) (hcb.trans hb_dvd), hc⟩ |
| 425 | | smul r x _ hx => |
| 426 | obtain ⟨c, hc_dvd, hc⟩ := hx |
| 427 | exact ⟨c, dvd_smul_of_dvd r hc_dvd, hc⟩ |
| 428 | have one_mem : (1 : 𝔸f L) ∈ Submodule.span L (Function.fixedPoints τ) := by |
| 429 | simpa [smul_smul, Ideal.mem_bot.not.mp hr] using h_span (r⁻¹ • 1) |
| 430 | obtain ⟨c, hc_dvd, hc⟩ := divisible 1 one_mem |
| 431 | exact ⟨c, isUnit_of_dvd_one hc_dvd, hc⟩ |
| 432 | |
| 433 | end New |
| 434 | |
| 435 | end IdeleHilbert90 |