Fermat's little theorem proof?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
Cheesycheese213
Messages
55
Reaction score
8
So I was taught that
If gcd (a, p) = 1, then ap-1 ≡ 1 (mod p)
And then the proof was
Lemma:
Let p be prime, Let i, j ,k = Integers
If gcd (k, p) = 1 and ik ≡ jk (mod p)
then i ≡ j (mod p)
Main Proof:
Consider 1a, 2a, 3a, ..., (p - 1)a
Taking mod p is some arrangement of 1, 2, 3, ..., p - 1
Then (p - 1)! ap-1 ≡ (p - 1)! mod p
Therefore, ap-1 ≡ 1

But I couldn't really understand the part going from the 1, 2, 3, ..., p - 1 to the next step. Where and how did they get that equation?

Thanks!

P.S. Looking online, people did the proof a different way, but then the last line before the therefore is the same?
 
Mathematics news on Phys.org
Whatever a is, your set of 1a, 2a, 3a, ..., (p - 1)a will have every possible remainder mod p (apart from 0) in it exactly once. It shares this property with the set 1, 2, 3, ..., p - 1. If you multiply all together their remainder has to be the same.

As an example: With p=5 and a=3 you get (3,6,9,12) -> (3,1,4,2) mod 5, multiply everything and (5 - 1)! 35-1 ≡ (5-1)! mod 5.
 
  • Like
Likes   Reactions: Cheesycheese213