Solution (source code)

= Solution

Choose a <positive system of a root system> and the corresponding <triangular decomposition of a Lie algebra> $L=\mathfrak n^-\oplus H\oplus\mathfrak n^+$. A <primitive element of a Lie algebra representation> of <weight> $\omega\in H^*$ is a nonzero vector $v$ with $hv=\omega(h)v$ for every $h\in H$ and $\mathfrak n^+v=0$. Thus it is a <highest-weight vector>; the choice of positive roots is part of this definition. A <highest-weight representation> is generated by such a vector.

Let $\mathfrak b=H\oplus\mathfrak n^+$ be the corresponding <Borel subalgebra>. Define its one-dimensional <Lie algebra representation> $\mathbb C_\omega$ by the scalar $\omega(h)$ on $H$ and zero on $\mathfrak n^+$. This respects the <Lie bracket>, since $[\mathfrak b,\mathfrak b]\subseteq\mathfrak n^+$. The induced <Verma module>
$$
M(\omega)=U(L)\otimes_{U(\mathfrak b)}\mathbb C_\omega
$$
is nonzero: the <Poincare-Birkhoff-Witt theorem> identifies its underlying <vector space> with $U(\mathfrak n^-)$, and $v=1\otimes1$ is a primitive element of weight $\omega$. Its <weight spaces> are finite dimensional, its top <weight space> is the line $\mathbb Cv$, and all other <weights> are $\omega-\sum n_i\alpha_i$ with $n_i\ge0$ and at least one positive coefficient.

A proper <submodule> cannot contain $v$, because $v$ generates $M(\omega)$. More strongly it has no component of weight $\omega$: any finite sum of distinct <weight vectors> can be projected onto its individual components by a <polynomial> in a generic element of $H$. Therefore the sum $N$ of all proper submodules still misses the top weight line and is proper. It contains every proper submodule, so the <irreducible quotient of a Verma module>
$$
\boxed{L(\omega)=M(\omega)/N}
$$
is irreducible and retains the nonzero primitive element $v+N$. This constructs the requested representation for every $\omega\in H^*$. It is not asserted to be finite dimensional for arbitrary $\omega$.

For the <sl2 Lie algebra>, use $h=\begin{pmatrix}1&0\\0&-1\end{pmatrix}$, $e=\begin{pmatrix}0&1\\0&0\end{pmatrix}$ and $f=\begin{pmatrix}0&0\\1&0\end{pmatrix}$, with $[h,e]=2e$, $[h,f]=-2f$, $[e,f]=h$. The <classification of finite-dimensional sl2 representations> gives one irreducible $V_n$ for every integer $n\ge0$. In a <basis> $v_0,\ldots,v_n$ its action is
$$
hv_j=(n-2j)v_j,\qquad fv_j=v_{j+1},\qquad ev_j=j(n-j+1)v_{j-1},
$$
where $v_{-1}=v_{n+1}=0$. These formulas satisfy the three <Lie brackets>. Any nonzero invariant subspace contains a <weight vector> by <polynomial> projection using $h$; repeated application of $e$ gives $v_0$, and applications of $f$ then give the entire <basis>. Thus $V_n$ is irreducible.

Conversely, in any finite-dimensional irreducible module, start with an <eigenvector> of $h$ and apply $e$ until reaching a nonzero vector $v$ with $ev=0$. This process terminates because $e$ increases the <eigenvalue> by two and only finitely many <eigenvalues> occur. Write $hv=av$. The <sl2 highest-weight lowering formula> gives
$$
hf^jv=(a-2j)f^jv,\qquad ef^jv=j(a-j+1)f^{j-1}v.
$$
Let $f^nv\ne0$ and $f^{n+1}v=0$, which again follows from the finite set of <weights>. Applying $e$ to the latter identity yields $(n+1)(a-n)f^nv=0$, so $a=n$. The resulting $n+1$ distinct <weight vectors> span an invariant subspace, hence the entire irreducible module. Therefore \b[$\dim V_n=n+1$ and its primitive weight is $\omega_n(h)=n$], with $n=0,1,2,\ldots$; its weights are $n,n-2,\ldots,-n$.