Isomorphism between free abelian groups

Let $A_1$ and $A_2$ be two free abelian group generated on the same finite set $X$. I have to demonstrate that are isomorphic if and only if have the same characteristic $rank(A_1)=rank(A_2)$.

The "only if" is easy. But I don't know how to proceed to deduce the isomorphims of the two free abelian groups if $rank(A_1)=rank(A_2)$.

Note: if $A$ is a finetely generated abelian group it can be written as $$A=\mathbb{Z_{n_1}} \otimes...\otimes\mathbb{Z_{n_1}}\otimes\mathbb{Z^r}$$ in this contest by definition the rank of the abelian group is $rank(A)=r$.

Can anybody give me an hint?

• What does "characteristic" mean here? – Lord Shark the Unknown Apr 22 '17 at 5:23
• So who is "the author"? Where does the problem originate. As far as I am concerned there is a simple notion of free Abelian group, and to show that the isomorphism type determines the size of the generating set, the usual trick is to tensor with a field and use invariance of dimension. – Lord Shark the Unknown Apr 22 '17 at 5:56
• I was really wrong, the definition of the characteristic was something different of what I thought... I edited the question – Dac0 Apr 22 '17 at 6:15
• Is that in my language characteristic and rank are translated the same way – Dac0 Apr 22 '17 at 6:34

A finitely generated free Abelian group is isomorphic to $\Bbb Z^r$ where the rank $r$ is the size of the generating set. It is clear that $r$ determines the structure of $\Bbb Z^r$.
If $\Bbb Z^r\cong\Bbb Z^s$ then $(\Bbb Z/2\Bbb Z)^r\cong(\Bbb Z/2\Bbb Z)^s$ so $2^r=2^s$ and $r=s$. (For Abelian $G$ and $H$, $G\cong H$ implies $G/2G\cong H/2H$.)