# Proving $\mathbb{Z}/m\mathbb{Z}\ltimes \mathbb{Z}/n\mathbb{Z}$ abelian if and only if $m$ and $\varphi(n)$ are co-prime

If I've got the right idea of how the group operation of a semi-direct product works, then for some $c\in \mathrm{Hom}(\mathbb{Z}/n\mathbb{Z},\mathrm{Aut}\left(\mathbb{Z}/n\mathbb{Z}\right))$ and $([x_1],[y_1]), ([x_2],[y_2]) \in \mathbb{Z}/m\mathbb{Z}\ltimes\mathbb{Z}/n\mathbb{Z}$,

\begin{align*} ([x_1],[y_1])\cdot([x_2],[y_2]) &= \left([x_1][x_2],c([x_2])[y_1][y_2]\right)\\ &= \left([x_1x_2],c([x_2])[y_1y_2]\right) \end{align*}

and I want to show that this commutes if and only if $\gcd(m,\varphi(n)) = 1$. I've shown that $\mathrm{Aut}\left(\mathbb{Z}/n\mathbb{Z}\right)\cong \left(\mathbb{Z}/n\mathbb{Z}\right)^\times$, but I'm not sure where to go from here. Any assistance would be appreciated.

• What would have to be true for this operation to be commutative? – Mark Oct 25 '17 at 0:30
• More accurately, you're proving every semidirect product of the form $\Bbb Z_m\rtimes\Bbb Z_n$ is abelian iff $(m,\varphi(n))=1$. In any case, since the group is generated by $(1,0)$ and $(0,1)$, it's enough to verify those elements commute no matter what $c$ is. – anon Oct 25 '17 at 0:32
• By this, I mean that we want $([x_1],[y_1])\cdot ([x_2],[y_2]) =\dots = ([x_2],[y_2])\cdot ([x_1],[y_1])$. You've gotten stuck starting from the left and moving to the right. Why not try to start from the right and work towards where you are on the left? It'll help you understand what "gap" you need to fill. – Mark Oct 25 '17 at 0:32
• I'll play around with it, thanks. – Möbius Dickus Oct 25 '17 at 0:35

First of all, as anon commented, this question is ill defined right now: The structure of $\mathbb{Z}/m\mathbb{Z} \ltimes_c \mathbb{Z}/n\mathbb{Z}$ depends on the choice of $c:\mathbb{Z}/m\mathbb{Z} \rightarrow \text{Aut}(\mathbb{Z}/n\mathbb{Z})$, hence the $c$-subscript I've written. It's a true statement that every such semidirect product is abelian if and only if m and $\varphi(n)$ are coprime.
Secondly, you don't have the composition law right. Writing $x \cdot y$ for the action of $x \in \mathbb{Z}/m\mathbb{Z}$ on $y \in \mathbb{Z}/n \mathbb{Z}$, we want $(x_1,y_1)(x_2,y_2) = (x_1 x_2, (x_2 \cdot y_1) y_2).$ It looks like you've written $(x_1 x_2, x_2 \cdot (y_1 y_2))$.
Ok, now let's prove our statement. It's clear from this composition law that if every $x$ acts as the identity on every $y$, i.e, if $c$ is the trivial map, then our semidirect product is actually a direct product, so our group is abelian. The image of $c$ must be a subgroup of $\text{Aut}(\mathbb{Z}/n\mathbb{Z}) \cong (\mathbb{Z}/n\mathbb{Z})^\times$, but this group has size $\varphi(n)$, so by Lagrange's Theorem the size of the image divides $\varphi(n)$. The size of the image also must divide $n$ since it can be identified with a quotient of $\mathbb{Z}/m \mathbb{Z}$ by the first isomorphism theorem, so what does this mean about the image when $m$ and $\varphi(n)$ are coprime?
Conversely, if there is some common divisor, $p$, then we get a nontrivial map $c$ by sending $1$ to $\sigma$, where $\sigma$ is some automorphism of order $p$. Then there is some $x$ and $y$ with $x \cdot y \neq y$. Then $(1,y)(x,1) = (x,y \cdot x)$, but $(x,1)(1,y) = (x,y)$, so the group is not abelian.