Regarding Levi's decomposition of a Lie algebra Let $g$ be a Lie algebra and let $r$ be the radical of $g$. Then we have by Levi's theorem there exists a subalgebra $h$ of $g$ such that $g=r \oplus h$. I want to conclude that $g \cong r \rtimes h$. How to prove this? Please help me.
 A: That's a general fact independent of the concrete situation but holds for Lie algebras in general. 
Suppose you have a split short exact sequence of Lie algebras $$(\ddagger)\qquad 0\to {\mathfrak n}\to {\mathfrak g}\to {\mathfrak q}\to 0$$ with splitting $s: {\mathfrak q}\to {\mathfrak g}$ of Lie algebras.
Then, from abelian groups or abelian categories in general, you'd be used to conclude that ${\mathfrak g}\cong {\mathfrak n}\oplus {\mathfrak q}$ as Lie algebras, but that's not true in fact. We do get an isomorphism ${\mathfrak n}\oplus {\mathfrak q}\cong {\mathfrak g}, (n,q)\mapsto n+s(q)$ of vector spaces; however, for $n,n^{\prime}\in {\mathfrak n}$ and $q,q^{\prime}\in {\mathfrak q}$, we have $$[n + s(q), n^{\prime} + s(q^\prime)] = [n,n^\prime] + s([q,q^{\prime}]) + [s(q),n^\prime] - [s(q^\prime),n],$$
so the induced Lie bracket on ${\mathfrak n}\oplus{\mathfrak q}$ is that of ${\mathfrak n}\rtimes_\theta {\mathfrak q}$ with respect to the action $\theta(q,n) := [s(q),n]$. 
Only in the situation where you can choose the Lie subalgebra complement $s({\mathfrak q})$ of ${\mathfrak n}$ to be an ideal, you get $\theta=0$ and hence ${\mathfrak g}\cong {\mathfrak n}\oplus{\mathfrak q}$ as Lie algebras.
I leave it to you to check that you are indeed in the situation $(\ddagger)$ - if you ned more help, let me know.
