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