Objects & Morphisms

The atoms of category theory: objects, arrows, and hom-sets

Objects & Morphisms

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.

Category Builder Canvas

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.

fgg∘fABC

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.

Real-World Categories

Categories are everywhere! Any collection of things with structured relationships between them can often be viewed as a category.

BA117JL44AF11AF276NYCLondonTokyoParis

Cities are objects, direct flights are morphisms. Connecting flights are composition: flying NYC→London→Tokyo is the composite of two morphisms.

Arrow Notation

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!

AfB
f : AB

"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.

Hom-Set Explorer

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.

Hom(,)

Hom(A, B) = {f, g}

|Hom| = 2
f : AB
g : AB

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!

Key Takeaways

  • Objects & Morphisms — A category is made of objects (dots) and morphisms (arrows). The arrows are the primary data — objects are just anchor points.
  • Real-World Categories — Categories appear everywhere: cities with flights, ordered numbers, and social networks all have categorical structure.
  • Arrow Notation — We write f : A → B to say "f is a morphism from A to B", specifying the morphism's name, domain, and codomain.
  • Hom-Sets — Hom(A, B) collects all morphisms from A to B into a set. Different pairs of objects can have different-sized hom-sets.