Question: Let C be an nxn matrix, then the polynomials in C (with appropriate coefficients) form an algebra of commuting matrices. I feel that I should know if the converse is true but I do not. So my first question (adding several conditions) is: Suppose A and B are symmetric integer matrices with AB=BA, must there be a matrix C such that both A and B are polynomials in C? This would imply that the algebra which A and B generate has dimension n or less. In general: Let **A** be an algebra of pairwise commuting nxn matrices over an integral domain D, Under what conditions (if any) on D and **A** can we conclude that there is a matrix C so that **A** is contained in the D-algebra generated by C? I am thinking of conditions such as D is an algebraically closed field, D has characteristic zero, the matrices are symmetric. etc.

Answer: 
Consider the subalgebra of $M\_{2n}(k)$ spanned by the matrices of the form $\left(\begin{smallmatrix}0&A\\0&0\end{smallmatrix}\right)$ (all blocks are $n\times n$) together with the identity, which is commutative. Its dimension is larger than $2n$ when $n$ is sufficiently large, so it is not generated by a single matrix.
For symmetric matrices over the reals, the answer is yes: if $A$ and $B$ commute, then they can be simultaneously diagonalized. That is to say, there exists an orthogonal matrix $U$ ($U^TU = I$) such that $U^TAU$ and $U^TBU$ are both diagonal. It follows that for any diagonal matrix $D$ with distinct diagonal entries, both $A$ and $B$ are polynomials in $C = UDU^T$.

In general it is instructive, and loses no generality, to assume that $A$ is in a normal (Jordan, Smith, etc.) form. Over a field, for example, the dimension of the space of polynomials in $A$ is the same as the degree of the minimal polynomial of $A$, which is the sum, over all eigenvalues $\lambda$, of the size of the largest Jordan block for $\lambda$ in the Jordan normal form of $A$ over the algebraic closure of the field. It's not too hard to verify that every matrix commuting with $A$ is a polynomial in $A$ if and only if the minimal polynomial is the characteristic polynomial, that is if every eigenvalue has a single Jordan block (as happens automatically for example if there are $n$ distinct eigenvalues).

I can't remember the precise statement of something that surprised me, some unsolved problem related to the dimension of a commuting set in terms of Jordan block sizes. Someone please comment if you are familiar with this open problem and can state it precisely.