I know there are different ways to approach the JNF, one popular of them being expanding the Eigenspace by taking a potence of $\ker (f-\lambda id)$ where $f$ is an Endomorphism and $\lambda$ an Eigenvalue of the respective Eigenspace, where I will just care about one (the one of $\lambda$ in the following).
After expanding to the generalized eigenspace and showing the cyclic decomposition of the vector space one considers the nilpotent endomorphism $(f-\lambda id)$ and finds a decomposition again.
I know that $f\ker(f-\lambda id)^k=\lambda\ker(f-\lambda id)^k$.
But if we build the JNF matrix, we have something like this
$f\ker(f-\lambda id)^k=\ker(f-\lambda id)^{k+1}+\lambda\ker(f-\lambda id)^k$.
otherwise the JNF wouldn't have the form it does. My problem is, although I get the decompositions, I don' t understand how the basis is obtained, or why the construction of the matrix has too look like above.
Suppose there's only one eigenvalue, $\lambda$. Let $r$ be the index of nilpotency of $A-\lambda I$ and consider the sequence: $$\ker(A-\lambda I)\varsubsetneq\bigl(\ker(A-\lambda I)\bigr)^2\varsubsetneq\dots\varsubsetneq\bigl(\ker(A-\lambda I)\bigr)^r=\bigl(\ker(A-\lambda I)\bigr)^{r+1}=\dotsm $$ The strategy is the following: find the maximal number of linearly independent vectors in $\;\bigl(\ker(A-\lambda I)\bigr)^r\smallsetminus \bigl(\ker(A-\lambda I)\bigr)^{r-1}$ (i.e. if you've heard of quotient vector spaces lift a basis of the quotient space $\;\bigl(\ker(A-\lambda I)\bigr)^r/\bigl(\ker(A-\lambda I)\bigr)^{r-1}$).
$A-\lambda I$ maps this basis to a system of linearly independent vectors in $\;\bigl(\ker(A-\lambda I)\bigr)^{r-1}\smallsetminus \bigl(\ker(A-\lambda I)\bigr)^{r-2}$. Complete to a maximal system of linearly independent vectors in $\;\bigl(\ker(A-\lambda I)\bigr)^{r-1}\smallsetminus \bigl(\ker(A-\lambda I)\bigr)^{r-2}$, and map it by $A-\lambda I$ to a set of linearly independent vectors in $\bigl(\ker(A-\lambda I)\bigr)^{r-2}$.
ascading this way, you end up in a set of linearly independent vectors in the eigenspace $\ker(A-\lambda I)$, which you complete in a basis of the eigenspace. This basis is by construction a Jordan basis
Note:
Setting $d_k=\dim\bigl(\ker(A-\lambda I)\bigr)^k$ and $d_0=0$, the sequence $(d_k-d_{k-1})$ is decreasing and its value is the number of Jordan blocks of size $\ge k$. In particular $d_1$ (the dimension of the eigenspace) is the total number of Jordan blocks.