# Is the following set of real square matrices dense: Those that can be diagonalised by a square root of the identity

It's well known that the following set of real square matrices is dense: those matrices $$M$$ for which there exists an invertible matrix $$P$$ such that $$P M P^{-1}$$ is diagonal. My question is can this statement be strengthened so that $$P = P^{-1}$$?

The motivation for this question comes from the spectral theorem, whose statement is: Given a matrix $$M$$ such that $$M = M^T$$, there exists a matrix $$P$$ such that $$P M P^{-1}$$ is diagonal and $$P P^T = I$$. I'm wondering what happens if you drop the transpose operation. The resulting statement is clearly false, but the question remains "how true" it is.

Note that the set of matrices $$P$$ such that $$P=P^{-1}$$ is the same as the set of matrices that are diagonalisable and whose eigenvalues are $$\pm 1$$.

No

Consider $$2\times2$$ matrices $$M$$ whose eigenvalues are not real (they form an open set). The eigenvalues are complex conjugate, as well as the eigenvectors. If $$M=P^{-1}DP$$, then the columns of $$P$$ are eigenvectors, thus $$P=\begin{pmatrix} aw & b\bar w \\ a z & b\bar z \end{pmatrix}.$$ Writing $$P^2=I_2$$ gives you that $$wz$$ is real, which is unlikely.

• This answer boils down to the claim that the following set is non-empty and open: $\Omega = \{M \in M_2(\mathbb R) \mid \Delta(\chi_M) < 0 \text{ and } \forall z \in S^1. \forall k \in [0,1]. M(z,k\bar z)^T \times (z, k\bar z)^T \neq 0\}$, where $\chi_M$ denotes the characteristic polynomial of $M$, $\Delta$ denotes the discriminant, $S^1$ denotes the set of unit complex numbers, and $\times$ denotes the cross product (for detecting non-parallelism). By the argument above, no element of $\Omega$ can be diagonalised by a square root of the identity
• The set is $\Omega$ is clearly non-empty because $M = \begin{pmatrix} 0 & 1 \\ -1 & 0\end{pmatrix}$ is an element of it. But I'm not sure how you show it's open. (By the way, there is a language called Abstract Stone Duality in which one can prove that this set is open, but this is not widely known)
• $F(M) := \Delta(\chi_M)$ is a polynomial in the entries of $M$, right? You can write it down. So clearly $F$ is continuous, and thus the set $F^{-1}((-\infty, 0))$ is open. Nov 8, 2020 at 16:13
• @NateEldredge I'm actually concerned with the "$\forall z \in S^1. \forall k \in [0,1]. M(z,k\bar z)^T \text{ not parallel to } (z, k\bar z)^T$" bit. (Sorry, edited a bit)
• A follow-up question is what happens if we replace $\mathbb R$ with $\mathbb C$. The above argument doesn't work any more