I am writing notes for a reading class and I've decided to add a proof of Cochran's theorem in order to show that a statistic is $\chi^2$. I am struggling for the proof of a particular lemma but the rest is just peachy.
Lemma: Let $A$ be a real real symmetric idempotent matrix of order $n$ with rank $r$. Suppose $A=A_1+\cdots+A_k$ with rank $A_i = r_i$ and $A_i$ symmetric. Additionally, $r_1+\cdots+r_k=r$. Then each $A_i$ is idempotent.
I've been really struggling with this. It seems fairly obvious that $A_i$ gives an orthogonal decomposition of $A$. I've tried a lot of methods, looking at $A$'s and $A_i'$s spectral decomposition so I can show that the eigenvalues of $A_i$ must be $1$. Tried showing that $A_iA_j =0$ for $i$ not equal to $j$.