Lie's theorem stated in Fulton's Representation theory book is as follows :
Let $\mathfrak{g}\subseteq \mathfrak{gl}(V)$ be a solvable lie algebra. Then there exists a vector $v\in V$ which is a common eigen vector for all $X\in \mathfrak{g}$.
Idea is to prove by induction on dimension of $\mathfrak{g}$.
We have produced a codimension $1$ ideal $\mathfrak{h}$ of $\mathfrak{g}$. Let $\mathfrak{g}$ be generated (as a vector space) by $\mathfrak{h}$ and $Y$Being a subalgebra of solvable algebra $\mathfrak{g}$, $\mathfrak{h}$ is itself a solvable lie algebra. As dimension of $\mathfrak{h}$ is strictly less than that of $\mathfrak{g}$, we can apply induction step on $\mathfrak{h}$ and choose $v\in V$ such that $v$ is an eigenvector for all $X\in \mathfrak{h}$.
The idea is to consider set $W$ all common eigenvectors of elements of $\mathfrak{h}$ and produce an eigenvector of $Y$ from this $W$. Let $W=\{v\in V:X(v)=\lambda(X)v ~ \forall ~X\in \mathfrak{h} \text{ for some } \lambda(X)\in \mathbb{C}\}.$
Suppose $W$ is an invariant subspace of $Y$, we then have restriction map $Y:W\rightarrow W$. As we are in complex vector space (algebraically closed) there exists an eigenvector for $Y$ in $W$ say $w_0$.
As any element of $\mathfrak{g}$ is of the form $X+kY$ for some $X\in \mathfrak{h}$ and $k\in \mathbb{C}$ we have $$(X+kY)(w_0)=X(w_0)+kY(w_0)=\lambda(X)w_0+k\lambda(Y)(w_0)=(**)w_0.$$ Thus, $w_0$ is common eigenvector for all elements of $\mathfrak{g}$. It remains to show that $W$ is an invariant subspace of $Y$ i.e., $Y(w)\in W$ for all $w\in W$ i.e., given $X\in \mathfrak{h}$, we need to have $X(Y(w))=\lambda(X)Y(w)$.
Let $w\in W$, we have $$X(Y(w))=Y(X(w))+[X,Y](w)=Y(\lambda(X)w)+\lambda\left([X,Y]\right)w=\lambda(X)Y(w)+\lambda\left([X,Y]\right)w.$$ This is almost same as what we want but with an extra term $\lambda\left([X,Y]\right)w$. Suppose we prove $\lambda\left([X,Y]\right)=0$ for all $X\in \mathfrak{h}$ then we are done.
Author then considers subspace $U$ spanned by elements $\{w,Y(w),Y^2(w),\cdots\}$ and then says that $U$ is invariant subspace of each element of $\mathfrak{h}$ and (assuming $n$ is the smallest integer such that $Y^{n+1}w$ is in the subsapce generated by $\{w,Y(w),\cdots,Y^n(w)\}$) representation of an element $Z$ of $\mathfrak{h}$ with the basis $\{w,Y(w),\cdots,Y^n(w)\}$ is an upper triangular matrix with $\lambda(Z)$ in the diagonal. So, $tr(Z)=n\lambda(Z)$.
So, $tr([X,Y])=n\lambda([X,Y])$. As $[X,Y]=XY-YX$, we have $tr([X,Y])=tr(XY)-tr(YX)=0$. Thus, $\lambda([X,Y])=0$ and we are done.
I understand the proof but I do not understand how can one think about constructing such $U$. What is the motivation behind this construction? Any references for this motivation is welcome.