# Proof of Hoeffding's Covariance Identity

Let $X,Y$ be random variables such that $\text{Cov}\left(X,Y\right)$ is well defined, let $F\left(x,y\right)$ be the joint-CDF of $X,Y$ and let $F_{X}\left(x\right),F_{Y}\left(y\right)$ be the CDF of $X,Y$ respecitvely. Hoeffding's covariance identity states $$\text{Cov}\left(X,Y\right)=\int\limits _{-\infty}^{\infty}\int\limits _{-\infty}^{\infty}\left[F\left(x,y\right)-F\left(x\right)F\left(y\right)\right]dxdy$$ It can easily be seen that $$\left[F\left(x,y\right)-F\left(x\right)F\left(y\right)\right]=\mathbb{P}\left(X\leq x,Y\leq y\right)-\mathbb{P}\left(X\leq x\right)\mathbb{P}\left(Y\leq y\right) =\mathbb{E}\left[1_{\left\{ X\leq x\right\} }\cdot1_{\left\{ Y\leq y\right\} }\right]-\mathbb{E}\left[1_{\left\{ X\leq x\right\} }\right]\mathbb{E}\left[1_{\left\{ Y\leq y\right\} }\right]=\text{Cov}\left(1_{\left\{ X\leq x\right\} },1_{\left\{ Y\leq y\right\} }\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)dxdy$$ I haven't manged to prove this but I did manage to prove that $$\text{Cov}\left(X,Y\right)=\int\limits _{-\infty}^{\infty}\int\limits _{-\infty}^{\infty}\text{Cov}\left(1_{\left\{ X\geq x\right\} },1_{\left\{ Y\geq y\right\} }\right)dxdy$$ 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 $\text{Cov}\left(1_{\left\{ X\leq x\right\} },1_{\left\{ Y\leq y\right\} }\right)$ .

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\}}$.
• Technically, the event $\{X=x\}$ need not have measure $0$. For instance, the statement applies equally well to discrete random variables. – pre-kidney Jan 17 '16 at 7:14
• @pre-kidney I was only proceeding from the result that the asker of the question originally obtained. In fact, if the integrand had been $\operatorname{Cov}[\mathbb 1_{\{X > x\}}, \mathbb 1_{\{Y > y\}}]$, then my response would hold rigorously. – heropup Jan 17 '16 at 7:23