Determination of all invariant subspaces Let $T\colon V \to V$ be a linear endomorphism of a finite dimensional $k$-vector space $V$.  Suppose that the minimal polynomial of $T$ is of the form $p(X)^m$, for an irreducible polynomial $p(X) \in k[X]$ and $m \in \mathbb N$.  How to determine all the $T$-invariant subspaces of $V$?
I think the answer should be $\ker (p(T)^i)$ for $i=0,1,\dots,m$, but I don't know how to prove it.  It is easy to show that all the subspaces of the form $\ker (p(T)^i)$ are $T$-invariant.  Is the converse true?  If yes, how to prove it?  
 A: Assume that $K$ is not algebraically closed. Let $A\in M_n(K)$; if $m_A$, the minimum polynomial of $A$ is in the form $P(x)^m$, where $P$ is an irreducible polynomial of degree $p$, then $\chi_A$, the characteristic polynomial of $A$, is $P(x)^{n/p}$; in particular, $p$ divides $n$.
The case $p=1$ is very particular ($A$ admits eigenvectors). Up to a translation, we may assume that $P(x)=x$, that is $A$ is nilpotent. When $K$ is infinite, the number of invariant subspaces (IS) is finite iff $m=n$, that is when $A$ is cyclic. For example, $A=\begin{pmatrix}0&1&0\\0&0&0\\0&0&0\end{pmatrix}$admits the IS of dimension $2$: $[e_1,e_2+\tau e_3],\tau\in K$ (the orbit of $e_2+\tau e_3$ under the action of $A$ spans this vector subspace).
In the sequel, we assume that $p\geq 2$. If $p=n$, that is $\chi_A=P(x)$, then $A$ has no proper IS.
If $p<n$, then we consider the Frobenius form of $A$. There are $>0$ integers $d_1\leq\cdots\leq d_{k-1}\leq d_k=m$ s.t. $\sum_{i=1}^k d_i =n/p$ and $A$ is similar  over $K$ to $diag(C_{P^{d_1}},\cdots,C_{P^{d_k}})$, where $C_Q$ is the companion matrix of $Q$.
Note that if $F$ is an IS, then $\chi_{A|F}$ divides $\chi_A$ and, therefore, is a power of $P$; in particular, $dim(F)$ is a multiple of $p$.
We consider the particular case when $p=2,K=\mathbb{R},n=6$. Note that we may assume that $P(x)=x^2+1$. The IS have even dimension. Below, $\tau$ is a real parameter. There are $2$ cases.
Case $1$. The Frobenius form of $A$ is $diag(C_P,C_P,C_P)$ and its real Jordan form is again $diag(U,U,U)$ where $U=C_P=\begin{pmatrix}0&-1\\1&0\end{pmatrix}$. Note that $A$ is diagonalizable non-cyclic. There is an infinity of IS over $\mathbb{C}$ and also over $\mathbb{R}$. Indeed, since  $A^2+I=0$, the orbit of any non-zero vector spans an IS of dimension $2$. Thus any IS is the sum of such orbits. For example, the orbit of $e_1+\tau e_3$ spans $[e_1+\tau e_3, e_2+\tau e_4]$.
Case 2. The Frobenius form of $A$ is $diag(C_P,C_{P^2})$ and its real Jordan form is $diag(U,\begin{pmatrix}U&I_2\\0&U\end{pmatrix})$. Note that $A$ is non-diagonalizable and non-cyclic. Thus again, there is an infinity of IS of dimension $2$ or $4$. Now we use the real Jordan form.
For example, the orbit of $e_1+\tau e_3$ spans $[e_1+\tau e_3,e_2+\tau e_4]$ of dimension $2$. The orbit of $e_1+\tau e_5$ spans $[e_3,e_4,e_1+\tau e_5,e_2+\tau e_6]$ of dimension $4$.
