Skip to main content

Section 1.1 Introduction to Sets

Subsection 1.1.1 Sets

Definition 1.1.1.

Intuitively, a set is a collection of distinct objects, called elements (or members).

  • Sets are typically represented by capital letters, like \(A, B, S\text{,}\) etc.

  • The objects in sets can be pretty much anything, i.e. they need not be numbers.

Sets can be defined by listing the elements within set braces, \(\{ \text{ and } \}\text{,}\) separated by commas. For example, the set containing the integers 1, 2, and 4 would be written as,

\begin{equation*} \set{1, 2, 4} \end{equation*}

This is called the roster method, because it involves simply listing the elements of the set. If the set is large, then we can write,

\begin{equation*} \set{1, 2, 3, \dots, 100} \end{equation*}

which represents the set of all integers from 1 to 100.

If an object \(x\) is an element of the set \(A\text{,}\) we write \(x \in A\text{.}\) Otherwise, we write \(x \notin A\text{.}\) For each object \(x\) and set \(A\text{,}\) either \(x \in A\) or \(x \notin A\text{,}\) but not both.

Definition 1.1.2.

Two sets are equal, \(A = B\text{,}\) if and only if they contain exactly the same elements (up to ordering). Otherwise, they are not equal, \(A \neq B\text{.}\) In other words, two sets are not equal if at least one element is in one of the sets and is not in the other set.

This means that a set is completely determined by its elements, and in particular not by the ordering of the elements, or how many times the elements are listed.

For example, \(\set{1,2,3} = \set{2,3,1} = \set{3,2,1}\text{,}\) but \(\set{1,2} \neq \set{1,3}\text{.}\)

Also, sets with duplicate objects are considered equal to the set without the duplicates. For example,

\begin{equation*} \set{1, 2} = \set{1, 2, 1} = \set{1, 2, 1, 1, 1, 1, 1} \end{equation*}

All of these sets are equal, again because every element in each set is also in the other set. Of course, by convention, for simplicity, sets are written without duplicate elements.

Subsection 1.1.2 Set-Builder Notation

A set can also be defined based on all its elements sharing a common property. This can be done using set-builder notation, which defines a set as,

Definition 1.1.3.

Let \(S\) be a set, \(P(x)\) be a property that elements of \(S\) may or may not satisfy. Then, we write,

\begin{equation*} \set{x \in S: P(x)} \end{equation*}

which represents the set of all elements \(x\)in \(S\) such that \(P(x)\) is true.

Remark 1.1.4.

Here, the colon \(:\) means “such that”. Sometimes, we use a vertical bar \(\mid\) instead, i.e. \(\set{x \in S \mid P(x)}\text{.}\)

With this notation, the variable \(x\) is a dummy variable, in that replacing \(x\) with any other variable or symbol does not change the set. For example, the following two sets are equal,

\begin{equation*} \set{x \in S: P(x)} = \set{y \in X: P(y)} \end{equation*}

Sometimes, for convenience, we simply write,

\begin{equation*} \set{x : P(x)} \end{equation*}

without specifying the set that \(x\) belongs to, especially if the set \(S\) is implicitly clear.

Subsection 1.1.3 Finite and Infinite Sets

Some sets have infinitely many elements. In roster notation, which can be indicated by an ellipsis “\(\dots\)”.

Definition 1.1.5.

Intuitively, a finite set has a finite number of elements, i.e. the number of elements in the set is a whole number. An infinite set has infinitely many elements, i.e. the number of elements in the set is not a whole number.

Definition 1.1.6.

The empty set (or null set), denoted by \(\emptyset\) or \(\set{}\text{,}\) is the unique set with no elements.

Subsection 1.1.4 Cardinality

Definition 1.1.7.

Let \(A\) be a finite set. The cardinality (or size or cardinal number) of a set \(A\text{,}\) denoted by \(n(A)\) or \(\abs{A}\text{,}\) is the number of elements in \(A\text{.}\)

Intuitively, the notation \(\abs{A}\) uses the absolute value bars, which intuitively means the “size” of the set.

For \(A = \set{1,2,4}\text{,}\) \(\abs{A} = 3\text{.}\)

The empty set has cardinality zero, \(\abs{\emptyset} = 0\text{,}\) and it is the unique set with this property.

Subsection 1.1.5 Subsets

Definition 1.1.9.

A set \(A\) is a subset of a set \(B\text{,}\) denoted by \(A \subseteq B\text{,}\) if every element of \(A\) is also an element of \(B\text{.}\)

Intuitively, if \(A \subseteq B\text{,}\) then the set \(A\) is “contained within” \(B\text{.}\)

Subsection 1.1.6 Important Sets of Numbers

In mathematics, naturally, the most important sets are sets containing numbers. Many of these sets are used frequently enough to be worthy of a term, symbols and notation to denote them.

  • Natural numbers. These are the numbers used for counting,

    \begin{equation*} \mathbb{N} = \set{1, 2, 3, \dots} \end{equation*}
    Note that some mathematicians, and especially computer scientists, include 0 as a natural number.

  • Whole numbers. If one considers the natural numbers to not include zero, then the whole numbers are the natural numbers, including zero.

    \begin{equation*} \set{0, 1, 2, 3, \dots} \end{equation*}
    Sometimes, the whole numbers are represented by \(\mathbb{W}\text{.}\)

  • Integers. The set including all whole numbers and the negatives of the natural numbers,

    \begin{equation*} \mathbb{Z} = \set{\dots, -3, -2, -1, 0, 1, 2, 3, \dots} \end{equation*}
    The integers are denoted by Z because the German word for number is Zahlen.

Note that infinite sets can be listed using an ellipsis “\(\dots\)”.

To avoid ambiguity, sometimes the notation \(\mathbb{Z}^{+}\) is used to represent the postive integers, rather than using the term natural numbers.

Also, sometimes, the set of whole numbers is referred to as the non-negative integers.

  • Rational numbers (or fractions, or simply rationals). The set of all numbers that can be represented as a quotient of two integers (of course, such that the denominator isn't 0). Represented as decimals, rational numbers are terminating or repeating decimals.

    \begin{equation*} \mathbb{Q} = \set{\frac{a}{b}: a, b \in \mathbb{Z}, b \neq 0} \end{equation*}
    The rationals are denoted by Q for “quotient”.

  • Irrational numbers. The set of all numbers which cannot be represented as quotients of integers. Sometimes, it is denoted by \(\mathbb{I}\text{.}\) Represented as decimals, irrational numbers are neither terminating nor repeating.

  • Real numbers \(\mathbb{R}\text{.}\) The set including all rational and irrational numbers. Roughly, it is the set of all decimal numbers. Or, it can be thought of as the set of all numbers on a number line.

The real numbers \(\mathbb{R}\) is said to be continuous, because it is thought of to have no “holes”. In contrast, the integers \(\mathbb{Z}\) are said to be discrete, because they are all separated from each other. This is why it is called discrete mathematics.

  • Complex numbers \(\mathbb{C}\text{.}\) The set of all numbers of the form \(a + bi\text{,}\) where \(a, b \in \mathbb{R}\text{,}\) and \(i\) is the imaginary unit which satisfies \(i^2 = -1\text{.}\) In other words,

    \begin{equation*} \mathbb{C} = \set{a + bi: a, b \in \mathbb{R}} \end{equation*}

Subsection 1.1.7 Intervals of Real Numbers

Intervals are a particular kind of subset of real numbers. Roughly, they represent a range of numbers which lie between two given numbers. Let \(a \leq b\text{.}\) Then,

  • A closed interval \([a,b]\) is the set,

    \begin{equation*} [a, b] = \set{x \in \mathbb{R}: a \leq x \leq b} \end{equation*}

  • An open interval \((a,b)\) is the set,

    \begin{equation*} (a, b) = \set{x \in \mathbb{R}: a \lt x \lt b} \end{equation*}

  • A half-open interval is the set,

    \begin{equation*} (a, b] = \set{x \in \mathbb{R}: a \lt x \leq b} \end{equation*}
    or,
    \begin{equation*} [a, b) = \set{x \in \mathbb{R}: a \leq x \lt b} \end{equation*}

  • Infinite intervals. Can be of the form,

    \begin{align*} (a, \infty) \amp = \set{x \in \mathbb{R}: x > a}\\ [a, \infty) \amp = \set{x \in \mathbb{R}: x \geq a}\\ (-\infty, b) \amp = \set{x \in \mathbb{R}: x \lt b}\\ (-\infty, b] \amp = \set{x \in \mathbb{R}: x \leq b}\\ (-\infty, \infty) \amp = \mathbb{R} \end{align*}

In this notation, the symbol \(\infty\) or \(-\infty\) doesn't represent a number. Rather, it simply indicates that the interval is unbounded. Note that the notation for an open interval \((a,b)\) is the same as the notation for an ordered pair \((a,b)\) (this is an abuse of notation). However, the context is almost always clear as to which is being referred to.