elementary number theory and methods of proof. basic definitions an integer n is an even number if...

29
Elementary Number Theory and Methods of Proof

Post on 20-Dec-2015

218 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Elementary Number Theory

and

Methods of Proof

Page 2: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Basic Definitions

An integer n is an even number

if there exists an integer k such that n = 2k.

An integer n is an odd number

if there exists an integer k such that n = 2k+1.

An integer n is a prime number if and only if n>1 and if n=rs for some positive integers r and s then r=1 or s=1.

Page 3: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Simple Exercises

The sum of two even numbers is even.

The product of two odd numbers is odd.

direct proof.

Page 4: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Rational Number

R is rational there are integers a and b such that

and b ≠ 0.

numerator

denominator

Is 0.281 a rational number?

Is 0 a rational number?

If m and n are non-zero integers, is (m+n)/mn a rational number?

Is the sum of two rational numbers a rational number?

Is 0.12121212…… a rational number?

Page 5: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

a “divides” b (a|b):

b = ak for some integer k

Divisibility

5|15 because 15 = 35

n|0 because 0 =

n0

1|n because n =

1n

n|n because n =

n1

A number p > 1 with no positive integer divisors other than 1 and itself

is called a prime. Every other number greater than 1 is called

composite. 2, 3, 5, 7, 11, and 13 are prime,

4, 6, 8, and 9 are composite.

Page 6: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

1. If a | b, then a | bc for all c.

2. If a | b and b | c, then a | c.

3. If a | b and a | c, then a | sb + tc for all s and

t.

4. For all c ≠ 0, a | b if and only if ca | cb.

Simple Divisibility Facts

Proof of (1)

direct proof.

Page 7: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

1. If a | b, then a | bc for all c.

2. If a | b and b | c, then a | c.

3. If a | b and a | c, then a | sb + tc for all s and

t.

4. For all c ≠ 0, a | b if and only if ca | cb.

Simple Divisibility Facts

Proof of (2)

direct proof.

Page 8: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Divisibility by a Prime

Theorem. Any integer n > 1 is divisible by a prime number.

Idea of induction.

Page 9: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Every integer, n>1, has a unique factorization into primes:

p0 ≤ p1 ≤ ··· ≤ pk

p0 p1 ··· pk = n

Fundamental Theorem of Arithmetic

Example:

61394323221 = 3·3·3·7·11·11·37·37·37·53

Page 10: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Claim: Every integer > 1 is a product of primes.

Prime Products

Proof: (by contradiction)

Suppose not. Then set of non-products is nonempty.

There is a smallest integer n > 1 that is not a product of

primes.

In particular, n is not prime.

So n = k·m for integers k, m where n > k,m >1.

Since k,m smaller than the least nonproduct,

both are prime products, eg.,

k = p1 p2 p94

m = q1 q2 q214

Page 11: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Prime Products

…So

n = k m = p1 p2 p94 q1 q2 q214

is a prime product, a contradiction.

The set of nonproducts > 1 must be empty.

QED

Claim: Every integer > 1 is a product of primes.

(The proof of the fundamental theorem will be given later.)

Idea of induction (or smallest counterexample).

Page 12: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

For b > 0 and any a, there are unique numbers

q ::= quotient(a,b), r ::= remainder(a,b), such that

a = qb + r and 0 r < b.

The Quotient-Reminder Theorem

When b=2, this says that for any a,

there is a unique q such that a=2q or a=2q+1.

When b=3, this says that for any a,

there is a unique q such that a=3q or a=3q+1 or a=3q+2.

We also say q = a div b and r = a mod b.

Page 13: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

For b > 0 and any a, there are unique numbers

q ::= quotient(a,b), r ::= remainder(a,b), such that

a = qb + r and 0 r < b.

The Division Theorem

0 b 2b kb (k+1)b

Given any b, we can divide the integers into many blocks of b numbers.

For any a, there is a unique “position” for a in this line.

q = the block where a is in

a

r = the offset in this block

Clearly, given a and b, q and r are uniquely defined.

-b

Page 14: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

The Square of an Odd Integer

32 = 9 = 8+1, 52 = 25 = 3x8+1 …… 1312 = 17161 = 2145x8 + 1, ………

Idea 1: prove that n2 – 1 is divisible by 8.

Idea 2: consider (2k+1)2

Idea 0: find counterexample.

Page 15: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

The Square of an Odd Integer

Idea 3: Use quotient-remainder theorem.

Proof by cases.

Page 16: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Trial and Error Won’t Work!

Euler conjecture:

has no solution for a,b,c,d positive integers.

Open for 218 years,until Noam Elkies found

4 4 4 495800 217519 414560 422481

Fermat (1637): If an integer n is greater than 2,

then the equation an + bn = cn has no solutions in non-zero integers a,

b, and c.Claim: has no solutions in non-zero integers a, b, and c.

False. But smallest counterexample has more than 1000 digits.

Page 17: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Since m is an odd number, m = 2l+1 for some natural number l.

So m2 is an odd number.

The Square Root of an Even Square

Statement: If m2 is even, then m is even

Contrapositive: If m is odd, then m2 is odd.

So m2 = (2l+1)2

= (2l)2 + 2(2l) + 1

Proof (the contrapositive):

Proof by contrapositive.

Page 18: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

• Suppose was rational.

• Choose m, n integers without common prime factors (always

possible) such that

• Show that m and n are both even, thus having a common

factor 2,

a contradiction!

n

m2

Theorem: is irrational.2

Proof (by contradiction):

Irrational Number

2

Page 19: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

lm 2so can assume

2 24m l

22 2ln

so n is even.

n

m2

mn2

222 mn

so m is even.

2 22 4n l

Theorem: is irrational.2

Proof (by contradiction): Want to prove both m and n are even.

Proof by contradiction.

Irrational Number

Page 20: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Infinitude of the Primes

Theorem. There are infinitely many prime numbers.

Claim: if p divides a, then p does not divide a+1.

Let p1, p2, …, pN be all the primes.

Proof by contradiction.

Consider p1p2…pN + 1.

Page 21: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Greatest Common Divisors

Given a and b, how to compute gcd(a,b)?

Can try every number,

but can we do it more efficiently?

Let’s say a>b.

1. If a=kb, then gcd(a,b)=b, and we are done.

2. Otherwise, by the Division Theorem, a = qb + r for r>0.

Page 22: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Greatest Common Divisors

Let’s say a>b.

1. If a=kb, then gcd(a,b)=b, and we are done.

2. Otherwise, by the Division Theorem, a = qb + r for r>0.

Euclid: gcd(a,b) = gcd(b,r)!

a=12, b=8 => 12 = 8 + 4 gcd(12,8) = 4

a=21, b=9 => 21 = 2x9 + 3 gcd(21,9) = 3

a=99, b=27 => 99 = 3x27 + 18 gcd(99,27) = 9

gcd(8,4) = 4

gcd(9,3) = 3

gcd(27,18) = 9

Page 23: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Euclid’s GCD Algorithm

Euclid: gcd(a,b) = gcd(b,r)

gcd(a,b)

if b = 0, then answer = a.

else

write a = qb + r

answer = gcd(b,r)

a = qb + r

Page 24: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

gcd(a,b)

if b = 0, then answer = a.

else

write a = qb + r

answer = gcd(b,r)

Example 1

GCD(102, 70) 102 = 70 + 32

= GCD(70, 32) 70 = 2x32 + 6

= GCD(32, 6) 32 = 5x6 + 2

= GCD(6, 2) 6 = 3x2 + 0

= GCD(2, 0)

Return value: 2.

Page 25: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

gcd(a,b)

if b = 0, then answer = a.

else

write a = qb + r

answer = gcd(b,r)

Example 2

GCD(252, 189) 252 = 1x189 + 63

= GCD(189, 63) 189 = 3x63 +

0

= GCD(63, 0)

Return value: 63.

Page 26: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

gcd(a,b)

if b = 0, then answer = a.

else

write a = qb + r

answer = gcd(b,r)

Example 3

GCD(662, 414) 662 = 1x414 + 248

= GCD(414, 248) 414 = 1x248 + 166

= GCD(248, 166) 248 = 1x166 + 82

= GCD(166, 82) 166 = 2x82 + 2

= GCD(82, 2) 82 = 41x2 + 0

= GCD(2, 0)

Return value: 2.

Page 27: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Euclid: gcd(a,b) = gcd(b,r)

a = qb + r

Correctness of Euclid’s GCD Algorithm

When r = 0:

Page 28: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Euclid: gcd(a,b) = gcd(b,r)a = qb + r

Correctness of Euclid’s GCD Algorithm

Let d be a common divisor of b, r

When r > 0:

Page 29: Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer

Euclid: gcd(a,b) = gcd(b,r)a = qb + r

Correctness of Euclid’s GCD Algorithm

Let d be a common divisor of a, b.

When r > 0: