CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring 2013 1.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
(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.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic Autumn 2011 CSE 3111.
Sets 1.
Sets 1.
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.
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Methods of Proof & Proof Strategies
Introduction to Proofs
Reading and Writing Mathematical Proofs
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 03: PROOFS Section 1.5 Jarek Rossignac CS1050: Understanding.
MATH 224 – Discrete Mathematics
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
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} =
Reading and Writing Mathematical Proofs Spring 2015 Lecture 4: Beyond Basic Induction.
DISCRETE COMPUTATIONAL STRUCTURES
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
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
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 With Question/Answer Animations. Section 2.1.
Snick  snack Supplement: Worked Set Proofs Based on work by Meghan Allen.
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
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Review 2 Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by lower.
Basic Definitions of Set Theory Lecture 24 Section 5.1 Fri, Mar 2, 2007.
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
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
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
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.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
The Foundations: Logic and Proofs
CSE 311 Foundations of Computing I
Week 7 - Monday CS322.
Chapter 1: The Foundations: Logic and Proofs
CSE 311 Foundations of Computing I
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Chapter 1 The Foundations: Logic and Proofs
Set Operations Section 2.2.
The Foundations: Logic and Proofs
CSE 311 Foundations of Computing I
CSE 311: Foundations of Computing
CS 220: Discrete Structures and their Applications
MA/CSSE 474 More Math Review Theory of Computation
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 311: Foundations of Computing
CSE 321 Discrete Structures
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Presentation transcript:

CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring

Announcements Reading assignments – Logical Inference 1.6, th Edition 1.5, th Edition – Set Theory th and 7 th Editions Homework – Graded HW 1: If you didn’t pick it up yesterday you can get it now. If you did then please return it for recording. Good News: High scores Bad News: No feedback – HW 2 due now – HW 3 out later today 2

Review…Simple Propositional Inference Rules Excluded middle plus two inference rules per binary connective, one to eliminate it and one to introduce it 3 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 ∴ p  p Direct Proof Rule Not like other rules! See next slide…

Inference Rules for Quantifiers 4 P(c) for some c ∴  x P(x)  x P(x) ∴ P(a) for any a “Let a be anything * ”...P(a) ∴  x P(x)  x P(x) ∴ P(c) for some special c * in the domain of P

Important: Applications of Inference Rules You can use equivalences to make substitutions of any subformula Inference rules only can be applied to whole formulas (not correct otherwise). e.g. 1. p  q Given 2. (p  r)  q Intro  from 1. 5 Does not follow! e.g p=F, q=F, r=T

General Proof Strategy 1.Look at the rules for introducing connectives to see how you would build up the formula you want to prove from pieces of what is given 2.Use the rules for eliminating connectives to break down the given formulas so that you get the pieces you need in 1. 3.Write the proof beginning with what you figured out for 2 followed by 1. 6

Example Prove  x (P(y)  Q(x)))  (P(y)  x Q(x)) where x is not a free variable in P(y) 7

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

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. 9 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 10

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. 11 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 12 Rational(x)   p  q ((x=p/q)  Integer(p)  Integer(q)  q  0)  x  y ((Rational(x)  Rational(y))  Rational(xy)) Domain: Real numbers

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 13 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 14 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) 15

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) 16

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

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) / 18

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) 19

Empty Set and Power Set Empty set ∅ does not contain any elements Power set of a set A = set of all subsets of A (A)  { B  B  A} 20

Cartesian Product : A  B A  B = { (a, b) | a  A  b  B} 21

Set operations A  B = { x | (x  A)  (x  B) } A  B = { x | (x  A)  (x  B) } A  B = { x | (x  A)  (x  B) } A - B = { x | (x  A)  (x  B) } A = { x | x  A } (with respect to universe U) _ / / union intersection set difference symmetric difference complement 22

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

De Morgan’s Laws A  B = A  B A  B = A  B Proof technique: To show C = D show x  C  x  D and x  D  x  C A B 24

Distributive Laws A  (B  C) = (A  B)  (A  C) A  (B  C) = (A  B)  (A  C) C AB C AB 25