logic and proofs: section 1.4-1.6

44
1 Basic Proof Methods I Basic Proof Methods II Proofs Involving Quantifiers

Upload: madrona-escovado

Post on 04-Jan-2016

29 views

Category:

Documents


0 download

DESCRIPTION

Logic and Proofs: section 1.4-1.6. Basic Proof Methods I Basic Proof Methods II Proofs Involving Quantifiers. Modus Ponens. Consider (p  (p→q)) → q. 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” - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Logic and Proofs: section 1.4-1.6

1

Basic Proof Methods IBasic Proof Methods II

Proofs Involving Quantifiers

Page 2: Logic and Proofs: section 1.4-1.6

Consider (p (p→q)) → q

2

q

qp

p

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

Page 3: Logic and Proofs: section 1.4-1.6

Assume that we know: ¬q and p → qWe can conclude ¬p

3

p

qp

q

Example: Assume you are given the following two statements:

“you will not get a grade”“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 Tollens, you can conclude that you are not in this class

Page 4: Logic and Proofs: section 1.4-1.6

Addition: If you know that p is true, then p q will ALWAYS be true

Simplification: If p q is true, then p will ALWAYS be true

4

qp

p

p

qp

Page 5: Logic and Proofs: section 1.4-1.6

5

““It isIt is not not sunny this afternoonsunny this afternoon and and it it is colder than yesterdayis colder than yesterday””

““We will go swimmingWe will go swimming only if only if it is it is sunnysunny””

““If If we dowe do not not go swimminggo swimming, then , then we we will take a canoe tripwill take a canoe trip””

““If If we take a canoe tripwe take a canoe trip, then , then we will we will be home by sunset”be home by sunset”

Does this imply that “Does this imply that “we will be we will be home by sunsethome by sunset”?”?

p

q

r

s

t

¬p q

r → p

¬r → s

s → t

t

Page 6: Logic and Proofs: section 1.4-1.6

1. ¬p q 1st hypothesis2. ¬p Simplification using step 13. r → p 2nd hypothesis4. ¬r Modus tollens using steps 2 &

35. ¬r → s 3rd hypothesis6. s Modus ponens using steps 4 &

57. s → t 4th hypothesis8. t Modus ponens using steps 6 &

7

6

p

qp

q

qp

p

p

qp

q

Page 7: Logic and Proofs: section 1.4-1.6

Conjunction: if p and q are true separately, then pq is true

Disjunctive: If pq is true, and p is false, then q must be true

Resolution: If pq is true, and ¬pr is true, then qr must be true

Conditional Transitivity: If p→q is true, and q→r is true, then p→r must be true

7

qp

q

p

q

p

qp

rq

rp

qp

rp

rq

qp

Page 8: Logic and Proofs: section 1.4-1.6

“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”?

8

(¬r ¬f) →(s l)

s → t

¬t

r

Page 9: Logic and Proofs: section 1.4-1.6

1. ¬t 3rd hypothesis2. s → t 2nd hypothesis3. ¬s Modus tollens using steps 2 & 34. (¬r¬f)→(sl) 1st hypothesis5. ¬(sl)→¬(¬r¬f) Contrapositive of step 46. (¬s¬l)→(rf) DeMorgan’s law and double negation law7. ¬s¬l Addition from step 38. rf Modus ponens using steps 6 & 79. r Simplification using step 8

9p

qp

q

qp

p

p

qp

q

qp

p

Page 10: Logic and Proofs: section 1.4-1.6

(If p then q): p→q

10

Example: Show that the square of an even number is an even number (i.e. if n is even, then n2 is even)

Proof: Assume n is evenThus, n = 2k, for some k (definition of even numbers)But, n2 = (2k)2 = 4k2 = 2(2k2)As n2 is 2 times an integer, n2 is thus even

Page 11: Logic and Proofs: section 1.4-1.6

To show: p→q, instead show the contra positive ¬q→¬p

11

Example: If n2 is an odd integer then n is an odd integer

Proof: by contrapositive, we need to show: If n is an even integer, then n2 is an even integerSince n is even n=2k for some integer k (definition of even numbers) n2 = (2k)2 = 4k2 = 2(2k2)Since n2 is 2 times an integer, it is even

Page 12: Logic and Proofs: section 1.4-1.6

When do you use a direct proof versus an indirect proof?

- If it’s not clear from the problem, try direct first, then indirect second

- If indirect fails, try the other proofs

12

Page 13: Logic and Proofs: section 1.4-1.6

Problem: Prove that if n is an integer and n3+5 is odd,

then n is even

Via direct proof n3+5 = 2k+1 for some integer k (definition of

odd numbers) n3 = 2k-4

Then what …

So direct proof didn’t work out. Next up: indirect proof

13

3 42 kn

Page 14: Logic and Proofs: section 1.4-1.6

Problem: Prove that if n is an integer and n3+5 is odd, then n is

even

Via indirect proof (Contrapositive) Need to show: If n is odd, then n3+5 is even

Assume n is odd, and show that n3+5 is even n=2k+1 for some integer k (definition of odd

numbers) n3+5 = (2k+1)3+5 = 8k3+12k2+6k+6 =

2(4k3+6k2+3k+3) As 2(4k3+6k2+3k+3) is 2 times an integer, it is even

14

Page 15: Logic and Proofs: section 1.4-1.6

Given a statement of the form p→qJust consider the case where p is true and q

is false then arrive to a contradiction .

15

Example: Prove that if n is an integer and n3+5 is odd, then n is evenRephrased: If n3+5 is odd, then n is even

Proof: Assume p is true and q is false. Assume n3+5 is odd, and n is odd).

Since n is odd, n=2k+1 for some integer k (definition of odd numbers)But, n3+5 = (2k+1)3+5 = 8k3+12k2+6k+6 = 2(4k3+6k2+3k+3)As 2(4k3+6k2+3k+3) is 2 times an integer, it must be evenContradiction!

Page 16: Logic and Proofs: section 1.4-1.6

Consider an implication: p→qIf it can be shown that p is false, then the

implication is always true (by definition of an implication)

16

Example: Consider the statement: All criminology majors in Math 3313 are female(i.e. If you are a criminology major and you are in Math 3313, then you are female)

Proof: Since there are no criminology majors in this class, the antecedent is false, and the implication is true

Page 17: Logic and Proofs: section 1.4-1.6

Consider an implication: p→qIf it can be shown that q is true, then the

implication is always true by definition of an implication

17

Example: Consider the statement:If you are tall and are in Math 3313 then you are a student

Proof: Since all people in Math 3313 are students, the implication is true regardless

Page 18: Logic and Proofs: section 1.4-1.6

Show a statement is true by showing all possible cases are true

You are showing

18

qpqpqpqppp nn ...... 2121

Page 19: Logic and Proofs: section 1.4-1.6

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 and b > 0

Then |a| = -a, |b| = b, and Case 4: a < 0 and b < 0

Then |a| = -a, |b| = -b, and

19

b

a

b

a

b

a

b

a

b

a

b

a

b

a

b

a

b

a

b

a

b

a

b

a

b

a

b

a

b

a

b

a

b

a

Page 20: Logic and Proofs: section 1.4-1.6

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

20

Page 21: Logic and Proofs: section 1.4-1.6

Problem: Show that m2=n2 if and only if m=n or m=-n(i.e. (m2=n2) ↔ [(m=n)(m=-n)] )

Proof: Need to prove two parts: [(m=n)(m=-n)] → (m2=n2)

Proof by cases! Case 1: (m=n) → (m2=n2)

(m)2 = m2, and (n)2 = n2, so this case is proven Case 2: (m=-n) → (m2=n2)

(m)2 = m2, and (-n)2 = n2, so this case is proven (m2=n2) → [(m=n)(m=-n)]

Subtract n2 from both sides to get m2-n2=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)

21

Page 22: Logic and Proofs: section 1.4-1.6

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

22

Page 23: Logic and Proofs: section 1.4-1.6

If the real number equation 5x+3=b has a solution then it is unique

Existence We can manipulate 5x+3=b to yield x=(b-3)/5

Uniqueness If there are two such numbers, then they

would fulfill the following: b = 5x+3 = 5y+3 We can manipulate this to yield that x = y

Thus, the one solution is unique!

23

Page 24: Logic and Proofs: section 1.4-1.6

DISPROVING a UNIVERSAL statement by a counterexample

Example: Every positive integer is the square of another integer

Proof: The square root of 5 is 2.236, which is not an integer

24

Page 25: Logic and Proofs: section 1.4-1.6

x P(x)P(o) (substitute any object o)

P(g) (for g a general element of universe.)x P(x)

x P(x)P(c) (substitute a new constant c)

P(o) (substitute any extant object o)x P(x)

25

Page 26: Logic and Proofs: section 1.4-1.6

“Everyone in this foundation math class has taken a course in computer science” and “Marla is a student in this class” imply “Marla has taken a course in computer science” F(x): “x is in foundation math class” C(x): “x has taken a course in computer science”

x (F(x) C(x)) F(Marla) C(Marla)

26

Page 27: Logic and Proofs: section 1.4-1.6

Step Proved by1. x (F(x) C(x)) Premise #1.2. F(Marla) C(Marla) Univ. instantiation.3. F(Marla) Premise #2.4. C(Marla) Modus ponens on 2,3.

27

Page 28: Logic and Proofs: section 1.4-1.6

“A student in this class has not read the book” and “Everyone in this class passed the first exam” imply “Someone who passed the first exam has not read the book” C(x): “x is in this class” B(x): “x has read the book” P(x): “x passed the first exam”

x(C(x) B(x)) x (C(x) P(x)) x(P(x) B(x))

28

Page 29: Logic and Proofs: section 1.4-1.6

Step Proved by1. x(C(x) B(x)) Premise #1.2. C(a) B(a) Exist. instantiation.3. C(a) Simplification on 2.4. x (C(x) P(x)) Premise #2.5. C(a) P(a) Univ. instantiation.6. P(a) Modus ponens on 3,57. B(a) Simplification on 28. P(a) B(a) Conjunction on 6,79. x(P(x) B(x)) Exist. generalization

29

Page 30: Logic and Proofs: section 1.4-1.6

Proving pq Direct proof: Assume p is true, and prove q. Indirect proof: Assume q, and prove p. Trivial proof: Prove q true. Vacuous proof: Prove p is true.

Proving p Proof by contradiction: Prove p (r r) (r r is a contradiction); therefore p must

be false. Prove (a b) p

Proof by cases: prove (a p) and (b p). More …

30

Page 31: Logic and Proofs: section 1.4-1.6

A proof of a statement of the form x P(x) is called an existence proof.

If the proof demonstrates how to actually find or construct a specific element a such that P(a) is true, then it is called a constructive proof.

Otherwise, it is called a non-constructive proof.

31

Page 32: Logic and Proofs: section 1.4-1.6

Theorem: There exists a positive integer n that is the sum of two perfect cubes in two different ways: equal to j3 + k3 and l3 + m3 where j, k, l, m are

positive integers, and {j,k} ≠ {l,m} Proof: Consider n = 1729, j = 9, k = 10,

l = 1, m = 12. Now just check that the equalities hold.

32

Page 33: Logic and Proofs: section 1.4-1.6

Theorem: “There are infinitely many prime numbers.”

Any finite set of numbers must contain a maximal element, so we can prove the theorem if we can just show that there is no largest prime number.

i.e., show that for any prime number, there is a larger number that is also prime.

More generally: For any number, a larger prime.

Formally: Show n p>n : p is prime.

33

Page 34: Logic and Proofs: section 1.4-1.6

Some very simple statements of number theory haven’t been proved or disproved! E.g. Goldbach’s conjecture: Every integer n≥2

is exactly the average of some two primes. n≥2 primes p,q: n=(p+q)/2.

There are true statements of number theory (or any sufficiently powerful system) that can never be proved (or disproved) (Gödel).

34

Page 35: Logic and Proofs: section 1.4-1.6

Assume that we know that x P(x) is true Then we can conclude that P(c) is true

Here c stands for some specific constant This is called “universal instantiation”

Assume that we know that P(c) is true for any value of c Then we can conclude that x P(x) is true This is called “universal generalization”

35

Page 36: Logic and Proofs: section 1.4-1.6

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

36

Page 37: Logic and Proofs: section 1.4-1.6

Show that a square exists that is the sum of two other squares Proof: 32 + 42 = 52

Show that a cube exists that is the sum of three other cubes Proof: 33 + 43 + 53 = 63

37

Page 38: Logic and Proofs: section 1.4-1.6

Problem:Prove that either 2*10500+15 or 2*10500+16 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*10500+15, 2*10500+16}

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!

38

Page 39: Logic and Proofs: section 1.4-1.6

Assume that we know that x P(x) is true Then we can conclude that P(c) is true for

some value of c This is called “existential instantiation”

Assume that we know that P(c) is true for some value of c Then we can conclude that x P(x) is true This is called “existential generalization”

39

Page 40: Logic and Proofs: section 1.4-1.6

Given the hypotheses: “Linda, a student in this class,

owns a red convertible.” “Everybody who owns a red

convertible has gotten at least one speeding ticket”

Can you conclude: “Somebody in this class has gotten a speeding ticket”?

40

C(Linda)R(Linda)

x (R(x)→T(x))

x (C(x)T(x))

Page 41: Logic and Proofs: section 1.4-1.6

1. x (R(x)→T(x)) 3rd hypothesis2. R(Linda) → T(Linda) Universal instantiation using

step 13. R(Linda) 2nd hypothesis4. T(Linda) Modes ponens using steps 2 & 35. C(Linda) 1st hypothesis6. C(Linda) T(Linda) Conjunction using steps 4 & 57. x (C(x)T(x)) Existential generalization using

step 6

41

Thus, we have shown that “Somebody in this class has gotten a speeding ticket”

Page 42: Logic and Proofs: section 1.4-1.6

Given the hypotheses: “There is someone in this class

who has been to France” “Everyone who goes to France

visits the Louvre” Can you conclude: “Someone

in this class has visited the Louvre”?

42

x (C(x)F(x))

x (F(x)→L(x))

x (C(x)L(x))

Page 43: Logic and Proofs: section 1.4-1.6

1. x (C(x)F(x)) 1st hypothesis2. C(y) F(y) Existential instantiation using step 13. F(y) Simplification using step 24. C(y) Simplification using step 25. x (F(x)→L(x)) 2nd hypothesis6. F(y) → L(y) Universal instantiation using step 57. L(y) Modus ponens using steps 3 & 68. C(y) L(y) Conjunction using steps 4 & 79. x (C(x)L(x)) Existential generalization using

step 8

43

Thus, we have shown that “Someone in this class has visited the Louvre”

Page 44: Logic and Proofs: section 1.4-1.6

Experience!

In general, use quantifiers with statements like “for all” or “there exists”

44