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.Order.CompletePartialOrder |
| 4 | import Mathlib.Topology.Algebra.Group.Matrix |
| 5 | import Mathlib.Topology.Connected.Separation |
| 6 | import Mathlib.Topology.MetricSpace.Ultra.TotallySeparated |
| 7 | public import Lib.Adelic.Unitary.Defs |
| 8 | public import Lib.General.LinearAlgebra.IntegralLattices |
| 9 | public import Lib.Adelic.Witt.WittTheorem -- shake: keep (needed public by an exposed definition) |
| 10 | |
| 11 | /-! |
| 12 | # Components of unitary adelic points at places; sums and moves of hermitian spaces |
| 13 | |
| 14 | Elements of the finite adelic unitary group `New.Gf` of a CM field are studied through their |
| 15 | components `g.atPlace w`. The component at `w̄` is determined by the one at `w`, and is `1` exactly |
| 16 | when that one is, so supports have the form `S ∪ S̄`. Elements are cut along the idempotent |
| 17 | `New.idem` of a set of places. A hermitian space with a point `New.Space E n s` is a matrix `J` over |
| 18 | `E` together with `x` in `GL n (𝔸 E)` such that `xᴴ J x` is the diagonal matrix of the signs `s` at |
| 19 | infinity and `1` at the finite places. |
| 20 | |
| 21 | ## Main definitions and results |
| 22 | |
| 23 | * `New.Gf.componentOn`: keeps the components at `S ∪ S̄` and replaces the others by `1`. |
| 24 | * `New.Gf.exists_supportedOn_mul_trivialOn`: splitting into a part supported on `S ∪ S̄` and one |
| 25 | trivial there. |
| 26 | * `New.Gf.mem_of_stdLevel_le_of_supportedOn_le`: `New.stdLevel` and the elements supported at one |
| 27 | pair `w, w̄` generate the group. |
| 28 | * `New.range_ofSplitPlace`, `New.ofSplitPlaces`: elements with prescribed components at split |
| 29 | places. |
| 30 | * `New.U.sum`, `New.G.sum`, `New.Space.sum`: block diagonal sums. |
| 31 | * `New.G.neg`, `New.Space.neg`: passing from signs `s` to `-s` (and from `J` to `-J`). |
| 32 | * `New.signedSpace`: the standard space with matrix `diag(s)`. |
| 33 | |
| 34 | Notions from other files: |
| 35 | * `New.idem`: The finite adele with component 1 at the places of a set and 0 elsewhere. |
| 36 | * `New.ofSplitPlace`: For a split place w, the homomorphism GL_n(E_w) → G_f sending g to the unitary |
| 37 | element with component g at w and 1 off w, w̄. |
| 38 | * `New.G`: The adelic unitary group G = G_∞ × G_f (an element `g` has adelic matrix `g.adeleMatrix`) |
| 39 | for signs s at the infinite places and the identity matrix at the finite places. |
| 40 | * `New.stdForm`: The diagonal adelic matrix that is diag(s) at infinity and 1 at the finite places. |
| 41 | -/ |
| 42 | |
| 43 | @[expose] public section |
| 44 | |
| 45 | noncomputable section |
| 46 | |
| 47 | /-! |
| 48 | ## Components at sets of places and elements at split places |
| 49 | |
| 50 | Conventions: `star` is complex conjugation, on places too; `New.Gf.supportedOn` is the subgroup |
| 51 | trivial outside `S ∪ S̄` and `New.Gf.trivialOn` the one trivial on `S`; `New.localIntGL` is |
| 52 | `GL_n(O_w)`, and `New.stdLevel` is the subgroup of `New.Gf` of integral matrices with integral |
| 53 | inverse. |
| 54 | -/ |
| 55 | |
| 56 | namespace New |
| 57 | |
| 58 | open Gf NumberField Filter Matrix MonoidHom |
| 59 | |
| 60 | section ComponentsAtPlaces |
| 61 | |
| 62 | variable {E : Type*} [Field E] [NumberField E] {n : Type*} [Fintype n] [DecidableEq n] |
| 63 | |
| 64 | /-- For a set `S` of places, cutting `g` along the idempotent of `S` (`cutGL`) keeps the component |
| 65 | `g.map (evalAt w)` at `w` if `w ∈ S` and replaces it by `1` otherwise. -/ |
| 66 | lemma map_evalAt_cutGL (w : FinPlace E) (S : Set (FinPlace E)) [Decidable (w ∈ S)] |
| 67 | (g : GL n (𝔸f E)) : |
| 68 | (cutGL (idem_mul_self S) g).map (evalAt w) = if w ∈ S then g.map (evalAt w) else 1 := by |
| 69 | aesop (add simp [cutGL, Matrix.one_apply]) |
| 70 | |
| 71 | /-- A matrix over the finite adeles lies in `intGL n (Ô E) = GL_n(Ô)` (entries of `g` and `g⁻¹` in |
| 72 | `Ô`), where `Ô` is the ring of integral finite adeles, if and only if its component at each place |
| 73 | `w` lies in `localIntGL n w = GL_n(O_w)`. -/ |
| 74 | lemma mem_intGL_Ô {g : GL n (𝔸f E)} : |
| 75 | g ∈ intGL n (Ô E) ↔ ∀ w : FinPlace E, g.map (evalAt w) ∈ localIntGL n w := by |
| 76 | simp [Ô, ← map_inv, mem_intGL, forall_and, forall_comm (α := FinPlace E)] |
| 77 | |
| 78 | /-- The group `localIntGL n w = GL_n(O_w)` is open in `GL_n(K_w)`. -/ |
| 79 | lemma isOpen_localIntGL (w : FinPlace E) : (localIntGL n w).IsOpen := |
| 80 | isOpen_intGL (Valued.isOpen_integer _) |
| 81 | |
| 82 | /-- The group `localIntGL n w = GL_n(O_w)` is compact. -/ |
| 83 | lemma isCompact_localIntGL (w : FinPlace E) : |
| 84 | IsCompact (localIntGL n w : Set (GL n (LocField w))) := |
| 85 | isCompact_intGL (isCompact_LocInt w) |
| 86 | |
| 87 | variable [IsCMField E] (S : Set (FinPlace E)) {g k : Gf E n} {u : FinPlace E} (w : FinPlace E) |
| 88 | |
| 89 | /-- The set S ∪ S̄ of the finite places in S and their complex conjugates. -/ |
| 90 | abbrev _root_.Set.conjClosure : Set (FinPlace E) := S ∪ star ⁻¹' S |
| 91 | |
| 92 | /-- A place and its conjugate already form a set closed under conjugation. -/ |
| 93 | lemma _root_.Set.conjClosure_pair_star : |
| 94 | ({w, star w} : Set (FinPlace E)).conjClosure = {w, star w} := by |
| 95 | ext u |
| 96 | simp [star_involutive.eq_iff, or_comm] |
| 97 | |
| 98 | /-- If `S` is finite, then `S ∪ S̄` is finite. -/ |
| 99 | lemma _root_.Set.Finite.conjClosure (hS : S.Finite) : S.conjClosure.Finite := hS.union hS.star |
| 100 | |
| 101 | /-- The set S of finite places is disjoint from its complex conjugate: its places are not |
| 102 | self-conjugate, and it holds at most one place of each conjugate pair. -/ |
| 103 | abbrev _root_.Set.IsConjDisjoint : Prop := Disjoint S (star ⁻¹' S) |
| 104 | |
| 105 | /-- If `S` and its conjugates are disjoint from `T`, they are also disjoint from its conjugates. -/ |
| 106 | lemma _root_.Disjoint.conjClosure_right {S T : Set (FinPlace E)} |
| 107 | (h : Disjoint S.conjClosure T) : Disjoint S.conjClosure T.conjClosure := by |
| 108 | rw [Set.disjoint_left] at h ⊢ |
| 109 | grind [star_star] |
| 110 | |
| 111 | /-- The component map `g ↦ g.atPlace w` of the finite adelic unitary group is continuous. -/ |
| 112 | @[fun_prop] |
| 113 | lemma Gf.continuous_atPlace : Continuous (Gf.atPlace (n := n) w) := by |
| 114 | simp only [atPlace, MonoidHom.coe_comp] |
| 115 | fun_prop |
| 116 | |
| 117 | variable {S w} |
| 118 | |
| 119 | /-- Two elements of the finite adelic unitary group with the same component at every finite place |
| 120 | are equal. -/ |
| 121 | @[ext] |
| 122 | lemma Gf.ext (h_eq : ∀ w : FinPlace E, g.atPlace w = k.atPlace w) : g = k := |
| 123 | Subtype.ext (GL_ext_evalAt h_eq) |
| 124 | |
| 125 | /-! ### Integrality and supports in the unitary group -/ |
| 126 | |
| 127 | /-- For a unitary adelic matrix `g` and places with `ū = w`, the component at `w` is the |
| 128 | transpose of the conjugate (`conjLoc`, carrying `E_u` to `E_w`) of the inverse of the component |
| 129 | at `u`. -/ |
| 130 | lemma Gf.atPlace_star (huw : star u = w) : |
| 131 | g.atPlace w = ((g.atPlace u)⁻¹.val.map (conjLoc huw))ᵀ := by |
| 132 | -- `g` is unitary, so `g = star g⁻¹`; take components at `w` |
| 133 | change g.val.val.map (evalAt w) = _ |
| 134 | rw [show g.val.val = (g⁻¹).val.valᴴ from U.inv_val_eq_conjTranspose g⁻¹] |
| 135 | exact evalAt_star_GL huw (g⁻¹).val |
| 136 | |
| 137 | /-- The component of an element of the finite adelic unitary group lies in |
| 138 | `localIntGL n w = GL_n(O_w)` for all but finitely many places `w`. -/ |
| 139 | lemma Gf.eventually_atPlace_mem_localIntGL : |
| 140 | ∀ᶠ w : FinPlace E in cofinite, g.atPlace w ∈ localIntGL n w := by |
| 141 | -- each entry of `g` and of `g⁻¹` is a finite adele, so integral at almost all places |
| 142 | have h_entries (k : Gf E n) (i j : n) : |
| 143 | ∀ᶠ w : FinPlace E in cofinite, (k.atPlace w).val i j ∈ LocInt w := (k.val i j).property |
| 144 | -- keep `∀ᶠ` folded, and the inverse as a unit, so that `mem_intGL` applies |
| 145 | simpa [-eventually_cofinite, -coe_units_inv, mem_intGL, map_inv] |
| 146 | using And.intro (h_entries g) (h_entries g⁻¹) |
| 147 | |
| 148 | /-- An element lies in the integral subgroup `stdLevel` if and only if each of its components lies |
| 149 | in `localIntGL n w = GL_n(O_w)`. -/ |
| 150 | lemma mem_stdLevel_iff : g ∈ stdLevel E n ↔ ∀ w : FinPlace E, g.atPlace w ∈ localIntGL n w := |
| 151 | mem_intGL_Ô |
| 152 | |
| 153 | /-- By unitarity, the component at `w̄` is integral if and only if the component at `w` is. -/ |
| 154 | @[simp] |
| 155 | lemma Gf.atPlace_star_mem_iff : |
| 156 | g.atPlace (star w) ∈ localIntGL n (star w) ↔ g.atPlace w ∈ localIntGL n w := by |
| 157 | simp_all [iff_def, ← map_inv, atPlace_star, mem_LocInt, mem_intGL] |
| 158 | |
| 159 | /-- `g` is supported on `S ∪ S̄` if and only if its component is `1` at every place `w` with |
| 160 | neither `w` nor `w̄` in `S`. -/ |
| 161 | @[simp low] |
| 162 | lemma Gf.mem_supportedOn : |
| 163 | g ∈ supportedOn n S ↔ ∀ w : FinPlace E, w ∉ S → star w ∉ S → g.atPlace w = 1 := by |
| 164 | simp [supportedOn] |
| 165 | |
| 166 | /-- `g` is trivial on `S` if and only if its component is `1` at every place of `S`. -/ |
| 167 | @[simp low] |
| 168 | lemma Gf.mem_trivialOn : g ∈ trivialOn n S ↔ ∀ w ∈ S, g.atPlace w = 1 := by simp [trivialOn] |
| 169 | |
| 170 | /-- By unitarity, the component at `w̄` is `1` if and only if the component at `w` is. -/ |
| 171 | lemma Gf.atPlace_star_eq_one_iff : g.atPlace (star w) = 1 ↔ g.atPlace w = 1 := by |
| 172 | have h_imp (u v : FinPlace E) (huv : star u = v) (hu : g.atPlace u = 1) : g.atPlace v = 1 := |
| 173 | Units.ext (by simp [atPlace_star huv, hu]) |
| 174 | exact ⟨h_imp (star w) w (star_star w), h_imp w (star w) rfl⟩ |
| 175 | |
| 176 | /-- If `S ⊆ T`, then every element supported on `S ∪ S̄` is supported on `T ∪ T̄`. -/ |
| 177 | lemma Gf.supportedOn_mono {T : Set (FinPlace E)} (hST : S ⊆ T) : |
| 178 | supportedOn n S ≤ supportedOn n T := by |
| 179 | grind [mem_supportedOn, IsConcreteLE.le_iff] |
| 180 | |
| 181 | /-- If `g` is supported on `S ∪ S̄` and `k` is trivial on `S`, one of them is `1` at each place. -/ |
| 182 | lemma Gf.atPlace_eq_one_or (hg : g ∈ supportedOn n S) (hk : k ∈ trivialOn n S) : |
| 183 | ∀ u : FinPlace E, g.atPlace u = 1 ∨ k.atPlace u = 1 := by |
| 184 | grind [mem_supportedOn, mem_trivialOn, atPlace_star_eq_one_iff] |
| 185 | |
| 186 | /-- The elements supported outside `S ∪ S̄` are those whose components at the places of `S` |
| 187 | are `1`. -/ |
| 188 | lemma Gf.supportedOn_compl : supportedOn n S.conjClosureᶜ = trivialOn n S := by |
| 189 | ext g |
| 190 | grind [mem_supportedOn, mem_trivialOn, atPlace_star_eq_one_iff, star_star] |
| 191 | |
| 192 | /-- Elements supported on `S` and its conjugates are trivial at `T` when the two conjugation |
| 193 | closures are disjoint. -/ |
| 194 | lemma Gf.supportedOn_le_trivialOn_of_disjoint {T : Set (FinPlace E)} |
| 195 | (h : Disjoint S.conjClosure T.conjClosure) : supportedOn n S ≤ trivialOn n T := by |
| 196 | rw [← supportedOn_compl] |
| 197 | exact supportedOn_mono (Set.disjoint_left.1 (h.mono_left Set.subset_union_left)) |
| 198 | |
| 199 | /-- An element supported on `S ∪ S̄` commutes with one that is trivial on `S`. -/ |
| 200 | lemma Gf.commute_supportedOn_trivialOn (hg : g ∈ supportedOn n S) (hk : k ∈ trivialOn n S) : |
| 201 | Commute g k := |
| 202 | ext fun u ↦ by rcases atPlace_eq_one_or hg hk u with h_one | h_one <;> simp [h_one] |
| 203 | |
| 204 | /-- Two elements supported on `S ∪ S̄` that agree at the places of `S` are equal. -/ |
| 205 | lemma Gf.eq_of_supportedOn (hg : g ∈ supportedOn n S) (hk : k ∈ supportedOn n S) |
| 206 | (h_eq : ∀ w ∈ S, g.atPlace w = k.atPlace w) : g = k := by |
| 207 | ext1 u |
| 208 | by_cases hu : u ∈ S |
| 209 | · exact h_eq u hu |
| 210 | by_cases hu_star : star u ∈ S |
| 211 | · -- the component at `u` is determined by the one at its conjugate |
| 212 | exact Units.ext (by simp only [atPlace_star (star_star u), h_eq (star u) hu_star]) |
| 213 | · rw [mem_supportedOn.1 hg u hu hu_star, mem_supportedOn.1 hk u hu hu_star] |
| 214 | |
| 215 | /-- If a finite adelic unitary matrix is integral outside `S ∪ S̄`, it is integral everywhere |
| 216 | exactly when it is integral on `S`. Unitarity transfers integrality to the conjugate place. -/ |
| 217 | lemma Gf.mem_stdLevel_iff_of_integral_off (h_off : g ∈ localLevel n S.conjClosureᶜ) : |
| 218 | g ∈ stdLevel E n ↔ ∀ w ∈ S, g.atPlace w ∈ localIntGL n w := by |
| 219 | refine ⟨fun h w _ ↦ mem_stdLevel_iff.1 h w, fun h ↦ mem_stdLevel_iff.2 fun w ↦ ?_⟩ |
| 220 | by_cases hw : w ∈ S.conjClosure |
| 221 | · exact Or.elim hw (h w) (fun hw_star ↦ atPlace_star_mem_iff.1 (h (star w) hw_star)) |
| 222 | · exact mem_localLevel.1 h_off w hw |
| 223 | |
| 224 | /-- An element supported on `S ∪ S̄` is integral if and only if its components at the places |
| 225 | of `S` are integral. -/ |
| 226 | lemma Gf.mem_stdLevel_iff_of_supportedOn (hg : g ∈ supportedOn n S) : |
| 227 | g ∈ stdLevel E n ↔ ∀ w ∈ S, g.atPlace w ∈ localIntGL n w := by |
| 228 | apply mem_stdLevel_iff_of_integral_off |
| 229 | grind [mem_localLevel, mem_supportedOn, one_mem] |
| 230 | |
| 231 | /-! ### The part supported on `S ∪ S̄`, and generation by local elements -/ |
| 232 | |
| 233 | open scoped Pointwise in |
| 234 | @[simp] |
| 235 | lemma star_idem_conjClosure : star (idem S.conjClosure) = idem S.conjClosure := by |
| 236 | simp [star_idem, S.union_comm] |
| 237 | |
| 238 | variable (n S) in |
| 239 | /-- The endomorphism of the finite adelic unitary group that keeps the components at the places |
| 240 | of S ∪ S̄ and replaces the others by 1. -/ |
| 241 | def Gf.componentOn : Gf E n →* Gf E n := U.cutAt (idem_mul_self S.conjClosure) star_idem_conjClosure |
| 242 | |
| 243 | open scoped Classical in |
| 244 | @[simp] |
| 245 | lemma Gf.atPlace_componentOn : |
| 246 | (componentOn n S g).atPlace w = if w ∈ S.conjClosure then g.atPlace w else 1 := |
| 247 | map_evalAt_cutGL w S.conjClosure g.val |
| 248 | |
| 249 | lemma Gf.componentOn_mem_supportedOn : componentOn n S g ∈ supportedOn n S := by simp_all |
| 250 | |
| 251 | /-- Projecting onto a set of places fixes every element supported there and at their conjugates. -/ |
| 252 | lemma Gf.componentOn_eq_self (hg : g ∈ supportedOn n S) : componentOn n S g = g := |
| 253 | eq_of_supportedOn componentOn_mem_supportedOn hg (by simp +contextual) |
| 254 | |
| 255 | lemma Gf.componentOn_mem_stdLevel (hg : g ∈ stdLevel E n) : componentOn n S g ∈ stdLevel E n := by |
| 256 | grind [atPlace_componentOn, mem_stdLevel_iff, one_mem] |
| 257 | |
| 258 | /-- Every `g` in the finite adelic unitary group is a product `a * b` with `a` supported on `S ∪ S̄` |
| 259 | and `b` trivial at the places of `S`, such that `a` and `b` lie in the integral subgroup `stdLevel` |
| 260 | whenever `g` does. -/ |
| 261 | lemma Gf.exists_supportedOn_mul_trivialOn (S : Set (FinPlace E)) (g : Gf E n) : |
| 262 | ∃ a ∈ supportedOn n S, ∃ b ∈ trivialOn n S, |
| 263 | g = a * b ∧ (g ∈ stdLevel E n → a ∈ stdLevel E n ∧ b ∈ stdLevel E n) := by |
| 264 | -- at a place of `S` the component of the second factor is `g⁻¹ * g = 1` |
| 265 | refine ⟨componentOn n S g, componentOn_mem_supportedOn, componentOn n S g⁻¹ * g, by simp_all, |
| 266 | by simp [map_inv], fun hg ↦ ⟨componentOn_mem_stdLevel hg, ?_⟩⟩ |
| 267 | exact mul_mem (componentOn_mem_stdLevel (inv_mem hg)) hg |
| 268 | |
| 269 | /-- A subgroup `H` of the finite adelic unitary group that contains the integral subgroup `stdLevel` |
| 270 | and, for every finite place `w`, all elements supported on `{w, w̄}` contains every element of the |
| 271 | group. -/ |
| 272 | lemma Gf.mem_of_stdLevel_le_of_supportedOn_le {H : Subgroup (Gf E n)} (h_std : stdLevel E n ≤ H) |
| 273 | (h_local : ∀ w : FinPlace E, supportedOn n ({w} : Set (FinPlace E)) ≤ H) (g : Gf E n) : |
| 274 | g ∈ H := by |
| 275 | -- `g` is integral outside a finite set `S` of places; induct on `S`. |
| 276 | obtain ⟨S, hS, hg : ∀ w ∉ S, g.atPlace w ∈ localIntGL n w⟩ := |
| 277 | hasBasis_cofinite.eventually_iff.1 g.eventually_atPlace_mem_localIntGL |
| 278 | induction S, hS using Set.Finite.induction_on generalizing g with |
| 279 | | empty => exact h_std (mem_stdLevel_iff.2 fun w ↦ hg w (Set.notMem_empty w)) |
| 280 | | @insert v S _ _ ih => |
| 281 | -- Split off the components at `v` and its conjugate: `g = a * b`. |
| 282 | obtain ⟨a, ha, b, hb, rfl, -⟩ := g.exists_supportedOn_mul_trivialOn {v} |
| 283 | refine mul_mem (h_local v ha) (ih b fun w hwS ↦ ?_) |
| 284 | -- Where `b` is not trivial, `w ≠ v` and `a` is trivial, so `b` agrees with `a * b`. |
| 285 | by_cases hb1 : b.atPlace w = 1 |
| 286 | · simp [hb1] |
| 287 | · have ha1 : a.atPlace w = 1 := (atPlace_eq_one_or ha hb w).resolve_right hb1 |
| 288 | have hwv : w ≠ v := fun h ↦ hb1 (mem_trivialOn.1 hb w h) |
| 289 | simpa [ha1] using hg w (by simp [hwv, hwS]) |
| 290 | |
| 291 | end ComponentsAtPlaces |
| 292 | |
| 293 | section SplitPlaces |
| 294 | |
| 295 | variable {E : Type*} [Field E] [NumberField E] {n : Type*} [Fintype n] [DecidableEq n] |
| 296 | [IsCMField E] {w : FinPlace E} (hw : star w ≠ w) (g : GL n (LocField w)) |
| 297 | |
| 298 | /-! ### Split places -/ |
| 299 | |
| 300 | /-- For a place `w ≠ w̄`, the component of `ofSplitPlace hw g` (the unitary element with component |
| 301 | `g` at `w`) at a place other than `w` and `w̄` is `1`. -/ |
| 302 | @[local simp] |
| 303 | lemma atPlace_ofSplitPlace_of_ne {u : FinPlace E} (hu : u ≠ w) (hu_star : star u ≠ w) : |
| 304 | (ofSplitPlace hw g).atPlace u = 1 := by |
| 305 | simp_all [ofSplitPlace, atPlace, evalAt_star_singleGL] |
| 306 | |
| 307 | /-- The element `ofSplitPlace hw g` is supported on `{w} ∪ {w̄}`. -/ |
| 308 | @[simp] |
| 309 | lemma ofSplitPlace_mem_supportedOn : |
| 310 | ofSplitPlace hw g ∈ supportedOn n ({w} : Set (FinPlace E)) := by aesop |
| 311 | |
| 312 | /-- For a finite place `w` of the CM field `E` with `w̄ ≠ w`, the image of the homomorphism |
| 313 | `ofSplitPlace hw` from `GL_n(E_w)` to the finite adelic unitary group, which sends `g` to the |
| 314 | element with component `g` at `w` and `1` off `w, w̄`, is the subgroup `supportedOn n {w}` of |
| 315 | elements with component `1` at every place other than `w` and `w̄`. -/ |
| 316 | lemma range_ofSplitPlace : (ofSplitPlace hw).range = supportedOn n ({w} : Set (FinPlace E)) := by |
| 317 | refine le_antisymm (by aesop (add simp IsConcreteLE.le_iff)) fun k hk ↦ ⟨k.atPlace w, ?_⟩ |
| 318 | -- an element supported on `w` and its conjugate is determined by its component at `w` |
| 319 | exact eq_of_supportedOn (ofSplitPlace_mem_supportedOn hw (k.atPlace w)) hk (by simp) |
| 320 | |
| 321 | /-- For a split place `w`, the element `ofSplitPlace hw g` is integral if and only if |
| 322 | `g ∈ localIntGL n w = GL_n(O_w)`. -/ |
| 323 | @[simp] |
| 324 | lemma ofSplitPlace_mem_stdLevel : ofSplitPlace hw g ∈ stdLevel E n ↔ g ∈ localIntGL n w := by |
| 325 | simp [mem_stdLevel_iff_of_supportedOn (ofSplitPlace_mem_supportedOn hw g)] |
| 326 | |
| 327 | /-- For a split place `w`, the embedding `ofSplitPlace hw` of `GL_n(E_w)` into the finite adelic |
| 328 | unitary group is continuous. -/ |
| 329 | @[fun_prop] |
| 330 | lemma continuous_ofSplitPlace : Continuous (ofSplitPlace (n := n) hw) := by |
| 331 | -- the matrix of `singleGL w g` is `1` plus the matrix `g - 1` embedded entrywise at `w` |
| 332 | have h_locGL : Continuous (singleGL w : GL n (LocField w) → GL n (𝔸f E)) := |
| 333 | Continuous.units_map _ |
| 334 | (by fun_prop : Continuous fun g : Matrix n n (LocField w) ↦ 1 + (g - 1).map (singleAdele w)) |
| 335 | -- `ofSplitPlace hw g` is `singleGL w g * star (singleGL w g⁻¹)` |
| 336 | exact Continuous.subtype_mk |
| 337 | (f := fun g : GL n (LocField w) ↦ singleGL w g * star (singleGL w g⁻¹)) (by fun_prop) _ |
| 338 | |
| 339 | variable {S : Finset (FinPlace E)} (hS : ∀ w ∈ S, star w ∉ S) |
| 340 | |
| 341 | /-- For a finite set `S` of finite places disjoint from `S̄`, the homomorphism sending a family |
| 342 | `(g_w)` in `∏ w ∈ S, GL_n(E_w)` to the unitary element with component `g_w` at each `w` in `S` |
| 343 | and `1` off `S ∪ S̄`. -/ |
| 344 | def ofSplitPlaces : (∀ w : S, GL n (LocField w.val)) →* Gf E n := |
| 345 | -- the factors commute: at each place one of the two is trivial |
| 346 | noncommPiCoprod (fun w : S ↦ ofSplitPlace (n := n) (w := w.val) (by grind)) <| by |
| 347 | intro v w hvw g h |
| 348 | exact commute_supportedOn_trivialOn (ofSplitPlace_mem_supportedOn _ _) |
| 349 | (by simp (disch := grind)) |
| 350 | |
| 351 | /-- For a finite set `S` of places of the CM field `E` disjoint from `S̄` and a family |
| 352 | `g w ∈ GL_n(E_w)` for `w` in `S`, the component at `w ∈ S` of the finite adelic unitary element |
| 353 | `ofSplitPlaces hS g` (the product of the elements `ofSplitPlace _ (g w)` concentrated at `w, w̄`) is |
| 354 | `g w`. -/ |
| 355 | @[simp] |
| 356 | lemma atPlace_ofSplitPlaces (g : (i : S) → GL n (LocField (i : FinPlace E))) (w : S) : |
| 357 | (ofSplitPlaces (n := n) hS g).atPlace w = g w := by |
| 358 | classical |
| 359 | -- Take the factor at `w` out of the product; the other factors are trivial at `w`. |
| 360 | have h_split : ∀ v : S, star (v : FinPlace E) ≠ v := by grind |
| 361 | have h_other : ∀ v ∈ (Finset.univ : Finset S).erase w, |
| 362 | (ofSplitPlace (n := n) (h_split v) (g v)).atPlace w = 1 := |
| 363 | fun v hv ↦ atPlace_ofSplitPlace_of_ne (h_split v) (g v) (by grind) (by grind) |
| 364 | rw [ofSplitPlaces, noncommPiCoprod_apply, |
| 365 | ← Finset.mul_noncommProd_erase (a := w) (h := Finset.mem_univ w)] |
| 366 | simp only [map_mul, atPlace_ofSplitPlace, mul_eq_left] |
| 367 | exact (Gf.atPlace (w : FinPlace E)).ker.noncommProd_mem _ h_other |
| 368 | |
| 369 | /-- For a finite set `S` of places disjoint from `S̄`, the finite adelic unitary element |
| 370 | `ofSplitPlaces hS g` with component `g w` at each `w ∈ S` is `1` at every place outside `S ∪ S̄`. -/ |
| 371 | lemma ofSplitPlaces_mem_supportedOn (g : (i : S) → GL n (LocField (i : FinPlace E))) : |
| 372 | ofSplitPlaces hS g ∈ supportedOn n S := by |
| 373 | -- the image is generated by the images of the factors, each supported on one `{w, w̄}` |
| 374 | suffices h_le : (ofSplitPlaces (n := n) hS).range ≤ supportedOn n S from h_le ⟨g, rfl⟩ |
| 375 | exact (noncommPiCoprod_range _).trans_le |
| 376 | (iSup_le fun w ↦ (range_ofSplitPlace _).trans_le (supportedOn_mono (by simp))) |
| 377 | |
| 378 | /-- For a finite set `S` of places disjoint from `S̄`, the element `ofSplitPlaces hS g` with |
| 379 | component `g w` at each `w ∈ S` lies in the integral subgroup `stdLevel E n` if and only if every |
| 380 | `g w` lies in `localIntGL n w = GL_n(O_w)`. -/ |
| 381 | lemma ofSplitPlaces_mem_stdLevel (g : (i : S) → GL n (LocField (i : FinPlace E))) : |
| 382 | ofSplitPlaces hS g ∈ stdLevel E n ↔ ∀ w : S, g w ∈ localIntGL n w := by |
| 383 | rw [mem_stdLevel_iff_of_supportedOn (ofSplitPlaces_mem_supportedOn _ _), Subtype.forall'] |
| 384 | simp |
| 385 | |
| 386 | end SplitPlaces |
| 387 | |
| 388 | end New |
| 389 | |
| 390 | /-! |
| 391 | ## Constructions on hermitian spaces with a point |
| 392 | |
| 393 | Negation of spaces and the standard spaces need an element of norm `-1` in the integral finite |
| 394 | adeles (`New.Weil.normNegOne`), which exists under the hypothesis `New.HasPrimitiveRoot5040`: the |
| 395 | field contains a primitive root of unity of order `5040`. |
| 396 | -/ |
| 397 | |
| 398 | section SpaceOperations |
| 399 | |
| 400 | open NumberField Matrix |
| 401 | |
| 402 | namespace New |
| 403 | |
| 404 | section |
| 405 | |
| 406 | variable {m n R : Type*} [DecidableEq m] [DecidableEq n] [CommRing R] |
| 407 | |
| 408 | /-! ### Sign matrices, and blocks and reindexing over a ring -/ |
| 409 | |
| 410 | /-- The homomorphism GL_m(R) × GL_n(R) → GL_{m+n}(R) sending (g, h) to the block diagonal matrix |
| 411 | diag(g, h). -/ |
| 412 | @[simps! apply_val] |
| 413 | def blockGL [Fintype m] [Fintype n] : GL m R × GL n R →* GL (m ⊕ n) R where |
| 414 | toFun g := |
| 415 | { val := fromBlocks g.1 0 0 g.2 |
| 416 | inv := fromBlocks ↑g.1⁻¹ 0 0 ↑g.2⁻¹ |
| 417 | val_inv := by simp [fromBlocks_multiply] |
| 418 | inv_val := by simp [fromBlocks_multiply] } |
| 419 | map_one' := by ext : 1; simp |
| 420 | map_mul' g h := by ext : 1; simp [fromBlocks_multiply] |
| 421 | |
| 422 | /-- The block diagonal sum of the sign matrices `signMatrix s = diag(s)` and `signMatrix t` of s and |
| 423 | t is that of the concatenated signs. -/ |
| 424 | lemma signMatrix_sum (s : m → ℤˣ) (t : n → ℤˣ) : |
| 425 | fromBlocks (signMatrix s) 0 0 (signMatrix t) = signMatrix (n := m ⊕ n) (s ⊕ᵥ t) := by |
| 426 | simp [signMatrix] |
| 427 | |
| 428 | @[simp] |
| 429 | lemma signMatrix_neg (s : n → ℤˣ) : signMatrix (-s) = -signMatrix (n := n) s := by simp [signMatrix] |
| 430 | |
| 431 | variable [Fintype m] [Fintype n] [StarRing R] (e : m ≃ n) {J : Matrix m m R} |
| 432 | |
| 433 | /-- For a bijection e of index sets, the isomorphism GL_m(R) ≅ GL_n(R) relabelling rows and |
| 434 | columns along e. -/ |
| 435 | @[simps! apply_val] |
| 436 | def reindexGL : GL m R ≃* GL n R := Units.mapEquiv (reindexRingEquiv R e).toMulEquiv |
| 437 | |
| 438 | /-- The block embedding `U J × U J' → U J''`, `(g, h) ↦ diag(g, h)`, where `J''` is the block |
| 439 | diagonal sum of `J` and `J'`. -/ |
| 440 | def U.sum {J' : Matrix n n R} {J'' : Matrix (m ⊕ n) (m ⊕ n) R} (h : fromBlocks J 0 0 J' = J'') : |
| 441 | U J × U J' →* U J'' := |
| 442 | (blockGL.comp ((U J).subtype.prodMap (U J').subtype)).codRestrict (U J'') <| by |
| 443 | aesop (add simp [mem_unitaryGroupOf_iff, star_eq_conjTranspose, fromBlocks_conjTranspose, |
| 444 | fromBlocks_multiply]) |
| 445 | |
| 446 | /-- The block embedding a ↦ diag(a, 1) of U(diag ε) into the unitary group of the concatenated |
| 447 | signs (ε, η). -/ |
| 448 | @[simps! apply_coe_val] |
| 449 | noncomputable def U.inl {n m : Type*} [Fintype n] [DecidableEq n] [Fintype m] [DecidableEq m] |
| 450 | (ε : n → ℤˣ) (η : m → ℤˣ) : |
| 451 | U (signMatrix ε) →* U (signMatrix (Sum.elim ε η)) := |
| 452 | (sum (signMatrix_sum ε η)).comp (MonoidHom.inl (U (signMatrix ε)) (U (signMatrix η))) |
| 453 | |
| 454 | /-- The block diagonal homomorphism U_m(R) × U_n(R) → U_{m+n}(R), (g, h) ↦ diag(g, h), between |
| 455 | the unitary groups of identity matrices. -/ |
| 456 | abbrev U.blockSumOne : |
| 457 | U (1 : Matrix m m R) × U (1 : Matrix n n R) →* U (1 : Matrix (m ⊕ n) (m ⊕ n) R) := |
| 458 | sum (fromBlocks_one (l := m) (m := n) (α := R)) |
| 459 | |
| 460 | /-- Renaming the basis by `e` identifies the unitary group of `J` with that of the form `J'` |
| 461 | obtained from `J` by the same renaming of rows and columns. -/ |
| 462 | def U.reindex {J' : Matrix n n R} (h : J.submatrix e.symm e.symm = J') : U J ≃* U J' where |
| 463 | toEquiv := (reindexGL e).subtypeEquiv <| by |
| 464 | subst h |
| 465 | simp [← ext_iff, reindex_equiv e.symm, mem_unitaryGroupOf_iff, star_eq_conjTranspose] |
| 466 | map_mul' := by simp |
| 467 | |
| 468 | variable {l : Type*} [Fintype l] [DecidableEq l] (e : m ⊕ l ≃ n) |
| 469 | |
| 470 | /-- The block diagonal embedding U(1_m) × U(1_l) → U(1_n) of unitary groups of identity |
| 471 | matrices, along a bijection of the disjoint union of m and l with n. -/ |
| 472 | def U.block : U (1 : Matrix m m R) × U (1 : Matrix l l R) →* U (1 : Matrix n n R) := |
| 473 | (reindex e (submatrix_one_equiv e.symm)).toMonoidHom.comp blockSumOne |
| 474 | |
| 475 | /-- The matrix of the image of a pair `g = (g₁, g₂)` of unitary matrices (`New.U J` is the unitary |
| 476 | group of the form `J`) under `New.U.block e` is diag(g₁, g₂) with rows and columns relabelled |
| 477 | along `e`. -/ |
| 478 | @[simp] |
| 479 | lemma U.block_val (g : U (1 : Matrix m m R) × U (1 : Matrix l l R)) : |
| 480 | (block e g).val.val = (fromBlocks g.1 0 0 g.2).submatrix e.symm e.symm := rfl |
| 481 | |
| 482 | end |
| 483 | |
| 484 | section |
| 485 | |
| 486 | variable {E : Type*} [Field E] [NumberField E] [IsCMField E] |
| 487 | {m n : Type*} [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n] {s : n → ℤˣ} {t : m → ℤˣ} |
| 488 | |
| 489 | /-! ### The adelic unitary groups -/ |
| 490 | |
| 491 | /-- The block diagonal embedding of the product of the adelic unitary groups for signs s and t |
| 492 | into the one for the concatenated signs. -/ |
| 493 | def G.sum : G E s × G E t →* G E (s ⊕ᵥ t) := |
| 494 | .prod (.mk' (fun g w ↦ U.sum (signMatrix_sum s t) (g.1.1 w, g.2.1 w)) |
| 495 | (by simp [← map_mul, funext_iff])) |
| 496 | ((U.sum (by simp)).comp (.prodMap (.snd (GInf E s) (Gf E n)) (.snd (GInf E t) (Gf E m)))) |
| 497 | |
| 498 | /-- The adelic matrix (`New.G.adeleMatrix`) of the block sum of g₁ and g₂ is diag(g₁, g₂). -/ |
| 499 | @[simp] |
| 500 | lemma G.adeleMatrix_sum (g : G E s × G E t) : |
| 501 | (sum g).adeleMatrix = g.1.adeleMatrix.fromBlocks 0 0 g.2.adeleMatrix := by |
| 502 | ext (i | i) (j | j) <;> rfl |
| 503 | |
| 504 | /-- The isomorphism between the adelic unitary groups for signs s and −s that is the identity on |
| 505 | matrices, since U(J) = U(−J) at each infinite place. -/ |
| 506 | def G.neg : G E s ≃* G E (-s) := |
| 507 | .prodCongr (.piCongrRight fun _ ↦ MulEquiv.subgroupCongr (by ext; simp [mem_unitaryGroupOf_iff])) |
| 508 | (.refl (Gf E n)) |
| 509 | |
| 510 | omit [IsCMField E] [Fintype m] [Fintype n] in |
| 511 | /-- The standard adelic forms for signs s and t have as block diagonal sum the standard form for |
| 512 | the concatenated signs. -/ |
| 513 | lemma stdForm_sum : fromBlocks (stdForm E s) 0 0 (stdForm E t) = stdForm E (s ⊕ᵥ t) := by |
| 514 | simp [stdForm] |
| 515 | |
| 516 | end |
| 517 | |
| 518 | variable {E : Type*} [Field E] [CMType E] {m n : Type*} [Fintype m] [DecidableEq m] [Fintype n] |
| 519 | [DecidableEq n] {s : n → ℤˣ} {t : m → ℤˣ} (V : Space E n s) (e : n ≃ m) (h : s ∘ e.symm = t) |
| 520 | (g : G E s) |
| 521 | |
| 522 | /-- If `a w` carries `J`, embedded in `ℂ` by the CM type, to the diagonal matrix of signs `s` at |
| 523 | each infinite place `w` and `b` carries `J` to `1` over the finite adeles, then the adelic matrix |
| 524 | with components `a` and `b` (`New.mkAdelicGL`) carries `J` to the standard form. Here `Φ w` is |
| 525 | the embedding of `E` chosen at `w` and `toAdele` is the diagonal embedding of `E`. -/ |
| 526 | lemma gram_mkAdelicGL {J : Matrix n n E} {a : InfinitePlace E → GL n ℂ} {b : GL n (𝔸f E)} |
| 527 | (ha : ∀ w : InfinitePlace E, (a w).valᴴ * map J (Φ w) * (a w).val = signMatrix s) |
| 528 | (hb : b.valᴴ * J.map (algebraMap E (𝔸f E)) * b.val = 1) : |
| 529 | (mkAdelicGL (a, b)).valᴴ * J.map toAdele * (mkAdelicGL (a, b)).val = stdForm E s := by |
| 530 | apply matrix_ext_𝔸 |
| 531 | -- on the infinite components the identity is `ha`, on the finite one `hb`; `↓` maps the |
| 532 | -- product factor by factor first |
| 533 | · simpa [↓Matrix.map_mul, stdForm] |
| 534 | · simpa [↓Matrix.map_mul, stdForm] |
| 535 | |
| 536 | section |
| 537 | |
| 538 | variable {E : Type*} [Field E] [NumberField E] [IsCMField E] (e : n ≃ m) (h : s ∘ e.symm = t) |
| 539 | (g : G E s) |
| 540 | |
| 541 | @[simp] |
| 542 | lemma G.adeleMatrix_neg : (neg g).adeleMatrix = g.adeleMatrix := by ext <;> rfl |
| 543 | |
| 544 | /-- For a bijection of index sets carrying signs s to signs t, the isomorphism of the |
| 545 | corresponding adelic unitary groups relabelling rows and columns in every component. -/ |
| 546 | def G.reindex : G E s ≃* G E t := |
| 547 | toUnitary.trans ((U.reindex e (by simp [← h, stdForm])).trans toUnitary.symm) |
| 548 | |
| 549 | @[simp] |
| 550 | lemma G.adeleMatrix_reindex : |
| 551 | (reindex e h g).adeleMatrix = g.adeleMatrix.submatrix e.symm e.symm := rfl |
| 552 | |
| 553 | end |
| 554 | |
| 555 | variable [HasPrimitiveRoot5040 E] |
| 556 | |
| 557 | /-! ### A unit of norm `-1` and the standard spaces -/ |
| 558 | |
| 559 | /-- For a field `E` with a primitive root of unity of order 5040, a chosen element ε of Ô with |
| 560 | ε̄ε = −1, as a unit with inverse −ε̄. It exists by `New.exists_unit_star_mul_self_eq`. -/ |
| 561 | def Weil.normNegOne {E : Type*} [Field E] [NumberField E] [IsCMField E] [HasPrimitiveRoot5040 E] : |
| 562 | (Ô E)ˣ := |
| 563 | have h_norm := exists_unit_star_mul_self_eq (u := -1) (by simp) (by simp) |
| 564 | Units.mkOfMulEqOne h_norm.choose (-star h_norm.choose.val) (by |
| 565 | ext1 |
| 566 | rw [mul_neg] |
| 567 | change -(h_norm.choose.val.val * star h_norm.choose.val.val) = (1 : 𝔸f E) |
| 568 | grind) |
| 569 | |
| 570 | open Weil |
| 571 | |
| 572 | /-- The element `normNegOne` satisfies `ε̄ε = -1`. -/ |
| 573 | @[simp] |
| 574 | lemma star_normNegOne_mul_self {E : Type*} [Field E] [NumberField E] [IsCMField E] |
| 575 | [HasPrimitiveRoot5040 E] : star normNegOne.val.val * normNegOne.val.val = (-1 : 𝔸f E) := by |
| 576 | simpa [normNegOne] using (exists_unit_star_mul_self_eq (E := E) (u := -1) (by simp) |
| 577 | (by simp)).choose_spec |
| 578 | |
| 579 | variable (E) |
| 580 | |
| 581 | /-- The idele that is 1 at the infinite places and whose finite part is the unit |
| 582 | ε = `New.Weil.normNegOne` of Ô, with ε̄ε = −1. -/ |
| 583 | def normNegOneIdele (E : Type*) [Field E] [NumberField E] [IsCMField E] [HasPrimitiveRoot5040 E] : |
| 584 | (𝔸 E)ˣ := normNegOne.map (MonoidHom.prod 1 (Ô E).subtype.toMonoidHom) |
| 585 | |
| 586 | /-- If `E` contains a primitive root of unity of order 5040, the standard space with matrix |
| 587 | diag(s). Its point is diagonal, with entry 1 where s_i = 1 and `normNegOneIdele E` (the idele |
| 588 | with finite part of norm −1) where s_i = −1. -/ |
| 589 | def signedSpace (s : n → ℤˣ) : Space E n s where |
| 590 | J := diagonal fun i ↦ s i |
| 591 | x := diagGL fun i ↦ if s i = 1 then 1 else normNegOneIdele E |
| 592 | gram_point := by |
| 593 | -- where `s i = -1` the norm `-1` of the finite part cancels the sign |
| 594 | simp_all [apply_ite, ite_apply, normNegOneIdele, funext_iff, stdForm, Prod.ext_iff, |
| 595 | Int.units_ne_iff_eq_neg] |
| 596 | |
| 597 | variable {E} |
| 598 | |
| 599 | namespace Space |
| 600 | |
| 601 | /-! ### Operations on spaces -/ |
| 602 | |
| 603 | /-- For spaces V, W with signs s, t, the space with concatenated signs whose matrix and point |
| 604 | are the block diagonal sums of those of V and W. -/ |
| 605 | def sum (W : Space E m t) : Space E (n ⊕ m) (s ⊕ᵥ t) where |
| 606 | J := V.J.fromBlocks 0 0 W.J |
| 607 | x := blockGL (V.x, W.x) |
| 608 | gram_point := by |
| 609 | simp [fromBlocks_conjTranspose, fromBlocks_map, fromBlocks_multiply, gram_point, stdForm] |
| 610 | |
| 611 | /-- For a space V with signs s and an index bijection carrying s to t, the space with signs t |
| 612 | obtained by relabelling its matrix and point. -/ |
| 613 | def reindex : Space E m t where |
| 614 | J := V.J.reindex e e |
| 615 | x := reindexGL e V.x |
| 616 | gram_point := by |
| 617 | subst h |
| 618 | simp [← submatrix_map, gram_point, stdForm] |
| 619 | |
| 620 | /-- If `E` contains a primitive root of unity of order 5040 and (J, x) is a space with signs s, |
| 621 | the space with signs −s, matrix −J and point x multiplied by the scalar `normNegOneIdele E`, the |
| 622 | idele that is 1 at infinity and whose finite part has norm −1. -/ |
| 623 | def neg : Space E n (-s) where |
| 624 | J := -V.J |
| 625 | x := normNegOneIdele E • V.x |
| 626 | gram_point := by |
| 627 | -- At the finite places the norm `-1` of the scaling factor cancels the sign of `-V.J`. |
| 628 | simp [Matrix.map_neg, normNegOneIdele, Units.smul_def, ← diagonal_smul, gram_point, stdForm, |
| 629 | Prod.ext_iff, funext_iff] |
| 630 | grind [star_normNegOne_mul_self] |
| 631 | |
| 632 | /-- For a space (J, x) and g in G, the space (J, xg): the same matrix with the point moved by g. -/ |
| 633 | def move : Space E n s where |
| 634 | J := V.J |
| 635 | x := V.x * g.toUnitary.val |
| 636 | gram_point := gram_mul_of_gram_eq V.gram_point (mem_unitaryGroupOf_iff.1 g.toUnitary.property) |
| 637 | |
| 638 | attribute [simps J] signedSpace sum reindex neg move |
| 639 | |
| 640 | end Space |
| 641 | |
| 642 | end New |
| 643 | |
| 644 | end SpaceOperations |
| 645 | |
| 646 | end |