module 1Lab.Type.Pointed where
Pointed typesπ
A pointed type is a type equipped with a choice of base point
: β β β Type (lsuc β)
Typeβ = Ξ£ (Type β) (Ξ» A β A) Typeβ β
private variable
: Level
β β' : Typeβ β A B C D
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.
: A ββ B
zeroβ {B = _ , bβ} = record { snd = refl }
zeroβ
: A ββ A
idβ = id , refl
idβ
_ββ_ : (B ββ C) β (A ββ B) β A ββ C
(f , f*) ββ (g , g*) = record
{ fst = f β g
; snd = ap f g* β f*
}
: Typeβ β β Typeβ β' β Typeβ (β β β')
Mapsβ .fst = A ββ B
Mapsβ A B .snd = zeroβ
Mapsβ A B
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 _Γβ_
: A Γβ B ββ A
fstβ = fst , refl
fstβ
: A Γβ B ββ B
sndβ = snd , refl sndβ
Paths 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
: (h : β x β f x β‘ g x) β Square (h aβ) Ο Ξ³ refl β fβ β‘ gβ
funextβ = record
funextβ h pth i { fst = funext h i
; snd = pth i
}
_ : (h : β x β f x β‘ g x) β Ο β‘ h aβ β Ξ³ β fβ β‘ gβ
_ = Ξ» h Ξ± β funextβ h (flipβ (ββsquare' Ξ±))
: (f : A ββ B) β idβ ββ f β‘ f
ββ-idl = funextβ (Ξ» _ β refl) (β-idr _)
ββ-idl f
: (f : A ββ B) β f ββ idβ β‘ f
ββ-idr = funextβ (Ξ» _ β refl) (β-idl _)
ββ-idr f
: (f : C ββ D) (g : B ββ C) (h : A ββ B)
ββ-assoc β (f ββ g) ββ h β‘ f ββ (g ββ h)
(f , f') (g , g') (h , h') = funextβ (Ξ» _ β refl) $
ββ-assoc (f β g) h' β ap f g' β f' β‘β¨ β-assoc _ _ _ β©
ap (ap (f β g) h' β ap f g') β f' β‘Λβ¨ ap-β f _ _ β©ββ¨refl β©
(ap g h' β g') β f' β ap 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β)
: A ββ B β A β‘ B
uaβ (e , p) i .fst = ua e i
uaβ (e , p) i .snd = pathβua-pathp e p i uaβ
Of 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
: A ββ B
toβ = e .fst .fst , e .snd
toβ
open Equiv (e .fst) hiding (inverse) public
: B ββ A
inverse .fst = Equiv.inverse (e .fst)
inverse .snd = sym (Equiv.adjunctl (e .fst) (e .snd)) inverse
: B ββ A
fromβ = inverse .fst .fst , inverse .snd
fromβ
: β {β} {A : Typeβ β} β A ββ A
idββ = idβ , refl
idββ
_β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'
: β {β ββ ββ} (A : Typeβ β) {B : Typeβ ββ} {C : Typeβ ββ}
βββ¨β©-syntax β B ββ C β A ββ B β A ββ C
= f βeβ g
βββ¨β©-syntax A g f
_ββΛβ¨_β©_ : β {β ββ ββ} (A : Typeβ β) {B : Typeβ ββ} {C : Typeβ ββ}
β B ββ A β B ββ C β A ββ C
= Equivβ.inverse f βeβ g
A ββΛβ¨ f β© g
_βββ¨β©_ : β {β ββ} (A : Typeβ β) {B : Typeβ ββ} β A ββ B β A ββ B
= xβ‘y
x βββ¨β© xβ‘y
_βββ : β {β} (A : Typeβ β) β A ββ A
= idββ
x βββ
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
= Ξ£-pathp (Ξ£-prop-path! (ap fst p)) (ap snd p)
ββ-ext p
: A β‘ B β A ββ B
pathβequivβ .fst = pathβequiv (ap fst p)
pathβequivβ p .snd = from-pathp (ap snd p)
pathβequivβ p
: 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)
uaβ-id-equiv (Ξ» { (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ββ)
.to-path = uaβ
univalenceβ-identity-system .to-path-over {a = A , aβ} (e , e*) i = record
univalenceβ-identity-system { fst =
let
: β i β A β ua e i
f = pathβua-pathp e refl i
f i a 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
= IdsJ univalenceβ-identity-system EquivβJ
Homogeneityπ
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.
: Type β β Type _
Homogeneous = β {x y} β Path (Typeβ _) (A , x) (A , y) Homogeneous A
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
: β {β} {A : Type β} {x y : A} β Homogeneous (Path A x y)
Path-homogeneous {x = _} {_} {p} {q} = uaβ record
Path-homogeneous { 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
{A = A} {B = B , bβ} {f = fβ@(f , f*)} {gβ@(g , g*)} h =
homogeneous-funextβ (Ξ» b β PathP (Ξ» i β A ββ b i) fβ gβ) fix bad where
subst : β x β Path (Typeβ _) (B , bβ) (B , x)
hom = auto
hom x
= sym f* ββ h (A .snd) ββ g*
fg*
: PathP (Ξ» i β A ββ B , fg* i) fβ gβ
bad .fst x = h x i
bad i .snd j = ββ-filler (sym f*) (h (A .snd)) g* j i
bad i
: Square {A = Typeβ _} refl (Ξ» i β B , fg* i) refl refl
fix = hcomp (β i β¨ β j) Ξ» where
fix i j (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β k k
Typeβ-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)
{A = A} n = Equivβis-hlevel (suc n)
Typeβ-path-is-hlevel (identity-system-gives-path univalenceβ-identity-system eβ»ΒΉ)
(hlevel (suc n))