Proof Review CS 202 Aaron Bloomfield Spring 2007.

Slides:



Advertisements
Similar presentations
With examples from Number Theory
Advertisements

Discrete Mathematics University of Jazeera College of Information Technology & Design Khulood Ghazal Mathematical Reasoning Methods of Proof.
Introduction to Proofs
Mathematical Induction
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Elementary Number Theory and Methods of Proof
1 Valid and Invalid Arguments CS 202 Epp Section 1.3 Aaron Bloomfield.
Chapter 3. Mathematical Reasoning 3.1 Methods of proof A theorem is a statement that can be shown to be true. A proof is to demonstrate that a theorem.
Discussion #12 1/22 Discussion #12 Deduction, Proofs and Proof Techniques.
Induction Sections 4.1 and 4.2 of Rosen Fall 2010
CSE115/ENGR160 Discrete Mathematics 01/31/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/01/11
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
CMSC 250 Discrete Structures Number Theory. 20 June 2007Number Theory2 Exactly one car in the plant has color H( a ) := “ a has color”  x  Cars –H(
Proof Must Have Statement of what is to be proven.
CS 202 Rosen section 1.5 Aaron Bloomfield
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
CS 2210 (22C:019) Discrete Structures Logic and Proof Spring 2015 Sukumar Ghosh.
Methods of Proof & Proof Strategies
Copyright © Curt Hill Rules of Inference What is a valid argument?
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
MATH 224 – Discrete Mathematics
1 Methods of Proof CS/APMA 202 Epp, chapter 3 Aaron Bloomfield.
Review I Rosen , 3.1 Know your definitions!
1 Basic Proof Methods I Basic Proof Methods II Proofs Involving Quantifiers.
CSci 2011 Discrete Mathematics Lecture 6
1 Methods of Proof. 2 Consider (p  (p→q)) → q pqp→q p  (p→q)) (p  (p→q)) → q TTTTT TFFFT FTTFT FFTFT.
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Chapter 5 Existence and Proof by contradiction
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
Discrete Structures (DS)
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
CSci 2011 Discrete Mathematics Lecture 8 CSci 2011.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 The Foundations: Logic and Proofs Introduction to Proofs.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
Mathematical Preliminaries
1 Course Summary CS 202 Aaron Bloomfield. 2 Outline A review of the proof methods gone over in class Interspersed with the most popular demotivators from.
1 Mathematical Induction CS 202 Epp, chapter 4. 2.
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
1 CMSC 250 Chapter 3, Number Theory. 2 CMSC 250 Introductory number theory l A good proof should have: –a statement of what is to be proven –"Proof:"
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
CSci 2011 Discrete Mathematics Lecture 5 CSci 2011.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Chapter 1, Part III: Proofs With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without.
Chapter 1 Logic and proofs
The Foundations: Logic and Proofs
CS 2210:0001 Discrete Structures Logic and Proof
CSE15 Discrete Mathematics 02/01/17
Methods of Proof Aaron Bloomfield.
In this slide set… Rules of inference for propositions
Discrete Mathematics Logic.
Proof methods We will discuss ten proof methods: Direct proofs
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
Methods of Proof CS 202 Epp, chapter 3.
Proof Techniques.
The Foundations: Logic and Proofs
Methods of Proof. Methods of Proof Definitions A theorem is a valid logical assertion which can be proved using Axioms: statements which are given.
Applied Discrete Mathematics Week 2: Proofs
Section 2.1 Proof Techniques Introduce proof techniques:   o        Exhaustive Proof: to prove all possible cases, Only if it is about a.
Discrete Mathematics Logic.
Information Technology Department SKN-SITS,Lonavala.
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Valid and Invalid Arguments
Mathematical Induction
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Presentation transcript:

Proof Review CS 202 Aaron Bloomfield Spring 2007

Proof methods in this course Logical equivalences –via truth tables –via logical equivalences Set equivalences –via set identities –via membership tables –via mutual subset proof –via set builder notation and logical equivalences Rules of inference –for propositions –for quantified statements Proofs without a category –Pigeonhole principle –Combinatorial proofs Ten proof methods in chapter 3: –Direct proofs –Indirect proofs –Vacuous proofs –Trivial proofs –Proof by contradiction –Proof by cases –Proofs of equivalence –Existence proofs Constructive Non-constructive –Uniqueness proofs –Counterexamples Induction –Weak mathematical induction –Strong mathematical induction –Structural induction

Logic proofs

Using Truth Tables pqrp→rq →r (p→r)  (q →r)pqpq(p  q) →r TTTTTTTT TTFFFFTF TFTTTTFT TFFFTTFT FTTTTTFT FTFTFTFT FFTTTTFT FFFTTTFT pqpq(p→r)  (q →r) q →rp→rrqp

Idempotent Law Associativity of Or Definition of implication Using Logical Equivalences Re-arranging Original statement DeMorgan’s Law

Set proofs

Definition of difference DeMorgan’s law Complementation law Distributive law Complement law Identity law Commutative law Proof by using basic set identities Prove that A∩B=B-(B-A)

Proof by membership tables The following membership table shows that A∩B=B-(B-A) Because the two indicated columns have the same values, the two expressions are identical This is similar to Boolean logic!

Proof by showing each set is a subset of the other 1 Assume that x  B-(B-A) –By definition of difference, we know that x  B and x  B-A Consider x  B-A –If x  B-A, then (by definition of difference) x  B and x  A –Since x  B-A, then only one of the inverses has to be true (DeMorgan’s law): x  B or x  A So we have that x  B and (x  B or x  A) –It cannot be the case where x  B and x  B –Thus, x  B and x  A –This is the definition of intersection Thus, if x  B-(B-A) then x  A∩B

Proof by showing each set is a subset of the other 2 Assume that x  A∩B –By definition of intersection, x  A and x  B Thus, we know that x  B-A –B-A includes all the elements in B that are also not in A not include any of the elements of A (by definition of difference) Consider B-(B-A) –We know that x  B-A –We also know that if x  A∩B then x  B (by definition of intersection) –Thus, if x  B and x  B-A, we can restate that (using the definition of difference) as x  B-(B-A) Thus, if x  A∩B then x  B-(B-A)

Proof by set builder notation and logical equivalences 2 Original statement Definition of difference Negating “element of” Definition of difference DeMorgan’s Law Distributive Law Negating “element of” Negation Law Identity Law Definition of intersection

Rules of Inference

Modus Ponens example Assume you are given the following two statements: –“you are in this class” –“if you are in this class, you will get a grade” Let p = “you are in this class” Let q = “you will get a grade” By Modus Ponens, you can conclude that you will get a grade

Modus Tollens Assume that we know: ¬q and p → q –Recall that p → q = ¬q → ¬p Thus, we know ¬q and ¬q → ¬p We can conclude ¬p

Generalization & Specialization Generalization: If you know that p is true, then p  q will ALWAYS be true Specialization: If p  q is true, then p will ALWAYS be true

More rules of inference Conjunction: if p and q are true separately, then p  q is true Elimination: If p  q is true, and p is false, then q must be true Transitivity: If p→q is true, and q→r is true, then p→r must be true

Even more rules of inference Proof by division into cases: if at least one of p or q is true, then r must be true Contradiction rule: If ¬p→c is true, we can conclude p (via the contra-positive) Resolution: If p  q is true, and ¬p  r is true, then q  r must be true –Not in the textbook

Example of proof We have the hypotheses: –“It is not sunny this afternoon and it is colder than yesterday” –“We will go swimming only if it is sunny” –“If we do not go swimming, then we will take a canoe trip” –“If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? –“It is not sunny this afternoon and it is colder than yesterday” –“We will go swimming only if it is sunny” –“If we do not go swimming, then we will take a canoe trip” –“If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? –“It is not sunny this afternoon and it is colder than yesterday” –“We will go swimming only if it is sunny” –“If we do not go swimming, then we will take a canoe trip” –“If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? –“It is not sunny this afternoon and it is colder than yesterday” –“We will go swimming only if it is sunny” –“If we do not go swimming, then we will take a canoe trip” –“If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? –“It is not sunny this afternoon and it is colder than yesterday” –“We will go swimming only if it is sunny” –“If we do not go swimming, then we will take a canoe trip” –“If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? –“It is not sunny this afternoon and it is colder than yesterday” –“We will go swimming only if it is sunny” –“If we do not go swimming, then we will take a canoe trip” –“If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? p q r s t ¬p  q¬p  q r → p ¬r → s s → t t

Example of proof 1.¬p  q1 st hypothesis 2.¬pSimplification using step 1 3.r → p2 nd hypothesis 4.¬rModus tollens using steps 2 & 3 5.¬r → s3 rd hypothesis 6.sModus ponens using steps 4 & 5 7.s → t 4 th hypothesis 8.tModus ponens using steps 6 & 7

Example of proof Given the hypotheses: –“If it does not rain or if it is not foggy, then the sailing race will be held and the lifesaving demonstration will go on” –“If the sailing race is held, then the trophy will be awarded” –“The trophy was not awarded” Can you conclude: “It rained”? (¬r  ¬f) → (s  l) s → t ¬t r

Example of proof 1.¬t3 rd hypothesis 2.s → t2 nd hypothesis 3.¬sModus tollens using steps 2 & 3 4.(¬r  ¬f)→(s  l)1 st hypothesis 5.¬(s  l)→¬(¬r  ¬f)Contrapositive of step 4 6.(¬s  ¬l)→(r  f)DeMorgan’s law and double negation law 7.¬s  ¬lAddition from step 3 8.r  fModus ponens using steps 6 & 7 9.rSimplification using step 8

Proofs without a category

Corollary 1: algebraic proof Let n be a non-negative integer. Then Algebraic proof

Corollary 1: combinatorial proof Let n be a non-negative integer. Then Combinatorial proof A set with n elements has 2 n subsets A set with n elements has 2 n subsets By definition of power set Each subset has either 0 or 1 or 2 or … or n elements Each subset has either 0 or 1 or 2 or … or n elements There are subsets with 0 elements, subsets with 1 element, … and subsets with n elements Thus, the total number of subsets is Thus, Thus,

Pigeonhole Principle Consider 5 distinct points (x i, y i ) with integer values, where i = 1, 2, 3, 4, 5 Show that the midpoint of at least one pair of these five points also has integer coordinates Thus, we are looking for the midpoint of a segment from (a,b) to (c,d) The midpoint is ( (a+c)/2, (b+d)/2 ) The midpoint is ( (a+c)/2, (b+d)/2 ) Note that the midpoint will be integers if a and c have the same parity: are either both even or both odd Same for b and d Same for b and d There are four parity possibilities (even, even), (even, odd), (odd, even), (odd, odd) (even, even), (even, odd), (odd, even), (odd, odd) Since we have 5 points, by the pigeonhole principle, there must be two points that have the same parity possibility Thus, the midpoint of those two points will have integer coordinates Thus, the midpoint of those two points will have integer coordinates

Ten proof methods in chapter 3

Direct proofs Consider an implication: p→q –If p is false, then the implication is always true –Thus, show that if p is true, then q is true To perform a direct proof, assume that p is true, and show that q must therefore be true

Direct proof example Show that the square of an even number is an even number –Rephrased: if n is even, then n 2 is even Assume n is even –Thus, n = 2k, for some k (definition of even numbers) –n 2 = (2k) 2 = 4k 2 = 2(2k 2 ) –As n 2 is 2 times an integer, n 2 is thus even

Indirect proofs Consider an implication: p→q –It’s contrapositive is ¬q→¬p Is logically equivalent to the original implication! –If the antecedent (¬q) is false, then the contrapositive is always true –Thus, show that if ¬q is true, then ¬p is true To perform an indirect proof, do a direct proof on the contrapositive

Indirect proof example If n 2 is an odd integer then n is an odd integer Prove the contrapositive: If n is an even integer, then n 2 is an even integer Proof: n=2k for some integer k (definition of even numbers) n 2 = (2k) 2 = 4k 2 = 2(2k 2 ) Since n 2 is 2 times an integer, it is even

Vacuous proofs Consider an implication: p→q If it can be shown that p is false, then the implication is always true –By definition of an implication Note that you are showing that the antecedent is false

Vacuous proof example Consider the statement: –All criminology majors in CS 202 are female –Rephrased: If you are a criminology major and you are in CS 202, then you are female Could also use quantifiers! Since there are no criminology majors in this class, the antecedent is false, and the implication is true

Trivial proofs Consider an implication: p→q If it can be shown that q is true, then the implication is always true –By definition of an implication Note that you are showing that the conclusion is true

Trivial proof example Consider the statement: –If you are tall and are in CS 202 then you are a student Since all people in CS 202 are students, the implication is true regardless

Proof by contradiction Given a statement p, assume it is false –Assume ¬p Prove that ¬p cannot occur –A contradiction exists Given a statement of the form p→q –To assume it’s false, you only have to consider the case where p is true and q is false

Proof by contradiction example Theorem (by Euclid): There are infinitely many prime numbers. Proof. Assume there are a finite number of primes List them as follows: p 1, p 2 …, p n. Consider the number q = p 1 p 2 … p n + 1 –This number is not divisible by any of the listed primes If we divided p i into q, there would result a remainder of 1 –We must conclude that q is a prime number, not among the primes listed above This contradicts our assumption that all primes are in the list p 1, p 2 …, p n.

Proof by cases Show a statement is true by showing all possible cases are true Thus, you are showing a statement of the form: is true by showing that:

Proof by cases example Prove that –Note that b ≠ 0 Cases: –Case 1: a ≥ 0 and b > 0 Then |a| = a, |b| = b, and –Case 2: a ≥ 0 and b < 0 Then |a| = a, |b| = -b, and –Case 3: a 0 Then |a| = -a, |b| = b, and –Case 4: a < 0 and b < 0 Then |a| = -a, |b| = -b, and

Proofs of equivalences This is showing the definition of a bi- conditional Given a statement of the form “p if and only if q” –Show it is true by showing (p→q)  (q→p) is true

Proofs of equivalence example Show that m 2 =n 2 if and only if m=n or m=-n –Rephrased: (m 2 =n 2 ) ↔ [(m=n)  (m=-n)] Need to prove two parts: –[(m=n)  (m=-n)] → (m 2 =n 2 ) Proof by cases! Case 1: (m=n) → (m 2 =n 2 ) –(m) 2 = m 2, and (n) 2 = n 2, so this case is proven Case 2: (m=-n) → (m 2 =n 2 ) –(m) 2 = m 2, and (-n) 2 = n 2, so this case is proven –(m 2 =n 2 ) → [(m=n)  (m=-n)] Subtract n 2 from both sides to get m 2 -n 2 =0 Factor to get (m+n)(m-n) = 0 Since that equals zero, one of the factors must be zero Thus, either m+n=0 (which means m=n) or m-n=0 (which means m=-n)

Existence proofs Given a statement:  x P(x) We only have to show that a P(c) exists for some value of c Two types: –Constructive: Find a specific value of c for which P(c) exists –Nonconstructive: Show that such a c exists, but don’t actually find it Assume it does not exist, and show a contradiction

Constructive existence proof example Show that a square exists that is the sum of two other squares –Proof: = 5 2 Show that a cube exists that is the sum of three other cubes –Proof: = 6 3

Non-constructive existence proof example Prove that either 2* or 2* is not a perfect square –A perfect square is a square of an integer –Rephrased: Show that a non-perfect square exists in the set {2* , 2* } Proof: The only two perfect squares that differ by 1 are 0 and 1 –Thus, any other numbers that differ by 1 cannot both be perfect squares –Thus, a non-perfect square must exist in any set that contains two numbers that differ by 1 –Note that we didn’t specify which one it was!

Uniqueness proofs A theorem may state that only one such value exists To prove this, you need to show: –Existence: that such a value does indeed exist Either via a constructive or non-constructive existence proof –Uniqueness: that there is only one such value

Uniqueness proof example If the real number equation 5x+3=a has a solution then it is unique Existence –We can manipulate 5x+3=a to yield x=(a-3)/5 –Is this constructive or non-constructive? Uniqueness –If there are two such numbers, then they would fulfill the following: a = 5x+3 = 5y+3 –We can manipulate this to yield that x = y Thus, the one solution is unique!

Counterexamples Given a universally quantified statement, find a single example which it is not true Note that this is DISPROVING a UNIVERSAL statement by a counterexample  x ¬R(x), where R(x) means “x has red hair” –Find one person (in the domain) who has red hair Every positive integer is the square of another integer –The square root of 5 is 2.236, which is not an integer

A note on counterexamples You can DISPROVE something by showing a single counter example –You are finding an example to show that something is not true You cannot PROVE something by example Example: prove or disprove that all numbers are even –Proof by contradiction: 1 is not even –(Invalid) proof by example: 2 is even

Induction

Mathematical induction example Inductive step: show

Strong induction example Show that any number > 1 can be written as the product of one or more primes Base case: P(2) –2 is the product of 2 (remember that 1 is not prime!) Inductive hypothesis: assume P(2), P(3), …, P(k) are all true Inductive step: Show that P(k+1) is true

Strong induction example 1 Inductive step: Show that P(k+1) is true There are two cases: –k+1 is prime It can then be written as the product of k+1 –k+1 is composite It can be written as the product of two composites, a and b, where 2 ≤ a ≤ b < k+1 By the inductive hypothesis, both P(a) and P(b) are true

Chess and induction Can the knight reach any square in a finite number of moves? Show that the knight can reach any square (i, j) for which i+j=k where k > 1. Base case: k = 2 Inductive hypothesis: assume the knight can reach any square (i, j) for which i+j=k where k > 1. Inductive step: show the knight can reach any square (i, j) for which i+j=k+1 where k > 1.

Chess and induction Inductive step: show the knight can reach any square (i, j) for which i+j=k+1 where k > 1. –Note that k+1 ≥ 3, and one of i or j is ≥ 2 –If i ≥ 2, the knight could have moved from (i-2, j+1) Since i+j = k+1, i-2 + j+1 = k, which is assumed true –If j ≥ 2, the knight could have moved from (i+1, j-2) Since i+j = k+1, i+1 + j-2 = k, which is assumed true