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
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
`agda 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' α))
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 a pointed equivalence 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 = injective $
inverse .ε (e .fst) _ ⟩
e · from b₀ ≡⟨ Equiv.snd ⟩
b₀ ≡˘⟨ e e · a₀ ∎
: B →∙ A
from∙ = inverse .fst .fst , inverse .snd
from∙
: ∀ {ℓ} {A : Type∙ ℓ} → A ≃∙ A
id≃∙ = id≃ , refl
id≃∙
: ∀ {ℓ ℓ₁ ℓ₂} (A : Type∙ ℓ) {B : Type∙ ℓ₁} {C : Type∙ ℓ₂}
≃∙⟨⟩-syntax → B ≃∙ C → A ≃∙ B → A ≃∙ C
(g , pt) (f , pt') = f ∙e g , ap (g .fst) pt' ∙ pt
≃∙⟨⟩-syntax A
_≃∙˘⟨_⟩_ : ∀ {ℓ ℓ₁ ℓ₂} (A : Type∙ ℓ) {B : Type∙ ℓ₁} {C : Type∙ ℓ₂}
→ B ≃∙ A → B ≃∙ C → A ≃∙ C
= ≃∙⟨⟩-syntax _ g (Equiv∙.inverse f)
A ≃∙˘⟨ f ⟩ g
_≃∙⟨⟩_ : ∀ {ℓ ℓ₁} (A : Type∙ ℓ) {B : Type∙ ℓ₁} → A ≃∙ B → A ≃∙ B
= x≡y
x ≃∙⟨⟩ x≡y
_≃∙∎ : ∀ {ℓ} (A : Type∙ ℓ) → A ≃∙ A
= id≃∙
x ≃∙∎
infixr 2 ≃∙⟨⟩-syntax _≃∙⟨⟩_ _≃∙˘⟨_⟩_
infix 3 _≃∙∎
infix 21 _≃∙_
syntax ≃∙⟨⟩-syntax x q p = x ≃∙⟨ p ⟩ q
: 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