Problem: Let $N,P \in \mathbb{R}^{n \times n}$ be matrices, and let $P \neq 0$. Suppose that $P = NP$ and that $P$ is diagonalizable. Prove then that $N$ has an eigenspace with dimension greater than or equal to the rank of $P$.
Attempt: Let $E_{\lambda_i}$ be an eigenspace of $N$ corresponding to the eigenvalue $\lambda_i$. Then we have to prove that $\text{rank}(P) \leq \dim(E_{\lambda_i})$. Since $P$ is diagonalizable, there exists an invertible matrix $B$ such that $B^{-1} P B = D$ is a diagonal matrix. We know that the equation $n = \text{rank}(P) + \text{nullity}(P)$ always holds. Now, I tried to relate the rank of $P$ to the rank of $NP$, but I don't know how.
Take the first $m = \text{rank}(P)$ eigenvalues in $D$ to be nonzero. Then
$$ P = NP \Rightarrow BD = NBD \Rightarrow 1 \cdot (b_jd_j) = N (b_jd_j), \; j=1,\ldots,m $$
where $b_j$ is the column $j$ of $B$ and so are independent. This says $N$ has an eigenspace associated with $\lambda = 1$ with at least rank $m$. I'm not sure if you need to explicitly show that it can indeed be strictly greater than $m$. I need to think about that part.