# Set builder notation, left or right of :| convention

Set builder notation which specify a subset such as $Z$ or $R$ tend to put this condition on the left, whereas other conditions go on the right.

$$\{ x ∈ Z : x > 0 \}$$

Why is this preferred over, say:

$$\{ x : x > 0 \textrm{ and } x ∈ Z\}$$

I notice that if the left-side has more than a simple term it tends not to have the contains expression. For example:

$$\{ x + 1 : x > 0 \}$$

In such a form could a $Z$ appear on the left, or must it appear on the right if it needs to be specified?

In what situations can the conditions go on the left, as opposed to the right of the $:$ operator?

• I asked a related question one month ago here. It had a more pedantic background. I also like the smiley in your question title. – Nikolaj-K May 26 '12 at 9:34

Of course it is all a stylistic choice. However, the $\{x\in Set: x$ does something$\}$ convention has roots in set theory. It was found that the specific problem with the old attempt at set theory ("naive set theory") is called unrestricted comprehension. In less fancy terms, unrestricted comprehension assumes that any objects which satisfy some property form a set. Because of things like Russel's Paradox, this doesn't work.

So in the generally accepted axiomization of set theory, called "ZFC," we have what is called restricted comprehension. This is the same thing as unrestricted comprehension, with the caveat that you have to guarantee that all the objects you're trying to put in a set already belong in another set.

Thus, we cannot, strictly speaking, talk about the set $\{x: x<3\}$, because we have not guaranteed that the $x$'s came from somewhere. But we can write $\{x: x\in\mathbb{Z}\text{ and }x<3\}$ and be sure that this is a set. However, think about how this reads. "The set of all objects $x$ such that $x$ is an integer and $x<3$." It's clunky, and moreover you might be tempted to throw it out immediately, because I say "the set of all object such that (property)" which is not generally allowed.

By writing instead $\{x\in\mathbb{Z} : x<3\}$, it now reads "the set of all $x$ in $\mathbb{Z}$ such that $x<3$." In this way, you have given the sentence the more correct schema of "the set of all $x$ in (set) such that (property)," and the fact that you are not using unrestricted comprehension is much more obvious. Furthermore, you're telling your reader up front that this set is a subset of $\mathbb{Z}$, which might be appreciated for more practical reasons.

Edit: Sorry, I didn't directly answer your question. For that reason, we generally put the set you're guaranteeing the $x$'s come from on the left, and the property that we demand the $x$'s satisfy on the right.

For your last example, I would write $\{x+1\in\mathbb{Z} : x>0\}$. Well, I would actually write $\{x\in\mathbb{Z} : x\geq 2\}$, but that's more for style than a good answer to your question. In general, for a function from $A$ to $B$, I would write $\{ f(x)\in B : x>0\}$, as opposed to something clunky like $\{ f(x) ~~ (x\in A) : x>0\}$

(I still would prefer the clunky one to $\{x+1 : x>0\text{ and } x\in\mathbb{Z}\}$. Again, it goes back to reading it: "One plus all objects $x$ such that $x>0$ and $x$ is an integer"? Not pretty.)

• Okay, but in my last expression you couldn't do it this way, you'd have to put the subset on the right, correct? $\{ x + 1 : x > 0 \}$ => $\{ x + 1 : x > 0 \textrm{ and } x ∈ Z \}$ – edA-qa mort-ora-y May 26 '12 at 8:35
• Sorry, just added that part. – Eric Stucky May 26 '12 at 8:40
• A problem with $\{f(x) \in B\}$ is that the domain of $f$ might not be obvious from context. (For example, how would you interpret $\{x^y \in \mathbb R\}$?) Of course, in the cases where that happens, one can still always fall back to explicitly specifying the domain on the right. – Ilmari Karonen May 26 '12 at 13:13
• That's a fair point, thanks for mentioning it. – Eric Stucky May 26 '12 at 19:44
• @EricStucky: Please forgive this rudimentary question. Shouldn't $\{x + 1 \in \mathbb{Z} : x > 0\} = \{x \in \mathbb{Z} : x \geq 2\}$? – NNOX Apps Aug 24 '13 at 3:40

I wouldn't focus too much on "what side of the $:$" stuff goes on. It isn't very significant. As long as whoever is using set notation is paying attention to what they doing, and taking care to actually unambiguously define a set, it doesn't matter what side of the $:$ has more stuff on it.

Stuff often goes to the right of the $:$ when one is forming a subset of a set $S$ that is determined by imposing explicit conditions on the elements of the "larger" set. Examples:

• $\{(x,y,z) \in \mathbb{Z}^3 : x^2 + y^2 = z^2\}$ (defines a subset of $\mathbb{Z}^3$ imposed by an algebraic condition).

• $\{x \in \mathbb{R}: x^5 + 3x + 1 = 0\}$ (defines a subset of $\mathbb{R}$).

When a subset of a known set $S$ is described in this way, it is often very easy to test whether or not a given element of $S$ is in the subset (because you have a list of conditions to check). To test whether or not a given element $(a,b,c)$ of $\mathbb{Z}^3$ is in the first set, I can just compute $a^2 + b^2$ and see if it's $c^2$. To test whether or not a real number $t$ is in the second set, I can just compute $t^5 + 3t + 1$ and see if I get $0$.

On the down side, when a subset of a known set $S$ is described in this way, it can be difficult to exhibit specific elements of the subset without work. For example, to find an element of the second set above, you actually have to find a solution to the equation $x^5 + 3x + 1 = 0$.

More stuff often goes to the left of the $:$ when one is forming a subset of a set $S$ that is generated by an explicit construction process. For example:

• $\{(\cos(x),\sin(x)): x \in \mathbb{R}\}$. (A subset of the set $S = \mathbb{R}^2$.)

• $\{a^2 + b^2: a, b \in \mathbb{Z}\}$. (A subset of the set $S = \mathbb{Z}$.)

When a set is described in this way, we are often in the reverse of the previous situation. It can involve a bit of work to test whether or not a given element of the "known" set is in the subset. (Example: is $1234$ in the second set? You probably can't answer immediately, since it's the question of whether or not you can find integers $a$ and $b$ with $a^2 + b^2 = 1234$, and this is a bit of a math problem.) But it is easy to exhibit specific elements of the subset without work. (For example, $1^2 + 5^2$ and $2^2 + 4^2$ and $6^2 + 8^2$ are clearly elements of the second set.)

Many problems in mathematics can be thought of as finding a description for a set that has been given in one of the two above forms, in terms of the other form. This is because many problems in mathematics boil down to one of the following two things:

• One has a list of conditions, and one wants a way of generating things that satisfying all of the conditions, or
• One has a well-defined rule that generates things, and one wants a list of conditions that characterize the output of the rule.

I hope this helped.

Every set should be defined in the form $\{x \in A : P(x)\}$, where the set $A$ has been defined previously (for example, $\mathbb R$) and where $P(\cdot)$ is a condition (perhaps a logical composition of many subconditions) that is meaningful when applied to elements of $A$. This was not understood in the 19th Century, before set theory became well founded, when set definitions of the form $\{x : P(x)\}$ were considered meaningful, giving rise to Russell's famous paradoxical set $\{x : x\not\in x\}$. Of course, you often see the form $\{x : P(x)\}$, where the domain of $x$ is implicitly understood, or is stated as part of the $P(\cdot)$ condition. But (IMHO) it is better always to state the domain as in the first-stated form.

• Actually, you're forgetting about replacement: $\{ f(x) : x \in A \}$. Zermelo set theory isn't always enough to construct this set. – user14972 May 26 '12 at 13:33
• @Hurkyl: Yes, thank you: I shouldn't have said "every" set. The axiom of replacement says that, given a set $A$ and a (suitably defined) $f$, there is a unique set $B$ such that $y \in B$ iff there exists $x \in A$ such that $y=f(x)$. Without this axiom, we cannot define $B$ by the notation "$\{ f(x) : x \in A \}$". Of course this instance of notation is unproblematic, given the axiom and the restrictive nature of the condition, and we can use it by convention---or write simply "$f(A)$" (provided that $A$ is not in the domain of $f$). Similar remarks apply to the powerset axiom. – John Bentin May 26 '12 at 15:31

When you use set builder notation, use $$\{x\in \hbox{Universe of discourse or subset threof }| {\rm TestForMembership}(x)\}.$$ The stuff to the left of the $|$ bounds the discussion and establishes context.