Is $\left(\begin{smallmatrix}0&0&1\\1&0&0\\ 0&1&0\end{smallmatrix}\right)$ diagonalizable over $\mathbb{Z}_2$? Is $A= \begin{pmatrix} 0 & 0 & 1\\ 1 & 0 & 0\\ 0 & 1 & 0 \end{pmatrix}$ diagonalizable over $\mathbb{Z}_2$?
I tried two approaches and got two different answers so I was hoping someone could point me to a flaw in my reasoning:
First approach:
The minimal polynomial for $A$ is easily found to be $m(x) =x^3-1$ which is the same as $x-1$ over $\mathbb{Z}_2$. Since the minimal polynomial decomposes into distinct linear factors it must be that $A$ is diagonalizable over $\mathbb{Z}_2$.
Second approach:
It follows from the minimal polynomial that $1$ is the only eigenvalue of $A$ . The eigenvector equation is
$\begin{pmatrix} 0 & 0 & 1\\ 1 & 0 & 0\\ 0 & 1 & 0 \end{pmatrix} \begin{pmatrix} x \\ y\\ z \end{pmatrix} = \begin{pmatrix} z \\ x\\ y \end{pmatrix} = 1 \times \begin{pmatrix} x \\ y\\ z \end{pmatrix}  $ and the only solution is $\begin{pmatrix} 1 \\ 1\\ 1 \end{pmatrix}$.
But $\mathbb{Z}_2^3$ has dimension $3$, so there is no basis for $\mathbb{Z}_2^3$ consisting of eigenvectors for $A$. $A$ can't be diagonalized over $\mathbb{Z}_2$.

What went wrong? Many thanks!
 A: Your claim that $x^3-1$ and $x-1$ are the same polynomial is the mistake. Yes, as functions over $\mathbb{Z_2}$ they are the same. But a polynomial is not a function. A polynomial is a formal sum of the form $\sum_{i=0}^n a_ix^i$ where the coefficients are elements in the field. So $x^3-1$ is actually not a product of distinct linear factors.
Another way to see this is a mistake is to note that if $x-1$ was the minimal polynomial of $A$ then it would mean that $A-I=0$ and hence $A=I$. But $A$ is not the identity matrix.
A: No, $x^3-1$ is not equal to $x-1$ over $\Bbb Z_2$, although the corresponding polynomial functions are equal indeed. On the other hand, $x^3-1=(x-1)(x^2+x+1)$ and $x^2+x+1$ is irreducible of $\Bbb Z_2$. Therefore, yes, your matrix is not diagonalizable over $\Bbb Z_2$.
A: To supplement the other good answers, one might be skeptical that "a formal sum" is a real thing. For example, since the functions $x\to x^3-1$ and $x\to x-1$ on $\mathbb F_2$ are the same, why should it matter that the "expressions" are "different"?
(Yes, describing such things as "formal sums" or "just symbols" is fairly common, but maybe not a good long-term explanation...)
One way to say what the polynomial ring $k[x]$ is (let's say for a commutative ring $k$ with unit $1$) is that it is the/a free $k$-algebra on one generator (the generator being $x$). This means that, given any ring $R$ with $k$ in its center, and $r_o\in R$, there is a unique $k$-algebra hom (that is, a ring hom that also preserves the multiplication by $k$) $k[x]\to R$ such that $x\to r_o$.
(Indeed, this is what we do with polynomials: we evaluate them by specifying $x$... This is a meta-mathematical argument that the above is a good characterization of polynomials.)
In the case at hand, there are many $\mathbb F_2$ algebras much larger than $\mathbb F_2$ itself, for example an algebraic closure, and we can (canonically) map $x$ to elements therein.
The usual notation then becomes merely a notation for the things themselves, ... which I myself prefer to declaring strings of symbols to be the actual mathematical entities.
