Skip to content

Commit ed81aa8

Browse files
Merge pull request #1843 from jdchristensen/colimits
Colimits and Hopf: clean up and speed up
2 parents ab1b7e1 + 33bd17d commit ed81aa8

File tree

2 files changed

+54
-36
lines changed

2 files changed

+54
-36
lines changed

theories/Colimits/Colimit_Pushout.v

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Require Import Basics.
22
Require Import Types.
3+
Require Import Diagrams.Graph.
4+
Require Import Diagrams.Diagram.
35
Require Import Diagrams.Span.
46
Require Import Diagrams.Cocone.
57
Require Import Colimits.Colimit.
@@ -26,12 +28,11 @@ Section PO.
2628
Proof.
2729
srapply Build_Cocone.
2830
- intros [|[]]; [ exact (inr' o g) | exact inl' | exact inr' ].
29-
- intros [] [] []; cbn. destruct b.
31+
- intros [u|b] [u'|b'] []; cbn. destruct b'.
3032
+ exact pp'.
3133
+ reflexivity.
3234
Defined.
3335

34-
3536
Definition pol' {f : A -> B} {g : A -> C} {Z} (Co : Cocone (span f g) Z)
3637
: B -> Z
3738
:= legs Co (inr true).
@@ -55,26 +56,38 @@ Section PO.
5556
:= colimp (D:=span f g) (inl tt) (inr true) tt a
5657
@ (colimp (D:=span f g) (inl tt) (inr false) tt a)^.
5758

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))
6071
(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.
6275
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'.
7684
Defined.
7785

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+
7891
Definition PO_ind_beta_pp (P : PO f g -> Type) (l' : forall b, P (pol b))
7992
(r' : forall c, P (por c)) (pp' : forall a, popp a # l' (f a) = r' (g a))
8093
: forall x, apD (PO_ind P l' r' pp') (popp x) = pp' x.
@@ -86,7 +99,7 @@ Section PO.
8699
rewrite (Colimit_ind_beta_colimp P _ _ (inl tt) (inr false) tt x).
87100
rewrite moveR_transport_p_V, moveR_moveL_transport_p.
88101
rewrite inv_pp, inv_V.
89-
exact (concat_p_Vp _ _).
102+
apply concat_p_Vp.
90103
Defined.
91104

92105
Definition PO_rec (P: Type) (l': B -> P) (r': C -> P)
@@ -98,15 +111,15 @@ Section PO.
98111
: forall x, ap (PO_rec P l' r' pp') (popp x) = pp' x.
99112
Proof.
100113
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.
106115
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).
110123
Defined.
111124

112125
(** A nice property: the pushout of an equivalence is an equivalence. *)
@@ -161,23 +174,27 @@ Section is_PO_pushout.
161174
* exact (por' Co).
162175
* exact (popp' Co).
163176
+ intros [Co Co'].
164-
srapply path_cocone; cbn.
177+
srapply path_cocone.
165178
* intros [[]|[]] x; simpl.
166179
1: apply (Co' (inl tt) (inr false) tt).
167180
all: reflexivity.
168-
* intros [[]|[]] [[]|[]] [] x; simpl.
181+
* cbn beta.
182+
intros [u|b] [u'|b'] [] x.
183+
destruct u, b'; cbn.
169184
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.
173190
+ intro h.
174191
apply path_forall.
175192
srapply Pushout_ind; cbn.
176193
1,2: reflexivity.
177-
intro a; cbn.
194+
intro a; cbn beta.
178195
nrapply transport_paths_FlFr'; apply equiv_p1_1q.
179196
unfold popp'; cbn.
180-
refine (_ @ concat_p1 _).
197+
rhs_V nrapply concat_p1.
181198
nrapply Pushout_rec_beta_pglue.
182199
Defined.
183200

theories/Homotopy/Hopf.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ Definition freudenthal_hspace' `{Univalence}
100100
: O_inverts (Tr (m +2+ m).+1) (loop_susp_unit X).
101101
Proof.
102102
set (r:=connecting_map_family (hopf_construction X)).
103-
rapply (OO_inverts_conn_map_factor_conn_map _ (m +2+ m) _ r).
103+
nrapply (OO_inverts_conn_map_factor_conn_map _ (m +2+ m) _ r).
104+
2, 4: exact _.
104105
1: apply O_lex_leq_Tr.
105-
rapply (conn_map_homotopic _ idmap).
106+
rapply (conn_map_homotopic _ equiv_idmap (r o loop_susp_unit X)).
106107
symmetry.
107108
nrapply hopf_retraction.
108109
Defined.

0 commit comments

Comments
 (0)