module Cat.Diagram.Terminal where
module _ {o h} (C : Precategory o h) where
open Cat.Reasoning C
Terminal objects🔗
An object of a category is said to be terminal if it admits a unique map from any other object:
: Ob → Type _
is-terminal = ∀ x → is-contr (Hom x ob)
is-terminal ob
record Terminal : Type (o ⊔ h) where
field
: Ob
top : is-terminal top has⊤
We refer to the centre of contraction as !
. Since it inhabits a contractible type,
it is unique.
: ∀ {x} → Hom x top
! = has⊤ _ .centre
!
: ∀ {x} (h : Hom x top) → ! ≡ h
!-unique = has⊤ _ .paths
!-unique
: ∀ {x} (f g : Hom x top) → f ≡ g
!-unique₂ = is-contr→is-prop (has⊤ _)
!-unique₂
open Terminal
Uniqueness🔗
If a category has two terminal objects and then there is a unique isomorphism We first establish the isomorphism: Since (resp. is terminal, there is a unique map (resp. To show these maps are inverses, we must show that is But these morphisms inhabit a contractible space, namely the space of maps into so they are equal.
: (t1 t2 : Terminal) → is-invertible (! t1 {top t2})
!-invertible = make-invertible (! t2) (!-unique₂ t1 _ _) (!-unique₂ t2 _ _)
!-invertible t1 t2
: (t1 t2 : Terminal) → top t1 ≅ top t2
⊤-unique = invertible→iso (! t2) (!-invertible t2 t1) ⊤-unique t1 t2
Hence, if is additionally a category, it has a propositional space of terminal objects:
: is-category C → is-prop Terminal
⊤-contractible .top =
⊤-contractible ccat x1 x2 i .to-path (⊤-unique x1 x2) i
ccat
.has⊤ ob =
⊤-contractible ccat x1 x2 i
is-prop→pathp(λ i → is-contr-is-prop {A = Hom _
(ccat .to-path (⊤-unique x1 x2) i)})
(x1 .has⊤ ob) (x2 .has⊤ ob) i
: ∀ {A B} → A ≅ B → is-terminal A → is-terminal B
is-terminal-iso = contr (isom .to ∘ term x .centre) λ h →
is-terminal-iso isom term x .to ∘ term x .centre ≡⟨ ap (isom .to ∘_) (term x .paths _) ⟩
isom .to ∘ isom .from ∘ h ≡⟨ cancell (isom .invl) ⟩
isom h ∎
In terms of right adjoints🔗
We prove that the inclusion functor of an object of is right adjoint to the unique functor if and only if is terminal.
module _ (x : Ob) (term : is-terminal x) where
: !F ⊣ !Const {C = C} x
is-terminal→inclusion-is-right-adjoint =
is-terminal→inclusion-is-right-adjoint (e _ .fst) (e _ .snd)
hom-iso→adjoints λ _ _ _ → term _ .paths _
where
: ∀ y → ⊤ ≃ Hom y x
e = is-contr→≃ (hlevel 0) (term y)
e y
module _ (x : Ob) (adj : !F ⊣ !Const {C = C} x) where
: is-terminal x
inclusion-is-right-adjoint→is-terminal = Equiv→is-hlevel 0
inclusion-is-right-adjoint→is-terminal y (Σ-contract (λ _ → hlevel 0) e⁻¹)
(R-adjunct-is-equiv adj .is-eqv _)
module _ {o h} {C : Precategory o h} where
open Cat.Reasoning C
private unquoteDecl eqv = declare-record-iso eqv (quote Terminal)
instance
Extensional-Terminal: ∀ {ℓr}
→ ⦃ sa : Extensional Ob ℓr ⦄
→ Extensional (Terminal C) ℓr
=
Extensional-Terminal ⦃ sa ⦄
embedding→extensional(Iso→Embedding eqv ∙emb (fst , Subset-proj-embedding (λ _ → hlevel 1)))
sa