I'm trying to prove Hoffding's identity and I have trouble proving $2Cov(X_1,X_2)=E[(X-\bar{X_1})(X_2-\bar{X_2})]$. Where $\bar{X_1}$ and $\bar{X_2}$ are the independent copy of $X_1$ and $X_2$. Note $X_1$ and $X_2$ are not independent.
Here is the proof: $$2Cov(X_1,X_2)=E[(X_1-E[X_1])(X_2-E[X_2])]+E[(\bar{X_1}-E[\bar{X_1}])(\bar{X_2}-E[\bar{X_2}])]$$ $$=E[X_1X_2-X_1E[X_2]-X_2E[X_1]-E[X_1]E[X_2]]+E[\bar{X_1}\bar{X_2}-\bar{X_1}E[\bar{X_2}]-\bar{X_2}E[\bar{X_1}]-E[\bar{X_1}]E[\bar{X_2}]]$$ $$=E[X_1X_2-X_1\bar{X_2}-X_2\bar{X_1}+\bar{X_1}\bar{X_2}]$$ $$=E[(X-\bar{X_1})(X_2-\bar{X_2})]$$ What I don't understand is from the second equation to the third equation. Please help!
The calculation contains some errors. It should be
$$\begin{aligned}2Cov(X_1,X_2)&=E[(X_1-E[X_1])(X_2-E[X_2])]+E[(\bar{X_1}-E[\bar{X_1}])(\bar{X_2}-E[\bar{X_2}])] \\&=E[X_1X_2-X_1E[X_2]-X_2E[X_1]+E[X_1]E[X_2]] \\&+E[\bar{X_1}\bar{X_2}+\bar{X_1}E[\bar{X_2}]-\bar{X_2}E[\bar{X_1}]+E[\bar{X_1}]E[\bar{X_2}]] \\&=E[X_1X_2]-E[X_1]E[X_2]+E[\bar{X_1}\bar{X_2}]-E[\bar{X_1}]E[\bar{X_2}] \end{aligned}$$
Need to show $E(X_1)E(X_2)+E(\bar{X}_1)E(\bar{X}_2)=E(X_1\bar{X}_2)+E(\bar{X}_1X_2).$ By the assumption $X_1,\bar{X}_2$ and $X_2,\bar{X}_1$ are independent. So $$E(X_1\bar{X}_2)=E(X_1)E(\bar{X}_2)=E(X_1)E(X_2)$$ since $\bar{X}_2$ is a copy of $X_2$. Similarly, $E(\bar{X}_1X_2)=E(\bar{X}_1)E(\bar{X}_2).$ This gives the third step.