TITLE: a matrix of rank $r$ satisfies a polynomial of degree $r+1$.
QUESTION [8 upvotes]: Let $M$ be an $n\times n$ matrix with coefficients in $\mathbb C$. Suppose $M$ has rank $r$ with $r<n$. Prove there is a polynomial $P(x)$ with degree $r+1$ and coefficients in $\mathbb C$ such that $P(M)$ is the zero matrix.
I think this has to do with the minimal/characteristic polynomials, although I have not yet seen this in school. I would appreciate a comprehensive solution, hopefully referencing the theorems as they are used.

REPLY [8 votes]: Small variation of the answer of loup blanc that does not mention minimal polynomials, and produces an actual annihilating polynmial of degree $r+1$. Note that is is irrelevant that the vector space is over$~\Bbb C$.
The image space $W$ of $M$ (or column space if you prefer) has dimension $r$ by definition of the rank. The characteristic polynomial $Q$ of the endomorphism of$~W$ obtained by restriction of $M$ has degree$~r$ (one can compute this polynomial by expressing the restriction as an $r\times r$ matrix on some basis of the image). Then by Cayley-Hamilton, the restriction of $Q[M]$ to $W$ is zero, i.e., $Q[M]$ vanishes on$~W$. Since $W$ is the image of$~M$, this implies that $(QX)[M]=Q[M]\cdot M=0$, and $QX$ is our annihilating polynmial of degree $r+1$.