Commuting space dimension If $C(A) = \{X\in M_n(\mathbb{K}),~XA = AX\}$, I showed that $\dim C(A) \geq n$, also $C(A) = \mathbb{K}[A]$ iff $\mu_A = \chi_A$. If the equivalence is verified, we have $$\dim C(A) = \dim\mathbb{K}[A] = \deg \mu_A = \deg \chi_A = n.$$ Is it true that $\dim C(A) = n$ implies the equivalence ?
My guess is that it's false, but I can't seem to find any counter example. I would need $A$ such that $\mu_A\ne \chi_A$, but with $\dim C(A) = n$.
I recall that $\chi_A(X)=\det(XI_n-A)$ and $\mu_A$ is the minimal polynomial such that $\mu_A(A) = 0$.
 A: Yes, it is true that $\dim C(A) = n$ implies that $\mu_A$ and $\chi_A$ coincide. Equivalently, if $\mu_A \neq \chi_A$, then $\dim C(A) > n$. It is easiest to see this by appealing to the algebraic closure of $\Bbb K$ and using the Jordan canonical form (cf. Matrix Analysis by Horn and Johnson, Theorem 3.2.4.2 and its proof, for instance), but here is an attempt to avoid algebraic closures.
To understand the relationship between $A$ and $C(A)$, it is useful to consider the Frobenius normal form of $A$. We can suppose without loss of generality that $A$ is in this canonical form; that is, we stipulate the following:

*

*$A$ has the block-diagonal form $A = \operatorname{diag}(A_1,A_2, \dots, A_k)$,

*For each $j = 1,\dots,k$, $A_j$ is the companion matrix associated with the polynomial $p_j(x)$,

*The polynomials satisfy the divisibility condition $p_j \mid p_{j+1}$ for each $j = 1,\dots,k$.

The polynomials $p_1,\dots,p_k$ are sometimes referred to as the invariant factors of $A$. The last of these factors, $p_k$, is the minimal polynomial of $A$, and the characteristic polynomial is the product of these factors.  In fact, this level of detail is more than we strictly need. Let us simply write that $A$ has the block form
$$
A = \pmatrix{P & 0\\0 & Q},
$$
where $Q$ (i.e. $A_k$) is the companion matrix associated with the minimal polynomial of $A$ and $P$ satisfies $p(Q) = 0$ for some polynomial $p$ (i.e. $p_{k-1}$) satisfying $p \mid \mu_A$. It suffices to show that $\dim C(A) > \dim C(P) + \dim C(Q)$, since we already know that
$$
\dim C(P) + \dim C(Q) \geq n_P + n_Q = n.
$$
To that end, we note that the set of matrices of the form
$$
X = \pmatrix{X_1&0\\0&X_2}
$$
such that $X_1 \in C(P)$ and $X_2 \in C(Q)$ are elements of $C(A)$, and that the matrices of this form constitute a dimension-$[\dim C(P) + \dim C(Q)]$ subspace of $C(A)$. Thus, it suffices to find a matrix $X$ in $C(A)$ that is not of this form.
Write
$$
X = \pmatrix{X_{11} & X_{12}\\ X_{21} & X_{22}}.
$$
The condition that $AX = XA$ amounts to the following conditions:
$$
PX_{11} = X_{11}P, \quad P X_{12} = X_{12} Q, \quad Q X_{21} = X_{21} P, \quad Q X_{22} = X_{22}Q,
$$
so it suffices to find a non-zero $X_{12}$ satisfying $PX_{12} = X_{12}Q$. In the case that $p(x)$ has a linear factor, this is trivial: take $X_{12} = vw^T$ where $v,w$ are non-zero vectors such that $Pv = \lambda v$ and $w^TQ = \lambda w$.
For the remaining cases, we have the following.

Claim: Let $f(x)$ be a degree-$d$ (monic) irreducible factor of $p(x)$. Let $v$ denote any non-zero element of $\ker(f(P))$ and $w$ any non-zero element of $\ker f(Q^\top)$. Let $M$ denote an invertible matrix such that $M^{-1}C_f M = C_f^\top$ (or in fact, any non-zero matrix for which $C_f M = MC_f^\top$). Then the matrix
$$
Z = \underbrace{\pmatrix{v & Pv & \cdots P^{d-1}v}}_{Z_1}
M
\underbrace{\pmatrix{w^\top \\ w^\top Q \\ \vdots \\ w^\top Q^{d-1} }}_{Z_2} = \sum_{j=0}^{d-1} P^{j}vMw^\top Q^{j}
$$
satisfies $PZ = ZQ$.

Proof: We have
\begin{align}
P(Z_1 M Z_2) &= (Z_1C_f) M Z_2
\\ & = Z_1 (C_f M) Z_2
\\ & = Z_1 (M C_f^\top) Z_2
\\ & = Z_1 M (C_f^\top Z_2)
\\ & = Z_1 M (Z_2 Q) = (Z_1 M Z_2)Q.
\end{align}
