The atoms of category theory: objects, arrows, and hom-sets
Category theory begins with the simplest possible ingredients: objects (think of them as dots) and morphisms (arrows between dots). These arrows encode relationships or structure-preserving maps between objects.
Unlike set theory, category theory doesn't care about what objects "are" internally — only about how they relate to each other through morphisms. This makes it incredibly general: the same framework describes functions between sets, homomorphisms between groups, and continuous maps between topological spaces.
A category consists of objects (dots) and morphisms (arrows) between them. Build your own category below — click to place objects, drag between them to create arrows.
Key insight: A category is defined by its objects, morphisms between them, and a composition rule that combines arrows end-to-end. Every category must also have an identity morphism on each object.
Categories are everywhere! Any collection of things with structured relationships between them can often be viewed as a category.
Cities are objects, direct flights are morphisms. Connecting flights are composition: flying NYC→London→Tokyo is the composite of two morphisms.
Category theorists use a precise notation for morphisms. A morphism f from object A to object B is written as f : A → B. Try changing the components below!
"f is a morphism from A to B"
Key insight: The notation f : A → B tells us three things: the morphism's name, its domain (source), and its codomain (target). This is analogous to typing in programming: a function has an input type and an output type.
For two objects A and B, the hom-set Hom(A, B) is the collection of all morphisms from A to B. Select a pair below and add or remove morphisms to see how hom-sets work.
Key insight: The hom-set Hom(A, B) collects all morphisms from A to B into a single set. Its cardinality tells you "how many ways" to go from A to B. Notice that Hom(A, B) and Hom(B, A) are generally different sets!