# Is the following matrix diagonalizable over $\mathbb{R}$?

I am getting conflicting answers depending on how I approach the problem and I don't understand why. Let $$A=\begin{pmatrix}2&-5&7\\1&-2&0\\0&0&3 \end{pmatrix}$$. If I go directly to the characteristic polynomial I get $$\det(A-I\lambda)=\det\begin{pmatrix}2-\lambda&-5&7\\1&-2-\lambda&0\\0&0&3-\lambda \end{pmatrix}$$ and then calculating the determinant I get that $$\lambda_1=3, \lambda_{2,3}=\pm i$$.

I then conclude that $$A$$ is not diagonalizable over $$\mathbb{R}$$ as we have non-real eigenvalues.

However if I put $$A$$ into an upper diagonal matrix I have that $$A=\begin{pmatrix}2&-5&7\\0&0.5&-3.5\\0&0&3 \end{pmatrix}$$

I then see the eigenvalues as the entries of our upper diagonal matrix, i.e. distinct and real. Then isn't this representation of $$A$$ diagonalizable? But $$A$$ hasn't changed. What am I misunderstanding?

Thanks

• There should be an error in your upper diagonal similar matrix. – mathcounterexamples.net Dec 8 '20 at 14:01
• "But $A$ hasn't changed": er, $A$ has changed in three elements ! – Yves Daoust Dec 8 '20 at 14:05
• Ok, there is my misunderstanding. Performing elementary row operations does effect $A$. I thought they were "fair game." – Marco Esquandolas Dec 8 '20 at 14:08

Your new matrix is equivalent to $$A$$, but not similar. The latter condition is stronger and required to preserve the Eigenvalues.
The operation you are performing on the matrix $$A$$ is equivalent to pre-multiplying by another elementary matrix $$E$$. Just because $$EA$$ is diagonalizable, does not mean that $$A$$ is. In particular, as you just demonstrated, the eigenvalues of $$A$$ and $$EA$$ are not necessarily the same.
Perhaps a more elementary example of such "innocent" alterations leading to changing eigenvalues are flipping the rows of $$M = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix},$$ which results in the identity matrix. The original matrix $$M$$ has eigenvalues $$-1,1$$ and the resulting identity has only $$1$$ instead (with multiplicity $$2$$)...
That means every matrix of order $$n\times n$$ with rank $$n$$ is diagonalizable. But this is certainly not true. The matrix you got after you row reduced your $$A$$ is not simlar to $$A$$ since there does not exist any invertible $$P$$ such that $$A=PBP^{-1}$$ where $$B$$ is the row reduced version of $$A$$