---
jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.16.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---
# 4.4. Categorification
+++
![x](raster/2023-08-12T14-27-59.png)
+++
See also [Categorification](https://en.wikipedia.org/wiki/Categorification). This process is about asking where something came from. It's creative; in the sense of imagination being better than knowledge it asks you to come up with many possible models, many possible worlds, such as the quantum mechanics model. It's telling an origin myth (aition) in terms of mathematics. As the author mentions there is no bottom, just like there is no end to the turtles in the classic aition. From the Wikipedia article:
> Categorification and decategorification are not precise mathematical procedures, but rather a class of possible analogues. They are used in a similar way to the words like 'generalization', and not like 'sheafification'.
+++
## 4.4.1. The basic idea of categorification
+++
![x](raster/2023-08-12T14-29-49.png)
+++
![x](raster/2023-08-12T14-34-08.png)
+++
## 4.4.2. A reflection on wiring diagrams
+++
![x](raster/2023-08-12T14-41-15.png)
+++
![x](raster/2023-08-12T14-44-58.png)
+++
![x](raster/2023-08-12T14-46-42.png)
+++
## 4.4.3. Monoidal categories
+++
![x](raster/2023-08-12T14-58-55.png)
+++
### Rough Definition 4.45.
+++
![x](raster/2023-08-12T15-08-11.png)
+++
See also [Monoidal category](https://en.wikipedia.org/wiki/Monoidal_category), though we've jumped to [Symmetric monoidal category](https://en.wikipedia.org/wiki/Symmetric_monoidal_category) (see also [symmetric monoidal category](https://ncatlab.org/nlab/show/symmetric+monoidal+category)). What makes this definition "rough" is that the author has decided to ignore all the coherence conditions (triangle, pentagon, hexagon, etc.).
+++
![x](raster/2023-08-12T15-18-21.png)
+++
### Exercise 4.48.
+++
![x](raster/2023-08-12T15-26-24.png)
+++
Let's recall the definition:
+++
![x](raster/2023-08-12T15-46-45.png)
+++
The `(i)` constituent roughly remains the same, with a singular identity "element" replaced by an identity "object" (such as a singleton set). An object here is a generalization of an element.
In `(ii)` we generalize a function for β to a functor. This functor β is from π Γ π β π, where π is a preorder. The left hand side of this functor (π Γ π) is a product of preorders (see Example 1.56) where $(pβ,pβ) β€ (qβ,qβ)$ if $pβ β€ qβ$ and $pβ β€ qβ$. So for β to be a functor (preserve composition) i.e. a monotone map we must have that whenever $(pβ,pβ) β€ (qβ,qβ)$ (i.e. $pβ β€ qβ$ and $pβ β€ qβ$) we also have $pββpβ β€ qββqβ$. This is exactly the requirement of `(a)` in Definition 2.2. The same point is made in [Monoidal category Β§ Monoidal preorders](https://en.wikipedia.org/wiki/Monoidal_category#Monoidal_preorders) under:
> Furthermore, the fact that Β· is required to be a functor meansβin the present case, where C is a preorderβnothing more than the following:
>
> if $c_1\to c_1'$ and $c_2\to c_2'$ then $(c_1\cdot c_2)\to (c_1'\cdot c_2')$
Part `(b)` of Definition 2.2. is generalized from two equations to the two natural isomorphisms listed in `(a)` and `(b)` in Rough Definition 4.45. That is, we must add two natural isomorphisms to allow for "flexibility" in how I β c is "equivalent" to c. Said another way, these two objects are equivalent "up to isomorphism" i.e. only with `β
` rather than `=`. For an example of this with respect to identities see the last paragraph of Example 4.49.
Part `(c)` of Definition 2.2. is again generalized from a single equation to a single natural isomorphism in part `(c)` of Rough Definition 4.45. An example of this is discussed in the paragraphs above Rough Definition 4.45.
Part `(d)` of Definition 2.2. is again generalized from a single equation to a single natural isomorphism in part `(d)` of Rough Definition 4.45.
+++
### Example 4.49.
+++
![x](raster/2023-08-12T15-58-30.png)
+++
### Exercise 4.50.
+++
![x](raster/2023-08-12T16-35-23.png)
```{code-cell} ipython3
f_C = lambda a: abs(a)
f_D = lambda a: a*5
g_E = lambda d,b: d <= b
g_F = lambda d,b: d - b
h = lambda c,e: c if e else 1 - c
```
```{code-cell} ipython3
g_E(5,3), g_F(5,3)
```
```{code-cell} ipython3
g_E(3,5), g_F(3,5)
```
```{code-cell} ipython3
h(5,True)
```
```{code-cell} ipython3
h(-5,True)
```
```{code-cell} ipython3
h(-5,False)
```
```{code-cell} ipython3
q_G = lambda a,b: h(f_C(a), g_E(f_D(a), b))
q_F = lambda a,b: g_F(f_D(a), b)
```
```{code-cell} ipython3
q_G(-2,3), q_F(-2,3)
```
```{code-cell} ipython3
q_G(2,3), q_F(2,3)
```
## 4.4.4. Categories enriched in a symmetric monoidal category
+++
![x](raster/2023-08-12T16-52-35.png)
+++
See also [Closed monoidal category](https://en.wikipedia.org/wiki/Closed_monoidal_category) and [Enriched category](https://en.wikipedia.org/wiki/Enriched_category).
+++
### Rough Definition 4.51.
+++
![x](raster/2023-08-12T16-55-10.png)
+++
### Exercise 4.52.
+++
![x](raster/2023-08-12T16-55-46.png)
+++
Let's recall Definition 3.6:
+++
![x](raster/2023-08-12T17-16-18.png)
+++
The constituent `(i)` is the exact same between the two definitions. The constituent `(ii)` is a simple generalization in Rough Definition 4.51; when we apply π₯ = (**Set**, {1}, Γ) the *hom-object* becomes a *hom-set*.
Regarding `(iii)`, in Definition 3.6 the identity morphism was part of the set $\mathcal{X}(x,x)$ and conceptualized as being on $x$. In Rough Definition 4.51 it's a morphism in π₯ = (**Set**, {1}, Γ) from {1} to $\mathcal{X}(x,x)$. A morphism in **Set** is a function. A function from {1} to some (presumably larger) set then "selects" an object from that set, in this case selecting one morphism from a set of morphisms.
It looks like `(iv)` is essentially the same. In Definition 3.6 we enumerate all morphisms $f$ and $g$ associated with three objects, while in Rough Definition 4.51 we take the cartesian product of all morphisms between the first/second and second/third objects. We should get the same answer either way.
+++
### Remark 4.53.
+++
Recalling the definition:
+++
![x](raster/2023-08-12T17-40-30.png)
+++
![x](raster/2023-08-12T17-32-12.png)
+++
### Exercise 4.54.
+++
![x](raster/2023-08-12T17-34-47.png)
+++
In a **Cost**-category the identity element and the top element are the same: 0. The identity elements of a category enriched in **Cost** are $id_x: I β \mathcal{X}(x,x)$ or when specializing to a preorder the arrows $I \leq \mathcal{X}(x,x)$. As explained in the text above this exercise, a preorder always has at most one morphism between any two objects. The $I \leq \mathcal{X}(x,x)$ requirement is effectively that there is one element rather than zero.
The requirement that $I \leq \mathcal{X}(x,x)$ in Definition 2.46 translates to $0 \geq \mathcal{X}(x,x)$ in a **Cost**-enriched category because **Cost** = ([0,β],β₯,0,+). In **Cost** there are no arrows up from the top however. This constrains the $id_x$ for all $x$ to the identity element on zero in **Cost**; this is the only morphism from the $I$ in **Cost** (i.e. 0) to any other element in **Cost**.
Conceptually, it makes sense that the distance from any object to itself is zero.
+++
```{admonition} Reveal 7S answer
:class: dropdown
![x](raster/2023-08-12T18-05-33.png)
```