Options

Lecture 68 - Chapter 4: Feedback in Collaborative Design

Last time we began studying feedback in co-design diagrams. This led us into a fascinating topic which we'll explore more deeply today: cups and caps. Ultimately it leads to the subject of 'compact closed' categories, which Fong and Spivak introduce in Section 4.5.1. Covering this material adequately will take longer than the three weeks I'd intended to spend on each chapter, but I think it's worth it.

Last time we saw that for each preorder \(X\) there's a feasibility relation called the cup

$$ \cup_X \colon X^{\text{op}} \times X \nrightarrow \textbf{1} $$ which we draw as follows:

image

To define the cup, we remembered that feasibility relations \(X^{\text{op}} \times X \nrightarrow \textbf{1}\) are monotone functions \( (X^{\text{op}} \times X)^\text{op} \times \textbf{1} \to \mathbf{Bool} \), and we defined \(\cup_X\) to be the composite

$$ (X^{\text{op}} \times X)^\text{op} \times \textbf{1} \stackrel{\sim}{\to} (X^{\text{op}} \times X)^\text{op} \stackrel{\sim}{\to} (X^{\text{op}})^\text{op} \times X^{\text{op}} \stackrel{\sim}{\to} X \times X^{\text{op}} \stackrel{\sim}{\to} X^{\text{op}} \times X \stackrel{\text{hom}}{\to} \textbf{Bool} $$ where all the arrows with little squiggles over them are isomorphisms - most of them discussed in Puzzles 213-215. In short, the cup is the hom-functor \(\text{hom} \colon X^{\text{op}} \times X \to \mathbf{Bool}\) in disguise!

The cup's partner is called the cap

$$ \cap_X \colon \textbf{1} \nrightarrow X \times X^{\text{op}} $$ and we draw it like this:

image

The cap is also the hom-functor in disguise! To define it, remember that feasibility relations \(\textbf{1} \nrightarrow X \times X^{\text{op}} \) are monotone functions \(\textbf{1}^{\text{op}} \times (X \times X^{\text{op}}) \). But \(\textbf{1}^{\text{op}} = \textbf{1}\), so we define the cap to be the compoiste

$$ \textbf{1}^{\text{op}} \times (X \times X^{\text{op}}) = \textbf{1}\times (X \times X^{\text{op}}) \stackrel{\sim}{\to} X \times X^{\text{op}} \stackrel{\sim}{\to} X^{\text{op}} \times X \stackrel{\text{hom}}{\to} \textbf{Bool} . $$ One great thing about the cup and cap is that they let us treat the edges in our co-design diagrams as flexible wires. In particular, they obey the snake equations, also known as the zig-zag identities. These say that we can pull taut a zig-zag of wire.

The first snake equation says

image

In other words,

$$ (1_X \times \cup_X) (\cap_X \times 1_X) = 1_X .$$ Please study the diagram and the corresponding equation very carefully to make sure you see how each part of one corresponds to a part of the other! And please ask questions if there's anything puzzling. It takes a while to get used to these things.

The second snake equation says

image

In other words,

$$ (\cup_X \times 1_{X^{\text{op}}}) (1_{X^{\text{op}}} \times \cap_X) = 1_{X^{\text{op}}} .$$ A great exercise, to make sure you understand what's going on, is to prove the snake equations. You just need to remember all the definition, use them to compute the left-hand side of the identity, and show it equals the much simpler right-hand side.

Puzzle 217. Prove the snake equations.

In fact some of you have already started doing this!

To read other lectures go here.

Comments

  • 1.

    (I think there's a typo in the first snake equation, John – surely it should be cup of \(X^\text{op}\) not cup of \(X\))

    (Also in the second one, shouldn't the arrows in the left hand diagram go the other way? otherwise it's just the first one, but "op".)

    Comment Source:(I think there's a typo in the first snake equation, John – surely it should be cup of \\(X^\text{op}\\) not cup of \\(X\\)) (Also in the second one, shouldn't the arrows in the left hand diagram go the other way? otherwise it's just the first one, but "op".)
  • 2.

    (Also in the second one, shouldn't the arrows in the left hand diagram go the other way? otherwise it's just the first one, but "op".)

    I think that's the point.

    Comment Source:>(Also in the second one, shouldn't the arrows in the left hand diagram go the other way? otherwise it's just the first one, but "op".) I think that's the point.
  • 3.

    shouldn't the diagram on the right of the second snake equation be flipped around to \(X^{op}\)?

    Comment Source:shouldn't the diagram on the right of the second snake equation be flipped around to \\(X^{op}\\)?
  • 4.

    hmm, I'd have thought the second snake equation should be an independent fact in its own right rather than merely the result of applying op to the first.

    I think it should look like this (apologies for the hand drawn picture!):

    second-snake

    Comment Source:hmm, I'd have thought the second snake equation should be an independent fact in its own right rather than merely the result of applying op to the first. I think it should look like this (apologies for the hand drawn picture!): ![second-snake](https://i.imgur.com/sydXrFJ.jpg)
  • 5.

    Michael wrote:

    shouldn't the diagram on the right of the second snake equation be flipped around to \(X^{\text{op}}\)?

    Yes, that was a cut-and-paste error... I was getting sleepy!

    Comment Source:Michael wrote: > shouldn't the diagram on the right of the second snake equation be flipped around to \\(X^{\text{op}}\\)? Yes, that was a cut-and-paste error... I was getting sleepy!
  • 6.
    edited July 31

    There are even worse mistakes in the pictures; I'll fix them pretty soon. There are certain arbitrary conventions in this game, but one should handle them consistently and I didn't. It's easy to get the conventions right when I'm writing things on paper and can look at all the diagrams at once, but it's harder when I'm drawing diagrams in LaTeX, using Irfanview to create png files from them, and writing a lecture in LaTeX on the forum, which I can only look at when it's done!

    Now you folks are exploring the various subtleties of this subject and seeing how tricky it is. I'll let you know when I fix this lecture; then everything should make sense!

    Comment Source:There are even worse mistakes in the pictures; I'll fix them pretty soon. There are certain arbitrary conventions in this game, but one should handle them consistently and I didn't. It's easy to get the conventions right when I'm writing things on paper and can look at all the diagrams at once, but it's harder when I'm drawing diagrams in LaTeX, using Irfanview to create png files from them, and writing a lecture in LaTeX on the forum, which I can only look at when it's done! Now you folks are exploring the various subtleties of this subject and seeing how tricky it is. I'll let you know when I fix this lecture; then everything should make sense!
  • 7.
    edited July 31

    Okay! I think I've got this lecture fixed, with consistent conventions.

    • The cup:

    $$ \cup_X \colon X^{\text{op}} \times X \nrightarrow \textbf{1} $$

    image
    • The cap:

    $$ \cap_X \colon \textbf{1} \nrightarrow X \times X^{\text{op}} $$

    image

    These conventions are different than the book's, because in the book's discussion of compact closed categories they use a 'unit' which corresponds to a cup \( \cup_X \colon X \times X^{\text{op}} \nrightarrow \textbf{1} \) and a 'counit' which corresponds to a cap \( \cap_X \colon \textbf{1} \nrightarrow X^{\text{op}} \times X \). These are equally consistent convention, but much less commonly used in the category theory literature, for good reasons I won't explain now, so I think it's better for us to use the more standard ones.

    Either way, the snake equations are then the two equations one can write down using \(\cap_X\) and \(\cup_X\). For me they are:

    • The first snake equation:

    $$ (1_X \times \cup_X) (\cap_X \times 1_X) = 1_X .$$

    image
    • The second snake equation:

    $$ (\cup_X \times 1_{X^{\text{op}}}) (1_{X^{\text{op}}} \times \cap_X) = 1_{X^{\text{op}}} .$$

    image
    Comment Source:Okay! I think I've got this lecture fixed, with consistent conventions. * The cup: \[ \cup_X \colon X^{\text{op}} \times X \nrightarrow \textbf{1} \] <center><img width = "120" src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/cup.png"></center> * The cap: \[ \cap_X \colon \textbf{1} \nrightarrow X \times X^{\text{op}} \] <center><img width = "120" src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/cap.png"></center> These conventions are different than the book's, because in the book's discussion of compact closed categories they use a 'unit' which corresponds to a cup \\( \cup_X \colon X \times X^{\text{op}} \nrightarrow \textbf{1} \\) and a 'counit' which corresponds to a cap \\( \cap_X \colon \textbf{1} \nrightarrow X^{\text{op}} \times X \\). These are equally consistent convention, but much less commonly used in the category theory literature, for good reasons I won't explain now, so I think it's better for us to use the more standard ones. Either way, the snake equations are then the two equations one can write down using \\(\cap_X\\) and \\(\cup_X\\). For me they are: * The first snake equation: \[ (1\_X \times \cup\_X) (\cap\_X \times 1_X) = 1\_X .\] <center><img src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/zigzag_1.png"></center> * The second snake equation: \[ (\cup_X \times 1\_{X^{\text{op}}}) (1\_{X^{\text{op}}} \times \cap_X) = 1_{X^{\text{op}}} .\] <center><img src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/zigzag_2.png"></center>
  • 8.
    edited July 31

    Don't we want to show something like,

    \[ (\hom^{op}(x,x) \times 1_X)(1_X \times \hom(x,x))\\ \cong (1^{op}_X \times 1_X)\hom(x,x)\\ \cong 1_X \]

    Or in pretty pictures,

    image
    Comment Source:Don't we want to show something like, \\[ (\hom^{op}(x,x) \times 1\_X)(1\_X \times \hom(x,x))\\\\ \cong (1^{op}\_X \times 1\_X)\hom(x,x)\\\\ \cong 1\_X \\] Or in pretty pictures, <center> <img src="https://i.imgur.com/2FlgfFQ.png" /> </center>
  • 9.
    edited July 31

    Keith - the middle diagram in your trio of diagrams can't equal the other two, because its top and bottom look different from the other two. It shows a feasibility relation going from 'nothing' (namely \(\textbf{1}\)) to \( X \times X^{\text{op}}\) (or maybe \( X^{\text{op}} \times X\), depending on your conventions) while the other two show feasibility relations going from \(X\) to \(X\).

    Your equations don't make sense to me. Take \( \text{hom}^{\text{op}}(x,x) \times 1_X\), for example. \(1_X\) could be the name for a feasibility relation from \(X\) to \(X\), or it could be the name for a monotone function from \(X\) to \(X\). I don't know which since you didn't say which category these equations are describing morphisms in.

    I don't know what \(\text{hom}^{\text{op}}(x,x)\) means, or what particular value of \(x\) you're talking about. No matter what guess I make, I'm having trouble seeing what \(\text{hom}^{\text{op}}(x,x) \times 1_X\) is supposed to mean.

    Hmm, maybe you are using \(\text{hom}^{\text{op}}(x,x)\) as a name for the hom-functor for \( X^{\text{op}}\). It that's what you mean, call it \(\text{hom}\), or better \( \text{hom}_{X^{\text{op}}}\) to indicate which preorder it's the hom-functor of.

    There's a hom-functor

    $$ \text{hom}_X : X^{\text{op}} \times X \to \mathbf{Bool}, $$ and similarly a hom-functor

    $$ \text{hom}_{X^{\text{op}}} : (X^{\text{op}})^{\text{op}} \times X^{\text{op}} \to \mathbf{Bool}, $$ or

    $$ \text{hom}_{X^{\text{op}}} : X \times X^{\text{op}} \to \mathbf{Bool} $$ for short.

    Comment Source:Keith - the middle diagram in your trio of diagrams can't equal the other two, because its top and bottom look different from the other two. It shows a feasibility relation going from 'nothing' (namely \\(\textbf{1}\\)) to \\( X \times X^{\text{op}}\\) (or maybe \\( X^{\text{op}} \times X\\), depending on your conventions) while the other two show feasibility relations going from \\(X\\) to \\(X\\). Your equations don't make sense to me. Take \\( \text{hom}^{\text{op}}(x,x) \times 1_X\\), for example. \\(1_X\\) could be the name for a feasibility relation from \\(X\\) to \\(X\\), or it could be the name for a monotone function from \\(X\\) to \\(X\\). I don't know which since you didn't say which category these equations are describing morphisms in. I don't know what \\(\text{hom}^{\text{op}}(x,x)\\) means, or what particular value of \\(x\\) you're talking about. No matter what guess I make, I'm having trouble seeing what \\(\text{hom}^{\text{op}}(x,x) \times 1_X\\) is supposed to mean. Hmm, maybe you are using \\(\text{hom}^{\text{op}}(x,x)\\) as a name for the hom-functor for \\( X^{\text{op}}\\). It that's what you mean, call it \\(\text{hom}\\), or better \\( \text{hom}_{X^{\text{op}}}\\) to indicate which preorder it's the hom-functor of. There's a hom-functor \[ \text{hom}\_X : X^{\text{op}} \times X \to \mathbf{Bool}, \] and similarly a hom-functor \[ \text{hom}_{X^{\text{op}}} : (X^{\text{op}})^{\text{op}} \times X^{\text{op}} \to \mathbf{Bool}, \] or \[ \text{hom}_{X^{\text{op}}} : X \times X^{\text{op}} \to \mathbf{Bool} \] for short.
  • 10.
    edited August 2

    First snake equation.

    We can show that the diagrams for the snake equation are equal in terms of feasibility relations by expanding the right hand side (RHS) and showing it equals the identity on \(X\).

    $$ \left(1_X \times \cup_X \right)\left(\cap_X \times 1_X\right) = 1_X $$ Each of these definitions a function from the product of their inputs and outputs to \(\mathbf{Bool}\).

    The first part is cap and the identity: \((\cap_X \times 1_X ) : 1 \times X \nrightarrow X \times X^\mathrm{op} \times X\) $$(\cap_X \times 1_X )((\bullet,x),(x',x^\ast,x'')) = (x^\ast \le x') \ \mathrm{and} \ (x \le x'') $$ where \(\bullet \in 1\).

    Dually, we get \((1_X \times \cup_X ) : X \times X^\mathrm{op} \times X \nrightarrow X \times 1\) $$(1_X \times \cup_X )((x',x^\ast,x''),(x,\bullet)) = (x'' \le x^\ast) \ \mathrm{and} \ (x' \le x) $$ Composing, we get $$ (1_X \times \cup_X ) (\cap_X \times 1_X )((\bullet,x),(x,\bullet)) = x \le x'' \le x^\ast \le x' \le x $$ where the composite is true only if we can find one \(x'',x^\ast,x'\) in \(X\) such that \(x\le x\), but this is always true since we can set \(x = x' = x'' = x^\ast\).

    Therefore \((1_X \times \cup_X ) (\cap_X \times 1_X ) \simeq 1_X\). Equality holds if \(X \otimes 1 = X = 1 \otimes X\) because \((1_X \times \cup_X ) (\cap_X \times 1_X ) : 1\otimes X \nrightarrow X \otimes 1 \).

    Second snake equation

    Same as above, but with opposite preorders (i.e., turn the arrows around).

    $$ (1_{X^\mathrm{op}} \times \cap_{X^\mathrm{op}})((x,\bullet),(x',x^\ast,x'')) = x'' \le x^\ast \ \mathrm{and} \ x' \le x $$ and

    $$ (\cup_{X^\mathrm{op}} \times 1_{X^\mathrm{op}})((x',x^\ast,x''),(\bullet,x)) = x^\ast \le x' \ \mathrm{and} \ x \le x'' $$ Composing gives $$ (\cup_{X^\mathrm{op}} \times 1_{X^\mathrm{op}})(1_{X^\mathrm{op}} \times \cap_{X^\mathrm{op}})((x,\bullet),(\bullet,x)) = x \le x'' \le x^\ast \le x' \le x $$ for some choice of \(x'',x^\ast,x'\) in \(X\), but again this is always possible since we can choose \(x = x' = x'' = x^\ast\).

    This composite behaves the same as the identity on \(X^\mathrm{op}\), the dual object of \(X\).

    Edits: Changed the name of the element in 1 from 1 to \(\bullet\). Also see Yoav's comment since I only prove that the two profunctors are equal along their diagonal.

    Comment Source:**First snake equation**. We can show that the diagrams for the snake equation are equal in terms of feasibility relations by expanding the right hand side (RHS) and showing it equals the identity on \\(X\\). \[ \left(1_X \times \cup_X \right)\left(\cap_X \times 1_X\right) = 1_X \] Each of these definitions a function from the product of their inputs and outputs to \\(\mathbf{Bool}\\). The first part is cap and the identity: \\((\cap_X \times 1_X ) : 1 \times X \nrightarrow X \times X^\mathrm{op} \times X\\) \[(\cap_X \times 1_X )((\bullet,x),(x',x^\ast,x'')) = (x^\ast \le x') \ \mathrm{and} \ (x \le x'') \] where \\(\bullet \in 1\\). Dually, we get \\((1_X \times \cup_X ) : X \times X^\mathrm{op} \times X \nrightarrow X \times 1\\) \[(1_X \times \cup_X )((x',x^\ast,x''),(x,\bullet)) = (x'' \le x^\ast) \ \mathrm{and} \ (x' \le x) \] Composing, we get \[ (1_X \times \cup_X ) (\cap_X \times 1_X )((\bullet,x),(x,\bullet)) = x \le x'' \le x^\ast \le x' \le x \] where the composite is true only if we can find one \\(x'',x^\ast,x'\\) in \\(X\\) such that \\(x\le x\\), but this is always true since we can set \\(x = x' = x'' = x^\ast\\). Therefore \\((1_X \times \cup_X ) (\cap_X \times 1_X ) \simeq 1_X\\). Equality holds if \\(X \otimes 1 = X = 1 \otimes X\\) because \\((1_X \times \cup_X ) (\cap_X \times 1_X ) : 1\otimes X \nrightarrow X \otimes 1 \\). **Second snake equation** Same as above, but with opposite preorders (i.e., turn the arrows around). \[ (1_{X^\mathrm{op}} \times \cap_{X^\mathrm{op}})((x,\bullet),(x',x^\ast,x'')) = x'' \le x^\ast \ \mathrm{and} \ x' \le x \] and \[ (\cup_{X^\mathrm{op}} \times 1_{X^\mathrm{op}})((x',x^\ast,x''),(\bullet,x)) = x^\ast \le x' \ \mathrm{and} \ x \le x'' \] Composing gives \[ (\cup_{X^\mathrm{op}} \times 1_{X^\mathrm{op}})(1_{X^\mathrm{op}} \times \cap_{X^\mathrm{op}})((x,\bullet),(\bullet,x)) = x \le x'' \le x^\ast \le x' \le x \] for some choice of \\(x'',x^\ast,x'\\) in \\(X\\), but again this is always possible since we can choose \\(x = x' = x'' = x^\ast\\). This composite behaves the same as the identity on \\(X^\mathrm{op}\\), the dual object of \\(X\\). **Edits:** Changed the name of the element in 1 from 1 to \\(\bullet\\). Also see Yoav's comment since I only prove that the two profunctors are equal along their diagonal.
  • 11.

    Scott, your snake equation proof looks good, except that you only show that the two profunctors are equal along the diagonal. That is, you only show that for all \(x\), $$ (1_X \times \cup_X ) (\cap_X \times 1_X )((1,x),(x,1)) = 1_X(x,x) $$ You need to show that for all \(x,\tilde{x}\), $$ (1_X \times \cup_X ) (\cap_X \times 1_X )((1,x),(\tilde{x},1)) = 1_X(x,\tilde{x}). $$ Replacing \(x\) by \(\tilde{x}\) in the appropriate places in your proof, you get that \((1_X \times \cup_X ) (\cap_X \times 1_X )((1,x),(\tilde{x},1))\) if and only if there exist \(x'', x^*, x'\) such that \(x\le x'' \le x^* \le x' \le \tilde{x}\), and of course this hold if and only if \(x\le\tilde{x}\) or in other words \(1_X(x,\tilde{x})\).

    On a stylistic note, I think 0 is better than 1 as the name for the only element in \(\mathbf{1}\), as John used in the last lecture. I've seen others here use a bullet or star symbol, which I think are also better than 1.

    Comment Source:Scott, your snake equation proof looks good, except that you only show that the two profunctors are equal along the diagonal. That is, you only show that for all \\(x\\), \[ (1_X \times \cup_X ) (\cap_X \times 1_X )((1,x),(x,1)) = 1_X(x,x) \] You need to show that for all \\(x,\tilde{x}\\), \[ (1_X \times \cup_X ) (\cap_X \times 1_X )((1,x),(\tilde{x},1)) = 1_X(x,\tilde{x}). \] Replacing \\(x\\) by \\(\tilde{x}\\) in the appropriate places in your proof, you get that \\((1_X \times \cup_X ) (\cap_X \times 1_X )((1,x),(\tilde{x},1))\\) if and only if there exist \\(x'', x^*, x'\\) such that \\(x\le x'' \le x^* \le x' \le \tilde{x}\\), and of course this hold if and only if \\(x\le\tilde{x}\\) or in other words \\(1_X(x,\tilde{x})\\). On a stylistic note, I think 0 is better than 1 as the name for the only element in \\(\mathbf{1}\\), as John used in the last lecture. I've seen others here use a bullet or star symbol, which I think are also better than 1.
  • 12.
    edited August 2

    Thanks Yoav, I think I forgot the definition of the identity profunctor and was thinking it imposed equality between inputs and outputs, but of course that violates the definition of a profunctor.

    On a stylistic note, I think 0 is better than 1 as the name for the only element in 1, as John used in the last lecture. I've seen others here use a bullet or star symbol, which I think are also better than 1.

    I couldn't remember and got lazy so I didn't look up what we had used before. I'll change that

    Comment Source:Thanks Yoav, I think I forgot the definition of the identity profunctor and was thinking it imposed equality between inputs and outputs, but of course that violates the definition of a profunctor. > On a stylistic note, I think 0 is better than 1 as the name for the only element in 1, as John used in the last lecture. I've seen others here use a bullet or star symbol, which I think are also better than 1. I couldn't remember and got lazy so I didn't look up what we had used before. I'll change that
  • 13.

    Had a couple of thoughts on how these string diagrams of profunctors actually work.

    My initial instinct was to think of a profunctor \(\Phi : X \nrightarrow Y\) as a "box", with a "wire" coming in on the left and another "wire" going out on the right:

    image

    These boxes can be connected together end-to-end, which corresponds to composing profunctors:

    image

    They can also stacked vertically, which corresponds to tensoring profunctors:

    image

    (Of course we need to prove that "connecting" and "stacking" commute, i.e.

    $$(\Psi\circ\Phi)\otimes(\Psi'\circ\Phi') = (\Psi\otimes\Psi')\circ(\Phi\otimes\Phi'), $$ but that's pretty straightforward once you notice that \(\otimes\) distributes over arbitrary joins in a quantale.)

    However, I'm now thinking this "box" intuition is slightly misleading. We've seen how a profunctor \(\Phi : X \nrightarrow Y\) can equally well be written as a profunctor \(Y^\text{op} \times X \nrightarrow \textbf{1}\), or \(\textbf{1} \nrightarrow Y \times X^\text{op}\), or \(Y^\text{op} \nrightarrow X^\text{op}\). Which suggests these boxes are all equally good representations of \(\Phi\):

    image

    So really it doesn't matter which "side" the wires go into or out of the box. All that matters is the direction, in or out.

    This suggests we ought to think of profunctors not as boxes, but rather as blobs with inputs and outputs.

    image

    Composition means connecting the output of one blob to the input of another. Tensoring means gathering together a bunch of blobs into one:

    image

    But the "horizontal v vertical" or "left to right" aspects of string diagrams – at least for profunctors – turn out to be irrelevant.

    Comment Source:Had a couple of thoughts on how these string diagrams of profunctors actually work. My initial instinct was to think of a profunctor \\(\Phi : X \nrightarrow Y\\) as a "box", with a "wire" coming in on the left and another "wire" going out on the right: <center><img src="https://i.imgur.com/9r8wboJ.png"></center> These boxes can be connected together end-to-end, which corresponds to composing profunctors: <center><img src="https://i.imgur.com/FZKUsVv.png"></center> They can also stacked vertically, which corresponds to tensoring profunctors: <center><img src="https://i.imgur.com/zUgpafv.png"></center> (Of course we need to prove that "connecting" and "stacking" commute, i.e. \[(\Psi\circ\Phi)\otimes(\Psi'\circ\Phi') = (\Psi\otimes\Psi')\circ(\Phi\otimes\Phi'), \] but that's pretty straightforward once you notice that \\(\otimes\\) distributes over arbitrary joins in a quantale.) However, I'm now thinking this "box" intuition is slightly misleading. We've seen how a profunctor \\(\Phi : X \nrightarrow Y\\) can equally well be written as a profunctor \\(Y^\text{op} \times X \nrightarrow \textbf{1}\\), or \\(\textbf{1} \nrightarrow Y \times X^\text{op}\\), or \\(Y^\text{op} \nrightarrow X^\text{op}\\). Which suggests these boxes are all equally good representations of \\(\Phi\\): <center><img src="https://i.imgur.com/yh6BAqG.png"></center> So really it doesn't matter which "side" the wires go into or out of the box. All that matters is the direction, in or out. This suggests we ought to think of profunctors not as boxes, but rather as blobs with inputs and outputs. <center><img src="https://i.imgur.com/RcWbzjT.png"></center> Composition means connecting the output of one blob to the input of another. Tensoring means gathering together a bunch of blobs into one: <center><img src="https://i.imgur.com/AYGEndl.png"></center> But the "horizontal v vertical" or "left to right" aspects of string diagrams – at least for profunctors – turn out to be irrelevant.
  • 14.

    @Anindya Thank you for the "blob diagrams"! They make a lot sense to me. And it seems in their case there is no need to introduce the special feedback feasibility relations – the cap and cup profunctors are the identity blob, with \(X\) as both input and output.

    Comment Source:@Anindya Thank you for the "blob diagrams"! They make a lot sense to me. And it seems in their case there is no need to introduce the special feedback feasibility relations – the cap and cup profunctors are the identity blob, with \\(X\\) as both input and output.
  • 15.

    yes. just to clarify – all of the above assumes that we've proved all the snake equations. these basically tell us that it doesn't matter which "side of box" wires enter or exit from, and that our wires are "floppy" in that we can introduce or remove snakey bends at will.

    Comment Source:yes. just to clarify – all of the above assumes that we've proved all the snake equations. these basically tell us that it doesn't matter which "side of box" wires enter or exit from, and that our wires are "floppy" in that we can introduce or remove snakey bends at will.
  • 16.

    Does that reduce the string diagrams to Directed graphs?

    Comment Source:Does that reduce the string diagrams to Directed graphs?
  • 17.

    thing is directed graphs have loops in them, but I'm a bit unsure what it would mean to plug the output of a blob directly into one of its inputs. for instance suppose you had \(\Phi : X \nrightarrow Y\) and \(\Psi : Y \nrightarrow Z\) – you could tensor them to give \(\Phi \otimes \Psi : X \times Y \nrightarrow Y \times Z\) – and maybe if you "loop" by plugging the output \(Y\) into the input, you'd get plain old \(\Psi\circ\Phi : X \nrightarrow Z\)? but I'm just speculating here.

    Comment Source:thing is directed graphs have loops in them, but I'm a bit unsure what it would mean to plug the output of a blob directly into one of its inputs. for instance suppose you had \\(\Phi : X \nrightarrow Y\\) and \\(\Psi : Y \nrightarrow Z\\) – you could tensor them to give \\(\Phi \otimes \Psi : X \times Y \nrightarrow Y \times Z\\) – and maybe if you "loop" by plugging the output \\(Y\\) into the input, you'd get plain old \\(\Psi\circ\Phi : X \nrightarrow Z\\)? but I'm just speculating here.
  • 18.
    edited August 2

    I think that's right, looping an output into an input works like this: Let \(f : X \otimes Y \nrightarrow Z \otimes Y\). Tensoring and composing with cap, cup, and identity profunctors allows you to feed the \(Y\) output into the \(Y\) input, and get a new profunctor via the composition rule. So if \(f^\star : X \nrightarrow Y\) is that profunctor, then it's definition is

    $$f^\star(x,z) = \begin{cases} f((x,y),(z,y')) & \mathrm{if} \ y \le y' \ \text{for any} \ y,y' \in Y \\ \mathrm{false} & \mathrm{otherwise} \end{cases}$$ So basically, unless \(f\) requires less \(Y\) than it produces, you don't get a non-trivial profunctor \(f^\star:X \nrightarrow Z\). For any pair \((x,z)\), \(f^\star\) would return false. If \(f\) does require less \(Y\) then it produces, then it reduces to asking whether you can get \(x\) given \(z\), so you can simply forget about \(Y\) inputs and outputs.

    Comment Source:I think that's right, looping an output into an input works like this: Let \\(f : X \otimes Y \nrightarrow Z \otimes Y\\). Tensoring and composing with cap, cup, and identity profunctors allows you to feed the \\(Y\\) output into the \\(Y\\) input, and get a new profunctor via the composition rule. So if \\(f^\star : X \nrightarrow Y\\) is that profunctor, then it's definition is \[f^\star(x,z) = \begin{cases} f((x,y),(z,y')) & \mathrm{if} \ y \le y' \ \text{for any} \ y,y' \in Y \\\ \mathrm{false} & \mathrm{otherwise} \end{cases}\] So basically, unless \\(f\\) requires less \\(Y\\) than it produces, you don't get a non-trivial profunctor \\(f^\star:X \nrightarrow Z\\). For any pair \\((x,z)\\), \\(f^\star\\) would return false. If \\(f\\) does require less \\(Y\\) then it produces, then it reduces to asking whether you can get \\(x\\) given \\(z\\), so you can simply forget about \\(Y\\) inputs and outputs.
  • 19.

    One way to think about this \(f\) is to imagine it represents a machine or process that turns Z into X. So given \(z\) amount of Z, \(f\) answers whether or not we can make \(x\) amount of X. But the machine requires electricity (Y), but also happens to produce electricity.

    Thus, \(f\) depends on whether or not we have enough electricity. But if the machine makes less electricity than it needs (which must be true if the 2nd law of thermodynamics is true), then we cannot make X given Z for any amounts of X and Z. We need an external supply of energy.

    Alternatively, if the machine makes more electricity than it needs, we don't need to specify how much electricity is supplied as an input or demanded as an output. The machine will run regardless if there's enough Z to make X. Maybe Y is money instead of electricity if you want thermodynamics to hold, and the machine costs \(y'\) to run but tourists pay \(y\) to watch it run (a contrived example to be sure).

    Comment Source:One way to think about this \\(f\\) is to imagine it represents a machine or process that turns Z into X. So given \\(z\\) amount of Z, \\(f\\) answers whether or not we can make \\(x\\) amount of X. But the machine requires electricity (Y), but also happens to produce electricity. Thus, \\(f\\) depends on whether or not we have enough electricity. But if the machine makes less electricity than it needs (which must be true if the 2nd law of thermodynamics is true), then we cannot make X given Z for any amounts of X and Z. We need an external supply of energy. Alternatively, if the machine makes more electricity than it needs, we don't need to specify how much electricity is supplied as an input or demanded as an output. The machine will run regardless if there's enough Z to make X. Maybe Y is money instead of electricity if you want thermodynamics to hold, and the machine costs \\(y'\\) to run but tourists pay \\(y\\) to watch it run (a contrived example to be sure).
  • 20.
    edited August 2

    I think the blob interpretation, where the bends can be removed and all the strings can be combed straight and have the arrows point in the same direction is incorrect.

    Consider what I'm going to call spider profunctors,

    \[ S: X_1 \otimes X_2 \otimes X_3 \otimes \cdots X_n \nrightarrow Y_1 \otimes Y_2 \otimes Y_3 \otimes \cdots Y_m \]

    I conjecture that there exists an arrangement of spiders and loops that can't be undone and "combed straight" as it were.

    Comment Source:I think the blob interpretation, where the bends can be removed and all the strings can be combed straight and have the arrows point in the same direction is incorrect. Consider what I'm going to call spider profunctors, \\[ S: X\_1 \otimes X\_2 \otimes X\_3 \otimes \cdots X\_n \nrightarrow Y\_1 \otimes Y\_2 \otimes Y\_3 \otimes \cdots Y\_m \\] I conjecture that there exists an arrangement of spiders and loops that can't be undone and "combed straight" as it were.
  • 21.
    edited August 2

    Actually, thinking about it, I don't think I need loops to prove it.

    This spider can't be made into a blob where all the arrows point in the same direction,

    \[ X^{op} \otimes Y \nrightarrow Z^{op} \otimes W. \]

    Edit: Therefore the assumption that,

    "horizontal v vertical" or "left to right" aspects of string diagrams – at least for profunctors – turn out to be irrelevant.

    is incorrect. Directionality cannot be ignored and made irrelevant under topological moves.

    Comment Source:Actually, thinking about it, I don't think I need loops to prove it. This spider can't be made into a blob where all the arrows point in the same direction, \\[ X^{op} \otimes Y \nrightarrow Z^{op} \otimes W. \\] Edit: Therefore the assumption that, >"horizontal v vertical" or "left to right" aspects of string diagrams – at least for profunctors – turn out to be irrelevant. is incorrect. Directionality cannot be ignored and made irrelevant under topological moves.
  • 22.

    However, if we add is a swapping profunctor,

    \[ \sigma : A \otimes B \nrightarrow B \otimes A \]

    then every profunctor can be given an isomorphic profunctor where when as string diagrams all the string arrows point in the same direction.

    Comment Source:However, if we add is a swapping profunctor, \\[ \sigma : A \otimes B \nrightarrow B \otimes A \\] then every profunctor can be given an isomorphic profunctor where when as string diagrams all the string arrows point in the same direction.
  • 23.

    @Keith – surely we already have an isomorphism of \(\mathcal{V}\)-categories \(X \times Y \cong Y \times X\) given by \((x, y) \mapsto (y, x)\). We can check that this is in fact a \(\mathcal{V}\)-functor:

    \[ (Y \times X)((y, x), (y', x')) = Y(y, y') \otimes X(x, x') = X(x, x') \otimes Y(y, y') = (X \times Y)((x, y), (x', y')) \]

    NB we need \(\otimes\) to be symmetric in order to define the product \(\mathcal{V}\)-category \(X \times Y\) in the first place.

    Comment Source:@Keith – surely we already have an isomorphism of \\(\mathcal{V}\\)-categories \\(X \times Y \cong Y \times X\\) given by \\((x, y) \mapsto (y, x)\\). We can check that this is in fact a \\(\mathcal{V}\\)-functor: \\[ (Y \times X)((y, x), (y', x')) = Y(y, y') \otimes X(x, x') = X(x, x') \otimes Y(y, y') = (X \times Y)((x, y), (x', y')) \\] NB we need \\(\otimes\\) to be symmetric in order to define the product \\(\mathcal{V}\\)-category \\(X \times Y\\) in the first place.
  • 24.

    Thought I'd update/fix my previous attempt at proving the first snake inequality given the conventions we've settled on for cap and cup. I've also restricted it to the case where \(\mathcal{V} = \textbf{Bool}\), although the proof works in the general case too.

    The first snake inequality concerns the following row of profunctors:

    $$ X \cong \textbf{1} \times X \nrightarrow (X \times X^\text{op}) \times X \cong X \times (X^\text{op} \times X) \nrightarrow X \times \textbf{1} \cong X $$ Given any objects \(x, y\) in \(X\) the value of the composite profunctor at \((x, y)\) is

    $$ \bigvee\big(\Phi((\bullet, x), (z, z', z'')) \otimes \Psi((z, z', z''), (y, \bullet))\big) $$ where we're joining over triples \((z, z', z'')\) in \(X \times X^\text{op} \times X\) and

    $$ \Phi((\bullet, x), (z, z', z'')) = \cap_X(\bullet, (z, z')) \wedge \text{1}_X(x, z'') = (z' \leq z) \wedge (x \leq z'') $$ $$ \Psi((z, z', z''), (y, \bullet)) = \text{1} _X(z, y) \wedge \cup_X((z', z''), \bullet) = (z \leq y) \wedge (z'' \leq z') $$ So our join is

    $$ \bigvee\big((z' \leq z) \wedge (x \leq z'') \wedge (z \leq y) \wedge (z'' \leq z')\big) $$ Reorder the terms to get

    $$ \bigvee\big((x \leq z'') \wedge (z'' \leq z') \wedge (z' \leq z) \wedge (z \leq y) \big) $$ Now if this join is true, then the "summand" must be true for some triple \((z, z', z'')\), and that implies \((x \leq y)\).

    Conversely, if \((x \leq y)\) then the "summand" is true for the triple \((x, x, x)\), so the join is true.

    Hence the join is true iff \((x \leq y)\), so the composite profunctor equals the identity profunctor. QED.

    Comment Source:Thought I'd update/fix my previous attempt at proving the first snake inequality given the conventions we've settled on for cap and cup. I've also restricted it to the case where \\(\mathcal{V} = \textbf{Bool}\\), although the proof works in the general case too. The first snake inequality concerns the following row of profunctors: \[ X \cong \textbf{1} \times X \nrightarrow (X \times X^\text{op}) \times X \cong X \times (X^\text{op} \times X) \nrightarrow X \times \textbf{1} \cong X \] Given any objects \\(x, y\\) in \\(X\\) the value of the composite profunctor at \\((x, y)\\) is \[ \bigvee\big(\Phi((\bullet, x), (z, z', z'')) \otimes \Psi((z, z', z''), (y, \bullet))\big) \] where we're joining over triples \\((z, z', z'')\\) in \\(X \times X^\text{op} \times X\\) and \[ \Phi((\bullet, x), (z, z', z'')) = \cap_X(\bullet, (z, z')) \wedge \text{1}_X(x, z'') = (z' \leq z) \wedge (x \leq z'') \] \[ \Psi((z, z', z''), (y, \bullet)) = \text{1} _X(z, y) \wedge \cup_X((z', z''), \bullet) = (z \leq y) \wedge (z'' \leq z') \] So our join is \[ \bigvee\big((z' \leq z) \wedge (x \leq z'') \wedge (z \leq y) \wedge (z'' \leq z')\big) \] Reorder the terms to get \[ \bigvee\big((x \leq z'') \wedge (z'' \leq z') \wedge (z' \leq z) \wedge (z \leq y) \big) \] Now if this join is true, then the "summand" must be true for some triple \\((z, z', z'')\\), and that implies \\((x \leq y)\\). Conversely, if \\((x \leq y)\\) then the "summand" is true for the triple \\((x, x, x)\\), so the join is true. Hence the join is true iff \\((x \leq y)\\), so the composite profunctor equals the identity profunctor. QED.
  • 25.
    edited August 3

    @John - I was looking at your old Network Theory III notes and I saw a familiar pattern:

    Given finite sets \(X\) and \(Y\) , a stochastic map \(f : X \rightsquigarrow Y\) assigns a real number \(f_{yx}\) to each pair \(x \in X\), \(y \in Y\) in such a way that for any \(x\), the numbers \(f_{yx}\) form a probability distribution on Y . We call \(f_{yx}\) the probability of \(y\) given \(x\).

    So, we demand:

    • \(f_{yx} \geq 0\) for all \(x ∈ X\) \(y ∈ Y\)
    • \(\displaystyle{\sum_{y\in Y} f_{yx} = 1} \) for all \(x \in X\)

    We can compose stochastic maps \(f : X \rightsquigarrow Y\) and \(g : Y \rightsquigarrow Z\) by matrix multiplication:

    $$ (g \circ f )_{zx} = \sum_{y\in Y} g_{zy} f_{yz}$$ and get a stochastic map \(g ◦ f : X \rightsquigarrow Z\).

    We let \(\mathtt{FinStoch}\) be the category with

    • finite sets as objects,
    • stochastic maps \(f : X \rightsquigarrow Y\) as morphisms.

    It is perhaps well beyond the scope of this course, but is \(\mathtt{FinStoch}\) a \(\mathcal{V}\)-enriched profunctor category? It doesn't seem like it is because \(\sum\) is not the same as \(\bigvee\). Is it some kind of related profunctor category?

    Comment Source:@John - I was looking at your old [Network Theory III](http://math.ucr.edu/home/baez/networks_oxford/networks_entropy.pdf) notes and I saw a familiar pattern: > Given finite sets \\(X\\) and \\(Y\\) , a stochastic map \\(f : X \rightsquigarrow Y\\) assigns a > real number \\(f\_{yx}\\) to each pair \\(x \in X\\), \\(y \in Y\\) in such a way that for > any \\(x\\), the numbers \\(f\_{yx}\\) form a probability distribution on Y . > We call \\(f\_{yx}\\) the probability of \\(y\\) given \\(x\\). > > So, we demand: > > - \\(f\_{yx} \geq 0\\) for all \\(x ∈ X\\) \\(y ∈ Y\\) > - \\(\displaystyle{\sum\_{y\in Y} f\_{yx} = 1} \\) for all \\(x \in X\\) > > We can compose stochastic maps \\(f : X \rightsquigarrow Y\\) and \\(g : Y \rightsquigarrow Z\\) by matrix multiplication: > > \[ (g \circ f )_{zx} = \sum_{y\in Y} g_{zy} f_{yz}\] > > and get a stochastic map \\(g ◦ f : X \rightsquigarrow Z\\). > > We let \\(\mathtt{FinStoch}\\) be the category with > > - finite sets as objects, > - stochastic maps \\(f : X \rightsquigarrow Y\\) as morphisms. It is perhaps well beyond the scope of this course, but is \\(\mathtt{FinStoch}\\) a \\(\mathcal{V}\\)-enriched profunctor category? It doesn't seem like it is because \\(\sum\\) is not the same as \\(\bigvee\\). Is it some kind of related profunctor category?
  • 26.
    edited August 3

    Anindya wrote:

    Composition means connecting the output of one blob to the input of another. Tensoring means gathering together a bunch of blobs into one:

    image

    RIGHT!!! image

    This is an incredibly important point. I've been slowly leading up to it, but I probably should have just come out and said it.

    But the "horizontal vs vertical" or "left to right" aspects of string diagrams – at least for profunctors – turn out to be irrelevant.

    Sort of. We have a great deal of flexibility in manipulating our diagrams for profunctors: for example we can take both sides of an equation and 'turn them around' using caps and cups, turning inputs into outputs and vice versa, and get another true equation. And yet, we do need to be careful about whether we're talking about \(\Phi \colon X \nrightarrow Y\) or \(\Phi \colon Y \nrightarrow X\), because this affects which formulas involving \(\Phi\) will make sense, or be true. And ironically, it matters most of all when \(X = Y\)!

    Comment Source:Anindya wrote: > Composition means connecting the output of one blob to the input of another. Tensoring means gathering together a bunch of blobs into one: > <center><img src="https://i.imgur.com/AYGEndl.png"></center> RIGHT!!! <img src = "http://math.ucr.edu/home/baez/emoticons/thumbsup.gif"> This is an incredibly important point. I've been slowly leading up to it, but I probably should have just come out and said it. > But the "horizontal vs vertical" or "left to right" aspects of string diagrams – at least for profunctors – turn out to be irrelevant. Sort of. We have a great deal of flexibility in manipulating our diagrams for profunctors: for example we can take both sides of an equation and 'turn them around' using caps and cups, turning inputs into outputs and vice versa, and get another true equation. And yet, we do need to be careful about whether we're talking about \\(\Phi \colon X \nrightarrow Y\\) or \\(\Phi \colon Y \nrightarrow X\\), because this affects which formulas involving \\(\Phi\\) will make sense, or be true. And ironically, it matters most of all when \\(X = Y\\)!
  • 27.
    edited August 3

    Matthew wrote:

    It is perhaps well beyond the scope of this course, but is \(\mathtt{FinStoch}\) a \(\mathcal{V}\)-enriched profunctor category? It doesn't seem like it is because \(\sum\) is not the same as \(\bigvee\). Is it some kind of related profunctor category?

    Very interesting question. I don't think it's an enriched profunctor category; I think both this category and enriched profunctor categories are special cases of a more general sort of category.

    \(\mathtt{FinStoch}\) is a subcategory of a simpler category called \(\mathtt{Mat}(\mathbb{R})\), where

    • objects are finite sets,

    • a morphism \(f \colon X \to Y\) is a 'matrix', namely a function \(f \colon Y \times X \to \mathbb{R}\),

    • composition is done via matrix multiplication: we compose morphisms \(f : X \to Y\) and \(g : Y \to Z\) to get \(g \circ f : X \to Z\) as follows:

    $$ (g \circ f )_{zx} = \sum_{y\in Y} g_{zy} f_{yz} $$ This category is equivalent (but not isomorphic) to the category of finite-dimensional real vector spaces.

    In fact we can define a category \(\mathtt{Mat}(R)\) in the exact same way whenever \(R\) is any ring, or even any rig! A great example is \( R = [0,\infty) \) with the usual notions of \(+\) and \(\times\). \(\mathtt{FinStoch}\) is actually a subcategory of \(\mathtt{Mat}([0,\infty))\)

    You might enjoy this exploration of \(\mathtt{FinStoch}\), \(\mathtt{Mat}([0,\infty))\) and related categories:

    This is the beginning of a long story, continued in other blog articles in that series.

    But notice that any quantale gives a rig with \(+ = \vee\) and \(\times = \otimes\). So we can also create categories \(\mathtt{Mat}(\mathcal{V})\) when \(\mathcal{V}\) is a quantale! And in this case there's no need to limit ourselves to finite sets as objects! Infinite joins are well-defined, so we can say

    $$ (g \circ f )_{zx} = \bigvee_{y\in Y} g_{zy} \otimes f_{yz}$$ even when \(Y\) is infinite!

    So we get a category where morphisms are possibly infinite-sized matrices with entries in a quantale \(\mathcal{V}\). But these are not the categories of \(\mathcal{V}\)-enriched profunctors - do you see why? See how they're related?

    So there must be some 'least common generalization' that includes everything I've been talking about, but I'm not sure what it is.

    Comment Source:Matthew wrote: > It is perhaps well beyond the scope of this course, but is \\(\mathtt{FinStoch}\\) a \\(\mathcal{V}\\)-enriched profunctor category? It doesn't seem like it is because \\(\sum\\) is not the same as \\(\bigvee\\). Is it some kind of related profunctor category? Very interesting question. I don't think it's an enriched profunctor category; I think both this category and enriched profunctor categories are special cases of a more general sort of category. \\(\mathtt{FinStoch}\\) is a subcategory of a simpler category called \\(\mathtt{Mat}(\mathbb{R})\\), where * objects are finite sets, * a morphism \\(f \colon X \to Y\\) is a 'matrix', namely a function \\(f \colon Y \times X \to \mathbb{R}\\), * composition is done via matrix multiplication: we compose morphisms \\(f : X \to Y\\) and \\(g : Y \to Z\\) to get \\(g \circ f : X \to Z\\) as follows: \[ (g \circ f )\_{zx} = \sum_{y\in Y} g\_{zy} f\_{yz} \] This category is equivalent (but not isomorphic) to the category of finite-dimensional real vector spaces. In fact we can define a category \\(\mathtt{Mat}(R)\\) in the exact same way whenever \\(R\\) is any ring, or even any [rig](https://en.wikipedia.org/wiki/Semiring)! A great example is \\( R = [0,\infty) \\) with the usual notions of \\(+\\) and \\(\times\\). \\(\mathtt{FinStoch}\\) is actually a subcategory of \\(\mathtt{Mat}([0,\infty))\\) You might enjoy this exploration of \\(\mathtt{FinStoch}\\), \\(\mathtt{Mat}([0,\infty))\\) and related categories: * John Baez, [Relative entropy (part 1)](https://johncarlosbaez.wordpress.com/2013/06/20/relative-entropy-part-1/), _Azimuth_, 20 June 2013. This is the beginning of a long story, continued in other blog articles in that series. But notice that any quantale gives a rig with \\(+ = \vee\\) and \\(\times = \otimes\\). So we can also create categories \\(\mathtt{Mat}(\mathcal{V})\\) when \\(\mathcal{V}\\) is a quantale! And in this case there's no need to limit ourselves to finite sets as objects! Infinite joins are well-defined, so we can say \[ (g \circ f )\_{zx} = \bigvee_{y\in Y} g\_{zy} \otimes f\_{yz}\] even when \\(Y\\) is infinite! So we get a category where morphisms are possibly infinite-sized matrices with entries in a quantale \\(\mathcal{V}\\). But these are _not_ the categories of \\(\mathcal{V}\\)-enriched profunctors - do you see why? See how they're related? So there must be some 'least common generalization' that includes everything I've been talking about, but I'm not sure what it is.
  • 28.

    Very nice answer to Puzzle 217 in comment #10, Scott!

    Therefore \((1_X \times \cup_X ) (\cap_X \times 1_X ) \simeq 1_X\). Equality holds if \(X \otimes 1 = X = 1 \otimes X\) because \((1_X \times \cup_X ) (\cap_X \times 1_X ) : 1\otimes X \nrightarrow X \otimes 1 \).

    Hmm, this is an interesting nuance.

    You're right, the claimed equation

    $$ (1_X \times \cup_X ) (\cap_X \times 1_X ) = 1_X $$ is not really right, because the right-hand side is a profunctor from \(X\) to \(X\), while the right is really a profunctor from \(\mathbf{1} \times X\) to \(X \times \mathbf{1}\).

    Luckily, there are god-given isomorphisms called the left unitor

    $$ \lambda_X \colon \mathbf{1} \times X \nrightarrow X $$ and right unitor

    $$ \rho_X \colon X \otimes \mathbf{1} \nrightarrow X .$$ (These actually begin life as monotone functions with monotone inverses, but we can convert them into enriched profunctors by taking companions.)

    So, a more precise way to state the claimed equation is

    $$ \rho_X^{-1} (1_X \times \cup_X ) (\cap_X \times 1_X ) \lambda_X = 1_X .$$ More precise, but not completely precise: there's an even subtler subtlety! The morphism \(\cap_X \times 1_X\) has target \( (X \times X) \times X\), while the morphism \(1_X \times \cup_X \) has source \( X \times (X \times X)\). So, you can only compose them if you stick the obvious isomorphism from \( (X \times X) \times X\) to \( X \times (X \times X)\) between them! This an example of an associator

    $$ \alpha_{X,Y,Z} \colon (X \times Y) \times Z \nrightarrow X \times (Y \times Z) .$$ All this may be seen as overly fussy by some people. But anyway, the left unitor, right unitor and associator are three main features of a monoidal category, and any category of \(\mathcal{V}\)-enriched profunctors is a monoidal category!

    Soon I will talk about these... and you can read about them in Section 4.4.3 of the book, though you won't see the precise definition.

    I hadn't remembered that we already need to think a bit about the unitors and associators to be completely precise about the snake equations. Many less careful people are willing to pretend these are identity morphisms and thus ignorable. This is actually justified by 'Mac Lane's coherence theorem'.

    Comment Source:Very nice answer to Puzzle 217 in [comment #10](https://forum.azimuthproject.org/discussion/comment/20436/#Comment_20436), Scott! >Therefore \\((1_X \times \cup_X ) (\cap_X \times 1_X ) \simeq 1_X\\). Equality holds if \\(X \otimes 1 = X = 1 \otimes X\\) because \\((1_X \times \cup_X ) (\cap_X \times 1_X ) : 1\otimes X \nrightarrow X \otimes 1 \\). Hmm, this is an interesting nuance. You're right, the claimed equation \[ (1_X \times \cup_X ) (\cap_X \times 1_X ) = 1_X \] is not really right, because the right-hand side is a profunctor from \\(X\\) to \\(X\\), while the right is really a profunctor from \\(\mathbf{1} \times X\\) to \\(X \times \mathbf{1}\\). Luckily, there are god-given isomorphisms called the **left unitor** \[ \lambda_X \colon \mathbf{1} \times X \nrightarrow X \] and **right unitor** \[ \rho_X \colon X \otimes \mathbf{1} \nrightarrow X .\] (These actually begin life as monotone functions with monotone inverses, but we can convert them into enriched profunctors by taking companions.) So, a more precise way to state the claimed equation is \[ \rho_X^{-1} (1_X \times \cup_X ) (\cap_X \times 1_X ) \lambda_X = 1_X .\] More precise, but not completely precise: there's an even subtler subtlety! The morphism \\(\cap_X \times 1_X\\) has target \\( (X \times X) \times X\\), while the morphism \\(1_X \times \cup_X \\) has source \\( X \times (X \times X)\\). So, you can only compose them if you stick the obvious isomorphism from \\( (X \times X) \times X\\) to \\( X \times (X \times X)\\) between them! This an example of an **associator** \[ \alpha_{X,Y,Z} \colon (X \times Y) \times Z \nrightarrow X \times (Y \times Z) .\] All this may be seen as overly fussy by some people. But anyway, the left unitor, right unitor and associator are three main features of a [monoidal category](https://en.wikipedia.org/wiki/Monoidal_category#Formal_definition), and any category of \\(\mathcal{V}\\)-enriched profunctors is a monoidal category! Soon I will talk about these... and you can read about them in Section 4.4.3 of the book, though you won't see the precise definition. I hadn't remembered that we already need to think a bit about the unitors and associators to be completely precise about the snake equations. Many less careful people are willing to pretend these are identity morphisms and thus ignorable. This is actually justified by 'Mac Lane's coherence theorem'.
  • 29.

    @John,

    The subltety tripped me up a little at first since you'd written equality in the original post, but the type signatures don't work out to be the same, only isomorphic! Of course, sometimes we have equality and sometimes we only have isomorphism.

    Of course, in modeling the real world this distinction sometimes doesn't matter very much. Case in point our feasibilitiy relations.

    Comment Source:@John, The subltety tripped me up a little at first since you'd written equality in the original post, but the type signatures don't work out to be the same, only isomorphic! Of course, sometimes we have equality and sometimes we only have isomorphism. Of course, in modeling the real world this distinction sometimes doesn't matter very much. Case in point our feasibilitiy relations.
Sign In or Register to comment.