Probability/Decision- infimum over set of expectations (can be interpreted as decision problem) Let $X$ be a random variable over $\mathbb{R}$ with finite first moment (mean). Let $H$ be a piecewise function defined such that $H_a=c_1(x-a)$ for $x>a$, and $H_a=c_2(a-x)$ for $x<a$, with $c_1,c_2>0$.
Let $a'$ be a number such that $P(X<a')=c_1/(c_1+c2)$, and $\mathbb{P}(X>a')=c_2/(c_1+c_2)$. 
Why is $\inf_{a\in\mathbb{R}} \mathbb{E}  [H_a] = \mathbb{E}[H_{a'}]$?
What I have tried: I am trying to exploit some property of the expected value in order to nicely evaluate the expected value (for fixed $a$) $$\mathbb{P}(X> a)\cdot \mathbb{E}_{X> a}[H_a] + \mathbb{P}(X< a)\cdot \mathbb{E}_{X< a}[H_a].$$ But is there some nice property we can exploit here?
What else I tried: Take the case where $c_1=c_2$. Then one can prove that $a'$ is the median and see the equality by a definition of the median, since $\mathbb{E}  [H_a]=\mathbb{E}[|X-a|],$ which is minimized by the median, defined by $P(X<a')=\frac12$.
But how to generalize...I wonder if we can do some transformation of $Z$ in the general case to reduce to the case where these constants are the same?
Are there similar results for different quartiles (not just the median?)
 A: Express the expectation as a Lebesgue-Stieltjes integral (relative to the cumulative distribution function $F$), break it into two pieces at $x=a$, and integrate by parts:
$$\eqalign{
\mathbb{E}_F(H_a)& = \int_{\mathbb R} H_a(x) dF(x) = -c_2\int_{-\infty}^a (x-a)dF(x) + c_1\int_a^\infty (x-a) dF(x)\\
& = c_2\int_{-\infty}^a F(x) dx - c_1 \int_a^\infty (1-F(x)) dx.
}$$
This requires $\lim_{x\to -\infty}x F(x)= \lim_{x\to \infty}x (1-F(x))= 0$, but both of those are implied by the assumption that $F$ has a finite mean.
This is evidently differentiable with derivative
$$\frac{d \mathbb {E} _F(H_a)}{da} = c_2 F(a) - c_1(1-F(a)) =  -c_1 + (c_2+c_1)F(a).$$
The only critical point besides $\pm \infty$ is where $F(a) = c_1/(c_1+c_2)$; if such a point exists, you can check that it is a global minimum.  (If $F$ has a discrete jump at $a$ which passes over $c_1/(c_1+c_2)$, you can draw the same conclusion by observing that $\mathbb{E}_F(H_a)$ increases on $[a,\infty)$ and decreases on $(-\infty, a)$.)

Here is a quick demonstration that a finite expectation implies the integration by parts step was valid.  Two such integrations were done: one for negative values of $x-a$ and another for positive values of $x-a$.  The latter is obtained in the same way as the former, and neither depends on the specific value of $a$ (just change variables to $y=x-a$), so let's focus on integrating $xdF(x)$.
By definition, a finite expectation means that both $\int_{-\infty}^0 |x| dF(x)$ and  $\int_0^{\infty}x dF(x)$ are finite.  The infinite lower bound is attained by setting it to $t$ and letting $t\to-\infty$.  Integrating this finite integral by parts, which is not-problematic, yields
$$\int_{-\infty}^0 |x| dF(x) = \lim_{t\to-\infty} \int_t^0\left(F(x)-F(t)\right)dx.$$
This integral is represented by the (blue) area $I$ in the figure.

The limiting area of $I$, as $t\to-\infty$, is the total area $I+II+III$ because $F(t)\to 0$.  But this finite area clearly is just $\int_{-\infty}^0 F(x)dx$, QED.
