Bonus Lecture 2: Eulers Totient Theorem Primes Are Overrated - - PowerPoint PPT Presentation

bonus lecture 2 euler s totient theorem
SMART_READER_LITE
LIVE PREVIEW

Bonus Lecture 2: Eulers Totient Theorem Primes Are Overrated - - PowerPoint PPT Presentation

Bonus Lecture 2: Eulers Totient Theorem Primes Are Overrated Anyways 1 / 10 i i i ai mod p i i i i i 1 exists for all i i i 1 i i Factor out a : a p 1 p Recall From the Future... 1 2 1 Multiply by 1 p What happens if p not prime? p


slide-1
SLIDE 1

Bonus Lecture 2: Euler’s Totient Theorem

Primes Are Overrated Anyways

1 / 10

slide-2
SLIDE 2

Recall From the Future...

“Recall” Fermat’s Little Theorem: Theorem: Let p be prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof: f x ax p is biject. on 1 2 p 1 So 1 p 1 a p 1 a p Means

i i i ai mod p

Factor out a:

i i

ap 1

i i

p i 1 exists for all i 1 2 p 1 Multiply by

i i 1 i i 1

p What happens if p not prime?

2 / 10

slide-3
SLIDE 3

Recall From the Future...

“Recall” Fermat’s Little Theorem: Theorem: Let p be prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof:

▶ f(x) = ax (mod p) is biject. on {1, 2, ..., p − 1} ▶ So {1, ..., p − 1} = {a, ..., (p − 1)a} (mod p)

Means

i i i ai mod p

Factor out a:

i i

ap 1

i i

p i 1 exists for all i 1 2 p 1 Multiply by

i i 1 i i 1

p What happens if p not prime?

2 / 10

slide-4
SLIDE 4

Recall From the Future...

“Recall” Fermat’s Little Theorem: Theorem: Let p be prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof:

▶ f(x) = ax (mod p) is biject. on {1, 2, ..., p − 1} ▶ So {1, ..., p − 1} = {a, ..., (p − 1)a} (mod p) ▶ Means ∏

i i = ∏ i(ai mod p)

▶ Factor out a: ∏

i i ≡ ap−1 ∏ i i (mod p)

i 1 exists for all i 1 2 p 1 Multiply by

i i 1 i i 1

p What happens if p not prime?

2 / 10

slide-5
SLIDE 5

Recall From the Future...

“Recall” Fermat’s Little Theorem: Theorem: Let p be prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof:

▶ f(x) = ax (mod p) is biject. on {1, 2, ..., p − 1} ▶ So {1, ..., p − 1} = {a, ..., (p − 1)a} (mod p) ▶ Means ∏

i i = ∏ i(ai mod p)

▶ Factor out a: ∏

i i ≡ ap−1 ∏ i i (mod p)

▶ i−1 exists for all i ∈ {1, 2, ..., p − 1} ▶ Multiply by (∏

i i)−1 ≡ ∏ i(i−1) (mod p)

What happens if p not prime?

2 / 10

slide-6
SLIDE 6

Recall From the Future...

“Recall” Fermat’s Little Theorem: Theorem: Let p be prime and a ̸≡ 0 (mod p). Then ap−1 ≡ 1 (mod p). Proof:

▶ f(x) = ax (mod p) is biject. on {1, 2, ..., p − 1} ▶ So {1, ..., p − 1} = {a, ..., (p − 1)a} (mod p) ▶ Means ∏

i i = ∏ i(ai mod p)

▶ Factor out a: ∏

i i ≡ ap−1 ∏ i i (mod p)

▶ i−1 exists for all i ∈ {1, 2, ..., p − 1} ▶ Multiply by (∏

i i)−1 ≡ ∏ i(i−1) (mod p)

What happens if p not prime?

2 / 10

slide-7
SLIDE 7

Euler Attempt 1

Claim: If a ̸≡ 0 (mod m), am−1 ≡ 1 (mod m). “Proof”: Is ax m a biject. on 1 m 1 ? Not necessarily! 2x 4 maps 1 2 3 to 2 0 2 ! Generally have issues if a m 1 Not recoverable: if am 1 1 m , am 2 is a 1!

3 / 10

slide-8
SLIDE 8

Euler Attempt 1

Claim: If a ̸≡ 0 (mod m), am−1 ≡ 1 (mod m). “Proof”:

▶ Is ax (mod m) a biject. on {1, ..., m − 1}?

Not necessarily! 2x 4 maps 1 2 3 to 2 0 2 ! Generally have issues if a m 1 Not recoverable: if am 1 1 m , am 2 is a 1!

3 / 10

slide-9
SLIDE 9

Euler Attempt 1

Claim: If a ̸≡ 0 (mod m), am−1 ≡ 1 (mod m). “Proof”:

▶ Is ax (mod m) a biject. on {1, ..., m − 1}? ▶ Not necessarily! ▶ 2x (mod 4) maps {1, 2, 3} to {2, 0, 2}!

Generally have issues if a m 1 Not recoverable: if am 1 1 m , am 2 is a 1!

3 / 10

slide-10
SLIDE 10

Euler Attempt 1

Claim: If a ̸≡ 0 (mod m), am−1 ≡ 1 (mod m). “Proof”:

▶ Is ax (mod m) a biject. on {1, ..., m − 1}? ▶ Not necessarily! ▶ 2x (mod 4) maps {1, 2, 3} to {2, 0, 2}!

Generally have issues if gcd(a, m) ̸= 1 Not recoverable: if am 1 1 m , am 2 is a 1!

3 / 10

slide-11
SLIDE 11

Euler Attempt 1

Claim: If a ̸≡ 0 (mod m), am−1 ≡ 1 (mod m). “Proof”:

▶ Is ax (mod m) a biject. on {1, ..., m − 1}? ▶ Not necessarily! ▶ 2x (mod 4) maps {1, 2, 3} to {2, 0, 2}!

Generally have issues if gcd(a, m) ̸= 1 Not recoverable: if am−1 ≡ 1 (mod m), am−2 is a−1!

3 / 10

slide-12
SLIDE 12

Euler Attempt 2

Claim: If gcd(a, m) = 1, am−1 ≡ 1 (mod m). Proof: f x ax m is biject. on 1 m 1 So 1 m 1 a m 1 a m Means

i i i ai mod m

Factor out a:

i i

am 1

i i

m Issue: not all is have inverses So

i i 1 DNE!

4 / 10

slide-13
SLIDE 13

Euler Attempt 2

Claim: If gcd(a, m) = 1, am−1 ≡ 1 (mod m). Proof:

▶ f(x) = ax (mod m) is biject. on {1, ..., m − 1} ▶ So {1, ..., m − 1} = {a, ..., (m − 1)a} (mod m)

Means

i i i ai mod m

Factor out a:

i i

am 1

i i

m Issue: not all is have inverses So

i i 1 DNE!

4 / 10

slide-14
SLIDE 14

Euler Attempt 2

Claim: If gcd(a, m) = 1, am−1 ≡ 1 (mod m). Proof:

▶ f(x) = ax (mod m) is biject. on {1, ..., m − 1} ▶ So {1, ..., m − 1} = {a, ..., (m − 1)a} (mod m) ▶ Means ∏

i i = ∏ i(ai mod m)

▶ Factor out a: ∏

i i ≡ am−1 ∏ i i (mod m)

Issue: not all is have inverses So

i i 1 DNE!

4 / 10

slide-15
SLIDE 15

Euler Attempt 2

Claim: If gcd(a, m) = 1, am−1 ≡ 1 (mod m). Proof:

▶ f(x) = ax (mod m) is biject. on {1, ..., m − 1} ▶ So {1, ..., m − 1} = {a, ..., (m − 1)a} (mod m) ▶ Means ∏

i i = ∏ i(ai mod m)

▶ Factor out a: ∏

i i ≡ am−1 ∏ i i (mod m)

▶ Issue: not all is have inverses ▶ So (∏

i i)−1 DNE!

4 / 10

slide-16
SLIDE 16

Euler Attempt 3

Theorem: Let φ(m) be |{x ∈ Zm| gcd(x, m) = 1}|.1 Then for a coprime to m, aφ(m) ≡ 1 (mod m). Proof: Let S x

m

x m 1 f x ax m is bijection on S So S ax mod m x S Hence

i S i i S ai mod m

Factor out a:

i S i

a S

i S i

m

i S i 1 i S i 1

m , so exists! Multiply to get a

m

1 m

1φ(·) is known as Euler’s Totient Function.

5 / 10

slide-17
SLIDE 17

Euler Attempt 3

Theorem: Let φ(m) be |{x ∈ Zm| gcd(x, m) = 1}|.1 Then for a coprime to m, aφ(m) ≡ 1 (mod m). Proof:

▶ Let S = {x ∈ Zm| gcd(x, m) = 1} ▶ f(x) = ax (mod m) is bijection on S

So S ax mod m x S Hence

i S i i S ai mod m

Factor out a:

i S i

a S

i S i

m

i S i 1 i S i 1

m , so exists! Multiply to get a

m

1 m

1φ(·) is known as Euler’s Totient Function.

5 / 10

slide-18
SLIDE 18

Euler Attempt 3

Theorem: Let φ(m) be |{x ∈ Zm| gcd(x, m) = 1}|.1 Then for a coprime to m, aφ(m) ≡ 1 (mod m). Proof:

▶ Let S = {x ∈ Zm| gcd(x, m) = 1} ▶ f(x) = ax (mod m) is bijection on S ▶ So S = {ax mod m|x ∈ S} ▶ Hence ∏

i∈S i = ∏ i∈S(ai mod m)

Factor out a:

i S i

a S

i S i

m

i S i 1 i S i 1

m , so exists! Multiply to get a

m

1 m

1φ(·) is known as Euler’s Totient Function.

5 / 10

slide-19
SLIDE 19

Euler Attempt 3

Theorem: Let φ(m) be |{x ∈ Zm| gcd(x, m) = 1}|.1 Then for a coprime to m, aφ(m) ≡ 1 (mod m). Proof:

▶ Let S = {x ∈ Zm| gcd(x, m) = 1} ▶ f(x) = ax (mod m) is bijection on S ▶ So S = {ax mod m|x ∈ S} ▶ Hence ∏

i∈S i = ∏ i∈S(ai mod m)

▶ Factor out a: ∏

i∈S i ≡ a|S| ∏ i∈S i (mod m)

▶ (∏

i∈S i

)−1 ≡ ∏

i∈S(i−1) (mod m), so exists!

▶ Multiply to get aφ(m) ≡ 1 (mod m)

1φ(·) is known as Euler’s Totient Function.

5 / 10

slide-20
SLIDE 20

Understanding φ

Claim: Suppose m can be factored as pn1

1 · ... · pnk k .

Then φ(m) = (p1 − 1)pn1−1

1

· ... · (pk − 1)pnk−1

k

. Examples: m 12 22 3 12 2 1 21 3 1 30 4 1, 5, 7, 11 m 11 11 11 1 110 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 m 90 2 32 5 90 2 1 20 3 1 31 5 1 50 24 1,7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 77,79,83,89

6 / 10

slide-21
SLIDE 21

Understanding φ

Claim: Suppose m can be factored as pn1

1 · ... · pnk k .

Then φ(m) = (p1 − 1)pn1−1

1

· ... · (pk − 1)pnk−1

k

. Examples:

▶ m = 12 = 22 · 3

▶ φ(12) = (2 − 1)21 · (3 − 1)30 = 4 ▶ 1, 5, 7, 11

m 11 11 11 1 110 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 m 90 2 32 5 90 2 1 20 3 1 31 5 1 50 24 1,7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 77,79,83,89

6 / 10

slide-22
SLIDE 22

Understanding φ

Claim: Suppose m can be factored as pn1

1 · ... · pnk k .

Then φ(m) = (p1 − 1)pn1−1

1

· ... · (pk − 1)pnk−1

k

. Examples:

▶ m = 12 = 22 · 3

▶ φ(12) = (2 − 1)21 · (3 − 1)30 = 4 ▶ 1, 5, 7, 11

▶ m = 11

▶ φ(11) = (11 − 1)110 = 10 ▶ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

m 90 2 32 5 90 2 1 20 3 1 31 5 1 50 24 1,7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 77,79,83,89

6 / 10

slide-23
SLIDE 23

Understanding φ

Claim: Suppose m can be factored as pn1

1 · ... · pnk k .

Then φ(m) = (p1 − 1)pn1−1

1

· ... · (pk − 1)pnk−1

k

. Examples:

▶ m = 12 = 22 · 3

▶ φ(12) = (2 − 1)21 · (3 − 1)30 = 4 ▶ 1, 5, 7, 11

▶ m = 11

▶ φ(11) = (11 − 1)110 = 10 ▶ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

▶ m = 90 = 2 · 32 · 5

▶ φ(90) = (2−1)20·(3−1)31·(5−1)50 = 24 ▶ 1,7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,

47, 49, 53, 59, 61, 67, 71, 73, 77,79,83,89

6 / 10

slide-24
SLIDE 24

φ Is Multiplicative

Lemma: If gcd(m, n) = 1, φ(mn) = φ(m)φ(n). Proof: Consider b

mn m n such that

b x x mod m x mod n CRT gives b 1

m n mn

Claim: x invertible ifg b x is xx 1 1 m , xx 1 1 n If ax 1 m and ax 1 n , ax 1 mn m inv. choices for b x 1, n for b x 2 Thus, m n inv. choices for b x

7 / 10

slide-25
SLIDE 25

φ Is Multiplicative

Lemma: If gcd(m, n) = 1, φ(mn) = φ(m)φ(n). Proof:

▶ Consider b : Zmn → Zm × Zn such that

b(x) = (x mod m, x mod n) CRT gives b 1

m n mn

Claim: x invertible ifg b x is xx 1 1 m , xx 1 1 n If ax 1 m and ax 1 n , ax 1 mn m inv. choices for b x 1, n for b x 2 Thus, m n inv. choices for b x

7 / 10

slide-26
SLIDE 26

φ Is Multiplicative

Lemma: If gcd(m, n) = 1, φ(mn) = φ(m)φ(n). Proof:

▶ Consider b : Zmn → Zm × Zn such that

b(x) = (x mod m, x mod n)

▶ CRT gives b−1 : Zm × Zn → Zmn

Claim: x invertible ifg b x is xx 1 1 m , xx 1 1 n If ax 1 m and ax 1 n , ax 1 mn m inv. choices for b x 1, n for b x 2 Thus, m n inv. choices for b x

7 / 10

slide-27
SLIDE 27

φ Is Multiplicative

Lemma: If gcd(m, n) = 1, φ(mn) = φ(m)φ(n). Proof:

▶ Consider b : Zmn → Zm × Zn such that

b(x) = (x mod m, x mod n)

▶ CRT gives b−1 : Zm × Zn → Zmn ▶ Claim: x invertible ifg b(x) is

xx 1 1 m , xx 1 1 n If ax 1 m and ax 1 n , ax 1 mn m inv. choices for b x 1, n for b x 2 Thus, m n inv. choices for b x

7 / 10

slide-28
SLIDE 28

φ Is Multiplicative

Lemma: If gcd(m, n) = 1, φ(mn) = φ(m)φ(n). Proof:

▶ Consider b : Zmn → Zm × Zn such that

b(x) = (x mod m, x mod n)

▶ CRT gives b−1 : Zm × Zn → Zmn ▶ Claim: x invertible ifg b(x) is

▶ xx−1 ≡ 1 (mod m), xx−1 ≡ 1 (mod n) ▶ If ax ≡ 1 (mod m) and ax ≡ 1 (mod n),

ax ≡ 1 (mod mn) m inv. choices for b x 1, n for b x 2 Thus, m n inv. choices for b x

7 / 10

slide-29
SLIDE 29

φ Is Multiplicative

Lemma: If gcd(m, n) = 1, φ(mn) = φ(m)φ(n). Proof:

▶ Consider b : Zmn → Zm × Zn such that

b(x) = (x mod m, x mod n)

▶ CRT gives b−1 : Zm × Zn → Zmn ▶ Claim: x invertible ifg b(x) is

▶ xx−1 ≡ 1 (mod m), xx−1 ≡ 1 (mod n) ▶ If ax ≡ 1 (mod m) and ax ≡ 1 (mod n),

ax ≡ 1 (mod mn)

▶ φ(m) inv. choices for b(x)1, φ(n) for b(x)2 ▶ Thus, φ(m)φ(n) inv. choices for b(x)

7 / 10

slide-30
SLIDE 30

φ For Prime Powers

Lemma: For prime p, φ(pk) = (p − 1)pk−1. Proof: x not coprime to pk ifg p x Not coprime: p 2p 3p pk pk 1p Total of pk 1 nums not coprime So num coprime = pk pk 1 p 1 pk 1

8 / 10

slide-31
SLIDE 31

φ For Prime Powers

Lemma: For prime p, φ(pk) = (p − 1)pk−1. Proof:

▶ x not coprime to pk ifg p|x

Not coprime: p 2p 3p pk pk 1p Total of pk 1 nums not coprime So num coprime = pk pk 1 p 1 pk 1

8 / 10

slide-32
SLIDE 32

φ For Prime Powers

Lemma: For prime p, φ(pk) = (p − 1)pk−1. Proof:

▶ x not coprime to pk ifg p|x ▶ Not coprime: p, 2p, 3p, ..., pk = pk−1p

Total of pk 1 nums not coprime So num coprime = pk pk 1 p 1 pk 1

8 / 10

slide-33
SLIDE 33

φ For Prime Powers

Lemma: For prime p, φ(pk) = (p − 1)pk−1. Proof:

▶ x not coprime to pk ifg p|x ▶ Not coprime: p, 2p, 3p, ..., pk = pk−1p ▶ Total of pk−1 nums not coprime ▶ So num coprime = pk − pk−1 = (p − 1)pk−1

8 / 10

slide-34
SLIDE 34

Proving φ

Theorem: Suppose m factored as pn1

1 · ... · pnk k .

Then φ(m) = (p1 − 1)pn1−1

1

· ... · (pk − 1)pnk−1

k

. Proof: Since is multiplicative: m pn1

1

pnk

2

k 2

pnk

1

k 1

pnk

k

pn1

1

pnk

2

k 2

pnk

1

k 1

pnk

k

pn1

1

pnk

2

k 2

pnk

1

k 1

pnk

k

. . . pn1

1

pn2

2

pnk

k

Apply previous lemma to each prime power!

9 / 10

slide-35
SLIDE 35

Proving φ

Theorem: Suppose m factored as pn1

1 · ... · pnk k .

Then φ(m) = (p1 − 1)pn1−1

1

· ... · (pk − 1)pnk−1

k

. Proof:

▶ Since φ is multiplicative:

φ(m) = φ(pn1

1 · ... · pnk−2 k−2 · pnk−1 k−1 · pnk k )

= φ(pn1

1 · ... · pnk−2 k−2 · pnk−1 k−1)φ(pnk k )

= φ(pn1

1 · ... · pnk−2 k−2)φ(pnk−1 k−1)φ(pnk k )

. . . = φ(pn1

1 )φ(pn2 2 )...φ(pnk k )

Apply previous lemma to each prime power!

9 / 10

slide-36
SLIDE 36

Proving φ

Theorem: Suppose m factored as pn1

1 · ... · pnk k .

Then φ(m) = (p1 − 1)pn1−1

1

· ... · (pk − 1)pnk−1

k

. Proof:

▶ Since φ is multiplicative:

φ(m) = φ(pn1

1 · ... · pnk−2 k−2 · pnk−1 k−1 · pnk k )

= φ(pn1

1 · ... · pnk−2 k−2 · pnk−1 k−1)φ(pnk k )

= φ(pn1

1 · ... · pnk−2 k−2)φ(pnk−1 k−1)φ(pnk k )

. . . = φ(pn1

1 )φ(pn2 2 )...φ(pnk k )

▶ Apply previous lemma to each prime power!

9 / 10

slide-37
SLIDE 37

Fin

Have a great weekend!

10 / 10