Read · 2 min
Fermat's Little Theorem (FLT) is an incredibly useful theorem in its own right. However, it only applies to prime bases, and "most" integers are certainly not prime. How can we generalize FLT to any integer base?
It is clear that simply stating if will not work here. As a simple counterexample, take and . Looking at why this doesn't work will give us a clue regarding how we should generalize FLT.
Recall the proof of FLT. If you trace through it, you will find that it works in almost exactly the same way ... until the very end: In the very last step, we divide both sides of the congruence by to obtain our final result: But if is not prime, then this no longer works! Think about why not before moving on.
For not prime, , meaning that is definitely not relatively prime to . Remember that, in general, you cannot divide in congruences unless the factor being removed on both sides is relatively prime to the base. For example, is not valid, because and are not relatively prime, but is valid, because and are relatively prime.
This gives us the clue we need. Instead of taking the set , we need to take a set with all numbers relatively prime to . How many positive integers less than or equal to are relatively prime to ? It's our familiar friend: Euler's totient function, ! We are now ready to state Euler's Theorem:
If , then:
Our proof of Euler's Theorem will mimic that of FLT very closely. Let be all of the integers between and , inclusive, that are relatively prime to . Now, consider the set . We will prove that this set is an abbreviated residue class modulo , meaning that it contains every remainder relatively prime to exactly once.
It is clear that all of the elements in the set are relatively prime to . Assume, for the sake of contradiction, that for . Then, , which is a contradiction, since is not a multiple of . Therefore, all of the elements are distinct modulo . Thus, since these elements can only occupy residue classes, each residue class must be occupied exactly once.
Since is an abbreviated residue class, it follows that: Since is relatively prime to , we may divide by in the above congruence to obtain: Thus, we have proved Euler's Theorem.