Solution (source code)

= Solution

A bilinear form $B$ on a <Lie algebra> is <invariant bilinear form on a Lie algebra>[invariant] when
$$
B([x,y],z)=B(x,[y,z]),
$$
equivalently $B([x,y],z)+B(y,[x,z])=0$.

Choose a basis $(x_i)$ of $\mathfrak g$ and its $B$-dual basis $(x^i)$. The <Casimir element> is
$$
\Omega=\sum_i x_ix^i\in U(\mathfrak g),
$$
where $U(\mathfrak g)$ is the <universal enveloping algebra>. The tensor $\sum_i x_i\otimes x^i$ corresponds under $B:\mathfrak g\cong\mathfrak g^*$ to the identity endomorphism, so invariance of $B$ makes it fixed by the diagonal adjoint action. Applying multiplication $U(\mathfrak g)\otimes U(\mathfrak g)\to U(\mathfrak g)$ gives
$$
[x,\Omega]=0
$$
for every $x\in\mathfrak g$. Thus $\Omega$ lies in the <center of an associative algebra> of $U(\mathfrak g)$.