Is there any example of a Lie algebra which is not a derivation algebra? 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.

*

*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)?


*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!
 A: $\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.
A: If $A$ is an arbitrary algebra over a field of characteristic $p>0$, then its derivation algebra is a restricted Lie algebra under the usual Lie bracket $[D_1,D_2]=D_1D_2-D_2D_1$ and the ordinary $p$-exponentation. This shows that, in positive characteristic, a non-restrictable Lie algebra cannot be the derivation algebra of an algebra of any kind.
