lecture 7: proofswiki.cs.pdx.edu/cs350/proofs.pdfwhat is a proof? proof: an inferential argument for...

42
Lecture 7: Proofs Leila Hawana New Beginnings Fall 2017

Upload: others

Post on 12-Jul-2020

10 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Lecture 7: Proofs

Leila HawanaNew Beginnings

Fall 2017

Page 2: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Agenda● The Basics● Direct Proof● Proof by Contradiction● Proof by Exhaustion● Two Column Proof● Logic Proofs● Proof by Induction● Sources

Page 3: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

The Basics

Page 4: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

What is a proof?● Proof: an inferential argument for a mathematical statement.

○ Inference: steps in reasoning, moving from premises to conclusions.○ In the argument, other previously established statements can be used

(like theorems). ○ In principle, a proof can be traced back to axioms (self-evident or

assumed statements) along with accepted rules of inference. ■ Axioms may be treated as conditions that must be met before the

statement applies.

● A proof must demonstrate that a statement is always true (occasionally by listing all possible cases and showing that it holds in each), rather than enumerate many confirmatory cases.

● Proofs employ logic but usually include some amount of natural language (which usually admits some ambiguity).

Page 5: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

What is a conjecture?● Conjecture: An unproven proposition that is believed to

be true.

Page 6: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

How do i start?● There are several methods to proving that can provide you

with a structured approach to the problem. Some of these include:

○ Direct proofs○ Proof by contradiction○ Proof by induction○ Proof by exhaustion○ And others

● Each problem can be solved a number of ways. It is up to you to determine what will be easiest for each problem.

Page 7: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

What is QED?● QED: A Latin phrase quod erat demonstrandum meaning "what

was to be demonstrated" or "what was to be shown."

● Will often times see this at the end of a proof. Denotes the end of the proof.

Page 8: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Direct Proof

Page 9: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

What is a direct proof?● Direct Proof: A proof where the conclusion is established

by logically combining axioms, definitions, and earlier theorems.

● Also known as proof by definition.

● These require solidified understanding of theorems, definitions, and axioms.

Page 10: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Try this on your ownGiven two sets A and B, prove in one direction (via direct proof) that A = B iff A ⊆ B and B ⊆ A.

Answer (in short):

By definition of subset, all elements in the subset must be contained in the set it is a subset of. Thus, all of A’s

elements must be contained in B. Further, by the definition of subset, all of B’s elements must be contained in A.

Therefore, the elements in A must equal the elements in B. Thus, A = B.

QED

Page 11: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Proof by Contradiction

Page 12: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

What is proof by contradiction?● Proof by Contradiction: A style of proof that shows if

some statement were true, a logical contradiction occurs, which therefore makes the statement false.

● To start these proofs, you make the assumption that is the opposite of what you want to prove, and then proceed to show how it is impossible.

Page 13: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Try this on your ownGiven two sets A and B, prove in one direction (via proof by contradiction) that A = B iff A ⊆ B and B ⊆ A.

Answer (in short):

Assume A ≠ B when A ⊆ B and B ⊆ A. This means that there exists either an element in A that doesn’t belong in B or an element in B that doesn’t belong in A. By definition of a

subset, all elements in A must be contained in B. However, B is also a subset of A, meaning all of B’s elements must also be in A. This is a contradiction. Therefore, A = B must be

true when A ⊆ B and B ⊆ A.QED

Page 14: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Proof by Exhaustion

Page 15: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

What is proof by exhaustion?● Proof by Exhaustion: A proof style where the conclusion

is established by dividing it into a finite number of cases and proving each one separately.

● Also known as proof by cases.

● Good when there are only a small number of cases to look at.

Page 16: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

ExampleProve (by proof of exhaustion) that if n is a positive integer, then n7 - n is divisible by 7.

ANSWER:

First let’s expand our equation.

Now, let’s determine our cases.

How many cases should we have?

Page 17: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Example ContinuedWe should have 7 cases because any number put in this equation can fit into the following 7 categories:

For an arbitrary number n and a corresponding number q:

1. n = 7q2. n = 7q + 13. n = 7q + 24. n = 7q + 35. n = 7q + 46. n = 7q + 57. n = 7q + 6

Page 18: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Example ContinuedNow we just need to show that these 7 cases hold.

Case 1: n = 7q. Then n7 - n has the factor n, which is divisible by 7.

Case 2: n = 7q + 1. Then n7 - n has the factor n-1 = 7q.

Case 3: n = 7q + 2. Then the factor n2 + n + 1 = (7q + 2)2 + (7q+2) + 1 = 49 q2 + 35 q + 7 is clearly divisible by 7.

Case 4: n = 7q + 3. Then the factor n2 - n + 1 = (7q + 3)2 - (7q+3) + 1 = 49 q2 + 35 q + 7 is clearly divisible by 7.

Case 5: n = 7q + 4. Then the factor n2 + n + 1 = (7q + 4)2 + (7q+4) + 1 = 49 q2 + 63 q + 21 is clearly divisible by 7.

Case 6: n = 7q + 5. Then the factor n2 - n + 1 = (7q + 5)2 - (7q+5) + 1 = 49 q2 + 63 q + 21 is clearly divisible by 7.

Case 7: n = 7q + 6. Then the factor n + 1 = 7q + 7 is clearly divisible by 7.

Therefore, n7 - n is divisible by 7 if n is a positive integer. QED.

Page 19: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Try this on your ownProve that if n ∈ Z, then n2 ≥ n.

Answer (in short):

Divide into three cases:

n = 0

n < 0

n > 0

Show that it is true for all three cases.

Page 20: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Two Column Proof

Page 21: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

What is a two column proof?● Two Column Proof: A proof written as a series of lines in

two columns. ○ In each line, the left-hand column contains a proposition, while the

right-hand column contains a brief explanation of how the corresponding proposition in the left-hand column is either an axiom, a hypothesis, or can be logically derived from previous propositions.

● The left-hand column is typically headed "Statements" and the right-hand column is typically headed "Reasons".

Page 22: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Example

Page 23: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

When to use two column proofs● For our purposes, we tend to use these more when we are

dealing with logic.

● We refer to the logic and predicate calculus rules when doing these logic proofs.

Page 24: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Note: Two Column Proofs are a layout, not a proving technique.

Page 25: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Try this on your ownGiven two sets A and B, prove (via two column proof) that A = B iff A ⊆ B and B ⊆ A.

Answer shown in class.

Page 26: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Logic Proofs

Page 27: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

How do we prove logic?● So far, we can prove things like tautologies,

contradictions, equivalences, etc with truth tables.○ However, truth tables can’t easily prove everything...

● What if I want to do it via logic rules or predicate calculus instead?

Page 28: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Logic Proofs● We use two column proofs to prove logic.

● We can manipulate expressions via rules (like DeMorgans, transitivity, etc) to prove logical statements.

Page 29: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

List of logic rulesList of logic rules

List of predicate calculus rules

Page 30: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

ExampleGiven ¬A → B, B → A, and A → (C∧D), prove A∧C∧D.

Page 31: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Example - AnswerStatement Reasoning

¬A → B Given

B → A Given

A → (C∧D) Given

A ∨ B Conditional

¬B ∨ A Conditional

A 4,5

C ∧ D Modus Ponens

A ∧ C ∧ D Conjunction

Page 32: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Try this on your ownGiven (A → C) ∧ (B → C), prove (A ∨ B) → C.

Page 33: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Try this on your own - AnswerStatement Reasoning

(A→C)∧(B→C) Given

(¬A∨C)∧(¬B∨C) Conditional

(C∨¬A)∧(C∨¬B) Commutative

C∨(¬A∧¬B) Distributive

(¬A∧¬B)∨C Commutative

¬(A∨B)∨C DeMorgans

(A∨B) → C Conditional

Page 34: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Why does this work?● These rules are logical equivalences or rules of

inference. They are similar to axioms, but for logic.

● They can be proven (and have been).

● Thus, if we can show we can get from point A to point B with equivalence substitutions, then we can prove the statements are true.

Page 35: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Proof by Induction

Page 36: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

What is proof by induction?● Proof by Induction: A proof style that proves a single

base case and then uses an induction rule to show that an arbitrary case implies the next case.

● Good for problems that try to prove for a sequence.

Page 37: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Formal DefinitionLet P be a proposition defined on the positive integers N. That is, P(n) is either true or false for each n ∈ N. Suppose P has the following two properties:

1. P(1) is true2. P(k+1) is true whenever P(k) is true.

Then P is true for every positive integer n ∈ N.

Page 38: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

ExampleProve that the sum of the first n odd numbers is n2.

Answer shown in class.

Page 39: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Try this on your ownProve 2 + 4 + 6 + … + 2n = n(n+1).

ANSWER:

Base case: n = 1: 1 (1+1) = 1(2) = 2 => ok

Assume this is true for some k where 0 < k < n. This means:2 + 4 + 6 + … + 2k = k(k+1).

Show this is true for k+1. This means prove that2 + 4 + 6 + … + 2k + 2(k+1) = (k+1)((k+1)+1) = (k+1)(k+2)

Page 40: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Try this on your ownUsing our previous assumption:

2 + 4 + 6 + … + 2k + 2(k+1) = k(k+1) + 2(k+1) = (k+1)(k+2)

Therefore, by the inductive assumption, 2 + 4 + 6 + … + 2n = n(n+1).

Q.E.D.

Page 41: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Sources

Page 42: Lecture 7: Proofswiki.cs.pdx.edu/cs350/Proofs.pdfWhat is a proof? Proof: an inferential argument for a mathematical statement. Inference: steps in reasoning, moving from premises to

Sources for this slide deck● Wikipedia:

https://en.wikipedia.org/wiki/Mathematical_proof

● Schaum’s Outlines for Discrete Mathematics (3rd edition)