Built with Alectryon, running Coq+SerAPI v8.19.0+0.19.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
Require Import Homotopy.IdentitySystems.Require Import WildCat.Require Import Truncations.Core.Require Import ReflectiveSubuniverse.Require Import Extensions.Local Set Polymorphic Inductive Cumulativity.Declare Scope pointed_scope.LocalOpen Scope pointed_scope.LocalOpen Scope path_scope.Generalizable VariablesA B f.(** ** Pointed Types *)Notation"'pt'" := (point _) : pointed_scope.Notation"[ X , x ]" := (Build_pType X x) : pointed_scope.(** The unit type is pointed *)Instanceispointed_unit : IsPointed Unit := tt.(** The Unit [pType] *)DefinitionpUnit : pType := [Unit, tt].(** A sigma type of pointed components is pointed. *)Instanceispointed_sigma `{IsPointed A} `{IsPointed (B (point A))}
: IsPointed (sig B)
:= (point A; point (B (point A))).(** A product of pointed types is pointed. *)Instanceispointed_prod `{IsPointed A, IsPointed B} : IsPointed (A * B)
:= (point A, point B).(** We override the notation for products in pointed_scope *)Notation"X * Y" := ([X * Y, ispointed_prod]) : pointed_scope.(** A pointed type family consists of a type family over a pointed type and a section of that family at the basepoint. By making this a Record, it has one fewer universe variable, and is cumulative. We declare [pfam_pr1] to be a coercion [pFam >-> Funclass]. *)RecordpFam (A : pType) := { pfam_pr1 :> A -> Type; dpoint : pfam_pr1 (point A)}.Arguments Build_pFam {A} _ _.Arguments pfam_pr1 {A} P : rename.Arguments dpoint {A} P : rename.(** The constant pointed family *)Definitionpfam_const {A : pType} (B : pType) : pFam A
:= Build_pFam (fun_ => pointed_type B) (point B).(** [IsTrunc] for a pointed type family *)ClassIsTrunc_pFamn {A} (P : pFam A)
:= trunc_pfam_is_trunc : forallx, IsTrunc n (P x).(** Pointed dependent functions *)RecordpForall (A : pType) (P : pFam A) := {
pointed_fun : forallx, P x ;
dpoint_eq : pointed_fun (point A) = dpoint P ;
}.Arguments dpoint_eq {A P} f : rename.Arguments pointed_fun {A P} f : rename.Coercionpointed_fun : pForall >-> Funclass.(** ** Pointed functions *)(** A pointed map is a map with a proof that it preserves the point. We define it as as a notation for a non-dependent version of [pForall]. *)Notation"A ->* B" := (pForall A (pfam_const B)) : pointed_scope.DefinitionBuild_pMap {AB : pType} (f : A -> B) (p : f (point A) = point B)
: A ->* B
:= Build_pForall A (pfam_const B) f p.(** The [&] is a bidirectionality hint that tells Coq to unify with the typing context after type checking the arguments to the left. In practice, this allows Coq to infer [A] and [B] from the context. *)Arguments Build_pMap {A B} & f p.(** Pointed maps preserve the base point *)Definitionpoint_eq {AB : pType} (f : A ->* B)
: f (point A) = point B
:= dpoint_eq f.(** The identity pointed map *)Definitionpmap_idmap {A : pType} : A ->* A
:= Build_pMap idmap 1.(** Composition of pointed maps *)Definitionpmap_compose {ABC : pType} (g : B ->* C) (f : A ->* B)
: A ->* C
:= Build_pMap (g o f) (ap g (point_eq f) @ point_eq g).Infix"o*" := pmap_compose : pointed_scope.(** ** Pointed homotopies *)(** A pointed homotopy is a homotopy with a proof that the preservation paths agree. We define it instead as a special case of a [pForall]. This means that we can define pointed homotopies between pointed homotopies. *)Definitionpfam_phomotopy {A : pType} {P : pFam A} (fg : pForall A P) : pFam A
:= Build_pFam (funx => f x = g x) (dpoint_eq f @ (dpoint_eq g)^).DefinitionpHomotopy {A : pType} {P : pFam A} (fg : pForall A P)
:= pForall A (pfam_phomotopy f g).Infix"==*" := pHomotopy : pointed_scope.DefinitionBuild_pHomotopy {A : pType} {P : pFam A} {fg : pForall A P}
(p : f == g) (q : p (point A) = dpoint_eq f @ (dpoint_eq g)^)
: f ==* g
:= Build_pForall A (pfam_phomotopy f g) p q.(** The underlying homotopy of a pointed homotopy *)Coercionpointed_htpy {A : pType} {P : pFam A} {f g : pForall A P} (h : f ==* g)
: f == g
:= h.(** This is the form that the underlying proof of a pointed homotopy used to take before we changed it to be defined in terms of [pForall]. *)
A: pType P: pFam A f, g: pForall A P h: f ==* g
h pt @ dpoint_eq g = dpoint_eq f
A: pType P: pFam A f, g: pForall A P h: f ==* g
h pt @ dpoint_eq g = dpoint_eq f
A: pType P: pFam A f, g: pForall A P h: f ==* g
h pt = dpoint_eq f @ (dpoint_eq g)^
exact (dpoint_eq h).Defined.(** ** Pointed equivalences *)(** A pointed equivalence is a pointed map and a proof that it is an equivalence *)RecordpEquiv (AB : pType) := {
pointed_equiv_fun : pForall A (pfam_const B) ;
pointed_isequiv :: IsEquiv pointed_equiv_fun ;
}.Arguments Build_pEquiv {A B} & _ _.(** TODO: It might be better behaved to define [pEquiv] as an equivalence and a proof that this equivalence is pointed. In pEquiv.v we have another constructor [Build_pEquiv'] which Coq can infer faster than [Build_pEquiv]. *)Infix"<~>*" := pEquiv : pointed_scope.(** Note: because we define [pMap] as a special case of [pForall], we must declare all coercions into [pForall], *not* into [pMap]. *)Coercionpointed_equiv_fun : pEquiv >-> pForall.Coercionpointed_equiv_equiv {A B} (f : A <~>* B)
: A <~> B := Build_Equiv A B f _.(** The pointed identity is a pointed equivalence *)Definitionpequiv_pmap_idmap {A} : A <~>* A
:= Build_pEquiv pmap_idmap _.(** Pointed sigma types *)Definitionpsigma {A : pType} (P : pFam A) : pType
:= [sig P, (point A; dpoint P)].(** *** Pointed products *)(** Pointed pi types; note that the domain is not pointed *)Definitionpproduct {A : Type} (F : A -> pType) : pType
:= [forall (a : A), pointed_type (F a), ispointed_type o F].
H: Funext A: Type F: A -> pType X: pType f: foralla : A, X ->* F a
X ->* pproduct F
H: Funext A: Type F: A -> pType X: pType f: foralla : A, X ->* F a
X ->* pproduct F
H: Funext A: Type F: A -> pType X: pType f: foralla : A, X ->* F a
X -> pproduct F
H: Funext A: Type F: A -> pType X: pType f: foralla : A, X ->* F a
?f pt = pt
H: Funext A: Type F: A -> pType X: pType f: foralla : A, X ->* F a
X -> pproduct F
H: Funext A: Type F: A -> pType X: pType f: foralla : A, X ->* F a x: X a: A
F a
exact (f a x).
H: Funext A: Type F: A -> pType X: pType f: foralla : A, X ->* F a
(funx : X => (funa : A => f a x) : pproduct F) pt =
pt
H: Funext A: Type F: A -> pType X: pType f: foralla : A, X ->* F a
(funa : A => f a pt) =
(funx : A => ispointed_type (F x))
H: Funext A: Type F: A -> pType X: pType f: foralla : A, X ->* F a a: A
f a pt = ispointed_type (F a)
apply point_eq.Defined.
A: Type F: A -> pType a: A
pproduct F ->* F a
A: Type F: A -> pType a: A
pproduct F ->* F a
A: Type F: A -> pType a: A
pproduct F -> F a
A: Type F: A -> pType a: A
?f pt = pt
A: Type F: A -> pType a: A
pproduct F -> F a
A: Type F: A -> pType a: A x: pproduct F
F a
exact (x a).
A: Type F: A -> pType a: A
(funx : pproduct F => x a) pt = pt
reflexivity.Defined.(** The projections from a pointed product are pointed maps. *)Definitionpfst {AB : pType} : A * B ->* A
:= Build_pMap fst idpath.Definitionpsnd {AB : pType} : A * B ->* B
:= Build_pMap snd idpath.Definitionpprod_corec {XY} (Z : pType) (f : Z ->* X) (g : Z ->* Y)
: Z ->* (X * Y)
:= Build_pMap (funz => (f z, g z))
(path_prod' (point_eq _) (point_eq _)).
X, Y, Z: pType f: Z ->* X g: Z ->* Y
pfst o* pprod_corec Z f g ==* f
X, Y, Z: pType f: Z ->* X g: Z ->* Y
pfst o* pprod_corec Z f g ==* f
X, Y, Z: pType f: Z ->* X g: Z ->* Y
pfst o* pprod_corec Z f g == f
X, Y, Z: pType f: Z ->* X g: Z ->* Y
?p pt =
dpoint_eq (pfst o* pprod_corec Z f g) @ (dpoint_eq f)^
X, Y, Z: pType f: Z ->* X g: Z ->* Y
(funx0 : Z => 1) pt =
dpoint_eq (pfst o* pprod_corec Z f g) @ (dpoint_eq f)^
X, Y, Z: pType f: Z ->* X g: Z ->* Y
1 @ dpoint_eq f =
dpoint_eq (pfst o* pprod_corec Z f g)
X, Y, Z: pType f: Z ->* X g: Z ->* Y
ap pfst (point_eq (pprod_corec Z f g)) = dpoint_eq f
apply ap_fst_path_prod'.Defined.
X, Y, Z: pType f: Z ->* X g: Z ->* Y
psnd o* pprod_corec Z f g ==* g
X, Y, Z: pType f: Z ->* X g: Z ->* Y
psnd o* pprod_corec Z f g ==* g
X, Y, Z: pType f: Z ->* X g: Z ->* Y
psnd o* pprod_corec Z f g == g
X, Y, Z: pType f: Z ->* X g: Z ->* Y
?p pt =
dpoint_eq (psnd o* pprod_corec Z f g) @ (dpoint_eq g)^
X, Y, Z: pType f: Z ->* X g: Z ->* Y
(funx0 : Z => 1) pt =
dpoint_eq (psnd o* pprod_corec Z f g) @ (dpoint_eq g)^
X, Y, Z: pType f: Z ->* X g: Z ->* Y
1 @ dpoint_eq g =
dpoint_eq (psnd o* pprod_corec Z f g)
X, Y, Z: pType f: Z ->* X g: Z ->* Y
ap psnd (point_eq (pprod_corec Z f g)) = dpoint_eq g
apply ap_snd_path_prod'.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. *)Ltacpointed_reduce :=
(*TODO: are these correct? *)unfold pointed_fun, pointed_htpy;
cbnin *;
repeatmatch goal with
| [ X : pType |- _ ] => destruct X as [X ?point]
| [ P : pFam ?X |- _ ] => destruct P as [P ?]
| [ phi : pForall ?X?Y |- _ ] => destruct phi as [phi ?]
| [ alpha : pHomotopy ?f?g |- _ ] => letH := freshindestruct alpha as [alpha H]; try (apply moveR_pM in H)
| [ equiv : pEquiv ?X?Y |- _ ] => destruct equiv as [equiv ?iseq]
end;
cbnin *; unfold point in *;
path_induction; cbn.(** Next a version that uses [rewrite], and should only be used in opaque proofs. *)Ltacpointed_reduce_rewrite :=
pointed_reduce;
rewrite?concat_p1, ?concat_1p.(** Finally, a version that just strictifies a single map or equivalence. This has the advantage that it leaves the context more readable. *)Ltacpointed_reduce_pmap f
:= trymatchtype of f with
| pEquiv ?X?Y => destruct f as [f ?iseq]
end;
matchtype of f with
| _ ->* ?Y => letp := freshindestruct Y as [Y ?], f as [f p]; cbnin *; destruct p; cbnend.(** A general tactic to replace pointedness paths in a [pForall] with reflexivity. Because it generalizes [f pt], it can usually only be applied once the function itself is not longer needed. Compared to [pointed_reduce], an advantage is that the pointed types do not need to be destructed. *)Ltacpelim f :=
trymatchtype of f with
| pEquiv ?X?Y => destruct f as [f ?iseq]; unfold pointed_fun in *
end;
destruct f as [f ?ptd];
cbnin f, ptd |- *;
matchtype of ptd with?fpt = _ => generalize dependent fpt end;
napply paths_ind_r;
tryclear f.Tactic Notation"pelim"constr(x0) := pelim x0.Tactic Notation"pelim"constr(x0) constr(x1) := pelim x0; pelim x1.Tactic Notation"pelim"constr(x0) constr(x1) constr(x2) := pelim x0; pelim x1 x2.Tactic Notation"pelim"constr(x0) constr(x1) constr(x2) constr(x3) := pelim x0; pelim x1 x2 x3.Tactic Notation"pelim"constr(x0) constr(x1) constr(x2) constr(x3) constr(x4) := pelim x0; pelim x1 x2 x3 x4.Tactic Notation"pelim"constr(x0) constr(x1) constr(x2) constr(x3) constr(x4) constr(x5) := pelim x0; pelim x1 x2 x3 x4 x5.Tactic Notation"pelim"constr(x0) constr(x1) constr(x2) constr(x3) constr(x4) constr(x5) constr(x6) := pelim x0; pelim x1 x2 x3 x4 x5 x6.(** ** Equivalences to sigma-types. *)(** [pType] *)Definitionissig_ptype : { X : Type & X } <~> pType := ltac:(issig).(** [pForall] *)Definitionissig_pforall (A : pType) (P : pFam A)
: {f : forallx, P x & f (point A) = dpoint P} <~> (pForall A P)
:= ltac:(issig).(** [pMap] *)Definitionissig_pmap (AB : pType)
: {f : A -> B & f (point A) = point B} <~> (A ->* B)
:= ltac:(issig).(** [pHomotopy] *)Definitionissig_phomotopy {A : pType} {P : pFam A} (fg : pForall A P)
: {p : f == g & p (point A) = dpoint_eq f @ (dpoint_eq g)^} <~> (f ==* g)
:= ltac:(issig).(** [pEquiv] *)Definitionissig_pequiv (AB : pType)
: {f : A ->* B & IsEquiv f} <~> (A <~>* B)
:= ltac:(issig).(** The record for pointed equivalences is equivalently a different sigma type *)Definitionissig_pequiv' (AB : pType)
: {f : A <~> B & f (point A) = point B} <~> (A <~>* B)
:= ltac:(make_equiv).(** [pForall] can also be described as a type of extensions. *)
H: Funext A: pType P: pFam A
ExtensionAlong (unit_name pt) P (unit_name (dpoint P)) <~>
pForall A P
H: Funext A: pType P: pFam A
ExtensionAlong (unit_name pt) P (unit_name (dpoint P)) <~>
pForall A P
H: Funext A: pType P: pFam A
{s : forally : A, P y & Unit -> s pt = dpoint P} <~>
pForall A P
H: Funext A: pType P: pFam A
{s : forally : A, P y & Unit -> s pt = dpoint P} <~>
{f : forallx : A, P x & f pt = dpoint P}
H: Funext A: pType P: pFam A s: forally : A, P y
(Unit -> s pt = dpoint P) <~> s pt = dpoint P
symmetry; apply equiv_unit_rec.Defined.(** This is [equiv_prod_coind] for pointed families. *)
A: pType P, Q: pFam A
pForall A P * pForall A Q <~>
pForall A
{|
pfam_pr1 := funa : A => (P a * Q a)%type;
dpoint := (dpoint P, dpoint Q)
|}
A: pType P, Q: pFam A
pForall A P * pForall A Q <~>
pForall A
{|
pfam_pr1 := funa : A => (P a * Q a)%type;
dpoint := (dpoint P, dpoint Q)
|}
A: pType P, Q: pFam A
pForall A P * pForall A Q <~>
{p : (foralla : A, P a) * (foralla : A, Q a) &
((fst p pt = dpoint P) * (snd p pt = dpoint Q))%type}
A: pType P, Q: pFam A
{p : (foralla : A, P a) * (foralla : A, Q a) &
((fst p pt = dpoint P) * (snd p pt = dpoint Q))%type} <~>
pForall A
{|
pfam_pr1 := funa : A => (P a * Q a)%type;
dpoint := (dpoint P, dpoint Q)
|}
A: pType P, Q: pFam A
{p : (foralla : A, P a) * (foralla : A, Q a) &
((fst p pt = dpoint P) * (snd p pt = dpoint Q))%type} <~>
pForall A
{|
pfam_pr1 := funa : A => (P a * Q a)%type;
dpoint := (dpoint P, dpoint Q)
|}
A: pType P, Q: pFam A
{p : (foralla : A, P a) * (foralla : A, Q a) &
((fst p pt = dpoint P) * (snd p pt = dpoint Q))%type} <~>
{f
: forallx : A,
{|
pfam_pr1 := funa : A => (P a * Q a)%type;
dpoint := (dpoint P, dpoint Q)
|} x &
f pt =
dpoint
{|
pfam_pr1 := funa : A => (P a * Q a)%type;
dpoint := (dpoint P, dpoint Q)
|}}
A: pType P, Q: pFam A
(foralla : A, P a) * (foralla : A, Q a) <~>
(forallx : A,
{|
pfam_pr1 := funa : A => (P a * Q a)%type;
dpoint := (dpoint P, dpoint Q)
|} x)
A: pType P, Q: pFam A
foralla : (foralla : A, P a) * (foralla : A, Q a),
(funp : (foralla0 : A, P a0) * (foralla0 : A, Q a0)
=>
((fst p pt = dpoint P) * (snd p pt = dpoint Q))%type)
a <~>
(funf : forallx : A,
{|
pfam_pr1 := funa0 : A => (P a0 * Q a0)%type;
dpoint := (dpoint P, dpoint Q)
|} x =>
f pt =
dpoint
{|
pfam_pr1 := funa0 : A => (P a0 * Q a0)%type;
dpoint := (dpoint P, dpoint Q)
|}) (?f a)
A: pType P, Q: pFam A
foralla : (foralla : A, P a) * (foralla : A, Q a),
(funp : (foralla0 : A, P a0) * (foralla0 : A, Q a0)
=>
((fst p pt = dpoint P) * (snd p pt = dpoint Q))%type)
a <~>
(funf : forallx : A,
{|
pfam_pr1 := funa0 : A => (P a0 * Q a0)%type;
dpoint := (dpoint P, dpoint Q)
|} x =>
f pt =
dpoint
{|
pfam_pr1 := funa0 : A => (P a0 * Q a0)%type;
dpoint := (dpoint P, dpoint Q)
|}) (equiv_prod_coind P Q a)
A: pType P, Q: pFam A f: ((foralla : A, P a) * (foralla : A, Q a))%type
(fst f pt = dpoint P) * (snd f pt = dpoint Q) <~>
prod_coind_uncurried f pt = (dpoint P, dpoint Q)
A: pType P, Q: pFam A f: ((foralla : A, P a) * (foralla : A, Q a))%type
(fst f pt = dpoint P) * (snd f pt = dpoint Q) <~>
(fst f pt, snd f pt) = (dpoint P, dpoint Q)
exact (equiv_path_prod (fst f _, snd f _) (dpoint P, dpoint Q)).Defined.
apply path_prod; apply point_eq.Defined.(** [isequiv_functor_prod] applies, and is an Instance. *)Definitionequiv_functor_pprod {AA'BB' : pType} (f : A <~>* A') (g : B <~>* B')
: A * B <~>* A' * B'
:= Build_pEquiv (functor_pprod f g) _.(** ** Various operations with pointed homotopies *)(** For the following three instances, the typeclass (e.g. [Reflexive]) requires a third universe variable, the maximum of the universe of [A] and the universe of the values of [P]. Because of this, in each case we first prove a version not mentioning the typeclass, which avoids a stray universe variable. *)(** [pHomotopy] is a reflexive relation *)Definitionphomotopy_reflexive {A : pType} {P : pFam A} (f : pForall A P)
: f ==* f
:= Build_pHomotopy (funx => 1) (concat_pV _)^.Instancephomotopy_reflexive' {A : pType} {P : pFam A}
: Reflexive (@pHomotopy A P)
:= @phomotopy_reflexive A P.(** [pHomotopy] is a symmetric relation *)
A: pType P: pFam A f, g: pForall A P p: f ==* g
g ==* f
A: pType P: pFam A f, g: pForall A P p: f ==* g
g ==* f
A: pType P: pFam A f, g: pForall A P p: f ==* g
g == f
A: pType P: pFam A f, g: pForall A P p: f ==* g
?Goal pt = dpoint_eq g @ (dpoint_eq f)^
A: pType P: pFam A f, g: pForall A P p: f ==* g
((funx : A => (p x)^) : g == f) pt =
dpoint_eq g @ (dpoint_eq f)^
by pelim p f g.Defined.Instancephomotopy_symmetric' {AP}
: Symmetric (@pHomotopy A P)
:= @phomotopy_symmetric A P.Notation"p ^*" := (phomotopy_symmetric p) : pointed_scope.(** [pHomotopy] is a transitive relation *)
A: pType P: pFam A f, g, h: pForall A P p: f ==* g q: g ==* h
f ==* h
A: pType P: pFam A f, g, h: pForall A P p: f ==* g q: g ==* h
f ==* h
A: pType P: pFam A f, g, h: pForall A P p: f ==* g q: g ==* h
(funx : A => p x @ q x) pt =
dpoint_eq f @ (dpoint_eq h)^
A: pType P: pFam A f, g, h: pForall A P p: f ==* g q: g ==* h
dpoint_eq f @
((dpoint_eq g)^ @ dpoint (pfam_phomotopy g h)) =
dpoint_eq f @ (dpoint_eq h)^
napply whiskerL; napply concat_V_pp.Defined.Instancephomotopy_transitive' {AP} : Transitive (@pHomotopy A P)
:= @phomotopy_transitive A P.Notation"p @* q" := (phomotopy_transitive p q) : pointed_scope.(** ** Whiskering of pointed homotopies by pointed functions *)
A, B, C: pType f, g: A ->* B h: B ->* C p: f ==* g
h o* f ==* h o* g
A, B, C: pType f, g: A ->* B h: B ->* C p: f ==* g
h o* f ==* h o* g
A, B, C: pType f, g: A ->* B h: B ->* C p: f ==* g
(funx : A => h (f x)) == (funx : A => h (g x))
A, B, C: pType f, g: A ->* B h: B ->* C p: f ==* g
?Goal pt =
(ap h (point_eq f) @ point_eq h) @
(ap h (point_eq g) @ point_eq h)^
A, B, C: pType f, g: A ->* B h: B ->* C p: f ==* g
(funx : A => ap h (p x)) pt =
(ap h (point_eq f) @ point_eq h) @
(ap h (point_eq g) @ point_eq h)^
by pelim p f g h.Defined.
A, B, C: pType f: A ->* B g, h: B ->* C p: g ==* h
g o* f ==* h o* f
A, B, C: pType f: A ->* B g, h: B ->* C p: g ==* h
g o* f ==* h o* f
A, B, C: pType f: A ->* B g, h: B ->* C p: g ==* h
(funx : A => g (f x)) == (funx : A => h (f x))
A, B, C: pType f: A ->* B g, h: B ->* C p: g ==* h
?Goal pt =
(ap g (point_eq f) @ point_eq g) @
(ap h (point_eq f) @ point_eq h)^
A, B, C: pType f: A ->* B g, h: B ->* C p: g ==* h
(funx : A => p (f x)) pt =
(ap g (point_eq f) @ point_eq g) @
(ap h (point_eq f) @ point_eq h)^
by pelim f p g h.Defined.(** ** 1-categorical properties of [pType]. *)(** Composition of pointed maps is associative up to pointed homotopy *)
A, B, C, D: pType h: C ->* D g: B ->* C f: A ->* B
h o* g o* f ==* h o* (g o* f)
A, B, C, D: pType h: C ->* D g: B ->* C f: A ->* B
h o* g o* f ==* h o* (g o* f)
A, B, C, D: pType h: C ->* D g: B ->* C f: A ->* B
h o* g o* f == h o* (g o* f)
A, B, C, D: pType h: C ->* D g: B ->* C f: A ->* B
by pelim p f g.Defined.(** ** The pointed category structure of [pType] *)(** Pointed types of pointed maps *)(** A family of pointed types gives rise to a [pFam]. *)Definitionpointed_fam {A : pType} (B : A -> pType) : pFam A
:= Build_pFam (pointed_type o B) (point (B (point A))).(** The section of a family of pointed types *)Definitionpoint_pforall {A : pType} (B : A -> pType) : pForall A (pointed_fam B)
:= Build_pForall A (pointed_fam B) (funx => point (B x)) 1.(** The pointed type of dependent pointed maps. Note that we need a family of pointed types, not just a family of types with a point over the basepoint of [A]. *)DefinitionppForall (A : pType) (B : A -> pType) : pType
:= [pForall A (pointed_fam B), point_pforall B].Notation"'ppforall' x .. y , P"
:= (ppForall _ (funx => .. (ppForall _ (funy => P)) ..))
: pointed_scope.(** The constant (zero) map *)Definitionpconst {AB : pType} : A ->* B
:= point_pforall (fun_ => B).(** The pointed type of pointed maps. This is a special case of [ppForall]. *)DefinitionppMap (AB : pType) : pType
:= [A ->* B, pconst].Infix"->**" := ppMap : pointed_scope.
((funx : pUnit =>
match x as u return (pconst u = f u) with
| tt => (point_eq f)^
end)
:
pconst == f) pt = dpoint_eq pconst @ (dpoint_eq f)^
exact (concat_1p _)^.Defined.
H: Funext A, B: pType C: Contr A
Contr (A ->* B)
H: Funext A, B: pType C: Contr A
Contr (A ->* B)
H: Funext A, B: pType C: Contr A
{b : B & b = pt} <~> (A ->* B)
H: Funext A, B: pType C: Contr A
{b : B & b = pt} <~> {f : A -> B & f pt = pt}
exact (equiv_functor_sigma_pb (equiv_arrow_from_contr A B)^-1%equiv).Defined.(** * [pType] and [pForall] as wild categories *)(** Note that the definitions for [pForall] are also used for the higher structure in [pType]. *)(** [pType] is a graph *)Instanceisgraph_ptype : IsGraph pType
:= Build_IsGraph pType (funXY => X ->* Y).(** [pForall] is a graph *)Instanceisgraph_pforall (A : pType) (P : pFam A)
: IsGraph (pForall A P)
:= Build_IsGraph _ pHomotopy.(** [pType] is a 0-coherent 1-category *)Instanceis01cat_ptype : Is01Cat pType
:= Build_Is01Cat pType _ (@pmap_idmap) (@pmap_compose).(** [pForall] is a 0-coherent 1-category *)
A: pType P: pFam A
Is01Cat (pForall A P)
A: pType P: pFam A
Is01Cat (pForall A P)
A: pType P: pFam A
foralla : pForall A P, a $-> a
A: pType P: pFam A
forallabc : pForall A P,
(b $-> c) -> (a $-> b) -> a $-> c
A: pType P: pFam A
foralla : pForall A P, a $-> a
exact phomotopy_reflexive.
A: pType P: pFam A
forallabc : pForall A P,
(b $-> c) -> (a $-> b) -> a $-> c
A: pType P: pFam A a, b, c: pForall A P f: b $-> c g: a $-> b
a $-> c
exact (g @* f).Defined.Instanceis2graph_ptype : Is2Graph pType := funfg => _.Instanceis2graph_pforall (A : pType) (P : pFam A)
: Is2Graph (pForall A P)
:= funfg => _.(** [pForall] is a 0-coherent 1-groupoid *)
A: pType P: pFam A
Is0Gpd (pForall A P)
A: pType P: pFam A
Is0Gpd (pForall A P)
A: pType P: pFam A
forallab : pForall A P, (a $-> b) -> b $-> a
A: pType P: pFam A a, b: pForall A P h: a $-> b
b $-> a
exact h^*.Defined.(** [pType] is a 1-coherent 1-category *)
Is1Cat pType
Is1Cat pType
forallab : pType, Is01Cat (a $-> b)
forallab : pType, Is0Gpd (a $-> b)
forall (abc : pType) (g : b $-> c),
Is0Functor (cat_postcomp a g)
forall (abc : pType) (f : a $-> b),
Is0Functor (cat_precomp c f)
forall (abcd : pType) (f : a $-> b) (g : b $-> c)
(h : c $-> d), h $o g $o f $== h $o (g $o f)
forall (ab : pType) (f : a $-> b), Id b $o f $== f
forall (ab : pType) (f : a $-> b), f $o Id a $== f
forall (abc : pType) (g : b $-> c),
Is0Functor (cat_postcomp a g)
forall (abc : pType) (f : a $-> b),
Is0Functor (cat_precomp c f)
forall (abcd : pType) (f : a $-> b) (g : b $-> c)
(h : c $-> d), h $o g $o f $== h $o (g $o f)
forall (ab : pType) (f : a $-> b), Id b $o f $== f
forall (ab : pType) (f : a $-> b), f $o Id a $== f
forall (abc : pType) (g : b $-> c),
Is0Functor (cat_postcomp a g)
A, B, C: pType h: B $-> C
forallab : A $-> B,
(a $-> b) -> cat_postcomp A h a $-> cat_postcomp A h b
A, B, C: pType h: B $-> C f, g: A $-> B p: f $-> g
h o* f ==* h o* g
apply pmap_postwhisker; assumption.
forall (abc : pType) (f : a $-> b),
Is0Functor (cat_precomp c f)
A, B, C: pType h: A $-> B
forallab : B $-> C,
(a $-> b) -> cat_precomp C h a $-> cat_precomp C h b
A, B, C: pType h: A $-> B f, g: B $-> C p: f $-> g
f o* h ==* g o* h
apply pmap_prewhisker; assumption.
forall (abcd : pType) (f : a $-> b) (g : b $-> c)
(h : c $-> d), h $o g $o f $== h $o (g $o f)
intros ? ? ? ? f g h; exact (pmap_compose_assoc h g f).
forall (ab : pType) (f : a $-> b), Id b $o f $== f
intros ? ? f; exact (pmap_postcompose_idmap f).
forall (ab : pType) (f : a $-> b), f $o Id a $== f
intros ? ? f; exact (pmap_precompose_idmap f).Defined.(** [pType] is a pointed category *)
IsPointedCat pType
IsPointedCat pType
pType
IsInitial ?zero_object
IsTerminal ?zero_object
pType
exact pUnit.
IsInitial pUnit
A: pType
{f : pUnit $-> A & forallg : pUnit $-> A, f $== g}
A: pType
forallg : pUnit $-> A, pconst $== g
exact punit_pmap_pconst.
IsTerminal pUnit
B: pType
{f : B $-> pUnit & forallg : B $-> pUnit, f $== g}
B: pType
forallg : B $-> pUnit, pconst $== g
exact pmap_punit_pconst.Defined.(** The constant map is definitionally equal to the zero_morphism of a pointed category *)Definitionpath_zero_morphism_pconst (AB : pType)
: (@pconst A B) = zero_morphism := idpath.(** [pForall] is a 1-category *)
A: pType P: pFam A
Is1Cat (pForall A P)
A: pType P: pFam A
Is1Cat (pForall A P)
A: pType P: pFam A
forallab : pForall A P, Is01Cat (a $-> b)
A: pType P: pFam A
forallab : pForall A P, Is0Gpd (a $-> b)
A: pType P: pFam A
forall (abc : pForall A P) (g : b $-> c),
Is0Functor (cat_postcomp a g)
A: pType P: pFam A
forall (abc : pForall A P) (f : a $-> b),
Is0Functor (cat_precomp c f)
A: pType P: pFam A
forall (abcd : pForall A P) (f : a $-> b)
(g : b $-> c) (h : c $-> d),
h $o g $o f $== h $o (g $o f)
A: pType P: pFam A
forall (ab : pForall A P) (f : a $-> b),
Id b $o f $== f
A: pType P: pFam A
forall (ab : pForall A P) (f : a $-> b),
f $o Id a $== f
A: pType P: pFam A
forall (abc : pForall A P) (g : b $-> c),
Is0Functor (cat_postcomp a g)
A: pType P: pFam A
forall (abc : pForall A P) (f : a $-> b),
Is0Functor (cat_precomp c f)
A: pType P: pFam A
forall (abcd : pForall A P) (f : a $-> b)
(g : b $-> c) (h : c $-> d),
h $o g $o f $== h $o (g $o f)
A: pType P: pFam A
forall (ab : pForall A P) (f : a $-> b),
Id b $o f $== f
A: pType P: pFam A
forall (ab : pForall A P) (f : a $-> b),
f $o Id a $== f
A: pType P: pFam A
forall (abc : pForall A P) (g : b $-> c),
Is0Functor (cat_postcomp a g)
A: pType P: pFam A f, g, h: pForall A P p: g $-> h
forallab : f $-> g,
(a $-> b) -> cat_postcomp f p a $-> cat_postcomp f p b
A: pType P: pFam A f, g, h: pForall A P p: g $-> h q, r: f $-> g s: q $-> r
cat_postcomp f p q $-> cat_postcomp f p r
exact (phomotopy_postwhisker s p).
A: pType P: pFam A
forall (abc : pForall A P) (f : a $-> b),
Is0Functor (cat_precomp c f)
A: pType P: pFam A f, g, h: pForall A P p: f $-> g
forallab : g $-> h,
(a $-> b) -> cat_precomp h p a $-> cat_precomp h p b
A: pType P: pFam A f, g, h: pForall A P p: f $-> g q, r: g $-> h s: q $-> r
cat_precomp h p q $-> cat_precomp h p r
exact (phomotopy_prewhisker p s).
A: pType P: pFam A
forall (abcd : pForall A P) (f : a $-> b)
(g : b $-> c) (h : c $-> d),
h $o g $o f $== h $o (g $o f)
A: pType P: pFam A a, b, c, d: pForall A P p: a $-> b q: b $-> c r: c $-> d
r $o q $o p $== r $o (q $o p)
A: pType P: pFam A a, b, c, d: pForall A P p: a $-> b q: b $-> c r: c $-> d
p @* (q @* r) ==* (p @* q) @* r
exact (phomotopy_compose_assoc p q r).
A: pType P: pFam A
forall (ab : pForall A P) (f : a $-> b),
Id b $o f $== f
intros ? ? p; exact (phomotopy_compose_p1 p).
A: pType P: pFam A
forall (ab : pForall A P) (f : a $-> b),
f $o Id a $== f
intros ? ? p; exact (phomotopy_compose_1p p).Defined.(** [pForall] is a 1-groupoid *)
A: pType P: pFam A
Is1Gpd (pForall A P)
A: pType P: pFam A
Is1Gpd (pForall A P)
A: pType P: pFam A
forall (ab : pForall A P) (f : a $-> b),
f^$ $o f $== Id a
A: pType P: pFam A
forall (ab : pForall A P) (f : a $-> b),
f $o f^$ $== Id b
A: pType P: pFam A
forall (ab : pForall A P) (f : a $-> b),
f^$ $o f $== Id a
A: pType P: pFam A a, b: pForall A P p: a $-> b
p^$ $o p $== Id a
exact (phomotopy_compose_pV p).
A: pType P: pFam A
forall (ab : pForall A P) (f : a $-> b),
f $o f^$ $== Id b
forall (abc : pType) (g : b $-> c),
Is1Functor (cat_postcomp a g)
forall (abc : pType) (f : a $-> b),
Is1Functor (cat_precomp c f)
forall (abc : pType) (ff' : a $-> b)
(gg' : b $-> c) (p : f $== f') (p' : g $== g'),
(p' $@R f) $@ (g' $@L p) $== (g $@L p) $@ (p' $@R f')
forall (abcd : pType) (f : a $-> b) (g : b $-> c),
Is1Natural
(funx : c $-> d =>
cat_precomp d f (cat_precomp d g x))
(cat_precomp d (g $o f)) (cat_assoc f g)
forall (abcd : pType) (f : a $-> b) (h : c $-> d),
Is1Natural
(funx : b $-> c =>
cat_precomp d f (cat_postcomp b h x))
(funx : b $-> c =>
cat_postcomp a h (cat_precomp c f x))
(fung : b $-> c => cat_assoc f g h)
forall (abcd : pType) (g : b $-> c) (h : c $-> d),
Is1Natural (cat_postcomp a (h $o g))
(funx : a $-> b =>
cat_postcomp a h (cat_postcomp a g x))
(funf : a $-> b => cat_assoc f g h)
forallab : pType,
Is1Natural (cat_postcomp a (Id b)) idmap cat_idl
forallab : pType,
Is1Natural (cat_precomp b (Id a)) idmap cat_idr
forall (abcde : pType) (f : a $-> b) (g : b $-> c)
(h : c $-> d) (k : d $-> e),
k $@L cat_assoc f g h $o cat_assoc f (h $o g) k $o
cat_assoc g h k $@R f $==
cat_assoc (g $o f) h k $o cat_assoc f g (k $o h)
forall (abc : pType) (f : a $-> b) (g : b $-> c),
g $@L cat_idl f $o cat_assoc f (Id b) g $==
cat_idr g $@R f
forallab : pType, Is1Gpd (a $-> b)
exact _.
forall (abc : pType) (g : b $-> c),
Is1Functor (cat_postcomp a g)
A, B, C: pType f: B $-> C
forall (ab : A $-> B) (f0g : a $-> b),
f0 $== g ->
fmap (cat_postcomp A f) f0 $==
fmap (cat_postcomp A f) g
A, B, C: pType f: B $-> C
foralla : A $-> B,
fmap (cat_postcomp A f) (Id a) $==
Id (cat_postcomp A f a)
A, B, C: pType f: B $-> C
forall (abc : A $-> B) (f0 : a $-> b) (g : b $-> c),
fmap (cat_postcomp A f) (g $o f0) $==
fmap (cat_postcomp A f) g $o
fmap (cat_postcomp A f) f0
A, B, C: pType f: B $-> C
forall (ab : A $-> B) (f0g : a $-> b),
f0 $== g ->
fmap (cat_postcomp A f) f0 $==
fmap (cat_postcomp A f) g
A, B, C: pType f: B $-> C g, h: A $-> B p, q: g $-> h r: p $== q
fmap (cat_postcomp A f) p $==
fmap (cat_postcomp A f) q
A, B, C: pType f: B $-> C g, h: A $-> B p, q: g $-> h r: p $== q
fmap (cat_postcomp A f) p == fmap (cat_postcomp A f) q
A, B, C: pType f: B $-> C g, h: A $-> B p, q: g $-> h r: p $== q
?p pt =
dpoint_eq (fmap (cat_postcomp A f) p) @
(dpoint_eq (fmap (cat_postcomp A f) q))^
A, B, C: pType f: B $-> C g, h: A $-> B p, q: g $-> h r: p $== q
(funx : A => ap (ap f) (r x)) pt =
dpoint_eq (fmap (cat_postcomp A f) p) @
(dpoint_eq (fmap (cat_postcomp A f) q))^
by pelim r p q g h f.
A, B, C: pType f: B $-> C
foralla : A $-> B,
fmap (cat_postcomp A f) (Id a) $==
Id (cat_postcomp A f a)
A, B, C: pType f: B $-> C g: A $-> B
fmap (cat_postcomp A f) (Id g) $==
Id (cat_postcomp A f g)
A, B, C: pType f: B $-> C g: A $-> B
fmap (cat_postcomp A f) (Id g) ==
Id (cat_postcomp A f g)
A, B, C: pType f: B $-> C g: A $-> B
?p pt =
dpoint_eq (fmap (cat_postcomp A f) (Id g)) @
(dpoint_eq (Id (cat_postcomp A f g)))^
A, B, C: pType f: B $-> C g: A $-> B
(funx0 : A => 1) pt =
dpoint_eq (fmap (cat_postcomp A f) (Id g)) @
(dpoint_eq (Id (cat_postcomp A f g)))^
by pelim g f.
A, B, C: pType f: B $-> C
forall (abc : A $-> B) (f0 : a $-> b) (g : b $-> c),
fmap (cat_postcomp A f) (g $o f0) $==
fmap (cat_postcomp A f) g $o
fmap (cat_postcomp A f) f0
A, B, C: pType f: B $-> C g, h, i: A $-> B p: g $-> h q: h $-> i
fmap (cat_postcomp A f) (q $o p) $==
fmap (cat_postcomp A f) q $o fmap (cat_postcomp A f) p
A, B, C: pType f: B $-> C g, h, i: A $-> B p: g $-> h q: h $-> i
fmap (cat_postcomp A f) (q $o p) ==
fmap (cat_postcomp A f) q $o fmap (cat_postcomp A f) p
A, B, C: pType f: B $-> C g, h, i: A $-> B p: g $-> h q: h $-> i
?p pt =
dpoint_eq (fmap (cat_postcomp A f) (q $o p)) @
(dpoint_eq
(fmap (cat_postcomp A f) q $o
fmap (cat_postcomp A f) p))^
A, B, C: pType f: B $-> C g, h, i: A $-> B p: g $-> h q: h $-> i
((funx : A => ap_pp f (p x) (q x))
:
fmap (cat_postcomp A f) (q $o p) ==
fmap (cat_postcomp A f) q $o
fmap (cat_postcomp A f) p) pt =
dpoint_eq (fmap (cat_postcomp A f) (q $o p)) @
(dpoint_eq
(fmap (cat_postcomp A f) q $o
fmap (cat_postcomp A f) p))^
by pelim p q g h i f.
forall (abc : pType) (f : a $-> b),
Is1Functor (cat_precomp c f)
A, B, C: pType f: A $-> B
forall (ab : B $-> C) (f0g : a $-> b),
f0 $== g ->
fmap (cat_precomp C f) f0 $== fmap (cat_precomp C f) g
A, B, C: pType f: A $-> B
foralla : B $-> C,
fmap (cat_precomp C f) (Id a) $==
Id (cat_precomp C f a)
A, B, C: pType f: A $-> B
forall (abc : B $-> C) (f0 : a $-> b) (g : b $-> c),
fmap (cat_precomp C f) (g $o f0) $==
fmap (cat_precomp C f) g $o fmap (cat_precomp C f) f0
A, B, C: pType f: A $-> B
forall (ab : B $-> C) (f0g : a $-> b),
f0 $== g ->
fmap (cat_precomp C f) f0 $== fmap (cat_precomp C f) g
A, B, C: pType f: A $-> B g, h: B $-> C p, q: g $-> h r: p $== q
fmap (cat_precomp C f) p $== fmap (cat_precomp C f) q
A, B, C: pType f: A $-> B g, h: B $-> C p, q: g $-> h r: p $== q
fmap (cat_precomp C f) p == fmap (cat_precomp C f) q
A, B, C: pType f: A $-> B g, h: B $-> C p, q: g $-> h r: p $== q
?p pt =
dpoint_eq (fmap (cat_precomp C f) p) @
(dpoint_eq (fmap (cat_precomp C f) q))^
A, B, C: pType f: A $-> B g, h: B $-> C p, q: g $-> h r: p $== q
((funx : A => r (f x))
:
fmap (cat_precomp C f) p == fmap (cat_precomp C f) q)
pt =
dpoint_eq (fmap (cat_precomp C f) p) @
(dpoint_eq (fmap (cat_precomp C f) q))^
by pelim f r p q g h.
A, B, C: pType f: A $-> B
foralla : B $-> C,
fmap (cat_precomp C f) (Id a) $==
Id (cat_precomp C f a)
A, B, C: pType f: A $-> B g: B $-> C
fmap (cat_precomp C f) (Id g) $==
Id (cat_precomp C f g)
A, B, C: pType f: A $-> B g: B $-> C
fmap (cat_precomp C f) (Id g) ==
Id (cat_precomp C f g)
A, B, C: pType f: A $-> B g: B $-> C
?p pt =
dpoint_eq (fmap (cat_precomp C f) (Id g)) @
(dpoint_eq (Id (cat_precomp C f g)))^
A, B, C: pType f: A $-> B g: B $-> C
(funx0 : A => 1) pt =
dpoint_eq (fmap (cat_precomp C f) (Id g)) @
(dpoint_eq (Id (cat_precomp C f g)))^
by pelim f g.
A, B, C: pType f: A $-> B
forall (abc : B $-> C) (f0 : a $-> b) (g : b $-> c),
fmap (cat_precomp C f) (g $o f0) $==
fmap (cat_precomp C f) g $o fmap (cat_precomp C f) f0
A, B, C: pType f: A $-> B g, h, i: B $-> C p: g $-> h q: h $-> i
fmap (cat_precomp C f) (q $o p) $==
fmap (cat_precomp C f) q $o fmap (cat_precomp C f) p
A, B, C: pType f: A $-> B g, h, i: B $-> C p: g $-> h q: h $-> i
fmap (cat_precomp C f) (q $o p) ==
fmap (cat_precomp C f) q $o fmap (cat_precomp C f) p
A, B, C: pType f: A $-> B g, h, i: B $-> C p: g $-> h q: h $-> i
?p pt =
dpoint_eq (fmap (cat_precomp C f) (q $o p)) @
(dpoint_eq
(fmap (cat_precomp C f) q $o
fmap (cat_precomp C f) p))^
A, B, C: pType f: A $-> B g, h, i: B $-> C p: g $-> h q: h $-> i
(funx0 : A => 1) pt =
dpoint_eq (fmap (cat_precomp C f) (q $o p)) @
(dpoint_eq
(fmap (cat_precomp C f) q $o
fmap (cat_precomp C f) p))^
by pelim f p q i g h.
forall (abc : pType) (ff' : a $-> b)
(gg' : b $-> c) (p : f $== f') (p' : g $== g'),
(p' $@R f) $@ (g' $@L p) $== (g $@L p) $@ (p' $@R f')
A, B, C: pType f, g: A $-> B h, k: B $-> C p: f $== g q: h $== k
(q $@R f) $@ (k $@L p) $== (h $@L p) $@ (q $@R g)
A, B, C: pType f, g: A $-> B h, k: B $-> C p: f $== g q: h $== k
(q $@R f) $@ (k $@L p) == (h $@L p) $@ (q $@R g)
A, B, C: pType f, g: A $-> B h, k: B $-> C p: f $== g q: h $== k
forall (abcd : pType) (f : a $-> b) (g : b $-> c),
Is1Natural
(funx : c $-> d =>
cat_precomp d f (cat_precomp d g x))
(cat_precomp d (g $o f)) (cat_assoc f g)
A, B, C, D: pType f: A $-> B g: B $-> C
Is1Natural
(funx : C $-> D =>
cat_precomp D f (cat_precomp D g x))
(cat_precomp D (g $o f)) (cat_assoc f g)
A, B, C, D: pType f: A $-> B g: B $-> C
forall (aa' : C $-> D) (f0 : a $-> a'),
cat_assoc f g a' $o
fmap (cat_precomp D f o cat_precomp D g) f0 $==
fmap (cat_precomp D (g $o f)) f0 $o cat_assoc f g a
A, B, C, D: pType f: A $-> B g: B $-> C r1, r2: C $-> D s1: r1 $-> r2
cat_assoc f g r2 $o
fmap (cat_precomp D f o cat_precomp D g) s1 $==
fmap (cat_precomp D (g $o f)) s1 $o cat_assoc f g r1
A, B, C, D: pType f: A $-> B g: B $-> C r1, r2: C $-> D s1: r1 $-> r2
cat_assoc f g r2 $o
fmap (cat_precomp D f o cat_precomp D g) s1 ==
fmap (cat_precomp D (g $o f)) s1 $o cat_assoc f g r1
A, B, C, D: pType f: A $-> B g: B $-> C r1, r2: C $-> D s1: r1 $-> r2
?p pt =
dpoint_eq
(cat_assoc f g r2 $o
fmap (cat_precomp D f o cat_precomp D g) s1) @
(dpoint_eq
(fmap (cat_precomp D (g $o f)) s1 $o
cat_assoc f g r1))^
A, B, C, D: pType f: A $-> B g: B $-> C r1, r2: C $-> D s1: r1 $-> r2
(funx : A =>
concat_p1
(fmap (cat_precomp D f o cat_precomp D g) s1 x) @
(concat_1p
(fmap (cat_precomp D f o cat_precomp D g) s1 x))^)
pt =
dpoint_eq
(cat_assoc f g r2 $o
fmap (cat_precomp D f o cat_precomp D g) s1) @
(dpoint_eq
(fmap (cat_precomp D (g $o f)) s1 $o
cat_assoc f g r1))^
by pelim f g s1 r1 r2.
forall (abcd : pType) (f : a $-> b) (h : c $-> d),
Is1Natural
(funx : b $-> c =>
cat_precomp d f (cat_postcomp b h x))
(funx : b $-> c =>
cat_postcomp a h (cat_precomp c f x))
(fung : b $-> c => cat_assoc f g h)
A, B, C, D: pType f: A $-> B g: C $-> D
Is1Natural
(funx : B $-> C =>
cat_precomp D f (cat_postcomp B g x))
(funx : B $-> C =>
cat_postcomp A g (cat_precomp C f x))
(fung0 : B $-> C => cat_assoc f g0 g)
A, B, C, D: pType f: A $-> B g: C $-> D
forall (aa' : B $-> C) (f0 : a $-> a'),
(fung0 : B $-> C => cat_assoc f g0 g) a' $o
fmap (cat_precomp D f o cat_postcomp B g) f0 $==
fmap (cat_postcomp A g o cat_precomp C f) f0 $o
(fung0 : B $-> C => cat_assoc f g0 g) a
A, B, C, D: pType f: A $-> B g: C $-> D r1, r2: B $-> C s1: r1 $-> r2
(fung0 : B $-> C => cat_assoc f g0 g) r2 $o
fmap (cat_precomp D f o cat_postcomp B g) s1 $==
fmap (cat_postcomp A g o cat_precomp C f) s1 $o
(fung0 : B $-> C => cat_assoc f g0 g) r1
A, B, C, D: pType f: A $-> B g: C $-> D r1, r2: B $-> C s1: r1 $-> r2
(fung0 : B $-> C => cat_assoc f g0 g) r2 $o
fmap (cat_precomp D f o cat_postcomp B g) s1 ==
fmap (cat_postcomp A g o cat_precomp C f) s1 $o
(fung0 : B $-> C => cat_assoc f g0 g) r1
A, B, C, D: pType f: A $-> B g: C $-> D r1, r2: B $-> C s1: r1 $-> r2
?p pt =
dpoint_eq
((fung0 : B $-> C => cat_assoc f g0 g) r2 $o
fmap (cat_precomp D f o cat_postcomp B g) s1) @
(dpoint_eq
(fmap (cat_postcomp A g o cat_precomp C f) s1 $o
(fung0 : B $-> C => cat_assoc f g0 g) r1))^
A, B, C, D: pType f: A $-> B g: C $-> D r1, r2: B $-> C s1: r1 $-> r2
(funx : A =>
concat_p1
(fmap (cat_precomp D f o cat_postcomp B g) s1 x) @
(concat_1p
(fmap (cat_precomp D f o cat_postcomp B g) s1 x))^)
pt =
dpoint_eq
((fung0 : B $-> C => cat_assoc f g0 g) r2 $o
fmap (cat_precomp D f o cat_postcomp B g) s1) @
(dpoint_eq
(fmap (cat_postcomp A g o cat_precomp C f) s1 $o
(fung0 : B $-> C => cat_assoc f g0 g) r1))^
by pelim f s1 r1 r2 g.
forall (abcd : pType) (g : b $-> c) (h : c $-> d),
Is1Natural (cat_postcomp a (h $o g))
(funx : a $-> b =>
cat_postcomp a h (cat_postcomp a g x))
(funf : a $-> b => cat_assoc f g h)
A, B, C, D: pType f: B $-> C g: C $-> D
Is1Natural (cat_postcomp A (g $o f))
(funx : A $-> B =>
cat_postcomp A g (cat_postcomp A f x))
(funf0 : A $-> B => cat_assoc f0 f g)
A, B, C, D: pType f: B $-> C g: C $-> D
forall (aa' : A $-> B) (f0 : a $-> a'),
(funf1 : A $-> B => cat_assoc f1 f g) a' $o
fmap (cat_postcomp A (g $o f)) f0 $==
fmap (cat_postcomp A g o cat_postcomp A f) f0 $o
(funf1 : A $-> B => cat_assoc f1 f g) a
A, B, C, D: pType f: B $-> C g: C $-> D r1, r2: A $-> B s1: r1 $-> r2
(funf0 : A $-> B => cat_assoc f0 f g) r2 $o
fmap (cat_postcomp A (g $o f)) s1 $==
fmap (cat_postcomp A g o cat_postcomp A f) s1 $o
(funf0 : A $-> B => cat_assoc f0 f g) r1
A, B, C, D: pType f: B $-> C g: C $-> D r1, r2: A $-> B s1: r1 $-> r2
(funf0 : A $-> B => cat_assoc f0 f g) r2 $o
fmap (cat_postcomp A (g $o f)) s1 ==
fmap (cat_postcomp A g o cat_postcomp A f) s1 $o
(funf0 : A $-> B => cat_assoc f0 f g) r1
A, B, C, D: pType f: B $-> C g: C $-> D r1, r2: A $-> B s1: r1 $-> r2
?p pt =
dpoint_eq
((funf0 : A $-> B => cat_assoc f0 f g) r2 $o
fmap (cat_postcomp A (g $o f)) s1) @
(dpoint_eq
(fmap (cat_postcomp A g o cat_postcomp A f) s1 $o
(funf0 : A $-> B => cat_assoc f0 f g) r1))^
A, B, C, D: pType f: B $-> C g: C $-> D r1, r2: A $-> B s1: r1 $-> r2
((funx : A =>
(concat_p1 (ap (g o f) (s1 x)) @
ap_compose f g (s1 x)) @
(concat_1p (ap g (ap f (s1 x))))^)
:
(funf0 : A $-> B => cat_assoc f0 f g) r2 $o
fmap (cat_postcomp A (g $o f)) s1 ==
fmap (cat_postcomp A g o cat_postcomp A f) s1 $o
(funf0 : A $-> B => cat_assoc f0 f g) r1) pt =
dpoint_eq
((funf0 : A $-> B => cat_assoc f0 f g) r2 $o
fmap (cat_postcomp A (g $o f)) s1) @
(dpoint_eq
(fmap (cat_postcomp A g o cat_postcomp A f) s1 $o
(funf0 : A $-> B => cat_assoc f0 f g) r1))^
by pelim s1 r1 r2 f g.
forallab : pType,
Is1Natural (cat_postcomp a (Id b)) idmap cat_idl
A, B: pType
Is1Natural (cat_postcomp A (Id B)) idmap cat_idl
A, B: pType
forall (aa' : A $-> B) (f : a $-> a'),
cat_idl a' $o fmap (cat_postcomp A (Id B)) f $==
fmap idmap f $o cat_idl a
A, B: pType r1, r2: A $-> B s1: r1 $-> r2
cat_idl r2 $o fmap (cat_postcomp A (Id B)) s1 $==
fmap idmap s1 $o cat_idl r1
A, B: pType r1, r2: A $-> B s1: r1 $-> r2
cat_idl r2 $o fmap (cat_postcomp A (Id B)) s1 ==
fmap idmap s1 $o cat_idl r1
(funx : A =>
concat_p1 (fmap (cat_precomp B (Id A)) s1 x) @
(concat_1p (fmap (cat_precomp B (Id A)) s1 x))^) pt =
dpoint_eq
(cat_idr r2 $o fmap (cat_precomp B (Id A)) s1) @
(dpoint_eq (fmap idmap s1 $o cat_idr r1))^
simpl; by pelim s1 r1 r2.
forall (abcde : pType) (f : a $-> b) (g : b $-> c)
(h : c $-> d) (k : d $-> e),
k $@L cat_assoc f g h $o cat_assoc f (h $o g) k $o
cat_assoc g h k $@R f $==
cat_assoc (g $o f) h k $o cat_assoc f g (k $o h)
A, B, C, D, E: pType f: A $-> B g: B $-> C h: C $-> D j: D $-> E
j $@L cat_assoc f g h $o cat_assoc f (h $o g) j $o
cat_assoc g h j $@R f $==
cat_assoc (g $o f) h j $o cat_assoc f g (j $o h)
A, B, C, D, E: pType f: A $-> B g: B $-> C h: C $-> D j: D $-> E
j $@L cat_assoc f g h $o cat_assoc f (h $o g) j $o
cat_assoc g h j $@R f ==
cat_assoc (g $o f) h j $o cat_assoc f g (j $o h)
A, B, C, D, E: pType f: A $-> B g: B $-> C h: C $-> D j: D $-> E
?p pt =
dpoint_eq
(j $@L cat_assoc f g h $o cat_assoc f (h $o g) j $o
cat_assoc g h j $@R f) @
(dpoint_eq
(cat_assoc (g $o f) h j $o cat_assoc f g (j $o h)))^
A, B, C, D, E: pType f: A $-> B g: B $-> C h: C $-> D j: D $-> E
(funx0 : A => 1) pt =
dpoint_eq
(j $@L cat_assoc f g h $o cat_assoc f (h $o g) j $o
cat_assoc g h j $@R f) @
(dpoint_eq
(cat_assoc (g $o f) h j $o cat_assoc f g (j $o h)))^
by pelim f g h j.
forall (abc : pType) (f : a $-> b) (g : b $-> c),
g $@L cat_idl f $o cat_assoc f (Id b) g $==
cat_idr g $@R f
A, B, C: pType f: A $-> B g: B $-> C
g $@L cat_idl f $o cat_assoc f (Id B) g $==
cat_idr g $@R f
A, B, C: pType f: A $-> B g: B $-> C
g $@L cat_idl f $o cat_assoc f (Id B) g ==
cat_idr g $@R f
A, B, C: pType f: A $-> B g: B $-> C
?p pt =
dpoint_eq (g $@L cat_idl f $o cat_assoc f (Id B) g) @
(dpoint_eq (cat_idr g $@R f))^
A, B, C: pType f: A $-> B g: B $-> C
(funx0 : A => 1) pt =
dpoint_eq (g $@L cat_idl f $o cat_assoc f (Id B) g) @
(dpoint_eq (cat_idr g $@R f))^
by pelim f g.Defined.(** The forgetful map from [pType] to [Type] is a 0-functor *)
Is0Functor pointed_type
Is0Functor pointed_type
forallab : pType, (a $-> b) -> a $-> b
a, b: pType f: a $-> b
a $-> b
exact f.Defined.(** The forgetful map from [pType] to [Type] is a 1-functor *)
Is1Functor pointed_type
Is1Functor pointed_type
forall (ab : pType) (fg : a $-> b),
f $== g -> fmap pointed_type f $== fmap pointed_type g
foralla : pType, fmap pointed_type (Id a) $== Id a
forall (abc : pType) (f : a $-> b) (g : b $-> c),
fmap pointed_type (g $o f) $==
fmap pointed_type g $o fmap pointed_type f
forall (ab : pType) (fg : a $-> b),
f $== g -> fmap pointed_type f $== fmap pointed_type g
a, b: pType f, g: a $-> b h: f $== g
fmap pointed_type f $== fmap pointed_type g
exact h.
foralla : pType, fmap pointed_type (Id a) $== Id a
a: pType
fmap pointed_type (Id a) $== Id a
reflexivity.
forall (abc : pType) (f : a $-> b) (g : b $-> c),
fmap pointed_type (g $o f) $==
fmap pointed_type g $o fmap pointed_type f
a, b, c: pType f: a $-> b g: b $-> c
fmap pointed_type (g $o f) $==
fmap pointed_type g $o fmap pointed_type f
reflexivity.Defined.(** [pType] has binary products *)
HasBinaryProducts pType
HasBinaryProducts pType
X, Y: pType
BinaryProduct X Y
X, Y: pType
pType
X, Y: pType
?cat_binprod' $-> X
X, Y: pType
?cat_binprod' $-> Y
X, Y: pType
forallz : pType,
(z $-> X) -> (z $-> Y) -> z $-> ?cat_binprod'
X, Y: pType
forall (z : pType) (f : z $-> X) (g : z $-> Y),
?cat_pr1 $o ?cat_binprod_corec z f g $== f
X, Y: pType
forall (z : pType) (f : z $-> X) (g : z $-> Y),
?cat_pr2 $o ?cat_binprod_corec z f g $== g
X, Y: pType
forall (z : pType) (fg : z $-> ?cat_binprod'),
?cat_pr1 $o f $== ?cat_pr1 $o g ->
?cat_pr2 $o f $== ?cat_pr2 $o g -> f $== g
X, Y: pType
pType
exact (X * Y).
X, Y: pType
X * Y $-> X
exact pfst.
X, Y: pType
X * Y $-> Y
exact psnd.
X, Y: pType
forallz : pType,
(z $-> X) -> (z $-> Y) -> z $-> X * Y
exact pprod_corec.
X, Y: pType
forall (z : pType) (f : z $-> X) (g : z $-> Y),
pfst $o pprod_corec z f g $== f
exact pprod_corec_beta_fst.
X, Y: pType
forall (z : pType) (f : z $-> X) (g : z $-> Y),
psnd $o pprod_corec z f g $== g
exact pprod_corec_beta_snd.
X, Y: pType
forall (z : pType) (fg : z $-> X * Y),
pfst $o f $== pfst $o g ->
psnd $o f $== psnd $o g -> f $== g
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g
f $== g
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g
f ==* g
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g
f == g
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g
?p pt = dpoint_eq f @ (dpoint_eq g)^
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g
f == g
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g a: Z
f a = g a
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g a: Z
fst (f a) = fst (g a)
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g a: Z
snd (f a) = snd (g a)
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g a: Z
fst (f a) = fst (g a)
exact (p a).
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g a: Z
snd (f a) = snd (g a)
exact (q a).
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g
((funa : Z =>
path_prod' (p a : fst (f a) = fst (g a))
(q a : snd (f a) = snd (g a)))
:
f == g) pt = dpoint_eq f @ (dpoint_eq g)^
X, Y, Z: pType f, g: Z $-> X * Y p: pfst $o f $== pfst $o g q: psnd $o f $== psnd $o g
forall (z : pType) (fg : z $-> pproduct x),
(foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g) ->
f $== g
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g
f $== g
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g
f == g
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g
?p pt = dpoint_eq f @ (dpoint_eq g)^
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g
((funz : Z =>
path_forall (f z) (g z)
((funi : I =>
letX := funi0 : I => pointed_fun (p i0) in
X i z)
:
f z == g z))
:
f == g) pt = dpoint_eq f @ (dpoint_eq g)^
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g
(funi : I => p i pt) =
apD10 (dpoint_eq f @ (dpoint_eq g)^)
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g i: I
p i pt = apD10 (dpoint_eq f @ (dpoint_eq g)^) i
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g i: I
p i pt =
ap (pproduct_proj i) (dpoint_eq f) @
ap (pproduct_proj i) (dpoint_eq g)^
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g i: I
dpoint
(pfam_phomotopy (pproduct_proj i $o f)
(pproduct_proj i $o g)) =
ap (pproduct_proj i) (dpoint_eq f) @
ap (pproduct_proj i) (dpoint_eq g)^
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g i: I
ap (funx : foralla : I, x a => x i) (point_eq f) @ 1 =
ap (funx : foralla : I, x a => x i) (dpoint_eq f)
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g i: I
(ap (funx : foralla : I, x a => x i) (point_eq g) @
1)^ =
ap (funx : foralla : I, x a => x i) (dpoint_eq g)^
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g i: I
ap (funx : foralla : I, x a => x i) (point_eq f) @ 1 =
ap (funx : foralla : I, x a => x i) (dpoint_eq f)
apply concat_p1.
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g i: I
(ap (funx : foralla : I, x a => x i) (point_eq g) @
1)^ =
ap (funx : foralla : I, x a => x i) (dpoint_eq g)^
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g i: I
(ap (funx : foralla : I, x a => x i) (point_eq g) @
1)^ =
(ap (funx : foralla : I, x a => x i) (dpoint_eq g))^
H: Funext I: Type x: I -> pType Z: pType f, g: Z $-> pproduct x p: foralli : I,
pproduct_proj i $o f $== pproduct_proj i $o g i: I
ap (funx : foralla : I, x a => x i) (point_eq g) @ 1 =
ap (funx : foralla : I, x a => x i) (dpoint_eq g)
apply concat_p1.Defined.(** Some higher homotopies *)(** Horizontal composition of homotopies. *)Notation"p @@* q" := (p $@@ q).(** ** Funext for pointed types and direct consequences. *)(** By funext pointed homotopies are equivalent to paths *)
H: Funext A: pType P: pFam A f, g: pForall A P
f ==* g <~> f = g
H: Funext A: pType P: pFam A f, g: pForall A P
f ==* g <~> f = g
H: Funext A: pType P: pFam A f, g: pForall A P
{p : f == g & p pt = dpoint_eq f @ (dpoint_eq g)^} <~>
f = g
H: Funext A: pType P: pFam A
forallb : {f : forallx : A, P x & f pt = dpoint P},
{p : issig_pforall A P b == issig_pforall A P b &
p pt =
dpoint_eq (issig_pforall A P b) @
(dpoint_eq (issig_pforall A P b))^}
H: Funext A: pType P: pFam A
forallb1 : {f : forallx : A, P x & f pt = dpoint P},
Contr
{b2 : {f : forallx : A, P x & f pt = dpoint P} &
{p : issig_pforall A P b1 == issig_pforall A P b2 &
p pt =
dpoint_eq (issig_pforall A P b1) @
(dpoint_eq (issig_pforall A P b2))^}}
H: Funext A: pType P: pFam A
forallb : {f : forallx : A, P x & f pt = dpoint P},
{p : issig_pforall A P b == issig_pforall A P b &
p pt =
dpoint_eq (issig_pforall A P b) @
(dpoint_eq (issig_pforall A P b))^}
H: Funext A: pType P: pFam A f: forallx : A, P x feq: f pt = dpoint P
{p : f == f & p pt = feq @ feq^}
H: Funext A: pType P: pFam A f: forallx : A, P x feq: f pt = dpoint P
1 = feq @ feq^
exact (concat_pV _)^.
H: Funext A: pType P: pFam A
forallb1 : {f : forallx : A, P x & f pt = dpoint P},
Contr
{b2 : {f : forallx : A, P x & f pt = dpoint P} &
{p : issig_pforall A P b1 == issig_pforall A P b2 &
p pt =
dpoint_eq (issig_pforall A P b1) @
(dpoint_eq (issig_pforall A P b2))^}}
H: Funext A: pType P: pFam A f: forallx : A, P x feq: f pt = dpoint P
Contr
{b2 : {f : forallx : A, P x & f pt = dpoint P} &
{p : f == b2.1 & p pt = feq @ (b2.2)^}}
H: Funext A: pType P: pFam A f: forallx : A, P x feq: f pt = dpoint P
Contr {y : f pt = dpoint P & 1 = feq @ y^}
H: Funext A: pType P: pFam A f: forallx : A, P x feq: f pt = dpoint P
{feq' : f pt = dpoint P & feq = feq'} <~>
{y : f pt = dpoint P & 1 = feq @ y^}
H: Funext A: pType P: pFam A f: forallx : A, P x feq, p: f pt = dpoint P
feq = p <~> 1 = feq @ (1%equiv p)^
H: Funext A: pType P: pFam A f: forallx : A, P x feq, p: f pt = dpoint P
1 = feq @ (1%equiv p)^ <~> p = feq
apply equiv_moveR_1M.Defined.Definitionpath_pforall `{Funext} {A : pType} {P : pFam A} {f g : pForall A P}
: (f ==* g) -> (f = g) := equiv_path_pforall f g.(** We note that the inverse of [path_pforall] computes definitionally on reflexivity, and hence [path_pforall] itself computes typally so. *)Definitionequiv_inverse_path_pforall_1 `{Funext} {A : pType} {P : pFam A} (f : pForall A P)
: (equiv_path_pforall f f)^-1%equiv 1%path = reflexivity f
:= 1.Definitionpath_pforall_1 `{Funext} {A : pType} {P : pFam A} {f : pForall A P}
: equiv_path_pforall _ _ (reflexivity f) = 1%path
:= moveR_equiv_M _ _ (equiv_inverse_path_pforall_1 f)^.(** Here is the inverse map without assuming funext *)Definitionphomotopy_path {A : pType} {P : pFam A} {fg : pForall A P}
: (f = g) -> (f ==* g) := ltac:(byintros []).(** And we prove that it agrees with the inverse of [equiv_path_pforall] *)Definitionpath_equiv_path_pforall_phomotopy_path `{Funext} {A : pType}
{P : pFam A} {f g : pForall A P}
: phomotopy_path (f:=f) (g:=g) = (equiv_path_pforall f g)^-1%equiv
:= ltac:(by funext []).(** TODO: The next few results could be proven for [GpdHom_path] in any WildCat. *)(** [phomotopy_path] sends concatenation to composition of pointed homotopies.*)
A: pType P: pFam A f, g, h: pForall A P p: f = g q: g = h
phomotopy_path (p @ q) ==*
phomotopy_path p @* phomotopy_path q
A: pType P: pFam A f, g, h: pForall A P p: f = g q: g = h
phomotopy_path (p @ q) ==*
phomotopy_path p @* phomotopy_path q
A: pType P: pFam A f, g: pForall A P p, p': f = g q: p = p'
phomotopy_path p ==* phomotopy_path p'
A: pType P: pFam A f, g: pForall A P p, p': f = g q: p = p'
phomotopy_path p ==* phomotopy_path p'
A: pType P: pFam A f, g: pForall A P p: f = g
phomotopy_path p ==* phomotopy_path p
reflexivity.Defined.(** [phomotopy_path] sends inverses to inverses.*)
A: pType P: pFam A f, g: pForall A P p: f = g
phomotopy_path p^ ==* (phomotopy_path p)^*
A: pType P: pFam A f, g: pForall A P p: f = g
phomotopy_path p^ ==* (phomotopy_path p)^*
A: pType P: pFam A f: pForall A P
phomotopy_path 1^ ==* (phomotopy_path 1)^*
A: pType P: pFam A f: pForall A P
phomotopy_reflexive' f ==* (phomotopy_reflexive' f)^*
A: pType P: pFam A f: pForall A P
(phomotopy_reflexive' f)^* ==* phomotopy_reflexive' f
exact gpd_rev_1.Defined.(** Since pointed homotopies are equivalent to equalities, we can act as if they are paths and define a path induction for them. *)
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P, k ==* k' -> Type q: Q k (reflexivity k) k': pForall A P
forallH : k ==* k', Q k' H
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P, k ==* k' -> Type q: Q k (reflexivity k) k': pForall A P
forallH : k ==* k', Q k' H
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P, k ==* k' -> Type q: Q k (reflexivity k) k': pForall A P p: k = k'
Q k' ((equiv_path_pforall k k')^-1%equiv p)
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P, k ==* k' -> Type q: Q k (reflexivity k)
Q k ((equiv_path_pforall k k)^-1%equiv 1)
exact q.Defined.(** Sometimes you have a goal with both a pointed homotopy [H] and [path_pforall H]. This is an induction principle that allows us to replace both of them by reflexivity at the same time. *)
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P,
k ==* k' -> k = k' -> Type q: Q k (reflexivity k) 1 k': pForall A P H: k ==* k' p: k = k' r: path_pforall H = p
Q k' H p
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P,
k ==* k' -> k = k' -> Type q: Q k (reflexivity k) 1 k': pForall A P H: k ==* k' p: k = k' r: path_pforall H = p
Q k' H p
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P,
k ==* k' -> k = k' -> Type q: Q k (reflexivity k) 1 k': pForall A P H: k ==* k'
Q k' H (path_pforall H)
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P,
k ==* k' -> k = k' -> Type q: Q k (reflexivity k) 1
forall (k' : pForall A P) (H : k ==* k'),
Q k' H (path_pforall H)
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P,
k ==* k' -> k = k' -> Type q: Q k (reflexivity k) 1
Q k (reflexivity k) (path_pforall (reflexivity k))
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P, k ==* k' -> Type q: Q k (reflexivity k)
phomotopy_ind Q q k (reflexivity k) = q
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P, k ==* k' -> Type q: Q k (reflexivity k)
phomotopy_ind Q q k (reflexivity k) = q
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P, k ==* k' -> Type q: Q k (reflexivity k)
phomotopy_ind Q q k
((equiv_path_pforall k k)^-1%equiv 1) = q
apply equiv_ind_comp.Defined.
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P,
k ==* k' -> k = k' -> Type q: Q k (reflexivity k) 1
phomotopy_ind' Q q k (reflexivity k)
(path_pforall (reflexivity k)) 1 =
transport (Q k (reflexivity k)) path_pforall_1^ q
H0: Funext A: pType P: pFam A k: pForall A P Q: forallk' : pForall A P,
k ==* k' -> k = k' -> Type q: Q k (reflexivity k) 1
phomotopy_ind' Q q k (reflexivity k)
(path_pforall (reflexivity k)) 1 =
transport (Q k (reflexivity k)) path_pforall_1^ q
srapply phomotopy_ind_1.Defined.(** Every homotopy between pointed maps of sets is a pointed homotopy. *)
X, Y: pType IsHSet0: IsHSet Y f, g: X ->* Y h: f == g
f ==* g
X, Y: pType IsHSet0: IsHSet Y f, g: X ->* Y h: f == g
f ==* g
X, Y: pType IsHSet0: IsHSet Y f, g: X ->* Y h: f == g
h pt = dpoint_eq f @ (dpoint_eq g)^
apply path_ishprop.Defined.(** Pointed homotopies in a set form an HProp. *)Instanceishprop_phomotopy_hset `{Funext} {X Y : pType} `{IsHSet Y} (f g : X ->* Y)
: IsHProp (f ==* g)
:= inO_equiv_inO' (O:=Tr (-1)) _ (issig_phomotopy f g).(** ** Operations on equivalences needed to make [pType] a wild category with equivalences *)(** The inverse equivalence of a pointed equivalence is again a pointed equivalence *)
A: Type point0: IsPointed A B: Type f: A -> B iseq: IsEquiv f
eisretr f (f point0) =
(ap f (moveR_equiv_V (f point0) point0 1) @ 1) @ 1
A: Type point0: IsPointed A B: Type f: A -> B iseq: IsEquiv f
eisretr f (f point0) =
(ap f (ap f^-11 @ eissect f point0) @ 1) @ 1
A: Type point0: IsPointed A B: Type f: A -> B iseq: IsEquiv f
ap f (eissect f point0) =
(ap f (ap f^-11 @ eissect f point0) @ 1) @ 1
A: Type point0: IsPointed A B: Type f: A -> B iseq: IsEquiv f
(ap f (ap f^-11 @ eissect f point0) @ 1) @ 1 =
ap f (eissect f point0)
exact (concat_p1 _ @ concat_p1 _ @ ap _ (concat_1p _)).Defined.(** Univalence for pointed types *)
H: Univalence A, B: pType
(A <~>* B) <~> A = B
H: Univalence A, B: pType
(A <~>* B) <~> A = B
H: Univalence A, B: pType
Contr {y : pType & A <~>* y}
H: Univalence A, B: pType
{X : Type & {f : A <~> X & {x : X & f pt = x}}} <~>
{y : pType & A <~>* y}
H: Univalence A, B: pType
Contr {X : Type & {f : A <~> X & {x : X & f pt = x}}}
H: Univalence A, B: pType
Contr {X : Type & {f : A <~> X & {x : X & f pt = x}}}
H: Univalence A, B: pType
{X : Type & A <~> X} <~>
{X : Type & {f : A <~> X & {x : X & f pt = x}}}
H: Univalence A, B: pType X: Type
{f : A <~> X & {x : X & f pt = x}} <~> (A <~> X)
rapply equiv_sigma_contr.(** If you replace the type in the second line with { Xf : {X : Type & A <~> X} & {x : Xf.1 & Xf.2 pt = x} }, then the third line completes the proof, but that results in an extra universe variable. *)Defined.Definitionpath_ptype `{Univalence} {A B : pType} : (A <~>* B) -> A = B
:= equiv_path_ptype A B.(** The inverse map can be defined without Univalence. *)Definitionpequiv_path {AB : pType} (p : A = B) : (A <~>* B)
:= match p with idpath => pequiv_pmap_idmap end.(** This just confirms that it is definitionally the inverse map. *)Definitionpequiv_path_equiv_path_ptype_inverse `{Univalence} {A B : pType}
: @pequiv_path A B = (equiv_path_ptype A B)^-1
:= idpath.Instanceisequiv_pequiv_path `{Univalence} {A B : pType}
: IsEquiv (@pequiv_path A B)
:= isequiv_inverse (equiv_path_ptype A B).(** Two pointed equivalences are equal if their underlying pointed functions are equal. This requires [Funext] for knowing that [IsEquiv] is an [HProp]. *)
H: Funext A, B: pType f, g: A <~>* B
f = g <~> f = g
H: Funext A, B: pType f, g: A <~>* B
f = g <~> f = g
H: Funext A, B: pType f, g: A <~>* B
f = g <~>
(f; pointed_isequiv A B f) =
(g; pointed_isequiv A B g)
match goal with |- _ <~> ?F = ?G => exact (equiv_path_sigma_hprop F G) end.Defined.(** Two pointed equivalences are equal if their underlying pointed functions are pointed homotopic. *)Definitionequiv_path_pequiv `{Funext} {A B : pType} (f g : A <~>* B)
: (f ==* g) <~> (f = g)
:= equiv_path_pequiv' f g oE equiv_path_pforall f g.Definitionpath_pequiv `{Funext} {A B : pType} (f g : A <~>* B)
: (f ==* g) -> (f = g)
:= equiv_path_pequiv f g.
H: Funext A, B: pType f, g, h: A ->* B K: g ==* f
f ==* h <~> g ==* h
H: Funext A, B: pType f, g, h: A ->* B K: g ==* f
f ==* h <~> g ==* h
H: Funext A, B: pType f, g, h: A ->* B K: g ==* f
f = h <~> g = h
H: Funext A, B: pType f, g, h: A ->* B K: g ==* f
g = f
H: Funext A, B: pType f, g, h: A ->* B K: g ==* f
g ==* f
exact K.Defined.(** Under funext, [pType] has morphism extensionality *)
H: Funext
HasMorExt pType
H: Funext
HasMorExt pType
H: Funext A, B: pType f, g: A $-> B
IsEquiv GpdHom_path
H: Funext A, B: pType f, g: A $-> B
(equiv_path_pforall f g)^-1%equiv == GpdHom_path
intros []; reflexivity.Defined.(** [pType] has equivalences *)
HasEquivs pType
HasEquivs pType
A, B: pType f: A <~>* B
A ->* B
A, B: pType f: A <~>* B
IsEquiv ?Goal
A, B: pType f: A $-> B X: IsEquiv f
A <~>* B
A, B: pType f: A $-> B fe: IsEquiv f
?Goal@{f:=(funH : IsEquiv f => ?Goal4@{X:=H}) fe} ==*
f
A, B: pType f: A <~>* B
B ->* A
A, B: pType f: A <~>* B
?Goal1 o* ?Goal ==* pmap_idmap
A, B: pType f: A <~>* B
?Goal o* ?Goal1 ==* pmap_idmap
A, B: pType f: A $-> B g: B ->* A r: f o* g ==* pmap_idmap s: g o* f ==* pmap_idmap
IsEquiv f
A, B: pType f: A <~>* B
A ->* B
exact f.
A, B: pType f: A <~>* B
IsEquiv f
exact _.
A, B: pType f: A $-> B X: IsEquiv f
A <~>* B
exact (Build_pEquiv f _).
A, B: pType f: A $-> B fe: IsEquiv f
(funH : IsEquiv f =>
{| pointed_equiv_fun := f; pointed_isequiv := H |})
fe ==* f
A, B: pType f: A $-> B g: B ->* A r: f o* g ==* pmap_idmap s: g o* f ==* pmap_idmap
IsEquiv f
A, B: pType f: A $-> B g: B ->* A r: f o* g ==* pmap_idmap s: g o* f ==* pmap_idmap
(funx : B => f (g x)) == idmap
A, B: pType f: A $-> B g: B ->* A r: f o* g ==* pmap_idmap s: g o* f ==* pmap_idmap
(funx : A => g (f x)) == idmap
A, B: pType f: A $-> B g: B ->* A r: f o* g ==* pmap_idmap s: g o* f ==* pmap_idmap
(funx : B => f (g x)) == idmap
intros x; exact (r x).
A, B: pType f: A $-> B g: B ->* A r: f o* g ==* pmap_idmap s: g o* f ==* pmap_idmap
(funx : A => g (f x)) == idmap
intros x; exact (s x).Defined.
H: Funext
HasMorExt (core pType)
H: Funext
HasMorExt (core pType)
H: Funext
forall (xy : core pType)
(fg : uncore x $<~> uncore y), IsEquiv (ap cate_fun)
H: Funext A, B: core pType f, g: uncore A $<~> uncore B
IsEquiv (ap cate_fun)
H: Funext A, B: core pType f, g: uncore A $<~> uncore B
f = g <~> f = g
H: Funext A, B: core pType f, g: uncore A $<~> uncore B
?f == ap cate_fun
H: Funext A, B: core pType f, g: uncore A $<~> uncore B
(equiv_path_pequiv' f g)^-1%equiv == ap cate_fun
byintros [].Defined.(** [pType] is a univalent 1-coherent 1-category *)
H: Univalence
IsUnivalent1Cat pType
H: Univalence
IsUnivalent1Cat pType
H: Univalence A, B: pType
IsEquiv (cat_equiv_path A B)
(* [cate_equiv_path] is almost definitionally equal to [pequiv_path]. Both are defined by path induction, sending [idpath A] to [id_cate A] and [pequiv_pmap_idmap A], respectively. [id_cate A] is almost definitionally equal to [pequiv_pmap_idmap A], except that the former uses [catie_adjointify], so the adjoint law is different. However, the underlying pointed maps are definitionally equal. *)
H: Univalence A, B: pType
pequiv_path == cat_equiv_path A B
H: Univalence A, B: pType
pequiv_path 1 = cat_equiv_path A A 1
H: Univalence A, B: pType
pequiv_path 1 = cat_equiv_path A A 1
reflexivity.Defined.(** The free base point added to a type. This is in fact a functor and left adjoint to the forgetful functor [pType] to [Type]. *)Definitionpointify (S : Type) : pType := [S + Unit, inr tt].
Is0Functor pointify
Is0Functor pointify
forallab : Type,
(a $-> b) -> pointify a $-> pointify b
A, B: Type f: A $-> B
pointify A $-> pointify B
A, B: Type f: A $-> B
pointify A -> pointify B
A, B: Type f: A $-> B
?f pt = pt
A, B: Type f: A $-> B
functor_sum f idmap pt = pt
reflexivity.Defined.(** [pointify] is left adjoint to forgetting the basepoint in the following sense *)
H: Funext A: Type X: pType
(pointify A ->* X) <~> (A -> X)
H: Funext A: Type X: pType
(pointify A ->* X) <~> (A -> X)
H: Funext A: Type X: pType
(pointify A ->* X) -> A -> X
H: Funext A: Type X: pType
(A -> X) -> pointify A ->* X
H: Funext A: Type X: pType
?f o ?g == idmap
H: Funext A: Type X: pType
?g o ?f == idmap
H: Funext A: Type X: pType
(A -> X) -> pointify A ->* X
H: Funext A: Type X: pType
(funf : pointify A ->* X => f o inl) o ?g == idmap
H: Funext A: Type X: pType
?g o (funf : pointify A ->* X => f o inl) == idmap
H: Funext A: Type X: pType
(A -> X) -> pointify A ->* X
H: Funext A: Type X: pType f: A -> X
pointify A ->* X
H: Funext A: Type X: pType f: A -> X
pointify A -> X
H: Funext A: Type X: pType f: A -> X
?f pt = pt
H: Funext A: Type X: pType f: A -> X
pointify A -> X
H: Funext A: Type X: pType f: A -> X a: A
X
H: Funext A: Type X: pType f: A -> X u: Unit
X
H: Funext A: Type X: pType f: A -> X u: Unit
X
exact pt.
H: Funext A: Type X: pType f: A -> X
(funX0 : pointify A =>
match X0 with
| inl a => (funa0 : A => f a0) a
| inr u => unit_name pt u
end) pt = pt
reflexivity.
H: Funext A: Type X: pType
(funf : pointify A ->* X => f o inl)
o (funf : A -> X =>
Build_pMap
(funX0 : pointify A =>
match X0 with
| inl a => (funa0 : A => f a0) a
| inr u => unit_name pt u
end) 1) == idmap
H: Funext A: Type X: pType
(funf : A -> X =>
Build_pMap
(funX0 : pointify A =>
match X0 with
| inl a => (funa0 : A => f a0) a
| inr u => unit_name pt u
end) 1) o (funf : pointify A ->* X => f o inl) ==
idmap
H: Funext A: Type X: pType
(funf : A -> X =>
Build_pMap
(funX0 : pointify A =>
match X0 with
| inl a => (funa0 : A => f a0) a
| inr u => unit_name pt u
end) 1) o (funf : pointify A ->* X => f o inl) ==
idmap
H: Funext A: Type X: pType f: pointify A ->* X
Build_pMap
(funX0 : pointify A =>
match X0 with
| inl a => f (inl a)
| inr _ => pt
end) 1 = f
H: Funext A: Type X: pType f: pointify A ->* X
{|
pointed_fun :=
funX0 : A + Unit =>
match X0 with
| inl a => f (inl a)
| inr _ => ispointed_type X
end;
dpoint_eq := 1
|} = f
H: Funext A, X: Type f: A + Unit -> X
{|
pointed_fun :=
funX0 : A + Unit =>
match X0 with
| inl a => f (inl a)
| inr _ => f (inr tt)
end;
dpoint_eq := 1
|} = {| pointed_fun := f; dpoint_eq := 1 |}
H: Funext A, X: Type f: A + Unit -> X
{|
pointed_fun :=
funX0 : A + Unit =>
match X0 with
| inl a => f (inl a)
| inr _ => f (inr tt)
end;
dpoint_eq := 1
|} ==* {| pointed_fun := f; dpoint_eq := 1 |}
H: Funext A, X: Type f: A + Unit -> X
{|
pointed_fun :=
funX0 : A + Unit =>
match X0 with
| inl a => f (inl a)
| inr _ => f (inr tt)
end;
dpoint_eq := 1
|} == {| pointed_fun := f; dpoint_eq := 1 |}
H: Funext A, X: Type f: A + Unit -> X
?p pt =
dpoint_eq
{|
pointed_fun :=
funX0 : A + Unit =>
match X0 with
| inl a => f (inl a)
| inr _ => f (inr tt)
end;
dpoint_eq := 1
|} @
(dpoint_eq {| pointed_fun := f; dpoint_eq := 1 |})^
H: Funext A, X: Type f: A + Unit -> X
((funx : [A + Unit, inr tt] =>
match
x as s
return
({|
pointed_fun :=
funX0 : A + Unit =>
match X0 with
| inl a => f (inl a)
| inr _ => f (inr tt)
end;
dpoint_eq := 1
|} s = {| pointed_fun := f; dpoint_eq := 1 |} s)
with
| inl a => (funa0 : A => 1) a
| inr u =>
(funu0 : Unit =>
match
u0 as u1
return
({|
pointed_fun :=
funX0 : A + Unit =>
match X0 with
| inl a => f (inl a)
| inr _ => f (inr tt)
end;
dpoint_eq := 1
|} (inr u1) =
{| pointed_fun := f; dpoint_eq := 1 |}
(inr u1))
with
| tt => 1end) u
end)
:
{|
pointed_fun :=
funX0 : A + Unit =>
match X0 with
| inl a => f (inl a)
| inr _ => f (inr tt)
end;
dpoint_eq := 1
|} == {| pointed_fun := f; dpoint_eq := 1 |}) pt =
dpoint_eq
{|
pointed_fun :=
funX0 : A + Unit =>
match X0 with
| inl a => f (inl a)
| inr _ => f (inr tt)
end;
dpoint_eq := 1
|} @
(dpoint_eq {| pointed_fun := f; dpoint_eq := 1 |})^
reflexivity.Defined.
H: Funext A: Type
NatEquiv (opyon (pointify A)) (opyon A o pointed_type)
H: Funext A: Type
NatEquiv (opyon (pointify A)) (opyon A o pointed_type)
H: Funext A: Type
foralla : pType,
opyon (pointify A) a $<~>
(funx : pType => opyon A x) a
H: Funext A: Type
Is1Natural (opyon (pointify A))
(funx : pType => opyon A x) (funa : pType => ?e a)
H: Funext A: Type
Is1Natural (opyon (pointify A))
(funx : pType => opyon A x)
(funa : pType => equiv_pointify_map A a)
H: Funext A: Type
forall (aa' : pType) (f : a $-> a'),
(funa0 : pType => cate_fun (equiv_pointify_map A a0))
a' $o fmap (opyon (pointify A)) f $==
fmap (opyon A o pointed_type) f $o
(funa0 : pType => cate_fun (equiv_pointify_map A a0))
a
cbv; reflexivity.Defined.(** * Pointed categories give rise to pointed structures *)(** Pointed categories have pointed hom sets *)DefinitionpHom {A : Type} `{IsPointedCat A} (a1 a2 : A)
:= [Hom a1 a2, zero_morphism].(** Pointed functors give pointed maps on morphisms *)
A, B: Type F: A -> B IsGraph0: IsGraph A Is2Graph0: Is2Graph A Is01Cat0: Is01Cat A H: Is1Cat A H0: IsPointedCat A IsGraph1: IsGraph B Is2Graph1: Is2Graph B Is01Cat1: Is01Cat B H1: Is1Cat B H2: IsPointedCat B HasEquivs0: HasEquivs B HasMorExt0: HasMorExt B Is0Functor0: Is0Functor F Is1Functor0: Is1Functor F IsPointedFunctor0: IsPointedFunctor F a1, a2: A
pHom a1 a2 ->* pHom (F a1) (F a2)
A, B: Type F: A -> B IsGraph0: IsGraph A Is2Graph0: Is2Graph A Is01Cat0: Is01Cat A H: Is1Cat A H0: IsPointedCat A IsGraph1: IsGraph B Is2Graph1: Is2Graph B Is01Cat1: Is01Cat B H1: Is1Cat B H2: IsPointedCat B HasEquivs0: HasEquivs B HasMorExt0: HasMorExt B Is0Functor0: Is0Functor F Is1Functor0: Is1Functor F IsPointedFunctor0: IsPointedFunctor F a1, a2: A
pHom a1 a2 ->* pHom (F a1) (F a2)
A, B: Type F: A -> B IsGraph0: IsGraph A Is2Graph0: Is2Graph A Is01Cat0: Is01Cat A H: Is1Cat A H0: IsPointedCat A IsGraph1: IsGraph B Is2Graph1: Is2Graph B Is01Cat1: Is01Cat B H1: Is1Cat B H2: IsPointedCat B HasEquivs0: HasEquivs B HasMorExt0: HasMorExt B Is0Functor0: Is0Functor F Is1Functor0: Is1Functor F IsPointedFunctor0: IsPointedFunctor F a1, a2: A
pHom a1 a2 -> pHom (F a1) (F a2)
A, B: Type F: A -> B IsGraph0: IsGraph A Is2Graph0: Is2Graph A Is01Cat0: Is01Cat A H: Is1Cat A H0: IsPointedCat A IsGraph1: IsGraph B Is2Graph1: Is2Graph B Is01Cat1: Is01Cat B H1: Is1Cat B H2: IsPointedCat B HasEquivs0: HasEquivs B HasMorExt0: HasMorExt B Is0Functor0: Is0Functor F Is1Functor0: Is1Functor F IsPointedFunctor0: IsPointedFunctor F a1, a2: A
?f pt = pt
A, B: Type F: A -> B IsGraph0: IsGraph A Is2Graph0: Is2Graph A Is01Cat0: Is01Cat A H: Is1Cat A H0: IsPointedCat A IsGraph1: IsGraph B Is2Graph1: Is2Graph B Is01Cat1: Is01Cat B H1: Is1Cat B H2: IsPointedCat B HasEquivs0: HasEquivs B HasMorExt0: HasMorExt B Is0Functor0: Is0Functor F Is1Functor0: Is1Functor F IsPointedFunctor0: IsPointedFunctor F a1, a2: A
pHom a1 a2 -> pHom (F a1) (F a2)
exact (fmap F).
A, B: Type F: A -> B IsGraph0: IsGraph A Is2Graph0: Is2Graph A Is01Cat0: Is01Cat A H: Is1Cat A H0: IsPointedCat A IsGraph1: IsGraph B Is2Graph1: Is2Graph B Is01Cat1: Is01Cat B H1: Is1Cat B H2: IsPointedCat B HasEquivs0: HasEquivs B HasMorExt0: HasMorExt B Is0Functor0: Is0Functor F Is1Functor0: Is1Functor F IsPointedFunctor0: IsPointedFunctor F a1, a2: A
fmap F pt = pt
A, B: Type F: A -> B IsGraph0: IsGraph A Is2Graph0: Is2Graph A Is01Cat0: Is01Cat A H: Is1Cat A H0: IsPointedCat A IsGraph1: IsGraph B Is2Graph1: Is2Graph B Is01Cat1: Is01Cat B H1: Is1Cat B H2: IsPointedCat B HasEquivs0: HasEquivs B HasMorExt0: HasMorExt B Is0Functor0: Is0Functor F Is1Functor0: Is1Functor F IsPointedFunctor0: IsPointedFunctor F a1, a2: A