Functors

...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.

...every sufficiently good analogy is yearning to become a functor.

Before functoriality, people lived in caves.

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 C and D are categories. A functor F:C→D consists of the following data:

  • For each object c∈C, an object F(c)∈D
  • For each arrow f:cβ†’cβ€² in C, an arrow F(f):F(c)β†’F(cβ€²) in D

with the following properties:

  1. (Compatibility with composition) For every pair of composable arrows f,g in C, we must have F(g∘f)=F(g)∘F(f)
  2. (Identity Preservation) For every object c∈C, one has F(1c)=1Fc
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 f:c1β†’c2 in C to an arrow F(f):F(c2)β†’F(c1) in D. 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 F(f∘g)=F(g)∘F(g).

The more modern view has reverted to simply "functors", and has incorporated the contravariant functors via the notion of opposite categories: a contravariant functor C→D is equivalent to a (covariant) functor C→Dop (and also to a covariant functor Cop→D).

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 P:Set→Set is defined as follows:


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 U:Grp→Set assigns to each group G the set U(G) of its elements ("forgetting" the multiplication and hence the group structure), and assigns to each group homomorphism f:G→G′ the same function f, 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 F:Setβ†’Grp that assigns to each set X the so-called free group F(X). This is the group whose elements are finite "words" with letters the elements x∈X (along with their formal inverses), modulo an equivalence relation that equates the words xxβˆ’1 and xβˆ’1x with the empty word (which is the identity for the group). The operation on this free group F(X) 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 G is the trivial group (with a single element), the free group on the one-element set U(G) is infinite. In other words, F(U(G))β‰ G. So what is the relation between the functors U and F? That is something we will explore in detail when we study adjoint functors.


Abelianization

Suppose G is a group. For each pair of elements x,y∈G, the element xyxβˆ’1yβˆ’1 is called the commutator [x,y] of x and y in G. Notice that this element is the identity exactly when the elements x and y commute. The subgroup generated by the set of all commutators in G is a normal subgroup of G, called the commutator subgroup and denoted [G,G]. You can verify the following facts:

  1. G/[G,G] is always an abelian group;
  2. Any group morphism G→H carries commutators to commutators, hence [G,G] to [H,H]
  3. Every group morphism G→H to an abelian group H factors uniquely through the projection G→G/[G,G]
  4. The assignment G↦G/[G,G] is the object function of a functor Grpβ†’Ab, called the abelianization functor (or sometimes factor-commutator functor).
    The abelianization functor is adjoint to the forgetful functor U:Ab→Grp.

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 G of its center Z(G). Intuitively, that is because a homomorphism G→H can carry an element in the center of G to one not in the center of H, and hence we do not have an induced morphism Z(G)→Z(H). For additional details, check out this exercise.


General linear group

For each commutative ring R, the set of all invertible n×n matrices with entries in R is called general linear group GLn(R). Moreover, for each ring morphism R→S between commutative rings there is a set map that takes each matrix with entries in R to a matrix with entries in S (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 R to invertible matrices with entries in S, and in fact is a group morphism GLn(R)→GLn(S). Convince yourself that this defines a functor GLn:CRing→Grp.


Unit groups

This example is closely related to the previous. For each ring R, the set of (multiplicative) units in R forms a group RΓ—, and since ring homomorphisms preserve units we have for each ring homomorphism Rβ†’S an induced group homomorphism RΓ—β†’SΓ—. Convince yourself again this defines a functor βˆ™Γ—:Ringβ†’Grp. We similarly have a functor βˆ™Γ—:CRingβ†’Ab.


Examples in topology

Singular homology in a given dimension n assigns to each topological space X an abelian group Hn(X), and also to each continuous map X→Y a group morphism Hn(X)→Hn(Y). If you are familiar with homology, you should convince yourself this defines a functor Hn:Top→Ab.

Similarly, the assignment of a homotopy group Ο€n(X,x) to each pointed topological space is (the object function of) a functor Ο€n:Topβˆ—β†’Grp. Alternatively, it's possible to defined a functor on Top that assigns to each topological space its fundamental groupoid.


Families of objects in a category

Suppose C is any category and S is any set. A family of objects in C indexed by S is, as it sounds, a collection of the form {cs∈C∣s∈S}. We can equivalently package this information in the form of a functor. Let S denote the discrete category on S, i.e., the category whose objects are the elements of S and that only has identity arrows. A functor F:Sβ†’C is then exactly the information of a set map (usually also denoted F) from the set S to the set of objects of C; indeed, the arrow function of F is completed fixed, since S only contains identity arrows 1s for each s∈S and we must have F(1s)=1F(s) for all s∈S.

For example, the set of objects of C is in (natural) bijection with the set of functors 1→C, while the set of pairs of objects in C is in (natural) bijection with the set of functors S→C, where S is the discrete category on the set {1,2}.

In general, we have a (natural) bijection

HomSet(S,Ob(C))≃HomCat(S,C).

This allows us to interchangeably think of families of objects in a given category C as either collections of objects in C indexed by S, or functors from the discrete category Set to C.


Suggested next notes

Natural transformations
Universal Properties I - Inspiring Examples


  1. Hence the origin for the name of this wiki! β†©οΈŽ