Centralizer of certain matrices Let $M=M_{n}(\mathbb{F}_{q})$, is the $\mathbb{F}_{q}$-algebra of $n\times n$ matrices over the finite field of $q$ elements, $\mathbb{F}_{q}$. Let $X\in M$, be a matrix such that the characteristic polynomial of $X$, is same as its minimal polynomial. Let $f$ be the characteristic polynomial of $X$. Let $C_{M}(X)=\{ A\in M | AX=XA \} $. Clearly $C_{M}(X)$ is a subalgebra of $M$. Prove that 
$$C_{M}(X) \cong \frac{\mathbb{F}_{q}[t]}{(f)} $$
as $\mathbb{F}_{q}$-algebras.
I am having trouble in proving this! I have no clue how to prove this. Any kind of help will be highly appreciated.
Thanks!
 A: Let $\mathbb F$ be the algebraic closure of $\mathbb F_q$. Since the characteristic and minimal polynomial of $X$ are the same over $\mathbb F$, we get that $X$ is diagonalizable: that is, $X=SDS^{-1}$, with $D$ diagonal and all diagonal entries of $D$ are distinct. Now let $A\in C_M(X)$. Let $A'=S^{-1}AS$. Then 
$$
A'D=S^{-1}ASS^{-1}XS=S^{-1}AXS=S^{-1}XAS=DA'. 
$$
From the fact that all diagonal entries of $D$ are distinct, we get that $A'$ is diagonal. Now choose a polynomial $p\in \mathbb F_q[t]$ such that $p(D_{jj})=A'_{jj}$. Then $A'=p(D)$, and 
$$
A=SA'S^{-1}=Sp(D)S^{-1}=p(SDS^{-1})=p(X). 
$$
Thus
$$
C_M(X)=\{p(X):\ p\in\mathbb F_q[t]\}.
$$
Now define $\pi:\mathbb F_q[t]/(f)\to C_M(X)$ by $\pi(p+(f))=p(X)$. We showed above that $\pi$ is surjective. If $\pi(p+(f))=0$, then $p(X)=0$, so $f|p$ and $p+(f)=(f)$; so $\pi$ is injective. It is easy to check that $\pi$ is an algebra homomorphism. 
A: In order to prove
$C_{M}(X) \cong \dfrac{\mathbb{F}_{q}[t]}{(f)}, \tag 1$
we first establish that $C_M(X)$ consists precisely of all matrices in $M_n(\Bbb F_q)$ which may be expressed as polynomials in $X$; the exact result needed may be found in 
this Wikipedia article on commuting matrices, where it is affirmed that if the characteristic and minimal polynomials of $X$ coincide, then any matrix $A$ satisfying 
$AX = XA \tag 2$
is expressible in the form
$A = p(X), \tag 3$
for some
$p(t) \in \Bbb F_q[t]; \tag 4$
invocation of this result allows us to infer that
$C_M(X) = \{r(X) \mid r(t) \in F_q[t] \}. \tag 5$
With such a description of $C_M(X)$ in hand, we may define a homomorphism
$\phi: \Bbb F_q[t] \to C_M(X) \tag 6$
via 
$\phi \left ( \displaystyle \sum_0^m r_j t^j \right ) = \displaystyle \sum_0^m r_j X^j. \tag 7$
I leave it to my readers to verify that the function $\phi$ is in fact a homomorphism; the algebraic details, though a tad tedious, are straightforward.  We next observe that, based upon the above remarks, 
$\phi$ is in fact surjective, and thus (6) immediately yields an isomorphism $\bar \phi$ induced by $\phi$:
$\bar \phi: \dfrac{\Bbb F_q[t]}{\ker \phi} \cong C_M(X); \tag 8$
it remains to identify $\ker \phi$.  Now $\Bbb F_q[t]$ is a principal ideal domain, as is well-known; therefore we may write
$\ker \phi = (g(t)), \tag 9$
for some
$g(t) \in \Bbb F_q[t]; \tag{10}$
now since
$f(X) = 0, \tag{11}$
we have
$f(t) \in (g(t)) \Longrightarrow g(t) \mid f(t); \tag{12}$
furthermore, since $f(t)$ is minimal for $X$, we must have
$f(t) \mid g(t) \tag{13}$
as well, as may be seen by applying Euclidean division of polynomials to $f(t)$ and $g(t)$:  we write
$g(t) = q(t) f(t) + r(t), \tag{14}$
where $q(t), r(t) \in \Bbb F_q[t]$ with either $r(t) = 0$ or 
$\deg r(t) < \deg f(t); \tag{15}$
but if
$r(t) \ne 0, \tag{16}$
then (14) yields
$r(X) = g(X) - q(X)f(X) = 0,\tag{17}$
contradicting the minimality of $f(X)$; therefore $r(t) = 0$ and (13) binds, which together with (12) forces
$g(t) = f(t); \tag{18}$
thus
$\ker \phi = (f(t)), \tag{19}$
and we finally see that (8) becomes
$\bar \phi: \dfrac{\Bbb F_q[t]}{(f(t))} \cong C_M(X), \tag{20}$
the desired isomorphism. $OE\Delta$.
