Discrete Mathematics
Lecture 3: Sets, Relations and Functions
Partha Sarathi Mandal
IIT Guwahati
Rules of Set Theory
Let P, Q and R be sets.
• Commutative law:
(P ∪ Q) = (Q ∪ P) and (P ∩ Q) = (Q ∩ P)
• Associative law:
(P ∪ (Q ∪ R)) = ((P ∪ Q) ∪ R) and (P ∩ (Q ∩ R)) = ((P ∩ Q) ∩ R)
• Distributive law:
(P ∪ (Q ∩ R)) = (P ∪ Q) ∩ (P ∪ R) (union distributes over intersection)
(P ∩ (Q ∪ R)) = (P ∩ Q) ∪ (P ∩ R) (intersection distributes over union)
• De Morgan's Law:
(P ∪ Q)c = (Pc ∩ Qc) and (P ∩ Q)c = (Pc ∪ Qc)
Rules of Set Theory
•S ST T ST
• STS STT
• S∅=S S∅ =∅
• SS=SS=S
Proof idea
Distributive law: (R ∪ (S ∩ T)) = (R ∪ S) ∩ (R ∪ T)
Proof idea:
Let x (R ∪ (S ∩ T)) then we need to show that x (R ∪ S) ∩ (R ∪ T)
which implies (R ∪ (S ∩ T)) (R ∪ S) ∩ (R ∪ T) ------ (1)
Now,
let y (R ∪ S) ∩ (R ∪ T) , then we neet to show that y (R ∪ (S ∩ T))
which implies (R ∪ S) ∩ (R ∪ T) (R ∪ (S ∩ T)) ------ (2)
(1) and (2) implies (R ∪ (S ∩ T)) = (R ∪ S) ∩ (R ∪ T).
Detailed proof
• Let x R∪(S∩T), then, x R or x S∩T.
If x R then, x R∪S and x R∪T
Thus, x (R∪S)∩(R∪T).
If x R, then x S∩T, so, x S and x T. Here x R∪S and x R∪T.
Thus, x (R∪S)∩(R∪T).
• So, (R ∪(S∩T)) (R∪S)∩(R∪T) ----- (1)
Now, let y (R∪S)∩(R∪T), then y (R∪S) and y (R∪T).
Now, if y (R∪S) the either y R or y S or both.
if y R, then y R∪(S∩T)
if y R, then the condition y (R ∪ S) and y (R ∪ T) imply that y S and y T.
Thus y S∩T and hence y R∪(S∩T).
This shows that (R ∪ S) ∩ (R ∪ T) (R ∪ (S ∩ T)) ----- (2)
(1) and (2) imply (R ∪(S∩T)) = (R∪S)∩(R∪T)
Power set
• Let X be a set. Then, the set that contains all subsets of X is called the
power set of X and is denoted by P(X) or 2X
• Example:
Let X = {a, b, c}. Then P(X) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}.
Whereas set Y = {∅, {a}, {c}, {a, b}, {a, c}, {a, b, c}} is a set of sets rather some
collection of sub sets of the set X.
Cartesian Product
• Let A be a set. A x A is a the set of ordered pairs (x, y) where x, y A.
• Let X = {a, b, c} and Y = {1, 2, 3, 4}. Then, what is X x X and X x Y?
• By convention, ∅ x Y = X x ∅ = ∅. In fact, X x Y = ∅ if and only if X = ∅ or Y = ∅.
• Similarly, A x A x … x A (n times) (also denoted as An) is the set of all
ordered subsets (with repetitions) of A of size n
• For example: {0, 1}n the set of all “strings" of 0 and 1 of length n.
A detailed proof
Prove S T if and only if S T = S.
Proof:
• Given S T we need to prove S T = S
• if x S implies x T as S T
• Hence x S and x T implies x S T -> S S T ---- (1)
• Now if x S T then x S -> S T S ---- (2)
• (1) and (2) implies S T = S
• Given S T = S we need to prove S T
• If x S then by assumption x S T
• so x S and x T.
• In particular, x T.
• Therefore, S T.
Russell’s paradox (1902)
Cantor established set theory in 1874
• Now the question is does
the barber shave himself?
Russell’s paradox (1902) • Think about it,
• if the barber does not save
himself, then he should
and
• if he does shave himself then
he shouldn’t
Russell’s paradox
• If it is a member of itself, then it must meet the condition of its not being a
member of itself.
• But if it is not a member of itself, then it precisely meets the condition of
being a member of itself.
• The set M is the set of all sets that do not contain themselves as members.
Does M contain itself?
• For Example: “A is an element of M if and only if A is not an element of A” M
={x: x x},
• MM MM
• Responded to by introduction of rigorous axioms in set theory (Zermelo-
Fraenkel axioms (ZFC))
Some problems on set theory
Let U be the universal set and S, T U. Then,
1. Uc = ∅ and ∅c = U.
2. S Sc = U and S Sc = ∅.
3. S U = U and S U = S.
4. (Sc)c = S.
5. S Sc if and only if S = ∅.
6. S T if and only if Tc Sc.
7. S = Tc if and only if S T = ∅ and S T = U.
8. S \ T = S Tc and T \ S = T Sc.
9. S T = (S T) \ (S T).
Prove the following
1. S (S T) = S (S T) = S.
2. S T if and only if S T = T.
3. S T if and only if S T = S
4. If R T and S T then R S T
5. If R S and R T then R S T.
6. If S T then R S R T and R S R T.
7. If S T ∅ then either S ∅ or T ∅.
8. If S T ∅ then both S ∅ and T ∅.
9. S = T if and only if S T = S T.