A functor is what goes between categories.
A functor from to is an image of in (but the naive image need not be a subcategory of ).
A functor between (small) categories is a morphism of the underlying directed graphs that respects the composition of edges.
So a functor is a morphism between two categories that
constsis of a map of the objects of the categories
and a map of the morphisms of the categories
such that
it respect source and target: coincides with on source and target objects;
it respects composition: the image of the composite of two morphisms under is the composite of their images.
This last property is the decicive one of a functor. It is called the functoriality condition. It is a direct generalization of the notion of homomorphism (of monoids, groups, algebras, etc.) to the case that there are more objects. As a slogan we have
The notion of functor is a horizontal categorification of that of homomorphism.
A functor from a category to a category is a map sending each object to an object and each morphism in to morphism in , such that
preserves composition: whenever the left-hand side is well-defined,
preserves identity morphisms: for each object , .
Or equivalently, since compositions (commuting triangles) and identities (commuting loops) are both simple commuting diagrams, we can combine the above conditions to the single statement
Given morphisms , , and , declaring the triangle commutes amounts to declaring
In this case, for to preserve the commutative triangle means
as depicted below
Preserving commuting triangles means preserves compositions.
Given morphisms , , and , declaring the loop commutes amounts to declaring
In this case, for to preserve the commutative loop means
as depicted below
However, it means more than that. Since any commutative loop is equal to the identity morphism, we must also have
implying
Preserving commuting loops means preserves identity morphisms.
Another equivalent way to say this is that a functor is precisely a morphism of simplicial sets between the nerves of these categories
the objects of and are the 0-cells of and , so maps objects of to objects of ;
the morphisms of and are the 1-cells of and , so maps morphisms of to objects of ;
the identity morphisms of and are the degenerate 1-cellsof and , so the fact that respects degeneracy maps means that respects identities;
the commuting triangles of and are the 2-cells of and , so the fact that maps 2-cells to 2-cells means that it respects commuting triangles, hence that it respects composition.
See nerve for more details on this.
The functors between two categories and form themselves a category, the functor category , whose morphisms are natural transformations. Equipped with these functor categories as hom-objects, we have a -category Cat of categories, functors and natural transformations. In other words, functors are morphisms in .
If and are internal categories in some ambient category , then an internal functor is
a morphism of objects in ;
a morphisms of morphisms in ;
such that the following diagrams commute
respect for the source map: ;
respect for the target map: ;
respect for identities ;
respect for composition .
This reproducces the external definition of functors above for small categories, which are categories internal to Set
In many cases, this notion is too restrictive, and we should use internal anafunctors instead.
In enriched category theory a functor maps not hom-sets but the given hom-objects to each other, in a way that respects their composition. This is described at
A generalization of the notion of enriched functor is the notion of profunctor.
In higher category theory there are corresponding higher notions of functor, such as
See also an informal discussion about an experimental alternative definition of functor.
Functors with special properties are important in applications. See for instance
And for more background on this see stuff, structure, property.
For monoids or groups, let , , be the corresponding obe-object categories (as described at delooping). Then functors
are canonically in bijection with monoid homomorphisms and accordingly functors
are canonically in bijection with group homomorphisms .
With as above, functors on with values in Vect are the same as linear representations of the group . In fact, we have a canonical isomorphism of categories
of the functor category with the representation category.
Let and be one-object categories whose objects are each finite-dimensional vector space and whose morphisms are all of the linear endomorphisms on that space, i.e. one-object full subcategories of .
If the linear map has a left inverse, i.e.
where is the preimage, then we can construct a functor
by defining its action on objects by
where on the right-hand side is the image and its action on endomorphisms by
Composition follows immediately
Identity morphisms are preserved since for any vector in , then
for some vector in and we have
so that
as required. Hence, is a functor.
If the linear map has a right inverse, i.e.
where is the preimage, then we can construct a functor
by defining its action on objects by
where on the right-hand side is preimage, and its action on endomorphisms by
Composition follows immediately
Identity morphisms are preserved since for any vector in , then
for some vector in and we have
so that
as required. Hence, is a functor.
Functors with values in Set are also called presheaves. As such one calls them presheaves on the opposite category of . See presheaf for more on this.
For a category, and an object, and any other object, a morphism may be regarded as a generalized element of , written (For this language applied to the category Set of sets see ETCS. For the general case see type theory).
The set of generalized elements of an object is thus the union of hom-sets .
While a morphism in an arbitrary category need not at all come to us as a function of sets, it always induces a function of sets of generalized elements : it sends the generalized element of to the generalized element
of , using the composition of the morphism with the morphism in .
In terms of this notation, the functoriality condition on a functor , which is
appears as
This can be illustrated in the following diagram
which provides an alternative expression of the functoriality condition as simply a statement that commuting diagrams in map to commuting diagrams in .