module Cat.Functor.Base where
Functor precategories🔗
Fix a pair of (completely arbitrary!) precategories and . We’ll show how to make the type of functors into a precategory on its own right, with the natural transformations as the morphisms. First, given , we construct the identity natural transformation by having every component be the identity:
: {F : Functor C D} → F => F
idnt .η _ = D.id
idnt .is-natural _ _ _ = D.id-comm-sym idnt
Moreover, if we have a pair of composable-looking natural transformations and , then we can indeed make their pointwise composite into a natural transformation:
_∘nt_ : ∀ {F G H : Functor C D} → G => H → F => G → F => H
(f ∘nt g) .η x = f .η x D.∘ g .η x
_∘nt_ {F} {G} {H} f g .is-natural x y h =
(f .η y D.∘ g .η y) D.∘ F .F₁ h ≡⟨ D.pullr (g .is-natural x y h) ⟩
.η y D.∘ G .F₁ h D.∘ g .η x ≡⟨ D.extendl (f .is-natural x y h) ⟩
f .F₁ h D.∘ f .η x D.∘ g .η x ∎
H
infixr 40 _∘nt_
Since we already know that identity of natural transformations is determined by identity of the underlying family of morphisms, and the identities and composition we’ve just defined are componentwise just identity and composition in , then the category laws we have to prove are, once again, those of :
_,_]
Cat[: Precategory o ℓ → Precategory o₁ ℓ₁
→ Precategory (o ⊔ ℓ ⊔ o₁ ⊔ ℓ₁) (o ⊔ ℓ ⊔ ℓ₁)
.Pc.Ob = Functor C D
Cat[ C , D ] .Pc.Hom = _=>_
Cat[ C , D ] .Pc.Hom-set F G = Nat-is-set
Cat[ C , D ]
.Pc.id = idnt
Cat[ C , D ] .Pc._∘_ = _∘nt_
Cat[ C , D ]
.Pc.idr f = ext λ x → Pc.idr D _
Cat[ C , D ] .Pc.idl f = ext λ x → Pc.idl D _
Cat[ C , D ] .Pc.assoc f g h = ext λ x → Pc.assoc D _ _ _ Cat[ C , D ]
We’ll also need the following foundational tool, characterising paths between functors. It says that, given a homotopy between the object-parts of functors , and, over this, an identification between the actions of and on morphisms, we can construct a path .
Paths between functors🔗
Functor-path: {F G : Functor C D}
→ (p0 : ∀ x → F₀ F x ≡ F₀ G x)
→ (p1 : ∀ {x y} (f : C .Pc.Hom x y)
→ PathP (λ i → D .Pc.Hom (p0 x i) (p0 y i)) (F .F₁ f) (G .F₁ f))
→ F ≡ G
Note that this lemma is a bit unusual: we’re characterising the identity type of the objects of a precategory, rather than, as is more common, the morphisms of a precategory. However, this characterisation will let us swiftly establish necessary conditions for univalence of functor categories.
Action on isomorphisms🔗
We have also to make note of the following fact: absolutely all functors preserve isomorphisms, and, more generally, preserve invertibility.
: ∀ {x y} (F : Functor C D) → x C.≅ y → F₀ F x D.≅ F₀ F y
F-map-iso .to = F .F₁ (x .to)
F-map-iso F x .from = F .F₁ (x .from)
F-map-iso F x .inverses =
F-map-iso F x record { invl = sym (F .F-∘ _ _) ∙ ap (F .F₁) (x .invl) ∙ F .F-id
; invr = sym (F .F-∘ _ _) ∙ ap (F .F₁) (x .invr) ∙ F .F-id
}
where module x = C._≅_ x
: ∀ {x y} (F : Functor C D) {f : C.Hom x y} → C.is-invertible f → D.is-invertible (F₁ F f)
F-map-invertible =
F-map-invertible F inv .make-invertible (F₁ F _)
D(sym (F-∘ F _ _) ·· ap (F₁ F) x.invl ·· F-id F)
(sym (F-∘ F _ _) ·· ap (F₁ F) x.invr ·· F-id F)
where module x = C.is-invertible inv
If the categories the functor maps between are univalent, there is a competing notion of preserving isomorphisms: the action on paths of the object-part of the functor. We first turn the isomorphism into a path (using univalence of the domain), run it through the functor, then turn the resulting path back into an isomorphism. Fortunately, functors are already coherent enough to ensure that these actions agree:
F-map-path: (ccat : is-category C) (dcat : is-category D)
→ ∀ (F : Functor C D) {x y} (i : x C.≅ y)
→ ap (F₀ F) (Univalent.iso→path ccat i) ≡ Univalent.iso→path dcat (F-map-iso F i)
{x} = Univalent.J-iso ccat P pr where
F-map-path ccat dcat F : (b : C.Ob) → C.Isomorphism x b → Type _
P = ap (F₀ F) (Univalent.iso→path ccat im)
P b im .iso→path dcat (F-map-iso F im)
≡ Univalent
: P x C.id-iso
pr =
pr (F₀ F) (Univalent.iso→path ccat C.id-iso) ≡⟨ ap (ap (F₀ F)) (Univalent.iso→path-id ccat) ⟩
ap (F₀ F) refl ≡˘⟨ Univalent.iso→path-id dcat ⟩
ap .to-path D.id-iso ≡⟨ ap (dcat .to-path) (D.≅-path (sym (F .F-id))) ⟩
dcat .to-path (F-map-iso F C.id-iso) ∎ dcat
Presheaf precategories🔗
Of principal importance among the functor categories are those to the category : these are the presheaf categories.
: ∀ κ {o ℓ} → Precategory o ℓ → Precategory _ _
PSh = Cat[ C ^op , Sets κ ] PSh κ C