Skip to main content

Section 1.3 Sets

Subsection 1.3.1 Intro To Sets

We often talk about collections of objects, like whole numbers, or integers, or polygons, or triangles. So far, we’ve dealt with these just with words but it was pretty repetitive and clumsy. It would be nice (and it is important!) if we had some rules for talking about collections of objects.
In this section, we do introduce our language for collections of objects and their members. We also look at how to combine collections and the relationship between our language for collections and logic.

Definition 1.3.1.

A set is a collection of objects, called elements, with some rules attached:
  1. Elements do not occur more than once in a set.
  2. The order in which the elements are listed does not matter.
Often, sets are written with capital letters, like \(A,B,X,Y\text{,}\) and so on, and elements of these sets are written with lower case letters, like \(a,b,x,y\text{,}\) and so on. If an object \(a\) is an element of a set \(A\) we write \(a \in A\text{.}\) If \(a\) is not an element of \(A\text{,}\) we write \(a \notin A\text{.}\)
There are a few different ways of telling people what elements are in a set. We can:
  1. List the elements; e.g. \(\{1,2,3,4,5\}\)
  2. Describe the elements in words; e.g. \(\{ \text{all counting numbers from 1 to 5, inclusive} \}\)
  3. Describe the elements using mathematical notation; e.g. \(\{ \text{whole numbers } n \ | \ 1 \leq n \leq 5 \}\)
We call the final method set builder notation and read the " \(|\) " symbol as the phrase "such that". So, in words, we would read this set builder notation as "whole numbers \(n\) such that \(n\) is between 1 and 5, inclusive", or some other phrase with an equivalent meaning (for example, greater than or equal to 1 and less than or equal to 5).

Checkpoint 1.3.2.

  1. \(\displaystyle A_1 = \{ \text{all prime numbers less than 11} \}\)
  2. \(\displaystyle A_2 = \{ \text{whole numbers } n \ | \ 10 \leq n(n+1) \leq 25 \} \)
  3. \(\displaystyle A_3 = \{ \text{NHL teams active in the 2021-2022 season that, as of Jan 1, 2022 have never won a Stanley Cup} \}\)
  4. \(\displaystyle A_4 = \{ \text{prime numbers } p \ | \ p \geq 3 \text{ and } p^2 \text{ is even} \}\)
Solution 1.
\(A_1 = \{2,3,5,7 \}\text{.}\) Note that 11 is not included as 11 is not less than 11.
Solution 2.
It’s probably easiest to check this by trial and error. The smallest value of \(n\) that satisfies this condition is \(n=3\) (as \(3 \times 4 = 12\) but \(2 \times 3 = 6\)). And the largest value that satisfies this condition is \(n=4\) as \(4 \times 5 =20\) but \(5 \times 6 = 30\text{.}\) So \(A_2 = \{3,4\}\text{.}\)
Solution 3.
You might have to know a bit of hockey to know this, but you can look this up in a table on, say, Wikipedia. Thus \(A_3 = \{ \text{Panthers, Sabres, Blue Jackets, Jets, Wild, Coyotes, Predators, Canucks, Sharks, Kraken, Golden Knights} \}\)
Solution 4.
There are *no* prime numbers besides 2 that have an even square, as for any odd number \(n, n^2\) is also odd. So \(A_4 = \{ \}. \)
Remember that sets do not have an order to their elements. It’s simply a list of what the set contains. A good analogy for a set is a bag containing the elements in your set:
Note that in the previous exercise, we came across the set with no elements. We call this the empty set and write it as \(\{ \}\) or with \(\emptyset.\)
It’s very useful to be able to talk about sets contained in other sets. We call these subsets. More generally, let A and B be two sets. If all elements of B are also elements of A, then we say B is a subset of A, and we write \(B \subseteq A.\)

Example 1.3.3.

Notice that the definition of a subset contains a quantifier. Use the idea of negation of quantifiers to determine when B is not a subset of A, written \(B \not \subseteq A\text{.}\)
Solution.
Remember, to negate a quantifier, we change the quantifier type, and negate the open sentence. So \(B \not \subseteq A\) means "There is an element in B that is not in A." In the language of counterexamples, this says that there is a counterexample to the definition of subsets.
You can view the idea of a subset using Venn diagrams. In the diagram below, B is a subset of A:
Let’s look at a few examples of subsets to help us understand how the concept works:

Example 1.3.4.

Let’s define the following sets:
  1. \(\displaystyle A = \{1,2,3,4,5,6,7\}\)
  2. \(\displaystyle B = \{2,4,6,8\}\)
  3. \(\displaystyle C = \{1, 2, 4, 6 \}\)
  4. \(\displaystyle D = \emptyset\)
Let’s check if \(B \subseteq A\text{.}\) If we find one element that is in B but not in A, then \(B \not \subseteq A.\text{.}\) Note that \(8 \in B\) but \(8 \not \in A\text{.}\) We’ve found a counterexample to the definition of a subset, thus \(B \not \subseteq A.\)
Is \(C \subseteq A\text{?}\) We can see that all of the element of C, that is 1,2,4, and 6, are also elements of A. Thus \(C \subseteq A.\)
Is \(D \subseteq A\text{?}\) Yes! This is "vacuously true" as there is no counterexample to the definition of subset. Alternatively you can view it the following way: The statement \(D \not \subseteq A\) is not true, as there is no element of D that is not an element of A. So if \(D \not \subseteq A\) is false, it must be that its negation \(D \subseteq A\) is true.
Is \(A \subseteq A\text{?}\) Of course! Every element of A is also an element of A (obviously!).
Another concept that is important to us is the number of elements in a set A, which we call the cardinality of A. We write this \(|A|\text{.}\)

Example 1.3.5.

\(E = \{ \text{all even counting numbers} \}.\)\(|A| = 7, \ |B| = 4, \ |C|= 4, \ |D| = 0, \ |E| = \infty\text{.}\)

Notes for Additional Understanding.

There’s no limit to the types of objects sets can contain, and can even contain other sets. There is a lot more to be said about sets (there is an entire branch of mathematics dedicated to studying them), but it’s beyond the scope of this book.
Another important concept is when two sets have the same elements. We say that sets A and B are equal, and write \(A=B\) if A and B have exactly the same elements. Alternatively, we can say that \(A=B\) when \(A \subseteq B\) and \(B \subseteq A\text{.}\)

Example 1.3.6.

Let \(S_1 = \{ 2,3,5,7\}\) and \(S_2 = \{\text{prime numbers less than 10}\}\text{.}\) Since all prime numbers less than 10 are 2,3,5 and 7, we have that \(S_1 = S_2\text{.}\)
There are a few sets of numbers that we talk about quite a lot (you’ve probably noticed that so far). Since they are so commonly used, mathematicians have some notation for these, and we’ll use this throughout the rest of the textbook to save time and space.
  • We let \(\mathbb{N} = \{1,2,3,4, \ldots \}\) and call it the set of natural numbers, or counting numbers.
  • We let \(\mathbb{N}_0 = \{0,1,2,3,4, \ldots \}\) and call it the set of natural numbers with zero, or whole numbers.
  • We let \(\mathbb{Z} = \{ \ldots, -3, -2, -1, 0, 1, 2, 3, \ldots \} \) and call it the set of integers. Note that some other textbooks might use the symbol \(\mathbb{I}\) instead, but \(\mathbb{Z}\) is most common.
  • We let \(\mathbb{Q} = \{ \dfrac{a}{b} \ | \ a,b \in \mathbb{Z} \text{ and } b \neq 0 \text{ and the usual rules for equivalent fractions hold} \}\) and call it the set of rational numbers. Note that this is saying that the set contains all fractions with integer numerators and denominators, but we cannot have a denominator of 0.
  • We let \(\mathbb{R} = \{ \text{all numbers on the number line} \}\) be the set of real numbers. This set includes numbers like \(\pi, \sqrt{2},\) and all others.
From the following diagram you can see that these sets are listed in a "subset ordering", that is \(\mathbb{N} \subseteq \mathbb{N}_0 \subseteq \mathbb{Z} \subseteq \mathbb{Q} \subseteq \mathbb{R}\text{.}\)

Checkpoint 1.3.7.

Let A,B,C be sets that aren’t the empty set (so \(A,B,C \neq \emptyset\)). Show that if \(A \subseteq B\) and \(B \subseteq C\) then \(A \subseteq C\text{.}\)
Solution.
Note that this is an if-then statement. So we need to show that it’s never the case that the if-part is true and the then-part is false. But, in the definition of subsets we have additional if-then statements as well, so we have to be careful with these "nested" conditional statements.
Let’s assume the if-part is true: that \(A \subseteq B\) and \(B \subseteq C\text{.}\) So this means that if \(x \in A\) then \(x \in B\) (since A is a subset of B) and if \(x \in B\) then \(x \in C\) (since B is a subset of C).
We need to show that the then-part is true; that A is a subset of C, so if \(x \in A\) then \(x \in C\text{.}\)
So now, using the if-part assumption, let’s show that the then-part is true. Let \(x \in A\text{.}\) By our assumption that \(A \subseteq B\) we know \(x \in B\text{.}\) Now, by the second part of our assumption, that \(B \subseteq C\) we know that \(x \in C\text{.}\)
Since we started with an element of A and showed that it must be an element of C, we have shown the then-part; that \(A \subseteq C\text{,}\) and this means we’ve proved that the if-then statement is always true.
Note that you can see this visually using the following Venn diagram:
Looking at the Venn diagram for subsets, you may have realized that it’s the same as the diagram for conditional statements, which is very related to the universal quantifiers. In fact, they are very related concepts, and we can view the same Venn diagram with these three lenses.
For example, we can phrase the same idea in three ways:
  1. All cats are mammals
    If something is a cat, then it is a mammal.
    Cats are a subset of mammals.
Let’s label the same Venn diagram using the three viewpoints:
INSERT VENN DIAGRAM

Subsection 1.3.2 Combining Sets

An important thing we wish to do is to be able to talk about set operations. These are very related to logical operations from the previous section.
Sometimes we like to keep track of when objects (like numbers) satisfy all conditions, and other times we like when they satisfy at least one. And another thing we like to talk about is when objects satisfy one condition, but not another. Let’s introduce some notation for this:

Example 1.3.8.

Definition 1.3.9.

Let A and B be two sets. Then the union of A and B, written \(A \cup B\) is the set of all elements that are either in A or B (or both). In set notation we write \(A \cup B = \{ x \ | \ x \in A \text{ or } x \in B\}.\)

Definition 1.3.10.

Let A and B be two sets. Then the intersection of A and B, written \(A \cap B\) is the set of all elements that are in both A and B. In set notation we write \(A \cap B = \{ x \ | \ x \in A\) and \(x \in B\}.\)

Definition 1.3.11.

Let A and B be two sets. Then the difference of A and B, written \(A - B\) is the set of all elements that are in A but not in B. In set notation we write \(A - B = \{ x \ | \ x \in A \)> and \(> x \not \in B\}.\)
Finally, we like to talk about *all* objects that do not satisfy a rule. However, we have to be careful that we limit the objects just to those that we’re interested in talking about.

Definition 1.3.12.

We call the set of all possible objects we wish to consider the universe, and usually denote this set by the letter \(U\text{.}\)

Definition 1.3.13.

Let A be a set. We say the set complement, written \(\sim A\text{,}\) is the set of all elements in the universe \(U\) not in A. In set notation, \(\sim A = \{ x \in U \ | \ x \not \in A \}.\)

Example 1.3.14.

Suppose we were only interested in the counting numbers up to 10. Let’s define the universe \(U = \{ 1,2,3, \ldots , 9, 10 \}\) and the following sets:
  1. \(\displaystyle A = \{1,2,3,4,5,6,7\}\)
  2. \(\displaystyle B = \{2,4,6,8\}\)
Then
\begin{equation*} A \cup B = \{ 1,2,3,4,5,6,7,8\}, \ A \cap B = \{2,4,6\}, \ A - B = \{1,3,5,7\}, \ B - A = \{8\}, \ \sim A = \{8,9,10\} \end{equation*}
Here are some Venn diagram showing the sets above:

Checkpoint 1.3.15.

Let the universe \(U = \{ \text{ all polygons } \}\) and define the following sets:
\begin{equation*} A = \{ \text{ all triangles } \}, \end{equation*}
\begin{equation*} B = \{ \text{ all polygons with at least one obtuse angle (angle larger than 90 degrees) }\}, \end{equation*}
\begin{equation*} C= \{ \text{ all polygons with at most 5 sides } \}. \end{equation*}
For each set:
  1. \(\displaystyle A \cap B\)
  2. \(\displaystyle A \cup C\)
  3. \(\displaystyle \sim B\)
  4. \(\displaystyle C - B\)
  5. \(\displaystyle A - A\)
Solution 1.
Since elements in an intersection need to satisfy being a member of *both* A and B, we have that \(A \cap B = \{ \text{ obtuse triangles} \}\text{.}\)
A possible example of an element in this set is a triangle with one angle of 100 degrees:
An obtuse triangle
A possible example of an element not in this set is a square:
A square
Solution 2.
Since elements in a union need to satisfy being a member of *either* A or B (or both), we have that \(A \cup C = \{ \text{ all polygons that are triangles or have at most 5 sides.} \}\text{.}\) However, triangles are polygons of at most 5 sides (they have three). Thus we have that \(A \subseteq C\) and thus we can express \(A \cup C = \{ \text{ all polygons of at most 5 sides.} \}\) and note \(A \cup C = C\text{.}\)
An example of an element of the set is the square:
Picture of a square
and a non-example would be a hexagon since it has more than 5 sides:
Picture of a hexagon
Solution 3.
Since elements in complement are all elements not in the original set, we have that \(\sim B = \{ \text{ all polygons with no obtuse angles } \}\text{.}\) In a future Geometry chapter we will show that this set will only contain certain triangles and quadrilaterals (polygons with 4 sides).
An example of an element in the set is a square, since it has all angles of measure exactly 90 degrees (and not larger):
Picture of a square
A non-example is a triangle with one angle with measure 100 degrees:
Picture of an obtuse triangle
Solution 4.
Since elements in the set difference need to satisfy being a member of C but not B, we have that \(C - B = \{ \text{ polygons with at most 5 sides but without any obtuse angles } \}\text{.}\) Again, in a future chapter we will show that \(\sim B = C - B\)
Note that the examples and non-examples from the previous part work for this set as well.
Solution 5.
Elements in the set difference need to satisfy being a member of A but not A. However there are, of course, *no* elements that are both a member and not a member of a set. Thus, we have that \(A - A =\emptyset\text{.}\)
Note that since the set is empty, no polygon is an example of an element in the set, and every polygon is a non-example.