# Axiom schema of specification

In many popular versions of axiomatic set theory, the axiom schema of specification, also known as the axiom schema of separation (Aussonderungsaxiom), subset axiom, axiom of class construction, or axiom schema of restricted comprehension is an axiom schema. Essentially, it says that any definable subclass of a set is a set.
Some mathematicians call it the axiom schema of comprehension, although others use that term for unrestricted comprehension, discussed below.
Because restricting comprehension avoided Russell's paradox, several mathematicians including Zermelo, Fraenkel, and Gödel considered it the most important axiom of set theory.

## Statement

One instance of the schema is included for each formula φ in the language of set theory with free variables among x, w$_1$, ..., w$_n$, A. So B does not occur free in φ. In the formal language of set theory, the axiom schema is:
    $\forall w_{1},\ldots ,w_{n}\,\forall A\,\exists B\,\forall x\,(x\in B\Leftrightarrow [x\in A\land \varphi (x,w_{1},\ldots ,w_{n},A)])$
or in words:
    Given any set A, there is a set B (a subset of A) such that, given any set x, x is a member of B if and only if x is a member of A and φ holds for x.
Note that there is one axiom for every such predicate φ; thus, this is an axiom schema.
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 $\varphi$, we can find a subset B of A whose members are precisely the members of A that satisfy $\varphi$. By the axiom of extensionality this set is unique. We usually denote this set using set-builder notation as $B=\{x\in A|\varphi (x)\}$. Thus the essence of the axiom is:
    Every subclass of a set that is defined by a predicate is itself a set.
The preceding form of separation was introduced in 1930 by Thoralf Skolem as a refinement of a previous, non-first-order form by Zermelo. The axiom schema of specification is characteristic of systems of axiomatic set theory related to the usual set theory ZFC, but does not usually appear in radically different systems of alternative set theory. For example, New Foundations and positive set theory use different restrictions of the axiom of comprehension of naive set theory. The Alternative Set Theory of Vopenka makes a specific point of allowing proper subclasses of sets, called semisets. Even in systems related to ZFC, this scheme is sometimes restricted to formulas with bounded quantifiers, as in Kripke–Platek set theory with urelements.

## Relation to the axiom schema of replacement

The axiom schema of specification is implied by the axiom schema of replacement together with the axiom of empty set.
The axiom schema of replacement says that, if a function $f$ is definable by a formula $\varphi (x,y,p_{1},\ldots ,p_{n})$, then for any set $A$, there exists a set $B=f(A)=\{f(x)\mid x\in A\}$:
    ${\begin{aligned}&\forall x\,\forall y\,\forall z\,\forall p_{1}\ldots \forall p_{n}[\varphi (x,y,p_{1},\ldots ,p_{n})\wedge \varphi (x,z,p_{1},\ldots ,p_{n})\implies y=z]\implies \\&\forall A\,\exists B\,\forall y(y\in B\iff \exists x(x\in A\wedge \varphi (x,y,p_{1},\ldots ,p_{n})))\end{aligned}}$.
To derive the axiom schema of specification, let $\varphi (x,p_{1},\ldots ,p_{n})$ be a formula and $z$ a set, and define the function $f$ such that $f(x)=x$ if $\varphi (x,p_{1},\ldots ,p_{n})$ is true and $f(x)=u$ if $\varphi (x,p_{1},\ldots ,p_{n})$ is false, where $u\in z$ such that $\varphi (u,p_{1},\ldots ,p_{n})$ is true. Then the set $y$ guaranteed by the axiom schema of replacement is precisely the set $y$ required in the axiom schema of specification. If $u$ does not exist, then $f(x)$ in the axiom schema of specification is the empty set, whose existence (i.e., the axiom of empty set) is then needed.
For this reason, the axiom schema of specification is left out of some axiomatizations of ZF (Zermelo–Fraenkel set theory), although some authors, despite the redundancy, include both. Regardless, the axiom schema of specification is notable because it was in Zermelo's original 1908 list of axioms, before Fraenkel invented the axiom of replacement in 1922. Additionally, if one takes ZFC set theory (i.e., ZF with the axiom of choice), removes the axiom of replacement and the axiom of collection, but keeps the axiom schema of specification, one gets the weaker system of axioms called ZC (i.e., Zermelo's axioms, plus the axiom of choice).

## Unrestricted comprehension

The axiom schema of unrestricted comprehension reads:
$\forall w_{1},\ldots ,w_{n}\,\exists B\,\forall x\,(x\in B\Leftrightarrow \varphi (x,w_{1},\ldots ,w_{n}))$
that is:
This set B is again unique, and is usually denoted as {x : φ(x, w$_1$, ..., w$_b$)}.
In an unsorted material set theory, the axiom or rule of full or unrestricted comprehension says that for any property P, there exists a set {x | P(x)} of all objects satisfying P.
This axiom schema was tacitly used in the early days of naive set theory, before a strict axiomatization was adopted. However, it was later discovered to lead directly to Russell's paradox, by taking φ(x) to be ¬(x ∈ x) (i.e., the property that set x is not a member of itself). Therefore, no useful axiomatization of set theory can use unrestricted comprehension. Passing from classical logic to intuitionistic logic does not help, as the proof of Russell's paradox is intuitionistically valid.
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, the axiom of regularity, or the axiom of choice) then became necessary to make up for some of what was lost by changing the axiom schema of comprehension to the axiom schema of specification – each of these axioms states that a certain set exists, and defines that set by giving a predicate for its members to satisfy, i.e. it is a special case of the axiom schema of comprehension.
It is also possible to prevent the schema from being inconsistent by restricting which formulae it can be applied to, such as only stratified formulae in New Foundations (see below) or only positive formulae (formulae with only conjunction, disjunction, quantification and atomic formulae) in positive set theory. Positive formulae, however, typically are unable to express certain things that most theories can; for instance, there is no complement or relative complement in positive set theory.

## In NBG class theory

In von Neumann–Bernays–Gödel set theory, a distinction is made between sets and classes. A class C is a set if and only if it belongs to some class E. In this theory, there is a theorem schema that reads $\exists D\forall C\,([C\in D]\iff [P(C)\land \exists E\,(C\in E)])\,,$
that is,
provided that the quantifiers in the predicate P are restricted to sets.
This theorem schema is itself a restricted form of comprehension, which avoids Russell's paradox because of the requirement that C be a set. Then specification for sets themselves can be written as a single axiom $\forall D\forall A\,(\exists E\,[A\in E]\implies \exists B\,[\exists E\,(B\in E)\land \forall C\,(C\in B\iff [C\in A\land C\in D])])\,,$
that is,
or even more simply
In this axiom, the predicate P is replaced by the class D, which can be quantified over. Another simpler axiom which achieves the same effect is $\forall A\forall B\,([\exists E\,(A\in E)\land \forall C\,(C\in B\implies C\in A)]\implies \exists E\,[B\in E])\,,$
that is,

## In higher-order settings

In a typed language where we can quantify over predicates, the axiom schema of specification becomes a simple axiom. This is much the same trick as was used in the NBG axioms of the previous section, where the predicate was replaced by a class that was then quantified over.
In second-order logic and higher-order logic with higher-order semantics, the axiom of specification is a logical validity and does not need to be explicitly included in a theory.

## In Quine's New Foundations

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 (and so at different "relative types"); 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. For details, see stratification.