$$ \mathbb{B} = \{ \tt{true}, \tt{false} \} . $$

This set becomes a poset where \(\tt{false}\leq\tt{false}\), \(\tt{false}\leq\textrm{true}\), and \(\tt{true}\leq\tt{true}\), but \(\tt{true}\not\leq\tt{false}\). In other words \(A\leq B\) in the poset if \(A\) implies \(B\), often denoted \(A\implies B\).

In any poset \(A \vee B\) stands for the **join** of \(A\) and \(B\): the least element of the poset that is greater than both \(A\) and \(B\). The join may not exist, but it is unique.

In the poset \(\mathbb{B}\), what is

- \(\tt{true}\lor\tt{false}\)?
- \(\tt{false}\lor\tt{true}\)?
- \(\tt{true}\lor\tt{true}\)?
- \(\tt{false}\lor\tt{false}\)?

(This question only makes sense if you read the book!)

]]>*order-preserving*if \(x\leq y\) implies \(f(x)\leq f(y)\), for all \(x,y\in\mathbb{R}\);*metric-preserving*if \(|x-y|=|f(x)-f(y)|\);*addition-preserving*if \(f(x+y)=f(x)+f(y)\).

In each of the three cases above, find an \(f\) that is *foo*-preserving and an example of an \(f\) that is not *foo*-preserving.

The sample instance \( I : \mathcal{G} \rightarrow \textbf{Set} \). [ \begin{matrix} \begin{array}{c | c c } \text{Email} & \text{sent_by} & \text{received_by} \\ \hline \text{Em_1} & \tt{Bob} & \tt{Grace} \\ \text{Em_2} & \tt{Grace} & \tt{Pat} \\ \text{Em_3} & \tt{Bob} & \tt{Emory} \\ \text{Em_4} & \tt{Sue} & \tt{Doug} \\ \text{Em_5} & \tt{Doug} & \tt{Sue} \\ \text{Em_6} & \tt{Bob} & \tt{Bob} \end{array} & \begin{array}{c | } \tt{Address} \\ \hline \tt{Bob} \\ \tt{Doug} \\ \tt{Emory} \\ \tt{Grace} \\ \tt{Pat} \\ \tt{Sue} \end{array} \end{matrix} ]

]]>- Draw a picture of the unit corelation \(\varnothing\to\ul{3}\sqcup\ul{3}\).
- Draw a picture of the counit corelation \(\ul{3}\sqcup\ul{3}\to\varnothing\).
- Check that the snake equations \eqref{eqn.yanking} hold. (Since every object is its own dual, you only need to check one of them.)

For every \(c\in\mathrm{Ob}(\mathcal{C})\)
[\require{AMScd}\begin{equation}\label{eqn.yanking}\tag{4.57}\begin{CD}c @= c\@V{\cong}VV {}@AA{\cong}A\c{\otimes}I @. I{\otimes}c\@V{c\otimes\eta_c}VV {}@AA{\epsilon_c\otimes c}A\c\otimes(c^*\otimes c) @>>\cong> (c\otimes c^*)\otimes c\end{CD}\hspace{.8in}\begin{CD}c^* @= c^*\@V{\cong}VV {}@AA{\cong}A\I{\otimes}c^* @. c^*{\otimes}I\@V{\eta_c\otimes c^*}VV {}@AA{c^*\otimes\epsilon_c}A\(c^*\otimes c)\otimes c^* @>>\cong> c^*\otimes(c\otimes c^*)\end{CD}\end{equation}]

Recall from Example 4.47 that \(\cat{V}=(\smset,{1},\times)\) is a
symmetric monoidal category. This means we can apply
Definition \ref{def1}. Does the (rough) definition roughly agree with
the definition of category given in Definition 3.6? Or is there a subtle
difference?
\(\label{def1}\tag{4.49}\)
**Rough Definition 4.49**:

Let \(\cat{V}\) be a symmetric monoidal category, as in Definition 4.43. To
specify a *category enriched in \(\cat{V}\)*, or a *\(\cat{V}\)-category*,
denoted \(\cat{X}\),

- one specifies a collection \(\Ob(\cat{X})\), elements of which are called
*objects*; - for every pair \(x,y\in\Ob(\cat{X})\), one specifies an object \(\cat{X}(x,y)\in\cat{V}\), called the
*hom-object*for \(x,y\); - for every \(x\in\Ob(\cat{X})\), one specifies a morphism \(\id_x\colon I\to\cat{X}(x,x)\) in \(\cat{V}\), called the
*identity element*; - for each \(x,y,z\in\Ob(\cat{X})\), one specifies a morphism \(\cp\colon\cat{X}(x,y)\otimes\cat{X}(y,z)\to\cat{X}(x,z)\), called the
*composition morphism*.

These constituents are required to satisfy the usual associative and unital laws.

]]>Suppose that \(A=B=C=D=F=G=\ZZ\) and \(E=\BB={\true,\false}\), and suppose that \(f_C(a)=|a|\), \(f_D(a)=a*5\), \(g_E(d,b)=d\leq b\), \(g_F(d,b)=d-b\), and \(h(c,e)=\tn{if }e\tn{ then }c\tn{ else }1-c\).

- What are \(g_E(5,3)\) and \(g_F(5,3)\)?
- What are \(g_E(3,5)\) and \(g_F(3,5)\)?
- What is \(h(5,\true)\)?
- What is \(h(-5,\true)\)?
- What is \(h(-5,\false)\)?

The whole diagram now defines a function \(A\times B\to G\times F\); call it \(q\).

- What are \(q_G(-2,3)\) and \(q_F(-2,3)\)?
- What are \(q_G(2,3)\) and \(q_F(2,3)\)?

Show that \(F\) and \(G\) are \(\cat{V}\)-adjoints (as in \ref{eq1}) if and only if the companion of the former equals the conjoint of the latter: \(\comp{F}=\conj{G}\).

Use this to prove that \(\comp{\id}=\conj{\id}\), as was stated in 4.34.

\begin{equation}\label{eq1}\tag{4.39}\cat{P}(p,G(q))\cong\cat{Q}(F(p),q)\end{equation}

]]>Example 4.36:

Consider the function \(+\colon\mathbb{R}\times\mathbb{R}\times\mathbb{R}\to\mathbb{R}\), sending a triple \((a,b,c)\) of real numbers to \(a+b+c\in\mathbb{R}\). This function is monotonic, because if \((a,b,c)\leq(a',b',c')\)---i.e. if \(a\leq a'\) and \(b\leq b'\), and \(c\leq c'\)---then obviously \(a+b+c\leq a'+b'+c'\). Thus it has a companion and a conjoint.

Its companion \(\hat{+}\colon(\mathbb{R}\times\mathbb{R}\times\mathbb{R})\nrightarrow\mathbb{R}\) is the function that sends \((a,b,c,d)\) to \(\mathrm{true}\) if \(a+b+c\leq d\) and to \(\mathrm{false}\) otherwise.

]]>\begin{equation}\label{eq1}\tag{4.25}U_{\mathcal{X}}(x,y):=\mathcal{X}(x,y).\end{equation}

]]>**Lemma 4.30**

Serial composition of profunctors is associative: given profunctors \( \Phi : \mathcal{P} \rightarrow \mathcal{Q} \), \( \Psi : \mathcal{Q} → \mathcal{R} \), and \( \Upsilon : \mathcal{R} → \mathcal{S} \), we have [ (\Phi.\Psi).\Upsilon = \Phi.(\Psi.\Upsilon) ]

]]>2) In the case \( \mathcal{V} = \textbf{Bool} \), we can directly show each of the four steps in Eq. (4.27) is actually an equality. How?

**Equation 4.27**

Φ(p, q) I ⊗ Φ(p, q) ≤ P(p, p) ⊗ Φ(p, q) ≤ Ü P(p, p 1 ) ⊗ Φ(p 1 , q) (U P .Φ)(p, q).

]]>In defining Cat, the category of small categories, Wikipedia states that the terminal object (the terminal category) is the trivial category 1 with a single object and morphism.

Is that trivial category necessarily unique?

In defining Set, the category of sets, Wikipedia states that every singleton is a terminal object.

This seems to be an essential distinction that I wish to voice and discuss. In the case of Cat, we would say that there is only one trivial category because any other such trivial category has the exact same structure and so they are the same. Whereas in the case of Set, we would say that a singleton is defined by the letter, the element that it consists of, such as {a} or {1} or {0}.

But this, I am thinking, is the essential contribution of category theory. Category theory is studying the duality between internal structure and external relationships. And, in principle, the idea would be to restrict our attention to external relationships and to show where and how that is sufficient to deduce internal structure. It's a very typical situation in the real world, where we observe affairs in the real world and try to deduce models of what people are thinking or why they are behaving as they do or what are the physical laws dictating the course of the universe.

However, most of the verbage about category theory ends up being centered on the internal structure, and so it's very hard for a beginner like me to learn to focus just on the external relationships.

From the external point of view, a category is a diagram (of nodes and arrows - they can be labelled for convenience) plus (and this is very important and I am only slowing realizing) a commutative diagram showing which compositions are deemed equivalent (of course, the commutative diagram can typically be described more succinctly than by drawing them all out). The diagram can have unfathomable cardinality but still it's a diagram.

Then a category Set and some other category are the same category if they have the same external relationships, which is to say, the same diagram and the same commutative diagram, which can be labelled the same.

If that's basically correct, then I would find it helpful to have it stated up front in the beginning. It's interesting to think more about what can be garnered from a "mystery" category, as such, just knowing facts about its diagram and commutative diagram. Because it's confusing and misleading to always be told, look at the category of sets, of vector spaces, of abelian groups, of Z, because those are all cases of internal structure. It would seem more relevant, at least pedagogically, to say, here's some facts about a category. What can you say, if anything, about its internal structure? I have an example in mind that I hope to discuss.

Aside from that, I really appreciate starting out with focus on preorders. John, I am very grateful for your explanation of adjoints. It's the first time I have felt that I am understanding it. Thank you!

]]>Show that the set \(\uparrow p:=\{p'\in P\mid p\leq p'\}\) is an upper set, for any \(p\in P\).

Show that this construction defines a monotone map \(\uparrow:P^\mathrm{op}\to\mathcal{U}P\).

Draw a picture of the map \(\uparrow\) in the case where \(P\) is the preorder \((b\geq a\leq c)\) from Exercise 1.48.

Example 1.45:

Given a preorder \((P,\le)\), an *upper set* in \(P\) is a subset \(U\) of \(P\) satisfying the condition that
if \(p \in U\) and \(p \le q\), then \(q \in U\). ``If \(p\) is an element then so is anything bigger.''
Write \(\mathcal U(P)\) for the set of
upper sets in \(P\). We can give the set \(\mathcal{U}\) an order by letting \(U \le V\) if \(U\) is
contained in \(V\).

For example, if \((\mathbb{B},\leq)\) is the booleans (Example 1.33), then its preorder of uppersets \(\mathcal U\mathbb{B}\) is \[\boxed{\begin{matrix}\lbrace\mathrm{false},\mathrm{true}\rbrace\\\uparrow\\\lbrace\mathrm{true}\rbrace\\\uparrow\\\varnothing\end{matrix}}\]

Just \(\{\mathrm{false}\}\) by itself is not an upper set, because \(\mathrm{false}\leq\mathrm{true}\).

]]>(i.) \( Ob(\mathcal{X}^{op}) := Ob(\mathcal{X}) \), and

(ii.) for all \( x, y \in \mathcal{X} \), we have \( \mathcal{X}^{op}(x, y) := \mathcal{X}(y, x) \).

Similarly, we can talk of daggers.
A **dagger structure** on a \(\mathcal{V}\)-category \(\mathcal{X}\) is a functor
\( \dagger : \mathcal{X} \rightarrow \mathcal{X}^{op} \)
that is identity on objects and such that \( \dagger . \dagger = id_\mathcal{X} \) .

Recall that an ordinary metric space \( (X, d) \) is a Lawvere metric space
with some extra properties; see Definition 2.32.
One of these properties is symmetry: \( d(x, y) = d(y, x) \) for every \( x, y \in X \).
What if we have a Lawvere metric space \( (X, d) \) such that the identity
function \( id_X : X \rightarrow X \) is a **Cost**-functor \( (X, d) \rightarrow (X, d)^{op} \) .
Is this exactly the same as the symmetry property?

Show that a skeletal dagger

**Cost**-category is a metric space.Make sense of the following analogy: “preorders are to sets as Lawvere metric spaces are to metric spaces.”

[ \lbrace A_p \rbrace_{ p \in P } ]

and

[ \lbrace A^\prime_{p^\prime} \rbrace_{ p^\prime \in P^\prime } ]

are two partitions of \(A\) such that for each \( p \in P \) there exists a \( p' \in P' \) with \( A_p = A'_{p'} \) .

- Show that for each \( p \in P \) there is at most one \( p' \in P \) such that \( A_p = A'_{p'} \).
- Show that for each \( p' \in P \) there is a \( p \in P \) such that \( A_p = A'_{p'} \) .

**Definition 3.87**

Let \( D : \mathcal{J} \rightarrow \mathcal{C} \) be a diagram.
A *cone* \( (C, c_* ) \) over \(D\) consists of

(i) an object \( C \in Ob(\mathcal{C} \);

(ii) for each object \( j \in Ob(\mathcal{J}) \), a morphism \( c_j : C \rightarrow D(j) \).

To be a cone, these must satisfy the following property:

(a) for each \( f : i \rightarrow j \) in \( \mathcal{J} \) , we have \( c_j = c_i . D( f ) \).

A morphism of cones \( (C, c_* ) \rightarrow (C' , c'_* ) \) is a morphism \( a : C \rightarrow C' \) in \( \mathcal{C} \) such that for all \( j \in \mathcal{J} \) we have \( c_j = a.c'_j \). Cones over \(D\), and their morphisms, form a category \( \textbf{Cone}(D) \).

The *limit* of \(D\), denoted \( lim(D) \), is the terminal object in the category \( \textbf{Cone}(D) \).
Say it is the cone \( lim(D) = (C, c_* ) \); we refer to \(C\) as the *limit object* and
the map \(c_j\) for any \( j \in \mathcal{J} \) as the \(j^{th}\) *projection map*.

- Given a morphism \(f : X \rightarrow Y\), what morphism should \( - \times B : X \times B \rightarrow Y \times B \) return?
- Given a morphism \(f : X \rightarrow Y\), what morphism should \( (−)^B : X^B \rightarrow Y^B \) return?
- Consider the function \(+ : \mathbb{N} \times \mathbb{N} \rightarrow \mathbb{N} \), which sends \( (a, b) \mapsto a + b \). Currying \(+\), we get a certain function \(p : \mathbb{N} → \mathbb{N}^\mathbb{N} \). What is \(p(3)\)?

- What is the other value of \( \alpha_{Arrow}\), and what are the three values of \( \alpha_{Vertex} \)?
- Draw \( \alpha_{Arrow} \) as two lines connecting the cells in the ID column of \(G(Arrow)\) to those in the ID column of \(H(Arrow)\). Similarly, draw \( \alpha_{Vertex} \) as connecting lines.
- Check the source column and target column and make sure that the matches are natural, i.e. that “alpha-then-source equals source-then-alpha” and similarly for “target”.

[ \begin{matrix} G := & & \begin{array}{c|cc} Arrow & source & target \\ \hline a & 1 & 2 \\ b & 2 & 3 \end{array} & & \begin{array}{c|} Vertex \\ \hline 1 \\ 2 \\ 3 \end{array} \\ H := & \begin{array}{c|cc} Arrow & source & target \\ \hline c & 4 & 5 \\ d & 4 & 5 \\ e & 5 & 5 \end{array} & & \begin{array}{c|} Vertex \\ \hline 4 \\ 5 \end{array} & \end{matrix} ]

]]>**Equation 3.2**

- Figure out how to compose natural transformations. (Hint: an expert tells you “for each object \(c \in \mathcal{C}\), compose the \(c\)-components”.)
- Propose an identity natural transformation on any object \(F \in \mathcal{D}^\mathcal{C}\) , and check that it is unital.

**Definition 3.44**
Let \(\mathcal{C}\) and \(\mathcal{D}\) be categories.
We denote by \(\mathcal{D}^\mathcal{C}\) the category whose objects are functors \(F : \mathcal{C} \rightarrow \mathcal{D}\) and whose morphisms \(\mathcal{D}^\mathcal{C}(F, G)\) are the natural transformations \( \alpha : F \rightarrow G\).
This category \(\mathcal{D}^\mathcal{C}\) is called the \(\textit{functor category}\).