What Is Category Theory? (And Why Should You Care?)
Imagine you’re looking at a collection of things—say, all the LEGO sets you’ve ever owned. Each set has its own pieces and instructions. Now imagine someone asks you: “What’s the same about how all these sets work?” Not the same pieces, but the same patterns of building. That’s roughly what category theory does, but for all of mathematics.
Here’s the weird thing mathematicians noticed: when you look at different areas of math—like geometry, algebra, and logic—they seem to be built from the same kinds of patterns. The way you combine two shapes in geometry looks suspiciously like the way you combine two numbers in algebra, which looks suspiciously like the way you combine two statements in logic. Category theory is the study of these patterns themselves, stripped of whatever particular stuff they’re made of.
What Actually Is a Category?
Let’s start simple. A category has two kinds of things:
- Objects (these could be anything: numbers, shapes, statements, sets)
- Arrows between objects (these represent relationships or transformations)
And there are two rules. First, every object has an arrow that goes from itself to itself—call it the “do nothing” arrow. Second, if you have an arrow from A to B and another from B to C, you can combine them to get an arrow from A to C. That’s it. That’s the whole definition.
But here’s the trick: the objects almost don’t matter. What matters are the arrows and how they connect. A mathematician named Saunders Mac Lane once said: “A category is defined by its arrows.” If you describe a category but forget to say what the objects are, someone could probably figure it out from the arrows alone.
This is already strange. Normally, when we think about math, we think about things—numbers, sets, shapes. Category theory says: no, think about the relationships between things first. The things themselves are just places where relationships start and end.
Examples That Make This Concrete
You already know lots of categories, even if you didn’t call them that.
The category of sets. Objects: all possible sets. Arrows: functions between them. A function from set A to set B just matches each element of A with an element of B. The “do nothing” arrow on any set is the function that sends each element to itself. Combining two functions means doing one after the other.
The category of groups. Objects: groups (collections of things that can be combined, like numbers under addition). Arrows: group homomorphisms—functions that preserve the group structure. If you add two numbers first and then apply the function, you get the same result as applying the function first and then adding.
Any preorder. This one is surprising. A preorder is just a way of saying some things come before others. Like: Monday ≤ Tuesday, Tuesday ≤ Wednesday, Monday ≤ Wednesday. This forms a category where the objects are the days and there’s exactly one arrow from A to B if A ≤ B. The arrow just says “A comes before or is equal to B.” The “do nothing” arrow says a day comes before itself.
Any monoid. A monoid is a set with a way of combining things (like addition) and a “do nothing” element (like zero). A monoid forms a category with just one object. The arrows are the elements of the monoid. Combining arrows is the monoid operation. This sounds weird, but it shows how flexible the definition is.
What Makes Category Theory Powerful?
If category theory only gave us a new way to describe things we already knew, it wouldn’t be very interesting. What makes it powerful is a trio of ideas: functors, natural transformations, and adjoints.
Functors: Bridges Between Categories
A functor is a way of translating one category into another. It sends objects to objects and arrows to arrows, and it preserves the structure—if you combine two arrows first and then translate, you get the same result as translating each arrow and then combining them.
Here’s an example. There’s a functor from the category of groups to the category of sets called the “forgetful functor.” It takes a group and just forgets that it’s a group—it remembers the underlying set of elements, and it remembers the function between sets, but it forgets that those functions were group homomorphisms. This seems trivial, but it turns out to be deeply important.
There’s also a functor going the other way: the “free group” functor. Given any set, it builds the most general group you can make from those elements—the “free” group, with no extra relationships. You just take the elements as generators and add nothing but what the group axioms require.
Natural Transformations: Bridges Between Bridges
If you have two different functors between the same two categories, you might ask: how are they related? A natural transformation is an arrow between functors. It gives you a systematic way to translate from one functor’s outputs to the other’s.
Think of it this way. Suppose you have two different ways of turning sets into groups. (The free group is one. There are others.) A natural transformation between them would be a family of group homomorphisms—one for each set—that makes everything fit together consistently. If you start with a set, apply either functor, then use the natural transformation, the result should be the same as using the natural transformation first and then doing something else.
This part gets technical, but here’s what it accomplishes: natural transformations let mathematicians talk about when two different constructions are “essentially the same” in a precise way.
Adjoints: Conceptual Inverses
Now we get to the most important idea. An adjunction is a pair of functors going in opposite directions that are “almost inverses” to each other. They’re not true inverses—if you go there and back, you don’t end up where you started. But there’s a systematic relationship between them.
The forgetful functor and the free group functor are adjoints. The forgetful functor “forgets” group structure; the free group functor “freely adds” it. They’re conceptual inverses: the free group is the best possible solution to the problem “how do I turn this set into a group without adding any extra information?”
Mathematicians were stunned to discover how many important constructions in math are adjoints. Products of numbers, logical connectives like “and” and “or,” the quantifiers “for all” and “there exists”—all of these can be described as adjoints. This suggests that adjoints are one of the fundamental patterns that mathematics is built from.
But What Does This Mean for Philosophy?
Category theory raises deep questions about what mathematics is and how it works.
Objects are defined by their relationships. In category theory, an object is whatever it is because of how it connects to other objects. There’s no such thing as “the natural numbers” in isolation. There’s only “the natural numbers as they appear in this particular category”—and in a different category, they might look different. This is really weird. It means mathematical objects don’t have a fixed, independent identity. Their identity depends on context.
Sameness isn’t equality. In set theory, two things are the same if they have the same elements. In category theory, two things are the same if there’s an isomorphism between them—a pair of arrows that are inverses. This is a weaker notion of sameness. It means mathematicians can talk about things being “the same up to isomorphism” without caring about exactly what they’re made of.
Foundations might be different. Ever since Euclid, people have thought mathematics needs a foundation—a set of basic truths everything else is built from. For the last hundred years, that foundation has usually been set theory. Category theory offers an alternative: maybe the foundation isn’t sets and membership, but categories and arrows. Philosophers still argue about whether this works and what it would mean.
Where This Gets Complicated
Honestly, category theory is hard. It’s abstract in a way that takes time to get used to. Professional mathematicians sometimes struggle with it. The definitions seem simple—objects, arrows, composition, identity—but the consequences are enormous and still being explored.
One of the hardest parts is that category theory keeps going. There are categories of categories. There are 2-categories (with arrows between arrows). There are n-categories. There’s even something called “higher-dimensional category theory” that connects to quantum physics. Nobody really knows where this ends, or whether it ends at all.
Things to Think About
-
If objects are defined by their relationships rather than their internal structure, what does that say about identity? Are you the same person if all your relationships change but your body stays the same?
-
The forgetful functor “forgets” structure. What would it mean to have a forgetful functor for your daily life—to forget about school, or friendships, or the rules you follow? Would anything remain?
-
If mathematics could be founded on categories instead of sets, would that change what it means for something to be “true” in mathematics? Or is truth independent of the framework?
-
The free group is the “most general” group you can build from a set. What would the “most general” version of something in your life look like—a free game, a free friendship, a free school?
Where This Shows Up
- Computer science. Category theory is used to design programming languages and to prove that programs do what they’re supposed to do. The idea of “monads” in programming comes directly from category theory.
- Logic. Categorical logic uses categories to understand logical systems. It’s helped clarify connections between different kinds of logic—classical, intuitionistic, linear.
- Physics. Higher-dimensional category theory is used in quantum field theory and quantum gravity. Some physicists think categories might be the right language for describing how the universe works at the most fundamental level.
- Cognitive science. Researchers have used categorical ideas to model how humans make analogies and how neural networks learn patterns.
Key Terms
| Term | What It Does in This Debate |
|---|---|
| Category | A collection of objects and arrows between them, with rules for combining arrows |
| Arrow (morphism) | A relationship or transformation from one object to another |
| Functor | A translation between categories that preserves their structure |
| Natural transformation | A systematic way to relate two different functors |
| Adjoint | A pair of functors that are “conceptual inverses” to each other |
| Forgetful functor | A functor that throws away some structure (like forgetting that a group is a group) |
| Free group | The most general group you can build from a set, with no extra relationships |
Key People
- Saunders Mac Lane and Samuel Eilenberg – Two mathematicians who invented category theory in 1945, originally just as a tool for another problem. They didn’t expect it to become a whole field.
- F. William Lawvere – A mathematician who argued that categories could be the foundation for all of mathematics, and who showed that logical concepts like “and” and “for all” are adjoints.
- Alexander Grothendieck – A revolutionary mathematician who used categories to transform algebraic geometry and introduced the concept of a topos, which connects geometry and logic.
Appendices
Things to Think About
-
If objects are defined by their relationships rather than their internal structure, what does that say about identity? Are you the same person if all your relationships change but your body stays the same?
-
The forgetful functor “forgets” structure. What would it mean to have a forgetful functor for your daily life—to forget about school, or friendships, or the rules you follow? Would anything remain?
-
If mathematics could be founded on categories instead of sets, would that change what it means for something to be “true” in mathematics? Or is truth independent of the framework?
-
The free group is the “most general” group you can build from a set. What would the “most general” version of something in your life look like—a free game, a free friendship, a free school?
Where This Shows Up
- Computer science. Category theory is used to design programming languages and to prove that programs do what they’re supposed to do. The idea of “monads” in programming comes directly from category theory.
- Logic. Categorical logic uses categories to understand logical systems. It’s helped clarify connections between different kinds of logic—classical, intuitionistic, linear.
- Physics. Higher-dimensional category theory is used in quantum field theory and quantum gravity. Some physicists think categories might be the right language for describing how the universe works at the most fundamental level.
- Cognitive science. Researchers have used categorical ideas to model how humans make analogies and how neural networks learn patterns.