Find the structure of $ \mathbb Z ^{3} / K $ with $K$ the image of a matrix I have this matrix:
$$
A= \begin{pmatrix} 2 & 5 & -1 & 2\\ -2 & -16 & -4 & 4 \\ -2 &-2 &0 &6
\end{pmatrix}
$$ 
If we set K as the Image of this matrix, how do you find a basis of $ K $ of this form  :
$$( d_1 w_1 , \cdots , d_s w_s ), s \leq 4$$
such that we have that $( w_1 , \cdots , w_4 ) $ is a basis of $ \mathbb Z ^{3} $ and that $ d_i | d_{i+1} $
I must use the Smith normal form, but I'm blocked by the fact that I can't find a basis of the Image. 
In the correction of this exercice, their are using a method I'm not understanding. 
I would firstly determine a basis of the image and then do the same computation as I usually do. 
 A: $\DeclareMathOperator{\im}{Im}\DeclareMathOperator{sp}{Span}\require{AMScd}$First, let us understand where all the maps are going in the Smith normal form:
\begin{CD}
\mathbb{Z}^4 @>A>> \mathbb{Z}^3\\ 
@APAA @AAQA \\ \mathbb{Z}^4 @>>D> \mathbb{Z}^3
\end{CD}
$P$ and $Q$ are isomorphisms (invertible), $D$ is diagonal and $A = QDP^{-1}$. The point of $P$ and $Q$ is that they are a change of basis such that in the new basis, $A$ acts diagonally.
We want to compute the image of $A$, or equivalently, the image of $QDP^{-1}$.
First, I claim that $\im(A) = \im(QD)$ and this is because $P$ is invertible.

Let $y \in \im(A)$. Then $y = Ax = QDP^{-1}$ for some $x$. So $y = QD(P^{-1}x)$ is in the image of $QD$. Next, let $y \in \im(QD)$. Then $y = QDx$ for some $x$. Since $P$ (and also $P^{-1}$) is invertible, there must be some $x'$ such that $x = P^{-1}x'$ (namely: $x' = Px$). Then $y = QDP^{-1}x' = Ax' \in \im{A}$.

The general rule here is that if $A = BC$ and $C$ is invertible, then $\im(A) = \im(B)$.
Next, given any matrix, the image of that matrix is the same as the column space.

To demonstrate, let $B$ have columns $v_1, \dots, v_n$ and let $x = (x_1,\dots,x_n)$. Then
  $$ Bx = \begin{pmatrix} v_1 & \cdots & v_n \end{pmatrix} \begin{pmatrix} x_1 \\ \vdots \\ x_n \end{pmatrix} = x_1v_1 + \cdots + x_nv_n \in \sp\{v_1,\dots,v_n\}$$
  And conversely, any element $x_1v_1 + \cdots + x_n v_n \in \sp\{v_1,\dots,v_n\}$ can be written as $Bx$ where $x = (x_1,\dots,x_n)$.

So what we have shown is that $\im(A) = \im(QD) = \sp\{\text{columns of $QD$}\}$.
Now the last step is what I said near the beginning: $P$ and $Q$ represent a change of basis. So the columns of $Q$ are a basis for $\mathbb{Z}^3$ and the columns of $P$ are a basis for $\mathbb{Z}^4$. (In fact, the same is true for $P^{-1}, Q^{-1}$ as well as $P^T$ and $Q^T$ or, more generally, any invertible matrix.)
So the columns of $Q$ are a basis for $\mathbb{Z^3}$ and the (non-zero) columns of $QD$ are a basis for $\im(A)$. Then it's just a matter of understanding how diagonal matrices act on other matrices. Multiplying by a diagonal matrix on the right multiplies the columns by the corresponding diagonal element. Multiplying by a diagonal matrix on the left multiplies the rows by the corresponding diagonal element.
This is why $QD$ is obtained from $Q$ by multiplying the columns by $-1, -2$, and $2$ respectively.
A: I don't know if you are follow the same course as mine but I had this exact exercice this semester with D. Testerman. Here is the solution :


A: This took me six elementary column matrices, the 4 by 4 square matrix has determinant $1.$ Actually, I combined some steps, so it might be more reasonable to indicate the square matrix as $R = R_1 R_2R_3R_4R_5R_6R_7 R_8,$ this is the order when using column operations rather than the more familiar row operations. 
$$
\left(
\begin{array}{rrrr}
 2&   5& -1& 2 \\
-2& -16& -4& 4 \\
-2&  -2&  0& 6 \\
\end{array}
\right)
\left(
\begin{array}{rrrr}
1 &-3& -10 & -56 \\
0  &1 &  3 & 17 \\
1 &-3 & -9 &-53 \\
0& -1 & -2 & -13 \\
\end{array}
\right) =
\left(
\begin{array}{rrrr} 
 1 & 0 &0& 0 \\
-6 &-2& 0& 0 \\
-2 &-2& 2 & 0 \\
\end{array}
\right)
$$
