This is a revision of the section of abstractmath.org on notation for sets.

## Sets of numbers

The following notation for sets of numbers is fairly standard.

- $\mathbb{N}$ is the set of all natural numbers.
- $\mathbb{Z}$ is the set

of all integers - $\mathbb{Q}$ is the set of all rational numbers.
- $\mathbb{R}$ is the set of all real numbers.
- $\mathbb{C}$ is the set of all complex numbers.

### Remarks

- Some authors use $\mathbb{I}$ for $\mathbb{Z}$, but $\mathbb{I}$ is also used for the unit interval.
- Many authors use $\mathbb{N}$ to denote the nonnegative integers instead

of the positive ones. - To remember $\mathbb{Q}$, think “quotient”.
- $\mathbb{Z}$ is used because the German word for “integer” is “Zahl”.

Until the 1930’s, Germany was the world center for scientific and mathematical study, and at least until the 1960’s, being able to read scientific German was was required of anyone who wanted a degree in science. A few years ago I was asked to transcribe some hymns from a German hymnbook — not into English, but merely from fraktur (the old German alphabet) into the Roman alphabet. I sometimes feel that I am the last living American to be able to read fraktur easily.

## Element notation

The expression “$x\in A$” means that $x$ is an element of the set $A$. The expression “$x\notin A$” means that $x$ is not an element of $A$.

“$x\in A$” is pronounced in any of the following ways:

- “$x$ is
**in**$S$”. - “$x$ is an
**element**of $S$”. - “$x$ is a
**member**of $S$”. -
“$S$
**contains**$x$”. - “$x$
**is contained in**$S$”.

### Remarks

**Warning:**The math English phrase “$A$ contains $B$” can mean either “$B\in A$” or “$B\subseteq A$”.- The Greek letter epsilon occurs in two forms in math, namely $\epsilon$ and $\varepsilon$. Neither of them is the symbol for “element of”, which is “$\in$”. Nevertheless, it is not uncommon to see either “$\epsilon$” or “$\varepsilon$” being used to mean “element of”.

##### Examples

- $4$ is an element of all the sets $\mathbb{N}$, $\mathbb{Z}$, $\mathbb{Q}$, $\mathbb{R}$, $\mathbb{C}$.
- $-5\notin \mathbb{N}$ but it is an element of all the others.

## List notation

### Definition: list notation

A set with a small number of elements may be denoted by listing the elements inside braces (curly brackets). The list must include *exactly all of the elements of the set and nothing else.*

##### Example

The set $\{1,\,3,\,\pi \}$ contains the numbers $1$, $3$ and $\pi $ as elements, and *no others.* So $3\in \{1,3,\pi \}$ but $-3\notin \{1,\,3,\,\pi \}$.

### Properties of list notation

#### List notation shows every element and nothing else

If $a$ occurs in a list notation, then $a$ is in the set the notation defines. If it does not occur, then it is *not* in the set.

##### Be careful

When I say “$a$ occurs” I don’t mean it necessarily occurs *using that name.* For example, $3\in\{3+5,2+3,1+2\}$.

#### The order in which the elements are listed is irrelevant

For example, $\{2,5,6\}$ and $\{5,2,6\}$ are the same set.

#### Repetitions don’t matter

$\{2,5,6\}$, $\{5,2,6\}$, $\{2,2,5,6 \}$ and $\{2,5,5,5,6,6\}$ are all different representations of the same set. That set has exactly three elements, no matter how many numbers you see in the list notation.

Multisets may be written with braces and repeated entries, but then the repetitions mean something.

### When elements are sets

When (some of) the elements in list notation are themselves sets (more about that here), care is required. For example, the numbers $1$ and $2$ are not elements of the set \[S:=\left\{ \left\{ 1,\,2,\,3 \right\},\,\,\left\{ 3,\,4 \right\},\,3,\,4 \right\}\]The elements listed include the set $\{1, 2, 3\}$ among others, but not the number $2$. The set $S$ contains four elements, two sets and two numbers.

Another way of saying this is that the element relation is not transitive: The facts that $A\in B$ and $B\in C$ do not imply that $A\in C$.

### Sets are arbitrary

- Any mathematical object can be the element of a set.
- The elements of a set do not have to have anything in common.
- The elements of a set do not have to form a pattern.

##### Examples

- $\{1,3,5,6,7,9,11,13,15,17,19\}$ is a set. There is no point in asking, “Why did you put that $6$ in there?” (Sets can be arbitrary.)
- Let $f$ be the function on the reals for which $f(x)=x^3-2$. Then \[\left\{\pi^3,\mathbb{Q},f,42,\{1,2,7\}\right\}\] is a set. Sets do not have to be homogeneous in any sense.

## Setbuilder notation

### Definition:

Suppose $P$ is an assertion. Then the expression “$\left\{x|P(x) \right\}$” denotes the set of all objects $x$ for which $P(x)$ is true. It contains no other elements.

- The notation “$\left\{ x|P(x) \right\}$” is called
**setbuilder notation.** - The assertion $P$ is called the
**defining condition**for the set. - The set $\left\{ x|P(x) \right\}$ is called the
**truth set**of the assertion $P$.

##### Examples

In these examples, $n$ is an integer variable and $x$ is a real variable..

- The expression “$\{n| 1\lt n\lt 6 \}$” denotes the set $\{2, 3, 4, 5\}$. The
**defining condition**is “$1\lt n\lt 6$”. The set $\{2, 3, 4, 5\}$ is the**truth set**of the assertion “n is an integer and $1\lt n\lt 6$”. - The notation $\left\{x|{{x}^{2}}-4=0 \right\}$ denotes the set $\{2,-2\}$.
- $\left\{ x|x+1=x \right\}$ denotes the empty set.
- $\left\{ x|x+0=x \right\}=\mathbb{R}$.
- $\left\{ x|x\gt6 \right\}$ is the infinite set of all real numbers bigger than $6$. For example, $6\notin \left\{ x|x\gt6 \right\}$ and $17\pi \in \left\{ x|x\gt6 \right\}$.
- The set $\mathbb{I}$ defined by $\mathbb{I}=\left\{ x|0\le x\le 1 \right\}$ has among its elements $0$, $1/4$, $\pi /4$, $1$, and an infinite number of

other numbers. $\mathbb{I}$ is fairly standard notation for this set – it is called the**unit interval.**

### Usage and terminology

- A colon may be used instead of “|”. So $\{x|x\gt6\}$ could be written $\{x:x\gt6\}$.
- Logicians and some mathematicians called the truth set of $P$ the
**extension**of $P$. This is not connected with the usual English meaning of “extension” as an add-on. - When the assertion $P$ is an equation, the truth set of $P$ is usually called the
**solution set**of $P$. So $\{2,-2\}$ is the solution set of $x^2=4$. - The expression “$\{n|1\lt n\lt6\}$” is commonly pronounced as “The set of integers such that $1\lt n$ and $n\lt6$.” This means
*exactly*the set $\{2,3,4,5\}$. Students whose native language is not English sometimes assume that a set such as $\{2,4,5\}$ fits the description.

### Setbuilder notation is tricky

#### Looking different doesn’t mean they are different.

A set can be expressed in many different ways in setbuilder notation. For example, $\left\{ x|x\gt6 \right\}=\left\{ x|x\ge 6\text{ and }x\ne 6 \right\}$. Those two expressions denote exactly the same set. (But $\left\{x|x^2\gt36 \right\}$ is a *different* set.)

#### Russell’s Paradox

In certain areas of math research, setbuilder notation can go seriously wrong. See Russell’s Paradox if you are curious.

### Variations on setbuilder notation

An expression may be used left of the vertical line in setbuilder notation, instead of a single variable.

#### Giving the type of the variable

You can use an expression on the left side of setbuilder notation to indicate the type of the variable.

##### Example

The unit interval $I$ could be defined as \[\mathbb{I}=\left\{x\in \mathrm{R}\,|\,0\le x\le 1 \right\}\]making it clear that it is a set of real numbers rather than, say rational numbers. You can always get rid of the type expression to the left of the vertical line by complicating the defining condition, like this:\[\mathbb{I}=\left\{ x|x\in \mathrm{R}\text{ and }0\le x\le 1 \right\}\]

#### Other expressions on the left side

Other kinds of expressions occur before the vertical line in setbuilder notation as well.

##### Example

The set\[\left\{ {{n}^{2}}\,|\,n\in \mathbb{Z} \right\}\]consists of all the squares of integers; in other words its elements are 0,1,4,9,16,…. This definition could be rewritten as $\left\{m|\text{ there is an }n\in \mathrm{}\text{ such that }m={{n}^{2}} \right\}$.

##### Example

Let $A=\left\{1,3,6 \right\}$. Then $\left\{ n-2\,|\,n\in A\right\}=\left\{ -1,1,4 \right\}$.

##### Warning

Be careful when you read such expressions.

##### Example

The integer $9$ * is* an element of the set \[\left\{{{n}^{2}}\,|\,n\in \text{ Z and }n\ne 3 \right\}\]It is true that $9={{3}^{2}}$ and that $3$ is excluded by the defining condition, but it is also true that $9={{(-3)}^{2}}$ and $-3$ is

*not*an integer ruled out by the defining condition.

## Reference

Sets. Previous post.

### Acknowledgments

Toby Bartels for corrections.

< ![endif]>

This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.