
Okay, so I got a bit ahead of myself at the end of my last post. Remember that we ended off there with this diagram of objects and arrows that somehow encodes the structure of a category, and we asked the question “What if we took this diagram inside some category whose objects themselves were categories?”. The thing is, this begs another question of what the arrows should be in this “category of categories”. This question has an answer, of course, and it brings one to the notion of a functor. And after thinking about it for a while, I decided that functors were important enough and fundamental enough to the story of category theory that they deserved their own post, so here we are. We’ll get back to our little story in my next post.
Broadly speaking, when mathematicians go to define maps between instances of some type of mathematical object (like categories) that they care about, they typically want those maps to preserve the structure or “shape” of that object. For example, suppose I want to define a map f that sends the integers (…-2, -1, 0, 1, 2…) to only the even integers (…-4, -2, 0, 2, 4…). By “map”, I mean that f sends each integer to some (not necessarily unique) even integer. Let’s say that the extra structure that I care about is being able to add integers, but only adding. Then I might want my map f to have the following property: for any two integers x and y, I should be able to add them together, apply f to that sum, and have that result be the same as if I had first applied f to each of x and y, and then added those results together. In symbols, this property looks like this: f(x+y) = f(x) + f(y). The map that sends each integer x to 2x will have this property (in fact, multiplication by any even number will do the trick; try it yourself!). In general, structure-preserving maps like this are called homomorphisms, which comes from the Greek for “same shape”.
So how should we build a map F between, say, two categories C and D? Well, following the example above, we should probably start by having some assignment F_0 that sends each object of C to an object of D. Now, what structure is there to preserve in a map between categories? Well, the arrows in a category show us how all of the objects are related to each other; that’s definitely structure. But the arrows themselves also have some structure, in the form of the composition operation (being able to attach arrows head-to-tail to create new arrows) and the identity/”do-nothing” arrows, so we should preserve those too.
What does it mean to preserve an arrow? Let’s start by picking some arbitrary arrow f: x –> y in C (this just means an arrow between the objects x and y in C, which we’re naming f). Remember that we already have an assignment F_0 that sends objects of C to objects of D. In particular, this sends the objects x and y to some objects F_0(x) and F_0(y) in D, respectively. Preserving f, then, should mean that f gets sent to an arrow F(f) between F_0(x) and F_0(y).
We can think of preserving composition in much the same way that we looked at preserving addition earlier: if we start with two composable arrows f and g in C, compose them, and then apply F to the resulting arrow, this should give the same result as first applying F to f and g, and then composing these arrows. Notice that we aren’t able to do this without first having the arrow-preserving condition above. Denoting composition by a circle, we’d write this as F(g \circ f) = F(g) \circ F(f). See how similar this looks to what we ended up with in the addition example?
Preserving identity arrows just means that if we plug an identity arrow from C into our assignment F, it should get sent to an identity arrow in D. Because of the way that identity arrows behave when composed with other arrows (in particular, they have no effect at all), this requirement is actually just a consequence of the equality in the previous paragraph. In fact, requiring that equality to hold also implies that F preserves arrows, because arrow composition requires that the two arrows being composed must line up head-to-tail.
As you might have guessed, an assignment F that satisfies all of these properties is called a functor. So essentially, a functor is a map between categories that preserves the composition of arrows.
If we wanted to, we could actually go one level deeper and look at how to define maps between functors; these are so-called natural transformations, which are, in effect, arrows between arrows between categories. It was the desire to make the idea of natural transformations precise that brought Saunders Mac Lane and Samuel Eilenberg to start the field of category theory in the first place. To define natural transformations, you need functors, and to define functors, you need categories.
In fact, if we really wanted to, we could define arrows between natural transformations, and arrows between those arrows, and on and on forever. This fractal-esque process would bring us into the realm of infinity-categories, which are a whole other weird and awesome kind of category that I hope I have time to learn more about someday.
For now, though, there’s still a whole story about double categories to tell…
Image via Openclipart