A quotient group and its torsion elements Let $(x_1,\dots,x_r)$ be a non-zero element of $\mathbb{Z}^r$, and let $h$ be the highest common factor of $x_1, \dots, x_r$. Show that:
$$
\mathbb{Z}^r/\langle(x_1,\dots,x_r)\rangle \cong \mathbb{Z}^{r-1} \oplus (\mathbb{Z}/h\mathbb{Z}).
$$

Now, the previous part of the question implies that I can find an isomorphism $\phi:\mathbb{Z}^r \to \mathbb{Z}^r$ taking $(x_1,\dots,x_r)$ to $(h,0,\dots,0)$, and I am supposed to 'deduce' this part from that. An answer  on my other question led me to the following: let $H$ be the cyclic subgroup of $\mathbb{Z}^r$ generated by $(x_1,\ldots,x_r)$. If $(y_1,\dots,y_r)$ is a torsion element of $\mathbb{Z}^r/H$ then
$$
n(y_1,\dots,y_r) = (x_1,\dots,x_r),
$$
but then $n|x_i$ for all $i$, so $n|h$. This feels like it is along the right lines, but something seems off. If it were $h|n$ instead, wouldn't that give the answer? Can someone point me in the right direction?
 A: You cannot in general find an isomorphism that takes $(x_1,\ldots,x_r)$ to $(1,0,\ldots,0)$. As your previous question indicates you can find such an isomorphism if and only if $h=1$; if $h\gt 1$, you cannot (for example, take $r=2$, $(x_1,x_2)=(2,2)$; no map from $\mathbb{Z}^2$ to $\mathbb{Z}^2$ takes $(x_1,x_2)$ to $(1,0)$, because there is no element $(x,y)$ of $\mathbb{Z}^2$ such that $2(x,y)=(1,0)$, so you can find nothing to map $(1,1)$ to).
So, in the spirit of using the previous result, let $h$ be the greatest common divisor of $x_1,\ldots,x_r$, and let $(y_1,\ldots,y_r)\in\mathbb{Z}^r$ such that $h(y_1,\ldots,y_r)=(x_1,\ldots,x_r)$. Then $\gcd(y_1,\ldots,y_r)=1$, so by the previous problem you know that there exists $\phi\colon\mathbb{Z}^r\to\mathbb{Z}^r$ such that $\phi(y_1,\ldots,y_r) = (1,0,\ldots,0)$, and hence $\phi(x_1,\ldots,x_r) = h\phi(y_1,\ldots,y_r) = (h,0,\ldots,0)$.
Now consider the map $\psi\colon\mathbb{Z}\times\mathbb{Z}^{r-1}\to(\mathbb{Z}/h\mathbb{Z}) \times \mathbb{Z}^{r-1}$ given by taking the first coordinate modulo $h$, and consider the composite map
$$\mathbb{Z}^r \stackrel{\phi}{\to}\mathbb{Z}\times\mathbb{Z}^{r-1}\stackrel{\psi}{\to}(\mathbb{Z}/h\mathbb{Z})\times\mathbb{Z}^{r-1}.$$
It should be clear that $(x_1,\ldots,x_r)$ lies in the kernel of $\psi\circ\phi$. Show that this is all of the kernel, and you'll be done by the isomorphism theorem.
