Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(LightProfinite): light profinite sets as sequential limits with surjective transition maps #13333

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1747555
feat(Topology): a profinite space has countably many clopens iff it i…
dagurtomas May 17, 2024
4b76e3e
golf
dagurtomas May 17, 2024
13ca0cf
Update Compact.lean
dagurtomas May 17, 2024
6541d50
Merge branch 'master' into dagur/SecondCountableClopens
dagurtomas May 23, 2024
86a2011
Merge branch 'master' into dagur/SecondCountableClopens
dagurtomas May 27, 2024
42e26ad
golf
dagurtomas May 27, 2024
2a24309
Update Mathlib/Topology/Compactness/Compact.lean
dagurtomas May 28, 2024
d3960af
Update Mathlib/Topology/Compactness/Compact.lean
dagurtomas May 28, 2024
af3c9a2
fix errors
dagurtomas May 28, 2024
508dace
refactor(LightProfinite): redefine light profinite spaces as second c…
dagurtomas May 28, 2024
8fa0af9
aslimit file
dagurtomas May 28, 2024
31f7ff8
remove file for future PR
dagurtomas May 28, 2024
e36c047
mathlib file
dagurtomas May 28, 2024
94d5bd4
Merge branch 'master' into dagur/LightProfiniteRefactor
dagurtomas May 28, 2024
e3b89d3
lint
dagurtomas May 28, 2024
7bfadef
feat(LightProfinite): light profinite sets as sequential limits with …
dagurtomas May 29, 2024
b086057
mathlib
dagurtomas May 29, 2024
be5333f
move instance
dagurtomas May 29, 2024
aa3c52c
Merge branch 'master' into dagur/LightProfiniteRefactor
dagurtomas May 30, 2024
d8e49ab
fix merge errors
dagurtomas May 30, 2024
812fb56
Merge branch 'master' into dagur/LightProfiniteRefactor
dagurtomas Jun 4, 2024
132d31e
fix error
dagurtomas Jun 4, 2024
a55eab2
fix typos
dagurtomas Jun 4, 2024
893959f
Merge branch 'dagur/LightProfiniteRefactor' into dagur/LightProfinite…
dagurtomas Jun 4, 2024
95f5196
Merge branch 'master' into dagur/LightProfiniteAsLimit
dagurtomas Jun 8, 2024
e469799
Merge branch 'master' into dagur/LightProfiniteAsLimit
dagurtomas Jun 11, 2024
c9a9e94
more conflicts
dagurtomas Jun 11, 2024
8c24069
Merge branch 'master' into dagur/LightProfiniteAsLimit
dagurtomas Jul 2, 2024
c7d4bbf
feat(Topology/LightProfinite): light profinite sets as sequential limits
dagurtomas Jul 2, 2024
7b41e02
remove unused import
dagurtomas Jul 2, 2024
dfaec2e
lint
dagurtomas Jul 2, 2024
bcfa4da
Merge branch 'master' into dagur/LightProfiniteAsLimit
dagurtomas Jul 15, 2024
a356a07
remove unnecessary API
dagurtomas Jul 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4158,6 +4158,7 @@ import Mathlib.Topology.Category.CompHaus.Projective
import Mathlib.Topology.Category.CompHausLike.Basic
import Mathlib.Topology.Category.Compactum
import Mathlib.Topology.Category.FinTopCat
import Mathlib.Topology.Category.LightProfinite.AsLimit
import Mathlib.Topology.Category.LightProfinite.Basic
import Mathlib.Topology.Category.LightProfinite.EffectiveEpi
import Mathlib.Topology.Category.LightProfinite.Limits
Expand Down
2 changes: 2 additions & 0 deletions Mathlib/CategoryTheory/Countable.lean
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ attribute [instance] CountableCategory.countableObj CountableCategory.countableH
instance countablerCategoryDiscreteOfCountable (J : Type*) [Countable J] :
CountableCategory (Discrete J) where

instance : CountableCategory ℕ where

namespace CountableCategory

variable (α : Type u) [Category.{v} α] [CountableCategory α]
Expand Down
8 changes: 8 additions & 0 deletions Mathlib/CategoryTheory/Limits/Cones.lean
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,14 @@ theorem cone_iso_of_hom_iso {K : J ⥤ C} {c d : Cone K} (f : c ⟶ d) [i : IsIs
w := fun j => (asIso f.hom).inv_comp_eq.2 (f.w j).symm }, by aesop_cat⟩⟩
#align category_theory.limits.cones.cone_iso_of_hom_iso CategoryTheory.Limits.Cones.cone_iso_of_hom_iso

/-- Given an isomorphism of cones, produce an isomorphism of their points. -/
@[simps]
def ptIsoOfIso {K : J ⥤ C} {c d : Cone K} (i : c ≅ d) : c.pt ≅ d.pt where
hom := i.hom.hom
inv := i.inv.hom
hom_inv_id := by simp [← Cone.category_comp_hom]
inv_hom_id := by simp [← Cone.category_comp_hom]

/-- There is a morphism from an extended cone to the original cone. -/
@[simps]
def extend (s : Cone F) {X : C} (f : X ⟶ s.pt) : s.extend f ⟶ s where
Expand Down
139 changes: 139 additions & 0 deletions Mathlib/Topology/Category/LightProfinite/AsLimit.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/-
Copyright (c) 2024 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson
-/
import Mathlib.Topology.Category.LightProfinite.Basic
/-!
# Light profinite sets as limits of finite sets.

We show that any light profinite set is isomorphic to a sequential limit of finite sets.

The limit cone for `S : LightProfinite` is `S.asLimitCone`, the fact that it's a limit is
`S.asLimit`.

We also prove that the projection and transition maps in this limit are surjective.

-/

noncomputable section

open CategoryTheory Limits

attribute [local instance] ConcreteCategory.instFunLike

namespace LightProfinite

universe u

variable (S : LightProfinite.{u})

/-- The functor `ℕᵒᵖ ⥤ FintypeCat` whose limit is isomorphic to `S`. -/
abbrev fintypeDiagram : ℕᵒᵖ ⥤ FintypeCat := S.toLightDiagram.diagram

/-- An abbreviation for `S.fintypeDiagram ⋙ FintypeCat.toProfinite`. -/
abbrev diagram : ℕᵒᵖ ⥤ LightProfinite := S.fintypeDiagram ⋙ FintypeCat.toLightProfinite

/--
A cone over `S.diagram` whose cone point is isomorphic to `S`.
(Auxiliary definition, use `S.asLimitCone` instead.)
-/
def asLimitConeAux : Cone S.diagram :=
let c : Cone (S.diagram ⋙ lightToProfinite) := S.toLightDiagram.cone
let hc : IsLimit c := S.toLightDiagram.isLimit
liftLimit hc

/-- An auxiliary isomorphism of cones used to prove that `S.asLimitConeAux` is a limit cone. -/
def isoMapCone : lightToProfinite.mapCone S.asLimitConeAux ≅ S.toLightDiagram.cone :=
let c : Cone (S.diagram ⋙ lightToProfinite) := S.toLightDiagram.cone
let hc : IsLimit c := S.toLightDiagram.isLimit
liftedLimitMapsToOriginal hc

/--
`S.asLimitConeAux` is indeed a limit cone.
(Auxiliary definition, use `S.asLimit` instead.)
-/
def asLimitAux : IsLimit S.asLimitConeAux :=
let hc : IsLimit (lightToProfinite.mapCone S.asLimitConeAux) :=
S.toLightDiagram.isLimit.ofIsoLimit S.isoMapCone.symm
isLimitOfReflects lightToProfinite hc

/-- A cone over `S.diagram` whose cone point is `S`. -/
def asLimitCone : Cone S.diagram where
pt := S
π := {
app := fun n ↦ (lightToProfiniteFullyFaithful.preimageIso <|
Cones.ptIsoOfIso S.isoMapCone).inv ≫ S.asLimitConeAux.π.app n
naturality := fun _ _ _ ↦ by simp only [Category.assoc, S.asLimitConeAux.w]; rfl }

/-- `S.asLimitCone` is indeed a limit cone. -/
def asLimit : IsLimit S.asLimitCone := S.asLimitAux.ofIsoLimit <|
Cones.ext (lightToProfiniteFullyFaithful.preimageIso <|
Cones.ptIsoOfIso S.isoMapCone) (fun _ ↦ by rw [← @Iso.inv_comp_eq]; rfl)

/-- A bundled version of `S.asLimitCone` and `S.asLimit`. -/
def lim : Limits.LimitCone S.diagram := ⟨S.asLimitCone, S.asLimit⟩

/-- The projection from `S` to the `n`th component of `S.diagram`. -/
abbrev proj (n : ℕ) : S ⟶ S.diagram.obj ⟨n⟩ := S.asLimitCone.π.app ⟨n⟩

lemma map_liftedLimit {C D J : Type*} [Category C] [Category D] [Category J] {K : J ⥤ C}
{F : C ⥤ D} [CreatesLimit K F] {c : Cone (K ⋙ F)} (t : IsLimit c) (n : J) :
(liftedLimitMapsToOriginal t).inv.hom ≫ F.map ((liftLimit t).π.app n) = c.π.app n := by
have : (liftedLimitMapsToOriginal t).hom.hom ≫ c.π.app n = F.map ((liftLimit t).π.app n) := by
simp
rw [← this, ← Category.assoc, ← Cone.category_comp_hom]
simp

lemma lightToProfinite_map_proj_eq (n : ℕ) : lightToProfinite.map (S.proj n) =
(lightToProfinite.obj S).asLimitCone.π.app _ := by
simp only [Functor.comp_obj, proj, asLimitCone, Functor.const_obj_obj, asLimitConeAux, isoMapCone,
Functor.FullyFaithful.preimageIso_inv, Cones.ptIsoOfIso_inv, Functor.map_comp,
Functor.FullyFaithful.map_preimage]
let c : Cone (S.diagram ⋙ lightToProfinite) := S.toLightDiagram.cone
let hc : IsLimit c := S.toLightDiagram.isLimit
exact map_liftedLimit hc _

lemma proj_surjective (n : ℕ) : Function.Surjective (S.proj n) := by
change Function.Surjective (lightToProfinite.map (S.proj n))
rw [lightToProfinite_map_proj_eq]
exact DiscreteQuotient.proj_surjective _

/-- An abbreviation for the `n`th component of `S.diagram`. -/
abbrev component (n : ℕ) : LightProfinite := S.diagram.obj ⟨n⟩

/-- The transition map from `S_{n+1}` to `S_n` in `S.diagram`. -/
abbrev transitionMap (n : ℕ) : S.component (n+1) ⟶ S.component n :=
S.diagram.map ⟨homOfLE (Nat.le_succ _)⟩

/-- The transition map from `S_m` to `S_n` in `S.diagram`, when `m ≤ n`. -/
abbrev transitionMapLE {n m : ℕ} (h : n ≤ m) : S.component m ⟶ S.component n :=
S.diagram.map ⟨homOfLE h⟩

lemma proj_comp_transitionMap (n : ℕ) :
S.proj (n + 1) ≫ S.diagram.map ⟨homOfLE (Nat.le_succ _)⟩ = S.proj n :=
S.asLimitCone.w (homOfLE (Nat.le_succ n)).op

lemma proj_comp_transitionMap' (n : ℕ) : S.transitionMap n ∘ S.proj (n + 1) = S.proj n := by
rw [← S.proj_comp_transitionMap n]
rfl

lemma proj_comp_transitionMapLE {n m : ℕ} (h : n ≤ m) :
S.proj m ≫ S.diagram.map ⟨homOfLE h⟩ = S.proj n :=
S.asLimitCone.w (homOfLE h).op

lemma proj_comp_transitionMapLE' {n m : ℕ} (h : n ≤ m) :
S.transitionMapLE h ∘ S.proj m = S.proj n := by
rw [← S.proj_comp_transitionMapLE h]
rfl

lemma surjective_transitionMap (n : ℕ) : Function.Surjective (S.transitionMap n) := by
apply Function.Surjective.of_comp (g := S.proj (n + 1))
simpa only [proj_comp_transitionMap'] using S.proj_surjective n

lemma surjective_transitionMapLE {n m : ℕ} (h : n ≤ m) :
Function.Surjective (S.transitionMapLE h) := by
apply Function.Surjective.of_comp (g := S.proj m)
simpa only [proj_comp_transitionMapLE'] using S.proj_surjective n

end LightProfinite
Loading