module public import TauCeti.Algebra.AddCircle public import Mathlib.Analysis.SpecialFunctions.Complex.CircleAddChar public import Mathlib.Topology.Instances.ZMod public import TauCeti.Analysis.SpecialFunctions.Complex.Circle.Basic import Mathlib.GroupTheory.FiniteAbelian.Duality import Mathlib.RingTheory.SimpleRing.Principal import Mathlib.Topology.Compactness.Paracompact import Mathlib.Topology.Connected.Separation import Mathlib.Topology.Separation.CompletelyRegular import Mathlib.Topology.Separation.Connected public import Lib.ClassField.GaloisCohomology.ContinuousCocycles public import Lib.General.Topology import TauCeti.Algebra.Module.CharacterModule import TauCeti.Topology.Algebra.ContinuousMonoidHom.Basic /-! # ℚ/ℤ, characters of profinite groups, and extension of homomorphisms `New.QZ` is `ℚ/ℤ` with the discrete topology, and a character of a profinite group `G` (`New.QZChar G`) is a continuous homomorphism `G → ℚ/ℤ`. The file first proves elementary facts: the exponential embedding of `ℚ/ℤ` into `ℂˣ`, the embedding of `ZMod n` into `ℚ/ℤ`, extension of homomorphisms into divisible groups, and equality of the orders of a finite abelian group and its dual. It then shows that characters separate points of the topological abelianisation of `G`, and that additive maps from characters to `ℚ/ℤ` are evaluations at its points; these facts are used to build Artin maps from their values on characters. `New.QZChar.abelianLift χ` denotes the map induced by `χ` on the abelianisation, with values written multiplicatively. ## Main definitions and results * `New.QZ.exists_extend`: for abelian groups, homomorphisms to a divisible group extend along any homomorphism whose kernel they kill. * `New.exists_zmod_log_of_dvd_orderOf`: logarithms modulo divisors of a cyclic generator’s order. * `New.card_hom_QZ`: a finite abelian group and its dual have the same order. * `New.QZChar.mem_of_forall_abelianLift`, `New.QZChar.abelianization_ext`: characters separate a point from a closed subgroup of the abelianisation, and hence separate points. * `New.QZChar.exists_hom_abelianLift_eq`: every additive map from characters to `ℚ/ℤ` is evaluation at a point of the abelianisation, in a form that is multiplicative in a parameter. * `New.QZChar.continuous_iff_forall_isOpen_ker_comp`: a homomorphism from a commutative topological group to the abelianisation is continuous exactly when its composite with each character has open kernel. * `New.exists_monoidHom_extend`, deduced from `New.QZ.exists_extend`: a homomorphism `θ` from a commutative group into a divisible commutative group, trivial on the preimage of a subgroup `H` under a homomorphism `f` of commutative groups, factors through `f` by a homomorphism trivial on `H`. Notions from other files: * `New.Z1 ρ`: the continuous 1-cocycles of `ρ`, that is the continuous `f : G → M` with `f (g h) = f g + ρ g (f h)`; `New.QZChar G` is the case of the trivial action on `ℚ/ℤ`. * `New.QZChar.toHom χ`: the character `χ` as a group homomorphism to `ℚ/ℤ` written multiplicatively; `New.QZChar.ker χ` is its kernel. -/ @[expose] public section noncomputable section /-! ## ℚ/ℤ, embeddings of ZMod n and duals of finite abelian groups -/ section RatModInt open Nat Function QuotientAddGroup AddCircle CharacterModule ZMod NeZero AddMonoidHom AddMonoid variable {n : ℕ} {G A B W : Type*} [Group G] [TopologicalSpace G] [IsTopologicalGroup G] [AddCommGroup A] [AddCommGroup B] [AddCommGroup W] namespace New.QZ /-- Every element of `ℚ/ℤ` has finite order. -/ lemma isAddTorsion : IsAddTorsion QZ := AddCircle.isAddTorsion_rat (p := (1 : ℚ)) /-- Every element of `ℚ/ℤ` is the class of a rational number. -/ lemma mk_surjective : Surjective mk := mk'_surjective (AddSubgroup.zmultiples 1) /-- The group homomorphism from `ℚ/ℤ`, written multiplicatively, to `ℂˣ` sending the class of `x` to `exp (2 π i x)`. -/ def expUnit : Multiplicative QZ →* ℂˣ := TauCeti.expCircle.toMonoidHom.toHomUnits /-- The homomorphism `expUnit : x ↦ exp (2 π i x)` from `ℚ/ℤ` to `ℂˣ` has trivial kernel. -/ lemma expUnit_eq_one_iff {a : Multiplicative QZ} : expUnit a = 1 ↔ a = 1 := Units.ext_iff.trans (TauCeti.expCircle_eq_one_iff (x := a.toAdd)) /-- Let `A`, `B` and `W` be abelian groups with `W` divisible and `f : A →+ B` a homomorphism, not necessarily injective. Every homomorphism `u : A →+ W` that kills the kernel of `f` is equal to `v ∘ f` for some homomorphism `v : B →+ W`. -/ lemma exists_extend [DivisibleBy W ℤ] (f : A →+ B) (u : A →+ W) (h_ker : f.ker ≤ u.ker) : ∃ v : B →+ W, ∀ a : A, v (f a) = u a := by -- A divisible group is injective, so the map induced by `u` on `A ⧸ ker f` extends to `B`. obtain ⟨v, hv⟩ : ∃ v : B →+ W, v.comp (kerLift f) = QuotientAddGroup.lift f.ker u h_ker := (Module.Baer.of_divisible W).extension_property_addMonoidHom _ (kerLift_injective f) _ exact ⟨v, fun a ↦ DFunLike.congr_fun hv (a : A ⧸ f.ker)⟩ /-- An element of an abelian group that is killed by every homomorphism to `ℚ/ℤ` is zero. -/ lemma eq_zero_of_forall_hom_eq_zero {a : A} (h_eval : ∀ u : A →+ QZ, u a = 0) : a = 0 := eq_zero_of_character_apply h_eval /-! ### The embedding of `ZMod n` -/ /-- The additive homomorphism `ℤ/n → ℚ/ℤ` sending the class of `k` to the class of `k / n`. For `n = 0`, this is the zero homomorphism. -/ def ofZMod (n : ℕ) : ZMod n →+ QZ := ZMod.toRatAddCircle n /-- The map `ofZMod n` sends a residue `b` to the class in `ℚ/ℤ` of `b.val / n`. For `n ≠ 0`, `b.val` is the representative of `b` below `n`. -/ lemma ofZMod_apply (b : ZMod n) : ofZMod n b = mk (b.val / n) := ZMod.toRatAddCircle_apply n b variable [NeZero n] @[simp] lemma ofZMod_injective : Injective (ofZMod n) := ZMod.toRatAddCircle_injective n /-- An element of `ℚ/ℤ` killed by `n` is in the image of the embedding `ofZMod n` of `ℤ/n`. -/ lemma exists_ofZMod {a : QZ} (ha : n • a = 0) : ∃ b : ZMod n, ofZMod n b = a := ZMod.exists_toRatAddCircle_eq_of_nsmul_eq_zero n ha /-- If `A` is killed by `n`, composing with `New.QZ.ofZMod n` is a bijection from the homomorphisms `A →+ ZMod n` to the homomorphisms `A →+ ℚ/ℤ`. -/ lemma bijective_ofZMod_comp (h_exp : ∀ a : A, n • a = 0) : Bijective ((ofZMod n).comp (M := A)) := by refine ⟨fun g g' h ↦ (cancel_left ofZMod_injective).1 h, fun f ↦ ?_⟩ -- Each value `f a` is killed by `n`, so it is `ofZMod n (g a)` for some `g a`. have h_lift (a : A) : ∃ b : ZMod n, ofZMod n b = f a := exists_ofZMod (by rw [← map_nsmul, h_exp, map_zero]) choose g hg using h_lift -- `g` is additive because `ofZMod n` is injective. have h_add (a b : A) : g (a + b) = g a + g b := ofZMod_injective (by simp [hg]) exact ⟨.mk' g h_add, ext hg⟩ end QZ /-! ### Discrete logarithms for cyclic groups -/ open Multiplicative in /-- If a group `G` is generated by `g` and `m` divides the order of `g`, there is a discrete logarithm modulo `m`, a group homomorphism to `ℤ/m` that sends `g` to `1`. The group may be infinite cyclic, in which case `orderOf g = 0`. -/ lemma exists_zmod_log_of_dvd_orderOf {G : Type*} [Group G] {m : ℕ} {g : G} (h_gen : ∀ x : G, x ∈ Subgroup.zpowers g) (h_dvd : m ∣ orderOf g) : ∃ log : G →* Multiplicative (ZMod m), log g = ofAdd 1 := by have h_order : orderOf (ofAdd (1 : ZMod m)) ∣ orderOf g := by simpa using h_dvd exact ⟨monoidHomOfForallMemZpowers h_gen h_order, monoidHomOfForallMemZpowers_apply_gen h_gen h_order⟩ variable (A) /-! ### Duals of finite abelian groups -/ /-- An abelian group `A` has `Nat.card (A →+ ℚ/ℤ) = Nat.card A` (for infinite `A`, both sides are `0`). -/ @[simp] lemma card_hom_QZ : Nat.card (A →+ QZ) = Nat.card A := TauCeti.natCard_characterModule A instance [Finite A] : Finite (A →+ QZ) := inferInstanceAs (Finite (CharacterModule A)) end New end RatModInt /-! ## Characters of a profinite group and its abelianisation -/ namespace New open Nat Subgroup Fact QuotientGroup MonoidHom QZ DFunLike variable {G C : Type*} [Group G] [CommGroup C] [TopologicalSpace G] [IsTopologicalGroup G] attribute [instance] isClosed_topologicalClosure namespace QZChar /-- The additive map sending a continuous 1-cocycle of `G` with values in `ℤ/n` (trivial action) to the character `G → ℚ/ℤ` obtained by composing with the map `ofZMod n`, which is zero when `n = 0`. -/ noncomputable abbrev ofZModCocycle (n : ℕ) : Z1 (Representation.trivial ℤ G (ZMod n)) →+ QZChar G := pairMapZ1 (ContinuousMonoidHom.id G) (ofZMod n).toIntLinearMap omit [IsTopologicalGroup G] in lemma continuous_val (χ : QZChar G) : Continuous χ.val := χ.prop.1 instance (χ : QZChar G) : Fact (toHom χ).ker.IsOpen := ⟨(continuous_val χ).isOpen_preimage {0} (isOpen_discrete _)⟩ @[simp] theorem abelianLift_mk (χ : QZChar G) (g : G) : abelianLift χ g = Multiplicative.ofAdd (χ.val g) := rfl @[fun_prop] lemma continuous_abelianLift (χ : QZChar G) : Continuous (abelianLift χ) := (continuous_val χ).quotient_lift _ omit [IsTopologicalGroup G] in /-- The kernel of a character `χ : G → ℚ/ℤ` is open. -/ lemma isOpen_ker (χ : QZChar G) : (ker χ).IsOpen := out omit [IsTopologicalGroup G] in /-- Let `G` be a nonarchimedean group and `f : G →* C` a homomorphism to a commutative group with closed kernel. If `σ` is not in the kernel, some continuous character of `G` vanishes on the kernel but not at `σ`. -/ lemma exists_apply_ne_zero_of_notMem_ker [NonarchimedeanGroup G] (f : G →* C) (σ : G) (hf : IsClosed (f.ker : Set G)) (hσ : σ ∉ f.ker) : ∃ χ : QZChar G, (∀ g ∈ f.ker, χ.val g = 0) ∧ χ.val σ ≠ 0 := by -- An open subgroup `V` with `σ * V` disjoint from the closed set `f.ker`. obtain ⟨V, hV⟩ : ∃ V : OpenSubgroup G, (V : Set G) ⊆ (fun g ↦ σ * g) ⁻¹' (f.ker : Set G)ᶜ := NonarchimedeanGroup.is_nonarchimedean _ ((map_mul_left_nhds_one σ).le (hf.compl_mem_nhds hσ)) -- So `f σ` is not in `f V`, and a homomorphism `u` from `C ⧸ f V` to `QZ` detects it. let π : C →* C ⧸ V.map f := mk' (V.map f) have h_ne : Additive.ofMul (π (f σ)) ≠ 0 := by intro h_zero obtain ⟨g, hg, hfg⟩ : ∃ g ∈ V, f g = f σ := (QuotientGroup.eq_one_iff (f σ)).1 h_zero exact hV (V.inv_mem hg) (by simp [hfg] : σ * g⁻¹ ∈ f.ker) obtain ⟨u, hu⟩ : ∃ u : Additive (C ⧸ V.map f) →+ QZ, u (.ofMul (π (f σ))) ≠ 0 := not_forall.1 (mt eq_zero_of_forall_hom_eq_zero h_ne) -- Pulled back to `G`, the map `u` kills `V`, hence is continuous. let ψ : G →* Multiplicative QZ := (u.toMultiplicativeRight.comp π).comp f have h_le : V.toSubgroup ≤ ψ.ker := by intro g hg have h_one : π (f g) = 1 := (QuotientGroup.eq_one_iff (f g)).2 (mem_map_of_mem f hg) simp [ψ, h_one] have h_cont : Continuous ψ := ψ.continuous_of_isOpen_ker (isOpen_mono h_le V.isOpen) let χ : QZChar G := ⟨fun g ↦ (ψ g).toAdd, continuous_toAdd.comp h_cont, by simp⟩ have χ_apply (g : G) : χ.val g = u (.ofMul (π (f g))) := rfl exact ⟨χ, fun g hg ↦ by simp [χ_apply, mem_ker.1 hg], by rwa [χ_apply]⟩ variable [CompactSpace G] /-- A character `χ : G → ℚ/ℤ` of a compact group has finite order: it is killed by the index of its open kernel. -/ lemma isOfFinAddOrder_of_compactSpace (χ : QZChar G) : IsOfFinAddOrder χ := by have h_fin : Finite (G ⧸ ker χ) := quotient_finite_of_isOpen (ker χ) (isOpen_ker χ) refine isOfFinAddOrder_iff_nsmul_eq_zero.2 ⟨(ker χ).index, Nat.pos_of_ne_zero index_ne_zero_of_finite, ?_⟩ ext g change (ker χ).index • (toHom χ g).toAdd = 0 rw [← _root_.toAdd_pow, ← map_pow, toAdd_eq_zero, ← mem_ker] exact (ker χ).pow_index_mem g /-- Let `G` be a compact group and `t` an additive map from the characters `G → ℚ/ℤ` to `ℚ/ℤ`. On a finite set `S` of characters, `t` is evaluation at some point of `G`. -/ lemma exists_eval_eq_on_finset (t : QZChar G →+ QZ) (S : Finset (QZChar G)) : ∃ g : G, ∀ χ ∈ S, χ.val g = t χ := by -- Characters have finite order, so `S` generates a finite group `T`. let T : AddSubgroup (QZChar G) := AddSubgroup.closure (S : Set (QZChar G)) have h_fin : Finite T := AddCommGroup.finite_of_fg_isAddTorsion T fun χ ↦ T.subtype_injective.isOfFinAddOrder_iff.1 (isOfFinAddOrder_of_compactSpace χ.val) -- `E` is the group of the homomorphisms `T →+ QZ` that are evaluation at a point of `G`. let pair : QZChar G →+ Additive G →+ QZ := .mk' (fun χ ↦ toAdditiveLeft (toHom χ)) fun _ _ ↦ rfl let ev : Additive G →+ T →+ QZ := (pair.domRestrict T).flip let E : AddSubgroup (T →+ QZ) := ev.range -- Evaluations separate characters, so `T` embeds in the dual of `E`. As a finite group and -- its dual have the same order, `E` is all of the dual of `T`. have h_inj : Function.Injective (E.subtype.flip : T →+ E →+ QZ) := by intro χ ψ h_eq ext g change ev (.ofMul g) χ = ev (.ofMul g) ψ exact DFunLike.congr_fun h_eq (ev.rangeRestrict (.ofMul g)) have h_card : Nat.card (T →+ QZ) ≤ Nat.card E := calc Nat.card (T →+ QZ) = Nat.card T := card_hom_QZ T _ ≤ Nat.card (E →+ QZ) := card_le_card_of_injective _ h_inj _ = Nat.card E := card_hom_QZ E obtain ⟨g, hg⟩ : ∃ g : Additive G, ev g = t.domRestrict T := AddMonoidHom.range_eq_top.1 (E.eq_top_of_le_card h_card) _ exact ⟨g.toMul, fun χ hχ ↦ DFunLike.congr_fun hg ⟨χ, AddSubgroup.subset_closure hχ⟩⟩ /-- For a compact group `G`, an additive map `t` from the characters `G → ℚ/ℤ` to `ℚ/ℤ` is evaluation at some point of `G`. -/ lemma exists_eval_eq (t : QZChar G →+ QZ) : ∃ g : G, ∀ χ : QZChar G, χ.val g = t χ := by -- These are closed conditions on a compact space, and finitely many of them can be met. have h_nonempty : (⋂ χ : QZChar G, {g : G | χ.val g = t χ}).Nonempty := CompactSpace.iInter_nonempty (fun χ ↦ isClosed_eq (continuous_val χ) continuous_const) fun S ↦ by simpa [Set.Nonempty] using exists_eval_eq_on_finset t S simpa [Set.Nonempty] using h_nonempty variable [TotallyDisconnectedSpace G] instance : NonarchimedeanGroup G where -- The clopen neighbourhoods of `1` form a basis, and each of them contains an open subgroup. is_nonarchimedean U hU := by obtain ⟨W, ⟨h_clopen, h_one⟩, hWU⟩ := (nhds_basis_isClopen (1 : G)).mem_iff.1 hU obtain ⟨V, hVW⟩ := IsTopologicalGroup.exist_openSubgroup_sub_clopen_nhds_of_one h_clopen h_one exact ⟨V, hVW.trans hWU⟩ /-! ### Duality for profinite groups -/ /-- Let `G` be profinite and `H` a closed subgroup of its topological abelianisation. An element `σ` of the abelianisation lies in `H` if it is killed by every character `χ : G → ℚ/ℤ` that kills `H`; here `abelianLift χ` is the map induced by `χ` on the abelianisation. -/ lemma mem_of_forall_abelianLift {H : Subgroup (TopologicalAbelianization G)} (hH : IsClosed H.carrier) (σ : TopologicalAbelianization G) (hσ : ∀ χ : QZChar G, (∀ g ∈ H, abelianLift χ g = 1) → abelianLift χ σ = 1) : σ ∈ H := by -- Apply `exists_apply_ne_zero_of_notMem_ker` to the projection of `G` to the quotient of its -- abelianisation by `H`. let π : G →* TopologicalAbelianization G ⧸ H := (mk' H).comp (mk' (_root_.commutator G).topologicalClosure) have mem_ker_π (g : G) : g ∈ π.ker ↔ (g : TopologicalAbelianization G) ∈ H := QuotientGroup.eq_one_iff _ have h_closed : IsClosed (π.ker : Set G) := by convert hH.preimage continuous_mk exact Set.ext mem_ker_π obtain ⟨τ, rfl⟩ := mk_surjective σ by_contra h_notMem obtain ⟨χ, hχ, h_ne⟩ : ∃ χ : QZChar G, (∀ g ∈ π.ker, χ.val g = 0) ∧ χ.val τ ≠ 0 := exists_apply_ne_zero_of_notMem_ker π τ h_closed (mt (mem_ker_π τ).1 h_notMem) have h_kills : ∀ g ∈ H, abelianLift χ g = 1 := forall_mk.2 fun g hg ↦ by rw [abelianLift_mk, hχ g ((mem_ker_π g).2 hg), ofAdd_zero] exact h_ne (by simpa using hσ χ h_kills) /-- For a profinite group `G`, two elements of the topological abelianisation are equal if the map `abelianLift χ` induced by each character `χ : G → ℚ/ℤ` takes the same value on them. -/ @[ext] lemma abelianization_ext {g g' : TopologicalAbelianization G} (h_lift : ∀ χ : QZChar G, abelianLift χ g = abelianLift χ g') : g = g' := by -- The abelianisation is the quotient by a closed subgroup, so its trivial subgroup is closed. refine eq_of_div_eq_one (mem_bot.1 (mem_of_forall_abelianLift isClosed_singleton (g / g') fun χ _ ↦ ?_)) rw [map_div, h_lift χ, div_self'] /-- The existence part of Pontryagin duality for a profinite group `G`: if `s` maps a group `X` homomorphically to the additive maps from the characters of `G` to `ℚ/ℤ`, then some homomorphism `f` from `X` to the topological abelianisation of `G` has `χ (f x) = s x χ` for all `χ` and `x`. Here `abelianLift χ` is the map induced by `χ` on the abelianisation. -/ lemma exists_hom_abelianLift_eq {X : Type*} [Group X] (s : Additive X →+ QZChar G →+ QZ) : ∃ f : X →* TopologicalAbelianization G, ∀ (χ : QZChar G) (x : X), abelianLift χ (f x) = Multiplicative.ofAdd (s (Additive.ofMul x) χ) := by choose g hg using fun x : X ↦ exists_eval_eq (s (.ofMul x)) have h_ab (χ : QZChar G) (x : X) : abelianLift χ (g x) = .ofAdd (s (.ofMul x) χ) := by rw [abelianLift_mk, hg] -- The class of `g x` is multiplicative in `x`, because characters separate the points. have h_mul (x y : X) : (g (x * y) : TopologicalAbelianization G) = g x * g y := abelianization_ext fun χ ↦ by rw [map_mul, h_ab, h_ab, h_ab, ofMul_mul, map_add, AddMonoidHom.add_apply, ofAdd_add] exact ⟨.mk' (fun x ↦ g x) h_mul, h_ab⟩ /-- Let `G` be a profinite group and `C` a commutative topological group. A homomorphism `f` from `C` to the topological abelianisation of `G` is continuous exactly when its composite with the map `abelianLift χ` induced by each character `χ : G → ℚ/ℤ` has open kernel. -/ lemma continuous_iff_forall_isOpen_ker_comp [TopologicalSpace C] [IsTopologicalGroup C] {f : C →* TopologicalAbelianization G} : Continuous f ↔ ∀ χ : QZChar G, ((abelianLift χ).comp f).ker.IsOpen := by -- Characters separate points, so they embed the compact abelianisation in a product of -- discrete groups, and continuity can be checked one character at a time. have h_emb : Topology.IsClosedEmbedding fun (g : TopologicalAbelianization G) (χ : QZChar G) ↦ abelianLift χ g := (continuous_pi continuous_abelianLift).isClosedEmbedding fun g g' h_eq ↦ abelianization_ext (congrFun h_eq) rw [h_emb.continuous_iff, continuous_pi_iff] exact forall_congr' fun χ ↦ ⟨fun h_cont ↦ h_cont.isOpen_preimage {1} (isOpen_discrete _), ((abelianLift χ).comp f).continuous_of_isOpen_ker⟩ end QZChar end New /-! ## Extension of homomorphisms into a divisible group -/ section ExtendCharacter open QuotientGroup /-- Let `A` and `G` be commutative groups, `C` a divisible commutative group, `f : A → G` a homomorphism and `H` a subgroup of `G`. A homomorphism `θ : A → C` that is trivial at every `a` with `f a ∈ H` factors as `χ ∘ f` for some homomorphism `χ : G → C` trivial on `H`. -/ lemma New.exists_monoidHom_extend {A G C : Type*} [CommGroup A] [CommGroup G] [CommGroup C] [d : DivisibleBy (Additive C) ℤ] (f : A →* G) (θ : A →* C) (H : Subgroup G) (h_triv : ∀ a : A, f a ∈ H → θ a = 1) : ∃ χ : G →* C, H ≤ χ.ker ∧ ∀ a : A, χ (f a) = θ a := by -- Extend `θ` from `A` to the quotient `G ⧸ H`, then pull it back to `G`. have h_ker : ((mk' H).comp f).ker ≤ θ.ker := fun a ha ↦ h_triv a ((eq_one_iff (f a)).1 ha) obtain ⟨v, hv⟩ : ∃ v : Additive (G ⧸ H) →+ Additive C, ∀ a : A, v (.ofMul (f a : G ⧸ H)) = .ofMul (θ a) := QZ.exists_extend ((mk' H).comp f).toAdditive θ.toAdditive h_ker refine ⟨v.toMultiplicative.comp (mk' H), fun g hg ↦ ?_, hv⟩ change v (.ofMul (g : G ⧸ H)) = 0 rw [(eq_one_iff g).2 hg, ofMul_one, map_zero] end ExtendCharacter end