Congruences - Prof Still

29
Congruences The theory of congruences was developed at the beginning of the nineteenth century by Carl Friedrich Gauss. A congruence is nothing more than a statement about divisibility. Definition 1. Let m 6=0 where m is an integer. If m|(a - b) we say that a is congruent to b modulo m, and we write a b(mod m). If m 6 |(a - b), we write a 6b(mod m). Example 1. 3 ≡-6(mod 9) 12 60(mod 7) 15 0(mod 5) 63 624(mod 2) 1 17(mod 4) 4! 6≡-1(mod 4) Chapter 2: Congruences 1

Transcript of Congruences - Prof Still

Page 1: Congruences - Prof Still

Congruences

The theory of congruences was developed at the beginning of thenineteenth century by Carl Friedrich Gauss. A congruence is nothing morethan a statement about divisibility.

Definition 1. Let m 6= 0 where m is an integer. If m|(a− b) we say that ais congruent to b modulo m, and we write a ≡ b(mod m). If m 6 |(a − b),we write a 6≡ b(mod m).

Example 1.

3 ≡ −6(mod 9) 12 6≡ 0(mod 7)15 ≡ 0(mod 5) 63 6≡ 24(mod 2)1 ≡ 17(mod 4) 4! 6≡ −1(mod 4)

Chapter 2: Congruences 1

Page 2: Congruences - Prof Still

Theorem 1. Let a, b, c, d ∈ Z.

1. The following statements are equivalent:

(a) a ≡ b(mod m)(b) b ≡ a(mod m)(c) a− b ≡ 0(mod m)

2. If a ≡ b(mod m) and b ≡ c(mod m) then a ≡ c(mod m).

3. If a ≡ b(mod m) and c ≡ d(mod m) then a+ c ≡ b+ d(mod m).

4. If a ≡ b(mod m) and c ≡ d(mod m) then ac ≡ bd(mod m).

5. If a ≡ b(mod m) and d|m, d > 0 then a ≡ b(mod d).

6. If a ≡ b(mod m) then ac ≡ bc(mod mc) for c > 0.

Chapter 2: Congruences 2

Page 3: Congruences - Prof Still

Illustration 1.

1. 7 ≡ 32(mod 5)⇔ 32 ≡ 7(mod 5)⇔ 32− 7 ≡ 0(mod 5).

2. 7 ≡ 32(mod 5) and 32 ≡ 2(mod 5)⇒ 7 ≡ 2(mod 5).

3. 2 ≡ 17(mod 3) and 5 ≡ −4(mod 3)⇒ 2 + 5 ≡ 17 + (−4)(mod 3).

4. 21 ≡ 1(mod 4) and 3 ≡ −9(mod 4)⇒ 63 ≡ −9(mod 4)

5. 6 ≡ 12(mod 6) and 2|6⇒ 6 ≡ 12(mod 2)

6. 4 ≡ 10(mod 6)⇒ 12 ≡ 30(mod 18)

Chapter 2: Congruences 3

Page 4: Congruences - Prof Still

Theorem 2. Let f be a polynomial with integral coefficients. If a ≡b(mod m) then f(a) ≡ f(b)(mod m).

Example 2. Let f(x) = x3−2x2 +5. Since 3 ≡ −1(mod 4) we must havef(3) ≡ f(−1)(mod 4).

f(3) = 33 − 2(32) + 5 = 27− 18 + 5 = 14

f(−1) = (−1)3 − 2(−1)2 + 5 = −1− 2 + 5 = 2

=⇒ 14 ≡ 2(mod 4)

Chapter 2: Congruences 4

Page 5: Congruences - Prof Still

Theorem 3.

1. ax ≡ ay(mod m) if and only if x ≡ y(

mod m(a,m)

).

2. If ax ≡ ay(mod m) and (a,m) = 1 then x ≡ y(mod m).

3. x ≡ y(mod mi) if and only if x ≡ y(mod [m1,m2, . . . ,mk]).

Illustration 2.

1. 32 ≡ 8(mod 8)⇔ 8 ≡ 2(mod 2) where a = 4 and m = 8.

2. 10 ≡ 30(mod 2)⇔ 2 ≡ 6(mod 2) where a = 5 and m = 2.

3. 62 ≡ 72(mod 10)⇔ 62 ≡ 72(mod 5) and 62 ≡ 72(mod 2).

Chapter 2: Congruences 5

Page 6: Congruences - Prof Still

Definition 2. If x ≡ r(mod m) then r is called a residue of x modulo m.A set {x1, x2, . . . xm} is called a complete residue system modulo m iffor all integer y there exists exactly one xi such that y ≡ xi(mod m).

Illustration 3.

Let y ∈ Z =⇒ y = mq + r, 0 ≤ r < m

=⇒ y − r = mq

=⇒ y ≡ r(mod m)

Hence, for all integer y there exists exactly one xi such that y ≡xi(mod m) and {0, 1, 2, . . . ,m− 1} constitute a complete residue systemmodulo m.

Chapter 2: Congruences 6

Page 7: Congruences - Prof Still

Let m = 10 then S = {0, 1, 2, . . . , 9} is a complete residue systemmodulo 10. If y = 299 then 299 ≡ 9(mod 10). However, there areinfinitely many complete residue systems modulo m. For this particularexample, S′ = {1, 2, . . . , 10} is another complete residue system modulo10.

Let {x1, x2, . . . , xm} be a complete residue system modulo m.

If x′1 ≡ x1(mod m)

x′2 ≡ x2(mod m)

...

x′m ≡ xm(mod m)

Then {x′1, x′2, . . . , x′m} is another complete residue system modulo m.

Chapter 2: Congruences 7

Page 8: Congruences - Prof Still

Remark: If C is any complete residue system modulo m then

1. C has exactly m elements

2. The elements of C are pairwise incongruent modulo m.

Theorem 4. If x ≡ y(mod m) then (x,m) = (y,m).

Illustration 4. 12 ≡ 32(mod 10) then (12, 10) = (32, 10) = 2.

Chapter 2: Congruences 8

Page 9: Congruences - Prof Still

Definition 3. A reduced residue system modulo m is a set S of integersri such that

1. (ri,m) = 1 for all ri ∈ S

2. ri 6≡ rj(mod m) if ri 6= rj and

3. for each integer y, if (y,m) = 1 then y ≡ ri(mod m) for some ri ∈ S.

Chapter 2: Congruences 9

Page 10: Congruences - Prof Still

Example 3. We know that C = {1, 2, 3, 4, 5, 6, 7, 8, 9} is a completeresidue system modulo 9. If we delete from this set every integer xwith (x, 9) > 1, we obtain the set S = {1, 2, 4, 5, 7, 8}. From definition3,

1. (ri, 9) = 1 for all ri ∈ S,

2. since S ⊆ C and C is a complete residue system modulo m, then allits elements are pairwise incongruent modulo 9,

3. let y ∈ Z such that (y, 9) = 1. By the definition of a complete residuesystem, there exists xi ∈ C such that y ≡ xi(mod 9). By theorem 4,(xi,m) = (y,m) = 1

Hence, S is a reduced residue system modulo 9.

Chapter 2: Congruences 10

Page 11: Congruences - Prof Still

Theorem 5. The number φ(m) is equal to the number of positive integersnot exceeding m and relatively prime to m.

Theorem 6. Let (a,m) = 1. Let A = {x1, x2, . . . , xk} and aA ={ax1, ax2, . . . , axk}.

1. If A is complete residue system modulo m then aA is complete residuesystem modulo m.

2. If A is reduced residue system modulo m then aA is reduced residuesystem modulo m.

Chapter 2: Congruences 11

Page 12: Congruences - Prof Still

Illustration 5.

1. Let A = {1, 2, 3, 4, 5} and let a = 2. Then aA = {2, 4, 6, 8, 10}.Observe that

1 ≡ 6(mod 5)

2 ≡ 2(mod 5)

3 ≡ 8(mod 5)

4 ≡ 4(mod 5)

5 ≡ 10(mod 5)

Since A is a complete residue system modulo 5 then aA is also acomplete residue system modulo 5.

2. Let S = {1, 2, 4, 5, 7, 8} and let a = 4. Then aS = {4, 8, 16, 20, 28, 32}.

Chapter 2: Congruences 12

Page 13: Congruences - Prof Still

Observe that

1 ≡ 28(mod 9)

2 ≡ 20(mod 9)

4 ≡ 4(mod 9)

5 ≡ 32(mod 9)

7 ≡ 16(mod 9)

8 ≡ 8(mod 9)

Since S is a reduced residue system modulo 5 then aS is also a reducedresidue system modulo 9. Also, φ(9) = 6.

Chapter 2: Congruences 13

Page 14: Congruences - Prof Still

Theorem 7. (Euler) If (a,m) = 1 then aφ(m) ≡ 1(mod m).

Illustration 6. Let a = 2 and m = 9. From illustration 5 part (2),φ(9) = 6. Hence, 1 ≡ 26(mod 9).

Theorem 8. (Fermat) Let p denote a prime. If p 6 |a then ap−1 ≡1(mod p).

Illustration 7. Let p = 29, since 29 6 |6 then 628 ≡ 1(mod 29).

Theorem 9. If (a,m) = 1 then ax ≡ b(mod m) has a solution x = x0. Ifx = x1 is any other solution, then x1 ≡ x0(mod m).

Example 4. Given 3x ≡ 5(mod 11), x0 = 3φ(11)−1 ·5 is a solution. Hence,39 · 5 ≡ 5(mod 11) since φ(11) = 10.

Theorem 10. (Wilson) If p is a prime then (p− 1)! ≡ −1(mod p).

Chapter 2: Congruences 14

Page 15: Congruences - Prof Still

Illustration 8. Let p = 5 then 4! ≡ −1(mod 5) and if p = 101 then100! ≡ −1(mod 101)

Theorem 11. Let p denote a prime. Then x2 ≡ −1(mod p) has solutionsif and only if p = 2 or p ≡ 1(mod 4).

Illustration 9. Let p = 17 then x =

8∏j=1

j = 40320 is a solution to x2 ≡

−1(mod 17).

Chapter 2: Congruences 15

Page 16: Congruences - Prof Still

Solution of Congruences

In this section, we shall let f(x) denote a polynomial in x with integralcoefficients. If f(u) ≡ 0(mod m), we shall say that u is a solution ofthe congruence f(x) ≡ 0(mod m). We know that if v ≡ u(mod m) thenf(v) ≡ 0(mod m) by theorem 2. Hence there are infinitely many solutions.However, we shall count solutions in a different way. If v ≡ u(mod m), weshall count v as a solution distinct from u. We shall define the number ofsolutions of the congruence f(x) ≡ 0(mod m) to be the number of pairwiseincongruent solutions modulo m.

Chapter 2: Congruences 16

Page 17: Congruences - Prof Still

Definition 4. Let x1, x2, . . . , xm form a complete residue system modulom. The number of solutions of the congruence f(x) ≡ 0(mod m) is thenumber of xi such that f(xi) ≡ 0(mod m)

Example 5. Given 3x ≡ 0(mod 6) and C = {1, 2, 3, 4, 5, 6} a completeresidue system modulo 6. 2, 4 and 6 are solutions which implies thenumber of solutions is 3.

Definition 5. Let f(x) = a0 + a1x+ a2x2 + . . .+ anx

n. If an 6≡ 0(mod m)then f(x) ≡ 0(mod m) is of degree n.

Example 6.

1. f(x) = 3x− 8 ≡ 0(mod 6) is of degree 1 since 3 6≡ 0(mod 6).

2. 2 − 5x + 6x2 − 12x3 ≡ 0(mod 4) is of degree 2 since 12 ≡ 0(mod 4)and 6 6≡ 0(mod 4).

Chapter 2: Congruences 17

Page 18: Congruences - Prof Still

Theorem 12. If d|m, d > 0, and if u is a solution of f(x) ≡ 0(mod m),then u is a solution of f(x) ≡ 0(mod d).

Any congruence of degree 1 can be written in the form ax ≡ b(mod m),a 6≡ 0(mod m). From theorem 9, there is exactly one solution if (a,m) = 1.The next theorem treats the general case of a congruence of degree 1.

Theorem 13. Let (a,m) = g. Then ax ≡ b(mod m) has no solution ifg 6 |b. If g|b it has g solutions given by

x ≡ b

gx0 + t

m

g(mod m) t = 0, 1, 2, . . . , g − 1

where x0 is any solution ofa

gx ≡ 1

(mod

m

g

).

Chapter 2: Congruences 18

Page 19: Congruences - Prof Still

Illustration 10.

1. 4x ≡ 7(mod 6) has no solution since (4, 6) = 2 and 2 6 |7.

2. 4x ≡ 8(mod 6) has 2 solutions since (4, 6) = 2 and 2|8. The 2solutions are x1 = 4x0 and x2 = 4x0 + 3 where x0 is a solution to4

2x ≡ 1

(mod

6

2

). Hence, x0 = 2φ(3)−1 = 2. Thus, x1 = 8 and

x2 = 11 where 4(8) ≡ 8(mod 6) and 4(11) ≡ 8(mod 6).

Chapter 2: Congruences 19

Page 20: Congruences - Prof Still

The Chinese Remainder Theorem

A very rich man owns a great number of cars. If he will divide them asevenly as possible among his 12 friends, there will be remainder of 4, if hewill divide them among his 7 children, there will be remainder of 2. Whatis the minimum number of cars that the rich man could possibly have?

Problems similar to this can be solved by the following theorem:

Theorem 14. The Chinese Remainder Theorem. Let m1,m2, . . . ,mk

denote k positive integers that are relatively prime in pairs andlet a1, a2, . . . , ak denote any k integers. The congruences x ≡ai(mod mi), i = 1, 2, . . . , k, have common solutions. Any two solutionsare congruent modulo m1,m2, . . . ,mk.

Chapter 2: Congruences 20

Page 21: Congruences - Prof Still

Illustration 11. For the problem above, x ≡ 4(mod 12) and x ≡ 2(mod 7).

Let m = 84. To find b1, we solve84

12b1 ≡ 1(mod 12) and to find b2, we

solve84

7b2 ≡ 1(mod 7).

7b1 ≡ 1(mod 12) =⇒ b1 = 7φ(12)−1 = 73 ≡ 7(mod 12)

=⇒ b1 = 7

12b2 ≡ 1(mod 7) =⇒ b2 = 12φ(7)−1 = 125 ≡ 55(mod 7) ≡ 3(mod 7)

=⇒ b2 = 3

Chapter 2: Congruences 21

Page 22: Congruences - Prof Still

Hence,

x ≡ 7(7)a1 + 12a2(mod 84)

≡ 49(4) + 36(2)(mod 84)

≡ 268(mod 84)

≡ 16(mod 84)

Therefore, the minimum number of cars that the rich man couldpossible have is 16.

Chapter 2: Congruences 22

Page 23: Congruences - Prof Still

Now we recall the function φ(n) which is defined for all positive integersn. In general, any function whose domain is the set Z+ is called a numericalfunction. A numerical function f : Z+ −→ Z is said to be multiplicative iff(mn) = f(m)f(n) for all pairs of relatively prime integers m and n. Thenumerical function f is called totally multiplicative if f(mn) = f(m)f(n)for all pairs of integers m and n.

Chapter 2: Congruences 23

Page 24: Congruences - Prof Still

Theorem 15. The function φ(n) is multiplicative.

Illustration 12.

1. Since (6, 7) = 1, φ(6) = 2 and φ(7) = 6, then φ(42) = φ(6)φ(7) = 12.

2. Since (2, 4) = 2, φ(2) = 1 and φ(4) = 2, then φ(8) 6= φ(2)φ(4) sinceφ(8) = 4 6= 2.

Let A be any finite set and let xi be a real number for each i ∈ A. Weshall denote by ∏

i∈A

xi

the product of all the numbers xi where i ranges over all elements of thefinite set A. In particular, if A = {1, 2, . . . , n} then the same product will

Chapter 2: Congruences 24

Page 25: Congruences - Prof Still

be denoted byn∏i=1

xi.

In case A = ∅, then the product will be defined to be equal to 1. If A isthe set of all prime divisors of n ∈ Z, then we shall write∏

p|n

xp for∏p∈A

xp.

Example 7. If A = {1, 2, 3, 4} then∏i∈A

xi = x1 · x2 · x3 · x4. If n = 10

then A = {2, 5} and∏p|n

xp = x2 · x5.

Chapter 2: Congruences 25

Page 26: Congruences - Prof Still

Primitive Roots

Definition 6. Let m denote a positive integer and a any integer suchthat (a,m) = 1. Let h be the smallest positive integer such that ah ≡1(mod m). We say that the order of a modulo m is h, or that abelongs to the exponent h modulo m.

Lemma 16. If a has order h(mod m), then the positive integers k suchthat ak ≡ 1(mod m) are precisely those for which h|k.

Corollary 16.1. If (a,m) = 1, then the order of a modulo m divides φ(m)

Lemma 17. If a has order h modulo m, then ak has orderh

(h, k)modulo

m.

Lemma 18. If a has order h(mod m), b has order k(mod m) , and if(h, k) = 1, then ab has order hk(mod m).

Chapter 2: Congruences 26

Page 27: Congruences - Prof Still

Definition 7. If g belongs to the exponent φ(m) modulo m, then g is calleda primitive root modulo m

In algebraic language, this definition can be stated: If the order ofg modulo m is φ(m), then the multiplicative group of reduced residuesmodulo mis a cyclic group generated by the element g.

In view of Lemma 16, the number a is a solution of the congruencexk ≡ 1(mod m) if and only if the order of a(mod m) divides k. In onespecial case, where xd ≡ 1(mod p) with d|(p− 1), the number of solutionsis d.

If p is prime and k|(p − 1), then there are precisely k residue classesa(mod p) such that the order of a modulo p is a divisor of k. If k happensto be a prime power, we can then determine the exact number of residuesa(mod p) of order k.

Chapter 2: Congruences 27

Page 28: Congruences - Prof Still

Lemma 19. Let p and q be primes, and suppose that qα|(p − 1), whereα ≥ 1. Then there are precisely qα − qα−1 residue classes a(mod p) oforder qα.

Theorem 20. If p is a prime, then there exist φ(p − 1) primitive rootsmodulo p.

Definition 8. If (a, p) = 1 and xn ≡ a(mod p) has a solution, then a iscalled an nth power residue modulo p.

Theorem 21. Let a, b and m > 0 be given integers, and let g = (a,m).The congruence ax ≡ b(mod m) has a solution if and only if g|b. If thiscondition is met then the solution form an arithmetic progression withcommon difference m/g giving g solutions (mod m).

Chapter 2: Congruences 28

Page 29: Congruences - Prof Still

Theorem 22. If p is a prime and (a, p) = 1, then the congruence xn ≡a(mod p) has (n,p-1) solutions or no solution according as

a(p−1)/(n,p−1) ≡ 1(mod p)

or not.

Lemma 23. Let p be a prime number. Then x2 ≡ 1(mod p) if and onlyif x ≡ ±1(mod p)

Corollary 23.1. (Euler’s Criterion) If p is an odd prime and (a, p) =1, then x2 ≡ a(mod p) has two solutions or no solution according asa(p−1)/2 ≡ 1 or ≡ −1(mod p).

Chapter 2: Congruences 29