If $A$ and $B$ are orthogonal projection matrices, show that
$$ \operatorname{tr} (AB) \le \operatorname{rank} (AB) $$
I was using the Cauchy-Schwarz inequality to get
$$\operatorname{tr} (AB) \le \sqrt{\operatorname{tr} \left( A^2 \right) \operatorname{tr} \left(B^2\right)}$$
and I know that $\operatorname{tr}\left(A^2\right)= \operatorname{rank} (A)$, but I can't get the rank of $AB$.