TITLE: Lie algebras and complements
QUESTION [6 upvotes]: I have some elementary questions about Lie algebras and vector space complements.
Let  $(\mathfrak{g},[.,.])$  be a finite-dimensional Lie algebra and $\mathfrak{g}_1$ a Lie ideal in $\mathfrak{g}$.
1) Is it possible to choose $\mathfrak{g}$ and $\mathfrak{g}_1$ in such a way that there is no vector space complement $\mathfrak{g}_2$ of $\mathfrak{g}_1$ in $\mathfrak{g}$ which is additionally a sub-Lie algebra of $\mathfrak{g}$?
2) Is there an example of $\mathfrak{g}$ and $\mathfrak{g}_1$ such that there is a vector space complement $\mathfrak{g}_2$ of $\mathfrak{g}_1$ in $\mathfrak{g}$ with $[\xi_1,\xi_2] = 0$ for all $\xi_1 \in \mathfrak{g}_1$ and $\xi_2 \in \mathfrak{g}_2$ but such that no such complement is a Lie ideal in $\mathfrak{g}$?
In the situation I need, all Lie algebras occur as Lie algebras of some Lie group. For every Lie algebra $\mathfrak{g}$ there exists a Lie group $G$ with $\mathrm{Lie}(G) = \mathfrak{g}$, but that's rather abstract, so it would be nice if $\mathfrak{g}$ and $\mathfrak{g}_1$ were the Lie algebras of some well-known Lie groups.
I'm not an expert in Lie algebra theory, so if some things described in 1) or 2) have special names in the literature it would be nice if you could mention that or give some references.

REPLY [12 votes]: Take $\mathfrak{g}$ to be the Lie algebra of the Heisenberg Lie group (i.e., the nilpotent Lie algebra of strictly upper triangular $3\times 3$ matrices) and let $\mathfrak{g}_1$ be the centre.  This gives you examples to (1) and (2).
Added
Now that I have more time, I can perhaps say something else about (1).  (I will work in zero characteristic, just in case.)
Every ideal $\mathfrak{g}_1$ of $\mathfrak{g}$ gives rise to an exact sequence of Lie algebras
$$\begin{matrix} 0 & \longrightarrow & \mathfrak{g}_1 & \longrightarrow & \mathfrak{g} & \longrightarrow & \mathfrak{h} & \longrightarrow & 0 \end{matrix}$$
where $\mathfrak{h} = \mathfrak{g}/\mathfrak{g}_1$.  This says that $\mathfrak{g}$ is an extension of $\mathfrak{h}$ by $\mathfrak{g}_1$.
Your condition (1), that there should not be a Lie subalgebra of $\mathfrak{g}$ complementary to $\mathfrak{g}_1$, is precisely the statement that the sequence does not split.  Hence, in particular, $\mathfrak{g}$ is not isomorphic to a (semi)direct product of $\mathfrak{g}_1$ and $\mathfrak{h}$.
If $\mathfrak{g}_1$ were abelian, it becomes in a natural way an $\mathfrak{h}$-module and you can classify such extensions by the Lie algebra cohomology group $H^2(\mathfrak{h},\mathfrak{g}_1)$.  Then your condition  (1) can be rephrased as saying that the corresponding extension class in $H^2(\mathfrak{h},\mathfrak{g}_1)$ is nonzero.  (I do not know what classifies extensions in the general case.)