Let's first talk about the case when \(m=1\) and \(n=1\), then this case is trivial:
$$ (a-b)|(a-b) $$
Now let \(m=1\) and \(n \gt 1\). We are going to prove by using mathematical induction that:
$$ (a-b)|(a^n - b^n) $$
We know that there exists a value of \(k\) (=1) for which \((a-b)|(a^k - b^k)\). If we use \(k+1\):
$$ a^{k+1} - b^{k+1} = a(a^k - b^k) + b^k (a-b) $$
This means if \((a-b) | a(a^k - b^k)\) and \((a-b) | b^k (a-b)\), then \((a-b)|(a^{k+1} - b^{k+1})\). This proves that \((a-b)|(a^n - b^n)\) when \(n \gt 1\). Now let's talk about the next case where \(m \gt 1\), \(n \gt 1\) and \(m|n\), and let \(mk=n\), then:
$$ a^n - b^n = a^{mk} - b^{mk} = (a^m)^k - (b^m)^k $$
Let \(x = a^m\) and \(y = b^m\):
$$ a^n - b^n = x^k - y^k $$
Through the previous case, we know that \(x-y\) divides \(x^k - y^k\), which means:
$$ (x-y)|(a^n - b^n) $$$$ (a^m - b^m)|(a^n - b^n) $$