discussion #12 1/22 discussion #12 deduction, proofs and proof techniques

22
Discussion #12 1/22 Discussion #12 Deduction, Proofs and Proof Techniques

Post on 20-Dec-2015

220 views

Category:

Documents


2 download

TRANSCRIPT

Discussion #12 1/22

Discussion #12

Deduction, Proofsand Proof Techniques

Discussion #12 2/22

Topics• Proofs = Sound Arguments, Derivations,

Deduction• Proof Techniques

1. Exhaustive

2. Equivalence to Truth

3. If and only if (iff)

4. Contrapositive Proof

5. Contradiction (or Indirect)

6. Conditional

7. Case Analysis

8. Induction

9. Direct

Discussion #12 3/22

1. Exhaustive Truth Proof

Show true for all cases.– e.g. Prove x2 + 5 < 20 for integers 0 x 3

02 + 5 = 5 < 20 T12 + 5 = 6 < 20 T22 + 5 = 9 < 20 T32 + 5 = 14 < 20 T

– Thus, all cases are exhausted and true.– Same as using truth tables when all

combinations yield a tautology.

Discussion #12 4/22

2. Equivalence to Truth

2a. Transform logical expression to T.

Prove: R S (R S)

R S (R S) R S R S de Morgan’s law

R S R S double negation

(R S) (R S) implication (PQ PQ)

T law of excl. middle (P P) T

Discussion #12 5/22

2. Equivalence to Truth (continued…)

2b. Or, transform lhs to rhs or vice versa.Prove: P Q P Q Q

P Q P Q (P P) Q distributive law

(factoring)

T Q law of excluded middle

Q identity

Discussion #12 6/22

3. If and only if Proof

• Also called necessary and sufficient

• If we have P Q, then we can create two standard deductive proofs, namely,

(P Q) and (Q P).

• i.e. P Q (P Q) (Q P)

• Transforms proof to a standard deductive proof actually two of them

Discussion #12 7/22

3. If and only if Proof: Example

Prove: 2x – 4 > 0 iff x > 2.Thus, we can do two proofs:

(1) If 2x – 4 > 0 then x > 2.(2) If x > 2 then 2x – 4 > 0.

Proof:(1) Suppose 2x – 4 > 0. Then 2x > 4 and thus x > 2.(2) Suppose x > 2. Then 2x > 4 and thus 2x – 4 > 0.

Note that we could have also simply converted the lhs to the rhs.Proof: 2x – 4 > 0 2x > 4 x > 2.

1. 2x – 4 > 0 premise2. 2x > 4 algebraic equiv.3. x > 2 algebraic equiv.

Discussion #12 8/22

4. Contrapositive ProofRemember:

T

T

F

F

T

T

F

T

T

F

T

F

T

T

T

T

T

T

F

T

FF

TF

FT

TT

P)(Q(P Q)QP

Discussion #12 9/22

4. Contrapositive Proof (continued…)

Prove: if s is not a multiple of 3, then s is not a solution of x2 + 3x – 18 = 0.

P = s is a multiple of 3Q = s is a solution of x2 + 3x – 18 = 0.

Instead of proving P Q, we can prove Q P (because of the contrapositive equivalence)

Thus, we prove: if s is a solution of x2 + 3x – 18 = 0, then s is a multiple of 3.

Discussion #12 10/22

4. Contrapositive Proof: Example

Prove: if s is a solution of x2 + 3x – 18 = 0, then s is a multiple of 3.

Proof: The solutions of x2 + 3x – 18 = 0 are 3 and – 6. Both 3 and – 6 are multiples of 3. Thus, every solution s is a multiple of 3.

Note: Using a contrapositive proof helps get rid of the not’s and makes the problem easier to understand indeed, the contrapositive turns this into a simple proof we can do exhaustively.

Note: In the proof we make true statements. Recall: we can always make any true statement we wish in a proof.

Discussion #12 11/22

5. Proof by Contradiction• Note: P P P F

T T F T

F T T F

• Thus, P F P.

• By substituting R S for P, we can prove R S by proving (R S) F. (R S) F (R S) F implication

R S F de Morgan’s law

R S F double negation

Discussion #12 12/22

5. Proof by Contradiction (continued…)

• Thus, since R S F R S, from R S, we negate the conclusion, add it as a premise, and derive a contradiction, i.e. derive F.

• Any contradiction (e.g. P P) is equivalent to F, so deriving any contradiction is enough.

• BTW, in our project we will implement the semantics of Datalog by programming the computer to do a proof by contradiction.

Discussion #12 13/22

5. Proof by Contradiction: Example• Prove: the empty set is unique.

Since P (P F), we can prove P F instead. i.e. We can prove: if the empty set is not unique, then there is a contradiction, or, in other words, assuming the empty set is not unique leads (deductively) to a contradiction.

• Proof:– Assume the empty set is not unique.– Then there are at least two empty sets 1 and 2 such that

1 2.– Since an empty set is a set and an empty set is a subset of

every set, 1 2 and 2 1 and thus 1 = 2.– But now we now have 1 2 and 1 = 2 a

contradiction.

Discussion #12 14/22

Informal Proofs in Englishvs. Formal Proofs

• Compare

• vs.1. Empty set not unique assumed premise2. Empty set not unique

1 and 2 exist 1 2 uniqueness definition3. 1 and 2 exist 1 2 1&2, modus ponens4. 1 2 3 simplification5. 1 2 2 1 property of empty sets6. 1 2 2 1 1 = 2 set equality definition7. 1 = 2 5&6, modus ponens8. 1 2 1 = 2 4&7 combination9. F 8 contradiction law (PPF)

Assume the empty set is not unique. Then there are at least two empty sets 1 and 2 such that 1 2. Since an empty set is set and an empty set is a subset of every set, 1 2 and 2 1 and thus 1 = 2. But now we now have 1 2 and 1 = 2 a contradiction.

Discussion #12 15/22

6. Conditional ProofP (Q R) (P Q) R• Much simpler form

• Simple implication• extra premise

• Easy to remember: make lhs of conclusion a premise.

P Q R P (Q R) (P Q) R

T T T T T T T T

T T F F F T T F

T F T T T T F T

T F F T T T F T

F T T T T T F T

F T F T F T F T

F F T T T T F T

F F F T T T F T

Discussion #12 16/22

6. Conditional Proof: ExampleProve: If A B and B C, then A C.

If (xA) (xB) and (xB) (xC) then (xA) (xC) ((P Q) (Q R)) (P R) (P Q) (Q R) P R

Proof:1. P premise (assumed)2. P Q premise3. Q 1&2, modus ponens4. Q R premise5. R 3&4, modus ponens

Discussion #12 17/22

6. Conditional Proof: ExampleProve: If A B and B C, then A C.

If (xA) (xB) and (xB) (xC) then (xA) (xC) ((P Q) (Q R)) (P R) (P Q) (Q R) P R

Proof:1. xA premise (assumed)2. (xA) (xB) premise3. xB 1&2, modus ponens4. (xB) (xC) premise5. xC 3&4, modus ponens

Let xA. Then since (xA) (xB), xB.Thus, since xB and (xB) (xC), xC.

Discussion #12 18/22

6. Conditional Proof: ExampleProve: If A B and B C, then A C.

If (xA) (xB) and (xB) (xC) then (xA) (xC) ((P Q) (Q R)) (P R) (P Q) (Q R) P R

Proof:1. xA premise (assumed)2. (xA) (xB) premise3. xB 1&2, modus ponens4. (xB) (xC) premise5. xC 3&4, modus ponens

Let xA. Then since A B, xB.Thus, since xB and B C, xC.

Discussion #12 19/22

7. Case Analysis

P (Q P) (Q P)

P Q P (Q P) (Q P)

T T T T T F T

T F T T T T T

F T T F F F T

F F T T F T F

• We can prove P by doing two proofs: (Q P) and (Q P).

• And, we can choose any Q presumably one that’s helpful.

Discussion #12 20/22

7. Case Analysis: ExampleProve: There are no even primes except 2.

If n is a prime, then n=2 or n is odd.

Now add cases: u (x y z) where u is n=2u (x y z) where u is n2

Now observe that we can use a conditional proof: u x y z if n=2 and n is prime, then n=2 or n is odd

u x y z if n2 and n is prime, then n=2 or n is odd

x y z

Discussion #12 21/22

7. Case Analysis: Example

Prove: If n is a prime, then n=2 or n is odd. Proof:

Case 1: n=2: Since n=2, n=2 or n is odd holds.

Case 2: n2: Since n2 and n is prime, n>2. Now nmust be odd, for suppose that n is even, thenn = 2k for some integer k>1. But thenn is composite (not prime) a contradiction.

Thus, n is odd and hence n=2 or n is odd holds.

Subproof

Discussion #12 22/22

8. Proof by Induction

To be continued….