Let $V$ be a finite-dimensional $K$-vector space and let $T$ be a linear operator from $V$ to $V$.
I already proved that for every polynomial $p(x) \in K[x]$, $\ker p(T)$ and $Im p(T)$ are $T$-invariant. Is it true that for every $W$ proper $T$-invariant subspace, $W$ is the kernel of $p(T)$ for a polynomial $p$?
My guess is yes. If $p$ is the characteristic polynomial of the restriction of $T$ to $W$, then $p(T)v=0$ for every $v$ and then $W\subset \ker p(T)$. How can I finish the converse?