Skip to content

Commit 1df4ec3

Browse files
committed
add apD_natural to PathGroupoids.v
1 parent d4a8621 commit 1df4ec3

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

contrib/HoTTBookExercises.v

+1-10
Original file line numberDiff line numberDiff line change
@@ -702,16 +702,7 @@ Definition Book_2_16 := @HoTT.Metatheory.FunextVarieties.NaiveFunext_implies_Fun
702702
(* ================================================== ex:dep-htpy-natural *)
703703
(** Exercise 2.18 *)
704704

705-
(** This exercise is solved in the library as HoTT.Basics.PathGroupoids.apD_homotopic *)
706-
707-
Definition Book_2_18 {A : Type} {B : A -> Type} {f g : forall x, B x}
708-
(H : forall x, f x = g x) {x y : A} (p : x = y)
709-
: apD f p @ H y = ap (transport B p) (H x) @ apD g p.
710-
Proof.
711-
destruct p.
712-
unfold transport.
713-
exact (concat_1p _ @ (ap_idmap _)^ @ (concat_p1 _)^).
714-
Defined.
705+
Definition Book_2_18 := @HoTT.Basics.PathGroupoids.apD_natural.
715706

716707
(* ================================================== ex:equiv-functor-set *)
717708
(** Exercise 3.1 *)

theories/Basics/PathGroupoids.v

+10-3
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,21 @@ Definition concat_pA1 {A : Type} {f : A -> A} (p : forall x, x = f x) {x y : A}
479479
| idpath => concat_p1_1p _
480480
end.
481481

482+
Definition apD_natural {A : Type} {B : A -> Type} {f g : forall x, B x}
483+
(p : forall x, f x = g x) {x y : A} (q : x = y)
484+
: apD f q @ p y = ap (transport B q) (p x) @ apD g q.
485+
Proof.
486+
destruct q.
487+
unfold transport.
488+
exact (concat_1p _ @ (ap_idmap _)^ @ (concat_p1 _)^).
489+
Defined.
490+
482491
Definition apD_homotopic {A : Type} {B : A -> Type} {f g : forall x, B x}
483492
(p : forall x, f x = g x) {x y : A} (q : x = y)
484493
: apD f q = ap (transport B q) (p x) @ apD g q @ (p y)^.
485494
Proof.
486495
apply moveL_pV.
487-
destruct q; unfold apD, transport.
488-
symmetry.
489-
exact (concat_p1 _ @ ap_idmap _ @ (concat_1p _)^).
496+
exact (apD_natural _ _).
490497
Defined.
491498

492499
(** Naturality with other paths hanging around. *)

0 commit comments

Comments
 (0)