Set Operations
Sets can be combined in a number of different ways to produce another set. Here four basic operations are introduced and their properties are discussed.
Definition (Union): The union of sets A and B, denoted by A ∪B, is the set defined as
A ∪B = {x | x ∈A ∨ x ∈B}
Example 1: If A = {1, 2, 3} and B = {4, 5}, then A ∪B = {1, 2, 3, 4, 5}.
Example 2: If A = {1, 2, 3} and B = {1, 2, 4, 5}, then A ∪B = {1, 2, 3, 4, 5}.
Note that elements are not repeated in a set.
Definition (Intersection): The intersection of sets A and B, denoted by A ∩B, is the set defined as
A ∩B = {x | x ∈A ⋀ x ∈B}
Example 3: If A = {1, 2, 3} and B = {1, 2, 4, 5}, then A ∩B = {1, 2}.
Example 4: If A = {1, 2, 3} and B = {4, 5}, then A ∩B = ∅.
Definition (Difference): The difference of sets A from B, denoted by A - B, is the set defined as
A - B = {x | x ∈A ⋀ x ∉ B}
Example 5: If A = {1, 2, 3} and B = {1, 2, 4, 5}, then A - B = {3}.
Example 6: If A = {1, 2, 3} and B = {4, 5}, then A - B = {1, 2, 3}.
Note that in general A - B≠ B - A
Definition (Complement): For a set A, the difference U - A, where U is the universe, is called the complement of A and it is denoted by
A¯A¯ size 12{ {overline {A}} } {}.
Thus
A¯A¯ size 12{ {overline {A}} } {} is the set of everything that is not in A.
The fourth set operation is the Cartesian product. We first define an ordered pair and Cartesian product of two sets using it. Then the Cartesian product of multiple sets is defined using the concept of n-tuple.
Definition (ordered pair):
An ordered pair is a pair of objects with an order associated with them. If objects are represented by x and y, then we write the ordered pair as <x, y>.
Two ordered pairs <a, b> and <c, d> are equal if and only if a = c and b = d. For example the ordered pair <1, 2> is not equal to the ordered pair <2, 1>.
Definition (Cartesian product):
The set of all ordered pairs <a, b>, where a is an element of A and b is an element of B, is called the Cartesian product of A and B and is denoted by A×B.
Example 1: Let A = {1, 2, 3} and B = {a, b}. Then A × B = {<1, a>, <1, b>, <2, a>, <2, b>, <3, a>, <3, b>}.
Example 2: For the same A and B as in Example 1,
B ×A = {<a, 1>, <a, 2>, <a, 3>, <b, 1>, <b, 2>, <b, 3>}.
As you can see in these examples, in general, A ×B ≠B ×A unless A = ∅, B = ∅ or A = B.
Note that A × ∅= ∅ × A = ∅ because there is no element in ∅ to form ordered pairs with elements of A.
The concept of Cartesian product can be extended to that of more than two sets. First we are going to define the concept of ordered n-tuple.
Definition (ordered n-tuple): An ordered n-tuple is a set of n objects with an order associated with them (rigorous definition to be filled in). If n objects are represented by x1, x2, ..., xn, then we write the ordered n-tuple as <x1, x2, ..., xn> .
Definition (Cartesian product): Let A1, ..., An be n sets. Then the set of all ordered n-tuples <x1, ..., xn> , where xi∈Ai for all i, 1 ≤ i ≤ n , is called the Cartesian product of A1, ..., An, and is denoted by A1 ×... ×An .
Example 3:
Let A = {1, 2}, B = {a, b} and C = {5, 6}. Then A ×B ×C = {<1, a, 5>, <1, a, 6>, <1, b, 5>, <1, b, 6>, <2, a, 5>, <2, a, 6>, <2, b, 5>, <2, b, 6>}.
Definition (equality of n-tuples): Two ordered n-tuples <x1, ..., xn> and <y1, ..., yn> are equal if and only if xi = yi for all i, 1 ≤i ≤n.
For example the ordered 3-tuple <1, 2, 3> is not equal to the ordered n-tuple <2, 3, 1>.
Properties of Set Operation
Basic properties of set operations are discussed here. 1 - 6 directly correspond to identities and implications of propositional logic, and 7 - 11 also follow immediately from them as illustrated below.
1. A ∪ ∅ = A
A ∩ U = A
------- Identity Laws
2. A ∪ U = U
A ∩ ∅ = ∅
------- Domination Laws
3. A ∪ A = A
A ∩ A = A
------- Idempotent Laws
4. A ∪ B = B ∪ A
A ∩ B = B ∩A
------- Commutative Laws
5. (A ∪ B) ∪ C = A ∪ (B ∪ C)
(A ∩ B) ∩ C = A ∩ (B ∩ C)
------- Associative Laws
6. A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
------- Distributive Laws
7. If A⊆B and C⊆D, then A ∪ C ⊆ B ∪ D, and A ∩ C ⊆ B ∩ D
8. If A⊆B, then A ∪ B = B and A ∩ B = A
9. A ∪ (B - A) = A ∪ B
10. A ∩ (B - A) = ∅
11. A - (B ∪ C) = (A – B) ∩ (A - C) (cf.
A∪B¯=A¯∩B¯A∪B¯=A¯∩B¯ size 12{ {overline {A union B}} = {overline {A}} intersection {overline {B}} } {})
A - (B ∩ C) = (A - B) ∪ (A - C) (cf.
A∩B¯=A¯∪B¯A∩B¯=A¯∪B¯ size 12{ {overline {A intersection B}} = {overline {A}} union {overline {B}} } {})
------- De Morgan's Laws
12.
B=A¯B=A¯ size 12{B= {overline {A}} } {} if and only if A ∪ B = U and A ∩ B = ∅
13.
A¯¯=AA¯¯=A size 12{ {overline overline {A}} =A} {}
Additional properties:
14. A ⊆A ∪B
15. A∩B ⊆A
The properties 1~6, and 11 can be proven using equivalences of propositional logic. The others can also be proven similarly by going to logic, though they can be proven also using some of these properties (after those properties are proven, needless to say). Let us prove some of these properties.
Proof for 4: A ∪ B = B ∪ A
We are going to prove this by showing that every element that is in A∪B is also in B∪A and vice versa.
Consider an arbitrary element x. Then by the definition of set union x ∈ A ∪ B ⇔ x ∈A ∨ x ∈ B
⇔ x ∈A ∨ x ∈ B by the commutativity of ∨
⇔ x ∈ B ∪ A by the definition of set union.
Hence by Universal Generalization, every element is in A ∪B is also in B ∪A.
Hence A ∪ B = B ∪ A.
Note here the correspondence of the commutativity of ∪ and that of ∨. This correspondence holds not just for the commutativity but also for others.
Furthermore a similar correspondence exists between ∩ and ⋀, and between ⊆ and →.
Proof for 6: By the definition of the equality of sets, we need to prove that ∀x [x ∈ A ∪ (B ∩ C)] if and only if x ∈ (A ∪ B) ∩ (A ∪ C).
For that, considering the Universal Generalization rule, we need to show that for an arbitrary element in the universe x, x ∈ A ∪ (B ∩ C) if and only if x ∈ (A ∪ B) ∩ (A ∪ C).
Here the only if part is going to be proven. The if part can be proven similarly.
x ∈ A ∪ (B ∩ C) ⇔ x ∈ A ∨ x ∈ (B ∩ C) by the definition of ∪
⇔ x ∈ A ∨ (x ∈ B ⋀ x ∈ C) by the definition of ∩
⇔ (x ∈ A ∨ x ∈ B) ⋀ (x ∈ A ∨ x ∈ C) by the distribution from the equivalences of propositional logic
⇔ x ∈ (A ∪ B) ⋀ x ∈ (A ∪ C) by the definition of ∪.
⇔ x ∈ (A ∪ B) ∩ (A ∪ C) by the definition of ∩.
Proof for 8: (a) If A⊆B then A ∪ B = B.
Let x be an arbitrary element in the universe.
Then x ∈ A ∪ B ⇔ x ∈ A ∨ x ∈ B.
Since A⊆B, x ∈ A → x ∈ B
Also x ∈ B → x ∈ B
Hence x ∈ A ∪ B → x ∈ B.
Hence A ∪ B ⊆ B
Since B ⊆ A ∪ B (use "addition" rule), A ∪ B = B follows.
(b) Similarly for A ∩ B = A.
Alternative proof:
These can also be proven using 8, 14, and 15. For example, (b) can be proven as follows:
First by 15, A ∩B ⊆A.
Then since A ⊆A, and A ⊆B, by 7 A ∩A ⊆A ∩B.
Since A ∩A = A by 3, A ⊆A ∩B.
Proof for 9: Let x be an arbitrary element in the universe.
Then [x ∈ A ∪ (B - A)] ⇔ [x ∈ A ∨ (x ∈ B ⋀ x ∉ A)]
⇔ [(x ∈ A ∨ x ∈ B) ⋀ (x ∈ A ∨ x ∉ A)]
⇔ [(x ∈ A ∨ x ∈ B) ⋀ True]
⇔ [x ∈ A ∨ x ∈ B]
Hence A ∪ (B - A) = A ∪ B.
Alternative proof
This can also proven using set properties as follows.
A ∪( B - A ) = A ∪( B ∩
A¯A¯ size 12{ {overline {A}} } {}) by the definition of ( B - A ) .
= ( A ∪B ) ∩( A ∪
A¯A¯ size 12{ {overline {A}} } {}) by the distribution.
= (A ∪B ) ∩U
= ( A ∪B ) by 1.
Proof for 10: Suppose A ∩ (B - A) ≠ ∅.
Then there is an element x that is in A ∩ (B - A), i.e.
x ∈ A ∩ (B - A) ⇔ x ∈ A ⋀ x ∈ B – A
⇔ x ∈ A ⋀ (x ∈ B ⋀ x ∉ A)
⇔ (x ∈ A ⋀ x ∉ A) ⋀ x ∈ B
⇔ False
Hence A ∩ (B - A) ≠ ∅ does not hold.
Hence A ∩ (B - A) = ∅.
This can also be proven in the similar manner to 9 above.
Proof for 11: Let x be an arbitrary element in the universe.
Then x ∈ A - (B ∪ C) ⇔ x ∈ A ⋀ x ∉ B ∪ C
⇔ x ∈ A ⋀ ¬(x ∈ B ⋁ x ∈C)
⇔ x ∈ A ⋀ (x ∉ B ⋀ x ∉C)
⇔ (x ∈ A ⋀ x ∉ B) ⋀ x ∉C
⇔ (x ∈ A ⋀ x ∉ B) ⋀ (x ∈ A ⋀ x ∉C)
⇔ x ∈ A - B ⋀ x ∈ A - C
⇔ x ∈ (A - B) ∩ (A - C)
Hence A - (B ∪ C) = (A – B) ∩ (A - C)
Proof for 12:
(a) A ∪ B = U ⋀ A ∩ B = ∅ ⇒ B =
A¯A¯ size 12{ {overline {A}} } {}?
(b) Try to prove B ⊆
A¯A¯ size 12{ {overline {A}} } {} and
A¯A¯ size 12{ {overline {A}} } {} ⊆ B.
Let x be an arbitrary element in the universe.
Then if x ∈ B, then x ∉A since A ∩ B = ∅. Hence x ∈
A¯A¯ size 12{ {overline {A}} } {}.
Hence B ⊆
A¯A¯ size 12{ {overline {A}} } {}.
If x ∈
A¯A¯ size 12{ {overline {A}} } {}, then x ∉A. Since x ∈ A ∨ x ∈ B (from A ∪ B = U ), x ∈ B
must hold. Hence
A¯A¯ size 12{ {overline {A}} } {} ⊆ B.
Hence B =
A¯A¯ size 12{ {overline {A}} } {}. (c) B =
A¯A¯ size 12{ {overline {A}} } {} ⇒ A ∪ B = U ⋀ A ∩ B = ∅ ?
Since B =
A¯A¯ size 12{ {overline {A}} } {}, A ∪ B = A ∪ (U-A) = A ∪ U = U since A ⊆ U
Also A ∩ B = A ∩ (U - A) = ∅ by 10 above.
Proof for 13: Since
A¯¯A¯¯ size 12{ {overline overline {A}} } {} ∪
A¯A¯ size 12{ {overline {A}} } {} =
A¯A¯ size 12{ {overline {A}} } {} ∪
A¯¯A¯¯ size 12{ {overline overline {A}} } {},
A¯A¯ size 12{ {overline {A}} } {} ∪
A¯¯A¯¯ size 12{ {overline overline {A}} } {}= U
Also since
A¯¯A¯¯ size 12{ {overline overline {A}} } {} ∩
A¯A¯ size 12{ {overline {A}} } {} =
A¯A¯ size 12{ {overline {A}} } {} ∩
A¯¯A¯¯ size 12{ {overline overline {A}} } {} ,
A¯A¯ size 12{ {overline {A}} } {} ∩
A¯¯A¯¯ size 12{ {overline overline {A}} } {} = ∅.
Hence
A¯¯A¯¯ size 12{ {overline overline {A}} } {} satisfies the conditions for the complement of
A¯A¯ size 12{ {overline {A}} } {}.
Hence
A¯¯=AA¯¯=A size 12{ {overline overline {A}} =A} {}.