How is the given set a basis for $K$? I am studying Smith normal form from a lecture note given by our instructor on commutative algebra. Here I find some difficulty in understanding a concept. Here's this $:$

Consider an abelian group $G$ which is generated by two elements $a$ and $b$ which satisfy the relation
$$2a + 4b =0\ \mathrm {and}\ -2a+6b=0.$$
Let $e_1,e_2$ be the standard basis for $\mathbb Z^2$.
Consider the map from $\mathbb Z^2 \longrightarrow G$ given by sending $e_1$ to $a$ and $e_2$ to $b$.
This is an onto group homomorphism.
Let $K$ be the kernel. Let $y_1=2e_1+4e_2$ and $y_2 = -2e_1+6e_2$.
Then $K$ is a free $\mathbb Z$-module which has a basis $\{y_1,y_2 \}$.

This is the statement where I am struggling. My question is " Why is $\{y_1,y_2 \}$ a basis for $K$?" It is clear that $K$ is free since $\mathbb Z$ is a PID and $\mathrm {span}\ \{y_1,y_2 \} \subset  K$. How do I prove the other way round? Also since $\mathbb Z$ is a PID so
$2=\mathrm {rank}\ ({\mathrm {span}\ \{y_1,y_2 \}}) \leq \mathrm {rank}\ K \leq \mathrm {rank}\ \mathbb Z^2 = 2 \implies \mathrm {rank}\ K = 2$. Also the set $\{y_1,y_2 \}$ is linearly independent. From here can I conclude that $\{y_1,y_2 \}$ is a basis for $K$? Though this reasoning doesn't hold good for general module over a PID. For instance if we take $\mathbb Z^2$ then as a $\mathbb Z$-module it has rank $2$. Though the linearly independent doubleton set $\{(0,2), (2,0) \}$ fails to be a generating set of $\mathbb Z^2$ and hence not a basis for $\mathbb Z^2$ over $\mathbb Z$ though $\mathbb Z$ is a PID.
So how should I argue to reach at the desired conclusion? Please help me.
Thank you in advance.
 A: EDIT. This answer has been downvoted. I suspect this is because it contains a mistake, but I don't see it, and would be most grateful if somebody could point it out to me. 
[Another possible reason for the downvote is this: It seemed (and still seems) clear to me that the intended exercise was not the one stated in the question; that this intended exercise was to assume that the indicated conditions are not only satisfied by the group $G$, but was presented by them; and that this intended exercise is much more interesting than the stated exercise. So the message of the downvoter might be: "You're asked to answer the question as stated, not to speculate about any intended meaning". But I mainly would like to know if there is a mistake, and, if such is the case, what this mistake is. Thank you very much in advance!]
End of the edit.
You should add the assumption that the equalities 
$$
\left\{
\begin{matrix}
2a&+&4b&=0\\ \\ 
-2a&+&6b&=0 
\end{matrix}
\right.
$$ 
give a presentation of $G$, because otherwise $G=0$ is a counterexample. 
If you do add this assumption, then $G$ is the cokernel of the $\mathbb Z$-linear endomap of $\mathbb Z^2$ attached to the matrix 
$$
A:=\begin{pmatrix}
2&-2\\ 4&6
\end{pmatrix},
$$ 
and $K$ is generated by the columns of $A$. As you said, $K$ is free. Thus it only remains to check that the determinant of $A$ doesn't vanish, which is clear.
(About your comment: Thanks for never denoting $\mathbb Z/(n)$ by $\mathbb Z_n$. By a universal consensus $\mathbb Z_n$ denotes the ring of $n$-adic integers.)
