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...