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

Wedge of a family of pType #1829

Merged
merged 3 commits into from
Jan 25, 2024
Merged
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
53 changes: 51 additions & 2 deletions theories/Homotopy/Wedge.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Require Import Basics Types.Paths.
Require Import Basics Types.
Require Import Pointed.Core.
Require Import Colimits.Pushout.
Require Import WildCat.
Expand Down Expand Up @@ -100,4 +100,53 @@ Proof.
by pelim f g.
- intros Z f g p q.
by apply wedge_up.
Defined.
Defined.

(** Wedge of an indexed family of pointed types *)

(** Note that the index type is not necesserily 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.
Proof.
snrapply Build_pType.
- srefine (Pushout (A := I) (B := sig X) (C := pUnit) _ _).
+ exact (fun i => (i; pt)).
+ exact (fun _ => pt).
- apply pushr.
exact pt.
Defined.

(** 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.
Proof.
snrapply Build_pMap.
- exact pushl.
- exact (pglue pt).
Defined.

(** Recursion principle for the wedge of an indexed family of pointed types. *)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an equivalence, which means that FamilyWedge X is a coproduct in pType. Does the Wildcat library have coproducts where the summands are indexed by a type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add such coproducts yet, but it should be straightforward.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll hold off on making this an equivalence for now and perhaps introduce it when we have that result for coproducts.

Definition fwedge_rec (I : Type) (X : I -> pType) (Z : pType)
(f : forall i, X i $-> Z)
: FamilyWedge I X $-> Z.
Proof.
snrapply Build_pMap.
- snrapply Pushout_rec.
+ apply (sig_rec _ _ _ f).
+ exact pconst.
+ intros i.
exact (point_eq (f i)).
- exact idpath.
Defined.

(** 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 should land. This makes it somewhat awkward to work with, however in practice we typically only care about decidable index sets. *)
Definition fwedge_incl `{Funext} (I : Type) `(DecidablePaths I) (X : I -> pType)
: FamilyWedge I X $-> pproduct X.
Proof.
snrapply fwedge_rec.
intro i.
snrapply pproduct_corec.
intro a.
destruct (dec_paths i a).
- destruct p; exact pmap_idmap.
- exact pconst.
Defined.
12 changes: 12 additions & 0 deletions theories/Pointed/Core.v
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@ Definition psigma {A : pType} (P : pFam A) : pType
Definition pproduct {A : Type} (F : A -> pType) : pType
:= [forall (a : A), pointed_type (F a), ispointed_type o F].

Definition pproduct_corec `{Funext} {A : Type} (F : A -> pType)
(X : pType) (f : forall a, X ->* F a)
: X ->* pproduct F.
Proof.
snrapply Build_pMap.
- intros x a.
exact (f a x).
- cbn.
funext a.
apply point_eq.
Defined.

(** The following tactics often allow us to "pretend" that pointed maps and homotopies preserve basepoints strictly. *)

(** First a version with no rewrites, which leaves some cleanup to be done but which can be used in transparent proofs. *)
Expand Down
Loading