Detail in the proof $\text{rank}(G)=\dim_{\mathbb{Q}}(G\otimes\mathbb{Q})$ Let $G$ be a finitely generated $\mathbb{Z}$-module. I want to show that $\text{rank}(G)=\dim_{\mathbb{Q}}(G\otimes\mathbb{Q})$. I've shown that $G\otimes\mathbb{Q}\cong \mathbb{Q}^{\text{rank}(G)}$ like $\mathbb{Z}$-modules. Can I conclude that they are isomorphic also like $\mathbb{Q}$-vector spaces? Why?
 A: The group $G\otimes\mathbb{Q}$ is in a natural way a $\mathbb{Q}$-vector space, using the structure of $\mathbb{Q}$ as $\mathbb{Z}$-$\mathbb{Q}$-bimodule.
Consider now the exact sequence $0\to t(G)\to G\to G/t(G)\to 0$, where $t(G)$ is the torsion part of $G$. Then tensoring with $\mathbb{Q}$ gives the exact sequence
$$
t(G)\otimes\mathbb{Q}\to
G\otimes\mathbb{Q}\to
(G/t(G))\otimes\mathbb{Q}\to0
$$
and, since $t(G)\otimes\mathbb{Q}=0$, we get the isomorphism
$$
G\otimes\mathbb{Q}\cong(G/t(G))\otimes\mathbb{Q}
$$
Now it's just a matter of showing that the ranks of $G$ and $G/t(G)$ are the same.
I'll denote by $\bar{x}$ the image of $x\in G$ under the canonical projection $G/t(G)$. If $\{x_1,\dots,x_k\}$ is a maximal linearly independent set in $G$, then also $\{\bar{x}_1,\dots,\bar{x}_k\}$ is linearly independent in $G/t(G)$: if
$$
a_1\bar{x}_1+\dots+a_k\bar{x}_k=0
$$
then $a_1x_1+\dots+a_kx_k\in t(G)$, so, for some $n>0$,
$$
na_1x_1+\dots+na_kx_k=0
$$
and therefore
$$
na_1\bar{x}_1+\dots+na_k\bar{x}_k=0
$$
which shows $na_1=\dots=na_k=0$, so also $a_1=\dots=a_k=0$. In particular, the rank of $G$ is less than or equal to the rank of $G/t(G)$.
It is also obvious that, if $\{\bar{y}_1,\dots,\bar{y}_h\}$ is linearly independent in $G/t(G)$, then $\{y_1,\dots,y_h\}$ is linearly independent in $G$, so the rank of $G/t(G)$ is less than or equal to the rank of $G$.
Since $G/t(G)$ is a torsionfree finitely generated abelian group, it is isomorphic to $\mathbb{Z}^k$, where $k$ is the rank of $G/t(G)$ (and so of $G$). Thus
$$
G\otimes\mathbb{Q}\cong(G/t(G))\otimes\mathbb{Q}
\cong\mathbb{Z}^k\otimes\mathbb{Q}\cong\mathbb{Q}^k
$$
(Note that just a fragment of the classification of finitely generated abelian groups is needed to establish that $G/t(G)$ is free. In the proof of equality of ranks, finiteness can be dispensed with, by defining the rank as the maximum cardinality of a linearly independent set.)
A: We have that $$\Bbb{Q} \otimes \Bbb{Z} \cong \Bbb{Q}:q\otimes n \mapsto qn$$ is an isomorphism of $\Bbb{Q}$-vector spaces, as you can easily check. Therefore, if $G\cong \Bbb{Z}^r \oplus \bigoplus \Bbb{Z}/n_i$, $$\Bbb{Q}\otimes G \cong (\Bbb{Q}\otimes \Bbb{Z})^r \cong \Bbb{Q}^r$$ as $\Bbb{Q}$-vector spaces (if you want to be really rigourous, you should check that the isomorphism $\Bbb{Q}\otimes \Bbb{Z}^r\cong (\Bbb{Q}\otimes \Bbb{Z})^r)$ is an isomorphism of $\Bbb{Q}-$vector spaces). The result follows.
