module Cat.Functor.Closed where
When taken as a (bi)category,
the collection of (pre)categories is, in a suitably weak sense, Cartesian closed: there is an equivalence between the functor categories
and
We do not define the full equivalence here, leaving the natural
isomorphisms aside and focusing on the inverse functors themselves:
Curry and
Uncurry.
The two conversion functions act on objects essentially in the same way as currying and uncurrying behave on functions: the difference is that we must properly stage the action on morphisms. Currying a functor fixes a morphism and we must show that is natural in It follows from a bit of calculation using the functoriality of
Curry : Functor (C ΓαΆ D) E β Bifunctor C D E Curry {C = C} {D = D} F = make-bifunctor Ξ» where .Fβ a x β F.β (a , x) .lmap f β F.β (f , D.id) .rmap g β F.β (C.id , g) .lmap-id β F.F-id .rmap-id β F.F-id .lmap-β f g β ap F.β (refl ,β sym (D.idr _)) β F.F-β _ _ .rmap-β f g β ap F.β (sym (C.idr _) ,β refl) β F.F-β _ _ .lrmap f g β Fr.weave F (C.idr _ β sym (C.idl _) ,β D.idl _ β sym (D.idr _)) where module C = Precategory C module D = Precategory D module F = Functor F
open _=>_ evF : Bifunctor (Cat[ C , D ]) C D evF {C = C} {D = D} = make-bifunctor record where module C = Cr C module D = Cr D Fβ F x = F .Fβ x lmap f = f .Ξ· _ lmap-id = refl lmap-β f g = refl rmap {a = F} f = F .Fβ f rmap-id {a = F} = F .F-id rmap-β {a = F} _ _ = F .F-β _ _ lrmap f g = f .is-natural _ _ _ eval-at : β C β β Functor Cat[ C , D ] D eval-at {C = C} {D = D} = Bifunctor.Left evF