proof of Euler-Fermat theorem
Let be all positive integers less than which are coprime to . Since , then the set are each congruent
to one of the integers in some order. Taking the product
of these congruences
, we get
hence
Since , we can divide both sides by , and the desired result follows.