Fermat's little theorem
Consider modular arithmetic under modulo . We fix number so that . Let us write a function where . We argued before (when we proved that the inverse exists) that is a bijection. Therefore,
This gives us . Equivalently, divides . When is prime, we know that divides .
For any prime and number that is not divisible by , we have .
Remark the distinction between the elementary FT and the much-more-difficult-to-prove Fermat's Last Theorem (FLT). The correctness of RSA follows from a simple application of FT.
We have that .
Since , we can write for some integer . Therefore,
We argue that and , which would imply the desired result (do you see why?). We only prove the former claim (the latter case is symmetrical). To prove , we consider two cases:
- If is divisible by , notice that is also divisible by .
- If is not divisible by , we can apply FT to obtain and therefore .
Prove that for all integer . Your proof should be at most a few lines (in particular, do not list all possible choices of ).