# Additive Operations on Cartesian Frames

The mathematical object (but not the philosophical interpretation) of a [Cartesian Frame](https://www.lesswrong.com/posts/BSpdshJWGAW6TuNzZ/introduction-to-cartesian-frames) is studied under the name "Chu space."

(In category theory, Chu spaces are usually studied in the special case of $W=2$. To learn more about Chu spaces, see Vaughan Pratt's [guide to papers](http://chu.stanford.edu/guide.html) and *n*Lab's [page on the Chu construction](https://ncatlab.org/nlab/show/Chu+construction).)

In this post and the next one, I'll mostly be discussing standard facts about Chu spaces. I'll also discuss how to interpret the standard definitions as statements about agency.

Chu spaces form a category as a special case of the Chu construction. You may notice a strong similarity between operations on Cartesian frames and operations in [linear logic](https://ncatlab.org/nlab/show/linear+logic), coming from the fact that the Chu construction is also intimately related to linear logic, and is used in the semantics for linear logic.

Linear logic has a large number of operations—additive conjunction ($\&$), multiplicative conjunction ($\otimes$), and so on—and many of those symbols will turn out to have interpretations for Cartesian frames, and they're actually going to be meaningful interpretations in this setting. For that reason, we'll be stealing much of our notation from linear logic, though this sequence won't assume familiarity with linear logic.

**Definition:** $\mbox{Chu}(W)$ is the category whose objects are Cartesian frames over $W$, whose morphisms from $C=(A,E,\cdot)$ to $D=(B,F,\star)$ are pairs of functions $(g:A\rightarrow B, h:F\rightarrow E)$, such that $a\cdot h(f)=g(a)\star f$ for all $a\in A$ and $f\in F$, and whose composition of morphisms is given by $(g_1,h_1)\circ (g_0,h_0)=(g_1\circ g_0,h_0\circ h_1)$.

The composition of two morphisms $C_0\rightarrow C_1$ and $C_1\rightarrow C_2$, then, sends the agent of $C_0$ to $C_2$ and sends the environment of $C_2$ to $C_0$.

**Claim:** $\mbox{Chu}(W)$ is a category.

**Proof:** It suffices to show that composition is well-defined and associative and there exist identity morphisms. For identity, $(\mbox{id}_A,\mbox{id}_E)$ is clearly an identity on $C=(A,E,\cdot)$, where $\mbox{id}_X$ is the identity map from $X$ to itself.

The composition $(g_1,h_1)\circ(g_0,h_0)$ of $(g_0,h_0):C_0\rightarrow C_1$ with $(g_1,h_1):C_1\rightarrow C_2$ is $(g_1\circ g_0,h_0\circ h_1):C_0\rightarrow C_2$. To verify that this is a morphism, we just need that $a_0\cdot_0 h_0(h_1(e_2))=g_1(g_0(a_0))\cdot_2 e_2$ for all $a_0\in \mbox{Agent}(C_0)$, and $e_2\in\mbox{Env}(C_2)$, where $\cdot_i=\mbox{Eval}(C_i)$. Indeed, 

$$
\begin{equation} \begin{split} a_0\cdot_0 h_0(h_1(e_2)) & = g_0(a_0)\cdot_1 h_1(e_2) \ & = g_1(g_0(a_0))\cdot_2 e_2, \end{split} \end{equation}
$$

since each component is a morphism.

Associativity of the composition follows from the fact that it is just a pair of compositions of functions on sets, and composition is associative for sets. $\square$

1\. What Do These Morphisms Represent?
--------------------------------------

**1.1. Morphisms as Interfaces**

A Cartesian frame is a first-person perspective. The agent $A$ finds itself in a certain situation or game, where it expects to encounter an environment $E$. The morphisms in $\mbox{Chu}(W)$ allow the agent of one Cartesian frame to play the game of another Cartesian frame.

We can think of the morphisms from $C=(A,E,\cdot)$ to $D=(B,F,\star)$ as ways of fitting the agent of $C$ into the environment of $D$. Indeed, for every morphism $(g,h):C\rightarrow D$, one can construct a Cartesian frame $(A,F,\diamond)$, whose agent matches $C$'s agent, and whose environment matches $D$'s environment, with $\diamond$ given by $a \diamond f=a\cdot h(f)=g(a)\star f$. (The morphism from $C$ to $D$ can actually be viewed as the composition of $(\mbox{id}_A,h):C\rightarrow (A,F,\diamond)$ with $(g,\mbox{id}_F):(A,F,\diamond)\rightarrow D$.)

Two random large Cartesian frames will typically have no morphisms between them. When there *is* a morphism, the morphism functions as an interface that allows the agent $A$ to interact with some other environment $F$. However, we aren't just randomly throwing $A$ and $F$ together. $A$'s interaction with $F$ factors through the function $h:F\rightarrow E$, so $A$ can in a sense still be thought of as using an interface where it interacts with $E$. It just interacts with an $e\in E$ that is of the form $h(f)$ for some $f\in F$. But this is happening simultaneously with the dual view in which $F$ can be thought of as still interacting with $B$!

Since a Cartesian frame is a first-person perspective, you can imagine $A$ having the internal experience of interacting with $E$, while $F$ has the "experience" of interacting with $B$. The morphism's job is to be the translation interface that allows this $A$ and $F$ to interact with each other, while preserving their respective internal experiences in such a way that they feel like they're interacting with $E$ and $B$ respectively. $A$ gets to play $B$'s game, while still thinking that it is playing its own game.

**1.2. Morphisms as Differences in Agents' Strength**

We can also interpret the existence of a morphism from $C=(A,E,\cdot)$ to $D=(B,F,\star)$ as saying something like "$D$'s agent is at least as strong as $C$'s agent."

This is easiest to see for a morphism $(g,h):C\rightarrow D$ where $g$ and $h$ are both injective. In this case, it is as though $A\subseteq B$ and $F\subseteq E$, so $D$'s agent has more options to choose between and fewer environments it has to worry about.

Since some of the environments in $E\backslash F$ might have been good for the agent, the agent isn't necessarily strictly better off in $D$; but in a zero-sum game, the agent will indeed be strictly better off. I think this justifies saying that $C$'s agent is in some sense weaker than $D\mbox{'s}$ agent.

If $g$ or $h$ is not injective, we could duplicate elements of $B$ and $E$ to make it injective, so the interpretation "$C$'s agent is no stronger than $D$'s agent" is reasonable in that case as well. In particular, the existence of a morphism from $C$ to $D$ implies that $\mbox{Ensure}(C)\subseteq\mbox{Ensure}(D)$ (and thus $\mbox{Ctrl}(C)\subseteq\mbox{Ctrl}(D)$).

However, the existence of a morphism is stronger than just saying the set of ensurables is larger. The morphism from $C$ to $D$ can be thought of as telling $D$'s agent how to strategy-steal from $C$'s agent, and thus do anything that $C$'s agent can do.

We now provide a few examples to illustrate morphisms between Cartesian frames. (If you're ready to forge ahead, [skip to §2](https://www.lesswrong.com/posts/ewkYgtZapQRtDPT2F/additive-operations-on-cartesian-frames#2__Self_Duality) instead.)

**1.3. Simple Examples of Morphisms**

Imagine a student who is deciding between staying up late studying for a test ($a_s$) or ignoring the test ($a_i$). We will represent the student with a Cartesian frame over letter grades, where $W=\{ \mbox{A+}, \mbox{A}, \mbox{A-}, \mbox{B+}, \mbox{B}, \mbox{B-}, \mbox{C+}, \mbox{C}, \mbox{C-}, \mbox{D+}, \mbox{D}, \mbox{D-}, \mbox{F} \}$.

If the student doesn't study, her final grade is always a C+, represented by the possible world $\mbox{C+}$. If she does study, she may oversleep and get a bad grade (represented by the environment selecting $e_o$ and putting her in $\mbox{D-}$). If she studies and doesn't oversleep, she is uncertain about whether her teacher is typical ($e_t$, resulting in $\mbox{A-}$) or unusually demanding ($e_d$, resulting in $\mbox{B+}$). We represent this with the frame

$C_T=\begin{array}{cc} &\begin{array}{cc} e_t   &e_d   &e_o \end{array}\ \begin{array}{c} a_s \ a_i \end{array} & \begin{pmatrix} \mbox{A-} & \mbox{B+} & \mbox{D-} \ \mbox{C+} & \mbox{C+} & \mbox{C+}  \ \end{pmatrix} \end{array}$.

Let us also suppose that yesterday, the student had the extra option of copying another student's answers on test day to get a sure A+. However, she decided not to cheat. We represent the student's options yesterday, prior to precommitting, with the frame

$C_Y=\begin{array}{cc} &\begin{array}{cc} f_t   &f_d   &f_o \end{array}\ \begin{array}{c} b_s \ b_i \ b_c \end{array} & \begin{pmatrix} \mbox{A-} & \mbox{B+} & \mbox{D-} \ \mbox{C+} & \mbox{C+} & \mbox{C+}  \ \mbox{A+} & \mbox{A+} & \mbox{A+} \ \end{pmatrix} \end{array}$.

There is a morphism from the student's frame today to her frame yesterday, representing the fact that $\mbox{Agent}(C_T)$ can be plugged into $\mbox{Agent}(C_Y)$'s game, or that the student was "stronger" yesterday than she is today.

Let us also suppose that the student's teacher *is* in fact demanding. If the student today knew this fact, we would instead represent her perspective with the frame

$C_{T^\prime}=\begin{array}{cc} &\begin{array}{cc} e^\prime_d   &e^\prime_o \end{array}\ \begin{array}{c} a^\prime_s \ a^\prime_i \end{array} & \begin{pmatrix} \mbox{B+} & \mbox{D-} \ \mbox{C+} & \mbox{C+}  \ \end{pmatrix} \end{array}$.

Here, we have a morphism from the student today ($C_T$) to her perspective if she had an additional promise from the environment ($C_{T^\prime}$). This represents the fact that $C_{T^\prime}$ can strategy-steal from a version of herself who knows strictly less.

Given two Cartesian frames $C_0$ and $C_1$, I am not aware of an efficient universal method for determining whether there exists a morphism from $C_0$ to $C_1$. Indeed, I conjecture that this problem might be NP-complete. In the above cases, however, we can see that there exist morphisms from $C_T$ to the other two frames by observing that $C_T$ is effectively $C_Y$ with a row deleted, or $C_{T^\prime}$ with a column added.

While $\mbox{Agent}(C_Y)$ and $\mbox{Agent}(C_{T^\prime})$ are both stronger than $\mbox{Agent}(C_T)$, we have no morphisms between $C_Y$ and $C_{T^\prime}$; their options are different enough that we can't compare their strength directly.

**1.4. Examples of Morphisms Going Both Ways**

Every Cartesian frame has an identity morphism pointing to itself; and as we'll discuss in the next post, whenever two Cartesian frames $C$ and $D$ are equivalent (in a sense to be defined), there will be a morphism going from $C$ to $D$ and another going from $D$ to $C$. But not all pairs of Cartesian frames with morphisms going both ways are equivalent. Consider, for example,

$C_1=\begin{array}{cc} &\begin{array}{cc} e_0 &e_1 \end{array}\ \begin{array}{c} a_0 \ a_1 \end{array} & \begin{pmatrix} w_0 & w_0\ w_0 & w_1\ \end{pmatrix} \end{array}\mbox{ and } D_1=\begin{array}{cc} &\begin{array}{cc} f_0 \end{array}\ \begin{array}{c} b_0 \end{array} & \begin{pmatrix} w_0 \ \end{pmatrix} \end{array}$.

In $C_1 = (A,E,\cdot)$, the default outcome is $w_0$, but the agent and environment can handshake to produce $w_1$. In $D_1=(B,F,\star)$, there are no choices, and there's only one possible world, $w_0$.

It turns out that there is a morphism $(g,h):C_1\rightarrow D_1$, where $g$ is the constant function $b_0$ and $h$ is the constant function $e_0$; and there is a second morphism $(g^\prime, h^\prime):D_1\rightarrow C_1,$ where $g^\prime$ is the constant function $a_0$ and $h^\prime$ is the constant function $f_0$. We can interpret these like so:

*   There is a morphism $C_1\rightarrow D_1$ because $D_1$ is effectively $C_1$ plus a promise from the environment "I'll choose $e_0$." The agent in $D_1$ is "stronger" in the sense that it has fewer possible environments to worry about. There is less the environment can do to interfere with the agent's choices.
*   There is a morphism $D_1\rightarrow C_1$ because $C_1$'s agent has strictly more options than $D_1\mbox{'s}$ agent: moving from $D_1$ to $C_1$ lets you retain the option to produce $w_0$ if you want, but it also lets you try for $w_1$.

So we can view the smaller matrix as the larger matrix plus a promise from the environment "I'll choose $e_0$," or we can view it as the larger matrix plus a commitment from the agent "I'll choose $a_0$."

This example demonstrates that my intuitive statement "wherever there's a morphism from $C$ to $D$, $D$ is at least as strong as $C$" conflates two different notions of "stronger." These notions often go together, but come apart in situations such as the handshake example. Like the hypothetical student in $C_{T^\prime}$, the agent of $D_1$ is "stronger" in the sense that the environment can't do as much to get in the way. But like the not-yet-precommitted student in $C_Y$, the agent of $C_1$ is "stronger" in the sense that it has more options.

2\. Self-Duality
----------------

A key property of $\mbox{Chu}(W)$ is that it is self-dual.

**Definition:** Let $-^{*}:\mbox{Chu}(W)\rightarrow\mbox{Chu}(W)^\mbox{op}$ be the functor given by $(A,E,\cdot)^*=(E,A,\star)$, where $e\star a=a\cdot e$, and $(g,h)^*=(h,g)$.

The more standard notation for dual in linear logic would be $-^\bot$, but this is horrible notation.[^1^](https://www.lesswrong.com/posts/ewkYgtZapQRtDPT2F/additive-operations-on-cartesian-frames#Footnotes)

**Claim:** $-^*$ is an isomorphism between $\mbox{Chu}(W)$ and $\mbox{Chu}(W)^\mbox{op}$.

**Proof:** First, we show $-^*$ is a functor. The objects in $\mbox{Chu}(W)^\mbox{op}$ are the same as in $\mbox{Chu}(W)$, the morphisms from $D$ to $C$ in $\mbox{Chu}(W)^\mbox{op}$ are the morphisms from $C$ to $D$ in $\mbox{Chu}(W)$, and composition is the same, but with the order reversed. $-^*$ clearly preserves identity morphisms. To show that $-^*$ preserves composition, we have

$$
\begin{equation} \begin{split} (g_0,h_0)^*\circ^\mbox{op}(g_1,h_1)^* & = (h_1,g_1)\circ(h_0,g_0) \ & = (h_1\circ h_0,g_0\circ g_1) \ & = ((g_0,h_0)\circ(g_1,h_1))^*. \end{split} \end{equation}
$$

To see that it is an isomorphism, we need a left and right inverse. We will abuse notation and also write $-^*$ for the functor from $\mbox{Chu}(W)^\mbox{op}$ to $\mbox{Chu}(W)$ given by $(E,A,\star)^*=(A,E,\cdot)$, where $a\cdot e=e\star a$, and $(h,g)^*=(g,h)$. Clearly, we have $-^*:\mbox{Chu}(W)\rightarrow\mbox{Chu}(W)^\mbox{op}$ and $-^*:\mbox{Chu}(W)^\mbox{op}\rightarrow\mbox{Chu}(W)$ composing to the identity in both orders, so $-^*$ is an isomorphism. $\square$

Going back to our visualization of Cartesian frames as matrices, $-^*$ just takes the transpose of the matrix, swapping agent with environment. "$\mbox{Chu}(W)$ is self-dual" is another way of saying that transposing a Cartesian frame always gives you another Cartesian frame.

Philosophically, depending on our interpretation, this may be doing something weird. We talk about possible agents and possible environments, but we may mean something different by "possible" in those two cases.

Since we are imagining events from the point of view of the agents, "possible agents" is referring to all of the ways the agent can choose to be by exercising its "free will." We could think of "possible environments" similarly, or we could think of possible environments as representing the agent's uncertainty.

Under the view where possible environments represent uncertainty, $-^*$ is pointing to an interesting duality that swaps choices with uncertainty, swaps the "could" of "I could do X" with the "could" of "The world could have property Y," and (if we add probability to the mix) swaps mixed strategies with probabilistic uncertainty. "What will I do?" becomes "What game am I playing?", or "What is the world-as-a-function-of-my-action like?"

I will introduce many operations on Cartesian frames, so it will help to highlight even the basic properties as I go. Here, I'll note:

**Claim:** For any Cartesian frame $C$, $(C^*)^*= C$.

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

3\. Sums of Cartesian Frames
----------------------------

The first binary operation on Cartesian frames I want to introduce is the sum, $\oplus$.

**Definition:** For Cartesian frames $C=(A,E,\cdot)$ and $D=(B,F,\star)$ over $W$, $C\oplus D$ is the Cartesian frame $(A\sqcup B, E\times F, \diamond)$, where $a\diamond(e,f)=a\cdot e$ if $a\in A$, and $a\diamond(e,f)=a\star f$ if $a\in B$.

The sum takes the disjoint union of the agents and the Cartesian product of the environments, and does the obvious thing with the evaluation function. The agent can choose any strategy from $A$ or from $B$, and the environment has to respond to that strategy. We can interpret this as an agent that can choose between two different first-person perspectives: it can decide to interact with the environment as the agent of $C$, or as the agent of $D$.

Maybe "Rebecca the chess player" is considering which chess opening to employ, whereas "Rebecca the food-eater" is considering putting her plate down on the chess board and having lunch instead. "Rebecca the agent that can choose between playing chess and having lunch" is the sum of the other two Rebeccas.

If Rebecca tunnel-visions on the chess game, she may not consider her other options. Likewise if she tunnel-visions on lunch. If she inhabits the perspective of the third Rebecca, she can instead decide between chess moves *and* decide whether she wants to be playing chess at all.

Meanwhile, the environment must use a policy that selects an option from $E$ if the agent chooses from $A$, and selects an option from $F$ if the agent chooses from $B$.

In the chess example: The environment must be able to respond to different chess moves, but it must also be able to respond to Rebecca deciding to play a different game.

To give a formal example, let $C_2=(A,E,\cdot)$ and $D_2=(B,F,\star)$ be given by the matrices

$C_2=\begin{array}{cc} &\begin{array}{cc} e_0 &e_1 \end{array}\ \begin{array}{c} a_0 \ a_1 \end{array} & \begin{pmatrix} w_0 & w_1\ w_2 & w_3\ \end{pmatrix} \end{array}\mbox{ and } D_2=\begin{array}{cc} &\begin{array}{cc} f_0  &f_1  &f_2 \end{array}\ \begin{array}{c} b_0 \ b_1 \ b_2 \end{array} & \begin{pmatrix} w_4 & w_5 & w_6 \ w_7 & w_8 & w_9 \ w_{10} & w_{11} & w_{12}\ \end{pmatrix} \end{array}$.

Here, $C_2\oplus D_2$ is given by

$C_2\oplus D_2=\begin{array}{cc} &\begin{array}{cccc} e_0f_0  &e_0f_1  &e_0f_2  &e_1f_0   &e_1f_1  &e_1f_2 \end{array}\ \begin{array}{c} a_0 \ a_1\\b_0\\b_1\\b_2 \end{array} & \begin{pmatrix}  w_0  & w_0 & w_0 & w_1 & w_1 & w_1 \  w_2  &  w_2 & w_2 & w_3 & w_3 & w_3 \  w_4  & w_5 & w_6 & w_4 & w_5 & w_6 \  w_7 & w_8 & w_9 & w_7 & w_8 & w_9 \  w_{10}  & w_{11} & w_{12} & w_{10} & w_{11} & w_{12} \ \end{pmatrix} \end{array}$.

If we wish to interpret $C_2\oplus D_2$ temporally, we can say: The agent first chooses what game to play. The environment then, as a function of which game was chosen, "chooses" what it does; and the agent simultaneously chooses its own move within the game it picked.

**Definition:** Let $0$ be given by the Cartesian frame $0=(\{\},\{e\},\cdot)$, where $\mbox{Agent}(0)$ is the empty set, $\mbox{Env}(0)=\{e\}$ is any singleton set, and $\mbox{Eval}(0)$ is trivial, since it has empty domain.

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

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

Returning to our interpretation of morphisms as differences in agents' strength: The agent of $C\oplus D$ can choose between being the agent from $C$ or the agent from $D$, and so is stronger than either. Indeed, we can think of $C\oplus D$'s agent as the weakest agent that is stronger than both $C$'s agent and $D$'s agent. Mathematically, this translates to $\oplus$ being the categorical coproduct in $\mbox{Chu}(W)$.

**Theorem:** $C_0\oplus C_1$ is the coproduct of $C_0$ and $C_1$ in $\mbox{Chu}(W)$, and $0$ is initial in $\mbox{Chu}(W)$.

**Proof:** First, we show that $0$ is initial. We want to show that there exists a unique morphism from $0$ to a given $C$. Indeed, a morphism from $0$ to $C=(A,E,\cdot)$ is a function from $\{\}$ to $A$ along with a function from $E$ to $\{e\}$, and there is always exactly one such pair of functions, regardless of what $A$ and $E$ are. It is also easy to see that this pair of functions is a morphism, since the condition for morphism is empty, since $\mbox{Agent}(0)$ is empty. Thus $0$ is initial.

Let $C_i=(A_i,E_i,\cdot_i)$, and let $C_0\oplus C_1=(A_0\sqcup A_1,E_0\times E_1,\diamond)$. We want to show that there exist inclusion 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 Cartesian frame $D=(B,F,\star)$, and any pair of morphisms $\phi_0:C_0\rightarrow D$ and $\phi_1:C_1\rightarrow D ,$ we have that there exists a unique morphism $\phi:C_0\oplus C_1\rightarrow D$ such that $\phi\circ \iota_0=\phi_0$ and $\phi\circ \iota_1=\phi_1$.

First, we need to specify $\iota_i:(A_i,E_i,\cdot_i)\rightarrow (A_0\sqcup A_1,E_0\times E_1,\diamond)$. We let $\iota_i=(j_i,k_i)$, where $j_i:A_i\rightarrow A_0\sqcup A_1$ is just the the obvious inclusion of $A_i$ into $A_0\sqcup A_1$, and $k_i:E_0\times E_1\rightarrow E_i$ is just the obvious projection. This is clearly a morphism.

Given $\phi_0=(g_0,h_0):C_0\rightarrow D$ and $\phi_1=(g_1,h_1):C_1\rightarrow D$, we let $\phi=(g,h)$, where $g:A_0\sqcup A_1\rightarrow B$ is given by $g(a)=g_i(a)$ where $i$ is such that $a\in A_i$, and $h:F\rightarrow E_0\times E_1$ is given by $h(f)=(h_0(f),h_1(f))$. This is a morphism because for all $a\in A_0\sqcup A_1$ and $f\in F$, we have

$$
\begin{equation} \begin{split} a\diamond h(f) &=a\cdot_i h_i(f) \ &=g_i(a)\star f \ &=g(a)\star f, \end{split}\end{equation}
$$

where $i$ is such that $a\in A_i$. It is clear from the definitions that $\phi\circ \iota_i=\phi_i$.

Finally, we need to show the uniqueness of this $\phi$. Let $\phi^\prime=(g^\prime,h^\prime):C_0\oplus C_1\rightarrow D$ be a morphism such that $\phi^\prime\circ\iota_i=\phi_i$ for both $i=1,2$. This means that $g^\prime(a)=g_i(a)$ when $a\in A_i$, so $g^\prime(a)=g(a)$ for all $a\in A_0\sqcup A_1$. Similarly, $h^\prime(f)$ must project to $h_0(f)$ and $h_1(f)$, so

$$
\begin{equation} \begin{split} h^\prime(f) &=(h_0(f),h_1(f)) \ &=h(f) \end{split}\end{equation}
$$

for all $f\in F$. Thus $\phi^\prime=\phi$. $\square$

4\. Products of Cartesian Frames
--------------------------------

Dual to sum, we have the product operation, $\&$. This operation is a product. It is also in the section on additive operations. There are many counterintuitive things about the notation of Chu spaces and linear logic.

**Definition:** For Cartesian frames $C=(A,E,\cdot)$ and $D=(B,F,\star)$ over $W$, $C\&D$ is the Cartesian frame $(A\times B,E\sqcup F,\diamond)$, where $(a,b)\diamond e=a\cdot e$ if $e\in E$, and $(a,b)\diamond e=b\star e$ if $e\in F$.

$C\&D$ means that the agent might have to be the agent of $C$, and might have to be the agent of $D$, but does not get to decide which one. Thus, it will have to choose a pair, $(a,b)$, where $a$ says how to behave in a $C$ situation, and $b$ says how to behave in a $D$ situation. The environment will "choose" to either be $C$'s environment or $D$'s environment. When the agent and environment interact, the agent uses the component of its pair that matches the environment's choice.

Instead of thinking of the agent as choosing a pair, we could again think about the situation temporally. $C\&D$ is equivalent to an interaction where the environment first chooses which Cartesian frame, $C$ or $D$, to play; then the agent observes this choice, and the agent and environment simultaneously behave as though they were in the chosen frame, either $C$ or $D$.

(In fact, if $\mbox{Image}(C)$ and $\mbox{Image}(D)$ are disjoint, we can see this interpretation in the formalism by noting that $\mbox{Image}(C)\in\mbox{Obs}(C\& D)$—that is, the agent can change its behavior on the basis of whether the environment selected from $C$ or from $D$.)

For example, if we let $C_2$ and $D_2$ be as the example in §3,

$C_2=\begin{array}{cc} &\begin{array}{cc} e_0 &e_1 \end{array}\ \begin{array}{c} a_0 \ a_1 \end{array} & \begin{pmatrix} w_0 & w_1\ w_2 & w_3\ \end{pmatrix} \end{array}\mbox{ and } D_2=\begin{array}{cc} &\begin{array}{cc} f_0  &f_1  &f_2 \end{array}\ \begin{array}{c} b_0 \ b_1 \ b_2 \end{array} & \begin{pmatrix} w_4 & w_5 & w_6 \ w_7 & w_8 & w_9 \ w_{10} & w_{11} & w_{12}\ \end{pmatrix} \end{array}$,

then $C_2\&D_2$ is given by

$C_2\& D_2=\begin{array}{cc} &\begin{array}{cccc}   e_0   &e_1   & f_0   &f_1   &f_2   \end{array}\ \begin{array}{c} a_0b_0 \ a_0b_1\\a_0b_2\ a_1b_0\\a_1b_1\\a_1b_2 \end{array} & \begin{pmatrix} w_0&w_1&w_4&w_5&w_6 \ w_0&w_1&w_7&w_8&w_9\ w_0&w_1&w_{10}&w_{11}&w_{12} \ w_2&w_3&w_4&w_5&w_6 \ w_2&w_3&w_7&w_8&w_9 \ w_2&w_3&w_{10}&w_{11}&w_{12} \end{pmatrix} \end{array}$.

A second example: Suppose that we have two Cartesian frames, $C_3$ and $D_3$.  $C_3$ is a frame in which it's raining, and the agent chooses whether to carry an umbrella. $D_3$ is a frame in which it's sunny, and the agent chooses whether to carry an umbrella.

$C_3=\begin{array}{cc} &\begin{array}{cc} r \end{array}\ \begin{array}{c} u \ n \end{array} & \begin{pmatrix} ur \ nr \end{pmatrix} \end{array}\mbox{ and } D_3=\begin{array}{cc} &\begin{array}{cc} s \end{array}\ \begin{array}{c} u \ n \end{array} & \begin{pmatrix} us \ ns\ \end{pmatrix} \end{array}$

It turns out that the second example we provided in "Introduction to Cartesian Frames" §3.2 ([Examples of Controllables](https://www.lesswrong.com/posts/BSpdshJWGAW6TuNzZ/introduction-to-cartesian-frames#3_2__Examples_of_Controllables)) is exactly equal to the product of these two Cartesian frames, 

$\begin{array}{cc} &\begin{array}{cc} r &s \end{array}\ \begin{array}{c} uu = u \ nn = n \ un = u\leftrightarrow r\ nu = u\leftrightarrow s \end{array} & \begin{pmatrix} ur & us\ nr & ns\ ur & ns\ nr & us\ \end{pmatrix} \end{array}$.

The environment is the disjoint union of the rain and sun environments, and the policies of the agent can be viewed as "I get to choose what to do as a function of what game we're playing," where "what game we're playing" is "what the weather is."

**Definition:** Let $\top$ be given by the Cartesian frame $\top=(\{a\},\{\},\cdot)$, where $\mbox{Agent}(\top)$ is a singleton, $\mbox{Env}(\top)$ is the empty set, and $\mbox{Eval}(\top)$ is trivial, since it has empty domain.

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

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

$\&$ is essentially just $\oplus$ from the point of view of the environment. Thus, since $-^*$ swaps agent and environment, we can express $\&$ using $\oplus$ and $-^*$.

**Claim:** $C\&D=(C^*\oplus D^*)^*$, $\top= 0^*$, $C\oplus D=(C^*\& D^*)^*$, and $0=\top^*$.

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

In other words, $\oplus$ and $\&$ are De Morgan dual with respect to $-^*$.

In the same way that we interpreted $C\oplus D$ as having the weakest agent that is stronger than the agents of $C$ and $D$, we can interpret $C\&D$'s agent as the *strongest* agent that is *weaker* than the agents of $C$ and $D$.

**Theorem:** $C_0\&C_1$ is the product of $C$ and $D$ in $\mbox{Chu}(W)$, and $\top$ is terminal in $\mbox{Chu}(W)$.

**Proof:** Since $\oplus$ is the coproduct in $\mbox{Chu}(W)$, it is the product in $\mbox{Chu}(W)^\mbox{op}$. Since $-^*$ is an isomorphism between $\mbox{Chu}(W)$ and $\mbox{Chu}(W)^\mbox{op}$, we can take a product in $\mbox{Chu}(W)$ of $C_0$ and $C_1$ by sending them to $\mbox{Chu}(W)^\mbox{op}$ via this isomorphism, taking a product, and sending them back. Thus $(C_0^*\oplus C_1^*)^*=C_0\&C_1$ is the product in $\mbox{Chu}(W)$ of $C_0$ and $C_1$.

Similarly, since $0$ is initial in $\mbox{Chu}(W)$, it is terminal in $\mbox{Chu}(W)^\mbox{op}$. Thus, $0^*=\top$ is terminal in $\mbox{Chu}(W)$. $\square$

Our next post will discuss equivalence relations between Cartesian frames. We will introduce a homotopy equivalence on Cartesian frames, and employ these relations to classify small Cartesian frames up to homotopy.

* * *

Footnotes
---------

1\. One important reason $-^\bot$ is bad notation for dual is that $A^B$ normally represents $B \rightarrow A$, where $\rightarrow$ is your category's [internal hom](https://ncatlab.org/nlab/show/internal+hom) functor. For Chu spaces, $\rightarrow$ is $\multimap$. Since $\bot$ will be the name for an object in our category, one would reasonably expect $C^{\bot}$ to represent $\bot \multimap C$, but it doesn't. Worse still, $C^*$ *does* happen to be equivalent to $C\multimap \bot$, and this will be an important fact to understand. To minimize confusion, we instead use the common notation $-^*$ for dual. [↩](https://www.lesswrong.com/posts/ewkYgtZapQRtDPT2F/additive-operations-on-cartesian-frames#2__Self_Duality)