Outline for Today. What is an Implication? Negations and their Applications. Proof by Contrapositive. Proof by Contradiction

Similar documents
Outline for Today. What is an Implication? Negations and their Applications. Proof by Contrapositive. Proof by Contradiction

Announcements. Problem Set 1 out. Checkpoint due Monday, September 30. Remaining problems due Friday, October 4.

Mathematical Logic Part Three

Mathematical Logic Part One

Mathematical Logic Part One

Mathematical Logic Part Three

A Note on Turing Machine Design

Mathematical Logic Part Two

Mathematical Logic Part Three

CS103 Handout 08 Spring 2012 April 20, 2012 Problem Set 3

Binary Relations Part Two

Checkpoint Questions Due Monday, October 1 at 2:15 PM Remaining Questions Due Friday, October 5 at 2:15 PM

Proof: If (a, a, b) is a Pythagorean triple, 2a 2 = b 2 b / a = 2, which is impossible.

Mathematical Logic Part One

CS103 Handout 09 Fall 2012 October 19, 2012 Problem Set 4

Mathematical Logic Part One

Guide to Negating Formulas

The Inductive Proof Template

Introduction to Basic Proof Techniques Mathew A. Johnson

1 / 9. Due Friday, May 11 th at 2:30PM. There is no checkpoint problem. CS103 Handout 30 Spring 2018 May 4, 2018 Problem Set 5

Guide to Proofs on Discrete Structures

Mathematical Logic Part Three

Introducing Proof 1. hsn.uk.net. Contents

Course Staff. Textbook

MA103 STATEMENTS, PROOF, LOGIC

Proof by contrapositive, contradiction

How to write maths (well)

Mathematical Logic Part One

Readings and Exercises

Section 3.1: Direct Proof and Counterexample 1

Mathematical Induction

MATH 341, Section 001 FALL 2014 Introduction to the Language and Practice of Mathematics

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Guide to Proofs on Sets

Elementary Linear Algebra, Second Edition, by Spence, Insel, and Friedberg. ISBN Pearson Education, Inc., Upper Saddle River, NJ.

1 General Tips and Guidelines for Proofs

Outline for Today. Revisiting our first lecture with our new techniques! How do we know when two sets have the same size?

Mathematical Logic Part One

NP-Completeness Part II

HOW TO CREATE A PROOF. Writing proofs is typically not a straightforward, algorithmic process such as calculating

CS103 Handout 22 Fall 2012 November 30, 2012 Problem Set 9

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

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

Isomorphisms and Well-definedness

Basic Logic and Proof Techniques

One-to-one functions and onto functions

NP-Completeness Part One

MITOCW watch?v=ed_xr1bzuqs

Some Review Problems for Exam 1: Solutions

Mathematical Writing and Methods of Proof

Recap from Last Time

Supplementary Logic Notes CSE 321 Winter 2009

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

CSE 311: Foundations of Computing I. Lecture 1: Propositional Logic

Manual of Logical Style

Topic 1: Propositional logic

1.1 Administrative Stuff

Proof by Contradiction

Fog Chamber Testing the Label: Photo of Fog. Joshua Gutwill 10/29/1999

NP-Completeness Part II

Finite Automata Part Two

MITOCW watch?v=y6ma-zn4olk

Practice Second Midterm Exam I

Section 1.3. Let I be a set. When I is used in the following context,

EECS 1028 M: Discrete Mathematics for Engineers

CSC165. Larry Zhang, October 7, 2014

MITOCW ocw nov2005-pt1-220k_512kb.mp4

Discrete Structures Proofwriting Checklist

Proof: If (a, a, b) is a Pythagorean triple, 2a 2 = b 2 b / a = 2, which is impossible.

Math Fundamentals for Statistics I (Math 52) Unit 7: Connections (Graphs, Equations and Inequalities)

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

An analogy from Calculus: limits

Logic and Mathematics:

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

DISCRETE MATHEMATICS BA202

MITOCW watch?v=vjzv6wjttnc

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011

3: Linear Systems. Examples. [1.] Solve. The first equation is in blue; the second is in red. Here's the graph: The solution is ( 0.8,3.4 ).

For all For every For each For any There exists at least one There exists There is Some

PROBLEM SET 3: PROOF TECHNIQUES

8.1 Solutions of homogeneous linear differential equations

MAT2345 Discrete Math

Welcome to CS103! Three Handouts Today: Course Overview Introduction to Set Theory The Limits of Computation

Instructor (Brad Osgood)

Manual of Logical Style (fresh version 2018)

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

2-4: The Use of Quantifiers

Recommended Reading. A Brief History of Infinity The Mystery of the Aleph Everything and More

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

Math 300 Introduction to Mathematical Reasoning Autumn 2017 Proof Templates 1

MATH 22 INFERENCE & QUANTIFICATION. Lecture F: 9/18/2003

MITOCW ocw f99-lec09_300k

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

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter III. Basic Proof Techniques. Proving the obvious has never been easy. Marty Rubin

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

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

Inference and Proofs (1.6 & 1.7)

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Axiomatic systems. Revisiting the rules of inference. Example: A theorem and its proof in an abstract axiomatic system:

Transcription:

Indirect Proofs

Outline for Today What is an Implication? Understanding a key type of mathematical statement. Negations and their Applications How do you show something is not true? Proof by Contrapositive What's a contrapositive? And some applications! Proof by Contradiction The basic method. And some applications!

Logical Implication

Implications An implication is a statement of the form If P is true, then Q is true. Some examples: If n is an even integer, then n 2 is an even integer. If A B and B A, then A = B. If you like the way you look that much, (ohhh baby) then you should go and love yourself.

Implications An implication is a statement of the form If P is true, then Q is true. In the above implication, the statement P is true is called the antecedent and the statement Q is true is called the consequent.

What Implications Mean Consider the simple statement If I put fire near cotton, it will burn. Some questions to consider: Does this apply to all fire and all cotton, or just some types of fire and some types of cotton? (Scope) Does the fire cause the cotton to burn, or does the cotton burn for another reason? (Causality) These are significantly deeper questions than they might seem. To mathematically study implications, we need to formalize what implications really mean.

Understanding Implications If there's a rainbow in the sky, then it's raining somewhere. In mathematics, implication is directional. The above statement doesn't mean that if it's raining somewhere, there has to be a rainbow. In mathematics, implications only say something about the consequent when the antecedent is true. If there's no rainbow, it doesn't mean there's no rain. In mathematics, implication says nothing about causality. Rainbows do not cause rain.

What Implications Mean In mathematics, a statement of the form For any x, if P(x) is true, then Q(x) is true means that any time you find an object x where P(x) is true, you will see that Q(x) is also true (for that same x). There is no discussion of causation here. It simply means that if you find that P(x) is true, you'll find that Q(x) is also true.

Implication, Diagrammatically Any Any time time P is is true, true, Q is is true true as as well. well. Set of objects x where P(x) is true. Set of objects x where Q(x) is true. If If P isn't isn't true, true, Q may may or or may may not not be be true. true.

Negations

Negations A proposition is a statement that is either true or false. Some examples: If n is an even integer, then n 2 is an even integer. Ø = R. The new me is still the real me. The negation of a proposition X is a proposition that is true whenever X is false and is false whenever X is true. For example, consider the statement it is snowing outside. Its negation is it is not snowing outside. Its negation is not it is sunny outside. Its negation is not we re in the Bay Area.

How do you find the negation of a statement?

All My Friends Are Taller Than Me Me My Friends

The negation of the universal statement Every P is a Q is the existential statement There is a P that is not a Q.

The negation of the universal statement For all x, P(x) is true. is the existential statement There exists an x where P(x) is false.

Some Friend Is Shorter Than Me Me My Friends

The negation of the existential statement There exists a P that is a Q is the universal statement Every P is not a Q.

The negation of the existential statement There exists an x where P(x) is true is the universal statement For all x, P(x) is false.

Puppy Logic Consider the statement If x is a puppy, then I love x. The statement below is not its negation: If x is a puppy, then I don t love x It might not be obvious, at a first glance, why these statements aren t negations of one another. Talk this over with someone next to you and see if you can sort out why.

Puppy Logic If x is a puppy, then I love x. If x is a puppy, then I don t love x So So what what is is the the proper proper negation? negation? Puppies Puppies Puppies Things I Love Things I Love Things I Love I love all puppies. It's complicated. I don't love any puppies.

Puppy Logic If x is a puppy, then I love x. There is a puppy I don t love. Puppies Puppies Puppies Things I Love Things I Love Things I Love I love all puppies. There is a puppy that I don t love.

The negation of the statement For any x, if P(x) is true, then Q(x) is true is the statement There is at least one x where P(x) is true and Q(x) is false. The negation of an implication is not an implication!

How to Negate Universal Statements: For all x, P(x) is true becomes There is an x where P(x) is false. How to Negate Existential Statements: There exists an x where P(x) is true becomes For all x, P(x) is false. How to Negate Implications: For every x, if P(x) is true, then Q(x) is true becomes There is an x where P(x) is true and Q(x) is false

Proof by Contrapositive

The Contrapositive The contrapositive of the implication If P, then Q is the implication If Q is false, then P is false. For example: If it s a pupply, then I love it. Contrapositive: If I don t love it, then it s not a puppy. Another example: If I store cat food inside, then angry raccoons won t steal my cat food. Contrapositive: If angry raccoons stole my cat food, then I didn't store it inside.

To prove the statement if P is true, then Q is true, you can choose to instead prove the equivalent statement if Q is false, then P is false, if that seems easier. This is called a proof by contrapositive.

Theorem: For any n Z, if n 2 is even, then n is even. Proof: We will prove this by contrapositive by showing that if n is odd, then n 2 is odd. Let n be an arbitrary odd integer. Since n is odd, This there is some integer k This is such is a that a courtesy courtesy to n = 2k to the + the 1. reader Squaring both sides of reader and this equality and says says heads and heads up! up! we re simplifying gives the following: we re not not going going to to do do a a regular regular old-fashioned old-fashioned direct direct proof proof here. here. n 2 = (2k + 1) 2 n 2 = 4k 2 + 4k + 1 n 2 = 2(2k 2 + 2k) + 1. From this, we see that there is an integer m (namely, 2k 2 + 2k) such that n 2 = 2m + 1. Therefore, n 2 is odd.

Theorem: For any n Z, if n 2 is even, then n is even. Proof: We will prove this by contrapositive by showing that if n is odd, then n 2 is odd. Let n be an arbitrary odd integer. Since n is odd, there is some integer k such that n = 2k + 1. Squaring What What is is both the the contrapositive sides contrapositive of this of equality of the the statement statement and simplifying gives the following: if if n 2 2 is is even, even, then then n is is even? even? n 2 = (2k + 1) 2 n 2 = 4k 2 + 4k + 1 n 2 = 2(2k 2 + 2k) + 1. If If n is is odd, odd, then then n 2 2 is is odd. odd. From this, we see that there is an integer m (namely, 2k 2 + 2k) such that n 2 = 2m + 1. Therefore, n 2 is odd.

Theorem: For any n Z, if n 2 is even, then n is even. Proof: We will prove this by contrapositive by showing that if n is odd, then n 2 is odd. Let n be an arbitrary odd integer. Since n is odd, there is some integer k such that n = 2k + 1. Squaring What What is is both the the contrapositive sides contrapositive of this of equality of the the statement statement and simplifying gives the following: if if n 2 2 is is even, even, then then n is is even? even? n 2 = (2k + 1) 2 n 2 = 4k 2 + 4k + 1 n 2 = 2(2k 2 + 2k) + 1. If If n is is odd, odd, then then n 2 2 is is odd. odd. From this, we see that there is an integer m (namely, 2k 2 + 2k) such that n 2 = 2m + 1. Therefore, n 2 is odd.

Theorem: For any n Z, if n 2 is even, then n is even. Proof: We will prove this by contrapositive by showing that if n is odd, then n 2 is odd. Let n be an arbitrary odd integer. Since n is odd, there is some integer k such that n = 2k + 1. Squaring both sides of this equality and simplifying gives the following: n 2 = (2k + 1) 2 n 2 = 4k 2 + 4k + 1 n 2 = 2(2k 2 + 2k) + 1. We've We've said said that that we're we're going going to to prove prove this this new new implication, implication, so so let's let's go go do do it! it! The The rest rest of of this this proof proof will will look look a a lot lot like like a a From this, we see that there is an integer m (namely, 2k 2 + 2k) such that n 2 = 2m + 1. Therefore, n 2 standard is odd. standard direct direct proof. proof.

Theorem: For any n Z, if n 2 is even, then n is even. Proof: We will prove this by contrapositive by showing that if n is odd, then n 2 is odd. Let n be an arbitrary odd integer. Since n is odd, there is some integer k such that n = 2k + 1. Squaring both sides of this equality and simplifying gives the following: n 2 = (2k + 1) 2 n 2 = 4k 2 + 4k + 1 n 2 = 2(2k 2 + 2k) + 1. From this, we see that there is an integer m (namely, 2k 2 + 2k) such that n 2 = 2m + 1. Therefore, n 2 is odd.

Theorem: For any n Z, if n 2 is even, then n is even. Proof: We will prove this by contrapositive by showing that if n is odd, then n 2 is odd. Let n be an arbitrary The general odd pattern integer. here Since is the n following: is odd, there is some integer k such that n = 2k + 1. Squaring both sides of this equality and simplifying gives the following: The general pattern here is the following: 1. 1. Start Start by by announcing announcing that that we're we're going going to to use use a a proof proof by by contrapositive contrapositive so so that that the the reader reader knows knows what what to to expect. expect. n 2 = (2k + 1) 2 n 2 = 4k 2 + 4k + 1 n 2 = 2(2k 2 + 2k) + 1. 2. 2. Explicitly Explicitly state state the the contrapositive contrapositive of of what what we we want want to to prove. prove. From this, we see that there is an integer m (namely, 2k 2 + 2k) such that n 2 = 2m + 1. Therefore, n 2 is odd. 3. 3. Go Go prove prove the the contrapositive. contrapositive.

Biconditionals The previous theorem, combined with what we saw on Wednesday, tells us the following: For any integer n, if n is even, then n 2 is even. For any integer n, if n 2 is even, then n is even. These are two different implications, each going the other way. We use the phrase if and only if to indicate that two statements imply one another. For example, we might combine the two above statements to say for any integer n: n is even if and only if n 2 is even.

Proving Biconditionals To prove a theorem of the form P if and only if Q, you need to prove two separate statements. First, that if P is true, then Q is true. Second, that if Q is true, then P is true. You can use any proof techniques you'd like to show each of these statements. In our case, we used a direct proof for one and a proof by contrapositive for the other.

Time-Out for Announcements!

Are you interested in attending AfroTech?? FILL OUT THIS INTEREST FORM! The Computer Forum is gauging interest in AfroTech to potentially partially or fully subsidize some student tickets. The AfroTech conference will take place in San Francisco from November 9th to 10th. It is the largest Black tech conference in Silicon Valley. "The groundbreaking, revolutionary experience for Black techies, startups and entrepreneurs returns! Come join 3000+ of your fellow founders, entrepreneurs, engineers for a 360-degree look at how culture and tech runs the world." Questions? Contact Ekua Awotwi (eawotwi@stanford.edu).

CURIS Poster Session There s a CURIS poster session showcasing work from the summer going on from 3PM 5PM today on the Packard lawn. Feel free to stop on by! Interested in seeing what research projects are open right now? Visit https://curis.stanford.edu. Have questions about research or how CURIS works? Email PhD students and CURIS mentors Griffin Dietz and Kexin Rong at curis-mentors@cs.stanford.edu. Email CURIS admin Nan Aoki at nanaoki@cs.stanford.edu. Email Michael Bernstein, HCI professor and CURIS chair, at msb@cs.stanford.edu.

Handouts There are five (!) total handouts for today: Handout 08: Mathematical Vocabulary Handout 09: Guide to Indirect Proofs Handout 10: Ten Techniques to Get Unstuck Handout 11: Proofwriting Checklist Handout 12: Problem Set One Be sure to read over Handouts 08 11; there's a lot of really important information in there!

Announcements Problem Set 1 goes out today! Checkpoint due Monday, October 1 at 2:30PM. Grade determined by attempt rather than accuracy. It's okay to make mistakes we want you to give it your best effort, even if you're not completely sure what you have is correct. We will get feedback back to you with comments on your proof technique and style. The more effort you put in, the more you'll get out. Remaining problems due Friday, October 5 at 2:30PM. Feel free to email us with questions, stop by office hours, or ask questions on Piazza!

Submitting Assignments All assignments should be submitted through GradeScope. The programming portion of the assignment gets submitted separately from the written component. The written component must be typed up; handwritten solutions don t scan well and get mangled in GradeScope. Summary of the late policy: Everyone has three 24-hour late days. Late days can't be used on checkpoints. Nothing may be submitted more than two days past the due date. Because submission times are recorded automatically, we're strict about the submission deadlines. Very good idea: Leave at least two hours buffer time for your first assignment submission, just in case something goes wrong. Very bad idea: Wait until the last minute to submit.

Working in Pairs You can work on the problem sets individually or in pairs. Each person/pair should only submit a single problem set. In other words, if you re working in a pair, you and your partner should agree who will make the submission. Full details about the problem sets, collaboration policy, and Honor Code can be found in Handout 04 and Handout 05.

A Note on the Honor Code

Office hours have started! Schedule is available on the course website.

Back to CS103!

Proof by Contradiction

There s something hidden behind one of these doors. Which door is it hidden behind? Door 3 Even Even without without opening opening this this door, door, we we know know whatever whatever is is hidden hidden has has to to be be here. here.

Every statement in mathematics is either true or false. If statement P is not false, what does that tell you? The Door of Truth Even Even without without opening opening this this door, door, we we know know P P has has to to be be here. here.

A proof by contradiction shows that some statement P is true by showing that it cannot be false.

Proof by Contradiction To prove a statement P is true using a proof by contradiction, do the following: Make the assumption that P is false. Beginning with this assumption, use logical reasoning to conclude something that is clearly impossible. For example, that 1 = 0, that x S and x S, etc. Conclude that P cannot be false, so P must be true.

An Example: Set Cardinalities

Set Cardinalities We ve seen sets of many different cardinalities: Ø = 0 {1, 2, 3} = 3 { n N n < 137} = 137 N = ℵ₀.₀. These span from the finite up through the infinite. Question: Is there a largest set? That is, is there a set that s bigger than every other set?

Theorem: There is no largest set. Proof: Assume for the sake of contradiction that there is a largest set; call it S. Now, consider the set (( S). By Cantor s Theorem, we know that S < (( S), so (( S) is a To larger set To prove than prove this S. this statement This statement by contradicts by contradiction, contradiction, the fact that S we re is the largest we re going set. going to to assume assume its its negation. negation. We ve reached What What is is a the the contradiction, negation negation of of the the statement statement so our assumption must there there have is is no no been largest largest wrong. set? set? Therefore, there is no largest set. One One option: option: there there is is a a largest largest set. set.

Theorem: There is no largest set. Proof: Assume for the sake of contradiction that there is a largest set; call it S. Now, consider the set (( S). By Cantor s Theorem, Notice we know that S < (( S), so (( S) is a Notice that that we're we're announcing announcing larger set than S. This contradicts the fact that S is the largest 1. that set. this is a proof by contradiction, and 1. that this is a proof by contradiction, and 2. what, specifically, we're assuming. We ve reached 2. what, a specifically, contradiction, we're assuming. so our assumption must have been wrong. Therefore, This This helps helps the the reader reader understand understand where where we're we're there is no largest set. going. going. Remember Remember proofs proofs are are meant meant to to be be read read by by other other people! people!

Theorem: There is no largest set. Proof: Assume for the sake of contradiction that there is a largest set; call it S. The Now, consider the The three set three key (( key pieces: S). pieces: By Cantor s 1. Theorem, Say that the proof we is know by contradiction. that S < (( S), so (( S) is a 2. Say what you are assuming is the negation of the statement to prove. 3. larger Say you set have than reached S. a contradiction This contradicts and what the the contradiction fact that means. S is the In largest In CS103, CS103, please please set. include include all all these these steps steps in in your your proofs! proofs! 1. Say that the proof is by contradiction. 2. Say what you are assuming is the negation of the statement to prove. 3. Say you have reached a contradiction and what the contradiction means. We ve reached a contradiction, so our assumption must have been wrong. Therefore, there is no largest set.

Theorem: There is no largest set. Proof: Assume for the sake of contradiction that there is a largest set; call it S. Now, consider the set (( S). By Cantor s Theorem, we know that S < (( S), so (( S) is a larger set than S. This contradicts the fact that S is the largest set. We ve reached a contradiction, so our assumption must have been wrong. Therefore, there is no largest set.

Proving Implications To prove the implication If P is true, then Q is true. you can use these three techniques: Direct Proof. Assume P is true, then prove Q is true. Proof by Contrapositive. Assume Q is false, then prove that P is false. Proof by Contradiction. what does this look like?

Theorem: For any integer n, if n 2 is even, then n is even. Proof: Assume for the sake of contradiction that n is an integer and that n 2 is even, but that n is odd. Since n is odd we know that there is an integer k such that n = 2k + 1 (1) Squaring both sides of equation (1) and simplifying gives the What following: What is is the the negation negation of of our our theorem? theorem? n 2 = (2k + 1) 2 = 4k 2 + 4k + 1 = 2(2k 2 + 2k) + 1 (2) Equation (2) tells us that n 2 is odd, which is impossible; by assumption, n 2 is even. We have reached a contradiction, so our assumption must have been incorrect. Thus if n is an integer and n 2 is even, n is even as well.

Theorem: For any integer n, if n 2 is even, then n is even. Proof: Assume for the sake of contradiction that there is an integer n where n 2 is even, but n is odd. Since n is odd we know that there is an integer k such that n = 2k + 1 (1) Squaring both sides of equation (1) and simplifying gives the following: n 2 = (2k + 1) 2 = 4k 2 + 4k + 1 = 2(2k 2 + 2k) + 1 (2) Equation (2) tells us that n 2 is odd, which is impossible; by assumption, n 2 is even. We have reached a contradiction, so our assumption must have been incorrect. Thus if n is an integer and n 2 is even, n is even as well.

Theorem: For any integer n, if n 2 is even, then n is even. Proof: Assume for the sake of contradiction that there is an integer n where n 2 is even, but n is odd. Since n is odd we know that there is an integer k such that n = 2k + 1. (1) Squaring both sides of equation (1) and simplifying gives the following: n 2 = (2k + 1) 2 = 4k 2 + 4k + 1 = 2(2k 2 + 2k) + 1. (2) Equation (2) tells us that n 2 is odd, which is impossible; by assumption, n 2 is even. We have reached a contradiction, so our assumption must have been incorrect. Thus if n is an integer and n 2 is even, n is even as well.

Recap: Negating Implications To prove the statement For any x, if P(x) is true, then Q(x) is true by contradiction, we do the following: Assume this entire purple statement is false. Derive a contradiction. Conclude that the statement is true. What is the negation of the above purple statement? There is an x where P(x) is true and Q(x) is false

What We Learned What's an implication? It's statement of the form if P, then Q, and states that if P is true, then Q is true. How do you negate formulas? It depends on the formula. There are nice rules for how to negate universal and existential statements and implications. What is a proof by contrapositive? It's a proof of an implication that instead proves its contrapositive. (The contrapositive of if P, then Q is if not Q, then not P. ) What's a proof by contradiction? It's a proof of a statement P that works by showing that P cannot be false.

Next Time Mathematical Logic How do we formalize the reasoning from our proofs? Propositional Logic Reasoning about simple statements. Propositional Equivalences Simplifying complex statements.