/-
Copyright (c) 2021 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/
module
public import Mathlib.CategoryTheory.ConcreteCategory.EpiMono
public import Mathlib.CategoryTheory.Preadditive.Projective.Basic
public import Mathlib.Topology.Category.CompHaus.Basic
/-!
# CompHaus has enough projectives
In this file we show that `CompHaus` has enough projectives.
## Main results
Let `X` be a compact Hausdorff space.
* `CompHaus.projective_ultrafilter`: the space `Ultrafilter X` is a projective object
* `CompHaus.projectivePresentation`: the natural map `Ultrafilter X → X`
is a projective presentation
## Reference
See [miraglia2006introduction] Chapter 21 for a proof that `CompHaus` has enough projectives.
-/
@[
expose]
public section
noncomputable
section
open CategoryTheory Function
namespace CompHaus
instance projective_ultrafilter (X : Type*) : Projective (of <| Ultrafilter X)
where
factors {Y Z} f g hg :=
by
rw [epi_iff_surjective] at hg
obtain ⟨g', hg'⟩ := hg.hasRightInverse
let t : X → Y := g' ∘ f ∘ (pure : X → Ultrafilter X)
let h : Ultrafilter X → Y := Ultrafilter.extend t
have hh : Continuous h := continuous_ultrafilter_extend _
use CompHausLike.ofHom _ ⟨h, hh⟩
apply ConcreteCategory.coe_ext
have : g.hom ∘ g' = id := hg'.comp_eq_id
convert!
denseRange_pure.equalizer (g.hom.hom.continuous.comp hh) f.hom.hom.continuous
_
-- This used to be `rw`, but we need `rw; rfl` after https://github.com/leanprover/lean4/pull/2644
-- This used to be `rw`, but we need `rw; rfl` after https://github.com/leanprover/lean4/pull/2644
rw [comp_assoc, ultrafilter_extend_extends, ← comp_assoc, this, id_comp]
rfl
/-- For any compact Hausdorff space `X`,
the natural map `Ultrafilter X → X` is a projective presentation. -/
def projectivePresentation (X : CompHaus) : ProjectivePresentation X
where
p := of <| Ultrafilter X
f := CompHausLike.ofHom _ ⟨_, continuous_ultrafilter_extend id⟩
projective := CompHaus.projective_ultrafilter X
epi :=
ConcreteCategory.epi_of_surjective _
fun x =>
⟨(pure x : Ultrafilter X), congr_fun (ultrafilter_extend_extends ( X)) x⟩
instance : EnoughProjectives CompHaus
where presentation X := ⟨projectivePresentation X⟩
end CompHaus