TITLE: Generalized convex combination over a Banach space
QUESTION [9 upvotes]: The Question: Is the following true?  If not, what further hypotheses do I need?

Let $X$ be a Banach space, and let $C \subset X$ be closed and convex.  Let $P$ be a probability measure over $D$, and let $f:D \to X$ with $f(D) \subseteq C$ be $P$-integrable. Then
  $$
\int_D f \,dP \in C
$$

Intuitively, I believe this should be true since it is a sort of "limit" of convex combinations of elements of $C$.  That is, when $P$ is a discrete measure with finitely many atoms, then this is simply the definition of convexity, and I would think that there is some limit by which we can reach integrals with respect to arbitrary measure.
I am not sure, however, how to formalize this argument.  This seems like something that would pop up in some handy reference, or failing that, it at least it seems like a standard kind of argument of which someone here could fill in the blanks.
At the very least, I would be interested in an argument that works in the case that $X = \Bbb R^n$ (or $X = \Bbb C^n$).

REPLY [7 votes]: I'll assume real scalars for convenience.  If $y = \int_D f\; dP \notin C$, then by the Separation Theorem there is $r \in \mathbb R$ and  a continuous linear functional $\phi$ such that
$\phi(y) > r$ while $\phi \le r$ on $C$.  But $\phi(y) = \int_D \phi(f)\; dP \le \int_D r \; dP = r$, contradiction.

REPLY [2 votes]: Assuming whatever sort of integral you're talking about satisfies $$\Lambda\left(\int f\right)=\int\Lambda\circ f\quad(\Lambda\in X^*)$$this is immediate from the Hahn-Banach theorem (the disjoint-convex-sets-one-closed-one-convex version):
https://en.wikipedia.org/wiki/Hahn%E2%80%93Banach_theorem#Geometric_Hahn.E2.80.93Banach_theorem