MATH2301 Workbook on Number Theory
Table of contents 0. Introductory comments 1. Division algorithm 2. Prime factorisation 3. Modular arithmetic
0. Introduc Introducto tory ry commen comments ts With MATH1061 under your belt, this is not your our first first expos exposur ure e to numbe numberr theo theory ry.. HowHowever, this time around, focus will be on proofs of some main theorems and quick review of what you have already learnt.
Notation. Throughout Throughout this workbook rkbo ok notes the integers
{··· , −2, −1, 0, 1, 2, · · · }. Moreover,
N denotes
positive integers
{1, 2, · · · }.
Z
de-
0. Introduc Introducto tory ry commen comments ts With MATH1061 under your belt, this is not your our first first expos exposur ure e to numbe numberr theo theory ry.. HowHowever, this time around, focus will be on proofs of some main theorems and quick review of what you have already learnt.
Notation. Throughout Throughout this workbook rkbo ok notes the integers
{··· , −2, −1, 0, 1, 2, · · · }. Moreover,
N denotes
positive integers
{1, 2, · · · }.
Z
de-
1. Divisi Division on algo algorit rithm hm Definit Definition ion 1.1. 1.1. Let a, b We say a Z. divides b if there exists another integer c Z such that
∈
∈
b = ac.
In this case, we write
|
a b.
Examples 1.1. (i) 4 12
|
(ii) 6 15
| (iii) n | 0 for all n ∈ Z.
1
Z and suppose Theorem 1.1. Let a, b b = 0. Then there exists unique integers q and r such that
∈
a = bq + r
and 0
≤ r < b.
Terminology 1.1. The integer q is called the quotient and r is called the remainder. Proof of existence
2
Proof of uniqueness
3
Exercise 1.1. (i) Every integer is either even or odd, but not both. (ii) The remainder r is zero if and only if b divides a. (iii) Suppose a b and a c. Then a bx + cy for all integers x, y .
|
|
|
(iv) If a b and b = 0, then a b . Thus, only finitely many integers divide a given integer b.
|
| |≤| |
4
Definition 1.2. Let a and b be non-zero integer. The greatest common divisor of a and b, denoted by gcd(a, b), is the largest integer d dividing both a and b. Comment 1.1 Alternatively, d = gcd(a, b) if the following three conditions hold: (i) d a;
|
(ii) d b;
|
(iii) If c a and c b, then c
|
|
≤ d.
Example 1.1 (i) gcd(21, 6) = (ii) gcd(14, 2) = (iii) gcd(a, b) = gcd(b, a). (iv) gcd(a, 0) = (v) gcd(a,
−b) = gcd(a, b). 5
Exercise 1.1. Let a = bq + r be as in the division algorithm. Then gcd(a, b) = gcd(b, r). Algorithm 1.1: Finding gcd. Input a
≥ b ≥ 0, a = 0.
While b > 0 set a := b and b := r return r . Example 1.2 gcd(2234, 1020) =
6
2. Primes Definition 2.1. Two integers a and b are said to be coprime if gcd(a, b) = 1. Comment 2.1. a and b are coprime if and only if they have no common factor. Example 2.1 (i) 7 and 17 are coprime. (ii) 6 and 16 are not coprime. Exercise 2.1. (i) a and b are coprime if and only if there exists integers x and y such that ax + by = 1. (iu) Suppose a and b are coprime. Then
|
a c,
and
b c =
|
⇒
|
ab c.
7
Definition 2.2. (i) An integer p 2 is called prime if its only divisors are 1 and p.
≥
(ii) An integer q is said to be a prime power if q = pa for some positive integer a. (iii) An integer which is not a prime is called composite . Theorem 2.1 (Euclid). finitely many primes
There exists in-
Proof.
8
Theorem 2.2 (Fundamental Theorem of Arithmetic) Every integer a can be written as a = p1 p2
· · · pk
pk are prime numbers. where p1 p2 Moreover, this presentation is unique.
≤ ≤ · · · ≤
Proof of Existence
9
Proof of Uniqueness
10
Comments 2.2. Unique factorisation fails in slightly more general setting; e.g. in
√ √ Z[ −5] = {a + b −5 | a, b ∈ Z}. For instance,
√ √ 2.3 = (1 + −5)(1 − −5) = 6. Theorem 2.3. The number of primes less than n is asymptotic to logn n . e
Comments 2.3 (i) Distribution of primes is intimately related to Riemann Hypothesis. (ii) It is not known if there are infinitely many twin primes. (iii) It is not known if every even integer greater than 2 can be written as a sum of two primes. 11
3. Modular Arithmetic Fix a positive integer n. Definition 3.1. Let a, b congruent to b modulo n if
∈ Z.
| − b. In this case, we write a ≡ b
We say a is
n a
mod n.
Examples 3.1 (i) 21
≡ 3 mod 6. (ii) −7 ≡ 3 mod 10. (iii) n2 ≡ 1 mod 4 for all odd n. (iv) 10n ≡ 1 mod 9 for all n ≥ 0. 12
Comments 3.1 b mod n if and only if a and b have (i) a the same remainder under division by n.
≡
(ii) a
≡0
mod n if and only if n a.
|
Exercise 3.1. Show that congruence modulo n defines an equivalence relation on Z. We let [a] denote the equivalence class containing the integer a. Then [a] is the set of all integers whose remainders modulo n equals a. Examples 3.2 (i) If n = 2 then [1] is the set of all odd numbers and [0] is the set of all even numbers. (ii) If n = 5, then [2] =
{··· , −8, −3, 2, 7, 12, · · · }
(iii) If n = 2 then [1] = [ 1] = [3] = [2017].
− (iv) If n = 5 then [1] = [ −4] = [2016].
13
Division algorithm tells us Z
= [0], [1],
{
· · · , [n − 1]}.
Let us call this a new set Zn. We now define addition and multiplication on Zn : [a] + [b] = [a + b]. [a].[b] = [a.b]. Examples 3.3 (i) In Z2, [1] + [1] = [0]. This is just saying that the sum of two odd integers is even. (ii) In
Z5 ,
[3][4] = [2].
(iii) In
Z10,
[4][9] =
(iv) In
Z15,
[10] + [10] =
14
Theorem 3.1 Addition and multiplication in Zn is well-defined; i.e. if [a] = [b] and [c] = [d] then [ a + b ] = [ c + d] ,
[ab] = [cd].
Proof.
15
Question 3.1 What about subtracting in Zn ? Definition 3.2 Let [a] Zn. An inverse for [a] is an element [ x] Zn such that
∈
[ax] = [1]
∈ ⇐⇒ ax ≡ n
mod 1.
Examples 3.3 (i) In
Z11,
we have [3][4] = [1]. Thus, [3]−1 = [4].
(ii) In (iii) In
Z5 ,
[2]−1 =
Z10,
does [2] have an inverse?
(iv) Does [0] ever have an inverse? Definition 3.3 Invertible elements in called units .
Zn
16
are
Theorem 3.2
Zn is invertible then 1. Let n > 1. If [a] its inverse is unique.
∈
2. If [a] is invertible, then so is [ a]−1. Moreover, inverse of [ a]−1 equals [a]. Proof.
17
Theorem 3.3 Let n > 1. Then [a] invertible if and only if gcd( a, n) = 1.
∈ Zn is
Proof.
18
Corollary 3.1 Let p be a prime number and suppose a = 0. Then [a] is invertible in Z p.
Comment 3.2 We see that we can add, subtract, multiply, and divide (by non-zero elements) in Z p. We say that Z p is a field . Exercise 3.2. (i) Suppose gcd(a, n) = 1. Show that the equation [a][x] = [b] has a unique solution. (ii) Show that for all integers r , ([a]−1)r = ([a]r )−1 = [a]−r .
(iii) Show that for all integers r and s, [a]r [a]s = [a]r+s. Notation 3.1 Sometimes we drop the bracket in the notation and write a instead of [ a] for an element of Zn. 19
We have discussed congruence equations of the form ax = b in Zn. We now want to discuss systems of congruence equations. Example 3.4. The system
≡1 x≡2 x≡3 x
mod 3 mod 5 mod 7
is solvable. Indeed, x = 52 is a solution. Is this the only solution?
20
Theorem 3.4 (Chinese Remainder TheN be pairwise coorem). Let m1, , mk prime positive integers. Then every system of equations
···
x
≡ ai
mod mi,
∈
1
≤i≤k
is solvable. Moreover, the solution is unique mk . modulo m1m2
···
Proof
21
Proof continued.
22
Notation 3.2. We let Z× n denote the set of units (=invertible) elements in Zn. Example 3.5. (i)
Z12
(ii) If p is prime then
= 1, 5, 7, 11 .
Z p
{
}
= 1, 2,
{
· · · , p − 1}.
Exercise 3.3 Show that if a Zn is invertible, then there exists an integer k such that ak = 1.
∈
Definition 3.4 The order of an element a Z× n , denoted by o(a), is the smallest positive integer k such that ak = 1.
∈
Example 3.6. (i) The order of 2 (ii) The order of 4
∈ Z5 is ∈ Z11 is 23
m = 1 if a Theorem 3.5. Let a Z× . Then n and only if m is a multiple of o(a).
∈
Proof.
24
Exercise 3.3. o(a) Z× n .
Show that if a
|| |
Definition 3.5. If o(a) = called a primitive root of Zn.
∈ Z×n then
|Z×n | then
a is
∈ Z×n
is a
Exercise 3.5. Show that if a primitive root then
× = {1, a , a2, · · · , an−1}.
Zn
Example 3.7. Which one of the following is a primitive root? (i) 2
∈ Z5 (ii) 4 ∈ Z11 (ii) 3 ∈ Z8 Question 3.2 . For which integer n does Zn have a primitive root? 25
Definition 3.6. defined by
The function ϕ : n
N
→N
→ |Z×n |
is called the Euler ϕ function. Example 3.8. (i) ϕ(6) = (ii) ϕ( p) = (ii) ϕ(2n) = Exercise 3.6. Show that for all primes p, we have ϕ( pk ) = pk−1( p 1).
−
Theorem 3.6. Let m, n Then ϕ(mn) = ϕ(m)ϕ(n).
∈ N be
coprime.
Proof. Later in the course. k a Exercise 3.7. Compute ϕ( i=1 pi i ). 26
Theorem 3.7 (Euler’s Theorem). Let 1 and gcd(a, n) = 1. Then a, n Z with n aφ(n) 1 mod n.
∈
≡
≥
Proof.
27