TITLE: Necessary and sufficient conditions for a sum of idempotents to be idempotent
QUESTION [13 upvotes]: Given: a finite list of $n$-by-$n$ idempotent complex matrices $E_1, E_2, \ldots, E_k$.
If all pairwise products $E_i E_j$ (with $i \neq j$) are zero, it is trivial to show the sum $E_1 + E_2 + \cdots + E_k$ is idempotent.
The converse, while true, is not so trivial: If the sum is idempotent, all pairwise products are zero.
I have been told that the converse is well known among
statisticians but I cannot find a reference. Do you know one?

REPLY [12 votes]: The key point is that the image of the sum of the idempotents is necessarily the direct sum of the images of the individual idempotents.
Suppose that $E_1,\ldots,E_k$ are idempotent and $F = \sum E_i$ is idempotent.  Let $R_i$ and $K_i$ be the image and kernel of $E_i$, respectively, and let $R$ be the image of $F$.
The trace of an idempotent equals its rank, so $$\dim R = \mathrm{tr}(F) = \sum \mathrm{tr}(E_i) = \sum \dim R_i.$$  Furthermore $R$ is a subspace of $\sum R_i$ and $\sum R_i$ has dimension at most $\sum \dim R_i$, with equality iff this sum is direct, so we actually have $$R = R_1\oplus \cdots \oplus R_k.$$ Consider a vector $v_1\in R_1$.  By definition $$(v_1,0,\ldots,0) = Fv_1 = (E_1v_1,E_2v_1,\ldots,E_k v_1)$$ with respect to this decomposition.  In other words, $R_1\subset K_i$ for all $i\neq 1$, or $E_i E_1 = 0$ for all $i\neq 1$.  It follows similarly that $E_i E_j = 0$ for all $i\neq j$.