# Set-Builder Notation

Recall that, by definition, being a set is equivalent to " being an open sentence. This means that the theory of sets and the theory of logic are basically the same--differing only by notation and perspective. One can exploit this correspondence by using open sentences to define sets. Given an open sentence , we can define the corresponding set , which consists of all values so that is true. We write and read aloud is the set of all such that ." In other words, is the set so that means exactly . This way of defining sets has the unfortunately puerile name set-builder notation. It's how most sets in most mathematics texts are defined. By way of example, we'll rephrase some previous definitions.

Definition.

• • Activity Complete the list of set operations by giving set-builder descriptions of each of the following set operations.

• • • • Exercise. Consider two sets, and . What can we say about the open sentences and if we know each of the following facts about the sets and ?

• • • • is the universe

The last exercise referenced the universe, which naturally leads to the question of how to specify the universe in set-builder notation. An even number is an integer which is twice some other integer. So we could write

Definition.

*** QuickLaTeX cannot compile formula:
\begin{equation*}\left\{n\middle\vert n\in\mathbb{Z}\wedge\exists k:\left(k\in \mathbb{Z}\wedge n=2k\right) \right\}
But the right-hand side (after the pipe symbol $\vert$) is a little crowded. Doing the same trick as we did in, we want to handle the conditions $n\in\mathbb{Z}$ and $k\in\mathbb{Z}$ by changing the universe. We do this as follows:
<strong>Definition. </strong>The set of even numbers is the set \begin{equation*}\left\{n\in\mathbb{Z}\middle\vert \exists k\in\mathbb{Z}:n=2k\right\}\end{equation*}

*** Error message:
Display math should end with .
leading text: ...ht-hand side (after the pipe symbol \$\vert



We would read this aloud The set of all integers such that there is an integer with ." In this version of set-builder notation, the left-hand side (before the pipe) is about what kind of objects the elements of the set being defined are; the right-hand side gives a condition that describes the set.

There is yet another way to use set-builder notation to define a set, as exemplified:

Definition. We would read this aloud The set of a numbers of the form , where is an integer." Notice that has disappeared entirely from this version. In this version of set-builder notation, the left-hand side gives the general form of the elements of the set, and the right-hand side tells us which elements of that form actually occur in the set.

### Learning to let go of your s

An open sentence like has two variables and one quantifier. The two variables are used in quite different ways. First, notice that the only variable that's eligible for plugging in to is : we can sensibly ask Is it true that ? and Is it true that ?. But substituting for like this: yields nonsense.

What's going on here? Variables where we can plug in values and get something sensible (like here) are called free. The other kind of variable (like here) is called a bound variable, from the verb bind. The idea is that the quantifier has a binding effect on the variable. You can recognize bound variables in three ways:

• Substituting for a bound variable results in nonsense; substituting for a free variable does not.
• Bound variables almost always occur exactly twice; free variables occur once.
• There is always a way to read a mathematical formula containing a bound variable in a way that makes the bound variable go away.

I'll illustrate these checks by giving some examples of bound variables, one of which you've seen before:

Consider the integral The variables and are free; the variable is bound.

• We could substitute in for and : . If we substitute for , we get , which is nonsense.
• The variable occurs twice: once in the integrand and once in the differential.
• We could read this integral aloud as The integral, from to , of the squaring function."

Consider the (true) statement Here, the variable is bound and there are no free variables.

• If we tried to substitute, we'd get something like , which doesn't make sense.
• The variable occurs twice: once in the open sentence , and once in the quantifier.
• We could read this aloud as If a number's square is less than 9, its cube is less than 27."

One very important trick to do with a bound variable is to replace it, across the board, with another variable. I call this letting go of your s. So for example, in an integral we can change the integrating variable at whim: We can do the same with quantified statements and open sentences: What does all this have to do with sets and set-builder notation? Observe that the variables that appear in set-builder notation are almost all bound, which we can tell because they occur twice (once on each side of the pipe). For example: is the same set as which in turn is the same set as The point is that the particular choice of variable or or or or has no significance at all. By way of example, if , then  In particular, our definition of does not create any particular link between the letter and the set . We could just as well have defined .

Published in sets.