Invariant Factor Decomposition of Integer Matrices Suppose $M$ is an $n \times n$ matrix with integer entries. If we think of $M$ as acting on $V=\mathbb{Q}^n$, then we can think of $V$ as a $\mathbb{Q}[M]$-module and have that $V$ is isomorphic to a direct sum of cyclic $\mathbb{Q}[M]$-modules.
Suppose instead that $M$ acts on $W=\mathbb{Z}^n$. My question is then: how can we decompose $V$ as a $\mathbb{Z}[M]$-module? Also, we have $\mathbb{Z}[M]=\mathbb{Z}[X]/I$ where $I$ is the ideal of polynomials for which $M$ satisfies. A priori, it's not even obvious that this ideal is principal (i.e. that $M$ has a minimal polynomial) but I think I've proven this using Gauss's Lemma. Is that right?
 A: Because $\def\Z{\Bbb Z}\Z[X]$ is not principal, one does not have the corresponding theory of decompositions of modules (in particular there are no invariant factors with the usual properties), and in fact the situation does not seem to have any simple general description. There is one positive thing that can be said about the ideal$~I$ defining the ring $K[M]$: not only is $I$ principal (since it is the intersection of an ideal of $\Bbb Q[X]$ with $\Z[X]$), but since $M$ is integral over$~\Bbb Z$ (by the Cayley-Hamliton theorem), $I$ is generated by a monic polynomial in$~\Z[X]$. So $K[M]$ is an integral extension of$~\Z$. But except in some rare cases, like when the minimal polynomial is $X^2+1$ or $X^2+X+1$, this ring is not principal (nor is it in general a domain, but I think that is less important here), and no easy structure theory applies.
One might define the invariant factors of $M$ over$~\Z$ to be just those over$~\Bbb Q$, which are indeed (monic) polynomials with integer coefficients. However it is not true that the $\Z[X]$-module always decomposes as a direct sum of cyclic modules isomorphic to $\Z[X]/(P_i)$ for these invariant factors$~P_i$, nor indeed that these $P_i$ determine the $\Z[X]$-module up to isomorphism. To see this, consider the matrices
$$
  \begin{pmatrix}0&1\\1&0\end{pmatrix}
\qquad\text{and}\qquad
  \begin{pmatrix}1&0\\0&-1\end{pmatrix}.
$$
Both have minimal and characteristic polynomials equal to $X^2-1=(X-1)(X+1)$, which is therefore also the unique invariant factor; however for the $\Z[X]$-modules defined by these matrices, the first (defined by a companion matrix) is isomorphic to $\Z[X]/(X^2-1)$ and indecomposable, but the second decomposes as $\Z[X]/(X-1)\oplus\Z[X]/(X+1)$; there is no Chinese remainder theorem here.
For the case of involutions (integer matrices$~A$ satisfying $A^2=I$) one can show that one still always gets a direct sum of cyclic modules (of one of the three types occurring in the example). However, even this statement is not true in general: the $\Z[X]/(X^2+3)$-module defined by the matrix
$$
  A=\begin{pmatrix}1&-2\\2&-1\end{pmatrix}
$$
is irreducible but not cyclic (since for any integer vector $v$, the pair of vectors $(v,A\cdot v)$ has an even determinant, so it never forms a basis of$~\Z^2$). In other words, $A$ is not similar over$~\Z$ to the companion matrix of its minimal and characteristic polynomial$~X^2+3$, although it is over$~\Bbb Q$.
