many commonly occurring categories are functor categories, so any statement proved for general functor categories is widely applicable;
every category embeds in a functor category ; the functor category often has nicer properties than the original category, allowing certain operations that were not available in the original setting.
Definition
Suppose is a small category and is an arbitrary category. The category of functors from to, written as Fun, Funct,, or, has as objects the covariant functors from to, and as morphisms the natural transformations between such functors. Note that natural transformations can be composed: if is a natural transformation from the functor to the functor, and is a natural transformation from the functor to the functor, then the collection defines a natural transformation from to. With this composition of natural transformations, satisfies the axioms of a category. In a completely analogous way, one can also consider the category of all contravariant functors from to ; we write this as Funct. If and are both preadditive categories, then we can consider the category of all additive functors from to, denoted by Add.
Examples
If is a small discrete category, then a functor from to essentially consists of a family of objects of, indexed by ; the functor category can be identified with the corresponding product category: its elements are families of objects in and its morphisms are families of morphisms in.
An arrow category is just, where 2 is the category with two objects and their identity morphisms as well as an arrow from one object to the other.
A directed graph consists of a set of arrows and a set of vertices, and two functions from the arrow set to the vertex set, specifying each arrow's start and end vertex. The category of all directed graphs is thus nothing but the functor category, where is the category with two objects connected by two parallel morphisms, and Set denotes the category of sets.
Any group can be considered as a one-object category in which every morphism is invertible. The category of all -sets is the same as the functor category Set.
Similar to the previous example, the category of -linear representations of the group is the same as the functor category k-Vect.
Any ring can be considered as a one-object preadditive category; the category of left modules over is the same as the additive functor category Add, and the category of right -modules is Add. Because of this example, for any preadditive category, the category Add is sometimes called the "category of left modules over and Add is the category of right modules over.
The category of presheaves on a topological space is a functor category: we turn the topological space into a category having the open sets in as objects and a single morphism from to if and only if is contained in. The category of presheaves of sets on is then the same as the category of contravariant functors from to . Because of this example, the category Funct is sometimes called the "category of presheaves of sets on even for general categories not arising from a topological space. To define sheaves on a general category, one needs more structure: a Grothendieck topology on.
Facts
Most constructions that can be carried out in can also be carried out in by performing them "componentwise", separately for each object in. For instance, if any two objects and in have a product, then any two functors and in have a product, defined by for every object in. Similarly, if is a natural transformation and each has a kernel in the category, then the kernel of in the functor category is the functor with for every object in. As a consequence we have the general rule of thumb that the functor category shares most of the "nice" properties of :
if is any small category, then the category of presheaves is a topos.
So from the above examples, we can conclude right away that the categories of directed graphs, -sets and presheaves on a topological space are all complete and cocomplete topoi, and that the categories of representations of, modules over the ring, and presheaves of abelian groups on a topological space are all abelian, complete and cocomplete. The embedding of the category in a functor category that was mentioned earlier uses the Yoneda lemma as its main tool. For every object of, let be the contravariant representable functor from to. The Yoneda lemma states that the assignment is a full embedding of the category into the category Funct. So naturally sits inside a topos. The same can be carried out for any preadditive category : Yoneda then yields a full embedding of into the functor category Add. So naturally sits inside an abelian category. The intuition mentioned above can be made precise in several ways; the most succinct formulation uses the language of adjoint functors. Every functor induces a functor . If and is a pair of adjoint functors, then and is also a pair of adjoint functors. The functor category has all the formal properties of an exponential object; in particular the functors from stand in a natural one-to-one correspondence with the functors from to. The category of all small categories with functors as morphisms is therefore a cartesian closed category.