|
| 1 | +/- |
| 2 | +Copyright (c) 2026 Adam Topaz. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Adam Topaz |
| 5 | +-/ |
| 6 | +module |
| 7 | + |
| 8 | +public import Mathlib.GroupTheory.FiniteIndexNormalSubgroup |
| 9 | +public import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Limits |
| 10 | + |
| 11 | +/-! |
| 12 | +# Profinite completion of groups |
| 13 | +
|
| 14 | +We define the profinite completion of a group as the limit of its finite quotients, |
| 15 | +and prove its universal property. |
| 16 | +-/ |
| 17 | + |
| 18 | +@[expose] public section |
| 19 | + |
| 20 | +namespace OpenNormalSubgroup |
| 21 | + |
| 22 | +variable {G : Type*} [Group G] [TopologicalSpace G] |
| 23 | + |
| 24 | +/-- An open normal subgroup of a compact topological group has finite index. -/ |
| 25 | +@[to_additive |
| 26 | + /-- An open normal additive subgroup of a compact topological additive group has finite index. -/] |
| 27 | +def toFiniteIndexNormalSubgroup [CompactSpace G] [ContinuousMul G] |
| 28 | + (H : OpenNormalSubgroup G) : FiniteIndexNormalSubgroup G := |
| 29 | + letI : H.toSubgroup.FiniteIndex := Subgroup.finiteIndex_of_finite_quotient |
| 30 | + FiniteIndexNormalSubgroup.ofSubgroup H.toSubgroup |
| 31 | + |
| 32 | +@[to_additive] |
| 33 | +theorem toFiniteIndexNormalSubgroup_mono [CompactSpace G] [ContinuousMul G] |
| 34 | + {H K : OpenNormalSubgroup G} (h : H ≤ K) : |
| 35 | + H.toFiniteIndexNormalSubgroup ≤ K.toFiniteIndexNormalSubgroup := |
| 36 | + fun _ hx ↦ h hx |
| 37 | + |
| 38 | +@[to_additive] |
| 39 | +theorem toFiniteIndexNormalSubgroup_injective [CompactSpace G] [ContinuousMul G] : |
| 40 | + Function.Injective (toFiniteIndexNormalSubgroup (G := G)) := by |
| 41 | + intro H K h |
| 42 | + apply toSubgroup_injective |
| 43 | + exact congrArg (fun L : FiniteIndexNormalSubgroup G ↦ (L : Subgroup G)) h |
| 44 | + |
| 45 | +end OpenNormalSubgroup |
| 46 | + |
| 47 | +namespace ProfiniteGrp |
| 48 | + |
| 49 | +open CategoryTheory |
| 50 | + |
| 51 | +universe u |
| 52 | + |
| 53 | +namespace ProfiniteCompletion |
| 54 | + |
| 55 | +variable (G : GrpCat.{u}) |
| 56 | + |
| 57 | +/-- The diagram of finite quotients indexed by finite-index normal subgroups of `G`. -/ |
| 58 | +def finiteGrpDiagram : FiniteIndexNormalSubgroup G ⥤ FiniteGrp.{u} where |
| 59 | + obj H := FiniteGrp.of <| G ⧸ H.toSubgroup |
| 60 | + map f := FiniteGrp.ofHom <| QuotientGroup.map _ _ (MonoidHom.id _) f.le |
| 61 | + map_id H := by ext ⟨x⟩; rfl |
| 62 | + map_comp f g := by ext ⟨x⟩; rfl |
| 63 | + |
| 64 | +/-- The finite-quotient diagram viewed in `ProfiniteGrp`. -/ |
| 65 | +def diagram : FiniteIndexNormalSubgroup G ⥤ ProfiniteGrp.{u} := |
| 66 | + finiteGrpDiagram _ ⋙ forget₂ _ _ |
| 67 | + |
| 68 | +/-- The profinite completion of `G` as a projective limit. -/ |
| 69 | +def completion : ProfiniteGrp.{u} := limit (diagram G) |
| 70 | + |
| 71 | +/-- The canonical map from `G` to its profinite completion, as a function. -/ |
| 72 | +def etaFn (x : G) : completion G := ⟨fun _ => QuotientGroup.mk x, fun _ _ _ => rfl⟩ |
| 73 | + |
| 74 | +/-- The canonical morphism from `G` to its profinite completion. -/ |
| 75 | +def eta : G ⟶ GrpCat.of (completion G) := GrpCat.ofHom { |
| 76 | + toFun := etaFn G |
| 77 | + map_one' := rfl |
| 78 | + map_mul' _ _ := rfl |
| 79 | +} |
| 80 | + |
| 81 | +lemma denseRange : DenseRange (etaFn G) := by |
| 82 | + apply dense_iff_inter_open.mpr |
| 83 | + rintro U ⟨s, hsO, hsv⟩ ⟨⟨spc, hspc⟩, uDefaultSpec⟩ |
| 84 | + rw [← hsv, Set.mem_preimage] at uDefaultSpec |
| 85 | + rcases (isOpen_pi_iff.mp hsO) _ uDefaultSpec with ⟨J, fJ, hJ1, hJ2⟩ |
| 86 | + let M : Subgroup G := iInf fun (j : J) => j.val |
| 87 | + have hM : M.Normal := Subgroup.normal_iInf_normal fun j => inferInstance |
| 88 | + have hMFinite : M.FiniteIndex := by |
| 89 | + apply Subgroup.finiteIndex_iInf |
| 90 | + infer_instance |
| 91 | + let m : FiniteIndexNormalSubgroup G := { toSubgroup := M } |
| 92 | + rcases QuotientGroup.mk'_surjective M (spc m) with ⟨origin, horigin⟩ |
| 93 | + use etaFn G origin |
| 94 | + refine ⟨?_, origin, rfl⟩ |
| 95 | + rw [← hsv] |
| 96 | + apply hJ2 |
| 97 | + intro a a_in_J |
| 98 | + let M_to_Na : m ⟶ a := (iInf_le (fun (j : J) => (j.val.toSubgroup)) ⟨a, a_in_J⟩).hom |
| 99 | + rw [← (etaFn G origin).property M_to_Na] |
| 100 | + dsimp [etaFn] at ⊢ horigin |
| 101 | + rw [horigin] |
| 102 | + exact Set.mem_of_eq_of_mem (hspc M_to_Na) (hJ1 a a_in_J).right |
| 103 | + |
| 104 | +variable {G} |
| 105 | +variable {P : ProfiniteGrp.{u}} |
| 106 | + |
| 107 | +/-- The preimage of an open normal subgroup under a morphism to a profinite group. -/ |
| 108 | +def preimage (f : G ⟶ GrpCat.of P) (H : OpenNormalSubgroup P) : FiniteIndexNormalSubgroup G := |
| 109 | + H.toFiniteIndexNormalSubgroup.comap f.hom |
| 110 | + |
| 111 | +lemma preimage_le {f : G ⟶ GrpCat.of P} {H K : OpenNormalSubgroup P} |
| 112 | + (h : H ≤ K) : preimage f H ≤ preimage f K := |
| 113 | + FiniteIndexNormalSubgroup.comap_mono _ h |
| 114 | + |
| 115 | +/-- The induced map on finite quotients coming from a morphism to `P`. -/ |
| 116 | +def quotientMap (f : G ⟶ GrpCat.of P) (H : OpenNormalSubgroup P) : |
| 117 | + FiniteGrp.of (G ⧸ (preimage f H).toSubgroup) ⟶ FiniteGrp.of (P ⧸ H.toSubgroup) := |
| 118 | + FiniteGrp.ofHom <| QuotientGroup.map _ _ f.hom <| fun _ h => h |
| 119 | + |
| 120 | +/-- The universal morphism from the profinite completion to `P`. -/ |
| 121 | +noncomputable |
| 122 | +def lift (f : G ⟶ GrpCat.of P) : completion G ⟶ P := |
| 123 | + P.isLimitCone.lift ⟨_, { |
| 124 | + app H := (limitCone (diagram G)).π.app _ ≫ (ofFiniteGrpHom <| quotientMap f H) |
| 125 | + naturality := by |
| 126 | + intro X Y g |
| 127 | + ext ⟨x, hx⟩ |
| 128 | + -- TODO: `dsimp` should handle this `change`; investigate missing simp lemmas in the |
| 129 | + -- `ProfiniteGrp` / `CompHausLike` API. |
| 130 | + change quotientMap f Y (x <| preimage f Y) = |
| 131 | + P.diagram.map g (quotientMap _ _ <| x <| preimage f X) |
| 132 | + have := hx <| preimage_le (f := f) g.le |>.hom |
| 133 | + obtain ⟨t, ht⟩ : ∃ g : G, QuotientGroup.mk g = x (preimage f X) := |
| 134 | + QuotientGroup.mk_surjective (x (preimage f X)) |
| 135 | + rw [← this, ← ht] |
| 136 | + have := P.cone.π.naturality g |
| 137 | + apply_fun fun q => q (f t) at this |
| 138 | + exact this |
| 139 | + }⟩ |
| 140 | + |
| 141 | +@[reassoc (attr := simp)] |
| 142 | +lemma lift_eta (f : G ⟶ GrpCat.of P) : eta G ≫ (forget₂ _ _).map (lift f) = f := by |
| 143 | + let e := isoLimittoFiniteQuotientFunctor P |
| 144 | + rw [← (forget₂ ProfiniteGrp GrpCat).mapIso e |>.cancel_iso_hom_right] |
| 145 | + dsimp |
| 146 | + rw [Category.assoc, ← (forget₂ ProfiniteGrp GrpCat).map_comp (lift f) e.hom] |
| 147 | + change eta G ≫ ((forget₂ _ _).map ((_ ≫ e.inv) ≫ e.hom)) = _ |
| 148 | + simp only [Category.assoc, Iso.inv_hom_id] |
| 149 | + rfl |
| 150 | + |
| 151 | +lemma lift_unique (f g : completion G ⟶ P) |
| 152 | + (h : eta G ≫ (forget₂ _ _).map f = eta G ≫ (forget₂ _ _).map g) : f = g := by |
| 153 | + ext x |
| 154 | + apply congrFun |
| 155 | + refine (denseRange (G := G)).equalizer f.hom.continuous_toFun g.hom.continuous_toFun ?_ |
| 156 | + funext y |
| 157 | + simpa [GrpCat.comp_apply] using (ConcreteCategory.congr_hom h y) |
| 158 | + |
| 159 | +end ProfiniteCompletion |
| 160 | + |
| 161 | +/-- The profinite completion functor. -/ |
| 162 | +@[simps] |
| 163 | +noncomputable def profiniteCompletion : GrpCat.{u} ⥤ ProfiniteGrp.{u} where |
| 164 | + obj G := ProfiniteCompletion.completion G |
| 165 | + map f := ProfiniteCompletion.lift <| f ≫ ProfiniteCompletion.eta _ |
| 166 | + map_id G := by |
| 167 | + apply ProfiniteCompletion.lift_unique |
| 168 | + cat_disch |
| 169 | + map_comp f g := by |
| 170 | + apply ProfiniteCompletion.lift_unique |
| 171 | + cat_disch |
| 172 | + |
| 173 | +namespace ProfiniteCompletion |
| 174 | + |
| 175 | +/-- The hom-set equivalence exhibiting the adjunction. -/ |
| 176 | +noncomputable |
| 177 | +def homEquiv (G : GrpCat.{u}) (P : ProfiniteGrp.{u}) : |
| 178 | + (completion G ⟶ P) ≃ (G ⟶ GrpCat.of P) where |
| 179 | + toFun f := eta G ≫ (forget₂ _ _).map f |
| 180 | + invFun f := lift f |
| 181 | + left_inv f := by apply lift_unique; simp |
| 182 | + right_inv f := by simp |
| 183 | + |
| 184 | +/-- The profinite completion is left adjoint to the forgetful functor. -/ |
| 185 | +noncomputable |
| 186 | +def adjunction : profiniteCompletion ⊣ forget₂ _ _ := |
| 187 | + Adjunction.mkOfHomEquiv { |
| 188 | + homEquiv := homEquiv |
| 189 | + homEquiv_naturality_left_symm f g := by |
| 190 | + apply lift_unique |
| 191 | + simp [homEquiv] |
| 192 | + } |
| 193 | + |
| 194 | +end ProfiniteCompletion |
| 195 | + |
| 196 | +end ProfiniteGrp |
0 commit comments