2.2: Set Operations
( \newcommand{\kernel}{\mathrm{null}\,}\)
Complement of Sets
Definition: Complement
The complement of a set is another set which contains only elements not found in the first set.
Let A be a set.
Ac = {x∣x∉A}
We write c to denote a complementary set.
Often, the context provides a "universe" of all possible elements pertinent to a given discussion. Suppose we have given such a set of "all" elements. Let us call it U. Then, the complement of a set A, denoted by Ac, is defined as Ac=U−A. In our work with sets, the existence of a universal set U is tacitly assumed.
Example 2.2.1
Consider Q and Qc, the sets of rational and irrational numbers, respectively:
x∈Q→x∉Qc, since a number cannot be both rational and irrational.
So, the sets of rational and irrational numbers are complements of each other.
Union
Definition: Union
A union of two sets creates a "united" set containing all terms from both sets.
A∪B={x∣(x∈A)∨(x∈B)}
Example 2.2.2
Let A={1,3,5} and B={2,4,6}
Then A∪B={1,2,3,4,5,6}
Intersection
Definition: Intersection
The intersection of two sets creates a set with elements that are in both sets.
A∩B={x∣(x∈A)∧(x∈B)}
Example 2.2.3
Let A={8,12,37,−22} and B={8675309,42,12,8,57}
Then A∩B={8,12}
Set Difference
Definition: Set difference
The difference between two sets generates a set which has no elements of the second set.
A−B={x∣(x∈A)∧(x∉B)}
Example 2.2.4
Let A={8,12,37,−22} and B={8675309,42,12,8,57}.
Then A−B={37,−22}
The Empty Set
Definition: Empty set
The empty set is a set that has no elements. It is written {} or ∅.
∅⊆A, for any set A
The empty set has just one subset, which is itself. The empty set is also a subset of every set, since a set with no elements naturally fits into any set with elements.
Disjoints
Definition: Disjoint sets
A and B are called disjoints if A∩B=∅.
Example 2.2.5
Consider sets Q and Qc:
Since Q∩Qc =∅, these sets are called disjoints.
Cartesian Product
Definition: Cartesian products
The so-called Cartesian product of sets is a powerful and ubiquitous method to construct new sets out of old ones.
Let A and B be sets. Then the Cartesian product of A and B, denoted by A×B, is the set of all ordered pairs (a,b), with a∈A and b∈B. In other words,
A×B={(a,b) | a∈A,b∈B}.
An important example of this construction is the Euclidean plane R2=R×R. It is not an accident that x and y in the pair (x,y) are called the Cartesian coordinates of the point (x,y) in the plane.
Example 2.2.6
Let A={2,4,6,8} and B={1,3,5,7}. then
A×B={(2,1),(4,3),(6,5),(8,7)}