If a is coprime to n, then a raised to the power phi(n) is congruent to one modulo n.
Multiplication by a unit permutes the reduced residue classes modulo . Multiplying all classes before and after this permutation and cancelling their unit product proves .
Codex Wiki