Lecture 66 - Chapter 4: Collaborative Design

This describes a big complicated feasibility relation built from smaller ones - the little boxes - in various ways. Now let me start explaining those various ways!

First of all, remember that a feasibility relation \(\Phi \colon X \nrightarrow Y \) from a preorder \(X\) to a preorder \(Y\) is monotone function

$$ \Phi \colon X^{\text{op}} \times Y \to \lbrace \text{true}, \text{false} \rbrace . $$
In collaborative design we interpret \(\Phi(x,y) = \text{true}\) to mean "we can meet the requirements \(x\) given the resources \(y\)". In a codesign diagram we can draw \(\Phi\) as a box with one wire coming in at left labelled \(X\), and one wire going out at right labelled \(Y\):

Here are a few easy examples:

Puzzle 204. Suppose you are trying to buy a plane ticket, and the cheapest available ticket is $500. Describe this using a feasibility relation \(\Phi : \textbf{Bool} \nrightarrow [0,\infty) \) where we make \( [0,\infty) \), the set of nonnegative real numbers, into a poset with its usual ordering \(\le\).

Puzzle 205. Suppose you are trying to buy either one or two loaves of bread - or perhaps none. Suppose bread costs $2 per loaf. Describe this using a feasibility relation \(\Psi : \lbrace 0,1,2\rbrace \nrightarrow [0,\infty) \). Here we make \( {0,1,2}\) into a poset with its usual ordering.

Puzzle 206. Suppose you are trying to feed hungry children with the loaves of bread you bought in the previous puzzle, and you can feed at most three children with each loaf of bread. Describe this using a feasibility relation \(\Phi : \mathbb{N} \nrightarrow \lbrace 0,1,2\rbrace \). Here \(\mathbb{N}\) is the set of natural numbers \( \lbrace 0,1,2,3,\dots \rbrace \) with its usual ordering.

The box on the outside helps us think of \(\Psi\Phi\) as a single thing, but we could also leave it out.

The idea in codesign is that this describes two systems or processes stuck together, with the second providing the resources required for the first. Let's look at an easy example:

Puzzle 207. Suppose you buy loaves of bread and then use them to feed hungry children. Compose the feasibility relation \(\Psi : {0,1,2} \nrightarrow [0,\infty) \) from Puzzle 205 and the feasibility relation \(\Phi : \mathbb{N} \nrightarrow \lbrace 0,1,2\rbrace \) from Puzzle 206 to get a feasibility relation \(\Psi \Phi : \mathbb{N} \nrightarrow [0,\infty) \) describing how many children you can feed for a certain amount of money (given the fact that you plan to buy at most two loaves).

Third, if we have a bunch of preorders \(X_1, \dots, X_m \) and \(Y_1, \dots, Y_n\), their products \(X_1 \times \cdots \times X_m\) and \(Y_1 \times \cdots \times Y_n \) are also preorders, so we can talk about a feasibility relation

$$ \Phi \colon X_1 \times \cdots \times X_m \nrightarrow Y_1 \times \cdots \times Y_n $$
We draw this as a box with a bunch of wires going in and a bunch going out, as follows:

The idea in codesign is that this describes a situation where a bunch of resources \(Y_1, \dots, Y_n\) are needed to meet a bunch of requirements \(X_1, \dots, X_m\).

Puzzle 208. Suppose you some slices of bread, some slices of cheese and some slices of ham. You are trying to make sandwiches. You can make a cheese sandwich with two slices of bread and one slice of cheese. You can make a ham sandwich with two slices of bread and one slice of ham. There is a feasibility relation \(\Theta : \mathbb{N} \times \mathbb{N} \nrightarrow \mathbb{N} \times \mathbb{N} \times \mathbb{N} \) where \(\Theta(m,n,i,j,k) = \text{true}\) if you can make \(m\) cheese sandwiches and \(n\) ham sandwiches from \(i\) slices of bread, \(j\) slices of cheese and \(k\) slices of ham.

Fourth, if we have feasibility relations \(\Phi \colon X \nrightarrow Y\) and \(\Psi \colon X' \nrightarrow Y'\), we can define a new feasibility relation

This describes a situation where we can meet the requirements \((x,x')\) given resources \( (y,y') \) iff we can meet requirement \(x\) given \(x'\) and meet requirement \(y\) given \(y'\).

Here is a very simple example:

Puzzle 209. Suppose you are trying to fry some eggs and also toast some slices of bread. Describe each process separately as a feasibility relation from \(\mathbb{N}\) to \(\mathbb{N}\) and then tensor these relations. What is the result?

Puzzle 210. Show that \(\Phi \otimes \Psi\) is really a feasibility relation if \(\Phi\) and \(\Psi\) are feasibility relations.

Puzzle 211. What general mathematical result is Puzzle 209 an example of?

Puzzle 212. We can get a feasibility relation by taking either the companion or the conjoint of a monotone map, thanks to the ideas in the puzzles of Lecture 65. Which of the feasibility relations in this lecture's puzzles are companions or conjoints?

Comments

Puzzle 204. Suppose you are trying to buy a plane ticket, and the cheapest available ticket is $500. Describe this using a feasibility relation \(\Phi : \textbf{Bool} \nrightarrow [0,\infty) \)
where we make \( [0,\infty) \), the set of nonnegative real numbers, into a poset with its usual ordering \(\le\).

This is a feasibility relation \(\Phi\), where \(\texttt{false}\) maps to everything less than $500, and \(\texttt{true}\) maps to everything greater than or equal to $500, ie if you can buy a ticket, then you have at least $500. Since this is required to only be a feasibility relation and not a monotone map, this is a perfectly reasonable thing to do.

Comment Source:>**Puzzle 204.** Suppose you are trying to buy a plane ticket, and the cheapest available ticket is $500. Describe this using a feasibility relation \\(\Phi : \textbf{Bool} \nrightarrow [0,\infty) \\)
where we make \\( [0,\infty) \\), the set of nonnegative real numbers, into a poset with its usual ordering \\(\le\\).
This is a feasibility relation \\(\Phi\\), where \\(\texttt{false}\\) maps to everything less than &#x24;500, and \\(\texttt{true}\\) maps to everything greater than or equal to &#x24;500, ie if you can buy a ticket, then you have at least $500. Since this is required to only be a feasibility relation and not a monotone map, this is a perfectly reasonable thing to do.

Keith - that's interesting, and you're on the right track. You're also the only person so far who had the guts to try these puzzles, and I don't think I should keep cranking out lectures until people solve these puzzles.

But please clarify what you mean by saying

\(\texttt{false}\) maps to everything less than $500

You're making it sound like a feasibility relation is a 'multi-valued function' where \(\texttt{false}\) can map to lots of different things. That's a really cool way of talking, which we may be able to make sense of if we work a little - but that's not what we defined a feasibility relation to be.

We defined a feasibility relation \(\Phi \colon \textbf{Bool} \to [0,\infty) \)
to be a monotone function

$$ \Phi \colon \textbf{Bool}^{\text{op}} \times [0,\infty) \to \textbf{Bool} .$$
So, I'd be happiest if you said what \(\Phi(x,y)\) equals for each \(x \in \textbf{Bool}^{\text{op}} \) and \(y \in [0,\infty) \). Then we could stare at that and see if it defines a monotone function.

Comment Source:Keith - that's interesting, and you're on the right track. You're also the only person so far who had the guts to try these puzzles, and I don't think I should keep cranking out lectures until people solve these puzzles.
But please clarify what you mean by saying
> \\(\texttt{false}\\) maps to everything less than &#x24;500
You're making it sound like a feasibility relation is a 'multi-valued function' where \\(\texttt{false}\\) can map to lots of different things. That's a really cool way of talking, which we may be able to make sense of if we work a little - but that's not what we defined a feasibility relation to be.
We defined a feasibility relation \\(\Phi \colon \textbf{Bool} \to [0,\infty) \\)
to be a monotone function
\[ \Phi \colon \textbf{Bool}^{\text{op}} \times [0,\infty) \to \textbf{Bool} .\]
So, I'd be happiest if you said what \\(\Phi(x,y)\\) equals for each \\(x \in \textbf{Bool}^{\text{op}} \\) and \\(y \in [0,\infty) \\\). Then we could stare at that and see if it defines a monotone function.

But yeah, we are not looking for a monotone function \(\Phi \colon \textbf{Bool} \to [0,\infty) \). A monotone function \( \Phi \colon \textbf{Bool}^{\text{op}} \times [0,\infty) \to \textbf{Bool} \) is the same as a relation from \(\textbf{Bool}\) to \([0,\infty)\) that obeys certain properties:

Comment Source:**Puzzle 204.** I would define \\(\Phi\\) as follows:
- If there are no requirements then the feasibility relation is satisfied no matter how much money we have:
\[ \Phi(\texttt{false}, y) = \texttt{true}, \mbox{ for all } y \in [0,\infty). \]
- If the requirement is to buy a ticket then we need at least $500 to satisfy the feasibility relation:
\[ \Phi(\texttt{true}, y) = \begin{cases} \texttt{true} &\mbox{if } 500 \le y \\\\
\texttt{false} & \mbox{otherwise.}\end{cases} \]

Puzzle 204/Puzzle 212. I think we can define \(\Phi\) to be the companion of \(F\) where \(\texttt{false} \mapsto 0\) and \(\texttt{true} \mapsto 500\).

Really? Huh, maybe so! It seemed so obvious to me that this feasibility relation was the conjoint of a function. Are both of us right? Neither? Just one of us?

Comment Source:Matthew wrote:
>**Puzzle 204**/**Puzzle 212**. I think we can define \\(\Phi\\) to be the *companion* of \\(F\\) where \\(\texttt{false} \mapsto 0\\) and \\(\texttt{true} \mapsto 500\\).
Really? Huh, maybe so! It seemed so obvious to me that this feasibility relation was the *conjoint* of a function. Are both of us right? Neither? Just one of us?

Puzzle 205. Suppose you are trying to buy either one or two loaves of bread - or perhaps none. Suppose bread costs $2 per loaf. Describe this using a feasibility relation \(\Phi : \lbrace 0,1,2\rbrace \nrightarrow [0,\infty) \). Here we make \( {0,1,2}\) into a poset with its usual ordering.

In puzzle 207, I think the feasability relations compose the other way around, that is, it should have been \(\Phi \Psi : \mathbb{N} \nrightarrow [0,\infty) \).

Comment Source:@John A few typos in the lecture:
1. A couple of feasbility relations use the wrong type of arrow:
in the introduction, \\(\Phi \colon X \to Y \\) should be \\(\Phi \colon X \nrightarrow Y\\);
in puzzle 207, \\(\Psi \Phi : \mathbb{N} \to [0,\infty) \\) should be \\(\Psi \Phi : \mathbb{N} \nrightarrow [0,\infty) \\).
2. In the definition of tensoring \\(\Phi'\\) should be \\(\Psi\\).
3. In puzzle 207, I think the feasability relations compose the other way around, that is, it should have been \\(\Phi \Psi : \mathbb{N} \nrightarrow [0,\infty) \\).

Matthew: okay, thanks for going through all that - I think you're right! But I think this particular feasibility relation \( \Phi : \mathbf{Bool} \nrightarrow [0,\infty) \) is also the conjoint of the monotone function

Or in the English: the feasible situations are precisely those where you either have more than $500, or you don't buy a ticket!

So yes, I think we were both right. I think this feasibility relation is both a companion and a conjoint!

Somehow the conjoint seems more intuitive to me: from the amount of money you have, I can determine whether or not you can buy a ticket.

The companion approach is more mysterious to me: from whether or not you can buy a ticket, I cannot determine how much money you have!

Nonetheless you were able to dream up a monotone function from truth values to amounts of money, whose companion gives the desired feasibility relation. Interesting!

Comment Source:Matthew: okay, thanks for going through all that - I think you're right! But I think this particular feasibility relation \\( \Phi : \mathbf{Bool} \nrightarrow [0,\infty) \\) is also the conjoint of the monotone function
\[ G : [0,\infty) \to \mathbf{Bool} \]
given by
\[ G(y) = \begin{cases} \texttt{true} &\mbox{if } y \ge 500 \\\\
\texttt{false} & \mbox{otherwise.}\end{cases} \]
Let's see: the conjoint of \\(G\\) is defined by
\[ \check{G}(x,y) = \mathbf{Bool}(x, G(y)) .\]
so it evaluates as \\(\texttt{true}\\) iff \\(x \le G(y)\\).
Two cases here:
* \\(y \ge 500\\). In this case \\(G(y) = \texttt{true}\\) so we have \\(x \le G(y) \\) for all \\(x \in \mathbf{Bool}\\). Thus, in this case \\(\check{G}(x,y) = \texttt{true}\\) for all \\(x\\).
* \\(y \lt 500 \\). In this case \\(G(y) = \texttt{false}\\) so we have \\(x \le G(y) \\) iff \\(x = \texttt{false}\\). Thus, in this case \\(\check{G}(x,y) = \texttt{true}\\) only for \\(x = \texttt{false}\\).
In short, \\(\check{G}(x,y) = \texttt{true}\\) iff either \\(y \ge 500\\) or \\(x = \texttt{false}\\).
Or in the English: the feasible situations are precisely those where you either have more than $500, or you don't buy a ticket!
So yes, I think we were both right. I think this feasibility relation is both a companion and a conjoint!
Somehow the conjoint seems more intuitive to me: from the amount of money you have, I can determine whether or not you can buy a ticket.
The companion approach is more mysterious to me: from whether or not you can buy a ticket, I cannot determine how much money you have!
Nonetheless you were able to dream up a monotone function from truth values to amounts of money, whose companion gives the desired feasibility relation. Interesting!

A function is a special kind of relation. So, when you get a feasibility relation from a monotone function \(F: X \to Y\) by taking its companion, you might be fooled into thinking this relation is just that function thought of as a relation in the usual way. But it's not: the usual way gives the relation \(f(x) = y \), but here we're getting the relation \(f(x) \le y\).

That should have been obvious - but my mental image of which feasibility relations arise as companions was a bit off.

I think one of the feasibility relations in my puzzles is neither a companion nor a conjoint. Maybe I'm confused. But does someone see which one I mean?

Comment Source:So this is what I learned from all that.
A function is a special kind of relation. So, when you get a feasibility relation from a monotone function \\(F: X \to Y\\) by taking its companion, you might be fooled into thinking this relation is just that function thought of as a relation in the usual way. But it's not: the usual way gives the relation \\(f(x) = y \\), but here we're getting the relation \\(f(x) \le y\\).
That should have been obvious - but my mental image of which feasibility relations arise as companions was a bit off.
I think one of the feasibility relations in my puzzles is neither a companion nor a conjoint. Maybe I'm confused. But does someone see which one I mean?

In puzzle 207, I think the feasibility relations compose the other way around, that is, it should have been \(\Phi \Psi : \mathbb{N} \nrightarrow [0,\infty) \).

Ugh - yes! But since I'd just been talking about \(\Psi\Phi\) in a general abstract situation, I want my example to be about a feasibility relation called \(\Psi\Phi\) . So I'm going to switch the names \(\Phi\) and \(\Psi\) in puzzles 205 and 206.

Sorry! Things are already confusing enough, given that this feasibility relation

is called \(\Psi\Phi\). That's because when we apply first a function \(f\) and then a function \(g\), we usually call the composite \(g f\) or \(g \circ f\).

Comment Source:Thanks for catching all those typos, Dan!
> 3. In puzzle 207, I think the feasibility relations compose the other way around, that is, it should have been \\(\Phi \Psi : \mathbb{N} \nrightarrow [0,\infty) \\).
Ugh - yes! But since I'd just been talking about \\(\Psi\Phi\\) in a general abstract situation, I want my example to be about a feasibility relation called \\(\Psi\Phi\\) . So I'm going to switch the names \\(\Phi\\) and \\(\Psi\\) in puzzles 205 and 206.
Sorry! Things are already confusing enough, given that this feasibility relation
<center><img src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/codesign_diagram_composition.png"></center>
is called \\(\Psi\Phi\\). That's because when we apply first a function \\(f\\) and then a function \\(g\\), we usually call the composite \\(g f\\) or \\(g \circ f\\).

I think you have a typo in post #13. You mean \(\check{G}\) not \(\hat{G}\), right?

You said in Lecture 65 that \(\hat{F}\) is the companion of \(F\) while \(\check{F}\) is the conjoint of \(F\).

The companion approach is more mysterious to me: from whether or not you can buy a ticket, I cannot determine how much money you have!

Let me try to motivate my reasoning. I was thinking of \(\mathbf{Bool}\) as the set \(\lbrace 0, 1\rbrace\). So I figured "0 tickets costs $0" and "1 ticket costs $500", hence the mapping.

This is also my idea behind the companion for Puzzle 205.

We can also find the conjoint for Puzzle 205. Let \(F : \lbrace 0, 1, 2 \rbrace \to [0,\infty)\) such that \(n \mapsto 2 n\). Using the theorem you had us prove in Lecture 65 that \(\hat{F} = \check{G} \iff F \dashv G\), we just need to find the right adjoint of \(F\) to find the conjoint.

Comment Source:John:
I think you have a typo in post #13. You mean \\(\check{G}\\) not \\(\hat{G}\\), right?
You said in Lecture 65 that \\(\hat{F}\\) is the **companion** of \\(F\\) while \\(\check{F}\\) is the **conjoint** of \\(F\\).
> The companion approach is more mysterious to me: from whether or not you can buy a ticket, I cannot determine how much money you have!
Let me try to motivate my reasoning. I was thinking of \\(\mathbf{Bool}\\) as the set \\(\lbrace 0, 1\rbrace\\). So I figured "0 tickets costs $0" and "1 ticket costs $500", hence the mapping.
This is also my idea behind the companion for **Puzzle 205**.
We can also find the conjoint for Puzzle 205. Let \\(F : \lbrace 0, 1, 2 \rbrace \to [0,\infty)\\) such that \\(n \mapsto 2 n\\). Using the theorem you had us prove in Lecture 65 that \\(\hat{F} = \check{G} \iff F \dashv G\\), we just need to find the right adjoint of \\(F\\) to find the conjoint.
But then \\(G: [0,\infty) \to \lbrace 0, 1, 2 \rbrace\\) is \\(r \mapsto \min (2, \lfloor r / 2 \rfloor)\\). I think in this case the conjoint is harder to see, but maybe that's me.

Puzzle 206. Suppose you are trying to feed hungry children with the loaves of bread you bought in the previous puzzle, and you can feed at most three children with each loaf of bread. Describe this using a feasibility relation \(\Phi : \mathbb{N} \nrightarrow \lbrace 0,1,2\rbrace \). Here \(\mathbb{N}\) is the set of natural numbers \( \lbrace 0,1,2,3,\dots \rbrace \) with its usual ordering.

Puzzle 207. Suppose you buy loaves of bread and then use them to feed hungry children. Compose the feasibility relation \(\Psi : {0,1,2} \nrightarrow [0,\infty) \) from Puzzle 205 and the feasibility relation \(\Phi : \mathbb{N} \nrightarrow \lbrace 0,1,2\rbrace \) from Puzzle 206 to get a feasibility relation \(\Psi \Phi : \mathbb{N} \nrightarrow [0,\infty) \) describing how many children you can feed for a certain amount of money (given the fact that you plan to buy at most two loaves).

Puzzle 208. Suppose you some slices of bread, some slices of cheese and some slices of ham. You are trying to make sandwiches. You can make a cheese sandwich with two slices of bread and one slice of cheese. You can make a ham sandwich with two slices of bread and one slice of ham. There is a feasibility relation \(\Theta : \mathbb{N} \times \mathbb{N} \nrightarrow \mathbb{N} \times \mathbb{N} \times \mathbb{N} \) where \(\Theta(m,n,i,j,k) = \text{true}\) if you can make \(m\) cheese sandwiches and \(n\) ham sandwiches from \(i\) slices of bread, \(j\) slices of cheese and \(k\) slices of ham.

Comment Source:>**Puzzle 208.** Suppose you some slices of bread, some slices of cheese and some slices of ham. You are trying to make sandwiches. You can make a cheese sandwich with two slices of bread and one slice of cheese. You can make a ham sandwich with two slices of bread and one slice of ham. There is a feasibility relation \\(\Theta : \mathbb{N} \times \mathbb{N} \nrightarrow \mathbb{N} \times \mathbb{N} \times \mathbb{N} \\) where \\(\Theta(m,n,i,j,k) = \text{true}\\) if you can make \\(m\\) cheese sandwiches and \\(n\\) ham sandwiches from \\(i\\) slices of bread, \\(j\\) slices of cheese and \\(k\\) slices of ham.
\[
\Theta(m,n,i,j,k) =
\begin{cases}
\texttt{true} & \mbox{if } m \leq j \mbox{ and } n \leq k \mbox{ and } m+n \leq 4i \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]

Puzzle 209. Suppose you are trying to fry some eggs and also toast some slices of bread. Describe each process separately as a feasibility relation from \(\mathbb{N}\) to \(\mathbb{N}\) and then tensor these relations. What is the result?

The exact requirements of frying and toasting is vague... but I think this is what we were supposed to do?

Define \(\Phi(x,x’)\) to be feasibility for frying where you get one fried egg (x) from one egg (x’). Similarly define \(\Psi(y,y’)\) to be feasibility for toasting where you get one toast (y) from one slice of bread (y’).Then :

Puzzle 211. What general mathematical result is Puzzle 209 an example of?

This is just the monoidal preorder law.

Comment Source:>**Puzzle 209.** Suppose you are trying to fry some eggs and also toast some slices of bread. Describe each process separately as a feasibility relation from \\(\mathbb{N}\\) to \\(\mathbb{N}\\) and then tensor these relations. What is the result?
The exact requirements of frying and toasting is vague... but I think this is what we were supposed to do?
Define \\(\Phi(x,x’)\\) to be feasibility for frying where you get one fried egg (x) from one egg (x’). Similarly define \\(\Psi(y,y’)\\) to be feasibility for toasting where you get one toast (y) from one slice of bread (y’).Then :
\[
\Phi(x,x') =
\begin{cases}
\texttt{true} & \mbox{if } x \leq x' \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]
\[
\Psi(y,y') =
\begin{cases}
\texttt{true} & \mbox{if } y \leq y' \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]
\[
(\Phi \otimes \Psi)((x,y),(x',y')) =
\begin{cases}
\texttt{true} & \mbox{if } (x \leq x') \mbox{ and } (y \leq y') \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]
>**Puzzle 211.** What general mathematical result is Puzzle 209 an example of?
This is just the monoidal preorder law.

I think you have a typo in post #13. You mean \(\check{G}\) not \(\hat{G}\), right?

Right, sorry. I've gone back and fixed that - I hope Simon doesn't get upset.

You said in Lecture 65 that \(\hat{F}\) is the companion of \(F\) while \(\check{F}\) is the conjoint of \(F\).

Right. I always mix up "vee" and "wedge" when typing in LaTeX, and apparently I mix up "hat" and "check" too. I seem to do bad at all these arbitrary binary conventions.

Comment Source:Matthew wrote:
> John:
> I think you have a typo in post #13. You mean \\(\check{G}\\) not \\(\hat{G}\\), right?
Right, sorry. I've gone back and fixed that - I hope Simon doesn't get upset. <img src = "http://math.ucr.edu/home/baez/emoticons/tongue2.gif">
> You said in Lecture 65 that \\(\hat{F}\\) is the **companion** of \\(F\\) while \\(\check{F}\\) is the **conjoint** of \\(F\\).
Right. I always mix up "vee" and "wedge" when typing in LaTeX, and apparently I mix up "hat" and "check" too. I seem to do bad at all these arbitrary binary conventions.

Puzzle 209. Suppose you are trying to fry some eggs and also toast some slices of bread. Describe each process separately as a feasibility relation from \(\mathbb{N}\) to \(\mathbb{N}\) and then tensor these relations. What is the result?

Michael wrote:

The exact requirements of frying and toasting is vague...

Yes - I wanted to make people think a little. If you have some number \(x\) of eggs, and you want fried eggs, you can get at most \(x\) fried eggs. Similarly with toasting slices of bread. I wanted people to translate these well-known facts into feasibility relations.

Define \(\Phi(x,x’)\) to be feasibility for frying where you get one fried egg (x) from one egg (x’). Similarly define \(\Psi(y,y’)\) to be feasibility for toasting where you get one toast (y) from one slice of bread (y’).Then :

Puzzle 210. Show that \(\Phi \otimes \Psi\) is really a feasibility relation if \(\Phi\) and \(\Psi\) are feasibility relations.

But Puzzle 209 is about something more specific.

So, let me give some hints.

In Puzzle 209 the feasibility relation we're calling \(\Phi\) is just any old feasibility relation from \(\mathbb{N}\) to \(\mathbb{N}\): it's a very famous one, with a name! Similarly for \(\Psi\)... and similarly for \(\Phi \otimes \Psi\). So the answer to Puzzle 209 is a special case of a general result - a result I haven't stated yet. I'm trying to get people to guess this result based on this particular example.

Comment Source:> **Puzzle 209.** Suppose you are trying to fry some eggs and also toast some slices of bread. Describe each process separately as a feasibility relation from \\(\mathbb{N}\\) to \\(\mathbb{N}\\) and then tensor these relations. What is the result?
Michael wrote:
> The exact requirements of frying and toasting is vague...
Yes - I wanted to make people think a little. If you have some number \\(x\\) of eggs, and you want fried eggs, you can get at most \\(x\\) fried eggs. Similarly with toasting slices of bread. I wanted people to translate these well-known facts into feasibility relations.
> Define \\(\Phi(x,x’)\\) to be feasibility for frying where you get one fried egg (x) from one egg (x’). Similarly define \\(\Psi(y,y’)\\) to be feasibility for toasting where you get one toast (y) from one slice of bread (y’).Then :
> \[
\Phi(x,x') =
\begin{cases}
\texttt{true} & \mbox{if } x \leq x' \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]
> \[
\Psi(y,y') =
\begin{cases}
\texttt{true} & \mbox{if } y \leq y' \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]
Right! And now we tensor them together...
> \[
(\Phi \otimes \Psi)((x,y),(x',y')) =
\begin{cases}
\texttt{true} & \mbox{if } (x \leq x') \mbox{ and } (y \leq y') \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]
Right!
Okay, on to the next puzzle.
> **Puzzle 211.** What general mathematical result is Puzzle 209 an example of?
Michael wrote:
> This is just the monoidal preorder law.
Hmm. First of all, the monoidal preorder law isn't a "result", it's just part of a definition. In a monoidal preorder we must have
\[ x \le x' \text{ and } y \le y \text{ implies } x \otimes x' \le y \otimes y' \]
\\(\textbf{Bool}\\) is a monoidal preorder, and the monoidal preorder law for \\(\textbf{Bool}\\) says
\[ x \le x' \text{ and } y \le y \text{ implies } x \wedge x' \le y \wedge y' \]
I believe this law is the key to solving Puzzle 210:
> **Puzzle 210.** Show that \\(\Phi \otimes \Psi\\) is really a feasibility relation if \\(\Phi\\) and \\(\Psi\\) are feasibility relations.
But Puzzle 209 is about something more specific.
So, let me give some hints.
In Puzzle 209 the feasibility relation we're calling \\(\Phi\\) is just any old feasibility relation from \\(\mathbb{N}\\) to \\(\mathbb{N}\\): it's a very famous one, with a name! Similarly for \\(\Psi\\)... and similarly for \\(\Phi \otimes \Psi\\). So the answer to Puzzle 209 is a special case of a general result - a result I haven't stated yet. I'm trying to get people to guess this result based on this particular example.

Comment Source:I've lost enough marks in school to know that this is *technically* incorrect since \\(x\\) is in units of \\(\text{bread}\\) and \\(y\\) is in units of $.
This is like saying, "an electron will jump to a new orbital, before decaying back down and emitting a photon, but only if it has been given *1.2* of energy."
Without the units, this doesn't make sense.
The answer with units is,
\[
\Psi(x, y) =
\begin{cases}
\texttt{false} & \mbox{if } (x = 1 \text{ bread} \mbox{ and } y \lt \$ 2) \mbox{ or } (x = 2 \text{ bread} \mbox{ and } y \lt \$ 4) \\\\
\texttt{true} & \mbox{otherwise.}
\end{cases}
\]

Half the people who go into math instead of physics do so in order to avoid worrying about units.

If we want to be persnickety about this, I actually think Michael's original formula was correct given my statement of the problem. After all, I said \(\Psi\) was a feasibility relation from \(\lbrace{0,1,2\rbrace}\) to \(\mathbb{N}\). So, for \(\Psi(x,y)\) to make sense we need \(x \in \lbrace0,1,2\rbrace \). So it's possible to have \(x = 1\), but not possible to have \(x = 1 \text{ bread}\).

However, you could argue that in my problem I should have used the set \(\lbrace 0 \text{ bread}, 1 \text{ bread}, 2 \text{ bread}\rbrace \), not the set \(\lbrace{0,1,2\rbrace}\).

That's fine; I wouldn't argue with that. In applications, sets of numbers are 'typed'. That is, the set \(\lbrace 0 \text{ bread}, 1 \text{ bread}, 2 \text{ bread}\rbrace \) is not equal to \(\lbrace 0 \text{ dollar}, 1 \text{ dollar}, 2 \text{ dollar} \rbrace \), just isomorphic. I'm just too lazy to include units in all my sets of numbers. This amounts to treating various isomorphic sets as equal.

Comment Source:Half the people who go into math instead of physics do so in order to avoid worrying about units. <img src = "http://math.ucr.edu/home/baez/emoticons/tongue2.gif">
If we want to be persnickety about this, I actually think Michael's original formula was correct given my statement of the problem. After all, I said \\(\Psi\\) was a feasibility relation from \\(\lbrace{0,1,2\rbrace}\\) to \\(\mathbb{N}\\). So, for \\(\Psi(x,y)\\) to make sense we need \\(x \in \lbrace0,1,2\rbrace \\). So it's possible to have \\(x = 1\\), but not possible to have \\(x = 1 \text{ bread}\\).
However, you could argue that in my problem I should have used the set \\(\lbrace 0 \text{ bread}, 1 \text{ bread}, 2 \text{ bread}\rbrace \\), not the set \\(\lbrace{0,1,2\rbrace}\\).
That's fine; I wouldn't argue with that. In applications, sets of numbers are 'typed'. That is, the set \\(\lbrace 0 \text{ bread}, 1 \text{ bread}, 2 \text{ bread}\rbrace \\) is not equal to \\(\lbrace 0 \text{ dollar}, 1 \text{ dollar}, 2 \text{ dollar} \rbrace \\), just isomorphic. I'm just too lazy to include units in all my sets of numbers. This amounts to treating various isomorphic sets as equal.

You're making it sound like a feasibility relation is a 'multi-valued function' where \(\texttt{false}\) can map to lots of different things. That's a really cool way of talking, which we may be able to make sense of if we work a little - but that's not what we defined a feasibility relation to be.

Christopher wrote approximately:

a relation is the same thing as a multivalued function (where 'multi' includes zero).

Right: that's the clarification I was wanting from Keith. We can think of relations in at least 3 ways:

A relation \(R: X \nrightarrow Y \) between sets is a function
\( R \colon X \to P(Y) \) where \(P(Y)\) is the power set of \(Y\).

We've been using the first two outlooks a lot, but the third lets us think of a relation as a multivalued function from \(X\) to \(Y\), i.e. a function that maps each element of \(X\) to a subset of \(Y \). This is the outlook that Keith was taking!

We can get from outlook 2 to outlook 3 as follows.

Functions \(f: A \times B \to C\) correspond in a one-to-one way with functions \(\hat{f} : A \to C^B\), where \(C^B\) is the set of functions from \(B\) to \(C\). Computer scientists call this correspondence currying. It goes like this:

$$ \tilde{\Phi} : Y \to \textbf{Bool}^{\textbf{X}^{\text{op}}} ? $$
The first problem here is figuring out what's an exponential of preorders!

Comment Source:Keith wrote in comment #1:
> \\(\texttt{false}\\) maps to everything less than &#x24;500
I wrote:
> [...] please clarify what you mean by saying
> > \\(\texttt{false}\\) maps to everything less than &#x24;500
> You're making it sound like a feasibility relation is a 'multi-valued function' where \\(\texttt{false}\\) can map to lots of different things. That's a really cool way of talking, which we may be able to make sense of if we work a little - but that's not what we defined a feasibility relation to be.
Christopher wrote approximately:
> a relation is the same thing as a multivalued function (where 'multi' includes zero).
Right: that's the clarification I was wanting from Keith. We can think of relations in at least 3 ways:
1. A relation \\(R: X \nrightarrow Y \\) between sets is a subset \\( R \subseteq X \times Y \\).
2. A relation \\(R: X \nrightarrow Y \\) between sets is a function
\\( R \colon X \times Y \to \textbf{Bool} \\).
3. A relation \\(R: X \nrightarrow Y \\) between sets is a function
\\( R \colon X \to P(Y) \\) where \\(P(Y)\\) is the power set of \\(Y\\).
We've been using the first two outlooks a lot, but the third lets us think of a relation as a multivalued function from \\(X\\) to \\(Y\\), i.e. a function that maps each element of \\(X\\) to a _subset_ of \\(Y \\). This is the outlook that Keith was taking!
We can get from outlook 2 to outlook 3 as follows.
Functions \\(f: A \times B \to C\\) correspond in a one-to-one way with functions \\(\hat{f} : A \to C^B\\), where \\(C^B\\) is the set of functions from \\(B\\) to \\(C\\). Computer scientists call this correspondence **currying**. It goes like this:
\[ \hat{f}(a)(b) = f(a,b) .\]
So, functions
\[ f: X \times Y \to \textbf{Bool} \]
correspond in a one-to-one way with functions
\[ \hat{f} : X \to \textbf{Bool}^Y .\]
But \\(\textbf{Bool}^Y\\) is just the power set of \\(Y \\)!
It's interesting to see how this plays out when we think about _feasibility_ relations.
**Puzzle.** Suppose \\(X\\) and \\(Y\\) are preorders. Can we reinterpret a feasibility relation, namely a monotone function
\[ \Phi : X^{\text{op}} \times Y \to \textbf{Bool} , \]
as a monotone function
\[ \hat{\Phi} : X^{\text{op}} \to \textbf{Bool}^{\textbf{X}} \]
or perhaps slightly better
\[ \tilde{\Phi} : Y \to \textbf{Bool}^{\textbf{X}^{\text{op}}} ? \]
The first problem here is figuring out what's an exponential of preorders!

Puzzle 212. We can get a feasibility relation by taking either the companion or the conjoint of a monotone map, thanks to the ideas in the puzzles of Lecture 65. Which of the feasibility relations in this lecture's puzzles are companions or conjoints?

This companion and conjoint business is confusing but from what I've been able to put together, its basically the two ways of creating a feasibility relation from a monotone function? It seems to be related to whether the feasibility relation is based on "at most" or "at least" or both or none? This is still very distant to me and I think I need more examples to get some intuition. Has anyone worked the answers to this puzzle?

Comment Source:>**Puzzle 212.** We can get a feasibility relation by taking either the companion or the conjoint of a monotone map, thanks to the ideas in the puzzles of [Lecture 65](https://forum.azimuthproject.org/discussion/2299/lecture-65-chapter-4-collaborative-design/p1). Which of the feasibility relations in this lecture's puzzles are companions or conjoints?
This companion and conjoint business is confusing but from what I've been able to put together, its basically the two ways of creating a feasibility relation from a monotone function? It seems to be related to whether the feasibility relation is based on "at most" or "at least" or both or none? This is still very distant to me and I think I need more examples to get some intuition. Has anyone worked the answers to this puzzle?

So if we want \(\Phi = \hat{F}\) for some \(F\), we need a monotone function \(F: \mathbf{Bool} \to [0,\infty)\).

Perhaps what is confusing is that we are using some shorthand here.

\(\mathbf{Bool}\) is shorthand for "the bounded total order \((\lbrace \mathtt{false}, \mathtt{true}\rbrace, \leq, \mathtt{false})\) where \(\mathtt{false} \le \mathtt{true}\)." Perhaps most confusingly, we are taking \(\mathbf{Bool}\) here to be a \(\mathbf{Bool}\)-enriched category. In particular, as a \(\mathbf{Bool}\)-enriched category \(\mathbf{Bool}(x,y) = x \leq y\).

Moreover \([0,\infty)\) is shorthand "the lower-bounded total order \(([0,\infty), \leq, 0)\) where under the conventional ordering from analysis class". Once again we have a \(\mathbf{Bool}\)-enriched category on our hands, since all partial orders are bool-enriched categories. In particular, as a \(\mathbf{Bool}\)-enriched category \([0,\infty)(x,y) = x \leq y\).

So finding a map \(F: \mathbf{Bool} \to [0,\infty)\), but we know price goes up with quantity so I just list out the price of things.

John's answer is the right adjoint of my answer (if this isn't obvious, perhaps we can check this).

Comment Source:> Sorry this is probably a newbie question but why is \\(\mathcal{Y}(F(x), y )\\) of type \\(\mathbf{Bool}\\) ?
The short answer: is because partial orders are \\(\mathbf{Bool}\\)-categories, and a monotone function is exactly the same as a functor between \\(\mathbf{Bool}\\)-categories .
The long answer: For **Puzzle 204**, we want to define a feasibility relation \\(\Phi : \mathbf{Bool} \nrightarrow [0,\infty)\\).
If we have a monotone function \\(F: \mathcal{X} \to \mathcal{Y} \\), its companion \\(\hat{F} : \mathcal{X} \to \mathcal{Y} \\) is defined by \\(\hat{F}(x,y) = \mathcal{Y}(F(x),y)\\).
So if we want \\(\Phi = \hat{F}\\) for some \\(F\\), we need a monotone function \\(F: \mathbf{Bool} \to [0,\infty)\\).
Perhaps what is confusing is that we are using some shorthand here.
\\(\mathbf{Bool}\\) is shorthand for "the bounded total order \\((\lbrace \mathtt{false}, \mathtt{true}\rbrace, \leq, \mathtt{false})\\) where \\(\mathtt{false} \le \mathtt{true}\\)." Perhaps most confusingly, we are taking \\(\mathbf{Bool}\\) here to be a \\(\mathbf{Bool}\\)-enriched category. In particular, as a \\(\mathbf{Bool}\\)-enriched category \\(\mathbf{Bool}(x,y) = x \leq y\\).
Moreover \\([0,\infty)\\) is shorthand "the lower-bounded total order \\(([0,\infty), \leq, 0)\\) where under the conventional ordering from analysis class". Once again we have a \\(\mathbf{Bool}\\)-enriched category on our hands, since all partial orders are bool-enriched categories. In particular, as a \\(\mathbf{Bool}\\)-enriched category \\([0,\infty)(x,y) = x \leq y\\).
So finding a map \\(F: \mathbf{Bool} \to [0,\infty)\\), but we know price goes up with quantity so I just list out the price of things.
John's answer is the right adjoint of my answer (if this isn't obvious, perhaps we can check this).

These are of type \(\mathbf{Bool}\) because a \(\mathbf{Bool}\)-profunctor \(\Phi : X \nrightarrow Y\) is the same as a functor \(\overline{\Phi} : X^{op} \times Y \to \mathbf{Bool}\).

Comment Source:These are of type \\(\mathbf{Bool}\\) because a \\(\mathbf{Bool}\\)-profunctor \\(\Phi : X \nrightarrow Y\\) is the same as a functor \\(\overline{\Phi} : X^{op} \times Y \to \mathbf{Bool}\\).

The short answer: is because partial orders are \(\mathbf{Bool}\)-categories, and a monotone function is exactly the same as a functor between \(\mathbf{Bool}\)-categories .

Doh. We learned this... sorry forgot that preorders are just \(\mathbf{Bool}\)-categories. I think I've been learning too much in short period of time LOL. Thanks for the kind answer.

Comment Source:Matthew wrote :
>The short answer: is because partial orders are \\(\mathbf{Bool}\\)-categories, and a monotone function is exactly the same as a functor between \\(\mathbf{Bool}\\)-categories .
Doh. We learned this... sorry forgot that preorders are just \\(\mathbf{Bool}\\)-categories. I think I've been learning too much in short period of time LOL. Thanks for the kind answer.

This companion and conjoint business is confusing but from what I've been able to put together, its basically the two ways of creating a feasibility relation from a monotone function? It seems to be related to whether the feasibility relation is based on "at most" or "at least" or both or none? This is still very distant to me and I think I need more examples to get some intuition. Has anyone worked the answers to this puzzle?

Maybe we can find a few companions and conjoints together? I already tried to find a few.

John mentioned that one of the problems has neither a conjoint nor a companion, so finding that one and proving it doesn't have any is going to be hard.

Puzzle 206. Suppose you are trying to feed hungry children with the loaves of bread you bought in the previous puzzle, and you can feed at most three children with each loaf of bread. Describe this using a feasibility relation \(\Phi : \mathbb{N} \nrightarrow \lbrace 0,1,2\rbrace \). Here \(\mathbb{N}\) is the set of natural numbers \( \lbrace 0,1,2,3,\dots \rbrace \) with its usual ordering.

The companion, if it exists at all, is less intuitive. If it doesn't exist do you see how we'd go about proving it doesn't?

Comment Source:Hey Michael,
> This companion and conjoint business is confusing but from what I've been able to put together, its basically the two ways of creating a feasibility relation from a monotone function? It seems to be related to whether the feasibility relation is based on "at most" or "at least" or both or none? This is still very distant to me and I think I need more examples to get some intuition. Has anyone worked the answers to this puzzle?
Maybe we can find a few companions and conjoints together? I already tried to find a few.
John mentioned that one of the problems has *neither* a conjoint nor a companion, so finding that one and proving it doesn't have any is going to be hard.
> >**Puzzle 206.** Suppose you are trying to feed hungry children with the loaves of bread you bought in the previous puzzle, and you can feed at most three children with each loaf of bread. Describe this using a feasibility relation \\(\Phi : \mathbb{N} \nrightarrow \lbrace 0,1,2\rbrace \\). Here \\(\mathbb{N}\\) is the set of natural numbers \\( \lbrace 0,1,2,3,\dots \rbrace \\) with its usual ordering.
>
> \[
\Psi(x, y) =
\begin{cases}
\texttt{true} & \mbox{if } (x \leq 0 \mbox{ and } y = 0) \mbox{ or } (x \leq 3 \mbox{ and } y = 1) \mbox{ or } (x \leq 6 \mbox{ and } y = 2) \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]
I can see a conjoint that gives rise to your answer.
The companion, if it exists at all, is less intuitive. If it doesn't exist do you see how we'd go about proving it doesn't?

In Puzzle 209 the feasibility relation we're calling \(\Phi\) is just any old feasibility relation from \(\mathbb{N}\) to \(\mathbb{N}\): it's a very famous one, with a name! Similarly for \(\Psi\)... and similarly for \(\Phi \otimes \Psi\). So the answer to Puzzle 209 is a special case of a general result - a result I haven't stated yet. I'm trying to get people to guess this result based on this particular example.

They are the identity morphisms for their respective objects in the category of feasibility relations. Perhaps the general result you mean is that the tensor of identities gives the identity for the tensor of the objects.

Comment Source:> But Puzzle 209 is about something more specific.
> So, let me give some hints.
> In Puzzle 209 the feasibility relation we're calling \\(\Phi\\) is just any old feasibility relation from \\(\mathbb{N}\\) to \\(\mathbb{N}\\): it's a very famous one, with a name! Similarly for \\(\Psi\\)... and similarly for \\(\Phi \otimes \Psi\\). So the answer to Puzzle 209 is a special case of a general result - a result I haven't stated yet. I'm trying to get people to guess this result based on this particular example.
They are the identity morphisms for their respective objects in the category of feasibility relations. Perhaps the general result you mean is that the tensor of identities gives the identity for the tensor of the objects.

In Puzzle 209, \(\Phi, \Psi \colon \mathbf{N} \to \mathbf{N}\) are both the identity feasibility relation, and we are tensoring them and getting the identity feasibility relation from \(\mathbb{N} \times \mathbb{N}\) to itself.

If anyone doesn't see why these guys are identities, they can look at Lecture 64, where I proved this:

In Lecture 67 we'll see another use for the 'hom-functor': it not only gives identities, it gives something called the 'cup'.

Comment Source:Yoav - yes, you're right!
In Puzzle 209, \\(\Phi, \Psi \colon \mathbf{N} \to \mathbf{N}\\) are both the identity feasibility relation, and we are tensoring them and getting the identity feasibility relation from \\(\mathbb{N} \times \mathbb{N}\\) to itself.
If anyone doesn't see why these guys are identities, they can look at [Lecture 64](https://forum.azimuthproject.org/discussion/2298/lecture-64-chapter-4-the-category-of-enriched-profunctors#latest), where I proved this:
> **Lemma.** For any \\(\mathcal{V}\\)-enriched category \\(\mathcal{X}\\), the \\(\mathcal{V}\\)-enriched functor \\( \mathrm{hom} \colon \mathcal{X}^{\text{op}} \times \mathcal{X} \to \mathcal{V} \\), defined by
> \[ \mathrm{hom}(x,x') = \mathcal{X}(x,x') ,\]
> corresponds to a \\(\mathcal{V}\\)-enriched profunctor
> \[ 1_{\mathcal{X}} \colon \mathcal{X} \nrightarrow \mathcal{X} \]
> that serves as an identity for composition.
A feasibility relation is just a \\(\textbf{Bool}\\)-enriched profunctor, so we can water down the above Lemma to this special case:
**Watered-Down Lemma.** For an preorder \\(X\\), the monotone function \\( \mathrm{hom} \colon X^{\text{op}} \times X \to \mathbf{Bool} \\), defined by
\[ \mathrm{hom}(x,x') =
\begin{cases}
\texttt{true} & \mbox{if } x \le x' \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]
corresponds to a feasibility relation
\[ 1\_{\mathcal{X}} \colon X \nrightarrow X \]
that serves as an identity for composition.
In [Lecture 67](https://forum.azimuthproject.org/discussion/2303/lecture-67-chapter-4-collaborative-design/p1) we'll see another use for the 'hom-functor': it not only gives identities, it gives something called the 'cup'.

John mentioned that one of the problems has neither a conjoint nor a companion [....]

I think I might have been wrong about that.

My intuition for companions and conjoints wasn't so good at first: witness my surprise in comment #9! But I think that surprise wound up improving my intuition.

So, let me try to explain my intuition for this stuff. It's easiest with an example:

Puzzle 207. Suppose you buy loaves of bread and then use them to feed hungry children. Compose the feasibility relation \(\Psi : {0,1,2} \nrightarrow [0,\infty) \) from Puzzle 205 and the feasibility relation \(\Phi : \mathbb{N} \nrightarrow \lbrace 0,1,2\rbrace \) from Puzzle 206 to get a feasibility relation \(\Psi \Phi : \mathbb{N} \nrightarrow [0,\infty) \) describing how many children you can feed for a certain amount of money (given the fact that you plan to buy at most two loaves).

Suppose we want \(\Psi\) to be the companion of some monotone function \(F \colon {0,1,2} \nrightarrow [0,\infty) \).

\(F\) is a function that takes a number of loaves of bread and gives an amount of money. So, the obvious first guess is a function \(F\) such that

\(x\) loaves of bread costs \(F(x)\) dollars.

\(\hat{F}\) will then take this function and 'pad it out' to give a feasibility relation. If you have more than \(F(x)\) dollars, it's still feasible to buy \(x\) loaves of bread. And if you have \(F(x)\) dollars, it's feasible to buy less than \(x\) loaves of bread. So the feasibility relation \(\hat{F}\) is true for more pairs \( (x,y) \) than those for which \(F(x) = y\).

In fact, it's true exactly for pairs with \(F(x) \le y\)!

This isn't hard to see. The idea of a companion is that

$$ \hat{F}(x,y) = \mathbf{Bool}(F(x), y ) $$
but if you unravel all the jargon and notation, this just means

\( \hat{F}(x,y) = \text{true} \) iff \(F(x) \le y \)

So, to find a function \(F\) whose companion is \(\Psi\), we need a function such that

But to repeat myself: if we're seeking such a function, the obvious first guess is a function such that

\(x\) loaves of bread costs \(F(x)\) dollars.

For Puzzle 207, I think such a function exists.

Comment Source:Matthew wrote:
> John mentioned that one of the problems has *neither* a conjoint nor a companion [....]
I think I might have been wrong about that.
My intuition for companions and conjoints wasn't so good at first: witness my surprise in [comment #9](https://forum.azimuthproject.org/discussion/comment/20337/#Comment_20337)! But I think that surprise wound up improving my intuition.
So, let me try to explain my intuition for this stuff. It's easiest with an example:
> **Puzzle 207.** Suppose you buy loaves of bread and then use them to feed hungry children. Compose the feasibility relation \\(\Psi : \{0,1,2\} \nrightarrow [0,\infty) \\) from Puzzle 205 and the feasibility relation \\(\Phi : \mathbb{N} \nrightarrow \lbrace 0,1,2\rbrace \\) from Puzzle 206 to get a feasibility relation \\(\Psi \Phi : \mathbb{N} \nrightarrow [0,\infty) \\) describing how many children you can feed for a certain amount of money (given the fact that you plan to buy at most two loaves).
Suppose we want \\(\Psi\\) to be the companion of some monotone function \\(F \colon \{0,1,2\} \nrightarrow [0,\infty) \\).
\\(F\\) is a function that takes a number of loaves of bread and gives an amount of money. So, the obvious first guess is a function \\(F\\) such that
<center> \\(x\\) loaves of bread costs \\(F(x)\\) dollars.</center>
\\(\hat{F}\\) will then take this function and 'pad it out' to give a feasibility relation. If you have _more than_ \\(F(x)\\) dollars, it's still feasible to buy \\(x\\) loaves of bread. And if you have \\(F(x)\\) dollars, it's feasible to buy _less than_ \\(x\\) loaves of bread. So the feasibility relation \\(\hat{F}\\) is true for more pairs \\( (x,y) \\) than those for which \\(F(x) = y\\).
In fact, it's true exactly for pairs with \\(F(x) \le y\\)!
This isn't hard to see. The idea of a companion is that
\[ \hat{F}(x,y) = \mathbf{Bool}(F(x), y ) \]
but if you unravel all the jargon and notation, this just means
<center> \\( \hat{F}(x,y) = \text{true} \\) iff \\(F(x) \le y \\) </center>
So, to find a function \\(F\\) whose companion is \\(\Psi\\), we need a function such that
<center> You can buy \\(x\\) loaves of bread for \\(y\\) dollars iff \\(F(x) \le y\\). </center>
But to repeat myself: if we're seeking such a function, the obvious first guess is a function such that
<center> \\(x\\) loaves of bread costs \\(F(x)\\) dollars.</center>
For Puzzle 207, I think such a function exists.

Conjoints work the same way only backwards. If you've got a feasibility relation \(\Phi \colon X \nrightarrow Y \) and you want it to be the conjoint of some function \(G \colon Y \to X\), you need

\(\Phi(x,y) = \text{true} \) iff \(x \le G(y) \).

But in Puzzle 207, which is about buying loaves of bread, the obvious first guess would be a function \(G\) such that

\(y\) dollars can buy \(G(y) \) loaves of bread.

Comment Source:Conjoints work the same way only backwards. If you've got a feasibility relation \\(\Phi \colon X \nrightarrow Y \\) and you want it to be the conjoint of some function \\(G \colon Y \to X\\), you need
<center> \\(\Phi(x,y) = \text{true} \\) iff \\(x \le G(y) \\). </center>
But in Puzzle 207, which is about buying loaves of bread, the obvious first guess would be a function \\(G\\) such that
<center> \\(y\\) dollars can buy \\(G(y) \\) loaves of bread. </center>

Puzzle 210. Show that \(\Phi \otimes \Psi\) is really a feasibility relation if \(\Phi\) and \(\Psi\) are feasibility relations.

I thought it might be worth proving it in the general case, ie

$$ \Phi \text{ and } \Psi \text{ are }\mathcal{V}\text{-profunctors} \implies (\Phi\otimes\Psi) \text{ is a }\mathcal{V}\text{-profunctor} $$
This amounts to proving that for all objects \((x, x')\) and \((a, a')\) in \(X\times X'\), and all objects \((y, y')\) and \((b, b')\) in \(Y\times Y'\), we have:

$$\mathrm{hom}_{\mathcal{X}} \otimes \mathrm{hom}_{\mathcal{Y}} = \mathrm{hom}_{\mathcal{X} \times \mathcal{Y}} $$
Perhaps we can also think about Puzzle 209 from the perspective of companions and conjoints.

One way between \(\mathcal{V}\)-enriched categories form a category is via composition. Every \(\mathcal{V}\)-category has a identity functor that leaves the objects alone and \(F \circ G (x) = F(G(x))\) is associative and obeys the \(\mathcal{V}\)-laws.

Let \(I_{\mathcal{X}}\) denote the identity functor for \(\mathcal{X}\), then we have:

$$ \hat{I}_{\mathcal{X}} = \check{I}_{\mathcal{X}} = \mathrm{hom}_{\mathcal{X}} $$
Moreover, for \(\mathbf{Bool}\)-categories in particular, we know how to construct products. We can lift this into product functors with \((F\times G)(x,y) := (F(x),G(y))\). In the special case of identity functors, we have:

This sort of leads me to wonder if we can generalize the above as a special case of two more general rules:

Is \(\hat{F} \otimes \hat{G} = \widehat{F \times G}\)?

Is \(\check{F} \otimes \check{G} = \overline{F \times G}\)?

Moreover, thinking about Puzzle 207, I have been wondering:

Is \(\hat{F} \hat{G} = \widehat{F \circ G}\)?

Is \(\check{F} \check{G} = \overline{F \circ G}\)?

I think the answer to those two questions is yes but I don't quite know...

Comment Source:John wrote:
>> **Lemma.** For any \\(\mathcal{V}\\)-enriched category \\(\mathcal{X}\\), the \\(\mathcal{V}\\)-enriched functor \\( \mathrm{hom} \colon \mathcal{X}^{\text{op}} \times \mathcal{X} \to \mathcal{V} \\), defined by
>> \[ \mathrm{hom}(x,x') = \mathcal{X}(x,x') ,\]
>> corresponds to a \\(\mathcal{V}\\)-enriched profunctor
>> \[ 1_{\mathcal{X}} \colon \mathcal{X} \nrightarrow \mathcal{X} \]
>> that serves as an identity for composition.
Based on Yoav's comment, I think we can say further that:
\[\mathrm{hom}\_{\mathcal{X}} \otimes \mathrm{hom}\_{\mathcal{Y}} = \mathrm{hom}\_{\mathcal{X} \times \mathcal{Y}} \]
Perhaps we can also think about **Puzzle 209** from the perspective of companions and conjoints.
One way between \\(\mathcal{V}\\)-enriched categories form a category is via composition. Every \\(\mathcal{V}\\)-category has a identity functor that leaves the objects alone and \\(F \circ G (x) = F(G(x))\\) is associative and obeys the \\(\mathcal{V}\\)-laws.
Let \\(I\_{\mathcal{X}}\\) denote the identity functor for \\(\mathcal{X}\\), then we have:
\[ \hat{I}\_{\mathcal{X}} = \check{I}\_{\mathcal{X}} = \mathrm{hom}\_{\mathcal{X}} \]
Moreover, for \\(\mathbf{Bool}\\)-categories in particular, we know how to construct products. We can lift this into product functors with \\((F\times G)(x,y) := (F(x),G(y))\\). In the special case of identity functors, we have:
\[
\begin{align}
\widehat{(I\_{\mathcal{X}} \times I\_{\mathcal{Y}})} & = \hat{I}\_{\mathcal{X}} \otimes \hat{I}\_{\mathcal{Y}} \\\\
\overline{(I\_{\mathcal{X}} \times I\_{\mathcal{Y}})}& = \check{I}\_{\mathcal{X}} \otimes \check{I}\_{\mathcal{Y}} \\\\
\end{align}
\]
Here I am using \\(\overline{(I\_{\mathcal{X}} \times I\_{\mathcal{Y}})}\\) because mathjax doesn't support `\widecheck`.
This sort of leads me to wonder if we can generalize the above as a special case of two more general rules:
1. Is \\(\hat{F} \otimes \hat{G} = \widehat{F \times G}\\)?
2. Is \\(\check{F} \otimes \check{G} = \overline{F \times G}\\)?
Moreover, thinking about Puzzle 207, I have been wondering:
3. Is \\(\hat{F} \hat{G} = \widehat{F \circ G}\\)?
4. Is \\(\check{F} \check{G} = \overline{F \circ G}\\)?
I think the answer to those two questions is *yes* but I don't quite know...

Great! I could only figure \(\hat{F} \hat{G} = \widehat{F \circ G}\) using an adjunction, but you strengthened it!

I think all of the results involving conjoints are basically the same arguments but flipped.

Comment Source:Hey Anindya,
Great! I could only figure \\(\hat{F} \hat{G} = \widehat{F \circ G}\\) using an adjunction, but you strengthened it!
I think all of the results involving conjoints are basically the same arguments but flipped.

Puzzle 206. Suppose you are trying to feed hungry children with the loaves of bread you bought in the previous puzzle, and you can feed at most three children with each loaf of bread. Describe this using a feasibility relation \(\Phi : \mathbb{N} \nrightarrow \lbrace 0,1,2\rbrace \). Here \(\mathbb{N}\) is the set of natural numbers \( \lbrace 0,1,2,3,\dots \rbrace \) with its usual ordering.

Feasibily relation is saying "If we have y loaves, we can feed at most G(y) children."

The companion, if it exists at all, is less intuitive. If it doesn't exist do you see how we'd go about proving it doesn't?

I think I see why this whole business is confusing. I can give a companion solution using a different G(y) but I do not see how we can make a companion using the function described above nor can I prove it. I can plug it in using definitions and can see it is impossible to give a viable companion solution tho. Using a different G(y) or to make notation more applicable, using a new function F(x), we can do the following:

Since F(x) and G(y) are adjoints, shouldn't \(\hat{F}(x,y) = \check{G}(x,y)\)?

Comment Source:Matthew
> >**Puzzle 206.** Suppose you are trying to feed hungry children with the loaves of bread you bought in the previous puzzle, and you can feed at most three children with each loaf of bread. Describe this using a feasibility relation \\(\Phi : \mathbb{N} \nrightarrow \lbrace 0,1,2\rbrace \\). Here \\(\mathbb{N}\\) is the set of natural numbers \\( \lbrace 0,1,2,3,\dots \rbrace \\) with its usual ordering.
>
> \[
\Psi(x, y) =
\begin{cases}
\texttt{true} & \mbox{if } (x \leq 0 \mbox{ and } y = 0) \mbox{ or } (x \leq 3 \mbox{ and } y = 1) \mbox{ or } (x \leq 6 \mbox{ and } y = 2) \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]
> I can see a conjoint that gives rise to your answer.
Thanks for doing this. Guidance like this is really helpful as a newb. Really appreciate it.
I think the conjoint is pretty obvious from the feasibility relation.
First set \\(G(y) =3x\\):
\[ \text{y loaves feeds G(y) children} \]
Then \\(\check{G}(x,y) = \text{true iff } x \le G(y) \\).
Feasibily relation is saying "If we have y loaves, we can feed at most G(y) children."
> The companion, if it exists at all, is less intuitive. If it doesn't exist do you see how we'd go about proving it doesn't?
I think I see why this whole business is confusing. I can give a companion solution using a different G(y) but I do not see how we can make a companion using the function described above nor can I prove it. I can plug it in using definitions and can see it is impossible to give a viable companion solution tho. Using a different G(y) or to make notation more applicable, using a new function F(x), we can do the following:
First set \\(F(x) = \left\lceil x/3 \right\rceil\\):
\[\text{x children need F(x) loaves of bread} \]
Then \\(\hat{F}(x,y) = \text{true iff } F(x) \le y \\):
\[
\Psi(x, y) =
\begin{cases}
\texttt{true} & \mbox{if } (0 \leq x \mbox{ and } 0 \leq y) \mbox{ or } (3 \leq x \mbox{ and } 1 \leq y) \mbox{ or } (6 \leq x \mbox{ and } 2 \leq y ) \\\\
\texttt{false} & \mbox{otherwise.}
\end{cases}
\]
In this case, feasibility relation is saying "if we have at least x children, we need at least F(x) loaves of bread."
Since F(x) and G(y) are adjoints, shouldn't \\(\hat{F}(x,y) = \check{G}(x,y)\\)?

Thanks for doing this. Guidance like this is really helpful as a newb. Really appreciate it.

I think the conjoint is pretty obvious from the feasibility relation.
First set \(G(y) =3y\)

Yes! This is exactly what I got :)

The companion, if it exists at all, is less intuitive. If it doesn't exist do you see how we'd go about proving it doesn't?

I think I see why this whole business is confusing. I can give a companion solution using a different G(y) but I do not see how we can make a companion using the function described above nor can I prove it. I can plug it in using definitions and can see it is impossible to give a viable companion solution tho. Using a different G(y) or to make notation more applicable, using a new function F(x), we can do the following:

First set \(F(x) = \left\lceil x/3 \right\rceil\)

Believe me, this is really confusing for me too!

The conjoint \(G\) you gave works, as well as the feasibility relation \(\Phi\). In this case, there is no companion \(F\).

Let's see the issue. For starters, the \(F\) you gave here is not a function. It needs to map every value in \(\mathbb{N}\) to the range \(\lbrace 0,1,2 \rbrace\).

Now suppose that we tried to repair \(F\) to be a function somehow. It turns out it's impossible to fix.

We know that since 2 is the max in \(\lbrace 0,1,2\rbrace\), then \(F(7) \leq 2\).

But if \(\hat{F} = \check{G}\), then we know that \(F \dashv G\) hence \(7 \leq G(2)\). But that says \(7 \leq 6\), which is impossible!

This argument I just gave to prove there is no companion used two things: \(\hat{F} = \check{G} \iff F \dashv G\) and the Adjoint functor theorem for posets. I did not explicitly invoke the adjoint functor theorem, however, just thought about it.

If you want, you can try to see how to use the adjoint functor theorem directly.

The adjoint functor theorem says that the \(G\) you gave, if it is a right adjoint, must preserve all arbitrary meets. Can you see a meet it doesn't preserve?

Comment Source:Michael wrote:
> Thanks for doing this. Guidance like this is really helpful as a newb. Really appreciate it.
>
> I think the conjoint is pretty obvious from the feasibility relation.
> First set \\(G(y) =3y\\)
Yes! This is exactly what I got :)
> > The companion, if it exists at all, is less intuitive. If it doesn't exist do you see how we'd go about proving it doesn't?
>
> I think I see why this whole business is confusing. I can give a companion solution using a different G(y) but I do not see how we can make a companion using the function described above nor can I prove it. I can plug it in using definitions and can see it is impossible to give a viable companion solution tho. Using a different G(y) or to make notation more applicable, using a new function F(x), we can do the following:
>
> First set \\(F(x) = \left\lceil x/3 \right\rceil\\)
Believe me, this is really confusing for me too!
The conjoint \\(G\\) you gave works, as well as the feasibility relation \\(\Phi\\). In this case, there is no companion \\(F\\).
Let's see the issue. For starters, the \\(F\\) you gave here is not a function. It needs to map every value in \\(\mathbb{N}\\) to the range \\(\lbrace 0,1,2 \rbrace\\).
Now suppose that we tried to *repair* \\(F\\) to be a function somehow. It turns out it's impossible to fix.
We know that since 2 is the max in \\(\lbrace 0,1,2\rbrace\\), then \\(F(7) \leq 2\\).
But if \\(\hat{F} = \check{G}\\), then we know that \\(F \dashv G\\) hence \\(7 \leq G(2)\\). But that says \\(7 \leq 6\\), which is impossible!
This argument I just gave to prove there is no companion used two things: \\(\hat{F} = \check{G} \iff F \dashv G\\) and the [Adjoint functor theorem for posets](https://forum.azimuthproject.org/discussion/2031/lecture-16-chapter-1-the-adjoint-functor-theorem-for-posets/p1). I did not explicitly invoke the adjoint functor theorem, however, just thought about it.
If you want, you can try to see how to use the adjoint functor theorem directly.
The adjoint functor theorem says that the \\(G\\) you gave, if it is a right adjoint, must preserve all arbitrary meets. Can you see a meet it doesn't preserve?

If \(X\) and \(Y\) are posets, then let \(Y^X\) be the set \(\lbrace F: X \to Y \mid F \text{ is monotone}\rbrace\). If \(f,g \in Y^X\) then \(f \leq_{Y^X} g\) if and only if \(f(x) \leq_Y g(x)\) for all \(x \in X\).

We want to show \(\mathrm{Hom}(X\times Y,Z) \cong \mathrm{Hom}(X,Z^Y)\). This can be done by defining

First, let \(x \leq x'\). We need to show \(\mathtt{curry}(f)(x) \leq \mathtt{curry}(f)(x')\). But this means we need to show \(\mathtt{curry}(f)(x)(y) \leq \mathtt{curry}(f)(x')(y)\) for all \(y\). By evaluating these functions we can see we want to show \( f(x,y) \leq f(x',y)\) for all \(y\). Since \(x \leq x'\) we know that \((x,y) \leq (x',y)\) by definition of the product order, and \(f(x,y) \leq f(x',y)\) since \(f\) is mono.

We can be confident then that \(\mathtt{curry}\) and \(\mathtt{uncurry}\) are well defined.

Next, let's check that they are inverses. Evaluating the functions defined gives:

$$
\begin{align}
(((\mathtt{curry} \circ \mathtt{uncurry})(g))(x))(y) & = ((\mathtt{curry} (\mathtt{uncurry}(g)))(x))(y) \\
& = (\mathtt{uncurry}(g))(x,y) \\
& = (g(x))(y)
\end{align}
$$
However, \(((id(g))(x))(y) = (g(x))(y)\), so by extensionality we have \((\mathtt{curry} \circ \mathtt{uncurry}) = id\). Extensionality is the principle that says that if two sets have the same elements, then they are equivalent. In Higher Order Logic and the λ-calculus, it holds that if two functions are the same on all inputs then they are the same.

We can note that the category of Posets and the category of Preorders have a terminal object: the poset with 1 element. So the categories are in fact Cartesian Closed Categories.

They also have coproducts (I can talk about this a little if someone wants). I do not know if they have an initial object, however. So I can't say if the categories of Posets and Preorders are Bicartesian closed...

Comment Source:John wrote:
> **Puzzle.** Suppose \\(X\\) and \\(Y\\) are preorders. Can we reinterpret a feasibility relation, namely a monotone function
>
> \[ \Phi : X^{\text{op}} \times Y \to \textbf{Bool} , \]
>
> as a monotone function
>
> \[ \hat{\Phi} : X^{\text{op}} \to \textbf{Bool}^{\textbf{X}} \]
>
> or perhaps slightly better
>
> \[ \tilde{\Phi} : Y \to \textbf{Bool}^{\textbf{X}^{\text{op}}} ? \]
>
> The first problem here is figuring out what's an exponential of preorders!
Okay, I cheated a little and I looked this up in [Steve Awodey's lecture notes](https://www.andrew.cmu.edu/course/80-413-713/notes/chap06.pdf).
If \\(X\\) and \\(Y\\) are posets, then let \\(Y^X\\) be the set \\(\lbrace F: X \to Y \mid F \text{ is monotone}\rbrace\\). If \\(f,g \in Y^X\\) then \\(f \leq\_{Y^X} g\\) if and only if \\(f(x) \leq\_Y g(x)\\) for all \\(x \in X\\).
We want to show \\(\mathrm{Hom}(X\times Y,Z) \cong \mathrm{Hom}(X,Z^Y)\\). This can be done by defining
- \\(\mathtt{curry} : \mathrm{Hom}(X\times Y,Z) \to \mathrm{Hom}(X,Z^Y)\\) and
- \\(\mathtt{uncurry} : \mathrm{Hom}(X,Z^Y) \to \mathrm{Hom}(X\times Y,Z)\\)
We also need to show these definititions are well defined, and demonstrate \\(\mathtt{curry} \circ \mathtt{uncurry} = id\\) and \\(\mathtt{uncurry} \circ \mathtt{curry} = id\\).
Here are the definitions:
\[
\begin{align}
\mathtt{curry}(f) & := x \mapsto (y \mapsto f (x,y))\\\\
\mathtt{uncurry}(g) & := (x,y) \mapsto (g(x))(y)
\end{align}
\]
Let's check that if \\(f : X \times Y \to Z\\) is a monotonic function then \\(\mathtt{curry}(f) : X \to Z^Y\\) is monotonic.
First, let \\(x \leq x'\\). We need to show \\(\mathtt{curry}(f)(x) \leq \mathtt{curry}(f)(x')\\). But this means we need to show \\(\mathtt{curry}(f)(x)(y) \leq \mathtt{curry}(f)(x')(y)\\) for all \\(y\\). By evaluating these functions we can see we want to show \\( f(x,y) \leq f(x',y)\\) for all \\(y\\). Since \\(x \leq x'\\) we know that \\((x,y) \leq (x',y)\\) by definition of the product order, and \\(f(x,y) \leq f(x',y)\\) since \\(f\\) is mono.
Next, we'll want to check if \\(g : X \to Z^Y\\) is a monotonic function then \\(\mathtt{uncurry}(g) : X \times Y \to Z\\) is monotonic.
Let \\((x,y) \leq (x',y')\\). We need to show \\(\mathtt{uncurry}(g)(x,y) \leq \mathtt{uncurry}(g)(x',y')\\). This amounts to showing if \\(x \leq x'\\) and \\(y \leq y'\\) then \\((g(x))(y) \leq (g'(x'))(y')\\). We know that \\(g(x') \in Z^Y\\), are monotonic by definition, hence \\((g(x'))(y) \leq (g(x'))(y')\\). We also know that \\(g\\) is monotonic, hence \\(g(x) \leq g(x')\\), and thus \\(g(x)(y) \leq g(x')(y)\\). By transitivity we have \\((g(x))(y) \leq (g(x'))(y')\\).
We can be confident then that \\(\mathtt{curry}\\) and \\(\mathtt{uncurry}\\) are well defined.
Next, let's check that they are inverses. Evaluating the functions defined gives:
\[
\begin{align}
(((\mathtt{curry} \circ \mathtt{uncurry})(g))(x))(y) & = ((\mathtt{curry} (\mathtt{uncurry}(g)))(x))(y) \\\\
& = (\mathtt{uncurry}(g))(x,y) \\\\
& = (g(x))(y)
\end{align}
\]
However, \\(((id(g))(x))(y) = (g(x))(y)\\), so by [*extensionality*](https://en.wikipedia.org/wiki/Axiom_of_extensionality) we have \\((\mathtt{curry} \circ \mathtt{uncurry}) = id\\). Extensionality is the principle that says that if two sets have the same elements, then they are equivalent. In Higher Order Logic and the [λ-calculus](https://en.wikipedia.org/wiki/Lambda_calculus#%CE%B7-conversion), it holds that if two functions are the same on all inputs then they are the same.
Considering the other direction, we have:
\[
\begin{align}
((\mathtt{uncurry} \circ \mathtt{curry})(g))(x,y)
& = ((\mathtt{curry}(g))(x))(y) \\\\
& = g(x,y)
\end{align}
\]
Hence, we have the isomorphism we desire.
We can note that the category of Posets and the category of Preorders have a terminal object: the poset with 1 element. So the categories are in fact [Cartesian Closed Categories](https://en.wikipedia.org/wiki/Cartesian_closed_category).
They also have coproducts (I can talk about this a little if someone wants). I do not know if they have an initial object, however. So I can't say if the categories of Posets and Preorders are [Bicartesian closed](https://en.wikipedia.org/wiki/Cartesian_closed_category#Equational_theory)...