We can use the idea that a natural transformation is a mapping between functors
to reproduce facts that we know ought to work. For example, since functor composition
is associative, we should be able to define a natural isomorphism between
(f∘g)∘h and f∘(g∘h).
There is still more we can do, for example, we can provide mappings from
any functor that is composed with the identity, to itself, essentially
proving that the identity functor is a neutral element with regards to
functor composition when the maps are natural transformations.
parameters {o1, o2 : Type} {c : Category o1} {d : Category o2} {f : c ->> d} public export funcIdRNT : idF c ⨾⨾ f =>> f funcIdRNT = MkNT (\vx => d.id _) (\x, y, m => d.idLeft _ _ _ `trans` sym (d.idRight _ _ _)) public export funcIdLNT : f ⨾⨾ idF d =>> f funcIdLNT = MkNT (\vx => d.id _) (\x, y, m => d.idLeft _ _ _ `trans` sym (d.idRight _ _ _)) public export funcIdLNT' : f =>> f ⨾⨾ idF d funcIdLNT' = MkNT (\vx => d.id _) (\x, y, m => d.idLeft _ _ _ `trans` sym (d.idRight _ _ _)) public export funcIdRNT' : f =>> idF c ⨾⨾ f funcIdRNT' = MkNT (\vx => d.id _) (\x, y, m => d.idLeft _ _ _ `trans` sym (d.idRight _ _ _) )
shouldn’t this be about the bicategory of sets, functors and natural transformations?
Actually the above help us define the monoidal category of endofunctors,
unlike FunctorCat, we fix one category C instead of two, and objects
are endofunctors C→C
Endofunctors
We define endofunctors as functors with the same
source and target. Here we make this a bit more precise by giving a function Endo that
will only build endofunctors. With this we can build the category EndoCat of endofunctors
as objects and natural transformations as morphisms
Definition
Endofunctors are functors with the same source and target.
public exportEndo : Category o -> TypeEndo c = c ->> c
Proposition
There is a category of endofunctors where the objects are endofunctors and the morphisms
are natural transformations between endofunctors.
public exportEndoCat : (c : Category o) -> Category (Endo c)EndoCat c = FunctorCat c c