Find Jordan base for nilpotent matrix $$A=\begin{pmatrix}
1&1 &-1  &-1 \\ 
1&1 &-1  &-1 \\ 
1&1&-1&-1\\ 1&1  & -1&-1
\end{pmatrix}$$
I find Jordan form for matrix $A$(matrix $A$ is nilpotent $\operatorname{ind}(A)=3$), but I need to find Jordan base for it. Can anyone explain me algorithm for finding Jordan base for nilpotent matrix. 
 A: Note that$$A.\begin{pmatrix}x\\y\\z\\t\end{pmatrix}=\begin{pmatrix}0\\0\\0\\0\end{pmatrix}\iff x+y=z+t.$$So, find a basis $\{v_1,v_3,v_4\}$ (no, this is not a typo) of this vector space, with $v_1=(1,1,1,1)$. Note that$$A.\begin{pmatrix}1\\1\\1\\0\end{pmatrix}=v_1$$So, let $v_2=(1,1,1,0)$. Hence, we have


*

*$A.v_1=0$;

*$A.v_2=v_1$;

*$A.v_3=0$;

*$A.v_4=0$.


Therefore, $\{v_1,v_2,v_3,v_4\}$ is a basis of the type you're after.
A: The algorithm is the following: find first the index of nilpotency of $A$.
One checks $A^2=0$. On the  other hand, $A$ has rank $1$. We deduce at once that


*

*$\dim\ker A=3$, so the Jordan form of the matrix has $3$ Jordan blocks,

*$\dim\ker A^2=4$, so the Jordan form has $4-3=1$ block  of size $\ge 2$,

*$\dim\ker A^3=4$, so the Jordan form has $4-4=0$ block of size $\ge 3 $.


Thus the Jordan form of the matrix is
$$\begin{bmatrix}0&0&0&0\\0&0&0&0\\0&0&0&1\\0&0&0&0\end{bmatrix}$$
How to find a Jordan basis?
Choose  non-zero vectors in $\ker A^2\smallsetminus\ker A=\mathbf R^4\smallsetminus\ker A$,  linearly independent modulo $\ker A$. In the present case there is at most $1$ such vector. The condition to be satisfied is $x+y\ne z+t$. Say $v_4=(1,1,1,0)$, and set $v_3=Av_4=(1,1,1,1)$. Since $A^2=0$, note $v_3\in\ker A$. Complete $v_3$ with two other linearly independent vectors $v_1$ and $v_2$ so that $v_3, v_1, v_2$ make up a basis of $\ker A$, say:
$$v_1=(1, 0,1 ,0),\quad v_2=(0,1,1,0).$$
In the basis $\mathcal B=(v_1,v_2,v_3,v_4)$, the matrix of $A$, by construction, has the form above.
