Let 
\begin{align}
\mathfrak{g} = Span\_{\mathbb{C}}\{ e\_1, e\_2, e\_3, e\_4, e\_5: \text{ non-zero brackets are } [e\_1, e\_i]=e\_{i+1}, i=2,3,4, [e\_2, e\_3]=e\_5 \}
\end{align}
be a $5$-dimensional Lie algebra. I want to write $e\_1, \ldots, e\_5$ as matrices. That is, I need to find an injective homomorphism of Lie algebras: $\mathfrak{g} \to \mathfrak{gl}(V)$, $V$ is some vector space. Are there some general method to do this? I know that Ado's theorem says that this homomorphism always exists. But I don't know how to construct these matrices explicitly. Can some software like GAP compute the matrices of $e\_1, \ldots, e\_5$? Thank you very much.



Faithful linear representation of a nilpotent Lie algebra
The Lie algebra is filiform nilpotent and is generated by $e\_1$ and $e\_2$. It is known that any faithful Lie algebra representation $\rho:\mathfrak{f}\_n\rightarrow \mathbb{gl}(V)$ of a $n$-dimensional filiform Lie algebra $\mathfrak{f}\_n$ is of degree at least $n$. In the above example, we do not need to invoke Ado's theorem. It is enough to construct a faithful $5$-dimensional Lie algebra representation as follows. By Lie's theorem, we may assume that the operators $\rho(e\_i)$ are simultaneously upper-triangular. We may even assume that $\rho(e\_1)$ satisfies further properties. Then it is easy to compute explicit matrices $\rho(e\_1)$ and $\rho(e\_2)$, which determine a faithful representation of degree $5$. For details on this construction see, e.g., [here](http://homepage.univie.ac.at/Dietrich.Burde/papers/burde_03_ben.pdf), and for computational aspects and other methods in general see [here](http://homepage.univie.ac.at/Dietrich.Burde/papers/burde_35_nilrep.pdf), with references to GAP programs.


Edit: A short computation shows that
$$
\rho(e\_1)=\begin{pmatrix} 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 0 
 \end{pmatrix},\;
\rho(e\_2)=\begin{pmatrix} 0 & 0 & 3 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 
 \end{pmatrix}
$$
defines a representation of the above filiform Lie algebra, where the center is represented nontrivially, i.e., $\rho(e\_5)\neq 0$, so that the representation is faithful.


