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 at most one set y such that P(x,y) holds. There is a corresponding definable function FP, where FP(x)=y if and only if P(x,y). Consider the (possibly proper) class B defined such that for every set y, y∈B if and only if there is an x∈A with FP(x)=y. B is called the image of A under FP, and denoted FP[A] or (using set-builder notation) {FP(x):x∈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. Let ϕ be a well-formed formula in the formal language of ZF set theory, with the constraint that B and z are not allowed to be free in it. Let ϕ[y/z] be identical to ϕ, except for having all free instances of y in ϕ replaced with z. For each free variable in ϕ other than A,x,y, there is a universal quantifier for it in the prefix, outside the scope of ∀A. For each ϕ, there is an axiom: ∀A(∀x(x∈A⟹∃y(ϕ∧∀z(ϕ[y/z]⟹y=z)))⟹∃B∀y(y∈B⟺∃x(x∈A∧ϕ))) By using common metalanguage abbreviations, including the definition of the uniqueness quantifier, this can be abbreviated as: ∀A([∀x∈A∃!yϕ(x,y)] ⟹ ∃B∀y[y∈B⇔∃x∈Aϕ(x,y)]) So whenever ϕ 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]. Another commonly seen version of the schema, used in automated theorem provers like Isabelle, only requires ϕ to behave like a partial function instead of a total one: ∀A(∀x(x∈A⟹∀y∀z((ϕ∧ϕ[y/z])⟹y=z))⟹∃B∀y(y∈B⟺∃x(x∈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 ω+ω is the first such ordinal. Indeed, the axiom of infinity asserts the existence of an infinite set ω={0,1,2,…}. One may hope to define ω+ω 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 ω+ω without resorting to replacement: simply take the disjoint union of two copies of ω, with the second copy greater than the first; however, that 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(ℕ×ℕ) by the axioms of separation and power set (a relation on A is a subset of A×A, and so an element of P(A×A). A set of relations is thus a subset of P(A×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 An=An−1×A and for large A, the set {An∣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, so as to construct transfinite (but countable) iterations of the powerset of a given set, usually the natural numbers. ZF (which includes replacement) proves the consistency of Z, as the set Vω+ω is a model of Z whose existence can be proved in ZF. The cardinal number ℵω is the smallest cardinal that 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.
… excerpt ends here. Continue reading the full article.

![Axiom schema of replacement: Axiom schema of collection: the image f[A] of the domain set A under the definable class function f falls inside a set B.](https://thumb.wikimedia.org/wikipedia/commons/thumb/d/d1/Codomain2_A_B.SVG/500px-Codomain2_A_B.SVG.png?utm_source=en.wikipedia.org&utm_campaign=parser&utm_content=thumbnail)

