Skip to main content

Section 4.2 Operations with Sets

Guiding Questions.

In this section, we’ll seek to answer the questions:
  • What are some common operations with sets?
  • What properties do these common operations satisfy?
  • How can we prove that two sets are equal?
In Section 4.1, we explored some elementary properties of sets, such as element membership, subset relationships, and cardinality. In this section, we explore operations with sets, and common ways of combining sets with other sets. We will establish our results via the element-chasing method of proving set equality.

Subsection 4.2.1 Union, Intersection, and Equality of Sets

The most basic operations with sets are union and intersection.

Definition 4.2.1.

Let \(A\) and \(B\) be sets. The union of \(A\) and \(B\text{,}\) denoted \(A\cup B\text{,}\) is the set of all elements \(x\) which are in \(A\) or \(B\) (or both):
\begin{equation*} A\cup B := \setof{x}{x\in A \lor x\in B}. \end{equation*}
The intersection of \(A\) and \(B\text{,}\) denoted \(A\cap B\text{,}\) is the set of all elements \(x\) which are in both \(A\) and \(B\text{:}\)
\begin{equation*} A\cap B := \setof{x}{x\in A\land x\in B}. \end{equation*}
If \(A\cap B = \emptyset\text{,}\) we say \(A\) and \(B\) are disjoint.

LaTeX Code 4.2.2.

To typeset \(A\cup B\) in \(\LaTeX\text{,}\) use A\cup B in math mode. To typeset \(A\cap B\) in \(\LaTeX\text{,}\) use A\cap B in math mode.

Activity 4.2.3.

Let \(A = \set{5,10,15}\text{,}\) \(B = \set{\emptyset, 5, \pi}\text{,}\) \(C = \set{ 2, \pi, -\sqrt{7}, \set{2, - \sqrt{7}}}\text{,}\) and \(D = \set{2, -\sqrt{7}}\text{.}\) Give each of the following sets in roster form.
  1. \(\displaystyle A\cup B\)
  2. \(\displaystyle A\cap B\)
  3. \(\displaystyle B\cap C\)
  4. \(\displaystyle C\cup D\)
  5. \(\displaystyle C\cap D\)

Problem 4.2.5.

For each of the following, find sets \(A\) and \(B\) such that:
Given the way set theory has reshaped mathematics over the past 150 years, many mathematical proofs rely on the equality of certain sets. While Axiom 4.1.7 gives a precise meaning to set equality, we typically verify set equality using a technique sometimes called element chasing.

Proving Sets are Equal via Element-Chasing.

The typical way to prove that sets \(A\) and \(B\) are equal via Axiom 4.1.7 is to show that \(A\subseteq B\) and \(B\subseteq A\text{.}\) We generally do this in two steps: first by letting \(x\in A\) and demonstrating via mathematics and logical deduction that \(x\in B\text{,}\) and then letting \(x\in B\) and demonstrating that \(x\in A\text{.}\)
Consider the following example.

Proof.

Let \(x\in A\cup B\text{.}\) Then \(x\in A\) or \(x\in B\text{,}\) so \(x\in B\) or \(x\in A\text{.}\) But this means that \(x\in B\cup A\text{,}\) so \(A\cup B\subseteq B\cup A\text{.}\)
Now suppose \(x\in B\cup A\text{.}\) Then \(x\in B\) or \(x\in A\text{,}\) which means \(x\in A\) or \(x\in B\text{.}\) This means that \(x\in A\cup B\text{,}\) so \(B\cup A\subseteq A\cup B\text{.}\)
Thus, by Axiom 4.1.7, \(A\cup B = B\cup A\text{.}\)
Union and intersection obey additional algebraic laws.

Subsection 4.2.2 Complement and Difference

We next wish to introduce the notion of the complement of a set \(A\text{,}\) which we will denote \(A^c\text{.}\) Informally, \(A^c\) consists of all elements which are not in \(A\text{...}\)but, wait —really? All elements? So if \(A\) simultaneously does not contain a \(5\times 5\) Rubik’s cube and the Lincoln Memorial, then \(A^c\) does?
This is clearly untenable. Until now, we’ve been playing a little fast and loose with one thing: the idea of a larger universe \(U\) in which our sets live. In mathematics we often consider sets of numbers; if we are interested in a set of integers, the universe might be \(\Z\) (or maybe \(\N\) if we know they’re positive). This was implicit in our definition of the set \(B\) in Example 4.1.4, as the first half of the set-builder form specified that we were considering only \(x\in \Z\text{.}\)
This universe is typically implied (as it was in Example 4.1.4), but in defining and using both the complement and relative complement (the set difference), our definitions and theorems will name the universal set \(U\text{.}\)

Definition 4.2.11.

Let \(A\) be a set contained in some universe \(U\text{.}\) Then the complement of \(A\), denoted \(A^c\text{,}\) is the set of elements \(x\in U\) with \(x\notin A\text{.}\) That is:
\begin{equation*} A^c := \setof{x\in U}{x\notin A}. \end{equation*}

Activity 4.2.12.

Consider \(A = \set{-2,-1,0,1,2}\) and \(B = \set{0,3}\) in the universe \(U = \set{-4,-3,-2,-1,0,1,2,3}\text{.}\) Calculate:
  1. \(A^c\text{.}\)
  2. \(B^c\text{.}\)
  3. \(\displaystyle (A\cap B)^c\)
  4. \(\displaystyle A^c \cup B^c\)
  5. \(\displaystyle (A\cup B)^c\)
  6. \(\displaystyle A^c \cap B^c\)
Another important set operation related to the complement is the set difference.

Definition 4.2.18.

Let \(A\) and \(B\) be sets. The (set) difference of \(A\) and \(B\) (sometimes called the relative complement of \(A\) in \(B\)), denoted \(A\setminus B\text{,}\) is the set of elements \(x\) such that \(x\in A\) and \(x\notin B\text{:}\)
\begin{equation*} A\setminus B := \setof{x}{x\in A \land x\notin B}. \end{equation*}

Problem 4.2.19.

Let \(A\) and \(B\) be sets. Give a proof or counterexample of the following:
\begin{equation*} A\setminus B = B\setminus A. \end{equation*}

Problem 4.2.22.

Let \(A, B\text{,}\) and \(C\) be sets. Prove or give a counterexample that
\begin{equation*} A\setminus (B\setminus C) = (A\setminus B) \cup (A\cap C). \end{equation*}

Subsection 4.2.3 Cartesian Products

The last significant operation we’ll do on sets is, in some sense, multiply them.

Definition 4.2.23.

Let \(A, B\) be sets. Given elements \(a\in A\) and \(b\in B\text{,}\) the ordered pair \((a,b)\) is the set
\begin{equation*} (a,b) := \set{\set{a}, \set{a,b}}. \end{equation*}
The Cartesian product of \(A\) and \(B\text{,}\) denoted \(A\times B\text{,}\) is the set of all ordered pairs whose first coordinate is from \(A\) and whose second coordinate is from \(B\text{:}\)
\begin{equation*} A\times B := \setof{(a,b)}{a\in A, \ b\in B}. \end{equation*}

LaTeX Code 4.2.24.

To typeset \(A\times B\) in \(\LaTeX\text{,}\) use A\times B in math mode.
We include the definition of ordered pairs in Definition 4.2.23 for completeness, but in practice we rarely use it, instead relying on our intuition for how ordered pairs work in the \(xy\)-plane, \(\R\times \R\text{.}\)
It is standard to denote the product of a set \(A\) with itself as \(A^2\text{,}\) \(A\times A \times A = A^3\text{,}\) and so on.

Problem 4.2.25.

Given the definition of ordered pair in Definition 4.2.23 and \((1,2), (2,1)\in \Z\times \Z\text{,}\) is it true that \((1,2) = (2,1)\text{?}\)

Activity 4.2.26.

Let \(A = \set{5,10,15}\text{,}\) \(B = \set{\emptyset, 5, \pi}\text{,}\) \(C = \set{ 2, \pi, -\sqrt{7}, \set{2, - \sqrt{7}}}\text{,}\) and \(D = \set{2, -\sqrt{7}}\text{.}\)
  1. List three elements of \(C\times D\text{.}\)
  2. How many elements are in \(A\times B\text{?}\) How about \(B\times D\text{?}\)
  3. Describe \(A\times\emptyset\text{.}\)
  4. Let \(S,T\) be sets with \(|S| = m\) and \(|T| = n\text{.}\) Conjecture a formula for \(|S\times T|\text{,}\) and then prove your formula is correct.
We conclude this section with an exploration of some set-theoretic identities involving the Cartesian product.