Jensen's for continuous convex combinations Let $d_p(u(x), v(x)) = \left( \int_0^m \left| u(x)-v(x) \right|^p dx \right)^{1/p}$ be the distance according to the $\ell_p$ norm of two functions $u,v:[0,m]\to [0,M]$. Is the following true for the distance of a continuous convex combination to some (fixed) set of functions $S$?
$$ \inf_{g\in S} d_p\left( \int_0^m w(y) f(x,y) dy, g(x) \right) \leq \int_0^m w(y) \inf_{g\in S} d_p\left( f(x,y), g(x) \right) dy $$
where $w(y) \geq 0,\ \forall y\geq 0,\ \int_0^m w(y) dy = 1$
My intuition tells me that some version of Jensen should make this true, but I'm not sure to what extent it matters that we're in infinite-dimensional spaces. I'm willing to assume that all the infimums here exist and are finite, all integrals converge, etc.
 A: The main result won't hold in general, but a weaker result will hold. This weaker inequality is, in fact, a direct application of Jensen's inequality, and can be stated as follows:
$$\inf_{g\in S}\left\{d_p\left(\int_0^m w(y)f(x,y)dy, g(x)\right)\right\} \leq \inf_{g\in S}\left\{\int_0^m w(y)d_{p}(f(x,y), g(x))dy\right\}$$
Proving the original inequality does not hold
Consider the functions given by $w(y)=\frac{1}{m}$, $f(x,y)=\sin(x(y+1))$ and $S=\{g_z(x)=\sin(x(z+1)), 0\leq z\leq m\}$.
For any fixed $y\in(0,m)$ we have that $$d_p(f(x,y),g_y(x))=0$$ so we can conclude that $$\inf_{g\in S}\{d_p(f(x,y),g(x))\}=0$$ and in particular $$\int_0^m w(y) \inf_{g\in S}\{d_p(f(x,y),g(x))\} dy=0$$
However, it turns out that
$$\int_0^m w(y) f(x,y) dy = \frac{-\cos(x(y+1))}{mx}\bigg|_{y=0}^{y=m}=\frac{\cos(x)-\cos((m+1)x)}{mx}$$
The map
$$z\mapsto \left(\int_0^m \left|\frac{\cos(x)-\cos((m+1)x)}{mx} \sin(x(z+1))\right|^p dx\right)^{\frac{1}{p}}$$
is continuous so it will achieve a minimum over $[0,m]$ which is compact. Since the function $$x\mapsto \left|\frac{\cos(x)-\cos((m+1)x)}{mx} \sin(x(z+1))\right|^p$$ is continuous and for every fixed $z$ there will exist some $x$ such that it is strictly positive, none of the integrals are zero. Then the minimum is strictly positive, and we have that
$$\inf_{g\in S}\left\{d_p\left(\int_0^m w(y)f(x,y)dy, g(x)\right)\right\} = \\ \min_{z\in[0,m]} \left\{\left(\int_0^m \left|\frac{\cos(x)-\cos((m+1)x)}{mx} \sin(x(z+1))\right|^p dx\right)^{\frac{1}{p}} \right\} > \\ 0 = \int_0^m w(y) \inf_{g\in S}\{d_p(f(x,y),g(x))\} dy$$
which disproves the inequality in the general case.
As to some intuition as to how I came up with the counterexample, it seemed that $\inf$ being over every $g\in S$ inside the integral gave way too much freedom to approximate $f$ - a luxury that each particular function $g$ wouldn't have while approximating $\int_0^m w(y)f(x,y)dy$. This led me to choose a class of functions similar to $f$, in order to ensure the infimum always equaled zero, but complex enough so that the approximations would always differ by some margin. Then, I tampered around with increasingly complex functions ($x+y$ didn't work as the infimum was achieved, $\sin(xy)$ didn't work for the same reason as when $y=0$ then $\sin(xy)=0$, and then $\sin(x(y+1))$ which fixed this problem) until I found these ones which seemed to do the trick.
Proving the weaker result
Since $w\geq 0$, $\int_0^m w(y)dy=1$, we have that $w$ is the probability density function for a probability measure $\mu_w$ in $[0,m]$. Due to the Radon Nikodym theorem, we have that $$\int_0^m w(y)f(x,y)dy = \int_0^m f(x,y)d\mu_w(y) = \mathbb{E}_{\mu_w}[f(x,Y)]$$ for each $x\in [0,m]$.
Now, let $d_{p,g}(h)=d_p(h,g)$ and then $d_{p,g}$ is a convex function. We will have that by Jensen's inequality:
\begin{align*}
d_p\left(\int_0^m w(y)f(x,y)dy, g(x)\right) &= d_{p, g}\left(\int_0^m w(y)f(x,y)dy\right) \\
&= d_{p, g}\left(\int_0^m f(x,y)d\mu_w(y)\right) \\
&\leq \int_0^m d_{p,g}(f(x,y))d\mu_w(y) \\ 
& = \int_0^m w(y)d_{p}(f(x,y), g(x))dy 
\end{align*}
Then we can conclude that:
\begin{align*}
\inf_{h\in S}\left\{d_p\left(\int_0^m w(y)f(x,y)dy, h(x)\right)\right\}&\leq d_p\left(\int_0^m w(y)f(x,y)dy, g(x)\right) \\
&\leq \int_0^m w(y)d_{p}(f(x,y), g(x))dy
\end{align*}
for every $g\in S$, so in particular:
\begin{align*}
\inf_{g\in S}\left\{d_p\left(\int_0^m w(y)f(x,y)dy, g(x)\right)\right\}&\leq\inf_{g\in S}\left\{\int_0^m w(y)d_{p}(f(x,y), g(x))dy\right\}
\end{align*}
as we wished to prove.
