# large sets of commuting linearly independent matrices

Given a set of $n \times n$ real matrices which are linearly independent and commute with one another, how large can the cardinality of this set be? By using diagonal matrices we can have such a set of size $n$ and since diagonal matrices commute with upper triangular ones, we can get $n+1$ too. Can we do better?

What about the case of matrices over finite fields?

-
Diagonal matrices don't (necessarily) commute with upper triangular ones, e.g., if $A=\pmatrix{1&0\cr0&2\cr}$ and $B=\pmatrix{0&1\cr0&0\cr}$ then $AB\ne BA$. –  Gerry Myerson Jun 1 '11 at 0:12

Let $n$ be even. Then we can achieve $1+(n/2)^2$ by the matrices of the form $$\begin{pmatrix} a \cdot \mathrm{Id} & M \\ 0 & a \cdot \mathrm{Id} \end{pmatrix}$$ where each block is $(n/2) \times (n/2)$ and $M$ is arbitrary. This is best possible, by a result of Schur. See "A simple proof of a theorem of Schur", if you have access to JSTOR.