4.1 Defining and Writing Sets

Definition 4.1 (Set).

A collection of objects is called a set11 1 This definition is adequate for now but we shall see that it requires subtle refinement. A complete definition (and there are a few equivalent options) is covered in logic or the foundations of mathematics later. See Russell’s Paradox for more details..

  1. 1.

    The objects within a set are called its elements.

  2. 2.

    If the element aa belongs to the set SS, we write aSa\in S. If the element aa is not in the set SS, we write aSa\notin S.

  3. 3.

    Two sets are equal if they contain exactly the same elements.

  4. 4.

    Sets do not contain identical repeated elements.

  5. 5.

    We use curly brackets (also called braces) to indicate that we are defining a set. For example, {Monday, Tuesday, Wednesday} indicates the set consisting of the elements Monday, Tuesday and Wednesday.

It is important to note that symbols in mathematics form part of an English sentence. The symbol \in stands for “is an element of”. So, in a sentence, aSa\in S is read as “aa is an element of SS”.

Example 4.2.

Some sets of numbers are so important they get their own name:

  • \mathbb{N}

    ={1,2,3,}=\{1,2,3,\dots\} is the set of strictly positive integers or natural numbers.

  • \mathbb{Z}

    ={3,2,1,0,1,2,3,}=\{\dots-3,-2,-1,0,1,2,3,\dots\} is the set of all integers,

  • \mathbb{Q}

    is the set of rational numbers, and

  • \mathbb{R}

    is the set of all real numbers.

Note that in this course \mathbb{N} does not include 0. Other mathematicians sometimes consider 0 to be a natural number so may say 00\in\mathbb{N}. It is therefore always worth checking which definition you are working with. You may also see the notation 0={0,1,2,3,}\mathbb{N}_{0}=\{0,1,2,3,\cdots\}.

Sets can consist of anything, including other sets. All elements within a set don’t have to be the same type of object. For example, {2,{4}}\{2,\{4\}\} is a set containing 2 and the set {4}\{4\}. Therefore, {4}{2,{4}}\{4\}\in\{2,\{4\}\} but 4{2,{4}}4\notin\{2,\{4\}\}.

Sets can also contain nothing. The set with no elements is called the empty set and is written ∅︀\emptyset.

Sometimes it is not helpful or possible to list all the objects within a set. For example, we know there are infinitely many prime numbers but we don’t know of any clear patterns to them so writing the set of prime numbers as a list within braces would not be feasible.

Instead, we can express the elements of a set in terms of the criteria they must satisfy to be in that set. So if my set SS consists of all elements of a set AA that satisfy a particular criteria, I could write

S={xA:“criteria that x satisfies”}.S=\{x\in A:\text{``criteria that $x$ satisfies''}\}.

Thus, we can write the set of prime numbers as

{x:x is a prime number},\{x\in\mathbb{R}:x\text{ is a prime number}\},

and read this as "the set of all real numbers xx such that xx is prime". This way of writing a set is known as set-builder notation.

If a set BB consists of elements from the set AA, we call AA the universal set for BB. For example, the universal set for

{x:x is a prime number},\{x\in\mathbb{R}:x\text{ is a prime number}\},

is \mathbb{R}.

Example 4.3.

We’ve already seen that the rational numbers \mathbb{Q} are the set of all real numbers which can be written as a fraction. Using set-builder notation, we can express the set \mathbb{Q} as:

={x:x=pq for p and q}.\mathbb{Q}=\left\{x\in\mathbb{R}:x=\frac{p}{q}\text{ for }p\in\mathbb{Z}\text{% and }q\in\mathbb{N}\right\}.

Another useful form of notation lets us define intervals of the real number line.

Definition 4.4 (Interval Notation).

Let aa and bb be two real numbers such that a<ba<b. Then

(a,b)\displaystyle(a,b) ={x:a<x<b};\displaystyle=\{x\in\mathbb{R}:a<x<b\};
(a,b]\displaystyle(a,b] ={x:a<xb};\displaystyle=\{x\in\mathbb{R}:a<x\leq b\};
[a,b)\displaystyle[a,b) ={x:ax<b};\displaystyle=\{x\in\mathbb{R}:a\leq x<b\};
[a,b]\displaystyle[a,b] ={x:axb}.\displaystyle=\{x\in\mathbb{R}:a\leq x\leq b\}.
Example 4.5.

The set of positive real numbers less than or equal to 2 can be written as (0,2]={x:0<x2}(0,2]=\{x\in\mathbb{R}:0<x\leq 2\}.

We can extend this notation to also define real intervals with no upper or lower bound:

Definition 4.6.

Let aa be a real number. Then

(a,)\displaystyle(a,\infty) ={x:a<x};\displaystyle=\{x\in\mathbb{R}:a<x\};
[a,)\displaystyle[a,\infty) ={x:ax};\displaystyle=\{x\in\mathbb{R}:a\leq x\};
(,a)\displaystyle(-\infty,a) ={x:a>x};\displaystyle=\{x\in\mathbb{R}:a>x\};
(,a]\displaystyle(-\infty,a] ={x:ax}.\displaystyle=\{x\in\mathbb{R}:a\geq x\}.

Note that we never use a square bracket immediately before or after the symbol \infty which represents “infinity”.