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 TauCeti.Algebra.Ring.Invertible |
| 4 | import TauCeti.LinearAlgebra.Matrix.Nonsingular.Inverse |
| 5 | import TauCeti.Analysis.Matrix.IndefiniteUnitaryGroup |
| 6 | public import Lib.Adelic.Unitary.GramMatrix |
| 7 | public import Lib.Adelic.Unitary.ComponentsAndBlockSums |
| 8 | import Lib.General.Topology |
| 9 | import Lib.Adelic.Adeles.StrongApproximation |
| 10 | |
| 11 | /-! |
| 12 | # Closed matrix embedding of adelic unitary groups, discrete rational points, weak approximation |
| 13 | |
| 14 | This file concerns the adelic unitary group `New.G E s = G_∞ × G_f` over a CM field `E` (hypothesis |
| 15 | `IsCMField E`; the discreteness instance and the `New.Space` results assume `CMType E` instead, |
| 16 | which makes `E` a CM field), together with the rational points of a hermitian space `V` with signs |
| 17 | `s`. When all signs are `1`, the finite parts of the rational points form a discrete subgroup of |
| 18 | `G_f`. |
| 19 | |
| 20 | ## Main definitions and results |
| 21 | |
| 22 | * `New.G.isClosedEmbedding_adeleMatrix`: sending `g` to its adelic matrix is a closed embedding. |
| 23 | Hence a map into the group is continuous when its matrix is (`New.G.continuous_iff`), and elements |
| 24 | with the same matrix are equal (`New.G.ext_adeleMatrix`). |
| 25 | * An instance: for a space `W` whose signs are all `1`, the group `New.Space.Γf` of finite parts of |
| 26 | the rational points is discrete in `G_f`. |
| 27 | * `New.Space.cayleyMap`: a map from all rational matrices to the rational points, through the Cayley |
| 28 | transform of a rational skew matrix. |
| 29 | * `New.Space.eventually_tendsto_cayleyMap`: for all but finitely many parameters `c`, the image of |
| 30 | `A` under this map tends to `g` at a given place as `A + e • B` (`A` rational, `B` adelic) tends |
| 31 | to `V.toRatCoords g`, if the place kills the adeles `e` and `star e`. |
| 32 | * `New.Space.weak_approximation`: weak approximation. The consequence that a rational translate of a |
| 33 | finite adelic point is integral above a prime is `New.exists_mul_mem_integralAbove`, in |
| 34 | `Lib.Adelic.AutomorphicForms.PAdicGauge`. |
| 35 | |
| 36 | Notions from other files: |
| 37 | * `New.G E s`: the adelic unitary group for the signs `s`; `New.G.adeleMatrix g` is the `n × n` |
| 38 | matrix over the adeles of its element `g`. |
| 39 | * `New.Space E n s`: a hermitian space with a point, given by a matrix `J` over `E` and `x` in |
| 40 | `GL_n(𝔸)` with `xᴴ J x` equal to `diag s` at the infinite places and `1` at the finite places. |
| 41 | * `New.Space.ratEmbed`, `New.Space.embFin`: `γ ↦ x⁻¹ γ x` from the rational unitary group of `J` to |
| 42 | `G`, and its finite part; their images are `New.Space.Γ` and `New.Space.Γf`. |
| 43 | * `New.Space.toRatCoords`: `g ↦ x g x⁻¹` from `G` to the adelic unitary group of `J`. |
| 44 | |
| 45 | ## Relation to the literature |
| 46 | |
| 47 | Known result: weak approximation for unitary groups. Source: V. Platonov, A. Rapinchuk, Algebraic |
| 48 | Groups and Number Theory, 1994, ch. 7. Here a hermitian space comes with an adelic frame to a fixed |
| 49 | diagonal form, and this form is the identity at all finite places, so every space of one signature |
| 50 | shares one adelic group. |
| 51 | -/ |
| 52 | |
| 53 | @[expose] public section |
| 54 | |
| 55 | /-! ## Closed embedding into matrices and discreteness of rational points -/ |
| 56 | |
| 57 | namespace New |
| 58 | |
| 59 | open NumberField Topology U |
| 60 | |
| 61 | variable {E : Type*} [Field E] [NumberField E] [IsCMField E] {n : Type*} [Fintype n] |
| 62 | [DecidableEq n] {s : n → ℤˣ} |
| 63 | |
| 64 | /-- Sending an element of the adelic unitary group to its adelic matrix is a closed embedding. -/ |
| 65 | lemma G.isClosedEmbedding_adeleMatrix : IsClosedEmbedding |
| 66 | (adeleMatrix : G E s → Matrix n n (𝔸 E)) := by |
| 67 | -- `adeleMatrix` is `toUnitary` followed by the closed embedding of the unitary group of |
| 68 | -- `stdForm E s` into matrices, so it suffices that `toUnitary` and its inverse are continuous. |
| 69 | have h_emb : IsClosedEmbedding fun u : U (stdForm E s) ↦ (u.val : Matrix n n (𝔸 E)) := |
| 70 | Matrix.unitaryGroupOf.isClosedEmbedding_val isUnit_stdForm |
| 71 | have h_symm : Continuous (toUnitary.symm : U (stdForm E s) → G E s) := |
| 72 | .prodMk (continuous_pi fun w ↦ continuous_map (continuous_apply w).fst') |
| 73 | (continuous_map continuous_snd) |
| 74 | exact h_emb.comp |
| 75 | (toUnitary.left_inv.isClosedEmbedding h_symm (h_emb.continuous_iff.2 continuous_adeleMatrix)) |
| 76 | |
| 77 | /-- Elements of the adelic unitary group with the same adelic matrix are equal. -/ |
| 78 | lemma G.ext_adeleMatrix {g g' : G E s} (h : g.adeleMatrix = g'.adeleMatrix) : g = g' := |
| 79 | isClosedEmbedding_adeleMatrix.injective h |
| 80 | |
| 81 | /-- A map into the adelic unitary group is continuous if and only if its adelic matrix is. -/ |
| 82 | lemma G.continuous_iff {X : Type*} [TopologicalSpace X] {f : X → G E s} : |
| 83 | Continuous f ↔ Continuous fun x : X ↦ (f x).adeleMatrix := |
| 84 | isClosedEmbedding_adeleMatrix.continuous_iff |
| 85 | |
| 86 | /-- For a space `W` whose signs are all `1`, the finite parts of the rational points form a |
| 87 | discrete subgroup `W.Γf` of `G_f`. -/ |
| 88 | instance {E : Type*} [Field E] [CMType E] (W : Space E n 1) : DiscreteTopology W.Γf := by |
| 89 | -- The infinite factor is compact, so the finite projection is a closed map. |
| 90 | change DiscreteTopology (Set.range (Prod.snd ∘ W.ratEmbed)) |
| 91 | rw [Set.range_comp] |
| 92 | have hΓ : IsDiscrete (W.Γ : Set (G E (1 : n → ℤˣ))) := |
| 93 | isDiscrete_iff_discreteTopology.2 W.discreteTopology_Gamma |
| 94 | exact (isDiscrete_image_of_isClosedMap hΓ (W.Γ.isClosed_of_isDiscrete hΓ) |
| 95 | isClosedMap_snd_of_compactSpace).to_subtype |
| 96 | |
| 97 | end New |
| 98 | |
| 99 | /-! |
| 100 | ## Weak approximation at infinity and finitely many finite places |
| 101 | |
| 102 | Let `x` be the point of `V`. Then `V.toRatCoords g = x g x⁻¹` and `V.ratEmbed γ = x⁻¹ γ x` |
| 103 | translate between `New.G` and the unitary group of `V.J`. |
| 104 | |
| 105 | The idea: let `γ = V.toRatCoords g` and take a rational `c` with `star c * c = 1` and `1 + c γ` |
| 106 | invertible at the given places. The Cayley transform of `c γ` is skew for `V.J`, rational skew |
| 107 | matrices `u` approach it, and the rational isometries `c⁻¹ (1 - u) (1 + u)⁻¹` approach `γ`; so |
| 108 | their images under `V.ratEmbed` approach `g`. The matrices `u` come from rational matrices that |
| 109 | approach `γ` (`New.Exchange.denseRange_rat_matrix_add`). |
| 110 | -/ |
| 111 | |
| 112 | namespace New.Space |
| 113 | |
| 114 | open Matrix Topology Filter G Exchange Function Gf RingHom Algebra |
| 115 | |
| 116 | variable {E n : Type*} [Field E] [CMType E] [Fintype n] [DecidableEq n] {s : n → ℤˣ} |
| 117 | (V : Space E n s) |
| 118 | |
| 119 | /-- A CM field has infinitely many elements `c` with `star c * c = 1`. -/ |
| 120 | instance : Infinite (unitary E) := by |
| 121 | -- For `z ≠ star z`, the quotients `star y / y` with `y = k + z`, `k : ℕ`, are pairwise distinct. |
| 122 | obtain ⟨z, hz⟩ : ∃ z : E, IsUnit (z - star z) := exists_isUnit_sub_star |
| 123 | -- `1 - (y - star y) * y⁻¹` is `star y / y` for `y ≠ 0` and `1` for `y = 0`. |
| 124 | have h_mem (y : E) : 1 - (y - star y) * y⁻¹ ∈ unitary E := by |
| 125 | suffices h : (1 - (star y - y) * (star y)⁻¹) * (1 - (y - star y) * y⁻¹) = 1 by |
| 126 | simpa [unitary, mul_comm] using h |
| 127 | grind [star_eq_zero] |
| 128 | refine .of_injective (fun k : ℕ ↦ ⟨_, h_mem (k + z)⟩) fun k l hkl ↦ ?_ |
| 129 | -- The difference `y - star y = z - star z` is nonzero and does not depend on `k`. |
| 130 | simpa [hz.ne_zero] using hkl |
| 131 | |
| 132 | /-- The Cayley transform `(1 - A) (1 + A)⁻¹` of a square matrix (`0` if `1 + A` is singular). -/ |
| 133 | noncomputable def _root_.New.cayleyTransform {K : Type*} [Field K] (A : Matrix n n K) : |
| 134 | Matrix n n K := |
| 135 | (1 - A) * (1 + A)⁻¹ |
| 136 | |
| 137 | /-- The Cayley transform is an involution where it is defined: if `2 ≠ 0` in `K` and `1 + A` is |
| 138 | invertible and `C` is the transform of `A`, then `1 + C` is invertible and the transform of `C` is |
| 139 | `A`. -/ |
| 140 | lemma _root_.New.cayleyTransform_cayleyTransform {K : Type*} [Field K] (h_two : (2 : K) ≠ 0) |
| 141 | {A : Matrix n n K} (hA : (1 + A).det ≠ 0) : |
| 142 | (1 + cayleyTransform A).det ≠ 0 ∧ cayleyTransform (cayleyTransform A) = A := by |
| 143 | -- `(1 + C) (1 + A) = 2` and `(1 - C) (1 + A) = 2 A`. |
| 144 | have h_cancel : cayleyTransform A * (1 + A) = 1 - A := by simp [cayleyTransform, hA] |
| 145 | have h_add : (1 + cayleyTransform A) * ((2 : K)⁻¹ • (1 + A)) = 1 := by |
| 146 | rw [mul_smul_comm, one_add_mul, h_cancel, inv_smul_eq_iff₀ h_two, two_smul, add_add_sub_cancel] |
| 147 | have h_sub : (1 - cayleyTransform A) * ((2 : K)⁻¹ • (1 + A)) = A := by |
| 148 | rw [mul_smul_comm, one_sub_mul, h_cancel, inv_smul_eq_iff₀ h_two, two_smul, add_sub_sub_cancel] |
| 149 | exact ⟨(isUnit_det_of_right_inverse h_add).ne_zero, |
| 150 | by rw [cayleyTransform, inv_eq_right_inv h_add, h_sub]⟩ |
| 151 | |
| 152 | /-- The two factors of the Cayley transform commute. -/ |
| 153 | lemma _root_.New.cayleyTransform_eq_inv_mul {K : Type*} [Field K] (A : Matrix n n K) : |
| 154 | cayleyTransform A = (1 + A)⁻¹ * (1 - A) := by |
| 155 | have h_comm : Commute (1 - A) (1 + A) := |
| 156 | (Commute.one_left _).sub_left ((Commute.one_right A).add_right (Commute.refl A)) |
| 157 | rw [cayleyTransform, nonsing_inv_eq_ringInverse] |
| 158 | exact h_comm.ringInverse_right.eq |
| 159 | |
| 160 | /-- The Cayley transform of an isometry is skew. Here `B` stands for the conjugate transpose of |
| 161 | `A`: if `B J A = J` with `J` and `1 + A` invertible, then `1 + B` is invertible and the |
| 162 | transforms `A'`, `B'` satisfy `B' J = -J A'`. -/ |
| 163 | lemma _root_.New.cayleyTransform_mul_eq_neg {K : Type*} [Field K] {A B J : Matrix n n K} |
| 164 | (h_gram : B * J * A = J) (hJ : J.det ≠ 0) (hA : (1 + A).det ≠ 0) : |
| 165 | (1 + B).det ≠ 0 ∧ cayleyTransform B * J = -(J * cayleyTransform A) := by |
| 166 | have h_add : (1 + B) * J * A = J * (1 + A) := by simp [add_mul, mul_add, h_gram, add_comm] |
| 167 | have hB : (1 + B).det ≠ 0 := fun h_zero ↦ by simpa [h_zero, hJ, hA] using congrArg det h_add |
| 168 | -- Both sides of `h_cross` are `J A - B J`. |
| 169 | have h_cross : (1 - B) * J * (1 + A) = -((1 + B) * J * (1 - A)) := by |
| 170 | simp only [sub_mul, add_mul, mul_add, mul_sub, h_gram, one_mul, mul_one] |
| 171 | abel |
| 172 | refine ⟨hB, ?_⟩ |
| 173 | calc _ = (1 + B)⁻¹ * ((1 - B) * J * (1 + A)) * (1 + A)⁻¹ := by |
| 174 | simp [cayleyTransform_eq_inv_mul, ← Matrix.mul_assoc, hA] |
| 175 | _ = -(J * cayleyTransform A) := by simp [h_cross, cayleyTransform, Matrix.mul_assoc, hB] |
| 176 | |
| 177 | /-- The Cayley transform commutes with maps of fields. -/ |
| 178 | lemma _root_.New.cayleyTransform_map {K L : Type*} [Field K] [Field L] (φ : K →+* L) |
| 179 | (A : Matrix n n K) : (cayleyTransform A).map φ = cayleyTransform (A.map φ) := by |
| 180 | simp [cayleyTransform, map_nonsing_inv, Matrix.map_add, Matrix.map_sub] |
| 181 | |
| 182 | /-- The Cayley transform is continuous where `1 + A` is invertible. -/ |
| 183 | lemma _root_.New.continuousAt_cayleyTransform {K : Type*} [NormedField K] {A : Matrix n n K} |
| 184 | (hA : (1 + A).det ≠ 0) : ContinuousAt cayleyTransform A := |
| 185 | (continuousAt_const.sub continuousAt_id).mul |
| 186 | ((continuousAt_const.add continuousAt_id).matrix_inv hA) |
| 187 | |
| 188 | /-- The part of a rational matrix `C` that is skew for the form `J = V.J`, namely |
| 189 | `(C - J⁻¹ Cᴴ J) / 2`. -/ |
| 190 | noncomputable def formSkewPart (C : Matrix n n E) : Matrix n n E := |
| 191 | (2 : E)⁻¹ • (C - V.J⁻¹ * Cᴴ * V.J) |
| 192 | |
| 193 | /-- The skew part `u` of a matrix satisfies `uᴴ J = -J u`. -/ |
| 194 | lemma conjTranspose_formSkewPart_mul (C : Matrix n n E) : |
| 195 | (V.formSkewPart C)ᴴ * V.J = -(V.J * V.formSkewPart C) := by |
| 196 | have hJ : V.J.det ≠ 0 := ((isUnit_iff_isUnit_det _).1 V.isUnit_J).ne_zero |
| 197 | simp [formSkewPart, conjTranspose_nonsing_inv, conjTranspose_J, mul_assoc, mul_sub, sub_mul, |
| 198 | smul_sub, hJ] |
| 199 | |
| 200 | /-- If `u` is skew for the form of `V`, `1 + u` is invertible and `star c * c = 1`, then `c⁻¹` times |
| 201 | the Cayley transform of `u` is an isometry of `V`. -/ |
| 202 | lemma smul_cayleyTransform_isometry (c : unitary E) {u : Matrix n n E} |
| 203 | (hu : uᴴ * V.J = -(V.J * u)) (h_det : (1 + u).det ≠ 0) : |
| 204 | (c.val⁻¹ • cayleyTransform u)ᴴ * V.J * (c.val⁻¹ • cayleyTransform u) = V.J := by |
| 205 | -- `(1 - u)ᴴ J (1 - u) = (1 + u)ᴴ J (1 + u)`; multiply by the inverse of `1 + u` on both sides. |
| 206 | have h_gram : (1 - u)ᴴ * V.J * (1 - u) = (1 + u)ᴴ * V.J * (1 + u) := by |
| 207 | simp only [conjTranspose_sub, conjTranspose_add, conjTranspose_one, sub_mul, add_mul, hu] |
| 208 | noncomm_ring |
| 209 | have hc : c.val⁻¹ * star c.val⁻¹ = 1 := by simp [← mul_inv] |
| 210 | calc _ = (c.val⁻¹ * star c.val⁻¹) • ((1 + u)⁻¹ᴴ * ((1 - u)ᴴ * V.J * (1 - u)) * (1 + u)⁻¹) := by |
| 211 | simp [cayleyTransform, smul_smul, Matrix.mul_assoc] |
| 212 | _ = ((1 + u) * (1 + u)⁻¹)ᴴ * V.J * ((1 + u) * (1 + u)⁻¹) := by |
| 213 | simp only [hc, h_gram, one_smul, conjTranspose_mul, Matrix.mul_assoc] |
| 214 | _ = V.J := by simp [h_det] |
| 215 | |
| 216 | open scoped Classical in |
| 217 | /-- A map from rational matrices to rational points of the space `V`. For `star c * c = 1` and a |
| 218 | square matrix `A` over `E`, let `u` be the skew part of the Cayley transform of `c A`. The value is |
| 219 | the image under `V.ratEmbed` of the isometry `c⁻¹ (1 - u) (1 + u)⁻¹` of `V.J` if `1 + u` is |
| 220 | invertible, and `1` otherwise. -/ |
| 221 | noncomputable def cayleyMap (c : unitary E) (A : Matrix n n E) : G E s := |
| 222 | let u : Matrix n n E := V.formSkewPart (cayleyTransform (c.val • A)) |
| 223 | V.ratEmbed (if h : (1 + u).det ≠ 0 then |
| 224 | U.of V.isUnit_J (c.val⁻¹ • cayleyTransform u) |
| 225 | (V.smul_cayleyTransform_isometry c (V.conjTranspose_formSkewPart_mul _) h) |
| 226 | else 1) |
| 227 | |
| 228 | /-- For a ring map `φ : E →+* K` to a field and a matrix `M` over `K`, `1 + φ c • M` is |
| 229 | invertible for all but finitely many `c : unitary E`, as `-(φ c)⁻¹` avoids the finite spectrum of |
| 230 | `M`. -/ |
| 231 | private lemma eventually_det_one_add_smul_ne_zero {K : Type*} [Field K] (φ : E →+* K) |
| 232 | (M : Matrix n n K) : |
| 233 | ∀ᶠ c : unitary E in cofinite, (1 + φ c • M).det ≠ 0 := by |
| 234 | have off_spectrum : ∀ᶠ c : unitary E in cofinite, -(φ c)⁻¹ ∉ spectrum K M := |
| 235 | ((neg_injective.comp inv_injective).comp |
| 236 | (φ.injective.comp Subtype.val_injective)).tendsto_cofinite.eventually |
| 237 | M.finite_spectrum.eventually_cofinite_notMem |
| 238 | filter_upwards [off_spectrum] with c hc |
| 239 | have h_norm : φ (star c.val) * φ c = 1 := by rw [← map_mul, c.prop.left, map_one] |
| 240 | have hc_ne : φ c ≠ 0 := right_ne_zero_of_mul_eq_one h_norm |
| 241 | have h_eq : 1 + φ c • M = -φ c • (algebraMap K _ (-(φ c)⁻¹) - M) := by |
| 242 | simp [algebraMap_eq_smul_one, smul_sub, smul_smul, hc_ne] |
| 243 | rw [h_eq, det_smul] |
| 244 | simpa [hc_ne, isUnit_iff_isUnit_det] using spectrum.notMem_iff.1 hc |
| 245 | |
| 246 | /-- Under a ring map `φ : E →+* K`, the skew part of the Cayley transform of `c • A` depends only |
| 247 | on the images of `A` and `Aᴴ`. -/ |
| 248 | private lemma map_formSkewPart_cayleyTransform {K : Type*} [Field K] (φ : E →+* K) |
| 249 | (c : unitary E) (A : Matrix n n E) : |
| 250 | (V.formSkewPart (cayleyTransform (c.val • A))).map φ = |
| 251 | (2 : K)⁻¹ • (cayleyTransform (φ c • A.map φ) - |
| 252 | (V.J.map φ)⁻¹ * cayleyTransform (φ (star c.val) • Aᴴ.map φ) * V.J.map φ) := by |
| 253 | have h_star : (cayleyTransform (c.val • A))ᴴ = cayleyTransform (star c.val • Aᴴ) := by |
| 254 | rw [cayleyTransform_eq_inv_mul (star c.val • Aᴴ)] |
| 255 | simp [cayleyTransform, conjTranspose_nonsing_inv] |
| 256 | simp [formSkewPart, h_star, map_nonsing_inv, map_smul', Matrix.map_sub, Matrix.map_mul, |
| 257 | cayleyTransform_map, map_ofNat] |
| 258 | |
| 259 | /-- For `c : unitary E` with `1 + φ c • γ.map f` invertible (where `φ = f ∘ toAdele` and |
| 260 | `γ = V.toRatCoords g`), the images of the rational skew matrices |
| 261 | `V.formSkewPart (cayleyTransform (c • A))` tend to `cayleyTransform (φ c • γ.map f)` as `A + e • B` |
| 262 | tends to `γ`, provided `f` kills `e` and `star e`. -/ |
| 263 | private lemma tendsto_map_formSkewPart_cayleyTransform (g : G E s) (e : 𝔸 E) {K : Type*} |
| 264 | [NormedField K] (f : 𝔸 E →+* K) (hf : Continuous f) (hf_zero : f e = 0 ∧ f (star e) = 0) |
| 265 | (c : unitary E) |
| 266 | (h_det : (1 + (f.comp toAdele) c • (V.toRatCoords g : Matrix n n (𝔸 E)).map f).det ≠ 0) : |
| 267 | Tendsto (fun p : Matrix n n E × Matrix n n (𝔸 E) ↦ |
| 268 | (V.formSkewPart (cayleyTransform (c.val • p.1))).map (f.comp toAdele)) |
| 269 | (comap (fun p : Matrix n n E × Matrix n n (𝔸 E) ↦ p.1.map toAdele + e • p.2) |
| 270 | (𝓝 (V.toRatCoords g))) |
| 271 | (𝓝 (cayleyTransform ((f.comp toAdele) c • |
| 272 | (V.toRatCoords g : Matrix n n (𝔸 E)).map f))) := by |
| 273 | let φ : E →+* K := f.comp toAdele |
| 274 | let γ : Matrix n n (𝔸 E) := V.toRatCoords g |
| 275 | have h_norm : φ (star c.val) * φ c = 1 := by rw [← map_mul, c.prop.left, map_one] |
| 276 | have h_two : (2 : K) ≠ 0 := by simpa only [map_ofNat] using (map_ne_zero φ).2 two_ne_zero |
| 277 | let J : Matrix n n K := V.J.map φ |
| 278 | have hJ : J.det ≠ 0 := ((isUnit_iff_isUnit_det _).1 (V.isUnit_J.map φ.mapMatrix)).ne_zero |
| 279 | let C : Matrix n n K := cayleyTransform (φ c • γ.map f) |
| 280 | -- As `f` need not respect conjugation, the images of `A` and `Aᴴ` are two variables `x`, `y`. |
| 281 | let u (x y : Matrix n n K) : Matrix n n K := |
| 282 | (2 : K)⁻¹ • (cayleyTransform (φ c • x) - J⁻¹ * cayleyTransform (φ (star c.val) • y) * J) |
| 283 | have gram : φ (star c.val) • γᴴ.map f * J * φ c • γ.map f = J := by |
| 284 | have h_gram : γᴴ.map f * J * γ.map f = J := by |
| 285 | simpa [J, φ, γ, coe_comp, star_eq_conjTranspose] using |
| 286 | congrArg (map · f) (mem_unitaryGroupOf_iff.1 (V.toRatCoords g).prop) |
| 287 | simp [smul_smul, mul_comm (φ c), h_norm, h_gram] |
| 288 | obtain ⟨h_det_star, skew⟩ := cayleyTransform_mul_eq_neg gram hJ h_det |
| 289 | have u_value : u (γ.map f) (γᴴ.map f) = C := by |
| 290 | simp [u, C, Matrix.mul_assoc, skew, hJ, ← two_smul K, smul_smul, h_two] |
| 291 | have h_cont (A : Matrix n n K) (hA : (1 + A).det ≠ 0) : ContinuousAt cayleyTransform A := |
| 292 | continuousAt_cayleyTransform hA |
| 293 | have u_cont : ContinuousAt (fun x : Matrix n n (𝔸 E) ↦ u (x.map f) (xᴴ.map f)) γ := by |
| 294 | fun_prop (disch := assumption) |
| 295 | change Tendsto (fun p : Matrix n n E × Matrix n n (𝔸 E) ↦ |
| 296 | (V.formSkewPart (cayleyTransform (c.val • p.1))).map φ) |
| 297 | (comap (fun p ↦ p.1.map toAdele + e • p.2) (𝓝 γ)) (𝓝 C) |
| 298 | rw [← u_value] |
| 299 | refine (u_cont.tendsto.comp tendsto_comap).congr fun p ↦ ?_ |
| 300 | rw [V.map_formSkewPart_cayleyTransform φ c p.1] |
| 301 | simp [u, J, φ, conjTranspose_map_toAdele, map_smul', Matrix.map_add, hf_zero, coe_comp] |
| 302 | |
| 303 | /-- Let `V` be a hermitian space over the CM field `E`: a matrix `J` with a point `x` in `GL_n(𝔸)` |
| 304 | such that `xᴴ J x` is `diag s` at the infinite places and `1` at the finite places. Let `f` be a |
| 305 | continuous ring map from the adeles to a normed field that kills both the adele `e` and `star e`. |
| 306 | Then for all but finitely many `c` in `E` with `star c * c = 1`, the following holds: when |
| 307 | `A + e • B` tends to `V.toRatCoords g = x g x⁻¹`, with `A` rational (embedded diagonally by |
| 308 | `toAdele`) and `B` adelic, the adelic matrix of the rational point `V.cayleyMap c A` tends to that |
| 309 | of `g` after applying `f`. Here `V.cayleyMap c A` is `x⁻¹ c⁻¹ (1 - u) (1 + u)⁻¹ x`, where `u` is the |
| 310 | skew part of the Cayley transform of `c A`, and it is `1` if `1 + u` is not invertible. -/ |
| 311 | lemma eventually_tendsto_cayleyMap (g : G E s) (e : 𝔸 E) {K : Type*} [NormedField K] |
| 312 | (f : 𝔸 E →+* K) (hf : Continuous f) (hf_zero : f e = 0 ∧ f (star e) = 0) : |
| 313 | ∀ᶠ c : unitary E in cofinite, |
| 314 | Tendsto (fun p : Matrix n n E × Matrix n n (𝔸 E) ↦ (V.cayleyMap c p.1).adeleMatrix.map f) |
| 315 | (comap (fun p : Matrix n n E × Matrix n n (𝔸 E) ↦ p.1.map toAdele + e • p.2) |
| 316 | (𝓝 (V.toRatCoords g))) |
| 317 | (𝓝 (g.adeleMatrix.map f)) := by |
| 318 | -- Let `γ = V.toRatCoords g`, read through `f`, and take `c` with `1 + c γ` invertible. The Cayley |
| 319 | -- transform `C` of `c γ` is skew, so the rational skew matrices `v A` tend to `C`, and |
| 320 | -- `c⁻¹ (1 - v A) (1 + v A)⁻¹` tends to `γ`. |
| 321 | let φ : E →+* K := f.comp toAdele |
| 322 | let γ : Matrix n n (𝔸 E) := V.toRatCoords g |
| 323 | filter_upwards [eventually_det_one_add_smul_ne_zero φ (γ.map f)] with c h_det |
| 324 | have h_norm : φ (star c.val) * φ c = 1 := by rw [← map_mul, c.prop.left, map_one] |
| 325 | have hc_ne : φ c ≠ 0 := right_ne_zero_of_mul_eq_one h_norm |
| 326 | have h_two : (2 : K) ≠ 0 := by simpa only [map_ofNat] using (map_ne_zero φ).2 two_ne_zero |
| 327 | let C : Matrix n n K := cayleyTransform (φ c • γ.map f) |
| 328 | let v (A : Matrix n n E) : Matrix n n E := V.formSkewPart (cayleyTransform (c.val • A)) |
| 329 | obtain ⟨h_back, h_invol⟩ : (1 + C).det ≠ 0 ∧ cayleyTransform C = φ c • γ.map f := |
| 330 | cayleyTransform_cayleyTransform h_two h_det |
| 331 | have u_tendsto : Tendsto (fun p : Matrix n n E × Matrix n n (𝔸 E) ↦ (v p.1).map φ) |
| 332 | (comap (fun p ↦ p.1.map toAdele + e • p.2) (𝓝 γ)) (𝓝 C) := |
| 333 | V.tendsto_map_formSkewPart_cayleyTransform g e f hf hf_zero c h_det |
| 334 | -- Near `C` the matrix `1 + u` is invertible and the Cayley transform is continuous. |
| 335 | let Ψ (x : Matrix n n K) : Matrix n n K := |
| 336 | V.x⁻¹.val.map f * (φ c)⁻¹ • cayleyTransform x * V.x.val.map f |
| 337 | have value : Ψ C = g.adeleMatrix.map f := by |
| 338 | simp [Ψ, h_invol, hc_ne, γ, mul_assoc, ← Matrix.map_mul, toRatCoords, adeleMatrix] |
| 339 | have h_cont : ContinuousAt cayleyTransform C := continuousAt_cayleyTransform h_back |
| 340 | have Ψ_cont : ContinuousAt Ψ C := by fun_prop (disch := assumption) |
| 341 | have h_near : ∀ᶠ x in 𝓝 C, (1 + x).det ≠ 0 := ContinuousAt.eventually_ne (by fun_prop) h_back |
| 342 | rw [← value] |
| 343 | refine (Ψ_cont.tendsto.comp u_tendsto).congr' ((u_tendsto.eventually h_near).mono fun p hp ↦ ?_) |
| 344 | have h_rat : (1 + v p.1).det ≠ 0 := by rwa [← map_ne_zero φ, φ.map_det, map_add, map_one] |
| 345 | have h_map : (φ c)⁻¹ • cayleyTransform ((v p.1).map φ) = |
| 346 | (c.val⁻¹ • cayleyTransform (v p.1)).map φ := by simp [cayleyTransform_map, map_smul'] |
| 347 | simp only [Function.comp_apply, Ψ, v, h_map, cayleyMap, dite_eq_left h_rat, adeleMatrix_ratEmbed, |
| 348 | Matrix.map_mul] |
| 349 | rfl |
| 350 | |
| 351 | /-- For a finite set `T` of finite places, multiplying a finite adele `y` by the idempotent |
| 352 | `idem T` (component `1` on `T` and `0` elsewhere) gives the sum over `w ∈ T` of the adeles |
| 353 | `singleAdele w (evalAt w y)` with component `evalAt w y = y w` at `w` and `0` elsewhere. -/ |
| 354 | lemma _root_.New.idem_mul_eq_sum_singleAdele {T : Set (FinPlace E)} (hT : T.Finite) (y : 𝔸f E) : |
| 355 | idem T * y = ∑ w ∈ hT.toFinset, singleAdele w (evalAt w y) := by |
| 356 | classical |
| 357 | refine DFunLike.ext _ _ fun u ↦ ?_ |
| 358 | change evalAt u (idem T * y) = evalAt u (∑ w ∈ hT.toFinset, singleAdele w (evalAt w y)) |
| 359 | have h_single (w : FinPlace E) : singleAdele w (y w) u = if u = w then y u else 0 := by |
| 360 | obtain rfl | h := eq_or_ne u w <;> simp [*] |
| 361 | simp [h_single, idem_apply] |
| 362 | |
| 363 | /-- Convergence in `G` from convergence place by place: for an adele `a`, `a.1 w` is its component |
| 364 | at an infinite place and `evalAt w a.2` at a finite one. If the matrices of `x i` tend to the |
| 365 | matrix of `g` at every infinite place and at every place of the finite set `S` or conjugate to |
| 366 | one (`S.conjClosure`), then `x i` tends to `g` once the components at all other finite places are |
| 367 | replaced by `1` (`componentOn n S`). -/ |
| 368 | lemma _root_.New.G.tendsto_componentOn {S : Set (FinPlace E)} (hS : S.Finite) {ι : Type*} |
| 369 | {l : Filter ι} {x : ι → G E s} {g : G E s} |
| 370 | (h_inf : ∀ w : NumberField.InfinitePlace E, |
| 371 | Tendsto (fun i : ι ↦ (x i).adeleMatrix.map fun a : 𝔸 E ↦ a.1 w) l |
| 372 | (𝓝 (g.adeleMatrix.map fun a : 𝔸 E ↦ a.1 w))) |
| 373 | (h_fin : ∀ w ∈ S.conjClosure, |
| 374 | Tendsto (fun i : ι ↦ (x i).adeleMatrix.map fun a : 𝔸 E ↦ evalAt w a.2) l |
| 375 | (𝓝 (g.adeleMatrix.map fun a : 𝔸 E ↦ evalAt w a.2))) : |
| 376 | Tendsto (fun i : ι ↦ ((x i).1, componentOn n S (x i).2) : ι → G E s) l |
| 377 | (𝓝 (g.1, componentOn n S g.2)) := by |
| 378 | -- Matrices converge entry by entry. An entry converges at each infinite place by `h_inf`; its |
| 379 | -- finite part is cut down to the finitely many places of `S.conjClosure`, where `h_fin` applies. |
| 380 | let e : 𝔸f E := idem S.conjClosure |
| 381 | have h_entry_inf (j k : n) : Tendsto (fun i : ι ↦ ((x i).adeleMatrix j k).1) l |
| 382 | (𝓝 (g.adeleMatrix j k).1) := |
| 383 | tendsto_pi_nhds.2 fun w ↦ ((h_inf w).apply_nhds j).apply_nhds k |
| 384 | have h_entry_fin (j k : n) : |
| 385 | Tendsto (fun i : ι ↦ e * ((x i).adeleMatrix j k).2) l (𝓝 (e * (g.adeleMatrix j k).2)) := by |
| 386 | simp only [e, idem_mul_eq_sum_singleAdele hS.conjClosure] |
| 387 | refine tendsto_finsetSum _ fun w hw ↦ ((continuous_singleAdele w).tendsto _).comp ?_ |
| 388 | exact ((h_fin w (hS.conjClosure.mem_toFinset.1 hw)).apply_nhds j).apply_nhds k |
| 389 | rw [isClosedEmbedding_adeleMatrix.tendsto_nhds_iff] |
| 390 | refine tendsto_pi_nhds.2 fun j ↦ tendsto_pi_nhds.2 fun k ↦ ?_ |
| 391 | -- By definition `componentOn n S` is `m ↦ e • m + (1 - e) • 1`. |
| 392 | let b : 𝔸f E := ((1 - e) • 1 : Matrix n n (𝔸f E)) j k |
| 393 | change Tendsto (fun i : ι ↦ (((x i).adeleMatrix j k).1, e * ((x i).adeleMatrix j k).2 + b)) l |
| 394 | (𝓝 ((g.adeleMatrix j k).1, e * (g.adeleMatrix j k).2 + b)) |
| 395 | exact (h_entry_inf j k).prodMk_nhds ((h_entry_fin j k).add_const b) |
| 396 | |
| 397 | /-- Weak approximation. For a finite set `S` of finite places, the products `γ * (1, h)` are dense |
| 398 | in the adelic unitary group `G = G_∞ × G_f`, where `γ` runs over the rational points `V.Γ` and |
| 399 | `h` over the elements of `G_f` with component `1` at every place of `S`. So `V.Γ` is dense at |
| 400 | infinity and at the places of `S`. -/ |
| 401 | lemma weak_approximation {S : Set (FinPlace E)} (hS : S.Finite) : |
| 402 | DenseRange fun p : V.Γ × trivialOn n S ↦ (p.1 : G E s) * (1, (p.2 : Gf E n)) := by |
| 403 | -- By strong approximation, rational matrices `A` approach `V.toRatCoords g` at infinity and on |
| 404 | -- `S.conjClosure`, the places of `S` and their conjugates (along the filter `l`). For a suitable |
| 405 | -- `c` the rational points `V.cayleyMap c A` then tend to `g` at these places by |
| 406 | -- `eventually_tendsto_cayleyMap`; an element of `trivialOn n S` corrects the other components. |
| 407 | intro g |
| 408 | let e : 𝔸 E := idemAdele S.conjClosureᶜ |
| 409 | let approx (p : Matrix n n E × Matrix n n (𝔸 E)) : Matrix n n (𝔸 E) := p.1.map toAdele + e • p.2 |
| 410 | let l : Filter (Matrix n n E × Matrix n n (𝔸 E)) := comap approx (𝓝 (V.toRatCoords g)) |
| 411 | have h_dense : DenseRange approx := by |
| 412 | simpa [approx, e] using denseRange_rat_matrix_add hS.conjClosure.infinite_compl.nonempty |
| 413 | (1 : GL n (𝔸 E)) |
| 414 | have : l.NeBot := comap_neBot fun _ ↦ h_dense.mem_nhds |
| 415 | -- At each infinite place and each place of `S.conjClosure`, where `e` vanishes, all but |
| 416 | -- finitely many `c` give convergence along `l`; take one `c` for all of them. |
| 417 | have at_infinite : ∀ᶠ c : unitary E in cofinite, ∀ w : NumberField.InfinitePlace E, |
| 418 | Tendsto (fun p ↦ (V.cayleyMap c p.1).adeleMatrix.map fun a ↦ a.1 w) l |
| 419 | (𝓝 (g.adeleMatrix.map fun a ↦ a.1 w)) := |
| 420 | eventually_all.2 fun w ↦ V.eventually_tendsto_cayleyMap g e |
| 421 | ((Pi.evalRingHom _ w).comp (fst _ _)) (continuous_apply w).fst' (by simp [e]) |
| 422 | have at_finite : ∀ᶠ c : unitary E in cofinite, ∀ w ∈ S.conjClosure, |
| 423 | Tendsto (fun p ↦ (V.cayleyMap c p.1).adeleMatrix.map fun a ↦ evalAt w a.2) l |
| 424 | (𝓝 (g.adeleMatrix.map fun a ↦ evalAt w a.2)) := |
| 425 | (eventually_all_finite hS.conjClosure).2 fun w hw ↦ V.eventually_tendsto_cayleyMap g e |
| 426 | ((evalAt w).comp (snd _ _)) (continuous_evalAt w).snd' (by aesop (add norm simp e)) |
| 427 | obtain ⟨c, h_inf, h_fin⟩ := (at_infinite.and at_finite).exists |
| 428 | -- `π` keeps the components at infinity and on `S.conjClosure` and replaces the others by `1`. |
| 429 | let π : G E s →* G E s := (MonoidHom.id _).prodMap (componentOn n S) |
| 430 | have h_tendsto : Tendsto (fun p ↦ π (V.cayleyMap c p.1)) l (𝓝 (π g)) := |
| 431 | tendsto_componentOn hS h_inf h_fin |
| 432 | -- `g = π g * ((π g)⁻¹ * g)` is the limit of `π x * ((π g)⁻¹ * g)`, `x = V.cayleyMap c A`; this |
| 433 | -- differs from `x` only at finite places outside `S.conjClosure`. |
| 434 | rw [← mul_inv_cancel_left (π g) g] |
| 435 | refine mem_closure_of_tendsto (h_tendsto.mul_const _) (.of_forall fun p ↦ ?_) |
| 436 | set x : G E s := V.cayleyMap c p.1 |
| 437 | let h : Gf E n := (x⁻¹ * (π x * ((π g)⁻¹ * g))).2 |
| 438 | have h_triv : h ∈ trivialOn n S := by simp +contextual [h, π, atPlace_componentOn] |
| 439 | have h_eq : x * (1, h) = π x * ((π g)⁻¹ * g) := Prod.ext (by simp [π]) (by simp [h]) |
| 440 | -- `cayleyMap` is by definition in the range `V.Γ` of `V.ratEmbed`. |
| 441 | exact ⟨(⟨x, _, rfl⟩, ⟨h, h_triv⟩), h_eq⟩ |
| 442 | |
| 443 | end New.Space |