Timings for Wedge.v
Require Import Basics Types.
Require Import Pointed.Core Pointed.pSusp.
Require Import Colimits.Pushout.
Require Import Homotopy.Suspension.
Local Set Universe Minimization ToSet.
Local Open Scope pointed_scope.
Definition Wedge (X Y : pType) : pType
:= [Pushout (fun _ : Unit => point X) (fun _ => point Y), pushl (point X)].
Notation "X \/ Y" := (Wedge X Y) : pointed_scope.
Definition wedge_inl {X Y} : X $-> X \/ Y.
exact (fun x => pushl x).
Definition wedge_inr {X Y} : Y $-> X \/ Y.
exact (fun x => pushr x).
Definition wglue {X Y : pType}
: pushl (point X) = (pushr (point Y)) :> (X \/ Y) := pglue tt.
(** Wedge recursion into an unpointed type. *)
Definition wedge_rec' {X Y : pType} {Z : Type}
(f : X -> Z) (g : Y -> Z) (w : f pt = g pt)
: Wedge X Y -> Z.
Definition wedge_rec {X Y : pType} {Z : pType} (f : X $-> Z) (g : Y $-> Z)
: X \/ Y $-> Z.
snrapply (wedge_rec' f g).
exact (point_eq f @ (point_eq g)^).
Definition wedge_rec_beta_wglue {X Y Z : pType} (f : X $-> Z) (g : Y $-> Z)
: ap (wedge_rec f g) wglue = point_eq f @ (point_eq g)^
:= Pushout_rec_beta_pglue _ f g _ tt.
Definition wedge_pr1 {X Y : pType} : X \/ Y $-> X
:= wedge_rec pmap_idmap pconst.
Definition wedge_pr2 {X Y : pType} : X \/ Y $-> Y
:= wedge_rec pconst pmap_idmap.
Definition wedge_incl (X Y : pType) : X \/ Y $-> X * Y
:= pprod_corec _ wedge_pr1 wedge_pr2.
Definition wedge_incl_beta_wglue {X Y : pType}
: ap (@wedge_incl X Y) wglue = 1.
lhs_V nrapply eta_path_prod.
lhs_V nrapply ap_compose.
nrapply wedge_rec_beta_wglue.
lhs_V nrapply ap_compose.
nrapply wedge_rec_beta_wglue.
(** 1-universal property of wedge. *)
Lemma wedge_up X Y Z (f g : X \/ Y $-> Z)
: f $o wedge_inl $== g $o wedge_inl
-> f $o wedge_inr $== g $o wedge_inr
-> f $== g.
snrapply Build_pHomotopy.
snrapply (Pushout_ind _ p q).
nrapply transport_paths_FlFr'.
lhs nrapply (whiskerL _ (dpoint_eq q)).
rhs nrapply (whiskerR (dpoint_eq p)).
Global Instance hasbinarycoproducts : HasBinaryCoproducts pType.
snrapply Build_BinaryCoproduct.
snrapply Build_pHomotopy.
snrapply Build_pHomotopy.
refine (_ @ (ap_V _ (pglue tt))^).
refine (Pushout_rec_beta_pglue _ f g _ _ @ _).
(** *** Lemmas about wedge functions *)
Lemma wedge_pr1_inl {X Y} : wedge_pr1 $o (@wedge_inl X Y) $== pmap_idmap.
Lemma wedge_pr1_inr {X Y} : wedge_pr1 $o (@wedge_inr X Y) $== pconst.
snrapply Build_pHomotopy.
rhs nrapply (ap_V _ wglue).
exact (inverse2 (wedge_rec_beta_wglue pmap_idmap pconst)^).
Lemma wedge_pr2_inl {X Y} : wedge_pr2 $o (@wedge_inl X Y) $== pconst.
Lemma wedge_pr2_inr {X Y} : wedge_pr2 $o (@wedge_inr X Y) $== pmap_idmap.
snrapply Build_pHomotopy.
rhs nrapply (ap_V _ wglue).
exact (inverse2 (wedge_rec_beta_wglue pconst pmap_idmap)^).
(** Wedge of an indexed family of pointed types *)
(** Note that the index type is not necessarily pointed. An empty wedge is the unit type which is the zero object in the category of pointed types. *)
Definition FamilyWedge (I : Type) (X : I -> pType) : pType.
srefine (Pushout (A := I) (B := sig X) (C := pUnit) _ _).
exact (fun i => (i; pt)).
Definition fwedge_in' (I : Type) (X : I -> pType)
: forall i, X i $-> FamilyWedge I X
:= fun i => Build_pMap _ _ (fun x => pushl (i; x)) (pglue i).
(** We have an inclusion map [pushl : sig X -> FamilyWedge X]. When [I] is pointed, so is [sig X], and then this inclusion map is pointed. *)
Definition fwedge_in (I : pType) (X : I -> pType)
: psigma (pointed_fam X) $-> FamilyWedge I X
:= Build_pMap _ _ pushl (pglue pt).
(** Recursion principle for the wedge of an indexed family of pointed types. *)
Definition fwedge_rec (I : Type) (X : I -> pType) (Z : pType)
(f : forall i, X i $-> Z)
: FamilyWedge I X $-> Z.
(** We specify a universe variable here to prevent minimization to [Set]. *)
Global Instance hasallcoproducts_ptype : HasAllCoproducts pType@{u}.
snrapply Build_Coproduct.
snrapply Build_pHomotopy.
exact (Pushout_rec_beta_pglue Z _ (unit_name pt) (fun i => point_eq (f i)) _).
snrapply Build_pHomotopy.
exact (point_eq _ @ (point_eq _)^).
nrapply transport_paths_FlFr'.
(** Wedge inclusions into the product can be defined if the indexing type has decidable paths. This is because we need to choose which factor a given wedge summand should land in. *)
Definition fwedge_incl `{Funext} (I : Type) `(DecidablePaths I) (X : I -> pType)
: FamilyWedge I X $-> pproduct X
:= cat_coprod_prod X.
(** ** The pinch map on the suspension *)
(** Given a suspension, there is a natural map from the suspension to the wedge of the suspension with itself. This is known as the pinch map.
This is the image to keep in mind:
<<
*
/|\
/ | \
Susp X / | \
/ | \
* * merid(x)*
/|\ \ | /
/ | \ \ | /
/ | \ \ | /
/ | \ Pinch \|/
* merid(x)* ----------> *
\ | / /|\
\ | / / | \
\ | / / | \
\|/ / | \
* * merid(x)*
\ | /
\ | /
\ | /
\|/
*
>>
Note that this is only a conceptual picture as we aren't working with "reduced suspensions". This means we have to track back along [merid pt] making this map a little trickier to imagine. *)
(** The pinch map for a suspension. *)
Definition psusp_pinch (X : pType) : psusp X $-> psusp X \/ psusp X.
refine (Build_pMap _ _ (Susp_rec pt pt _) idpath).
refine (ap wedge_inl _ @ wglue @ ap wedge_inr _ @ wglue^).
1,2: exact (loop_susp_unit X x).
(** It should compute when [ap]ed on a merid. *)
Definition psusp_pinch_beta_merid {X : pType} (x : X)
: ap (psusp_pinch X) (merid x)
= ap wedge_inl (loop_susp_unit X x) @ wglue
@ ap wedge_inr (loop_susp_unit X x) @ wglue^.
rapply Susp_rec_beta_merid.
(** Doing wedge projections on the pinch map gives the identity. *)
Definition wedge_pr1_psusp_pinch {X}
: wedge_pr1 $o psusp_pinch X $== Id (psusp X).
snrapply Build_pHomotopy.
change (?t = _) with (t = loop_susp_unit X x).
lhs nrapply (ap_compose (psusp_pinch X)).
lhs nrapply (ap _ (psusp_pinch_beta_merid x)).
lhs nrapply (ap (fun x => _ @ x) (ap_V _ _)).
rhs nrapply (whiskerL _ (wedge_rec_beta_wglue _ _)).
lhs nrapply (ap (fun x => _ @ x)).
lhs_V nrapply ap_compose.
lhs nrapply (ap (fun x => _ @ x) (wedge_rec_beta_wglue _ _)).
lhs_V nrapply (ap_compose wedge_inl).
Definition wedge_pr2_psusp_pinch {X}
: wedge_pr2 $o psusp_pinch X $== Id (psusp X).
snrapply Build_pHomotopy.
change (?t = _) with (t = loop_susp_unit X x).
lhs nrapply (ap_compose (psusp_pinch X)).
lhs nrapply (ap _ (psusp_pinch_beta_merid x)).
lhs nrapply (ap (fun x => _ @ x) (ap_V _ _)).
rhs nrapply (whiskerL _ (wedge_rec_beta_wglue _ _)).
lhs nrapply (ap (fun x => _ @ x) _).
lhs_V nrapply ap_compose.
lhs nrapply (ap _ (wedge_rec_beta_wglue _ _)).
lhs_V nrapply (ap_compose wedge_inl).