proof methods. introduction –formal proofs vs. informal proofs –many proof methods exist however...

23
Proof Methods

Upload: silas-fisher

Post on 25-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Proof Methods

Introduction– Formal Proofs vs. Informal Proofs– Many proof methods exist however none is

guaranteed to prove a true theorem• i.e., no general proof algorithm exists

– Rather we must intelligently choose our proof technique based on the particulars of the problem • Exhaustive, direct, contraposition, contradiction, induction

– Important Terms• Inductive Reasoning – a general conclusion is drawn from a

set of experiences.• Deductive Reasoning – a specific conclusion is shown to

follow from a set of premises

Hypothesisgeneration

Hypothesisconfirmation

Direct Proof– To prove P Q, assume P is true and use formal logic

to show that Q is also true• Example: Our previous proofs were direct proofs• Problem: Too slow and cumbersome to be practical

– Can use same idea of direct proof but less formal notation (called informal direct proof)• Example: Conjecture: “If an integer is divisible by 6, then

twice that integer is divisible by 4” (taken from text, p.93)• Informal Proof

Counterexample– A single counterexample to a conjecture is sufficient to

disprove that conjecture• Example: Finding large prime numbers (for cryptography)• We observe that f(n) = n2 – n + 41 produces prime numbers

for n = 1 (41), 2 (43), 3 (47), and 4 (53)• Conjecture: f(n) is prime for all positive integers n.• Counterexample: n = 41

– f(41) = 412 – 41 + 41 = 412

Exhaustive Proof– Can one prove a conjecture by example?

• In general, no• In rare cases, yes

– Conjecture deals with finite collection– Can show conjecture true for each element in collection– Called proof by exhaustion– Example: f(n) is prime where 0 n 40

More Examples– Prove or disprove for all positive integers.

1. If 2n + 3 is odd then the number n is odd.

2. If 3n + 2 is odd then the number n is odd.

3. If x + y = 7, then either x or y must be even.

Contraposition Proof– To prove P Q, prove that Q P

• (Q P) (P Q) is a tautology• Example: n2 is odd n is odd• Contrapositive: n is even n2 is even• Proof:

– Converse• The contrapositive is not the converse

– Converse of Q P is P Q• “If and only if” conjectures require

– Proof of the implication– Proof of the converse

– Examples• If x is positive then so is x + 1.• If the product of 2 integers is not divisible by n then neither

integer is.

Contradiction Proof

– Example: Prove that all numbers are interesting• Not an implication: Assume Q• What do we mean by interesting?

Contradiction Proof– A contradiction is a wff whose truth value is always

false• Example: (A A)• Notice the following are tautologies

– (Q false) (Q)– (P Q false) (P Q)

• Try to develop the truth table for the above formulae

– To prove a conjecture true, prove that the negation of the conjecture is false• To prove a simple Q, assume Q and show that this leads to a

contradiction.• To prove an implication P Q, assume P and Q and show

that this leads to a contradiction– Remember this doesn’t prove that Q is true

» only that P Q is true

Contradiction Proof– Example: Prove that if 3n + 2 is odd then n is odd

• Let P be “3n + 2 is odd”• Let Q be “n is odd”• Assume P Q

– More Examples1. No integer is both even and odd.2. If the sum of two primes is prime, then one of the primes

must be 2.

Practice Problems– Mathematical Structures for Computer Science

• Section 2.1: 12, 14, 15, 19, 24, 26, 35, 36, 38, 40, 47, 48, 51, 55, 62

• Section 2.2: 1, 5, 8, 12, 13, 16, 22, 29, 36, 43, 44, 51, 66, 74

Project 1

Contradiction Proof– Example: The Halting Problem

• “There is an algorithm that takes as input a computer program and input to that program and determines whether the program will eventually stop when run with this input.”

• Recall that an algorithm must terminate, therefore you can’t just run the program on the input to see if it terminates – what if it doesn’t?

Halting Algorithm

Program

Input

Halt/Never

The Halting Problem

• Assume there is a solution to the Halting Problem, – call it H(P, I) – H(P,I) == “halt” when P terminates on I– H(P,I) == “never” when P does not terminate on I

• We need a way to represent the Program and Input when it’s given to the Halting Algorithm.

– Represent both using 0s and 1s• So we can run H(P,P) and according to our assumption, it will

return either “halt” or “never”

H(P, I)P

I

Halt/Never

The Halting Problem• Consider the following algorithm K(P)

temp = H(P,P)if temp == “halt” then while (true) do {}end if

• What happens if we try K(K)?– if H(K,K) is “never”, then by definition K(K) halts

» a contradiction– if H(K,K) is “halt”, then by definition K(K) doesn’t halt

» a contradiction• Therefore, no such Halting Algorithm can exist!

– Often used in computer science as the base line– “If we could write program X we could write H and therefore

program X is not possible.”

H(K, K)K

K

Halt/Never

More Proof Methods

Proof by obviousness: "The proof is so clear that it need not be mentioned."Proof by general agreement: "All in favor?..."Proof by majority rule: Only to be used if general agreement is impossible.Proof by imagination: "Well, we'll pretend it's true..."Proof by convenience: "It would be very nice if it were true, so..."Proof by necessity: "It had better be true, or the entire structure of mathematics would crumble to the ground."Proof by plausibility: "It sounds good, so it must be true."Proof by intimidation: "Don't be stupid; of course it's true!“Proof by terror: When intimidation fails...Proof by lack of sufficient time: "Because of the time constraint, I'll leave the proof to you."Proof by postponement: "The proof for this is long and arduous, so it is given to you in the appendix."Proof by accident: "Hey, what have we here?!"Proof by insignificance: "Who really cares anyway?“Proof by profanity: (example omitted)Proof by definition: "We define it to be true."Proof by tautology: "It's true because it's true."Proof by plagiarism: "As we see on page 289,..."Proof by lost reference: "I know I saw it somewhere...."

Proof by calculus: "This proof requires calculus, so we'll skip it."Proof by lack of interest: "Does anyone really want to see this?"Proof by illegibility:  Proof by logic: "If it is on the problem sheet, it must be true!"Proof by clever variable choice: "Let A be the number such that this proof works..."Proof by tessellation: "This proof is the same as the last."Proof by divine word: "...And the Lord said, 'Let it be true,' and it was true."Proof by stubbornness: "I don't care what you say- it is true."Proof by simplification: "This proof reduced to the statement 1 + 1 = 2."Proof by hasty generalization: "Well, it works for 17, so it works for all reals."Proof by deception: "Now everyone turn their backs..."Proof by supplication: "Oh please, let it be true."Proof by poor analogy: "Well, it's just like..."Proof by avoidance: Limit of proof by postponement as it approaches infinityProof by design: If it's not true in today's math, invent a new system in which it is.Proof by authority: "Well, Don Knuth says it's true, so it must be!"Proof by intuition: "I have this gut feeling."

If the proof of a theorem is not immediately apparent, it may be because you are trying the wrong approach….

Induction Proof– Highly useful proof method in computer science

• used in statement counting• used as basis of recursion

– Induction involves the properties of positive integers– Proof by induction involves two steps

1. Prove conjecture for the first case 2. Prove that if the conjecture is true for a given case, it is true

for the next case

– Leads to the following first principle of induction • P(1) is true • k P(k) true P(k+1) true P(n) true for all positive integers n.

Basis stepInductive step

Induction Proof– Example: Use Induction to prove that n < 2n for all

positive integers n.• Basis: P(1): 1 < 2• Induction: P(k+1): Assume that if k < 2k, we can prove (k+1)

< 2(k+1)

Note: Don’t be confused – mathematical induction is a deductive technique, not a method of inductive reasoning!

Induction Proof– Example: Use Induction to prove that for all positive integers n.

• Basis: 1 = 1(2) / 2• Induction:

2/)1(1

nnin

i

Basic Process: 1. Establish theorem 2. Show true for base case 3. Assume inductive hypothesis LHSih = RHSih

4. State “want to show” as LHSwts = RHSwts

5. Give definition of LHSwts

6. Translate to use LHSih

7. Substitute RHSih for LHSih

8. Manipulate to find RHSwts

Induction Proof– More Examples

(a) ∑ 5i= 5n (n+1)/2 1 ≤ i ≤ n

(b) ∑ i3 = [n2 (n+1)2]/4 1 ≤ i ≤ n

Induction Proof– Sometimes it is convenient to use the second principle

of induction• P(1) is true• k[ P(r) true for 1 r k P(k+1) is true ]

– Example: Show that if n is an integer greater than 1, then n can be written as the product of primes.• Let P(n) be the statement that “n can be written as a product

of primes”• Basis: P(2) = 2• Induction: Assume P(i) is true for all integers 1 < i k.

Induction Proof– Example: Your bank ATM delivers cash using only $20

and $50 bills. Prove that you can collect, in addition to $20, any multiple of $10 that is $40 or greater (text, p. 117).

Practice Problems– Mathematical Structures for Computer Science

• Section 2.1: 12, 14, 15, 19, 24, 26, 35, 36, 38, 40, 47, 48, 51, 55, 62

• Section 2.2: 1, 5, 8, 12, 13, 16, 22, 29, 36, 43, 44, 51, 66, 74