# Axiom schema of replacement

In set theory, the axiom schema of replacement is a schema of axioms in Zermelo–Fraenkel set theory (ZF) that asserts that the image of any set under any definable mapping is also a set. It is necessary for the construction of certain infinite sets in ZF.
The axiom schema is motivated by the idea that whether a class is a set depends only on the cardinality of the class, not on the rank of its elements. Thus, if one class is "small enough" to be a set, and there is a surjection from that class to a second class, the axiom states that the second class is also a set. However, because ZFC only speaks of sets, not proper classes, the schema is stated only for definable surjections, which are identified with their defining formulas.

## Statement

Suppose $P$ is a definable binary relation (which may be a proper class) such that for every set $x$ there is a unique set $y$ such that $P(x,y)$ holds. There is a corresponding definable function $F_{P}$, where $F_{P}(x)=y$ if and only if $P(x,y)$. Consider the (possibly proper) class $B$ defined such that for every set $y$, $y\in B$ if and only if there is an $x\in A$ with $F_{P}(x)=y$. $B$ is called the image of $A$ under $F_{P}$, and denoted $F_{P}[A]$ or (using set-builder notation) $\{F_{P}(x):x\in A\}$.
The axiom schema of replacement states that if $F$ is a definable class function, as above, and $A$ is any set, then the image $F[A]$ is also a set. This can be seen as a principle of smallness: the axiom states that if $A$ is small enough to be a set, then $F[A]$ is also small enough to be a set. It is implied by the stronger axiom of limitation of size.
Because it is impossible to quantify over definable functions in first-order logic, one instance of the schema is included for each formula $\phi$ in the language of set theory with free variables among $w_{1},\dotsc ,w_{n},A,x,y$; but $B$ is not free in $\phi$. In the formal language of set theory, the axiom schema is:
    ${\begin{aligned}\forall w_{1},\ldots ,w_{n}\,\forall A\,([\forall x\in A&\,\exists !y\,\phi (x,y,w_{1},\ldots ,w_{n},A)]\ \Longrightarrow \ \exists B\,\forall y\,[y\in B\Leftrightarrow \exists x\in A\,\phi (x,y,w_{1},\ldots ,w_{n},A)])\end{aligned}}$
For the meaning of $\exists !$, see uniqueness quantification.
For clarity, in the case of no variables $w_{i}$, this simplifies to:
    ${\begin{aligned}\forall A\,([\forall x\in A&\,\exists !y\,\phi (x,y,A)]\ \Longrightarrow \ \exists B\,\forall y\,[y\in B\Leftrightarrow \exists x\in A\,\phi (x,y,A)])\end{aligned}}$
So whenever $\phi$ specifies a unique $x$-to-$y$ correspondence, akin to a function $F$ on $A$, then all $y$ reached this way can be collected into a set $B$, akin to $F[A]$.

## Applications

The axiom schema of replacement is not necessary for the proofs of most theorems of ordinary mathematics. Indeed, Zermelo set theory (Z) already can interpret second-order arithmetic and much of type theory in finite types, which in turn are sufficient to formalize the bulk of mathematics. Although the axiom schema of replacement is a standard axiom in set theory today, it is often omitted from systems of type theory and foundation systems in topos theory.
At any rate, the axiom schema drastically increases the strength of ZF, both in terms of the theorems it can prove - for example the sets shown to exist - and also in terms of its proof-theoretic consistency strength, compared to Z. Some important examples follow:
* Using the modern definition due to von Neumann, proving the existence of any limit ordinal greater than ω requires the replacement axiom. The ordinal number ω·2 = ω + ω is the first such ordinal. The axiom of infinity asserts the existence of an infinite set ω = {0, 1, 2, ...}. One may hope to define ω·2 as the union of the sequence {ω, ω + 1, ω + 2,...}. However, arbitrary such classes of ordinals need not be sets - for example, the class of all ordinals is not a set. Replacement now allows one to replace each finite number n in ω with the corresponding ω + n, and thus guarantees that this class is a set. As a clarification, note that one can easily construct a well-ordered set that is isomorphic to ω·2 without resorting to replacement – simply take the disjoint union of two copies of ω, with the second copy greater than the first – but that this is not an ordinal since it is not totally ordered by inclusion.
* Larger ordinals rely on replacement less directly. For example, ω$_1$, the first uncountable ordinal, can be constructed as follows – the set of countable well orders exists as a subset of $P({\mathbb {N} }\times {\mathbb {N} })$ by separation and powerset (a relation on A is a subset of $A\times A$, and so an element of the power set $P(A\times A)$. A set of relations is thus a subset of $P(A\times A)$). Replace each well-ordered set with its ordinal. This is the set of countable ordinals ω$_1$, which can itself be shown to be uncountable. The construction uses replacement twice; once to ensure an ordinal assignment for each well ordered set and again to replace well ordered sets by their ordinals. This is a special case of the result of Hartogs number, and the general case can be proved similarly.
* In light of the above, the existence of an assignment of an ordinal to every well-ordered set requires replacement as well. Similarly the von Neumann cardinal assignment which assigns a cardinal number to each set requires replacement, as well as axiom of choice.
* For sets of tuples recursively defined as $A^{n}=A^{n-1}\times A$ and for large $A$, the set $\{A^{n}\mid n\in {\mathbb {N} }\}$ has too high of a rank for its existence to be provable from set theory with just the axiom of power set, choice and without replacement.
* Similarly, Harvey Friedman showed that at least some instances of replacement are required to show that Borel games are determined. The proven result is Donald A. Martin's Borel determinacy theorem. A later, more careful analysis by Martin of the result showed that it only requires replacement for functions with domain an arbitrary countable ordinal.
* ZF with replacement proves the consistency of Z, as the set V$_{ω·2}$ is a model of Z whose existence can be proved in ZF. The cardinal number $\aleph _{\omega }$ is the first one which can be shown to exist in ZF but not in Z. For clarification, note that Gödel's second incompleteness theorem shows that each of these theories contains a sentence, "expressing" the theory's own consistency, that is unprovable in that theory, if that theory is consistent - this result is often loosely expressed as the claim that neither of these theories can prove its own consistency, if it is consistent.

## Relation to other axiom schemas
### Simplifications

Some simplifications may be made to the axiom schema of replacement to obtain different equivalent versions. Azriel Lévy showed that a version of replacement with parameters removed, i.e. the following schema, is equivalent to the original form. In particular the equivalence holds in the presence of the axioms of extensionality, pairing, union and powerset.
    $\forall A\,([\forall x\,\exists !y\,\phi (x,y,A)]\ \Longrightarrow \ \exists B\,\forall y\,[y\in B\Leftrightarrow \exists x\in A\,\phi (x,y,A)])$

### Collection

The axiom schema of collection is closely related to and frequently confused with the axiom schema of replacement. Over the remainder of the ZF axioms, it is equivalent to the axiom schema of replacement. The axiom of collection is stronger than replacement in the absence of the power set axiom or its constructive counterpart of ZF and is used in the framework of IZF, which lacks the law of excluded middle, instead of Replacement which is weaker.
While replacement can be read to say that the image of a function is a set, collection speaks about images of relations and then merely says that some superclass of the relation's image is a set. In other words, the resulting set $B$ has no minimality requirement, i.e. this variant also lacks the uniqueness requirement on $\phi$. That is, the relation defined by $\phi$ is not required to be a function—some $x\in A$ may correspond to many $y$'s in $B$. In this case, the image set $B$ whose existence is asserted must contain at least one such $y$ for each $x$ in the original set, with no guarantee that it will contain only one.
Suppose that the free variables of $\phi$ are among $w_{1},\dotsc ,w_{n},x,y$; but neither $A$ nor $B$ is free in $\phi$. Then the axiom schema is:
    $\forall w_{1},\ldots ,w_{n}\,[(\forall x\,\exists \,y\phi (x,y,w_{1},\ldots ,w_{n}))\Rightarrow \forall A\,\exists B\,\forall x\in A\,\exists y\in B\,\phi (x,y,w_{1},\ldots ,w_{n})]$
The axiom schema is sometimes stated without prior restrictions (apart from $B$ not occurring free in $\phi$) on the predicate, $\phi$:
    $\forall w_{1},\ldots ,w_{n}\,\forall A\,\exists B\,\forall x\in A\,[\exists y\phi (x,y,w_{1},\ldots ,w_{n})\Rightarrow \exists y\in B\,\phi (x,y,w_{1},\ldots ,w_{n})]$
In this case, there may be elements $x$ in $A$ that are not associated to any other sets by $\phi$. However, the axiom schema as stated requires that, if an element $x$ of $A$ is associated with at least one set $y$, then the image set $B$ will contain at least one such $y$. The resulting axiom schema is also called the axiom schema of boundedness.

### Separation

The axiom schema of separation, the other axiom schema in ZFC, is implied by the axiom schema of replacement and the axiom of empty set. Recall that the axiom schema of separation includes
    $\forall A\,\exists B\,\forall C\,(C\in B\Leftrightarrow [C\in A\land \theta (C)])$
for each formula $\theta$ in the language of set theory in which $B$ is not free, i.e. $\theta$ that does not mention $B$.
The proof is as follows: Either $A$ contains some element $a$ validating $\theta (a)$, or it does not. In the latter case, taking the empty set for $B$ fulfills the relevant instance of the axiom schema of separation and one is done. Otherwise, choose such a fixed $a$ in $A$ that validates $\theta (a)$. Now define $\phi (x,y):=(\theta (x)\land y=x)\lor (\neg \theta (x)\land y=a)$ for use with replacement. Using function notation for this predicate $\phi$, it acts as the identity $F_{a}(x)=x$ wherever $\theta (x)$ is true and as the constant function $F_{a}(x)=a$ wherever $\theta (x)$ is false. By case analysis, the possible values $y$ are unique for any $x$, meaning $F_{a}$ indeed constitutes a class function. In turn, the image $B:=\{F_{a}(x):x\in A\}$ of $A$ under $F_{a}$, i.e. the class $A\cap \{x:\theta (x)\}$, is granted to be a set by the axiom of replacement. This $B$ precisely validates the axiom of separation.
This result shows that it is possible to axiomatize ZFC with a single infinite axiom schema. Because at least one such infinite schema is required (ZFC is not finitely axiomatizable), this shows that the axiom schema of replacement can stand as the only infinite axiom schema in ZFC if desired. Because the axiom schema of separation is not independent, it is sometimes omitted from contemporary statements of the Zermelo-Fraenkel axioms.
Separation is still important, however, for use in fragments of ZFC, because of historical considerations, and for comparison with alternative axiomatizations of set theory. A formulation of set theory that does not include the axiom of replacement will likely include some form of the axiom of separation, to ensure that its models contain a sufficiently rich collection of sets. In the study of models of set theory, it is sometimes useful to consider models of ZFC without replacement, such as the models $V_{\delta }$ in von Neumann's hierarchy.
The proof given above assumes the law of excluded middle for the proposition that $A$ is inhabited by a set validating $\theta$, and for any $\theta (x)$ when stipulating that the relation $\phi$ is functional. The axiom of separation is explicitly included in constructive set theory, or a bounded variant thereof.

### Reflection

Lévy's reflection principle for ZFC is equivalent to the axiom of replacement, assuming the axiom of infinity. Lévy's principle is as follows:
    For any $x_{1},\ldots ,x_{n}$ and any first-order formula $\phi (x_{1},\ldots ,x_{n})$, there exists an $\alpha$ such that $\phi (x_{1},\ldots ,x_{n})\iff \phi ^{V_{\alpha }}(x_{1},\ldots ,x_{n})$.
This is a schema that consists of countably many statements, one for each formula $\phi$. Here, $\phi ^{M}$ means $\phi$ with all quantifiers bounded to $M$, i.e. $\phi$ but with every instance of $\exists x$ and $\forall x$ replaced with $\exists (x\in V_{\alpha })$ and $\forall (x\in V_{\alpha })$ respectively.

## History

The axiom schema of replacement was not part of Ernst Zermelo's 1908 axiomatisation of set theory (Z). Some informal approximation to it existed in Cantor's unpublished works, and it appeared again informally in Mirimanoff (1917).
Its publication by Abraham Fraenkel in 1922 is what makes modern set theory Zermelo-Fraenkel set theory (ZFC). The axiom was independently discovered and announced by Thoralf Skolem later in the same year (and published in 1923). Zermelo himself incorporated Fraenkel's axiom in his revised system he published in 1930, which also included as a new axiom von Neumann's axiom of foundation. Although it is Skolem's first order version of the axiom list that we use today, he usually gets no credit since each individual axiom was developed earlier by either Zermelo or Fraenkel. The phrase “Zermelo-Fraenkel set theory” was first used in print by von Neumann in 1928.
Zermelo and Fraenkel had corresponded heavily in 1921; the axiom of replacement was a major topic of this exchange. Fraenkel initiated correspondence with Zermelo sometime in March 1921. However, his letters before the one dated 6 May 1921 are lost. Zermelo first admitted to a gap in his system in a reply to Fraenkel dated 9 May 1921. On 10 July 1921, Fraenkel completed and submitted for publication a paper (published in 1922) that described his axiom as allowing arbitrary replacements: "If M is a set and each element of M is replaced by [a set or an urelement] then M turns into a set again" (parenthetical completion and translation by Ebbinghaus). Fraenkel's 1922 publication thanked Zermelo for helpful arguments. Prior to this publication, Fraenkel publicly announced his new axiom at a meeting of the German Mathematical Society held in Jena on 22 September 1921. Zermelo was present at this meeting; in the discussion following Fraenkel's talk he accepted the axiom of replacement in general terms, but expressed reservations regarding its extent.
Thoralf Skolem made public his discovery of the gap in Zermelo's system (the same gap that Fraenkel had found) in a talk he gave on 6 July 1922 at the 5th Congress of Scandinavian Mathematicians, which was held in Helsinki; the proceedings of this congress were published in 1923. Skolem presented a resolution in terms of first-order definable replacements: "Let U be a definite proposition that holds for certain pairs (a, b) in the domain B; assume further, that for every a there exists at most one b such that U is true. Then, as a ranges over the elements of a set M$_a$, b ranges over all elements of a set M$_b$." In the same year, Fraenkel wrote a review of Skolem's paper, in which Fraenkel simply stated that Skolem's considerations correspond to his own.
Zermelo himself never accepted Skolem's formulation of the axiom schema of replacement. At one point he called Skolem's approach “set theory of the impoverished”. Zermelo envisaged a system that would allow for large cardinals. He also objected strongly to the philosophical implications of countable models of set theory, which followed from Skolem's first-order axiomatization. According to the biography of Zermelo by Heinz-Dieter Ebbinghaus, Zermelo's disapproval of Skolem's approach marked the end of Zermelo's influence on the developments of set theory and logic.