# EDT solves 5 and 10 with conditional oracles

# Introduction and motivation

The starting point for this post is a comment I wrote on [Paul's post on EDT vs CDT](https://sideways-view.com/2018/09/19/edt-vs-cdt/):

> One argument for CDT over EDT that you didn’t mention in this post: Suppose you live in a deterministic universe and know your own source code. Suppose you are deciding between taking a 5 dollar bill and a 10 dollar bill. Suppose your world model says you take the 5 dollar bill with 100% probability. Now conditioning on taking the 10 dollar bill gives you complete garbage, since you are conditioning on a probability 0 event. If you use EDT, then depending on other details of your decision procedure, this could lead to you always taking the 5 dollar bill. So then your world model would be accurate. (This is the “5 and 10” problem often discussed at MIRI; I don’t know if it has been written up anywhere)
>
> CDT never generates undefined expected utility estimates like EDT does. It takes the 10 dollar bill in this problem. However, if it always takes the 10 dollar bill, then its counterfactual for taking the 5 dollar bill is strange because it is one in which a physical law is violated. The violation of a physical law could have important consequences other than which action the agent takes.
>
> Both decision theories have trouble with this problem, but at least CDT always produces a defined answer.
>
> Here’s another way of thinking about this problem. A fully Bayesian version of EDT must construct all possible worlds and then condition on taking a certain action. But each of these possible worlds contains a running copy of the EDT algorithm. So, absent some defined method for taking a fixed point, this leads to an infinite loop, and you can’t actually have a fully Bayesian version of EDT.
>
> (What if you use reflective oracles to allow EDT to select some fixed point? We could specify that the reflective oracle returns arbitrary results when asked to condition on a probability 0 event (I think this is what the most natural way to emulate conditional queries on a reflective oracle results in, but I haven’t checked). Now there are multiple possible reflective oracles (i.e. fixed points); it’s possible to always take the 10 dollar bill and think bad things will happen conditional on taking the 5 dollar bill, and it’s also possible to always take the 5 dollar bill and think bad things will happen conditional on taking the 10 dollar bill.)
>
> A fully Bayesian version of CDT must construct all possible counterfactuals. Each of these counterfactuals contains a running copy of CDT, so one might think the same problem applies. But in each of these counterfactuals, the output of the CDT algorithm is “thrown away”, since the agent’s action is controlled by a magic counterfactual intervention rather than its algorithm. So, if the CDT algorithm is sandboxed, the CDT’s world model can simply ignore the running CDT algorithm, as it has no effect. Thus, at least in single-agent problems (with no predictors etc), a fully Bayesian version of CDT is possible in principle, though obviously not in practice.

Some time during or after writing this comment, I noticed something: the equilibrium where the EDT agent thinks it always takes the 5 dollar bill, and therefore gets garbage (possibly low) estimates when considering taking the 10 dollar bill, and therefore never takes the 10 dollar bill, is _extremely_ unstable.  As soon as the agent assigns any probability at all to taking the 10 dollar bill, their conditional expected utility estimates are perfect.  Can we use this fact to design a variant of EDT that always takes the 10 dollar bill?

Yes, yes we can.

# Definitions and main theorem statements

Reflective conditional oracle distributions will be defined similar to in previous work such as [reflective oracles](https://arxiv.org/abs/1508.04145) and [reflective oracle distributions](https://agentfoundations.org/item?id=1435).  I recommend understanding reflective oracles before reading this post (understanding reflective oracle distributions is helpful but unnecessary).

Let $\mathcal{M}$ be some finite subset of the set of probabilistic Turing machines that may query a conditional oracle (defined in the next paragraph).  They must each always halt and return either 0 or 1.

_Definition 1:_ A _conditional oracle_ is a function $O : \mathcal{M}^4 \rightarrow \{0, 1\}$.

Intuitively, $O(m_1, n_1, m_2, n_2)$ asks whether $P(m_1^{O'}() | n_1^{O'}())$ is greater or less than $P(m_2^{O'}() | n_2^{O'}())$, where $O'$ is taken from some distribution over conditional oracles.

We make the assumption that machines in $\mathcal{M}$ only ever query the oracle with an element of $\mathcal{M}^4$.  All further definitions and lemmas/theorems are parameterized on some $\mathcal{M}$ satisfying this assumption.

_Definition 2:_ A _conditional oracle distribution_ (COD) is a distribution over conditional oracles, of type $\Delta (\mathcal{M}^4 \rightarrow \{0, 1\})$.

_Definition 3:_ A COD is _fully-mixed_ if it assigns nonzero probability to each possible conditional oracle.

Since the number of conditional oracles is finite, there are fully-mixed CODs.

_Definition 4:_ A COD $Q$ _weakly leads to_ a COD $Q'$ iff, for all $m_1, n_1, m_2, n_2 \in \mathcal{M}, p \in \mathcal{P}$:

$$P_Q(m_1^O() = 1 \wedge n_1^O() = 1) P_Q(n_2^O() = 1) > P_Q(m_2^O() = 1 \wedge n_2^O() = 1) P_Q(n^O() = 1) \rightarrow P_{Q'}(O(m_1, n_1, m_2, n_2) = 1) = 1$$

$$P_Q(m_1^O() = 1 \wedge n_1^O() = 1) P_Q(n_2^O() = 1) < P_Q(m_2^O() = 1 \wedge n_2^O() = 1) P_Q(n^O() = 1) \rightarrow P_{Q'}(O(m_1, n_1, m_2, n_2) = 0) = 1$$

(Here, the notation $P_Q(E)$ refers to the probability of event $E$ when $O \sim Q$.)

Intuitively, $Q$ weakly leads to $Q'$ iff $Q'$ accurately answers conditional queries that are about $Q$.  If $n_1^O() = 1$ for some $O$ and also $n_2^O() = 1$ for some (possibly different) $O$ and $Q$ is fully-mixed, these conditions are equivalent to:

$$P_Q(m_1^O() = 1 \mid n_1^O() = 1) > P_Q(m-o^O() = 1 \mid n_2^O() = 1) \rightarrow P_{Q'}(O(m_1, n_1, m_2, n_2) = 1) = 1$$

$$P_Q(m_1^O() = 1 \mid n_1^O() = 1) < P_Q(m-o^O() = 1 \mid n_2^O() = 1) \rightarrow P_{Q'}(O(m_1, n_1, m_2, n_2) = 0) = 1$$

As notation, let $\mathrm{StepWeak} : \Delta (\mathcal{M}^4 \rightarrow \{0, 1\}) \rightarrow \mathrm{PowerSet}(\Delta (\mathcal{M}^4 \rightarrow \{0, 1\}))$ map a COD to the set of CODs it weakly leads to.  This and related functions will be interpreted as [set-valued](https://en.wikipedia.org/wiki/Multivalued_function) when referring to their graphs.

Unfortunately, these conditional queries are not sensible when $P_Q(n_1^O() = 1) = 0$ or $P_Q(n_2^O() = 1) = 0$; the oracle is allowed to return any answer.  We will define a stricter notion of "leading to" that will require these answers to be sensible.

Let $\mathrm{StepClosure} : \Delta (\mathcal{M}^4 \rightarrow \{0, 1\}) \rightarrow \mathrm{PowerSet}(\Delta (\mathcal{M}^4 \rightarrow \{0, 1\}))$ be a set-valued function whose graph is the closure of (the graph of $\mathrm{StepWeak}$ restricted to $(Q, Q')$ where $Q$ is fully-mixed).  It will turn out that $\mathrm{StepClosure}(Q) = \mathrm{StepWeak}(Q)$ for fully-mixed $Q$.

Equivalently, $Q' \in \mathrm{StepClosure}(Q)$ iff there are infinite COD sequences $Q_1, Q_2, \ldots$ and $Q'_1, Q'_2, \ldots$ such that (a) each $Q_i$ is fully mixed, (b) each $Q_i$ weakly leads to $Q'_i$, (c) $\{Q_i\}_i$ limits to $Q$, and (d) $\{Q'_i\}_i$ limits to $Q'$.

Intuitively, $\mathrm{StepClosure}$ is equivalent to $\mathrm{StepWeak}$ for fully-mixed $Q$ and generalizes to non-fully-mixed $Q$ through taking limits that involve only fully-mixed $Q$ values.

Define $\mathrm{StepHull}(Q) := \mathrm{ConvexHull}(\mathrm{StepClosure}(Q))$.  It will turn out that $\mathrm{StepHull}(Q) = \mathrm{StepClosure}(Q) = \mathrm{StepWeak}(Q)$ for fully-mixed $Q$.

(Why take the convex hull?  This is to make $\mathrm{StepHull}$ a Kakutani map.  It might be the case that $\mathrm{StepClosure}(Q)$ is always convex but I haven't proven this.)

_Definition 5:_ A COD $Q$ _leads to_ a COD $Q'$ iff $Q' \in \mathrm{StepHull}(Q)$.

Due to Theorem 1, it will turn out that a fully-mixed COD $Q$ leads to $Q'$ iff it strictly leads to $Q'$.  Leading to is a stronger condition than weak leading to, as will be proven.

At this point we are ready to define a reflection condition:

_Definition 6:_ A COD is reflective iff it leads to itself.

Intuitively, a COD is reflective iff it accurately answers queries that are about itself.

This post's main results are the following (in addition to the proof that EDT beats 5 and 10):

_Theorem 1:_ For any fully-mixed COD $Q$, $\mathrm{StepWeak}(Q) = \mathrm{StepClosure}(Q) = \mathrm{StepHull}(Q)$.

_Theorem 2:_ If $Q$ leads to $Q'$, then it weakly leads to $Q'$.

_Theorem 3:_ There is a reflective COD.

These are proven at the end of the post.

# Defining EDT

EDT can be defined using a reflective COD; this decision theory will be called COEDT.  Let the decision problem be described by a Turing machine with an embedded agent, where this Turing machine including its agent may randomize and call a conditional oracle, and which returns either 0 or 1 to represent the agent's utility (intermediate utilities can be emulated by randomizing).  For example, for the 5 and 10 problem, we may define:

$$\mathrm{FiveTen}^O(\lceil A \rceil) := A^O()$$

where $\lceil A \rceil$ is the source code of the agent $A$.

COEDT is a function from the universe program (which already contains an embedded COEDT agent) to action.  The following COEDT variant handles cases where there are only 2 actions:

$$COEDT^O(\lceil U \rceil) := O(\lceil U^O() \rceil, \lceil COEDT^O(\lceil U \rceil) \rceil, \lceil U^O() \rceil, \lceil 1-COEDT^O(\lceil U \rceil) \rceil)$$

It uses the conditional oracle to determine if it has a higher chance of winning conditional on taking action 1 or action 0, and takes the action that it is more likely to win conditional on taking.

What does $COEDT$ do on $\mathrm{FiveTen}$?  We can take a fixed point:

$$U^O() := \mathrm{FiveTen}^O(\lceil COEDT^O(\lceil U \rceil)\rceil)$$

Let the set of machines considered be 

$$\mathcal{M} := \{ \lceil U^O() \rceil, \lceil COEDT^O(\lceil U \rceil) \rceil, \lceil 1-EDT^O(\lceil U \rceil) \}$$

_Theorem 4:_ For any reflective COD $Q$ on $\mathcal{M}$, $P_Q(COEDT^O(\lceil U \rceil) = 1) = 1$.

_Proof:_

Informally, this is true because the agent must always take action 1 when queries are about any fully-mixed COD.

$Q \in \mathrm{StepHull}(Q)$, so it is a convex combination of CODs in $\mathrm{StepClosure}(Q)$.  Let that convex combination be $\sum_{j=1}^k \lambda^j {Q'}^j$.

Each ${Q'}^j \in \mathrm{StepClosure}(Q)$, so we have COD sequences $\{Q^j_i\}_i$ limiting to $Q$ (with each being fully mixed) and $\{{Q'}^j_i\}_i$ limiting to ${Q'}^j$ such that each ${Q'^j}_i \in \mathrm{StepWeak}(Q^j_i)$.

For each $i,j$, since $COEDT^O(\lceil U \rceil)$ and $1-COEDT^O(\lceil U \rceil)$ both return 1 for some conditional oracles, and because $Q^j_i$ weakly leads to ${Q'}^j_i$, we have:

$$P_{Q^j_i}(U^O() = 1 \mid COEDT^O(\lceil U \rceil) = 1) > P_{Q^j_i}(U^O() = 1 \mid COEDT^O(\lceil U \rceil) = 0) \rightarrow P_{{Q'}^j_i}(COEDT^O() = 1) = 1$$

Obviously, the first conditional probability is 1 (since it is defined) and the second is 0.  Therefore, each $P_{{Q'}^j_i}(COEDT^O(\lceil U \rceil) = 1) = 1$.  This must then also be true for the limit
of $\{{Q'}^j_i\}_i$, i.e. $P_{{Q'}^j}(COEDT^O(\lceil U \rceil) = 1) = 1$.  This must also be true for the convex combination, i.e. $P_Q(COEDT^O(\lceil U \rceil) = 1) = 1$.

$\square$

# Multiple actions

(This section can be skipped.)

The COEDT defined above only handles problems that have 2 actions.  What if there are more than 2 actions?  Then we can split the agent into multiple 2-action COEDT agents: the first chooses between taking the first action and passing control to the second agent, the second agent chooses between taking the second action and passing control to the third agent, and so on.  For example, here is a 3-action construction of COEDT:

$$COEDT2^O(\lceil U \rceil, k) := O(\lceil U^O() \rceil, \lceil COEDT^O(\lceil U \rceil, k) = 1 \rceil, \lceil U^O() \rceil, \lceil COEDT^O(\lceil U \rceil, k) = 1 \rceil)$$

$$COEDT3^O(\lceil U \rceil) := \text{if } COEDT^O(\lceil U \rceil, 0) = 0 \text{ then } 0 \text { else } 1 + COEDT^O(\lceil U \rceil, 1)$$

(Why does $COEDT2$ have a second argument?  This is so the two different $COEDT2$ agents know which they are and can take different actions.)

One might think this has problems when the first agent expects the second agent to always take a bad action, therefore never defers control to the second agent, and therefore the second agent has no incentive to take a good action (this happens in Nash equilibria in sequential games).  However, since we consider fully-mixed oracles in the construction of COEDT, this is not a problem (EDIT: it is sometimes, see comment).  To demonstrate this, consider the following 5 and 10 and 15 problem:

$$U^O() := \text{if } COEDT3^O(\lceil U \rceil) = 0 \text { then } \mathrm{Flip}(1/2) \text{ else } COEDT3^O(\lceil U \rceil)-1$$

where $\mathrm{Flip}(p)$ flips a coin and returns 1 with probability $p$ and 0 with probability $1-p$.

Let the set of machines considered be

$$\mathcal{M} := \{ \lceil U^O() \rceil, \lceil COEDT2^O(\lceil U \rceil, 0) \rceil, \lceil 1-COEDT2^O(\lceil U \rceil, 0), \lceil COEDT2^O(\lceil U \rceil, 1) \rceil, \lceil 1-COEDT2^O(\lceil U \rceil, 1)\}$$

_Theorem 5:_ For any reflective COD $Q$ on $\mathcal{M}$, $P_Q(COEDT3^O(\lceil U \rceil) = 2) = 1$.

_Proof:_

$Q \in \mathrm{StepHull}(Q)$, so it is a convex combination of CODs in $\mathrm{StepClosure}(Q)$.  Let that convex combination be $\sum_{j=1}^k \lambda^j {Q'}^j$.

Each ${Q'}^j \in \mathrm{StepClosure}(Q)$, so we have COD sequences $\{Q^j_i\}_i$ limiting to $Q$ (with each being fully mixed) and $\{{Q'}^j_i\}_i$ limiting to ${Q'}^j$ such that each ${Q'^j}_i \in \mathrm{StepWeak}(Q^j_i)$.

By the same logic as in Theorem 4, each $P_{{Q'}^j_i}(COEDT2^O(\lceil U \rceil, 1) = 1) = 1$.

For each $i,j$, since $COEDT2^O(\lceil U \rceil, 0)$ and $1-COEDT2^O(\lceil U \rceil, 0)$ both return 1 for some conditional oracles, and because $Q^j_i$ weakly leads to ${Q'}^j_i$, we have:

$$P_{Q^j_i}(U^O() = 1 \mid COEDT2^O(\lceil U \rceil, 0) = 1) > P_{Q^j_i}(U^O() = 1 \mid COEDT2^O(\lceil U \rceil, 0) = 0) \rightarrow P_{{Q'}^j_i}(COEDT2^O() = 1) = 1$$

Obviously, the second conditional probability is 1/2.  The first is 1 since $P_{{Q'}^j_i}(COEDT2^O(\lceil U \rceil, 1) = 1) = 1$.
Therefore, each $P_{{Q'}^j_i}(COEDT2^O(\lceil U \rceil, 0) = 1) = 1$.

As in Theorem 4, these conditions must then be true for the limits ${Q'}^j$ and the convex combination $Q$.


$\square$

# Conclusion and future research

I consider COEDT to be major progress in decision theory.  Before COEDT, there were (as far as I know) 3 different ways to solve 5 and 10, all based on counterfactuals:

- Causal counterfactuals (as in CDT), where counterfactuals are worlds where physical magic happens to force the agent's action to be something specific.
- Model-theoretic counterfactuals (as in [modal UDT](https://agentfoundations.org/item?id=121)), where counterfactuals are [models](https://en.wikipedia.org/wiki/Model_theory) in which false statements are true, e.g. where PA is inconsistent.
- Probabilistic conditionals (as in reinforcement learning and logical inductor based decision theories such as [LIEDT/LICDT](https://agentfoundations.org/item?id=1629) and [asymptotic decision theory](https://www.lesswrong.com/posts/yXCvYqTZCsfN7WRrg/asymptotic-decision-theory-improved-writeup)), where counterfactuals are possible worlds assigned a small but nonzero probability by the agent in which the agent takes a different action through "exploration"; note that ADT-style optimism is a type of exploration.

COEDT is a new way to solve 5 and 10.  My best intuitive understanding is that, whereas ordinary EDT (using ordinary reflective oracles) seeks any equilibrium between beliefs and policy, COEDT specifically seeks a not-extremely-unstable equilibrium (though not necessarily one that is stable in the sense of dynamical systems), where the equilibrium is "justified" by the fact that there are arbitrarily close almost-equilibria.  This is similar to [trembling hand perfect equilibrium](https://en.wikipedia.org/wiki/Trembling_hand_perfect_equilibrium).  To the extent that COEDT has counterfactuals, they are these worlds where the oracle distribution is not actually reflective but is very close to the actual oracle distribution, and in which the agent takes a suboptimal action with very small probability. 

My sense is that the results in this post open up a wide new territory of open questions and further research.  Here are some of them:

- What kind of optimality result(s) does COEDT have for single-player problems?
- Do infinite reflective CODs exist, as with reflective oracles?
- Is the set of reflective CODs convex (as the set of [reflective oracle distributions](https://agentfoundations.org/item?id=1435) is)?
- Can this approach be integrated with logical uncertainty (e.g. logical inductors)?
- What happens in games with more than one COEDT?  What is the equilibrium concept?
- Are there optimality results for common-payoff games, or Pareto-optimality results for non-common-payoff games?
- Can COEDT be attacked with a "troll bridge" problem similar to [the one for LIEDT/LICDT](https://agentfoundations.org/item?id=1711)?

There is a lot of low-hanging fruit here, and I am posting this now before immediately picking the low-hanging fruit in the hope that discussion will be helpful.

Proofs of theorems 1-3 follow.

# Proving Theorem 1 and Theorem 2

First we will show that $\mathrm{StepWeak}$ is a Kakutani map; this will also help with Theorem 2 (as Theorem 2 will be proven by applying Kakutani's fixed point theorem to $\mathrm{StepHull}$).

_Lemma 1_: For each $Q$, $\mathrm{StepWeak}(Q)$ is nonempty and convex.

_Proof_:

Informally, this is true because for a fixed $Q$, the constraints on $Q'$ are convex and consistent.

Let $m_1,n_1,m_2,n_2 \in \mathcal{M}$.  There are 3 cases:

- If $P_Q(m_1^O() = 1 \wedge n_1^O() = 1) P_Q(n_2^O() = 1) > P_Q(m_2^O() = 1 \wedge n_2^O() = 1) P_Q(n^O() = 1)$, then the constraint corresponding to $(m_1, n_1, m_2, n_2)$ is $P_{Q'}(O(m_1,n_1,m_2,n_2) = 1) = 1$.
- If $P_Q(m_1^O() = 1 \wedge n_1^O() = 1) P_Q(n_2^O() = 1) < P_Q(m_2^O() = 1 \wedge n_2^O() = 1) P_Q(n^O() = 1)$, then the constraint corresponding to $(m_1, n_1, m_2, n_2)$ is $P_{Q'}(O(m_1,n_1,m_2,n_2) = 1) = 0$.
- If $P_Q(m_1^O() = 1 \wedge n_1^O() = 1) P_Q(n_2^O() = 1) = P_Q(m_2^O() = 1 \wedge n_2^O() = 1) P_Q(n^O() = 1)$, then there is no constraint corresponding to $(m_1, n_1,m_2,n_2)$.

$Q' \in \mathrm{StepWeak}(Q)$ iff $Q'$ satisfies these constraints for all $(m_1, n_1, m_2, n_2)$.

Clearly, each of these constraints is convex, since it picks out some hyperplane.  Their intersection must then also be convex.  So $\mathrm{StepWeak}(Q)$ is convex.

To show that $\mathrm{StepWeak}(Q)$ is nonempty, we need only consider $Q'$ that are fully factorized (i.e. the distinct random variables of the form $O(m_1, n_1,m_2,n_2)$ are independent).  For each $(m_1, n_1,m_2,n_2)$, if there is no constraint then set $P_{Q'}(O(m_1, n_1,m_2,n_2) = 1) = 1/2$.  If there is a constraint, set $P_{Q'}(O(m_1, n_1, m_2, n_2) = 1)$ to the value determined by this constraint.  This yields a $Q' \in \mathrm{StepWeak}(Q)$.

$\square$

_Lemma 2_: The graph of $\mathrm{StepWeak}$ is closed.

_Proof:_

Informally, this is true because each constraint on $(Q, Q')$ is closed.

Let $m_1,n_1,m_2,n_2 \in \mathcal{M}, p \in \mathcal{P}$.  Consider the set of $(Q, Q')$ (not necessarily fully-mixed) satisfying the two constraints:

$$P_Q(m_1^O() = 1 \wedge n_1^O() = 1) P_Q(n_2^O() = 1) > P_Q(m_2^O() = 1 \wedge n_2^O() = 1) P_Q(n^O() = 1) \rightarrow P_{Q'}(O(m_1, n_1, m_2, n_2) = 1) = 1$$

$$P_Q(m_1^O() = 1 \wedge n_1^O() = 1) P_Q(n_2^O() = 1) < P_Q(m_2^O() = 1 \wedge n_2^O() = 1) P_Q(n^O() = 1) \rightarrow P_{Q'}(O(m_1, n_1, m_2, n_2) = 0) = 1$$


It is simple to see that the set of $(Q, Q')$ satisfying the first constraint is closed, because (a) the set of $(Q, Q')$ satisfying the antecedent of the implication is open, (b) the set of $(Q, Q')$ satisfying the consequent of the implication is closed, and (c) the union of two closed sets is closed.  By similar logic, so is the set of $(Q, Q')$ satisfying the second constraint.  If we take the intersection for all $m_1, n_1, m_2, n_2$, the result is still closed, and this is the graph of $\mathrm{StepWeak}$.

$\square$

_Theorem 1:_ For any fully-mixed COD $Q$, $\mathrm{StepWeak}(Q) = \mathrm{StepClosure}(Q) = \mathrm{StepHull}(Q)$.

_Proof:_

Let $Q$ be fully-mixed.  First we will show $\mathrm{StepWeak}(Q) = \mathrm{StepClosure}(Q)$.  By Lemma 2, $\mathrm{StepWeak}$'s graph equals its closure intersected with the set of $(Q, Q')$ for which $Q$ is fully-mixed.  Since $\mathrm{StepClosure}$'s graph is simply the closure of $\mathrm{StepWeak}$'s graph, they coincide on $Q$.

Now we will show $\mathrm{StepClosure}(Q) = \mathrm{StepHull}(Q)$.  By Lemma 1, $\mathrm{StepClosure}(Q)$ is convex, so it equals its convex hull $\mathrm{StepHull}(Q)$.

$\square$

_Theorem 2:_ If a COD $Q$ leads to $Q'$, then it weakly leads to $Q'$.

_Proof:_

Since $\mathrm{StepWeak}$'s graph is closed, and $\mathrm{StepClosure}$'s graph is the closure of a subset of $\mathrm{StepWeak}$'s graph, $\mathrm{StepClosure}$'s graph is a subset of $\mathrm{StepWeak}$'s graph.

Since $\mathrm{StepWeak}(Q)$ is a convex superset of $\mathrm{StepClosure}(Q)$ for all $Q$, it must also be a superset of the convex hull $\mathrm{StepHull}(Q)$.

$\square$

# Proving Theorem 3

Now it is time to show that $\mathrm{StepHull}$ is a Kakutani map.  

_Lemma 3:_ $\mathrm{StepHull}$ has a closed graph.

_Proof:_

Informally, this is true because a limit point of $\mathrm{StepHull}$'s graph is the limit of a convergent sequence of convex combinations of points in $\mathrm{StepClosure}$'s graph (which is closed), which is itself equal to a convex combination of limits of sequences of points in $\mathrm{StepClosure}$'s graph, and $\mathrm{StepClosure}$'s graph is closed.

Trivially, $\mathrm{StepClosure}$ has a closed graph, since its graph is the closure of a set.

Consider a limit point $(Q, Q')$ of $\mathrm{StepHull}$'s graph.  That means we have sequences $\{Q_i\}_i$ limiting to $Q$ and $\{Q'_i\}$ limiting to $Q'$ such that each $Q'_i \in \mathrm{StepHull}(Q_i)$.

Let $k = |{2}^{\mathcal{M}^4}|$.  We consider CODs as elements of $\mathbb{R}^{k}$.  Since each $Q'_i \in \mathrm{ConvexHull}(\mathrm{StepClosure}(Q_i))$, it must
by definition be a finite convex combination of CODs in $\mathrm{StepClosure}(Q_i)$.  We can assume without loss of generality that this is a combination of exactly $k+1$ CODs, by
Carathéodory's theorem.

We will now name these convex combinations.  For each $i$ we have:

- A list ${Q'}_i^1, \ldots, {Q'}_i^{k+1}$, each in $\mathrm{StepClosure}(Q_i)$, and
- weights $\lambda_i^1, \ldots, \lambda_i^{k+1}$, each in $[0, 1]$ and which sum to 1,
- such that each $Q'_i = \sum_{j=1}^{k+1} \lambda^j {Q'}_i^j$.

We may now consider $X_i := {Q'}_i^1, \ldots, {Q'}_i^{k+1}, \lambda_i^1, \ldots, \lambda_i^{k+1}$ as a vector in $\mathbb{R}^{(k+1)^2 + k+1}$.  The sequence of these vectors has a convergent
subsequence by the Bolzano-Weierstrass theorem.

Define ${Q'}^1, \ldots, {Q'}^{k+1}, \lambda^1, \ldots, \lambda^{k+1}$ to be the limit of the convergent subsequence, and also call this full vector $X$.  Let the convergent subsequence be $\{X_i\}_i$.  Since $\mathrm{StepClosure}$'s graph is closed, we must have
each ${Q'}^j \in \mathrm{StepClosure}(Q)$.  Therefore, their convex combination ${Q'}^* := \sum_{j=1}^{k+1} \lambda_j {Q'}^j$ is in $\mathrm{StepHull}(Q)$.  We will now show $Q' = {Q'}^*$.

Consider a function $\alpha(q^1, \ldots, q^{k+1}, \lambda^1, \ldots, \lambda^{k+1}) := \sum_{j=1}^{k+1} \lambda^j q^j$.  Each $Q'_i = \alpha(X_i)$, so clearly $\alpha(X_i)$ limits to $Q'$.  Additionally, $\alpha$ is continuous, so, $\alpha(X_i)$ limits to $\alpha(X) = {Q'}^*$.  Therefore $Q' = {Q'}^*$.

We have at this point demonstrated $Q' \in \mathrm{StepHull}(Q)$, since we already had ${Q'}^* \in \mathrm{StepHull}(Q)$.

$\square$

_Lemma 4:_ For each $Q$, $\mathrm{StepHull}(Q)$ is nonempty and convex.

_Proof:_

$\mathrm{StepHull}(Q)$ is convex since it is the convex hull of a set, so we need only show that it is nonempty.  To do this we will show $\mathrm{StepClosure}(Q)$ is nonempty; this is sufficient since $\mathrm{StepClosure}(Q) \subset \mathrm{StepHull}(Q)$.

Let $Q_0$ be any fully-mixed COD.  For $t \in [0, 1)$, define $\beta(t) := t \cdot Q + (1-t) \cdot Q_0$.  $\beta$ is a curve proceeding from $Q_0$ to $Q$, and every COD in its image is fully-mixed.

Define $Q_i := \beta(1-1/i)$ for natural $i \geq 1$.  Define $Q'_i$ to be an arbitrary COD satisfying $Q'_i \in \mathrm{StepWeak}(Q_i)$; the sequence $\{Q'_i\}_i$ can be defined using the axiom of choice.  By the Bolzano-Weierstrass theorem, $\{Q'_i\}_i$ has a convergent subsequence; let $Q'$ be the limit of this subsequence.  Clearly, $Q' \in \mathrm{StepClosure}(Q)$, since by construction $(Q, Q')$ is a limit point of the graph of $\mathrm{StepWeak}$.  This proves that $\mathrm{StepClosure}(Q)$ is nonempty.

$\square$

The proof of Theorem 3 is now trivial:

_Theorem 3:_ There is a reflective COD.

_Proof:_

$\mathrm{StepHull}$ is a Kakutani map by Lemma 3 and Lemma 4.  Therefore by Kakutani's fixed point theorem, it has a fixed point, i.e. a COD $Q \in \mathrm{StepHull}(Q)$.  By definition $Q$ is reflective.

$\square$