CS 360, Winter Morphology of Proof: An introduction to rigorous proof techniques

Similar documents
Deænition 1 A set S is ænite if there exists a number N such that the number of elements in S èdenoted jsjè is less than N. If no such N exists, then

Some Review Problems for Exam 1: Solutions

a. See the textbook for examples of proving logical equivalence using truth tables. b. There is a real number x for which f (x) < 0. (x 1) 2 > 0.

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

CS1800: Mathematical Induction. Professor Kevin Gold

HOW TO WRITE PROOFS. Dr. Min Ru, University of Houston

Introduction to Basic Proof Techniques Mathew A. Johnson

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models

Proof Techniques (Review of Math 271)

CS 173: Induction. Madhusudan Parthasarathy University of Illinois at Urbana-Champaign. February 7, 2016

Writing Mathematical Proofs

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers:

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...}

Mathematical Induction

Math 38: Graph Theory Spring 2004 Dartmouth College. On Writing Proofs. 1 Introduction. 2 Finding A Solution

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Mathematical Writing and Methods of Proof

3 The language of proof

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions

means is a subset of. So we say A B for sets A and B if x A we have x B holds. BY CONTRAST, a S means that a is a member of S.

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

ASSIGNMENT 1 SOLUTIONS

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality

Discrete Mathematics for CS Fall 2003 Wagner Lecture 3. Strong induction

MA103 STATEMENTS, PROOF, LOGIC

One-to-one functions and onto functions

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

Section Summary. Proof by Cases Existence Proofs

Proof worksheet solutions

Proof by Contradiction

Basics of Proofs. 1 The Basics. 2 Proof Strategies. 2.1 Understand What s Going On

Supplementary Notes on Inductive Definitions

Proofs. Joe Patten August 10, 2018

Chapter 2 Section 2.1: Proofs Proof Techniques. CS 130 Discrete Structures

Lecture 4: Constructing the Integers, Rationals and Reals

Computer Science Foundation Exam

Definitions Chapter 1 Proof Technique (Pg.1): Proof (Pg.2): Statement (Pg.2): Conditional Statement/Implication (Pg3.): Hypothesis(Pg.

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

CMPSCI 250: Introduction to Computation. Lecture #15: The Fundamental Theorem of Arithmetic David Mix Barrington 24 February 2014

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Fall 2017 Test II review problems

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

Topic Contents. Factoring Methods. Unit 3: Factoring Methods. Finding the square root of a number

More examples of mathematical. Lecture 4 ICOM 4075

Direct Proof and Counterexample I:Introduction

Direct Proof and Counterexample I:Introduction. Copyright Cengage Learning. All rights reserved.

Proofs. Introduction II. Notes. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

ACCUPLACER MATH 0310

1 Direct Proofs Technique Outlines Example Implication Proofs Technique Outlines Examples...

Chapter 1 The Real Numbers

Introducing Proof 1. hsn.uk.net. Contents

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions

Math 250A, Fall 2004 Problems due October 5, 2004 The problems this week were from Lang s Algebra, Chapter I.

Standard forms for writing numbers

Chapter 5. Number Theory. 5.1 Base b representations

Proofs: A General How To II. Rules of Inference. Rules of Inference Modus Ponens. Rules of Inference Addition. Rules of Inference Conjunction

Writing proofs for MATH 61CM, 61DM Week 1: basic logic, proof by contradiction, proof by induction

Meaning of Proof Methods of Proof

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

CSE 20 DISCRETE MATH WINTER

Inference and Proofs (1.6 & 1.7)

An analogy from Calculus: limits

We are going to discuss what it means for a sequence to converge in three stages: First, we define what it means for a sequence to converge to zero

1.1 Statements and Compound Statements

PROOFS IN MATHEMATICS

Solutions to Homework Assignment 2

Matrix Multiplication

Announcements. Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Existence Proofs. Non-constructive

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1

MATH 215 Final. M4. For all a, b in Z, a b = b a.

PROBLEM SET 3: PROOF TECHNIQUES

Mathematical Induction

Mathematics 220 Midterm Practice problems from old exams Page 1 of 8

Basic Proof Examples

Winter Camp 2009 Number Theory Tips and Tricks

Isomorphisms and Well-definedness

Writing proofs. Tim Hsu, San José State University. May 31, Definitions and theorems 3. 2 What is a proof? 3. 3 A word about definitions 4

Induction 1 = 1(1+1) = 2(2+1) = 3(3+1) 2

An Introduction to Proofs in Mathematics

Handout on Logic, Axiomatic Methods, and Proofs MATH Spring David C. Royster UNC Charlotte

Logic, Sets, and Proofs

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

Chapter 5 Simplifying Formulas and Solving Equations

CITS2211 Discrete Structures (2017) Cardinality and Countability

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Divisibility of Natural Numbers

Math 13, Spring 2013, Lecture B: Midterm

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Fibonacci mod k. In this section, we examine the question of which terms of the Fibonacci sequence have a given divisor k.

CS 246 Review of Proof Techniques and Probability 01/14/19

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Note 2

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

Algebra Introduction to Polynomials

Reading 5 : Induction

MATH CSE20 Homework 5 Due Monday November 4

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

A n = A N = [ N, N] A n = A 1 = [ 1, 1]. n=1

Transcription:

CS 30, Winter 2011 Morphology of Proof: An introduction to rigorous proof techniques 1 Methodology of Proof An example Deep down, all theorems are of the form If A then B, though they may be expressed in some other way, such as All A are B or Let A be true. Then B is true. Thus every proof has assumptions the A part and conclusions the B part. To prove a theorem, you must combine the assumptions you are given with definitions and other theorems to prove the conclusion. Definitions and theorems let you convert statements to other statements; by stringing these together you can convert the statements of A into the statements of B. This constitutes a proof. For example: Theorem 1. Let x be a number greater than or equal to 4. Then 2 x x 2. This theorem converts the statement a number x is greater than or equal to 4 to for this number, 2 x x 2. We can use it in the proof of another theorem, like so: Theorem 2. Let x be the sum of four squares, a 2 + b 2 + c 2 + d 2, where a, b, c and d are positive integers. Then 2 x x 2. If we can prove that x is of necessity greater than or equal to 4 (by noting, for instance, that a, b, c and d are at least 1, and thus their sum is at least 4), then we can convert the assumption of our theorem from x is the sum of four squares to 2 x x 2. This completes our proof. Often, we use definitions to expand out mathematical shorthand before we can start applying proofs. For instance, if an assumption is that x is prime, then you might need to convert this to x has exactly two positive divisors before continuing with your proof. If you are at a loss for how to start a proof, convert all the terms in the assumptions to their definitions. Here is a theorem that can be proved with these techniques: Theorem 3. Let S be a finite subset of some infinite set U. Let T be the complement of S. Then T is infinite. Intuitively, this is saying that if you have an infinite supply of something, and you take a finite amount of it away, then you are left with an infinite amount. This explanation may seem obvious, but it is not a proof. To obtain a rigorous proof, we must get from the assumptions to the conclusion through theorems and definitions. We identify the assumptions: S is a finite subset of an infinite set. It has complement T. A good start is to expand the definitions in the assumption. Definition. A set S is finite if there exists a number N such that the number of elements in S (denoted S ) is less than N. If no such N exists, then S is infinite. Based on a handout by Rajeev Motwani. 1

Note that you give me the set S before I try to figure out the number N. Thus, if any number N exists that is bigger than S, I will be sure to find it, since I know what S is. This ordering concern ( first we have S, then we find N ) is important with statements such as there exists or for all. Definition. If S and T are both subsets of some U, T is the complement of S (under U) if S T = U and S T is. So now we can use our definitions to convert our assumptions: Original statement S is finite U is infinite T is the complement of S New statement There is a number N such that S < N There is no number M such that U < M S T = U and S T is We are still stuck, so we have to apply one of the proof methods which will be discussed in the next sections. These let you know the conclusion the B part to help prove the theorem. What we need here is a common proof technique, proof by contradiction. We assume that the result is false, and show that as a result, the assumptions must be false as well. Since we know the assumptions are true, this means that the theorem must also be true. So we assume that the result is false, that T is in fact finite. Then, applying a definition, there is a number P such that T < P. Since we know that S T = U and S T is, we know S + T = U (if you don t know this, then you can prove it on its own before you try to include it in this proof). But we know S < N and T < P, so S + T < N + P, that is, U < M + P. But we assumed there is no number such that U is less than it, so our claim that the result is false is wrong. Thus the result is true, and the theorem is proved. We write it up in a more mathematical, terse form: Proof. We know that S T = U and S and T are disjoint, so S + T = U. Since S is finite, S < M for some M, and since U is infinite, U > N for all N. So assume that T is finite, that is, for some P, T < P. Then S + T < M + P, or, substituting, U < M + P. But this contradicts our claim that U > N for all N. Summary: How to prove a theorem 1. Identify the assumptions and goals of the theorem. 2. Understand the implications of each of the assumptions made. Translate them into mathematical definitions if you can. 3. Either try to massage the definitions and theorems that you identified in (2) into the statement you are trying to prove, or, if that fails, 4. Make an assumption about what you are trying to prove and show that it leads to a proof or a contradiction. The last two items are the only two possible ways to convert your assumptions into a proof. These and other possible techniques for proving theorems will be discussed in more detail in the next section. 2

2 Taxonomy We will discuss the following techniques useful in proving a theorem: 1. Proving if and only if proofs in two directions 2. Structural induction 3. Contrapositive 4. Counterexample 2.1 Taxonomy of proof If and only if While all proofs are of the form If... Then, many have more complicated manifestations. The most basic proof has the form if A then B or A implies B or A B which was explored in Section 1. This means that whenever A is true, B is also true. A stronger connection between A and B is implied by the form A if an only if B or A B or A iff B The term if and only if is really a code word for equivalence. To prove a theorem of this form, you must prove that A and B are equivalent; that is, not only is B true whenever A is true, but A is true whenever B is true. If and only if is meant to be interpreted as follows: A if B means if B then A A only if B means if not B then not A It is a logical law that if A then B is always equivalent to if not B then not A (this is the basis to proof by contradiction), so A only if B is equivalent to if A then B as well. When proving an if and only if proof directly, you must make sure that the equivalence you are proving holds in all steps of the proof. This means that each step in the proof must use either a definition that is if and only if or a theorem that is if and only if. Using a less rigorous if... then proof in one of your steps will invalidate your proof. Making sure all the steps in your theorem obey this restriction is usually difficult and often impossible. The second, more common way then to prove an if and only if theorem is to physically break and if and only if proof into two proofs, the forwards and backwards proofs. To prove a theorem of the form A if and only if B, you first prove if A then B, then you prove if B then A, and that completes the proof. Using this technique, you can use if... then proofs as well as if and only if proofs in your own proof. 3

Theorem 4. Let x be a number. Let x be the greatest integer less than or equal to x, and let x be the smallest integer greater than or equal to x. Prove that x = x if and only if x is an integer. Proof. In this direction we assume x = x and try to prove x is an integer. Not that x x x. Since x = x, then x = x as well by the sandwich theorem. Since x is an integer, x must be as well. Now we assume x is an integer and try to prove that x = x. If x is an integer, then x = x and x = x (by definition of both terms), so x = x as well. 2.2 Taxonomy of proof Structural induction Straight induction is an occasionally useful proof technique. It is used to prove that there exists a relationship between some function of the integers and a given formula. Since there are an infinite number of integers, brute force won t work ( Well, the pattern holds for 1, and for 2, and for 3, and... ), so we use induction: Prove the pattern holds for at least one number (the base case ) Assume it holds for an arbitrary number N Prove that if it holds for N, it must hold for N + 1 as well. Again, we can t escape the if... then construction. Here s what I mean by pattern: Theorem 5. Prove that for all n. n i 2 = i=1 n(n + 1)(2n + 1) Proof. If n is 1, the sum of the first n squares is 1, and the formula works out to 1 2 3/ = 1 as well. Since we want to prove this pattern of equality between sum and formula holds for all positive integers, not just the number 1, we use induction. The case n = 1 serves as the basis of the induction. Assume the formula holds for some number n, that is, n i 2 = i=1 for this n. If we can prove that this implies n(n + 1)(2n + 1) (1) n+1 i 2 = i=1 [n + 1]([n + 1] + 1)(2[n + 1] + 1) (2) then we ve prove the theorem ((1) is the same as (2), but with all the n s replaced by n+1 s). To get the left-hand side of (1) to match that of (2), we add (n + 1) 2 to both sides of the equation. Adding 4

(n + 1) 2 to the right-hand side of (1) and multiplying it out gives 1 [2n3 + 3n 2 + n + (n 2 + 2n + 1)] which simplifies to 1 (2n3 + 9n 2 + 13n + ). If we expand the right-hand side of (2), we see it is (n 2 +3n+2)(2n+3) = 1 (2n3 + 9n 2 + 13n + ). Hence the two sides match, the formula works, and we re done. There aren t many places where this is useful, however, for we rarely try to prove things about integers. However, forms of induction can be appropriate when trying to prove things about structures defined recursively (when you consider the integers as such a structure, where all the numbers are defined by recursively adding one to itself, you get straight induction). For instance, a string in compute science is defined as a collection of characters, and proofs about strings often start with proving the case for single-character strings and then proving the rest by induction. This generalized induction is known as structural induction. It is useful when objects are built up from more primitive objects: if we can show the primitive objects have the desired property, and the act of building preserves that property, then we have shown that all objects must have the property. The inductive hypothesis (i.e., the assumption) is to assume that something is true for simpler forms of an object and then prove that it holds for more complex forms. Complexity is defined as a relative term: one object is more complex than another iff it includes that other object as a subpart. A classic use of structural induction is to prove that any legal expression has the same number of left parentheses as right parentheses: Theorem. E is a well-formed formula (wff) if it has one of the following forms: a number (constant) or letter (variable) E + F, where E and F are both wffs E F, where E and F are both wffs, or (E), where E is a wff. Prove all wffs have the same number of left and right parentheses. In this example, wffs of type 1 are the primitive types, while the others make new wffs from simpler ones. We must take care not to forget a case. Proof. We let E ( be the number of left parentheses in a wff E and E ) be the number of right parentheses in E. We now consider each case and its parentheses count: case number of ( s number of ) s 1 0 0 2 E ( + F ( E ) + F ) 3 E ( + F ( E ) + F ) 4 E ( + 1 E ) + 1 In the last three cases, E and F are simpler than the complex forms they are part of [E + F, E F, or (E)], and hence for these cases we can assume the inductive hypothesis for E and F : namely, that E ( = E ) and F ( = F ) for these simpler forms. Using this assumption, we see that [E + F ] ( = [E + F ] ), [E F ] ( = [E F ] ), and [(E)] ( = [(E)] ). Finally, we see by inspection that in the base case (1) the parenthesis count matches, so they match in all cases. 5

2.3 Taxonomy of proof Contrapositive Contrapositive is a quite powerful method in proof: it allows you to attack a proof backwards. Instead of going from the assumptions and trying to derive the result, you start by assuming the result is false and show that this violates one of the assumptions. This makes use of the logical law of contrapositive: if A then B is equivalent to if not B then not A Since we are assuming that the result is not true and end up contradicting our assumptions, this is also often called proof by contradiction. We used it back in Section 1 for the very first proof; it is used quite a lot. It gives a lot of flexibility in if and only if proofs, because it allows us to interpret the forward and backward part of the proof in several different ways: The two parts of an if and only if proof Prove: A iff B. Prove A implies B. Then prove B implies A. Prove A implies B. Then prove not A implies not B. Prove B implies A. Then prove not B implies not A. By applying the law of contrapositive, it is fairly easy to see that all three forms are in fact equivalent. This flexibility in proof methods is yet another reason to prefer the two-step approach to if and only if proofs to the monolithic approach. 2.4 Taxonomy of proof Counterexample It may be significantly easier to disprove something than to prove it, for to prove a theorem false, often all you need to do is provide a counterexample. Disproofs can be as simple as this: Alleged-Theorem 7. All prime numbers are odd. Disproof. Two is prime, but two is even. Usually, however, counterexamples are not that easy to come by. Frequently, you are not asked to disprove something, but are given a statement and told either to prove or disprove it. A good general strategy in such cases is to search for a proof, but use any weaknesses in your proof strategy to search for counterexamples. Here is an example of that technique. The definition we need here is this: a mod b is defined to be the unique integer r such that, for some q, bq +r = a, bq a and b(q + 1) > a. That is, a mod b is the remainder when a is divided by b. Note that from the definition it follows that 0 a mod b < b. Alleged-Theorem 8. Prove or disprove: There is no pair of numbers a and b such that a mod b = b mod a.

When asked to do things with pairs of objects, it is often possible to simplify the relationship between the two numbers to help with the proof. In this case, we can assume a < b without loss of generality, because if a > b, we can sway a and b and get the same equation we are taking advantage of the problem s symmetry. We must be careful not to forget the third case, however, that a = b. This turns out to be the chink in our proof that leads to a counterexample, but for right now we try to prove the theorem, keeping our eyes out for counterexamples. So first we assume that a < b. Then a mod b = a (from the definition above, with q = 0 and r = a). But b mod a < a, from our observation above that x mod y is always less than y. Hence a mod b b mod a for any values of a or b. By switching around a and b, we get a similar proof for the case b < a. But now we try to prove the theorem for the case a = b. And here we run into problems, because a mod b = 0 if a = b, and b mod a = 0 if b = a, so then a mod b = b mod a, disproving the theorem. Here s the proof: Disproof. The theorem is false: if a = b = 2, for instance, then 2 mod 2 = 2 mod 2. In the process of finding this counterexample, though, we found out something more than was asked for: we know exactly those conditions that make a mod b = b mod a. Thus we are able to prove a modified version of the theorem: Theorem 9. a mod b = b mod a iff a = b. Since this is an if and only if proof, we have to do it in two directions. As is often the case in if and only if proofs, one direction is much easier to do than the other. We will do the easy direction first. Proof. We assume a = b and prove a mod b = b mod a. But this is clearly true, since x mod x = 0 for all x, and a and b are equal. Here we have to prove that if a mod b = b mod a, then a = b. Try to find a direct proof, and then give up and do the contrapositive: assume a b, and prove that a mod b b mod a. There are two possible cases: a < b and b < a (we ve already assumed a b). a < b Then a mod b = a. But b mod a, as we noted, is strictly less than a, so it cannot be equal to a and hence can t be equal to a mod b. a > b Then b < a, and the proof is the same as above with a replaced by b and b replaced by a. 7