Okay, [last time](https://forum.azimuthproject.org/discussion/2124/lecture-30-chapter-1-preorders-as-enriched-categories/p1) I dumped the definition of ["enriched category"](https://en.wikipedia.org/wiki/Enriched_category) on you. Now let's figure out what it does! To get going we need to pick a monoidal preorder \$$\mathcal{V}\$$. Then:

**Definition.** A **\$$\mathcal{V}\$$-enriched category**, say \$$\mathcal{X}\$$, consists of:

1. a set of **objects**, \$$\mathrm{Ob}(\mathcal{X})\$$, and

2. an element \$$\mathcal{X}(x,y) \in \mathcal{V}\$$ for any pair of objects \$$x,y\$$.

such that:

a) \$$I\leq\mathcal{X}(x,x) \$$ for any object \$$x\$$, and

b) \$$\mathcal{X}(x,y)\otimes\mathcal{X}(y,z)\leq\mathcal{X}(x,z) \$$ for any objects \$$x,y,z\$$.

We often say "\$$\mathcal{V}\$$-category" instead of \$$\mathcal{V}\$$-enriched category, just to save time. Life is short.

To understand this definition, we need examples! The simplest interesting example is \$$\mathcal{V} = \mathbf{Bool}\$$. This is the set of **Booleans**, or "truth values":

$\mathbf{Bool} = \\{ \texttt{true}, \texttt{false} \\} .$

It's a poset where \$$x \le y\$$ means "\$$x\$$ implies \$$y\$$". Namely, \$$\texttt{false} \le \texttt{true} \$$ and everything is less than or equal to itself, and that's all. We make it monoidal by taking \$$x \otimes y\$$ to mean "\$$x\$$ and \$$y\$$", so the unit \$$I\$$ is \$$\texttt{true}\$$. Let's see what this gives.

**Theorem.** A \$$\mathbf{Bool}\$$-category is a preorder.

**Proof.** Let's start with a \$$\mathbf{Bool}\$$-category and see what it actually amounts to. A \$$\mathbf{Bool}\$$-enriched category, say \$$\mathcal{X}\$$, consists of:

1. a set of objects, \$$\mathrm{Ob}(\mathcal{X})\$$ and

2. an element \$$\mathcal{X}(x,y) \in \mathbf{Bool} \$$ for any two objects \$$x,y\$$

So, we get a truth value for each pair \$$x,y\$$. Let's make up a relation \$$\le\$$ on \$$\mathrm{Ob}(\mathcal{X})\$$ such that \$$x \le y\$$ is true when \$$\mathcal{X}(x,y) = \texttt{true}\$$, and false when \$$\mathcal{X}(x,y) = \texttt{false}\$$.

Next:

a) \$$I\leq\mathcal{X}(x,x) \$$ for any object \$$x\$$.

In our example this means

$\texttt{true} \textrm{ implies that } x \le x .$

In other words, \$$x \le x\$$ is true. So this is just the reflexive law for \$$\le\$$!

b) \$$\mathcal{X}(x,y)\otimes\mathcal{X}(y,z)\leq\mathcal{X}(x,z) \$$ for any objects \$$x,y,z\$$.

In our example this means

$x \le y \textrm{ and } y \le z \textrm{ implies } x \le z .$

So this is just the transitive law for \$$\le\$$!

It's easy to turn this argument around and get the converse: any preorder gives a \$$\mathbf{Bool}\$$-category \$$\mathcal{X}\$$ if we define \$$\mathcal{X}(x,y) = \texttt{true}\$$ when \$$x \le y\$$ and
\$$\mathcal{X}(x,y) = \texttt{false}\$$ otherwise. \$$\qquad \blacksquare \$$

Yee-hah! We've managed to define preorders in a new, more abstract, more confusing way! But of course that's not our goal. That was just a warmup. A much cooler example occurs when we take \$$\mathcal{V} = \mathbf{Cost}\$$. This is the set of **costs**, or non-negative real numbers including infinity:

$\mathbf{Cost} = [0,\infty] .$

It's a poset where the order is defined in the _opposite_ of the usual way: we use \$$\ge\$$ instead of \$$\le\$$. It becomes a monoidal using addition, with \$$0\$$ as the unit. In case you're nervous about infinity, this means that \$$x + \infty = \infty = \infty + x\$$ and \$$x \le \infty\$$ for all \$$x\$$.

**Puzzle 88.** Show that these choices actually makes \$$\mathbf{Cost}\$$ into a symmetric monoidal poset.

**Puzzle 89.** Figure out exactly what a \$$\mathbf{Cost}\$$-category is, starting with the definition above. Again, what matters is not your final answer so much as your process of deducing it!

Hint: given a \$$\mathbf{Cost}\$$-category \$$\mathcal{X}\$$, write \$$\mathcal{X}(x,y)\$$ as \$$d(x,y)\$$ and call it the **distance** between the objects \$$x,y \in \mathrm{Ob}(\mathcal{X})\$$. The axioms of an enriched category then say interesting things about "distance".

**[To read other lectures go here.](http://www.azimuthproject.org/azimuth/show/Applied+Category+Theory#Chapter_2)**