Diagonalizing Matrices over UFDs Suppose $R$ is a UFD, $K$ its field of fractions. If a matrix $M$ with entries in $R$ has distinct eigenvalues, then it is certainly diagonalizable over $K$. If those eigenvalues are actually in $R$, must it be diagonalizable over $R$? 
If it helps: the specific case I'm interested in is when $K$ is a local field of characteristic $0$ and $R$ its integers. 
 A: No. Consider the matrix
$$A=\left(\begin{array}{rr}
3&-1\\-1 & 3\end{array}\right)$$
over $\mathbb{Z}$. It is certainly diagonalizable over $\mathbb{Q}$, and the eigenvalues are $2$ and $4$, in $\mathbb{Z}$; the eigenspaces are $(a,-a)$ and $(b,b)$. Any diagonalizing matrix over $\mathbb{Q}$ would then be of the form
$$P = \left(\begin{array}{rr}a&b\\-a&b\end{array}\right)\qquad\text{or}\qquad \left(\begin{array}{rr}a & b\\a&-b
\end{array}\right),$$
so that $P^{-1}AP$ is diagonal. But the determinant of $P$ is either $2ab$ or $-2ab$. If $a$ and $b$ are nonzero integers, then the inverse of $P$ cannot be a matrix with integer coefficients, since the determinant is not $\pm 1$. 
Added. By the way: the assumption that the eigenvalues lie in $R$ is unnecessary: if $M$ has coefficients in $R$, then the characteristic polynomial is monic and has coefficients in $R$. In particular, if it splits over $K$, then it splits over $R$ (by the Rational Root Theorem, or by Gauss's Lemma). So all you need to assume is that the minimal polynomial splits over $K$ and is squarefree; the polynomial will then necessarily split over $R$ as well.
