Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving...

45
Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Functio Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function March 3, 2007 Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Transcript of Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving...

Page 1: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Chapter 4 - Solving Linear Congruences,Chinese Remainder Theorem, and Euler’s Φ

Function

March 3, 2007

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 2: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

1 Solving Linear Congruences

2 Chinese Remainder Theorem

3 Moduli are not Relatively Prime

4 Properties of Euler’s φ Function

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 3: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Lemma 4.1

Lemma 4.1Given relatively prime integers a and m, there exists an integerb, unique modulo m, such that

a× b ≡ 1 (mod m).

DefinitionIf a× b ≡ 1 (mod m), then we say that b is the inverse of amodulo m.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 4: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Lemma 4.1

Lemma 4.1Given relatively prime integers a and m, there exists an integerb, unique modulo m, such that

a× b ≡ 1 (mod m).

DefinitionIf a× b ≡ 1 (mod m), then we say that b is the inverse of amodulo m.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 5: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Lemma 4.1

Proof of Lemma 4.1By the Euclidean algorithm (Algorithm 1.8) we can find integersb and c such that

a× b + m × c = 1.

This means that a× b is congruent to 1 modulo m.Let e be any other integer satisfying

a× e ≡ 1 (mod m).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 6: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Lemma 4.1 - Cont.

Proof of Lemma 4.1 - Cont.Then,

e ≡ e × (a× b) (mod m)

≡ (a× e)× b (mod m)

≡ b (mod m)

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 7: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

1 Solving Linear Congruences

2 Chinese Remainder Theorem

3 Moduli are not Relatively Prime

4 Properties of Euler’s φ Function

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 8: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Chinese Remainder Theorem

We need to prove that if p and q are distinct primes, then

φ(p × q) = (p − 1)× (q − 1).

We will prove more. The starting point is an algorithm thatappeared in the first century A.D. simultaneously in China,in the writings of Sun-Tsu, and in Judea, in a book byNichomachus of Gerasa.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 9: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Chinese Remainder Theorem

We need to prove that if p and q are distinct primes, then

φ(p × q) = (p − 1)× (q − 1).

We will prove more. The starting point is an algorithm thatappeared in the first century A.D. simultaneously in China,in the writings of Sun-Tsu, and in Judea, in a book byNichomachus of Gerasa.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 10: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Chinese Remainder Theorem

Theorem 4.4Let m1, m2, . . . , mr be positive integers that are pairwiserelatively prime (i.e., no two share a common factor larger thanone). Let a1, a2, . . . , ar be arbitrary integers. Then there existsan integer a such that

a ≡ a1 (mod m1)

≡ a2 (mod m2)

...≡ ar (mod mr ).

Furthermore, a is unique modulo M = m1 ×m2 × · · ·mr .

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 11: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Theorem 4.4

Proof of Theorem 4.4We will actually find an algorithm for constructing a. For each ifrom 1 up to r , define Mi by

Mi = (M/mi)φ(mi ).

Since M/mi is relatively prime to mi and divisible by mj forevery j not equal to i , we have that

Mi ≡ 1 (mod mi)

Mj ≡ 0 (mod mi)

for every j not equal to i .

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 12: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Theorem 4.4 - Cont.

Proof of Theorem 4.4 - Cont.Define a by

a = a1 ×M1 + a2 ×M2 + · · ·+ ar ×Mr .

To see that a is unique modulo M, let b be any other integersatisfying the r congruences. Then for each mi , a and b arecongruent modulo mi . In other words, mi divides b − a. Sincethis is true for every i , M divides b − a which means that

a ≡ b (mod M).

Of course, one need only compute the values of Mi moduloM, which keeps the computations a little more reasonable.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 13: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Theorem 4.4 - Cont.

Proof of Theorem 4.4 - Cont.Define a by

a = a1 ×M1 + a2 ×M2 + · · ·+ ar ×Mr .

To see that a is unique modulo M, let b be any other integersatisfying the r congruences. Then for each mi , a and b arecongruent modulo mi . In other words, mi divides b − a. Sincethis is true for every i , M divides b − a which means that

a ≡ b (mod M).

Of course, one need only compute the values of Mi moduloM, which keeps the computations a little more reasonable.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 14: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Theorem 4.4 - Cont.

Proof of Theorem 4.4 - Cont.Define a by

a = a1 ×M1 + a2 ×M2 + · · ·+ ar ×Mr .

To see that a is unique modulo M, let b be any other integersatisfying the r congruences. Then for each mi , a and b arecongruent modulo mi . In other words, mi divides b − a. Sincethis is true for every i , M divides b − a which means that

a ≡ b (mod M).

Of course, one need only compute the values of Mi moduloM, which keeps the computations a little more reasonable.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 15: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

1 Solving Linear Congruences

2 Chinese Remainder Theorem

3 Moduli are not Relatively Prime

4 Properties of Euler’s φ Function

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 16: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Question

What if two or more of the moduli are divisible by the sameprime? The Chinese Remainder Theorem does not work inthis case.

We first observe that if we have a congruence with amodulus which is divisible by more than one prime, thenwe can split our single congruence into severalcongruences as long as the new moduli are relativelyprime and their product is the original modulus.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 17: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Question

What if two or more of the moduli are divisible by the sameprime? The Chinese Remainder Theorem does not work inthis case.We first observe that if we have a congruence with amodulus which is divisible by more than one prime, thenwe can split our single congruence into severalcongruences as long as the new moduli are relativelyprime and their product is the original modulus.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 18: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Example

Example

x ≡ 3 (mod 45)

is equivalent to

x ≡ 3 (mod 5) and x ≡ 3 (mod 9).

The equivalence is a consequence of the Chinese RemainderTheorem.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 19: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Example

Example

x ≡ 3 (mod 45)

is equivalent to

x ≡ 3 (mod 5) and x ≡ 3 (mod 9).

The equivalence is a consequence of the Chinese RemainderTheorem.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 20: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Example

Example

x ≡ 3 (mod 45)

is equivalent to

x ≡ 3 (mod 5) and x ≡ 3 (mod 9).

The equivalence is a consequence of the Chinese RemainderTheorem.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 21: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Procedure and Example

ProcedureLet us assume that in our system of congruences we have twomoduli say m1 and m2 that are both divisible by the same primep.

We split each of our congruences into two congruences asexplained above where one of the new moduli is the highestpower of p dividing m1 or m2, respectively.

ExampleAs an example, the two congruences

x ≡ 3 (mod 45)

x ≡ 7 (mod 756)

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 22: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Procedure and Example

ProcedureLet us assume that in our system of congruences we have twomoduli say m1 and m2 that are both divisible by the same primep. We split each of our congruences into two congruences asexplained above where one of the new moduli is the highestpower of p dividing m1 or m2, respectively.

ExampleAs an example, the two congruences

x ≡ 3 (mod 45)

x ≡ 7 (mod 756)

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 23: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Procedure and Example

ProcedureLet us assume that in our system of congruences we have twomoduli say m1 and m2 that are both divisible by the same primep. We split each of our congruences into two congruences asexplained above where one of the new moduli is the highestpower of p dividing m1 or m2, respectively.

ExampleAs an example, the two congruences

x ≡ 3 (mod 45)

x ≡ 7 (mod 756)

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 24: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Example - Cont.

Example - Cont.are split into four congruences:

x ≡ 3 (mod 9)

x ≡ 7 (mod 27)

x ≡ 3 (mod 5)

x ≡ 7 (mod 28).

We now have two congruences that both involve powers of p.One of two things has to happen:

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 25: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Example - Cont.

Example - Cont.are split into four congruences:

x ≡ 3 (mod 9)

x ≡ 7 (mod 27)

x ≡ 3 (mod 5)

x ≡ 7 (mod 28).

We now have two congruences that both involve powers of p.One of two things has to happen:

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 26: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Two Things

Two Things1. The congruences are contradictory and so there are nosolutions. This is the case with the example given above. Ifx ≡ 3 (mod 9), then x ≡ 3, 12, or 21 (mod 27). or

2. Both ofthe congruences for powers of p are implied by the congruencewith the higher power. This means we can get rid of one of ourequations, leaving us with three congruences with relativelyprime moduli for which we can use the Chinese RemainderTheorem.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 27: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Two Things

Two Things1. The congruences are contradictory and so there are nosolutions. This is the case with the example given above. Ifx ≡ 3 (mod 9), then x ≡ 3, 12, or 21 (mod 27). or 2. Both ofthe congruences for powers of p are implied by the congruencewith the higher power. This means we can get rid of one of ourequations, leaving us with three congruences with relativelyprime moduli for which we can use the Chinese RemainderTheorem.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 28: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Example

ExampleConsider the system of congruences,

x ≡ 7 (mod 200)

x ≡ 82 (mod 375).

This splits into four congruences:

x ≡ 7 (mod 25)

x ≡ 82 (mod 125)

x ≡ 7 (mod 8)

x ≡ 82 (mod 3).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 29: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Example

ExampleConsider the system of congruences,

x ≡ 7 (mod 200)

x ≡ 82 (mod 375).

This splits into four congruences:

x ≡ 7 (mod 25)

x ≡ 82 (mod 125)

x ≡ 7 (mod 8)

x ≡ 82 (mod 3).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 30: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Example - Cont.

Example - Cont.The congruence modulo 25 is a special case of the congruencemodulo 125, so we really have three congruences to relativelyprime moduli:

x ≡ 82 (mod 125)

x ≡ 7 (mod 8)

x ≡ 82 ≡ 1 (mod 3),

which has as a solution

x ≡ 1207 (mod 3000).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 31: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Example - Cont.

Example - Cont.The congruence modulo 25 is a special case of the congruencemodulo 125, so we really have three congruences to relativelyprime moduli:

x ≡ 82 (mod 125)

x ≡ 7 (mod 8)

x ≡ 82 ≡ 1 (mod 3),

which has as a solution

x ≡ 1207 (mod 3000).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 32: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Example - Cont.

Example - Cont.The congruence modulo 25 is a special case of the congruencemodulo 125, so we really have three congruences to relativelyprime moduli:

x ≡ 82 (mod 125)

x ≡ 7 (mod 8)

x ≡ 82 ≡ 1 (mod 3),

which has as a solution

x ≡ 1207 (mod 3000).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 33: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

1 Solving Linear Congruences

2 Chinese Remainder Theorem

3 Moduli are not Relatively Prime

4 Properties of Euler’s φ Function

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 34: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Lemma 4.6

Lemma 4.6If gcd(m, n) = 1, then

φ(m × n) = φ(m)× φ(n).

ProofLet a be a positive integer less than and relatively prime tom × n. In other words, a is one of the integers counted byφ(m × n). We consider the correspondence

a → (a mod m, a mod n).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 35: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Lemma 4.6

Lemma 4.6If gcd(m, n) = 1, then

φ(m × n) = φ(m)× φ(n).

ProofLet a be a positive integer less than and relatively prime tom × n. In other words, a is one of the integers counted byφ(m × n).

We consider the correspondence

a → (a mod m, a mod n).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 36: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Lemma 4.6

Lemma 4.6If gcd(m, n) = 1, then

φ(m × n) = φ(m)× φ(n).

ProofLet a be a positive integer less than and relatively prime tom × n. In other words, a is one of the integers counted byφ(m × n). We consider the correspondence

a → (a mod m, a mod n).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 37: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Lemma 4.6 - Cont.

Proof of Lemma 4.6 - Cont.The integer a is relatively prime to m and relatively prime to n,so a mod m and a mod n are relatively prime to m and n,respectively.

This means that each integer counted by φ(m× n)corresponds to a pair of integers, the first counted by φ(m) andthe second counted by φ(n).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 38: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Lemma 4.6 - Cont.

Proof of Lemma 4.6 - Cont.The integer a is relatively prime to m and relatively prime to n,so a mod m and a mod n are relatively prime to m and n,respectively. This means that each integer counted by φ(m× n)corresponds to a pair of integers, the first counted by φ(m) andthe second counted by φ(n).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 39: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Lemma 4.6 - Cont.

Proof of Lemma 4.6 - Cont.By the second part of Theorem 4.4, distinct integers counted byφ(m × n) correspond to distinct pairs. Therefore, φ(m × n) is atmost the number of such pairs:

φ(m × n) ≤ φ(m)× φ(n).

In the other direction, we take a pair of integers, one counted byφ(m) and the other counted by φ(n). Since m and n arerelatively prime, we can use the first part of Theorem 4.4 toconstruct a unique positive integer a less than and relativelyprime to m × n.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 40: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Lemma 4.6 - Cont.

Proof of Lemma 4.6 - Cont.By the second part of Theorem 4.4, distinct integers counted byφ(m × n) correspond to distinct pairs. Therefore, φ(m × n) is atmost the number of such pairs:

φ(m × n) ≤ φ(m)× φ(n).

In the other direction, we take a pair of integers, one counted byφ(m) and the other counted by φ(n). Since m and n arerelatively prime, we can use the first part of Theorem 4.4 toconstruct a unique positive integer a less than and relativelyprime to m × n.

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 41: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Lemma 4.6 - Cont.

Proof of Lemma 4.6 - Cont.By the Chinese Remainder Theorem

(b, c) → a ≡ b (mod m) and c (mod n).

So the number of such pairs is at most φ(m × n):

φ(m × n) ≥ φ(m)× φ(n).

In Exercise 4.17 you are asked to prove that if p is a prime,then

φ(pa) = pa−1 × (p − 1).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 42: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Lemma 4.6 - Cont.

Proof of Lemma 4.6 - Cont.By the Chinese Remainder Theorem

(b, c) → a ≡ b (mod m) and c (mod n).

So the number of such pairs is at most φ(m × n):

φ(m × n) ≥ φ(m)× φ(n).

In Exercise 4.17 you are asked to prove that if p is a prime,then

φ(pa) = pa−1 × (p − 1).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 43: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Proof of Lemma 4.6 - Cont.

Proof of Lemma 4.6 - Cont.By the Chinese Remainder Theorem

(b, c) → a ≡ b (mod m) and c (mod n).

So the number of such pairs is at most φ(m × n):

φ(m × n) ≥ φ(m)× φ(n).

In Exercise 4.17 you are asked to prove that if p is a prime,then

φ(pa) = pa−1 × (p − 1).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 44: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Theorem 4.7

With this equality and Lemma 4.6, we can calculate φ(n)for n that we can factor.

Theorem 4.7Let

n = pa11 × pa2

2 × · · · × parr

be the unique factorization of n. Then

φ(n) = n ×(

1− 1p1

(1− 1

p2

)× · · · ×

(1− 1

pr

).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function

Page 45: Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem…€¦ ·  · 2012-08-07Solving Linear Congruences Chinese Remainder Theorem Moduli are not ... relatively prime

Solving Linear Congruences Chinese Remainder Theorem Moduli are not Relatively Prime Properties of Euler’s φ Function

Theorem 4.7

With this equality and Lemma 4.6, we can calculate φ(n)for n that we can factor.

Theorem 4.7Let

n = pa11 × pa2

2 × · · · × parr

be the unique factorization of n. Then

φ(n) = n ×(

1− 1p1

(1− 1

p2

)× · · · ×

(1− 1

pr

).

Chapter 4 - Solving Linear Congruences, Chinese Remainder Theorem, and Euler’s Φ Function