module 1Lab.Type.Pointed wherePointed typesπ
A pointed type is a type equipped with a choice of base point
Typeβ : β β β Type (lsuc β)
Typeβ β = Ξ£ (Type β) (Ξ» A β A)private variable
β β' : Level
A B C D : Typeβ βIf we have pointed types and the most natural notion of function between them is not simply the type of functions but rather those functions which preserve the basepoint, i.e.Β the functions equipped with paths Those are called pointed maps.
_ββ_ : Typeβ β β Typeβ β' β Type _
(A , a) ββ (B , b) = Ξ£[ f β (A β B) ] (f a β‘ b)The type of pointed maps
is always inhabited by the constant function with value
which we refer to as the zero map. This makes the type
itself a pointed type; in the code, we write Mapsβ. As further examples, the identity
is evidently pointed, and the composition of pointed maps is once again
pointed.
zeroβ : A ββ B
zeroβ {B = _ , bβ} = record { snd = refl }
idβ : A ββ A
idβ = id , refl
_ββ_ : (B ββ C) β (A ββ B) β A ββ C
(f , f*) ββ (g , g*) = record
{ fst = f β g
; snd = ap f g* β f*
}Mapsβ : Typeβ β β Typeβ β' β Typeβ (β β β')
Mapsβ A B .fst = A ββ B
Mapsβ A B .snd = zeroβ
infixr 0 _ββ_
infixr 40 _ββ_The product of pointed types is naturally pointed (at the pairing of
the basepoints), and this definition makes the fst and snd projections into pointed maps.
_Γβ_ : Typeβ β β Typeβ β' β Typeβ (β β β')
(A , a) Γβ (B , b) = A Γ B , a , b
infixr 5 _Γβ_
fstβ : A Γβ B ββ A
fstβ = fst , refl
sndβ : A Γβ B ββ B
sndβ = snd , reflPaths between pointed maps are characterised as pointed
homotopies. If we are comparing
and
as pointed maps
it suffices to give a homotopy
and a Square with the boundary
below. We note in passing that this is equivalent to asking for a proof
that
module
_ {β β'} {A@(_ , aβ) : Typeβ β} {B@(_ , bβ) : Typeβ β'}
{fβ@(f , Ο) gβ@(g , Ξ³) : A ββ B}
where funextβ : (h : β x β f x β‘ g x) β Square (h aβ) Ο Ξ³ refl β fβ β‘ gβ
funextβ h pth i = record
{ fst = funext h i
; snd = pth i
}
_ : (h : β x β f x β‘ g x) β Ο β‘ h aβ β Ξ³ β fβ β‘ gβ
_ = Ξ» h Ξ± β funextβ h (flipβ (ββsquare' Ξ±))ββ-idl : (f : A ββ B) β idβ ββ f β‘ f
ββ-idl f = funextβ (Ξ» _ β refl) (β-idr _)
ββ-idr : (f : A ββ B) β f ββ idβ β‘ f
ββ-idr f = funextβ (Ξ» _ β refl) (β-idl _)
ββ-assoc : (f : C ββ D) (g : B ββ C) (h : A ββ B)
β (f ββ g) ββ h β‘ f ββ (g ββ h)
ββ-assoc (f , f') (g , g') (h , h') = funextβ (Ξ» _ β refl) $
ap (f β g) h' β ap f g' β f' β‘β¨ β-assoc _ _ _ β©
(ap (f β g) h' β ap f g') β f' β‘Λβ¨ ap-β f _ _ β©ββ¨refl β©
ap f (ap g h' β g') β f' βPointed equivalencesπ
Combining our univalent understanding of paths in the universe and our understanding of paths in types, it stands to reason that identifications in the space of pointed types are given by equivalences which carry to We call these pointed equivalences from to and, as expected, we can directly use cubical primitives to turn a pointed equivalence into a path of pointed types.
_ββ_ : Typeβ β β Typeβ β' β Type _
(A , aβ) ββ (B , bβ) = Ξ£[ e β A β B ] (e Β· aβ β‘ bβ)
uaβ : A ββ B β A β‘ B
uaβ (e , p) i .fst = ua e i
uaβ (e , p) i .snd = pathβua-pathp e p iOf course, a pointed equivalence has an underlying pointed map, by simply swapping the quantifiers. Less directly, the inverse of a pointed equivalence is a pointed equivalence as well.
module Equivβ {β β'} {A@(_ , aβ) : Typeβ β} {B@(_ , bβ) : Typeβ β'} (e : A ββ B) where toβ : A ββ B
toβ = e .fst .fst , e .snd
open Equiv (e .fst) hiding (inverse) public
inverse : B ββ A
inverse .fst = Equiv.inverse (e .fst)
inverse .snd = sym (Equiv.adjunctl (e .fst) (e .snd)) fromβ : B ββ A
fromβ = inverse .fst .fst , inverse .snd
idββ : β {β} {A : Typeβ β} β A ββ A
idββ = idβ , refl
_βeβ_ : β {β ββ ββ} {A : Typeβ β} {B : Typeβ ββ} {C : Typeβ ββ}
β A ββ B β B ββ C β A ββ C
(f , pt) βeβ (g , pt') = f βe g , ap (g .fst) pt β pt'
βββ¨β©-syntax : β {β ββ ββ} (A : Typeβ β) {B : Typeβ ββ} {C : Typeβ ββ}
β B ββ C β A ββ B β A ββ C
βββ¨β©-syntax A g f = f βeβ g
_ββΛβ¨_β©_ : β {β ββ ββ} (A : Typeβ β) {B : Typeβ ββ} {C : Typeβ ββ}
β B ββ A β B ββ C β A ββ C
A ββΛβ¨ f β© g = Equivβ.inverse f βeβ g
_βββ¨β©_ : β {β ββ} (A : Typeβ β) {B : Typeβ ββ} β A ββ B β A ββ B
x βββ¨β© xβ‘y = xβ‘y
_βββ : β {β} (A : Typeβ β) β A ββ A
x βββ = idββ
infixr 30 _βeβ_
infixr 2 βββ¨β©-syntax _βββ¨β©_ _ββΛβ¨_β©_
infix 3 _βββ
infix 21 _ββ_
syntax βββ¨β©-syntax x q p = x βββ¨ p β© q
ββ-ext
: {f g : A ββ B} β Equivβ.toβ f β‘ Equivβ.toβ g β f β‘ g
ββ-ext p = Ξ£-pathp (Ξ£-prop-path! (ap fst p)) (ap snd p)
pathβequivβ : A β‘ B β A ββ B
pathβequivβ p .fst = pathβequiv (ap fst p)
pathβequivβ p .snd = from-pathp (ap snd p)
uaβ-id-equiv : uaβ {A = A} idββ β‘ refl
uaβ-id-equiv {A = A , aβ} i j .fst = ua-id-equiv {A = A} i j
uaβ-id-equiv {A = A , aβ} i j .snd = attach (β j β¨ i)
(Ξ» { (j = i0) β aβ ; (j = i1) β aβ ; (i = i1) β aβ })
(inS aβ)Moreover, we can prove that pointed equivalences are an identity system on the type of pointed types, again by a pretty direct cubical argument.
univalenceβ-identity-system
: is-identity-system {A = Typeβ β} _ββ_ (Ξ» _ β idββ)
univalenceβ-identity-system .to-path = uaβ
univalenceβ-identity-system .to-path-over {a = A , aβ} (e , e*) i = record
{ fst =
let
f : β i β A β ua e i
f i a = pathβua-pathp e refl i
in f i , is-propβpathp (Ξ» i β is-equiv-is-prop (f i)) id-equiv (e .snd) i
; snd = Ξ» j β pathβua-pathp e (Ξ» k β e* (j β§ k)) i
}Note that this immediately lets us obtain a pointed equivalence induction principle.
EquivβJ
: β {β β'} {A : Typeβ β} (P : (B : Typeβ β) β A ββ B β Type β')
β P A idββ
β β {B} e β P B e
EquivβJ = IdsJ univalenceβ-identity-systemHomogeneityπ
Coming up with pointed homotopies is tricky when thereβs a lot of path algebra involved in showing that the underlying functions are identical, since we would have to trace the pointedness witness along this construction. However, there is a simplifying assumption we can impose on the codomain that makes this much simpler, allowing us to consider only the underlying functions to begin with.
We say that a type is homogeneous if, given two choices of basepoint we have that in the type of pointed types.
Homogeneous : Type β β Type _
Homogeneous A = β {x y} β Path (Typeβ _) (A , x) (A , y)By univalence, this is equivalent to asking for, given an equivalence with This provides us some example that the notion is not vacuous: for example, if we can decide equality in then we can build such an equivalence by case analysis.
Another example is readily given by path spaces, where if we are given then precomposition with is an auto-equivalence of which sends to thence an identification between the pointed types and
instance
Path-homogeneous : β {β} {A : Type β} {x y : A} β Homogeneous (Path A x y)
Path-homogeneous {x = _} {_} {p} {q} = uaβ record
{ fst = β-pre-equiv (q β sym p)
; snd = β-cancelr q p
}If are pointed maps into a homogeneous type then to get an identity it suffices to identify the underlying unpointed maps
homogeneous-funextβ
: β {β β'} {A : Typeβ β} {B : Typeβ β'}
β β¦ _ : Homogeneous (B .fst) β¦
β β {f g : A ββ B} (h : β x β f .fst x β‘ g .fst x)
β f β‘ g
homogeneous-funextβ {A = A} {B = B , bβ} {f = fβ@(f , f*)} {gβ@(g , g*)} h =
subst (Ξ» b β PathP (Ξ» i β A ββ b i) fβ gβ) fix bad where
hom : β x β Path (Typeβ _) (B , bβ) (B , x)
hom x = auto
fg* = sym f* ββ h (A .snd) ββ g*
bad : PathP (Ξ» i β A ββ B , fg* i) fβ gβ
bad i .fst x = h x i
bad i .snd j = ββ-filler (sym f*) (h (A .snd)) g* j i
fix : Square {A = Typeβ _} refl (Ξ» i β B , fg* i) refl refl
fix i j = hcomp (β i β¨ β j) Ξ» where
k (k = i0) β B , bβ
k (i = i0) β hom (fg* j) k
k (i = i1) β hom bβ k
k (j = i0) β hom bβ k
k (j = i1) β hom bβ kTypeβ-path-is-hlevel
: β {β} {A : Type β} {x y : A} n
β β¦ _ : H-Level A (suc n) β¦ β¦ _ : H-Level A (suc (suc n)) β¦
β is-hlevel (Path (Typeβ β) (A , x) (A , y)) (suc n)
Typeβ-path-is-hlevel {A = A} n = Equivβis-hlevel (suc n)
(identity-system-gives-path univalenceβ-identity-system eβ»ΒΉ)
(hlevel (suc n))