TITLE: If $\displaystyle \bigoplus_{i=1}^{n} \mathbb{Z} \cong \bigoplus_{i=1}^{m} \mathbb{Z}$ as groups, then $n=m.$
QUESTION [8 upvotes]: If $\displaystyle \bigoplus_{i=1}^{n} \mathbb{Z} \cong \bigoplus_{i=1}^{m} \mathbb{Z}$ as groups, then $n=m.$

Here is my proof:
Let $G$ be a group such that $\varphi:G \rightarrow \displaystyle \bigoplus_{i=1}^{n} \mathbb{Z}$ is a isomorphism, consider the subgroup of $2G:=G+G$ then, define $2\varphi:2G \rightarrow \displaystyle \bigoplus_{i=1}^{n} \mathbb{2Z}$, such that $2\varphi(x):=\varphi (x)+\varphi (x), $ is a isomorphism, then $G/2G \cong \displaystyle \bigoplus_{i=1}^{n} \mathbb{Z_2}$, thus, $|G/2G|=2^n$.
Finally, if $\displaystyle \bigoplus_{i=1}^{n} \mathbb{Z} \cong G\cong \displaystyle \bigoplus_{i=1}^{m} \mathbb{Z}$.
$2^m=|G/2G|=2^n$, we conclude that $n=m$.
Is my proof ok?

REPLY [7 votes]: The idea of your proof is fine, but there are some issues. (Contrary to the comments, it is not "OK".)
The main issue is with your function $2\varphi: 2G\rightarrow\bigoplus_{i=1}^{n} \mathbb{2Z}$, which you define by $2\varphi(x):= x+x$. Two issues:

The definition should be $2\varphi(x):= \varphi(x)+\varphi(x)$, as otherwise your codomain is incorrect ($x\in 2G$ not $\bigoplus_{i=1}^{n} \mathbb{2Z}$).
This is not the function you want. This function "doubles" elements, and you have already doubled every element by taking $2G$. In doubling them again you are essentially taking $4G$, so your quotient group, roughly, would be $$G/4G \cong \displaystyle \bigoplus_{i=1}^{n} \mathbb{Z_4}.$$
The function you are wanting is the restriction of $\varphi$ to $2G$, which is written $\varphi|_{2G}$. If you had used this function instead then everything else would have been fine.

Three other, more minor comments:

As @GregMartin commented, $2G\neq G+G$. Instead, $2G=\{x+x\mid x\in G\}$.
Maybe you could have justified the claim that $G/2G \cong\bigoplus_{i=1}^{n} \mathbb{Z_2}$? It is true, but if this was an exam the marking scheme might want you to prove this.
Don't use \displaystyle in your MathJax, as it can look weird. Instead, either put it on its own line, via $$...$$, or leave it as it is. For example, in the above I have used $\bigoplus_{i=1}^{n}$ "inline", but if I had put a \displaystyle infront, e.g. $\displaystyle\bigoplus_{i=1}^{n}$, it is distracting because it messes with spacing between lines (I've hopefully made my point but and just typing to add text to emphasise the line spacing issue).