Arun Pandian M

Arun Pandian M

Android Dev | Full-Stack & AI Learner

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

https://storage.googleapis.com/lambdabricks-cd393.firebasestorage.app/objects_connect_morphism.svg?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=firebase-adminsdk-fbsvc%40lambdabricks-cd393.iam.gserviceaccount.com%2F20260309%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20260309T195827Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=host&X-Goog-Signature=64e9bcace7f1370e9c5dba2101533c1f14e056387c4e9f37b74de5a30eb55c35b394704a83b05472247b144ab83cb000da3e68e1337ad89f5fc95be35be3cccc09ee98ea5d3de7ad8acc4700377da37aae2229c74bbec5e2022c6c3b7d64d9029c1ec51d7030e248e3643a93e08d428b5031e98d75767ef01e5f17497ff47f707d551e27f604eb09a63c70c0eafd3da8d4055e9cc4e209431f0573652ab4dbdfd1d3efac74e8b14cc573fdea404c9ea3390ea5d91d4bb20044f28ba27bfe620b4d33ee3361a18101409f19ec2b24e9bb71025ab1a5f3d1baedc7d52b17612e4c9ef693fa11576050d6e76f25b8107ad02fcb012804dcec400eec2bd338c8e2bd

Imagine a category with objects:

A, B, C, D

And morphisms between them:

A → B
B → C
A → C
C → D

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

aaa \le a

2. Transitivity

If one element precedes another, and that one precedes a third, then the first precedes the third.

abandbcaca \le b \quad \text{and} \quad b \le c \Rightarrow a \le c

3. Antisymmetry

If two elements precede each other, they must be the same element.

abandbaa=ba \le b \quad \text{and} \quad b \le a \Rightarrow a = b

Turning a Poset Into a Category

https://storage.googleapis.com/lambdabricks-cd393.firebasestorage.app/poset_as_category.svg?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=firebase-adminsdk-fbsvc%40lambdabricks-cd393.iam.gserviceaccount.com%2F20260309%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20260309T195827Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=host&X-Goog-Signature=829617591cb2a5139a84cd0444ed67979e1f87be146d1acffc668f1df42585a1af703d7e051c8c81af0adb43132213cea49b077acaf14688bc476e8f6b55ccf24dba71c1bea5dc5d8d69f41a70395963a298309c7d3b862ff51d3c1d964508dd43ca6c823ac569d75569c3895a8ab07a15553ee4d03f0f510c0c8715f3e4bc966b0c2d64f4e8fcbf1c2cf7ce2369c40eb370d67363207f69568be954395a188930a1d8ef6e3dc50e641ded55c1ca3255b21a0e1205a9e8e04637533d416ec9cb5114ee85f2c13002947965b9c488fda4b3708ce51dd413d446c805263c8b6cfa3fa9e86a7db064b1d9112b3736ec676e603a17d63f9574dde0bf17fe3db083ac

Something remarkable happens when we reinterpret a poset using category theory.

We can construct a category where:

Objects = elements of the set
Morphisms = ordering relations

In other words:

a → b  if and only if  a ≤ b

For example, consider the numbers:

1 ≤ 2 ≤ 3

The corresponding category becomes:

1 → 2
2 → 3
1 → 3

Notice 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 ≤ 3

Here 0 is the least element.

Every other element is greater than or equal to it.

Graphically:

0 → 1
0 → 2
0 → 3

If we translate this idea into category theory language, something familiar appears.

The Definition of the Initial Object

https://storage.googleapis.com/lambdabricks-cd393.firebasestorage.app/initial_obj_def.svg?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=firebase-adminsdk-fbsvc%40lambdabricks-cd393.iam.gserviceaccount.com%2F20260309%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20260309T195827Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=host&X-Goog-Signature=2bcdeca0fb01c20ad303a5a760ba4cedd00fd2a37fcefc25ef397e1cd4a309f0b3f7380cd49edfd46fddd43f7f883fb9a9c472dee806e2c9067520f641618ca2672d0d3b96b7fdd08e492d0d2e45e431d4d692f0dd442d19bab27f545b1f217ccbb556e690a492f65c565162bd7abf289cef06d58740a51f1eaf200714a24a6e942eeef904b0345cd7bfe080fbefd2192ea5923273cc3a93dae5c18cf765394f2657a4a2f38593dcc7a6785f97c5c3b0a34b63f807ae73565b26247242778aa66e2a4f02ef621b622b8b075b0eb00e57b5a927508b4db5544fa9b781aacba52db2a89b68f9a1b7eeca379a6005149763ac6ce92eea42023cee89c119a5b0a9b6

An object I in a category C is called initial if:

XC, ! (IX)\forall X \in C,\ \exists!\ (I \to X)

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 ≤ b

So the initial object must satisfy:

I ≤ X  for every X

That is exactly the definition of the least element.

So in poset categories:

Initial object = least element

However, 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 = functions

We ask:

Which set has exactly one function to every other set?

The answer is the empty set.

Why the Empty Set Works

A function

f:ABf : A \to B

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:

Nothing

Nothing 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 → Any

Why?

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.

CategoryInitial Object
PosetsLeast element
SetsEmpty set
TypesNothing
LogicFalse

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.

#TypeTheory#EngineeringMindset#ComputerScience#SoftwareDesign#InitialObject#FPConcepts#ProgrammingLanguages#Kotlin#CategoryTheory#FunctionalProgramming#AbstractThinking#ProgrammingConcepts#MathForProgrammers#Mathematics#LearnInPublic