Assume $X$, $Y$ random variables with joint distribution function $H$ and their respective marginals $F$ and $G$.
I'm trying to show that: $$E|X-Y| = \int_{\mathbb{R}}[F(t) + G(t) - 2H(t,t)]dt $$
My approach: So far I know that
$$ E|X-Y| = \int\int_{\mathbb{R}^2}|x-y| \text{d}H(x,y)$$
from where we can straightforwardly try to reduce the integral to
$$ \int_{-\infty}^{\infty}\int_{-\infty}^{x}(x-y) \text{d}H(x,y) + \int_{-\infty}^{\infty}\int_{x}^{\infty}(y-x) \text{d}H(x,y) $$
However, I'm not sure how to proceed from here, that is, how to think about working with the $\text{d}H(x,y)$ term and how to properly take it out.
Firstly, I'm not even sure if in general case we can take the $h(s,t)$ part out, where $H(x,y) = \int_{-\infty}^{x}\int_{-\infty}^{y}h(s,t)dsdt$, since $X$ and $Y$ are not necessarily continuous? Even if we could, I can't see how to properly proceed.
On the other hand, by going backwards,
$$ E|X-Y| = \int_{\mathbb{R}}[F(t) + G(t) - 2H(t,t)] dt = \int_{-\infty}^{\infty}\left(\int_{-\infty}^{t}dF(s) + \int_{-\infty}^{t}dG(s) - 2\int_{-\infty}^{t} \int_{-\infty}^{t} dH(s,j)\right)dt$$
It also feels like something in the likes of
$$ \int_{-\infty}^{t}dF(s) = \int_{-\infty}^{\infty} \int_{-\infty}^{t}dH(s,j),$$
might hold, but again, I'm not entirely sure how to work with distribution functions when they are in the integral measure part.
Any hints/ideas would be appreciated!
By the very definition of the distribution function, we have
$$\begin{align*} F(t)+G(t)-2H(t,t) &= \mathbb{P}(X \leq t) + \mathbb{P}(Y \leq t) - 2 \mathbb{P}(X \leq t, Y \leq t) \\ &= \bigg( \mathbb{P}(X \leq t, Y \in \mathbb{R}) - \mathbb{P}(X \leq t, Y \leq t) \bigg) \\ &\quad + \bigg( \mathbb{P}(Y \leq t, X \in \mathbb{R}) - \mathbb{P}(Y \leq t, X \leq t) \bigg) \\ &= \mathbb{P}(X \leq t, Y>t) + \mathbb{P}(Y \leq t, X>t)\end{align*}$$
for any $t \in \mathbb{R}$. This implies
$$F(t)+G(t)-2H(t,t) = \mathbb{P} \left( \min\{X,Y\} \leq t, \max\{X,Y\}>t \right). \tag{1}$$
Applying Tonelli's theorem and using the elementary identity
$$|x-y| = \max\{x,y\} - \min\{x,y\}$$
we find
$$\begin{align*} \int_{\mathbb{R}} \mathbb{P}(\min\{X,Y\} \leq t < \max\{X,Y\}) \,dt &= \mathbb{E} \left( \int_{\mathbb{R}} 1_{\{\min\{X,Y\} \leq t < \max\{X,Y\}} \, dt \right) \\ &= \mathbb{E} \left( \int_{\min\{X,Y\}}^{\max\{X,Y\}} \, dt \right) \\ &= \mathbb{E}(\max\{X,Y\}-\min\{X,Y\}) \\ &= \mathbb{E}(|X-Y|); \end{align*}$$
combining this with $(1)$ this proves the assertion.