The Initial Object — Finding the True Beginning
“Every complex system that works evolved from a simple system that worked.” — John Gall
When learning category theory, one of the first surprising ideas is that objects themselves are not the focus. Instead, what matters is how objects relate to each other through morphisms (arrows).
So the natural question becomes:
Can we find an object that sits at the **very beginning of the category**, from which every other object can be reached?
This question leads us to the concept of the initial object.
Understanding Objects Through Morphisms
Imagine a category with objects:
A, B, C, DAnd morphisms between them:
A → B
B → C
A → C
C → DIf we think of morphisms as arrows, the category begins to look like a network of flows.
Some objects appear earlier in the flow, while others appear later.
This idea resembles something mathematicians already know well:
ordered structures.
A Quick Detour: Partial Orders and Posets
Before understanding the initial object deeply, we need to look at partially ordered sets, or posets.
A poset is a set equipped with a relation ≤ that satisfies three properties:
1. Reflexivity
Every element is related to itself.
2. Transitivity
If one element precedes another, and that one precedes a third, then the first precedes the third.
3. Antisymmetry
If two elements precede each other, they must be the same element.
Turning a Poset Into a Category
Something remarkable happens when we reinterpret a poset using category theory.
We can construct a category where:
Objects = elements of the set
Morphisms = ordering relationsIn other words:
a → b if and only if a ≤ bFor example, consider the numbers:
1 ≤ 2 ≤ 3The corresponding category becomes:
1 → 2
2 → 3
1 → 3Notice something important:
Between any two objects, there is at most one morphism. That’s because the relation ≤ is simply a fact — it either holds or it doesn’t. This makes posets extremely useful for building intuition about categories.
The Least Element in a Poset
In an ordered structure, sometimes there is an element that comes before everything else.
For example:
0 ≤ 1
0 ≤ 2
0 ≤ 3Here 0 is the least element.
Every other element is greater than or equal to it.
Graphically:
0 → 1
0 → 2
0 → 3If we translate this idea into category theory language, something familiar appears.
The Definition of the Initial Object
An object I in a category C is called initial if:
This means:
For every object X, there exists exactly one morphism from I to X.
Two conditions must hold:
1. A morphism must exist
2. There must be only one
The symbol ∃! means “exists exactly one.”
So the definition can be read as:
The initial object is the object that has **one and only one arrow to every other object**.
Why Posets Make This Idea Clear
In a poset category:
a → b ⇔ a ≤ bSo the initial object must satisfy:
I ≤ X for every XThat is exactly the definition of the least element.
So in poset categories:
Initial object = least elementHowever, not every poset has a least element.
For example, consider all integers:
…, −3, −2, −1, 0, 1, 2 …For any integer n, there is always a smaller integer n-1.
So there is no least element, and therefore no initial object.
Initial Object in the Category of Sets
Now let’s look at the category: Set
Objects = sets
Morphisms = functionsWe ask:
Which set has exactly one function to every other set?
The answer is the empty set.
Why the Empty Set Works
A function
must assign an element of B to every element of A.
If A is empty, there are no elements to assign.
So the function is simply the empty function:
{}This function always exists, and there is exactly one of them.
Therefore:
\forall B,\ \exists!\ (\emptyset \to B)So the empty set is the initial object in the category of sets.
Initial Objects in Programming Languages
Programming languages have a similar concept.
Types can be viewed as sets of values.
Example:
Boolean = {true, false}
Unit = {()}
Int = {...numbers...}But there is also a special type representing no values at all.
In Kotlin this type is:
NothingNothing as the Initial Object of Types
The Kotlin type Nothing represents a type that cannot have any value.
Example:
fun fail(message: String): Nothing =
throw IllegalStateException(message)This function never returns normally.
Because Nothing has no values, a function from Nothing to any other type can exist.
Nothing → Int
Nothing → String
Nothing → User
Nothing → AnyWhy?
Because the function will never receive an input. So it never needs to produce an output. This exactly matches the definition of the initial object.
The Big Picture
Initial objects appear across mathematics and programming.
| Category | Initial Object |
|---|---|
| Posets | Least element |
| Sets | Empty set |
| Types | Nothing |
| Logic | False |
Each of these captures the same structural idea:
An object from which there exists exactly one arrow to every other object.
Final Intuition
Imagine a map of cities connected by one-way roads.
The initial object is the city from which there is exactly one road to every other city. It might look empty or unimportant at first glance — but structurally, it sits at the very beginning of the entire network. And that simple idea turns out to be one of the most powerful patterns in category theory.
