How arrows compose, identity morphisms, and associativity
Arrows that meet end to end can be joined into one. Three simple rules about that joining are all it takes to make a category.
Press Play and watch the particle run along f, then g. The shortcut it reveals is the composite g ∘ f.
The three axioms of a category are deceptively simple: (1) morphisms compose, (2) composition is associative, and (3) every object has an identity morphism. These three rules are enough to build an entire universe of mathematics.
Composition is the heartbeat of category theory. When we have f : A → B and g : B → C, we can form the composite g ∘ f : A → C. This seemingly simple idea turns out to be the foundation for functors, natural transformations, and everything else.
Composition is the fundamental operation: given f : A → B and g : B → C, the composite g ∘ f : A → C goes from A directly to C. Watch the particle travel along both arrows to reveal the composite!
Key insight: Composition is written right-to-left: g ∘ f means "first apply f, then apply g." The composite morphism g ∘ f "short-circuits" through B, going directly from A to C.
Show the identity loops and pick a side of the law. Composing with an identity leaves f unchanged.
Every object in a category has a special identity morphism that acts as a "do nothing" arrow. For any morphism f : A → B, composing with identity changes nothing: f ∘ id_A = f = id_B ∘ f.
Key insight: Identity morphisms are the categorical analog of the number 0 for addition or 1 for multiplication — they are the neutral element for composition.
Switch between h ∘ (g ∘ f) and (h ∘ g) ∘ f. Both groupings end at the same arrow from A to D.
Composition must be associative: for arrows f, g, h in sequence, it doesn't matter which pair we compose first. The result is always the same morphism from A to D.
Key insight: Associativity means we can write h ∘ g ∘ f without parentheses — the grouping doesn't matter. This is one of the three axioms every category must satisfy.
Pick a diagram, then click each path between the same two objects. If every path gives the same composite, the diagram commutes.
A diagram commutes when all paths between the same two objects compose to the same morphism. This is the single most important concept in category theory — "diagram chasing" is how proofs work!
Key insight: When category theorists draw a diagram and say it "commutes," they mean every pair of paths with the same start and end compose to the same morphism. Most theorems in category theory are expressed this way.
Spot a mistake or have an idea?