Spring 2018
Summary Last time: Today: Introduction to Basic Set Theory (Vardy) More on sets Connections between sets and logic Reading: Chapter 2
Set Notation A, B, C: sets A = {1, 2, 3}: finite set with elements 1, 2, 3 2 A: set membership relation ( 2 is in A ) A B, A B: set inclusion relations A B, A B: set operations (intersection, union, etc.)
Set Notation A, B, C: sets A = {1, 2, 3}: finite set with elements 1, 2, 3 2 A: set membership relation ( 2 is in A ) A B, A B: set inclusion relations A B, A B: set operations (intersection, union, etc.) Let A = {1, 2, 3} and B = {2, 3} Question: The statement 5 A is (A) Correct; (B) Wrong; (C) True; (D) None of the above
Set Notation A, B, C: sets A = {1, 2, 3}: finite set with elements 1, 2, 3 2 A: set membership relation ( 2 is in A ) A B, A B: set inclusion relations A B, A B: set operations (intersection, union, etc.) Let A = {1, 2, 3} and B = {2, 3} Question: The statement 5 A is (A) Correct; (B) Wrong; (C) True; (D) None of the above Question: The statement B A is (A) Correct; (B) Wrong; (C) True; (D) None of the above
Typecheck your math! A, B, C: sets
Typecheck your math! A, B, C: sets x, y, z: elements
Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false)
Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false)
Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements:
Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false
Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false A B, A B: sets (result of a set operation)
Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false A B, A B: sets (result of a set operation) (A B) (x / C)
Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false A B, A B: sets (result of a set operation) (A B) (x / C) nonsense: (A B) is a set, not a proposition.
Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false A B, A B: sets (result of a set operation) (A B) (x / C) nonsense: (A B) is a set, not a proposition. A x, A B
Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false A B, A B: sets (result of a set operation) (A B) (x / C) nonsense: (A B) is a set, not a proposition. A x, A B nonsense, unless x is a set, of B is a set of sets
Quiz Time Let A, B, C be sets (of numbers), x, y, z (numerical) values, and P(x), Q(x) predicates. Which of the following expressions are meaningful? (choose the best possible answer.) 1. (x A) (A B) 2. (A B) {x} 3. {x, y} (A B) 4. {x} (A B) 5. x.(x A) (x B) 6. A, B, C.(A B) (B C) (A C) 7. ({x : P(x)} {y : Q(y)}) ( x.p(x) Q(x)) (A) 1,2,3,6,7; (B) 1,2,3,4,5; (C) 1,2,3,5,6,7; (D) 1,3,5,6,7;
Set vs Predicates Each set A defines a corresponding predicate: set membership predicate P(x) = (x A)
Set vs Predicates Each set A defines a corresponding predicate: set membership predicate P(x) = (x A) Each predicate Q defines a corresponding set: the set of all values satisfying the predicate B = {x Q(x)}
Set vs Predicates Each set A defines a corresponding predicate: set membership predicate P(x) = (x A) Each predicate Q defines a corresponding set: the set of all values satisfying the predicate B = {x Q(x)} Notice: for any set A and predicate P If Q(x) = (x A), and B = {x : Q(x)}, then A = B If B = {x : P(x)} and Q(x) = (x B), then P(x) = Q(x), i.e., x.p(x) Q(x).
Set operations vs Logican operations A = {x : P(x)} B = {x : Q(x)} C = {x : R(x)}
Set operations vs Logican operations A = {x : P(x)} B = {x : Q(x)} C = {x : R(x)} A B = {x : P(x) Q(x)} A B = {x : P(x) Q(x)} A \ B = A B = {x : P(x) Q(x)} A c = A = {x : P(x)}
Set operations vs Logican operations A = {x : P(x)} B = {x : Q(x)} C = {x : R(x)} A B = {x : P(x) Q(x)} A B = {x : P(x) Q(x)} A \ B = A B = {x : P(x) Q(x)} A c = A = {x : P(x)} (A B) C = {x : (P(x) Q(x)) R(x)} ((x A) (x B) (x C)) (x (A B) C)
Quantifying over a set Quantification over the universe of discourse U: x.p(x) : P(x) is true for all x in U x.p(x) : P(x) is true for some x in U Universe U usually implicit, but clear from the context
Quantifying over a set Quantification over the universe of discourse U: x.p(x) : P(x) is true for all x in U x.p(x) : P(x) is true for some x in U Universe U usually implicit, but clear from the context Can use set notation to quantify over a specific set: x S.P(x) : P(x) is true for all x in set S x S.P(x) : P(x) is true for some x in set S Examples: 1. x Z. y Z.x + y = 0 2. x Q.x 2 = 2 3. x R.x 2 = 2
Quantifying over a set using logical connectives Which of the following logical statements corresponds to x S.P(x)? (A) x.((x S) P(x))) (B) x.((x S) P(x))) (C) x.((x S) P(x))) (D) x.(p(x) (x S))
Quantifying over a set using logical connectives Which of the following logical statements corresponds to x S.P(x)? (A) x.((x S) P(x))) (B) x.((x S) P(x))) (C) x.((x S) P(x))) (D) x.(p(x) (x S)) Which of the following logical statements corresponds to x S.P(x)? (A) x.((x S) P(x))) (B) x.((x S) P(x))) (C) x.((x S) P(x))) (D) x.(p(x) (x S))
Negating quantifiers over a set Which of the following statements is equivalent to ( x S.P(x))? (A) x S c. P(x) (B) x S c. P(x) (C) x S.P(x) (D) x S. P(x)
Negating quantifiers over a set Which of the following statements is equivalent to ( x S.P(x))? (A) x S c. P(x) (B) x S c. P(x) (C) x S.P(x) (D) x S. P(x) Which of the following statements is equivalent to ( x S.P(x))? (A) x S c. P(x) (B) x S c. P(x) (C) x S.P(x) (D) x S. P(x)
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x)))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x)))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x.( (x S) P(x))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x.( (x S) P(x)) x.((x S) P(x))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x.( (x S) P(x)) x.((x S) P(x)) x S. P(x))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x)))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x)))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x. ( (x S) P(x))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x. ( (x S) P(x)) x.( (x S) P(x))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x. ( (x S) P(x)) x.( (x S) P(x)) x.((x S) P(x))
Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x. ( (x S) P(x)) x.( (x S) P(x)) x.((x S) P(x)) x S. P(x))
Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined.
Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. x.p(x)
Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. x.p(x) x.((x ) P(x))
Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. x.p(x) x.((x ) P(x)) x.(false P(x))
Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. x.p(x) x.((x ) P(x)) x.(false P(x)) x.false
Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. x.p(x) x.((x ) P(x)) x.(false P(x)) x.false False
Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined.
Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. This is the negation of x. P(x) False. x.p(x)
Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. This is the negation of x. P(x) False. x.p(x) x.((x ) P(x))
Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. This is the negation of x. P(x) False. x.p(x) x.((x ) P(x)) x.(false P(x))
Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. This is the negation of x. P(x) False. x.p(x) x.((x ) P(x)) x.(false P(x)) x.true
Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. This is the negation of x. P(x) False. x.p(x) x.((x ) P(x)) x.(false P(x)) x.true True
Union and Intersection of set families Let A be a collection of sets The union of all sets in A is X = {v : X A.v X} X A
Union and Intersection of set families Let A be a collection of sets The union of all sets in A is X = {v : X A.v X} X A The intersection of all sets in A is X = {v : X A.v X} X A
Union and Intersection of set families Let A be a collection of sets The union of all sets in A is X = {v : X A.v X} X A The intersection of all sets in A is X = {v : X A.v X} X A Empty unions and intersections: If A =, then X A X = X A X = U
Counting Subsets Powerset of a set A P(A) = 2 A = {B : B A} Example: P({1, 2, 3}) = {, {1}, {2}, {3}, {1, 2, }, {1, 3}, {2, 3}, {1, 2, 3}}. What s the size of P(A)? For every element x A, there are two possibilities (x A or x / A) A subset of A can be selected in 2 A possible ways If A = n, then A has 2 n possible subsets Ok, so P(A) = 2 A. But how many subsets of A have size 3?
Binomial Coefficients The Binomial Coefficient ( n k) expresses the number of subsets of a set of n, that have size precisely k. ( ) n = k ( ) n = 1 n ( ) n = 1 0 ( ) n = n 1 ( ) n 1 + k 1 ( ) n 1 k