COMP 2711H: Lecture 24
Date: 2024-10-28 09:07:24
Reviewed:
Topic / Chapter:
summary
❓Questions
Notes
Fermat's Little Theorem
-
Fermat's Little Theorem
- theorem: for every prime ,
- one to one: as we can cancel by multiplying both side
- onto: create a program to check
- code
vector<int> seen; cin >> p >> a; // e.g. p = 11, a = 2 int p, a; for (int i = 0; i < p; ++i) if (!seen[i]) { } for (int j = 0; )
- if succeed (primitive root), we will result in: (multiplicative) cycle
- cycle involving only
- cycle involving others
- not always the case: e.g.
- results in cycle size of:
- cycle starting w/ 1: size
- as , : first element star
- code
- cycles will have the same size, except
- as each element: can be seen as
- and thus: elements are divided evenly
- s.t. it's divisor of
- different proof:
- let there be additive cycle of
- which is an equivalent set of
- and multiplying both sides, we get:
- cancelling from both dies, we get
- thus
- let there be additive cycle of
- proof by induction on
- rewrite FLT s.t.
- theorem: for every prime , integer ,
- 👨🏫 now works for too
- claim:
- then: all terms except are congruent to
- lemma:
- claim: it's multiple of when
- as it involves in denominator
- claim: it's multiple of when
- rewrite FLT s.t.
- theorem: for every prime ,
-
Computing modular exponentiation
- for , compute
- (depends on the size of cycle)
- theorem: if then
- simply: take modulus of on exponent
- then check it using the fast modulus algorithm
- for , compute
-
Non-prime number FLT
- assumption breaks: all cycle no longer necessarily w/ same size
- let , define as
- : Euler's totient function
- 👨🏫 not a meaningful name, "how many" or something in latin
- for prime :
- for
- claim:
- intuition: of all numbers: not having in prime factorization
- by multiplying all: we find proportion without common factors
- proof 1: suppose
- for CRT: we obtain "unique solution" for linear system of congruent equation
- 👨🏫 no matter how you choose
- for
- and such numbers within
-
- and manipulate it s.t.
- now, for
- let
- then we have: rel. prime number within
- for
- thus multiply it by , we obtain
- for CRT: we obtain "unique solution" for linear system of congruent equation
- proof 2:
- lemma: if , then
- same as: obtaining solution of system of equation
-
- choose s.t.
-
- choose s.t.
-
- s.t.
- according to CRF, within , we have unique solution for above system
- finally:
- same as: obtaining solution of system of equation
- consider
-
- as numbers are rel. prime to
-
- general case:
- then, for each
- thus:
- lemma: if , then
-
Euler's theorem
- extension of FLT
- let , then
-
-
- one-to-one as can be cancelled from both sides
- : provides cycles (excluding )
- sum of sizes on each cycle
- total size:
- 👨🏫 try to extend other proof of FLT for Euler's theorem
-
Wilson's theorem
- Wilson "guessed" it, not proved it
- but British always have to take fame :p
- for every prime ,
- e.g.
-
- as:
- as:
- second attempt:
- use similar idea:
- as
- 👨🏫 and is the only case
- thus : must include number and its (distinct) MMI as pairs
- naturally:
- lemma: the only s.t. are
- (Euclid's lemma)
- Wilson "guessed" it, not proved it