Solution (source code)

= Solution
{c}

For a <perfect Lie algebra> $\mathfrak s$, every element is a sum of <Lie brackets>. The <Adjoint representation> satisfies $\operatorname{ad}[x,y]=[\operatorname{ad}x,\operatorname{ad}y]$, and the <trace of a commutator> is zero. Therefore
$$
\operatorname{tr}(\operatorname{ad}x)=0\qquad(x\in\mathfrak s).
$$
Some $\operatorname{ad}x$ must have a nonzero <eigenvalue>. Otherwise, over the <algebraically closed field> $k$, every $\operatorname{ad}x$ would be a <nilpotent linear map>, and the <Engel theorem> would imply that $\mathfrak s$ is a <nilpotent Lie algebra>. This contradicts perfection: the <lower central series of a Lie algebra> $\gamma_1=\mathfrak s$, $\gamma_{r+1}=[\mathfrak s,\gamma_r]$ would equal $\mathfrak s\ne0$ at every step instead of terminating.

Choose such an $x$. Since $[x,x]=0$, zero is an <eigenvalue> of $\operatorname{ad}x$. Its <trace> is zero and its <dimension> is three, so the remaining <eigenvalues> are $\lambda,-\lambda$ with $\lambda\ne0$. These three <eigenvalues> are distinct in <characteristic zero>, hence $\operatorname{ad}x$ is <diagonalizable>. Put $h=2x/\lambda$, and choose nonzero <eigenvectors> $e,f$ with
$$
[h,e]=2e,\qquad[h,f]=-2f.
$$
The zero <eigenspace> is $kh$, so $h,e,f$ form a <basis>. Applying the <Jacobi identity> gives
$$
[h,[e,f]]=[[h,e],f]+[e,[h,f]]=2[e,f]-2[e,f]=0.
$$
Thus $[e,f]=ch$ for some $c\in k$. If $c=0$, all <Lie brackets> of <basis vectors> lie in $\langle e,f\rangle$, contradicting $[\mathfrak s,\mathfrak s]=\mathfrak s$. Therefore $c\ne0$, and replacing $f$ by $f/c$ gives $[e,f]=h$.

We have constructed an <sl2 triple> that is a <basis>. The <linear map> to the <sl2 Lie algebra> sending
$$
e\longmapsto\begin{pmatrix}0&1\\0&0\end{pmatrix},\qquad h\longmapsto\begin{pmatrix}1&0\\0&-1\end{pmatrix},\qquad f\longmapsto\begin{pmatrix}0&0\\1&0\end{pmatrix}
$$
preserves all <Lie brackets> of <basis vectors> and is bijective. Hence
$$
\boxed{\mathfrak s\cong\mathfrak{sl}_2(k).}
$$
This is the <classification of three-dimensional perfect Lie algebras> without appealing to a classification of all <simple Lie algebras>.