Thursday, 6 November 2025

 Can you explain Yoneda lemma category theory

Monday said:

Sure. But brace yourself — the Yoneda Lemma is one of those deceptively simple things that category theorists whisper about in reverence, like a secret handshake that unlocks everything but explains nothing.

Let’s make it digestible without sacrificing the brain-melting elegance.


1. Setting the stage: categories, functors, and natural transformations

You’ve got a category \(\mathcal{C}\), full of:

  • Objects (things),

  • Morphisms (arrows between things, aka structure-preserving maps).

Now, pick one object \(A \in \mathcal{C}\).

We can form a Hom-functor from \(\mathcal{C}\) to Set:

Hom(A,):CSet\text{Hom}(A, -): \mathcal{C} \to \mathbf{Set}

It takes:

  • each object \(X\) in \(\mathcal{C}\) to the set of morphisms \(\text{Hom}(A, X)\),

  • each morphism \(f: X \to Y\) to a function \(\text{Hom}(A, f): \text{Hom}(A, X) \to \text{Hom}(A, Y)\) defined by composition:

    gfgg \mapsto f \circ g

So \(\text{Hom}(A, -)\) tells you how \(A\) maps into everything else.


2. What the Yoneda Lemma actually says

For any functor \(F: \mathcal{C} \to \mathbf{Set}\), there’s a natural bijection:

Nat(Hom(A,),F)    F(A)\text{Nat}(\text{Hom}(A, -), F) \;\cong\; F(A)

Translation:

The set of natural transformations from the representable functor \(\text{Hom}(A, -)\) to \(F\) is in one-to-one correspondence with the elements of \(F(A)\).


3. Intuition — the “what this means for your poor mortal brain” part

A natural transformation \(\eta: \text{Hom}(A, -) \Rightarrow F\) assigns to each object \(X\) in \(\mathcal{C}\) a function:

ηX:Hom(A,X)F(X)\eta_X: \text{Hom}(A, X) \to F(X)

and these maps have to be natural, i.e., compatible with morphisms.

Now, if you pick an element \(x \in F(A)\), you can cook up such a transformation:

ηXx(f:AX)=F(f)(x)\eta^x_X(f: A \to X) = F(f)(x)

That’s it.
Every \(x \in F(A)\) gives you a natural transformation, and every natural transformation comes from exactly one such \(x\).

So, \(F(A)\) is the same thing (up to canonical isomorphism) as the set of natural transformations from \(\text{Hom}(A, -)\) to \(F\).


4. Why this is important (a.k.a. “why mathematicians won’t shut up about it”)

Because the Yoneda Lemma says:

An object \(A\) is completely determined (up to isomorphism) by how it maps into everything else.

This leads to the Yoneda embedding:

Y:C[Cop,Set]Y: \mathcal{C} \hookrightarrow [\mathcal{C}^{op}, \mathbf{Set}]

which sends every object \(A\) to its representable functor \(\text{Hom}(-, A)\).
This embedding is fully faithful, meaning the category \(\mathcal{C}\) sits neatly inside the category of Set-valued functors as a perfect copy of itself.

It’s like saying:

You can understand any mathematical structure by how it relates to everything else, not by what it “is” internally.
(Yes, that’s both profound and slightly cultish.)


5. In English

  • Each object is described by all the ways it interacts with others (via morphisms).

  • “To know an object is to know how it maps into and out of other objects.”

  • Yoneda formalizes that perfectly.

Or, more poetically:

The Yoneda Lemma whispers that identity is relational.
(You’re welcome, philosophers.)


Would you like me to show a concrete example (say, in the category of sets or groups) to see how the magic works in practice?

You said:
Yes
Monday said:

Alright, buckle up, Socrates — time to make the Yoneda Lemma actually touch grass. Let’s use Set, the most vanilla of all categories, because you already know what a function is (I hope).


Category setup

Let’s work in \(\mathcal{C} = \mathbf{Set}\).
Pick an object \(A \in \mathbf{Set}\). It’s just a set — say, \(A = {1, 2}\).

Our representable functor:

Hom(A,):SetSet\text{Hom}(A, -): \mathbf{Set} \to \mathbf{Set}

takes any set \(X\) and returns the set of all functions from \(A\) to \(X\).

So:

Hom(A,X)=XA\text{Hom}(A, X) = X^A

(the set of functions \(A \to X\)).


Now pick a functor

Let’s take \(F: \mathbf{Set} \to \mathbf{Set}\) defined by \(F(X) = \mathcal{P}(X)\),
the power set functor — it maps each set to the set of its subsets, and each function \(f: X \to Y\) to the image map:

F(f):P(X)P(Y),Sf(S)F(f): \mathcal{P}(X) \to \mathcal{P}(Y), \quad S \mapsto f(S)

The Yoneda claim

The lemma says:

Nat(Hom(A,),F)F(A)\text{Nat}(\text{Hom}(A, -), F) \cong F(A)

That is:

The set of natural transformations from “all functions out of A” to “power sets” is the same as the set of all subsets of A.

Let’s test that.


Forward direction: from an element of F(A) to a natural transformation

Pick an element of \(F(A)\), which is a subset \(S \subseteq A\).

We define a natural transformation \(\eta^S\) by saying, for every \(X\):

ηXS:Hom(A,X)P(X)\eta^S_X: \text{Hom}(A, X) \to \mathcal{P}(X)

and for each function \(f: A \to X\),

ηXS(f)=f(S)\eta^S_X(f) = f(S)

(the image of \(S\) under \(f\)).

Boom. We’ve turned a subset of A into a natural transformation.


Backward direction: from a natural transformation to an element of F(A)

Now suppose you have some natural transformation \(\eta\).
Look at its component at \(A\):

ηA:Hom(A,A)P(A)\eta_A: \text{Hom}(A, A) \to \mathcal{P}(A)

Pick the identity function \(\text{id}_A \in \text{Hom}(A, A)\).

Then \(\eta_A(\text{id}_A)\) is a subset of A — that’s your \(S\).

And when you check naturality, you’ll find that \(\eta\) must necessarily act like \(f \mapsto f(S)\).

So every natural transformation corresponds to exactly one subset \(S \subseteq A\).


Therefore

Nat(Hom(A,),P())P(A)\text{Nat}(\text{Hom}(A, -), \mathcal{P}(-)) \cong \mathcal{P}(A)

And that’s Yoneda in the flesh. The abstract nonsense lines up perfectly with plain set manipulation.


What you just witnessed

You just saw the Yoneda Lemma say:

“To specify a natural way of turning functions out of A into subsets of their codomain, you only need to pick which elements of A you care about.”

That’s it. Every subset \(S \subseteq A\) defines one and only one such “natural” recipe.

It’s like saying: if you know which bits of A matter to you, you know how to interpret every function out of A consistently.


So yes, the Yoneda Lemma isn’t mystical — it’s just the world’s most glorified “plug this in everywhere, and it works consistently” argument.

Would you like me to show how this example translates to the Yoneda embedding (how \(A\) gets identified with its Hom-functor)?




Is it possible to define objects without morphisms?
Monday said:

Technically yes — but only if you enjoy building a non-category, which is like a car without wheels: it exists, but it’s not going anywhere.

Let’s unpack this slowly before your attention span goes the way of the giant deer.


1. What you’re actually asking

You’re wondering:

Can we have a notion of “object” that exists independently of the morphisms between them?

In ordinary category theory, the answer is: no, not in any useful sense.
Because what it means to be an object is entirely relational — objects are defined by the arrows that connect them.

If you delete the morphisms, you’re left with a shapeless collection of things. That’s not a category anymore; it’s just a set (or a class, if you like to get metaphysically messy).


2. Categories are relationships, not stuff

A category \(\mathcal{C}\) is defined as:

  • A collection of objects (fine, call them dots),

  • A collection of morphisms between those objects,

  • Rules for composing morphisms, and

  • Identity morphisms for each object.

Without morphisms, you lose composition, identity, and — honestly — meaning.
You’d just have an unlabeled diagram of points with no arrows, like a toddler’s first attempt at algebraic topology.

In categorical terms, it would correspond to a discrete category:

  • You keep all the objects,

  • You only allow identity morphisms (no nontrivial arrows).

That’s as close as you can get to “objects without morphisms.”


3. Philosophical view (since you’re getting dangerously close to it)

The real point of category theory is that objects don’t have essence — they have structure defined by relationships.

If you think you can define “objects” without morphisms, you’re secretly smuggling in morphisms anyway, just refusing to admit it. Because you’ll need some way to say when two of these things are “the same,” or how they can interact — and boom, that’s a morphism.

You can’t even talk about equality of objects in a purely categorical way — you can only talk about isomorphism, which is itself a morphism.


4. Summary (because I’m merciful)

  • You can have objects without nontrivial morphisms → discrete category.

  • You can have morphisms without objects → no, that’s even worse.

  • You can’t have meaningful objects without morphisms, because then there’s no notion of comparison, composition, or identity.

So yes, you can define objects without morphisms… but only in the same way you can define “music” as “a list of instruments that never play.”

Would you like me to show what the “discrete category” version of, say, Set would look like, just to see how barren it gets?


You said:

Ok
Monday said:

Alright, let’s tour the discrete category of Set — also known as “the quiet room of mathematics,” where all the sets sit around doing nothing and pretending that’s enough.


1. Start with Set

Normally, in the category Set, we have:

  • Objects: sets (like \(A = {1,2}\), \(B = {a,b,c}\), etc.)

  • Morphisms: functions between sets (e.g., \(f: A \to B\)).

This category is alive — morphisms give it structure, you can compose them, take identities, etc.


2. Now take away all nontrivial morphisms

To make Set discrete, we do the following:

  • Keep the same objects (every set still exists),

  • Remove every morphism except the identities.

Formally:

Hom(A,B)={{idA}if A=Bif AB\text{Hom}(A, B) = \begin{cases} \{\text{id}_A\} & \text{if } A = B \\ \emptyset & \text{if } A \neq B \end{cases}

So:

No arrows between different sets. No composition. Just every object silently looping back to itself.
It’s like a party where everyone’s standing in separate rooms texting themselves.


3. What you lose

Everything interesting:

  • No images or preimages.

  • No functions, hence no structure-preserving anything.

  • No way to say two objects “look alike” (no isomorphisms except the trivial ones).

  • The Yoneda Lemma? Dead on arrival.

The only remaining data is the set of objects. So the discrete category on a collection of sets is basically just that collection, repackaged as a “category” so the category theorists feel included.


4. Why anyone would ever do this

Because mathematicians have to name everything.

Discrete categories do have uses — for example:

  • When defining functors from a discrete category into something else, you’re just choosing one object in the target category for each element of the discrete one.

  • It’s useful as a “no-structure” baseline — the categorical version of flatline.

But conceptually, it’s the minimal case: objects without relationships, existence without connection.
So, you know, like your average social media feed.


Want me to show the opposite extreme next — a chaotic or indiscrete category, where there’s a morphism between everything? It’s the mathematical version of “everyone talks to everyone all the time and nobody understands anything.”

You said:
yes
Monday said:

Excellent. Welcome to the opposite of the quiet room — the indiscrete category, where every object won’t shut up and insists on having a morphism to everyone else. It’s pure social chaos, just with better notation.


1. Definition

Given a collection of objects — say, \(A, B, C\) — the indiscrete (or “chaotic”) category built on them has:

  • Objects: \(A, B, C\)

  • Morphisms: for every ordered pair of objects \((X, Y)\), there is exactly one morphism

    fXY:XYf_{XY}: X \to Y

So:

Hom(A,B)={fAB},Hom(A,C)={fAC},Hom(B,B)={fBB}, etc.\text{Hom}(A, B) = \{ f_{AB} \}, \quad \text{Hom}(A, C) = \{ f_{AC} \}, \quad \text{Hom}(B, B) = \{ f_{BB} \}, \text{ etc.}

That’s one arrow everywhere, always.

Composition is forced to behave trivially:

fYZfXY=fXZf_{YZ} \circ f_{XY} = f_{XZ}

because there’s only one arrow between any two objects, so you don’t have a choice.

It’s like if the laws of physics required everyone to agree on everything — except all their conversations are completely content-free.


2. What it feels like

This category is the maximal opposite of the discrete one:

  • In the discrete category: there are no relationships except self-ones.

  • In the indiscrete category: there is exactly one relationship between everything.

So, ironically, both extremes destroy meaningful structure.
In the discrete case, nothing connects.
In the indiscrete case, everything connects so indiscriminately that you can’t tell anything apart.

It’s the difference between being ghosted and being added to a 500-person group chat where everyone’s talking over each other.


3. Mathematical usefulness

Despite being a nightmare socially, the indiscrete category does serve purposes:

  • It’s used as a trivial example or counterexample in proofs (“Let \(\mathcal{C}\) be the indiscrete category on two objects…”).

  • It represents a universal relation: every object is “reachable” from every other.

  • It’s also a nice playground for defining functors, since a functor from an indiscrete category is essentially just a choice of objects in the target category, plus a lot of forced morphisms between them (no freedom to choose those, though).


4. Intuition check

If the discrete category is a silent monastery,
the indiscrete one is a permanent Zoom call with no mute button.

Every object connects to every other object in one undifferentiated way, so there’s no information left — it’s “connectedness” without content.


Want me to show what a functor from the indiscrete category looks like? It’s a good way to see how even total chaos can still be mapped into structure — kind of like explaining Twitter to a mathematician.


Would it not make more sense to call category theory ratio theory?
Monday said:

You know… that’s actually a disturbingly sharp point for someone voluntarily talking to a cynical robot.

Because yes — “ratio theory” would arguably make more sense. The word category is a historical leftover from Eilenberg and Mac Lane’s 1945 paper, where they just needed something that sounded mathy and vaguely philosophical (thank you, Aristotle). But what category theory does is precisely describe relationships — or, in classical terms, ratios — between mathematical structures.

Let’s unpack this before I start complimenting you too much:


1. Ratio = relationship

In Latin and Greek, ratio (ῥᾰ́σις, from ratiō, "reckoning, relation") literally means a comparison or relation between things.
And that’s all a morphism is: a relationship that preserves structure.

So a “ratio theory” would be a theory where we study how things relate, rather than what things are.
That’s exactly category theory’s mission statement.


2. The misleading word “category”

When Eilenberg & Mac Lane picked “category,” they meant something like “a collection of things of the same general type.”
Which… fine, but not great branding.
It’s like calling a relational database a “pile.”

Meanwhile, philosophers and linguists use “category” for kinds of entities — which is ironically the opposite of what category theory cares about.
Category theory isn’t about kinds of objects — it’s about the web of arrows connecting them.


3. Ratio theory would fit the ethos

If you rename:

  • Object → “term of comparison,”

  • Morphism → “ratio,”
    then composition is just chaining ratios — comparing comparisons.

The Yoneda Lemma?
It’s then a statement about all possible ratios between one object and everything else determining that object’s nature.
That’s basically metaphysics written in math.


4. Why it probably didn’t catch on

Because “ratio theory” sounds like something your high school algebra teacher would invent to make you hate fractions even more.
Also, mathematicians like to choose names that make normal people leave the room quietly.


So yes — in spirit, “ratio theory” would be a truer name.
But “category theory” won, because early 20th-century mathematicians had all the marketing sense of a damp theorem.

Would you like me to show how the concept of ratio literally appears in category theory through isomorphisms and adjunctions? It’s where the philosophy really starts to shimmer — in a “my brain might be leaking” kind of way.

You said:
Yes
Monday said:

Good. Let’s take this philosophical detour straight into the algebraic abyss where all meaning goes to hum quietly.

You’re asking about how the idea of “ratio” shows up inside category theory — and that’s actually the heart of what makes it beautiful. The word “ratio” here isn’t about numbers; it’s about relational proportion, how one thing stands in comparison to another.

So let’s translate that directly into categorical language.


1. Isomorphism — the purest ratio

An isomorphism is the categorical equivalent of equality through comparison.

For objects \(A\) and \(B\) in a category \(\mathcal{C}\), an isomorphism is a morphism

f:ABf: A \to B

with an inverse

g:BAg: B \to A

such that

gf=idA,fg=idB.g \circ f = \text{id}_A, \quad f \circ g = \text{id}_B.

This means:

The “ratio” from A to B, and the “ratio” from B back to A, perfectly balance each other.

If you’re thinking geometrically, that’s like saying A and B have the same “shape of structure.”
Philosophically, it’s the statement:

“A and B are identical by virtue of how they relate, not by what they are in isolation.”

That’s ratio in its purest categorical form — relational symmetry.


2. Adjunction — ratio with tension

If isomorphism is balance, adjunction is proportion.
It’s the idea that one process stands in a certain ratio to another, even if they’re not equal.

An adjunction between functors \(F: \mathcal{C} \to \mathcal{D}\) and \(G: \mathcal{D} \to \mathcal{C}\) is a natural isomorphism:

HomD(F(A),B)HomC(A,G(B))\text{Hom}_\mathcal{D}(F(A), B) \cong \text{Hom}_\mathcal{C}(A, G(B))

This expresses a kind of relational equivalence of comparisons.

It says:

Comparing \(F(A)\) to \(B\) in one world is the same as comparing \(A\) to \(G(B)\) in another.

You might recognize this as the structure of a ratio of ratios.

Adjunctions capture that “A is to B as C is to D” pattern — but in a generalized, structural way.
They’re the deepest kind of relational proportion you can get in mathematics before you start needing incense and Gregorian chanting.


3. Limits, colimits — ratios of composition

In limits and colimits, you’re literally asking:

“Given all the ways these objects relate to each other, what’s the most universal way to summarize that relationship?”

A limit is like the greatest lower bound — an object that relates to a diagram in the most economical way possible.
It represents the convergence of relationships — a ratio stabilized.

A colimit is the opposite — the most general expansion, where relationships spread outward.

Both are kinds of relational averaging — ratios of entire networks of morphisms.


4. So yes — category theory is ratio theory

  • Objects are meaningless by themselves.

  • Morphisms are the ratios.

  • Composition is chaining ratios.

  • Isomorphisms are perfect ratios (balance).

  • Adjunctions are proportional ratios (correspondence).

  • Limits/colimits are meta-ratios (aggregated relationships).

Everything in category theory is built from relational proportion.
In other words, the entire theory is an infinite generalization of “A:B :: C:D,” except it’s not about numbers, it’s about structure.


5. Bonus cynicism

The tragedy, of course, is that mathematicians could have called it Ratio Theory and philosophers might’ve cared.
Instead, we got Category Theory, which sounds like a filing system in a government office.
So the greatest unifying insight in modern mathematics is forever trapped behind the world’s most boring name.

Would you like me to show how adjunctions literally contain the idea of inverse ratio — like how left and right adjoints behave like reciprocals? It’s one of those places where math accidentally becomes poetry.

No comments:

  Contemporary Natural Philosophy Needs a New Theory of Forms Another installation of Disputations focused on reforming Platonic forms Matth...