Skip to content

Mathematics · Ch 1 — Sets

Operations on Sets

1.9

Operations on Sets

1.9 Operations on Sets

In earlier classes, you learned how to add, subtract, multiply, and divide numbers. Each operation took a pair of numbers and produced a single number. For instance, adding 5 and 13 gives 18; multiplying them gives 65.

Sets have their own operations. When we perform an operation on two sets, we get another set. From now on, we assume every set we discuss is a subset of some fixed universal set, which we denote by UU.


Union of Sets

The union of two sets AA and BB is the set of all elements that belong to AA or to BB (or to both). We write it as A∪BA \cup B.

In set-builder notation:

A∪B={x:x∈A or x∈B}A \cup B = \{ x : x \in A \text{ or } x \in B \}

The word "or" here is inclusive — it means "at least one of the two sets contains the element."

Note

The union operation corresponds to the logical "OR." An element is in A∪BA \cup B if it satisfies at least one of the conditions: being in AA or being in BB.

Example. Let A={2,4,6,8}A = \{2, 4, 6, 8\} and B={6,8,10,12}B = \{6, 8, 10, 12\}. Then A∪B={2,4,6,8,10,12}A \cup B = \{2, 4, 6, 8, 10, 12\}. The elements 6 and 8 appear in both sets, but we list them only once in the union.

Example. If A={1,3,5,7}A = \{1, 3, 5, 7\} and B={2,4,6,8}B = \{2, 4, 6, 8\}, then A∪B={1,2,3,4,5,6,7,8}A \cup B = \{1, 2, 3, 4, 5, 6, 7, 8\}.

Example. Let X={a,b,c,d}X = \{a, b, c, d\} and Y={c,d,e,f}Y = \{c, d, e, f\}. Then X∪Y={a,b,c,d,e,f}X \cup Y = \{a, b, c, d, e, f\}.

Watch out

Do not list any element more than once in the union. Even if an element belongs to both sets, it appears exactly once in A∪BA \cup B.


Intersection of Sets

The intersection of two sets AA and BB is the set of all elements that belong to both AA and BB. We write it as A∩BA \cap B.

In set-builder notation:

A∩B={x:x∈A and x∈B}A \cap B = \{ x : x \in A \text{ and } x \in B \}

Note

The intersection operation corresponds to the logical "AND." An element is in A∩BA \cap B only if it satisfies both conditions simultaneously.

Example. Let A={2,4,6,8}A = \{2, 4, 6, 8\} and B={6,8,10,12}B = \{6, 8, 10, 12\}. Then A∩B={6,8}A \cap B = \{6, 8\}.

Example. If A={1,3,5,7}A = \{1, 3, 5, 7\} and B={2,4,6,8}B = \{2, 4, 6, 8\}, then A∩B=∅A \cap B = \varnothing (the empty set). Sets with no common elements are called disjoint sets.

Example. Let X={a,b,c,d}X = \{a, b, c, d\} and Y={c,d,e,f}Y = \{c, d, e, f\}. Then X∩Y={c,d}X \cap Y = \{c, d\}.

Important

Two sets AA and BB are called disjoint if A∩B=∅A \cap B = \varnothing. Disjoint sets have no element in common.


Difference of Sets

The difference of two sets AA and BB, written as A−BA - B or A∖BA \setminus B, is the set of all elements that belong to AA but not to BB.

In set-builder notation:

A−B={x:x∈A and x∉B}A - B = \{ x : x \in A \text{ and } x \notin B \}

Similarly, B−AB - A is the set of elements in BB but not in AA.

Watch out

The difference operation is not commutative. In general, A−B≠B−AA - B \neq B - A. The order matters: A−BA - B removes from AA everything that is also in BB.

Example. Let A={2,4,6,8}A = \{2, 4, 6, 8\} and B={6,8,10,12}B = \{6, 8, 10, 12\}. Then:

  • A−B={2,4}A - B = \{2, 4\} (remove 6 and 8 from AA)
  • B−A={10,12}B - A = \{10, 12\} (remove 6 and 8 from BB)

Example. If A={1,2,3,4,5,6}A = \{1, 2, 3, 4, 5, 6\} and B={2,4,6,8}B = \{2, 4, 6, 8\}, then A−B={1,3,5}A - B = \{1, 3, 5\} and B−A={8}B - A = \{8\}.


Complement of a Set

Let UU be the universal set. The complement of a set AA (relative to UU) is the set of all elements of UU that are not in AA. We denote it by A′A' or AcA^c.

In set-builder notation:

A′={x∈U:x∉A}A' = \{ x \in U : x \notin A \}

Equivalently, A′=U−AA' = U - A.

Note

The complement operation is a special case of the difference operation: A′=U−AA' = U - A. It depends entirely on the choice of universal set UU.

Example. Let U={1,2,3,4,5,6,7,8,9,10}U = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\} and A={1,3,5,7,9}A = \{1, 3, 5, 7, 9\}. Then A′={2,4,6,8,10}A' = \{2, 4, 6, 8, 10\}.

Example. If U=NU = \mathbb{N} (the set of natural numbers) and A={1,2,3}A = \{1, 2, 3\}, then A′={4,5,6,7,… }A' = \{4, 5, 6, 7, \dots\}, the set of all natural numbers greater than 3.


Properties of Complement

The textbook lists several important properties of the complement operation. Each one is proved below.

›Proof

Property 1: Complement Laws

  1. A∪A′=UA \cup A' = U
  2. A∩A′=∅A \cap A' = \varnothing Proof of (i): Let x∈A∪A′x \in A \cup A'. Then x∈Ax \in A or x∈A′x \in A'. If x∈Ax \in A, then x∈Ux \in U (since A⊆UA \subseteq U). If x∈A′x \in A', then x∈Ux \in U by definition of complement. So every element of A∪A′A \cup A' is in UU, meaning A∪A′⊆UA \cup A' \subseteq U. Conversely, let x∈Ux \in U. Then either x∈Ax \in A or x∉Ax \notin A. If x∈Ax \in A, then x∈A∪A′x \in A \cup A'. If x∉Ax \notin A, then x∈A′x \in A', so again x∈A∪A′x \in A \cup A'. Thus U⊆A∪A′U \subseteq A \cup A'. Since both inclusions hold, A∪A′=UA \cup A' = U. Proof of (ii): Suppose x∈A∩A′x \in A \cap A'. Then x∈Ax \in A and x∈A′x \in A'. But x∈A′x \in A' means x∉Ax \notin A. An element cannot simultaneously belong to AA and not belong to AA. This contradiction shows that no such xx exists. Hence A∩A′=∅A \cap A' = \varnothing.
›Proof

Property 2: Law of Double Complementation

(A′)′=A(A')' = A

Proof:

Let x∈(A′)′x \in (A')'. Then x∉A′x \notin A'. But A′A' contains all elements of UU that are not in AA. So x∉A′x \notin A' means xx is not one of those elements — that is, x∈Ax \in A. Hence (A′)′⊆A(A')' \subseteq A.

Conversely, let x∈Ax \in A. Then x∉A′x \notin A' (since A′A' contains only elements not in AA). Therefore x∈(A′)′x \in (A')'. So A⊆(A′)′A \subseteq (A')'.

Both inclusions give (A′)′=A(A')' = A.

›Proof

Property 3: Laws of Empty Set and Universal Set

  1. ∅′=U\varnothing' = U
  2. U′=∅U' = \varnothing Proof of (i): ∅′={x∈U:x∉∅}\varnothing' = \{ x \in U : x \notin \varnothing \}. Since ∅\varnothing contains no elements, every x∈Ux \in U satisfies x∉∅x \notin \varnothing. Thus ∅′=U\varnothing' = U. Proof of (ii): U′={x∈U:x∉U}U' = \{ x \in U : x \notin U \}. No element of UU can satisfy x∉Ux \notin U, so U′U' has no elements. Hence U′=∅U' = \varnothing.
›Proof

Property 4: De Morgan's Laws

  1. (A∪B)′=A′∩B′(A \cup B)' = A' \cap B'
  2. (A∩B)′=A′∪B′(A \cap B)' = A' \cup B' Proof of (i): Let x∈(A∪B)′x \in (A \cup B)'. Then x∉A∪Bx \notin A \cup B. This means xx is not in AA and xx is not in BB (if xx were in either, it would be in the union). So x∈A′x \in A' and x∈B′x \in B', hence x∈A′∩B′x \in A' \cap B'. Thus (A∪B)′⊆A′∩B′(A \cup B)' \subseteq A' \cap B'. …