-
Notifications
You must be signed in to change notification settings - Fork 2
/
task.txt
166 lines (152 loc) · 3.87 KB
/
task.txt
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
From Ltac2 Require Import Ltac2.
From Ltac2 Require Option.
Set Ltac Debug.
Set Ltac Batch Debug.
(************************************************************************
Limits and colimits in the unit category
Contents
1. Terminal objects
2. Products
3. Pullbacks
4. Initial objects
5. Coproducts
************************************************************************)
Require Import UniMath.Foundations.All.
Require Import UniMath.MoreFoundations.All.
Require Import UniMath.CategoryTheory.Core.Categories.
Require Import UniMath.CategoryTheory.Core.Functors.
Require Import UniMath.CategoryTheory.Core.Isos.
Require Import UniMath.CategoryTheory.Core.Univalence.
Require Import UniMath.CategoryTheory.categories.StandardCategories.
Require Import UniMath.CategoryTheory.limits.terminal.
Require Import UniMath.CategoryTheory.limits.binproducts.
Require Import UniMath.CategoryTheory.limits.pullbacks.
Require Import UniMath.CategoryTheory.limits.initial.
Require Import UniMath.CategoryTheory.limits.bincoproducts.
Require Import UniMath.CategoryTheory.limits.Preservation.
Local Open Scope cat.
(**
1. Terminal objects
*)
Definition isTerminal_unit_category
(x : unit_category)
: isTerminal unit_category x.
Proof.
use make_isTerminal.
intro y.
Debug Off.
use iscontraprop1; [ apply isasetunit | ].
Debug On.
apply isapropunit.
Qed.
Definition terminal_unit_category
: Terminal unit_category.
Proof.
simple refine (_ ,, _).
- exact tt.
- exact (isTerminal_unit_category tt).
Defined.
Definition functor_to_unit_preserves_terminal
(C : category)
: preserves_terminal (functor_to_unit C).
Proof.
intros x Hx.
apply isTerminal_unit_category.
Defined.
(**
2. Products
*)
Definition isBinProduct_unit_category
{x y z : unit_category}
(f : z --> x)
(g : z --> y)
: isBinProduct unit_category x y z f g.
Proof.
intros w h₁ h₂.
Debug Off. use iscontraprop1. Debug On.
- apply invproofirrelevance.
intros fg₁ fg₂.
use subtypePath.
{
intro.
apply isapropdirprod ; apply homset_property.
}
apply isasetunit.
- simple refine (_ ,, _ ,, _).
+ apply isapropunit.
+ apply isasetunit.
+ apply isasetunit.
Qed.
Definition binproduct_unit_category
: BinProducts unit_category.
Proof.
intros x y.
use make_BinProduct.
- exact tt.
- apply isapropunit.
- apply isapropunit.
- apply isBinProduct_unit_category.
Defined.
Definition functor_to_unit_preserves_binproduct
(C : category)
: preserves_binproduct (functor_to_unit C).
Proof.
intro ; intros.
apply isBinProduct_unit_category.
Defined.
(**
3. Pullbacks
*)
Definition isPullback_unit_category
{w x y z : unit_category}
{f : x --> z}
{g : y --> z}
{p₁ : w --> x}
{p₂ : w --> y}
(eq : p₁ · f = p₂ · g)
: isPullback eq.
Proof.
intros r h₁ h₂ q.
Debug Off. use iscontraprop1. Debug On.
- apply invproofirrelevance.
intros fg₁ fg₂.
use subtypePath.
{
intro.
apply isapropdirprod ; apply homset_property.
}
apply isasetunit.
- simple refine (_ ,, _ ,, _).
+ apply isapropunit.
+ apply isasetunit.
+ apply isasetunit.
Qed.
Definition pullbacks_unit_category
: Pullbacks unit_category.
Proof.
intros x y z f g.
use make_Pullback.
- exact tt.
- apply isapropunit.
- apply isapropunit.
- apply isasetunit.
- apply isPullback_unit_category.
Defined.
Definition functor_to_unit_preserves_pullback
(C : category)
: preserves_pullback (functor_to_unit C).
Proof.
intro ; intros.
apply isPullback_unit_category.
Defined.
(**
4. Initial objects
*)
Definition isInitial_unit_category
(x : unit_category)
: isInitial unit_category x.
Proof.
intro y.
Debug Off. use iscontraprop1 ; [ apply isasetunit | ]. Debug On.
apply isapropunit.
Qed.