Can matrices be ‘similar’ (or conjugate) by nonzero non-invertible matrix

linear algebramatricessimilar matrices

Let $A,B \in \mathbb R^{n \times n}$.

$A$ and $B$ are similar if there exists $P \in GL(n, \mathbb R)$ such that $AP=PB$.

While we could define something like we can define something like

$A$ and $B$ are 'conjugate' if there exists $P \in \mathbb R^{n \times n}$ such that $AP=PB$,

this would be kind of pointless since we could always pick $P=0$. Of course there are definitions for $A$ and $B$ to be 'conjugate in $X$' for some $X \subseteq \mathbb R^{n \times n}$ (or $X \subseteq GL(n, \mathbb R)$) if there exists $P \in X$ such that $AP=PB$, like here.

Question 1: Is it possible that $AP=PB$ for some nonzero yet non-invertible $P$? I have a feeling I'm missing some obvious counterexample. If no, then please help me prove that $P$ must either be zero or invertible.

Question 2: If yes, then I have a feeling there are infinitely many such $P$'s for any given $A$ and $B$. Is it true that for every $A$ and $B$, there exists such a $P$?

  • Context: Bullet 3.1 here

Best Answer

As the other answer shows, it is possible that $AP=PB$ for some nonzero yet non-invertible $P$, and it is also possible to find matrices $A,B$ that a non-invertible, non-zero solution $P$ exists, yet no invertible solution $P$ exists.

If yes, then I have a feeling there are infinitely many such $P$'s for any given $A$ and $B$. Is it true that for every $A$ and $B$, there exists such a $P$?

The answer is no; but we can be a bit more thorough than that. The $P$'s that you are looking for are the solutions to the Sylvester equation $$ AP + P(-B) = 0. $$ This equation will have infinitely many solutions if and only if $A$ and $B$ have a common eigenvalue. More specifically, if $\lambda \in \Bbb C$ is such that $Ax = \lambda x$ and $B^Ty = \lambda y$, then the matrix $P = xy^T$ (and its multiples) are solutions to this equation.

Of course, an invertible solution $P$ exists if and only if $A,B$ are similar. So, a necessary (but insufficient) condition for the existence of an invertible solution is that $A$ and $B$ have identical eigenvalues with identical (algebraic) multiplicites. If all eigenvalues have multiplicity $1$, then the condition also becomes sufficient.