Foundations of Category Theory
Understand the basic concepts of categories, the key types of morphisms, and how these morphisms relate to one another.
Summary
Read Summary
Flashcards
Save Flashcards
Quiz
Take Quiz
Quick Practice
What two classes of entities constitute a category?
1 of 16
Summary
Introduction to Category Theory
Why Category Theory?
Category theory emerged in the mid-20th century as a way to find common patterns across different mathematical disciplines. Mathematicians noticed that certain constructions—like quotients, products, and duality—appeared again and again in algebraic topology, algebra, geometry, and other fields. Rather than proving the same results over and over in different contexts, category theory provides a unifying framework that captures these patterns in abstract form.
The core insight of category theory is remarkably simple: instead of studying individual mathematical objects in isolation, we study the relationships between objects and the structure-preserving maps that connect them. This shift in perspective has proven extraordinarily powerful, and today category theory provides the foundational language for much of modern mathematics and computer science, including functional programming, type theory, and algebraic geometry.
What Is a Category?
At its heart, a category is a very simple structure consisting of two main ingredients:
A class of objects (these are abstract entities—we don't assume they have any internal structure)
A class of morphisms (also called arrows or maps) that go between objects
Think of a category as a collection of objects with all the allowed ways to move from one object to another. The key requirement is that these morphisms satisfy certain composition rules, which we'll discuss shortly.
Hom-Classes
For any two objects $a$ and $b$ in a category, the collection of all morphisms from $a$ to $b$ is called the hom-class, denoted $\operatorname{Hom}(a,b)$. (The term "hom" comes from "homomorphism.") If we write a morphism as $f\colon a \to b$, this means $f$ is an element of $\operatorname{Hom}(a,b)$—that is, $f$ "goes from" $a$ "to" $b$.
The crucial point is that objects themselves have no required internal structure. An object is just whatever it is; we only care about the morphisms that connect it to other objects.
Morphisms: The Real Focus
While we call the constituents of a category "objects and morphisms," the emphasis in category theory is really on the morphisms. Objects are important mainly because morphisms go between them, but the real mathematical content lives in the morphisms.
Morphisms can take many forms depending on the category. In the category of sets, morphisms are ordinary functions. In other categories, morphisms might be group homomorphisms, continuous functions, differentiable maps, or even abstract algebraic structures themselves. The remarkable thing is that we can study all these situations using the same categorical framework.
To make this concrete: in the category Set, the objects are all sets and the morphisms are all functions between sets. But we could also create a category where the single object is a monoid, and the morphisms are the elements of that monoid (composed by the monoid operation). The abstract definition of a category encompasses both situations.
Composition: Putting Morphisms Together
The key structure in a category is the ability to compose morphisms. If we have a morphism $f\colon a \to b$ and another morphism $g\colon b \to c$ (notice that the target of $f$ matches the source of $g$), then we can compose them to get a new morphism $g \circ f \colon a \to c$.
This composition operation must satisfy two fundamental properties:
Associativity: If we have three composable morphisms $f\colon a \to b$, $g\colon b \to c$, and $h\colon c \to d$, then: $$ (h \circ g) \circ f = h \circ (g \circ f) $$
This means we can compose three morphisms without worrying about the order in which we group them—the result is the same either way. This is exactly like function composition in ordinary mathematics.
Identity Morphisms: Doing Nothing
Every object $x$ in a category must have an identity morphism $1x\colon x \to x$ (sometimes written as $\text{id}x$). This morphism does nothing—it "returns" you to where you started. The identity morphism must satisfy the property that composing it with any other morphism just gives back that morphism:
If $f\colon x \to y$, then $f \circ 1x = f$
If $f\colon x \to y$, then $1y \circ f = f$
Think of the identity morphism as playing the role of the number 1 in multiplication—when you multiply anything by 1, you get back what you started with.
Important note: While this sounds simple, a useful principle in category theory is that objects are determined by their relationships to other objects. The identity morphism is the unique morphism that "relates" an object to itself in a trivial way.
Example: The Category of Sets
The most intuitive example is the category Set:
Objects: All sets (finite or infinite)
Morphisms: All functions between sets
Composition: Ordinary composition of functions
Identity morphisms: The identity function on each set
This example may seem trivial, but it's surprisingly useful as a testing ground for categorical concepts. When you're learning category theory, you can often understand a new concept by first understanding it in the category of sets.
Special Types of Morphisms
Not all morphisms are created equal. Different morphisms can have different properties, and we have special names for morphisms with particular characteristics. These special types generalize familiar concepts from other areas of mathematics.
Monomorphisms (Injective Morphisms)
A morphism $f\colon a \to b$ is a monomorphism (often abbreviated as monic) if it is "left-cancellative"—that is, whenever we have two morphisms $g1, g2\colon x \to a$ with $f \circ g1 = f \circ g2$, we can conclude that $g1 = g2$.
In other words, if two different paths through $a$ lead to the same point after passing through $f$, they must have been the same path all along. In the category of sets, this is exactly the notion of an injective function (one-to-one)—if $f$ maps two different elements to the same output, we could find two different functions that would be identified by $f$.
The definition captures the idea of being "one-to-one" without requiring the concept of elements, so it works in any category.
Epimorphisms (Surjective Morphisms)
A morphism $f\colon a \to b$ is an epimorphism (often abbreviated as epic) if it is "right-cancellative"—that is, whenever we have two morphisms $h1, h2\colon b \to y$ with $h1 \circ f = h2 \circ f$, we can conclude that $h1 = h2$.
In other words, if two different paths out of $b$ give the same result after being reached from $f$, they must be the same path. In the category of sets, this is exactly the notion of a surjective function (onto)—if $f$ doesn't map to everything in $b$, we could distinguish two functions on $b$ by where they send the missing elements.
The definition captures the idea of being "onto" in a way that works in any category.
Isomorphisms (Bijective Morphisms)
A morphism $f\colon a \to b$ is an isomorphism if there exists a morphism $g\colon b \to a$ (called the inverse of $f$) such that:
$f \circ g = 1b$ (composing $f$ with $g$ gives the identity on $b$)
$g \circ f = 1a$ (composing $g$ with $f$ gives the identity on $a$)
An isomorphism is a morphism that can be completely "undone"—we can go from $a$ to $b$ via $f$ and come back exactly to where we started via $g$. In categorical terms, isomorphic objects are essentially "the same" for all purposes within that category.
In the category of sets, isomorphisms are precisely the bijective functions (one-to-one and onto). If $f$ is bijective, its inverse function $g$ is the unique function that reverses $f$'s action.
Endomorphisms and Automorphisms
An endomorphism of an object $a$ is simply a morphism $f\colon a \to a$ that starts and ends at the same object. The collection of all endomorphisms of $a$ is denoted $\operatorname{End}(a)$.
An automorphism is an endomorphism that is also an isomorphism—that is, a morphism $f\colon a \to a$ for which an inverse $g\colon a \to a$ exists with $f \circ g = 1a = g \circ f$. The collection of all automorphisms of $a$ is denoted $\operatorname{Aut}(a)$.
Automorphisms are the "symmetries" of an object—they are the ways an object can transform while staying fundamentally the same. Automorphism groups are central objects of study throughout mathematics.
Retractions and Sections
Two more special types of morphisms are worth learning because they relate to isomorphisms in important ways.
A retraction is a morphism $f\colon a \to b$ that has a right inverse. This means there exists a morphism $g\colon b \to a$ such that $f \circ g = 1b$. In other words, if you go from $b$ to $a$ via $g$ and then back to $b$ via $f$, you end up where you started.
A section is a morphism $f\colon a \to b$ that has a left inverse. This means there exists a morphism $g\colon b \to a$ such that $g \circ f = 1a$. In other words, if you go from $a$ to $b$ via $f$ and then back to $a$ via $g$, you end up where you started.
Think of sections and retractions as "partial inverses"—they reverse the action of a morphism on one side, but not necessarily both sides.
How These Special Morphisms Relate
There are important relationships between all these special types of morphisms:
Every retraction is an epimorphism, and every section is a monomorphism. This makes intuitive sense: if you have a way to reverse a morphism on the right (retraction), then the original morphism must be surjective. Similarly, if you can reverse a morphism on the left (section), it must be injective.
Most importantly, here is the key relationship that ties everything together:
A morphism $f$ is an isomorphism if and only if it is both a monomorphism and a retraction. Equivalently, a morphism is an isomorphism if and only if it is both an epimorphism and a section.
This tells us that being "one-to-one" together with having a right inverse is enough to guarantee that $f$ is completely reversible. Similarly, being "onto" together with having a left inverse guarantees complete reversibility. And of course, an isomorphism is certainly both injective (monomorphism) and surjective (epimorphism), so these relationships all fit together coherently.
Flashcards
What two classes of entities constitute a category?
Objects
Morphisms (arrows or maps)
In a category, what components must every morphism specify?
A source object and a target object.
What is the term for the collection of all morphisms from object $a$ to object $b$?
The hom-class, denoted $\operatorname{Hom}(a,b)$.
What property must morphism composition satisfy for all composable $f, g,$ and $h$?
Associativity: $(h \circ g) \circ f = h \circ (g \circ f)$.
What unique morphism must exist for every object $x$ in a category?
An identity morphism $1{x} : x \to x$.
In the category Set, what are the objects and morphisms?
Objects are all sets and morphisms are all functions between sets.
What is the defining property of a monomorphism $f: a \to b$?
For all $g1, g2: x \to a$, $f \circ g1 = f \circ g2$ implies $g1 = g2$.
What is the defining property of an epimorphism $f: a \to b$?
For all $h1, h2: b \to y$, $h1 \circ f = h2 \circ f$ implies $h1 = h2$.
When is a morphism $f: a \to b$ considered an isomorphism?
If there exists a morphism $g: b \to a$ such that $f \circ g = 1b$ and $g \circ f = 1a$.
Which combinations of properties are equivalent to a morphism being an isomorphism?
Monomorphism and a retraction
Epimorphism and a section
What defines an endomorphism in a category?
A morphism whose source and target are the same object.
What is an automorphism?
An endomorphism that is also an isomorphism.
What is a retraction $f: a \to b$?
A morphism that has a right inverse $g: b \to a$ such that $f \circ g = 1b$.
Every retraction is necessarily which other type of morphism?
An epimorphism.
What is a section $f: a \to b$?
A morphism that has a left inverse $g: b \to a$ such that $g \circ f = 1a$.
Every section is necessarily which other type of morphism?
A monomorphism.
Quiz
Foundations of Category Theory Quiz Question 1: Which of the following constructions is commonly expressed using category theory?
- Quotients (correct)
- Fourier transforms
- Newtonian mechanics
- Organic synthesis pathways
Foundations of Category Theory Quiz Question 2: In which area of computer science is category theory prominently applied?
- Functional programming (correct)
- Network packet routing
- Database indexing
- Operating system kernel design
Foundations of Category Theory Quiz Question 3: Category theory underlies the development of which of the following mathematical areas?
- Scheme theory (correct)
- Classical Euclidean geometry
- Elementary number theory
- Real analysis of functions of a single variable
Foundations of Category Theory Quiz Question 4: Category theory provides foundations for which of these computer‑science fields?
- Type theory (correct)
- Computer graphics rendering
- Cryptographic hash functions
- Parallel hardware architecture
Foundations of Category Theory Quiz Question 5: What is the term for the collection of morphisms from object \(a\) to object \(b\)?
- Hom‑class \(\operatorname{Hom}(a,b)\) (correct)
- Kernel of \(a\) and \(b\)
- Tensor product of \(a\) and \(b\)
- Dual space of \(a\) with respect to \(b\)
Foundations of Category Theory Quiz Question 6: In the definition of a category, what is required about the internal structure of objects?
- It is not required (correct)
- It must be a set with an operation
- It must be a topological space
- It must be a vector space
Foundations of Category Theory Quiz Question 7: In a one‑object category formed from a monoid, what serve as the morphisms?
- The elements of the monoid (correct)
- The subsets of the monoid
- The ideals of the monoid
- The endomorphisms of the monoid
Foundations of Category Theory Quiz Question 8: If \(f\colon a\to b\) and \(g\colon b\to c\), how is their composite denoted?
- \(g\circ f\) (correct)
- \(f\circ g\)
- \(f+g\)
- \(f\;\text{then}\;g\)
Foundations of Category Theory Quiz Question 9: Which property does composition of morphisms satisfy in any category?
- Associativity (correct)
- Commutativity
- Distributivity over addition
- Idempotence
Foundations of Category Theory Quiz Question 10: In the category **Set**, what are the morphisms?
- Functions between sets (correct)
- Relations between sets
- Subsets of the product of sets
- Ordered pairs of elements
Foundations of Category Theory Quiz Question 11: When is a morphism \(f\colon a\to b\) called an epimorphism?
- When \(h_{1}\circ f = h_{2}\circ f\) implies \(h_{1}=h_{2}\) for all \(h_{1},h_{2}\colon b\to y\) (correct)
- When there exists a right inverse for \(f\)
- When \(f\circ g_{1}=f\circ g_{2}\) implies \(g_{1}=g_{2}\) for all \(g_{1},g_{2}\colon x\to a\)
- When \(f\) is an identity morphism
Foundations of Category Theory Quiz Question 12: What is a retraction?
- A morphism with a right inverse (correct)
- A morphism with a left inverse
- A morphism that is both monic and epic
- A morphism that is an identity
Foundations of Category Theory Quiz Question 13: What is a section?
- A morphism with a left inverse (correct)
- A morphism with a right inverse
- A morphism that is both monic and epic
- A morphism that is an automorphism
Foundations of Category Theory Quiz Question 14: Which collection of properties is equivalent to a morphism being an isomorphism?
- (1) monomorphism and retraction; (2) epimorphism and section; (3) isomorphism (correct)
- (1) epimorphism alone; (2) monomorphism alone; (3) section alone
- (1) retraction alone; (2) section alone; (3) monomorphism alone
- (1) endomorphism and automorphism; (2) bimorphism and retraction; (3) epimorphism alone
Foundations of Category Theory Quiz Question 15: What notation denotes the set of all automorphisms of an object $a$?
- \(\operatorname{Aut}(a)\) (correct)
- \(\operatorname{End}(a)\)
- \(\operatorname{Hom}(a,a)\)
- \(\operatorname{Iso}(a)\)
Foundations of Category Theory Quiz Question 16: In category theory, a natural transformation is a morphism between which kinds of structures?
- Functors (correct)
- Objects
- Morphisms
- Sets
Foundations of Category Theory Quiz Question 17: Which condition correctly characterizes a monomorphism $f\colon a\to b$ in any category?
- For all $g_{1},g_{2}\colon x\to a$, $f\circ g_{1}=f\circ g_{2}$ implies $g_{1}=g_{2}$. (correct)
- There exists a morphism $h\colon b\to a$ with $h\circ f = 1_{a}$.
- For all $h_{1},h_{2}\colon b\to y$, $h_{1}\circ f = h_{2}\circ f$ implies $h_{1}=h_{2}$.
- The morphism $f$ is both epic and monic.
Which of the following constructions is commonly expressed using category theory?
1 of 17
Key Concepts
Category Theory Concepts
Category (mathematics)
Functor
Natural transformation
Monomorphism
Epimorphism
Isomorphism
Applications and Foundations
Set (category)
Topos
Categorical logic
Type theory
Definitions
Category (mathematics)
An abstract structure consisting of objects and morphisms with associative composition and identity arrows for each object.
Functor
A mapping between categories that sends objects to objects and morphisms to morphisms while preserving composition and identities.
Natural transformation
A collection of morphisms linking two functors, providing a way to compare their action on each object in a coherent manner.
Monomorphism
A morphism that is left‑cancellable, meaning it can be “cancelled” from the left side of any composable pair of arrows.
Epimorphism
A morphism that is right‑cancellable, meaning it can be “cancelled” from the right side of any composable pair of arrows.
Isomorphism
A morphism that has both a left and a right inverse, establishing a bijective correspondence between its source and target objects.
Set (category)
The category whose objects are all sets and whose morphisms are all functions between sets, with ordinary function composition.
Topos
A category that behaves like the category of sets, supporting a rich internal logic and serving as a foundation for generalized set theory.
Categorical logic
The study of logical systems and reasoning within the framework of category theory, linking syntax and semantics via categorical structures.
Type theory
A formal system for constructing and reasoning about mathematical objects, closely related to categories through the Curry‑Howard correspondence.