# Nilpotent 4-dim Lie algebra

What is an example of a nilpotent Lie algebra $\cal g$ with dimension four and:

• $dim\ \mathcal g'=1$,
• $dim \ \mathcal g'=2$,
• $dim \ \mathcal g'=3$?

Is there a way to construct them?

• Yes, we can construct all possible $4$-dimensional Lie algebras. The nilpotent ones are the abelian ones and $\mathfrak{h}_1\oplus K$, $\mathfrak{f}_4$. However, $codim (g')=1$ is impossible, as you know. – Dietrich Burde Feb 17 '16 at 10:51

Take the $3$-dimensional Heisenberg Lie algebra $\mathfrak{h}_1$ with basis $(x,y,z)$ and Lie bracket $[x,y]=z$ and put $L=\mathfrak{h}\oplus K$ with the $1$-dimensional abelian Lie algebra $K$. Then $\dim L=4$ and $\dim L'=\dim [L,L]=1$. For $\dim L'=2$ take the standard graded filiform Lie algebra $\mathfrak{f}_4$ of dimension $4$, with basis $(e_1,\ldots e_4)$ and Lie brackets $$[e_1,e_i]=e_{i+1}, \; i=2,3.$$ Then $L'=\langle e_3,e_4\rangle$.
We cannot have $\dim L'=3$ for a nilpotent Lie algebra $L$ of dimension $4$, because $\dim L/L'\ge 2$, see your question here.