Axiom schema of specification
From Academic Kids

In axiomatic set theory and the branches of logic, mathematics, and computer science that use it, the axiom schema of specification, or axiom schema of separation, or axiom schema of restricted comprehension, is a schema of axioms in ZermeloFraenkel set theory. It is also called the axiom schema of comprehension, although that term is also used for unrestricted comprehension, discussed below.
Suppose P is any predicate in one variable that doesn't use the symbol B. Then in the formal language of the ZermeloFraenkel axioms, the axiom schema reads:
 <math>\forall A, \exist B, \forall C: C \in B \iff C \in A \and P(C)<math>
or in words:
 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.
Note that there is one axiom for every such predicate P; 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 P, we can find a subset B of A whose members are precisely the members of A that satisfy P. By the axiom of extensionality this set is unique. We usually denote this set using setbuilder notation as {C ∈ A : P(C)}. Thus the essence of the axiom is:
 Every subclass of a set that is defined by a predicate is itself a set.
The axiom schema of specification is generally considered uncontroversial as far as it goes, and it or an equivalent appears in just about any alternative axiomatisation of set theory. Indeed, many alternative formulations of set theory try to find a way to use an even more generous axiom schema, while stopping short of the axiom schema of (unrestricted) comprehension mentioned below.
Contents 
Relation to the axiom schema of replacement
The axiom schema of separation can almost be derived from the axiom schema of replacement.
First, recall this axiom schema:
 <math>\forall A, \exist B, \forall C: C \in B \iff \exist D: D \in A \and C = F(D)<math>
for any functional predicate F in one variable that doesn't use the symbols A, B, C or D. Given a suitable predicate P for the axiom of specification, define the mapping F by F(D) = D if P(D) is true and F(D) = E if P(D) is false, where E is any member of A such that P(E) is true. Then the set B guaranteed by the axiom of replacement is precisely the set B required for the axiom of specification. The only problem is if no such E exists. But in this case, the set B required for the axiom of separation is the empty set, so the axiom of separation follows from the axiom of replacement together with the axiom of empty set.
For this reason, the axiom schema of separation is often left out of modern lists of the ZermeloFraenkel 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.
Unrestricted comprehension
The axiom schema of unrestricted comprehension reads:
 <math>\exist B, \forall C, C \isin B \harr P \left(C\right)<math>
that is:
 There exists a set B whose members are precisely those objects that satisfy the predicate P.
This set B is again unique, and is usually denoted as {C : P(C)}.
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 ZermeloFraenkel 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 NBG class theory
In von NeumannBernaysGödel set theory, a distinction is made between sets and classes. A class C is a set iff it belongs to some class E. In this theory, there is a theorem schema that reads:
 <math>\exist D, \forall C, C \isin D \harr \left(P\left(C\right) \and \exist E, C \isin E \right)<math>
that is:
 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.
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:
 <math>\forall D, \forall A, \left(\exist E, A \isin E\right) \rarr \exist B, \left(\exist E, B \isin E \right) \and \forall C, C \isin B \harr \left(C \isin A \and C \isin D \right)<math>
that is:
 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;
or even more simply:
 The intersection of a class D and a set A is itself a set B.
In this axiom, the predicate P is replaced by the class D, which can be quantified over.
In second order logic
In secondorder logic, we can quantify over predicates, and 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 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; 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.de:Komprehensionsaxiom