# Find a flag to transform a matrix to an upper triangular one

Consider $F: \mathbb{R^3} \to \mathbb{R^3}$ represented by:

$A= \begin{bmatrix} 1 & 1 & 2 \\ -2 & 5 & 6 \\ 1 & -2 & -2 \\ \end{bmatrix}$ , eigenvalues: $(\lambda - 1)^2(\lambda -2)$

Now, $A$ admits Jordan canonical form: $J_A= \begin{bmatrix} 2 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \\ \end{bmatrix}$, so, the basis which brings $A$ in this form is a flag. However the exercise asks to find a flag with the method $\{0\} \subseteq V_1 \subseteq V_2 \subseteq ... \subseteq \mathbb{R^n}$.

It requests to verify that:

$V_1 =x_1+x_3 =x_2+2x_3=0$

$V_2 = x_2+2x_3=0$

are s.t. $\{0\} \subseteq V_1 \subseteq V_2 \subseteq V_3\ = \mathbb{R^3}$ is a flag for $F$

That is true, because the eigenvector of the eigenvalue $\lambda_1 =1$ is $v_{\lambda_1}=(1, -2, 1)$ and $V_1 = span \{(1, -2, 1\}$; plus, we notice that $(1, -2, 1) = (1, 0, 0) + (0, -2, 1)$ and these two are vectors of a basis of $V_2$, so $\{0\} \subseteq V_1 \subseteq V_2$.

Verified that, I have to complete a basis of $V_1$ on a complementary basis $W$ s.t. $V_1 \oplus W = \mathbb{R^3}$ and write a matrix whose columns are those vectors:

$B= \begin{bmatrix} 1 & 0 & 0 \\ -2 & 1 & 0 \\ 1 & 0 & 1 \\ \end{bmatrix}$, for example. I find $B^{-1} = \begin{bmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ -1 & 0 & 1 \\ \end{bmatrix}$

At this point $B^{-1}AB =C$ would be of the type: $\begin{bmatrix} \lambda_1 & \bullet & \bullet \\ 0 & * & * \\ 0 & * & * \\ \end{bmatrix}$, from here we have to write a new basis, whose first vector will be $(1,0,0)$, invariant, the second $(0,a,b)$ where $(a,b)$ is eigenvector of the restriction to $\begin{bmatrix} * & * \\ * & * \\ \end{bmatrix}$ of $C$ and, finally, the tird vector as complementary basis and repeat.

But $B^{-1}AB$, so "built", isn't of the type $C$ and I don't understand where I'm getting wrong. Thank you!