Rank nullity theorem Let $$0\rightarrow G_{1}\xrightarrow{f_{1}} G_{2}\xrightarrow{f_{2}} G_{3}\rightarrow 0$$ be a short exact sequence of finitely generated abelian groups. We call $\overline{G_{i}}$ the quotient of $G_{i}$ by its torsion. Then, we consider :
$$0\rightarrow \bar{G_{1}}\xrightarrow{\bar{f_{1}}} \bar{G_{2}}\xrightarrow{\bar{f_{2}}} \bar{G_{3}}\rightarrow 0.$$

Considering the exact sequence $$0\rightarrow Ker(\bar{f_{2}})\rightarrow \bar{G_{2}}\xrightarrow{\bar{f_{2}}} \bar{G_{3}}\rightarrow 0,$$ show that $$rank(G_{2})=rank(G_{1})+rank(G_{3}).$$

I know that $Ker(\bar{f_{2}})/Im(\bar{i_{1}})$ is a torsion group and that $\bar{i_{2}}$ is surjective.
Can you help me ? Thank you.
 A: Recall that for $G$ a finitely generated abelian group, $\overline{G}\simeq \mathbb{Z}^r$ where $r=rank(G)$. Hence the exactness of the sequence
$$
0\to \overline{G_1}\to \overline{G_2}\to \overline{G_3}\to 0
$$
means that
$$
0\to \mathbb{Z}^{r_1}\to \mathbb{Z}^{r_2}\to \mathbb{Z}^{r_3}\to 0
$$
is exact, where $r_i=rank(G_i)$. Since $\mathbb{Z}^{r_3}$ is a free abelian group, it is a so-called projective $\mathbb{Z}$-module, which means the sequence splits. This means $\mathbb{Z}^{r_2}\simeq \mathbb{Z}^{r_1}\oplus \mathbb{Z}^{r_3}$, so $r_2=r_1+r_3$ as desired.
A: (Alternative solution in case you know about tensor products.) If $A$ is a finitely generated abelian group, then the dimension of the $\mathbf{Q}$-vector space $A\otimes_\mathbf{Z}\mathbf{Q}$ (extension of scalars) is equal to the rank of $A$: if $A=A_{\mathrm{tor}}\oplus\mathbf{Z}^n$, then $A\otimes_\mathbf{Z}\mathbf{Q}=A_{\mathrm{tor}}\otimes_\mathbf{Z}\mathbf{Q}\oplus \mathbf{Q}^n=\mathbf{Q}^n$ as $-\otimes_\mathbf{Z}\mathbf{Q}$ "kills torsion". Now $\mathbf{Q}$ is torsion free, hence flat (meaning that if you take $-\otimes_\mathbf{Z}\mathbf{Q}$, then the induced sequence in tensor products is exact also). Thus the exact sequence $0\rightarrow G_1\otimes_\mathbf{Z}\mathbf{Q}\rightarrow G_2\otimes_\mathbf{Z}\mathbf{Q}\rightarrow G_3\otimes_\mathbf{Z}\mathbf{Q}\rightarrow 0$ of $\mathbf{Q}$ vector spaces, and in general for an exact sequence of vector spaces $0\rightarrow V'\rightarrow V\rightarrow V''\rightarrow 0$ you have $\dim V=\dim V'+\dim V''$ (for $V$ is isomorphic to $V'\oplus V''$).
