Keith wrote:

> I believe Puzzle 162 can be answered the same way using the initial objects and terminal objects of \$$\mathbf{Cat}\$$ and \$$\mathbf{Set}\$$.

I'm not sure how to use this idea, so my attempt takes the long and tedious route.

> **Puzzle 162.** Show that this bijection is natural.

The two functors in question are:

\begin{align} \mathbf{Cat}(\mathrm{Disc}(-), =) &: \mathbf{Set}^{\mathrm{op}} \times \mathbf{Cat} \to \mathbf{Set} \\\\ \mathbf{Set}(-, \mathrm{Ob}(=)) &: \mathbf{Set}^{\mathrm{op}} \times \mathbf{Cat} \to \mathbf{Set}. \end{align}

We will check the naturality of the two functors in both arguments, which are denoted above by \$$-\$$ and \$$=\$$.

First, we show that for any morphism in \$$\mathbf{Cat}\$$, \$$F: \mathcal{C} \to \mathcal{D}\$$ (functor), the following diagram commutes:

$\begin{matrix} \mathbf{Cat}(\mathrm{Disc}(S), \mathcal{C}) & \rightarrow & \mathbf{Cat}(\mathrm{Disc}(S), \mathcal{D}) \\\\ \downarrow & & \downarrow \\\\ \mathbf{Set}(S, \mathrm{Ob}(\mathcal{C})) & \rightarrow & \mathbf{Set}(S, \mathrm{Ob}(\mathcal{D})) \end{matrix}$

Written as an equation, this means:

$\mathbf{Set}(S, \mathrm{Ob}(F)) \circ \alpha_{S,\mathcal{C}} = \alpha_{S,D} \circ \mathbf{Cat}(\mathrm{Disc}(S), F).$

For any functor \$$G : \mathrm{Disc}(S) \to \mathcal{C}\$$, we have:

\begin{align} & (\mathbf{Set}(S, \mathrm{Ob}(F)) \circ \alpha_{S,\mathcal{C}})(G) \\\\ & = \text{{ composition }} \\\\ & \mathbf{Set}(S, \mathrm{Ob}(F))(\alpha_{S,\mathcal{C}}(G)) \\\\ & = \text{{ definition of the hom functor }} \\\\ & \alpha_{S,\mathcal{C}}(G) \circ \mathrm{Ob}(F) \\\\ & = \left\\{ \; \alpha \text{ behaves like Ob on functors } \right\\} \\\\ & \mathrm{Ob}(G) \circ \mathrm{Ob}(F) \\\\ & = \text{{ Ob preserves composition }} \\\\ & \mathrm{Ob}(G \circ F) \\\\ & = \left\\{ \; \alpha \text{ behaves like Ob on functors } \right\\} \\\\ & \alpha_{S,\mathcal{D}}(G \circ F)) \\\\ & = \text{{ definition of the hom functor }} \\\\ & \alpha_{S,\mathcal{D}}(\mathbf{Cat}(\mathrm{Disc}(S), F)(G))) \\\\ & = \text{{ composition }} \\\\ & (\alpha_{S,\mathcal{D}} \circ \mathbf{Cat}(\mathrm{Disc}(S), F))(G). \end{align}

Second, we show that for any morphism in \$$\mathbf{Set}\$$, \$$f: T \to S\$$ (function), the following diagram commutes:

$\begin{matrix} \mathbf{Cat}(\mathrm{Disc}(S), \mathcal{C}) & \rightarrow & \mathbf{Cat}(\mathrm{Disc}(T), \mathcal{C}) \\\\ \downarrow & & \downarrow \\\\ \mathbf{Set}(S, \mathrm{Ob}(\mathcal{C})) & \rightarrow & \mathbf{Set}(T, \mathrm{Ob}(\mathcal{C})) \end{matrix}$

Written as an equation, this means:

$\mathbf{Set}(f, \mathrm{Ob}(\mathcal{C})) \circ \alpha_{S,\mathcal{C}} = \alpha_{T,\mathcal{C}} \circ \mathbf{Cat}(\mathrm{Disc}(f), \mathcal{C}).$

For any functor \$$G : \mathrm{Disc}(S) \to \mathcal{C}\$$, we have:

\begin{align} & (\mathbf{Set}(f, \mathrm{Ob}(\mathcal{C})) \circ \alpha_{S,\mathcal{C}})(G) \\\\ & = \text{{ composition }} \\\\ & \mathbf{Set}(f, \mathrm{Ob}(\mathcal{C}))(\alpha_{S,\mathcal{C}})(G)) \\\\ & = \text{{ definition of the hom functor }} \\\\ & f \circ \alpha_{S,\mathcal{C}}(G) \\\\ & = \left\\{ \; \alpha \text{ behaves like Ob on functors } \right\\} \\\\ & f \circ \mathrm{Ob}(G) \\\\ & = \left\\{ \mathrm{Ob} \circ \mathrm{Disc} = 1 \right\\} \\\\ & \mathrm{Ob}(\mathrm{Disc}(f)) \circ \mathrm{Ob}(G) \\\\ & = \text{{ Ob preserves composition }} \\\\ & \mathrm{Ob}(\mathrm{Disc}(f) \circ G) \\\\ & = \left\\{ \; \alpha \text{ behaves like Ob on functors } \right\\} \\\\ & \alpha_{T,\mathcal{C}}(\mathrm{Disc}(f) \circ G) \\\\ & = \text{{ definition of the hom functor }} \\\\ & \alpha_{T,\mathcal{C}}(\mathbf{Cat}(\mathrm{Disc}(f), \mathcal{C})(G)) \\\\ & = \text{{ composition }} \\\\ & (\alpha_{T,\mathcal{C}} \circ \mathbf{Cat}(\mathrm{Disc}(f), \mathcal{C}))(G). \end{align}