TITLE: A group such that $a^m b^m = b^m a^m$ and $a^n b^n = b^n a^n$ ($m$, $n$ coprime) is abelian?
QUESTION [21 upvotes]: Let $(G,.)$ be a group and $m,n \in\mathbb Z$ such that $\gcd(m,n)=1$. Assume that
$$ \forall a,b \in G, \,a^mb^m=b^ma^m,$$
$$\forall a,b \in G, \, a^nb^n=b^na^n.$$
Then how prove $G$ is an abelian group?
Some context: Some of these commutation relations often imply that $G$ is abelian, for example if $(ab)^i = a^i b^i$ for three consecutive integers $i$ then $G$ is abelian, or if $g^2 = e$ for all $g$ then $G$ is abelian. This looks like another example of this phenomenon, but the same techniques do not apply.

REPLY [12 votes]: Write $mk+nl=1$ for some $k,l\in\mathbb Z$.
We have
$$\begin{align}
ab&=a^{mk+nl}b^{mk+nl}\\
&=a^{mk}(a^{nl}b^{mk})b^{nl}\\
&\stackrel{(*)}=a^{mk}(b^{mk}a^{nl})b^{nl}\\
&=(a^{mk}b^{mk})(a^{nl}b^{nl})\\
&=(b^{mk}a^{mk})(b^{nl}a^{nl})\\
&=b^{mk}(a^{mk}b^{nl})a^{nl}\\
&\stackrel{(**)}=b^{mk}(b^{nl}a^{mk})a^{nl}\\
&=(b^{mk}b^{nl})(a^{mk}a^{nl})\\
&=b^{mk+nl}a^{mk+nl}\\
&=ba,
\end{align}$$
where we used
$$a^{nl}b^{mk}=b^{mk}a^{nl}\qquad(*)$$ and $$a^{mk}b^{nl}=b^{nl}a^{mk}\qquad(**)$$
Let's prove $(*)$ and $(**)$:
$$\begin{align}
(a^mb^n)^{mk}&=a^m(b^na^m)^{mk-1}b^n\\
&=a^m(b^na^m)^{mk}a^{-m},
\end{align}$$
which implies
$$(a^mb^n)^{mk}a^m=a^m(b^na^m)^{mk}\\ \Rightarrow a^m(a^mb^n)^{mk}=a^m(b^na^m)^{mk},$$
hence
$$(a^mb^n)^{mk}=(b^na^m)^{mk}.\qquad(\sharp)$$
Similarly we get $$(a^mb^n)^{nl}=(b^na^m)^{nl}.\qquad(\sharp\sharp)$$
Multiplying $(\sharp)$ and $(\sharp\sharp)$ we obtain $a^mb^n=b^na^m$.
Proceeding in the same way we get $a^nb^m=b^ma^n$
An easy induction shows now $(*)$ and $(**)$.