Given matrices such that $A^{2} = A$, $B^{2} = B \,\ $and matrix $\,\ \mathbf{I} - (A + B)$ which is invertible. Prove that $rk(A) = rk(B)$.
What I tried to do is the following:
Let $C = \mathbf{I} - (A + B)$ $\implies$ $rk(CC^{-1})$ = rk($\mathbf{I}$) $\leq$ $rk(C)$ (*)
(*) Here I used the idea: $rk(AB)$ $\leq$ $min(rk(A), rk(B))$
Since $rk(C)$ $\leq$ $rk(\mathbf{I}) - rk(A) - rk(B)$
Hence, $rk(\mathbf{I})$ $\leq$ $rk(\mathbf{I}) - rk(A) - rk(B)$ $\implies$ $rk(A)$$+rk(B)$ $\leq$ $0$
But since each rank is non-negative then the last inequality is true when each rank is zero.
I wonder if this is a valid proof because I have a slight doubt but everything seems legit, so please, if it is not give a hint.
If everything's ok do you see another way of proving? As I am a self-learner, it would be great if you share!
For $0\ne v\in\operatorname{im}(A)$, we have $Av=v$ and thus $Cv=-Bv$. As $V$ is invertible, we conclude that $Bv\ne0$. So $\operatorname{im}(A)$ has trivial intersection with $\ker(B)$. Likewise, $\operatorname{im}(B)$ has trivial intersection with $\ker(A)$. Conclude.
Alternative computation for the first step: Assume $v\in\operatorname{im}(A)\cap \ker(B)$. So $Bv=0$ and $v=Aw$ for some $w$. Then $$Cv=Iv-Av-Bv=Aw-A^2w-0=0. $$