Proof by Contradiction CS 270 Math Foundations of CS Jeremy Johnson
Outline
Decimals and Fractions
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.
Repeating Decimals
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;
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?
Proof that sqrt(2) is not Rational
Negation Rules
Introduction and elimination rules Double negation e
Proof by Contradiction Negation elimination called proof by contradiction Assume and derive a a contradiction
Exercise Prove that A A and A A
Law of the Excluded Middle 1 (p p) assumption 2Assumption 3 (p p) 4 5 p 6 p p 7 8
De Morgan’s Law (P Q) P Q 1 (P Q)(P Q) premise 2assumption 3 P QP Q i PP 6Q 7 P QP Q i P QP Q i 5,9
De Morgan’s Law (P Q) P Q 1 P QP Q premise 2 e1 1 3 e2 1 4assumption 5P 6 e 2,5 7Q i2 6 8 e 3,7 9 e 4,5-6, (P Q)(P Q) i 4-9
Exercise Prove (P Q) P Q
Exercise Prove P Q (P Q)