Download Proofs by Contradiction and Contraposition

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Argument wikipedia , lookup

Turing's proof wikipedia , lookup

Gödel's incompleteness theorems wikipedia , lookup

Truth-bearer wikipedia , lookup

Law of thought wikipedia , lookup

Supertask wikipedia , lookup

Theorem wikipedia , lookup

Mathematical proof wikipedia , lookup

Transcript
CSE 215: Foundations of
Computer Science
Unit 10:
Proofs by Contradiction and
Contraposition
Kevin McDonnell
Stony Brook University – CSE 215
1
• In a direct proof you start with the hypothesis of a
statement and make one deduction after another until you
reach the conclusion.
• Indirect proofs are more roundabout. One kind of indirect
proof, argument by contradiction, is based on the fact
that either a statement is true or it is false but not both.
• So if you can show that the assumption that a given
statement is not true leads logically to a contradiction,
impossibility, or absurdity, then that assumption must be
wrong: and, hence, the given statement must be true.
• This method of proof relies on reducing a given assumption
to an impossibility or absurdity.
Kevin McDonnell
Stony Brook University – CSE 215
2
1. Suppose the statement to be proved is false. That is
suppose that the negation of the statement is true.
2. Show that this supposition leads logically to a
contradiction.
3. Conclude that the statement to be proved is true.
Kevin McDonnell
Stony Brook University – CSE 215
3
• Use proof by contradiction to show that there is no greatest
integer.
• Proof: Suppose not. That is, suppose there is a greatest
integer N.
• Then N  n for every integer n.
• Let M = N + 1. Now M is an integer since it is a sum of
integers.
• Also M > N since M = N + 1. Thus M is an integer that is
greater than N.
• So N is the greatest integer and N is not the greatest
integer, which is a contradiction.
Kevin McDonnell
Stony Brook University – CSE 215
4
• Use proof by contradiction to show that there is no integer
that is both even and odd.
• Proof: Suppose not. That is, suppose that there is at least
one integer n that is both even and odd
• By definition of even, n = 2a for some integer a, and by
definition of odd, 2b + 1 for some integer b.
• Consequently, 2a = 2b + 1 and so
2a – 2b = 1
2(a – b) = 1
a – b = 1/2
• Since a and b are integers, the difference a – b must also be
an integer. But a – b = 1/2 and 1/2 is not an integer, which
is a contradiction.
Kevin McDonnell
Stony Brook University – CSE 215
5
• Prove that the sum of any rational number and any
irrational number is irrational.
• Proof: Suppose not. That is, suppose that there is a rational
number r and an irrational number s such that r + s is
rational.
• By definition of rational, r = a / b and r + s = c / d for some
integers a, b, c and d with b ≠ 0 and d ≠ 0.
• By substitution
and so
Kevin McDonnell
Stony Brook University – CSE 215
6
• Now bc – ad and bd are both integers and bd ≠ 0 by the
zero product property.
• Hence, s is a quotient of the two integers bc – ad and bd.
• Therefore, s is rational, which contradicts the supposition
that s is irrational.
Kevin McDonnell
Stony Brook University – CSE 215
7
• A second form of indirect argument, argument by
contraposition, is based on the logical equivalence
between a statement and its contrapositive.
• To prove a statement by contraposition, you take the
contrapositive of the statement, prove the contrapositive
by a direct proof, and conclude that the original statement
is true.
• The underlying reasoning is that since a conditional
statement is logically equivalent to its contrapositive, if the
contrapositive is true then the statement must also be true.
Kevin McDonnell
Stony Brook University – CSE 215
8
1. Express the statement to be proved in the form
∀x in D, if P(x) then Q(x)
2. Rewrite this statement in the contrapositive form
∀x in D, if Q(x) is false then P(x) is false
3. Prove the contrapositive by a direct proof.
a. Suppose x is an element of D such that Q(x) is false.
b. Show that P(x) is false.
Kevin McDonnell
Stony Brook University – CSE 215
9
• Use proof by contraposition to show that for all integers n,
if n2 is even then n is even.
• Proof: Contrapositive: For all integers n, if n is not even
then n2 is not even.
• Suppose n is any odd integer. By definition of odd,
n = 2k + 1 for some integer k.
• By substitution and algebra:
n2 = (2k + 1)2 = 4k2 + 4k + 1 = 2(2k2 + 2k) + 1
• Now, 2k2 + 2k is an integer because products and sums of
integers are integers.
• So n2 = 2  (an integer) + 1, and thus, by definition of odd, n2
is odd.
Kevin McDonnell
Stony Brook University – CSE 215
10
• Observe that any proof by contraposition can be recast in
the language of proof by contradiction.
• In a proof by contraposition, the statement
∀x in D, if P(x) then Q(x) is proved by giving a direct proof
of the equivalent statement ∀x in D, if ~Q(x) then ~P(x)
• Exactly the same sequence of steps can be used as the
heart of a proof by contradiction for the given statement.
• The only thing that changes is the context in which the
steps are written down.
• To rewrite the proof as a proof by contradiction, you
suppose there is an x in D such that P(x) and ~Q(x).
Kevin McDonnell
Stony Brook University – CSE 215
11
• You then follow the steps of the proof by contraposition to
deduce the statement ~P(x).
• But ~P(x) is a contradiction to the supposition that P(x)
and ~Q(x). (Because to contradict a conjunction of two
statements, it is only necessary to contradict one of them.)
• When you use proof by contraposition, you know exactly
what conclusion you need to show, namely the negation of
the hypothesis. In proof by contradiction it may be difficult
to know what contradiction to aim for.
• The disadvantage of contraposition as compared with
contradiction is that you can use contraposition only for a
specific class of statements – those that are universal and
conditional.
Kevin McDonnell
Stony Brook University – CSE 215
12
• Use proof by contradiction to show that for all integers n, if
n2 is even then n is even.
• Proof: Suppose not. That is, suppose that there is an integer
n such that n2 is even and n is not even.
• Therefore, n is odd and can be written n = 2k + 1 for some
integer k.
• By substitution and algebra, n2 = (2k + 1)2 = 4k2 + 4k + 1 =
2(2k2 + 2k) + 1.
• But 2k2 + 2k is an integer (because products and sums of
integers are integer). So n2 = 2  (an integer) + 1, and thus,
by definition of odd, n2 is odd. This is a contradiction that
n2 is even.
• Compare this proof with the one based on contraposition.
Kevin McDonnell
Stony Brook University – CSE 215
13
• Prove that
is irrational. Because this is not a universal
conditional statement, we cannot use proof by
contraposition.
• Let’s try proof by contradiction.
Kevin McDonnell
Stony Brook University – CSE 215
14
Kevin McDonnell
Stony Brook University – CSE 215
15
p ap
a
• Prove that for any integer a and any prime number p,
if p | a then p ∤ (a + 1).
Kevin McDonnell
Stony Brook University – CSE 215
16
• Prove that the set of prime numbers is infinite.
Kevin McDonnell
Stony Brook University – CSE 215
17
Kevin McDonnell
Stony Brook University – CSE 215
18
• Prove that if a product of two positive real numbers is
greater than 100, then at least one of the numbers is
greater than 10.
Kevin McDonnell
Stony Brook University – CSE 215
19
• Prove that
Kevin McDonnell
+
is irrational.
Stony Brook University – CSE 215
20
Kevin McDonnell
Stony Brook University – CSE 215
21