Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ps/rr/redefine dpath as transport cleanup proofs #1879

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions theories/Algebra/AbGroups/Abelianization.v
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ Section Abel.
1: apply a.
intros [[x y] z].
refine (transport_compose _ _ _ _ @ _).
srapply dp_path_transport^-1%equiv.
apply c.
Defined.

Expand All @@ -96,9 +95,8 @@ Section Abel.
`{forall x, IsHSet (P x)}(a : forall x, P (ab x))
(c : forall x y z, DPath P (ab_comm x y z)
(a (x * (y * z))) (a (x * (z * y))))
(x y z : G) : dp_apD (Abel_ind P a c) (ab_comm x y z) = c x y z.
(x y z : G) : apD (Abel_ind P a c) (ab_comm x y z) = c x y z.
Proof.
apply dp_apD_path_transport.
refine (apD_compose' tr _ _ @ ap _ _ @ concat_V_pp _ _).
rapply Coeq_ind_beta_cglue.
Defined.
Expand All @@ -117,8 +115,7 @@ Section Abel.
(a : forall x, P (ab x)) : forall (x : Abel), P x.
Proof.
srapply (Abel_ind _ a).
intros; apply dp_path_transport.
apply path_ishprop.
intros; apply path_ishprop.
Defined.

(** And its recursion version. *)
Expand Down
3 changes: 1 addition & 2 deletions theories/Algebra/Groups/FreeProduct.v
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ Section FreeProduct.
snrapply Coeq_ind.
1: exact e.
intro a.
nrapply dp_path_transport^-1%equiv.
destruct a as [ [ [ [a | a ] | a] | a ] | a ].
+ destruct a as [[[x h1] h2] y].
apply dp_compose.
Expand All @@ -267,7 +266,7 @@ Section FreeProduct.
Proof.
srapply amal_type_ind.
1: exact e.
all: intros; apply dp_path_transport, path_ishprop.
all: intros; apply path_ishprop.
Defined.

(** From which we can derive the non-dependent eliminator / recursion principle *)
Expand Down
19 changes: 0 additions & 19 deletions theories/Colimits/Coeq.v
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,6 @@ Proof.
rapply GraphQuotient_rec_beta_gqglue.
Defined.

Definition Coeq_ind_dp {B A f g} (P : @Coeq B A f g -> Type)
(coeq' : forall a, P (coeq a))
(cglue' : forall b, DPath P (cglue b) (coeq' (f b)) (coeq' (g b)))
: forall w, P w.
Proof.
srapply (Coeq_ind P coeq'); intros b.
apply dp_path_transport^-1, cglue'.
Defined.

Definition Coeq_ind_dp_beta_cglue {B A f g} (P : @Coeq B A f g -> Type)
(coeq' : forall a, P (coeq a))
(cglue' : forall b, DPath P (cglue b) (coeq' (f b)) (coeq' (g b)))
(b : B)
: dp_apD (Coeq_ind_dp P coeq' cglue') (cglue b) = cglue' b.
Proof.
apply dp_apD_path_transport.
srapply Coeq_ind_beta_cglue.
Defined.

(** ** Universal property *)

Definition Coeq_unrec {B A} (f g : B -> A) {P}
Expand Down
9 changes: 2 additions & 7 deletions theories/Colimits/GraphQuotient.v
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ Section Flattening.
Lemma equiv_dp_dgraphquotient (x y : A) (s : R x y) (a : F x) (b : F y)
: DPath DGraphQuotient (gqglue s) a b <~> (e x y s a = b).
Proof.
refine (_ oE dp_path_transport^-1).
refine (equiv_concat_l _^ _).
apply transport_DGraphQuotient.
Defined.
Expand All @@ -132,21 +131,17 @@ Section Flattening.
snrapply GraphQuotient_ind.
1: exact Qgq.
intros a b s.
apply equiv_dp_path_transport.
apply dp_forall.
intros x y.
srapply (equiv_ind (equiv_dp_dgraphquotient a b s x y)^-1).
intros q.
destruct q.
apply equiv_dp_path_transport.
refine (transport2 _ _ _ @ Qgqglue a b s x).
refine (ap (path_sigma_uncurried DGraphQuotient _ _) _).
snrapply path_sigma.
1: reflexivity.
apply moveR_equiv_V.
simpl; f_ap.
lhs rapply concat_p1.
rapply inv_V.
lhs nrapply concat_p1.
apply inv_V.
Defined.

(** Rather than use [flatten_ind] to define [flatten_rec] we reprove this simple case. This means we can later reason about it and derive the computation rules easily. The full computation rule for [flatten_ind] takes some work to derive and is not actually needed. *)
Expand Down
39 changes: 11 additions & 28 deletions theories/Colimits/MappingCylinder.v
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,24 @@ Section MappingCylinder.
(cylb : forall b, P (cyr b))
(cylg : forall a, DPath P (cyglue a) (cyla a) (cylb (f a))).

Definition Cyl_ind_dp : forall c, P c.
Proof.
srapply Pushout_ind.
- apply cyla.
- apply cylb.
- intros a; apply dp_path_transport^-1, cylg.
Defined.

Definition Cyl_ind_dp_beta_cyglue (a : A)
: dp_apD Cyl_ind_dp (cyglue a) = cylg a.
Proof.
unfold Cyl_ind_dp.
refine ((dp_path_transport_apD _ _)^ @ _).
apply moveR_equiv_M.
rapply Pushout_ind_beta_pglue.
Defined.
Definition Cyl_ind : forall c, P c
:= Pushout_ind _ cyla cylb cylg.

Definition Cyl_ind_beta_cyglue (a : A)
: apD Cyl_ind (cyglue a) = cylg a
:= Pushout_ind_beta_pglue _ _ _ _ _.

End CylInd.

Section CylRec.
Context {P : Type} (cyla : A -> P) (cylb : B -> P) (cylg : cyla == cylb o f).

Definition Cyl_rec : Cyl f -> P.
Proof.
srapply Pushout_rec.
- apply cyla.
- apply cylb.
- apply cylg.
Defined.
Definition Cyl_rec : Cyl f -> P
:= Pushout_rec _ cyla cylb cylg.

Definition Cyl_rec_beta_cyglue (a : A)
: ap Cyl_rec (cyglue a) = cylg a.
Proof.
rapply Pushout_rec_beta_pglue.
Defined.
: ap Cyl_rec (cyglue a) = cylg a
:= Pushout_rec_beta_pglue _ _ _ _ _.

End CylRec.

Expand All @@ -82,7 +65,7 @@ Section MappingCylinder.
+ exact f.
+ exact idmap.
+ reflexivity.
- srapply Cyl_ind_dp.
- srapply Cyl_ind.
+ intros a; cbn.
symmetry; apply cyglue.
+ intros b; reflexivity.
Expand Down
Loading
Loading