Let $A$ and $B$ be $n\times n$ real matrices such that $A^2=A$ and $B^2=B$. Suppose that $I-(A+B)$ is invertible . Show that $\operatorname{Rank}(A)=\operatorname{Rank}(B)$.
I proceed in this way: Note that $A(I-(A+B))=A-A^2-AB=A-A-AB=-AB$ and similarly $B(I-(A+B))=-AB$. So $A(I-(A+B))=B(I-(A+B))$. Since $I-(A+B)$ is invertible we get $A=B \Rightarrow \operatorname{Rank}(A)=\operatorname{Rank}(B)$.