TITLE: Proof of Hoeffding's Covariance Identity
QUESTION [5 upvotes]: Let $X,Y$
  be random variables such that $\operatorname{Cov}(X,Y)$
  is well defined, let $F(x,y)$
  be the joint-CDF of $X,Y$
  and let $F_X(x),F_Y(y)$
  be the CDF of $X,Y$
  respecitvely. Hoeffding's covariance identity states $$\operatorname{Cov}(X,Y)=\int\limits_{-\infty}^\infty \int\limits_{-\infty}^\infty \left[F(x,y)-F(x)F(y)\right] \, dx \, dy$$
 It can easily be seen that $$[F(x,y)-F(x)F(y)] = \mathbb{P}(X\leq x,Y\leq y)-\mathbb{P}(X\leq x) \mathbb{P}(Y\leq y)
=\mathbb{E}[1_{\{ X\leq x\} }\cdot1_{\left\{ Y\leq y\right\} }] - \mathbb{E}[1_{\{ X\leq x\} }] \mathbb{E}\left[1_{\{ Y\leq y\} } \right] = \operatorname{Cov}\left(1_{\{ X\leq x\} }, 1_{\{ Y\leq y\} }\right)$$
So it would suffice to prove that$$\text{Cov}\left(X,Y\right)=\int\limits _{-\infty}^{\infty}\int\limits _{-\infty}^{\infty}\text{Cov}\left(1_{\left\{ X\leq x\right\} },1_{\left\{ Y\leq y\right\} }\right) \, dx \, dy$$
I haven't manged to prove this but I did manage to prove that $$\operatorname{Cov}(X,Y) = \int\limits_{-\infty}^\infty \int\limits _{-\infty}^\infty \operatorname{Cov}\left(1_{\{ X\geq x\} },1_{\{ Y\geq y\} }\right) \, dx \, dy$$
 I would really appreciate some help getting from the result I did manage to prove to either the original Hoeffding identity or to the equivalent identity in terms of $\operatorname{Cov}(1_{\{ X\leq x\} }, 1_{\{ Y\leq y\} })$.

REPLY [5 votes]: It suffices to observe that the random variables $\mathbb 1_{\{X \le x\}}$ and $\mathbb 1_{\{X \ge x\}}$ are perfectly correlated (except on a set of measure 0).  Specifically, their sum is almost surely 1.  Since the same holds for the indicator for $Y$, it immediately follows that the covariance of $\mathbb 1_{\{X \le x\}}$ and $\mathbb 1_{\{Y \le y\}}$ will be equal to the covariance of $\mathbb 1_{\{X \ge x\}}$ and $\mathbb 1_{\{Y \ge y\}}$.