Finding a Jordan basis of a $3\times 3$ matrix 
Find a Jordan basis for the following matrix: $$A=
    \begin{pmatrix}
    1 & -3 & 4 \\
    4 & -7 & 8 \\
    6 & -7 & 7 \\
    \end{pmatrix}
$$

Hey everyone. First I have found the characteristic polynomial which is $(x-3)(x+1)^2$.
Then i've found a basis for: $$\ker(3I-A)=\ker\begin{pmatrix}2 & 3 & -4 \\-4 & 10 & -8 \\-6 & 7 & -4 \\\end{pmatrix}$$ $B_1= \{(\frac{1}{2},1,1)^T\} $. Then, for the next Jordan block I've calculated $\ker(-I-A)=\ker \begin{pmatrix}
    -2 & 3 & -4 \\
    -4 & 6 & -8 \\
    -6 & 7 & -8 \\
    \end{pmatrix}
$ and found a basis for this subspace- $B_2= \{(1,2,1)^T\}. \dim(\ker(-I-A))=1\neq a_m(\lambda)=2$ so we find a basis for $\ker(-I-A)^2 \Rightarrow B_3=\{(1,1,0)^T,(0,1,1)^T\}$ and choose $e_1=(1,0,0)^T \ (e_1 \notin Sp(B_2)) $ to complete $B_3$ to a basis of $\mathbb{R^3}$. 
Hence, our first chain is the vector $v_1= \{(\frac{1}{2},1,1)^T\}$, and the second chain is $\{(-I-A)e_1, e_1\}=\{(-2,-4-6)^T, (1,0,0)^T\} $ therefor our basis is $B= \{(\frac{1}{2},1,1)^T, (-2,-4-6)^T, (1,0,0)^T \} $
But $P^{-1}AP $ where $P=\begin{pmatrix}
    \frac{1}{2} & -2 & 1 \\
    1 & -4 & 0 \\
    1 & -6 & 0 \\
    \end{pmatrix}$ equals $\begin{pmatrix}
    3 & -32 & 0 \\
    0 & -1 & -1 \\
    0 & 0 & -1 \\
    \end{pmatrix} \neq \begin{pmatrix}
    3 & 0 & 0 \\
    0 & -1 & 1 \\
    0 & 0 & -1 \\
    \end{pmatrix}$
I've done numerous tries with different vectors other than $e_1$ yet I did not achieve the matrix' Jordan form. I would be happy if you could help me find my mistakes. Thanks in advance :)
 A: The problem is that $e_1$ must be chosen to be in ${\rm ker}(-I-A)^2$. To be more specific, you must chose $e_1$ to be any element in ${\rm ker}(-I-A)^2$ that is not in ${\rm ker}(-I-A)$.
For example, you can chose $$e_1 = (1, 1, 0)^T.$$
Having chosen $e_1$, you are forced to take $$ e_2 : = (A + I)e_1 = (-1, -2, -1)^T$$ as your generator of ${\rm Ker}(-I-A)$.
Finally, you can take
$$ e_3 =(\tfrac 1 2, 1, 1)^T$$
as your generator of ${\rm Ker}(3I - A)$.
So the vectors $\{ e_1, e_2, e_3 \}$ satisfy the relations
$$ Ae_1 = -e_1 + e_2, \ \ \ A e_2 = -e_2, \ \ \ Ae_3 = 3e_3.$$
Thus $\{ e_3, e_2, e_1 \}$ is a Jordan basis, corresponding to the Jordan matrix
$$\begin{bmatrix} 3 & 0 & 0 \\ 0 & -1 & 1 \\ 0 & 0 & -1 \end{bmatrix} $$
[I had to reorder the basis vectors to put the matrix in standard form - sorry about that!]
Finally, a couple of minor points:


*

*For the signs to work out, you need to take $e_2 := (A + I)e_1$ as your generator of ${\rm Ker}(-I-A)$, not $(-I - A)e_1$.

*Verifying that $e_2 = (A + I)e_1$ really is in ${\rm Ker}(- I - A)$ is a good sanity check!
