Possible Jordan forms for a nilpotent $A$, given the ranks of $A$ and $A^2$ Could you help me to solve this exercise?

Let $A$ be an $8\times8$ nilpotent matrix over $\mathbb{C}$ with $\mathrm{rank}(A)=5$ and $\mathrm{rank}(A^2)=2$. List all possible Jordan canonical forms for $A$ and show that knowledge of $\mathrm{rank}(A^3)$ would allow one to determine the Jordan canonical form.

This is what I have done: $A$ is nilpotent so the characteristic polynomial is $x^8$ and the minumum polynomial is $x^n$ with $3\leq n\leq8$. But now I don't know how to continue, any idea?
 A: Since the matrix is nilpotent, as you note the characteristic polynomial is $x^8$, and the minimal polynomial is $x^i$ for some $i$, $1\leq i \leq 8$. It's not $x$, because $A$ is not zero, and it's not $x^2$, because $A^2$ is not zero either. So $3\leq i\leq 8$.
Let's go form there.
Because $A$ has rank $5$, the Rank-Nullity Theorem tells you the nullity is $3$; that means that the dimension of the eigenspace corresponding to $0$ is $3$; this tells you, by the basic theory of the Jordan Canonical Form, the number of Jordan blocks associated to zero. So the Jordan canonnical form of $A$ has exactly 3 blocks, all corresponding to zero.
The key observation to make is that if $J$ is $k\times k$ Jordan block associated to $0$, then it has rank $k-1$, and $J^s$ has rank $k-s$ ($1\leq s\leq k$); just notice that each time the $1$s "move up" one row until they disappear.
So: the original matrix consists of three blocks; say the sizes are $n_1$, $n_2$, and $n_3$, with $n_1\leq n_2\leq n_3$. We know the largest block has size at least $3$ (the degree of the minimal polynomial is the size of the largest block). And we know $n_1+n_2+n_3=8$.
We cannot have both $n_1$ and $n_2$ equal to $1$; if we did, the matrix would be a $6\times 6$ block and the rest would be zeros; after squaring, the matrix would have rank $4$ (by the observation above), which is not the case. So $n_2\geq 2$. We cannot have $n_1=1$ and $n_2=2$, because then $n_3=5$, and after squaring we would get a matrix of rank $3$, which is not the case.
In fact, if the blocks are of size $1+n_2+n_3$, with $n_3\geq n_2\geq 2$, then the rank of the square would be $n_2+n_3-4 = 3$, which is not the case. So $2\leq n_1$.
That will give the right rank, since then we will have that the rank of $A^2$ is $(n_1-2)+(n_2-2)+(n_3-2) = n_1+n_2+n_3-6 = 8-6 = 2$.
So we must have $2\leq n_1\leq n_2\leq n_3$, $n_1+n_2+n_3=8$; any of these combinations will be a possible Jordan canonical form.
After finding all possibilities, verify that in each case you get a different value for $\mathrm{rank}(A^3)$, so that will show the last clause of the problem is true.
A: Since Jordan blocks correspond to a direct sum decomposition of the vector space, the rank can be computed for each summand (block) and the added up. Now one easily sees a nilpotent Jordan block of size $d$ contributes $d-i$ to $\def\rk{\operatorname{rank}}\rk(A^i)$ if $d\geq i$, and contributes nothing otherwise. And therefore it contributes to $\rk(A^{i-1})-\rk(A^i)$ either $1$, when $d\geq i$, or $0$, when $d>i$.
It follows that as a function of $i$ the non-negative number $\rk(A^i)$ is (weakly) decreasing, but in such a way that the differences $\rk(A^{i-1})-\rk(A^i)$ are also (non-negative and) weakly decreasing. And that the latter numbers count the number of Jordan blocks of size at least$~i$; this will in particular allow deducing the sizes of the Jordan blocks (of a nilpotent matrix$~A$) when all values of $\rk(A^i)$ are known up to the point where they become$~0$.
In the example $(\rk(A^i))_{i=0,1,2}=(8,5,2)$, and one must have $\rk(A^3)\in\{0,1\}$ (because $\rk(A^{i+1})=\rk(A^i)$ is only possible if $\rk(A^i)=0$), and $\rk(A^4)=0$ is forced in either case. The corresponding sequences $(\rk(A^{i-1})-\rk(A^i))_{i=1,2,3,4}$ are $(3,3,2,0)$ and $(3,3,1,1)$, giving as Jordan types $(3,3,2)$ respectively $(4,2,2)$.
