### Category Theory in Context

#### Posted by Emily Riehl

In my final year at Harvard and again in my first year at Johns Hopkins, I had an opportunity to teach an advanced undergraduate/beginning graduate-level topics course entitled “Category Theory in Context.” Its aim was to provide a first introduction to the basic concepts of category theory — categories, functors, natural transformations, the Yoneda lemma, limits and colimits, adjunctions, monads, and Kan extensions — while simultaneously discussing the implications of these ideas in a wide variety of areas of mathematics on which category theory sheds light.

I thought teaching this course would provide a fun opportunity to collect as many examples of this kind as I could, for which I solicited widely — more about this below. This provided the impetus to write lecture notes. And now they have been published by Dover Publications in their new Aurora: Modern Math Originals series.

I extremely grateful to Dover for granting me permission to host a free PDF copy of the book on my website. This version is in some sense even better than the published version, in that I have been able to correct a handful of typos that were discovered after the print version was already in press.

## So what’s in the book?

The preface begins by whetting the readers appetite with a list of sample corollaries of categorical theorems, for instance in a path-connected space, any choice of basepoint yields an isomorphic fundamental group. Also, every row operation on matrices with $n$ rows is defined by left multiplication by some $n \times n$ matrix, namely the matrix obtained by performing the row operation on the identity matrix.

The first chapter introduces categories, functors, and natural transformations. The advantages of knowing the *functoriality* of a given mathematical construction are illustrated by proving the Brouwer Fixed Point Theorem: that any continuous endomorphism of a disk must have a fixed point. Before proving the characterization of those functors that define an equivalence of categories, some attempt is made to describe the basic techniques involved in the “art of the diagram chase.”

The second chapter discusses universal properties, representability, and the Yoneda lemma. The motivating example is the (contravariant) functor that sends a graph to its set of vertex colorings with $n$ colors. This functor is represented by the complete graph $K_n$ on $n$ elements, graph homomorphisms $G \to K_n$ defining $n$-colorings of the vertices of $G$. The final section of this chapter proves that universal objects can be understood as objects that are either initial or terminal in an appropriate category, namely the category of elements of the functor that they represent.

The third chapter introduces limits and colimits as a special case of objects defined by a universal property. For sake of expositional diversity, I deduce the usual construction of a generic colimit as a coequalizer of a pair of maps between two coproducts as a corollary of the Yoneda lemma and the corresponding fact for limits of diagrams valued in Set (which can be proven by comparing the elements of the two limit constructions).

The fourth chapter studies adjoint functors in their many guises. Several of the motivating corollaries in the preface reappear as a special case of the fact that right adjoints preserve limits (the proof of which is displayed as a watermark on the cover of the book). A final section on the adjoint functor theorems explains how a special case of the general adjoint functor theorem can be used to construct the free group on a set and that the special adjoint functor theorem can be understood as an abstraction of the construction of the Stone-Čech compactification.

The fifth chapter presents categorical universal algebra in the guise of monads, listing several naturally-arising examples of categories of algebras and Kleisli categories: for instance, the Kleisli category for the Giry monad defines the category of measurable spaces and Markov kernels. After proving the monadicity theorem, a final section gives an explicit construction of limits and colimits in a category of algebras, with the construction of the free product of groups used to motivate the general coproduct formula.

The final chapter, whose irresistible title is borrowed from Mac Lane’s *Categories for the Working Mathematician*, studies Kan extensions both in category theory and in the wild (e.g., in the guise of induced representations) and introduces derived functors. This chapter is a reworking of the first chapter of my previous book, Categorical Homotopy Theory, with several expository improvements.

A cheeky epilogue lists theorems in category theory, as a rejoinder to those who still claim that there are none.

## Crowdsourcing

Perhaps one of the most interesting features of this book is its acknowledgements section, which lists individual contributions from over 50 people, and that is not even including the very important role played by the 20 or so attendees of the two iterations of this course. Before I began writing, I asked for help in finding examples of applications of categorical ideas, on this blog and elsewhere.

The entire genesis of these lecture notes has taken place online, with drafts of new sections posted on the course website essentially as soon as they were written. A extremely pleasant and entirely unanticipated blessing was that very early on in the writing process I started receiving unsolicited emails from generous readers who compiled lists of typos, errors, and suggestions to improve the manuscript. Their perspicuous comments inspired many changes, and I am extremely grateful for the feedback provided by these early readers, many of whom I have still not met. (Note, if you are one of these people and our paths ever cross, please come introduce yourself!)

I had always intended to submit the manuscript to Dover, at out of appreciation for their history of publishing high-quality low-cost trade paperbacks, but I was not expecting them to allow me to host a free PDF copy. But by the time I submitted the manuscript, the book had been circulating online for several months and had attracted enough notice that the Dover editorial staff was willing to take a gamble and let me keep an updated version online.

While I am being candid about the writing process, I should also acknowledge that I lost a ton of research time over last winter to the final round of editing, during several daunting and dispiriting months. But I’m pleased with how it came out, and also think its important to step back every now and then to think about how the ideas that I find personally compelling might be shared with a wider audience.

## Table of contents

For those who are curious, here is the table of contents. Should you happen to read any of this, I hope you enjoy it!

Preface

Chapter 1. Categories, Functors, Natural Transformations

- 1.1. Abstract and concrete categories
- 1.2. Duality
- 1.3. Functoriality
- 1.4. Naturality
- 1.5. Equivalence of categories
- 1.6. The art of the diagram chase
- 1.7. The 2-category of categories

Chapter 2. Universal Properties, Representability, and the Yoneda Lemma

- 2.1. Representable functors
- 2.2. The Yoneda lemma
- 2.3. Universal properties and universal elements
- 2.4. The category of elements

Chapter 3. Limits and Colimits

- 3.1. Limits and colimits as universal cones
- 3.2. Limits in the category of sets
- 3.3. Preservation, reflection, and creation of limits and colimits
- 3.4. The representable nature of limits and colimits
- 3.5. Complete and cocomplete categories
- 3.6. Functoriality of limits and colimits
- 3.7. Size matters
- 3.8. Interactions between limits and colimits

Chapter 4. Adjunctions

- 4.1. Adjoint functors
- 4.2. The unit and counit as universal arrows
- 4.3. Contravariant and multivariable adjoint functors
- 4.4. The calculus of adjunctions
- 4.5. Adjunctions, limits, and colimits
- 4.6. Existence of adjoint functors

Chapter 5. Monads and their Algebras

- 5.1. Monads from adjunctions
- 5.2. Adjunctions from monads
- 5.3. Monadic functors
- 5.4. Canonical presentations via free algebras
- 5.5. Recognizing categories of algebras
- 5.6. Limits and colimits in categories of algebras

Chapter 6. All Concepts are Kan Extensions

- 6.1. Kan extensions
- 6.2. A formula for Kan extensions
- 6.3. Pointwise Kan extensions
- 6.4. Derived functors as Kan extensions
- 6.5. All concepts

Epilogue: Theorems in Category Theory

- E.1. Theorems in basic category theory
- E.2. Coherence for symmetric monoidal categories
- E.3. The universal property of the unit interval
- E.4. A characterization of Grothendieck toposes
- E.5. Embeddings of abelian categories

## Re: Category Theory in Context

Congratulations!