How to find a "flag base" to an endomorphism? I found several exercises that ask me to find a flag base for a given matrix, for example:
$$ A=\left( \begin{array}{ccc}
-1 & 1 & 0 \\
2 & 2 & 4 \\
-1 & -2 & -3 \end{array} \right)$$
I know that a flag base $B$ for $A$ exists iff $A$ is triangularizable; then I create the matrix $M$ with the columns being the vectors of $B$ and:
$$T=M^{-1}AM$$
where $T$ is finally triangular.
But I don't mind of $T$, I only need to build some $B$. How can I do that without make too many calculations?
I give you the Eigenspaces:
$$E_{-1}= span \left( \begin{pmatrix}-2 \\ 0 \\1 \end{pmatrix} \right)$$
$$E_{0}= span \left( \begin{pmatrix} 1 \\ 1 \\ -1 \end{pmatrix} \right)$$
Thank you very much, this is really important.
 A: I think the definition of flag basis you are looking for is: If $T$ is a linear transformation $T : V \to V$, then a flag basis for $T$ is a basis $\mathcal B = \{v_1, v_2, \dots, v_n\}$ of $V$ such that
$$Tv_j = \sum_{i = 1}^j b_{ji} v_i$$
note that the summation is only taken up to $i = j$. This means that $T$ is triangular in the basis $\mathcal B$.
So, to find your basis $\mathcal B$ you need to find a basis in which $A$ is triangular. There are a couple of different methods to convert a matrix to triangular form, there is e.g. the Schur decomposition and the Jordan normal form. I will describe how to get the basis for converting to Jordan normal form.
You have started calculating the eigenvectors for $A$, which is a good start. You calculated the following eigenvalue-eigenvector pairs:
$$\lambda_1 = 0, ~~~~ v_1 = \begin{pmatrix} 1 \\ 1 \\ -1 \end{pmatrix}$$
$$\lambda_2 = -1, ~~~~ v_2 = \begin{pmatrix} -2 \\ 0 \\ 1 \end{pmatrix}$$
but these don't make a basis since you don't have enough vectors.
Actually, if you look at the characteristic polynomial $p_A(x) = -x^3 -2x^2 -x$ of $A$ you see that it has a double root in $x = -1$, so there "should be" an additional eigenvector corresponding to the eigenvalue $-1$, but there isn't! The multiplicity of an eigenvalue in the characteristic polynomial is called the algebraic multiplicity of the eigenvalue, while the dimension of the corresponding eigenspace is called the geometric multiplicity of the eigenvalue. In this case the geometric multiplicity is smaller than the algebraic multiplicity, so we have to resort to a special trick.
Say there existed a vector $v_3$ such that $(A - \lambda_2I)v_3 = v_2$, then we would have
$$Av_3 = Av_3 - \lambda_2 I v_3 + \lambda_2 I v_3 =
(A - \lambda_2I)v_3 + \lambda_2 v_3 = v_2 + \lambda_2v_3
$$
such a vector $v_3$ is called a generalized eigenvector. This would be sufficient for us to construct a flag basis.
Note that above we can just solve for $v_3$, so let's try it. We get:
$$
\begin{pmatrix}
 0 & 1 & 0 \\
 2 & 3 & 4 \\
 -1 & -2 & -2
\end{pmatrix}
v_3 = v_2
\Rightarrow
v_3 = \begin{pmatrix} 3 \\ -2 \\ 0 \end{pmatrix}
$$
and we can verify that indeed $Av_3 = v_2 + \lambda_2v_3$.
So, then the vectors $v_1, v_2, v_3$ constitute a flag basis since:
$$
\begin{align}
Av_1 &= 0 = 0 \cdot v_1 \\
Av_2 &= (-1)v_2 = 0 \cdot v_1 + (-1) \cdot v_2 \\
Av_3 &= v_2 + (-1)v_3 = 0 \cdot v_1 + 1 \cdot v_2 + (-1) \cdot v_3
\end{align}$$
so in each expansion of $Av_i$ we only have terms with $v_j$ where $j \leq i$.
