Previous: [[The free product of groups]] To understand algebraic topology, and a lot of other fields connected with algebra, one needs to appreciate category theory. Yet, it is a very dense language that can make things very hard to read for people who aren't well-versed with it. One can think of it as a high information-density code that professionals use to make their lives easier, but which is hard to understand from the outside. This gives me a little problem when writing here. To what extent should I use categorical language? When used properly, it lets one see some really interesting and beautiful connections, and algebraic topology is the place where the complex connections between algebra and topology led to this language being developed in the first place. The compromise I chose is to mention the connections when they arise, but try to keep a lot of the exposition free from categorical language. The ideal audience for this is someone who knows the basic concepts of category theory, like what a category is and what functors are, but not really much beyond that. To put things on a somewhat even footing, I will review some basic notions here. If you've never heard of any of this before, this is probably not the best place to learn, but it can serve as a refresher if you're vaguely familiar with these ideas^[I think the only way to learn category theory is to learn it again, and again, and again, and .....] In most mathematical theories, we care about certain objects, like groups, topological spaces, vector spaces, etc. We define what it means for a set to be such an object, and then we define what "structure preserving maps" between such objects are. For groups, they are homomorphisms, for topological spaces continuous maps, for vector spaces linear maps, and so on. We also define a notion of isomorphism (or homeomorphism, diffeomorphism, isometry, etc.) A category is just the notion that captures these ideas. A category $\mathcal C$ is defined as a collection^[not necessarily set, but a proper class, to avoid Russel's paradox] of objects, and between any two objects a set^[in locally small categories] of morphisms. These are our objects and structure-preserving maps. We also have a notion of composing maps; if we have a morphism from $A$ to $B$ and one from $B$ to $C$ then composing them gives us a map from $A$ to $C$. Moreover, composition of morphisms is associative. We also require an identity morphism $\operatorname{id}_A: A \to A$ exist on each object $A$ of the category, and that composing any other morphism with it leave that other morphism unchanged. This is the basic structure of a category. We can place many objects into categories, like $\mathcal S$, the category of sets and functions between them, $\mathcal G$, of groups and homomorphisms between them, $\mathcal V$, of vector spaces and linear maps, $\mathcal T$, of topological spaces and continuous maps, and so on (these symbols are not necessarily standard). Note, however, that we don't have a notion of *elements* inside an object. The only information of an object is encoded in the maps to and from that object. Even with this restriction, we can recover many of the standard notions of set theory. For instance, an injective map in set theory can be seen as a morphism $\iota$ such that whenever we have any other morphisms $f$ and $g$ such that $\iota \circ f = \iota \circ g$ then $f = g$. Such a map is called a monomorphism. The appropriate concept for surjective maps is that of an epimorphism, which is a map $r$ such that whenever $f \circ r = g \circ r, f= g$. A bijective map is captured through the idea of an isomorphism, which is a morphism $f$ for which an inverse morphism $g$ exists such that $f \circ g = \operatorname{id}$ and $g \circ f = \operatorname{id}$. In nice categories like $\mathcal S$, a morphism that is both monic and epic is iso, but this is not always the case. Even when the underlying objects of a category are sets,^[i.e. there exists a forgetful functor to $\mathcal S$, see below ] it may be that monics and epics don't conform exactly to our idea of injective and surjective maps. Another important concept is that of a subobject, which generalizes subsets and subgroups and subspaces etc. This is expressed as an object with a monomorphism into the object it is a subobject of.^[technically, an [equivalence class thereof](https://en.wikipedia.org/wiki/Subobject)] In some categories we have an even nicer way of thinking about subobjects called a [subobject classifier](https://en.wikipedia.org/wiki/Subobject_classifier), wherein a subobject is represented by a map to a distinguished object called the classifier. In $\mathcal S$ we have the two-element set which can be interpreted to be $\{\text{True, False}\}$ which lets us check membership in subsets. By such constructions we can turn ordinary definitions into "categorical" ones. There are many nice diagrams and explanations for these online, so I won't belabor the point^[and if you really want to understand category theory well, Emily Riehl's book *Category Theory in Context* is freely available online]. The other important concept from category theory is that of a functor. A functor is really just a nice "function" whose domain is a category. It maps things from one category into another. We cannot define such things as functions because the domains aren't sets, so we give them a new name. There is one important condition that functors have to follow. They have to play nicely with the composition of morphisms. That is, if $F: \mathcal C \to \mathcal D$ is a functor, then for any $A$ and $B$ in $\mathcal C$ and any morphism $g$ from $A$ to $B$, there must exist a morphism $F(g)$ from $F(A)$ to $F(B)$. Moreover, this mapping of morphisms respects composition. If $f \circ g = h$ in $\mathcal C$ then $F(f) \circ F(g) = F(h)$ in $\mathcal D$. This "functoriality" of $F$ plays an important role in algebraic topology, where we often associate groups to topological spaces via functors. By functoriality, this means that continuous maps between spaces get turned into homomorphisms between the respective groups. In theories that use many different categories, associations that are not functors are not nearly as well behaved as functors. Two functors $F$ and $G$ are said to be "naturally isomorphic" if their outputs for the same input are isomorphic, *and* the way they map morphisms to morphisms is also "the same." Formally, if $F$ and $G$ are naturally isomorphic functors from $\mathcal C$ to $\mathcal D$ then for any object $A$ in $\mathcal C$ there needs to be an isomorphism $\eta_A$ from $F(A)$ to $G(A)$ that plays nicely with morphisms $f$ in $\mathcal C$ via the following commutative diagram: <iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsNCxbMCwwLCJGKEEpIixbMCwwLDEwMCwxXV0sWzEsMCwiRihCKSIsWzAsMCwxMDAsMV1dLFswLDEsIkcoQSkiLFswLDAsMTAwLDFdXSxbMSwxLCJHKEIpIixbMCwwLDEwMCwxXV0sWzAsMSwiRihmKSIsMCx7ImNvbG91ciI6WzAsMCwxMDBdfSxbMCwwLDEwMCwxXV0sWzAsMiwiXFxldGFfQSIsMCx7ImNvbG91ciI6WzAsMCwxMDBdfSxbMCwwLDEwMCwxXV0sWzEsMywiXFxldGFfQiIsMCx7ImNvbG91ciI6WzAsMCwxMDBdfSxbMCwwLDEwMCwxXV0sWzIsMywiRyhmKSIsMCx7ImNvbG91ciI6WzAsMCwxMDBdfSxbMCwwLDEwMCwxXV1d&embed" width="324" height="304" style="border-radius: 8px; border: none;"></iframe> If the maps $\eta_A$ are not isomorphisms, merely morphisms, then we say that there is a "natural transformation" between $F$ and $G$. This concept of natural isomorphism gives us a way to express many ideas, such as the fact that any vector space is only incidentally isomorphic to its dual but canonically isomorphic to its double dual. It also allows us to say when two categories are "the same:" exactly when there are functors going both ways whose compositions are naturally isomorphic to the identity endofunctor on either category^[If we make this condition more strict and only think about "isomorphic" categories whose functors compose to the identity, instead of just being naturally isomorphic to it, we get a very weak theory. Somehow the concept of natural isomorphism is the "right" way to think about things being "the same" in category theory]. This formalism allows ~~crazy~~ smart people to talk about things like the category of categories with functors being morphisms and natural transformations being morphisms of morphisms, but we won't go that abstract just yet. Next: [[A pretty bad introduction to limits]]