1
1
Require Import Basics.
2
2
Require Import Types .
3
+ Require Import Diagrams.Graph .
4
+ Require Import Diagrams.Diagram.
3
5
Require Import Diagrams.Span.
4
6
Require Import Diagrams.Cocone.
5
7
Require Import Colimits.Colimit.
@@ -26,12 +28,11 @@ Section PO.
26
28
Proof .
27
29
srapply Build_Cocone.
28
30
- intros [|[]]; [ exact (inr' o g) | exact inl' | exact inr' ].
29
- - intros [] [] []; cbn. destruct b.
31
+ - intros [u|b ] [u'|b' ] []; cbn. destruct b' .
30
32
+ exact pp'.
31
33
+ reflexivity.
32
34
Defined .
33
35
34
-
35
36
Definition pol' {f : A -> B} {g : A -> C} {Z} (Co : Cocone (span f g) Z)
36
37
: B -> Z
37
38
:= legs Co (inr true).
@@ -55,26 +56,38 @@ Section PO.
55
56
:= colimp (D:=span f g) (inl tt) (inr true) tt a
56
57
@ (colimp (D:=span f g) (inl tt) (inr false) tt a)^.
57
58
58
- (** The eliminators [PO_ind], [PO_rec], ... can be proven. *)
59
- Definition PO_ind (P : PO f g -> Type) (l' : forall b, P (pol b))
59
+ (** We next define the eliminators [PO_ind] and [PO_rec]. To make later proof terms smaller, we define two things we'll need. *)
60
+ Definition PO_ind_obj (P : PO f g -> Type) (l' : forall b, P (pol b))
61
+ (r' : forall c, P (por c))
62
+ : forall (i : span_graph) (x : obj (span f g) i), P (colim i x).
63
+ Proof .
64
+ intros [u|[]] x; cbn.
65
+ - exact (@colimp _ (span f g) (inl u) (inr true) tt x # l' (f x)).
66
+ - exact (l' x).
67
+ - exact (r' x).
68
+ Defined .
69
+
70
+ Definition PO_ind_arr (P : PO f g -> Type) (l' : forall b, P (pol b))
60
71
(r' : forall c, P (por c)) (pp' : forall a, popp a # l' (f a) = r' (g a))
61
- : forall w, P w.
72
+ : forall (i j : span_graph) (e : span_graph i j) (ar : span f g i),
73
+ transport P (colimp i j e ar) (PO_ind_obj P l' r' j (((span f g) _f e) ar)) =
74
+ PO_ind_obj P l' r' i ar.
62
75
Proof .
63
- srapply Colimit_ind.
64
- - intros [u|[]] x; cbn.
65
- + exact (@colimp _ (span f g) (inl u) (inr true) tt x # l' (f x)).
66
- + exact (l' x).
67
- + exact (r' x).
68
- - intros [] [] []; cbn.
69
- destruct b; cbn.
70
- 1: reflexivity.
71
- unfold popp in pp'.
72
- intro a. apply moveR_transport_p.
73
- rhs_V nrapply transport_pp.
74
- destruct u.
75
- symmetry; apply pp'.
76
+ intros [u|b] [u'|b'] []; cbn.
77
+ destruct b'; cbn.
78
+ 1: reflexivity.
79
+ unfold popp in pp'.
80
+ intro a. apply moveR_transport_p.
81
+ rhs_V nrapply transport_pp.
82
+ destruct u.
83
+ symmetry; apply pp'.
76
84
Defined .
77
85
86
+ Definition PO_ind (P : PO f g -> Type) (l' : forall b, P (pol b))
87
+ (r' : forall c, P (por c)) (pp' : forall a, popp a # l' (f a) = r' (g a))
88
+ : forall w, P w
89
+ := Colimit_ind P (PO_ind_obj P l' r') (PO_ind_arr P l' r' pp').
90
+
78
91
Definition PO_ind_beta_pp (P : PO f g -> Type) (l' : forall b, P (pol b))
79
92
(r' : forall c, P (por c)) (pp' : forall a, popp a # l' (f a) = r' (g a))
80
93
: forall x, apD (PO_ind P l' r' pp') (popp x) = pp' x.
@@ -86,7 +99,7 @@ Section PO.
86
99
rewrite (Colimit_ind_beta_colimp P _ _ (inl tt) (inr false) tt x).
87
100
rewrite moveR_transport_p_V, moveR_moveL_transport_p.
88
101
rewrite inv_pp, inv_V.
89
- exact ( concat_p_Vp _ _) .
102
+ apply concat_p_Vp.
90
103
Defined .
91
104
92
105
Definition PO_rec (P: Type ) (l': B -> P) (r': C -> P)
@@ -98,15 +111,15 @@ Section PO.
98
111
: forall x, ap (PO_rec P l' r' pp') (popp x) = pp' x.
99
112
Proof .
100
113
intro x.
101
- pose (X := Colimit_rec_beta_colimp P (Build_span_cocone l' r' pp')
102
- (inl tt) (inr true) tt x).
103
- pose (X0 := Colimit_rec_beta_colimp P (Build_span_cocone l' r' pp')
104
- (inl tt) (inr false) tt x).
105
- unfold popp; cbn in *.
114
+ unfold popp.
106
115
refine (ap_pp _ _ _ @ _ @ concat_p1 _).
107
- refine (X @@ _).
108
- refine (_ @ inverse2 X0).
109
- exact (ap_V _ _).
116
+ refine (_ @@ _).
117
+ 1: exact (Colimit_rec_beta_colimp P (Build_span_cocone l' r' pp')
118
+ (inl tt) (inr true) tt x).
119
+ lhs nrapply ap_V.
120
+ apply (inverse2 (q:=1)).
121
+ exact (Colimit_rec_beta_colimp P (Build_span_cocone l' r' pp')
122
+ (inl tt) (inr false) tt x).
110
123
Defined .
111
124
112
125
(** A nice property: the pushout of an equivalence is an equivalence. *)
@@ -161,23 +174,27 @@ Section is_PO_pushout.
161
174
* exact (por' Co).
162
175
* exact (popp' Co).
163
176
+ intros [Co Co'].
164
- srapply path_cocone; cbn .
177
+ srapply path_cocone.
165
178
* intros [[]|[]] x; simpl.
166
179
1: apply (Co' (inl tt) (inr false) tt).
167
180
all: reflexivity.
168
- * intros [[]|[]] [[]|[]] [] x; simpl.
181
+ * cbn beta.
182
+ intros [u|b] [u'|b'] [] x.
183
+ destruct u, b'; cbn.
169
184
2: reflexivity.
170
- refine (_ @ (concat_1p _)^).
171
- rewrite Pushout_rec_beta_pglue.
172
- hott_simpl.
185
+ rhs nrapply concat_1p.
186
+ lhs refine (_ @@ 1).
187
+ 1: nrapply Pushout_rec_beta_pglue.
188
+ unfold popp', legs_comm.
189
+ apply concat_pV_p.
173
190
+ intro h.
174
191
apply path_forall.
175
192
srapply Pushout_ind; cbn.
176
193
1,2: reflexivity.
177
- intro a; cbn.
194
+ intro a; cbn beta .
178
195
nrapply transport_paths_FlFr'; apply equiv_p1_1q.
179
196
unfold popp'; cbn.
180
- refine (_ @ concat_p1 _) .
197
+ rhs_V nrapply concat_p1.
181
198
nrapply Pushout_rec_beta_pglue.
182
199
Defined .
183
200
0 commit comments