# Catsters guide

## Introduction

In an attempt to solidify and extend my knowledge of category theory, I have been working my way through the excellent series of category theory lectures posted on Youtube by Eugenia Cheng and Simon Willerton, aka the Catsters.

Edsko de Vries used to have a listing of the videos, but it is no longer available. After wresting a copy from a Google cache, I began working my way through the videos, but soon discovered that Edsko’s list was organized by subject, not topologically sorted. So I started making my own list, and have put it up here in the hopes that it may be useful to others. Suggestions, corrections, improvements, etc. are of course welcome!

As far as possible I have tried to arrange the order so that each video only depends on concepts from earlier ones. Along with each video you can also find my cryptic notes; I make no guarantee that they will be useful to anyone (even me!), but hopefully they will at least give you an idea of what is in each video. (For some of the earlier videos I didn’t take notes, so I have just copied the description from YouTube.)

I have a goal to watch two videos per week (at which rate it will take me about nine months to watch all of them); I will keep this list updated with new video links and notes as I go.

## Terminal and Initial objects

### Terminal and initial objects 1

• Definition and examples of terminal objects
• Sketch of proof that terminal objects are unique up to unique isomorphism

### Terminal and initial objects 2

• Proof that terminal objects are unique
• Examples of categories without terminal objects

### Terminal and initial objects 3

• Definition and examples of initial objects

## Products and Coproducts

### Products and coproducts 1

• Definition of products
• Example: cartesian product of sets
• $B \times A$ and $A \times B$ as two (isomorphic) products
• Uniqueness up to unique isomorphism

### Products and coproducts 2

• More on uniqueness up to unique isomorphism
• Examples and non-examples of products

### Products and coproducts 3

• Definition and example of coproduct

### Products and coproducts 4

• Definition of the morphisms $(f,g)$ and $f \times g$
• The diagonal
• Products with the terminal object

## Pullbacks and Pushouts

### Pullbacks and pushouts 1

• Definition of pullback
• Example: pullbacks in $\mathbf{Set}$

### Pullbacks and pushouts 2

• Definition of pushouts
• Example: pushouts in $\mathbf{Set}$
• Pullback/pushout example of intersection/union of sets

## Natural transformations

### Natural transformations 1

• Definition of natural transformations.
• Naturality squares.
• Intuition about natural transformations based on homotopy.
• Alternative definition of natural transformation analogous to usual homotopy definition: a natural transformation is a functor $C \times I \to D$ where $I$ is the “categorical interval”, i.e. the two-object category with a single nontrivial morphism.

### Natural transformations 2

• Vertical composition of natural transformations.
• Functor categories.
• Horizontal composition of natural transformations
• Note there are two ways to define horizontal composition, and they are equal by naturality.

### Natural transformations 3

• Whiskering (though they don’t call it that yet).
• Horizontal composition as vertical composition of two whiskerings (in two different ways, which are equal by naturality).
• Interchange law: proof by commutativity of whiskering.

### Natural transformations 3A

• Define terminology “whiskering”.
• Note vertical composition of “right-whiskered fish” works because of functoriality (of functor we whiskered by).
• Vertical composition of “left-whiskered fish” comes by definition of vectical composition for natural transformations.
• So in the end, interchange depends on three things: definition of vertical composition; functoriality; naturality.

## Representable functors and the Yoneda Lemma

### Representables and Yoneda 1

• Definition of representable functors (co- or contravariant): those which are naturally isomorphic to $H^A$ or $H_A$ for some $A$.
• Contravariant: $H_A : C^{\text{op}} \to \mathbf{Set}$; $H_A(X) = C(X,A)$.
• Covariant: $H^A : C \to \mathbf{Set}$; $H^A(X) = C(A,X)$.
• Is there a functor $A \to H_A$? Yes, the Yoneda embedding $Y$:
• $Y(A) = H_A$
• $Y(f) = H_f$, where $H_f : H_A \to H_B$ is postcomposition with $f$. $H_f$ is a natural transformation; its component at $X$ has type $H_f(X) : H_A(X) \to H_B(X) = C(X,A) \to C(X,B)$. Postcomposing an arrow in $C(X,A)$ with $f : A \to B$ yields an arrow in $C(X,B)$.

### Representables and Yoneda 2

• Proof that Yoneda embedding $C \to [C^{\text{op}}, \mathbf{Set}]$ sends morphisms $f$ to natural transformations $H_f$. Comes down to the fact that composition in the category is associative.

### Representables and Yoneda 3

• Look at natural transformations from $H_A$ to some other (contravariant) functor $F$. Big idea: such natural transformations $\alpha$ are entirely determined by where $\alpha_A$ sends $1_A$.
• Yoneda lemma: $F\ A \cong [C^{\text{op}}, \mathbf{Set}](H_A, F)$ (natural in $A$ and $F$). I.e. the set of objects in $F\ A$ is isomorphic to the hom-set of natural transformations between $H_A$ and $F$.

## Adjunctions (part 1)

### Adjunctions 1

• Given categories $C$ and $D$ and functors $F : C \to D$ and $G : D \to C$, we have the following situations:
• Isomorphism: $1 = GF$, $FG = 1$
• Equivalence: $1 \cong GF$, $FG \cong 1$
• Adjunction: $\eta : 1 \Rightarrow GF$, $\varepsilon : FG \Rightarrow 1$ So we can think of an adjunction as a “weaker sort of equivalence”.
• $\eta$ and $\varepsilon$ are subject to triangle identities: $F \stackrel{F\eta}{\Longrightarrow} FGF \stackrel{\varepsilon F}{\Longrightarrow} F$ is the identity, and similarly for $\eta G ; G \varepsilon$.
• These laws can be expressed as commuting diagrams of 2-cells: draw $\eta$ and $\varepsilon$ as 2-cells and paste them in two different ways.

### Adjunctions 2

• Alternate definition of adjunction $F \dashv G$: an isomorphism $D(F X, Y) \cong C(X, G Y)$ natural in $X$ and $Y$.
• What “natural in $X$ and $Y$” means here.
• Hint: sending identity morphisms across the iso gives us $\eta$ and $\varepsilon$ from the first definition. Proof deferred to Adjunctions 4.

### Adjunctions 4

• Note: Adjunctions 4, not 3, follows on to 2.
• Given: an isomorphism $D(FX,Y) \cong C(X,GY)$ which is natural in $X$ and $Y$.
• Notation: write application of the isomorphism as an overbar.
• Construct the two squares implied by naturality. Follow them each around in both directions (since they involve a natural isomorphism) to get four equations in total governing how the iso interacts.
• Define $\eta$ and $\varepsilon$ by applying the isomorphism to appropriate identity morphisms. Naturality and the triangle identities follow from the above four equations.

## Monads

### Monads 1

• Monads give us a way to talk about algebraic theories (monoids, categories, groups, etc.).
• Definition of a monad:
• Functor $T : C \to C$
• “unit” $\eta : 1 \Rightarrow T$
• “multiplication” $\mu : T^2 \Rightarrow T$
• with unit and associativity laws.
• Note what is meant by a commutative diagram of natural transformations
• Example: monad for monoids (aka the list monad)
• $C = \mathbf{Set}$
• $T = X \mapsto X^*$, maps a set $X$ to set of words in $X$ (i.e. lists)
• $\eta$ is singleton
• $\mu$ is concatenation
• Note, unit and associativity for monad is different than unit and associativity of monoids, which has already been encoded in the definition of $T$.

### Monads 2

• Proof that the list monad (“monad for monoids”) is in fact a monad
• Example: monad for small categories
• $C = \mathbf{Gph}$, category of graphs
• $T$ makes the free category on a graph (morphisms = paths in the underlying graph)
• With only one object, this reduces to the monad for monoids.
• Proof of monads laws is basically the same as for the list monad.

### Monads 3

• Algebras for monads. Monads are supposed to be like algebraic theories; algebras are models.
• An algebra for a monad $(T : C \to C, \eta, \mu)$ is an object $A \in C$ (the “underlying object”) equipped with an “action” $\theta : T\ A \to A$, satisfying the “obvious” axioms ($\theta$ must interact “sensibly” with $\eta$ and $\mu$).
• $\eta ; \theta = 1$
• $\mu ; \theta = T \theta ; \theta$
• Example: $C = \mathbf{Set}$, $T$ = list monad (“monad for monoids”)
• An algebra is a set $A$ equipped with $\theta : [A] \to A$
• First axiom says $\theta$ must simply project element out of length-one list.
• Other axiom is essentially associativity.
• That is, algebras for the list monad are monoids.
• Example for monad of categories (from last time) works the same way.

### Monads 3A

More on monoids as monad algebras of the list monad.

• Given a monad algebra $\theta : [A] \to A$, construct the monoid:
• whose underlying set is $A$
• $a \cdot b = \theta [a,b]$
• $\varepsilon = \theta []$.
• The monad algebra law for $\eta$ (a triangle) just says that $\theta$ can’t do anything interesting on one-element lists: it has to just return the single element.
• Identity and associativity laws for the monoid come from the other monad algebra law, saying how $\theta$ interacts with $\mu$ (a square), and from how the list functor is defined. We start with a way of mapping lists down to values, which bakes in the idea that it doesn’t matter how we associate the list.

### Monads 4

Monad algebras form a category (called $\mathbf{Alg}\ T$).

• Given two monad algebras $\theta : T A \to A$ and $\varphi : T B \to B$, a morphism between them consists of a morphism of underlying objects, $f : A \to B$, such that the obvious square commutes.

• Example. List monad again. $C = \mathbf{Set}, T = []$. A morphism of monoids is a function $f : A \to B$ such that $f (xy) = f(x)f(y)$. See how this equation arises from the commuting square for monad morphisms, by starting with a 2-element list in upper left and following it around.

• Given a particular mathematical theory, can it be expressed as the category of algebras for some monad? I.e. given a category $D$, is it equivalent to $\mathbf{Alg}\ T$ for some $T$? (Answer: no, not in general, e.g. category of topological spaces can’t.)

• But this is still an interesting question, more or less the question of “monadicity”. Category $D$ said to be monadic over category $C$ if $D$ can be expressed as category of algebras of monads over $C$.

## Adjunctions and monads

### Adjunctions 3

• Note: depends on monads.
• Examples of adjunctions:
• between the category of sets and the category of monoids: $\text{Free} \dashv \text{Forget}$
• similarly between category of graphs and category $\mathbf{Cat}$ of (small) categories.

In general, free functors are left adjoint to forgetful functors. (How to remember the direction: “left” has four letters, just like “free”.)

• Every adjunction $(F \dashv G : C \to D, \eta, \varepsilon)$ gives rise to a monad $(GF, \eta, \mu = G \varepsilon F)$. Check monad laws:
• Monad triangle laws are just adjunction triangle laws with extra $G$ or $F$ everywhere.
• Monad associativity law is naturalty for $\varepsilon$, or something like that.

### Adjunctions 5

“Every monad comes from an adjunction via its category of algebras.”

Last time we showed every adjunction gives rise to a monad. What about the converse?

Answer: yes. In fact, given a monad, there is an entire category of adjunctions which give rise to it, which always has initial and terminal objects: these are the constructions found by Kleisli and by Eilenberg-Moore, respectively. Intuitively, any other adjunction giving rise to the monad can be described by the morphisms between it and the Kleisli and Eilenberg-Moore constructions.

Let $(T : C \to C, \eta, \mu)$ be a monad.

• Terminal solution (Eilenberg-Moore): consider category $\mathbf{Alg}\ T$ of $T$-algebras, also written $C^T$. We construct an adjunction $F \dashv G : C \to C^T$. (Intuition: $F : C \to C^T$ “freely” constructs a $T$-algebra; $G : C^T \to C$ “forgets” the algebra structure.)

• $G : C^T \to C$ is easy to construct: $(A, \theta : T A \to A) \mapsto A$.

• What about $F : C \to C^T$? Sends $A$ to the “free” $T$-algebra on $A$, with underlying set $T A$. Then evaluation map is $\mu$. That is, $F A = (T A, \mu : T (T A) \to T A)$. Need to check that this definition of $F$ really gives a monad algebra as a result. In this case the monad algebra laws are just the monad laws for $T$!

• Now define a unit and counit. $\eta_A : A \to GFA = A \to TA$ is just the $\eta$ for the monad. $\varepsilon_\theta : FG(A,\theta) \to (A,\theta)$ is an algebra morphism from the free algebra on $A$ (i.e. $(TA, \mu)$) to $(A,\theta)$: in fact, $\theta$ itself is such a morphism, by the second algebra law.

• Prove triangle laws for $\eta$ and $\varepsilon$: exercise for the watcher/reader.

### Adjunctions 6

This time, initial solution to “does a monad give rise to any adjunctions”: Kleisli.

• The Kleisli category for a monad $T$ on category $C$, written $\mathbf{Kl}(T)$ or $C_T$
• Objects: objects of $C$.
• Morphisms: $C_T(A,B) :\equiv C(A,T B)$.
• Composition: given $f : A \to T B$ and $g : B to T C$, produce $f ; T g ; \mu : A \to T C$.
• Identity: $\eta : A \to T A$.
• Category axioms come from monad axioms. Associativity comes from associativity and naturality of $\mu$; unit laws come from unit laws for $\eta$.
• Intuition: this is the category of free algebras: $A \to T B = GFB$ is equivalent, under the adjunction, to $F A \to F B$, morphism between free algebras.

• Note, for the Eilenberg-Moore category (last time) it was complicated to define the objects and simple to define the morphisms. For Kleisli, it’s the other way around. “Conservation of complicatedness.”

### Adjunctions 7

The adjunction that comes from the Kleisli category, giving rise to the original monad $T$.

Again, let $(T : C \to C, \eta, \mu)$ be a monad. We will construct $F_T \dashv G_T : C \to C_T$, where $C_T$ is the Kleisli category defined in Adjunctions 6, with $G_T F_T = T$.

• $F_T : C \to C_T$ sends objects to “free algebras”
• Identity on objects.
• On morphisms, sends $f : A \to B$ to $\eta ; T f : A \to T B$ (equivalently $f ; \eta$).
• $G_T : C_T \to C$ sends a “free algebra” to its “underlying object”
• Sends $A$ to $T A$.
• Sends $f : A \to T B$ to $T f ; \mu : T A \to T B$.
• Unit and counit
• $\eta : A \to G_T F_T A = T A$ we can take as the $\eta$ of the monad.
• $\varepsilon : F_T G_T A = T A \to T A$ we can take to be id.
• Adjunction laws come down to monad laws (left to viewer).

Given a monad $T$ on $C$, we have a category of adjunctions $\mathbf{Adj}(T)$ giving rise to $T$ (morphisms are functors making everything commute). $C_T$ is the initial object and $C^T$ is terminal.

Question of monadicity: given an adjunction $F \dashv G$, is $D \cong C^T$? If so, say “$D$ is monadic over $C$”, i.e. everything in $D$ can be expressed as monad algebras of $C$. Or can say the adjunction is a “monadic adjunction”. Can also say that the right adjoint (forgetful functor $G$) “is monadic”. Monadic adjunctions are particularly nice/canonical.

## General Limits and Colimits

### General limits and colimits 1

Defining limits in general, informally.

• The thing we take a limit of is called a diagram (a collection of objects and morphisms). A limit of a diagram is a universal cone.
• A cone over a diagram is an object (vertex) together with morphisms (projection maps) to all objects in the diagram, such that all triangles commute.
• Universal cone is the “best” one, through which all other cones factor, i.e. there is a unique morphism from the vertex of one to the other such that all the relevant triangles commute.

### General limits and colimits 2

Examples of limits.

• Terminal objects: limit over the empty diagram.
• Products: limit over discrete diagram on two objects.
• Pullback: limit over a “cospan”, i.e. a diagram like $X \to Y \leftarrow Z$. Note that we usually ignore the edge of the cone to $Y$, since it is uniquely determined by the edges to $X$ and $Z$.
• Equalizer: limit over a parallel pair of arrows.

### General limits and colimits 3

• Note: requires natural transformations.
• Formal definitions of:
• Diagram (functor from an index category)
• Cone (natural transformation from constant functor to diagram).

### General limits and colimits 4

• Requires Yoneda.
• Formal definition of a limit: given a diagram $D : I \to C$, a limit for $D$ is an object $U$ together with a family of isomorphisms $C(V,U) \cong [I,C](\Delta_V, D)$ natural in $V$. I.e. a natural correspondence between morphisms $V \to U$ (the “factorization” from one cone to another) and morphisms (i.e. natural transformations) from $\Delta_V$ to $D$ in the functor category $[I,C]$ (i.e. cones over $D$ with vertex $V$). That is, every cone with vertex $V$ has a unique factorization morphism, and vice versa!. The “vice versa” part is the surprising bit. If we have a limit then every morphism is the factorization for some cone to the universal cone.

• If we set $V = U$ then $C(U,U) \cong \dots$ etc. In particular $1_U : C(U,U)$ corresponds to some cone, which is THE universal cone. The Yoneda lemma says (?) that the entire natural isomorphism is determined by this one piece of data (where $1_U$ goes). Note that both $C(-,U)$ and $[I,C](\Delta_-, D)$ are functors $C^{\text{op}} \to \mathbf{Set}$. The Yoneda lemma says that a natural transformation from $C(-,U) = H_U$ to $[I,C](\Delta_-, D)$ is isomorphic to $[I,C](\Delta_U, D)$ — i.e. a cone with vertex $U$, the universal cone.

• The universality of this cone apparently comes from naturality.

### General limits and colimits 5

• Requires adjunctions.
• Notation for limits. Categories that “have all limits (of a given shape)”.
• The natural isomorphism defining a limit can be seen as an adjunction $\Delta \dashv \lim_{I \leftarrow}$ where $\Delta : C \to [I,C]$, and $\lim_{I \leftarrow} : [I,C] \to C$ is the functor that takes a diagram and produces its limit.
• Claim: this is an adjunction if $C$ has all $I$-limits. Need to show that the iso is also natural in $D$, and that $\lim_{I \leftarrow}$ is actually a functor.

### General limits and colimits 6

Colimits using the same general formulation. “Just dualize everything”.

• Cocone (“cone under the diagram”) is an object with morphisms from the objects in the diagram such that everything commutes.

• Universal cocone: for any other cocone, there is a unique morphism from the universal cocone to the other cone which makes everything commute. Note it has to go that direction since the universal cocone is supposed to be a “factor” of other cocones.

• In Eugenia’s opinion the word “cocone” is stupid.

• More generally: natural isomorphism between cocones and morphisms. $C(\lim_{\to I}, V) \cong [I,C](D, \Delta_V)$. Limits in $C$ are the same as colimits in $C^{op}$, and vice versa.

• All limits are terminal objects in a category of cones (and colimits are initial objects).

• Since terminal objects are initial objects in $C^{op}$ (and vice versa), we can even say that all universal properties are initial objects (and terminal objects) somewhere.

## Slice and comma categories

### Slice and comma categories 1

Slice category. Given a category $C$, fix an object $X \in C$. Then we define the slice category $C/X$ by

• Objects are pairs $(A,p)$ where $p : A \to X$.
• Morphisms from $(A,p)$ to $(B,q)$ are morphisms $h : A \to B$ in $C$ which make the triangle commute.

Coslice category, or “slice under” category $X/C$ is the dual of $C/X$, i.e. objects are pairs $(A,p)$ where $p : X \to A$, etc.

• If $C$ has a terminal object $1$, $C/1 \cong C$. (Dually, $0/C \cong C$.)

• Products in $C/X$ are pullbacks in $C$ having $X$ as a corner. (Dually, coproucts in $X/C$ are pushouts.)

### 2 Responses to Catsters guide

1. Omar Abuzzahab says:

Hey, they started posting new videos too!

Only two videos per week? My reaction upon finding Casters was to binge watch. ;-0 It’s kind of nostalgic to see these again actually. Remember when youtube had 11 minute time limits?