#### Howdy, Stranger!

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

Options

# Lecture 55 - Chapter 4: Enriched Profunctors and Collaborative Design

edited February 17

In Chapter 4 of Seven Sketches, Fong and Spivak introduce 'enriched profunctors' as a way to study collaborative design, where different teams are working together to make a product. An enriched profunctor can be used to answer the questions:

• given some requirements, what resources will let us fulfill these requirements?

and

• given some resources, what requirements will these resources let us fulfill?

You'll notice that these questions are two sides of the same coin! There will be an enriched profunctor going from resources to requirements they fulfill, and we can 'flip' it to get an enriched profunctor from requirements to resources needed to fulfill them.

As the name suggests, an 'enriched profunctor' is a bit like a functor between enriched categories... for pros. That is, for professionals.

Indeed, most category theorists consider enriched profunctors rather sophisticated. But Fong and Spivak bring them down to earth by their clever trick of focusing on preorders rather than more general categories.

Remember that in Chapter 1 they introduced preorders. A preorder is a set $$X$$ equipped with a relation $$\le$$ obeying

$$x \le x$$ and

$$x \le y \text{ and } y \le z \; \implies \; x \le z .$$ Later we saw a preorder is secretly a category with at most one morphism from any object $$x$$ to any object $$y$$: if one exists we write $$x \le y$$. But because there's at most one, we never have to worry about equations between morphisms. Everything simplifies enormously! This is the key to Fong and Spivak's expository strategy.

In Chapter 2 they introduced monoidal preorders. These are a special case of 'monoidal categories', which we haven't discussed yet - but they're much simpler! A monoidal preorder is a preorder $$(X,\le)$$ with an operation $$\otimes : X \times X \to X$$ and element $$I \in X$$ obeying

$$(x \otimes y) \otimes z = x \otimes (y \otimes z)$$ $$I \otimes x = x = x \otimes I$$ and

$$x \le x' \textrm{ and } y \le y' \textrm{ imply } x \otimes y \le x' \otimes y' .$$ We used preorders to study resources: we said $$x \le y$$ if $$x$$ is cheaper than $$y$$, or you can get $$x$$ if you have $$y$$. Then we used $$\otimes$$ to combine resources, and used $$I$$ for a 'nothing' resource: $$x$$ combined with nothing is just $$x$$.

(Actually Fong and Spivak use the opposite convention, writing $$x \le y$$ to mean you can get $$y$$ if you have $$x$$. This seems weird if you think of resources as being like money, but natural if you think of your preorder as a category, and remember $$x \le y$$ means there's a morphism $$f : x \to y$$. I should probably use this convention.)

Later in Chapter 2 they generalized preorders a bit, and introduced categories enriched in a monoidal preorder. Remember the idea: first we choose a monoidal preorder to enrich in, and call it $$\mathcal{V}$$. Then a $$\mathcal{V}$$-enriched category, say $$\mathcal{X}$$, consists of

1. a set of objects $$\text{Ob}(\mathcal{X})$$, and

2. for every two objects $$x,y$$, an element $$\mathcal{X}(x,y)$$ of $$\mathcal{V}$$,

such that

a) $$I\leq\mathcal{X}(x,x)$$ for every object $$x\in\text{Ob}(\mathcal{X})$$, and

b) $$\mathcal{X}(x,y)\otimes\mathcal{X}(y,z)\leq\mathcal{X}(x,z)$$ for all objects $$x,y,z\in\mathrm{Ob}(\mathcal{X})$$.

We saw that if $$\mathcal{V} = \mathbf{Bool}$$, a $$\mathcal{V}$$-enriched category is just a preorder: the truth value $$\mathcal{X}(x,y)$$ tells you if you can get from $$x$$ to $$y$$. But if $$\mathcal{V}$$ is something fancier, like $$\mathbf{Cost}$$, $$\mathcal{X}(x,y)$$ tells you more, like how much it costs to get from $$x$$ to $$y$$.

Where do enriched profunctors fit into this game?

Here: given $$\mathcal{V}$$-enriched categories $$\mathcal{X}$$ and $$\mathcal{Y}$$, a $$\mathcal{V}$$-enriched profunctor is a clever kind of thing going from $$\mathcal{X}$$ to $$\mathcal{Y}$$.

If we take objects of $$\mathcal{X}$$ to be requirements and objects of $$\mathcal{Y}$$ to be resources, we can use a $$\mathcal{V}$$-enriched profunctor from $$\mathcal{X}$$ to $$\mathcal{Y}$$ to describe, for each choice of requirements, which resources will fulfill it... or how much it will cost to make them fulfill it... or various other things like that, depending on $$\mathcal{V}$$.

On the other hand, we can use a $$\mathcal{V}$$-enriched profunctor going back from $$\mathcal{Y}$$ to $$\mathcal{X}$$ to describe, for each choice of resources, which requirements they will fulfill.. or how much it will cost to make it fulfill them... or various other things like that, depending on $$\mathcal{V}$$.

It's all very beautiful and fun. Dive in! Read Section 4.1 and 4.2.1, and maybe 4.2.2 if you're feeling energetic.

Happy Fourth of July! You don't need fireworks for excitement if you've got profunctors.

To read other lectures go here.

• Options
1.

David P Ellerman, in his introduction, describes $$\text{Het}$$-functors as being profunctors (Personally, I like the name "$$\text{Het}$$-functor" rather than the uninspired, undescriptive "profunctor"),

$\text{Hom}[F(X),Y] \cong \text{Het}[X,Y] \cong \text{Hom}[X,U(Y)]$

So a profunctor/$$\text{Het}$$-functor is then like a $$\text{Hom}$$-functor,

$\text{Hom}_{\mathcal{C}} : \mathcal{C}^{op} \times \mathcal{C} \to \mathbf{Set}$

but we're not fixed to a particular category $$\mathcal{C}$$,

$\text{Het}_{\mathcal{D}\times\mathcal{C}} : \mathcal{D}^{op} \times \mathcal{C} \to \mathbf{Set}.$

Comment Source:[David P Ellerman, in his introduction,](https://forum.azimuthproject.org/discussion/2007/introduction-david-p-ellerman#latest) describes \$$\text{Het}\$$-functors as being profunctors (Personally, I like the name "\$$\text{Het}\$$-functor" rather than the uninspired, undescriptive "profunctor"), \$\text{Hom}[F(X),Y] \cong \text{Het}[X,Y] \cong \text{Hom}[X,U(Y)] \$ So a profunctor/\$$\text{Het}\$$-functor is then like a \$$\text{Hom}\$$-functor, \$\text{Hom}\_{\mathcal{C}} : \mathcal{C}^{op} \times \mathcal{C} \to \mathbf{Set} \$ but we're not fixed to a particular category \$$\mathcal{C}\$$, \$\text{Het}\_{\mathcal{D}\times\mathcal{C}} : \mathcal{D}^{op} \times \mathcal{C} \to \mathbf{Set}. \$
• Options
2.

Yes, Ellerman reinvented profunctors and then I told him "those are profunctors".

Bénabou was the first to invent them, in 1973, and he called them both profunctors and 'distributors', or more precisely 'profoncteurs' and 'distributeurs'. The Australians like to call them 'bimodules' or simply 'modules' for short. (A bimodule in ring theory is an example of an enriched profunctor).

Comment Source:Yes, Ellerman reinvented profunctors and then I told him "those are profunctors". [B&eacute;nabou](https://fr.wikipedia.org/wiki/Distributeur_(th%C3%A9orie_des_cat%C3%A9gories)) was the first to invent them, in 1973, and he called them both profunctors and 'distributors', or more precisely 'profoncteurs' and 'distributeurs'. The Australians like to call them 'bimodules' or simply 'modules' for short. (A bimodule in ring theory is an example of an enriched profunctor).
• Options
3.
edited July 2018

So then, do profunctors/ hets/modules satisfy an analogous composition law to hom-functors?

$\text{Het}(f,g) \circ \text{Het}(j,k) \to \text{Het}(f \circ j, k \circ g)$

Comment Source:So then, do profunctors/ hets/modules satisfy an analogous composition law to hom-functors? \$\text{Het}(f,g) \circ \text{Het}(j,k) \to \text{Het}(f \circ j, k \circ g) \$
• Options
4.
edited July 2018

Is that arrow supposed to be an equation? If I understand you correctly, the left and right sides are morphisms. It doesn't make sense to have an arrow between morphisms in a category.

For example, the hom-functor $$\mathrm{hom} : \mathcal{C}^{\text{op}} \times \mathcal{C} \to \mathbf{Set}$$ will take a morphism $$(f,g)$$ in $$\mathcal{C}^{\text{op}} \times \mathcal{C}$$ and turn it into a function $$\mathrm{hom}(f,g)$$, and we have

$$\mathrm{hom}(f,g) \circ \mathrm{hom}(j,k) = \mathrm{hom}(f \circ h, g \circ k)$$ since the hom-functor is a functor, and there's an $$\mathrm{op}$$ in the first slot.

Comment Source:Is that arrow supposed to be an equation? If I understand you correctly, the left and right sides are morphisms. It doesn't make sense to have an arrow between morphisms in a category. For example, the hom-functor \$$\mathrm{hom} : \mathcal{C}^{\text{op}} \times \mathcal{C} \to \mathbf{Set}\$$ will take a morphism \$$(f,g) \$$ in \$$\mathcal{C}^{\text{op}} \times \mathcal{C}\$$ and turn it into a function \$$\mathrm{hom}(f,g) \$$, and we have $\mathrm{hom}(f,g) \circ \mathrm{hom}(j,k) = \mathrm{hom}(f \circ h, g \circ k)$ since the hom-functor is a functor, and there's an \$$\mathrm{op}\$$ in the first slot. 
• Options
5.

Just out of curiosity - has Ellerman published any profunctor-based updates to his het works?

Comment Source:Just out of curiosity - has Ellerman published any profunctor-based updates to his het works?
• Options
6.

Out of interest, where does the word "profunctor" come from? Dug about for a bit online but found nothing.

Comment Source:Out of interest, where _does_ the word "profunctor" come from? Dug about for a bit online but found nothing.
• Options
7.

So then, do profunctors/ hets/modules satisfy an analogous composition law to hom-functors?

$$\text{Het}(f,g) \circ \text{Het}(j,k) \to \text{Het}(f \circ j, k \circ g)$$

Wikipedia states how to compose two profunctors:

Using the cartesian closure of $$\mathbf{Cat}$$, the category of small categories, the profunctor $$\phi$$ can be seen as a functor

$$\hat{\phi} \colon \mathcal{C}\to\mathrm{Set}^{\mathcal{D}^\mathrm{op}}$$ The composite $$\psi\phi$$ of two profunctors $$\phi\colon \mathcal{C}\nrightarrow \mathcal{D}$$ and $$\psi\colon \mathcal{D}\nrightarrow E$$ is given by $$\psi\phi=\mathrm{Lan}_{Y_\mathcal{D}}(\hat{\psi})\circ\hat\phi$$ where $$\mathrm{Lan}_{Y_\mathcal{D}}(\hat{\psi})$$ is the left Kan extension of the functor $$\hat{\psi}$$ along the (covariant) Yoneda functor $$Y_{\mathcal{D}} \colon \mathcal{D}\to\mathrm{Set}^{\mathcal{D}^\mathrm{op}}$$ of $$\mathcal{D}$$

I think the Yoneda functor is related to the $$\mathbf{hom}$$ functor John introduced in Lecture 52.

Comment Source:> So then, do profunctors/ hets/modules satisfy an analogous composition law to hom-functors? > > $\text{Het}(f,g) \circ \text{Het}(j,k) \to \text{Het}(f \circ j, k \circ g)$ Wikipedia states how to [compose two profunctors](https://en.wikipedia.org/wiki/Profunctor#Composition_of_profunctors): >Using the [cartesian closure](https://en.wikipedia.org/wiki/Cartesian_closed_category) of \$$\mathbf{Cat}\$$, the [category of small categories](https://en.wikipedia.org/wiki/Category_of_small_categories), the profunctor \$$\phi\$$ can be seen as a functor > > $\hat{\phi} \colon \mathcal{C}\to\mathrm{Set}^{\mathcal{D}^\mathrm{op}}$ > > The composite \$$\psi\phi\$$ of two profunctors \$$\phi\colon \mathcal{C}\nrightarrow \mathcal{D}\$$ and \$$\psi\colon \mathcal{D}\nrightarrow E\$$ > is given by > > $\psi\phi=\mathrm{Lan}_{Y_\mathcal{D}}(\hat{\psi})\circ\hat\phi$ > > where \$$\mathrm{Lan}\_{Y\_\mathcal{D}}(\hat{\psi})\$$ is the left Kan extension of the functor \$$\hat{\psi}\$$ along the (covariant) Yoneda functor \$$Y\_{\mathcal{D}} \colon \mathcal{D}\to\mathrm{Set}^{\mathcal{D}^\mathrm{op}}\$$ of \$$\mathcal{D}\$$ I think the Yoneda functor is related to the \$$\mathbf{hom}\$$ functor John introduced in [Lecture 52](https://forum.azimuthproject.org/discussion/2273/lecture-52-the-hom-functor).
• Options
8.
Comment Source:Julio - I don't know; he's [attending this course so you could message him](https://forum.azimuthproject.org/discussion/2007/introduction-david-p-ellerman/p1).
• Options
9.
edited July 2018

Anindya - I don't know, apparently Bénabou invented the term 'profunctor' when he invented the concept in 1973. It seems like the perfect term to me, because it's a kind of preliminary to having an actual functor, and also a kind of presheaf, and also a 'professional version' of a functor.

Comment Source:Anindya - I don't know, apparently B&eacute;nabou invented the term 'profunctor' when he invented the concept in 1973. It seems like the perfect term to me, because it's a kind of preliminary to having an actual functor, and also a kind of presheaf, and also a 'professional version' of a functor.
• Options
10.

@John Cool. Thanks for the link! :)

Comment Source:@John Cool. Thanks for the link! :)
• Options
11.

@John - I get the feeling you might be able give an alternate definition of profunctor composition via right Kan extensions. Is that right, or am I totally off?

Comment Source:@John - I get the feeling you might be able give an alternate definition of profunctor composition via right Kan extensions. Is that right, or am I totally off?
• Options
12.
edited July 2018

Matthew - I'd guess left Kan extensions.

First, remember that left adjoints and in particular left Kan extensions tend to like adding a bunch of stuff up, while right adjoints and in particular right Kan extensions act like multiplication. For example, the left adjoint is the coproduct $$+ \mathbf{Set}^2 \to \mathbf{Set}$$, and we saw that this is a left Kan extension. The right adjoint to $$\Delta : \mathbf{Set} \to \mathbf{Set}^2$$ is the product $$\times : \mathbf{Set}^2 \to \mathbf{Set}$$, and we saw in Lecture 54 that this is a right Kan extension.

Second, we'll see that composing profunctors is like matrix multiplication. I'll explain this better later on, but:

An enriched profunctor $$\Phi : \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V}$$ is like a 'matrix' that hands us an element $$\Phi(x,y)$$ for each $$x$$ and $$y$$. To compose, we just generalize matrix multiplication. As you know, matrix multiplication involves multiplying matrix entries and then summing them up. But we use the monoidal structure in $$\mathcal{V}$$ to multiply the matrix entries and then a colimit to sum them up. The colimit is the part where Kan extensions might enter... and by my earlier remarks, it would be a left Kan extension.

Note however that it'll be an enriched left Kan extension. If we were looking at ordinary profunctors, which are $$\mathbf{Set}$$-enriched profunctors, then we'd be using an ordinary left Kan extension.

Comment Source:Matthew - I'd guess left Kan extensions. <img width = "100" src = "http://math.ucr.edu/home/baez/mathematical/warning_sign.jpg"> First, remember that left adjoints and in particular left Kan extensions tend to like adding a bunch of stuff up, while right adjoints and in particular right Kan extensions act like multiplication. For example, the left adjoint is the coproduct \$$+ \mathbf{Set}^2 \to \mathbf{Set}\$$, and we saw that this is a left Kan extension. The right adjoint to \$$\Delta : \mathbf{Set} \to \mathbf{Set}^2 \$$ is the product \$$\times : \mathbf{Set}^2 \to \mathbf{Set} \$$, and we saw in [Lecture 54](https://forum.azimuthproject.org/discussion/2277/lecture-54-chapter-3-tying-up-loose-ends/p1) that this is a right Kan extension. Second, we'll see that composing profunctors is like matrix multiplication. I'll explain this better later on, but: An enriched profunctor \$$\Phi : \mathcal{X}^{\text{op}} \times \mathcal{Y} \to \mathcal{V}\$$ is like a 'matrix' that hands us an element \$$\Phi(x,y) \$$ for each \$$x\$$ and \$$y\$$. To compose, we just generalize matrix multiplication. As you know, matrix multiplication involves multiplying matrix entries and then summing them up. But we use the monoidal structure in \$$\mathcal{V}\$$ to multiply the matrix entries and then a colimit to sum them up. The colimit is the part where Kan extensions might enter... and by my earlier remarks, it would be a left Kan extension. Note however that it'll be an _enriched_ left Kan extension. If we were looking at ordinary profunctors, which are \$$\mathbf{Set}\$$-enriched profunctors, then we'd be using an ordinary left Kan extension. 
• Options
13.
edited July 2018

First, remember that left adjoints and in particular left Kan extensions tend to like adding a bunch of stuff up, while right adjoints and in particular right Kan extensions act like multiplication. For example, the left adjoint to $$\Delta : \mathbf{Set} \to \mathbf{Set}^2$$ is the product $$\times : \mathbf{Set}^2 \to \mathbf{Set}$$, and we saw in Lecture 54 that this is a left Kan extension. The right adjoint is the coproduct $$+ \mathbf{Set}^2 \to \mathbf{Set}$$, and we saw that this is a right Kan extension.

I'm confused. I thought $$\Delta \dashv \times$$ ... is that correct? If so I think you mean "the right adjoint to $$\Delta : \mathbf{Set} \to \mathbf{Set}^2$$ is the product $$\times : \mathbf{Set}^2 \to \mathbf{Set}$$".

Moreover, I understand from reading Bartosz Milewski's blog 2017 for every functor $$K : \mathcal{C} \to \mathcal{D}$$ with left and right adjoints:

$$\mathrm{Ran}_K\ Id_{\mathcal{C}} \dashv K \dashv \mathrm{Lan}_K\ Id_{\mathcal{C}}$$ But, in the category of functors, this is flipped:

$$\mathrm{Lan}_K\ (-) \dashv (-) \circ K \dashv \mathrm{Ran}_K\ (-)$$ This is rather confusing! The proofs of these things have been a bit challenging for me too...

Comment Source:> First, remember that left adjoints and in particular left Kan extensions tend to like adding a bunch of stuff up, while right adjoints and in particular right Kan extensions act like multiplication. For example, the left adjoint to \$$\Delta : \mathbf{Set} \to \mathbf{Set}^2 \$$ is the product \$$\times : \mathbf{Set}^2 \to \mathbf{Set} \$$, and we saw in [Lecture 54](https://forum.azimuthproject.org/discussion/2277/lecture-54-chapter-3-tying-up-loose-ends/p1) that this is a left Kan extension. The right adjoint is the coproduct \$$+ \mathbf{Set}^2 \to \mathbf{Set}\$$, and we saw that this is a right Kan extension. I'm confused. I thought \$$\Delta \dashv \times\$$ ... is that correct? If so I think you mean "the *right* adjoint to \$$\Delta : \mathbf{Set} \to \mathbf{Set}^2 \$$ is the product \$$\times : \mathbf{Set}^2 \to \mathbf{Set} \$$". Moreover, I understand from reading [Bartosz Milewski's blog 2017](https://bartoszmilewski.com/2017/04/17/kan-extensions/) for every functor \$$K : \mathcal{C} \to \mathcal{D}\$$ with left and right adjoints: $\mathrm{Ran}\_K\ Id\_{\mathcal{C}} \dashv K \dashv \mathrm{Lan}\_K\ Id\_{\mathcal{C}}$ But, in the category of functors, this is *flipped*: $\mathrm{Lan}\_K\ (-) \dashv (-) \circ K \dashv \mathrm{Ran}\_K\ (-)$ This is rather confusing! The proofs of these things have been a bit challenging for me too...
• Options
14.
edited July 2018

Matthew wrote:

If so I think you mean "the right adjoint to $$\Delta : \mathbf{Set} \to \mathbf{Set}^2$$ is the product $$\times : \mathbf{Set}^2 \to \mathbf{Set}$$".

Yes, I wrote those backwards. But that mistake of mine was a localized brain fart: my overall point will still make sense, in fact more sense, if I fix this. So I'll go back and fix it.

But all this stuff was explaining a guess of mine - the guess could be wrong. When we get around to actually composing some (enriched) profunctors, let's come back to this. We can try to see if we can express composition using left or right adjoints, like left or right (enriched) Kan extensions.

Comment Source:Matthew wrote: > If so I think you mean "the *right* adjoint to \$$\Delta : \mathbf{Set} \to \mathbf{Set}^2 \$$ is the product \$$\times : \mathbf{Set}^2 \to \mathbf{Set} \$$". Yes, I wrote those backwards. But that mistake of mine was a localized brain fart: my overall point will still make sense, in fact more sense, if I fix this. So I'll go back and fix it. But all this stuff was explaining a _guess_ of mine - the guess could be wrong. When we get around to actually composing some (enriched) profunctors, let's come back to this. We can try to see if we can express composition using left or right adjoints, like left or right (enriched) Kan extensions. 
• Options
15.

Well the wikipedia page for the set-enriched profunctors uses the symbol "Lan" with a subscript. I'll wait to read it until later, but you are on the right track it seems.

Comment Source:Well the wikipedia page for the set-enriched profunctors uses the symbol "Lan" with a subscript. I'll wait to read it until later, but you are on the right track it seems.
• Options
16.

Hmm, good!

Comment Source:Hmm, good!
• Options
17.
edited December 2018

Merry Christmas! Just a small question: is this bit from the lecture still true? -

Actually Fong and Spivak use the opposite convention, writing $$x \le y$$ to mean you can get $$y$$ if you have $$x$$...

I see the following in Fong & Spivak (Oct 12 version, p.119) -

The order $$x \le y$$ represents the availability of $$x$$ given $$y$$, i.e. that whenever you have $$y$$, you also have $$x$$.

Comment Source:Merry Christmas! Just a small question: is this bit from the lecture still true? - >Actually Fong and Spivak use the opposite convention, writing \$$x \le y\$$ to mean you can get \$$y\$$ if you have \$$x\$$... I see the following in Fong & Spivak (Oct 12 version, p.119) - >The order \$$x \le y\$$ represents the _availability of_ \$$x\$$ _given_ \$$y\$$, i.e. that whenever you have \$$y\$$, you also have \$$x\$$.
• Options
18.

... ... yes, I think so. Though it really depends on the context.

I think this is saying if you have 8 dollars then you have 5 dollars. Therefor $5 <=$8. Though i don't have time to check the context to make sure. It might be that under their convention $8 <=$5.</p>

Comment Source:... ... yes, I think so. Though it really depends on the context. I think this is saying if you have 8 dollars then you have 5 dollars. Therefor $5 <=$8. Though i don't have time to check the context to make sure. It might be that under their convention $8 <=$5.