1
Language of Sets
Language of Sets
A set is a structure, representing an unordered collection (group, plurality) of zero or more
distinct (different) objects called elements. Set theory deals with operations between,
3
Basic notations for sets
For sets, we’ll use variables S, T, U, …
We can denote a set S in writing by listing all of its elements in curly braces:
{a, b, c} is the set of whatever 3 objects are denoted by a, b, c.
{1,2,3,4} is the set with integers from 1 to 4.
This is possible when the set contains finite number of elements.
Basic notations for sets
If a set is a large finite set or an infinite set, we use a descriptive notation by listing a property
necessary for membership.
Set builder notation:
B={x| x is a positive, even integer } defines set
5
Basic sets of numbers
Symbol Set Example of members
Z Integers -3, 0, 2, 145 Q Rational numbers -5/6, 0, 1, 23/4 R Real numbers
Basic properties of sets
Sets are inherently unordered:
No matter what objects a, b, and c denote,
{a, b, c} = {a, c, b} = {b, a, c} = {b, c, a} = {c, a, b} = {c, b, a}.
All elements are distinct (unequal); multiple listings make no difference!
{a, b, c} = {a, a, b, a, b, c, c, c, c}.
7
Membership
The basic relationship between set and
element is the inclusion membership. We write xS when element x is in set S and
xS otherwise. For instance
3{x| x is a positive, odd integer}
Definition of Set Equality
Two sets are declared to be equal if and only if
they contain exactly the same elements.
In particular, it does not matter how the set is defined or denoted.
For example: The set {1, 2, 3, 4} =
{x | x is an integer where x>0 and x<5 } = {x | x is a positive integer whose square is >0 and <25}
9
The Empty Set
(“null”, “the empty set”) is the unique set that contains no elements whatsoever.
The proposition
x is false for any element x.
x is true for any element x.
We should distinguish between sets and
{}. the first is the empty set, and the second is the set with exactly one element equal to empty set. So proposition {} is true.
Subset and Superset Relations
ST (“S is a subset of T”) means that every element of S is also an element of T.
Examples:
{2,4,6} {x| x is positive, even integer}
S the empty set is subset of any set.
SS each set is subset of itself.
ST (“S is a superset of T”) means TS.
11
Venn diagrams for sets
ST (“S is a proper subset of T”) means that
ST but . Similar for ST.
S
T
Venn Diagram equivalent of ST
Example: {1,2} {1,2,3}
S T /
The
Power Set
Operation
The power set P(S) of a set S is the set of all subsets of S. P(S) = {x | xS}.
E.g. P({a,b}) = {, {a}, {b}, {a,b}}. Sometimes P(S) is written 2S.
Note that for finite S, |P(S)| = 2|S|.
It turns out that |P(N)| > |N|.
Note: the above inequality is true also for infinite sets. There are different sizes of
13
Ordered
n
-tuples
For nN, an ordered n-tuple or a sequence
of length n is written (a1, a2, …, an). The
first element is a1, etc.
These are like sets, except that duplicates matter, and the order makes a difference. Note (1, 2) (2, 1) (2, 1, 1).
The Union Operator
For sets A, B, their union AB is the set
containing all elements that are either in A, or
in B (or, of course, in both).
Note that AB contains all the elements of A and it contains all the elements of B: so it is true (AB A) and (AB B).
15
The Union Operator
It is possible to represent inclusions (AB
A) and (AB B) using logical rules:
(xA (xA xB ) (xB (xA xB )
Both are special cases of tautology
{a,b,c}{2,3} = {a,b,c,2,3}
{2,3,5}{3,5,7} = {2,3,5,3,5,7} ={2,3,5,7} Venn diagram of the union of sets.
Union Examples
2
17
The Intersection Operator
For sets A, B, their intersection AB is the set containing all elements that are simultaneously in A and in B.
xAB (xA xB ) AB A
AB B
based on tautology P QP
{-2,-3}{2,3} = , Sets are disjoint {2,4,6}{3,4,5} ={4}
Intersection Examples
2
3
5
6
4
19
The Difference Operator
For sets A, B, their difference A-B is the set containing all elements that are in A and are not in B.
Formally, A,B: A-B{x | xA xB}.
Note that A-B is a subset of A and it is not a subset of B: (A-B A) and (A-B B)
{2,3}-{2,3,4,5} =
{2,4,6}-{3,4,5} ={2,6} Venn diagram:
Difference Examples
3
5
4
21
The Complement Operator
Sometimes we are dealing with sets that are all subsets of a set U. This set is called a
universal set or universe.
For sets {1,2,3} {-1,0,4} {x| x is positive
integer} a universal set can be chosen as
Z={x| x is integer}.
Given a universal set U, the set U-X is called the complement of X and written X.
Set Identities - 1
Identity: A=A AU=A Domination: AU=U A= Idempotent: AA = A = AA Double complement:
Commutative: AB=BA AB=BA Associative: A(BC)=(AB)C
A(BC)=(AB)C
A
A
)
23
Set Identities - 2
Distributive: A(BC)=(AB)(AC)
A(BC)=(AB) (AC) Absorption: A(AB)=A
A(AB)=A
Complement: AA =U
A A =
De Morgan’s: (AB)= AB
Generalized Union
Binary union operator: AB n-ary union:
AA2…An : ((…((A1 A2) …) An) (grouping & order is irrelevant)
“Big U” notation:
Or for infinite sets of sets:
in Ai1
X AA
25
Generalized Intersection
Binary intersection operator: AB n-ary intersection:
AA2…An((…((A1A2)…)An) (grouping & order is irrelevant)
“Big Arch” notation:
Or for infinite sets of sets:
in Ai1
X AA
Cartesian Products of Sets
For sets A, B, their Cartesian product
AB : {(a, b) | aA and bB }, it means set of all 2-tuples or ordered pairs.
E.g. {a,b}{1,2} = {(a,1),(a,2),(b,1),(b,2)} Note that for finite A, B, |AB|=|A||B|.
Note that the Cartesian product is not
commutative, in general AB BA. But
27
Cartesian Products of Sets
The Cartesian product of sets X1,X2, …Xn
is the set of all n-tuples (a1,a2, …an) where
a1X1,a2X2, …anXn.
Example X={1,2}, Y={a,b}, Z={1,2},
XYZ={(1,a,1), (1,a,2), (1,b,1), (1,b,2),
(2,a,1), (2,a,2), (2,b,1), (2,b,2)}. |XYZ|= =| X||Y||Z|= 8
The Cartesian product is not associative (XY)Z X(YZ) XYZ