<s>[INST] Finding an order of a coset in $A/B$ where $A$ is a free abelian group and $B$ is a subgroup. Let $A$ be a free abelian group with basis $x_1,x_2,x_3$ and let $B$ be a subgroup of A generated by $x_1+x_2+4x_3, 2x_1-x_1+2x_3$. In the group $A/B$ find the order of the coset $(x_1+2x_3)+B$. 
How can I find this order? Just so you can reply more directly, I shall find a basis $f_1,f_2,f_3$ such that $d_1\cdot f_1,d_2\cdot f_2,d_3\cdot f_3$ is a basis of $B$ where $d_i|d_{i+1}$.
$Attempt$: so by $Smith$ algorithm, $\begin{pmatrix}1 & 2 \\1 & -1 \\4 & 2 \\\end{pmatrix}$ $\underrightarrow{R_2\to R_2-R_1} \begin{pmatrix}1 & 2 \\0 & -3 \\4 & 2 \\\end{pmatrix}$ $\underrightarrow{R_3\to R_3-4R_1} \begin{pmatrix}1 & 2 \\0 & -3 \\0 & -6 \\\end{pmatrix}$ $\underrightarrow{R_3\to R_3-2R_1} \begin{pmatrix}1 & 2 \\0 & -3 \\0 & 0 \\\end{pmatrix}$ $\underrightarrow{C_2\to C_2-2C_1} \begin{pmatrix}1 & 0 \\0 & -3 \\0 & 0 \\\end{pmatrix}$$\underrightarrow{C_2\to -C_2} \begin{pmatrix}1 & 0 \\0 & 3 \\0 & 0 \\\end{pmatrix}$  and therefore, $d_1=1, \space d_2=3, \space d_3=0.$
Therefore, while $M= \begin{pmatrix}1 & 2 \\1 & -1 \\4 & 2 \\\end{pmatrix}$, there exist $Q,P\in GL_n(\Bbb{Z})$ such that $QMP^{-1}= \begin{pmatrix}1 & 0& 0 \\0 & 3 & 0\\0 & 0 & 0\\\end{pmatrix}$ and $P^{-1}$ columns are a basis of $A$ that fulfills the aforementioned requirements. One way to find $P^{-1}$ is to classify the identity element where the classification is the inverse of the row operations I used above in the opposite direction: from the end to the start: $\begin{pmatrix}1 & 0& 0 \\0 & 1 & 0\\0 & 0 & 1\\\end{pmatrix}$ $\underrightarrow{R_3\to R_3 + 2R_1}\begin{pmatrix}1 & 0& 0 \\0 & 1 & 0\\0 & 2 & 1\\\end{pmatrix}$ $\underrightarrow{R_3\to R_3+4R_1}\begin{pmatrix}1 & 0& 0 \\0 & 1 & 0\\4 & 2 & 1\\\end{pmatrix}$ $\underrightarrow{R_2\to R_2+R_1}\begin{pmatrix}1 & 0& 0 \\1 & 1 & 0\\4 & 2 & 1\\\end{pmatrix}$ $\Rightarrow \{x_1+x_2+4x_3, x_2+2x_3 , x_3\}$ is the desired basis, where $\Rightarrow \{x_1+x_2+4x_3, 3\cdot (x_2+2x_3
)\}$ is a basis of $B$. Furthermore: $A/B\cong \Bbb{Z}_{f_1}\times \Bbb{Z}_{f_2}\times \Bbb{Z}_{f_3}/1\cdot \Bbb{Z}_{f_1}\times 3\cdot \Bbb{Z}_{f_2}\times 0\cdot \Bbb{Z}_{f_3} \cong \Bbb{Z}/\Bbb{Z}\times \Bbb{Z}/3\Bbb{Z}\cong \Bbb{Z}/3\Bbb{Z}$. How shall I continue?
 [/INST] $Proof$: since no one has yet answered, I shall make an attempt and would appreciate your correction: Let us denote the basis $\{x_1+x_2+4x_3=a,\ 3 \cdot (x_2+2x_3)=b\}$ then $3a-b=3x_2+6x_6$. Then obviously, since $3x_2+6x_6\in B$ then the order of $(x_1+2x_3)+B$ is $3$, as $(x_1+2x_3)+B\ne B$, $2(x_1+2x_3)+B\ne B$ but $3(x_1+2x_3)+B=B= identity_{A/B}$. 
</s>