# Multiplicative Operations on Cartesian Frames

This is the seventh post in the [Cartesian frames](https://www.lesswrong.com/posts/BSpdshJWGAW6TuNzZ/introduction-to-cartesian-frames) sequence.

Here, we introduce three new binary operations on Cartesian frames, and discuss their properties.

1\. Tensor
----------

Our first multiplicative operation is the tensor product, $\otimes$.

One way we can visualize our [additive operations](https://www.lesswrong.com/posts/ewkYgtZapQRtDPT2F/additive-operations-on-cartesian-frames) from before, $\oplus$ and $\&$, is to imagine two robots (say, a mining robot $\mbox{Agent}(C)$ and a drilling robot $\mbox{Agent}(D)$) that have an override mode allowing an AI supervisor to take over that robot's decisions.

*   $C\oplus D$ represents the supervisor deciding which robot to take control of, then selecting that robot's action. (The other robot continues to run autonomously.)
*   $C\& D$ represents something in the supervisor's environment (e.g., its human operator) deciding which robot the supervisor will take control of. Then the supervisor selects that robot's action (while the other robot runs autonomously).

$C\otimes D$ represents an AI supervisor that controls both robots simultaneously. This lets $\mbox{Agent}(C\otimes D)$ direct $\mbox{Agent}(C)$ and $\mbox{Agent}(D)$ to work together as a team.

**Definition:** Let $C=(A,E,\cdot)$ and $D=(B,F,\star)$ be Cartesian frames over $W$. The tensor product of $C$ and $D$, written $C\otimes D$, is given by $C\otimes D=(A\times B,\mbox{hom}(C,D^*),\diamond)$, where $\mbox{hom}(C,D^*)$ is the set of morphisms $(g,h):C\rightarrow D^*$ (i.e., the set of all pairs $(g:A\rightarrow F,h:B\rightarrow E)$ such that $b\star g(a)=a\cdot h(b)$ for all $a\in A$, $b\in B$), and $\diamond$ is given by $(a,b)\diamond(g,h)=b\star g(a)=a\cdot h(b)$.

Let us meditate for a moment on why this definition represents two agents working together on a team. The following will be very informal.

Let Alice be an agent with Cartesian frame $C=(A,E,\cdot)$, and let Bob be an agent with Cartesian frame $D=(B,F,\star)$. The team consisting of Alice and Bob should have agent $A\times B$, since the team's choices consist of deciding what Alice does and also deciding what Bob does.

The environment is a bit more complicated. Starting from Alice, to construct the team, we want to internalize Bob's choices: instead of just being choices in $A$'s environment, Bob's choices will now be additional options for the team $A\times B$.

To do this, we want to first see Bob as being embedded in Alice's environment. This embedding is given by a function $h:B\rightarrow E$, which extends each $b \in B$ to a full environment $e \in E$. We will view Alice's possible environments as being constructed by combining a choice by Bob (that is, a $b\in B$) with a function from Bob's choices to possible environments ($h:B\rightarrow E$). Then, we will move the $B$ part across the Cartesian boundary into the agent.

Now, the agent looks like $A\times B$, while the environment looks like $B\rightarrow E$. However, we must have been able to do this starting from Bob as well, so a possible environment can also be viewed as function $g:A\rightarrow F$.

Since we should get the same world regardless of whether we think of the team as starting with Alice or with Bob, these functions $g$ and $h$ should agree with each other. This looks a bit like currying. The environment for an Alice-Bob team should be able to take in a Bob to create an environment for Alice, and it should also be able to take in an Alice to create an environment for Bob.

**1.1. Example**

We will illustrate this new operation using a simple formal example.

Jack, Kate, and Luke are simultaneously casting votes on whether to have a party. Each agent can vote for or against the party. The possible worlds are encoded as strings listing which people vote for the party, $W=\{\varepsilon, \mbox{J}, \mbox{K}, \mbox{L}, \mbox{JK}, \mbox{JL}, \mbox{KL}, \mbox{JKL}\}$. Jack's perspective is given by the frame

$C_J=\begin{pmatrix} \mbox{J} & \mbox{JK} & \mbox{JL} & \mbox{JKL}\ \varepsilon & \mbox{K} & \mbox{L} & \mbox{KL}\ \end{pmatrix}$,

Kate's perspective is given by the frame

$C_K=\begin{pmatrix} \mbox{K} & \mbox{JK} & \mbox{KL} & \mbox{JKL}\ \varepsilon & \mbox{J} & \mbox{L} & \mbox{JL}\ \end{pmatrix}$,

and Luke's perspective is given by the frame

$C_L=\begin{pmatrix} \mbox{L} & \mbox{JL} & \mbox{KL} & \mbox{JKL}\ \varepsilon & \mbox{J} & \mbox{K} & \mbox{JK}\ \end{pmatrix}$.

Since Luke's environment can be thought of as the team consisting of Jack and Kate, one might expect that $C_J\otimes C_K\cong C_L^*$. Indeed, we will show this is the case.

Let $C_J=(A,E,\cdot)$, and let $C_K=(B,F,\star)$. We label the elements of $A$, $E$, $B$, and $F$ as follows:

$C_J=\begin{array}{cc} &\begin{array}{cccc} e_\varepsilon &e_K&e_L &e_{KL} \end{array}\ \begin{array}{c} a_J \ a_\varepsilon\ \end{array} & \begin{pmatrix} \mbox{J} & \mbox{JK} & \mbox{JL} & \mbox{JKL}\ \varepsilon & \mbox{K} & \mbox{L} & \mbox{KL}\ \end{pmatrix} \end{array}$, and $C_K=\begin{array}{cc} &\begin{array}{cccc} f_\varepsilon &f_J&f_L &f_{JL} \end{array}\ \begin{array}{c} b_K \ b_\varepsilon\ \end{array} & \begin{pmatrix} \mbox{K} & \mbox{JK} & \mbox{KL} & \mbox{JKL}\ \varepsilon & \mbox{J} & \mbox{L} & \mbox{JL}\ \end{pmatrix} \end{array}$.

We will first enumerate all of the morphisms from $C_J$ to $C_K^*$. A morphism $(g,h):C_J\rightarrow C_K^*$ consists of a function $g:A\rightarrow F$ and a function $h:B\rightarrow E$. There are 16 functions from $A$ to $F$ and 16 functions from $B$ to $E$, but most of the 256 pairs do not form morphisms.

Let us break the possibilities into cases based on $g(a_J)$. Observe that $b_K\star g(a_J)=a_J\cdot h(b_K)$: the possible worlds where (from Kate's perspective) Kate votes for the party and Jake-interfacing-with-Kate's-perspective votes for the party too, are the same as the possible worlds where (from Jake's perspective) Jake votes for the party and Kate-interfacing-with-Jake's-perspective does too. These possible worlds must have a $\mbox{J}$ in them, so $g(a_J)$ must be either $f_J$ or $f_{JL}$.

If $g(a_J)=f_J$, then

$$
\begin{equation} \begin{split} a_J\cdot h(b_K) & =b_K\star g(a_J) \ & =\mbox{JK}, \end{split} \end{equation}
$$

so $h(b_K)=e_K$. Similarly,

$$
\begin{equation} \begin{split} a_J\cdot h(b_\varepsilon) & =b_\varepsilon\star g(a_J) \ & =\mbox{J}, \end{split} \end{equation}
$$

so $h(b_\varepsilon)=e_\varepsilon$, and

$$
\begin{equation} \begin{split} b_K\star g(a_\varepsilon) & =a_\varepsilon\cdot h(b_K)\ & =\mbox{K}, \end{split} \end{equation}
$$

so $g(a_\varepsilon)=f_\varepsilon$.

Similarly, if $g(a_J)=f_{JL}$, then $h(b_K)=e_{KL}$, $h(b_\varepsilon)=e_L$, and $g(a_\varepsilon)=f_L$.

Thus, there are only two candidate morphisms:

*   The first, which we will call $\phi_\varepsilon=(g_\varepsilon,h_\varepsilon)$, is given by $g_\varepsilon(a_\varepsilon)=f_\varepsilon$, $g_\varepsilon(a_J)=f_J$, $h_\varepsilon(b_\varepsilon)=e_\varepsilon$, and $h_\varepsilon(b_K)=e_K$.
*   The second, $\phi_L=(g_L,h_L)$, is given by $g_L(a_\varepsilon)=f_L$, $g_L(a_J)=f_{JL}$, $h_L(b_\varepsilon)=e_L$, and $h_L(b_K)=e_{KL}$.

It is easy to see that these are both indeed morphisms, by checking the definition of morphism on all four pairs in $A\times B$.

Thus, $\mbox{Env}(C_J\otimes C_K)=\{\phi_\varepsilon, \phi_L\}$, and $\mbox{Agent}(C_J\otimes C_K)=A\times B$, and we can compute $\mbox{Eval}(C_J\otimes C_K)$ from the definitions of the morphisms. The result is as follows:

$C_J\otimes C_K=\begin{array}{cc} &\begin{array}{cc} \phi_\varepsilon &\phi_L \end{array}\ \begin{array}{c} (a_J,b_K) \ (a_J,b_\varepsilon) \ (a_\varepsilon,b_K) \ (a_\varepsilon,b_ \varepsilon) \ \end{array} & \begin{pmatrix} \mbox{JK} & \mbox{JKL}\ \mbox{J}& \mbox{JL}\ \mbox{K}&\mbox{KL}\ \varepsilon&\mbox{L} \end{pmatrix} \end{array}$.

This is clearly $C_L^*$, up to reordering and relabeling rows and columns.

2\. Properties of Tensor
------------------------

Tensor introduces a lot of categorical structure to Chu spaces, in fact giving us a [star-autonomous category](https://ncatlab.org/nlab/show/star-autonomous+category). This post and the ones to come will be ignoring connections to larger topics in category theory, but only because my time and my familiarity with category theory are limited, not because these connections are unimportant.

I encourage the interested reader to learn more about the structure of Chu spaces on the excellent category theory wiki [*n*Lab](https://ncatlab.org/nlab/show/HomePage), beginning with their article on the [Chu construction](https://ncatlab.org/nlab/show/Chu+construction).

**2.1. Commutativity, Associativity, and Identity**

**Claim:** $\otimes$ is commutative and associative, and $1$ is the identity of $\otimes$ (up to isomorphism).

**Proof:** Commutativity is clear from the definition of $\otimes$, once one unpacks the definition of $\mbox{hom}(C,D^*)$.

To see that 1 is the identity of $\otimes$, let $C=(A,E,\cdot)$, let $1=(\{b\},W,\star)$, and let $C\otimes 1=(A\times\{b\}, \mbox{hom}(C,1^*),\diamond)$.

Consider the isomorphism $(\iota_0,\iota_1):C\rightarrow C\otimes 1$ given by $\iota_0(a)=(a,b)$ and $\iota_1(g,h)=h(b).$ We need to show that $(\iota_0,\iota_1)$ is a morphism, and that both $\iota_0$ and $\iota_1$ are bijective. To see that $(\iota_0,\iota_1)$ is a morphism, observe that for all $a\in A$ and $(g,h):C\rightarrow 1^*$,

$$
\begin{equation} \begin{split} \iota_0(a)\diamond(g,h) & =a\cdot h(b)\ & =a\cdot\iota_1(g,h). \end{split} \end{equation}
$$

 Clearly, $\iota_0$ is a bijection, so all that remains to show is that $\iota_1$ is bijective.

To see that $\iota_1$ is injective, observe that if $\iota_1(g_0,h_0)=\iota_1(g_1,h_1)$, then $h_0(b)=h_1(b)$, so $h_0=h_1$, and

$$
\begin{equation} \begin{split} g_0(a) & =b\star g_0(a) \ & =a\cdot h_0(b) \ & =a\cdot h_1(b) \ & =b\star g_1(a) \ & =g_1(a) \end{split} \end{equation}
$$

for all $a\in A$, so $g_0=g_1$.

To see that $\iota_1$ is surjective, observe that for every $e\in E$, there exists a morphism $(g_e,h_e):C\rightarrow 1^*$, given by $h_e(b)=e$ and $g_e(a)=a\cdot e$. This is clearly a morphism, since 

$$
\begin{equation} \begin{split} b\star g_e(a) & =g_e(a) \ & =a\cdot e \ & =a\cdot h_e(b), \end{split} \end{equation}
$$

and $\iota_1(g_e,h_e)=e$.

Next, we need to show that $\otimes$ is associative, which will be much more tedious. Let $C_i=(A_i,E_i,\cdot)$. Since we have already established commutativity, it suffices to show that $(C_0\otimes C_1)\otimes C_2\cong (C_0\otimes C_2)\otimes C_1$.

Let $D=(A_0\times A_1\times A_2,F,\star)$, where $F$ is the set of all triples of functions $(g_0:A_1\times A_2\rightarrow E_0,g_1:A_0\times A_2\rightarrow E_1,g_2:A_0\times A_1\rightarrow E_2)$, such that for all $a_i\in A_i$, we have

$$
\begin{equation} \begin{split} a_0\cdot_0g_0(a_1,a_2) & =a_1\cdot_1g_1(a_0,a_2) \ & =a_2\cdot_2g_2(a_0,a_1), \end{split} \end{equation}
$$

 and $\star$ is given by

$$
\begin{equation} \begin{split} (a_0,a_1,a_2)\star(g_0,g_1,g_2) & =a_0\cdot_0g_0(a_1,a_2) \ & =a_1\cdot_1g_1(a_0,a_2) \ & =a_2\cdot_2g_2(a_0,a_1). \end{split} \end{equation}
$$

We will show that $(C_0\otimes C_1)\otimes C_2\cong D$, and since the definition of $D$ is symmetric in swapping $C_1$ and $C_2$, it will follow that $(C_0\otimes C_2)\otimes C_1\cong D$, so $(C_0\otimes C_1)\otimes C_2\cong (C_0\otimes C_2)\otimes C_1$.

We construct a morphism $(\iota_0,\iota_1)$ from $(C_0\otimes C_1)\otimes C_2$ to $D$ as follows. $\iota_0$ is just the identity on $A_0\times A_1\times A_2$. We will let $\iota_1(g_0,g_1,g_2)$ be the morphism $(g_2,h):C_0\otimes C_1\rightarrow C_2^*$, where $h:A_2\rightarrow \mbox{hom}(C_0,C_1^*)$ is given by $h(a_2)=(h^{a_2}_0,h^{a_2}_1):C_0\rightarrow C_1^*$, where $h_0^{a_2}(a_0)= g_1(a_0,a_2)$, and $h_1^{a_2}(a_1)= g_0(a_1,a_2)$.

First, we need to show that $\iota_1$ is well-defined, by showing that $h(a_2)$ is a morphism from $C_0$ to $C_1^*$, and that $(g_2,h)$ is a morphism from $C_0\otimes C_1\rightarrow C_2^*$. To see that $h(a_2)=(h^{a_2}_0,h^{a_2}_1)$ is a morphism, observe that for $a_0\in A_0$ and $a_1 \in A_1$,

$$
\begin{equation} \begin{split} a_1\cdot_1 h_0^{a_2}(a_0) & =a_1\cdot _1g_1(a_0,a_2) \ & =a_0\cdot_0g_0(a_1,a_2) \ & =a_0\cdot_0 h_1^{a_2}(a_1). \end{split} \end{equation}
$$

To see that $(g_2,h)$ is a morphism, observe for all $(a_0,a_1)\in A_0\times A_1$ and all $a_2\in A_2$,

$$
\begin{equation} \begin{split} a_2\cdot_2g_2(a_0,a_1) & =a_0\cdot_0g_0(a_1,a_2) \ & =a_0\cdot_0h_1^{a_2}(a_1) \ & =(a_0,a_1)\diamond(h_0^{a_2},h_1^{a_2}) \ & =(a_0,a_1)\diamond h(a_2), \end{split} \end{equation}
$$

where $\diamond=\mbox{Eval}(C_0\otimes C_1)$.

Now that we know $\iota_1$ is well-defined, we need to show that $(\iota_0,\iota_1)$ is a morphism. Indeed, for all $(a_0,a_1,a_2)\in A_0,A_1,A_2$, and for all $(g_0,g_1,g_2)\in F$, we have

$$
\begin{equation} \begin{split} \iota_0(a_0,a_1,a_2)\star (g_0,g_1,g_2) & =a_2\cdot_2g_2(a_0,a_1) \ & =(a_0,a_1,a_2)\bullet(g_2,h) \ & =(a_0,a_1,a_2)\bullet \iota_1(g_0,g_1,g_2), \end{split} \end{equation}
$$

where $\bullet=\mbox{Eval}((C_0\otimes C_1)\otimes C_2)$.

Finally, to show that $(\iota_0,\iota_1)$ is an isomorphism, we need to show that $\iota_0$ and $\iota_1$ are bijective. $\iota_0$ is trivial, since it is the identity, so it suffices to show that $\iota_1$ is bijective.

To see that $\iota_1$ is surjective, let $(g,h)$ be a morphism from $C_0\otimes C_1$ to $C_2^*$, so $g:A_0\times A_1\rightarrow E_2$, and $h: A_2\rightarrow\mbox{hom}(C_0,C_1^*)$. Again, let $h(a_2)=(h^{a_2}_0,h^{a_2}_1)$. We will define $(g_0,g_1,g_2)$ by $g_2=g$, $g_1(a_0,a_2)=h_0^{a_2}(a_0)$, and $g_0(a_1,a_2)=h_1^{a_2}(a_1)$.

We need to show that $(g_0,g_1,g_2)\in F$, by showing that for all $(a_0,a_1,a_2)\in A_0\times A_1\times A_2$, we have

$$
\begin{equation} \begin{split} a_0\cdot_0g_0(a_1,a_2) & =a_1\cdot_1g_1(a_0,a_2) \ & =a_2\cdot_2g_2(a_0,a_1). \end{split} \end{equation}
$$

Observe that since $(g,h)$ is a morphism,

$$
\begin{equation} \begin{split} a_2\cdot_2g_2(a_0,a_1) & =a_2\cdot_2g(a_0,a_1) \ & =(a_0,a_1)\star h(a_2) \ & =(a_0,a_1)\star (h_0^{a_2},h_1^{a_2}), \end{split} \end{equation}
$$

where $\star=\mbox{Eval}(C_0\otimes C_1)$. Also, by the definition of $C_0\otimes C_1$, we have that

$$
\begin{equation} \begin{split} (a_0,a_1)\star(h_0^{a_2},h_1^{a_2}) & = a_0\cdot_0h_1^{a_2}(a_1) \ & =a_0\cdot_0g_0(a_1,a_2), \end{split} \end{equation}
$$

and similarly

$$
\begin{equation} \begin{split} (a_0,a_1)\star(h_0^{a_2},h_1^{a_2}) & = a_1\cdot_1h_0^{a_2}(a_1) \ & =a_1\cdot_1g_1(a_0,a_2). \end{split} \end{equation}
$$

Thus,

$$
\begin{equation} \begin{split} a_0\cdot_0g_0(a_1,a_2) & =a_1\cdot_1g_1(a_0,a_2) \ & =a_2\cdot_2g_2(a_0,a_1), \end{split} \end{equation}
$$

so $(g_0,g_1,g_2)\in F$. Finally, observe that $\iota_1(g_0,g_1,g_2)$ is in fact $(g,h)$.

To show that $\iota_1$ is injective, assume $\iota_1(g_0,g_1,g_2)=\iota_1(g^\prime_0,g^\prime_1,g^\prime_2)=(g,h)$, and given an $a_2\in A_2$, let $h(a_2)=(h^{a_2}_0,h^{a_2}_1)$. Clearly, this means $g_2=g=g_2^\prime$. Further, for all $a_0\in A_0$, $a_1\in A_1$, and $a_2\in A_2$,

$$
\begin{equation} \begin{split} g_0(a_1,a_2) & =h_1^{a_2}(a_1) \ & =g^\prime_0(a_1,a_2) \end{split} \end{equation}
$$

and

$$
\begin{equation} \begin{split} g_1(a_0,a_2) & =h_0^{a_2}(a_0) \ & =g^\prime_1(a_0,a_2). \end{split} \end{equation}
$$

Thus $(g_0,g_1,g_2)=(g^\prime_0,g^\prime_1,g^\prime_2)$. Thus, $\iota_1$ is bijective, so $(\iota_0,\iota_1)$ is an isomorphism, so $(C_0\otimes C_1)\otimes C_2\cong D\cong(C_0\otimes C_2)\otimes C_1$. $\square$

**2.2. Biextensional Equivalence**

Since many of our intuitions about Cartesian frames are up to biextensional equivalence, we should verify that tensor is well-defined up to biextensional equivalence.

**Claim:** If $C_0\simeq C_1$ and $D_0\simeq D_1$, then $C_0\otimes D_0\simeq C_1\otimes D_1$.

**Proof:** It suffices to show that for all $D$, $C_0\otimes D\simeq C_1\otimes D$. Then, by commutativity of tensor, 

$$
\begin{equation} \begin{split} C_0\otimes D_0 & \simeq C_0\otimes D_1 \ & \cong D_1\otimes C_0 \ & \simeq D_1\otimes C_1 \ & \equiv C_1\otimes D_1. \end{split} \end{equation}
$$

Let $C_i=(A_i,E_i,\cdot_i)$, and let $D=(B,F,\star)$. Since $C_0\simeq C_1$, there must exist morphisms $(g_0, h_0):C_0\rightarrow C_{1}$ and $(g_1, h_1):C_1\rightarrow C_{0}$ such that $(g_1\circ g_0, \mbox{id}_{E_0}):C_0\rightarrow C_0$ and $(g_0\circ g_1, \mbox{id}_{E_1}):C_1\rightarrow C_1$ are both morphisms.

Let $C_i\otimes D=(A_i\times B, \mbox{hom}(C_i,D^*),\diamond_i)$. Consider the morphisms $(g_i^\prime,h_i^\prime):C_i\otimes D\rightarrow C_{1-i}\otimes D$, where $g_i^\prime:A_i\times B\rightarrow A_{1-i} \times B$ is given by $g_i^\prime(a,b)=(g_i(a),b)$ and $h_i^\prime:\mbox{hom}(C_{1-i}, D^*)\rightarrow\mbox{hom}(C_{ I}, D^*)$ is given by $h_i^\prime(g,h)=(g,h)\circ(g_i,h_i)$.

To see that these are morphisms, observe that for any $(a,b)\in A_i\times B$ and $(g,h):C_{1-i}\rightarrow D^*$, we have

$$
\begin{equation} \begin{split} g_i^\prime(a,b)\diamond_{1-i} (g,h) & =(g_i(a),b)\diamond_{1-i}(g,h) \ & =b\star g(g_i(a)) \ & =b\star (g\circ g_i)(a)) \ & =(a,b)\diamond_{i}(g\circ g_i,h_i\circ h) \ & =(a,b)\diamond_ih_i^\prime(g,h). \end{split} \end{equation}
$$

Finally, we need to show that $(g_0^\prime,h_0^\prime)$ and $(g_1^\prime,h_1^\prime)$ compose to something homotopic to the identity in both orders. This is equivalent to saying that $(g_0^\prime\circ g_{1}^\prime,\mbox{id}_{\mbox{hom}(C_{ {1}},D^*)})$ and $(g_1^\prime\circ g_0^\prime,\mbox{id}_{\mbox{hom}(C_{ 0}, D^*)})$ are both morphisms. Indeed, for all $(a,b)\in A_i\times B$ and $(g,h):C_{i}\rightarrow D^*$, since $(g_{1-i}\circ g_{i}, \mbox{id}_{E_i})$ is a morphism, we have

$$
\begin{equation} \begin{split} g_{1-i}^\prime(g_{i}^\prime(a,b))\diamond_{i}(g,h) & =(g_{1-i}(g_{i}(a)),b)\diamond_{i}(g,h) \ & =g_{1-i}(g_{i}(a))\cdot_i h(b) \ & =a\cdot_i h(b) \ & =(a,b)\diamond_i(g,h). \end{split} \end{equation}
$$

$\square$

**2.3. Distributivity**

**Claim:** $\otimes$ distributes over $\oplus$, so for all Cartesian frames $C_0$, $C_1$, and $D$,$(C_0\oplus C_1)\otimes D\cong (C_0\otimes D)\oplus (C_1\otimes D)$.

**Proof:** Since $\oplus$ is the categorical coproduct, there exist morphisms $\iota_0: C_0\rightarrow C_0\oplus C_1$ and $\iota_1:C_1\rightarrow C_0\oplus C_1$ such that for any morphisms $\phi_0:C_0\rightarrow D^*$ and $\phi_1:C_1\rightarrow D^*$, there exists a unique morphism $\phi:C_0\otimes C_1\rightarrow D^*$such that $\phi_i=\phi\circ\iota_i$.

Let $C_i=(A_i,E_i,\cdot_i)$, and let $D=(B,F,\star)$. Consider the isomorphism $(g,h):(C_0\otimes D)\oplus (C_1\otimes D)\rightarrow (C_0\oplus C_1)\otimes D$, where $g: (A_0\times B)\sqcup (A_1\times B)\rightarrow (A_0\sqcup A_1)\times B$ is the natural bijection that sends $(a,b)$ to $(a,b)$, and $h:\mbox{hom}(C_0\oplus C_1,D^*)\rightarrow \mbox{hom}(C_0,D^*)\times\mbox{hom}(C_1,D^*)$ is given by $h(\phi)=(\phi\circ\iota_0,\phi\circ\iota_1)$.

Clearly, $g$ is an bijection. $h$ is also a bijection, since it is inverse to the function that sends $(\phi_0,\phi_1)$ to the unique $\phi$ as above. Thus, all that remains to show is that $(g,h)$ is a morphism.

Let $\diamond=\mbox{Eval}((C_0\otimes D)\oplus (C_1\otimes D))$ and let $\bullet=\mbox{Eval}((C_0\oplus C_1)\otimes D)$. Given $(a,b)\in (A_0\times B)\sqcup (A_1\times B)$ and $(g^\prime,h^\prime)\in\mbox{hom}(C_0\oplus C_1,D^*)$, without loss of generality, assume that $a\in A_0$. Let $(g^{\prime}_0,h^\prime_0)=(g^\prime,h^\prime)\circ\iota_0$. Observe that since the function on agents in $\iota_0$ is the inclusion of $A_0$ into $A_0\sqcup A_1$, we have that $g^\prime_0$ is $g^\prime$ restricted to $A_0$. Thus, we have

$$
\begin{equation} \begin{split} g(a,b)\bullet (g^\prime,h^\prime) & =(a,b)\bullet (g^\prime,h^\prime) \ & =b\star g^\prime(a) \ & =b\star g^\prime_0(a) \ & =(a,b)\diamond(g^\prime_0,h^\prime_0) \ & =(a,b)\diamond h(g^\prime,h^\prime). \end{split} \end{equation}
$$

$\square$

**2.4. Tensor is for Disjoint Agents**

It doesn't really make sense to talk about $C\otimes D$ when $C$ and $D$'s agents are the same agent, or otherwise overlap. This is because $C\otimes D$'s agent can make choices for both $C$ and $D$, and if $C$ and $D$ overlap, $C\otimes D$'s agent could make choices for the intersection in two contradictory ways.

If you try to take the tensor of two frames whose agents overlap, you get a frame with an agent but no possible worlds.

**Claim:** If $\mbox{Ensure}(C)\cap \mbox{Prevent}(D)$ is nonempty, then $C\otimes D\simeq \top$.

**Proof:** Let $C=(A,E,\cdot)$, and let $D=(B,F,\star)$. Consider some $S\in \mbox{Ensure}(C)\cap \mbox{Prevent}(D)$. There is some $a\in A$ such that $a\cdot e\in S$ for all $e\in E$, and some $b\in B$ such that $b\star f\notin S$ for all $f\in F$. First, observe that $\mbox{Agent}(C\otimes D)$ is nonempty, since it contains $(a,b)$. Next, observe that $\mbox{Env}(C\otimes D)$ is empty, since if there were a morphism $(g,h):C\rightarrow D^*$, it would need to satisfy $b\star g(a)=a\cdot h(b)$, which is impossible since the left hand side is not in $S$, while the right hand side is in $S$. Thus, $C\otimes D$ has empty environment and nonempty agent, so $C\otimes D\simeq\top$. $\square$

Tensoring an agent with itself lets you play "both" agents, which has the neat consequence that if the agent has any control, you can have the agent make two different choices that put you in two different possible worlds, which is a contradiction. The result is that the agent has no possible worlds.

**Corollary:** If $\mbox{Ctrl(C)}$ is nonempty, then $C\otimes C\simeq \top$.

**Proof:** Trivial. $\square$

3\. Tensor is Relative to a Coarse World Model
----------------------------------------------

Recall that for any function $p:W\rightarrow V$, the [functor](https://www.lesswrong.com/posts/GYQwJsChoRosjdW2r/functors-and-coarse-worlds) $p^\circ:\mbox{Chu}(W)\rightarrow \mbox{Chu}(V)$ preserves sums and products, meaning that for any Cartesian frames $C$ and $D$ over $W$, $p^\circ(C\oplus D)=p^\circ(C)\oplus p^\circ(D)$ and $p^\circ(C\& D)=p^\circ(C)\& p^\circ(D)$. However, the same is not true for $\otimes$. To see this, let's go back to the voting example above.

Let's assume that Jack, Kate, and Luke have a party if and only if a majority vote in favor, and let $V=\{\mbox{Y},\mbox{N}\}$ be the two-element world that only tracks whether or not they have a party. Let $p:W\rightarrow V$ be the function such that $p(\varepsilon)=p(\mbox{J})=p(\mbox{K})=p(\mbox{L})=\mbox{N}$ and $p(\mbox{JK})=p(\mbox{JL})=p(\mbox{KL})=p(\mbox{JKL})=\mbox{Y}$. Then, 

$p^\circ(C_J)\cong p^\circ(C_K)\cong\begin{pmatrix} \mbox{N} & \mbox{Y} & \mbox{Y} & \mbox{Y}\ \mbox{N} & \mbox{N} & \mbox{N} & \mbox{Y}\ \end{pmatrix}\simeq\begin{pmatrix} \mbox{N} &  \mbox{Y} & \mbox{Y}\ \mbox{N}  & \mbox{N} & \mbox{Y}\ \end{pmatrix}$,

and

$p^\circ(C_J\otimes C_K)\cong p^\circ(C_L^*)\cong\begin{pmatrix} \mbox{Y} & \mbox{Y}  \ \mbox{N} & \mbox{Y}\ \mbox{N}&\mbox{Y}\ \mbox{N}&\mbox{N} \end{pmatrix}\simeq\begin{pmatrix} \mbox{Y} & \mbox{Y}  \ \mbox{N}&\mbox{Y}\ \mbox{N}&\mbox{N}\end{pmatrix}$,

but

$\begin{pmatrix} \mbox{N} & \mbox{Y} & \mbox{Y} & \mbox{Y}\ \mbox{N} & \mbox{N} & \mbox{N} & \mbox{Y}\ \end{pmatrix}\otimes\begin{pmatrix} \mbox{N} & \mbox{Y} & \mbox{Y} & \mbox{Y}\ \mbox{N} & \mbox{N} & \mbox{N} & \mbox{Y}\ \end{pmatrix}\not\not\simeq \begin{pmatrix} \mbox{Y} & \mbox{Y}  \ \mbox{N} & \mbox{Y}\ \mbox{N}&\mbox{Y}\ \mbox{N}&\mbox{N} \end{pmatrix}$.

We can see that $p^\circ(C_J\otimes C_K)$ is not equivalent to $p^\circ(C_J)\otimes p^\circ(C_K)$ by observing that the latter has a constant $\mbox{N}$ environment while the former doesn't.

Let $p^\circ(C_J)\cong p^\circ(C_K)\cong (A,E,\cdot)$, and let $e_N\in E$ denote the environment such that $a\cdot e_N=\mbox{N}$ for both $a\in A$. (In the matrix representation above, this is the first column.) Observe that there exists a morphism $(g,h):(A,E,\cdot)\rightarrow(A,E,\cdot)^*$, where $g$ and $h$ are both the constant $e_N$ function. This is a morphism because for all $a_0,a_1\in A$, $a_0\cdot h(a_1)=a_1\cdot g(a_0)=\mbox{N}$. This gives an environment in  $p^\circ(C_J)\otimes p^\circ(C_K)$, all of whose entries must be $\mbox{N}$. $p^\circ(C_J\otimes C_K)$ has no such environment, so $p^\circ(C_J\otimes C_K)$ cannot be isomorphic to $p^\circ(C_J)\otimes p^\circ(C_K)$, or even biextensionally equivalent. Indeed:

$p^\circ(C_J)\otimes p^\circ(C_K)\simeq\begin{pmatrix} \mbox{N}&\mbox{Y}&\mbox{Y}&\mbox{Y}&\mbox{Y}&\mbox{Y}\ \mbox{N}&\mbox{N}&\mbox{N}&\mbox{Y}&\mbox{Y}&\mbox{Y}\ \mbox{N}&\mbox{N}&\mbox{Y}&\mbox{N}&\mbox{Y}&\mbox{Y}\ \mbox{N}&\mbox{N}&\mbox{N}&\mbox{N}&\mbox{N}&\mbox{Y}\ \end{pmatrix}$.

To see what is going on here, consider another example where Jack and Kate and Luke vote on whether to have a party, but whether or not the party happens is not just a function of the majority's vote. Instead, after the three people cast their votes, a coin is flipped:

*   If heads, the votes are tallied and majority wins as normal.
*   If tails, one of the three voters is selected at random to be dictator, and the party happens if and only if they voted in favor.

Let us work up to biextensional collapse. Let $D_J$ be the Cartesian frame over $V$ representing Jack's perspective. We have

$D_J\simeq \begin{pmatrix} \mbox{N} &  \mbox{Y} & \mbox{Y}\ \mbox{N}  & \mbox{N} & \mbox{Y}\ \end{pmatrix}$,

where the top row represents voting for the party, and the bottom row represents voting against.

The first column represents environments where the party does not happen *and* Jack's vote didn't matter—either the coin came up heads and the others both voted against, or Kate or Luke became dictator and voted against. The third column similarly represents outcomes where the party happens regardless of how Jack votes. The second column represents all environments in which Jack's vote matters, so either he is dictator, or Kate and Luke's votes were split.

Similarly, let $D_K$ be the Cartesian frame over $V$ representing Kate's perspective,

$D_K\simeq \begin{pmatrix} \mbox{N} &  \mbox{Y} & \mbox{Y}\ \mbox{N}  & \mbox{N} & \mbox{Y}\ \end{pmatrix}$.

Then,

$D_J\otimes D_K\simeq\begin{pmatrix} \mbox{N}&\mbox{Y}&\mbox{Y}&\mbox{Y}&\mbox{Y}&\mbox{Y}\ \mbox{N}&\mbox{N}&\mbox{N}&\mbox{Y}&\mbox{Y}&\mbox{Y}\\\mbox{N}&\mbox{N}&\mbox{Y}&\mbox{N}&\mbox{Y}&\mbox{Y}\ \mbox{N}&\mbox{N}&\mbox{N}&\mbox{N}&\mbox{N}&\mbox{Y}\ \end{pmatrix}$.

The rows represent, in order: both voting in favor; Jack voting in favor but Kate voting against; Kate voting in favor but Jack voting against; and both voting against.

The columns represent, in order: Luke is dictator and votes against; majority rules and Luke votes against; Kate is dictator; Jack is dictator; majority rules and Luke votes in favor; and Luke is dictator and votes in favor.

Here, $D_J\otimes D_K$ looks more like what we would expect Jack and Kate working together on a team to look like. However, up to biextensional equivalence, $D_J$ and $D_K$ are the same as $p^\circ(C_J)$ and $p^\circ(C_K)$.

When we forget the actual votes and only look at whether the party happens, then up to biextensional collapse, the Cartesian frame representing Jack's perspective no longer has any way to distinguish between the simple majority rule vote and the complicated voting system with coins and dictators.

In general, just looking at two Cartesian frames does not tell you all of the information about the relationships between the people we might be using the frames to model. The Cartesian frames over $V$ representing Jack and Kate's perspectives do not have any information that distinguishes between the two vote counting schemes.

When taking a tensor, we automatically include all of the possible ways the two agents can embed in each other's environments, even if a given embedding doesn't make sense in a given interpretation.

4\. Par
-------

Our next multiplicative operation is $⅋ \space$, which is pronounced "par."

**Definition:** Let $C=(A,E,\cdot)$ and $D=(B,F,\star)$ be Cartesian frames over $W$. $C ⅋ \space D=(\mbox{hom}(C^*, D), E\times F,\diamond)$, where $(g,h)\diamond(e,f)=g(e)\star f=h(f)\cdot e$.

**Claim:** $⅋ \space$ is De Morgan dual to $\otimes$, so $C ⅋ \space D=(C^*\otimes D^*)^*$.

**Proof:** Trivial. $\square$

$⅋ \space$ has much less of an intuitive interpretation than $\otimes$. One reason for this is that in order to par two agents together, they have to be large enough that each other's environments embed within them. If $C$ and $D$ are not large enough, we will have that $C ⅋ \space D\simeq 0$. (I am being informal with the word "large" here.)

One way that $C$ and $D$ can fail to be large enough is if $\mbox{Ensure}(C^*)\cap \mbox{Prevent}(D^*)$ is nonempty, which is dual to the above result about tensor being for disjoint agents. It is actually pretty difficult for $C$ and $D$ to be large enough. If there is any fact about the world that is determined outside of both agents, $C ⅋ \space D$ will be trivial.

We had a dual restriction for $\otimes$, but it didn't get in the way nearly as often: simple intuitive examples tend to be about small agents interacting with a large environment, so it is easy to imagine two agents that are disjoint. It is much harder to imagine simple examples of two agents that cover, which (informally) is what you would have to have for $⅋ \space$ to be nontrivial.

I expect to not use $⅋ \space$ very often, but I am including it here for completeness.

**Claim:** $⅋ \space$ is commutative and associative, and $\bot$ is the identity of $⅋ \space$ (up to isomorphism).

**Proof:** Trivial from the fact that $⅋ \space$ is De Morgan dual to $\otimes$ and $1^*\cong\bot$. $\square$

**Claim:** If $C_0\simeq C_1$ and $D_0\simeq D_1$, then $C_0 ⅋ \space D_0\simeq C_1 ⅋ \space D_1$.

**Proof:** Trivial from the fact that $⅋ \space$ is De Morgan dual to $\otimes$, and $\simeq$ is preserved by $-^*$. $\square$

**Claim:** $⅋ \space$ distributes over $\&$, so for all Cartesian frames $C_0$, $C_1$, and $D$, we have $(C_0\& C_1) ⅋ \space D\cong (C_0 ⅋ \space D)\&(C_1 ⅋ \space D)$.

**Proof:** Trivial from the fact that $⅋ \space$ is De Morgan dual to $\otimes$, and $\&$ is De Morgan dual to $\oplus.$ $\square$

5\. Lollipop
------------

We have one more operation to introduce, $\multimap$ (pronounced "lollipop"), which is a Cartesian frame that can be thought of as representing the collection of morphisms between two Cartesian frames.

**Definition:** Given two Cartesian frames over $W$, $C=(A,E,\cdot)$ and $D=(B,F,\star)$, we let $C\multimap D$ denote the Cartesian frame $C\multimap D=(\mbox{hom}(C, D), A\times F,\diamond)$, where $\diamond$ is given by $(g,h)\diamond(a,f)=g(a)\star f=a\cdot h(f)$.

One way to interpret $C\multimap D$ is as "$D$ with a $C$-shaped hole in it." Indeed, let us think about $\mbox{Agent}(C\multimap D)$. and $\mbox{Env}(C\multimap D)$ separately. 

$\mbox{Agent}(C\multimap D)=\mbox{hom}(C, D)$ is the collection of morphisms from $C$ to $D$. Morphisms from $C$ to $D$ are exactly interfaces through which the agent of $C$ can interact with the environment of $D$. We can also think of this as the collection of interfaces that allow the agent of $C$ to fill the role of the agent of $D$. This makes sense. The collection of ways that a "$D$ with a $C$-shaped hole in it" can be is exactly the collection of interfaces that allow us to get a possible agent of $D$ from a possible agent of $C$.

Similarly, $\mbox{Env}(C\multimap D)=A\times F$ makes sense as the environment of a "$D$ with a $C$-shaped hole in it." The environment needs to supply an environment for $D$, and also fill in the hole with an agent for $C$.

Previously, $C$'s agent might have been part of $D$'s agent; in $C\multimap D$, however, this part of $D$ gets moved into the environment.

Imagine a football team $D$ with one team member, $C$, removed—the team with a football-player-shaped hole in it. Its environment, naturally, is pairs of "the kind of environment you get for a football team" and "the removed teammate".

Lollipop can be easily constructed from our other operations.

$$**Claim:** $C\multimap D \cong C^* ⅋ \space D\cong(C\otimes D^*)^*$.

**Proof:** Trivial. $\square$

Lollipop is well-defined up to biextensional equivalence.

**Claim:** If $C_0\simeq C_1$ and $D_0\simeq D_1$, then $C_0 \multimap D_0\simeq C_1 \multimap D_1$.

**Proof:** Trivial. $\square$

Lollipop also has some identity-like properties.

$$**Claim:** For all Cartesian Frames $C$, $C\cong 1\multimap C$ and $C^*\cong C\multimap \bot$.

**Proof:** $1\multimap C\cong (1\otimes C^*)^* \cong {C^*}^*\cong C$ and $C\multimap\bot\cong (C\otimes 1)^* \cong C^*$. $\square$

This last result is especially interesting because we can actually think of $C\multimap\bot$ as an alternative definition for $C^*$.

In "Tensor is Relative to a Coarse World Model" above, we noted that two agents working together might sometimes have strictly fewer possible environments than show up in the tensor. In the next post, we will introduce the concept of a *sub-tensor*, which allows us to represent teams that have fewer possible environments than the tensor. Similarly, *sub-sum* will be sum with spurious possible environments removed.