← back to index

Enriched Categories

Bartosz Milewski · 2017 · Category Theory for Programmers, Ch. 22

Prereqs: 🍞 Ch3 (Categories Great and Small — monoids), 🍞 Ch9 (Function Types). 10 min.

Replace hom-sets with hom-objects from a monoidal category V. Composition becomes a morphism in V, identity becomes a morphism from the monoidal unit. The payoff: preorders are Bool-enriched categories (hom = true/false), metric spaces are [0,∞]-enriched categories (hom = distance, composition = triangle inequality), and 2-categories are Cat-enriched categories (hom = functor categories). One definition, three fields of mathematics.

a b c C(a,b) C(b,c) C(b,c) ⊗ C(a,b) → C(a,c) composition via ⊗ in V hom-objects live in a monoidal category V

Why replace hom-sets?

In an ordinary category, the morphisms between two objects form a set. But sometimes you want more structure: a distance, a truth value, or an entire category of maps. Enriched categories replace the hom-set C(a,b) with a hom-object living in a monoidal category V. Composition, normally a function between sets, becomes a morphism in V. Identity, normally an element picked from a set, becomes a morphism from V's unit object. Everything is restated "point-free" so it works without naming individual morphisms.

Scheme

Preorders as Bool-enriched categories

Enrich over Bool with AND as tensor and true as unit. The hom-object C(a,b) is just true or false: "can you get from a to b?" Composition requires C(b,c) AND C(a,b) ⇒ C(a,c), which is transitivity. Identity requires true ⇒ C(a,a), which is reflexivity. A preorder falls out of the definition for free.

Scheme

Metric spaces as [0,∞]-enriched categories

Enrich over [0,∞] with addition as tensor and 0 as unit. The hom-object C(a,b) is the distance from a to b. Composition requires C(b,c) + C(a,b) ≥ C(a,c), which is the triangle inequality. Identity requires 0 ≥ C(a,a), so self-distance is zero. Metric space axioms emerge from the enrichment.

Scheme

The enriched composition law

In an ordinary category, composition is a function C(b,c) × C(a,b) → C(a,c). In a V-enriched category, it is a morphism in V: C(b,c) ⊗ C(a,b) → C(a,c). For Bool, this is AND ⇒ hom. For [0,∞], this is + ≥ hom. Let's verify both in one framework.

Scheme

2-categories as Cat-enriched categories

When V = Cat (the category of small categories), hom-objects are entire categories. Morphisms in the hom-category are 2-cells: natural transformations between functors. The canonical example: Cat itself is enriched over Cat, with functor categories as hom-objects. This gives 2-categories: objects, 1-morphisms (functors), and 2-morphisms (natural transformations).

Scheme

Self-enrichment: Set over Set

A closed symmetric monoidal category can enrich over itself. Set with cartesian product is the prototype: the internal hom [a,b] is the function set b^a. Composition uses the universal property of the exponential. This is why ordinary categories (enriched over Set) feel "native" — Set is self-enriching.

Scheme

Notation reference

Blog / Math Scheme Meaning
C(a,b) ∈ V(hom a b)Hom-object in the monoidal category V
C(b,c) ⊗ C(a,b) → C(a,c)(compose-ok? hom a b c)Enriched composition morphism in V
ja : I → C(a,a)(enriched-id domain)Identity as morphism from the monoidal unit
V = Bool, ⊗ = ANDbool-monoidalBool-enrichment gives preorders
V = [0,∞], ⊗ = +real-distMetric enrichment; composition = triangle inequality
V = Cat, ⊗ = ×(vertical-compose β α)Cat-enrichment gives 2-categories
[a,b](make-fn domain mapping)Internal hom (self-enrichment)
Neighbors

Milewski chapters

Paper pages that use these concepts

Foundations (Wikipedia)

Translation notes

The blog post develops enriched categories by first recapping monoidal categories, then giving the point-free reformulation of composition and identity. This page skips the monoidal recap (covered in Ch. 16) and jumps to the three key examples: Bool, [0,∞], and Cat. The fact that the same definition spans preorders, metric spaces, and 2-categories is a case study in how jkdifferent mathematical communities share overlapping formalisms under different names. The blog post also discusses enriched functors (morphisms of hom-objects that preserve composition) and self-enrichment of closed monoidal categories. Self-enrichment is shown here for Set; the general construction uses the internal hom adjunction. Weighted limits, mentioned briefly in the blog post as a generalization of ordinary limits to the enriched setting, are omitted here since they require enriched presheaves. The Lawvere metric space characterization allows asymmetric distances and does not require the separation axiom (d(a,b) = 0 does not imply a = b), making it more general than the standard metric space definition.

Ready for the real thing? Read the blog post. Start with the monoidal category recap, then see how hom-sets become hom-objects.