I'm just studying Lie algebras. If $A$ is a $k$-algebra (not necessarily Lie or associative, just a bilinear law), it is straightforward to check that any derivation algebra of $A$ is a Lie algebra. I suppose that the converse is not true, but I can't find a counterexample.


1. Is there any example of a Lie algebra which is not isomorphic to the derivation algebra of any $k$-algebra (again, not necessarily associative or unital)?
2. Is there any example of a Lie algebra which is not isomorphic to the derivation algebra of any Lie algebra?


For the the second question the user YCor gives a positive answer. However, I am more interested in the first (and actually my original) question. Thank you!



Is there any example of a Lie algebra which is not a derivation algebra?
$\newcommand{\r}{\mathfrak{r}}\newcommand{\h}{\mathfrak{h}}\newcommand{\g}{\mathfrak{g}}\newcommand{\a}{\mathfrak{a}}$The 2-dimensional abelian Lie algebra $\a\_2$ is not isomorphic to the derivation Lie algebra of any Lie algebra.


Suppose otherwise. Let $\g$ be such a Lie algebra. We discuss according to whether the inner derivation algebra (that is $\g$ modulo its center) has dimension $d$ equal to 2, 1, or 0.


* if $d=2$, $\g$ modulo its center has dimension 2. So the derived subalgebra has dimension 1. If $[\g,\g]$ is contained in the center we deduce that $\g$ is 2-step-nilpotent, and isomorphic to the direct product of the Heisenberg Lie algebra $\h\_3$ with some abelian Lie algebra. In this case, the derivation algebra is much larger (for $\h\_3$ it is 6-dimensional). Otherwise $\g$ is the direct product of the two-dimensional non-abelian Lie algebra $\r$ with an abelian Lie algebra. But then its derivation algebra contains $\r$, hence is not abelian.
* $d=1$ is impossible, because the center in a Lie algebra can't be of codimension 1 (for the same reason the quotient of a group by its center can't be cyclic)
* $d=0$ means that $\g$ is abelian. But then its derivation algebra is either infinite, or has dimension some square.


