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

- All Categories 2.4K
- Chat 502
- Study Groups 21
- Petri Nets 9
- Epidemiology 4
- Leaf Modeling 2
- Review Sections 9
- MIT 2020: Programming with Categories 51
- MIT 2020: Lectures 20
- MIT 2020: Exercises 25
- Baez ACT 2019: Online Course 339
- Baez ACT 2019: Lectures 79
- Baez ACT 2019: Exercises 149
- Baez ACT 2019: Chat 50
- UCR ACT Seminar 4
- General 75
- Azimuth Code Project 110
- Statistical methods 4
- Drafts 10
- Math Syntax Demos 15
- Wiki - Latest Changes 3
- Strategy 113
- Azimuth Project 1.1K
- - Spam 1
- News and Information 148
- Azimuth Blog 149
- - Conventions and Policies 21
- - Questions 43
- Azimuth Wiki 718

Options

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

a set of

**objects**\(\text{Ob}(\mathcal{X})\), andfor 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.

## Comments

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}. \]

`[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}. \\]`

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).

`Yes, Ellerman reinvented profunctors and then I told him "those are profunctors". [Bé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).`

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) \]

`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) \\]`

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.

`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.`

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

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

Out of interest, where

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

Wikipedia states how to compose two profunctors:

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

`> 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).`

Julio - I don't know; he's attending this course so you could message him.

`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).`

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.

`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.`

@John Cool. Thanks for the link! :)

`@John Cool. Thanks for the link! :)`

@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?

`@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?`

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

enrichedleft 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.`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.`

I'm confused. I thought \(\Delta \dashv \times\) ... is that correct? If so I think you mean "the

rightadjoint 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...

`> 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...`

Matthew wrote:

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

guessof 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.`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.`

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.

`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.`

Hmm, good!

`Hmm, good!`

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

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

`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\\).`

... ... 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>

`... ... 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.`