Presentation is loading. Please wait.

Presentation is loading. Please wait.

Reading and Writing Mathematical Proofs Spring 2015 Lecture 2: Basic Proving Techniques.

Similar presentations


Presentation on theme: "Reading and Writing Mathematical Proofs Spring 2015 Lecture 2: Basic Proving Techniques."— Presentation transcript:

1 Reading and Writing Mathematical Proofs Spring 2015 Lecture 2: Basic Proving Techniques

2 Previously on Reading and Writing Mathematical Proofs Proofs in Textual Form

3 Definition Mathematical proof A convincing argument for the reader to establish the correctness of a mathematical statement without any doubt

4 Two Proof Formats Theorem If x is odd, then x 2 is odd Proof Since x is odd, there exists a k ℤ such that x = 2k + 1. Then, x 2 = (2k + 1) 2 = 4k 2 + 4k + 1 = 2(2k 2 + 2k) + 1. Thus, x 2 is odd. □ This is what you should write down This should be in the back of your mind

5 Proof Detail When is a proof detailed enough?  Depends on what the reader will accept as true statements  A proof with more detail has “more obvious” statements…  … but is also much longer  A good proof must find the right balance

6 Proving Tips Tips for writing proofs 1. State the proof techniques you’re using (see this lecture) 2. Keep a linear flow Proving process different from written proof 3. Describe every step clearly in words Or draw a figure 4. Don’t use complicated notation 5. Keep your proof as simple as possible 6. Make sure your axioms are actually “obvious” What is obvious to you may not be obvious to the reader 7. Finish your proof Connect everything with what you were trying to prove

7 Basic Proving Techniques Today…

8 Overview Basic Proving Techniques 1. Forward-backward method (or direct method) 2. Case analysis 3. Proof by contradiction 4. Mathematical induction

9 Forward-Backward Method

10  The most basic approach  Logically combine axioms, definitions, and earlier theorems (forward)  Simplify the goal (backward)  This is the approach we have been using so far  This should always be your default approach

11 Usage When to use?  Generally used for statements of the form: If P then Q  Reason forward from the premise  Reason backward from the goal  Follow the rules from Logic and Set Theory (2IT60) Note  Reasoning backward is part of the proving process  In a written proof you generally reason forward to keep the flow PremiseGoal

12 Example Theorem If 0 ≤ x ≤ 2, then –x 3 + 4x + 1 > 0

13 Example Theorem If 0 ≤ x ≤ 2, then –x 3 + 4x + 1 > 0 Proof Perhaps it helps if we first plot the function –x 3 + 4x + 1. It seems that the function is smallest around x = 0 and x = 2. But -0 3 + 4 x 0 + 1 = 1, and -2 3 + 4 x 2 + 1 = 1. It seems that –x 3 + 4x + 1 ≥ 1 for 0 ≤ x ≤ 2. Simplify goal: -x 3 + 4x ≥ 0 for 0 ≤ x ≤ 2.

14 Example Theorem If 0 ≤ x ≤ 2, then –x 3 + 4x + 1 > 0 Proof Let’s simplify further: -x 3 + 4x = x (4 – x 2 ) ≥ 0 Also, x (4 – x 2 ) ≥ 0 if x ≥ 0 and 4 – x 2 ≥ 0. I think we’re ready for the proof…

15 Example Theorem If 0 ≤ x ≤ 2, then –x 3 + 4x + 1 > 0 Proof We first show that –x 3 + 4x ≥ 0. We can rewrite the function as –x 3 + 4x = x (4 – x 2 ) = x (2 – x) (2 + x). Since x, (2 - x), and (2 + x) are all nonnegative for 0 ≤ x ≤ 2, it follows that x (2 – x) (2 + x) = –x 3 + 4x ≥ 0 for 0 ≤ x ≤ 2. By adding 1 to both sides we obtain –x 3 + 4x + 1 ≥ 1 > 0. □

16 Another Example Theorem If f 1 (n) = O(g 1 (n)) and f 2 (n) = O(g 2 (n)), then f 1 (n)f 2 (n) = O(g 1 (n)g 2 (n))

17 Another Example Theorem If f 1 (n) = O(g 1 (n)) and f 2 (n) = O(g 2 (n)), then f 1 (n)f 2 (n) = O(g 1 (n)g 2 (n)) Proof What does f(n) = O(g(n)) mean again? There exist positive constants c and n 0 such that f(n) ≤ c g(n) for all n ≥ n 0. Let’s write this as a logical formula: ∃ c,n0 [c > 0 ⋀ n 0 > 0: ∀ n [n ≥ n 0 : f(n) ≤ c g(n)]] We must be very careful with our variables! Use different names!

18 Another Example Theorem If f 1 (n) = O(g 1 (n)) and f 2 (n) = O(g 2 (n)), then f 1 (n)f 2 (n) = O(g 1 (n)g 2 (n)) Proof By definition there exist positive constants c’ and n 0 ’ such that f 1 (n) ≤ c’ g 1 (n) for all n ≥ n 0 ’. Similarly, there exist positive constants c’’ and n 0 ’’ such that f 2 (n) ≤ c’’ g 1 (n) for all n ≥ n 0 ’’. We need to show that there exist positive constants c and n 0 such that f 1 (n)f 2 (n) ≤ c g 1 (n)g 2 (n) for all n ≥ n 0. To establish this result, we need to find values for c and n 0 such that the above is true. We already have constants c’, c’’, n 0 ’, and n 0 ’’, so we can use these values to compute c and n 0. Note that f 1 (n)f 2 (n) ≤ c’g 1 (n) c’’g 2 (n) = c’ c’’ g 1 (n)g 2 (n), but only if n ≥ n 0 ’ and n ≥ n 0 ’’. So n ≥ n 0 should imply n ≥ n 0 ’ and n ≥ n 0 ’’.

19 Another Example Theorem If f 1 (n) = O(g 1 (n)) and f 2 (n) = O(g 2 (n)), then f 1 (n)f 2 (n) = O(g 1 (n)g 2 (n)) Proof By definition there exist positive constants c’ and n 0 ’ such that f 1 (n) ≤ c’ g 1 (n) for all n ≥ n 0 ’. Similarly, there exist positive constants c’’ and n 0 ’’ such that f 2 (n) ≤ c’’ g 1 (n) for all n ≥ n 0 ’’. We need to show that there exist positive constants c and n 0 such that f 1 (n)f 2 (n) ≤ c g 1 (n)g 2 (n) for all n ≥ n 0. Let n 0 = max(n 0 ’, n 0 ’’) and c = c’ c’’. Then, for all n ≥ n 0 (which implies n ≥ n 0 ’ and n ≥ n 0 ’’), f 1 (n)f 2 (n) ≤ c’ g 1 (n) c’’ g 2 (n) = c’ c’’ g 1 (n) g 2 (n) = c g 1 (n) g 2 (n). Thus, f 1 (n)f 2 (n) = O(g 1 (n)g 2 (n)). □ If the reasoning is confusing to you, try making a logical derivation using techniques from Logic and Set Theory (2IT60)

20 Case Analysis

21 Case analysis  Prove the theorem by considering a small number of cases  Say you want to prove Q, then you can also prove: P 1 ⇒ Q : if P 1 then Q P 2 ⇒ Q : if P 2 then Q P 3 ⇒ Q : if P 3 then Q P 1 ⋁ P 2 ⋁ P 3 : P 1 or P 2 or P 3  P 1, P 2, and P 3 describe the different cases Using P 1, P 2, or P 3 as premise might make proof easier  Don’t forget to prove: P 1 or P 2 or P 3 (one of the cases must hold)! helps forward reasoning

22 Usage When to use?  Generally useful for a “for all”-quantifier If it can be broken down into a small number of configurations Examples An integer is odd or even An integer is positive, negative, or zero x ≤ y or y < x A quadrilateral is convex or not  Also useful for proving correctness if-statement (see next lecture)

23 Example Theorem For any integer x, x(x+1) is even

24 Example Theorem For any integer x, x(x+1) is even Proof Right now we know nothing about x, which makes it hard to prove that x(x+1) is even (we have nothing to work with). What happens if x is odd? In that case (x+1) is even, and hence the multiplication must be even. What happens if x is even? Doesn’t really matter, the multiplication will be even.

25 Example Theorem For any integer x, x(x+1) is even Proof We consider two cases: Case (1): x is odd Then there exists an integer k such that x = 2k+1. Hence, x(x+1) = (2k+1) (2k + 2) = 2 (2k + 1) (k + 1). Thus, x(x+1) is even. Case (2): x is even Then there exists an integer k such that x = 2k. Hence, x(x+1) = 2k (2k + 1) = 2 (2k 2 + k). Thus, x(x+1) is even. Since an integer is either odd or even, this concludes the proof. □ Often omitted

26 Example Theorem Among any 6 people there are 3 mutual friends or 3 mutual strangers.

27 Example Theorem For any graph G=(V,E) with |V| = 6 vertices there is a complete subgraph of size 3 or an independent set of size 3.

28 Example Theorem For any graph G=(V,E) with |V| = 6 vertices there is a complete subgraph of size 3 or an independent set of size 3. Proof Consider any vertex x V. We consider the following cases: Case (1): x is connected to at least three other vertices in G x could be part of a complete subgraph. When is this not the case? Case (2): x is connected to at most two other vertices of G x could be part of an independent set. When is this not the case?

29 Example Theorem For any graph G=(V,E) with |V| = 6 vertices there is a complete subgraph of size 3 or an independent set of size 3. Proof Consider any vertex x V. We consider the following cases: Case (1): x is connected to at least three other vertices in G Let these vertices be u, v, and w. We again consider two cases: Case (a): u, v, and w are independent. Then {u, v, w} is our indep. set. Case (b): u, v, and w are not independent. Without loss of generality, let u and v be connected. Then {x, u, v} is our complete subgraph. Case (2): x is connected to at most two other vertices of G Let u, v, and w be three vertices not connected to x. More cases: Case (a): u, v, and w form a complete subgraph. Done! Case (b): u, v, and w do not form a complete subgraph. Without loss of generality, let u and v be independent. Then {x, u, v} is our indep. set. □

30 Case Analysis Dealing with Cases  Cases can be nested! (as in example)  Proofs should not have too many cases Proofs with many cases are hard to check  Reducing the number of cases can be helpful to the reader If proofs of two cases are essentially the same, you only need to give it once Some cases can be avoided with “without loss of generality” Examples In the previous proof we had to consider (u, v) E, (v, w) E or (u, w) E. We can swap letters to always make (u, v) E. For cases x ≤ y and y ≤ x we can assume the former w.l.o.g.

31 Proof by Contradiction

32 Contradiction Proof by Contradiction  Assume the negation and show that “it is impossible”  To prove Q: Assume ¬Q and derive contradiction (false) by forward reasoning  To prove ¬ Q: Assume Q and derive contradiction…  Very powerful technique! “When you have eliminated the impossible, whatever remains, however improbable, must be the truth”

33 Usage When to use?  Useful when the negation of the statement is easier to work with  Useful when the negation as a premise gives more information E.g. when the negation has a “there exists”-quantifier  Always try this method if you’re stuck!

34 Rational Numbers Definition A number x is rational if there exists integers a and b such that x = a/b Examples 6, ⅓, and -⅝ are rational π and e are irrational (not rational)

35 Example Theorem √2 is irrational

36 Example Theorem √2 is irrational Proof Ok, so we need to prove that there exist no integers a and b such that √2 = a/b. What can we do with that? Not sure… How about a proof by contradiction? That means we can assume that such a and b do exist. So what is wrong with that?

37 Example Theorem √2 is irrational Proof For the sake of contradiction, assume there exist integers a and b such that √2 = a/b. Without loss of generality we can assume that b > 0 (why?). Square both sides and rewrite to obtain 2b 2 = a 2. This means that a 2 is even and thus a is even (we have proved the contraposition in the previous lecture). Hence there exists a k such that a = 2k. But then 2b 2 = a 2 = 4k 2 or b 2 = 2k 2, and thus b is also even. Ok, so both a and b are even. In principle there is nothing wrong with that. However, if b = 2m, then a/b = k/m = √2. Also, k and m are smaller integers. Applying the same argument to k and m leads to even smaller integers. This cannot go on forever!

38 Example Theorem √2 is irrational Proof For the sake of contradiction, let a and b be the smallest positive integers such that √2 = a/b. Square both sides and rewrite to obtain 2b 2 = a 2. This means that a 2 is even and thus a is even (we have proved the contraposition in the previous lecture). Hence there exists a k such that a = 2k. But then 2b 2 = a 2 = 4k 2 or b 2 = 2k 2, and thus there exists an integer m such that b = 2m. We get that k/m = a/b = √2. But k and m are smaller than a and b, which contradicts the assumption that a and b are smallest. Thus, √2 is irrational. □

39 Example Theorem (pigeonhole principle) If n items are put into m containers and n > m, then there must exist a container that contains more than one item pigeons pigeonholes

40 Example Theorem (pigeonhole principle) If n items are put into m containers and n > m, then there must exist a container that contains more than one item Proof For the sake of contradiction, assume that every container contains at most one item. Let c i be the number of items in container i for 1 ≤ i ≤ m (so c i ≤ 1 for all i). Then, n = Σ 1≤i≤m c i ≤ Σ 1≤i≤m 1 = m < n This is a contradiction. Thus there must exist a container that contains more than one item. □ Can we say something about more than one container?

41 Example Theorem n 2 log n ≠ O(n 2 )

42 Example Theorem n 2 log n ≠ O(n 2 ) Proof For the sake of contradiction, assume that there exist positive constants c and n 0 such that n 2 log n ≤ c n 2 for all n ≥ n 0. By dividing both sides by n 2, we obtain that log n ≤ c for all n ≥ n 0. This is false for n = max(2 c+1, n 0 ), since then log n ≥ log 2 c+1 = c+1 > c. This contradicts that log n ≤ c for all n ≥ n 0. Thus, n 2 log n ≠ O(n 2 ). □ Usually it is sufficient to say that the function f(n) (in this case: log n) is unbounded. This automatically implies that, for any constant c, there exists an n large enough such that f(n) > c.

43 Mathematical Induction

44 Mathematical induction Mathematical Induction  Proving something about all positive integers using a chain of implications  Say we want to prove P(n) for all positive integers: Base case: Prove P(1)(or P(0) if for n ≥ 0) Step: Prove that P(n) implies P(n+1) for all n ≥ 1 P(1) ⇒ P(2) ⇒ P(3) ⇒ P(4) ⇒ P(5) ⇒ …  P(n) is called the induction hypothesis Sometimes you need to come up with one…  Again a very powerful technique!

45 Usage When to use?  Whenever you encounter a statement of the form: ∀ n [n ℕ : P(n)] or P(n) holds for all positive integers n  Or if it holds only for n ≥ c for some constant c Then the base case is P(c)  That’s all … for now

46 Example Theorem For all positive integers n, Σ 1≤k≤n k = n(n+1)/2

47 Example Theorem For all positive integers n, Σ 1≤k≤n k = n(n+1)/2 Proof We use induction on n. Base case (n = 1): Σ 1≤k≤n k = Σ 1≤k≤1 k = 1 = 1(1+1)/2 = n(n+1)/2 Step (n ≥ 1): Suppose that Σ 1≤k≤n k = n(n+1)/2. (Induction hypothesis or IH) We need to show that Σ 1≤k≤n+1 k = (n+1)(n+2)/2. We have: Σ 1≤k≤n+1 k = (Σ 1≤k≤n k) + (n+1) = n(n+1)/2 + (n+1) = (n+1)(n+2)/2 Note that we use the IH in the second equality. So it follows by induction that Σ 1≤k≤n k = n(n+1)/2 for all positive integers n. □

48 Example Theorem For every integer n ≥ 5, 2 n > n 2

49 Example Theorem For every integer n ≥ 5, 2 n > n 2 Proof We use induction on n. Base case (n = 5): 2 n = 2 5 = 32 > 25 = 5 2 = n 2 Step (n ≥ 5): Suppose that 2 n > n 2 (IH). We need to show that 2 n+1 > (n+1) 2. We have: 2 n+1 = 2 x 2 n > 2n 2 (by IH) So it is sufficient to show that 2n 2 ≥ (n+1) 2 = n 2 + 2n + 1 for n ≥ 5. This can be simplified to n 2 – 2n – 1 ≥ 0 or (n – 1) 2 ≥ 2. This is clearly true for n ≥ 5. So it follows by induction that 2 n > n 2 for n ≥ 5. □

50 Example Theorem A set of n ≥ 1 elements has 2 n subsets including the empty set.

51 Example Theorem A set of n ≥ 1 elements has 2 n subsets including the empty set. Proof We use induction on n. Base case (n = 1): If a set S has only one element x, then we have 2 subsets {} and {x}. Since 2 1 = 2, the base case holds. Step (n ≥ 1): Suppose that every set of n elements has 2 n subsets. (IH) We need to show that any set S of n+1 elements has 2 n+1 subsets. Pick some element x S (possible since n+1 ≥ 1). Let S’ = S\{x}. By the IH, S’ has 2 n subsets A 1, …, A k (k = 2 n ). The subsets of S’ are exactly the subsets of S that do not contain x. On the other hand, the sets A’ i = A i U {x} are the subsets of S’ that contain x. A subset of S’ must either contain x or not. Thus, S has 2 x 2 n = 2 n+1 subsets. □

52 Induction issues Be careful with induction! Theorem All horses have the same color

53 Induction issues Be careful with induction! Theorem In every set of n ≥ 1 horses, all horses have the same color Proof We use induction on n. Base case (n = 1): There is only one horse, so it must be true. Step (n ≥ 1): Suppose that in every set of n horses, all horses have the same color (IH). We need to show that any set of n+1 horses share the same color. By the IH, the first n horses have the same color. Similarly, by the IH, the last n horses have the same color. Thus all horses have the same color. □

54 Induction issues Be careful with induction! Theorem In every set of n ≥ 1 horses, all horses have the same color Proof We use induction on n. Base case (n = 1): There is only one horse, so it must be true. Step (n ≥ 1): Suppose that in every set of n horses, all horses have the same color (IH). We need to show that any set of n+1 horses share the same color. By the IH, the first n horses have the same color. Similarly, by the IH, the last n horses have the same color. Thus all horses have the same color. □ What happens if n = 1?

55 Induction issues Be careful with induction! Theorem In every set of n ≥ 1 horses, all horses have the same color  We are missing P(1) ⇒ P(2) This breaks everything!  Can be remedied by additionally proving P(2) as extra base case But in this case we can’t…  Step argument must work for all n ≥ 1 (or n ≥ c)! Otherwise these cases must be proved as extra base cases

56 Strong Induction  Normally we must prove P(n+1) using P(n)  What if we need P(i) (i < n) to prove P(n+1)? After all, P(i) should also already hold  Instead of P(n) ⇒ P(n+1) we prove P(1) ⋀ … ⋀ P(n) ⇒ P(n+1) More information in the premise! Still correct: strong induction  Not always useful, but sometimes very convenient…

57 Example Theorem It takes n – 1 breaks to break a chocolate bar with n ≥ 1 squares into individual squares

58 Example Theorem It takes n – 1 breaks to break a chocolate bar with n ≥ 1 squares into individual squares Proof We use strong induction on n. Base case (n = 1): It’s just 1 square, so 0 breaks is correct. Step (n ≥ 1): Suppose it takes i – 1 breaks to break a chocolate bar with i squares for 1 ≤ i ≤ n (IH). We need to show that it takes n breaks to break a chocolate bar with n+1 squares. Suppose the chocolate bar is broken into 2 pieces with a and b squares, where 1 ≤ a, b ≤ n and a + b = n+1. By the IH it takes a – 1 breaks for the first piece and b – 1 for the second piece. Thus, we need 1 + (a – 1) + (b – 1) = a + b – 1 = n breaks in total. □

59 Example Theorem It takes n – 1 breaks to break a chocolate bar with n ≥ 1 squares into individual squares Proof We use strong induction on n. Base case (n = 1): It’s just 1 square, so 0 breaks is correct. Step (n ≥ 2): Consider a chocolate bar with n squares. Suppose the chocolate bar is broken into 2 pieces with a and b squares, where 1 ≤ a, b < n and a + b = n. By the IH it takes a – 1 breaks for the first piece and b – 1 for the second piece. Thus, we need 1 + (a – 1) + (b – 1) = a + b – 1 = n – 1 breaks in total. □

60 Example Theorem With 4-cent and 5-cent coins we can make any amount n ≥ 12

61 Example Theorem With 4-cent and 5-cent coins we can make any amount n ≥ 12 Proof We use strong induction on n. Base case (n = 12): We can use three 4-cent coins. Step (n ≥ 12): Suppose we can make any amount i with 4-cent and 5-cent coins for 12 ≤ i ≤ n. We need to show that we can make the amount n+1. If we use one 4-cent coin, then the remainder is n – 3. By the IH we can make the amount n – 3, so that means we can make n+1. □

62 Example Theorem With 4-cent and 5-cent coins we can make any amount n ≥ 12 Proof We use strong induction on n. Base case (n = 12): We can use three 4-cent coins. Step (n ≥ 12): Suppose we can make any amount i with 4-cent and 5-cent coins for 12 ≤ i ≤ n. We need to show that we can make the amount n+1. If we use one 4-cent coin, then the remainder is n – 3. By the IH we can make the amount n – 3, so that means we can make n+1. □ Can we apply the IH to n – 3? For n = 12, n – 3 = 9 and we haven’t proved anything for n = 9! The step only works for n ≥ 15. We need more base cases!

63 Example Theorem With 4-cent and 5-cent coins we can make any amount n ≥ 12 Proof We use strong induction on n. Base case (12 ≤ n ≤ 15 ): (n = 12): three 4-cent coins. (n = 13): two 4-cent coins and one 5-cent coin. (n = 14): one 4-cent coin and two 5-cent coins. (n = 15): three 5-cent coins. Step (n ≥ 15): Suppose we can make any amount i with 4-cent and 5-cent coins for 12 ≤ i ≤ n. We need to show that we can make the amount n+1. If we use one 4-cent coin, then the remainder is n – 3. By the IH we can make the amount n – 3, so that means we can make n+1. □

64 Strong induction Final notes on strong induction  When you apply the IH to P(i), make sure that i ≤ n. Otherwise you may be proving P(n+1) with P(n+1)…  As with standard induction, make sure that the step works for all n If not, you may need more base cases Theorem 6n = 0 for all n ≥ 0 Proof Base case (n = 0): 6 x 0 = 0 Step (n ≥ 0 ): n + 1 = a + b. By the IH, 6a = 0 and 6b = 0. Thus, 6 (n+1) = 6 (a + b) = 6a + 6b = 0 + 0 = 0. □ What’s wrong with this proof?


Download ppt "Reading and Writing Mathematical Proofs Spring 2015 Lecture 2: Basic Proving Techniques."

Similar presentations


Ads by Google