Prove ideal of matrix is that set Given the set of matrices: 
$M=\left\{
\begin{pmatrix}
a & 0 \\
0 & b
\end{pmatrix}
\mid
a,b \in \Bbb Z
\right\}$.
It is easily seen that $M$ is a commutative subring of $M_{2,2}(\Bbb Z)$. If K is ideal of M prove that exits $m,n \in \Bbb Z$ to $K=\left\{
\begin{pmatrix}
ma & 0 \\
0 & nb
\end{pmatrix}
\mid
a,b \in \Bbb Z
\right\}$
My ideas is : if $\begin{pmatrix}
m & 0 \\
0 & n
\end{pmatrix}\in K$ then  $\left\{
\begin{pmatrix}
am & 0 \\
0 & bn
\end{pmatrix}
\mid
a,b \in \Bbb Z
\right\}\in M$.
I've tried to find $m: \mid m \mid < \mid a \mid, \begin{pmatrix}
a & 0 \\
0 & b
\end{pmatrix} \in K $ and  $n: \mid n \mid < \mid b \mid, \begin{pmatrix}
a & 0 \\
0 & b
\end{pmatrix} \in K$. But I'm not sure existence of both m, n: $\mid m \mid < \mid a \mid,\mid n \mid < \mid b \mid $.
Beside, I've known that $K=\Bbb Z$x$ \Bbb Z$, and A is subgroup of $\Bbb Z$ if and only if $A=m\Bbb Z$.
I have trouble proving it, is it possible?
 A: Let $A = \left\{\begin{pmatrix} a & 0 \\ 0 & 0\end{pmatrix} |\; a \in \mathbb{Z}\right\}$.  Clearly $A$ is an ideal of $M$, and $A$ is a ring isomorphic to $\mathbb{Z}$.  Since $K$ is an ideal of $M$, we know that $K\cap A$ is also an ideal of $M$.  Moreover, we see that $K\cap A$ is an ideal of $A$, and therefore $K\cap A$ isomorphic to an ideal of $\mathbb{Z}$ via the mapping $\begin{pmatrix}a & 0 \\ 0 & 0 \end{pmatrix}\mapsto a$.  Since the ideals of $\mathbb{Z}$ are of the form $m\mathbb{Z}$ for some $m\in \mathbb{Z}$, it follows that $K\cap A = \left\{\begin{pmatrix}ma & 0 \\ 0 & 0\end{pmatrix}|\; a\in \mathbb{Z}\right\}$.  In other words, the upper left entries of elements in $K$ are all of the form $ma$ for some $a\in\mathbb{Z}$.  A similar argument shows that the lower right entries are all of the form $nb$ for some $b\in \mathbb{Z}$.
A: Hint: Let $K_1$ be the set of $a$ such that $\pmatrix{a & 0\cr 0 & b\cr} \in K$ for some $b$, and $K_2$ the set of $b$ such that $\pmatrix{a & 0\cr 0 & b\cr} \in K$ for some $a$.  Show that $K_1$ and $K_2$ are ideals of $\mathbb Z$...
