<s>[INST] Calculate Smith normal form, cyclic group decomposition Can someone please check my working for the following problem?

Let $A$ be the abelian group generated by elements $x,y,z$ with relations $7x+5y+2z=0, 3x+3y=0, 13x+11y+2z=0$. Decompose $A$ as a direct sum of cyclic groups.

$$
M = \begin{pmatrix}
7 & 5 & 2 \\
3 & 3 & 0 \\
13 & 11 &  2 \end{pmatrix} 
$$
$$\begin{pmatrix}
7 & 5 & 2 \\
3 & 3 & 0 \\
13 & 11 &  2 \end{pmatrix}  \sim \begin{pmatrix}
7 & 5 & 2 \\
3 & 3 & 0 \\
-1 & 1 &  -2 \end{pmatrix} \sim \begin{pmatrix}
1 & -1 & 2 \\
3 & 3 & 0 \\
7 & 5 & 2 \end{pmatrix} \sim \begin{pmatrix}
1 & 0 & 0 \\
3 & 6 & -6 \\
7 & 12 & -12 \end{pmatrix}  \sim \begin{pmatrix}
1 & 0 & 0 \\
0 & 6 & -6 \\
0 & 12 & -12 \end{pmatrix} \sim \begin{pmatrix}
1 & 0 & 0 \\
0 & 6 & -6 \\
0& 0 &  0 \end{pmatrix} \sim \begin{pmatrix}
1 & 0 & 0 \\
0 & 6 & 0 \\
0 & 0 &  0 \end{pmatrix} $$
So $A = \mathbb{Z}/1\mathbb{Z} \oplus \mathbb{Z}/6\mathbb{Z} \oplus \mathbb{Z} / 0\mathbb{Z}$ based on the above Smith normal form which I'm not confident about.
The 6 steps taken are the following:


*

*$R_3=R_3-2R_1$

*Swap $R_3$ and $-R_1$

*$C_2=C_2+C_1$ and $C_3=C_3-2C_1$

*$R_2=R_2-3R_1$ and $R_3=R_3-7R_1$

*$R_3=R_3-2R_2$

*$C_3=C_3+C_2$

 [/INST] Since you want to check your answer, there is a direct way to obtain Smith normal form; define inductively
$$d_1d_2\cdots d_k=\mbox{gcd of $k\times k$ minors of matrix under consideration}.$$
Then the Smith normal form is 
$$\begin{bmatrix} d_1 &  & \\ & d_2 & \\ & & d_3\end{bmatrix}.$$
So $d_1=1$ because it is $gcd(7,5,..)=1$; next $d_1d_2=gcd(6,-6,12,-12)=6$, and 
$d_1d_2d_3=\det A=0.$ Thus 
$$d_1=1, d_2=6, d_3=0.$$
</s>