Necessary condition for have same rank Let $P,Q$ real $n\times n$ matrices  such that $P^2=P$ , $Q^2=Q$ and $I-P-Q$ is an invertible matrix.
Prove that $P$ and $Q$ have the same rank.
Some help with this please , happy year and thanks.

Let $V$ be the vector space on which all these matrices act. First, note that $V = P(V) \oplus (I-P)V$ (and in fact, $P(V) = \ker (I-P),$ $(I-P)V = \ker P.$ Similarly for $Q$ instead of $P.$
Now, notice that the third condition states that for no vector is it true that $(I-P)v = Q v.$ This means that $\dim Q (V) \leq \dim P(V).$ But by a symmetric argument, $\dim P(V) \leq \dim Q(V).$ So, $\dim Q(V) = \dim P(V).$ Now the result follows, since the rank of $P$ (or $Q$) is equal to the dimension of the image.
