So...we have an abelian group $G$ with generating set {$g_1,\ldots,g_n$} the following homomorphism has been formed ($F$ is a free group generated by {$f_1,\ldots,f_n$}); \begin{align} \phi:F &\rightarrow G \newline k_1f_1+\ldots +k_nf_n &\mapsto k_1g_1+\ldots +k_ng_n \end{align} Using the first isomorphism theorem $G \cong F/K$ where $K = \operatorname{Ker}(\phi)$. It can be shown that since $K$ is a subgroup of $F$ that it is itself free and finitely generated by {$r_1,\ldots,r_m$}, where $m \leq n$. The generators of $K$ can be expressed as; \begin{equation} \textbf{r} = A\textbf{f} \end{equation} where $\textbf{r} = (r_1,\ldots,r_m)^T$, $\textbf{f} = (f_1,\ldots f_n)^T$ and $A = (a_{ij})$ is an $m \times n$ matrix. It can be shown that $P\textbf{r}=PA\textbf{f}$ also generates $K$, and also that $P\textbf{r} = PAQ(Q^{-1}\textbf{f})$ generates $K$. So choosing suitable matrices $P$ and $Q$ we can show that $K$ is generated by {$a_1f'_1,\ldots,a_nf'_n$} where $a_i \in \mathbb{N}$ for $i=1,\ldots,m$ and $a_i = 0$ for $i = m+1,\ldots,n$. Now this is where my difficulties begin, that is if what i've outlined up to now makes any sense, using $\phi$ we can investigate the orders of the generating set for $G$. An element $x = k_1g_1+\ldots +k_ng_n \in G$ is equal to the identity iff k_1f'_1+\ldots +k_nf'_n \in K therefore $k_ig_i=e$ iff k_if'_i \in K and k_if'_i \in K iff $a_i |k_i$. So we conclude from this that $|g_i| = a_i$ for $i=1,\ldots ,m$ and $|g_i| = \infty$ for $i = m+1,\ldots,n$, and also that $\langle g_i \rangle \cong \mathbb{Z}/a_i\mathbb{Z}$ for $i=1,\ldots ,m$ and $\langle g_i \rangle \cong \mathbb{Z}$ for $i = m+1,\ldots,n$. Now I need to show that $G \cong \langle g_1 \rangle \oplus \ldots \oplus \langle g_m \rangle \oplus \mathbb{Z}^{n-m}$ but haven't got a clue how to go about it. I know i must show that the intersection $\langle g_i \rangle \cap \langle g_j \rangle=e$ for $i \not = j$ and that any $x \in G$ can be expressed as $k_1g_1+\ldots +k_ng_n$ (this follows from the fact that the set {$g_1,\ldots,g_n$} generates $G$ ?) and that $|G| =|g_i|\ldots|g_n|=a_1\ldots a_n$.
The question boils down to this - given an abelian group $G$ and two distinct elements $g_1,g_2 \in G$ is the intersection of the cyclic subgroups generated by $g_1$ and $g_2$ trivial?