Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number Theory and Techniques of Proof

Similar presentations


Presentation on theme: "Number Theory and Techniques of Proof"— Presentation transcript:

1 Number Theory and Techniques of Proof

2 Basic definitions:Parity
An integer n is called even if, and only if, there exists an integer k such that n = 2*k. An integer n is called odd if, and only if, it is not even. Corollary: An integer n is called odd if, and only if, there exists an integer k such that n = 2*k + 1 The property of an integer as being either odd or even is known as its parity.

3 Arguing the positive: Universal Statements
Let’s consider the following statement: “The sum of an odd and an even integer is odd.”

4 Arguing the positive: Universal Statements
Let’s consider the following statement: “The sum of an odd and an even integer is odd.” Do you believe this statement? Yes No

5 Arguing the positive: Universal Statements
Let’s consider the following statement: “The sum of an odd and an even integer is odd.” Do you believe this statement? If you believe it, you have to try to prove that it’s true (argue the positive/affirmative) Yes No

6 Proof, take 1 Claim to be proven true (we argue its affirmative):
“The sum of an odd and an even integer is odd.” Proof: Let 𝑛 1 be any odd integer. Then, ∃𝑘∈ℤ 𝑛 1 =2⋅𝑘+1 (1) Let 𝑛 2 be any even integer. Then, 𝑛 2 =2⋅𝑘 (2) By (1) and (2), we have that 𝑛 1 + 𝑛 2 = 2⋅𝑘+1 +2⋅𝑘= 2𝑘+2𝑘 +1=2⋅ 2𝑘 +1 (3). We set 2𝑘=𝑟. Clearly, 𝑟∈ℤ. (4) Substituting (4) into (3) yields: 𝑛 1 + 𝑛 2 =2⋅𝑟 + 1, which means that 𝑛 1 + 𝑛 2 is odd. End of proof.

7 Proof, take 1 Claim to be proven true (we argue its affirmative): “The sum of an odd and an even integer is odd.” Proof: Let 𝑛 1 be any odd integer. Then, ∃𝑘∈ℤ 𝑛 1 =2⋅𝒌+1 (1) Let 𝑛 2 be any even integer. Then, 𝑛 2 =2⋅𝒌 (2) By (1) and (2), we have that 𝑛 1 + 𝑛 2 = 2⋅𝑘+1 +2⋅𝑘= 2𝑘+2𝑘 +1=2⋅ 2𝑘 +1 (3). We set 2𝑘=𝑟. Clearly, 𝑟∈ℤ. (4) Substituting (4) into (3) yields: 𝑛 1 + 𝑛 2 =2⋅𝑟 + 1, which means that 𝑛 1 + 𝑛 2 is odd. End of proof. What does this proof actually prove? WHOOPS!

8 Proof, take 1 Claim to be proven true (we argue its affirmative): “The sum of an odd and an even integer is odd.” Proof: Let 𝑛 1 be any odd integer. Then, ∃𝑘∈ℤ 𝑛 1 =2⋅𝒌+1 (1) Let 𝑛 2 be any even integer. Then, 𝑛 2 =2⋅𝒌 (2) By (1) and (2), we have that 𝑛 1 + 𝑛 2 = 2⋅𝑘+1 +2⋅𝑘= 2𝑘+2𝑘 +1=2⋅ 2𝑘 +1 (3). We set 2𝑘=𝑟. Clearly, 𝑟∈ℤ. (4) Substituting (4) into (3) yields: 𝑛 1 + 𝑛 2 =2⋅𝑟 + 1, which means that 𝑛 1 + 𝑛 2 is odd. End of proof. What does this proof actually prove? It proves that two consecutive integers sum to an odd number! WHOOPS!

9 Proof, take 2 Claim to be proven true (we argue its affirmative):
“The sum of an odd and an even integer is odd.” Proof: Let 𝑛 1 be any odd integer. Then, ∃ 𝑘 1 ∈ℤ 𝑛 1 =2⋅ 𝑘 (1) Let 𝑛 2 be any even integer. Then, ∃ 𝑘 2 ∈ℤ [ 𝑛 2 =2⋅ 𝑘 2 ] (2) By (1) and (2), we have that 𝑛 1 + 𝑛 2 = 2⋅ 𝑘 ⋅ 𝑘 2 =2⋅ 𝑘 1 + 𝑘 (3). We set 𝑘 1 + 𝑘 2 =𝑘. Clearly, 𝑘 is an integer. (4) Substituting (4) into (3) yields: 𝑛 1 + 𝑛 2 =2⋅𝑘 + 1, which means that 𝑛 1 + 𝑛 2 is odd. End of proof.

10 Statements of claims / theorems
Mathematical claims and theorems can be stated in various different ways! “The sum of an odd and an even integer is odd.” “Any two integers of opposite parity sum to an odd number” “Every pair of integers of opposite parity sums to an odd number” ∀ 𝑛 1 ∈ ℤ 2𝑘+1 [ ∀ 𝑛 2 ∈ ℤ 2𝑘 𝑛 1 + 𝑛 2 ∈ 𝑍 2𝑘+1 ]

11 Statements of claims / theorems
Mathematical claims and theorems can be stated in various different ways! “The sum of an odd and an even integer is odd.” “Any two integers of opposite parity sum to an odd number” Other ideas? “Every pair of integers of opposite parity sums to an odd number” ∀ 𝑛 1 ∈ ℤ 2𝑘+1 [ ∀ 𝑛 2 ∈ ℤ 2𝑘 𝑛 1 + 𝑛 2 ∈ 𝑍 2𝑘+1 ]

12 Your turn, class! Let’s split into teams and prove the following claims true: The square of an odd integer is also odd. If 𝑎 is an integer, then 𝑎 2 +𝑎 is even.

13 Arguing the affirmative of existential statements
Two methods: Constructive Non-Constructive In “constructive” proofs we either explicitly show or construct an element of the domain that answers our query. In non-constructive proofs (very rare in this class) we prove that it is a logical necessity for such an element to exist! But we neither explicitly, nor implicitly, show or construct such an element!

14 Our first constructive proof
Claim: There exists a natural number that you cannot write as a sum of three squares of natural numbers.

15 Constructive proofs in Number Theory (and one non-constructive one)

16 Our first constructive proof
Claim: There exists a natural number that you cannot write as a sum of three squares of natural numbers. Examples of numbers you can write as a sum of three squares: 0= 1= 2= Try to find a number that cannot be written as such.

17 Proof The natural number 7 cannot be written as the sum of three squares. This we can prove by case analysis: Can’t use 3, since 3 2 =9>7 Can’t use 2 more than once, since =8>7 So, we can use 2, one or zero times. If we use 2 once, we have 7= 𝑎 2 + 𝑏 2 ≤ =6<7 If we use 2 zero times, the maximum value is =3<7

18 Your turn, class! Let’s split in teams and prove the following theorems: There exists an integer 𝑛 that can be written in two ways as a sum of two prime numbers. There is a perfect square that can be written as a sum of two other perfect squares. Suppose 𝑟, 𝑠∈ℤ. Then, (∃𝑘∈ℤ)[ 22𝑟 + 18𝑠 = 2𝑘] There exists an integer 𝑛 that can be written in two ways as a sum of two cubed integers. (Hard) 1729: Ramanujan, Hardy,

19 Your turn, class! How is the 3rd proof different from the others?
Let’s split in teams and prove the following theorems: There exists an integer 𝑛 that can be written in two ways as a sum of two prime numbers. There is a perfect square that can be written as a sum of two other perfect squares. Suppose 𝑟, 𝑠∈ℤ. Then,(∃𝑘∈ℤ)[ 22𝑟 + 18𝑠 = 2𝑘] There exists an integer 𝑛 that can be written in two ways as a sum of two cubed integers. (Hard) (4) is the Ramanujan problem How is the 3rd proof different from the others?

20 Our first (and last?) non-constructive proof
Theorem: There exists a pair of irrational numbers 𝑎 and 𝑏 such that 𝑎 𝑏 is a rational number. Proof: Let 𝑎 = 𝑏 = 2 . Since 2 is irrational, 𝑎 and 𝑏 are both irrational. Is 𝑎 𝑏 = ( 2 ) rational? Two cases: If is rational, then we have proven the result. Done. If is irrational, then we will name it 𝑐. Then, observe that 𝑐 is rational, since 𝑐 2 = = =2∈ℚ. Since both 𝑐 and are irrationals, but 𝑐 is rational, we are done. Take it as a given (for now) that root of 2 is irrational.

21 Divisibility Let 𝑛∈ℤ and d∈ ℤ ≠0 . Then, we say or denote any one of the following: d divides n n is divided by d d | n d is a divisor (or factor) of n n is a multiple of d 𝑛≡0 (𝑚𝑜𝑑 𝑑) if, and only if, ∃𝑘∈ℤ [𝑛=𝑑⋅𝑘] We sometimes call k the quotient of the division of n by d. If d does not divide n, we denote that by 𝑑 ∤ 𝑦 (note the small strikethrough)

22 Pop Quizzes 3 | 6 Yes No

23 Pop Quizzes 3 | 6 Y 6 | 3 Yes No

24 Pop Quizzes 3 | 6 Y 6 | 3 N 10 | 10 Yes No

25 Pop Quizzes 3 | 6 Y 6 | 3 N 10 | 10 Y -10 ∤ 10 Yes No

26 Pop Quizzes 3 | 6 Y 6 | 3 N 10 | 10 Y -10 ∤ 10 N 5 | 0 Yes No

27 Pop Quizzes 3 | 6 Y 6 | 3 N 10 | 10 Y -10 ∤ 10 N 5 | 0 Y 0 | 5 Yes No

28 Pop Quizzes 3 | 6 Y 6 | 3 N 10 | 10 Y -10 ∤ 10 N 5 | 0 Y 0 | 5 N
∀𝑝∈𝐏, 2∤𝑝 Yes No

29 Pop Quizzes 3 | 6 Y 6 | 3 N 10 | 10 Y -10 ∤ 10 N 5 | 0 Y 0 | 5 N
∼∃𝑛∈ ℕ 𝑜𝑑𝑑 :𝑛 | 0 Yes No

30 Pop Quizzes 3 | 6 Y 6 | 3 N 10 | 10 Y -10 ∤ 10 N 5 | 0 Y 0 | 5 N
∼∃𝑛∈ ℕ 𝑜𝑑𝑑 :𝑛 | 0 N (any non-zero integer divides 0) Yes No

31 Universal claims with divisibility
Let’s all try to prove the affirmative of this claim: ∀𝑎, 𝑏, 𝑐∈ℤ [((𝑎≠0)∧ 𝑎 𝑏)∧(𝑎 𝑐 )⇒𝑎 | 𝑏+𝑐 ]

32 Universal claims with divisibility
Let’s all try to prove the affirmative of this claim: ∀𝑎, 𝑏, 𝑐∈ℤ 𝑎≠0 ∧ 𝑎 𝑏 ∧ 𝑎 𝑐 ⇒𝑎 𝑏+𝑐 Proof: 𝑎 |𝑏⇒ ∃ 𝑟 1 ∈ℤ 𝑏=𝑎⋅ 𝑟 1 𝑎 |𝑐⇒ ∃ 𝑟 2 ∈ℤ 𝑐=𝑎⋅ 𝑟 2 From (1) and (2), we have that 𝑏+𝑐=𝑎⋅ 𝑟 1 +𝑎⋅ 𝑟 2 =𝑎⋅( 𝑟 1 + 𝑟 2 ) So 𝑎 |(𝑏+𝑐). Done.

33 Proof by contradiction
Sometimes, proving a fact directly is tough. In such cases, we can attempt an indirect proof The most common type of indirect proof is proof by contradiction Briefly: We want to prove a fact 𝑎, so we assume ∼𝑎 and hope that we reach a contradiction (a falsehood). Example: We will prove that if a prime number divides an integer 𝒂, it cannot possible divide 𝒂+𝟏.

34 Proofs by contradiction in Number Theory

35 First proof by contradiction
Claim: Let 𝑝∈𝐏, 𝑎∈ℕ. Then, if 𝑝 |𝑎, then 𝑝∤ 𝑎+1 .

36 First proof by contradiction
Claim: Let 𝑝∈𝐏, 𝑎∈ℕ. Then, if 𝑝 |𝑎, then 𝑝∤ 𝑎+1 . Proof: Assume that 𝑝 |(𝑎+1). Then, this means that ∃ 𝑟 1 ∈ℤ 𝑎+1=𝑝⋅ 𝑟 1 (I) We already know that 𝑝 |𝑎⇒(∃ 𝑟 2 ∈ℤ)[𝑎=𝑝⋅ 𝑟 2 ] (II) Substituting (II) into (I) yields: 𝑝⋅ 𝑟 2 +1=𝑝⋅ 𝑟 1 ⇒𝑝 𝑟 1 − 𝑟 2 =1⇒𝑝 |1 which is a contradiction. Therefore, 𝑝∤ 𝑎+1 .

37 Infinitude of primes Assume that the primes are finite. Then, we can list them in ascending order: 𝑝 1 , 𝑝 2 ,…, 𝑝 𝑛

38 Infinitude of primes Assume that the primes are finite. Then, we can list them in ascending order: 𝑝 1 , 𝑝 2 ,…, 𝑝 𝑛 Let’s create the number 𝑁= 𝑝 1 ⋅ 𝑝 2 ⋅…⋅ 𝑝 𝑛 +1

39 Infinitude of primes 𝑁= 𝑝 1 ⋅ 𝑝 2 ⋅…⋅ 𝑝 𝑛 +1
Clearly, 𝑁 is bigger than any 𝑝 𝑖 . We have two cases: N is prime. Contradiction, since 𝑁 is bigger than any prime. N is composite. This means that N has at least one factor 𝑓. Let’s take the smallest factor of N, and call it 𝑓 𝑚𝑖𝑛 . Then, this number is prime (why?) Since 𝑓 𝑚𝑖𝑛 is prime, it divides 𝑝 1 ⋅ 𝑝 2 ⋅…⋅ 𝑝 𝑛 . By the previous theorem, this means that it cannot possibly divide 𝑝 1 ⋅ 𝑝 2 ⋅…⋅ 𝑝 𝑛 +1=𝑁. Contradiction, since we assumed that 𝑓 𝑚𝑖𝑛 is a factor of N. Therefore, the primes are not finite.

40 Modular Arithmetic

41 Modular Arithmetic We say that 𝑎≡𝑏 𝑚𝑜𝑑 𝑚 (read “a is congruent to b mod m”) means that 𝑚 |(𝑎−𝑏). Examples: 100≡2 𝑚𝑜𝑑 7 91≡0 𝑚𝑜𝑑 13 6≡2 𝑚𝑜𝑑 4 Convention: 0≤𝑏≤𝑚−1 THINK: Take large number 𝑎, divide by 𝑚, remainder is 𝑏 Terminology: “Reducing 𝑎 𝑚𝑜𝑑 𝑚”

42 ≡ vs ≡ In Logic, 𝜑 1 ≡ 𝜑 2 mean that 𝜑 1 and 𝜑 2 have the same truth table (are logically equivalent) In Number Theory, 𝑎≡𝑏 (𝑚𝑜𝑑 𝑚), read “a is congruent to b mod m”) means 𝑚 | 𝑎 −𝑏 !

43 ≡ vs ≡ In Logic, 𝜑 1 ≡ 𝜑 2 mean that 𝜑 1 and 𝜑 2 have the same truth table (are logically equivalent) In Number Theory, 𝑎≡𝑏 (𝑚𝑜𝑑 𝑚), read “a is congruent to b mod m”) means 𝑚 | 𝑎 −𝑏 ! THESE TWO ARE VERY DIFFERENT!!!! THEY HAVE NOTHING TO DO WITH EACH OTHER!

44 Properties of equivalence
If 𝑎 1 ≡ 𝑏 1 (𝑚𝑜𝑑 𝑚) and 𝑎 2 ≡ 𝑏 2 (𝑚𝑜𝑑 𝑚), then: 𝑎 1 + 𝑎 2 ≡ 𝑏 1 + 𝑏 2 (𝑚𝑜𝑑 𝑚)

45 Properties of equivalence
If 𝑎 1 ≡ 𝑏 1 (𝑚𝑜𝑑 𝑚) and 𝑎 2 ≡ 𝑏 2 (𝑚𝑜𝑑 𝑚), then: 𝑎 1 + 𝑎 2 ≡ 𝑏 1 + 𝑏 2 𝑚𝑜𝑑 𝑚 Proof: 𝑎 1 ≡ 𝑏 1 𝑚𝑜𝑑 𝑚 ⇒𝑚|( 𝑎 1 − 𝑏 1 ) ∃ 𝑟 1 ∈ℤ [ 𝑎 1 − 𝑏 1 =𝑚⋅ 𝑟 1 ] (I) Similarly, ∃ 𝑟 2 ∈ℤ [ 𝑎 2 − 𝑏 2 =𝑚⋅ 𝑟 2 ] (II) Therefore, by (I) and (II) we have: 𝑎 1 − 𝑏 1 + 𝑎 2 − 𝑏 2 =𝑚⋅ 𝑟 1 +𝑚⋅ 𝑟 2 ⇒ 𝑎 1 + 𝑎 2 − 𝑏 1 + 𝑏 2 =𝑚⋅ 𝑟 1 + 𝑟 2 ⇒ 𝑎 1 + 𝑎 2 ≡ 𝑏 1 + 𝑏 2 (𝑚𝑜𝑑 𝑚)

46 Properties of equivalence
If 𝑎 1 ≡ 𝑏 1 (𝑚𝑜𝑑 𝑚) and 𝑎 2 ≡ 𝑏 2 𝑚𝑜𝑑 𝑚 , then 𝑎 1 ⋅ 𝑎 2 ≡ 𝑏 1 ⋅ 𝑏 2 𝑚𝑜𝑑 𝑚

47 Properties of equivalence
If 𝑎 1 ≡ 𝑏 1 (𝑚𝑜𝑑 𝑚) and 𝑎 2 ≡ 𝑏 2 𝑚𝑜𝑑 𝑚 , then 𝑎 1 ⋅ 𝑎 2 ≡ 𝑏 1 ⋅ 𝑏 2 𝑚𝑜𝑑 𝑚 Proof: For you to figure out. Might be in: Homework Quiz Midterm 1 Midterm 2 Final Any combination of the above How many possibilities are there?

48 First proof revisited Recall that we proved that the sum of an even and an odd integer is odd. Note that: If 𝑎 is even (so 2 divides it), then 𝑎≡0 𝑚𝑜𝑑 2 If 𝑎 is odd, then 𝑎≡1 𝑚𝑜𝑑 2 So now we can re-do the proof with modular arithmetic!

49 Proof with modular arithmetic
Claim: Any two integers of opposite parity sum to an odd number. Proof: Since 𝑎 1 , 𝑎 2 are opposite parity, without loss of generality, assume that 𝑎 1 ≡0 𝑚𝑜𝑑 2 and 𝑎 2 ≡1 (𝑚𝑜𝑑 2) Using the properties of modular arithmetic, we obtain: 𝑎 1 + 𝑎 2 ≡ 0+1 𝑚𝑜𝑑 2 ≡1 (𝑚𝑜𝑑 2) Done.

50 More proofs Similarly, you can show that ∀𝑎∈ℕ [𝑎 2 +𝑎≡0 ( 𝑚𝑜𝑑 2)]

51 More proofs Similarly, you can show that ∀𝑎∈ℕ [𝑎 2 +𝑎≡0 ( 𝑚𝑜𝑑 2)]
Proof: ≡ is ≡(𝑚𝑜𝑑 2) throughout to save space. We have two cases: 𝑎≡0. Then, 𝑎 2 +𝑎≡ ≡0. Done. 𝑎≡1. Then, 𝑎 2 +𝑎≡ ≡0. Done.

52 Advantages of this notation
Theorem (clumsy): If 𝑥 is such that when you divide x by 4 you get a remainder of 2, and 𝑦 is such that when you divide y by 4 you get a remainder of 3, then when you divide 𝑥 ⋅𝑦 by 4 you get a remainder of 2.

53 Advantages of this notation
Theorem (clumsy): If 𝑥 is such that when you divide x by 4 you get a remainder of 2, and 𝑦 is such that when you divide y by 4 you get a remainder of 3, then when you divide 𝑥 ⋅𝑦 by 4 you get a remainder of 2. THIS SOUNDS AWFUL!

54 Advantages of this notation
Theorem (clumsy): If 𝑥 is such that when you divide x by 4 you get a remainder of 2, and 𝑦 is such that when you divide y by 4 you get a remainder of 3, then when you divide 𝑥 ⋅𝑦 by 4 you get a remainder of 2. THIS SOUNDS AWFUL! Theorem (elegant): If 𝑥≡2 ( 𝑚𝑜𝑑 4) and 𝑦≡3 ( 𝑚𝑜𝑑 4), then 𝑥⋅𝑦≡2 (𝑚𝑜𝑑 4).

55 Advantages of this notation
Theorem (clumsy): If 𝑥 is such that when you divide x by 4 you get a remainder of 2, and 𝑦 is such that when you divide y by 4 you get a remainder of 3, then when you divide 𝑥 ⋅𝑦 by 4 you get a remainder of 2. THIS SOUNDS AWFUL! Theorem (elegant): If 𝑥≡2 ( 𝑚𝑜𝑑 4) and 𝑦≡3 ( 𝑚𝑜𝑑 4), then 𝑥⋅𝑦≡2 (𝑚𝑜𝑑 4). Proof: All ≡ are mod 4. Then: 𝑥⋅𝑦≡2⋅3≡6 ≡2 (𝑚𝑜𝑑 4)

56 Proofs by contrapositive in Number Theory

57 Proof by contraposition
Applicable to all kinds of statements of type: ∀𝑥∈𝐷 [𝑃 𝑥 ⇒𝑄 𝑥 ]

58 Proof by contraposition
Applicable to all kinds of statements of type: ∀𝑥∈𝐷 [𝑃 𝑥 ⇒𝑄 𝑥 ] Sometimes, proving the implication in this way is hard. On the other hand, proving its contrapositive might be easier: ∀𝑥∈𝑆 [ ∼𝑄 𝑥 ⇒∼𝑃 𝑥 ]

59 Examples ∀𝑛∈ℤ 𝑛 2 ≡0 𝑚𝑜𝑑 2 ⇒𝑛≡0 𝑚𝑜𝑑 2
∀𝑛∈ℤ 𝑛 2 ≡0 𝑚𝑜𝑑 2 ⇒𝑛≡0 𝑚𝑜𝑑 2 Proving this directly is somewhat hard On the other hand, the contrapositive is child’s (or 250 student’s) play: ∀𝑛∈ℤ, [ 𝑛≢0 (𝑚𝑜𝑑 2)⇒ 𝑛 2 ≢0 (𝑚𝑜𝑑 2)]

60 Examples ∀𝑛∈ℤ [ 𝑛 2 ≡0 ( 𝑚𝑜𝑑 2)⇒𝑛≡0 ( 𝑚𝑜𝑑 2)]
Proving this directly is somewhat hard On the other hand, the contrapositive is child’s (or 250 student’s) play: ∀𝑛∈ℤ, [ 𝑛≢0 (𝑚𝑜𝑑 2)⇒ 𝑛 2 ≢0 (𝑚𝑜𝑑 2) Proof: Since 𝑛≢0 (𝑚𝑜𝑑 2), we have that 𝑛≡1 𝑚𝑜𝑑 2 . So, 𝑛 2 ≡ 1 2 ≡1 (𝑚𝑜𝑑 2)

61 Another example If 𝑛 2 ≡0 (𝑚𝑜𝑑 5), then 𝑛≡0 (𝑚𝑜𝑑 5)

62 Another example If 𝑛 2 ≡0 (𝑚𝑜𝑑 5), then 𝑛≡0 (𝑚𝑜𝑑 5)
Proof (contrapositive): 𝑛≢0 (𝑚𝑜𝑑 5)⇒ 𝑛 2 ≢0 (𝑚𝑜𝑑 5) Cases (all ≡ are mod 5): 𝑛≡1 ⇒ 𝑛 2 ≡1≢ 0 𝑛≡2⇒ 𝑛 2 ≡4≢0 𝑛≡3⇒ 𝑛 2 ≡9≡4≢0 𝑛≡4⇒ 𝑛 2 ≡16≡1≢0 Done.

63 A historical proof by contradiction

64 Proof that 2 is irrational
Let’s assume BY WAY OF CONTRADICTION that 2 is rational. So 2 = 𝑎 𝑏 , 𝑎,𝑏∈ℤ, 𝑏≠0 and 𝑎,𝑏 do not have common factors. So 𝑎= 2 ⋅𝑏⇒ 𝑎 2 =2 𝑏 2 so 𝑎 2 ≡0 𝑚𝑜𝑑 2 (1) By the previous theorem, this means that 𝑎≡0 (𝑚𝑜𝑑 2) So 𝑎=2𝑘 for some integer 𝑘. (2) Substituting (2) into (1) yields: 2𝑘 2 =2 𝑏 2 ⇒ 𝑏 2 =2 𝑘 2 ⇒ 𝑏 2 ≡0 𝑚𝑜𝑑 2 ⇒𝑏≡0(𝑚𝑜𝑑 2) So both 𝑎 and 𝑏 are both even, have common factor of 2. Contradiction.

65 Proof that 5 is irrational
Let’s assume BY WAY OF CONTRADICTION that 5 is rational. So 5 = 𝑎 𝑏 , 𝑎,𝑏∈ℤ, 𝑏≠0 and 𝑎,𝑏 do not have common factors. So 𝑎= 5 ⋅𝑏⇒ 𝑎 2 =5 𝑏 2 so 𝑎 2 ≡0 𝑚𝑜𝑑 5 (1) By the previous theorem, this means that 𝑎≡0 (𝑚𝑜𝑑 5) So 𝑎=5𝑘 for some integer 𝑘. (2) Substituting (2) into (1) yields: 5𝑘 2 =5 𝑏 2 ⇒ 𝑏 2 =5 𝑘 2 ⇒ 𝑏 2 ≡0 𝑚𝑜𝑑 5 ⇒𝑏≡0 (𝑚𝑜𝑑 5) So both 𝑎 and 𝑏 are both even, have common factor of 5. Contradiction.

66 Proof that 4 is irrational (???)
Why can we not use this machinery to prove that 4 is irrational (which is wrong anyway)?

67 Using the Unique Factorization Theorem

68 Unique Factorization: examples
91= 7 1 × 13 1 There is no other way to factor 91 into a product of primes. 18= 2 1 × 3 2 Once again, no other way to factor 18 into a product of primes. 7= 7 1 Since 7 is prime, there is trivially no other way to factor it into primes. 1000= 2 3 × 5 3 1027: prime or not?

69 Unique Factorization: examples
91= 7 1 × 13 1 There is no other way to factor 91 into a product of primes. 18= 2 1 × 3 2 Once again, no other way to factor 18 into a product of primes. 7= 7 1 Since 7 is prime, there is trivially no other way to factor it into primes. 1000= 2 3 × 5 3 1027: prime or not? Nope! 1027=13 × 79 1049= (1049 is prime)

70 Statement of Theorem Every number 𝑛∈ ℕ ≥2 can be uniquely factored into a product of prime numbers 𝑝 1 , 𝑝 2 , …, 𝑝 𝑛 like so: 𝑛= 𝑝 1 𝑒 1 ⋅ 𝑝 2 𝑒 2 ⋅…⋅ 𝑝 𝑘 𝑒 𝑘 , 𝑒 𝑖 ∈ ℕ ≥1 Proving existence is easy (Jason) Proving uniqueness is hard (Bill)

71 What is “uniqueness”? By “uniqueness” we mean that the product is unique up to reordering of the factors 𝑝 𝑖 𝑒 𝑖 . Examples: 30= × = × 3 1 88= × = × 2 3 1026= 2 1 × × = 2 1 × × 3 3 = 19 1 × 2 1 × 3 3 = 3 3 × × 2 1

72 Proof of 2 ∉ℚ with PFT Proof (once again by contradiction): Assume that 2 ∈ℚ, so ∃𝑎∈ℤ, 𝑏∈ ℤ ≠0 [ 2 = 𝑎 𝑏 ]

73 Proof of 2 ∉ℚ with PFT Proof (once again by contradiction): Assume that 2 ∈ℚ, so ∃𝑎∈ℤ, 𝑏∈ ℤ ≠0 [ 2 = 𝑎 𝑏 ] Let 𝑘 1 ∈ℕ be the largest integer such that 𝑎= 2 𝑘 1 ⋅𝐴 (By UPFT) Similarly, let 𝑘 2 ∈ℕ be the largest integer such that 𝑏= 2 𝑘 2 ⋅𝐵 (By UPFT)

74 Proof of 2 ∉ℚ with UFT Since 2 = 𝑎 𝑏 , 𝑎 2 =2 𝑏 2
Proof (once again by contradiction): Assume that 2 ∈ℚ, so ∃𝑎∈ℤ, 𝑏∈ ℤ ≠0 [ 2 = 𝑎 𝑏 ] Since 2 = 𝑎 𝑏 , 𝑎 2 =2 𝑏 2

75 Proof of 2 ∉ℚ with UFT Since 2 = 𝑎 𝑏 , 𝑎 2 =2 𝑏 2
Let 𝑘 1 ∈ℕ be the largest integer such that 𝑎= 2 𝑘 1 ⋅𝐴⇒ 𝑎 2 = 2 2 𝑘 1 ⋅ 𝐴 2 Let 𝑘 2 ∈ℕ be the largest integer such that 𝑏= 2 𝑘 2 ⋅𝐵⇒ 𝑏 2 = 2 2 𝑘 2 ⋅ 𝐵 2 Since 𝑘 1 , 𝑘 2 are largest ints, 𝐴 and 𝐵 are odd, so 𝐴 2 , 𝐵 2 odd (we proved this) 𝑎 2 =2 𝑏 2 ⇒ 𝟐 𝟐 𝒌 𝟏 ⋅ 𝑨 𝟐 =𝟐⋅ 𝟐 𝟐 𝒌 𝟐 ⋅ 𝑩 𝟐 = 𝟐 𝟐 𝒌 𝟐 +𝟏 ⋅ 𝑩 𝟐 Even number of 2s on left side, odd number of 2s on right Contradiction.

76 Proof of 5 ∉ℚ with UFT 𝒂 𝟐 =𝟓 𝒃 𝟐 ⇒ 𝟓 𝟐 𝒌 𝟏 ⋅ 𝑨 𝟐 = 𝟓 𝟐 𝒌 𝟐 +𝟏 ⋅ 𝑩 𝟐
Proof (by contradiction) Assume that 5 ∈ℚ⇒ ∃𝑎∈ℤ, 𝑏∈ ℤ ≠ = 𝑎 𝑏 ⇒(∃𝑎∈ℤ, 𝑏∈ ℤ ≠0 )[ 𝑎 2 =5 𝑏 2 ] Let 𝑘 1 , 𝑘 2 ∈ℤ be the largest integers such that 𝑎= 5 𝑘 1 ⋅𝐴, 𝑏= 5 𝑘 2 ⋅𝐵. Clearly, 𝐴,𝐵 ≢0 (𝑚𝑜𝑑 5), so 𝐴 2 , 𝐵 2 ≢0 (𝑚𝑜𝑑 5) (make sure you’re convinced) 𝒂 𝟐 =𝟓 𝒃 𝟐 ⇒ 𝟓 𝟐 𝒌 𝟏 ⋅ 𝑨 𝟐 = 𝟓 𝟐 𝒌 𝟐 +𝟏 ⋅ 𝑩 𝟐 Even number of 5s on the left, odd on the right. Contradiction.

77 Proof that 4 ∉ℚ (???) with UFT
Why can we not use this machinery to prove that 4 is irrational (which is wrong anyway)?

78 Speed of Computations in Number Theory

79 Basic assumptions 𝑎+𝑏 and 𝑎⋅𝑏 have unit cost
This is not true if 𝑎,𝑏 are too large Jason: Do you mean >64 bits or something? Bill: Nobody cares, just say “large”.

80 First problem How fast can we compute 𝑎 𝑛 𝑚𝑜𝑑 𝑚 𝑛, 𝑚∈ℕ ?
Obviously, we can compute 𝑎 𝑛 = 𝑎×𝑎×⋯×𝑎 and mod that large number by 𝑚. 𝑛 𝑡𝑖𝑚𝑒𝑠

81 First problem How fast can we compute 𝑎 𝑛 𝑚𝑜𝑑 𝑚 𝑛, 𝑚∈ℕ ?
Obviously, we can compute 𝑎 𝑛 = 𝑎 × 𝑎 ×⋯ ×𝑎 and mod that large number by 𝑚. Is this algorithm ? 𝑛 𝑡𝑖𝑚𝑒𝑠 Good Bad Ugly

82 First problem How fast can we compute 𝑎 𝑛 𝑚𝑜𝑑 𝑚 𝑛, 𝑚∈ℕ ?
Obviously, we can compute 𝑎 𝑛 = 𝑎 × 𝑎 ×⋯×𝑎 and mod that large number by 𝑚. Is this algorithm ? 𝑛 𝑡𝑖𝑚𝑒𝑠 Because: Jason: Numbers can get above 32 bits, and that’s a storage and computation problem. Bill: Numbers get “too freaking large”. Good Bad Ugly

83 First problem, second approach
We could start computing 𝑎 × 𝑎 × … × 𝑎 until the product becomes larger than 𝑚, reduce and repeat until we’re done.

84 First problem, second approach
We could start computing 𝑎 × 𝑎⋯ × 𝑎 until the product becomes larger than 𝑚, reduce and repeat until we’re done. Is this better? Yes No Something Else

85 First problem, second approach
We could start computing 𝑎 × 𝑎 ×⋯× 𝑎 until the product becomes larger than 𝑚, reduce and repeat until we’re done. Is this better? Yes No Something Else We no longer produce huge numbers! However, we still need 𝑛 multiplications.

86 First problem How fast can we compute 𝑎 𝑛 𝑚𝑜𝑑 𝑚 𝑛, 𝑚∈ℕ ?
We always need 𝑛 steps We can do it in roughly 𝑛 steps We can do it in roughly log𝑛 steps Something Else

87 First problem How fast can we compute 𝑎 𝑛 𝑚𝑜𝑑 𝑚 𝑛, 𝑚∈ℕ ?
We always need 𝑛 steps We can do it in roughly 𝑛 steps We can do it in roughly log𝑛 steps Something Else

88 Example Computing 3 64 𝑚𝑜𝑑 99 in log 2 64 =6 steps.
All ≡ are ≡ (mod 99). 3 1 ≡3 3 2 ≡9 ≡ ≡ 9 2 ≡81 ≡ ≡ 81 2 ≡27 ≡ ≡ 27 2 ≡36 ≡ ≡ 36 2 ≡9 ≡ ≡81

89 Example Computing 3 64 𝑚𝑜𝑑 99 in log 2 64 =6 steps.
All ≡ are ≡ (mod 99). ≡9 ≡ ≡ 9 2 ≡81 ≡ ≡ 81 2 ≡27 ≡ ≡ 27 2 ≡36 ≡ ≡ 36 2 ≡9 ≡ ≡81 Aha! = ≡81

90 Good news, bad news Good news: By using repeated squaring, can compute 𝑎 2 ℓ 𝑚𝑜𝑑 𝑚 quickly (roughly ℓ= log ℓ steps) Bad news: What if our exponent is not a power of 2?

91 Example Computing 3 27 𝑚𝑜𝑑 99 with the same method
All ≡ are ≡ (mod 99). 3 1 ≡3 3 2 ≡9 ≡ ≡ 9 2 ≡81 ≡ ≡ 81 2 ≡27 ≡ ≡ 27 2 ≡36 3 27 = × × × 3 1 ≡36 × 27 × 9 × 3

92 Example (contd.) To avoid large numbers, reduce product as you go:
3 27 = × × × 3 1 ≡36 × 27 × 9 × 3≡ 36 × 27 × 9 × 3 ≡81 × 27≡9

93 Algorithm to compute 𝑎 𝑛 𝑚𝑜𝑑 𝑚 in log𝑛 steps
Step 1: Write 𝑛= 2 𝑞 𝑞 2 +…+ 2 𝑞 𝑟 , 𝑞 1 < 𝑞 2 <…< 𝑞 𝑟 Step 2: Note that 𝑎 𝑛 = 𝑎 2 𝑞 𝑞 2 +…+ 2 𝑞 𝑟 = 𝑎 2 𝑞 1 ×…× 𝑎 2 𝑞 𝑟 Step 3: Use repeated squaring to compute: 𝑎 , 𝑎 , 𝑎 , …, 𝑎 𝑞 𝑟 𝑚𝑜𝑑 𝑚 using 𝑎 2 𝑖+1 ≡ 𝑎 2 𝑖 𝑚𝑜𝑑 𝑚 Step 4: Compute 𝑎 2 𝑞 1 ×…× 𝑎 2 𝑞 𝑟 mod m reducing when necessary to avoid large numbers

94 The key step The key step is Step #3: Use repeated squaring to compute: 𝑎 , 𝑎 , 𝑎 , …, 𝑎 2 𝑞 𝑟 𝑚𝑜𝑑 𝑚 using 𝑎 2 𝑖+1 ≡ 𝑎 2 𝑖 𝑚𝑜𝑑 𝑚 When computing 𝑎 2 𝑖+1 mod m, already have computed 𝑎 2 𝑖 𝑚𝑜𝑑 𝑚 Note that all numbers are below 𝑚 because we reduce mod m every step of the way So 𝑎 2 𝑖 is unit cost and anything mod m is also unit cost!

95 Second problem: Greatest Common Divisor (GCD)
If 𝑎, 𝑏∈ ℕ ≠0 , then the GCD of 𝑎, 𝑏 is the largest non-zero integer 𝑛 such that 𝑛 |𝑎 and 𝑛 | 𝑏

96 Second problem: Greatest Common Divisor (GCD)
If 𝑎, 𝑏∈ ℕ ≠0 , then the GCD of 𝑎, 𝑏 is the largest non-zero integer 𝑛 such that 𝑛 |𝑎 and 𝑛 | 𝑏 What is the GCD of… 10 and 15?

97 Second problem: Greatest Common Divisor (GCD)
If 𝑎, 𝑏∈ ℕ ≠0 , then the GCD of 𝑎, 𝑏 is the largest non-zero integer 𝑛 such that 𝑛 |𝑎 and 𝑛 | 𝑏 What is the GCD of… 10 and 15? 5 12 and 90?

98 Second problem: Greatest Common Divisor (GCD)
If 𝑎, 𝑏∈ ℕ ≠0 , then the GCD of 𝑎, 𝑏 is the largest non-zero integer 𝑛 such that 𝑛 |𝑎 and 𝑛 | 𝑏 What is the GCD of… 10 and 15? 5 12 and 90? 6 20 and 29?

99 Second problem: Greatest Common Divisor (GCD)
If 𝑎, 𝑏∈ ℕ ≠0 , then the GCD of 𝑎, 𝑏 is the largest non-zero integer 𝑛 such that 𝑛 |𝑎 and 𝑛 | 𝑏 What is the GCD of… 10 and 15? 5 12 and 90? 6 20 and 29? 1 (20 and 29 are called co-prime or relatively prime) 153 and 181

100 Second problem: Greatest Common Divisor (GCD)
If 𝑎, 𝑏∈ ℕ ≠0 , then the GCD of 𝑎, 𝑏 is the largest non-zero integer 𝑛 such that 𝑛 |𝑎 and 𝑛 | 𝑏 What is the GCD of… 10 and 15? 5 12 and 90? 6 20 and 29? 1 (20 and 29 are called co-prime or relatively prime) 153 and

101 Euclid’s GCD algorithm
Recall: If 𝑎≡0 (𝑚𝑜𝑑 𝑚) and 𝑏≡0 𝑚𝑜𝑑 𝑚 , then 𝑎 −𝑏≡ 0 𝑚𝑜𝑑 𝑚 The GCD algorithm finds the greatest common divisor by executing this recursion (assume a > b): 𝐺𝐶𝐷 𝑎, 𝑏 =𝐺𝐶𝐷 𝑎, 𝑏 −𝑎 Until its arguments are the same.

102 Greatest Common Divisor (GCD)
Recall: If 𝑎≡0 (𝑚𝑜𝑑 𝑚) and 𝑏≡0 𝑚𝑜𝑑 𝑚 , then 𝑎 −𝑏≡ 0 𝑚𝑜𝑑 𝑚 The GCD algorithm finds the greatest common divisor by executing this recursion (assume a > b): 𝐺𝐶𝐷 𝑎, 𝑏 =𝐺𝐶𝐷 𝑎, 𝑏 −𝑎 Until its arguments are the same. Question: If we implement this in a programming language, it can only be done recursively Yes (why) No (Why) Something Else (What)

103 Greatest Common Divisor (GCD)
Recall: If 𝑎≡0 (𝑚𝑜𝑑 𝑚) and 𝑏≡0 𝑚𝑜𝑑 𝑚 , then 𝑎 −𝑏≡ 0 𝑚𝑜𝑑 𝑚 The GCD algorithm finds the greatest common divisor by executing this recursion: 𝐺𝐶𝐷 𝑎, 𝑏 =𝐺𝐶𝐷 𝑎, 𝑏 −𝑎 Until its arguments are the same. Question: If we implement this in a programming language, it can only be done recursively Tail recursion left = a; right = b; while(left != right){ if(left > right) left = left – right; else right = right - left; } print "GCD is: " left; // Or right Yes (why) No (Why) Something Else (What)

104 GCD example GCD(18, 100) = GCD(18, 100 – 18) = GCD(18, 82)=

105 GCD example GCD(18, 100) = GCD(18, 100 – 18) = GCD(18, 82)=
Given integers 𝑎, 𝑏 with 𝑎>𝑏 (without loss of generality), approximately how many steps does this algorithm take? a steps b steps a-b steps Something Else

106 GCD example GCD(18, 100) = GCD(18, 100 – 18) = GCD(18, 82)=
Given integers 𝑎, 𝑏 with 𝑎>𝑏 (without loss of generality), approximately how many steps does this algorithm take? a steps b steps Roughly 𝑎 𝑏 a-b steps Something Else

107 Can we do better? GCD(18, 100) = GCD(18, 100 – 18) = GCD(18, 82)=
Yes No Something Else GCD(18, 100) = GCD(18, 100 – 18) = GCD(18, 82)= GCD(18, 82 – 18 = GCD(18, 64) = GCD(18, 64 – 18) = GCD(18, 46) = GCD(18, 46 – 18) = GCD(18, 28) = GCD(18, 28 – 18) = GCD(18, 10) = GCD( , 10) = GCD(8, 10)= GCD(8, )= GCD(8, 2) = GCD(8 - 2, 2) = GCD(6, 2) = GCD(6 - 2, 2) = GCD(4, 2) = GCD(4- 2, 2) = GCD(2, 2) = 2

108 Can we do better? GCD(18, 100) = GCD(18, 100 – 18) = GCD(18, 82)=
Yes No Something Else GCD(18, 100) = GCD(18, 100 – 18) = GCD(18, 82)= GCD(18, 82 – 18 = GCD(18, 64) = GCD(18, 64 – 18) = GCD(18, 46) = GCD(18, 46 – 18) = GCD(18, 28) = GCD(18, 28 – 18) = GCD(18, 10) = GCD( , 10) = GCD(8, 10)= GCD(8, )= GCD(8, 2) = GCD(8 - 2, 2) = GCD(6, 2) = GCD(6 - 2, 2) = GCD(4, 2) = GCD(4- 2, 2) = GCD(2, 2) = 2 GCD(18, 100 – 5 x 18) GCD(18, 100) = GCD(18, 100 – 5 x 18) = GCD(18, 10) = GCD(18 – 10, 10) = GCD(8, 10) = GCD(8, ) = GCD(8, 2) = GCD(8 – 3 x 2, 2) = GCD(2, 2) = 2 GCD(8 – 3 x 2, 2) From 10 to 4 steps!

109 How fast is this new algorithm?
Given non-zero integers 𝑎, 𝑏 with 𝑎 > 𝑏, roughly how many steps does this new algorithm take to compute GCD(a, b)? 𝑎 𝑏 2 𝑎 loga Something Else

110 How fast is this new algorithm?
Given non-zero integers 𝑎, 𝑏 with 𝑎 > 𝑏, roughly how many steps does this new algorithm take to compute GCD(a, b)? In fact, it takes log 𝜙 𝑎 , where 𝜙= is the golden ratio. Proof by Gabriel Lamé in 1844, considered to be the first ever result in Algorithmic Complexity theory. 𝑎 𝑏 2 𝑎 loga Something Else


Download ppt "Number Theory and Techniques of Proof"

Similar presentations


Ads by Google