...whenever new abstract objects are constructed in a specified way out of given ones, it is advisable to regard the construction of the corresponding induced mappings on these objects as an integral part of their definition.
Maps between categories are called functors. Briefly, a functor between categories consists of maps of objects and arrows that preserve the categorical structure. In more detail:
Definition of functor
Suppose and are categories. A functor consists of the following data:
For each object , an object
For each arrow in , an arrow in
with the following properties:
(Compatibility with composition) For every pair of composable arrows in , we must have
(Identity Preservation) For every object , one has
Covariant? Contravariant?
You may run across the phrase "covariant functor" or "contravariant functor." Both are holdovers from the early days of category theory, when the foundations were still being established. Back then, many of the inspiring examples in algebraic geometry and algebraic topology involved functor-like maps that reversed the directions of arrows. We will even see examples of this in both module theory (see here) and category theory (see Yoneda's Lemma). In other words, we'll see maps between categories that send an arrow in to an arrow in . In other words, the direction of the arrow is being reversed.
Since such maps between categories arose naturally and behaved well in all other respects, they were called contravariant functors. By contrast, our usual (direction-preserving) maps were called covariant functors.[1] Note that a contravariant functor "reverses" composition, i.e., satisfies .
The more modern view has reverted to simply "functors", and has incorporated the contravariant functors via the notion of opposite categories: a contravariant functor is equivalent to a (covariant) functor (and also to a covariant functor ).
Examples
The power set functor
One of the first constructions you usually see in set theory is that of the power set. Indeed, it is usually part of the very axioms of set theory. This construction is the object map of a functor. The power set functor is defined as follows:
Objects: For each set we assign its power set , i.e., the set of all subsets of
Arrows: For each set map , we assign the set map defined by sending a subset to its image .
You should verify for yourself that these maps satisfy the properties of a functor.
Forgetful functors
A functor that simply "forgets" some or all of the structure of an algebraic object is commonly called a forgetful (or underlying) functor. For example, the forgetful functor assigns to each group the set of its elements ("forgetting" the multiplication and hence the group structure), and assigns to each group homomorphism the same function , regarded simply as a set map. Below are some other common forgetful functors:
What purpose could forgetting possibly serve?
A fair question. For now the answer is simply "Let's wait and see." Soon we will see that many (all?) constructions and "universal properties" depend crucially on the category in which one is working. As such, being able to be incredibly specific about which category is being considered will often prove critically important.
Remember me not
Are there functors inverse to "forgetting?" Sadly, we will see that the answer to that question is generally no: that which is forgotten cannot be remembered. However, we will also see that there is a type of functor which can be regarded as complementary to forgetting (later to be codified in the idea of an adjoint).
For example, there is a functor that assigns to each set the so-called free group. This is the group whose elements are finite "words" with letters the elements (along with their formal inverses), modulo an equivalence relation that equates the words and with the empty word (which is the identity for the group). The operation on this free group is concatenation. An alternative name for this functor could be the "groupification" functor, since it creates a group from a given set.
Note that these two functors are definitely not inverses. For instance, even if is the trivial group (with a single element), the free group on the one-element set is infinite. In other words, . So what is the relation between the functors and ? That is something we will explore in detail when we study adjoint functors.
Abelianization
Suppose is a group. For each pair of elements , the element is called the commutator of and in . Notice that this element is the identity exactly when the elements and commute. The subgroup generated by the set of all commutators in is a normal subgroup of , called the commutator subgroup and denoted . You can verify the following facts:
is always an abelian group;
Any group morphism carries commutators to commutators, hence to
Every group morphism to an abelian group factors uniquely through the projection
The assignment is the object function of a functor , called the abelianization functor (or sometimes factor-commutator functor).
The abelianization functor is adjoint to the forgetful functor .
A non-functor
Although nearly every common construction in algebra is the object function of a functor, there are a few notable exceptions. One such is the assignment to each group of its center . Intuitively, that is because a homomorphism can carry an element in the center of to one not in the center of , and hence we do not have an induced morphism . For additional details, check out this exercise.
General linear group
For each commutative ring , the set of all invertible matrices with entries in is called general linear group. Moreover, for each ring morphism between commutative rings there is a set map that takes each matrix with entries in to a matrix with entries in (by simply applying the ring morphism on each entry of the matrix). You can also verify that this map sends invertible matrices with entries in to invertible matrices with entries in , and in fact is a group morphism . Convince yourself that this defines a functor .
Unit groups
This example is closely related to the previous. For each ring , the set of (multiplicative) units in forms a group , and since ring homomorphisms preserve units we have for each ring homomorphism an induced group homomorphism . Convince yourself again this defines a functor . We similarly have a functor .
Examples in topology
Singular homology in a given dimension assigns to each topological space an abelian group , and also to each continuous map a group morphism . If you are familiar with homology, you should convince yourself this defines a functor .
Similarly, the assignment of a homotopy group to each pointed topological space is (the object function of) a functor . Alternatively, it's possible to defined a functor on that assigns to each topological space its fundamental groupoid.
Families of objects in a category
Suppose is any category and is any set. A family of objects in indexed by is, as it sounds, a collection of the form . We can equivalently package this information in the form of a functor. Let denote the discrete category on , i.e., the category whose objects are the elements of and that only has identity arrows. A functor is then exactly the information of a set map (usually also denoted ) from the set to the set of objects of ; indeed, the arrow function of is completed fixed, since only contains identity arrows for each and we must have for all .
For example, the set of objects of is in (natural) bijection with the set of functors , while the set of pairs of objects in is in (natural) bijection with the set of functors , where is the discrete category on the set .
In general, we have a (natural) bijection
This allows us to interchangeably think of families of objects in a given category as either collections of objects in indexed by , or functors from the discrete category to .