When do maximum and expectation commute? Hi, I'm looking for conditions on $G(t,x)$ such that
$$
\sup\limits_{t\in [0,1]}E[G(t,X)]=E[\sup\limits_{t\in [0,1]}G(t,X)]
$$
where $X$ is a random variable (it's easy to see that $\sup\limits_{t\in [0,1]}E[G(t,X)]\leq E[\sup\limits_{t\in [0,1]}G(t,X)]$).
Any suggestion or reference is greatly appreciated!
 A: *

*The equality holds if $G(t,x) = f(t) + g(x)$.

*If $G(t,x) = f(t) g(x)$, then
$$E(\sup(G(t,X))=\sup f(t) E(g(X)1_{g(X)\geq0}) + \inf f(t) E(g(X)1_{g(X)<0})$$
and
\begin{equation}
\sup E(G(t,X)) =
\begin{cases}
E(g(X)) \sup f(t) & \text{ if }  E(g(X)) \geq 0 \newline
E(g(X)) \inf f(t) & \text{ if }  E(g(X)) < 0 \end{cases}
\end{equation}
So the equality holds if $g(X) \geq 0$ a.s. or $g(X) \leq 0$ a.s.
A: This will require very strong conditions on $G$. The most general result I know of is an "almost upward-filtering" condition: Assume $G(t,\cdot)$ is measurable for each $t \in [0,1]$, and $\sup_{t \in [0,1]}\mathbb{E}[G(t,X)] < \infty$; then
$$
\sup_{t \in [0,1]}\mathbb{E}[G(t,X)] = \mathbb{E}[\text{ess}\sup_{t \in [0,1]}G(t,X)]
$$
if and only if for all $\epsilon > 0$ and $r,s \in [0,1]$ there exists $t \in [0,1]$ such that
$$
\mathbb{E}[(G(t,X) - G(s,X) \vee G(r,X))^-] \le \epsilon.
$$ I believe this result is originally due to J.A. Yan, in the hard-to-find paper "On the commutability of essential infimum and conditional expectation operators" and has since become become fairly well-known in the stochastic control literature.
Note: $\sup_{t \in [0,1]}G(t,X)$ need not be measurable, which is why the essential supremum is used in the aforementioned theorem.
A more transparent condition can be derived from the above if we add a continuity assumption: Assume $G(\cdot,x)$ is continuous for each $x$, $G(t,\cdot)$ is measurable for each $t$, and  $\sup_{t \in [0,1]}\mathbb{E}[G(t,X)] < \infty$. Then $\sup_{t \in [0,1]}\mathbb{E}[G(t,X)] = \mathbb{E}[\sup_{t \in [0,1]}G(t,X)]$ if and only if there exists $T \in [0,1]$ such that $G(T,X) = \sup_{t \in [0,1]}G(t,X)$ almost surely.
PROOF: The continuity assumption guarantees that $\sup_{t \in [0,1]}G(t,X)$ is indeed measurable (e.g. by Theorem 18.19 of Aliprantis & Border), and thus
$$
\text{ess}\sup_{t \in [0,1]}G(t,X) = \sup_{t \in [0,1]}G(t,X).
$$
The aforementioned theorem and a simple argument using compactness of $[0,1]$ and Fatou's lemma shows that (under our assumptions)
$$
\sup_{t \in [0,1]}\mathbb{E}[G(t,X)] = \mathbb{E}[\sup_{t \in [0,1]}G(t,X)]
$$ if and only if for all
$$
\mbox{$r,s \in [0,1]$ there exists $t \in [0,1]$ such that $G(t,X) \ge G(r,X) \vee G(s,X)$ a.s.}
$$
Since the "if" part is trivial, we now prove the "only if". Consider the set $S := \{G(t,X) : t \in [0,1]\}$ with the partial order given by almost sure inequality. Compactness of $[0,1]$ and continuity of $G(\cdot,x)$ for all $x$ yield the existence of an upper bound in $S$ for any chain of $S$, and thus by Zorn's lemma $S$ contains a maximal element. That is, there exists $T \in [0,1]$ such that there is no $s \in [0,1]$ for which
$$
\mbox{$G(s,X) \ge G(T,X)$ a.s. and $P(G(s,X) > G(T,X)) > 0$.}
$$
For any $t \in [0,1]$ there exists $r \in [0,1]$ such that
$$
G(r,X) \ge G(T,X) \vee G(t,X) \ge G(T,X) \mbox{a.s.}
\,,
$$ which implies $G(r,X) = G(T,X)$ a.s. and thus $G(T,X) \ge G(t,X)$ a.s.. Hence $G(T,X) \ge G(t,X)$ a.s. for any $t \in [0,1]$. $\blacksquare$
