Example Proofs: Contrapositive
Proofs Workshop
Note: the proofs in this handout are not necessarily in the same form as they were presented at the workshop. In particular, any errors you spot here are entirely accidental, not deliberate. Theorem n
Prove that if a − 1 is prime, then a = 2, where a and n are positive integers, with n ≥ 2. Contrapositive Proof The proposition is of the form p ⇒ q, where n
p is the statement:
a − 1 is prime,
q is the statement:
a=2
We prove the logically equivalent statement: if q is false then p is false (¬q ⇒ ¬p), that is, n if a ≠ 2, then a − 1 is not prime. Suppose a ≠ 2. n
If a = 1, then a − 1 = 0 is not prime. If a > 2, we use the identity n
a − 1 = (a !1)(1+ a + a 2 + ... + a n!1 ) We have a − 1 > 1, since a > 2, and 1 + a + a 2 + ... + a n−1 > 1 . n
This shows that a − 1 is the product of two positive integers greater than 1, and so is not prime. n n So if a ≠ 2, a − 1 is not prime. Hence if a − 1 is prime, then a = 2. Theorem Let f: ℝ – {–2} → ℝ be defined by f ( x) =
x , x ≠ −2 . x+2
If x ≠ y then f(x) ≠ f(y). (In other words, f is injective.) Contrapositive proof: Let p be the statement 'x ≠ y' and let q be the statement 'f(x) ≠ f(y)'. Then the theorem is in the form of a proposition: p ⇒ q. We will prove, instead, the equivalent proposition ¬q ⇒ ¬p (not-q ⇒ not-p), ie the contrapositive, where ¬q is the statement 'f(x) = f(y)', and ¬p is the statement 'x = y'. Suppose f(x) = f(y). Then
⇒ ⇒ ⇒ ⇒
x y = x+2 y+2 x( y + 2) = y ( x + 2) xy + 2 x = xy + 2 y 2x = 2 y x = y.
Therefore, if x ≠ y then f(x) ≠ f(y).
Shirleen Stibbe
http://www.shirleenstibbe.co.uk
Theorem 2
For every integer n, if n is odd, then n is odd. Contrapositive Proof 2
Let p be the statement 'n is odd', and q be the statement 'n is odd'. Then the theorem is in the form of a proposition: p ⇒ q. We will prove instead the equivalent proposition ¬q ⇒ ¬p (not-q ⇒ not-p), ie the contrapositive, where ¬q is the statement 'n is even', and 2
¬p is the statement 'n is even'. Suppose n is even then n = 2k for some integer k 2
2
2
⇒
n = 4k = 2(2k )
⇒
n
2
2
is even, since 2k is an integer 2
2
We have shown that if n is even, then n is even. Hence, if n is odd, then n is odd Theorem If 2
67
− 1 is prime, then 2
67
+ 1 is divisible by 3.
Contrapositive proof The theorem is in the form p ⇒ q, where p is the proposition "2
67
− 1 is prime", and q is the proposition "2
67
+ 1 is divisible by 3".
We are going to prove the logically equivalent statement: If 2
67
+ 1 is not divisible by 3, then 2
Suppose q is false, ie 2
67
The only divisors of 2 So 2
67
67
− 1 is not prime, i.e. ¬q ⇒ ¬p.
+ 1 is not divisible by 3.
67
are powers of 2, so 2
− 1 must be divisible by 3, since 2
Therefore 2
67
67
67
is also not divisible by 3.
− 1, 2
67
and 2
67
+ 1 are 3 consecutive integers.
− 1 is not prime, which is the statement ¬p.
We have shown that if 2 This proves that if 2
67
67
+ 1 is not divisible by 3, then 2
− 1 is prime, then 2
67
67
− 1 is not prime.
+ 1 is divisible by 3.
Note: We can generalize this result to: n
n
If 2 − 1 is prime, then 2 + 1 is divisible by 3. (Replace 67 by n in the above proof). In fact, 2
67
− 1 = 193,707,721 × 761,838,257,287 is not prime, but 2
4
67
+ 1 is divisible by 3.**
4
Also, 2 − 1 = 15 is not prime, and 2 + 1 = 17 is not divisible by 3. Neither of these two results invalidates the theorem. ** 2
67
≡ 2(mod3), so 2
67
+ 1 ≡ 0(mod3).
Prove the general cases, 2
Shirleen Stibbe
2k
≡ 1(mod3), and 2
2k+1
≡ 2(mod3) by induction.
http://www.shirleenstibbe.co.uk
Theorem Let f: ℝ – {–2} → ℝ be defined by f ( x) =
x , x ≠ −2 . x+2
If x ≠ y then f(x) ≠ f(y). (In other words, f is injective.) Contrapositive proof: Let p be the statement 'x ≠ y' and let q be the statement 'f(x) ≠ f(y)'. Then the theorem is in the form of a proposition: p ⇒ q. We will prove, instead, the equivalent proposition ¬q ⇒ ¬p (not-q ⇒ not-p), ie the contrapositive, where ¬q is the statement 'f(x) = f(y)', and ¬p is the statement 'x = y'. Suppose f(x) = f(y). Then
⇒ ⇒ ⇒ ⇒ .
x y = x+2 y+2 x( y + 2) = y ( x + 2) xy + 2 x = xy + 2 y 2x = 2 y x = y.
Therefore, if x ≠ y then f(x) ≠ f(y).
Theorem If 2 n − 1 is prime, then n is prime for all positive integers n. Contrapositive proof: Suppose that n is not prime. Then n may be written as the product of two positive integers, n = rs where both r and s are greater than 1. We have seen that 1 + a + a 2 + ... + a m−1 =
am − 1 whenever a ≠ 1, for any positive integer m. a −1
Setting a = 2 r and m = s we have
1 + 2 r + (2 r ) 2 + ... + (2 r ) s −1 = Then
(
(2 r ) s − 1 2 r −1
2n !1 = (2r !1) 1+ 2r + (2r )2 + ... + (2r ) s!1
)
=
2 rs − 1 2 r −1
=
2 n −1 2 r −1
Now 2 r − 1 is a positive integer greater than 1, since r is greater than 1 and
1 + 2 r + (2 r ) 2 + ... + (2 r ) s −1 is a positive integer greater than 1 because both r and s are greater than 1. It follows from
that 2 n − 1 is a product of two positive integers greater than 1 and so is not a prime number.
We have shown that if n is not a prime number, then 2 n − 1 is not a prime number. Hence if 2 n − 1 is prime then n is prime for all positive integers n.
Another useful example: Theorem: Let a, b be integers. Then ab is even if a + b is odd. We showed them both the direct and the contrapositive proofs of this, to try to convince them that the contrapositive is actually sound – they still didn't believe it! See Example proofs: Direct for details.
Shirleen Stibbe
http://www.shirleenstibbe.co.uk