Let \(A\) be an \(n \times n\) diagonal matrix with characteristic polynomial \[ (x - c_1)^{d_1} \cdots (x - c_k)^{d_k}, \] where \(c_1, \ldots, c_k\) are distinct. Let \(V\) be the space of \(n \times n\) matrices \(B\) such that \(AB = BA\). Prove that the dimension of \(V\) is \(d_1^2 + \cdots + d_k^2\).
Solution
Goal. Show \(\dim\theset{B : AB = BA} = d_1^2 + \cdots + d_k^2\) for a diagonal matrix \(A\) with distinct eigenvalues \(c_1, \dots, c_k\) of multiplicities \(d_1, \dots, d_k\).
1. \(A\) is diagonal with eigenvalue \(c_i\) appearing \(d_i\) times.
by hypothesis.
2. \(AB = BA\) iff \(B\) is block-diagonal with blocks of sizes \(d_1, \dots, d_k\).
2.1. Write \(B\) in blocks \(B_{ij}\) (size \(d_i \times d_j\)) matching the eigenspace decomposition.
partition \(B\) according to the multiplicities.
2.2. \(AB = BA\) gives \(c_i B_{ij} = c_j B_{ij}\) for each block.
the \((i,j)\) block of \(AB\) is \(c_i B_{ij}\) and of \(BA\) is \(c_j B_{ij}\).
2.3. For \(i \neq j\), \(c_i \neq c_j\) forces \(B_{ij} = 0\).
\((c_i - c_j) B_{ij} = 0\) and \(c_i \neq c_j\).
2.4. Hence \(B\) is block-diagonal, with arbitrary blocks \(B_{ii}\) of size \(d_i \times d_i\).
the diagonal blocks are unconstrained.
3. The dimension of the space of block-diagonal matrices is \(\sum_i d_i^2\).
3.1. Each diagonal block \(B_{ii}\) has \(d_i^2\) free entries.
a \(d_i \times d_i\) matrix has \(d_i^2\) entries.
3.2. Hence \(\dim V = \sum_{i=1}^k d_i^2\).
the blocks are independent.
4. Q.E.D.
3.2 is the claim.