I'm reading Halmos' Finite Dimensional Vector Spaces. Here:
I am a little bit confused at to why $\mathcal{K}$ is invariant under $A$. If $k\in \mathcal{K}$, why does it follows that $Ak\in \mathcal{K}$ instead of $Ak\in \mathcal{H}$? I guess I don't understand what he is "doing" in the proof. It seems he is trying to construct $\mathcal{H}$ and enlarge it the maximum possible and then use this (somehow to construct) $\mathcal{K}$. Excuse me for not being able to provide better details, I'm a bit confused.
Notice that this is not the entire proof, I got confused when he talks about constructing $\mathcal{K}$ by induction on the index of nilpotence.


$\mathcal K=\operatorname{span}\{x_0,Ax_0,\dots,A^{q-1}x_0\}$. Now we have $A(\mathcal K)\subset\mathcal K$, because we get the set $\{Ax_0,A^2x_0,\dots,A^{q-1}x_0,0\}$ when we apply $A$ to the set of which $\mathcal K$ is the span.
This is expressed by saying "$\mathcal K$ is invariant under $A$".