It looks like you're new here. If you want to get involved, click one of these buttons!

- All Categories 2.2K
- Applied Category Theory Course 355
- Applied Category Theory Seminar 4
- Exercises 149
- Discussion Groups 49
- How to Use MathJax 15
- Chat 480
- Azimuth Code Project 108
- News and Information 145
- Azimuth Blog 149
- Azimuth Forum 29
- Azimuth Project 189
- - Strategy 108
- - Conventions and Policies 21
- - Questions 43
- Azimuth Wiki 711
- - Latest Changes 701
- - - Action 14
- - - Biodiversity 8
- - - Books 2
- - - Carbon 9
- - - Computational methods 38
- - - Climate 53
- - - Earth science 23
- - - Ecology 43
- - - Energy 29
- - - Experiments 30
- - - Geoengineering 0
- - - Mathematical methods 69
- - - Meta 9
- - - Methodology 16
- - - Natural resources 7
- - - Oceans 4
- - - Organizations 34
- - - People 6
- - - Publishing 4
- - - Reports 3
- - - Software 21
- - - Statistical methods 2
- - - Sustainability 4
- - - Things to do 2
- - - Visualisation 1
- General 39

Options

Now that we've got enriched profunctors up and running, let's see how to compose them! We've already thought about it in some examples. In Lecture 58 we saw how to compose \(\mathbf{Bool}\)-enriched profunctors, also known as feasibility relations:

Here we have three \(\mathbf{Bool}\)-enriched categories \(X,Y,\) and \(Z\), also known as preorders, and feasibility relations between these:

$$ \Phi \colon X \nrightarrow Y , $$ $$ \Psi \colon Y \nrightarrow Z. $$ Remember, these are really monotone functions

$$ \Phi: X^{\text{op}} \times Y \to \mathbf{Bool} ,$$ $$ \Psi: Y^{\text{op}} \times Z \to \mathbf{Bool}.$$ In the pictures \(\Phi(x,y) = \text{true}\) iff there's a path from \(x\in X\) to \(y \in Y\), and \(\Psi(y,z) = \text{true}\) iff there's a path from \(y \in Y\) to \(z \in Z\).

Their composite

$$ \Psi\Phi \colon X \nrightarrow Z $$ is given by

$$ (\Psi\Phi)(x,z) = \bigvee_{y \in Y} \Phi(x,y) \wedge \Psi(y,z). $$
Remember, the join \( \bigvee \) in \(\mathbf{Bool}\) means 'there exists', while the meet \(\wedge\) means 'and'. So, this formula says that you can get from \(x \in X\) to \(z \in Z\) iff *there exists* \(y \in Y\) such that you can get from \(x\) to \(y\) *and* from \(y\) to \(z\).

Now let's generalize this, replacing \(\mathbf{Bool}\) with any sufficiently nice poset \(\mathcal{V}\). Last time we saw that if \(\mathcal{V}\) is a closed commutative monoidal poset we can define \(\mathcal{V}\) -enriched profunctors between \(\mathcal{V}\) -enriched categories. But to compose these enriched profunctors, \(\mathcal{V}\) will need to be a bit nicer.

The reason is not hard to see. Suppose we have three \(\mathcal{V}\)-enriched categories \(\mathcal{X},\mathcal{Y}\), and \(\mathcal{Z}\). Suppose we have \(\mathcal{V}\)-enriched profunctors between these:

$$ \Phi : \mathcal{X} \nrightarrow \mathcal{Y}, $$ $$ \Psi : \mathcal{Y} \nrightarrow \mathcal{Z}. $$ Remember, these are really \(\mathcal{V}\)-enriched functors

$$ \Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} , $$ $$ \Psi \colon \mathcal{Y}^{\text{op}} \times \mathcal{Z} \to \mathcal{V} . $$ Let's try to compose them using this formula:

$$ (\Psi\Phi)(x,z) = \bigvee_{y \in \mathrm{Ob}(\mathcal{Y})} \Phi(x,y) \otimes \Psi(y,z). $$ Note I've replaced the meet \(\wedge\), which is the multiplication in our monoidal poset \(\mathbf{Bool}\), by \(\otimes\), which is the name of the multiplication in a general monoidal poset \(\mathcal{V}\). But I'm keeping the join \(\bigvee\).

Why? The reason is that *composing enriched profunctors is like matrix multiplication!* First we 'multiply' the matrix entries \(\Phi(x,y)\) and \(\Psi(y,z)\), then we 'sum' over \(y\). The multiplication in \(\mathcal{V}\) is \(\otimes\), but the sum... well, in general a monoidal poset doesn't have a way to do 'sums', but if it has joins then these act like sums!

So, we'd better assume \(\mathcal{V}\) has all joins. There's a name for this:

**Definition.** A **quantale** is a closed monoidal poset \( \mathcal{V}\) that has all joins: that is, every subset of \( S\subseteq \mathcal{V}\) has a least upper bound \(\bigvee S\).

'Quantale' may sound like a strange word, but we've seen that posets are good for studying logic, and quantales first showed up in the study of quantum logic. In quantum logic we often need *noncommutative* quantales, but for our work now we need the multiplication \(\otimes\) in \(\mathcal{V}\) to be commutative.

So, putting it all together:

**Definition.** If \(\mathcal{V}\) is a commutative quantale and \(\Phi \colon \mathcal{X} \nrightarrow \mathcal{Y}\), \(\Psi\colon \mathcal{Y} \nrightarrow \mathcal{Z}\) are \(\mathcal{V}\)-enriched profunctors, define their **composite** by

$$ (\Psi\Phi)(x,z) = \bigvee_{y \in \mathrm{Ob}(\mathcal{Y})} \Phi(x,y) \otimes \Psi(y,z). $$ Great! But we still need to check that \(\Psi\Phi\) is an enriched profunctor! We've got a well-defined function

$$ \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} $$ but we need to check that it's a \(\mathcal{V}\)-enriched profunctor. I'll let you give it a try. This cool fact will help:

**Theorem.** If \(\mathcal{V}\) is a monoidal poset with all joins, \(\mathcal{V}\) is a quantale if and only if

$$ a \otimes \left( \bigvee_{b\in B} b\right) = \bigvee_{b \in A} (a \otimes b) $$ for every element \(a\) and every subset \(B\) of \(\mathcal{V}\).

**Proof Sketch.** For every element \(a\) of \(\mathcal{V}\) there is a monotone function

$$ a \otimes - \, \colon \mathcal{V} \to \mathcal{V} $$ sending each \(x \in \mathcal{V}\) to \(a \otimes x\) . By the Adjoint Functor Theorem for Posets, this monotone function has a right adjoint iff it preserves all joins. It a right adjoint iff \(\mathcal{V}\) is closed, since \(\mathcal{V}\) being closed says that

$$ a \otimes x \le y \text{ if and only if } x \le a \multimap y $$ for all \(x, y\) in \(\mathcal{V}\), which means that

$$ a \multimap - \, \colon \mathcal{V} \to \mathcal{V} $$ is a right adjoint of

$$ a \otimes - \, \colon \mathcal{V} \to \mathcal{V} $$ On the other hand, \(a \otimes -\) preserves all joins iff

$$ a \otimes \left( \bigvee_{b\in B} b\right) = \bigvee_{b \in B} (a \otimes b) $$ for every element \(a\) and every subset \(B\) of \(\mathcal{V}\). \( \qquad \blacksquare \)

Now try this puzzle:

**Puzzle 198.** Suppose \(\mathcal{V}\) is a commutative quantale, and suppose \( \Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} \) and \( \Psi \colon \mathcal{Y}^{\text{op}} \times \mathcal{Z} \to \mathcal{V} \) are \(\mathcal{V}\)-enriched functors. Show that \( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} \), defined by

$$ (\Psi\Phi)(x,z) = \bigvee_{y \in \mathrm{Ob}(\mathcal{Y})} \Phi(x,y) \otimes \Psi(y,z),$$ is a \(\mathcal{V}\)-enriched functor. This means checking an inequality - you can find the definition of enriched functor in Lecture 32.

Also try these:

**Puzzle 199.** Suppose that \(\mathcal{V}\) is a commutative quantale. Show that composition of \(\mathcal{V}\)-enriched profunctors is associative.

**Puzzle 200.** Suppose that \(\mathcal{V}\) is a commutative quantale and \(\mathcal{X}\) is a \(\mathcal{V}\)-enriched category. The hom-functor

$$ \mathrm{hom} \colon \mathcal{X}^{\text{op}} \times \mathcal{X} \to \mathcal{V} $$ described in Puzzle 197 gives an enriched profunctor that we call \(1_{\mathcal{V}} \colon \mathcal{V} \nrightarrow \mathcal{V}\). Show that this serves as an identity for composition of \(\mathcal{V}\)-enriched profunctors: check the left and right unit laws.

You can see what's coming! If you get stuck I'll help you next time. I'll also give more examples of commutative quantales, and say more about them!

## Comments

I tried to prove this in comment #21 of lecture 62, but I used Wikipedia's definition of a unital quantale.

My old attempted proof uses the following distributive laws:

$$ a \otimes \left( \bigvee_{b\in B} b\right) = \bigvee_{b \in B} (a \otimes b) \quad ; \quad \bigvee_{b\in B} (b \otimes a) = \left(\bigvee_{b \in B} b\right) \otimes a $$ Since we are assuming \(\mathcal{V}\) is commutative, we only need to prove one of these.

Recalling the definition of a quantale, we have:

Hence we know that \(\mathcal{V}\) has an adjoint \((A \otimes -) \dashv (A \multimap -)\) from Lecture 61.

Next, we want to show \(a \otimes \bigvee_{b \in B} b \leq c \iff \bigvee_{b \in B} (a \otimes b) \leq c\). Using the adjunction from Lecture 61 we have the following chain of biconditionals:

$$ \begin{align} a \otimes \left(\bigvee_{b \in B} b\right) \leq c & \iff \bigvee_{b \in B} b \leq a \multimap c \\ & \iff \text{for all } b \text{ in } B \text{: } b \leq a \multimap c \\ & \iff \text{for all } b \text{ in } B \text{: } a \otimes b \leq c \\ & \iff \bigvee_{b \in B} (a \otimes b) \leq c \\ \end{align} $$ We know that \(a \otimes \left(\bigvee_{b \in B} b\right) \leq a \otimes \left(\bigvee_{b \in B} b\right)\) by reflexivity, hence \(\bigvee_{b \in B} (a \otimes b) \leq a \otimes \left(\bigvee_{b \in B} b\right)\). Similarly, we know \(\bigvee_{b \in B} (a \otimes b) \leq \bigvee_{b \in B} (a \otimes b) \), hence \(a \otimes \left(\bigvee_{b \in B} b\right) \leq \bigvee_{b \in B} (a \otimes b) \). Thus \(a \otimes \left(\bigvee_{b \in B} b\right) = \bigvee_{b \in B} (a \otimes b) \).

Now that distributivity is established, my old proof should apply. I will reiterate it.

Let \(\Phi : \mathcal{A} \nrightarrow \mathcal{B} \), \(\Psi : \mathcal{B} \nrightarrow \mathcal{C}\), and \(\Upsilon : \mathcal{C} \nrightarrow \mathcal{D}\) be \(\mathcal{V}\)-profunctors. We need to show

$$ (\Phi \Psi) \Upsilon = \Phi (\Psi \Upsilon) $$ Expanding the definition of profunctor composition, this amounts to showing:

$$ \bigvee_{c \in \mathrm{obj}(\mathcal{C})} \left(\bigvee_{b \in \mathrm{obj}(\mathcal{B})} \Phi(a,b) \otimes \Psi(b,c)\right) \otimes \Upsilon(c,d) = \bigvee_{b \in \mathrm{obj}(\mathcal{B})} \Phi(a,b) \otimes \left(\bigvee_{c \in \mathrm{obj}(\mathcal{C})} \Psi(b,c) \otimes \Upsilon(c,d) \right) $$ Let's walk through how to get to this:

$$ \begin{align} \bigvee_{c \in \mathrm{obj}(\mathcal{C})} \left(\bigvee_{b \in \mathrm{obj}(\mathcal{B})} \Phi(a,b) \otimes \Psi(b,c)\right) \otimes \Upsilon(c,d) & = \bigvee_{c \in \mathrm{obj}(\mathcal{C})} \left(\bigvee_{b \in \mathrm{obj}(\mathcal{B})} \Phi(a,b) \otimes \Psi(b,c) \otimes \Upsilon(c,d) \right) \tag{by distributivity} \\ & = \bigvee_{b \in \mathrm{obj}(\mathcal{B})} \left(\bigvee_{c \in \mathrm{obj}(\mathcal{C})} \Phi(a,b) \otimes \Psi(b,c) \otimes \Upsilon(c,d) \right) \tag{lattice identity} \\ & = \bigvee_{b \in \mathrm{obj}(\mathcal{B})} \Phi(a,b) \otimes \left(\bigvee_{c \in \mathrm{obj}(\mathcal{C})} \Psi(b,c) \otimes \Upsilon(c,d) \right) \tag{by distributivity} \end{align} $$ \( \qquad \blacksquare \)

As a note, Anindya remarks in comment #22 of Lecture 62 there may be issues with that lattice identity I have tried to use...

`> **Puzzle 199.** Suppose that \\(\mathcal{V}\\) is a commutative quantale. Show that composition of \\(\mathcal{V}\\)-enriched profunctors is associative. I tried to prove this in [comment #21](https://forum.azimuthproject.org/discussion/comment/20204/#Comment_20204) of lecture 62, but I used Wikipedia's definition of a unital quantale. My old attempted proof uses the following distributive laws: \[ a \otimes \left( \bigvee\_{b\in B} b\right) = \bigvee\_{b \in B} (a \otimes b) \quad ; \quad \bigvee\_{b\in B} (b \otimes a) = \left(\bigvee\_{b \in B} b\right) \otimes a \] Since we are assuming \\(\mathcal{V}\\) is commutative, we only need to prove one of these. Recalling the definition of a quantale, we have: > **Definition.** A **quantale** is a closed monoidal poset \\( \mathcal{V}\\) that has all joins: that is, every subset of \\( S\subseteq \mathcal{V}\\) has a least upper bound \\(\bigvee S\\). Hence we know that \\(\mathcal{V}\\) has an adjoint \\((A \otimes -) \dashv (A \multimap -)\\) from [Lecture 61](https://forum.azimuthproject.org/discussion/2291/lecture-61-chapter-4-closed-monoidal-posets/p1). Next, we want to show \\(a \otimes \bigvee_{b \in B} b \leq c \iff \bigvee_{b \in B} (a \otimes b) \leq c\\). Using the adjunction from Lecture 61 we have the following chain of biconditionals: \[ \begin{align} a \otimes \left(\bigvee_{b \in B} b\right) \leq c & \iff \bigvee_{b \in B} b \leq a \multimap c \\\\ & \iff \text{for all } b \text{ in } B \text{: } b \leq a \multimap c \\\\ & \iff \text{for all } b \text{ in } B \text{: } a \otimes b \leq c \\\\ & \iff \bigvee_{b \in B} (a \otimes b) \leq c \\\\ \end{align} \] We know that \\(a \otimes \left(\bigvee_{b \in B} b\right) \leq a \otimes \left(\bigvee_{b \in B} b\right)\\) by reflexivity, hence \\(\bigvee_{b \in B} (a \otimes b) \leq a \otimes \left(\bigvee_{b \in B} b\right)\\). Similarly, we know \\(\bigvee_{b \in B} (a \otimes b) \leq \bigvee_{b \in B} (a \otimes b) \\), hence \\(a \otimes \left(\bigvee_{b \in B} b\right) \leq \bigvee_{b \in B} (a \otimes b) \\). Thus \\(a \otimes \left(\bigvee_{b \in B} b\right) = \bigvee_{b \in B} (a \otimes b) \\). Now that distributivity is established, my old proof should apply. I will reiterate it. Let \\(\Phi : \mathcal{A} \nrightarrow \mathcal{B} \\), \\(\Psi : \mathcal{B} \nrightarrow \mathcal{C}\\), and \\(\Upsilon : \mathcal{C} \nrightarrow \mathcal{D}\\) be \\(\mathcal{V}\\)-profunctors. We need to show \[ (\Phi \Psi) \Upsilon = \Phi (\Psi \Upsilon) \] Expanding the definition of profunctor composition, this amounts to showing: \[ \bigvee_{c \in \mathrm{obj}(\mathcal{C})} \left(\bigvee_{b \in \mathrm{obj}(\mathcal{B})} \Phi(a,b) \otimes \Psi(b,c)\right) \otimes \Upsilon(c,d) = \bigvee_{b \in \mathrm{obj}(\mathcal{B})} \Phi(a,b) \otimes \left(\bigvee_{c \in \mathrm{obj}(\mathcal{C})} \Psi(b,c) \otimes \Upsilon(c,d) \right) \] Let's walk through how to get to this: \[ \begin{align} \bigvee_{c \in \mathrm{obj}(\mathcal{C})} \left(\bigvee_{b \in \mathrm{obj}(\mathcal{B})} \Phi(a,b) \otimes \Psi(b,c)\right) \otimes \Upsilon(c,d) & = \bigvee_{c \in \mathrm{obj}(\mathcal{C})} \left(\bigvee_{b \in \mathrm{obj}(\mathcal{B})} \Phi(a,b) \otimes \Psi(b,c) \otimes \Upsilon(c,d) \right) \tag{by distributivity} \\\\ & = \bigvee_{b \in \mathrm{obj}(\mathcal{B})} \left(\bigvee_{c \in \mathrm{obj}(\mathcal{C})} \Phi(a,b) \otimes \Psi(b,c) \otimes \Upsilon(c,d) \right) \tag{lattice identity} \\\\ & = \bigvee_{b \in \mathrm{obj}(\mathcal{B})} \Phi(a,b) \otimes \left(\bigvee_{c \in \mathrm{obj}(\mathcal{C})} \Psi(b,c) \otimes \Upsilon(c,d) \right) \tag{by distributivity} \end{align} \] \\( \qquad \blacksquare \\) As a note, Anindya remarks in [comment #22](https://forum.azimuthproject.org/discussion/comment/20205/#Comment_20205) of Lecture 62 there may be issues with that lattice identity I have tried to use...`

This looks great, Matthew! Puzzle 199 would have been hard for many students because the "workhorses" required to solve this puzzle are the distributive laws:

$$ a \otimes \left( \bigvee_{b\in B} b\right) = \bigvee_{b \in B} (a \otimes b) \quad ; \quad \bigvee_{b\in B} (b \otimes a) = \left(\bigvee_{b \in B} b\right) \otimes a $$ which hold for every element \(a\) and every subset \(B\) of a commutative quantale \(\mathcal{V}\). The problem is that these need to be proved starting with the definition:

Definition.Aquantale\(\mathcal{V}\) is a closed monoidal poset that has all joins.The solution, as you so deftly note, is that \(\mathcal{V} \) being closed implies that the operation \(a \otimes - \) is a left adjoint, so it preserves all joins. And first distributive law above says precisely that \(a \otimes - \) preserves all joins!

The second one says that \(- \otimes a\) preserves all joins, but in a

commutativequantale we have \(- \otimes a = a \otimes - \).Those who are puzzled can look back at Lecture 16, where we proved this:

Theorem.If a monotone function \( f: X \to Y \) is a left adjoint, it preserves joins whenever they exist. That is, whenever a set \( S \subseteq X \) has a join we have$$ f (\bigvee S ) = \bigvee \{ f(x) : \; x \in S\} . $$ But the conditions of 'preserving joins' and 'being a left adjoint' are more closely connected that this theorem acknowledges. In Lecture 16 we went on to prove this:

Adjoint Functor Theorem for Posets.Suppose \(X\) is a poset that has all joins and \( Y \) is any poset. Then a monotone map \(f : X \to Y \) is a left adjoint if and only if it preserves all joins.Using this, we see that if \(\mathcal{V}\) is a monoidal poset with all joins, and the operation \(a \otimes -\) preserves joins, it must be a left adjoint! So, we get this nice result, which is a special case of Proposition 2.70 in

Seven Sketches:Theorem.If \(\mathcal{V}\) is a monoidal poset with all joins, \(\mathcal{V}\) is a quantale if and only if$$ a \otimes \left( \bigvee_{b\in B} b\right) = \bigvee_{b \in B} (a \otimes b) $$ for every element \(a\) and every subset \(B\) of \(\mathcal{V}\).

So, to help out future students, I'll add some of this material to the lecture!

`This looks great, Matthew! Puzzle 199 would have been hard for many students because the "workhorses" required to solve this puzzle are the distributive laws: \[ a \otimes \left( \bigvee\_{b\in B} b\right) = \bigvee\_{b \in B} (a \otimes b) \quad ; \quad \bigvee\_{b\in B} (b \otimes a) = \left(\bigvee\_{b \in B} b\right) \otimes a \] which hold for every element \\(a\\) and every subset \\(B\\) of a commutative quantale \\(\mathcal{V}\\). The problem is that these need to be proved starting with the definition: **Definition.** A **quantale** \\(\mathcal{V}\\) is a closed monoidal poset that has all joins. The solution, as you so deftly note, is that \\(\mathcal{V} \\\) being closed implies that the operation \\(a \otimes - \\) is a left adjoint, so it preserves all joins. And first distributive law above says precisely that \\(a \otimes - \\) preserves all joins! The second one says that \\(- \otimes a\\) preserves all joins, but in a _commutative_ quantale we have \\(- \otimes a = a \otimes - \\). Those who are puzzled can look back at [Lecture 16](https://forum.azimuthproject.org/discussion/2031/lecture-16-chapter-1-the-adjoint-functor-theorem-for-posets/p1), where we proved this: **Theorem.** If a monotone function \\( f: X \to Y \\) is a left adjoint, it preserves joins whenever they exist. That is, whenever a set \\( S \subseteq X \\) has a join we have \[ f (\bigvee S ) = \bigvee \\{ f(x) : \; x \in S\\} . \] But the conditions of 'preserving joins' and 'being a left adjoint' are more closely connected that this theorem acknowledges. In [Lecture 16](https://forum.azimuthproject.org/discussion/2031/lecture-16-chapter-1-the-adjoint-functor-theorem-for-posets/p1) we went on to prove this: **Adjoint Functor Theorem for Posets.** Suppose \\(X\\) is a poset that has all joins and \\( Y \\) is any poset. Then a monotone map \\(f : X \to Y \\) is a left adjoint if and only if it preserves all joins. Using this, we see that if \\(\mathcal{V}\\) is a monoidal poset with all joins, and the operation \\(a \otimes -\\) preserves joins, it must be a left adjoint! So, we get this nice result, which is a special case of Proposition 2.70 in _[Seven Sketches](http://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf)_: **Theorem.** If \\(\mathcal{V}\\) is a monoidal poset with all joins, \\(\mathcal{V}\\) is a quantale if and only if \[ a \otimes \left( \bigvee\_{b\in B} b\right) = \bigvee\_{b \in B} (a \otimes b) \] for every element \\(a\\) and every subset \\(B\\) of \\(\mathcal{V}\\). So, to help out future students, I'll add some of this material to the lecture!`

Matthew wrote:

I don't see any problem with that. Suppose we have a poset \(\mathcal{V}\) with all joins, and a doubly indexed family of elements in \(\mathcal{V}\), say \( \lbrace v_{a b} \rbrace_{a \in A, b \in B} \) where \(A\) and \(B\) are arbitrary sets. Then

$$ \bigvee_{a \in A} \bigvee_{b \in B} v_{ab} = \bigvee_{a \in A, b \in B} v_{ab} = \bigvee_{b \in B} \bigvee_{a \in A} v_{ab} $$ It takes a bit of work to show this, but it seems so obvious I don't have the energy right now. All three are just different ways of thinking about the least upper bound of all the elements \(v_{a b}\).

I guess in real analysis one should have seen this sort of fact when \(\mathcal{V} = [-\infty,\infty] \) is the extended real number line.

This fact implies a related fact for sums of arbitrary collections of numbers in \([0,\infty]\):

$$ \sum_{a \in A} \sum_{b \in B} v_{ab} = \sum_{a \in A, b \in B} v_{ab} = \sum_{b \in B} \sum_{a \in A} v_{ab} $$ The reason is that these sums are defined as suprema of partial sums.

`Matthew wrote: > As a note, Anindya remarks in comment #22 of Lecture 62, there may be issues with that lattice identity I have tried to use... I don't see any problem with that. Suppose we have a poset \\(\mathcal{V}\\) with all joins, and a doubly indexed family of elements in \\(\mathcal{V}\\), say \\( \lbrace v_{a b} \rbrace_{a \in A, b \in B} \\) where \\(A\\) and \\(B\\) are arbitrary sets. Then \[ \bigvee_{a \in A} \bigvee_{b \in B} v_{ab} = \bigvee_{a \in A, b \in B} v_{ab} = \bigvee_{b \in B} \bigvee_{a \in A} v_{ab} \] It takes a bit of work to show this, but it seems so obvious I don't have the energy right now. All three are just different ways of thinking about the least upper bound of all the elements \\(v_{a b}\\). I guess in real analysis one should have seen this sort of fact when \\(\mathcal{V} = [-\infty,\infty] \\) is the [extended real number line](https://en.wikipedia.org/wiki/Extended_real_number_line). This fact implies a related fact for sums of arbitrary collections of numbers in \\([0,\infty]\\): \[ \sum_{a \in A} \sum_{b \in B} v_{ab} = \sum_{a \in A, b \in B} v_{ab} = \sum_{b \in B} \sum_{a \in A} v_{ab} \] The reason is that these sums are defined as suprema of partial sums.`

OK, so still a bit behind, but more caught up on the material of this chapter - sorry I haven't tried any exercises in a while. It would be useful to get a sense of the motivation for the direction this chapter seems to be building in, namely a category where morphisms are quantale enriched profunctors. Also, there seems to be analogy between treating functors of type (XxY->2) as morphisms in a new category and the lower level phenomenon of treating functions of type (XxY->2) as morphisms in a new category (Rel).

`OK, so still a bit behind, but more caught up on the material of this chapter - sorry I haven't tried any exercises in a while. It would be useful to get a sense of the motivation for the direction this chapter seems to be building in, namely a category where morphisms are quantale enriched profunctors. Also, there seems to be analogy between treating functors of type (XxY->2) as morphisms in a new category and the lower level phenomenon of treating functions of type (XxY->2) as morphisms in a new category (Rel).`

Reuben:

I tried to give that motivation in the first few lectures:

(a general introduction to the meaning of enriched profunctors as relating 'requirements' - things you want - to 'resources' - things you have... and a tiny taste of their application to collaborative design)

(showing how the definition of a \(\textbf{Bool}\)-enriched profunctor is natural when you think of it as describing a relation between requirements and resources)

(a similar example, but now instead of just either being able to get from some resources to some requirements, you have to pay a certain

costto get from the resources to the requirements)In most of my examples so far I've found it easiest to talk about the process of getting this from that in terms of

travelling between cities, because it's such a beautiful visual metaphor. But we could equally well be talking aboutturning any resource into any product.There's a lot more motivation in the book, so please read that too!

In this particular chapter, Fong and Spivak go through the business of building a category where morphisms are quantale-enriched profunctors very rapidly, and spend most of their time drawing pictures of examples. So, I decided to spend more time on the details they skim over.

Once we get this category - which we'll have as soon as people solve the puzzles in this lecture! - I'll try to use it for something.

The main paper on this subject is:

If you have more precise questions, please ask!

`Reuben: > It would be useful to get a sense of the motivation for the direction this chapter seems to be building in, namely a category where morphisms are quantale enriched profunctors. I tried to give that motivation in the first few lectures: * [Lecture 55 - Chapter 4: Enriched Profunctors and Collaborative Design](https://forum.azimuthproject.org/discussion/2278/lecture-55-chapter-4-enriched-profunctors/p1) (a general introduction to the meaning of enriched profunctors as relating 'requirements' - things you want - to 'resources' - things you have... and a tiny taste of their application to collaborative design) * [Lecture 56 - Chapter 4: Feasibility Relations](https://forum.azimuthproject.org/discussion/2280/lecture-56-chapter-4-feasibility-relations/p1) (showing how the definition of a \\(\textbf{Bool}\\)-enriched profunctor is natural when you think of it as describing a relation between requirements and resources) * [Lecture 59 - Chapter 4: Cost-Enriched Profunctors](https://forum.azimuthproject.org/discussion/2285/lecture-59-chapter-4-cost-enriched-profunctors/p1) (a similar example, but now instead of just either being able to get from some resources to some requirements, you have to pay a certain _cost_ to get from the resources to the requirements) In most of my examples so far I've found it easiest to talk about the process of getting this from that in terms of _travelling between cities_, because it's such a beautiful visual metaphor. But we could equally well be talking about _turning any resource into any product_. There's a lot more motivation in [the book](http://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf), so please read that too! In this particular chapter, Fong and Spivak go through the business of building a category where morphisms are quantale-enriched profunctors very rapidly, and spend most of their time drawing pictures of examples. So, I decided to spend more time on the details they skim over. Once we get this category - which we'll have as soon as people solve the puzzles in this lecture! - I'll try to use it for something. The main paper on this subject is: * Andrea Censi, [A mathematical theory of co-design](https://arxiv.org/abs/1512.08055). If you have more precise questions, please ask!`

By the way, we're starting to use a fact we may not have proved. Let's prove it! It's not hard, but it's good to be fill in all the details.

First, suppose \(\mathcal{V}\) is a monoidal preorder. It's easy to show there is a monotone function

$$ a \otimes - : \mathcal{V} \to \mathcal{V} $$ that sends any \(x \in \mathcal{V} \) to \(a \otimes x \in \mathcal{V}\). To see that it's monotone we just need to show

$$ x \le y \text{ implies } a \otimes x \le a \otimes y .$$ But this follows from the definition of monoidal poset: the tensor product is monotone in each argument!

Next:

Theorem.Suppose \(\mathcal{V}\) is a monoidal poset. Show that \(\mathcal{V}\) is closed iff for every element \(x \in \mathcal{V}\) the monotone function \(x \otimes -: \mathcal{V} \to \mathcal{V}\) has a right adjoint.Puzzle.Prove this theorem!You get to use this definition:

Definition.A monoidal poset isclosedif for all elements \(x,y \in \mathcal{V}\) there is an element \(x \multimap y \in \mathcal{V}\) such that$$ x \otimes a \le y \text{ if and only if } a \le x \multimap y $$ for all \(a \in \mathcal{V}\).

The theorem is

almostobvious, but there's one thing to check that you may not have checked. Also:Puzzle.In a closed monoidal poset, is the element \(x \multimap y\) unique? Can you guess why I'm using posets instead of preorders here?`By the way, we're starting to use a fact we may not have proved. Let's prove it! It's not hard, but it's good to be fill in all the details. First, suppose \\(\mathcal{V}\\) is a monoidal preorder. It's easy to show there is a monotone function \[ a \otimes - : \mathcal{V} \to \mathcal{V} \] that sends any \\(x \in \mathcal{V} \\) to \\(a \otimes x \in \mathcal{V}\\). To see that it's monotone we just need to show \[ x \le y \text{ implies } a \otimes x \le a \otimes y .\] But this follows from the definition of monoidal poset: the tensor product is monotone in each argument! Next: **Theorem.** Suppose \\(\mathcal{V}\\) is a monoidal poset. Show that \\(\mathcal{V}\\) is closed iff for every element \\(x \in \mathcal{V}\\) the monotone function \\(x \otimes -: \mathcal{V} \to \mathcal{V}\\) has a right adjoint. **Puzzle.** Prove this theorem! You get to use this definition: **Definition.** A monoidal poset is **closed** if for all elements \\(x,y \in \mathcal{V}\\) there is an element \\(x \multimap y \in \mathcal{V}\\) such that \[ x \otimes a \le y \text{ if and only if } a \le x \multimap y \] for all \\(a \in \mathcal{V}\\). The theorem is _almost_ obvious, but there's one thing to check that you may not have checked. Also: **Puzzle.** In a closed monoidal poset, is the element \\(x \multimap y\\) unique? Can you guess why I'm using posets instead of preorders here?`

John wrote:

I think Anindya is wondering about how this generalizes to a categorical setting, using an

endlike Bartosz Milewski uses in his treatment of profunctor optics on his blog.I'll try a proof, however. In any semilattice with arbitrary joins, we have the following chain of equivalences:

$$ \begin{align} \bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b) \leq X & \iff \text{for all } a \text{ in } A \text{: } \bigvee_{b \in B} \phi(a,b) \leq X \\ & \iff \text{for all } a \text{ in } A \text{, for all } b \text{ in } B \text{: } \phi(a,b) \leq X \\ & \iff \text{for all } b \text{ in } B \text{, for all } a \text{ in } A \text{: } \phi(a,b) \leq X \\ & \iff \text{for all } b \text{ in } B \text{: } \bigvee_{a \in A} \phi(a,b) \leq X \\ & \iff \bigvee_{b \in B} \bigvee_{a \in A} \phi(a,b) \leq X \\ \end{align} $$ We know that \(\bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b) \leq \bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b)\), hence \(\bigvee_{b \in B} \bigvee_{a \in A} \phi(a,b) \leq \bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b)\). Symmetrically we have \(\bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b) \leq \bigvee_{b \in B} \bigvee_{a \in A} \phi(a,b)\), hence \(\bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b) = \bigvee_{b \in B} \bigvee_{a \in A} \phi(a,b) \).

I know I'm like a dog with a bone with this stuff, but argument rests on a first order logic tautology:

$$ \forall x. \phi(x) \to (\forall y. \psi(y) \to \chi(x,y)) \iff \forall y. \psi(y) \to (\forall x. \phi(x) \to \chi(x,y)) $$

`John wrote: >> As a note, Anindya remarks in comment #22 of Lecture 62, there may be issues with that lattice identity I have tried to use... > > I don't see any problem with that. Suppose we have a poset \\(\mathcal{V}\\) with all joins, and a doubly indexed family of elements in \\(\mathcal{V}\\), say \\( \lbrace v_{a b} \rbrace_{a \in A, b \in B} \\) where \\(A\\) and \\(B\\) are arbitrary sets. Then > > \[ \bigvee_{a \in A} \bigvee_{b \in B} v_{ab} = \bigvee_{a \in A, b \in B} v_{ab} = \bigvee_{b \in B} \bigvee_{a \in A} v_{ab} \] > > It takes a bit of work to show this, but it seems so obvious I don't have the energy right now. I think Anindya is wondering about how this generalizes to a categorical setting, using an *end* like Bartosz Milewski uses in his treatment of [profunctor optics](https://bartoszmilewski.com/2017/07/07/profunctor-optics-the-categorical-view/) on his blog. I'll try a proof, however. In any semilattice with arbitrary joins, we have the following chain of equivalences: \[ \begin{align} \bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b) \leq X & \iff \text{for all } a \text{ in } A \text{: } \bigvee_{b \in B} \phi(a,b) \leq X \\\\ & \iff \text{for all } a \text{ in } A \text{, for all } b \text{ in } B \text{: } \phi(a,b) \leq X \\\\ & \iff \text{for all } b \text{ in } B \text{, for all } a \text{ in } A \text{: } \phi(a,b) \leq X \\\\ & \iff \text{for all } b \text{ in } B \text{: } \bigvee_{a \in A} \phi(a,b) \leq X \\\\ & \iff \bigvee_{b \in B} \bigvee_{a \in A} \phi(a,b) \leq X \\\\ \end{align} \] We know that \\(\bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b) \leq \bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b)\\), hence \\(\bigvee_{b \in B} \bigvee_{a \in A} \phi(a,b) \leq \bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b)\\). Symmetrically we have \\(\bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b) \leq \bigvee_{b \in B} \bigvee_{a \in A} \phi(a,b)\\), hence \\(\bigvee_{a \in A} \bigvee_{b \in B} \phi(a,b) = \bigvee_{b \in B} \bigvee_{a \in A} \phi(a,b) \\). I know I'm like a dog with a bone with this stuff, but argument rests on a first order logic tautology: \[ \forall x. \phi(x) \to (\forall y. \psi(y) \to \chi(x,y)) \iff \forall y. \psi(y) \to (\forall x. \phi(x) \to \chi(x,y)) \]`

Reuben wrote:

Yes! This is one of many instances of how the same patterns keep reappearing in richer and richer ways as one advances deeper into category theory.

An easy way to think about this is that any set can be reinterpreted as

discreteposet, meaning one where \(x\le y\) iff \(x = y\).A monotone function (or in other words, a \(\textbf{Bool}\)-enriched profunctor) between

discreteposets is just a function between the sets they came from.A feasibility relation (or in other words, a \(\textbf{Bool}\)-enriched profunctor) between

discreteposets is just a relation between the sets they came from.Category theorists would phrase this last fact as follows: there's a full and faithful functor from the category \(\mathbf{Rel}\) into the category of \(\mathbf{Bool}\)-enriched profunctors.

`Reuben wrote: > Also, there seems to be analogy between treating functors of type (XxY->2) as morphisms in a new category and the lower level phenomenon of treating functions of type (XxY->2) as morphisms in a new category (Rel). Yes! This is one of many instances of how the same patterns keep reappearing in richer and richer ways as one advances deeper into category theory. An easy way to think about this is that any set can be reinterpreted as **discrete** poset, meaning one where \\(x\le y\\) iff \\(x = y\\). A monotone function (or in other words, a \\(\textbf{Bool}\\)-enriched profunctor) between _discrete_ posets is just a function between the sets they came from. A feasibility relation (or in other words, a \\(\textbf{Bool}\\)-enriched profunctor) between _discrete_ posets is just a relation between the sets they came from. <img width = "100" src = "http://math.ucr.edu/home/baez/mathematical/warning_sign.jpg"> Category theorists would phrase this last fact as follows: there's a [full and faithful functor](https://en.wikipedia.org/wiki/Full_and_faithful_functors) from the category \\(\mathbf{Rel}\\) into the category of \\(\mathbf{Bool}\\)-enriched profunctors.`

@John wrote:

Thinking about this further has led me to the conclusion that I'm overthinking it! I take your point that even if we were to index or structure our sets \(A\), \(B\), the

joinwould ignore that structure (since joins do not care about order or repetition).Regarding proving the "obvious" identity, here's one reasonably slick way of doing it.

We write \((\downarrow v)\) for the subset \(\{ x \in \mathcal{V} : x \leq v\}\).

We can then write the definition of join as

$$ \bigvee S \leq v \iff S \subseteq (\downarrow v) $$ But this just states that \(\bigvee\) is left adjoint to \(\downarrow\) (treating them as monotone maps between \(\mathcal{V}\) and the poset of subsets of \(\mathcal{V}\)).

So \(\bigvee\) preserves joins, ie \(\bigvee \bigcup \{ S_i : i \in I \} = \bigvee \{ \bigvee S_i : i \in I \}\).

which is what we need to show that the join of all \(v_{a b}\) = the join of the joins of its rows = the join of the joins of its columns.

`@John wrote: > Suppose we have a poset \\(\mathcal{V}\\) with all joins, and a doubly indexed family of elements in \\(\mathcal{V}\\), say \\( \lbrace v_{a b} \rbrace_{a \in A, b \in B} \\) where \\(A\\) and \\(B\\) are arbitrary sets. Then > \[ \bigvee_{a \in A} \bigvee_{b \in B} v_{ab} = \bigvee_{a \in A, b \in B} v_{ab} = \bigvee_{b \in B} \bigvee_{a \in A} v_{ab} \] > It takes a bit of work to show this, but it seems so obvious I don't have the energy right now. All three are just different ways of thinking about the least upper bound of all the elements \\(v_{a b}\\). Thinking about this further has led me to the conclusion that I'm overthinking it! I take your point that even if we were to index or structure our sets \\(A\\), \\(B\\), the _join_ would ignore that structure (since joins do not care about order or repetition). Regarding proving the "obvious" identity, here's one reasonably slick way of doing it. We write \\((\downarrow v)\\) for the subset \\(\\{ x \in \mathcal{V} : x \leq v\\}\\). We can then write the definition of join as \[ \bigvee S \leq v \iff S \subseteq (\downarrow v) \] But this just states that \\(\bigvee\\) is left adjoint to \\(\downarrow\\) (treating them as monotone maps between \\(\mathcal{V}\\) and the poset of subsets of \\(\mathcal{V}\\)). So \\(\bigvee\\) preserves joins, ie \\(\bigvee \bigcup \\{ S_i : i \in I \\} = \bigvee \\{ \bigvee S_i : i \in I \\}\\). which is what we need to show that the join of all \\(v_{a b}\\) = the join of the joins of its rows = the join of the joins of its columns.`

Okay, this ended up being a lot tougher than I was hoping, but here's my attempted proof of

Puzzle 200.Let \(\Phi : \mathcal{A} \nrightarrow \mathcal{B} \) be a \(\mathcal{V}\)-profunctor, and let \(1_{\mathcal{A}} : \mathcal{A} \nrightarrow \mathcal{A} \) and \(1_{\mathcal{B}} : \mathcal{B} \nrightarrow \mathcal{B} \) be \(\mathcal{V}\)-profunctors such that \(1_{\mathcal{A}}(x,y) = \mathcal{A}(x,y)\) and \(1_{\mathcal{B}}(x,y) = \mathcal{B}(x,y)\) .

We want to show \(1_{\mathcal{A}} \Phi = \Phi 1_{\mathcal{B}} = \Phi \). Expanding the definition of \(\mathcal{V}\)-profunctor composition and the definitions of \(1_{\mathcal{A}}\) and \(1_{\mathcal{B}}\), we need to show:

$$ \bigvee_{x \in \mathrm{obj}(\mathcal{A})} \left( \mathcal{A}(a,x) \otimes \Phi(x,b) \right) = \bigvee_{y \in \mathrm{obj}(\mathcal{B})} \left( \Phi(a,y) \otimes \mathcal{B}(y,b) \right) = \Phi(a,b) $$ I am only going to show \( \bigvee_{x \in \mathrm{obj}(\mathcal{A})} \left( \mathcal{A}(a,x) \otimes \Phi(x,b) \right) = \Phi(a,b) \), since the argument for the other identity is symmetrical.

In comment 18 in Lecture 62 Anindya Bhattacharyya identified a nice rule: if \(\mathcal{V}\) is a commutative quantale then $$ \Phi: \mathcal{A} \nrightarrow \mathcal{B} \text{ is a } \mathcal{V} \text{-profunctor} \iff \mathcal{A}(a, x) \otimes \Phi(x, y) \otimes \mathcal{B}(y, b) \leq \Phi(a, b) \text{ for all } a, x, y, b \tag{A}$$ Since \(\mathcal{B}\) is a \(\mathcal{V}\)-category we know \(I \leq \mathcal{B}(b,b)\). Using the monotony of \((x \otimes -)\) that John proved in #6, \(x \otimes I = x\) and (A) we have for all \(a\), \(x\) and \(b\)

$$ \mathcal{A}(a,x) \otimes \Phi(x,b) \leq \mathcal{A}(a,x) \otimes \Phi(x,b) \otimes \mathcal{B}(b,b) \leq \Phi(a,b) $$ Since this holds for all \(x\), we may introduce a supremum:

$$ \bigvee_{x \in \mathrm{obj}(\mathcal{A})}\mathcal{A}(a,x) \otimes \Phi(x,b) \leq \Phi(a,b) \tag{B} $$ Moreover, since \(\mathcal{A}\) is a \(\mathcal{V}\)-category we have \(I \leq \mathcal{A}(a,a)\). Using this and the identity laws, commutativity and the monotony of \((x \otimes -)\) we have $$ \Phi(a,b) \leq \mathcal{A}(a,a) \otimes \Phi(a,b) \tag{C} $$ But also notice

$$ \mathcal{A}(a,a) \otimes \Phi(a,b) \in \lbrace \mathcal{A}(a,x) \otimes \Phi(x,b)\ \mid\ x \in \mathrm{obj}(\mathcal{A}) \rbrace $$ hence

$$ \mathcal{A}(a,a) \otimes \Phi(a,b) \leq \bigvee \lbrace \mathcal{A}(a,x) \otimes \Phi(x,b)\ \mid\ x \in \mathrm{obj}(\mathcal{A}) \rbrace $$ However \(\bigvee_{x \in \mathrm{obj}(\mathcal{A})}\mathcal{A}(a,x) \otimes \Phi(x,b)\) is really just syntactic sugar for \(\bigvee \lbrace \mathcal{A}(a,x) \otimes \Phi(x,b)\ \mid\ x \in \mathrm{obj}(\mathcal{A}) \rbrace\). Using the nicer notation, we have:

$$ \mathcal{A}(a,a) \otimes \Phi(a,b) \leq \bigvee_{x \in \mathrm{obj}(\mathcal{A})}\mathcal{A}(a,x) \otimes \Phi(x,b) $$ with (C) we have

$$ \Phi(a,b) \leq \bigvee_{x \in \mathrm{obj}(\mathcal{A})}\mathcal{A}(a,x) \otimes \Phi(x,b) \tag{D} $$ From (B) and (D) it follows that \(\bigvee_{x \in \mathrm{obj}(\mathcal{A})} \left( \mathcal{A}(a,x) \otimes \Phi(x,b) \right) = \Phi(a,b)\) as desired \( \qquad \blacksquare \)

`Okay, this ended up being a lot tougher than I was hoping, but here's my attempted proof of **Puzzle 200**. > **Puzzle 200.** Suppose that \\(\mathcal{V}\\) is a commutative quantale and \\(\mathcal{X}\\) is a \\(\mathcal{V}\\)-enriched category. The hom-functor > > \[ \mathrm{hom} : \mathcal{X}^{\text{op}} \times \mathcal{X} \to \mathcal{V} \] > > described in [Puzzle 197](https://forum.azimuthproject.org/discussion/2292/lecture-62-chapter-4-constructing-enriched-categories/p1) gives an enriched profunctor that we call \\(1_{\mathcal{V}} \colon \mathcal{V} \to \mathcal{V}\\). Show that this serves as an identity for composition of \\(\mathcal{V}\\)-enriched profunctors: check the left and right unit laws. Let \\(\Phi : \mathcal{A} \nrightarrow \mathcal{B} \\) be a \\(\mathcal{V}\\)-profunctor, and let \\(1_{\mathcal{A}} : \mathcal{A} \nrightarrow \mathcal{A} \\) and \\(1_{\mathcal{B}} : \mathcal{B} \nrightarrow \mathcal{B} \\) be \\(\mathcal{V}\\)-profunctors such that \\(1_{\mathcal{A}}(x,y) = \mathcal{A}(x,y)\\) and \\(1_{\mathcal{B}}(x,y) = \mathcal{B}(x,y)\\) . We want to show \\(1_{\mathcal{A}} \Phi = \Phi 1_{\mathcal{B}} = \Phi \\). Expanding the definition of \\(\mathcal{V}\\)-profunctor composition and the definitions of \\(1_{\mathcal{A}}\\) and \\(1_{\mathcal{B}}\\), we need to show: \[ \bigvee_{x \in \mathrm{obj}(\mathcal{A})} \left( \mathcal{A}(a,x) \otimes \Phi(x,b) \right) = \bigvee_{y \in \mathrm{obj}(\mathcal{B})} \left( \Phi(a,y) \otimes \mathcal{B}(y,b) \right) = \Phi(a,b) \] I am only going to show \\( \bigvee_{x \in \mathrm{obj}(\mathcal{A})} \left( \mathcal{A}(a,x) \otimes \Phi(x,b) \right) = \Phi(a,b) \\), since the argument for the other identity is symmetrical. In [comment 18](https://forum.azimuthproject.org/discussion/comment/20194/#Comment_20194) in Lecture 62 Anindya Bhattacharyya identified a nice rule: if \\(\mathcal{V}\\) is a commutative quantale then \[ \Phi: \mathcal{A} \nrightarrow \mathcal{B} \text{ is a } \mathcal{V} \text{-profunctor} \iff \mathcal{A}(a, x) \otimes \Phi(x, y) \otimes \mathcal{B}(y, b) \leq \Phi(a, b) \text{ for all } a, x, y, b \tag{A}\] Since \\(\mathcal{B}\\) is a \\(\mathcal{V}\\)-category we know \\(I \leq \mathcal{B}(b,b)\\). Using the monotony of \\((x \otimes -)\\) that John proved in [#6](https://forum.azimuthproject.org/discussion/comment/20236/#Comment_20236), \\(x \otimes I = x\\) and (A) we have for all \\(a\\), \\(x\\) and \\(b\\) \[ \mathcal{A}(a,x) \otimes \Phi(x,b) \leq \mathcal{A}(a,x) \otimes \Phi(x,b) \otimes \mathcal{B}(b,b) \leq \Phi(a,b) \] Since this holds for all \\(x\\), we may introduce a supremum: \[ \bigvee_{x \in \mathrm{obj}(\mathcal{A})}\mathcal{A}(a,x) \otimes \Phi(x,b) \leq \Phi(a,b) \tag{B} \] Moreover, since \\(\mathcal{A}\\) is a \\(\mathcal{V}\\)-category we have \\(I \leq \mathcal{A}(a,a)\\). Using this and the identity laws, commutativity and the monotony of \\((x \otimes -)\\) we have \[ \Phi(a,b) \leq \mathcal{A}(a,a) \otimes \Phi(a,b) \tag{C} \] But also notice \[ \mathcal{A}(a,a) \otimes \Phi(a,b) \in \lbrace \mathcal{A}(a,x) \otimes \Phi(x,b)\ \mid\ x \in \mathrm{obj}(\mathcal{A}) \rbrace \] hence \[ \mathcal{A}(a,a) \otimes \Phi(a,b) \leq \bigvee \lbrace \mathcal{A}(a,x) \otimes \Phi(x,b)\ \mid\ x \in \mathrm{obj}(\mathcal{A}) \rbrace \] However \\(\bigvee_{x \in \mathrm{obj}(\mathcal{A})}\mathcal{A}(a,x) \otimes \Phi(x,b)\\) is really just syntactic sugar for \\(\bigvee \lbrace \mathcal{A}(a,x) \otimes \Phi(x,b)\ \mid\ x \in \mathrm{obj}(\mathcal{A}) \rbrace\\). Using the nicer notation, we have: \[ \mathcal{A}(a,a) \otimes \Phi(a,b) \leq \bigvee_{x \in \mathrm{obj}(\mathcal{A})}\mathcal{A}(a,x) \otimes \Phi(x,b) \] with (C) we have \[ \Phi(a,b) \leq \bigvee_{x \in \mathrm{obj}(\mathcal{A})}\mathcal{A}(a,x) \otimes \Phi(x,b) \tag{D} \] From (B) and (D) it follows that \\(\bigvee_{x \in \mathrm{obj}(\mathcal{A})} \left( \mathcal{A}(a,x) \otimes \Phi(x,b) \right) = \Phi(a,b)\\) as desired \\( \qquad \blacksquare \\)`

I think we can tidy up that last bit @Matthew.

For all \(c\in\text{Ob}(\mathcal{A})\) we have \(\mathcal{A}(a, c)\otimes\Phi(c, b) \leq \bigvee\mathcal{A}(a, x)\otimes\Phi(x, b)\)

Set \(c = a\) and we get \(\mathcal{A}(a, a)\otimes\Phi(a, b) \leq \bigvee\mathcal{A}(a, x)\otimes\Phi(x, b)\)

Then \(I\leq\mathcal{A}(a, a)\) tells us \(\Phi(a, b) \leq \bigvee\mathcal{A}(a, x)\otimes\Phi(x, b)\)

`I think we can tidy up that last bit @Matthew. For all \\(c\in\text{Ob}(\mathcal{A})\\) we have \\(\mathcal{A}(a, c)\otimes\Phi(c, b) \leq \bigvee\mathcal{A}(a, x)\otimes\Phi(x, b)\\) Set \\(c = a\\) and we get \\(\mathcal{A}(a, a)\otimes\Phi(a, b) \leq \bigvee\mathcal{A}(a, x)\otimes\Phi(x, b)\\) Then \\(I\leq\mathcal{A}(a, a)\\) tells us \\(\Phi(a, b) \leq \bigvee\mathcal{A}(a, x)\otimes\Phi(x, b)\\)`

I thought it might be worth explicitly spelling out the "profunctor rule" @Matthew mentions in his proof.

Proof: (1) is true iff \(\Phi : \mathcal{X}^\text{op} \times \mathcal{Y} \to \mathcal{V}\) is a \(\mathcal{V}\)-functor, which is true iff$$ (\mathcal{X}^\text{op} \times \mathcal{Y})((x, y), (a, b)) \leq \mathcal{V}(\Phi(x, y), \Phi(a, b)) $$ for all \((x, y)\) and \((a, b)\). Unwrapping the left and right hand sides, this is equivalent to

$$ \mathcal{X}(a, x) \otimes \mathcal{Y}(y, b) \leq \Phi(x, y) \multimap \Phi(a, b) $$ for all \(a, x, y, b\). But the adjunction definition of \(\multimap\) tells us that this is equivalent to

$$ \Phi(x, y) \otimes \mathcal{X}(a, x) \otimes \mathcal{Y}(y, b) \leq \Phi(a, b) $$ We can reorder the left hand side because \(\otimes\) is commutative – this shows that (1) is equivalent to (2).

Note that \(I \leq \mathcal{X}(x, x)\) and \(I \leq \mathcal{Y}(y, y)\) by the definition of a \(\mathcal{V}\)-category. So given (2) we can set \(b = y\) to get

$$ \mathcal{X}(a, x) \otimes \Phi(x, y) = \mathcal{X}(a, x) \otimes \Phi(x, y) \otimes I \leq \mathcal{X}(a, x) \otimes \Phi(x, y) \otimes \mathcal{Y}(y, y) \leq \Phi(a, y) $$ Or we can set \(a = x\) to get

$$ \Phi(x, y) \otimes \mathcal{Y}(y, b) = I \otimes \Phi(x, y) \otimes \mathcal{Y}(y, b) \leq \mathcal{X}(x, x) \otimes \Phi(x, y) \otimes \mathcal{Y}(y, b) \leq \Phi(x, b) $$ So (2) implies (3). Finally, assume (3) and then

$$ \mathcal{X}(a, x) \otimes \Phi(x, y) \otimes \mathcal{Y}(y, b) \leq \Phi(a, y) \otimes \mathcal{Y}(y, b) \leq \Phi(a, b) $$ so (3) implies (2) and we are done. QED

`I thought it might be worth explicitly spelling out the "profunctor rule" @Matthew mentions in his proof. > **Theorem**: the following are equivalent: > (1) \\(\qquad\Phi : \mathcal{X} \nrightarrow \mathcal{Y}\\) is a profunctor > (2) \\(\qquad\mathcal{X}(a, x) \otimes \Phi(x, y) \otimes \mathcal{Y}(y, b) \leq \Phi(a, b)\\) for all \\(a, x, y, b\\) >(3) \\(\qquad\mathcal{X}(a, x) \otimes \Phi(x, y) \leq \Phi(a, y)\\) and \\(\Phi(x, y) \otimes \mathcal{Y}(y, b) \leq \Phi(x, b)\\) for all \\(a, x, y, b\\) **Proof**: (1) is true iff \\(\Phi : \mathcal{X}^\text{op} \times \mathcal{Y} \to \mathcal{V}\\) is a \\(\mathcal{V}\\)-functor, which is true iff \[ (\mathcal{X}^\text{op} \times \mathcal{Y})((x, y), (a, b)) \leq \mathcal{V}(\Phi(x, y), \Phi(a, b)) \] for all \\((x, y)\\) and \\((a, b)\\). Unwrapping the left and right hand sides, this is equivalent to \[ \mathcal{X}(a, x) \otimes \mathcal{Y}(y, b) \leq \Phi(x, y) \multimap \Phi(a, b) \] for all \\(a, x, y, b\\). But the adjunction definition of \\(\multimap\\) tells us that this is equivalent to \[ \Phi(x, y) \otimes \mathcal{X}(a, x) \otimes \mathcal{Y}(y, b) \leq \Phi(a, b) \] We can reorder the left hand side because \\(\otimes\\) is commutative – this shows that (1) is equivalent to (2). Note that \\(I \leq \mathcal{X}(x, x)\\) and \\(I \leq \mathcal{Y}(y, y)\\) by the definition of a \\(\mathcal{V}\\)-category. So given (2) we can set \\(b = y\\) to get \[ \mathcal{X}(a, x) \otimes \Phi(x, y) = \mathcal{X}(a, x) \otimes \Phi(x, y) \otimes I \leq \mathcal{X}(a, x) \otimes \Phi(x, y) \otimes \mathcal{Y}(y, y) \leq \Phi(a, y) \] Or we can set \\(a = x\\) to get \[ \Phi(x, y) \otimes \mathcal{Y}(y, b) = I \otimes \Phi(x, y) \otimes \mathcal{Y}(y, b) \leq \mathcal{X}(x, x) \otimes \Phi(x, y) \otimes \mathcal{Y}(y, b) \leq \Phi(x, b) \] So (2) implies (3). Finally, assume (3) and then \[ \mathcal{X}(a, x) \otimes \Phi(x, y) \otimes \mathcal{Y}(y, b) \leq \Phi(a, y) \otimes \mathcal{Y}(y, b) \leq \Phi(a, b) \] so (3) implies (2) and we are done. QED`

@Anindya

I think you have a typo.

should say

`@Anindya I think you have a typo. > > (1) \\(\qquad\Phi : \mathcal{X}^\text{op} \nrightarrow \mathcal{Y}\\) is a profunctor should say > > (1) \\(\qquad\Phi : \mathcal{X} \nrightarrow \mathcal{Y}\\) is a profunctor`

cheers, corrected!

`cheers, corrected!`

Anindya wrote:

I think there is a typo. \(\mathcal{Y}(a, b)\) should be \(\mathcal{Y}(y, b)\)?

`Anindya wrote: >for all \\((x, y)\\) and \\((a, b)\\). Unwrapping the left and right hand sides, this is equivalent to >\[ \mathcal{X}(a, x) \otimes \mathcal{Y}(a, b) \leq \Phi(x, y) \multimap \Phi(a, b) \] >for all \\(a, x, y, b\\). But the adjunction definition of \\(\multimap\\) tells us that this is equivalent to >\[ \Phi(x, y) \otimes \mathcal{X}(a, x) \otimes \mathcal{Y}(a, b) \leq \Phi(a, b) \] I think there is a typo. \\(\mathcal{Y}(a, b)\\) should be \\(\mathcal{Y}(y, b)\\)?`

Anindya wrote:

I think this is a typo too? \(\Phi : \mathcal{X} \times \mathcal{Y} \to \mathcal{V}\) should read \(\Phi : \mathcal{X}^ {op} \times \mathcal{Y} \to \mathcal{V}\)

`Anindya wrote: >**Proof**: (1) is true iff \\(\Phi : \mathcal{X} \times \mathcal{Y} \to \mathcal{V}\\) is a \\(\mathcal{V}\\)-functor, which is true iff I think this is a typo too? \\(\Phi : \mathcal{X} \times \mathcal{Y} \to \mathcal{V}\\) should read \\(\Phi : \mathcal{X}^ {op} \times \mathcal{Y} \to \mathcal{V}\\)`

cheers again, hopefully all fixed now

`cheers again, hopefully all fixed now`

We need to check:

1. \(\Psi\Phi: Ob(\mathcal{X^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{V})\)We are given: $$\Phi : Ob(\mathcal{X^{op}} \times \mathcal{Y}) \rightarrow Ob(\mathcal{V})$$ $$\Psi : Ob(\mathcal{Y^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{V})$$ First we compose the two:

$$\Psi\Phi : Ob(\mathcal{Y^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{X^{op}} \times \mathcal{Y}) \rightarrow Ob(\mathcal{V})$$ We can switch the order using opposite categories: $$\Psi\Phi : Ob(\mathcal{Z^{op}} \times \mathcal{Y}) \rightarrow Ob( \mathcal{Y^{op}} \times \mathcal{X}) \rightarrow Ob(\mathcal{V})$$ Then by currying : $$\Psi\Phi : \mathcal{Z^{op}} \rightarrow \mathcal{Y} \rightarrow \mathcal{Y^{op}} \rightarrow \mathcal{X} \rightarrow Ob(\mathcal{V})$$ By transitivity: $$\Psi\Phi : \mathcal{Z^{op}} \rightarrow \mathcal{X} \rightarrow Ob(\mathcal{V})$$ Curry back out and switch the order using opposites: $$\Psi\Phi: Ob(\mathcal{X^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{V})$$

2. \((\mathcal{X}^{op} \times \mathcal{Z})(x_1, z_1), (x_2, z_2)) \leq \mathcal{V}(\Psi\Phi(x_1, z_1), \Psi\Phi(x_2, z_2))\)Since \(\Phi\) and \(\Psi\) are \(\mathcal{V}\)-enriched functors, using our "profunctor rule" we have: $$\mathcal{X}(x_2, x_1) \otimes \Phi(x_1, y_1) \otimes \mathcal{Y}(y_1, y_2) \leq \Phi(x_2, y_2)$$ $$\mathcal{Y}(Y_2, y_1) \otimes \Psi(y_1, z_1) \otimes \mathcal{Z}(z_1, z_2) \leq \Psi(y_2, z_2)$$ Then we can combine these two: $$\mathcal{X}(x_2, x_1) \otimes \Phi(x_1, y_1) \otimes \mathcal{Y}(y_1, y_2) \otimes \mathcal{Y}(y_2, y_1) \otimes \Psi(y_1, z_1) \otimes \mathcal{Z}(z_1, z_2) \leq \Phi(x_2, y_2) \otimes \Psi(y_2, z_2)$$ \(\mathcal{Y}(y_1, y_2) \otimes \mathcal{Y}(y_2, y_1)\) cancels out since we are going back and forth: $$\mathcal{X}(x_2, x_1) \otimes \Phi(x_1, y_1) \otimes \Psi(y_1, z_1) \otimes \mathcal{Z}(z_1, z_2) \leq \Phi(x_2, y_2) \otimes \Psi(y_2, z_2)$$ Then by definition of profunctor composition, we can combine \(\Phi\) and \(\Psi\) terms: $$\mathcal{X}(x_2, x_1) \otimes \Psi\Phi(x_1, z_1) \otimes \mathcal{Z}(z_1, z_2) \leq \Psi\Phi(x_2, z_2)$$ Since \(\mathcal{V}\) is commutative and closed, we get: $$\mathcal{X}(x_2, x_1) \otimes \mathcal{Z}(z_1, z_2) \leq \Psi\Phi(x_1, z_1) \multimap \Psi\Phi(x_2, z_2)$$ By definition of product category given in Lecture 62: $$(\mathcal{X}^{op} \times \mathcal{Z})(x_1, z_1), (x_2, z_2)) \leq \Psi\Phi(x_1, z_1) \multimap \Psi\Phi(x_2, z_2)$$ By definition of \(\mathcal{V}\) being a closed monoidal preorder: $$(\mathcal{X}^{op} \times \mathcal{Z})(x_1, z_1), (x_2, z_2)) \leq \mathcal{V}(\Psi\Phi(x_1, z_1), \Psi\Phi(x_2, z_2))$$

`>**Puzzle 198.** Suppose \\(\mathcal{V}\\) is a commutative quantale, and suppose >\\( \Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} \\) and \\( \Psi \colon \mathcal{Y}^{\text{op}} \times \mathcal{Z} \to \mathcal{V} \\) are \\(\mathcal{V}\\)-enriched functors. Show that \\( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} \\), defined by >\[ (\Psi\Phi)(x,z) = \bigvee_{y \in Y} \Phi(x,y) \otimes \Psi(y,z),\] >is a \\(\mathcal{V}\\)-enriched functor. There are two axioms to check - you can find them in [Lecture 32](https://forum.azimuthproject.org/discussion/2169/lecture-32-chapter-2-enriched-functors/p1). We need to check: 1. \\(\Psi\Phi: Ob(\mathcal{X^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{V})\\) 2. \\((\mathcal{X}^{op} \times \mathcal{Z})(x_1, z_1), (x_2, z_2)) \leq \mathcal{V}(\Psi\Phi(x_1, z_1), \Psi\Phi(x_2, z_2))\\) **1. \\(\Psi\Phi: Ob(\mathcal{X^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{V})\\)** We are given: \[\Phi : Ob(\mathcal{X^{op}} \times \mathcal{Y}) \rightarrow Ob(\mathcal{V})\] \[\Psi : Ob(\mathcal{Y^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{V})\] First we compose the two: \[\Psi\Phi : Ob(\mathcal{Y^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{X^{op}} \times \mathcal{Y}) \rightarrow Ob(\mathcal{V})\] We can switch the order using opposite categories: \[\Psi\Phi : Ob(\mathcal{Z^{op}} \times \mathcal{Y}) \rightarrow Ob( \mathcal{Y^{op}} \times \mathcal{X}) \rightarrow Ob(\mathcal{V})\] Then by currying : \[\Psi\Phi : \mathcal{Z^{op}} \rightarrow \mathcal{Y} \rightarrow \mathcal{Y^{op}} \rightarrow \mathcal{X} \rightarrow Ob(\mathcal{V})\] By transitivity: \[\Psi\Phi : \mathcal{Z^{op}} \rightarrow \mathcal{X} \rightarrow Ob(\mathcal{V})\] Curry back out and switch the order using opposites: \[\Psi\Phi: Ob(\mathcal{X^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{V})\] **2. \\((\mathcal{X}^{op} \times \mathcal{Z})(x_1, z_1), (x_2, z_2)) \leq \mathcal{V}(\Psi\Phi(x_1, z_1), \Psi\Phi(x_2, z_2))\\)** Since \\(\Phi\\) and \\(\Psi\\) are \\(\mathcal{V}\\)-enriched functors, using our "profunctor rule" we have: \[\mathcal{X}(x_2, x_1) \otimes \Phi(x_1, y_1) \otimes \mathcal{Y}(y_1, y_2) \leq \Phi(x_2, y_2)\] \[\mathcal{Y}(Y_2, y_1) \otimes \Psi(y_1, z_1) \otimes \mathcal{Z}(z_1, z_2) \leq \Psi(y_2, z_2)\] Then we can combine these two: \[\mathcal{X}(x_2, x_1) \otimes \Phi(x_1, y_1) \otimes \mathcal{Y}(y_1, y_2) \otimes \mathcal{Y}(y_2, y_1) \otimes \Psi(y_1, z_1) \otimes \mathcal{Z}(z_1, z_2) \leq \Phi(x_2, y_2) \otimes \Psi(y_2, z_2)\] \\(\mathcal{Y}(y_1, y_2) \otimes \mathcal{Y}(y_2, y_1)\\) cancels out since we are going back and forth: \[\mathcal{X}(x_2, x_1) \otimes \Phi(x_1, y_1) \otimes \Psi(y_1, z_1) \otimes \mathcal{Z}(z_1, z_2) \leq \Phi(x_2, y_2) \otimes \Psi(y_2, z_2)\] Then by definition of profunctor composition, we can combine \\(\Phi\\) and \\(\Psi\\) terms: \[\mathcal{X}(x_2, x_1) \otimes \Psi\Phi(x_1, z_1) \otimes \mathcal{Z}(z_1, z_2) \leq \Psi\Phi(x_2, z_2)\] Since \\(\mathcal{V}\\) is commutative and closed, we get: \[\mathcal{X}(x_2, x_1) \otimes \mathcal{Z}(z_1, z_2) \leq \Psi\Phi(x_1, z_1) \multimap \Psi\Phi(x_2, z_2)\] By definition of product category given in [Lecture 62](https://forum.azimuthproject.org/discussion/2292/lecture-62-chapter-4-constructing-enriched-categories#latest): \[(\mathcal{X}^{op} \times \mathcal{Z})(x_1, z_1), (x_2, z_2)) \leq \Psi\Phi(x_1, z_1) \multimap \Psi\Phi(x_2, z_2)\] By definition of \\(\mathcal{V}\\) being a closed monoidal preorder: \[(\mathcal{X}^{op} \times \mathcal{Z})(x_1, z_1), (x_2, z_2)) \leq \mathcal{V}(\Psi\Phi(x_1, z_1), \Psi\Phi(x_2, z_2))\]`

Hey Michael,

I think there might be some errors in your proof:

I don't think composition works this way.

We can

`flip`

the order of arguments in a function and`curry`

them as you say.But I don't see how we can apply transitivity in the following step:

Others may correct me, but I don't think we have to work very hard to prove \(\Psi\Phi: Ob(\mathcal{X^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{V})\).

We already know the action of \(\Psi\Phi\) on objects: \((x,z) \mapsto \bigvee_{y \in Y} \Phi(x,y) \otimes \Psi(y,z)\). If we were in a programming language, like Coq, then the computer could infer this mapping has the type \( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} \) for us.

`Hey Michael, I think there might be some errors in your proof: > We are given: > \[\Phi : Ob(\mathcal{X^{op}} \times \mathcal{Y}) \rightarrow Ob(\mathcal{V})\] > \[\Psi : Ob(\mathcal{Y^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{V})\] > > First we compose the two: > > \[\Psi\Phi : Ob(\mathcal{Y^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{X^{op}} \times \mathcal{Y}) \rightarrow Ob(\mathcal{V})\] I don't think composition works this way. We can [`flip`](https://hackage.haskell.org/package/base-4.11.1.0/docs/Prelude.html#v:flip) the order of arguments in a function and [`curry`](https://hackage.haskell.org/package/base-4.11.1.0/docs/Prelude.html#v:curry) them as you say. But I don't see how we can apply transitivity in the following step: > \[\Psi\Phi : \mathcal{Z^{op}} \rightarrow \mathcal{Y} \rightarrow \mathcal{Y^{op}} \rightarrow \mathcal{X} \rightarrow Ob(\mathcal{V})\] > > By transitivity: > >\[\Psi\Phi : \mathcal{Z^{op}} \rightarrow \mathcal{X} \rightarrow Ob(\mathcal{V})\] Others may correct me, but I don't think we have to work very hard to prove \\(\Psi\Phi: Ob(\mathcal{X^{op}} \times \mathcal{Z}) \rightarrow Ob(\mathcal{V})\\). We already know the action of \\(\Psi\Phi\\) on objects: \\((x,z) \mapsto \bigvee_{y \in Y} \Phi(x,y) \otimes \Psi(y,z)\\). If we were in a programming language, like Coq, then the computer could infer this mapping has the type <strike>\\( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} \\)</strike> for us.`

Matthew

Yeah I knew the first part of the proof was dubious at best when I was writing it out. Like you said it's pretty obvious what's going on with the objects but I just didn't know how to prove it and the above result was the best I could do.

Wait, the problem asks to show \( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} \) is a \(\mathcal{V}\)-enriched category? Why isn't it \( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Z} \to \mathcal{V} \)? Maybe I don't get what's going on with the objects...

`Matthew Yeah I knew the first part of the proof was dubious at best when I was writing it out. Like you said it's pretty obvious what's going on with the objects but I just didn't know how to prove it and the above result was the best I could do. Wait, the problem asks to show \\( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} \\) is a \\(\mathcal{V}\\)-enriched category? Why isn't it \\( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Z} \to \mathcal{V} \\)? Maybe I don't get what's going on with the objects...`

I meant to write \( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Z} \to \mathcal{V} \) rather than \( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} \). My mistake!

`I meant to write \\( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Z} \to \mathcal{V} \\) rather than \\( \Psi\Phi \colon \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V} \\). My mistake!`

@Michael – I think you've got into a bit of a muddle there by confusing composition of \(\mathcal{V}\)-functors with composition of \(\mathcal{V}\)-profunctors.

For the latter we want to define a \(\Psi\Phi : \mathcal{X} \nrightarrow \mathcal{Z}\) for every pair \(\Phi : \mathcal{X} \nrightarrow \mathcal{Y}\) and \(\Psi : \mathcal{Y} \nrightarrow \mathcal{Z}\).

This amounts to defining a \(\mathcal{V}\)-functor \(\Psi\Phi : \mathcal{X}^\text{op} \times \mathcal{Z} \to \mathcal{V}\) for every pair of \(\mathcal{V}\)-functors \(\Phi : \mathcal{X}^\text{op} \times \mathcal{Y} \to \mathcal{V}\) and \(\Psi : \mathcal{Y}^\text{op} \times \mathcal{Z} \to \mathcal{V}\).

So our "composite profunctor" is

nota composite of \(\mathcal{V}\)-functors.Instead we

defineit by writing down its value in \(\mathcal{V}\) for any pair of objects \(x \in \text{Ob}(\mathcal{X}^\text{op})\) and \(z \in \text{Ob}(\mathcal{Z})\).That's what this formula does:

$$ (\Psi\Phi)(x, z) = \bigvee\big(\Phi(x, y)\otimes\Psi(y, z)\big) $$ Then we need to check that this definition is a \(\mathcal{V}\)-functor, which means proving

$$ (\mathcal{X}^\text{op}\times \mathcal{Z})((x, z), (x', z')) \leq \mathcal{V}(\Psi\Phi)(x, z), (\Psi\Phi)(x', z')) $$ which in turn amounts to proving that

$$ \mathcal{X}(x', x) \otimes \mathcal{Z}(z, z') \leq (\Psi\Phi)(x, z)\multimap(\Psi\Phi)(x', z') $$ which in turn amounts to proving that

$$ \mathcal{X}(x', x) \otimes \bigvee\big(\Phi(x, y)\otimes\Psi(y, z)\big) \otimes\mathcal{Z}(z, z') \leq \bigvee\big(\Phi(x', y)\otimes\Psi(y, z')\big) $$ This is what we need to prove, and the trick here is to use the fact that \(\otimes\) preserves joins.

`@Michael – I think you've got into a bit of a muddle there by confusing composition of \\(\mathcal{V}\\)-functors with composition of \\(\mathcal{V}\\)-profunctors. For the latter we want to define a \\(\Psi\Phi : \mathcal{X} \nrightarrow \mathcal{Z}\\) for every pair \\(\Phi : \mathcal{X} \nrightarrow \mathcal{Y}\\) and \\(\Psi : \mathcal{Y} \nrightarrow \mathcal{Z}\\). This amounts to defining a \\(\mathcal{V}\\)-functor \\(\Psi\Phi : \mathcal{X}^\text{op} \times \mathcal{Z} \to \mathcal{V}\\) for every pair of \\(\mathcal{V}\\)-functors \\(\Phi : \mathcal{X}^\text{op} \times \mathcal{Y} \to \mathcal{V}\\) and \\(\Psi : \mathcal{Y}^\text{op} \times \mathcal{Z} \to \mathcal{V}\\). So our "composite profunctor" is *not* a composite of \\(\mathcal{V}\\)-functors. Instead we *define* it by writing down its value in \\(\mathcal{V}\\) for any pair of objects \\(x \in \text{Ob}(\mathcal{X}^\text{op})\\) and \\(z \in \text{Ob}(\mathcal{Z})\\). That's what this formula does: \[ (\Psi\Phi)(x, z) = \bigvee\big(\Phi(x, y)\otimes\Psi(y, z)\big) \] Then we need to check that this definition is a \\(\mathcal{V}\\)-functor, which means proving \[ (\mathcal{X}^\text{op}\times \mathcal{Z})((x, z), (x', z')) \leq \mathcal{V}(\Psi\Phi)(x, z), (\Psi\Phi)(x', z')) \] which in turn amounts to proving that \[ \mathcal{X}(x', x) \otimes \mathcal{Z}(z, z') \leq (\Psi\Phi)(x, z)\multimap(\Psi\Phi)(x', z') \] which in turn amounts to proving that \[ \mathcal{X}(x', x) \otimes \bigvee\big(\Phi(x, y)\otimes\Psi(y, z)\big) \otimes\mathcal{Z}(z, z') \leq \bigvee\big(\Phi(x', y)\otimes\Psi(y, z')\big) \] This is what we need to prove, and the trick here is to use the fact that \\(\otimes\\) preserves joins.`

Nice work, folks! I've organized this a bit and put a lot of it into the next lecture, Lecture 64.

`Nice work, folks! I've organized this a bit and put a lot of it into the next lecture, [Lecture 64](https://forum.azimuthproject.org/discussion/2298/lecture-64-chapter-5-the-category-of-enriched-profunctors/p1).`

Edit: My reading comprehension is low and I didn't notice that a quantale needs to be closed :)

Hi,

I'm confused about the definition of quantale. You said:

Definition.Aquantaleis a closed monoidal poset \( \mathcal{V}\) that has all joins: that is, every subset of \( S\subseteq \mathcal{V}\) has a least upper bound \(\bigvee S\).And then we sketched a proof of the following:

Theorem.If \(\mathcal{V}\) is a monoidal poset with all joins, \(\mathcal{V}\) is a quantale if and only if$$ a \otimes \left( \bigvee_{b\in B} b\right) = \bigvee_{b \in A} (a \otimes b) $$ for every element \(a\) and every subset \(B\) of \(\mathcal{V}\).

But I thought that a quantale is a monoidal poset with all joins. Why do we need prove this extra condition about the monoidal product commuting with joins?

`Edit: My reading comprehension is low and I didn't notice that a quantale needs to be closed :) Hi, I'm confused about the definition of quantale. You said: **Definition.** A **quantale** is a closed monoidal poset \\( \mathcal{V}\\) that has all joins: that is, every subset of \\( S\subseteq \mathcal{V}\\) has a least upper bound \\(\bigvee S\\). And then we sketched a proof of the following: **Theorem.** If \\(\mathcal{V}\\) is a monoidal poset with all joins, \\(\mathcal{V}\\) is a quantale if and only if \[ a \otimes \left( \bigvee\_{b\in B} b\right) = \bigvee\_{b \in A} (a \otimes b) \] for every element \\(a\\) and every subset \\(B\\) of \\(\mathcal{V}\\). But I thought that a quantale is a monoidal poset with all joins. Why do we need prove this extra condition about the monoidal product commuting with joins?`

@JadeMaster: I think that the Theorem simply says that a monoidal poset with all joins is closed (hence a quantale) iff the distributive conditions on the monoidal product and joins hold.

`@JadeMaster: I think that the Theorem simply says that a monoidal poset with all joins is closed (hence a quantale) iff the distributive conditions on the monoidal product and joins hold.`

worth noting that some places (eg Wikipedia)

definea quantale as a monoidal poset with all joins where the product distributes over infinite joins.so you can view John's theorem as a proof that his definition coincides with this alternative one.

`worth noting that some places (eg [Wikipedia](https://en.wikipedia.org/wiki/Quantale)) _define_ a quantale as a monoidal poset with all joins where the product distributes over infinite joins. so you can view John's theorem as a proof that his definition coincides with this alternative one.`

Jade wrote:

We don't "need to" prove it. As mathematicians we

enjoyproving stuff.The reason this condition is cool is the following theorem, which gives

two equivalent conditionsfor \(\mathcal{V}\) to be a quantale:Theorem.If \(\mathcal{V}\) is a monoidal poset with all joins, \(\mathcal{V}\) is closed if and only if$$ a \otimes \left( \bigvee_{b\in B} b\right) = \bigvee_{b \in A} (a \otimes b) $$ for every element \(a\) and every subset \(B\) of \(\mathcal{V}\).

So, we can either say a quantale is a monoidal poset with all joins that is

closed, or a monoidal poset with all joins wheretensoring distributes over all joins.This is especially cool when you realize that \(\otimes\) is like multiplication, being closed is like having division, and joins are like (possibly infinite) sums. It's almost as if we're saying multiplication distributes over sums iff we can divide!

That's not true in plain old algebra, but here we are doing 'slightly categorified' algebra, working with posets rather than mere sets, and defining our 'sums' by a universal property... so we have new magic powers.

Proof Sketch.For every element \(a\) of \(\mathcal{V}\) there is a monotone function$$ a \otimes - \, \colon \mathcal{V} \to \mathcal{V} $$ sending each \(x \in \mathcal{V}\) to \(a \otimes x\) . By the Adjoint Functor Theorem for Posets, this monotone function has a right adjoint iff it preserves all joins. It a right adjoint iff \(\mathcal{V}\) is closed, since \(\mathcal{V}\) being closed says that

$$ a \otimes x \le y \text{ if and only if } x \le a \multimap y $$ for all \(x, y\) in \(\mathcal{V}\), which means that

$$ a \multimap - \, \colon \mathcal{V} \to \mathcal{V} $$ is a right adjoint of

$$ a \otimes - \, \colon \mathcal{V} \to \mathcal{V} $$ On the other hand, \(a \otimes -\) preserves all joins iff

$$ a \otimes \left( \bigvee_{b\in B} b\right) = \bigvee_{b \in B} (a \otimes b) $$ for every element \(a\) and every subset \(B\) of \(\mathcal{V}\). \( \qquad \blacksquare \)

`Jade wrote: > Why do we need prove this extra condition about the monoidal product commuting with joins? We don't "need to" prove it. As mathematicians we _enjoy_ proving stuff. <img src = "http://math.ucr.edu/home/baez/emoticons/tongue2.gif"> The reason this condition is cool is the following theorem, which gives _two equivalent conditions_ for \\(\mathcal{V}\\) to be a quantale: **Theorem.** If \\(\mathcal{V}\\) is a monoidal poset with all joins, \\(\mathcal{V}\\) is closed if and only if \[ a \otimes \left( \bigvee\_{b\in B} b\right) = \bigvee\_{b \in A} (a \otimes b) \] for every element \\(a\\) and every subset \\(B\\) of \\(\mathcal{V}\\). So, we can either say a quantale is a monoidal poset with all joins that is _closed_, or a monoidal poset with all joins where _tensoring distributes over all joins._ This is especially cool when you realize that \\(\otimes\\) is like multiplication, being closed is like having division, and joins are like (possibly infinite) sums. It's almost as if we're saying multiplication distributes over sums iff we can divide! <img src = "http://math.ucr.edu/home/baez/emoticons/surprised.gif"> That's not true in plain old algebra, but here we are doing 'slightly categorified' algebra, working with posets rather than mere sets, and defining our 'sums' by a universal property... so we have new magic powers. **Proof Sketch.** For every element \\(a\\) of \\(\mathcal{V}\\) there is a monotone function \[ a \otimes - \, \colon \mathcal{V} \to \mathcal{V} \] sending each \\(x \in \mathcal{V}\\) to \\(a \otimes x\\) . By the [Adjoint Functor Theorem for Posets](https://forum.azimuthproject.org/discussion/2031/lecture-16-chapter-1-the-adjoint-functor-theorem-for-posets/p1), this monotone function has a right adjoint iff it preserves all joins. It a right adjoint iff \\(\mathcal{V}\\) is closed, since \\(\mathcal{V}\\) being closed says that \[ a \otimes x \le y \text{ if and only if } x \le a \multimap y \] for all \\(x, y\\) in \\(\mathcal{V}\\), which means that \[ a \multimap - \, \colon \mathcal{V} \to \mathcal{V} \] is a right adjoint of \[ a \otimes - \, \colon \mathcal{V} \to \mathcal{V} \] On the other hand, \\(a \otimes -\\) preserves all joins iff \[ a \otimes \left( \bigvee\_{b\in B} b\right) = \bigvee\_{b \in B} (a \otimes b) \] for every element \\(a\\) and every subset \\(B\\) of \\(\mathcal{V}\\). \\( \qquad \blacksquare \\)`

So I was trying to write up this stuff in a constructive context, but ran into a problem that the naive function for arbitrary joins (which has type (set V -> V)) seems to be uncomputable (for V with infinite elements) to me.

Is there a way to restrict this to what we need?

`So I was trying to write up this stuff in a constructive context, but ran into a problem that the naive function for arbitrary joins (which has type (set V -> V)) seems to be uncomputable (for V with infinite elements) to me. Is there a way to restrict this to what we need?`

Christopher - I don't know exactly what rules you're trying to follow, and I'm not an expert on constructive mathematics, but constructive mathematicians do have some way of dealing with infinite joins: after all, \(\exists\) is the classic example of a join.

For example, suppose \( f \colon S \to \textbf{Bool} \) is a function from a possibly infinite set to to the poset \(\textbf{Bool} = \lbrace \texttt{true},\texttt{false}\rbrace \). Then the join

$$ \bigvee_{x \in S} f(x) $$ is another way of talking about the proposition

$$ \exists x \in S \; f(x) .$$ Now, we can't compute this in general when \(S\) is infinite, since in general we can't go through infinitely many elements \(x \in S\) and evaluate \(f(x)\) for all of these. But if we can exhibit an element \(x \in S\) with \( f(x) = \texttt{true}\) then we know

$$ \bigvee_{x \in S} f(x) = \texttt{true} $$ And sometimes we can prove that no such element exists, and then we know

$$ \bigvee_{x \in S} f(x) = \texttt{false} .$$ More generally, for any poset \(X\) and function \(f : S \to X\), we know \(f(x)\) is a lower bound on \( \bigvee_{x \in S} f(x) \).

I don't know if this helps....

`Christopher - I don't know exactly what rules you're trying to follow, and I'm not an expert on constructive mathematics, but constructive mathematicians do have some way of dealing with infinite joins: after all, \\(\exists\\) is the classic example of a join. For example, suppose \\( f \colon S \to \textbf{Bool} \\) is a function from a possibly infinite set to to the poset \\(\textbf{Bool} = \lbrace \texttt{true},\texttt{false}\rbrace \\). Then the join \[ \bigvee_{x \in S} f(x) \] is another way of talking about the proposition \[ \exists x \in S \; f(x) .\] Now, we can't compute this in general when \\(S\\) is infinite, since in general we can't go through infinitely many elements \\(x \in S\\) and evaluate \\(f(x)\\) for all of these. But if we can exhibit an element \\(x \in S\\) with \\( f(x) = \texttt{true}\\) then we know \[ \bigvee_{x \in S} f(x) = \texttt{true} \] And sometimes we can prove that no such element exists, and then we know \[ \bigvee_{x \in S} f(x) = \texttt{false} .\] More generally, for any poset \\(X\\) and function \\(f : S \to X\\), we know \\(f(x)\\) is a lower bound on \\( \bigvee_{x \in S} f(x) \\). I don't know if this helps....`