# How to construct a map between the product group $Z_m\times Z_n$ and $Z_{mn}$ given that m and n are relatively prime numbers.

To prove that $Z_m\times Z_n$ is isomorphic to $Z_{mn}$ given that m and n are relatively prime numbers, I am trying to define a function $f:Z_m \times Z_n->Z_{mn}$. Of course $f(ab)=f(a)f(b)$ where $a, b$ belong to $Z_m \times Z_n$. Any general formula for such a mapping would be greatly appreciated. As of now, I have been able to map elements from $Z_m \times Z_n$ to $Z_{mn}$ by observing the order of elements in both the groups. However, I am unable to generalize this approach.

Both $\mathbb{Z}_m$ and $\mathbb{Z}_n$ are cyclic groups, so they have a generator. Let's call $a$ the generator of $\mathbb{Z}_m$ and $b$ the generator of $\mathbb{Z}_n$. Because $\gcd(m, n) = 1$, the element $(a, b) \in \mathbb{Z}_m\times\mathbb{Z}_n$ has order $mn$. You can see it this way, suppose $k$ satisfies the equation:

$$k\cdot (a, b) = (k\cdot a, k\cdot b) = (0, 0)$$

This would mean:

$$\begin{cases}k\cdot a \equiv 0 \pmod m\\ k\cdot b \equiv 0 \pmod n\end{cases}$$

Both $a$ and $b$ are invertible, once they are generators. So:

$$\begin{cases}k\equiv 0 \pmod m\\ k\equiv 0 \pmod n\end{cases}$$

Which means $k$ is a multiple of $mn$, once $m$ and $n$ are coprime, therefore $k = mn$ is the least positive integer that satisfies the first equation, wich proves $(a, b)$ has order $mn$. Mapping $(a, b)$ to the generator of $\mathbb{Z}_{mn}$ and you get the isomorphism needed.