Let $\mu$ prob measure on $\mathbb{R}$ and F the associated cumulative distribution function.
I found the formula $\int_{\mathbb{R}} F(x)(1-F(x)) dx \, =
\, \int_{\mathbb{R}}\int_{\mathbb{R}}|x-y|d\mu(x)d\mu(y) $
in a paper that I am studying but I cannot prove it.
Does anyone know how to do it ? Any hint/idea is appreciated.
\begin{align} \int_{\mathbb{R}} F(t) (1-F(t)) \, dt &= \int_{\mathbb{R}} \int_{\mathbb{R}} 1_{x \le t} \, d\mu(x) \int_{\mathbb{R}} 1_{y > t} \, d\mu(y) \, dt \\ &= \int_{\mathbb{R}} \int_{\mathbb{R}} \int_{\mathbb{R}} 1_{x \le t < y} \, dt \, d\mu(x) \, d\mu(y) \\ &= \int_{\mathbb{R}} \int_{\mathbb{R}} (y-x) 1_{y \ge x} \, d\mu(x) \, d\mu(y) \end{align}