Let $A$ be an $n\times n$ matrix and $B$ be an $m\times m$ matrix. Let P be a $n\times m$ matrix with independent columns$:AP=PB$. Prove that spectrum of $A$ and $B$ are same.
My attempt:-
Let $\lambda \in \text{spec}{A}\implies \exists x\in \mathbb R^n:x\ne 0$ and $Ax=\lambda x$. We need to prove $\lambda \in \text{spec}{B}$. We have $AP=PB.$ If P would be some invertible matrix then I can prove the result easily. Here I got stuck. Please help me.
For $m=n$, this is true (as you well know). For $m \neq n$, we have $\operatorname{spec} B \subseteq \operatorname{spec} A$, but the reverse inclusion may be false.
For instance, consider $$A = \left[\begin{matrix}1 & 0 \\ 0 & 2\end{matrix}\right], \qquad B = [1],\qquad P = \left[\begin{matrix}1 \\ 0\end{matrix}\right]$$
Then $2 \in \operatorname{spec}A \setminus \operatorname{spec}B$