Lesson 5 Relations, mappings, countable and uncountable sets

Slides:



Advertisements
Similar presentations
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Advertisements

© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 10 Cardinality Uncountability of the real numbers.
Discrete Structures Chapter 5 Relations and Functions Nurul Amelina Nasharuddin Multimedia Department.
CSE115/ENGR160 Discrete Mathematics 02/22/11 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/21/12
2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/L5- CountingAndEnumeration.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul.
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
Chapter 7 Functions Dr. Curry Guinn. Outline of Today Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The.
Cardinality of Sets Section 2.5.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Relation, function 1 Mathematical logic Lesson 5 Relations, mappings, countable and uncountable sets.
Introduction to Logic1 Introduction to Logic 3. lecture Propositional Logic Continuing Marie Duží.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
1st-order Predicate Logic (FOL)
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
1 Lecture 3 (part 3) Functions – Cardinality Reading: Epp Chp 7.6.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Mathematical Induction
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
Relations, Functions, and Countability
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
CompSci 102 Discrete Math for Computer Science
Sets. Definitions (I) Collection of elements such that: There are no duplicates There is no order Special sets Universe (U or E): all elements under consideration.
Mathematical Preliminaries
Introduction to Real Analysis Dr. Weihu Hong Clayton State University 8/27/2009.
Basic Structures: Sets, Functions, Sequences, and Sums.
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.
Review 2 Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by lower.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
CS 285- Discrete Mathematics
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Section 2.5. Cardinality Definition: A set that is either finite or has the same cardinality as the set of positive integers (Z + ) is called countable.
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.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Chapter 0 Discrete Mathematics 1. A collection of objects called elements; no repetition or order. A = {a 1, …, a n } or {a 1, a 2, …} N = {0, 1, 2, …}{1,
Sequences Lecture 11. L62 Sequences Sequences are a way of ordering lists of objects. Java arrays are a type of sequence of finite size. Usually, mathematical.
ICS 253: Discrete Structures I
Review: Discrete Mathematics and Its Applications
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
The Foundations: Logic and Proofs
Discrete Mathematics CS 2610
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
2.4 Sequences and Summations
Cardinality of Sets Section 2.5.
Review 2.
Lecture 7 Functions.
Discrete Structures for Computer Science
CSE15 Discrete Mathematics 02/27/17
The Foundations: Logic and Proofs
Logics for Data and Knowledge Representation
Lesson 5 Relations, mappings, countable and uncountable sets
A Brief Summary for Exam 1
1st-order Predicate Logic (FOL)
Review: Discrete Mathematics and Its Applications
ICS 253: Discrete Structures I
Applied Discrete Mathematics Week 3: Sets
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Foundations of Discrete Mathematics
Cardinality Definition: The cardinality of a set A is equal to the cardinality of a set B, denoted |A| = |B|, if and only if there is a one-to-one correspondence.
1st-order Predicate Logic (FOL)
Presentation transcript:

Lesson 5 Relations, mappings, countable and uncountable sets Mathematical logic Lesson 5 Relations, mappings, countable and uncountable sets 17.1.2019 Relation, function

Relation Relation between sets A, B is a subset of the Cartesian product A  B. Cartesian product A  B is a set of all ordered pairs a, b, where aA, bB (Binary) relation R2 on a set M is a subset of M  M: R2  M  M n-ary relation Rn on a set M: Rn  M ... M n times 17.1.2019 Relation, function

Relation Mind: A couple a,b  b,a, but a set {a,b} = {b,a} a, a  a, but {a,a} = {a} n-tuples are ordered, particular elements of tuples do not have to be unique (can be repeated), unlike sets Notation: a,b  R is written also in the prefix R(a,b) or infix way a R b. For instance 1  3. 17.1.2019 Relation, function

Relation - Example: Binary relation on the set of natural numbers N: < (strictly less than) {0,1,0,2,0,3,…,1,2,1,3, 1,4, …, 2,3,2,4,…,3,4,…,5,7,…,115,119, .…} Ternary relation on N: {0,0,0,1,0,1,1,1,0,…, 2,0,2, 2,1,1,2,2,0, …, 3,0,3, 3,1,2, 3,2,1,3,3,0,…,115,110,5, .…} the set of triples of natural numbers such that the 3rd number equals the 1st minus the 2nd one Relation “adress of a person”: {Jan Novák, Praha 5, Bellušova 1831, Marie Duží, Praha 5, Bellušova 1827,...,} 17.1.2019 Relation, function

Function (mapping) n-ary function F on a set M is a special “unique on the right-hand side” (n+1)-ary relation F  M ... M: (n+1) x a bc ([F(a,b)  F(a,c)]  b=c) Partial F: to each n-tuple of elements a  M...M there exists at most one element bM. Notation F: M ... M  M, instead of F(a,b) we write F(a)=b. The set M ... M is called a domain of the function F, the set M is called a range. 17.1.2019 Relation, function

Function (mapping) Example: Relation on N {1,1,1,2,1,2, 2,2 ,1, …, 4,2,2, …, 9,3,3, …, 27,9,3, .…} Is a partial function dividing without a remainder. The relation minus on N (see the previous slide) is a partial function on N: for instance the couple 2,4 does not have an image in N. In order that the function minus were total, we’d have to extend the domain to integers. 17.1.2019 Relation, function

Function (mapping) Functional symbols of FOL formulas are interpreted only by total functions: Total function F: A  B To each element aA there is just one element bB such that F(a)=b: a b F(a)=b  abc [(F(a)=b  F(a)=c)  b=c] Sometimes we introduce a special quantifier ! With the meaning “there is just one”, written as: a !b F(a)=b 17.1.2019 Relation, function

Function (mapping) Examples: Relation + {0,0,0, 1,0,1, 1,1,2, 0,1,1, …} is a (total binary) function on N. To each pair of numbers it assigns just one number, the sum of the former. Instead of 1,1,2  + we write 1+1=2. The relation  is not a function: x y z [(x  y)  (x  z)  (y  z)] Relation {0,0, 1,1, 2,4, 3,9, 4,16, …} is a function on N, namely the total function the second power (x2) 17.1.2019 Relation, function

Surjection, injection, bijection A mapping f : A  B is called a surjection (mapping A onto B), iff to each element b  B there is an element a  A such that f(a)=b. b [B(b)  a (A(a)  f(a)=b)]. A mapping f : A  B is called an injection (one to one mapping A into B), iff for all aA, bA such that a  b it holds that f(a)  f(b). a b [(A(b)  A(a)  (a  b))  (f(a)  f(b))]. A mapping f : A  B is called a bijection (one to one mapping A onto B), iff f is a surjection and injection. 17.1.2019 Relation, function

Function (mapping) Example: surjection injection bijection {1 2 3 4 5} {2 3 4 } {1 2 3 4 5} { 2 3 4 } {1 2 3 4 5} {1 2 3 4 5} If there is a bijection between the sets A, B, then we say that A and B have the same cardinality (number of elements). 17.1.2019 Relation, function

Cardinality, countable sets A set A that has the same cardinality as the set N of natural numbers is called a countable set. Example: the set S of even numbers is countable. The bijection f of S into N is defined, e.g., by f(n) = 2n. Hence 0  0, 1  2, 2  4, 3  6, 4  8, … One of the paradoxes of Cantor’s set theory: S  N (a proper subset) and yet the number of elements of the two sets is equal: Card(S) = Card(N)! 17.1.2019 Relation, function

Cardinality, countable sets The set of rational numbers R is also countable. Proof: in two steps. Card(N)  Card(R), because each natural number is rational: N  R. Now we construct a mapping of N onto R (surjection N onto R), by which we prove that Card(R)  Card(N): 1 2 3 4 5 6 … 1/1 2/1 1/2 3/1 2/2 1/3 … But, in the table there are repeating rationals, hence the mapping is not one-to-one. However, no rational number is omitted, therefore it is a mapping of N onto R (surjection). Card(N) = Card(R). 1/1 1/2 1/3 1/4 1/5 1/6 … 2/1 2/2 2/3 2/4 2/5 2/6 3/1 3/2 3/3 3/4 3/5 3/6 4/1 4/2 4/3 4/4 4/5 4/6 5/1 5/2 5/3 5/4 5/5 5/6 6/1 6/2 6/3 6/4 6/5 6/6 17.1.2019 Relation, function

Cardinality, uncountable sets There are, however, uncountable sets: the least of them is the set of real numbers R Even in the interval 0,1 there are more real numbers than the number of all natural numbers. However, in this interval there is the same number of reals than the number of all the reals R! Cantor’s diagonal proof: If there were countably many real numbers in the interval 0,1, the numbers could be ordered into a sequence: the first one (1.), the second (2.), the third (3.),…, and each of these numbers would be of a form 0,i1i2i3…, where i1i2i3… is the decimal part of the number. Rational numbers have a finite decimal part, irrational numbers have an infinite decimal part. Let us add to each nth number in in the sequence i1i2i3… of decimals the number 1. We obtain a number which is not contained in the original sequence – see the next slide: 17.1.2019 Relation, function

A new number that is not contained in the table: Cantor’s diagonal proof of uncountability of real numbers in the interval 0,1. 1 2 3 4 5 6 7 1 i11 i12 i13 i14 i15 i16 i17 2 i21 i22 i23 i24 i25 i26 i27 3 i31 i32 i33 i34 i35 i36 i37 4 i41 i42 i43 i44 i45 i46 i47 5 i51 i52 i53 i54 i55 i56 i57 …. A new number that is not contained in the table: 0,i11+1 i22+1 i33+1 i44+1 i55+1 … 17.1.2019 Relation, function

Propositional Logic again Summary of the most important notions and methods. 17.1.2019 Relation, function

Table of the truth functions 1 Be careful with implication, p  q. It is false only in one case: p = 1, q = 0. It is something like a promise: “If you behave well you will get a Christmas gift” (p  q). “I have been a good boy but there is no Christmas gift”. (p  q) Has the promise been fulfilled? If he were not a good boy (p = 0), then the promise would not obligate to anything. 17.1.2019 Propositional Logic - summary

Summary Typical tasks: Up to now we know the following methods: Check whether an argument is valid What is entailed by a given set of assumptions? Add the missing assumptions so that the argument is valid Is a given formula tautology, contradiction, satisfiable? Find the models of a formula, find a model of a set of formulas Up to now we know the following methods: Truth-table method Equivalent transformations An indirect semantic proof The resolution method Semantic tableau 17.1.2019 Propositional Logic

Example. The proof of a tautology |= [(p  q)  (p  r)]  (q  r) Table: A p q r (p  q) (p  r) A (q  r) A  (q  r) 1

Indirect proof of the tautology |= [(p  q)  (p  r)]  (q  r) The formula A is a tautology, iff the negated formula A is a contradiction: |= A iff A |= Let us assume that the negated formula can be true. Negation of implication: (A  B)  (A  B) (p  q)  (p  r)  q  r 1 1 1 0 1 0 q = 0, r = 0, hence p  0, p  0 0 0 0 0 therefore: p = 0, p = 0, i.e. 1 p = 1 contradiction The negated formula does not have a model, it is a contradiction. Hence the formula A is a tautology. 17.1.2019 Propositional Logic

The proof by equivalent transformations We need the laws: (A  B)  (A  B)  ((A  B)) (A  B)  (A  B) de Morgan (A  B)  (A  B) de Morgan (A  B)  (A  B) negation of implication (A  (B  C))  ((A  B)  (A  C)) distributive law (A  (B  C))  ((A  B)  (A  C)) distributive law 1  A  1 1  tautology, 1  A  A e.g. (p  p) 0  A  0 0  contradiction 0  A  A e.g. (p  p) 17.1.2019 propositional logic

The proof by equivalent transformations |= [(p  q)  (p  r)]  (q  r) [(p  q)  (p  r)]  (q  r)  [(p  q)  (p  r)]  (q  r)  (p  q)  (p  r)  q  r  [p  (p  r)  q  r]  [q  (p  r)  q  r]  (p  p  q  r)  (p  r  q  r)  (q  p  q  r)  (q  r  q  r)  1  1  1  1  1 – tautology Note: We obtained a conjunctive normal form (CNF) 17.1.2019 Relation, function

Proof of a tautology – resolution method |= [(p  q)  (p  r)]  (q  r) Negated formula is transformed into a clausal form (CNF), the indirect proof: (p  q)  (p  r)  q  r  (p  q)  (p  r)  q  r 1. p  q 2. p  r 3. q 4. r 5. q  r resolution 1, 2 6. r resolution 3, 5 7. resolution 4, 6 – contradiction 17.1.2019 propositional logic

Proof by a semantic tableau |= [(p  q)  (p  r)]  (q  r) Direct proof: we construct the CNF (‘’: branching, ‘’: comma – closed branches: ‘p  p’) (p  q)  (p  r)  q  r p, (p  r), q, r q, (p  r), q, r + p, p, q, r p, r, q, r + + 17.1.2019 propositional logic

Indirect proof by a semantic tableau |= [(p  q)  (p  r)]  (q  r) Indirect proof: by the DNF of the negated formula (‘’: branching, ‘’: comma, - closed branches 0: ‘p  p’) [(p  q)  (p  r)]  q  r p, (p  r), q, r q, (p  r), q, r + p, p, q, r p, r, q, r + + 17.1.2019 propositional logic

Proof of an argument |= [(p  q)  (p  r)]  (q  r) iff p: The program goes right q: The system is in order r: It is necessary to call for a system engineer If the program goes right, the system is in order. If the program malfunctions, it is necessary to call for a system engineer ---------------------------------------------------------------------------- If the system is not in order, it is necessary to call for a system engineer. 17.1.2019 propositional logic

Proof of an argument (p  q), (p  r) |= (q  r) Indirect proof: {(p  q), (p  r), (q  r)} – it cannot be a satisfiable set p  q p  r q r q  r resolution 1, 2 r resolution 3, 5 resolution 4, 6, contradiction

Proof of an argument (p  q), (p  r) |= (q  r) Direct proof: What is entailed by the assumptions? The resolution rule is truth preserving: p  q, p  r |-- q  r 1 1 1 In any valuation v it holds that if the assumptions are true, the resolvent is true as well Proof: a) p = 1  p = 0  q = 1  (q  r) = 1 b) p = 0  r = 1  (q  r) = 1 p  q p  r q  r resolution 1, 2 – consequence: (q  r)  (q  r) QED 17.1.2019 propositional logic