In set theory and its applications to logic, mathematics, and computer science, set-builder notation is a notation for describing a set by indicating the properties that its members must satisfy.
The simplest sort of set-builder notation is {x : P(x)}, where P is a predicate in one variable. This indicates the set of everything satisfying the predicate P, that is the set of every object x such that P(x) is true. For example:
- {x : x is a real number and x > 0} is the set of all positive real numbers;
- {k : for some natural number n, k = 2n} is the set of all even natural numbers;
- {a : for some integers p and q, q is not zero and a = p/q} is the set of rational numbers; and
- {S : S is a set and S does not belong to S} is the set of all sets that don't belong to themselves.
For this reason, set-builder notation can be modified to certain special forms. One of these is {x in A : P(x)}, where A is a previously defined set. This indicates the set of every element of A that satisfies the predicate P. For example:
- {x in R : x > 0}, where R is the set of real numbers, is the set of all positive real numbers.
Another variation on set-builder notation describes the members of the set in terms of members of some other set. Specifically, {F(x) : x in A}, where F is a function symbol and A is a previously defined set, indicates the set of all values of members of A under F. For example:
- {2n : n in N}, where N is the set of all natural numbers, is the set of all even natural numbers.
These notations can be combined in the form {F(x) : x in A, P(x)}, which indicates the set of all values under F of those members of A that satisfy P. For example:
- {p/q : p in Z, q in Z, q is not zero}, where Z is the set of all integers, is the set of all rational numbers.
The notation can be complicated, especially as in the previous example, and abbreviations are often employed when context indicates the nature of a variable. For example:
- {x : x > 0}, in a context where the variable x is used only for real numbers, indicates the set of all positive real numbers;
- {p/q : q is not zero}, in a context where the variables p and q are used only for integers, indicates the set of all rational numbers; and
- {S : S does not belong to S}, in a context where the variable S is used only for sets, indicates the set of all sets that don't belong to themselves.