Let $X$ and $A$ be compact Polish spaces endowed with Borel $\sigma$-algebras. Let $\mathcal{A} = X\times \mathcal{B}(A)$ be the $\sigma$-algebra consisting of cylinders whose projections on $A$ are Borel sets. Let $u: X\times A\rightarrow\mathbb{R}$ be a continuous function. Let $\pi\in \Delta(X\times A)$ be a probability measure.


Let $\mathcal{F}\equiv \{f:A\rightarrow A|\;f \text{ is } \mathcal{A} \text{ measurable}\}$ denote the collection of all measurable functions from $A$ to $A$.


**Question:** Is it true that
$$\sup\_{f\in \mathcal{F}}\int\_{X\times A} E \big[u\big(x,f(a)\big) \big| \mathcal{A}\big] d\pi(x,a) = \int\_{X\times A}\; \sup\_{f\in \mathcal{F}}E \big[u\big(x,f(a)\big) \big| \mathcal{A}\big] d\pi(x,a)?$$


**An economic interpretation:** As Michael Greinecker pointed out in the comment, if we interpret $u$ as the a payoff function, $x\in X$ as an unknown state, $a\in A$ as an action, and $\pi$ as a system of stochastic action recommendations, then the claim I am trying to establish can be interpreted as saying that *choosing an optimal contingent plan ex ante leads to the same expected utility as maximizing for each recommended action at the interim stage*.




---




---


**My thoughts so far:**


My first instinct is to invoke the Measurable Selection Theorem, which would be similar to the arguments in Theorem 14.60 of Rockafella and Wets' "Variational Analysis". However, I do not know how to work with the conditional expectations in the expression above, which is itself a random variable that is only unique almost surely.


Specifically, to use the Measurable Selection Theorem as Rockafellar and Wets did, I would need to somehow establish that
$$
\Big\{k: E \big[u\big(x,k\big) \big| a\big] \ge c \Big\}
$$
is a closed set for each $a\in A$ and $c\in \mathbb{R}$, but I'm not sure why that would be true, especially since conditional expectation is only pinned down for **almost all** $a\in A$.


Any pointers would be greatly appreciated!



Conditional expectation: commuting integration and supremum
Note: This answer used to be a counterexample that missed the mark.


The way to get around he definitional issues with conditional expectations is to work with [regular conditional probabilities in product form](https://doi.org/10.1214/aop/1176993081), which guarantee that all conditional expectations fit together well. In particular, there exists a measurable function (or a transition probability, essentially the same thing) $\kappa:A\to X$ such that for $\pi\_A$ the $A$-marginal of $\pi$, we have
for every Borel set $E\subseteq X\times A$ that
$$\pi(E)=\int\int 1\_E(x,a)~\mathrm d\kappa\_a(x)~\mathrm d\pi\_A(a).$$
The function $\kappa$ is unique up to $\pi\_A$-null sets.


That way, one can show that
$$\max\_{f\in \mathcal{F}}\int\_{X\times A} u\big(x,f(a)\big)~\mathrm d\pi(x,a) =\max\_{f\in \mathcal{F}}\int\_A \int\_X u\big(x,f(a)\big)~\mathrm d\kappa\_a(x) ~\mathrm d\pi\_A(a)$$ $$= \int\_A \max\_{f\in \mathcal{F}} \int\_X u\big(x,f(a)\big)~\mathrm d\kappa\_a(x) ~\mathrm d\pi\_A(a).$$
The left side is trivially no larger than the right side. For the other direction, you show that the correspondence that associates to each $a$ the argmax of $\int\_X u\big(x,\cdot\big)~\mathrm d\kappa\_a(x)$ is measurable with nonempty compact values. So you can use the Kuratowski-Ryll-Nardzewski measurable selection theorem to turn a solution for the problem on the right to a solution of the problem on the left, which must, therefore, give the same value.


The argument does not require $X$ to be compact, any Polish space will do, and $u$ need not be continuous in $X$, any bounded (or integrably bounded) Carathéodory function will do.


