Suppose *P* is any predicate in one variable that doesn't use the symbol *B*.
Then in the formal language of the Zermelo-Fraenkel axioms, the axiom schema reads:

- Given any set
*A*, there is a set*B*such that, given any set*C*,*C*is a member of*B*if and only if*C*is a member of*A*and*P*holds for*C*.

To understand this axiom schema, note that the set *B* must be a subset of *A*.
Thus, what the axiom schema is really saying is that, given a set *A* and a predicate *P*, we can find a subset *B* of *A* whose members are precisely the members of *A* that satisfy *P*.
We can use the axiom of extensionality to show that this set *B* is unique.
We denote the set *B* using set-builder notation as {*A* : *P*}, or {*C* ∈ *A* : *P*(*C*)} to be more clear.
Thus the essence of the axiom is:

- Every subclass of a set that is defined by a predicate is itself a set.

Table of contents |

2 Unrestricted comprehension 3 In NBG class theory 4 In second order logic 5 In Quine's New Foundations |

The axiom schema of specification can almost be derived from the axiom schema of replacement.

First, recall this axiom schema:

The only problem is if no such *E* exists.
But in this case, the set *B* required for the axiom of specification is the empty set, so the axiom schema follows in general using also the axiom of empty set.

For this reason, the axiom schema of specification is often left out of modern lists of the Zermelo-Fraenkel axioms. However, it's still important for historical considerations, and for comparison with alternative axiomatisations of set theory, as can be seen for example in the following sections.

The *axiom schema of unrestricted comprehension* reads:

- There exists a set
*B*whose members are precisely those objects that satisfy the predicate*P*.

This axiom schema was tacitly used in the early days of naive set theory, before a strict axiomatisation was adopted.
Unfortunately, it leads directly to Russell's paradox by taking *P*(*C*) to be (\*C* is not in *C*).
Therefore, no useful axiomatisation of set theory can use unrestricted comprehension, at least not with classical logic.
Accepting only the axiom schema of specification was the beginning of axiomatic set theory.
Most of the other Zermelo-Fraenkel axioms (but not the axiom of extensionality or the axiom of regularity) then became necessary to serve as an additional replacement for the axiom schema of comprehension; each of these axioms states that a certain set exists, and defines that set by giving a predicate for its members to satisfy.

In the von Neumann-Bernays-Gödel axioms of set theory, a distinction is made between sets and classeses.
A class *C* is a set iff it belongs to some class *E*.
In this theory, there is a theorem schema that reads:

- There is a class
*D*such that any class*C*is a member of*D*if and only if*C*is a set that satisfies*P*.

- Given any class
*D*and any set*A*, there is a set*B*whose members are precisely those classes that are members of both*A*and*D*;

- The intersection of a class
*D*and a set*A*is itself a set*B*.

In the New Foundations approach to set theory pioneered by W.V.O. Quine, the axiom of comprehension for a given predicate takes the unrestricted form, but the predicates that may be used in the schema are themselves restricted.
The predicate (*C* is not in *C*) is forbidden, because the same symbol *C* appears on both sides of the membership symbol; thus, Russell's paradox is avoided.
However, by taking *P*(*C*) to be (*C* = *C*), which is allowed, we can form a set of all sets.