# 2.2: Operations with Sets

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

#### Complements of Sets

**Definition**

The complement of a set is another set which contains only elements not found in the first set.

Let \(A\) be a set.

\(A\)^{c} = \(\{x \mid x \notin 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 \(A^c\) , is deﬁned as \(A^c = U - A\). In our work with sets, the existence of a **universal set** \(U\) is tacitly assumed.

**Example \(\PageIndex{1}\):**

Consider \(\mathbb{Q}\) and \(\mathbb{Q}\)^{c}, the sets of rational and irrational numbers, respectively:

\(x \in \mathbb{Q} \to x \notin \mathbb{Q}\)^{c}, since a number cannot be both rational and irrational.

So, the sets of rational and irrational numbers are complements of each other.

#### Union

**Definition**

A union of two sets creates a "united" set containing all terms from both sets.

\(A \cup B = \{x \mid (x \in A) \vee (x \in B)\}\)

**Example \(\PageIndex{2}\):**

Let \(A = \{1, 3, 5\}\) and \(B = \{2, 4, 6\}\)

Then \(A \cup B = \{1, 2, 3, 4, 5, 6 \}\)

#### Intersection

**Definition**

The intersection to two sets creates a set with elements that are in both sets.

\(A \cap B = \{x \mid (x \in A) \wedge (x \in B)\}\)

**Example \(\PageIndex{3}\):**

Let \(A = \{8, 12, \frac{3}{7}, -22\}\) and \(B = \{8 675 309, 42, 12, 8, 57\}\)

Then \(A \cap B = \{8, 12\}\)

#### Set Difference

**Definition**

The difference between two sets generates a set which has no elements of the second set.

\(A - B = \{x \mid (x \in A) \wedge (x \notin B)\}\)

**Example \(\PageIndex{4}\):**

Let \(A = \{8, 12, \frac{3}{7}, -22\}\) and \(B = \{8 675 309, 42, 12, 8, 57\}\).

Then \(A - B = \{\frac{3}{7}, -22\}\)

#### The Empty Set

**Definition**

The empty set is a set that has no elements. It is written \(\{\}\) or \(\emptyset\).

\(\emptyset \subseteq 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**

A and B are called disjoints if \(A \cap B = \emptyset\).

**Example \(\PageIndex{5}\):**

Consider sets \(\mathbb{Q}\) and \(\mathbb{Q}\)^{c}:

Since \(\mathbb{Q} \cap \mathbb{Q}\)^{c} \(= \emptyset\), these sets are called disjoints.

#### Cartesian Product

**Definition**

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 \times B\), is the set of all ordered pairs \((a, b),\) with \(a \in A\) and \(b \in B.\) In other words,

\[A \times B = \{(a, b) ~|~ a \in A, b \in B\} .\]

An important example of this construction is the Euclidean plane \(\mathbb{R}^2 = \mathbb{R} \times \mathbb{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 \(\PageIndex{6}\):**

Let \(A = \{2, 4, 6, 8\)\) and \(B = \{1, 3, 5, 7\}\)

\(A \times B = \{(2, 1), (4, 3), (6, 5), (8, 7)\}\)