CS70: Lecture 2. Outline. Quick Background and Notation. Direct Proof. Theorem: For any a , b , c ∈ Z , if a | b and a | c then a | ( b − c ) . Integers closed under addition. Proof: Assume a | b and a | c Today: Proofs!!! b = aq and c = aq ′ where q , q ′ ∈ Z a , b ∈ Z = ⇒ a + b ∈ Z b − c = aq − aq ′ = a ( q − q ′ ) Done? 1. By Example. a | b means “a divides b”. ( b − c ) = a ( q − q ′ ) and ( q − q ′ ) is an integer so 2 | 4? Yes! 2. Direct. (Prove P = ⇒ Q . ) 7 | 23? No! a | ( b − c ) 3. by Contraposition (Prove P = ⇒ Q ) 4 | 2? No! Works for ∀ a , b , c ? 4. by Contradiction (Prove P .) Argument applies to every a , b , c ∈ Z . Formally: a | b ⇐ ⇒ ∃ q ∈ Z where b = aq . 5. by Cases Direct Proof Form: 3 | 15 since for q = 5, 15 = 3 ( 5 ) . Goal: P = ⇒ Q A natural number p > 1, is prime if it is divisible only by 1 and itself. Assume P . ... Therefore Q. Another direct proof. The Converse Another Direct Proof. Let D 3 be the 3 digit natural numbers. Theorem: For n ∈ D 3 , if the alternating sum of digits of n is divisible Theorem: ∀ n ∈ D 3 , ( 11 | n ) = ⇒ ( 11 | alt. sum of digits of n ) by 11, than 11 | n . Proof: Assume 11 | n . n = 100 a + 10 b + c = 11 k = ⇒ ∀ n ∈ D 3 , ( 11 | alt. sum of digits of n ) = ⇒ 11 | n 99 a + 11 b +( a − b + c ) = 11 k = ⇒ Examples: Thm: ∀ n ∈ D 3 , ( 11 | alt. sum of digits of n ) = ⇒ 11 | n a − b + c = 11 k − 99 a − 11 b = ⇒ n = 121 Alt Sum: 1 − 2 + 1 = 0. Divis. by 11. As is 121. a − b + c = 11 ( k − 9 a − b ) = ⇒ Is converse a theorem? a − b + c = 11 ℓ where ℓ = ( k − 9 a − b ) ∈ Z n = 605 Alt Sum: 6 − 0 + 5 = 11 Divis. by 11. As is 605 = 11 ( 55 ) ∀ n ∈ D 3 , ( 11 | n ) = ⇒ ( 11 | alt. sum of digits of n ) That is 11 | alternating sum of digits. Yes? No? Proof: For n ∈ D 3 , n = 100 a + 10 b + c , for some a , b , c . Note: similar proof to other. In this case every = ⇒ is ⇐ ⇒ Assume: Alt. sum: a − b + c = 11 k for some integer k . Often works with arithmetic properties ... Add 99 a + 11 b to both sides. ...not when multiplying by 0. 100 a + 10 b + c = 11 k + 99 a + 11 b = 11 ( k + 9 a + b ) We have. Left hand side is n , k + 9 a + b is integer. = ⇒ 11 | n . Theorem: ∀ n ∈ N ′ , ( 11 | alt. sum of digits of n ) ⇐ ⇒ ( 11 | n ) Direct proof of P = ⇒ Q : Assumed P : 11 | a − b + c . Proved Q : 11 | n .
Proof by Contraposition Another Contraposition... Proof by contradiction:form Lemma: For every n in N , n 2 is even = ⇒ n is even. ( P = ⇒ Q ) Thm: For n ∈ Z + and d | n . If n is odd then d is odd. √ √ n 2 is even, n 2 = 2 k , ... Theorem: 2 is irrational. 2 k even? n = 2 k + 1 what do we know about d ? b ) 2 � = 2. Must show: For every a , b ∈ Z , ( a Proof by contraposition: ( P = ⇒ Q ) ≡ ( ¬ Q = ⇒ ¬ P ) What to do? P = ’ n 2 is even.’ ........... ¬ P = ’ n 2 is odd’ A simple property (equality) should always “not” hold. Goal: Prove P = ⇒ Q . Proof by contradiction: Q = ’n is even’ ........... ¬ Q = ’n is odd’ Assume ¬ Q ⇒ n 2 is odd. Theorem: P . Prove ¬ Q = ⇒ ¬ P : n is odd = ...and prove ¬ P . ¬ P = ⇒ P 1 ··· = ⇒ R Conclusion: ¬ Q = ⇒ ¬ P equivalent to P = ⇒ Q . n = 2 k + 1 ¬ P = ⇒ Q 1 ··· = ⇒ ¬ R n 2 = 4 k 2 + 4 k + 1 = 2 ( 2 k + k )+ 1. Proof: Assume ¬ Q : d is even. d = 2 k . n 2 = 2 l + 1 where l is a natural number.. ¬ P = ⇒ R ∧¬ R ≡ False d | n so we have ... and n 2 is odd! Contrapositive: True = ⇒ P . Theorem P is proven. n = qd = q ( 2 k ) = 2 ( kq ) n is even. ¬ P ¬ Q = ⇒ ¬ P so P = ⇒ Q and ... Contradiction Proof by contradiction: example Product of first k primes.. √ Theorem: There are infinitely many primes. Theorem: 2 is irrational. √ Proof: Assume ¬ P : 2 = a / b for a , b ∈ Z . Did we prove? ◮ Assume finitely many primes: p 1 ,..., p k . Reduced form: a and b have no common factors. ◮ “The product of the first k primes plus 1 is prime.” ◮ Consider √ ◮ No. 2 b = a q = ( p 1 × p 2 ×··· p k )+ 1 . ◮ The chain of reasoning started with a false statement. 2 b 2 = a 2 = 4 k 2 ◮ q cannot be one of the primes as it is larger than any p i . Consider example.. a 2 is even = ⇒ a is even. ◮ q has prime divisor p (” p > 1” = R ) which is one of p i . ◮ 2 × 3 × 5 × 7 × 11 × 13 + 1 = 30031 = 59 × 509 a = 2 k for some integer k ◮ p divides both x = p 1 · p 2 ··· p k and q , and divides x − q , ◮ There is a prime in between 13 and q = 30031 that divides q . b 2 = 2 k 2 ◮ = ⇒ p | x − q = ⇒ p ≤ x − q = 1. ◮ Proof assumed no primes in between p k and q . b 2 is even = ⇒ b is even. ◮ so p ≤ 1. ( Contradicts R . ) a and b have a common factor. Contradiction. The original assumption that “the theorem is false” is false, thus the theorem is proven.
Proof by cases. Proof by cases. Be careful. Theorem: x 5 − x + 1 = 0 has no solution in the rationals. Theorem: There exist irrational x and y such that x y is rational. Proof: First a lemma... √ Lemma: If x is a solution to x 5 − x + 1 = 0 and x = a / b for a , b ∈ Z , Let x = y = 2. √ then both a and b are even. √ 2 is rational. Done! Case 1: x y = 2 Theorem: 3 = 4 Reduced form a b : a and b can’t both be even! + Lemma √ √ 2 is irrational. = ⇒ no rational solution. Proof: Assume 3 = 4. Case 2: 2 √ Proof of lemma: Assume a solution of the form a / b . √ √ Start with 12 = 12. 2 , y = ◮ New values: x = 2 2. Divide one side by 3 and the other by 4 to get � 5 � a − a b + 1 = 0 ◮ 4 = 3. 2 � √ b √ √ √ � √ 2 √ √ 2 = 2 = 2 . 2 ∗ x y = 2 = 2 2 By commutativity theorem holds. Multiply by b 5 , a 5 − ab 4 + b 5 = 0 Don’t assume what you want to prove! Thus, we have irrational x and y with a rational x y (i.e., 2). Case 1: a odd, b odd: odd - odd +odd = even. Not possible. Case 2: a even, b odd: even - even +odd = even. Not possible. One of the cases is true so theorem holds. Case 3: a odd, b even: odd - even +even = even. Not possible. Case 4: a even, b even: even - even +even = even. Possible. Question: Which case holds? Don’t know!!! The fourth case is the only one possible, so the lemma follows. Be really careful! Summary: Note 2. CS70: Note 3. Induction! Direct Proof: To Prove: P = ⇒ Q . Assume P . Prove Q . Theorem: 1 = 2 By Contraposition: Proof: For x = y , we have To Prove: P = ⇒ Q Assume ¬ Q . Prove ¬ P . ( x 2 − xy ) = x 2 − y 2 1. The natural numbers. By Contradiction: x ( x − y ) = ( x + y )( x − y ) To Prove: P Assume ¬ P . Prove False . 2. 5 year old Gauss. x = ( x + y ) x = 2 x By Cases: informal. 3. ..and Induction. Universal: show that statement holds in all cases. 1 = 2 4. Simple Proof. Existence: used cases where one is true. √ √ Dividing by zero is no good. Either 2 and 2 worked. √ √ √ 2 worked. Also: Multiplying inequalities by a negative. or 2 and 2 P = ⇒ Q does not mean Q = ⇒ P . Careful when proving! Don’t assume the theorem. Divide by zero.Watch converse. ... And finally. Have a nice weekend!!
The naturals. A formula. Gauss and Induction i = 1 i = n ( n + 1 ) Child Gauss: ( ∀ n ∈ N )( ∑ n ) Proof? 2 i = 1 i = k ( k + 1 ) Idea: assume predicate P ( n ) for n = k . P ( k ) is ∑ k . 2 Is predicate, P ( n ) true for n = k + 1? i = 1 i )+( k + 1 ) = k ( k + 1 ) + k + 1 = ( k + 1 )( k + 2 ) ∑ k + 1 i = 1 i = ( ∑ k . 2 2 How about k + 2. Same argument starting at k + 1 works! n + 3 Teacher: Hello class. Induction Step. P ( k ) = ⇒ P ( k + 1 ) . n + 2 Teacher: Please add the numbers from 1 to 100. 0, 1, 2, 3, Is this a proof? It shows that we can always move to the next step. n + 1 Gauss: It’s ( 100 )( 101 ) or 5050! ... , n , n + 1, n + 2, n + 3, ... 2 n Need to start somewhere. P ( 0 ) is ∑ 0 i = 0 i = 1 = ( 0 )( 0 + 1 ) Base Case. 2 Statement is true for n = 0 P ( 0 ) is true plus inductive step = ⇒ true for n = 1 ( P ( 0 ) ∧ ( P ( 0 ) = ⇒ P ( 1 ))) = ⇒ P ( 1 ) 3 plus inductive step = ⇒ true for n = 2 ( P ( 1 ) ∧ ( P ( 1 ) = ⇒ P ( 2 ))) = ⇒ P ( 2 ) ... 2 true for n = k = ⇒ true for n = k + 1 ( P ( k ) ∧ ( P ( k ) = ⇒ P ( k + 1 ))) = ⇒ P ( k + 1 ) 1 ... 0 Predicate, P ( n ) , True for all natural numbers! Proof by Induction.
Recommend
More recommend