Solution (source code)

= Solution

By the <classification of finite-dimensional sl2 representations> over $\mathbb C$, every finite-dimensional <module> is a <direct sum> of simple modules $L_m$, indexed by integers $m\ge0$. The <module> $L_m$ has <dimension> $m+1$ and a <basis> $v_0,\ldots,v_m$ with
$$
\begin{aligned}
hv_j&=(m-2j)v_j,\\
ev_j&=jv_{j-1},\\
fv_j&=(m-j)v_{j+1},
\end{aligned}
$$
with out-of-range vectors interpreted as zero. In particular $v_0$ is a <highest weight> vector of weight $m$. The weights are $m,m-2,\ldots,-m$, each with multiplicity one. The multiplicities of the $L_m$ in a finite <module> determine that <module> up to isomorphism.