-
Notifications
You must be signed in to change notification settings - Fork 2
/
Coproducts.lean
69 lines (58 loc) · 1.96 KB
/
Coproducts.lean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import ExtrDisc.Basic
open CategoryTheory Limits
universe u
namespace ExtrDisc
variable {α : Type u} (X : α → ExtrDisc.{u})
abbrev mkHom {X Y : ExtrDisc.{u}} (f : X.compHaus ⟶ Y.compHaus) :
X ⟶ Y := f
@[simps]
noncomputable
def coproductCocone : Cofan X where
pt := {
compHaus := ∐ fun i => (X i).compHaus
extrDisc := by
rw [← CompHaus.Gleason]
infer_instance
}
ι := Discrete.natTrans fun ⟨i⟩ => Sigma.ι
(fun i => (X i).compHaus) i
@[simps]
noncomputable
def isColimitCoproductCocone :
IsColimit (coproductCocone X) where
desc := fun S =>
mkHom <| Sigma.desc fun _ => S.ι.app _
fac := fun S ⟨i⟩ =>
colimit.ι_desc (toCompHaus.mapCocone S) ⟨i⟩
uniq := fun S _ hm =>
(colimit.isColimit _).uniq (toCompHaus.mapCocone S) _ hm
noncomputable
instance {α : Type u} :
PreservesColimitsOfShape (Discrete α) toCompHaus := by
constructor ; unfold autoParam ; intro K
let e : K ≅ Discrete.functor (fun i => K.obj ⟨i⟩) :=
Discrete.natIsoFunctor
suffices PreservesColimit
(Discrete.functor (fun i => K.obj ⟨i⟩)) toCompHaus from
preservesColimitOfIsoDiagram (h := e.symm) (F := toCompHaus)
apply preservesColimitOfPreservesColimitCocone
(h := isColimitCoproductCocone _)
exact colimit.isColimit _
noncomputable
instance {α : Type u} :
CreatesColimitsOfShape (Discrete α) toCompHaus where
CreatesColimit := by
intro K
let e : K ≅ Discrete.functor (fun i => K.obj ⟨i⟩) :=
Discrete.natIsoFunctor
suffices CreatesColimit
(Discrete.functor <| fun i => K.obj ⟨i⟩) toCompHaus by
apply createsColimitOfIsoDiagram (h := e.symm) (F := toCompHaus)
apply createsColimitOfFullyFaithfulOfIso
(X := coproductCocone (fun i => K.obj ⟨i⟩) |>.pt)
exact Iso.refl _
noncomputable
example {α : Type u} :
PreservesColimitsOfShape (Discrete α) toCompHaus :=
inferInstance
end ExtrDisc