TITLE: Nonnegativity of the determinant of a commuting matrix
QUESTION [6 upvotes]: Let $A\in M_n(\mathbb{R})$ such that $A^2=-I_n$ and $AB=BA$ for some $B\in M_n(\mathbb{R})$. Prove that $\det(B)\geq0$.

All the information I could extract from the relation $A^2=-I_n$ are as follows:
$(a)$ $A$ is not diagonalizable.
$(b)$ $\det(A)=1$.
$(c)$ $n$ must be even.
Now how to conclude that $\det(B)$ is nonnegative using these $3$ informations alongwith $AB=BA$ is not clear to me. Any help is appreciated.

REPLY [2 votes]: Since $A^2=-Id$, its eigenvalues are $\pm i$. So $A$ does not have a real eigenvector.
By contradiction assume that $\det(B)<0$. Hence $B$ has a negative eigenvalue
$\lambda_1$. (Since the complex eigenvalues of $B$ come in conjugate pairs, if the real eigenvalues of $B$ are non negative  then $\det(B)$ would be non negative too).
Let $v\in \mathbb{R}^n$ be such that $Bv=\lambda_1 v$. So $ABv=\lambda_1 Av$. Thus, $BAv=\lambda_1 Av$.
Since $Av,v$ are linearly independent (A does not have a real eigenvector) and $A$ leaves invariant span$\{v,Av\}$ then there is an invertible real matrix $P_1$ such that
$P_1BP_1^{-1}=\begin{pmatrix}\lambda_1 Id_{2\times 2} & C_{2 \times n-2} \\
0_{n-2\times 2} & (B_1)_{n-2\times n-2}
\end{pmatrix}$ and $P_1AP_1^{-1}=\begin{pmatrix}A_2 & E_{2 \times n-2} \\
0_{n-2\times 2} & (A_1)_{n-2\times n-2}
\end{pmatrix}$.
These matrices still commute. So $B_1A_1=A_1B_1$. Of course $A_1^2=-Id_{n-2\times n-2}$.
In addition, $0>\det(B)=\lambda_1^2\det(B_1)$. So  $\det(B_1)<0$.
We can repeat this argument $m=n/2$ times to obtain
$P_mBP_m^{-1}=
\begin{pmatrix}\lambda_1 Id_{2\times 2}& C'_{2\times 2} &\ldots & C''_{2\times 2}\\
0_{2\times 2}& \lambda_2 Id &\ldots & D''_{2\times 2}\\
\vdots & \vdots &\ddots & \vdots\\
0_{2\times 2}& 0_{2\times 2} &\ldots & \lambda_m Id \\
\end{pmatrix}$.
Now, $\det(B)=\prod_{i=1}^m\lambda_i^2\geq 0$. Absurd!