proof by contradiction cs 270 math foundations of cs jeremy johnson

19
Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Upload: charlotte-chandler

Post on 17-Jan-2018

223 views

Category:

Documents


0 download

DESCRIPTION

Decimals and Fractions

TRANSCRIPT

Page 1: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Proof by Contradiction

CS 270 Math Foundations of CSJeremy Johnson

Page 2: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Outline

1. An example1. Rational numbers and repeating decimals2. Irrationality of

2. Negation Rules1. Bottom introduction and elimination2. Negation introduction and double negation

3. Indirect Proofs1. Double negation2. Law of excluded middle3. DeMorgan’s Laws

Page 3: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Decimals and Fractions

• 3/8 = .375 =

.3758 |3.0 2.4 60 56 40 40 0

Page 4: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Repeating Decimals• 9/11 = 0.81818181 … = 0.

.8111 |9.0 88 020 11 9• 7/23 = 0.

81

Page 5: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Repeating Decimals

• Theorem. A number r is rational iff it has a terminating or repeating decimal expansion

• Proof® If r = a/b perform long division to compute

the decimal expansion. At each step divide what is left by b, m = qb + r, 0 ≤ r < b. There are b possible remainders. If r = 0 the expansion is terminating. If r has occurred previously the expansion is repeating. After at most b steps one of these must happen.

Page 6: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Repeating Decimals

• Theorem. A number r is rational iff it has a terminating or repeating decimal expansion

• Proof Without loss of generality, we can assume 0 <

r < 1. If r = .a1…an, then r = a1…an/10n. If r = .b1…bk, then 10kr - b1…bk = a = . and (10n-1)a = a1…an and hence a is rational and consequently r is also rational.

Page 7: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Decimal Expansion of sqrt(2)

is the positive solution of

We can approximate the solution of this equation by repeated bisection

Page 8: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Decimal Expansion of sqrt(2)x0 := 1.0; x1 := 2.0; n := 20;for i from 1 to n do x := (x0+x1)/2; if x^2 > 2 then x1 := x; else x0 := x; end if;end do;

1.5000000001.250000000 1.375000000 1.437500000 1.406250000 1.421875000 1.414062500 1.417968750 1.416015625 1.415039062 1.414550781 1.414306640 1.414184570 1.414245605 1.414215088 1.414199829 1.414207458 1.414211273 1.414213180 1.414214134

Page 9: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Decimal Expansion of sqrt(2)

Does the expansion terminate or repeat? Maybe it doesn’t? How long should I look? Maybe it’s not rational?

Page 10: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Proof that sqrt(2) is not Rational

Proof by contradiction. Assume with gcd(a,b)=1. Then 2b2= a2. Since an odd number squared is odd, this

implies a=2p is even and 2b2= 4p2 and b2= 2p2 and b is also even.

Since a and b are both even gcd(a,b) 1 which is a contradiction

Thus we conclude that is not rational.

Page 11: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Negation Rules

• Introduce the symbol ( to encode a contradiction

• Bottom elimination can prove anything

• Bottom introduction

i

e.

Page 12: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Negation Rules

• Introduction and elimination rules

• Double negation e

… i

… e

Page 13: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Proof by Contradiction

• Negation elimination called proof by contradiction

Assume and derive a a contradiction

… PBC

Page 14: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Exercise

• Prove that A ® A and A ® A

Page 15: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Law of the Excluded Middle

• [derived rule LEM]

1 (p p) assumption

2 Assumption

3 (p p) ,4

4 3,15 p 2-4

6 p p ,4

7 6,1

8 p p e 1-7

Page 16: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

De Morgan’s Law

(P Q) P Q

1 (P Q) premise

2 assumption

3 P Q i1 2

4 1,3

5 P 2-4

6 Q

7 P Q i2 6

8 1,7

9 -8

10 P Q i 5,9

Page 17: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

De Morgan’s Law

(P Q) P Q

1 P Q premise

2 e1 1

3 e2 1

4 assumption

5 P assumption

6 e 2,5

7 Q i2 6

8 e 3,7

9 e 4,5-6, 7-8

10 (P Q) i 4-9

Page 18: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Exercise

• Prove (P Q) ® P Q

Page 19: Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson

Exercise

• Prove P Q ® (P Q)