Chapter 3

Set Theory

The mathematical logic that we’ve studied in the previous two chapters is foundational to all types of math. However, as demonstrated in the last few sections of Chapter 2, mathematicians rarely lay out all of the full, gory details when writing proofs. Instead, they rely on axioms, definitions, and previous theorems to work out the desired result. Occasionally, propositional logic may be used when doubts arise about the validity of a given proof, but that too is rare.

Something we’ve hinted at in the previous two chapters is that when we want to validate an argument, we start with some number of premises. Another way of stating this is that we start off with some initial collection, or set, of premises, and from those premises, we hopefully arrive at the desired conclusion. The group of premises we start off with may change from one argument to another, but in any case, we have a starting collection of premises no matter what argument we’re trying to build up.

The idea of a collection, or set, of objects underlies almost all of mathematics, whether that be a collection of premises (in mathematical logic), a collection of points (in geometry), a collection of possible outcomes for an experiment (in probability), or a collection of outputs for some given collection of inputs (mathematical relations). In this chapter, we start to define and work with these collections of objects, and what we can do with collections of objects in general. Even though mathematicians rarely describe all of the formal logic used in their arguments, any set-theoretic aspects are almost always explicitly laid out. Hence, getting a good understanding of Set Theory will be vital in learning to not only do mathematics, but to read mathematics as well.

Subsections of Set Theory

Sets

Trying to precisely define a set can be rather tricky. While there are formal definitions and axioms, here we will rely on our intuition. Even without a formal specification, we can still derive many useful results that hold up under scrutiny.

In this section, we’ll learn what a set is (intuitively), and how to describe what kinds of things are in a set.

Intuitively Defining a Set


Sets, or collections, of objects abound in daily life. We could speak of the set of fruits available for purchase at a local grocery store, the set of birds native to North America, the set of components used to build a specific computer, the set of roads from New York to Los Angeles, and so on. We can make note of a couple of things here:

  • The order in which we list the items in the collection doesn’t appear to be relevant. If we simply want to know what kinds of birds are native to North America, we can list the Wild Turkey before the Sandhill Crane, or the Sandhill Crane before the Wild Turkey.
  • If we accidentally list an item more than once, that also doesn’t affect the set we’re dealing with. For example, if we list I-80 W twice by accident, it doesn’t change the fact that I-80 W is still a road between New York and Los Angeles. Sometimes we may care about this when planning a trip, but not if we just want to know what roads exist between New York and Los Angeles.
  • However, if we miss an object — if it’s listed zero times — that does affect our set, because then our set is not complete. For example, if a local grocery store sells mangos but forgets to advertise them, they may lose out on customers who want to purchase mangos.

As such, the order in which we list elements from a set is irrelevant. The number of times we list an element from a set is also irrelevant. All we care about is whether or not an object is in a set or not.

Sets of objects also appear frequently in mathematics. We could speak of the set of numbers used to count objects, the set of points that make up a line in space, the collection of parabolas with real roots, the set of solutions to a system of equations, and so forth. Again, we don’t really care about the order in which these objects can be listed out, and we also don’t care if some objects from the set are listed more than once. However, in order to be a complete description, every possible object must be listed at least once.

SET, ELEMENT, MEMBER

A set is an unordered collection of well-defined objects.

Each object within the set is called an element, or member, of that set. We write

$$x \in A$$

to denote that object $x$ is a member of the set $A$. On the other hand, if some object $y$ is not in $A$, then we write

$$y \notin A.$$

By well-defined, what we mean is that, if presented with a description of some set $A$, we’re able to determine whether some given object — which we’ll refer to as $x$ — is an element of $A$, without any ambiguity.

Example 3.1.1: A set that isn’t well-defined

Suppose we were interested in forming sets of Major League Baseball players.

What kinds of players would we include if we wanted to form the set of “outstanding left-fielders”? The first thing we’d need to do is figure out which players are outstanding left-fielders. Well, who qualifies as an outstanding left-fielder? Are they the players who can throw with the most accuracy? If so, what’s the accuracy cutoff?

If accuracy isn’t the metric, what about running speed? How fast a player can run to catch a ball may be important. What about the ratio of caught balls to missed balls? How exactly do we decide who to include in the set of outstanding left-fielders?

The problem with a “set” such as “outstanding left-fielders” is that the term outstanding is vague. Since it’s not exactly clear how to determine who an outstanding left-fielder is, we have no well-defined criterion. As such, the above description does not define a set.

Let’s do something different. This time, let’s niche down into something like this:

$$\text{The set of all Major League Baseball players who hit at least 300 home runs in the 1990s.}$$

Here, all we have to do is check the records of players from the 1990s, and see who hit at least 300 home runs. Here are those players:

\[ \begin{array}{l} \text{Mark McGwire} \\ \text{Ken Griffey Jr.} \\ \text{Barry Bonds} \\ \text{Albert Belle} \\ \text{Juan Gonzalez} \\ \text{Sammy Sosa} \\ \text{Rafael Palmeiro} \\ \text{Jose Canseco} \\ \text{Frank Thomas} \\ \text{Fred McGriff} \\ \text{Matt Williams} \end{array} \]

Notice the difference: one description was vague and open to interpretation, so not everyone would agree on what players to include. The other description was specific, and could be verified against the available records — it wasn’t open to interpretation at all, since we offered a very specific metric, and only players meeting that requirement are included.

Typically, we use capital letters such as $A$, $B$, $C$, $\dots$, $X$, $Y$, and $Z$ to represent sets. That isn’t always the case, but it’s fairly common. In contrast, we typically use lowercase letters such as $a$, $b$, $c$, $\dots$, $x$, $y$, and $z$ to denote elements.

Something else worth noting is that we enclose the elements of a set within curly braces $\{\ \}$, as demonstrated in the next example.

Example 3.1.2: Testing membership in a well-defined set

Let’s revisit the set defined in the previous example — the only description that actually defined a set, that being the set of “Major League Baseball players who hit at least 300 home runs in the 1990s.”

Instead of repeatedly saying “the set of Major League Baseball players who hit at least 300 home runs in the 1990s,” we’ll use the capital letter $M$ to refer to that set:

$$M = \text{the set of Major League Baseball players who hit at least 300 home runs in the 1990s.}$$

We can use lowercase letters to refer to specific players:

\[ \begin{array}{rl} a\text{: } &\text{Joe DiMaggio} \\ b\text{: } &\text{Ken Griffey Jr.} \\ c\text{: } &\text{Babe Ruth} \\ d\text{: } &\text{Mark McGwire} \\ e\text{: } &\text{Mike Piazza} \\ f\text{: } &\text{Barry Bonds} \\ g\text{: } &\text{Rocky Marciano} \end{array} \]

We can go through and determine set membership for each of these players.

$a \notin M$, because Joe DiMaggio played baseball from 1936 to 1951, and so didn’t play baseball in the 1990s, meaning he didn’t hit at least 300 home runs in the 1990s.

$b \in M$, because Ken Griffey Jr. did hit at least 300 home runs in the 1990s. Even though he played baseball for a brief time in 1989, as well as for a long time in the 2000s, that’s irrelevant — we can still record how many home runs he hit in the 1990s alone, which was 382.

$c \notin M$, because Babe Ruth didn’t play baseball in the 1990s, and so didn’t hit at least 300 home runs in the 1990s.

$d \in M$, because Mark McGwire meets the requirement to be in $M$.

$e \notin M$, because even though Mike Piazza did play Major League Baseball in the 1990s, he didn’t hit enough home runs to be in $M$ (he hit 240, 60 short of the required 300).

$f \in M$, because Barry Bonds hit at least 300 home runs in the MLB in the 1990s. As such, he meets the requirement for membership in $M$.

$g \notin M$, because Rocky Marciano didn’t hit at least 300 home runs in the MLB in the 1990s. As a matter of fact, Rocky didn’t play baseball professionally at all — instead, he was the Heavyweight World Champion Boxer, active from 1947 to 1951. So not only is this the wrong sport, but the time frame is incorrect too.

Building a Set


There are two primary ways to describe what kinds of elements are within a set.

One way is to simply list them all. Of course, this method is only practical if the desired set contains a small number of elements, though it’s perhaps the most specific, and leaves absolutely nothing to the imagination.

Example 3.1.3: Listing every element of a set

Let $A$ denote the set

$$A = \{1, 3, 5, 7, 9, 11, 13, 15, 17\}.$$

Let $B$ denote the set

$$B = \{-12, -9, -6, -3\}.$$

Since order and repetition don’t matter when building a set, we also have that

\[ \begin{array}{lll} \boldsymbol{B} & = & \{-12, -9, -6, -3\} \\ & = & \{-3, -6, -9, -12\} \\ & = & \{-12, -9, -6, -12, -3, -3\} \end{array} \]

Since we explicitly state which elements are in each set, it’s extremely easy to determine if an element is in either set simply by inspection.

$3.14 \notin A$, because it isn’t one of the listed numbers in $A$.

$11 \in A$, because it’s explicitly listed within the set’s definition.

$-6 \in B$, because it’s explicitly listed in $B$’s definition.

$13 \notin B$, because it isn’t one of the listed numbers in $B$.

This method of building, or defining, a set is commonly called either the Roster Method, or the Exhaustive Method.

However, nothing stops us from defining sets that have infinitely many elements. When dealing with such a set, the Roster Method is somewhat inadequate on its own. We could list enough elements to make the pattern obvious, and finish with an ellipsis.

Example 3.1.4: Using an ellipsis for an infinite set

Let $A$ denote the set

$$A = \{2, 4, 6, 8, 10, 12, \dots\}.$$

When defining set $A$, all the numbers we listed are positive even integers, so we can reasonably assume that $A$ refers to the set of all positive even integers. Since there are infinitely many positive even integers, we have to use an ellipsis.

Let $B$ denote the set

$$B = \{1, 2, 4, 8, 16, 32, 64, \dots\}.$$

For $B$, it looks like all the numbers we listed are the non-negative integer powers of $2$:

$$B = \{2^0, 2^1, 2^2, 2^3, 2^4, 2^5, 2^6, \dots\}.$$

Hence, we can reasonably assume that $B$ refers to the set of all powers of $2$ where the exponent is a non-negative integer.

When using the Roster Method to list the first few elements of a set, it should be pretty clear what the pattern is. Anything that requires an elaborate setup to describe should be explicitly mentioned and described, so as to prevent confusion. Remember, it should be obvious what elements are in the set.

A few listed elements can still be ambiguous

Consider the set

$$\square = \{1, 2, 4, 8, 16, \dots\}$$

(here, we use the symbol $\square$ instead of a capital letter, for reasons that will become clear).

This almost looks like set $B$ from the previous example, defined using powers of $2$ — so we might think $\square$ is the set of all powers of $2$ where the exponent is a non-negative integer.

Let’s reveal the next number in this particular set:

$$\square = \{1, 2, 4, 8, 16, 31, \dots\}.$$

Hold on — $31$ isn’t an integral power of $2$! So $\square$ isn’t the set of all non-negative integer powers of $2$ after all.

So what is it, exactly? As it turns out, this particular sequence describes the maximum number of regions a circle can be divided into by placing points around its circumference, and connecting every pair of those points with a straight line — a classic, deceptively tricky combinatorics problem. Continuing the sequence a bit further:

$$\square = \{1, 2, 4, 8, 16, 31, 57, 99, 163, 256, \dots\}.$$

There is a formula for this sequence, but it involves something called “binomial coefficients,” which we’ll discuss later in this book — for now, it would look like complete gibberish.

The point is that, even though the first few terms of a listed set may seem to follow one pattern, there may be multiple patterns that fit, so listing only a few numbers at the start may not adequately describe the desired set. That’s exactly why we used the $\square$ symbol here — to signal that this is a misleading, ambiguous way to describe a set. Never be ambiguous when describing a set!

It’s because of this kind of ambiguity that another method of defining sets is more commonly used, called the Set-Builder Method. This method requires specifying a rule, or a list of conditions, that determine whether an element is a part of the set. Typically, this method looks something like this:

$$A = \{x \mid \text{condition}\}.$$

There are a few different parts to this notation, worth going over one at a time:

  • $A$ — the letter, or general symbol, we use to refer to the set.
  • $\{\ \}$ — the curly braces that enclose the definition of the set. Every set is enclosed by curly braces.
  • $x$ — the letter, or again some general symbol, we use to refer to some element within the set.
  • $\mid$ — this bar separates the listing of the element from the condition. When reading out the definition of a set, the vertical bar can be translated as “such that.”
  • $\text{condition}$ — specifies what must be true about $x$ for it to be an element of $A$. In other words, the condition is what we use to test whether some object is contained within $A$.

As such, when we see something like $A = \{x \mid \text{condition}\}$, we can read this as “$A$ refers to the set of all elements $x$ such that the condition is satisfied.” There’s some flexibility in how this method can be used, as demonstrated below.

Example 3.1.5: Using the Set-Builder Method

Here’s a typical example of the Set-Builder Method:

$$A = \{n \mid n \text{ is an even integer}\}.$$

Based on this definition, we see that $6 \in A$, $-12 \in A$, $100238 \in A$, and $-12300450678 \in A$, along with infinitely many other numbers. On the other hand, $1 \notin A$, $-13 \notin A$, $100343 \notin A$, $3.1415 \notin A$, and $-2.718 \notin A$, among infinitely many other numbers.

Sometimes, multiple conditions can be placed on a set using the conjunction operator discussed in Chapter 1, like so:

$$B = \{x \mid (x \text{ is an integer}) \land (x > 10)\}.$$

So, any number that’s simultaneously an integer and larger than $10$ is included in $B$. Thus $90 \in B$, $92 \in B$, and $100100 \in B$, and so on. On the other hand, $-2 \notin B$, $10 \notin B$, and $0.4335 \notin B$, because $-2$ isn’t larger than $10$, because $10$ isn’t larger than itself, and because $0.4335$ is neither an integer nor larger than $10$, so it fails both conditions.

It’s possible to specify one condition before the vertical bar in a set’s description, like so:

$$C = \{x \text{ is an integer} \mid x \leq -4\}.$$

Here, we’re implying that, before we even consider the usual condition, we’re presupposing that only integers can be included in $C$. In other words, this definition is equivalent to saying

$$C = \{x \mid (x \text{ is an integer}) \land (x \leq -4)\}.$$

Of course, we could use the disjunction operator as well:

$$D = \{x \mid (x \text{ is a multiple of } 0.4) \lor (x \text{ is a negative integer})\}.$$

As such, we find that $2.4 \in D$, $-12 \in D$, and $-100.4 \in D$, because $2.4$ is a multiple of $0.4$, because $-12$ is a negative integer (and a negative multiple of $0.4$), and because $-100.4$ is a multiple of $0.4$. However, $1 \notin D$, because $1$ is neither a multiple of $0.4$ nor a negative integer.

The Set-Builder Method is extremely useful for describing sets with infinitely many elements — but that doesn’t mean it isn’t useful for describing sets with finitely many elements too. This is especially true when there’s a large number of elements in the set.

Example 3.1.6: Using the Set-Builder Method for a large finite set

Consider the set

$$X = \{n \text{ is an integer} \mid n^2 < 100\}.$$

First, we know that we only have integers in $X$, since that’s a condition for set inclusion. The second condition is that the square of the integer must be less than $100$. We can check a few numbers to be sure:

\[ \begin{array}{l} 0^2 = 0 < 100 \\ 1^2 = 1 < 100 \\ 2^2 = 4 < 100 \\ 3^2 = 9 < 100 \\ 4^2 = 16 < 100 \\ 5^2 = 25 < 100 \end{array} \]

As a matter of fact, we know that the first integer $n$ where $n^2 \geq 100$ is $10$, since $10^2 = 100$. As such, all the positive integers less than $10$ are included in the set, and since negative integers have positive squares too, all the negative integers greater than $-10$ are included as well. We also verified $0 \in X$ above.

Any integer larger than $9$, or less than $-9$, won’t be included, because the smallest integer larger than $9$ is $10$, and $10^2$ is not less than $100$; similarly, the largest integer smaller than $-9$ is $-10$, and $(-10)^2$ is also not less than $100$.

As such, we know that all of the elements in $X$ are

$$X = \{0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, -6, 7, -7, 8, -8, 9, -9\}.$$

Even though we could just list them, the Set-Builder Method at least gives us a rule to decide whether some number belongs to the set — if we had simply listed the numbers, we wouldn’t know if there was some underlying condition, or if the numbers were chosen arbitrarily.

Of course, with a set like

$$Y = \{n \text{ is an integer} \mid n^2 \leq 1000000000000\},$$

it would take a long time to fully list out the elements. We still prefer the Set-Builder Method to describe $Y$, since it’s typically more succinct.

Example 3.1.7: Combining a formula with a condition

Consider the set

$$\Psi = \{n^3 \mid (n \text{ is an integer}) \land (n^2 < 100)\}$$

(here, we use the capital Greek letter psi, $\Psi$, just to add some variety to the names we’ve been giving our sets).

It looks like $\Psi$ consists of perfect cubes, but one of the conditions is that the square of the underlying integer must be less than $100$. Let’s examine the possibilities:

\[ \begin{array}{c|c|c} n & n^2 & n^3 \\ \hline 0 & 0 & 0 \\ \pm 1 & 1 & \pm 1 \\ \pm 2 & 4 & \pm 8 \\ \pm 3 & 9 & \pm 27 \\ \pm 4 & 16 & \pm 64 \\ \pm 5 & 25 & \pm 125 \\ \pm 6 & 36 & \pm 216 \\ \pm 7 & 49 & \pm 343 \\ \pm 8 & 64 & \pm 512 \\ \pm 9 & 81 & \pm 729 \end{array} \]

Any integer with absolute value $10$ or greater has a square of at least $100$, so we don’t need to examine any more integers. Since $\Psi$ doesn’t consist of these perfect squares, but instead the corresponding cubes, we have

$$\Psi = \{0, 1, -1, 8, -8, 27, -27, 64, -64, 125, -125, 216, -216, 343, -343, 512, -512, 729, -729\}.$$

Size of a Set

In the previous section, we saw sets that can have vastly different numbers of elements. Some sets have a finite number of elements, meaning that if we started to list out all of that set’s elements, we’d eventually be able to stop, having written down every element. In contrast, some sets have infinitely many elements, meaning that if we start listing elements and stop at any point in time, there would still be elements missing.

For finite sets, knowing the number of elements they contain can be useful.

CARDINALITY

For any finite set $A$, we use the notation

$$|A|$$

to refer to the number of elements in $A$. We refer to the number of elements in $A$ as the cardinality of $A$.

Even though we don’t yet speak of the cardinality of an infinite set, it’s technically correct to say that the cardinality of an infinite set like $\mathbb{Z}$ is countably infinite. This idea will be explored later, when we talk about the different special sets of numbers.

Example 3.2.1: Cardinality of finite and infinite sets

Consider the following sets:

\[ \begin{array}{rl} A = \{x^3 \mid (x \text{ is an integer}) \land (|x^3| < 100)\} & = \{1, -1, 8, -8, 27, -27, 64, -64\} \\ B = \{x^2 \mid (x \text{ is an integer}) \land (x^2 < 100)\} & = \{1, 4, 9, 16, 25, 36, 49, 64, 81\} \\ C = \{2n \mid n \text{ is an integer}\} & = \{0, 2, -2, 4, -4, 6, -6, 8, -8, 10, -10, \dots\} \end{array} \]

Both $A$ and $B$ are finite sets, so we can speak of their cardinalities: $|A| = 8$ and $|B| = 9$. We see that $C$ is an infinite set, so we don’t speak of its cardinality (yet).

Care must be taken when we’re dealing with sets that contain a wide variety of items. If a set has an element that is itself a set with multiple items, the elements of that inner set do not count towards the outer set’s cardinality.

Example 3.2.2: Cardinality with nested sets

Consider the set

$$X = \{a, b, c, 1, 2, 3, x, y, z, \{1, 2, 3\}, \{\{1\}, 2, 3\}, \{a\}\}.$$

This set has a wide variety of different types of objects: numbers, letters from the English alphabet (the $a$, $b$, $c$, $x$, $y$, and $z$ aren’t referring to variables in this particular case — just the letters themselves), and even a few sets!

Let’s list out each element of $X$ on its own line:

\[ \begin{array}{l} a \\ b \\ c \\ 1 \\ 2 \\ 3 \\ x \\ y \\ z \\ \{1, 2, 3\} \\ \{\{1\}, 2, 3\} \\ \{a\} \end{array} \]

Notice that the element $a$ is not the same thing as the element $\{a\}$: one is simply a letter, and the other is a set (containing that letter), so they’re entirely different elements. The same is true for the elements $1$, $2$, $3$, $\{1, 2, 3\}$, and $\{\{1\}, 2, 3\}$. The element $\{1, 2, 3\}$ is a set, and even though it contains several elements itself, it only counts as one element of $X$.

As such, there are no repeated elements in $X$, and since all twelve are distinct, they all count towards the cardinality of $X$, meaning

$$|X| = 12.$$

Of course, the set $\{1, 2, 3\}$ has its own cardinality: $|\{1, 2, 3\}| = 3$. But it’s still just $1$ set, and it only counts for $1$ element when considering the cardinality of $X$. Similarly, $|\{\{1\}, 2, 3\}| = 3$.

Contrast this with $|\{\{1\}, \{2, 3\}\}| = 2$, because the $2$ and the $3$ are included together in a single set within $\{\{1\}, \{2, 3\}\}$.

Subsets

A set can contain a wide variety of objects. They can contain objects that most people interact with on a daily basis — automotive parts that can be used to service a 1967 Camaro, tools used to carve statues out of wood, or art supplies needed to paint a picture. Likewise, they can contain a wide variety of mathematical objects, like numbers, shapes, or axioms.

Sometimes, we only care about some of the objects in a set. For example, we may only be interested in automotive parts needed to service a car’s headlights, or we may only be interested in art supplies needed for a fresco painting. Regardless, we’re able to build a lot of structure by constructing new sets from old ones — simply by restricting what elements are included in the new set. Here, we explore this kind of relationship between sets.

Starting with a Base Set


If we’re interested in selecting only some of the elements from a set, we’ll need to know what the original, or underlying, set contains. This is exactly the same idea behind the Universe of Discourse discussed when we studied open propositions in Chapter 1. There, a Universe of Discourse (or simply Universe) was the set of all values we allow to be substituted in for the variables of a propositional function.

It’s the exact same situation here. We even commonly use the same script letter $\mathcal{U}$ to denote the base set, though we can still use any symbol we want.

Example 3.3.1: Why a base set removes ambiguity

Suppose we were presented with the following set:

$$X = \{x \mid 1 \leq x \leq 10\}.$$

Is $1.5 \in X$?

It’s hard to tell without knowing what kinds of numbers we even want included in this set. Does it include all the real numbers between $1$ and $10$ inclusive? Or does it only include whole numbers from $1$ to $10$ inclusive?

Let’s remedy the situation by stating that set $X$ is only going to draw elements from the set $\mathcal{U}$ of all integers. Then we know that

$$X = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}.$$

Now that we have an established universe, we can simply write $X = \{x \mid 1 \leq x \leq 10\}$ without any ambiguity. We could also write $X = \{x \in \mathcal{U} \mid 1 \leq x \leq 10\}$, or even $X = \{x \mid (1 \leq x \leq 10) \text{ and } (x \in \mathcal{U})\}$. Because we’ve established a base set, all of these different ways of describing a set yield the exact same set $X$ of integers between $1$ and $10$ inclusive.

As such, since we now know what kinds of numbers we’re including in $X$, we can definitively say that $1.5 \notin X$.

Example 3.3.2: Changing the base set changes the resulting set

Reconsider the previous example, where we redefine $\mathcal{U}$ to be

$$\mathcal{U} = \{x \mid x \text{ is an even integer}\}.$$

In this case, since the allowable elements are the even integers, we have that

$$X = \{x \mid 1 \leq x \leq 10\} = \{2, 4, 6, 8, 10\}.$$

Alternatively, we could define $\mathcal{U}$ to be the set of all perfect squares:

$$\mathcal{U} = \{x \mid x \text{ is a perfect square}\} = \{1, 4, 9, 16, 25, 36, 49, 64, 81, 100, \dots\}.$$

If $\mathcal{U}$ was the set of all perfect squares, then we’d instead have

$$X = \{x \mid 1 \leq x \leq 10\} = \{1, 4, 9\}.$$

Subsets


The definition of a subset is closely related to what we’ve discussed so far in this section. We start with a universe of discourse, and then construct a set using only elements from that universe. We could go even further, constructing a third set by only taking elements from that second set.

SUBSET

If $A$ and $B$ are sets constructed using only elements of some given universe $\mathcal{U}$, we say that $A$ is a subset of $B$ if (and only if) every element of $A$ is also an element of $B$. When $A$ is a subset of $B$, we write

$$A \subseteq B.$$

Logically, we would write

$$\forall x\ [(x \in A) \Longrightarrow (x \in B)].$$

Alternatively, if $A$ is not a subset of $B$, we write

$$A \not\subseteq B.$$

Notice that the above definition uses a universally quantified logical implication. This offers us a chance to review logical implications, and what they mean in the context of sets and subsets. Since there’s a logical implication involved, the proposition

$$(x \in A) \to (x \in B)$$

is always true; thus, when we have $A \subseteq B$, there are only three scenarios to worry about:

\[ \begin{array}{c|c|c|l} x \in A & x \in B & (x \in A) \to (x \in B) & \textbf{Interpretation} \\ \hline 0 & 0 & 1 & \text{The element referred to by } x \text{ is in neither } A \text{ nor } B. \\ 0 & 1 & 1 & \text{The element referred to by } x \text{ is not in } A \text{, but is in } B. \\ 1 & 1 & 1 & \text{The element referred to by } x \text{ is in both } A \text{ and } B. \end{array} \]

Notice that there’s no row where $x \in A = 1$ and $x \in B = 0$ — since we’re asserting $A \subseteq B$, that scenario simply can’t happen.

Example 3.3.3: Confirming a subset relationship

Consider the universe $\mathbb{N}$ of all positive integers $\{1, 2, 3, 4, 5, 6, 7, 8, 9, \dots\}$. Now consider the following sets:

\[ \begin{array}{rl} X = \{x \mid x^2 \leq 100\} & = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\} \\ Y = \{y \mid y^2 \leq 37\} & = \{1, 2, 3, 4, 5, 6\} \end{array} \]

In order for $Y \subseteq X$, we need to verify that $\forall n\ [(n \in Y) \Longrightarrow (n \in X)]$.

If $n$ refers to anything that isn’t in $Y$, then $n \notin Y$, meaning $n \in Y = 0$, and hence $(n \in Y) \to (n \in X) = 1$ — so we don’t have to worry about checking elements that aren’t in $Y$. Let’s examine each element of $Y$, and see if it’s in $X$ as well:

\[ \begin{array}{c|c|c|c} n & n \in Y & n \in X & (n \in Y) \to (n \in X) \\ \hline 1 & 1 & 1 & 1 \\ 2 & 1 & 1 & 1 \\ 3 & 1 & 1 & 1 \\ 4 & 1 & 1 & 1 \\ 5 & 1 & 1 & 1 \\ 6 & 1 & 1 & 1 \end{array} \]

The column representing $(n \in Y) \to (n \in X)$ is all $1$s for each of the elements of $Y$. Hence it’s a tautology, meaning it’s a logical implication, and we can write $(n \in Y) \Longrightarrow (n \in X)$. Thus, we’ve shown that $Y$ is a subset of $X$, and we can write $Y \subseteq X$.

It’s also worth noting that we also have $X \subseteq \mathbb{N}$ and $Y \subseteq \mathbb{N}$.

Example 3.3.4: A set that is not a subset

Consider the universe $\mathbb{N}$ of all positive integers $\{1, 2, 3, 4, 5, 6, 7, 8, 9, \dots\}$. Now consider the following sets:

\[ \begin{array}{rl} X = \{x \mid x^2 \leq 100\} & = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\} \\ Y = \{y \mid y^2 \leq 145\} & = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12\} \end{array} \]

In order for $Y \subseteq X$, we’d need to verify that $\forall n\ [(n \in Y) \Longrightarrow (n \in X)]$. However, suppose we substituted $11$ in for $n$. We see that $11 \in Y$, but $11 \notin X$, meaning $(11 \in Y) \to (11 \in X) = 0$ — so we don’t have a logical implication, and $Y \not\subseteq X$.

However, we do have $X \subseteq Y$. Remember that a subset is a set in its own right — it just happens that all of that subset’s elements are also contained within some other set as well.

Every Set Is a Subset of Itself


It’s also natural to wonder whether a set counts as a subset of itself. Recall that $A \subseteq B$ requires every element of $A$ to also be an element of $B$ — in other words, that $(x \in A) \to (x \in B)$ holds for every $x$. When $B$ is $A$ itself, that condition becomes $(x \in A) \to (x \in A)$, which is always true, since any proposition implies itself. So every element of $A$ automatically satisfies the requirement for membership in $A$, which gives us the following theorem.

Theorem 3.3.1: Every set is a subset of itself

For any universe set $\mathcal{U}$, and set $A \subseteq \mathcal{U}$, we have that

$$A \subseteq A.$$
Proof 3.3.1

Consider some arbitrary element $x$ from $\mathcal{U}$. If we have $x \in A$, then obviously $x \in A$ (because we literally just considered that case). Thus, since every element contained in $A$ is (obviously) contained within $A$, the definition of subset tells us that $A \subseteq A$, as desired.

Example 3.3.5: Applying the theorem

Consider the set $B = \{x, y, z\}$, where $x$, $y$, and $z$ aren’t being used as variables here, but are simply the 24th, 25th, and 26th letters of the alphabet. By the previous theorem, we have that $\{x, y, z\} \subseteq \{x, y, z\}$.

Proper Subsets


Of course, when we assert $A \subseteq B$, all we’re saying is that whenever $x \in A$, we also have $x \in B$. However, this definition doesn’t say whether every single element of $B$ must be contained within $A$ too. We have a special term to describe when $A$ is a subset of $B$, but $B$ has elements not contained within $A$.

PROPER SUBSET

Consider two sets $A$ and $B$. $A$ is said to be a proper subset of $B$ if (and only if) every element contained within $A$ is also in $B$, but $B$ has at least one element that is not contained within $A$. We denote this by writing

$$A \subset B.$$

Logically, we would write this as

$$(\forall a \in A\ [a \in B]) \land (\exists b \in B\ [b \notin A]).$$
Example 3.3.6: Confirming a proper subset relationship

Consider the following sets:

\[ \begin{array}{rl} M\text{: } &\{x \mid x \text{ is an odd integer}\} \\ N\text{: } &\{x \mid x \text{ is an integer}\} \end{array} \]

Because every odd integer is a specific kind of integer, every element contained within $M$ is also an element of $N$, so we can write $M \subseteq N$. However, notice that $0 \in N$, but $0 \notin M$, meaning $N$ has at least one number not contained within $M$. So $M$ is a proper subset of $N$, and we can also write $M \subset N$.

Notice that by the previous example, for two sets $A$ and $B$, it’s possible for both $A \subseteq B$ and $A \subset B$ to be true. However, that’s not always the case, as demonstrated by the next example.

Example 3.3.7: A subset that is not a proper subset

Consider the set $\Psi = \{a, b, c, 1, 2, 3, x, y, z, \{1, 2, 3\}\}$. By the theorem above, we clearly have $\Psi \subseteq \Psi$. However, notice that we don’t have $\Psi \subset \Psi$: obviously any element contained within $\Psi$ is going to be contained within $\Psi$ (that’s tautologically true), but there’s no element within $\Psi$ that isn’t also contained within $\Psi$ (again, tautologically true). Thus, it’s not the case that $\Psi$ is a proper subset of itself — no set can be a proper subset of itself.

Now consider the set $\Omega = \{b, 1, z, \{1, 2, 3\}\}$. We can clearly see that every element contained within $\Omega$ is also an element of $\Psi$, so we can write $\Omega \subseteq \Psi$. Notice though that $a \in \Psi$, but $a \notin \Omega$, so we also have $\Omega \subset \Psi$.

Based on the previous two examples, it seems that if we know $A \subset B$, we also know $A \subseteq B$. Let’s formally show this is the case.

Theorem 3.3.2: A proper subset is also a subset

If $A \subset B$, then $A \subseteq B$.

Proof 3.3.2

Since we know $A \subset B$, we have by definition that for any element $a$ in $A$, $a$ will also be in $B$. Thus, by definition, we have $A \subseteq B$ as well.

Notice that if we know $A \subseteq B$, we don’t automatically know $A \subset B$. For example, we have $A \subseteq A$, but $A \not\subset A$.

The Empty Set

Just because we can put just about anything in a set doesn’t mean we need to have something in a set. There’s a special and unique kind of set that has no elements in it at all!

EMPTY SET, NULL SET

The empty set is the unique set containing no elements at all. The empty set is sometimes referred to as the null set, and is often symbolized by $\emptyset$.

The empty set is a very special set, and occurs throughout all of set theory, but it does have some interesting quirks that are a bit strange at first, though they become more natural as we work more and more with this kind of set.

First, note that because it’s a set containing nothing, we can write

$$\emptyset = \{\ \}.$$

There’s absolutely nothing written in between the curly braces, so we have, for example, that $\emptyset \neq \{0\}$ — above, we wrote a single number between the braces, and since $\{0\}$ is a set containing one item, it’s not equal to the empty set.

The second thing to note is that a set can have the empty set as one of its elements:

$$S = \{\emptyset\}.$$

Because $S$ is a set containing one element (that element itself being a set), we have $|S| = 1$. Thus, since $S$ contains at least one element, it’s not the same thing as the empty set, even though it’s the set containing the empty set: $S \neq \emptyset$. Comparing $S$ to $\emptyset$, since $\emptyset$ contains no elements, we have $|\emptyset| = 0$. If we substitute $\{\emptyset\}$ in for $S$, we see that $\{\emptyset\} \neq \emptyset$.

The Empty Set Is Always a Subset


Recall the definition of subset, which states that $A \subseteq B$ when every element in $A$ is also an element of $B$. In other words, $(n \in A) \to (n \in B)$ is always true. We use that definition, as well as the definition of the empty set, in our next theorem:

Theorem 3.4.1: The empty set is a subset of any set

For any universe $\mathcal{U}$, let $A$ be any set such that $A \subseteq \mathcal{U}$.

$$\emptyset \subseteq A$$
Proof 3.4.1

Let $x$ be any arbitrary element from $\mathcal{U}$. Because $\emptyset$ contains no elements, it’s impossible for $x \in \emptyset$, so it’s always true that $x \in \emptyset = 0$.

Notice that since $x \in \emptyset$ is always equal to $0$, we have that $(x \in \emptyset) \to (x \in A) = 0 \to (x \in A) = 1$. It doesn’t matter whether $x$ is an element of $A$ or not, because the hypothesis of the implication $x \in \emptyset$ is always false, meaning the overall implication always evaluates to true. Thus, $(x \in \emptyset) \Longrightarrow (x \in A)$, and so $\emptyset \subseteq A$, as desired.

Notice that in this theorem, we didn’t place any special requirements on set $A$ — it just had to be an arbitrary set constructed from some universe $\mathcal{U}$. Thus, by the Rule of Universal Generalization, since $A$ was arbitrary, and we have $\emptyset \subseteq A$, the empty set must be a subset of every possible conceivable set — including the universe $\mathcal{U}$ itself!

Example 3.4.1: Applying the theorem

By the previous theorem, for the set $A = \{1, 2, 3\}$, we have that

$$\{\ \} \subseteq A.$$

Proof Technique: Element Arguments

In the previous two sections, we provided proofs for two theorems (Theorem 3.4.1 and Theorem 3.3.1). Both proofs required that we select an arbitrary element from some set $A$, and show that because that arbitrarily chosen element satisfies some property, all elements of set $A$ satisfy that property. This is simply a rehash of the concept of Universal Specification and Universal Generalization as discussed in Chapter 2.

In this section, we adapt the methods of Universal Specification and Universal Generalization to a new, powerful proof technique we can use for sets.

The Underlying Argument


Here, we show off the basic structure of the argument that underlies an element argument.

Let’s suppose $p(x)$ and $q(x)$ are open statements defined on some set $A$ (here the set $A$ is acting like our universe set $\mathcal{U}$).

\[ \begin{array}{lll} \textbf{Step} & \textbf{Proposition} & \textbf{Reason} \\ (1) & \forall x \in A\ [p(x)] & \text{Premise} \\ (2) & c \in A & c \text{ is an arbitrarily chosen element from } A \\ (3) & p(c) & \text{Universal Specification on (1) and (2)} \\ (4) & p(c) \to q(c) & \text{Axiom, Definition, Premise, or Theorem} \\ (5) & q(c) & \text{Modus Ponens on (3) and (4)} \\ (6) & \therefore \forall x \in A\ [q(x)] & \text{Universal Generalization on (2) and (5)} \end{array} \]

Even though every element argument follows this basic structure, pay close attention to step (4). Notice that the reason given was either an axiom, definition, premise, or theorem. This is the part of the argument that changes with each and every property we’re trying to show is true for every element of some given set $A$. Depending on what we’re trying to show, we’ll need to bring in multiple axioms, definitions, premises, or theorems in order to reach the desired conclusion.

Typically, step (4) will be expanded into multiple steps, depending on how many axioms, definitions, and theorems are needed to get from proposition $p(c)$ to $q(c)$.

Some Straightforward Theorems


Here is one basic theorem whose proof relies on a fairly typical element argument.

Theorem 3.5.1: Transitivity of the subset relation

If $A \subseteq B$ and $B \subseteq C$, then $A \subseteq C$.

Proof 3.5.1

Let $x$ be an arbitrarily chosen element from $A$.

Because $x \in A$, and because $A \subseteq B$, we know that $x \in B$ as well.

Furthermore, because $x \in B$ and $B \subseteq C$, we must have that $x \in C$.

Thus, we’ve determined that for an arbitrarily chosen element $x$ from $A$, $x$ must also be an element of $C$, and so we must have that $A \subseteq C$ as desired.

Let’s rewrite this proof using the structure presented above.

\[ \begin{array}{lll} \textbf{Step} & \textbf{Proposition} & \textbf{Reason} \\ (1) & \forall x \in A\ [x \in B] & \text{Premise } A \subseteq B \\ (2) & x \in A & x \text{ is an arbitrarily picked element from } A \\ (3) & x \in B & \text{Universal Specification on (1) and (2)} \\ (4) & \forall x \in B\ [x \in C] & \text{Premise } B \subseteq C \\ (5) & x \in C & \text{Modus Ponens on (3) and (4)} \\ (6) & \therefore \forall x \in A\ [x \in C] & \text{Universal Generalization on (2) and (5)} \end{array} \]

This particular proof was a one-to-one translation of the basic structure of an element argument. Let’s look at a theorem that takes a little more work to prove.

Theorem 3.5.2: Transitivity of the proper-subset relation

If $A \subset B$ and $B \subset C$, then $A \subset C$.

Proof 3.5.2

General Strategy: Looking at the definition of proper subset, there are essentially two things we need to do. First, we show that every element of $A$ is also an element of $C$, meaning $A \subseteq C$. Next, we show that there is an element in $C$ that is not in $A$. Thus, the definition of proper subset will be satisfied.

Step 1: Show that $A \subseteq C$.

Let $x \in A$ be an arbitrarily picked element of $A$. Because $A \subset B$, Theorem 3.3.2 also tells us that $A \subseteq B$. As such, we also have that $x \in B$.

Furthermore, because $B \subset C$, Theorem 3.3.2 tells us that $B \subseteq C$ as well. As such, since $x \in B$ and $B \subseteq C$, we also have that $x \in C$.

Thus, since any arbitrarily picked element of $A$ is also an element of $C$, we know that $A \subseteq C$.

Step 2: Show that there is an element in $C$ that is not in $A$.

Because we know that $B \subset C$, there exists an element $y$ that is in $C$ that is not in $B$; in other words,

$$\exists y \in C\ [y \notin B].$$

Furthermore, since we know that $A \subseteq B$ and $y \notin B$, we also know that $y \notin A$ as well.

Conclusion. At this point, we have shown that $A \subseteq C$, and that $\exists y \in C\ [y \notin A]$. Thus by definition, we have that

$$A \subset C$$

as desired.

This proof required that we give a name to an element we knew existed — namely, an element that was contained within $C$, but was not contained within $B$, and as such not contained in $A$ either. There’s a special name we give to this situation, which we describe below.

Existential Specification and Existential Generalization


When we discussed quantifiers, we talked about two different kinds: those of the universal variety, and those of the existential variety. The Universal Quantifier has its own specification and generalization schemes, and the Existential Quantifier naturally has its own counterparts.

The concept of Existential Specification comes into play when we know some element exists, and in order to manipulate that element, we simply give it a name. In other words, if we know that

$$\exists x \in \mathcal{U}\ [p(x)] = 1,$$

then we can simply use a symbol to refer to that particular element where $p(x)$ is a true statement. The exact symbol chosen doesn’t matter: it could be the letter $c$, a Greek letter like $\beta$, or some geometrical symbol like $\square$ — just as long as we’re consistent with what symbol is used. For example, knowing that $\exists x \in \mathcal{U}\ [p(x)]$ is true, we could use the letter $c$ to denote the particular element within $\mathcal{U}$ such that

$$p(c) = 1.$$

The concept of Existential Generalization is essentially the reverse of Existential Specification. If we know that the particular element $c \in \mathcal{U}$ makes the open statement $p(x)$ true, meaning $p(c) = 1$, then we know that some element exists that makes $p(x)$ a true statement (because we identified such an element), meaning we know that

$$\exists x \in \mathcal{U}\ [p(x)] = 1.$$

We implicitly used Existential Specification and Existential Generalization in the proof for Theorem 3.5.2. Since we’re discussing a general proof strategy, let’s write out a formal argument in tabular format, as we’ve previously done for Theorem 3.5.2:

\[ \begin{array}{lll} \textbf{Step} & \textbf{Proposition} & \textbf{Reason} \\ (1) & A \subset B & \text{Premise} \\ (2) & A \subseteq B & \text{Theorem 3.3.2 on (1)} \\ (3) & B \subset C & \text{Premise} \\ (4) & B \subseteq C & \text{Theorem 3.3.2 on (3)} \\ (5) & A \subseteq C & \text{Theorem 3.5.1 on (2) and (4)} \\ (6) & (\forall b \in B\ [b \in C]) \land (\exists c \in C\ [c \notin B]) & \text{Definition of } B \subset C \text{ on (3)} \\ (7) & \exists c \in C\ [c \notin B] & \text{Conjunctive Simplification on (6)} \\ (8) & (y \in C) \land (y \notin B) & \text{Existential Specification on (7)} \\ (9) & y \notin B & \text{Conjunctive Simplification on (8)} \\ (10) & y \notin A & \text{Modus Tollens on (2) and (9)} \\ (11) & \exists c \in C\ [c \notin A] & \text{Existential Generalization on (10)} \\ (12) & (A \subseteq C) \land (\exists c \in C\ [c \notin A]) & \text{Conjunction on (5) and (11)} \\ (13) & (\forall a \in A\ [a \in C]) \land (\exists c \in C\ [c \notin A]) & \text{Definition of } A \subseteq C \text{ on (12)} \\ (14) & \therefore A \subset C & \text{Definition of } A \subset C \text{ on (13)} \end{array} \]

As can be seen, even though we can formally lay out every step of our proof in a tabular format, the paragraph format presented above is perhaps more readable and less cumbersome to write.

Two Additional Theorems


We’ve already examined the theorems

\[ \begin{array}{l} [(A \subset B) \land (B \subset C)] \Longrightarrow (A \subset C) \end{array} \]

and

\[ \begin{array}{l} [(A \subseteq B) \land (B \subseteq C)] \Longrightarrow (A \subseteq C). \end{array} \]

We could naturally examine situations involving both regular subsets and proper subsets.

Theorem 3.5.3: Combining subset and proper-subset transitivity, part one

If $A \subseteq B$ and $B \subset C$, then $A \subset C$.

Proof 3.5.3

Because $B \subset C$, invoking Theorem 3.3.2 yields the fact that $B \subseteq C$. Thus, because we know that $A \subseteq B$ and $B \subseteq C$, Theorem 3.5.1 tells us that $A \subseteq C$.

Now, because $B \subset C$, we know there exists some $c \in C$ such that $c \notin B$. But because we also know that $A \subseteq B$, we also know that $c \notin A$ as well.

Thus, because we know that $A \subseteq C$ and there is an element $c \in C$ such that $c \notin A$, we know that $A \subset C$ by definition as desired.

Theorem 3.5.4: Combining subset and proper-subset transitivity, part two

If $A \subset B$ and $B \subseteq C$, then $A \subset C$.

Proof 3.5.4

Just as in the proof for Theorem 3.5.3, we know that $A \subseteq C$.

Because $A \subset B$, we know there is some element $b \in B$ such that $b \notin A$. But because $B \subseteq C$, we know that $b \in C$ as well.

Thus, because we know that $A \subseteq C$ and there is an element $b \in C$ such that $b \notin A$, we know that $A \subset C$ by definition as desired.

Element arguments represent a powerful proof technique because they give us a way to account for what elements are in what sets, which will be an important skill in the upcoming sections when we start to talk about how we can combine and operate on sets.

Remember that when we talk about a set, what we care about is whether some given object is a member of that set or not, so by picking an arbitrary element, we can use the subset relationships discussed so far to determine if that element is a member of any other set.

A Set of Operations on Sets

We’ve discussed how to construct new sets by simply taking some of the elements from one set and putting them into a new set. While subsets are vitally important not only in Set Theory but throughout all of mathematics, subsets are formed by only considering one set at a time.

We can construct a wide variety of sets by considering two or more sets at a time. In this section, we learn what kinds of sets we can construct by considering more than one set at a time.

Complement


Before we talk about more than one set at a time, let’s talk about one more operation that only relies on one set. Technically, it does require two sets, because this particular operation requires knowing what universe is being considered — every element in the universe that isn’t in $A$ ends up in $A$’s complement.

COMPLEMENT

Consider a set $A$ consisting of elements taken from some universal set, denoted $\mathcal{U}$.

The complement of $A$, often denoted $A^C$ or $\overline{A}$, is the set of all elements in $\mathcal{U}$ that are not in $A$. In other words, we have that

$$A^C = \overline{A} = \{x \in \mathcal{U} \mid x \notin A\}.$$

The idea of set complement is really simple: we take all elements within $\mathcal{U}$ that are not in $A$, and put all of those elements in a new set we usually call either $A^C$ or $\overline{A}$, though occasionally other names are used.

Example 3.6.1: Finding a complement

Consider a universal set $\mathcal{U}$ consisting of all the whole numbers from $0$ to $10$ inclusive, meaning

$$\mathcal{U} = \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}.$$

Now consider the set $S$ of all perfect squares contained within $\mathcal{U}$, meaning we have

$$S = \{0, 1, 4, 9\}.$$

We then get that

$$S^C = \{2, 3, 5, 6, 7, 8, 10\}.$$

Of course, the essential property we care about when it comes to sets is whether a specific element is a member of that set or not. How do we tell that an element $x$ is in $A^C$ or not? Based on the definition of complement, we see that the following logical equivalency is used to test if $x$ is in $A$’s complement:

$$(x \in A^C) \Longleftrightarrow [(x \in \mathcal{U}) \land (x \notin A)]$$
Example 3.6.2: Testing membership in a complement

Reconsider the sets mentioned in the previous example:

\[ \begin{array}{rl} \mathcal{U} &= \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\} \\ S &= \{0, 1, 4, 9\} \end{array} \]

Is $5$ in $S$ or in $S^C$? Of course $5 \in \mathcal{U}$, so it will either be in $S$ or $S^C$. $S$ was defined to be the set of all elements from $\mathcal{U}$ that are perfect squares. Since $5 \in \mathcal{U}$ and $5$ is not a perfect square, we know that

$$5 \in S^C.$$

Now consider the number $9$. Because $9 \in \mathcal{U}$ and $9$ is a perfect square ($9 = 3^2$), we have that

$$9 \notin S^C.$$

What about a number like $1.5$? Remember that $\mathcal{U}$ only consists of whole numbers between $0$ and $10$. Since $1.5$ is not a whole number, we have that $1.5 \notin \mathcal{U}$, and as such we have that

\[ \begin{array}{rl} 1.5 \notin S & \\ 1.5 \notin S^C & \end{array} \]

Similarly, because $-12 \notin \mathcal{U}$, we also have that

\[ \begin{array}{rl} -12 \notin S & \\ -12 \notin S^C & \end{array} \]

Union


Now that we’ve talked about what’s outside a set, we can start to consider what happens when we combine two sets into one.

The first thing we can do is take all elements from two different sets, and simply mash them all up into one set.

UNION

Consider two sets $A$ and $B$ composed of elements from some universal set $\mathcal{U}$.

The union of sets $A$ and $B$, denoted $A \cup B$, is the set

$$A \cup B = \{x \in \mathcal{U} \mid (x \in A) \lor (x \in B)\}.$$

As long as an element is in $A$ or $B$, or even both $A$ and $B$, it will be included in the union of $A$ and $B$.

Example 3.6.3: Computing a union

Let’s consider some universal set, which we’ll refer to as $\mathcal{N}$, consisting of the whole numbers from $0$ to $100$ inclusive, meaning

$$\mathcal{N} = \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \dots, 98, 99, 100\}.$$

Now consider the following sets:

\[ \begin{array}{rl} S &= \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100\} \\ C &= \{0, 1, 8, 27, 64\} \end{array} \]

For clarity, the set $S$ is the set of all perfect squares contained in $\mathcal{N}$, and $C$ is the set of all perfect cubes contained within $\mathcal{N}$.

The union of sets $S$ and $C$ is simply the set containing all the elements from $S$ or $C$, or even both. As such, we get that

$$S \cup C = \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 0, 1, 8, 27, 64\}.$$

Even though in some sense the above set is correct, remember that when dealing with a set, order and repetition are irrelevant. As such, we can simplify how the set is written:

\[ \begin{array}{llll} \boldsymbol{S \cup C} & = & \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 0, 1, 8, 27, 64\} & \\ & = & \{0, 0, 1, 1, 4, 8, 9, 16, 25, 27, 36, 49, 64, 64, 81, 100\} & \text{Ordering the elements} \\ & = & \{0, 1, 4, 8, 9, 16, 25, 27, 36, 49, 64, 81, 100\} & \text{Eliminating duplicates} \end{array} \]

In simplifying how we wrote the set referred to by $S \cup C$, we started by ordering all the numbers (because order is irrelevant), which makes it easy to see any duplicate entries. After seeing where the duplicates were, we were able to eliminate them (because repetition is irrelevant).

One situation not yet considered is when one set is entirely contained within another. Because a union consists of elements contained in either set, this means that the union will actually just be whichever set contains the other one — since every element of the smaller set is already an element of the larger one, unioning them adds nothing new.

Example 3.6.4: A union where one set contains the other

Consider the sets

\[ \begin{array}{rl} \mathcal{N} &= \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \dots, 98, 99, 100\} \\ S &= \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100\} \\ Q &= \{0, 1, 16, 81\} \end{array} \]

where $\mathcal{N}$ is the universal set under consideration. Here, $S$ represents perfect squares within $\mathcal{N}$, and $Q$ is the set of all perfect fourth powers contained in $\mathcal{N}$. Because every element in $Q$ is also in $S$, there’s no difference between

$$S \cup Q = \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100\}$$

and $S$.

Intersection


Another kind of set we can compose from two other sets is to take elements that are in both sets. Here, we’re not taking elements that are present in either set; instead, we demand that the elements are present in both sets.

INTERSECTION

Consider two sets $A$ and $B$ composed of elements from some universal set $\mathcal{U}$.

The intersection of sets $A$ and $B$, denoted $A \cap B$, is the set

$$A \cap B = \{x \in \mathcal{U} \mid (x \in A) \land (x \in B)\}.$$

Just like with the union of two sets, we’d like to determine if an element $x$ is contained within the intersection of two sets. There’s a logical equivalency we can use to determine if element $x$ is contained within $A \cap B$:

$$(x \in A \cap B) \Longleftrightarrow ((x \in A) \land (x \in B)).$$

Before continuing on, it’s worth pointing out the similarity between the union and intersection symbols and the logical or and and operators, respectively:

\[ \begin{array}{rl} \cup \text{ pairs with } &\lor \\ \cap \text{ pairs with } &\land \end{array} \]
Example 3.6.5: Computing an intersection

Going back to the example above, we have the following sets:

\[ \begin{array}{rl} \mathcal{N} &= \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \dots, 98, 99, 100\} \\ S &= \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100\} \\ C &= \{0, 1, 8, 27, 64\} \end{array} \]

To figure out what elements are in $S \cap C$, we simply look for elements that are in both $S$ and $C$:

$$S \cap C = \{0, 1, 64\}.$$

When two sets in question don’t overlap at all, there’s nothing in the intersection. Of course, this means that the set $A \cap B$ has nothing in it, or in other words,

$$A \cap B = \{\ \} = \emptyset.$$

This means that the intersection of two sets with nothing in common is simply the empty set.

Example 3.6.6: An intersection that is empty

Reconsider the sets

\[ \begin{array}{rl} \mathcal{N} &= \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \dots, 98, 99, 100\} \\ X &= \{1, 9, 25, 49, 81\} \\ Y &= \{0, 8, 64\} \end{array} \]

where $X$ is the set of odd perfect squares in $\mathcal{N}$, and $Y$ is the set of even perfect cubes in $\mathcal{N}$. Since $X$ and $Y$ share no elements in common, we have that

$$X \cap Y = \emptyset.$$

When one of $A$ or $B$ is a subset of the other, the intersection will end up just being whichever set was the subset.

Example 3.6.7: An intersection where one set contains the other

Consider the sets

\[ \begin{array}{rl} \mathcal{N} &= \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \dots, 98, 99, 100\} \\ S &= \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100\} \\ Q &= \{0, 1, 16, 81\} \end{array} \]

We see that

$$S \cap Q = \{0, 1, 16, 81\} = Q.$$

Difference


It’s possible that we may want to exclude certain elements from the universe within any sets we construct. Of course, any given set can contain any element from the universe, whether or not we want it included. One thing we can do to remedy such a situation is to collect all of the elements we want excluded in a special set, which we’ll refer to as $B$ for now (an “exclusion set”). Then, for some given set we’ll call $A$, we can make a new set by removing all elements from $A$ that are also in $B$. This gives us a new set containing all elements from $A$ that we don’t want excluded.

DIFFERENCE

Consider two sets $A$ and $B$ containing elements from some universal set $\mathcal{U}$.

The difference from $B$ to $A$, which we’ll denote $A - B$, is the set of all elements in $A$ that are not in $B$. In other words,

$$A - B = \{x \in \mathcal{U} \mid (x \in A) \land (x \notin B)\}.$$

$A - B$ consists of whatever’s left of $A$ once every element $A$ shares with $B$ — that is, every element of $A \cap B$ — has been removed.

Once again, there’s a logical equivalency we can use to determine if a given object is contained in the set $A - B$:

$$(x \in A - B) \Longleftrightarrow ((x \in A) \land (x \notin B)).$$
Example 3.6.8: Computing a difference

Reconsider the sets

\[ \begin{array}{rl} \mathcal{N} &= \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \dots, 98, 99, 100\} \\ S &= \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100\} \\ C &= \{0, 1, 8, 27, 64\} \end{array} \]

where $\mathcal{N}$ is the universal set, from which sets $S$ and $C$ share elements.

In order to determine which elements are in $S - C$, we start with $S$, and take away any elements that are also in $C$. What we could do is look at the intersection of $S$ and $C$:

$$S \cap C = \{0, 1, 64\}.$$

Now, all we have to do is copy $S$, but remove all those elements that are in $S \cap C$:

$$S - C = \{4, 9, 16, 25, 36, 49, 81, 100\}.$$

We can do the same thing for $C - S$. We simply start with $C$, and take away elements that are also in $S$ (remember that all the common elements are in $S \cap C$):

$$C - S = \{8, 27\}.$$

Care should be taken when one of the sets is a subset of the other (in other words, when one of the sets is entirely contained within the other). If $B$ is a subset of $A$, then $A - B$ consists of exactly those elements of $A$ that aren’t also in $B$. But if $A$ is entirely contained within $B$, we’d have to remove every element of $A$, leaving us with the empty set $\emptyset$.

Example 3.6.9: A difference resulting in the empty set

Consider the sets

\[ \begin{array}{rl} \mathcal{N} &= \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \dots, 98, 99, 100\} \\ S &= \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100\} \\ E &= \{0, 4, 16, 36, 64, 100\} \end{array} \]

where $\mathcal{N}$ is the universal set being used.

By definition, we have that

$$S - E = \{1, 9, 25, 49, 81\}$$

since we’re trying to remove all of the even perfect squares from $S$.

However, notice that since every element in $E$ is also an element in $S$, when we determine $E - S$, we must remove every element in $E$. Basically, we start with every element in $E$, and since we’re removing every element in $E$, we’re left with nothing in $E - S$, which is just the empty set:

$$E - S = \emptyset.$$

Based on the previous example, it seems that if $A \subseteq B$, then $A - B = \emptyset$. Is that true for every single set? In a later section, we’ll start to use element-argument-style proofs to determine if that’s indeed the case, but for now, our intuition on the matter seems clear.

Symmetric Difference


With set difference, we only consider elements that are in $A$ but not in $B$. With a symmetric difference, we instead want elements that are either in $A$ and not in $B$, or in $B$ and not in $A$.

SYMMETRIC DIFFERENCE

Consider two sets $A$ and $B$ containing elements from some universal set $\mathcal{U}$.

The symmetric difference between $A$ and $B$, denoted $A \triangle B$, is the set

$$A \triangle B = \{x \in \mathcal{U} \mid ((x \in A) \land (x \notin B)) \lor ((x \notin A) \land (x \in B))\}.$$

The symmetric difference consists of everything covered by the union of $A$ and $B$, except whatever’s also covered by their intersection — in other words,

$$A \triangle B = (A \cup B) - (A \cap B).$$

Of course, we can examine given objects to determine membership in such a set:

$$(x \in A \triangle B) \Longleftrightarrow [((x \in A) \land (x \notin B)) \lor ((x \notin A) \land (x \in B))].$$
Example 3.6.10: Testing membership in a symmetric difference

Reconsider the sets

\[ \begin{array}{rl} \mathcal{N} &= \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \dots, 98, 99, 100\} \\ S &= \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100\} \\ C &= \{0, 1, 8, 27, 64\} \end{array} \]

Is $8 \in S \triangle C$? Let’s check the necessary conditions:

\[ \begin{array}{rl} 8 \in S = 0 & 8 \notin S = 1 \\ 8 \in C = 1 & 8 \notin C = 0 \\ (8 \in S) \land (8 \notin C) = 0 \land 0 &= 0 \\ (8 \notin S) \land (8 \in C) = 1 \land 1 &= 1 \end{array} \]\[ ((8 \in S) \land (8 \notin C)) \lor ((8 \notin S) \land (8 \in C)) = 0 \lor 1 = 1 \]

Because this comes out to $1$, we have that $8 \in S \triangle C$ as desired.

We can ask the same thing of $64$. Let’s run through the calculations again, this time using $x = 64$:

\[ \begin{array}{rl} 64 \in S = 1 & 64 \notin S = 0 \\ 64 \in C = 1 & 64 \notin C = 0 \\ (64 \in S) \land (64 \notin C) = 1 \land 0 &= 0 \\ (64 \notin S) \land (64 \in C) = 0 \land 1 &= 0 \end{array} \]\[ ((64 \in S) \land (64 \notin C)) \lor ((64 \notin S) \land (64 \in C)) = 0 \lor 0 = 0. \]

Because this comes out to $0$, we have that $64 \notin S \triangle C$.

Examining all elements in $\mathcal{N}$, we see that

$$S \triangle C = \{4, 8, 9, 16, 25, 27, 36, 49, 81, 100\}.$$

When one set is a subset of the other, the symmetric difference essentially carves the smaller set out of the larger one — it’s called a symmetric difference because it’s essentially a difference between the larger set and the subset.

Example 3.6.11: A symmetric difference is commutative

Consider the sets

\[ \begin{array}{rl} \mathcal{N} &= \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \dots, 98, 99, 100\} \\ S &= \{0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100\} \\ E &= \{0, 4, 16, 36, 64, 100\} \end{array} \]

where $\mathcal{N}$ is the universal set in question.

We see that

$$S \triangle E = \{1, 9, 25, 49, 81\}.$$

Since we only want elements that are in $S$ and not $E$, or elements that are in $E$ and not $S$, we also have that

$$E \triangle S = \{1, 9, 25, 49, 81\}$$

as well.

We saw in the previous example that $S \triangle E$ and $E \triangle S$ ended up being the exact same set. Is that always the case? In a later section, we’ll use an element argument to demonstrate that this observation does indeed hold in general.

Multiple Unions and Intersections


We can combine as many sets into a new set as we want. However, before we start combining multiple sets into one, we should recognize that dealing with multiple sets can be cumbersome. First of all, imagine having to deal with multiple sets with a wide variety of names that were hard to track. We can mitigate this issue by coming up with a naming scheme that makes each set we’re dealing with easy to track.

INDEX SET, INDEX

Consider some universal set $\mathcal{U}$.

Let $I$ be a non-empty set of objects that are not necessarily taken from $\mathcal{U}$, and for each $i \in I$, let

$$A_i \subseteq \mathcal{U}.$$

The set $I$ is called an index set, and every $i \in I$ is called an index.

Before looking at an example, let’s stress the fact that an index set is basically used to enumerate and track sets, and so doesn’t necessarily need to be taken from some universal set (though it could be taken from its own particular universal set).

Example 3.6.12: Naming several sets with an index set

Consider the universe $\mathbb{Z}$ of all whole numbers, including $0$ and all negative whole numbers:

$$\mathbb{Z} = \{0, 1, -1, 2, -2, 3, -3, 4, -4, \dots\}.$$

We could deal with a number of sets called $A$, $B$, $C$, $D$, and $E$ where

\[ \begin{array}{rl} A &= \{2, 4, 6, 8, 10\} \\ B &= \{-1, 0, 1, 2, 3, 4, 5\} \\ C &= \{1, 2, 7, 8\} \\ D &= \{1, 3, 4\} \\ E &= \{-5, -12, -13\} \end{array} \]

We could even have more exotic names, like $\Lambda$, $M$, $\Phi$, $\Psi$, and $\clubsuit$, but this would be unnecessarily tedious (though there may be times where such names would be useful).

Instead, what we could do is recognize that since we’re dealing with $5$ sets, we could come up with an index set containing $5$ elements, like so:

$$I = \{1, 2, 3, 4, 5\}.$$

Then, instead of using $5$ different set names, we can simply use one symbol, marked with the indices from the index set:

\[ \begin{array}{rl} A_1 &= \{2, 4, 6, 8, 10\} \\ A_2 &= \{-1, 0, 1, 2, 3, 4, 5\} \\ A_3 &= \{1, 2, 7, 8\} \\ A_4 &= \{1, 3, 4\} \\ A_5 &= \{-5, -12, -13\} \end{array} \]

Notice that in this case, we have that $A_1, A_2, A_3, A_4, A_5 \subseteq \mathbb{Z}$, but we also have that $I \subseteq \mathbb{Z}$, even though we don’t need that to be the case.

Example 3.6.13: An index set that is not a subset of the universe

Reconsider the set $\mathbb{Z} = \{0, 1, -1, 2, -2, 3, -3, 4, -4, \dots\}$. Now consider the index set

$$I = \{a, b, c, d, e\}.$$

Then we could have the following sets:

\[ \begin{array}{rl} A_a &= \{2, 4, 6, 8, 10\} \\ A_b &= \{-1, 0, 1, 2, 3, 4, 5\} \\ A_c &= \{1, 2, 7, 8\} \\ A_d &= \{1, 3, 4\} \\ A_e &= \{-5, -12, -13\} \end{array} \]

where $A_a, A_b, A_c, A_d, A_e \subseteq \mathbb{Z}$, but this time, $I \not\subseteq \mathbb{Z}$.

Example 3.6.14: An unusual index set

Once again, reconsider the set $\mathbb{Z} = \{0, 1, -1, 2, -2, 3, -3, 4, -4, \dots\}$. We can make the index set anything we want, such as

$$I = \{1, a, x, \boxminus, \star\}.$$

Then we have

\[ \begin{array}{rl} A_1 &= \{2, 4, 6, 8, 10\} \\ A_a &= \{-1, 0, 1, 2, 3, 4, 5\} \\ A_x &= \{1, 2, 7, 8\} \\ A_\boxminus &= \{1, 3, 4\} \\ A_\star &= \{-5, -12, -13\} \end{array} \]

where $A_1, A_a, A_x, A_\boxminus, A_\star \subseteq \mathbb{Z}$. This time, even though we have $I \not\subseteq \mathbb{Z}$, there’s at least one element in $I$ that’s also in $\mathbb{Z}$.

It’s worth noting that this kind of index set is impractical, and so won’t be used going forward unless there’s some niche application where it would be useful.

With an index set to help us, working with multiple sets is easy.

MULTIPLE UNION

Consider a universal set $\mathcal{U}$, along with an index set $I$ where for each $i \in I$, we have that $A_i \subseteq \mathcal{U}$.

The multiple union of all $A_i$ is denoted

$$\bigcup_{i \in I} A_i.$$

If the index set is defined using the whole numbers $I = \{1, 2, 3, \dots, n\}$, then we can write this multiple union as

$$\bigcup_{i=1}^{n} A_i.$$

As always, if we want to check to see if a given object is in this set, all we have to do is check to see if that object is in at least one of the sets making up the multiple union:

$$(x \in \bigcup_{i \in I} A_i) \Longleftrightarrow (\exists i \in I\ [x \in A_i]).$$

Of course, if the index set uses whole numbers starting from $1$ and ending at $n$, we can instead write this logical equivalency as

$$(x \in \bigcup_{i=1}^{n} A_i) \Longleftrightarrow (\exists i \in \{1, \dots, n\}\ [x \in A_i]).$$
Example 3.6.15: Computing a multiple union

Once again, reconsider the set $\mathbb{Z} = \{0, 1, -1, 2, -2, 3, -3, 4, -4, \dots\}$, with the following index set:

$$I = \{1, 2, 3, 4\},$$

along with the following sets:

\[ \begin{array}{rl} A_1 &= \{2, 4, 6, 8, 10\} \\ A_2 &= \{-1, 0, 1, 2, 3, 4, 5\} \\ A_3 &= \{1, 2, 4, 7, 8\} \\ A_4 &= \{1, 3, 4\} \end{array} \]

Is $8$ in the multiple union of $A_1$, $A_2$, $A_3$, and $A_4$? We can check to see if $8$ is in at least one of them:

$$(8 \in A_1) \lor (8 \in A_2) \lor (8 \in A_3) \lor (8 \in A_4) = 1 \lor 0 \lor 1 \lor 0 = 1$$

As such, we see that $8$ is indeed in the multiple union of $A_1$, $A_2$, $A_3$, and $A_4$.

However, when it comes to a number like $13$, we see that

$$(13 \in A_1) \lor (13 \in A_2) \lor (13 \in A_3) \lor (13 \in A_4) = 0 \lor 0 \lor 0 \lor 0 = 0$$

and so $13$ is not in the multiple union of $A_1$, $A_2$, $A_3$, and $A_4$.

We can just go ahead and determine the entire multiple union:

\[ \begin{array}{lll} \boldsymbol{A_1 \cup A_2 \cup A_3 \cup A_4} & = & \{2, 4, 6, 8, 10\} \cup \{-1, 0, 1, 2, 3, 4, 5\} \cup \{1, 2, 4, 7, 8\} \cup \{1, 3, 4\} \\ = & \{2, 4, 6, 8, 10, -1, 0, 1, 2, 3, 4, 5, 1, 2, 4, 7, 8, 1, 3, 4\} & \text{Combining all elements} \\ = & \{-1, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 4, 5, 6, 7, 8, 8, 10\} & \text{Ordering the elements} \\ = & \{-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10\} & \text{Eliminating duplicates} \end{array} \]

Another way we can write the set representing the multiple union is

$$\{x \in \mathcal{U} \mid \exists i \in I\ [x \in A_i]\}.$$

Naturally, there’s an intersection counterpart to the multiple union.

MULTIPLE INTERSECTION

Consider a universal set $\mathcal{U}$, along with an index set $I$ where for each $i \in I$, we have that $A_i \subseteq \mathcal{U}$.

The multiple intersection of all $A_i$ is denoted

$$\bigcap_{i \in I} A_i.$$

If the index set is defined using the whole numbers $I = \{1, 2, 3, \dots, n\}$, then we can write this multiple intersection as

$$\bigcap_{i=1}^{n} A_i.$$

Checking if a given object is in the multiple intersection of a collection of sets works nearly the same as checking if it’s in the multiple union, but we need to make sure the object is in all sets, which we can check with multiple and operations:

$$(x \in \bigcap_{i \in I} A_i) \Longleftrightarrow (\forall i \in I\ [x \in A_i]).$$

Of course, if the index set uses whole numbers starting from $1$ and ending at $n$, we can instead write this logical equivalency as

$$(x \in \bigcap_{i=1}^{n} A_i) \Longleftrightarrow (\forall i \in \{1, \dots, n\}\ [x \in A_i]).$$
Example 3.6.16: Computing a multiple intersection

Once again, reconsider the set $\mathbb{Z} = \{0, 1, -1, 2, -2, 3, -3, 4, -4, \dots\}$, with the following index set:

$$I = \{1, 2, 3, 4\},$$

along with the following sets:

\[ \begin{array}{rl} A_1 &= \{2, 4, 6, 8, 10\} \\ A_2 &= \{-1, 0, 1, 2, 3, 4, 5\} \\ A_3 &= \{1, 2, 4, 7, 8\} \\ A_4 &= \{1, 3, 4\} \end{array} \]

Is $4$ in the multiple intersection of $A_1$, $A_2$, $A_3$, and $A_4$? We can check to see if $4$ is in all of them:

$$(4 \in A_1) \land (4 \in A_2) \land (4 \in A_3) \land (4 \in A_4) = 1 \land 1 \land 1 \land 1 = 1$$

As such, we see that $4$ is indeed in the multiple intersection of $A_1$, $A_2$, $A_3$, and $A_4$.

However, when it comes to a number like $8$, we see that

$$(8 \in A_1) \land (8 \in A_2) \land (8 \in A_3) \land (8 \in A_4) = 1 \land 0 \land 1 \land 0 = 0$$

and so $8$ is not in the multiple intersection of $A_1$, $A_2$, $A_3$, and $A_4$.

We can just go ahead and determine the entire multiple intersection:

\[ \begin{array}{llll} \boldsymbol{A_1 \cap A_2 \cap A_3 \cap A_4} & = & \{2, 4, 6, 8, 10\} \cap \{-1, 0, 1, 2, 3, 4, 5\} \cap \{1, 2, 4, 7, 8\} \cap \{1, 3, 4\} & \\ & = & \{2, 4\} \cap \{1, 2, 4, 7, 8\} \cap \{1, 3, 4\} & \text{Intersecting } A_1 \text{ and } A_2 \\ & = & \{2, 4\} \cap \{1, 3, 4\} & \text{Intersecting the result with } A_3 \\ & = & \{4\} & \text{Intersecting the result with } A_4 \end{array} \]

Another way of writing the set representing the multiple intersection is

$$\{x \in \mathcal{U} \mid \forall i \in I\ [x \in A_i]\}.$$

Graphical Depictions of Sets

In the previous section, we defined the complement, union, intersection, difference, symmetric difference, multiple union, and multiple intersection of sets purely symbolically. While the symbolic definitions are precise, it’s often easier to build an intuition for what these operations actually do by picturing them.

The standard way to picture a set is as a circle, with each circle drawn inside a rectangle standing for the universe $\mathcal{U}$. Whenever an operation includes some region formed by these circles, we shade that region green.

Complement


The complement of a set $A$, denoted $A^C$, is the set of all elements within $\mathcal{U}$ that are not within $A$.
Figure 3.7.1: The complement of a set $A$, denoted $A^C$, is the set of all elements within $\mathcal{U}$ that are not within $A$.

Since the complement of $A$ consists of everything in the universe that isn’t in $A$, the circle for $A$ itself is left unshaded, while everything else within the surrounding rectangle is shaded to represent $A^C$.

Union


The union of two sets is the set containing any element contained in either set. $A$ and $B$ share some overlap here, but that overlap is still included — any part of either set is shaded green to indicate it's in the union.
Figure 3.7.2: The union of two sets is the set containing any element contained in either set. $A$ and $B$ share some overlap here, but that overlap is still included — any part of either set is shaded green to indicate it’s in the union.

As long as an element is in $A$ or $B$, or even both, it’s included in the union — so both circles are shaded in their entirety, overlap included.

Intersection


The intersection of two sets is the set containing all elements that are in both sets. Only the overlap between the two circles is shaded green, since that's the only region representing elements contained in both $A$ and $B$.
Figure 3.7.3: The intersection of two sets is the set containing all elements that are in both sets. Only the overlap between the two circles is shaded green, since that’s the only region representing elements contained in both $A$ and $B$.

Here, only the sliver shared by both circles is shaded, since that’s the only region representing elements common to both $A$ and $B$.

Difference


The difference $A - B$ is the set of all elements in $A$ that are not in $B$. The overlap with $B$ is left unshaded, since those elements are excluded — only the exclusive part of $A$ is shaded green.
Figure 3.7.4: The difference $A - B$ is the set of all elements in $A$ that are not in $B$. The overlap with $B$ is left unshaded, since those elements are excluded — only the exclusive part of $A$ is shaded green.

Only the part of $A$’s circle left over once the overlapping sliver shared with $B$ has been carved away is shaded.

Symmetric Difference


As long as an element is in one of $A$ or $B$, but not both, it's included in the symmetric difference of $A$ and $B$ — everything covered by either circle is shaded green, except the overlap.
Figure 3.7.5: As long as an element is in one of $A$ or $B$, but not both, it’s included in the symmetric difference of $A$ and $B$ — everything covered by either circle is shaded green, except the overlap.

The symmetric difference shades everything covered by either circle except the overlapping sliver shared by both — everything a union would shade, minus whatever an intersection would shade.

Multiple Union


When dealing with multiple sets $A_1$, $A_2$, and $A_3$, we can take every single element from every set and stick them into a new set, which we refer to as the union of all the sets.
Figure 3.7.6: When dealing with multiple sets $A_1$, $A_2$, and $A_3$, we can take every single element from every set and stick them into a new set, which we refer to as the union of all the sets.

This same idea of shading extends naturally to more than two sets at once — every region covered by at least one of $A_1$, $A_2$, or $A_3$ is shaded to represent their multiple union.

Multiple Intersection


When dealing with multiple sets $A_1$, $A_2$, and $A_3$, we can take all elements contained in all three and stick them into a new set, which we refer to as the intersection of all the sets.
Figure 3.7.7: When dealing with multiple sets $A_1$, $A_2$, and $A_3$, we can take all elements contained in all three and stick them into a new set, which we refer to as the intersection of all the sets.

Here, only the single region shared by all three circles at once — where $A_1$, $A_2$, and $A_3$ all overlap — is shaded, representing their multiple intersection.

The Laws of Set Theory

Understanding the laws of set theory is essential because they solve the problem of determining when two or more sets are equal, through fundamental equations including associativity, commutativity, and distribution. These laws provide a structured framework for defining and manipulating sets, ensuring consistency and precision in operations such as subset, difference, and symmetric difference.

In other words, by developing laws of set theory, we can essentially manipulate equations involving sets as if they were algebraic equations. In addition, the laws of set theory will allow us to convert complicated expressions involving sets into simpler ones, much like how we took complicated logical expressions and simplified them into smaller, logically equivalent expressions.

By studying these laws, one can formulate and prove mathematical concepts and theorems accurately. Furthermore, the foundations of many branches of mathematics are developed using the language of sets and set theory. In addition to the further development of mathematics, these laws also prove crucial to subjects like computer science and data science.

Equal Sets


We’ve briefly described some aspects of set equality when we first introduced what sets were. We talked about how repetition and order are irrelevant with respect to what elements are contained within a set. As such, even if some elements are repeated in various descriptions, they still represent the same set.

However, as we’ve also seen, there are a wide variety of methods to describe a set and what elements are contained within it. Just because we come up with different descriptions, that doesn’t necessarily mean we’re describing different sets — sometimes we may be describing exactly the same set.

Example 3.8.5: Two different descriptions of the same set

Consider the set

$$M = \{x \mid x \text{ is an even number between } -3 \text{ and } 10 \text{ inclusive}\}.$$

We already know what elements are in $M$:

$$M = \{-2, 0, 2, 4, 6, 8, 10\}.$$

Now consider the set

$$N = \{4x + 3 \mid x \in \{-1.25, -0.75, -0.25, 0.25, 0.75, 1.25, 1.75\}\}.$$

The description of $N$ is a little more complicated, but we can still determine what elements are in $N$. The only tricky part is recognizing that the elements of $N$ are based off elements that are in the set $\{-1.25, -0.75, -0.25, 0.25, 0.75, 1.25, 1.75\}$, so we just have to iterate over those elements to figure out what’s in $N$. We’ll tabulate all values below:

\[ \begin{array}{l|l|l} x & 4x & 4x + 3 \\ \hline -1.25 & -5 & -2 \\ -0.75 & -3 & 0 \\ -0.25 & -1 & 2 \\ 0.25 & 1 & 4 \\ 0.75 & 3 & 6 \\ 1.25 & 5 & 8 \\ 1.75 & 7 & 10 \end{array} \]

Since $N$ consists of the values $4x + 3$, we now know that

$$N = \{-2, 0, 2, 4, 6, 8, 10\}.$$

Notice that $M$ and $N$ have the same number of elements ($7$), and all elements are exactly the same. Thus, since $M$ and $N$ represent the exact same set, we could write

$$M = N.$$

It’s worth pointing out that since every element in $M$ is also in $N$, and every element in $N$ is also in $M$, we have that

\[ \begin{array}{rl} M &\subseteq N \\ N &\subseteq M \end{array} \]

However, defining set equality by having the same elements isn’t exactly rigorous. Two sets can share some number of elements while also having different elements. As such, we don’t define set equality by simply having the same elements — instead, we look to the end of the previous example for inspiration.

EQUAL

Consider the two sets $A$ and $B$ taken from some universal set $\mathcal{U}$.

Sets $A$ and $B$ are called equal, and we write $A = B$, when

$$A \subseteq B$$

and

$$B \subseteq A.$$

This definition is precise because we can determine whether a set is a subset of another set under scrutiny. As such, because the definition of set equality requires we show two things to be true, proofs showing two sets to be equal are usually broken up into two parts.

It’s this definition of set equality that makes the next two theorems somewhat straightforward to prove.

Theorem 3.8.9: A subset relationship gives an intersection

For any $A, B \subseteq \mathcal{U}$, if $A \subseteq B$, then $A \cap B = A$.

Proof 3.8.9

Step 1: Show that $A \cap B \subseteq A$.

Let $x$ be an arbitrarily picked element within $A \cap B$ (meaning $x \in A \cap B$).

By definition, $x \in A$ and $x \in B$, and as such we know that $x \in A$.

Thus, we have shown that if $x \in A \cap B$, then $x \in A$. This means that $A \cap B \subseteq A$, completing Step 1.

Step 2: Show that $A \subseteq A \cap B$.

Let $x$ be an arbitrarily picked element of $A$. Because we have by premise that $A \subseteq B$, we also have that $x \in B$.

Thus, since $x \in A$ and $x \in B$, we have that $x \in A \cap B$ by definition.

We’ve just shown that when $x \in A$, we also have that $x \in A \cap B$. We then have by definition that $A \subseteq A \cap B$, completing Step 2.

Conclusion. Because we’ve shown that $A \subseteq A \cap B$ and that $A \cap B \subseteq A$, we have by definition that

$$A \cap B = A$$

as desired.

Thus, by this theorem, whenever we know that $A \subseteq B$, we can replace $A \cap B$ with just $A$ anywhere we see $A \subseteq B$ in an equation. It’s worth stressing that we can only make such a replacement when we know $A \subseteq B$ — otherwise, doing so may not be correct.

There are a few more such equalities we can make use of, which we now show in the next theorem.

Theorem 3.8.10: Four equivalent ways to say a subset relationship

For any $A, B \subseteq \mathcal{U}$, we have that

$$(A \subseteq B) \Longleftrightarrow (A \cap B = A) \Longleftrightarrow (A \cup B = B) \Longleftrightarrow (B^C \subseteq A^C).$$
Proof 3.8.10

We’ll break this proof up into four steps.

Step 1: $(A \subseteq B) \Longrightarrow (A \cap B = A)$.

This is simply the previous theorem.

Step 2: $(A \cap B = A) \Longrightarrow (A \cup B = B)$.

The premise of this logical implication is that $A \cap B = A$, so we can bring that fact in whenever needed.

First we show that $A \cup B \subseteq B$.

Let $x$ be an arbitrarily picked element in $A \cup B$. Thus, by definition, $x \in A$ or $x \in B$. If $x$ happens to be an element of $B$, then it’s tautologically true that $x \in B$.

If $x \in A$, then the premise tells us that $x \in A \cap B$, meaning $x \in B$ as well.

Either way, we have that whenever $x \in A \cup B$, we also have that $x \in B$, meaning $A \cup B \subseteq B$.

Second, we show that $B \subseteq A \cup B$.

Let $x$ be an arbitrarily picked element within $B$. Thus, because $x \in B$, we also have that $x \in A \cup B$.

We’ve just shown that whenever $x \in B$, we also have that $x \in A \cup B$. This means that $B \subseteq A \cup B$.

Finally, because we’ve shown that $A \cup B \subseteq B$ and $B \subseteq A \cup B$, we have that

$$A \cup B = B$$

as desired.

Step 3: $(A \cup B = B) \Longrightarrow (B^C \subseteq A^C)$.

Remember that $A^C$ is the complement of $A$ within $\mathcal{U}$. Also remember that $A \cup B = B$ is a premise of this logical implication, so we can use that fact whenever we want (we can’t use $A \cap B = A$ as a premise here, since that isn’t included in the implication we’re considering).

We’re trying to show that $B^C \subseteq A^C$, so let $x$ be an arbitrarily picked element of $B^C$.

Because $x \in B^C$, we have by definition that $x \notin B$. Now, because $A \cup B = B$ and $x \notin B$, we also have that $x \notin A \cup B$.

Next, because $x \notin A \cup B$, we also know that $x \notin A$. Therefore, since $x \notin A$, we must have that $x \in A^C$.

We’ve just shown that whenever $x \in B^C$, we also have that $x \in A^C$ (assuming $A \cup B = B$ as a premise).

Thus by definition, whenever we know $A \cup B = B$, we have that $B^C \subseteq A^C$ as desired.

Step 4: $(B^C \subseteq A^C) \Longrightarrow (A \subseteq B)$.

We have $B^C \subseteq A^C$ as a premise, so we’ll invoke that fact when needed.

Let $x$ be an arbitrarily picked element of $A$. Since $x \in A$, we have by definition that $x \notin A^C$.

Now, because $B^C \subseteq A^C$ and $x \notin A^C$, we have (by Modus Tollens) that $x \notin B^C$.

Now, because $x \notin B^C$, we have by definition that $x \in B$.

Thus, we’ve shown that, assuming $B^C \subseteq A^C$ as a premise, whenever $x \in A$, we must also have that $x \in B$.

Therefore, assuming $B^C \subseteq A^C$ as a premise, we have that $A \subseteq B$ as desired.

Conclusion. Because we’ve shown that

\[ \begin{array}{l} (A \subseteq B) \Longrightarrow (A \cap B = A) \\[0.75em] (A \cap B = A) \Longrightarrow (A \cup B = B) \\[0.75em] (A \cup B = B) \Longrightarrow (B^C \subseteq A^C) \\[0.75em] (B^C \subseteq A^C) \Longrightarrow (A \subseteq B) \end{array} \]

we have that they’re all logically equivalent, meaning we have that

$$(A \subseteq B) \Longleftrightarrow (A \cap B = A) \Longleftrightarrow (A \cup B = B) \Longleftrightarrow (B^C \subseteq A^C)$$

as desired.

Because of this theorem, whenever we know one of

$$A \subseteq B \qquad A \cap B = A \qquad A \cup B = B \qquad B^C \subseteq A^C$$

is true, we automatically know that the other three are true as well.

Disjoint Sets


The total opposite of two sets $A$ and $B$ being equal is when $A$ and $B$ have absolutely no elements in common. Of course, if two sets share no element in common, then their intersection is a set with no elements in it — the empty set.

DISJOINT

Consider the two sets $A$ and $B$ taken from some universal set $\mathcal{U}$.

$A$ and $B$ are called disjoint whenever

$$A \cap B = \emptyset.$$

Many of the concepts discussed so far may seem disparate. However, they’re more connected than may initially appear.

Theorem 3.8.11: Disjoint sets and the symmetric difference

Let $A, B \subseteq \mathcal{U}$.

$$(A \cap B = \emptyset) \Longleftrightarrow (A \cup B = A \triangle B)$$
Proof 3.8.11

Because we have a logical biconditional, we break this proof into two steps. First, we assume $A \cap B = \emptyset$ as a premise and show that $A \cup B = A \triangle B$. Next, we assume $A \cup B = A \triangle B$ as a premise and show that $A \cap B = \emptyset$.

Step 1: $(A \cap B = \emptyset) \Longrightarrow (A \cup B = A \triangle B)$.

First, we try to show that $A \cup B \subseteq A \triangle B$.

Let $x$ be an arbitrarily picked element within $A \cup B$. Thus, we have by definition that $x \in A$ or $x \in B$, but because $A \cap B = \emptyset$, $x$ can’t be in both $A$ and $B$.

Thus we either have that $x \in A$ and $x \notin B$, meaning $x \in A \triangle B$, or we have that $x \notin A$ and $x \in B$, meaning we still have that $x \in A \triangle B$.

Either way, we have that $x \in A \triangle B$. Hence, we’ve just shown that (assuming $A \cap B = \emptyset$) whenever $x \in A \cup B$, we also have that $x \in A \triangle B$ as well, and so we have that

$$A \cup B \subseteq A \triangle B.$$

Second, we try to show that $A \triangle B \subseteq A \cup B$.

Now, let $x$ be an arbitrarily picked element in $A \triangle B$. Thus, by definition, either $x \in A$ and $x \notin B$, meaning $x \in A \cup B$, or $x \notin A$ and $x \in B$, meaning $x \in A \cup B$.

Either way, we know that whenever $x \in A \triangle B$, we also know that $x \in A \cup B$ as well.

Thus, by definition we have that

$$A \triangle B \subseteq A \cup B.$$

Finally, because we know that $A \cup B \subseteq A \triangle B$ and $A \triangle B \subseteq A \cup B$, we have by definition that

$$A \cup B = A \triangle B.$$

This shows that $(A \cap B = \emptyset) \Longrightarrow (A \cup B = A \triangle B)$, completing Step 1.

Step 2: $(A \cap B = \emptyset) \Longleftarrow (A \cup B = A \triangle B)$.

Here, we’re assuming $A \cup B = A \triangle B$ as a premise, and are trying to show that $A \cap B = \emptyset$.

Because we know that $A \cup B = A \triangle B$, we have by the definition of set equality that $A \cup B \subseteq A \triangle B$ and $A \triangle B \subseteq A \cup B$.

Thus, for any element $x \in A \cup B$, we also know that $x \in A \triangle B$. However, since $x \in A \triangle B$, we know that either

$$x \in A \text{ and } x \notin B \qquad \text{or} \qquad x \notin A \text{ and } x \in B.$$

Either way, no element $x \in A \cup B$ can be in both $A$ and $B$.

Thus, because no element $x$ exists such that $x \in A \cap B$, we must have that $A \cap B$ is empty, meaning $A \cap B = \emptyset$.

This shows that $(A \cup B = A \triangle B) \Longrightarrow (A \cap B = \emptyset)$, completing Step 2.

Conclusion. Because we’ve shown that $(A \cap B = \emptyset) \Longrightarrow (A \cup B = A \triangle B)$ and $(A \cup B = A \triangle B) \Longrightarrow (A \cap B = \emptyset)$, we must have that

$$(A \cap B = \emptyset) \Longleftrightarrow (A \cup B = A \triangle B)$$

as desired.

This theorem connects the concepts of equal sets, disjoint sets, unions, and symmetric differences.

Membership Tables


Remember that $x \in A$ is a statement about $x$ being a member of set $A$. Because it’s a statement, it has a truth value of either $0$ or $1$.

One powerful tool we had at our disposal for analyzing logical expressions was a truth table. We can adapt truth tables to analyze set relationships as well. In this case, membership tables offer a tabular way of representing element arguments.

\[ \begin{array}{l|l|l|l} x \in A & x \in B & x \in A \cup B & x \in A \cap B \\ \hline 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 \\ 1 & 0 & 1 & 0 \\ 1 & 1 & 1 & 1 \end{array} \]

Instead of using some generic symbol for a generic object whose membership in some set we want to analyze, we could simply list whatever sets we’re analyzing. As such, we could rewrite the above table like so:

\[ \begin{array}{l|l|l|l} A & B & A \cup B & A \cap B \\ \hline 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 \\ 1 & 0 & 1 & 0 \\ 1 & 1 & 1 & 1 \end{array} \]

All of the set operations have their corresponding tables, which we can include inside one large table:

\[ \begin{array}{l|l|l|l|l|l|l} A & B & A^C & A \cup B & A \cap B & A - B & A \triangle B \\ \hline 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 1 & 0 & 0 & 1 \\ 1 & 0 & 0 & 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1 & 0 & 0 \end{array} \]

Based on the values above, we see that there are obvious analogues with logical operators:

\[ \begin{array}{rl} A^C &\text{ pairs with } \neg a \\ A \cup B &\text{ pairs with } a \lor b \\ A \cap B &\text{ pairs with } a \land b \\ A - B &\text{ pairs with } \neg(a \to b) \\ A \triangle B &\text{ pairs with } a \veebar b \end{array} \]

Notice that the set difference resembles the logical complement of an implication.

In addition to the set operations, we can determine subset relationships. Let’s take a look at one more table to see an example:

\[ \begin{array}{l|l|l|l|l|l} x \in A & x \in B & x \in A \cup B & x \in A \cap B & (x \in A \cap B) \to (x \in A) & (x \in A) \to (x \in A \cup B) \\ \hline 0 & 0 & 0 & 0 & 1 & 1 \\ 0 & 1 & 1 & 0 & 1 & 1 \\ 1 & 0 & 1 & 0 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 \end{array} \]

Notice that the columns $(x \in A \cap B) \to (x \in A)$ and $(x \in A) \to (x \in A \cup B)$ have all $1$s. As such, we can write

$$(x \in A \cap B) \Longrightarrow (x \in A) \qquad \text{and} \qquad (x \in A) \Longrightarrow (x \in A \cup B)$$

which is exactly the definition of subset. As such, we can determine that a set $A$ is a subset of some other set $B$ by comparing their respective columns. If $A$ has $1$s in every row where $B$ also has a $1$, then we know that $A \subseteq B$.

Let’s prove a simple observation we may have had in our study of set relationships and operations.

Theorem 3.8.12: Intersection and union sandwich a set

Let $A, B \subseteq \mathcal{U}$.

$$(A \cap B) \subseteq A \subseteq (A \cup B)$$
Proof 3.8.12

Let’s examine a membership table:

\[ \begin{array}{l|l|l|l} A & B & A \cup B & A \cap B \\ \hline 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 \\ 1 & 0 & 1 & 0 \\ 1 & 1 & 1 & 1 \end{array} \]

Now, we can compare specific columns we want, but we’ll do so in two separate membership tables:

\[ \begin{array}{l|l} A \cap B & A \\ \hline 0 & 0 \\ 0 & 0 \\ 0 & 1 \\ 1 & 1 \end{array} \qquad \begin{array}{l|l} A & A \cup B \\ \hline 0 & 0 \\ 0 & 1 \\ 1 & 1 \\ 1 & 1 \end{array} \]

In the table on the left, every row of $A \cap B$ that has a $1$ also has a $1$ in the $A$ column. As such, we know that $(A \cap B) \subseteq A$.

Additionally, from the table on the right, every row in the $A$ column that has a $1$ also has a $1$ in the $A \cup B$ column. As such, we know that $A \subseteq (A \cup B)$.

Because we know that $(A \cap B) \subseteq A$ and $A \subseteq (A \cup B)$, we can combine them into the single expression

$$(A \cap B) \subseteq A \subseteq (A \cup B)$$

as desired.

Membership tables can be a convenient way to represent an element argument in tabular form. However, membership tables won’t totally replace element arguments, as sometimes the element argument is simpler to make for more esoteric situations where tables can be cumbersome to use.

Some Laws of Set Theory


We’ve already examined a number of simple laws (referred to as theorems) above, and have demonstrated their truth by way of element arguments and membership tables. What’s demonstrated above only scratches the surface of the multitude of equal-set relationships we can exploit. Below, we present a large table offering even more such laws.

As you look over this table, it would be wise to compare it with the table presented in Chapter 1, Section 5. You should see many analogues.

For any sets $A$, $B$, and $C$ taken from some universal set $\mathcal{U}$, we have the following equivalencies:

Law of Double Complement$(A^C)^C = A$
DeMorgan’s Laws$\begin{array}{c} (A \cup B)^C = A^C \cap B^C \\ (A \cap B)^C = A^C \cup B^C \end{array}$
Commutative Laws$\begin{array}{c} A \cup B = B \cup A \\ A \cap B = B \cap A \end{array}$
Associative Laws$\begin{array}{c} A \cup (B \cup C) = (A \cup B) \cup C \\ A \cap (B \cap C) = (A \cap B) \cap C \end{array}$
Distributive Laws$\begin{array}{c} A \cup (B \cap C) = (A \cup B) \cap (A \cup C) \\ A \cap (B \cup C) = (A \cap B) \cup (A \cap C) \end{array}$
Idempotent Laws$\begin{array}{c} A \cup A = A \\ A \cap A = A \end{array}$
Identity Laws$\begin{array}{c} A \cup \emptyset = A \\ A \cap \mathcal{U} = A \end{array}$
Inverse Laws$\begin{array}{c} A \cup A^C = \mathcal{U} \\ A \cap A^C = \emptyset \end{array}$
Domination Laws$\begin{array}{c} A \cup \mathcal{U} = \mathcal{U} \\ A \cap \emptyset = \emptyset \end{array}$
Absorption Laws$\begin{array}{c} A \cup (A \cap B) = A \\ A \cap (A \cup B) = A \end{array}$

Certainly, many more such laws and equivalencies exist, but the table above represents some of the more ubiquitous laws that are often used.

These laws present us an opportunity to directly compare three different proof techniques. First, we use a membership table.

Theorem 3.8.13: Law of Double Complement

For any $A \subseteq \mathcal{U}$,

$$(A^C)^C = A$$
Proof 3.8.13

General Strategy: We’ll use a membership table to compare the columns for $A$ and $(A^C)^C$.

\[ \begin{array}{l|l|l} A & A^C & (A^C)^C \\ \hline 0 & 1 & 0 \\ 1 & 0 & 1 \end{array} \]

Since the columns for $A$ and $(A^C)^C$ are exactly the same, they’re equal, and so we have

$$A = (A^C)^C$$

as desired.

Now, compare such a simple strategy with a standard element argument used in the next proof.

Theorem 3.8.14: DeMorgan’s Laws

For any $A, B \subseteq \mathcal{U}$,

\[ \begin{array}{rl} (A \cup B)^C &= A^C \cap B^C \\ (A \cap B)^C &= A^C \cup B^C \end{array} \]
Proof 3.8.14

General Strategy: We’ll split this proof up into two steps, where each step is dedicated to a different part of DeMorgan’s Laws. Both steps will make use of standard element arguments, as well as the definition of set equality.

Step 1: $(A \cup B)^C = A^C \cap B^C$.

First, we show that $(A \cup B)^C \subseteq A^C \cap B^C$.

Suppose that element $x \in \mathcal{U}$ was also in $(A \cup B)^C$, meaning $x \in (A \cup B)^C$.

Since $x \in (A \cup B)^C$, we know that $x \notin ((A \cup B)^C)^C$, and by the Law of Double Complement, we also know that $x \notin A \cup B$.

Now we simultaneously know that $x \notin A$ (otherwise $x$ would be in $A \cup B$, which we just established isn’t the case) and $x \notin B$ (again, because then $x$ would be in $A \cup B$).

Thus, since $x \notin A$ and $x \notin B$, we know that $x \in A^C$ and $x \in B^C$, meaning $x \in A^C \cap B^C$, which is what we’re trying to show.

Thus, whenever we have that $x \in (A \cup B)^C$, we know that $x \in A^C \cap B^C$, meaning

$$(A \cup B)^C \subseteq A^C \cap B^C.$$

Second, we show that $A^C \cap B^C \subseteq (A \cup B)^C$.

Now, suppose we knew that $x \in A^C \cap B^C$. Thus we simultaneously know that $x \in A^C$ and $x \in B^C$.

This means we have that $x \notin A$ and $x \notin B$. Thus, since $x$ is in neither $A$ nor $B$, $x$ can’t possibly be in $A \cup B$, meaning $x \notin A \cup B$. This means that $x \in (A \cup B)^C$.

Thus, whenever we know that $x \in A^C \cap B^C$, we also know that $x \in (A \cup B)^C$, which means we have that

$$A^C \cap B^C \subseteq (A \cup B)^C.$$

Finally, because we’ve shown that $(A \cup B)^C \subseteq A^C \cap B^C$ and $A^C \cap B^C \subseteq (A \cup B)^C$, we have by definition that

$$(A \cup B)^C = A^C \cap B^C$$

as desired.

Step 2: $(A \cap B)^C = A^C \cup B^C$.

Using nearly the exact same process as was used in Step 1, we come to the conclusion that

$$(A \cap B)^C = A^C \cup B^C.$$

Conclusion. By now, we’ve shown that both $(A \cup B)^C = A^C \cap B^C$ and $(A \cap B)^C = A^C \cup B^C$, and as such have completely established DeMorgan’s Laws.

The last of these laws we’ll prove in this section will be the Distributive Laws. Instead of making two separate element arguments to establish that $A \cup (B \cap C) \subseteq (A \cup B) \cap (A \cup C)$ and $(A \cup B) \cap (A \cup C) \subseteq A \cup (B \cap C)$, we’ll use logical equivalencies to show that $A \cup (B \cap C)$ and $(A \cup B) \cap (A \cup C)$ are subsets of each other simultaneously.

Theorem 3.8.15: Distributive Laws

For any $A, B, C \subseteq \mathcal{U}$,

\[ \begin{array}{rl} A \cup (B \cap C) &= (A \cup B) \cap (A \cup C) \\ A \cap (B \cup C) &= (A \cap B) \cup (A \cap C) \end{array} \]
Proof 3.8.15

General Strategy: We’ll use logical equivalencies to show that any element of $A \cup (B \cap C)$ is also an element of $(A \cup B) \cap (A \cup C)$. Since we use logical equivalencies, this also applies the other way simultaneously.

\[ \begin{array}{lll} & \boldsymbol{x \in A \cup (B \cap C)} & \textbf{Reason} \\ \Longleftrightarrow & (x \in A) \lor (x \in B \cap C) & \text{Definition of Set Union} \\ \Longleftrightarrow & (x \in A) \lor [(x \in B) \land (x \in C)] & \text{Definition of Set Intersection} \\ \Longleftrightarrow & [(x \in A) \lor (x \in B)] \land [(x \in A) \lor (x \in C)] & \text{Distribution of } \lor \text{ over } \land \\ \Longleftrightarrow & (x \in A \cup B) \land (x \in A \cup C) & \text{Definition of Set Union} \\ \Longleftrightarrow & x \in (A \cup B) \cap (A \cup C) & \text{Definition of Set Intersection} \end{array} \]

We’ve just established that

$$(x \in A \cup (B \cap C)) \Longleftrightarrow (x \in (A \cup B) \cap (A \cup C)).$$

Thus, whenever $x \in A \cup (B \cap C)$, we also simultaneously know that $x \in (A \cup B) \cap (A \cup C)$. As such, we know that

$$A \cup (B \cap C) \subseteq (A \cup B) \cap (A \cup C) \qquad \text{and} \qquad (A \cup B) \cap (A \cup C) \subseteq A \cup (B \cap C)$$

are simultaneously true, and so we have that

$$A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$$

as desired. The same logic also shows that $A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$ as well.

Of course, the rest of the Laws of Set Theory can be proven in many different ways. Because it’s a good exercise to provide a proof for all the above laws, proofs for the remaining laws are asked for in this chapter’s practice questions.

Using the Laws of Set Theory


Just as we can use the Laws of Logic to simplify complicated logical expressions, we can also use the Laws of Set Theory to simplify complicated expressions involving sets.

Example 3.8.6: Simplifying an expression with the Laws of Set Theory

Suppose we were dealing with the expression

$$X \cap (Y - X)$$

where $X, Y \subseteq \mathcal{U}$.

We can simplify the above expression in the following way:

\[ \begin{array}{lll} & \boldsymbol{X \cap (Y - X)} & \textbf{Reason} \\ = & X \cap (Y \cap X^C) & \text{Definition of Set Difference} \\ = & X \cap (X^C \cap Y) & \text{Commutative Law} \\ = & (X \cap X^C) \cap Y & \text{Associative Law} \\ = & \emptyset \cap Y & \text{Inverse Law} \\ = & \emptyset & \text{Domination Law} \end{array} \]

Thus, we’ve just established that for any $X, Y \subseteq \mathcal{U}$,

$$X \cap (Y - X) = \emptyset.$$

We made use of an additional law of Set Theory above, where we can express the set difference operation using only intersection and complement:

$$Y - X = Y \cap X^C.$$

We’ll now justify that equality:

\[ \begin{array}{lll} & \boldsymbol{Y - X} & \textbf{Reason} \\ = & \{p \mid (p \in Y) \land (p \notin X)\} & \text{Definition of Set Difference} \\ = & \{p \mid (p \in Y) \land (p \in X^C)\} & \text{Definition of Set Complement} \\ = & Y \cap X^C & \text{Definition of Set Intersection} \end{array} \]

For any two sets $A$ and $B$ taken from some universal set $\mathcal{U}$, we have that

$$A - B = A \cap B^C.$$

As a matter of fact, we can also express the symmetric difference operation using only union, intersection, and complement, which we justify below:

\[ \begin{array}{lll} & \boldsymbol{Y \triangle X} & \textbf{Reason} \\ = & \{p \mid (p \in Y) \veebar (p \in X)\} & \text{Definition of Symmetric Difference} \\ = & \{p \mid ((p \in Y) \land (p \notin X)) \lor ((p \notin Y) \land (p \in X))\} & \text{Definition of Logical Exclusive-or} \\ = & \{p \mid ((p \in Y) \land (p \in X^C)) \lor ((p \in Y^C) \land (p \in X))\} & \text{Definition of Set Complement} \\ = & \{p \mid (p \in Y \cap X^C) \lor (p \in Y^C \cap X)\} & \text{Definition of Set Intersection} \\ = & (Y \cap X^C) \cup (Y^C \cap X) & \text{Definition of Set Union} \end{array} \]

For any two sets $A$ and $B$ taken from some universal set $\mathcal{U}$, we have that

$$A \triangle B = (A \cap B^C) \cup (B^C \cap A).$$

This just goes to show how important the union, intersection, and complement operations are when it comes to sets, because no matter how we want to combine any combination of sets, we can always do so using just those three operations.

Example 3.8.7: Rewriting an expression with only Union, Intersection, and Complement

Can we rewrite the expression

$$(X - Y)^C$$

using only union, intersection, and complement? Let’s try and see.

\[ \begin{array}{lll} & \boldsymbol{(X - Y)^C} & \textbf{Reason} \\ = & (X \cap Y^C)^C & \text{Definition of Set Difference} \\ = & X^C \cup (Y^C)^C & \text{DeMorgan's Law} \\ = & X^C \cup Y & \text{Law of Double Complement} \end{array} \]

So $(X - Y)^C$ is equivalent to $X^C \cup Y$.

Example 3.8.8: A longer simplification

We can simplify the expression

$$(((X \cup Y) \cap Z)^C \cup Y)^C$$

using the following steps:

\[ \begin{array}{lll} & \boldsymbol{(((X \cup Y) \cap Z)^C \cup Y)^C} & \textbf{Reason} \\ = & (((X \cup Y) \cap Z)^C)^C \cap (Y^C)^C & \text{DeMorgan's Law} \\ = & ((X \cup Y) \cap Z) \cap Y & \text{Law of Double Complement} \\ = & (Z \cap (X \cup Y)) \cap Y & \text{Commutative Law} \\ = & Z \cap ((X \cup Y) \cap Y) & \text{Associative Law} \\ = & Z \cap ((X \cap Y) \cup (Y \cap Y)) & \text{Distributive Law} \\ = & Z \cap ((X \cap Y) \cup Y) & \text{Idempotent Law} \\ = & Z \cap (Y \cup (X \cap Y)) & \text{Commutative Law} \\ = & Z \cap Y & \text{Absorption Law} \end{array} \]

Generalized DeMorgan’s Laws


We’ve seen DeMorgan’s Laws applied to two sets at a time. Let’s see what happens when we have three sets at a time:

\[ \begin{array}{lll} & \boldsymbol{(A \cup B \cup C)^C} & \textbf{Reason} \\ = & ((A \cup B) \cup C)^C & \text{Associative Law} \\ = & (A \cup B)^C \cap C^C & \text{DeMorgan's Laws} \\ = & A^C \cap B^C \cap C^C & \text{DeMorgan's Laws} \end{array} \]

It stands to reason that repeated applications of DeMorgan’s Laws would work for intersection as well.

Furthermore, no matter how many sets we have, it seems as if we can just repeatedly apply DeMorgan’s Laws and the Associative Law. Based on this observation, we make the following observations, where $I$ is an index set over which the multiple union or intersection is taken:

\[ \begin{array}{rl} \left(\bigcup_{i \in I} A_i\right)^C &= \bigcap_{i \in I} A_i^C \\[0.75em] \left(\bigcap_{i \in I} A_i\right)^C &= \bigcup_{i \in I} A_i^C \end{array} \]

Of course, mere intuition doesn’t prove anything to be true. Instead, we must rely on rigorous tools, such as element arguments and logical equivalencies, to establish truth without any doubt.

Theorem 3.8.16: Generalized DeMorgan’s Laws

For a universal set $\mathcal{U}$ and index set $I$, the following equalities hold:

\[ \begin{array}{rl} \left(\bigcup_{i \in I} A_i\right)^C &= \bigcap_{i \in I} A_i^C \\[0.75em] \left(\bigcap_{i \in I} A_i\right)^C &= \bigcup_{i \in I} A_i^C \end{array} \]
Proof 3.8.16

General Strategy: We’ll make use of various definitions of Set Theory, including Complement. We also make use of the logical rules that apply when negating quantified statements, as discussed in Chapter 1, Section 10.

\[ \begin{array}{lll} & \boldsymbol{x \in \left(\bigcup_{i \in I} A_i\right)^C} & \textbf{Reason} \\ \Longleftrightarrow & x \notin \bigcup_{i \in I} A_i & \text{Definition of Set Complement} \\ \Longleftrightarrow & \neg \exists i \in I\ [x \in A_i] & \text{Definition of Multiple Union} \\ \Longleftrightarrow & \forall i \in I\ [x \notin A_i] & \text{Negating a Quantified Statement} \\ \Longleftrightarrow & \forall i \in I\ [x \in A_i^C] & \text{Definition of Set Complement} \\ \Longleftrightarrow & x \in \bigcap_{i \in I} A_i^C & \text{Definition of Multiple Intersection} \end{array} \]

We’ve just shown why the first equivalence is true. By similar logic, the second is also shown to be true. This establishes both equivalencies as desired.

The generalized versions of DeMorgan’s Laws will prove extremely useful in our further study of math.

Proof Technique: Exhaustion

All of the proof techniques discussed thus far work on sets that have infinitely many elements. For example, we’ve talked about theorems that apply to all even numbers, not merely some of them. For example, for all even numbers, adding one yields an odd number. As another example, no matter which two even numbers are added together, the sum is always another even number.

We’ve even talked about theorems that apply to all sets in general, not merely some of them. These include the set operations and the set equalities.

It’s not hard to see why methods that apply to sets of infinitely many objects are powerful. On the other hand, there may be times when there are only a finite number of objects we’re interested in examining. Here, we discuss a method for proving theorems dealing with only a finite number of elements.

A Contrived Example


Admittedly, dealing with only a finite number of elements seems hardly useful, as we mostly want results that apply generally, and not specifically. Here, we provide a contrived example simply to demonstrate the technique.

Example 3.9.1: Every even number from 2 to 20 as a sum of squares

Suppose we wanted to prove that the integers in the set

$$E = \{2, 4, 6, 8, 10, 12, 14, 16, 18, 20\}$$

could all be expressed as a sum of no more than three perfect squares. We could do this by simply tabulating the results.

\[ \begin{array}{l|l} n & \text{Sum of squares} \\ \hline 2 & 1^2 + 1^2 \\ 4 & 2^2 \\ 6 & 1^2 + 1^2 + 2^2 \\ 8 & 2^2 + 2^2 \\ 10 & 1^2 + 3^2 \\ 12 & 2^2 + 2^2 + 2^2 \\ 14 & 1^2 + 2^2 + 3^2 \\ 16 & 4^2 \\ 18 & 3^2 + 3^2 \\ 20 & 2^2 + 4^2 \end{array} \]

As such, we’ve “proved” the desired fact.

Notice that we didn’t say the numbers in $E$ could be written as a unique sum. There may be more than one way to write some of the numbers as a sum of perfect squares, like in the following example:

$$18 = 1^2 + 1^2 + 4^2.$$

We could perhaps call the result derived in the previous example a theorem, since we did provide a proof for the fact, but we prefer to reserve the term theorem for “major” results. That result was merely an exercise.

The Method of Exhaustion


Based on the previous example, we can see why the method presented in this section is called the Method of Exhaustion: it’s because we exhaustively check every single element in the desired set for a desired property. Note that while the term exhaustion is used to describe the thoroughness of checking every element, it doesn’t necessarily refer to the feeling one may get whilst performing the checking — though it should be said that for rather large sets, this method can be tiresome.

Let’s lay out the argument in logical fashion, same as we’ve done before. The reason this method works is because we verify that every element in the desired set has some desired property.

Suppose set $A$ is a finite subset consisting of the $n$ elements

$$A = \{a_1, a_2, a_3, \dots, a_n\}$$

taken from some universal set $\mathcal{U}$. Furthermore, suppose $p$ is an open statement defined on $\mathcal{U}$. The Method of Exhaustion is simply an argument of the form

\[ \begin{array}{l} p(a_1) \\ p(a_2) \\ p(a_3) \\ \vdots \\ p(a_n) \\ \hline \therefore \forall x \in A\ [p(x)] \end{array} \]

That’s all there really is to it.

Computer-Assisted Proofs and the Four Color Theorem


Just because a set is finite doesn’t mean it’s feasible to hand-check every single element within it. Sometimes tasks can be automated by writing computer programs to check thousands or even millions of elements in a timely fashion.

While the example presented above was rather contrived, one major result proved using the Method of Exhaustion was the Four Color Theorem. This theorem states that any planar (basically meaning flat) map only needs at most four different colors so that no adjacent regions on the map share the same color. For centuries, cartographers have been making maps of various places around the world, and one way to draw maps is to color regions so they’re easily distinguishable. It’s typically expected that adjacent regions on a map are colored differently, helping them stand out visually.

It was shown at some point in the late 1800s that no more than five colors were needed for any map so that no adjacent regions shared a color, but it was suspected that no more than four colors were needed as well. Though many mathematicians attempted to prove that no more than four colors were needed, many efforts proved fruitless.

Progress marched forward in the 1960s with the advent of computing technology. Two mathematicians, Kenneth Appel and Wolfgang Haken, further developed results derived from Heinrich Heesch to complete a proof. Essentially, one major step in the proof was showing that all maps could be “reduced” to a small number of essential configurations (basically, all maps are distortions of some simpler underlying map that represent the same types of regions). Appel and Haken found that there were only $1834$ such configurations.

Once Appel and Haken found these configurations, it was simply a matter of checking each and every one of them — using the Method of Exhaustion.

This proof was the first major proof to be verified by computer. As such, it was a controversial result: not all mathematicians readily accepted the proof, because it was hard and time-consuming for a human to check.

Nevertheless, the proof has mostly withstood scrutiny, with a minor error being corrected by Appel and Haken sometime in the late 1980s.

The point is that while the Method of Exhaustion may seem overly simple and contrived, being restricted to only finite sets instead of infinite sets, it’s still a valid proof technique that can come in handy.

Set Partitions

When working with a set of related objects, we may want to split that set up into smaller, more manageable sets.

For example, we may want to split up the integers based on parity: even integers, and odd integers. When dealing with the real numbers, we may want to split them up into three separate sets: the positive real numbers, the negative real numbers, and the number $0$. One more example may be the positive rational numbers, where we split them up based on how big they are — we may have all of the positive rational numbers less than $1$ in one set, and all of the positive rational numbers greater than or equal to $1$ in the other set.

No matter how we split up a set, we’ll want to make sure that all elements of the original set are accounted for in one of the smaller subsets we form.

Partitioning a Set


In the introduction to this section, we mentioned three examples of how we may split a large set into smaller subsets, making sure every element within the original set is in one of the subsets. A partition of a set creates these subsets while making sure that every element is accounted for; however, the word partition also invokes the idea of separation — no two subsets should share any elements. The following definition of partition offers something more precise.

PARTITION

Consider some set $A \subseteq \mathcal{U}$ along with some index set $I$.

For each $i \in I$, let $A_i \subseteq A$ such that $A_i \neq \emptyset$. Then the set

$$\{A_i \mid i \in I\}$$

is called a partition of $A$ if (and only if) the following two conditions are satisfied:

\[ \begin{array}{rl} \text{(1)} &\bigcup_{i \in I} A_i = A \\[0.75em] \text{(2)} &\forall i, j \in I\ [(i \neq j) \to (A_i \cap A_j = \emptyset)] \end{array} \]

Note that none of the sets in the partition can be empty. The whole point of forming a partition is to take elements from the original set and put them into a subset.

Example 3.10.1: Verifying a partition

Consider the following set of numbers:

$$A = \{0, 1, -1, 2, -2, 3, -3, 4, -4\}.$$

If we want to partition this set, we need to form non-empty subsets that are all disjoint, and such that all elements in $A$ are in one of the subsets.

Here’s one way to partition $A$:

\[ \begin{array}{rl} A_1 &= \{0, 1\} \\ A_2 &= \{-1, 2, -2\} \\ A_3 &= \{3, -3, 4, -4\} \end{array} \]

Notice that we didn’t start with the index set $I = \{1, 2, 3\}$. Instead, we formed the subsets first, and then indexed them. Of course, we should check to see if the conditions specified in the definition are met:

\[ \begin{array}{lll} \boldsymbol{A_1 \cup A_2 \cup A_3} & = & \{0, 1\} \cup \{-1, 2, -2\} \cup \{3, -3, 4, -4\} \\ = & A & \end{array} \]

This means that every element from $A$ was accounted for. Now we check to see if all the subsets are disjoint:

\[ \begin{array}{rl} A_1 \cap A_2 &= \{0, 1\} \cap \{-1, 2, -2\} = \emptyset \\ A_1 \cap A_3 &= \{0, 1\} \cap \{3, -3, 4, -4\} = \emptyset \\ A_2 \cap A_3 &= \{-1, 2, -2\} \cap \{3, -3, 4, -4\} = \emptyset \end{array} \]

Both conditions have been met, so this is a legitimate partition of $A$.

Example 3.10.2: Several other ways to partition the same set

There are other ways to partition the set

$$A = \{0, 1, -1, 2, -2, 3, -3, 4, -4\}.$$

One such way to partition the set is with the following:

\[ \begin{array}{rl} X_1 &= \{0, 4\} \\ X_2 &= \{-1\} \\ X_3 &= \{1, 2\} \\ X_4 &= \{-2, -3, -4\} \\ X_5 &= \{3\} \end{array} \]

Notice that we didn’t use the letter $A$ for the names of these subsets. The important thing is the content of the subsets themselves, not the name given to them. As long as the two conditions are met, the collection of sets forms a partition. We could also put every element of $A$ into its own subset, like so:

\[ \begin{array}{rl} Y_1 &= \{0\} \\ Y_2 &= \{1\} \\ Y_3 &= \{-1\} \\ Y_4 &= \{2\} \\ Y_5 &= \{-2\} \\ Y_6 &= \{3\} \\ Y_7 &= \{-3\} \\ Y_8 &= \{4\} \\ Y_9 &= \{-4\} \end{array} \]

Yet another partition we could form is just by taking the entire set itself:

$$Z = \{0, 1, -1, 2, -2, 3, -3, 4, -4\}.$$

Since there are no other sets in this partition, it’s trivially true that the union of all the sets forms $A$. Furthermore, since there are no other sets in the partition, it’s trivially true that all sets in the partition are disjoint.

Examples of Partitions


Example 3.10.3: Partitioning the integers by parity

As mentioned in the introduction, one thing we can do is split up the integers into two subsets: one containing the even integers, and a second subset containing the odd integers.

\[ \begin{array}{rl} A &= \{0, 2, -2, 4, -4, 6, -6, \dots\} \\ B &= \{1, -1, 3, -3, 5, -5, 7, -7, \dots\} \end{array} \]

Here, we didn’t use the same letter for the subset names, nor did we use indices. Again, the names of the subsets aren’t important. What’s important is knowing that all subsets are mutually disjoint, and that all elements from the original set are accounted for.

Example 3.10.4: Partitioning the real numbers

One way to partition the real numbers $\mathbb{R}$ is into three subsets: the subset of all positive real numbers greater than $0$, the subset of all negative real numbers less than $0$, and finally the subset containing just the number $0$.

\[ \begin{array}{rl} X &= \{x \in \mathbb{R} \mid x < 0\} \\ Y &= \{0\} \\ Z &= \{x \in \mathbb{R} \mid x > 0\} \end{array} \]

Some numbers that are in $X$ include $-\pi$, $-12.3372$, and $-\sqrt{2}$.

Some numbers in $Z$ include $1.2345$, $12$, and $\pi \cdot \pi$.

Example 3.10.5: Partitioning the positive rational numbers

As one more example, we could partition the positive rational numbers into two separate subsets.

\[ \begin{array}{rl} A &= \left\{\frac{a}{b} \ \middle|\ (a \in \{0, 1, 2, 3, \dots\}) \land (b \in \{1, 2, 3, \dots\}) \land \left(\frac{a}{b} < 1\right)\right\} \\ B &= \left\{\frac{a}{b} \ \middle|\ (a \in \{0, 1, 2, 3, \dots\}) \land (b \in \{1, 2, 3, \dots\}) \land \left(\frac{a}{b} \geq 1\right)\right\} \end{array} \]

Proof Technique: Casework

Previously, we talked about a proof technique where we examine every single element of a finite set. In a sense, we examined multiple cases, and verified some result for each of those cases. An exhaustive proof is a special kind of proof by casework.

Sometimes, we may have trouble demonstrating that some result holds for a set of elements. However, if we partition the set into groups that have their own special traits, and those traits make it easy to show the desired result holds, a proof by casework can be used to establish the desired result for the entire set.

The Underlying Argument


Suppose we were trying to prove a statement of the form

$$p \to c.$$

Suppose that we somehow knew that

$$p = p_1 \lor p_2 \lor p_3 \lor \dots \lor p_n.$$

If we knew how to show that

\[ \begin{array}{l} p_1 \to c \\ p_2 \to c \\ p_3 \to c \\ \vdots \\ p_n \to c \end{array} \]

we would then have that

$$(p_1 \lor p_2 \lor p_3 \lor \dots \lor p_n) \to c.$$

Thus, because $p = p_1 \lor p_2 \lor p_3 \lor \dots \lor p_n$, we would also have that $p \to c$ by extension.

This proof technique is simply an extension of the Rule of Proof by Cases:

\[ \begin{array}{l} p \to r \\ q \to r \\ \hline \therefore (p \lor q) \to r \end{array} \]

as presented in Chapter 2, Section 6. Even though we could have discussed this proof technique in Chapter 2, we decided to hold off until partitions were discussed, because a lot of casework is done by considering elements from disjoint sets. However, when doing casework, it’s not important that elements from the universe of discourse are in only one subset of a partition.

Whether we form a partition of the universe, or we split the universe up into overlapping subsets, isn’t important. What’s important is that, once we have our desired subsets, every element is represented by at least one of those subsets.

Picking Arbitrary Elements from a Partition


When we partition a set, we split it into disjoint subsets where every element is accounted for in one of the subsets. We don’t have to form these subsets arbitrarily. Instead, we could take all elements from the original set that have some common property, and stick those elements into a subset. We can repeat this process until all elements are accounted for.

Then, from each of these subsets, we choose an arbitrary element. Then, whatever is true of that element will be true for all elements within that subset. In essence, we’re using the principles of Universal Specification and Universal Generalization, along with a partition, to prove a theorem.

Our first theorem will be a result about absolute values of real numbers. As a reminder, here’s the definition of absolute value of a real number.

ABSOLUTE VALUE

For any real number $x$, the absolute value of $x$, commonly denoted $|x|$, is the non-negative real number given by the following:

\[ \begin{array}{rl} |x| = x & \text{when } x \geq 0 \\ |x| = -x & \text{when } x < 0 \end{array} \]

Another way to think of the absolute value of a number is as its distance from $0$.

Theorem 3.11.1: The absolute value of a product

For any two real numbers $x$ and $y$, we have that

$$|xy| = |x||y|.$$
Proof 3.11.1

General Strategy: Because the absolute value changes based on whether the given number is negative or non-negative, we can consider combinations of negative and non-negative numbers for $x$ and $y$ respectively.

We can start by partitioning the real numbers into two subsets: one subset will be the real numbers greater than or equal to $0$, and the other subset will be the real numbers less than $0$.

\[ \begin{array}{rl} \mathbb{R}^+ &= \{x \mid x \geq 0\} \\ \mathbb{R}^- &= \{x \mid x < 0\} \end{array} \]

Notice that we have two variables, $x$ and $y$. Because of how we partitioned the real numbers, we can pick values for $x$ and $y$ from either $\mathbb{R}^+$ or $\mathbb{R}^-$. This gives us four cases to check.

Case 1: $x \in \mathbb{R}^+$, $y \in \mathbb{R}^+$.

Because both $x \geq 0$ and $y \geq 0$, we have that $xy \geq 0$. We also have that $|x| = x$ and $|y| = y$. This tells us that

$$|xy| = xy = |x||y|$$

which is the desired result.

Case 2: $x \in \mathbb{R}^+$, $y \in \mathbb{R}^-$.

Because $y < 0$, we have that $|y| = -y$. We still have that $|x| = x$. Additionally, we know that $xy < 0$, and so $|xy| = -xy$. This tells us that

$$|xy| = -xy = x(-y) = |x||y|.$$

We’ve reached the same desired result.

Case 3: $x \in \mathbb{R}^-$, $y \in \mathbb{R}^+$.

This case is just a mirrored version of Case 2, and so we get the same result.

Case 4: $x \in \mathbb{R}^-$, $y \in \mathbb{R}^-$.

Since both $x$ and $y$ are less than $0$, we have that $|x| = -x$ and $|y| = -y$. However, notice that since both $x$ and $y$ are negative, their product $xy$ will be positive, and so $|xy| = xy$. This gives us the following result:

$$|xy| = xy = (1)xy = (-1)(-1)xy = (-1)x(-1)y = (-x)(-y) = |x||y|.$$

Here, we used the fact that $1 = (-1)(-1)$. We also used the commutative property of multiplication to move around the numbers.

Conclusion. In all four cases, we achieved the result as desired.

An Example with Lots of Cases


Here, we’re going to discuss perfect squares and what kinds of numbers can be the units digits of perfect squares. Before we discuss the next theorem, let’s make some observations about the non-negative integers.

Example 3.11.1: Every non-negative integer has the form 10a + b

Observe the following:

\[ \begin{array}{rl} 0 &= 0 + 0 = 10(0) + 0 \\ 1 &= 0 + 1 = 10(0) + 1 \\ 5 &= 0 + 5 = 10(0) + 5 \\ 13 &= 10 + 3 = 10(1) + 3 \\ 17 &= 10 + 7 = 10(1) + 7 \\ 453 &= 450 + 3 = 10(45) + 3 \\ 102706 &= 102700 + 6 = 10(10270) + 6 \end{array} \]

What we see is that any non-negative integer can be written as

$$10a + b$$

where $a$ is any non-negative integer and $b$ is one of $0, 1, 2, 3, 4, 5, 6, 7, 8$, or $9$.

This will be important to use in our next theorem, but for now we can organize this observation using the following table, where each entry gives the value of $10a + b$ for the row’s $a$ and the column’s $b$:

\[ \begin{array}{l|llllllllll} & b=0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline a=0 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ 1 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 \\ 2 & 20 & 21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 & 29 \\ 3 & 30 & 31 & 32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 \\ 4 & 40 & 41 & 42 & 43 & 44 & 45 & 46 & 47 & 48 & 49 \\ 5 & 50 & 51 & 52 & 53 & 54 & 55 & 56 & 57 & 58 & 59 \\ 6 & 60 & 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 \\ 7 & 70 & 71 & 72 & 73 & 74 & 75 & 76 & 77 & 78 & 79 \\ 8 & 80 & 81 & 82 & 83 & 84 & 85 & 86 & 87 & 88 & 89 \\ 9 & 90 & 91 & 92 & 93 & 94 & 95 & 96 & 97 & 98 & 99 \end{array} \]

From the observations presented in the previous example, we see that any non-negative integer can be written as $10a + b$. This observation will help us in the upcoming theorem.

Theorem 3.11.2: The units digits of perfect squares

The only numbers that can occur in the units digit of a perfect square are $0$, $1$, $4$, $5$, $6$, and $9$.

Proof 3.11.2

General Strategy: We use the observation above that any non-negative integer can be written as $10a + b$. We square that quantity to see what determines the units digit of any perfect square.

Any non-negative integer can be written as $10a + b$ where $a$ is any non-negative integer ($0, 1, 2, 3, 4, 5, \dots$) and $b$ can only be one of $0, 1, 2, 3, 4, 5, 6, 7, 8$, or $9$.

When we square that number, we see that

\[ \begin{array}{lll} \boldsymbol{(10a + b)^2} & = & (10a + b)(10a + b) \\ = & 100a^2 + 10ab + 10ab + b^2 & \\ = & 100a^2 + 20ab + b^2 & \\ = & 10(10a^2 + 2ab) + b^2 & \end{array} \]

Because the quantity $10a^2 + 2ab$ is being multiplied by $10$, the units digit of $(10a + b)^2$ will be the same as the units digit of $b^2$. Remember that $b$ can only take on one of ten values. Thus we could simply check each of those values and see if some pattern emerges.

Case 1: $b = 0$. When $b = 0$, we have that $b^2 = 0$. The units digit of $0$ is of course $0$, so the units digit of $(10a + b)^2$ will also be $0$.

Case 2: $b = 1$. When $b = 1$, we have that $b^2 = 1$. The units digit of $1$ is of course $1$, so the units digit of $(10a + b)^2$ will also be $1$.

Case 3: $b = 2$. When $b = 2$, we have that $b^2 = 4$. The units digit of $4$ is of course $4$, so the units digit of $(10a + b)^2$ will also be $4$.

Case 4: $b = 3$. When $b = 3$, we have that $b^2 = 9$. The units digit of $9$ is of course $9$, so the units digit of $(10a + b)^2$ will also be $9$.

Case 5: $b = 4$. When $b = 4$, we have that $b^2 = 16$. The units digit of $16$ is $6$, so the units digit of $(10a + b)^2$ will also be $6$.

Case 6: $b = 5$. When $b = 5$, we have that $b^2 = 25$. The units digit of $25$ is $5$, so the units digit of $(10a + b)^2$ will also be $5$.

Case 7: $b = 6$. When $b = 6$, we have that $b^2 = 36$. The units digit of $36$ is $6$, so the units digit of $(10a + b)^2$ will also be $6$.

Case 8: $b = 7$. When $b = 7$, we have that $b^2 = 49$. The units digit of $49$ is $9$, so the units digit of $(10a + b)^2$ will also be $9$.

Case 9: $b = 8$. When $b = 8$, we have that $b^2 = 64$. The units digit of $64$ is of course $4$, so the units digit of $(10a + b)^2$ will also be $4$.

Case 10: $b = 9$. When $b = 9$, we have that $b^2 = 81$. The units digit of $81$ is $1$, so the units digit of $(10a + b)^2$ will also be $1$.

Conclusion. After examining all ten cases, we see that the only units digits encountered were $0, 1, 4, 5, 6$, and $9$. This establishes the desired result.

A Common Mistake


The most common error that can occur when doing a proof by cases is not accounting for every element in the universe being considered. It is essential that all the cases you consider account for every possible element.

Example 3.11.2: An incomplete case split

Consider the universe of all integers.

Whether we have a negative or positive integer, squaring that integer yields a number that is either larger than, or equal to, the original integer.

For example, when we start with a positive integer $n \geq 1$, we have that

$$(n \geq 1) \Longrightarrow (n^2 \geq n).$$

Likewise, squaring any negative integer always yields a positive integer, like so:

$$(n \leq -1) \Longrightarrow (n^2 \geq -n \geq n).$$

It may seem like the previous example demonstrates that $n^2 \geq n$ for all integers. After all, we showed it was true for positive integers and negative integers. However, there’s one integer that’s neither positive nor negative, namely $0$. In this situation, since it’s only one integer left unaccounted for, we could simply compute $0^2$ and compare it to $0$ to determine that the above statement is indeed true for all integers. We formalize this proof now.

Theorem 3.11.3: Every integer is at most its own square

For any integer $n$, we have that

$$n \leq n^2.$$
Proof 3.11.3

General Strategy: Here, we’ll partition the integers into three subsets. We’ll consider negative integers, positive integers, and $0$.

Case 1: $n < 0$.

All square numbers are greater than or equal to $0$, meaning $n^2 \geq 0$.

Since $n < 0$ and $n^2 \geq 0$, we necessarily have that $n \leq n^2$ as desired.

Case 2: $n = 0$.

Here, since $0^2 = 0$, we also have that $0 \leq 0^2$. This gives us that $n \leq n^2$ as desired.

Case 3: $n > 0$.

Since $n$ is an integer $> 0$, we have that $n \geq 1$. Multiplying both sides by $n$ gives us that $n^2 \geq n$ as desired.

Conclusion. All integers are accounted for with the three cases presented above. Hence we have the desired result.

Russell's Paradox and a Formal Resolution

Sets are a powerful abstraction that allows us to collect a wide variety of objects into one structure. Typically, all objects within a set share some common characteristic other than mere inclusion in the set. They may be points on the plane, equilateral triangles, even numbers, or even fruits.

As powerful as sets are, we haven’t given a formal definition of what a set is. We’ve been relying on an intuitive definition, and though it works well enough for our purposes, sooner or later the cracks start to show. Sometime around 1901, a mathematician named Bertrand Russell formulated his now-infamous paradox that seemed to dismantle the entire theory of sets. The scary thing about the paradox is that a lot of mathematical research and important results rested on the foundations of Set Theory. If Set Theory is wrong, are all results depending on sets wrong as well?

In this section, we’ll eke out what this paradox is, and hint at a solution that solves the problem.

Sets That Are Members of Other Sets


Over the course of this chapter, we’ve defined sets that mostly have numbers, though we’ve constructed other more intricate sets. Sometimes we’ve constructed sets that contain other sets.

Example 3.12.1: A set containing another set

Let’s consider two different sets:

\[ \begin{array}{rl} A &= \{1, 2, 3\} \\ B &= \{1, 2, 3, \{1, 2, 3\}\} \end{array} \]

Here, we can see that $B$ contains the set $\{1, 2, 3\}$ as an element, which is something we’ve seen before, but we’re going to rewrite set $B$ to make it more obvious that it contains a different set:

$$B = \{1, 2, 3, A\}.$$

We’ve got a handle on this situation, but let’s ask a more interesting question:

Can a Set Contain Itself?


What would it look like for a set to contain itself? Let’s see if we can make such a set.

Example 3.12.2: Trying to build a set that contains itself

Let’s consider the set

$$\boxtimes = \{1\}.$$

Does $\boxtimes$ contain the set $\{1\}$ as an element? Of course not! Right now, $\boxtimes$ only contains a single element, which is a number.

Let’s redefine $\boxtimes$ to contain the set $\{1\}$ as well:

$$\boxtimes = \{1, \{1\}\}.$$

Does $\boxtimes$ contain itself now? Not quite, because now $\boxtimes$ contains two elements, one of which is a number, and the other one being a set. Instead the set $\{1, \{1\}, \{1, \{1\}\}\}$ contains $1$, $\{1\}$, and $\boxtimes$, but this set isn’t the same thing as $\{1, \{1\}\}$, which is what we’ve defined $\boxtimes$ to be.

Let’s try again, this time including the set $\{1, \{1\}\}$:

$$\boxtimes = \{1, \{1\}, \{1, \{1\}\}\}.$$

Of course, we run into the same problem. The sets

$$\{1, \{1\}, \{1, \{1\}\}\} \qquad \text{and} \qquad \{1, \{1\}, \{1, \{1\}\}, \{1, \{1\}, \{1, \{1\}\}\}\}$$

aren’t the same. We see that the set on the right could be written as $\{1, \{1\}, \{1, \{1\}\}, \boxtimes\}$.

It seems that no matter how many iterations we perform, we never quite get a set that contains itself. The only thing we may be able to do is to think about what would happen if we continue this process indefinitely:

$$\boxtimes = \{1, \{1\}, \{1, \{1\}\}, \{1, \{1\}, \{1, \{1\}\}\}, \dots\}.$$

Does this version of $\boxtimes$ contain itself as a member? This is a harder question to ask, because we’re now dealing with an infinite set.

Determining if a set is contained in another set when both sets contain infinitely many elements takes some care, so we’ll sidestep that issue by considering the following set:

$$\boxtimes = \{S \mid (S \text{ is a set}) \land (S \notin S)\}.$$

What kind of set is $\boxtimes$? It’s a set whose elements are sets. But these are special sets. In the previous example, we were concerned with what a set that contains itself would look like. Here, we don’t scrutinize whether a given set contains itself. Instead we’re just assuming that we’ve somehow curated every set, and are only including sets that don’t contain themselves.

Now consider the following question: is $\boxtimes$ contained within $\boxtimes$? Remember that for propositions such as $\boxtimes \in \boxtimes$, there are only two possibilities: either $\boxtimes \in \boxtimes = 0$ or $\boxtimes \in \boxtimes = 1$. Let’s consider both possibilities.

Case 1: $\boxtimes \in \boxtimes = 0$.

Here, we’re considering the possibility where $\boxtimes$ doesn’t contain itself. Well, since $\boxtimes \notin \boxtimes$, we know that

\[ \begin{array}{lll} & \boldsymbol{\boxtimes \notin \boxtimes} & \textbf{Reason} \\ \Longrightarrow & \neg((\boxtimes \text{ is a set}) \land (\boxtimes \notin \boxtimes)) & \text{Definition of } \boxtimes \\ \Longrightarrow & \neg(\boxtimes \text{ is a set}) \lor \neg(\boxtimes \notin \boxtimes) & \text{DeMorgan's Laws} \\ \Longrightarrow & (\boxtimes \text{ is not a set}) \lor (\boxtimes \in \boxtimes) & \text{Law of Double Negation} \end{array} \]

However, notice what the logical implications are if $\boxtimes \notin \boxtimes$: either $\boxtimes$ is not a set (it is, so this would be a contradiction) or $\boxtimes \in \boxtimes$ (which contradicts the supposition that $\boxtimes \notin \boxtimes$). Either way, the proposition $\boxtimes \notin \boxtimes$ yields contradictions. As such, we may suspect that $\boxtimes \in \boxtimes = 1$. Let’s check.

Case 2: $\boxtimes \in \boxtimes = 1$.

Suppose we somehow knew that $\boxtimes \in \boxtimes$.

\[ \begin{array}{lll} & \boldsymbol{\boxtimes \in \boxtimes} & \textbf{Reason} \\ \Longrightarrow & (\boxtimes \text{ is a set}) \land (\boxtimes \notin \boxtimes) & \text{Definition of } \boxtimes \\ \Longrightarrow & \boxtimes \notin \boxtimes & \text{Conjunctive Simplification} \end{array} \]

So, by assuming $\boxtimes \in \boxtimes$, the logical implication is that $\boxtimes \notin \boxtimes$? This is a clear contradiction.

At this point, both cases yield contradictions. This could be a problem, but solutions do exist.

Resolving the Paradox


How come we haven’t had this problem dealing with any of the previously defined sets in this chapter? It has to do with the fact that we were constructing sets with particular objects. Even numbers are easy to grasp, quadrilaterals are easy to grasp, but abstract set requirements aren’t so easy to grasp. We even had trouble trying to come up with a set that contained itself in the second example above.

While not a resolution to the paradox, defining sets using easy-to-grasp elements does at least avoid the issue.

Perhaps the most commonly used formal system of Set Theory is ZFC Set Theory. ZFC is short for Zermelo–Fraenkel–Choice, where Zermelo and Fraenkel are the two mathematicians who formulated this type of Set Theory, and the word choice refers to the Axiom of Choice, which is something that will be examined later in this book.

ZFC Set Theory came around in the early 20th century, and is free of paradoxes like Russell’s Paradox. ZFC Set Theory is an intricate system, and requires some more advanced mathematics to understand. While it isn’t discussed in this book, further reading on ZFC Set Theory and on the history of Russell’s Paradox is easy to find, for anyone curious enough to look into how it inspired the search for more axiomatic systems of Set Theory.