1. Rational Canonical Form

$\displaystyle A = \left( \begin{matrix} 4 &1 & 2 & 0 \\ -4 & 0 &1 &5 \\0 &0 &1 & -1 \\0 &0 &1 & 3 \\ \end{matrix} \right)$
$\displaystyle char_A = (x-2)^4$
$\displaystyle min_A=(A -2I)^3=x^3-6x^2+12x-8$.
We deduce that $\displaystyle R = \left( \begin{matrix} 0& 0& 8& 0\\1 &0 &-12 & 0 \\0 &1 & 6 & 0\\0 &0 & 0 & 2 \\ \end{matrix} \right)$.
We choose $\displaystyle \vec{v_1}= \left( \begin{matrix} 0 \\ 0 \\1 \\0 \\ \end{matrix} \right)$ and $\displaystyle \vec{v_2}= A\vec{v_1} = \left( \begin{matrix} 2 \\ 1 \\1 \\1 \\ \end{matrix} \right) = \vec{v_2}$. Then $\displaystyle \vec{v_3}= A\vec{v_2} = A^2\vec{v_1}$. This is the third column of $\displaystyle A^2$ which is $\displaystyle \left( \begin{matrix} 4 &1 & 2 & 0 \\ -4 & 0 &1 &5 \\0 &0 &1 & -1 \\0 &0 &1 & 3 \\ \end{matrix} \right)\left( \begin{matrix} 2 \\ 1 \\ 1 \\ 1 \\ \end{matrix} \right) = \left( \begin{matrix} 11 \\ -2 \\0 \\ 4 \\ \end{matrix} \right) = \vec{v_3}$. Finally,$\displaystyle \vec{v_4}= \left( \begin{matrix} 1 \\ 0 \\ 0\\ 0 \\ \end{matrix} \right)$.
Let $\displaystyle Q = \left( \begin{matrix} 0& 2&11 & 1\\0 &1 & -2 & 0 \\1 &1 & 0 & 0\\0 &1 & 4 & 0 \\ \end{matrix} \right)$.
Let's check independence of the columns and invertibility of the matrix right now.
$\displaystyle det(Q) = \left| \begin{matrix} 0& 2&11 & 1\\0 &1 & -2 & 0 \\1 &1 & 0 & 0\\0 &1 & 4 & 0 \\ \end{matrix} \right| = (1) \left| \begin{matrix} 2& 11 & 1\\1 & -2 & 0 \\1 & 4 & 0\\ \end{matrix} \right| = (1) (1)\left| \begin{matrix} 1 & -2 \\1 & 4 \\ \end{matrix} \right| = 6\neq 0$, so $\displaystyle Q$ is invertible. This also tells us that the row space (and thus the column space) has dimension 4. It follows that the columns are independent.
Now we check that $\displaystyle QR = AQ$.
$\displaystyle QR = \left( \begin{matrix} 0& 2&11 & 1\\0 &1 & -2 & 0 \\1 &1 & 0 & 0\\0 &1 & 4 & 0 \\ \end{matrix} \right) \left( \begin{matrix} 0& 0& 8& 0\\1 &0 &-12 & 0 \\0 &1 & 6 & 0\\0 &0 & 0 & 2 \\ \end{matrix} \right)= \left( \begin{matrix} 2& 11 & 42 & 2\\ 1 & -2 & -24 & 0\\ 1 & 0 & -4 &0\\ 1 & 4 & 12 &0\\ \end{matrix} \right)$

$\displaystyle AQ =\left( \begin{matrix} 4 &1 & 2 & 0 \\ -4 & 0 &1 &5 \\0 &0 &1 & -1 \\0 &0 &1 & 3 \\ \end{matrix} \right)\left( \begin{matrix} 0& 2&11 & 1\\0 &1 & -2 & 0 \\1 &1 & 0 & 0\\0 &1 & 4 & 0 \\ \end{matrix} \right) = \left( \begin{matrix} 2& 11 & 42 & 4\\ 1 & -2 & -24 & -4\\ 1 & 0 & -4 &0\\ 1 & 4 & 12 &0\\ \end{matrix} \right)$
It doesn't work can someone tell me why?
It seems that the only vector working is $\displaystyle \vec{v_4}= \left( \begin{matrix} 0 \\ 0 \\0 \\0 \\ \end{matrix} \right)$ !