Commuting linear maps

Why is it that if $f,g\,\,$ are endomorphisms and they commute then one of them is a polynomial with the "argument" being the other? It is easy to see that if that were true, $f,g\,\,$ would commute. What I fail to see is the converse. Thanks.

-
See this question and the links there. – Dylan Moreland Nov 20 '11 at 23:10
It's not true as stated, that's certain. Take $f(x,y,z,w) = (z,w,0,0)$, and $g(x,y,z,w) = (w,0,0,0)$. Then $f$ and $g$ are both powers of $t(x,y,z,w) = (y,z,w,0)$ ($f=t^2$, $g=t^3$), they commute, but $g$ is not a polynomial of $f$ nor is $f$ a polynomial of $g$. (That is, $f$ and $g$ could both be polynomial expressions of some other linear transformation, but not polynomial expressions of each other). – Arturo Magidin Nov 20 '11 at 23:11
And in $R[X,Y]$ we can let $f$ and $g$ be multiplication by $X$ and $Y$, respectively. They clearly commute, but are not polynomials each other and are not even both powers of the same endomorphism as in Arturo's example. – Henning Makholm Nov 20 '11 at 23:22
Thanks loads guys! – pott Nov 21 '11 at 0:29

I will write it this way: given a square matrix $M,$ then all matrices that commute with $M$ can be written as a polynomial in $M$ when:

All eigenvalues of $M$ are distinct, or, at least, whenever an eigenvalue has multiplicity larger than one, it has just a single Jordan block, call it multiplicity $k,$ Jordan block $k$ by $k,$ with $k-1$ occurrences of $1$ on the superdiagonal.

This is true if and only if the characteristic polynomial and the minimum polynomial are equal.

Those are all. That is, the following two conditions for a square matrix $M$ with real or complex entries are equivalent:

(I) All matrices that commute with $M$ can be written as a polynomial in $M.$

(II) The characteristic polynomial and the minimal polynomial of $M$ are the same.

See Corollary 1 to Theorem 2 on page 222 of The Theory of Matrices, Volume 1 by Feliks Ruvimovich Gantmakher.