As Eilenberg-Mac Lane first observed, ‘category’ has been defined in order to be able to define ‘functor’ and ‘functor’ has been defined in order to be able to define ‘natural transformation’.
Look back over this book and you will find two kinds of characters. There were things — sets, groups, vector spaces, spaces, simplicial complexes, chain complexes — and there were arrows between things — functions, homomorphisms, linear maps, continuous maps, simplicial maps, chain maps. The things got the chapter titles, but the arrows did the real work. Brouwer’s fixed-point theorem was not proved by staring at a disk; it was proved by asking what a map with no fixed point would force homology to do (§3.5 Maps, Invariance, and First Triumphs). This chapter is about what all those arrows have in common.
The common pattern has a name: a category. A map that turns one kind of thing-and-arrow world into another, the way homology turns spaces into groups, is a functor. And a way of comparing two functors that involves no arbitrary choices is a natural transformation. These three ideas were invented in the 1940s by a topologist and an algebraist, Samuel Eilenberg and Saunders Mac Lane, to straighten out a puzzle about homology (Eilenberg & Mac Lane 1945). So you are not starting a new subject so much as learning the names of things you have been doing since Part I.
You have been doing category theory all along
Here is a game. For each line below, the left column names some objects and the middle column names the arrows between them. Read down the right column: it is always the same three facts.
| Objects | Arrows | What we always used |
|---|---|---|
| sets (§1.1 Sets and Functions) | functions | follow one arrow by another; every object has a do-nothing arrow; brackets don’t matter |
| groups, abelian groups | homomorphisms | |
| vector spaces | linear maps (matrices) | |
| topological spaces | continuous maps | |
| simplicial complexes | simplicial maps | |
| chain complexes | chain maps |
In every case you can compose: if goes from to and goes from to then “first then is an arrow from to (read “ after as in §1.1 Sets and Functions). A composite of homomorphisms is a homomorphism; a composite of continuous maps is continuous; a product of matrices is a matrix. In every case there is an identity, the arrow that does nothing. And in every case composition is associative: following then then gives the same result however you group the steps.
Those three facts sound too obvious to be worth stating. But think about how much of this book rested on them. When we proved in §3.5 Maps, Invariance, and First Triumphs that a continuous map induces a homomorphism on homology, the two facts that made it useful were
Those equations say: homology respects composition and identities. They are statements about arrows, not about holes. Category theory is what you get when you take statements like these seriously and study them for their own sake. Its subtitle in this book — “the mathematics of mathematics” — is a little grand, but not wrong: it is a language for the patterns that different parts of mathematics share.
“…mathematics is the art of giving the same name to different things. … When language has been well chosen, one is astonished to find that all demonstrations made for a known object apply immediately to many new objects: nothing requires to be changed, not even the terms, since the names have become the same.” — Henri Poincaré, Science and Method, in Francis Maitland’s translation (Poincaré 1914, p. 34)
Category theory takes Poincaré’s remark literally. A bijection of sets, an isomorphism of groups, a homeomorphism of spaces and a homotopy equivalence will all turn out to be “the same thing”: an isomorphism in the appropriate category. Quotients, direct sums, kernels and products will turn out to be instances of one idea, the universal property. Seeing the shared shape does not do the hard work for you — computing still needed geometry — but it tells you which work needs doing and which comes for free.
Categories: dots and arrows
Here is the pattern written out in full. It looks long, but every clause is one of the table’s three facts, or the bookkeeping needed to state them. Read it once, then play with the figure after it.
Notice what the definition does not say. It never says that objects have elements, or that arrows are functions. An arrow is anything with a source and a target that can be composed, and that freedom lets some unexpected things qualify, as the figure and the examples below show.
A gallery of categories
Here are the categories this book has quietly been living in. For each, ask: what are the objects, what are the arrows, how do arrows compose, and what are the identities?
- : objects are sets, arrows are functions, composition is composition of functions, identities are the identity functions
- and : objects are groups (respectively abelian groups, §1.3 Groups), arrows are homomorphisms. That a composite of homomorphisms is again a homomorphism is a small calculation (Exercise 2).
- : real vector spaces and linear maps (§1.5 Linear Algebra). There is one such category for each field of scalars; the book used and
- : topological spaces and continuous maps (§2.1 Spaces and Continuity).
- , the homotopy category: the same objects as but an arrow is a homotopy class of continuous maps (§2.3 Homotopy). We compose classes by composing representatives, This is well defined — the answer does not depend on which representatives you pick — because if and then Once again a quotient (“declare homotopic maps equal”) produces a new world in which to work.
- : chain complexes of abelian groups and chain maps (§3.2 Chains and the Boundary Operator, §3.5 Maps, Invariance, and First Triumphs). The next chapter starts here.
Those are all “sets with structure, and functions that respect it”. Now three categories of a different flavour.
Commutative diagrams, and one word for sameness
Reading a diagram
Mathematicians draw categories the way you would draw a map of roads: dots for objects, arrows for arrows. Such a picture is a diagram. A diagram commutes if any two routes along arrows with the same starting point and the same end point give the same composite. For a square
commuting means one single equation: “Across, then down” equals “down, then across”. For a triangle it means that the long side is the composite of the two short ones. This is the same idea that commutative diagrams had when they first appeared in §1.1 Sets and Functions; now we will use them constantly.
Why draw pictures instead of writing equations? Because in a large diagram there are many routes, and “the diagram commutes” packs all their equations into one glance. You have already met several commutative squares in disguise. The definition of a chain map between chain complexes (§3.5 Maps, Invariance, and First Triumphs) is the statement that every square
A diagram chase is an argument that follows a single element around a diagram: start with push it across, push it down, compare with the other route. Proving that chain maps send cycles to cycles is a two-step chase: if then In §5.2 Homological Algebra you will watch a longer chase, the snake lemma, animated step by step.
Isomorphism: one word for every kind of sameness
Throughout the book we needed different words for “the same”: bijection, group isomorphism, linear isomorphism, homeomorphism, homotopy equivalence. In category language they are all one word.
The inverse is unique: if and both work, then That little proof used nothing but the axioms, so it holds in every category at once: it proves that inverse functions, inverse matrices and inverse homeomorphisms are unique, and that a homotopy inverse is unique up to homotopy, all in one line. This is Poincaré’s promise kept — the demonstration made for a known object applies immediately to the new ones. Now read the definition in each of our categories:
| Category | An isomorphism is… |
|---|---|
| a bijection | |
| a group isomorphism (§1.3 Groups) | |
| an invertible linear map (an invertible matrix) | |
| a homeomorphism (§2.1 Spaces and Continuity) | |
| a homotopy equivalence (§2.3 Homotopy) | |
| a poset | only the identity arrows (by antisymmetry) |
| a group, as a one-object category | every arrow |
The line for is worth pausing on. A homotopy equivalence was defined in §2.3 Homotopy as a map with a map such that and In the homotopy category, where homotopic maps are equal arrows, that is literally the definition of an isomorphism. The “weaker” notion of sameness is the ordinary notion in a different category.
Functors: maps between categories
You have already met the most important example. Homology takes a space and returns a group; it takes a map of spaces and returns a homomorphism; and it sends a composite of maps to the composite of the homomorphisms. It translates one world of objects and arrows into another, and the arrows go on talking to each other in the same way. Such a translation is a functor.
In words: a functor sends dots to dots and arrows to arrows, and it sends every commutative diagram to a commutative diagram. (Check this: if apply to both sides and use the first rule.) That last sentence is the whole reason functors are useful, as we will see shortly. Tom Leinster describes the strategy of algebraic topology in exactly these terms:
“…the strategy is to learn about a space by extracting data from it in some clever way, assembling that data into an algebraic structure, then studying the algebraic structure instead of the original space.” — Tom Leinster, Basic Category Theory (Leinster 2014, Examples 1.2.5)
Here are functors you already know, some of them old friends wearing a new badge.
- Homology, A space goes to the group a map goes to The two functor laws are the equations from §3.5 Maps, Invariance, and First Triumphs quoted above. Because homotopic maps induce the same homomorphism, is even a functor (Hatcher 2002, §2.3).
- Forgetful functors, such as which sends a group to its underlying set and a homomorphism to the same function, forgetting that there was an operation. Likewise They sound trivial, and they are; but they let us say precisely “this is the same map, viewed with less structure”.
- The free functor A set goes to the free abelian group of formal sums (§1.4 Abelian Groups and Formal Sums); a function goes to the homomorphism that applies it to each symbol and keeps the coefficients. The chain group is
- Path components, A space goes to the set of its path components; a continuous map sends paths to paths, so it sends each component into a component.
- The fundamental group, (§2.3 Homotopy). Here is the category of based spaces: spaces with a chosen point, and continuous maps that send chosen point to chosen point. The basepoint is needed because a loop has to start somewhere.
- Composites of functors. Simplicial homology was built in two stages: first the chain complex then its homology. Each stage is a functor — from simplicial complexes to and from to — and is their composite. Functors compose like arrows, so categories and functors themselves form a category (as long as we stick to small categories, whose objects form a set).
The next figure shows one functor at work on a small diagram. On top are three spaces and two continuous maps. The map wraps the circle times around one direction of the torus and times around the other: if we think of points of the circle as complex numbers of size 1, and points of the torus as pairs of them, The map sends to it multiplies angles by and and adds them. On the bottom is what makes of all this.
The loop goes 1 time around one way and 1 around the other; the composite winds 3 times around the last circle.
When arrows turn around
One of the book’s four recurring ideas is the reversal of arrows. Preimages ran backwards along functions (§1.1 Sets and Functions); the transpose of a matrix ran backwards along a linear map (§1.5 Linear Algebra); differential forms were pulled back along smooth maps (§4.3 Differential Forms); and cochains, the measurements of cohomology, travelled backwards along continuous maps (§4.2 Cohomology Groups). Category theory has a home for all of these.
Here is the reversed-arrow thread of the book, now seen as a list of contravariant functors.
- Preimage. Send a set to the set of its subsets, and a function to Then to find what lands in after doing then first pull back along then along
- Duals and transposes. Send a vector space to its dual the space of linear “measurements” and a linear map to to measure a vector of push it to and measure there. In matrices, is the transpose, and the rule is the old identity
- Measuring with values in a group. More generally, for a fixed abelian group sending is a contravariant functor Cochains are exactly this applied to chains:
- Cohomology, A map induces going backwards, with This is what we meant, back in §4.2 Cohomology Groups, by calling cohomology contravariant.
Arrows turned around, matrices transposed, and the order of composition reversed — yet the composite still matches.
Why should anyone care which way the arrows point? Two answers from earlier chapters. First, contravariance is what made the cup product possible (§4.5 The Cup Product). Two measurements on combine into one measurement on every space has the diagonal map and a contravariant functor carries backwards, turning that measurement on into a product measurement on Homology, which can only push forward along from into gets no product this way. Second, measurements can be restricted to smaller pieces of a space, which is what made sheaves work (§4.7 Sheaves and Čech Cohomology). Direction is not bookkeeping; it is structure.
Functoriality proves theorems
We can now state, in one line, why functors are so effective at proving that things are impossible or different.
Read the contrapositive (§0.2 How to Read Mathematics): if then . That is the logic of every invariant in this book. The circle and the point are not homotopy equivalent, because sends them to and The torus and the sphere are not homeomorphic, because gives and One small proposition, used a hundred times.
Functors do more than tell objects apart. They also show that certain arrows cannot exist, because a functor would carry an impossible diagram of spaces to an impossible diagram of groups. Start with a warm-up in one dimension.
Now the real thing. A retraction of the disk onto its rim would be a continuous map that keeps every point of the rim where it is. The figure walks through the argument that none exists. Read the top half as geometry and the bottom half as algebra; the functor is the bridge.
The inclusion i puts the circle into the disk as its rim.
From here, Brouwer’s fixed-point theorem is the short geometric step you saw in §3.5 Maps, Invariance, and First Triumphs: if a map had no fixed point, then for each the ray from through would hit the rim at a point and would be a retraction. In every dimension the same diagram works with since and for (Hatcher 2002, Cor. 2.15). Brouwer himself proved the theorem around 1911, with the degree of a map, a generation before anyone spoke of functors (Brouwer 1911).
Natural transformations: no arbitrary choices
Some maps feel more honest than others, and this book has used both kinds. The Hurewicz map of §3.5 Maps, Invariance, and First Triumphs sends a loop to the same loop, read as a cycle: nobody has to choose anything. The Universal Coefficient Theorem of §4.2 Cohomology Groups splits into two pieces, but to write the splitting down you must make choices, and different choices give different isomorphisms. For decades mathematicians called the first kind of map “natural” or “canonical”, as a matter of taste. Eilenberg and Mac Lane turned the taste into a definition — while making sense of the Universal Coefficient Theorem, as the History box below tells. The cleanest place to watch the definition at work is linear algebra.
Two isomorphisms, one natural
Let be a finite-dimensional real vector space. Its dual is the space of linear measurements and it has the same dimension as (§1.5 Linear Algebra). Two vector spaces of the same dimension are isomorphic, so But try to write down an isomorphism. The usual recipe is: choose a basis of let be the dual basis ( measures the -th coordinate), and send Call this map It works — but it depends on the basis you chose. Choose a different basis and you get a different map.
Now take one more step and consider the double dual its elements are measurements of measurements, machines that eat a and return a number. Here there is an isomorphism you can write down with no choices at all. A vector gives the machine “evaluate at
It is linear, and for finite-dimensional it is an isomorphism (it is injective, and both sides have the same dimension). No basis was mentioned (Leinster 2014, Example 1.3.14). How do we turn the feeling “ involves no choices but does” into mathematics?
The answer is to ask how each map behaves when we change perspective — when we move by a linear map If a construction involves no arbitrary choices, it cannot tell the difference between doing it before or after the move. For that is the claim that the square
commutes for every linear map Here is the double-dual map, Check it on a vector going across then down gives which eats and returns Going down then across gives which eats and returns The same. That calculation is the entire proof.
The double arrow is a reminder that is an arrow between functors, one level up from arrows between objects. Evaluation is a natural isomorphism from the identity functor of finite-dimensional vector spaces to the double-dual functor (which is covariant: two reversals cancel).
What about Here the double-dual trick is not available: is contravariant, so there is not even a square of the right shape for a general We can still test against changes of perspective that can be undone. If is invertible, then points the right way, and a choice-free would make the square with on the left and on the right commute. The figure lets you test that.
So and are isomorphic, but not naturally isomorphic, while and are naturally isomorphic. The precise statement is this: there is no way to choose isomorphisms one for every finite-dimensional space, that all commute with all invertible linear maps. (Already for and = doubling, the square forces so Mac Lane, describing a similar double-dual map for abelian groups, put it in words: naturality “is just a precise expression for the elementary observation that the definition … depends on no artificial choices of bases, generators, or the like” (Mac Lane 1971, §I.4).
Naturality in the wild
Two maps you have used in this book are natural transformations, and their naturality was doing work behind the scenes.
- The Hurewicz map. For a space with basepoint the map sends the class of a loop to the class of the loop viewed as a 1-cycle (§3.5 Maps, Invariance, and First Triumphs). For any based map map a loop and then view it as a cycle, or view it as a cycle and then map it — the same. So is a natural transformation between the functors and (both regarded as functors from based spaces to groups). This is why the Hurewicz isomorphism for path-connected is compatible with every map you apply (Hatcher 2002, Thm 2A.1).
- The connecting homomorphism. In the long exact sequence of a pair (§3.6 Exact Sequences and Mayer–Vietoris), the connecting map is natural: a map of pairs gives a commuting square So a map of pairs induces a whole ladder of commuting squares between two long exact sequences. Comparing such ladders is how many computations in §3.6 Exact Sequences and Mayer–Vietoris really work.
Now the Universal Coefficient Theorem from the start of this section can be stated precisely. It says the isomorphism exists, but the splitting into two pieces cannot be chosen naturally. For the homology version of the theorem, the next chapter exhibits a single map of spaces that no natural splitting could survive.
Universal properties: the best solution to a problem
So far we have described objects by what they are made of: a product of sets is a set of pairs, a quotient group is a set of cosets. But look at how this book used them. To get a map out of we defined it on cycles and checked that it killed boundaries. To define the boundary operator on chains, we said what it did to each simplex and let linearity do the rest. In those arguments we never once looked inside a coset. What mattered was how the object relates to every other object. Category theory turns that into a way of defining things: “among all solutions to a certain problem, this one is the best, in the sense that every other solution factors through it in exactly one way.” Such a description is called a universal property.
Products
Start with sets and The Cartesian product (§1.1 Sets and Functions) comes with two projections, and Now suppose some other set has a function to each factor, and Then there is a function that “remembers both”, namely usually written It makes both triangles in the diagram commute,
and it is the only function that does: if satisfies and then the two coordinates of are forced to be and Turn this observation into a definition that never mentions elements:
Read it as a problem and its best solution. The problem: “an object with an arrow to and an arrow to Every with such a pair of arrows is a solution. The product is the solution through which all others pass, uniquely. Now look at products in our categories:
- In the Cartesian product, as we just saw.
- In the direct sum of §1.4 Abelian Groups and Formal Sums, with the two coordinate projections.
- In the product space with the product topology (§2.1 Spaces and Continuity). In fact the product topology is designed to make this work: it is the coarsest topology for which both projections are continuous.
- In a poset: a product of and is an element such that every with and satisfies — the greatest lower bound. For the real numbers under it is for positive integers under divisibility it is the greatest common divisor.
This is why we may say “the product”: any two are isomorphic in one, and only one, compatible way. The same argument works for every universal property below. (Products, kernels and their reversed-arrow twins are all special cases of limits and colimits, the subject of Chapter 5 of Leinster’s book (Leinster 2014, ch. 5).)
Coproducts: the same, with arrows reversed
Turn every arrow around and you get the dual notion. A coproduct of and is an object with arrows and such that any pair factors as for exactly one In and the coproduct is the disjoint union a map out of a disjoint union is the same as a map out of each piece. In a poset it is the least upper bound (the lcm for divisibility). And in it is — again — the direct sum with the inclusions and a homomorphism out of is a pair of homomorphisms, added together, That one object is both the product and the coproduct is a special feature of abelian groups; it will reappear in the last section.
Kernels, cokernels, quotients and free groups
Four constructions you have used since Part I are universal.
- Kernel. For a homomorphism of abelian groups, the inclusion satisfies and it is the best such map: every with lands inside so it factors as for exactly one (The third tab of Figure 5.1.7 shows this for a linear map
- Cokernel. Reverse the arrows. The cokernel of is the quotient with the projection It satisfies and every with factors as for exactly one The cokernel is the dual twin of the kernel — “what is not reached”, where the kernel was “what is crushed”.
- Quotients. A special case you used constantly: a homomorphism out of a quotient group is the same thing as a homomorphism out of that sends to zero (§1.4 Abelian Groups and Formal Sums). Homology is a quotient, and this universal property is exactly why a chain map induces a well-defined map on homology: it sends cycles to cycles and boundaries to boundaries, so it kills what needs killing.
- Free abelian groups. A homomorphism out of is the same thing as an arbitrary function out of you may send the generators anywhere, and linearity does the rest, uniquely. That is why the boundary operator could be defined just by saying what it does to each simplex.
Equivalences, and where homological algebra lives
When are two categories “the same”?
Categories and functors form a world of their own, so we can ask our usual question one level up: when are two categories the same? An isomorphism of categories — functors and with and exactly the identity functors — is far too strict: as the example below shows, it would separate two categories that everyone who has used a matrix regards as the same. The right notion lets the round trips be the identity only up to natural isomorphism.
The motivating example is linear algebra itself. Compare the category of finite-dimensional real vector spaces with the matrix category from the gallery (objects arrows matrices). Send to and a matrix to the linear map it defines: every linear map between and comes from exactly one matrix, and every finite-dimensional space is isomorphic to some Choosing a basis for every space gives a functor back, and the round trips are naturally isomorphic to the identities. So the two categories are equivalent, even though one has a single object for each dimension and the other has vast numbers of different-looking spaces of each dimension. This is the precise sense in which “doing linear algebra with matrices” loses nothing. In Mac Lane’s words, equivalence “allows us to compare categories which are ‘alike’ but of very different ‘sizes’” (Mac Lane 1971, §I.4).
Additive and abelian categories
Look again at the abelian-group world It has features that and even lack:
- You can add arrows. Two homomorphisms have a sum, and composition distributes over this addition. Each hom-set is itself an abelian group. (In this fails: the pointwise product of two homomorphisms of a non-abelian group need not be a homomorphism.)
- There is a zero object, the trivial group with exactly one arrow to and from every object; composing through it gives the zero maps.
- Products and coproducts agree: is both, as we saw.
- Every arrow has a kernel and a cokernel, and the first isomorphism theorem holds: the natural map from to is an isomorphism (§1.4 Abelian Groups and Formal Sums).
A category with the first three features (stated with care) is called additive; one with all four is called abelian. Abelian categories are the natural home of the words “exact sequence”, “kernel”, “image” and “homology”: in any of them, every theorem of the next chapter — the snake lemma, long exact sequences, derived functors — is proved once and for all. Examples include abelian groups, vector spaces, modules over a ring, chain complexes, and sheaves of abelian groups on a space (§4.7 Sheaves and Čech Cohomology). It was the last example that drove the definition. David Buchsbaum had axiomatised “exact categories” in his 1955 thesis; Alexander Grothendieck’s 1957 paper “Sur quelques points d’algèbre homologique”, known as the Tôhoku paper, fixed the name abelian category and its axioms, together with a hierarchy of optional extra ones, so that sheaf cohomology could be built with the same tools as the cohomology of spaces (Grothendieck 1957; Weibel 1999).
We end where Mac Lane’s epigraph began. Categories were defined so that functors could be defined, and functors so that natural transformations could be defined. Go back to the box at the top of this chapter: each of its loose sentences now has a precise meaning, and one of them, applied to a diagram that cannot exist, gave the no-retraction theorem, and with it Brouwer’s, in a few lines. The next chapter moves into one abelian category, chain complexes, and finds that the tools you built by hand for spaces — exact sequences, connecting maps, the Universal Coefficient Theorem — are really facts about chain complexes, whether or not a space is in sight.
Exercises
Summary
Further reading
- The gentlest rigorous introduction (Cambridge University Press, 2014; free on the arXiv), written for readers with an undergraduate’s algebra and no more. Chapter 1 covers categories, functors, natural transformations and equivalence; Chapter 5 turns this chapter’s universal properties into the general theory of limits.
- The next step up (Dover, 2016; free from the author): examples from all over mathematics, algebraic topology included, and many exercises. Chapters 1–3 take functors, the Yoneda lemma and limits much further than this chapter.
- Short blackboard videos, each ten minutes or so, on natural transformations, adjunctions, monads and more. Good for seeing the diagrams drawn and chased by hand.
- Category theory through applications — databases, circuits, resource theories. Shows that dots-and-arrows thinking is not only for topologists.
- What is Category Theory Anyway? and What is a Natural Transformation? — Tai-Danae Bradley (Math3ma) freeTwo short, warm blog posts with pictures; the companion post on natural transformations is at math3ma.com/blog/what-is-a-natural-transformation.
- A friendly tour of where categories show up outside pure mathematics, aimed at newcomers.
- History and philosophy: where categories came from, and why some people think they belong at the foundations of mathematics.
- Categories for the Working Mathematician — Saunders Mac LaneThe classic (Springer, 1971; 2nd ed. 1998), by one of the subject’s two founders. Terse and aimed at graduate students, but Chapter I is readable after this chapter, and it is the source of the epigraph.
- The Joy of Abstraction — Eugenia ChengA book-length invitation to category theory for readers without a mathematics degree (Cambridge University Press, 2022).
- A forty-page history with exact dates and references (in I. M. James, ed., History of Topology, 1999). Pages 9–10 tell how Eilenberg and Mac Lane invented functors and natural isomorphisms in 1942 while making sense of the universal coefficient theorem.