CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.

Slides:



Advertisements
Similar presentations
Introduction to Proofs
Advertisements

Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Copyright © Cengage Learning. All rights reserved.
Sets Lecture 11: Oct 24 AB C. This Lecture We will first introduce some basic set theory before we do counting. Basic Definitions Operations on Sets Set.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
(CSC 102) Discrete Structures Lecture 14.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
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,
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Introduction to Proofs ch. 1.6, pg. 87,93 Muhammad Arief download dari
EE1J2 – Discrete Maths Lecture 5 Analysis of arguments (continued) More example proofs Formalisation of arguments in natural language Proof by contradiction.
1 Number Theory and Methods of Proof Content: Properties of integer, rational and real numbers. Underlying theme: Methods of mathematical proofs.
SETS A set B is a collection of objects such that for every object X in the universe the statement: “X is a member of B” Is a proposition.
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.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Methods of Proof & Proof Strategies
Introduction to Proofs
MATH 224 – Discrete Mathematics
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
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.
CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
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.
DISCRETE COMPUTATIONAL STRUCTURES
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.
CS201: Data Structures and Discrete Mathematics I
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
CompSci 102 Discrete Math for Computer Science
Section 3.3: Mathematical Induction Mathematical induction is a proof technique that can be used to prove theorems of the form:  n  Z +,P(n) We have.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
Mathematical Preliminaries
2.1 Sets 2.2 Set Operations –Set Operations –Venn Diagrams –Set Identities –Union and Intersection of Indexed Collections 2.3 Functions 2.4 Sequences and.
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.
Chapter 2 With Question/Answer Animations. Section 2.1.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
CSE 311 Foundations of Computing I Lecture 10 Set Theory Autumn 2012 Autumn 2012CSE
CS104:Discrete Structures Chapter 2: Proof Techniques.
1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes.
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
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Foundations of Computing I CSE 311 Fall Announcements Homework #2 due today – Solutions available (paper format) in front – HW #3 will be posted.
CSE 311: Foundations of Computing Fall 2013 Lecture 9: Set theory and functions.
The Foundations: Logic and Proofs
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
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
Negations of quantifiers
CSE 321 Discrete Structures
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
CSE 321 Discrete Structures
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Presentation transcript:

CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory

announcements Reading assignment – Logical inference th Edition th Edition – Set theory (both editions)

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: an inference rule--- 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: simple 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

review: 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

review: proofs using quantifiers “There exists an even prime number” Prime(x): x is an integer > 1 and x is not a multiple of any integer strictly between 1 and 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

proof by contradiction: one way to prove  p If we assume p and derive False (a contradiction), then we have proved  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 number is both even and odd.” English proof:   x (Even(x)  Odd(x))  x  (Even(x)  Odd(x)) Let x be any integer and suppose that it is both even and odd. Then x=2k for some integer k and x=2n+1 for some integer n. Therefore 2k=2n+1 and hence k=n+½. But two integers cannot differ by ½ so this is a contradiction. 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 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 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 – 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)

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)

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)

set theory Formal treatment dates from late 19 th century Direct ties between set theory and logic Important foundational language

definition: a set is an unordered collection of objects x  A : “x is an element of A” “x is a member of A” “x is in A” x  A :  (x  A) /

definitions A and B are equal if they have the same elements A is a subset of B if every element of A is also in B A = B   x (x  A  x  B) A  B   x (x  A  x  B)

empty set and power set

cartesian product

set operations union intersection set difference symmetric difference complement

it’s Boolean algebra again Definition for  based on  Definition for  based on  Complement works like 

De Morgan’s Laws Proof technique: To show C = D show x  C  x  D and x  D  x  C

distributive laws C AB C AB