The category of functors and natural transformations
Because vertical composition has the shape f =>> g -> g =>> h -> f =>> h, we
can use it to define the category of functors as objects and natural transformations as morphisms
using vertical composition to stitch natural transformations together.
The objects of this category are functors, it is parameterised by two categories c and d that will
remain fixed such that every object is an instance of a functor from c to d. The identity morphism
is given by the identity natural transformation. It remains to prove this statement, which we do
programmatically. First, we pin down the parameters that are not going to change, that is, the categories
C and D, and the functors f,g:C→D
parameters {0 o1, o2 : Type} {0 c : Category o1} {0 d : Category o2} {f, g : c ->> d}
To help with type inference, we define an alias for function composition that is specialied to the
category D.
0 (|>>) : {x, y, z : o2} -> x ~> y -> y ~> z -> x ~> z (|>>) = (|:>) d private infixr 2 |>>
Then we prove the three lemmas that need to hold for this to form a category
Lemma
The identity natural transformation is neutral on the right side of vertical composition.
Using those lemma we can build the functor category parameterised over two
categories C and D. The objects are functors C→D
and morphisms are natural transformation.
Proposition
Given categories C and D, we define the category of functors as objets
and natural transformations as morphisms, composed via vertical composition.