Mathematics for Computer Science

(avery) #1

8.10. Euler’s Theorem 277


Proof. (of Euler’s Theorem 8.10.3 forZn)
Let
PWWDk 1 k 2 k.n/.Zn/


be the product inZnof all the numbers inZn. Let


QWWD.kk 1 /.kk 2 /.kk.n// .Zn/

for somek 2 Zn. Factoring outk’s immediately gives


QDk.n/P .Zn/:

ButQis the same as the product of the numbers inkZn, andkZnDZn, so we
realize thatQis the product of the same numbers asP, just in a different order.
Altogether, we have
P DQDk.n/P .Zn/:


Furthermore,P 2 Znby Lemma 8.10.4, and so it can be cancelled from both sides
of this equality, giving
1 Dk.n/.Zn/:



Euler’s theorem offers another way to find inverses modulon: ifkis relatively
prime ton, thenk.n/^1 is aZn-inverse ofk, and we can compute this power of
kefficiently using fast exponentiation. However, this approach requires computing
.n/. In the next section, we’ll show that computing.n/is easyifwe know the
prime factorization ofn. But we know that finding the factors ofnis generally hard
to do whennis large, and so the Pulverizer remains the best approach to computing
inverses modulon.


Fermat’s Little Theorem


For the record, we mention a famous special case of Euler’s Theorem that was
known to Fermat a century earlier.


Corollary 8.10.8(Fermat’s Little Theorem).Supposepis a prime andkis not a
multiple ofp. Then:
kp^1 1 .modp/

Free download pdf