It is given that the rings $\mathbb Z^m$ and $\mathbb Z^n$ are isomorphic. Show that $m=n$.
My try:
I want to show that $m\leq n$ and $n\leq m$ .
Suppose $m\leq n$.Let $\phi:\mathbb Z^m\to \mathbb Z^n$ be the given isomorphism.Then since $(\underbrace{1,1,\ldots, 1}_{m \text{ times}})$ is the identity of $\mathbb Z^m$ so $\phi(\underbrace{1,1,\ldots, 1}_{m \text{ times}})=(\underbrace{1,1,\ldots, 1}_{n \text{ times}})$.
Also $\mathbb Z^m$ has $m$ generators, $\{(1,0,\ldots, 0),(0,1,\ldots,0),\dots,(0,0,\ldots,1)\}$. Since $\phi $ is an isomorphism it must map a generator to a generator.
Now obviously $\mathbb Z^n$ has a set of $n$ generators given by $(1,0,0\ldots,0),(0,1,0\ldots0),(0,0,1,\ldots0),\dots,(0,0,\ldots, 1)$.Let $A$ be the set of generators of $\mathbb Z^n$. Then if it can be shown that card $A$ is $n$ ,then we cannot map a set of $m$ elements injectively to a set of $n$ elements and hence a contradiction is reached and then we are done.
How to proceed from here?