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.Order.Archimedean.Real.Hom |
| 4 | import TauCeti.NumberTheory.NumberField.Global.Ideles.FiniteOpenSubgroup |
| 5 | public import Mathlib.NumberTheory.NumberField.ClassNumber |
| 6 | import Mathlib.Topology.MetricSpace.Ultra.TotallySeparated |
| 7 | import TauCeti.RingTheory.DedekindDomain.FiniteAdeleRing.Topology |
| 8 | import TauCeti.Topology.Algebra.Group.Units |
| 9 | import TauCeti.RingTheory.DedekindDomain.FiniteAdeleRing.IntegralIdeal |
| 10 | public import Lib.General.Measure.HaarModulus |
| 11 | public import Lib.Adelic.Adeles.Basic |
| 12 | public import Lib.General.Topology |
| 13 | import Lib.General.Groups.ProfiniteCharacters |
| 14 | import TauCeti.RingTheory.DedekindDomain.FiniteAdeleRing.LocalUnits |
| 15 | |
| 16 | /-! |
| 17 | # Finite ideles, principal ideles and the class group; finite index of open subgroups |
| 18 | |
| 19 | The finite ideles of a number field `K` are the units `(𝔸f K)ˣ` of the finite adeles. They embed in |
| 20 | the units of the adeles `New.𝔸 K`, the pairs of a map `NumberField.InfinitePlace K → ℂ` and a finite |
| 21 | adele, with component `1` at the infinite places. `New.FinPlace K` is the set of finite places, and |
| 22 | `New.LocField v` is the completion at `v`. The file defines principal, local and S-unit ideles and |
| 23 | proves their basic properties. It then relates the finite ideles to fractional ideals and the class |
| 24 | group, and deduces that every open subgroup containing the totally positive elements of `Kˣ` has |
| 25 | finite index. |
| 26 | |
| 27 | ## Main definitions and results |
| 28 | |
| 29 | * `New.principalIdele`, `New.locIdele`, `New.ideleAt`: the principal idele of an element of `Kˣ`, |
| 30 | the idele with one given component and `1` elsewhere, and the component at a place. |
| 31 | * `New.idelesUnitOff`: the ideles that are units outside `S`; open (`New.isOpen_idelesUnitOff`), and |
| 32 | compact for `S = ∅` (`New.isCompact_idelesUnitOff_empty`). |
| 33 | * `New.ideleDivisor`: the canonical fractional ideal of a finite idele. |
| 34 | `New.ideleDivisor_le_one_iff` characterises integrality, `New.ker_ideleDivisor` identifies |
| 35 | the everywhere-integral units, and `New.ideleDivisor_uniformizer` gives the divisor of a |
| 36 | local uniformiser. |
| 37 | * `New.ker_finIdeleClassGroup`: the kernel of the class group map, given by `Kˣ` times these units. |
| 38 | * `New.exists_sup_idelesUnitOff_eq_top`: for a suitable finite `S`, every idele is a principal idele |
| 39 | times a unit outside `S`. |
| 40 | * `New.finiteIndex_idele_subgroup_of_isOpen`: an open subgroup that contains the totally positive |
| 41 | elements of `Kˣ` has finite index. |
| 42 | |
| 43 | Notions from other files: |
| 44 | * `New.Ô K`: the integral finite adeles, whose component at every place lies in its ring of |
| 45 | integers; `New.uniformizer w` is a chosen uniformiser of the completion at `w`. |
| 46 | * `S.unit K` (Mathlib): the `S`-units, the `x` in `Kˣ` of valuation `1` at every finite place |
| 47 | outside `S`. |
| 48 | |
| 49 | ## Relation to the literature |
| 50 | |
| 51 | Known; see `Lib.ClassField.Places.LocalFields` for sources. |
| 52 | -/ |
| 53 | |
| 54 | @[expose] public section |
| 55 | |
| 56 | noncomputable section |
| 57 | |
| 58 | /-! |
| 59 | ## Finite ideles: principal and local ideles, S-unit ideles, positivity |
| 60 | |
| 61 | `New.mem_of_locIdele_mem` uses `New.exists_finset_cover_mulSupport_ideleAt`, which follows from |
| 62 | the compactness of `New.idelesUnitOff ∅`. `New.eventually_unramified` follows from Tau Ceti's |
| 63 | `IsDedekindDomain.FiniteAdeleRing.eventually_unitsOfAdicCompletion_mem_of_isOpen`. |
| 64 | -/ |
| 65 | |
| 66 | section Ideles |
| 67 | |
| 68 | open IsDedekindDomain Set Units FiniteAdeleRing |
| 69 | |
| 70 | namespace New |
| 71 | |
| 72 | variable {K : Type*} [Field K] [NumberField K] |
| 73 | |
| 74 | /-! ### Principal ideles, local ideles, components and ideles that are units outside `S` -/ |
| 75 | |
| 76 | /-- The diagonal homomorphism from K^× to the finite ideles of K. -/ |
| 77 | abbrev principalIdele : Kˣ →* (𝔸f K)ˣ := map (algebraMap K (𝔸f K)).toMonoidHom |
| 78 | |
| 79 | variable (S : Set (FinPlace K)) (a : (𝔸f K)ˣ) (v : FinPlace K) |
| 80 | |
| 81 | /-- The homomorphism sending x ∈ K_v^× to the finite idele with component x at v and 1 |
| 82 | elsewhere. -/ |
| 83 | def locIdele : (LocField v)ˣ →* (𝔸f K)ˣ := unitsMapNonUnital (singleAdele v) |
| 84 | |
| 85 | /-- The homomorphism from the finite ideles of K to the units of `New.𝔸 K` sending a to (1, a), with |
| 86 | component 1 at every infinite place. -/ |
| 87 | abbrev finIdeleIncl : (𝔸f K)ˣ →* (𝔸 K)ˣ := |
| 88 | map (MonoidHom.inr (NumberField.InfinitePlace K → ℂ) (𝔸f K)) |
| 89 | |
| 90 | /-- For a finite place v, the homomorphism from K_v^× to the units of `New.𝔸 K` placing the element |
| 91 | at v and 1 at all other places, finite and infinite. -/ |
| 92 | def locFullIdele : (LocField v)ˣ →* (𝔸 K)ˣ := finIdeleIncl.comp (unitsMapNonUnital (singleAdele v)) |
| 93 | |
| 94 | /-- The homomorphism sending a finite idele to its component in K_v^×. -/ |
| 95 | def ideleAt : (𝔸f K)ˣ →* (LocField v)ˣ := map (evalAt v).toMonoidHom |
| 96 | |
| 97 | /-- The group of finite ideles of K whose components at all places outside S are units. -/ |
| 98 | def idelesUnitOff : Subgroup (𝔸f K)ˣ := ⨅ v ∉ S, ((map Valued.v.toMonoidHom).comp (ideleAt v)).ker |
| 99 | |
| 100 | @[simp] |
| 101 | lemma locIdele_apply_self (x : (LocField v)ˣ) : (locIdele v x).val v = x := by simp [locIdele] |
| 102 | |
| 103 | @[simp] |
| 104 | lemma ideleAt_locIdele (x : (LocField v)ˣ) : ideleAt v (locIdele v x) = x := |
| 105 | ext (locIdele_apply_self v x) |
| 106 | |
| 107 | @[fun_prop] |
| 108 | lemma continuous_ideleAt : Continuous (ideleAt v) := (continuous_evalAt v).units_map |
| 109 | |
| 110 | /-! ### First properties: membership, openness and compactness -/ |
| 111 | |
| 112 | /-- A finite idele `a` is a unit at all but finitely many places. -/ |
| 113 | lemma finite_setOf_valued_val_ne_one : {v : FinPlace K | Valued.v (a.val v) ≠ 1}.Finite := |
| 114 | unitsEquiv_finite_valued_eq_one a |
| 115 | |
| 116 | private lemma idelesUnitOff_eq_sIntegralUnits : |
| 117 | idelesUnitOff S = sIntegralUnits (NumberField.RingOfIntegers K) K S := by |
| 118 | ext a |
| 119 | simp [idelesUnitOff, ← val_inj, ideleAt] |
| 120 | |
| 121 | /-- The ideles that are units at every place are the units of the ring of integral adeles. -/ |
| 122 | lemma idelesUnitOff_empty : idelesUnitOff ∅ = (Ô K).units := by |
| 123 | rw [idelesUnitOff_eq_sIntegralUnits, sIntegralUnits_empty] |
| 124 | exact integralUnits_eq_units_integralAdeles (NumberField.RingOfIntegers K) K |
| 125 | |
| 126 | lemma isOpen_idelesUnitOff : (idelesUnitOff S).IsOpen := by |
| 127 | rw [idelesUnitOff_eq_sIntegralUnits] |
| 128 | exact TauCeti.isOpen_sIntegralUnits (NumberField.RingOfIntegers K) K S |
| 129 | |
| 130 | variable {S a v} {w : FinPlace K} |
| 131 | |
| 132 | @[simp] |
| 133 | lemma locIdele_apply_of_ne (h_ne : w ≠ v) (x : (LocField v)ˣ) : (locIdele v x).val w = 1 := by |
| 134 | simp_all [locIdele] |
| 135 | |
| 136 | @[simp] |
| 137 | lemma ideleAt_locIdele_of_ne (h_ne : w ≠ v) (x : (LocField v)ˣ) : ideleAt w (locIdele v x) = 1 := |
| 138 | ext (locIdele_apply_of_ne h_ne x) |
| 139 | |
| 140 | /-- The library construction of a local idele has the same components as `locIdele`. -/ |
| 141 | private lemma unitsOfAdicCompletion_eq_locIdele (v : FinPlace K) (x : (LocField v)ˣ) : |
| 142 | unitsOfAdicCompletion K v x = locIdele v x := by |
| 143 | apply Units.ext |
| 144 | ext w |
| 145 | by_cases hw : w = v |
| 146 | · subst w |
| 147 | simp |
| 148 | · simp [hw] |
| 149 | |
| 150 | /-- The product of ideles supported at individual places has the prescribed component on the |
| 151 | finite set of places, and component one outside it. -/ |
| 152 | lemma ideleAt_prod_locIdele [DecidableEq (FinPlace K)] (T : Finset (FinPlace K)) |
| 153 | (x : ∀ u : FinPlace K, (LocField u)ˣ) : |
| 154 | ideleAt w (∏ u ∈ T, locIdele u (x u)) = if w ∈ T then x w else 1 := by |
| 155 | rw [map_prod, Finset.prod_eq_ite _ fun u _ hu ↦ ideleAt_locIdele_of_ne hu.symm _] |
| 156 | simp |
| 157 | |
| 158 | @[simp] |
| 159 | lemma mem_idelesUnitOff : |
| 160 | a ∈ idelesUnitOff S ↔ ∀ v : FinPlace K, v ∉ S → Valued.v (a.val v) = 1 := by |
| 161 | rw [idelesUnitOff_eq_sIntegralUnits, mem_sIntegralUnits_iff] |
| 162 | |
| 163 | /-- Two finite ideles have the same valuations outside `S` exactly when their quotient is a |
| 164 | unit outside `S`. -/ |
| 165 | lemma div_mem_idelesUnitOff_iff {b : (𝔸f K)ˣ} : |
| 166 | a / b ∈ idelesUnitOff S ↔ |
| 167 | ∀ w : FinPlace K, w ∉ S → Valued.v (a.val w) = Valued.v (b.val w) := by |
| 168 | rw [mem_idelesUnitOff] |
| 169 | refine forall₂_congr fun w _ ↦ ?_ |
| 170 | change Valued.v (↑(ideleAt w (a / b)) : LocField w) = 1 ↔ |
| 171 | Valued.v (↑(ideleAt w a) : LocField w) = Valued.v (↑(ideleAt w b) : LocField w) |
| 172 | rw [map_div, Units.val_div_eq_div_val, map_div₀] |
| 173 | exact div_eq_one_iff_eq (by simp) |
| 174 | |
| 175 | lemma idelesUnitOff_mono {T : Set (FinPlace K)} (h_sub : S ⊆ T) : |
| 176 | idelesUnitOff S ≤ idelesUnitOff T := |
| 177 | biInf_mono fun _ hv ↦ Set.notMem_subset h_sub hv |
| 178 | |
| 179 | lemma isCompact_idelesUnitOff_empty : IsCompact (idelesUnitOff (K := K) ∅ : Set (𝔸f K)ˣ) := by |
| 180 | rw [idelesUnitOff_empty] |
| 181 | exact (Ô K).units_isCompact isCompact_Ô |
| 182 | |
| 183 | /-- The principal idele of `x` is a unit outside `S` exactly when `x` is an `S`-unit. -/ |
| 184 | lemma principalIdele_mem_idelesUnitOff {x : Kˣ} : |
| 185 | principalIdele x ∈ idelesUnitOff S ↔ x ∈ S.unit K := by |
| 186 | aesop |
| 187 | |
| 188 | /-! ### Approximating an idele by finitely many components -/ |
| 189 | |
| 190 | /-- For an open neighbourhood `U` of `1` there is a finite set `T` of places such that an idele |
| 191 | that is a unit everywhere and lies outside `U` has a component `≠ 1` at some place of `T`. |
| 192 | Equivalently, the ideles that are units everywhere and `1` on `T` lie in `U`. -/ |
| 193 | lemma exists_finset_cover_mulSupport_ideleAt {U : Set (𝔸f K)ˣ} (hU : IsOpen U) (h_one : 1 ∈ U) : |
| 194 | ∃ T : Finset (FinPlace K), |
| 195 | (idelesUnitOff ∅).carrier \ U ⊆ ⋃ v ∈ T, (ideleAt v).ker.carrierᶜ := by |
| 196 | -- the complement of `U` in the units is compact and avoids `1`, so finitely many of the open |
| 197 | -- sets `{a | ideleAt v a ≠ 1}` cover it |
| 198 | refine (isCompact_idelesUnitOff_empty.diff hU).elim_finite_subcover _ |
| 199 | (fun v ↦ (continuous_ideleAt v).isOpen_mulSupport) fun a ⟨_, ha_notMem⟩ ↦ ?_ |
| 200 | have ha_ne : a ≠ 1 := (ne_of_mem_of_not_mem h_one ha_notMem).symm |
| 201 | simpa [ideleAt, ← val_inj, DFunLike.ext_iff] using ha_ne |
| 202 | |
| 203 | /-- A closed subgroup H of the finite ideles contains a as soon as it contains, for every place |
| 204 | v, the idele with component a_v at v and 1 elsewhere. -/ |
| 205 | lemma mem_of_locIdele_mem {H : Subgroup (𝔸f K)ˣ} (hH : IsClosed H.carrier) |
| 206 | (ha : ∀ v : FinPlace K, locIdele v (ideleAt v a) ∈ H) : a ∈ H := by |
| 207 | classical |
| 208 | -- If `a ∉ H`, the set `a⁻¹ Hᶜ` is an open neighbourhood of `1`. It contains `a⁻¹ b`, where |
| 209 | -- `b ∈ H` is the product of the components of `a` at enough places; this says `b ∉ H`. |
| 210 | by_contra ha_notMem |
| 211 | -- An idele that is a unit everywhere and `1` at the places of `T` lies in `a⁻¹ Hᶜ`. |
| 212 | obtain ⟨T, hT⟩ : ∃ T : Finset (FinPlace K), |
| 213 | (idelesUnitOff ∅).carrier \ (fun x ↦ a⁻¹ * x) '' H.carrierᶜ ⊆ |
| 214 | ⋃ v ∈ T, (⇑(ideleAt v)).mulSupport := |
| 215 | exists_finset_cover_mulSupport_ideleAt (isOpenMap_mul_left a⁻¹ _ hH.isOpen_compl) |
| 216 | ⟨a, ha_notMem, inv_mul_cancel a⟩ |
| 217 | -- Enlarge `T` by the places where `a` is not a unit. |
| 218 | set T' : Finset (FinPlace K) := T ∪ (finite_setOf_valued_val_ne_one a).toFinset with hT' |
| 219 | set b : (𝔸f K)ˣ := ∏ v ∈ T', locIdele v (ideleAt v a) with hb |
| 220 | have hb_mem : b ∈ H := prod_mem fun v _ ↦ ha v |
| 221 | have hb_at (w : FinPlace K) : ideleAt w b = if w ∈ T' then ideleAt w a else 1 := |
| 222 | ideleAt_prod_locIdele T' fun v ↦ ideleAt v a |
| 223 | -- `a⁻¹ b` is `1` on `T'` and equals `a⁻¹`, a unit, elsewhere. |
| 224 | have h_unit : a⁻¹ * b ∈ idelesUnitOff ∅ := by aesop (add simp [idelesUnitOff, hb_at, hT']) |
| 225 | have h_notMem : a⁻¹ * b ∉ (fun x ↦ a⁻¹ * x) '' H.carrierᶜ := by simpa using hb_mem |
| 226 | obtain ⟨v, hv, hv_ne⟩ : ∃ v ∈ T, ideleAt v (a⁻¹ * b) ≠ 1 := by simpa using hT ⟨h_unit, h_notMem⟩ |
| 227 | have h_one : ideleAt v (a⁻¹ * b) = 1 := by simp [hb_at, hT', hv] |
| 228 | exact hv_ne h_one |
| 229 | |
| 230 | /-- The idele with component `x` at `v` and `1` elsewhere is a unit outside any `S` when `x` is a |
| 231 | unit of the integers at `v`. -/ |
| 232 | lemma locIdele_mem_idelesUnitOff {x : (LocField v)ˣ} (hx_unit : Valued.v x.val = 1) |
| 233 | {S : Set (FinPlace K)} : locIdele v x ∈ idelesUnitOff S := by |
| 234 | simp_all [← and_forall_ne v] |
| 235 | |
| 236 | /-- A homomorphism ψ with open kernel from the finite ideles of K to a commutative group is |
| 237 | trivial on the local units at all but finitely many finite places. -/ |
| 238 | lemma eventually_unramified {C : Type*} [CommGroup C] (ψ : (𝔸f K)ˣ →* C) (h_open : ψ.ker.IsOpen) : |
| 239 | ∀ᶠ v : FinPlace K in Filter.cofinite, |
| 240 | ∀ x : (LocField v)ˣ, Valued.v x.val = 1 → ψ (locIdele v x) = 1 := by |
| 241 | -- The open kernel contains the local units at almost every place. |
| 242 | simpa only [unitsOfAdicCompletion_eq_locIdele, MonoidHom.mem_ker] using |
| 243 | eventually_unitsOfAdicCompletion_mem_of_isOpen (H := ψ.ker) h_open |
| 244 | |
| 245 | /-! ### Totally positive elements -/ |
| 246 | |
| 247 | /-- An element x of K is totally positive if φ(x) > 0 for every ring homomorphism φ : K → ℝ. -/ |
| 248 | def IsTotallyPositive (x : K) : Prop := ∀ φ : K →+* ℝ, 0 < φ x |
| 249 | |
| 250 | end New |
| 251 | |
| 252 | end Ideles |
| 253 | |
| 254 | /-! |
| 255 | ## Ideles, fractional ideals and the class group |
| 256 | |
| 257 | Here `v` is `Valued.v`, the multiplicative valuation of a completion, so the order of an element |
| 258 | at a place is `-log (v _)`. |
| 259 | -/ |
| 260 | |
| 261 | section IdeleClasses |
| 262 | |
| 263 | open NumberField IsDedekindDomain FractionalIdeal WithZero Subgroup ClassGroup HeightOneSpectrum |
| 264 | Function Units FiniteAdeleRing Valued |
| 265 | |
| 266 | namespace New |
| 267 | |
| 268 | variable {K : Type*} [Field K] [NumberField K] {R S : Set (FinPlace K)} |
| 269 | |
| 270 | attribute [-simp] WithZero.inv_exp |
| 271 | attribute [local simp] WithZero.exp_neg |
| 272 | |
| 273 | /-- The fractional ideal of a finite idele. -/ |
| 274 | @[no_expose] def ideleDivisor : (𝔸f K)ˣ →* (FractionalIdeal (nonZeroDivisors (𝓞 K)) K)ˣ := |
| 275 | toFractionalIdeal |
| 276 | |
| 277 | /-- A finite idele has integral divisor exactly when it is integral at every place. -/ |
| 278 | lemma ideleDivisor_le_one_iff (x : (𝔸f K)ˣ) : (ideleDivisor x).val ≤ 1 ↔ x.val ∈ Ô K := |
| 279 | toFractionalIdeal_le_one_iff x |
| 280 | |
| 281 | /-- The divisor map has kernel the everywhere-integral units. -/ |
| 282 | lemma ker_ideleDivisor : (ideleDivisor (K := K)).ker = idelesUnitOff ∅ := by |
| 283 | rw [ideleDivisor, ker_toFractionalIdeal, integralUnits_eq_units_integralAdeles, |
| 284 | idelesUnitOff_empty] |
| 285 | rfl |
| 286 | |
| 287 | /-- A local uniformiser has divisor the corresponding prime ideal. -/ |
| 288 | lemma ideleDivisor_uniformizer (w : FinPlace K) : |
| 289 | ideleDivisor (locIdele w (uniformizer w)) = |
| 290 | FractionalIdeal.mk0 K ⟨w.asIdeal, mem_nonZeroDivisors_of_ne_zero w.ne_bot⟩ := by |
| 291 | rw [ideleDivisor, ← unitsOfAdicCompletion_eq_locIdele, |
| 292 | toFractionalIdeal_unitsOfAdicCompletion_of_valued_eq_exp_neg_one w (v_uniformizer w)] |
| 293 | exact Units.ext (HeightOneSpectrum.coe_unitOfPrime w K) |
| 294 | |
| 295 | /-- The ideal class attached to a finite idele. -/ |
| 296 | @[no_expose] |
| 297 | def finIdeleClassGroup : (𝔸f K)ˣ →* ClassGroup (𝓞 K) := toClassGroup (𝓞 K) K |
| 298 | |
| 299 | /-- The kernel of the finite-idele class group map is generated by the principal ideles and the |
| 300 | everywhere-integral units. -/ |
| 301 | lemma ker_finIdeleClassGroup : |
| 302 | (finIdeleClassGroup (K := K)).ker = principalIdele.range ⊔ idelesUnitOff ∅ := by |
| 303 | rw [finIdeleClassGroup, ker_toClassGroup, integralUnits_eq_units_integralAdeles, |
| 304 | idelesUnitOff_empty, sup_comm] |
| 305 | rfl |
| 306 | |
| 307 | /-- For every finite idele a of K, the power a^h, with h the class number of K, is a principal |
| 308 | idele times an idele that is a unit at every prime. -/ |
| 309 | lemma pow_classNumber_mem_principal_sup (a : (𝔸f K)ˣ) : |
| 310 | a ^ classNumber K ∈ principalIdele.range ⊔ idelesUnitOff ∅ := by |
| 311 | -- The class of `a` has order dividing the class number. |
| 312 | rw [← ker_finIdeleClassGroup, MonoidHom.mem_ker, map_pow] |
| 313 | exact pow_card_eq_one |
| 314 | |
| 315 | /-- For finite sets `R`, `R'` of finite places there is a finite set `T` that contains `R`, meets |
| 316 | `R'` only inside `R`, and is such that every finite idele is a principal idele times an idele |
| 317 | that is a unit outside `T`. -/ |
| 318 | lemma exists_sup_idelesUnitOff_eq_top (hR : R.Finite) (R' : Set (FinPlace K)) (hR' : R'.Finite) : |
| 319 | ∃ T : Set (FinPlace K), T.Finite ∧ R ⊆ T ∧ (∀ v ∈ R', v ∈ T → v ∈ R) ∧ |
| 320 | principalIdele.range ⊔ idelesUnitOff T = ⊤ := by |
| 321 | obtain ⟨T, hT, hRT, hTR', h_sup⟩ := |
| 322 | exists_finite_sIntegralUnits_sup_range_unitEmbedding_eq_top K hR hR' |
| 323 | refine ⟨T, hT, hRT, fun v hvR' hvT ↦ hTR' ⟨hvT, hvR'⟩, ?_⟩ |
| 324 | rw [idelesUnitOff_eq_sIntegralUnits, sup_comm] |
| 325 | exact h_sup |
| 326 | |
| 327 | /-- Every finite set of places `R` lies in a finite set `S` such that every finite idele is a |
| 328 | principal idele times an idele that is a unit outside `S`. -/ |
| 329 | lemma exists_superset_sup_idelesUnitOff_eq_top (hR : R.Finite) : |
| 330 | ∃ S : Set (FinPlace K), S.Finite ∧ R ⊆ S ∧ principalIdele.range ⊔ idelesUnitOff S = ⊤ := by |
| 331 | obtain ⟨S, hS, hRS, -, h_sup⟩ := exists_sup_idelesUnitOff_eq_top hR ∅ Set.finite_empty |
| 332 | exact ⟨S, hS, hRS, h_sup⟩ |
| 333 | |
| 334 | /-- An open subgroup `H` of the finite ideles that contains the principal ideles of the totally |
| 335 | positive elements of `Kˣ` has finite index. -/ |
| 336 | lemma finiteIndex_idele_subgroup_of_isOpen (H : Subgroup (𝔸f K)ˣ) (h_open : H.IsOpen) |
| 337 | (h_pos : ∀ x : Kˣ, IsTotallyPositive x.val → principalIdele x ∈ H) : H.FiniteIndex := by |
| 338 | refine NumberField.finiteIndex_of_isOpen_of_totallyPositiveUnits_le h_open fun x hx ↦ ?_ |
| 339 | apply h_pos x |
| 340 | intro φ |
| 341 | -- The image under the real embedding is positive at the standard real place of `ℝ`. |
| 342 | have hw : (InfinitePlace.mk Complex.ofRealHom).IsReal := |
| 343 | InfinitePlace.isReal_mk_iff.mpr (by ext t; simp) |
| 344 | have h_positive := (NumberField.mem_totallyPositiveUnits.mp hx).map φ |
| 345 | simpa only [Real.ringHom_apply] using NumberField.isTotallyPositive_iff.mp h_positive _ hw |
| 346 | |
| 347 | /-- The finite ideles form a nonarchimedean group: they have the compact open subgroup |
| 348 | `idelesUnitOff ∅`. -/ |
| 349 | instance : NonarchimedeanGroup (𝔸f K)ˣ := |
| 350 | -- The open subgroup `idelesUnitOff ∅` is compact and totally disconnected, hence nonarchimedean. |
| 351 | -- The ideles map continuously and injectively to the product of the completions, which is |
| 352 | -- totally disconnected. |
| 353 | have h_inj : Function.Injective fun (a : (𝔸f K)ˣ) (w : FinPlace K) ↦ a.val w := by aesop_cat |
| 354 | have h_disconnected : TotallyDisconnectedSpace (𝔸f K)ˣ := |
| 355 | ⟨fun s _ h ↦ |
| 356 | s.subsingleton_of_image h_inj (h.image (fun a w ↦ a.val w) (by fun_prop)).subsingleton⟩ |
| 357 | have h_compact : CompactSpace (idelesUnitOff (∅ : Set (FinPlace K))) := |
| 358 | isCompact_iff_compactSpace.mp isCompact_idelesUnitOff_empty |
| 359 | .nonarchimedean_of_emb (idelesUnitOff ∅).subtype |
| 360 | (isOpen_idelesUnitOff ∅).isOpenEmbedding_subtypeVal |
| 361 | |
| 362 | end New |
| 363 | |
| 364 | end IdeleClasses |
| 365 | |
| 366 | end |