CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.

Slides:



Advertisements
Similar presentations
Discrete Math Methods of proof 1.
Advertisements

Introduction to Proofs
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
22C:19 Discrete Structures Logic and Proof Spring 2014 Sukumar Ghosh.
Logic and Proof. Argument An argument is a sequence of statements. All statements but the first one are called assumptions or hypothesis. The final statement.
CSE115/ENGR160 Discrete Mathematics 01/31/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/01/11
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic Autumn 2011 CSE 3111.
Copyright © Zeph Grunschlag,
First Order Logic (chapter 2 of the book) Lecture 3: Sep 14.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 12 Number theory Mathematical induction Proof by induction Examples.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2.1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Introduction to Proofs ch. 1.6, pg. 87,93 Muhammad Arief download dari
Mathematical Induction Assume that we are given an infinite supply of stamps of two different denominations, 3 cents and and 5 cents. Prove using mathematical.
First Order Logic. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Methods of Proof & Proof Strategies
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Introduction to Proofs
Reading and Writing Mathematical Proofs
MATH 224 – Discrete Mathematics
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
Proofs1 Elementary Discrete Mathematics Jim Skon.
CSci 2011 Discrete Mathematics Lecture 6
CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
1 Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2011 Suprakash Datta Office: CSEB 3043 Phone: ext
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
Induction Proof. Well-ordering A set S is well ordered if every subset has a least element. [0, 1] is not well ordered since (0,1] has no least element.
Chap 3 –A theorem is a statement that can be shown to be true –A proof is a sequence of statements to show that a theorem is true –Axioms: statements which.
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.
First Order Logic Lecture 3: Sep 13 (chapter 2 of the book)
22C:19 Discrete Structures Logic and Proof Fall 2014 Sukumar Ghosh.
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2012 CSE
CSci 2011 Discrete Mathematics Lecture 5 CSci 2011.
Chapter 1, Part III: Proofs With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Foundations of Computing I CSE 311 Fall Announcements Homework #2 due today – Solutions available (paper format) in front – HW #3 will be posted.
Lecture 2: Proofs and Recursion. Lecture 2-1: Proof Techniques Proof methods : –Inductive reasoning Lecture 2-2 –Deductive reasoning Using counterexample.
Chapter 1 Logic and Proof.
The Foundations: Logic and Proofs
CSE15 Discrete Mathematics 02/01/17
CSE 311 Foundations of Computing I
Advanced Algorithms Analysis and Design
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
Predicate Calculus Validity
Chapter 1: The Foundations: Logic and Proofs
CSE 311: Foundations of Computing
The Foundations: Logic and Proofs
CSE 311 Foundations of Computing I
CSE 311: Foundations of Computing
CS 220: Discrete Structures and their Applications
First Order Logic Rosen Lecture 3: Sept 11, 12.
Section 2.1 Proof Techniques Introduce proof techniques:   o        Exhaustive Proof: to prove all possible cases, Only if it is about a.
Negations of quantifiers
This Lecture Substitution model
Introduction to Proofs
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Presentation transcript:

CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs

Review: proofs Start with hypotheses and facts Use rules of inference to extend set of facts Result is proved when it is included in the set Fact 1 Fact 2 Hypothesis 3 Hypothesis 2 Hypothesis 1 Statement Result

Review: Modus Ponens If p and p  q are both true then q must be true Write this rule as Given: – If it is Wednesday then you have a 311 class today. – It is Wednesday. Therefore, by modus ponens: – You have a 311 class today. p, p  q ∴ q

Review: Inference Rules Each inference rule is written as:...which means that if both A and B are true then you can infer C and you can infer D. – For rule to be correct (A  B)  C and (A  B)  D must be a tautologies Sometimes rules don’t need anything to start with. These rules are called axioms: – e.g. Excluded Middle Axiom A, B ∴ C,D ∴ p  p

Review: Propositional Inference Rules Excluded middle plus two inference rules per binary connective, one to eliminate it and one to introduce it p  q ∴ p, q p, q ∴ p  q p ∴ p  q, q  p p  q,  p ∴ q p, p  q ∴ q p  q ∴ p  q Direct Proof Rule Not like other rules

Example:1. p assumption 2. p  q intro for  from 1 3. p  (p  q) direct proof rule Review: Direct Proof of an Implication p  q denotes a proof of q given p as an assumption The direct proof rule: If you have such a proof then you can conclude that p  q is true proof subroutine

Review: Proofs using the Direct Proof Rule Show that p  r follows from q and (p  q)  r 1. q given 2. (p  q)  r given 3. p assumption 4. p  q from 1 and 3 via Intro  rule 5. r modus ponens from 2 and 4 6. p  r direct proof rule

Inference rules for quantifiers ∴  x P(x)  x P(x) ∴  x P(x)  x P(x) * in the domain of P P(c) for some c ∴ P(a) for any a “ Let a be anything * ”...P(a) ∴ P(c) for some special** c ** By special, we mean that c is a name for a value where P(c) is true. We can’t use anything else about that value, so c has to be a NEW variable!

Proofs using Quantifiers “There exists an even prime number” First, we translate into predicate logic:  x (Even(x)  Prime(x)) 1. Even(2) Fact (math) 2.Prime(2) Fact (math) 3.Even(2)  Prime(2) Intro  : 1, 2 4.  x (Even(x)  Prime(x)) Intro  3

Proofs using Quantifiers 1. Even(2) Fact* (math) 2.Prime(2) Fact* (math) 3.Even(2)  Prime(2) Intro  : 1, 2 4.  x (Even(x)  Prime(x)) Intro  : 3 Those first two lines are sort of cheating; we should prove those “facts”. Prime(x): x is an integer > 1 and x is not a multiple of any integer strictly between 1 and x Even(x)   y (x=2y) 1.2 = 2*1 Definition of Multiplication 2.Even(2) Intro  1 3.There are no integers between 1 and 2 Definition of Integers 4.2 is an integerDefinition of 2 5.Prime(2)Intro  : 3, 4

Proofs using Quantifiers Prime(x): x is an integer > 1 and x is not a multiple of any integer strictly between 1 and x Even(x)   y (x=2y) 1. 2 = 2*1 Definition of Multiplication 2. Even(2) Intro  : 1 3. There are no integers between 1 and 2 Definition of Integers 4. 2 is an integerDefinition of 2 5. Prime(2)Intro  : 3, 4 6. Even(2)  Prime(2) Intro  : 2, 5 7.  x (Even(x)  Prime(x)) Intro  : 7 Note that 2 = 2*1 by definition of multiplication. It follows that there is a y such that 2 = 2y; so, 2 is even. Furthermore, 2 is an integer, and there are no integers between 1 and 2; so, by definition of a prime number, 2 is prime. Since 2 is both even and prime,  x (Even(x)  Prime(x)).

Even and Odd Prove: “The square of every even number is even.” Formal proof of:  x (Even(x)  Even(x 2 )) Even(x)   y (x=2y) Odd(x)   y (x=2y+1) Domain: Integers

Even and Odd Prove: “The square of every even number is even.” Formal proof of:  x (Even(x)  Even(x 2 )) Even(x)   y (x=2y) Odd(x)   y (x=2y+1) Domain: Integers

Even and Odd Prove: “The square of every odd number is odd.” English proof of:  x (Odd(x)  Odd(x 2 )) Let x be an odd number. Then x=2k+1 for some integer k (depending on x) Therefore x 2 =(2k+1) 2 = 4k 2 +4k+1=2(2k 2 +2k)+1. Since 2k 2 +2k is an integer, x 2 is odd. Even(x)   y (x=2y) Odd(x)   y (x=2y+1) Domain: Integers

Counterexamples To disprove  x P(x) find a counterexample: – some c such that  P(c) – works because this implies  x  P(x) which is equivalent to  x P(x)

Proof by Contrapositive: another strategy for implications If we assume  q and derive  p, then we have proven  q   p, which is the same as p  q. 1.  q Assumption  p 4.  q   p Direct Proof Rule 5. p  qContrapositive

Proof by Contradiction: one way to prove  p If we assume p and derive F (a contradiction), then we have proven  p. 1. p assumption F 4. p  F direct Proof rule 5.  p  F equivalence from 4 6.  p equivalence from 5

Even and Odd Prove: “No integer is both even and odd.” English proof:   x (Even(x)  Odd(x))  x  (Even(x)  Odd(x)) We go by contradiction. Let x be any integer and suppose that it is both even and odd. Then x=2k for some integer k and x=2m+1 for some integer m. Therefore 2k=2m+1 and hence k=m+½. But two integers cannot differ by ½ so this is a contradiction. So, no integer is both even an odd. Even(x)   y (x=2y) Odd(x)   y (x=2y+1) Domain: Integers

Rational Numbers A real number x is rational iff there exist integers p and q with q  0 such that x=p/q. Prove: – If x and y are rational then xy is rational – If x and y are rational then x+y is rational Rational(x)   p  q ((x=p/q)  Integer(p)  Integer(q)  q  0)

Rational Numbers A real number x is rational iff there exist integers p and q with q  0 such that x=p/q. Prove: If x and y are rational then xy is rational Domain: Real numbers Rational(x)   p  q ((x=p/q)  Integer(p)  Integer(q)  q  0)  x  y ((Rational(x)  Rational(y))  Rational(xy))

Rational Numbers A real number x is rational iff there exist integers p and q with q  0 such that x=p/q. Prove: – If x and y are rational then xy is rational – If x and y are rational then x+y is rational – If x and y are rational then x/y is rational Rational(x)   p  q ((x=p/q)  Integer(p)  Integer(q)  q  0)

Proofs Formal proofs follow simple well-defined rules and should be easy to check – In the same way that code should be easy to execute English proofs correspond to those rules but are designed to be easier for humans to read – Easily checkable in principle Simple proof strategies already do a lot – Later we will cover a specific strategy that applies to loops and recursion (mathematical induction)