Agenda. Introduction to Proofs Dr Patrick Chan School of Computer Science and Engineering South China University of Technology

Similar documents
Rules of Inference. Agenda. Rules of Inference Dr Patrick Chan. p r. p q. q r. Rules of Inference for Quantifiers. Hypothetical Syllogism

CS 2336 Discrete Mathematics

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Discrete Mathematics Logics and Proofs. Liangfeng Zhang School of Information Science and Technology ShanghaiTech University

Readings: Conjecture. Theorem. Rosen Section 1.5

Rules of Inference. Arguments and Validity

Methods of Proof. 1.6 Rules of Inference. Argument and inference 12/8/2015. CSE2023 Discrete Computational Structures

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

Rules Build Arguments Rules Building Arguments

ECOM Discrete Mathematics

Intro to Logic and Proofs

KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) RULES OF INFERENCE. Discrete Math Team

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Review: Potential stumbling blocks

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

The Foundations: Logic and Proofs. Chapter 1, Part III: Proofs

Logic Overview, I. and T T T T F F F T F F F F

software design & management Gachon University Chulyun Kim

Logic and Proof. Aiichiro Nakano

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

With Question/Answer Animations. Chapter 1, Part III: Proofs

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

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

1 The Foundation: Logic and Proofs

1 The Foundation: Logic and Proofs

Proofs. Example of an axiom in this system: Given two distinct points, there is exactly one line that contains them.

Predicate Logic. Andreas Klappenecker

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Discrete Mathematics

ICS141: Discrete Mathematics for Computer Science I

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

Sec$on Summary. Valid Arguments Inference Rules for Propositional Logic. Inference Rules for Quantified Statements. Building Arguments

Mathacle. PSet ---- Algebra, Logic. Level Number Name: Date: I. BASICS OF PROPOSITIONAL LOGIC

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

DISCRETE MATHEMATICS BA202

Discrete Structures for Computer Science

First order Logic ( Predicate Logic) and Methods of Proof

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Fall

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

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

A. Propositional Logic

Predicate Logic & Quantification

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Sec$on Summary. Valid Arguments Inference Rules for Propositional Logic. Inference Rules for Quantified Statements. Building Arguments

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

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

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

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY MA DISCRETE MATHEMATICS

Chapter 1 Elementary Logic

Outline. Rules of Inferences Discrete Mathematics I MATH/COSC 1056E. Example: Existence of Superman. Outline

Introduction to Sets and Logic (MATH 1190)

1. Propositions: Contrapositives and Converses

MAT 243 Test 1 SOLUTIONS, FORM A

CS0441 Discrete Structures Recitation 3. Xiang Xiao

Mat 243 Exam 1 Review

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

CITS2211 Discrete Structures Proofs

UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION B Sc (MATHEMATICS) I Semester Core Course. FOUNDATIONS OF MATHEMATICS (MODULE I & ii) QUESTION BANK

Solutions to Exercises (Sections )

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

Math 3336: Discrete Mathematics Practice Problems for Exam I

2. Use quantifiers to express the associative law for multiplication of real numbers.

Argument. whenever all the assumptions are true, then the conclusion is true. If today is Wednesday, then yesterday is Tuesday. Today is Wednesday.

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

Logic, Sets, and Proofs

Inference and Proofs (1.6 & 1.7)

Introduction to proofs. Niloufar Shafiei

Lecture 7 Feb 4, 14. Sections 1.7 and 1.8 Some problems from Sec 1.8

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Propositional Logic. Propositional Equivalences. Agenda. Yutaka HATA, IEEE Fellow. Ch1.1 Propositional Logic. Ch1.2 Propositional Equivalences

What is the decimal (base 10) representation of the binary number ? Show your work and place your final answer in the box.

Manual of Logical Style

Chapter 4, Logic using Propositional Calculus Handout

Discrete Mathematics Basic Proof Methods

Mat2345 Week 2. Chap 1.5, 1.6. Fall Mat2345 Week 2. Chap 1.5, 1.6. Week2. Negation. 1.5 Inference. Modus Ponens. Modus Tollens. Rules.

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

Tutorial Obtain the principal disjunctive normal form and principal conjunction form of the statement

Announcements. Exam 1 Review

Lecture 2: Proof Techniques Lecturer: Lale Özkahya

[Ch 3, 4] Logic and Proofs (2) 1. Valid and Invalid Arguments ( 2.3, 3.4) 400 lecture note #2. 1) Basics

PHI Propositional Logic Lecture 2. Truth Tables

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements

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

Full file at

Mathematical Reasoning Rules of Inference & Mathematical Induction. 1. Assign propositional variables to the component propositional argument.

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Section Summary. Proof by Cases Existence Proofs

MCS-236: Graph Theory Handout #A4 San Skulrattanakulchai Gustavus Adolphus College Sep 15, Methods of Proof

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

Transcription:

Discrete Mathematic Chapter 1: Logic and Proof 1.5 Rules of Inference 1.6 Introduction to Proofs Dr Patrick Chan School of Computer Science and Engineering South China University of echnology Agenda Rules of Inference Rules of Inference for Quantifiers Chapter 1.5 & 1.6 2 Recall John is a cop. John knows first aid. herefore, all cops know first aid Recall Some students work hard to study. Some students fail in examination. So, some work hard students fail in examination. Chapter 1.5 & 1.6 3 Chapter 1.5 & 1.6 4

Argument Premise / Hypothesis Conclusion therefore If it rains, the floor is wet It rains he floor is wet Argument p: It rains q: he floor is wet Argumentin propositional logic is a sequence of propositions Premises / Hypothesis: All except the final proposition Conclusion: he final proposition Argument form represents the argument by variables p p q Chapter 1.5 & 1.6 5 q Argument Form Argument: Valid? Given an argument, where p 1, p 2,, p n be the premises q be the conclusion he argument is validwhen (p 1 p 2 p n ) qis a tautology p 1 p 2 p n q When all premises are true, the conclusion should be true When not all premises are true, the conclusion can be either true or false p F F q F F p q F Focus on this case Check if it happens Chapter 1.5 & 1.6 6 Argument Example: p q p q Need to check if the conclusion is true or not Must be true If it rains, the floor is wet It rains he floor is wet ( p (p q) ) q p q F F F F p q F Argument is valid p (p q) F F F autology (p (p q)) q Rules of Inference How to show an argument is valid? ruth able May be tediouswhen the number of variables is large Rules of Inference Firstly establishthe validity of some relatively simple argument forms, called rules of inference hese rules of inference can be used as building blocks to construct more complicated valid argument forms Chapter 1.5 & 1.6 7 Chapter 1.5 & 1.6 8

Rules of Inference Modus Ponens Affirm by affirming q p p q Rules of Inference Hypothetical Syllogism p q q r p r Modus ollens Deny by denying q p q Disjunctive Syllogism p q p p q Chapter 1.5 & 1.6 9 Chapter 1.5 & 1.6 10 Rules of Inference Rules of Inference Addition Simplification p p q p q Resolution p = q = /F r = p =F q = r = /F p q p r q r Conjunction p p q p q Example I go to swim ori play tennis I do not go to swim or I play football herefore,i play tennis or I play football Chapter 1.5 & 1.6 11 Chapter 1.5 & 1.6 12

Rules of Inference ( ) Modus Ponens ((p q) (p)) q Modus ollens (( q) (p q)) p Hypothetical Syllogism ((p q) (q r)) (p r) Disjunctive Syllogism Addition Simplification Conjunction Resolution ((p q) ( p)) q (p) p q ((p) (q)) p ((p) (q)) (p q) ((p q) ( p r)) (q r) Chapter 1.5 & 1.6 13 Comparison between Inference and Equivalence Inference (p q) Meaning: If p, then q p qdoes notmean q p Either inference or equivalence rulescan be used p q implies p q is used in proof Equivalence (p q) Meaning: pis equal to q p q mean q p Only equivalence rules can be used p qcan be proved by showing p q and q p is used in proof Equivalence( )is a more restrictiverelation than Inference( ) Rules of Equivalence ( ) Recall Identify Laws Domination Laws Idempotent Laws Negation Laws Double Negation Law Commutative Laws Associative Laws Distributive Laws Absorption Laws De Morgan s Laws p p p F p p p F F p p p p p p p p p p F ( p) p p q q p p q q p p (q r) (p q) r p (q r) (p q) r p (q r) (p q) (p r) p (q r) (p q) (p r) p (p q) p p (p q) p (p q) p q (p q) p q Chapter 1.5 & 1.6 14 Using Rules of Inference Example 1: Given: It is not sunny this afternoon and it is colder than yesterday. We will go swimming only if it is sunny If we do not go swimming, then we will take a canoe trip If we take a canoe trip, then we will be home by sunset Can these propositions lead to the conclusion "We will be home by sunset? Chapter 1.5 & 1.6 15 Chapter 1.5 & 1.6 16

p q r p r s s t t Let p: It is sunny this afternoon q: It is colder than yesterday r: We go swimming s: We take a canoe trip t: We will be home by sunset It is notsunny this afternoon andit is colder than yesterday We will go swimming only ifit is sunny Ifwe do not go swimming, then we will take a canoe trip Ifwe take a canoe trip, then we will be home by sunset We will be home by sunset Using Rules of Inference Hypothesis: p q r p r s s t Conclusion: t Step Reason 1. p q Premise 2. p Simplification using (1) 3. r p Premise 4. r Modus tollens using (2) and (3) 5. r s Premise 6. s Modus ponens using (4) and (5) 7. s t Premise 8. t Modus ponens using (6) and (7) herefore, the propositions can lead to the conclusion We will be home by sunset Chapter 1.5 & 1.6 17 Chapter 1.5 & 1.6 18 Using Rules of Inference Or, another presentation method: Hypothesis: p q r p r s s t Conclusion: t ( p q) (r p) ( r s) (s t) p (r p) ( r s) (s t) r ( r s ) (s t) s (s t) t By Modus Ponens By Modus Ponens By Modus ollens By Simplification Small Exercise Given: If you send me an e-mail message, then I will finish writing the program If you do not send me an e-mail message, then I will go to sleep early If I go to sleep early, then I will wake up feeling refreshed Can these propositions lead to the conclusion "If I do not finish writing the program, then I will wake up feeling refreshed." Chapter 1.5 & 1.6 19 Chapter 1.5 & 1.6 20

p q p r r s q s Let p: you send me an e-mail message q: I will finish writing the program r: I will go to sleep early s: I will wake up feeling refreshed Ifyou send me an e-mail message, then I will finish writing the program Ifyou do notsend me an e-mail message, theni will go to sleep early IfI I go to sleep early, theni will wake up feeling refreshed IfI I do notfinish writing the program, then I will wake up feeling refreshed Small Exercise Hypothesis: p q p r r s Conclusion: q s Step Reason 1. p q Premise 2. q p Contrapositive of (1) 3. p r Premise 4. q r Hypothetical Syllogism using (2) and (3) 5. r s Premise 6. q s Hypothetical Syllogism using (4) and (5) herefore, the propositions can lead to the conclusion If I do not finish writing the program, then I will wake up feeling refreshed Chapter 1.5 & 1.6 21 Chapter 1.5 & 1.6 22 Small Exercise Or, another presentation method: Hypothesis: p q p r r s Conclusion: q s (p q) ( p r) (r s) ( q p) ( p r) (r s) ( q r) (r s) ( q s) By Hypothetical Syllogism Contrapositive By Hypothetical Syllogism Using Rules of Inference Fallacies Are the following arguments correct? Example 1(Fallacy of affirming the conclusion) Hypothesis If you success, you work hard You work hard Conclusion You success p q q Example 2(Fallacy of denying the hypothesis) Hypothesis If you success, you work hard p q You do not success p Conclusion You do not work hard q p Chapter 1.5 & 1.6 23 Chapter 1.5 & 1.6 24

Rules of Inference for Quantifiers Rules of Inference for Quantifiers Universal Instantiation x P(x) P(a) where ais a particular member of the domain Universal Generalization P(b) for an arbitrary b x P(x) Be noted that b that we select must be an arbitrary, and not a specific Existential Instantiation x P(x) P(c) for some element c Existential Generalization P(d) for some element d x P(x) Example 1 Given Everyone in this discrete mathematics class has taken a course in computer science Marla is a student in this class hese premises imply the conclusion "Marla has taken a course in computer science" Chapter 1.5 & 1.6 25 Chapter 1.5 & 1.6 26 Let DC(x): x studies in discrete mathematics CS(x): x studies in computer science Domain of x: student Everyone in this discrete x (DC(x) CS(x)) mathematics class has taken a course in computer science DC(Marla) CS(Marla) Marla is a student in this class Marla has taken a course in computer science Rules of Inference for Quantifiers Step Premise: x (DC(x) CS(x)) DC(Marla) Reason 1. x (DC(x) CS(x)) Premise 2. DC(Marla) CS(Marla) Universal Instantiation from (1) 3. DC(Marla) Premise Conclusion: CS(Marla) 4. CS(Marla) Modus ponens using (2) and (3) herefore, the propositions can lead to the conclusion Marla has taken a course in computer science Chapter 1.5 & 1.6 27 Chapter 1.5 & 1.6 28

Using Rules of Inference for Quantifiers Or, another presentation method: Premise: x (DC(x) CS(x)) DC(Marla) Conclusion: CS(Marla) x (DC(x) CS(x)) DC(Marla) By Universal Instantiation (DC(Marla) CS(Marla)) DC(Marla) Small Exercise Given A student in this class has not read the book Everyone in this class passed the first exam hese premises imply the conclusion "Someone who passed the first exam has not read the book" CS(Marla) By Modus ponens Chapter 1.5 & 1.6 29 Chapter 1.5 & 1.6 30 Let C(x): x in this class RB(x): x reads the book PE(x): x passes the first exam Domain of x: any person x (C(x) RB(x)) x (C(x) PE(x)) A student in this class has not read the book Everyonein this class passed the first exam Someonewho passed the first x (PE(x) RB(x)) exam has notread the book We cannot define the domain as student in this class since the conclusion means anyone Small Exercise Premise: x (C(x) RB(x)) x (C(x) PE(x)) Conclusion: x (PE(x) RB(x)) Step Reason 1. x (C(x) RB(x)) Premise 2. C(a) RB(a) Existential Instantiation from (1) 3. C(a) Simplification from (2) 4. x (C(x) PE(x)) Premise 5. C(a) PE(a) Universal Instantiation from (4) 6. PE(a) Modus ponens from (3) and (5) 7. RB(a) Simplification from (2) 8. PE(a) RB(a) Conjunction from (6) and (7) 9. x (PE(x) RB(x)) Existential Generalization from (8) herefore, the propositions can lead to the conclusion Someone who passed the first exam has not read the book Chapter 1.5 & 1.6 31 Chapter 1.5 & 1.6 32

Small Exercise Or, another presentation method: ( x (C(x) RB(x))) ( x (C(x) PE(x))) C(a) RB(a) ( x (C(x) PE(x))) C(a) RB(a) (C(a) PE(a)) PE(a) RB(a) x (PE(x) RB(x)) Premise: x (C(x) RB(x)) x (C(x) PE(x)) By Modus ponens By Existential Instantiation By Universal Instantiation By Existential Generalization Conclusion: x (PE(x) RB(x)) Chapter 1.5 & 1.6 33 Combining Rules of Inference he rules of inference of Propositions and Quantified Statements can be combined Universal Modus Ponens Universal Modus Ponens x(p(x) Q(x)) P(a),where a is a particular element in the domain Q(a) x(p(x) Q(x)) Q(a),where a is a particular element in the domain P(a) ( x(p(x) Q(x))) (P(a)) By Universal Instantiation (P(a) Q(a)) (P(a)) Q(a) By Modus Ponens ( x(p(x) Q(x))) ( Q(a)) By Universal Instantiation (P(a) Q(a)) ( Q(a)) P(a) By Modus ollens Chapter 1.5 & 1.6 34 Combining Rules of Inference Example: Given For all positive integers n, if n is greater than 4, then n 2 is less than 2 n is true. Showthat 100 2 < 2 100 Combining Rules of Inference Example: For allpositive integers n, ifn is greater than 4, thenn n 2 is less than 2 n n(p(n) Q(n)) P(100) (since 100 > 4) P(n): n > 4 Q(n): n 2 < 2 n Q(100) (100 2 < 2 100 ) By Universal Modus Ponens Chapter 1.5 & 1.6 35 Chapter 1.5 & 1.6 36

Summary What we have learnt in previous lectures? Proposition Operator Predicates Quantifier ruth able Rules of Equivalence Rules of Inference Show if an argument is valid Informal Proofs Informal proofscan often explainto humans why theorems are true Proof of mathematical theorems Applications to computer science Movefrom formal proofstoward more informal proofs his is called the formal proof very clearand precise extremely longand hard to follow Chapter 1.5 & 1.6 37 Chapter 1.5 & 1.6 38 Informal Proofs In practice, the proofs of theoremsdesigned for human consumption are almost always informal proofs More than one ruleof inference may be used in each step Stepsmay be skipped he axioms being assumed e.g. even number can be written as 2k, where k is integer he rulesof inference used are not explicitly stated Proof for heorems ypes of heorem Implication (P(x) Q(x)) Equivalence (P(x) Q(x)) Statement (P(x)) ype of proof Universal Quantification (For all...) Existential Quantification (For some...) Uniqueness Quantification (Only one...) Chapter 1.5 & 1.6 39 Chapter 1.5 & 1.6 40

Universal Quantification Proof for heorems: Methods Implication (P(x) Q(x)) Direct Proof Assume P(x) is true, show Q(x) is true Indirect Proof: Proof by Contraposition Assume Q(x) is true and show P(x) is true Universal Quantification: Proof of heorems: Implication Direct Proof Direct proofslead from the hypothesisof a theorem to the conclusion 1. Assume the premises are true 2. Show the conclusion is true Equivalence(P(x) Q(x)) As P(x) Q(x) (P(x) Q(x)) (Q(x) P(x)) Statement(P(x)) Indirect Proof: Proof by Contradiction Assume premise are true p 1 p 1 p n q show Chapter 1.5 & 1.6 41 Chapter 1.5 & 1.6 42 Universal Quantification: Proof of heorems: Implication Direct Proof: Example 1 Prove If nis an odd integer, then n 2 is odd Given, he integer n is even if there exists an integer ksuch that n = 2k he integer n is odd if there exists an integer ksuch that n = 2k+1 Show If nis an odd integer, then n 2 is odd 1. Assume the hypothesis is true n is odd is true By definition, n = 2k + 1, where k is a integer 2. Show the conclusion is correct n 2 is odd n 2 =(2k + 1) 2 =4k 2 + 4k + 1 =2(2k 2 + 2k) + 1 By definition, as (2k 2 + 2k)is an integerwe can conclude that n 2 is an odd integer herefore, if n is an odd integer, then n 2 is an odd integer has been proved Chapter 1.5 & 1.6 43 Chapter 1.5 & 1.6 44

Universal Quantification: Proof of heorems: Implication Direct Proof: Example 2 Prove If m and n are both perfect squares, then nm is also a perfect square Given An integer ais a perfect square if there is an integer bsuch that a = b 2 Show If m and n are both perfect squares, then nm is also a perfect square 1.Assume m andnare both perfect squares By definition, m = a 2 and n = b 2, where a and bare integers 2.Show thatmn is a perfect square mn = a 2 b 2 = (ab) 2, where abis an integer By the definition, we can conclude that mn is a perfect square herefore, An integer a is a perfect square if there is an integer b such that a = b 2 has been proved Chapter 1.5 & 1.6 45 Chapter 1.5 & 1.6 46 Universal Quantification: Proof of heorems: Implication Direct Proof: Example 3 Prove if n is an integer and 3n + 2 is odd, then n is odd Assume 3n + 2is an oddinteger 3n + 2 = 2k + 1for some integer k Show that n is odd 3n + 2 = 2k + 1 3n = 2k -1 n = 2k -1 3 Chapter 1.5 & 1.6 47 Universal Quantification: Proof of heorems: Implication Indirect Proof Sometimes, direct proofsmay reach dead ends Indirect proof may help Prove theorems not directly Do not start with the hypothesisand end with the conclusion Chapter 1.5 & 1.6 48

Universal Quantification: Proof of heorems: Implication: Indirect Proof Proof by Contraposition Recall, contrapositive: p q q p p qcan be proved by showing q pis true 1. Assume the conclusion is not true 2. Show either one premises is not true (p 1 p 2 p n ) q q (p 1 p 2 p n ) q ( p 1 p 2 p n ) Universal Quantification: Proof of heorems: Implication: Indirect Proof Proof by Contraposition: Example 1 Prove if n is an integer and 3n + 2 is odd, then n is odd 1. Assume the conclusion is false n is not odd n = 2k, where kis an integer 2.Show that the premises are not correct 3n + 2 is not odd 3 (2k) + 2 = 6k + 2 = 2(3k + 2) q p As if n is not odd, 3n + 2 is not odd herefore, if n is an integer and 3n + 2 is odd, then n is odd Chapter 1.5 & 1.6 49 Chapter 1.5 & 1.6 50 Universal Quantification: Proof of heorems: Implication: Indirect Proof Proof by Contraposition: Example 2 Prove if n = ab, where a and b are positive integers, then a n or b n 1.Assume a > n and b > n is true 2.Show n ab ab > ( n) 2 = n herefore, ab n herefore, if n = ab, where a and b are positive integers, then a n or b n Small Exercise Prove that the sum of two rational numbers is rational Given he real number r is rationalif there exist integers pand qwith q 0such that r = p / q A real number that is not rationalis called irrational Chapter 1.5 & 1.6 51 Chapter 1.5 & 1.6 52

Small Exercise Direct Proof Suppose that r and s are rational numbers r = p / q, s = t / u, where q 0and u 0 Show that r+s is rational number p t pu + qt r + s = q + u = qu Asq 0and u 0, qu 0 herefore, r + s is rational herefore, direct proof succeeded Small Exercise Prove if n is an integer and n 2 is odd, then n is odd Direct proof Suppose that n is an integer and n 2 is odd Exists an integer ksuch that n 2 = 2k + 1 Show n is odd Show (n = ± 2k + 1)is odd May not be useful Chapter 1.5 & 1.6 53 Chapter 1.5 & 1.6 54 Small Exercise Proof by contraposition Suppose n is not odd n = 2k, where kis an integer Show n 2 is not even n 2 = (2k) 2 = 4k 2 n 2 is even herefore, proof by contraposition succeeded Universal Quantification Proof of heorems: Equivalence Recall, p q (p q) (q p) o prove equivalence, we can showp q and q p areboth true Chapter 1.5 & 1.6 55 Chapter 1.5 & 1.6 56

Universal Quantification: Methods of Proving heorems Equivalence: Example Prove If n is a positive integer, then n is odd if and only ifn 2 is odd wo steps 1.If n is a positive integer, ifn is odd,thenn 2 is odd 2.If n is a positive integer, ifn 2 is odd,thenn is odd herefore, it is true (shown in slides 43) (shown in slides 54) Universal Quantification Proof of heorems: Equivalence How to show p 1, p 2, p 3 and p 4 are equivalence? p 1 p 2 p 1 p 3 p 1 p 4 p 2 p 3 p 2 p 4 p 3 p 4 Not necessary p 1 p 2 p 3 E.g. if p 1 p 2 and p 2 p 3, then p 4 p 1 p 3 Chapter 1.5 & 1.6 57 Chapter 1.5 & 1.6 58 Universal Quantification Proof of heorems: Equivalence p 1 p 2 p 3 p n When proving a group of statements are equivalent, any chain of conditional statementscan established as long as it is possible to work through the chain to go from anyone of these statements to any other statement p 1 p 1 p 1 p2 p2 p 2 p 3 p 4 p 3 p 4 p 3 p 4 Universal Quantification: Methods of Proving heorems Statement: Example Can you prove You love me? p q If you love me, you will buy me iphone5 What does it mean if you 1. Buy iphone 2. Do not buy iphone q p q p Prove nothing How? rap?? Chapter 1.5 & 1.6 59 Chapter 1.5 & 1.6 60

Universal Quantification: Methods of Proving heorems Statement: Example (Correct) Can you prove You love me? If you do not love me, you will not buy me iphone5 What does it mean if you 1. Buy iphone 2. Do not buy iphone q Prove nothing p q p How? p q Universal Quantification: Methods of Proving heorems: Statement Proof by Contradiction By using Proof by Contradiction, If you want to show p is true, you need: p q is true q is false P Q P Q F F F F F Recall, Proof by Contradiction of p q is p q Chapter 1.5 & 1.6 61 Chapter 1.5 & 1.6 62 Universal Quantification: Methods of Proving heorems: Statement Proof by Contradiction Procedures of Proof by Contradictionto prove p is correct: 1. Understand the meaning of p 2. Find out what p implies ( p qis true) 3. Showthat q is not correct Universal Quantification: Methods of Proving heorems: Statement Proof by Contradiction: Example 1 Prove 2 is irrational 1. Understand the meaning of p 2 is rational Not if then format Only one statement 2. Find out what p implies If 2 is rational, there exist integers p and q with 2 = p / q, where pand qhave no common factors So that the fraction p / qis in lowest terms 3. Show that q is not correct Show there exist integers p and q with 2 = p / q is not true Chapter 1.5 & 1.6 63 Chapter 1.5 & 1.6 64

Show there exist integers p and q with 2 = p / q is not true 2 = p / q, where q 0 2q 2 = p 2 p 2 is an even number If p 2 is even, so p = 2a, and a is an integer q is also even 2q 2 = 4a 2 q 2 = 2a 2 As p and q are even, they have a common factor 2, which leads the contradiction herefore, 2 is irrational is true Chapter 1.5 & 1.6 65 Universal Quantification: Methods of Proving heorems: Statement Proof by Contradiction: Example 2 Show that at least four of any 22 days must fall on the same day of the week. Chapter 1.5 & 1.6 66 Let p: "At least four of 22 chosen days fall on the same day of the week." 1. Understand the meaning of p At most three of 22 chosen days fall on the same dayof the week 2. Find out what p implies As at most three day fall on the same week day, therefore a week should have at least 22 / 3 days 3. Show that q is not correct A week only has 7 days, therefore, q is not correct herefore, p is correct Universal Quantification: Methods of Proving heorems: Statement Proof by Contradiction Proof by Contradictioncan also be used to show P(x) Q(x) Let S(x) : P(x) Q(x) and prove S(x) is correct S(x) : P(x) Q(x) S(x) (P(x) Q(x))is true P(x) Q(x)is false S(x) = (P(x) Q(x)) = ( P(x) Q(x)) = P(x) Q(x) Chapter 1.5 & 1.6 67 Chapter 1.5 & 1.6 68

Universal Quantification: Methods of Proving heorems: Statement Proof by Contradiction: Example 3 Show "If 3n + 2 is odd, then n is odd Be noted that proof by contraposition can be used (shown in slide 50) Let P(n): Q(3n+2) Q(n), where Q(n) : n is odd P(n) implies: P(n) (Q(3n+2) Q(n)) ( Q(3n+2) Q(n)) Q(3n+2) Q(n) Universal Quantification: Methods of Proving heorems: Statement Proof by Contradiction: Example 3 P(n) implies Q(3n+2) Q(n) Q(n) imply n is even, n = 2k, where kis integer 3n+2 = 3(2k)+2 = 2(3k+1) herefore, 3n+2 is even ( Q(3n+2)) Q(3n+2) Q(3n+2) is false herefore, P(n) must be false herefore, Q(3n+2) Q(n) is true Chapter 1.5 & 1.6 69 Chapter 1.5 & 1.6 70 Universal Quantification Exhaustive Proof and Proof by Cases Sometimes, a theorem cannot be proved easily using a single argument that holds for all possible cases Rather than considering (p q) directly, we can consider different cases separately his argument is named Proof by Cases: (p 1 p 2 p n ) q Universal Quantification Exhaustive Proof Exhaustive Proofs Prove all the possibilities Example Prove that (n + 1) 3 > 3 n if n is a positive integer with n 4 Prove all the possibilities: n = 1, 2, 3 and 4 [(p 1 q) (p 2 q)... (p n q)] E.g. x 2 0, we can x < 0, x = 0 and x > 0 Chapter 1.5 & 1.6 71 Chapter 1.5 & 1.6 72

Universal Quantification Exhaustive Proof: Example 1 Prove that (n + 1) 3 3 n if nis a positive integer with n 4 When n = 1 When n = 2 LHS: (n + 1) 3 = 8 RHS: 3 n = 3 LHS > RHS When n = 3 When n = 4 LHS: (n + 1) 3 = 64 RHS: 3 n = 27 LHS > RHS herefore, (n + 1) 3 > 3 n is valid LHS: (n + 1) 3 = 27 RHS: 3 n = 9 LHS > RHS LHS: (n + 1) 3 = 125 RHS: 3 n = 81 LHS > RHS Universal Quantification Exhaustive Proof: Example 2 Given An integer is a perfect powerif it equals n a, where ais an integer greater than 1 Prove that the only consecutive positive integers not exceeding 100that are perfect powersare 8 and 9 By exhaustive proof, list all the perfect powers not exceeding 100 n=1 2 3 4 5 6 7 8 9 10 a=2 1 4 9 16 25 36 49 64 81 100 3 1 8 27 64 4 1 32 81 5 1 64 >5 1 herefore, only 8 and 9 are consecutive Chapter 1.5 & 1.6 73 Chapter 1.5 & 1.6 74 Universal Quantification Proof by Cases Drawbackof Exhaustive Proofsis to check only a relatively small numberof instances of a statement Proof by Cases Prove all situations Example Prove that if n is an integer, then n 2 > n Prove all the situations: n is positive, equal and negative Universal Quantification Proof by Cases: Example 1 Prove that if n is an integer, then n 2 n When n 1 n 2 = n x n n x 1 = n, therefore n 2 n When n = 0 n 2 = n = 0, therefore, n 2 = n When n -1 n 2 > 0 and n < 0, therefore n 2 n herefore, this theorem is valid Chapter 1.5 & 1.6 75 Chapter 1.5 & 1.6 76

Universal Quantification Proof by Cases: Example 2 Use a proof by cases to show that x y = x y, where x and y are real numbers (Recall a = a, when a 0; a = -awhen a < 0) When x 0 and y 0 When x <0 and y 0 xy = x y = x y xy = -xy = (-x) (y)= x y When x 0 and y <0 When x <0 and y <0 xy = -x y= (x) (-y)= x y xy = xy= (-x) (-y)= x y Existence Proofs We will focus on the theorems which are assertions that objects of a particular type exist( ) A theorem of this type is a proposition of the form x P(x), where Pis a predicate he proof of this proposition is Existence Proof By finding an element a such that P(a) is true herefore, this theorem is valid Chapter 1.5 & 1.6 77 Chapter 1.5 & 1.6 78 Existence Proofs Example: Show that there is a positive integerthat can be written as the sum of cubes of positive integers in two different ways After considerable computation (such as a computer search), we find that 1729= 10 3 + 9 3 = 12 3 + 1 3 An example is given, the proof is done Uniqueness Proof he theorems which assert the existence of a unique element with a particular property will be discussed he two parts of a uniqueness proof are: Existence (An element with the property exists) Show that an element x with the property exists Uniqueness(No other element has this property) Show that if y x, y does not have the property. Equivalently, we can show that if x and y both have the desired property, then x = y x (P(x) y( P(y) (y = x) ) ) Existence Uniqueness Chapter 1.5 & 1.6 79 Chapter 1.5 & 1.6 80

Uniqueness Proof: Example Show that if a and b are real numbers and a 0, then there is a unique real number rsuch that ar + b = 0 Existence Part he real number t = -b / ais a solution of ar + b = 0 because a(-b/a) + b = -b + b = 0 Consequently, a real number t exists for which at + b = 0 Uniqueness Part Suppose that sis a real number such that as + b = 0 at+ b = as+ b at= as t= s his means that if s t, then as + b 0 tis b/ a ais nonzero ips DO NO over simplify the proof Obviously" or "clearly in proofs indicate that steps have been omittedthat the author expects the reader to be able to fill in Unfortunately, this assumption is often not warranted We will assiduously try to avoid using these wordsand try not to omit too many steps However, if we included all stepsin proofs, our proofs would often be too long Chapter 1.5 & 1.6 81 Chapter 1.5 & 1.6 82