Set-builder notation is a mathematical notation for defining a set through a condition that identifies its elements. A typical expression is
read as “the set of all in such that .” Here supplies the domain from which elements are selected, and states the condition they must satisfy. The notation is used throughout mathematics to describe finite and infinite sets, express relationships, and construct mathematical objects. In axiomatic set theory, its use is subject to rules governing which collections exist as sets.
Basic syntax and meaning
The expression
defines the subset of consisting exactly of the elements for which holds. Its meaning can be expressed by the membership equivalence
The main components are:
- Braces , indicating a set.
- A variable, such as , representing a possible element.
- A domain, such as , specifying the available elements.
- A condition, such as , determining which elements are included.
A colon often replaces the vertical bar:
Both separators mean “such that.” Conditions may be written in mathematical symbols, ordinary language, or a combination of the two.
For example,
where denotes the integers. The expression on the left uses set-builder notation; the expression on the right uses roster notation, which explicitly lists the elements.
An infinite set can be specified just as directly:
Unlike a list ending in an ellipsis, this description states an exact membership rule without requiring the reader to infer a pattern.
The role of the domain
The domain is part of the definition, not merely a stylistic addition. The same condition can select different sets from different domains. For example,
whereas
Here denotes the real numbers, the rational numbers, and the empty set.
When the domain is already clear, it may be omitted:
Such an expression relies on context. It could describe positive real numbers, positive integers, or another collection in which an ordering is understood. Explicitly stating the domain avoids this ambiguity.
Definitions can also depend on parameters. For a real parameter ,
defines a family of sets, one for each value of .
Selection and image forms
Two closely related forms of set-builder notation are common.
Selecting elements
The selection form
retains those elements of satisfying a condition. For example,
is the set of even integers.
Conditions may involve several requirements:
This set consists of the real numbers from , inclusive, to , exclusive.
Collecting values of an expression
The image form
collects the values of a function as its input ranges over . It is the image , also commonly written .
For example,
Its membership rule is
Selection and transformation can be combined:
This first restricts the inputs to those satisfying , then collects their function values.
The distinction between the two forms matters:
but
The first set contains selected inputs; the second contains their squares.
Variables, scope, and logical conditions
Set-builder notation binds the variables over which it ranges. Renaming a bound variable does not change the resulting set:
provided the renaming does not change the meaning of other variables.
By contrast, in
is bound by the construction, while is a free parameter.
Conditions may use the quantifiers and connectives of first-order logic. For example,
uses existential quantification to define the even integers. Conjunction, disjunction, and negation allow more elaborate membership conditions.
Several variables may be used to construct tuples. For sets and ,
is their Cartesian product. Its elements are ordered pairs, not the individual entries of those pairs.
A binary relation can be specified by restricting such pairs:
Order and repeated values
Set-builder notation describes a set, not a sequence or a multiset. Consequently:
- The order in which possible elements are considered is irrelevant.
- Repeated occurrences of the same value do not create additional elements.
For example,
Although both and produce , the resulting set contains only once. Thus the number of inputs need not equal the cardinality of the resulting image set.
Likewise, different conditions can define the same set. What matters is whether they yield exactly the same members, not whether their written descriptions are identical.
Common applications
Set-builder notation provides concise definitions across mathematical subjects.
Solution sets. An equation can be associated with the set of all values satisfying it:
Function graphs. The graph of a function is
Power sets. The power set of is
This expression denotes a set whose elements are themselves sets.
Optimization. A feasible set can be described by constraints:
Probability. An event may be expressed as a subset of a sample space:
In a formal probability model, this subset must also belong to the model’s designated collection of measurable events.
Foundational restrictions
A meaningful condition does not automatically determine a set. Unrestricted comprehension—the principle that every condition defines a set of all objects satisfying it—leads to contradictions.
The standard example is Russell’s paradox. If
were a set, its defining condition would imply
a contradiction.
In Zermelo–Fraenkel set theory, the axiom schema of separation instead permits selection from an already existing set:
More precisely, each allowed formula , with suitable parameters, determines a subset of . Separation does not provide a universal set from which every conceivable collection can be selected.
Image constructions such as
are supported by the axiom schema of replacement when the defining rule assigns exactly one output to each input. Other constructions rely on additional axioms; for example, the existence of is supplied by the power set axiom.
Set-builder notation therefore describes membership conditions, but the surrounding mathematical theory determines whether the collection described exists as a set.