# Centralizer of element in Lie algebra contains Cartan subalgebra

Let $G$ be a compact semisimple Lie group, and let $\mathfrak{g}$ be its Lie algebra. Let $X \in \mathfrak{g}$. Why is it the case that the centralizer $Z_\mathfrak{g}(X)$ contains a Cartan subalgebra?

I believe it's related to the fact that for any Cartan subalgebra $\mathfrak{h}$ of $\mathfrak{g}$, there exists some $g \in G$ such that $gXg^{-1} \in \mathfrak{h}$, but I'm not sure.

Let $\mathfrak{h}$ be a Cartan subalgebra of $\mathfrak{g}$. Then let $g \in G$ be such that $\mathrm{Ad}(g)X \in \mathfrak{h}$, i.e. $gXg^{-1} \in \mathfrak{h}$. Then $X \in \mathrm{Ad}(g^{-1})(\mathfrak{h}) =: \mathfrak{t}$, which is a Cartan subalgebra. So $\mathcal{Z}_\mathfrak{g}(X) \supseteq \mathfrak{t}$. And we're done.