TITLE: Proof of $(\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z}) \cong \mathbb{Z}/ \gcd(m,n)\mathbb{Z}$
QUESTION [68 upvotes]: I've just started to learn about the tensor product and I want to show: $$(\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z}) \cong \mathbb{Z}/ \gcd(m,n)\mathbb{Z}.$$
Can you tell me if my proof is right:
$\mathbb{Z}/m\mathbb{Z}$ and $\mathbb{Z} / n \mathbb{Z}$ are both finite free $\mathbb{Z}$-modules with the basis consisting of one single element $\{ 1 \}$. So $(\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z})$ has the basis $\{ 1 \otimes 1 \}$.
Therefore, any element in $(\mathbb{Z}/m\mathbb{Z}) \otimes_\mathbb{Z} (\mathbb{Z} / n \mathbb{Z})$  is of the form $(ab) 1 \otimes 1$ and any element in $\mathbb{Z}/ \gcd(m,n)\mathbb{Z}$ is of the form $k 1 = k$ where $k \in \{ 0, \dots , \gcd(n,m) \}$.
I would like to construct an isomorphism that maps $ab$ to some $k$. Let this map be $ab (1 \otimes 1) \mapsto ab \bmod \gcd(n,m)$.
This is a homomorphism between modules: it maps $0$ to $0$ because it maps the empty sum to the empty sum. It also fulfills $f(a + b) = f(a) + f(b)$ because there is only one element, $a = 1$. 
It is surjective. So all I need to show is that it is injective. But that is clear too because if $ab \equiv 0 \bmod \gcd(m,n)$  then both $a \equiv 0 \bmod n$ and $b \equiv 0 \bmod m$ so the kernel is trivial.
Many thanks for your help!!

REPLY [40 votes]: The better way to define a homomorphism from $\mathbb{Z}/m\mathbb{Z}\otimes \mathbb{Z}/n\mathbb{Z}$ to $\mathbb{Z}/\gcd(m,n)\mathbb{Z}$ is via the universal property.
Note that the map $\mathbb{Z}/m\mathbb{Z}\times \mathbb{Z}/n\mathbb{Z}\to \mathbb{Z}/\gcd(m,n)\mathbb{Z}$ defined by $$(x+m\mathbb{Z},y+n\mathbb{Z})\mapsto xy+\gcd(m,n)\mathbb{Z}$$ is well-defined and also bi-linear, thus by the universal property of tensor product, there is a linear map $f:\mathbb{Z}/m\mathbb{Z}\otimes \mathbb{Z}/n\mathbb{Z}\to \mathbb{Z}/\gcd(m,n)\mathbb{Z}$ such that $$f(x+m\mathbb{Z}\otimes y+n\mathbb{Z})=xy+\gcd(m,n)\mathbb{Z}.$$ Verify that the linear map $g:\mathbb{Z}/\gcd(m,n)\mathbb{Z}\to\mathbb{Z}/m\mathbb{Z}\otimes\mathbb{Z}/n\mathbb{Z}$ defined by
$$g(z+\gcd(m,n)\mathbb{Z})=(z+m\mathbb{Z})\otimes (1+n\mathbb{Z})$$
is well-defined, and we also have  $g\circ f=1, f\circ g=1$, thus $f$ is an isomorphism. To see  $g$ is well-defined, you may use the equality that $\gcd(m,n)=am+bn$ for some integers $a,b\in\mathbb{Z}$.