Center of Lie subalgebra of $\mathfrak{gl}_n$ My Lie algebra theory is quite rusty, and I have problems in proving the following or giving a counterexample.
Let $L$ be a non-abelian Lie subalgebra of $\mathfrak{gl}_n$ such that the bilinear form given by $b(x,y) = tr(xy)$ is nondegenerate. Then any matrix in the center of $L$ is diagonal.
Certainly the result is false if you omit the "non-abelian", but I've not been able to prove it nor to find a counterexample for non-abelian subalgebras.
Any help? Thanks in advance.
 A: I've found the answer to the question. I leave it here for future reference.
The result as stated is false. To see it, we can construct a counterexample as follows. Consider a $2\times 2$ matrix $A$ such that $tr(A^2)\neq 0$, for instance:
$A = \left(
\begin{array}{cc}
1& 1  \\
0 & 1
\end{array}
\right)$.
Let $\mathfrak{a}$ the abelian Lie algebra generated by $A$, and realize the Lie algebra $\mathfrak{sl}_2 \oplus \mathfrak{a}$ as a subalgebra of $\mathfrak{gl}_4$ by considering diagonal block matrices of the form:
$\left(
\begin{array}{c|c}
B & 0  \\
\hline
0 & \lambda A
\end{array}
\right)$
where $B \in \mathfrak{sl}_2$ and $\lambda \in \mathbb{R}$. 
It can be seen that the trace form is non-degenerate in this algebra (as it is non-degenerate in each factor: in $\mathfrak{sl}_2$ because it is a multiple of the Killing form and the algebra is semisimple, and in $\mathfrak{a}$ by construction) and it contains the non-diagonalizable matrix
$\left(
\begin{array}{c|c}
0& 0  \\
\hline
0 & A
\end{array}
\right)$
in its center.
