TITLE: Necessary condition for have same rank
QUESTION [5 upvotes]: 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.

REPLY [5 votes]: Since $I-P-Q$ is invertible by assumption, we have 
$$rank(P)=rank(P(I-P-Q))\mbox{ and }rank(Q)=rank((I-P-Q)Q).$$
On the other hand, we have 
$$P(I-P-Q)=P-P^2-PQ=-PQ$$
since $P^2=P$, and 
$$(I-P-Q)Q=Q-PQ-Q^2=-PQ$$
since $Q^2=Q$. Combining all these, we have
$$rank(P)=rank(-PQ)=rank(Q).$$

REPLY [3 votes]: 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.