Von Neumann–Bernays–Gödel set theory

In the foundations of mathematics, von Neumann–Bernays–Gödel set theory (NBG) is an axiomatic set theory that is a conservative extension of Zermelo–Fraenkel–choice set theory (ZFC). NBG introduces the notion of class, which is a collection of sets defined by a formula whose quantifiers range only over sets. NBG can define classes that are larger than sets, such as the class of all sets and the class of all ordinals. Morse–Kelley set theory (MK) allows classes to be defined by formulas whose quantifiers range over classes. NBG is finitely axiomatizable, while ZFC and MK are not.

A key theorem of NBG is the class existence theorem, which states that for every formula whose quantifiers range only over sets, there is a class consisting of the sets satisfying the formula. This class is built by mirroring the step-by-step construction of the formula with classes. Since all set-theoretic formulas are constructed from two kinds of atomic formulas (membership and equality) and finitely many logical symbols, only finitely many axioms are needed to build the classes satisfying them. This is why NBG is finitely axiomatizable. Classes are also used for other constructions, for handling the set-theoretic paradoxes, and for stating the axiom of global choice, which is stronger than ZFC's axiom of choice.

John von Neumann introduced classes into set theory in 1925. The primitive notions of his theory were function and argument. Using these notions, he defined class and set. Paul Bernays reformulated von Neumann's theory by taking class and set as primitive notions. Kurt Gödel simplified Bernays' theory for his relative consistency proof of the axiom of choice and the generalized continuum hypothesis.

The uses of classes
Classes have several uses in NBG:
 * They produce a finite axiomatization of set theory.
 * They are used to state a "very strong form of the axiom of choice" —namely, the axiom of global choice: There exists a global choice function $$G$$ defined on the class of all nonempty sets such that $$G(x) \in x$$ for every nonempty set $$x.$$ This is stronger than ZFC's axiom of choice: For every set $$s$$ of nonempty sets, there exists a choice function $$f$$ defined on $$s$$ such that $$f(x) \in x$$ for all $$x \in s.$$
 * The set-theoretic paradoxes are handled by recognizing that some classes cannot be sets. For example, assume that the class $$Ord$$ of all ordinals is a set. Then $$Ord$$ is a transitive set well-ordered by $$\in$$. So, by definition, $$Ord$$ is an ordinal. Hence, $$Ord \in Ord$$, which contradicts $$\in$$ being a well-ordering of $$Ord.$$ Therefore, $$Ord$$ is not a set. A class that is not a set is called a proper class, $$Ord$$ is a proper class.
 * Proper classes are useful in constructions. In his proof of the relative consistency of the axiom of global choice and the generalized continuum hypothesis, Gödel used proper classes to build the constructible universe. He constructed a function on the class of all ordinals that, for each ordinal, builds a constructible set by applying a set-building operation to previously constructed sets. The constructible universe is the image of this function.

Axiom schema versus class existence theorem
Once classes are added to the language of ZFC, it is easy to transform ZFC into a set theory with classes. First, the axiom schema of class comprehension is added. This axiom schema states: For every formula $$\phi(x_1, \ldots, x_n)$$ that quantifies only over sets, there exists a class $$A$$ consisting of the $n$-tuples satisfying the formula—that is, $$\forall x_1 \cdots \,\forall x_n [(x_1, \ldots, x_n) \in A \iff \phi(x_1, \ldots, x_n)].$$ Then the axiom schema of replacement is replaced by a single axiom that uses a class. Finally, ZFC's axiom of extensionality is modified to handle classes: If two classes have the same elements, then they are identical. The other axioms of ZFC are not modified.

This theory is not finitely axiomatized. ZFC's replacement schema has been replaced by a single axiom, but the axiom schema of class comprehension has been introduced.

To produce a theory with finitely many axioms, the axiom schema of class comprehension is first replaced with finitely many class existence axioms. Then these axioms are used to prove the class existence theorem, which implies every instance of the axiom schema. The proof of this theorem requires only seven class existence axioms, which are used to convert the construction of a formula into the construction of a class satisfying the formula.

Classes and sets
NBG has two types of objects: classes and sets. Intuitively, every set is also a class. There are two ways to axiomatize this. Bernays used many-sorted logic with two sorts: classes and sets. Gödel avoided sorts by introducing primitive predicates: $$\mathfrak{Cls}(A)$$ for "$$A$$ is a class" and $$\mathfrak{M}(A)$$ for "$$A$$ is a set" (in German, "set" is Menge). He also introduced axioms stating that every set is a class and that if class $$A$$ is a member of a class, then $$A$$ is a set. Using predicates is the standard way to eliminate sorts. Elliott Mendelson modified Gödel's approach by having everything be a class and defining the set predicate $$M(A)$$ as $$\exists C(A \in C).$$ This modification eliminates Gödel's class predicate and his two axioms.

Bernays' two-sorted approach may appear more natural at first, but it creates a more complex theory. In Bernays' theory, every set has two representations: one as a set and the other as a class. Also, there are two membership relations: the first, denoted by "∈", is between two sets; the second, denoted by "η", is between a set and a class. This redundancy is required by many-sorted logic because variables of different sorts range over disjoint subdomains of the domain of discourse.

The differences between these two approaches do not affect what can be proved, but they do affect how statements are written. In Gödel's approach, $$A \in C$$ where $$A$$ and $$C$$ are classes is a valid statement. In Bernays' approach this statement has no meaning. However, if $$A$$ is a set, there is an equivalent statement: Define "set $$a$$ represents class $$A$$" if they have the same sets as members—that is, $$\forall x(x \in a \iff x \;\eta \;A).$$ The statement $$a \;\eta \;C$$ where set $$a$$ represents class $$A$$ is equivalent to Gödel's $$A \in C.$$

The approach adopted in this article is that of Gödel with Mendelson's modification. This means that NBG is an axiomatic system in first-order predicate logic with equality, and its only primitive notions are class and the membership relation.

Definitions and axioms of extensionality and pairing
A set is a class that belongs to at least one class: $$A$$ is a set if and only if $$\exist C(A \in C)$$. A class that is not a set is called a proper class: $$A$$ is a proper class if and only if $$\forall C(A \notin C)$$. Therefore, every class is either a set or a proper class, and no class is both.

Gödel introduced the convention that uppercase variables range over classes, while lowercase variables range over sets. Gödel also used names that begin with an uppercase letter to denote particular classes, including functions and relations defined on the class of all sets. Gödel's convention is used in this article. It allows us to write: indent=1
 * $$\exist x\, \phi(x)$$ instead of $$\exist x \bigl(\exist C (x \in C) \land \phi(x)\bigr)$$
 * $$\forall x\, \phi(x)$$ instead of $$\forall x \bigl(\exist C (x \in C) \implies \phi(x)\bigr)$$

The following axioms and definitions are needed for the proof of the class existence theorem.

Axiom of extensionality. If two classes have the same elements, then they are identical.
 * $$\forall A \,\forall B \,[\forall x(x \in A \iff x \in B) \implies A = B]$$

This axiom generalizes ZFC's axiom of extensionality to classes.

Axiom of pairing. If $$x$$ and $$y$$ are sets, then there exists a set $$p$$ whose only members are $$x$$ and $$y$$.
 * $$\forall x \,\forall y \,\exists p \,\forall z \,[z \in p \iff (z = x \,\lor\, z = y)]$$

As in ZFC, the axiom of extensionality implies the uniqueness of the set $$p$$, which allows us to introduce the notation $$\{x, y\}.$$

Ordered pairs are defined by:
 * $$(x, y) = \{\{x\}, \{x, y\}\}$$

Tuples are defined inductively using ordered pairs:
 * $$(x_1) = x_1,$$
 * $$\text{For } n > 1\!: (x_1, \ldots, x_{n-1}, x_n) = ((x_1, \ldots, x_{n-1}), x_n).$$

Class existence axioms and axiom of regularity
Class existence axioms will be used to prove the class existence theorem: For every formula in $$n$$ free set variables that quantifies only over sets, there exists a class of $n$-tuples that satisfy it. The following example starts with two classes that are functions and builds a composite function. This example illustrates the techniques that are needed to prove the class existence theorem, which lead to the class existence axioms that are needed.


 * {| class="wikitable"


 * - style="text-align: left; vertical-align: top; style="background: white"
 * Example 1: If the classes $$F$$ and $$G$$ are functions, then the composite function $$G \circ F$$ is defined by the formula: $$\exists t[(x, t) \in F \,\land\, (t, y) \in G].$$ Since this formula has two free set variables, $$x$$ and $$y,$$ the class existence theorem constructs the class of ordered pairs: $$G \circ F\,=\,\{(x, y): \exists t[(x, t) \in F \,\land\, (t, y) \in G]\}.$$

Because this formula is built from simpler formulas using conjunction $$\land$$ and existential quantification $$\exists$$, class operations are needed that take classes representing the simpler formulas and produce classes representing the formulas with $$\land$$ and $$\exists$$. To produce a class representing a formula with $$\land$$, intersection used since $$x \in A \cap B \iff x \in A \land x \in B.$$ To produce a class representing a formula with $$\exists$$, the domain is used since $$x \in Dom(A) \iff \exists t[(x,t) \in A].$$

Before taking the intersection, the tuples in $$F$$ and $$G$$ need an extra component so they have the same variables. The component $$y$$ is added to the tuples of $$F$$ and $$x$$ is added to the tuples of $$G$$: $$F' = \{(x, t, y): (x, t) \in F\}\,$$ and $$\,G' = \{(t, y, x): (t, y) \in G\}$$ In the definition of $$F',$$ the variable $$y$$ is not restricted by the statement $$(x, t) \in F,$$ so $$y$$ ranges over the class $$V$$ of all sets. Similarly, in the definition of $$G',$$ the variable $$x$$ ranges over $$V.$$ So an axiom is needed that adds an extra component (whose values range over $$V$$) to the tuples of a given class.

Next, the variables are put in the same order to prepare for the intersection: $$F = \{(x, y, t): (x, t) \in F\}\,$$ and $$\,G = \{(x, y, t): (t, y) \in G\}$$ To go from $$F'$$ to $$F$$ and from $$G'$$ to $$G$$ requires two different permutations, so axioms that support permutations of tuple components are needed.

The intersection of $$F$$ and $$G$$ handles $$\land$$: $$F \cap G = \{(x, y, t): (x, t) \in F \,\land\, (t, y) \in G\}$$

Since $$(x, y, t)$$ is defined as $$((x, y), t)$$, taking the domain of $$F \cap G$$ handles $$\exists t$$ and produces the composite function: $$G \circ F = Dom(F \cap G) = \{(x, y): \exists t ((x, t) \in F \,\land\, (t, y) \in G)\}$$ So axioms of intersection and domain are needed.
 * }

The class existence axioms are divided into two groups: axioms handling language primitives and axioms handling tuples. There are four axioms in the first group and three axioms in the second group.

Axioms for handling language primitives:

Membership. There exists a class $$E$$ containing all the ordered pairs whose first component is a member of the second component.
 * $$\exists E \,\forall x \,\forall y \,[(x,y) \in E \iff x \in y]\!$$

Intersection (conjunction). For any two classes $$A$$ and $$B$$, there is a class $$C$$ consisting precisely of the sets that belong to both $$A$$ and $$B$$.
 * $$\forall A \,\forall B \,\exists C \,\forall x \,[x \in C \iff (x \in A \,\land\, x \in B)]$$

Complement (negation). For any class $$A$$, there is a class $$B$$ consisting precisely of the sets not belonging to $$A$$.
 * $$\forall A \,\exists B \,\forall x \,[x \in B \iff \neg(x \in A)]$$

Domain (existential quantifier). For any class $$A$$, there is a class $$B$$ consisting precisely of the first components of the ordered pairs of $$A$$.
 * $$\forall A \,\exists B \,\forall x \,[x \in B \iff \exists y((x,y) \in A)]$$

By the axiom of extensionality, class $$C$$ in the intersection axiom and class $$B$$ in the complement and domain axioms are unique. They will be denoted by: $$A \cap B,$$ $$\complement A,$$ and $$Dom(A),$$ respectively.

The first three axioms imply the existence of the empty class and the class of all sets: The membership axiom implies the existence of a class $$E.$$ The intersection and complement axioms imply the existence of $$E \cap \complement E$$, which is empty. By the axiom of extensionality, this class is unique; it is denoted by $$\empty.$$ The complement of $$\empty$$ is the class $$V$$ of all sets, which is also unique by extensionality. The set predicate $$M(A)$$, which was defined as $$\exists C(A \in C)$$, is now redefined as $$A \in V$$ to avoid quantifying over classes.

Axioms for handling tuples:

Product by $$V$$. For any class $$A$$, there is a class $$B$$ consisting of the ordered pairs whose first component belongs to $$A$$.
 * $$\forall A \,\exists B \,\forall u \,[u \in B \iff \exists x \, \exists y \,(u = (x, y) \land x \in A)]$$

Circular permutation. For any class $$A$$, there is a class $$B$$ whose 3tuples are obtained by applying the circular permutation $$(y,z,x) \mapsto (x,y,z)$$ to the 3tuples of $$A$$.
 * $$\forall A \,\exists B \,\forall x \,\forall y \,\forall z \,[(x,y,z) \in B \iff (y,z,x) \in A]$$

Transposition. For any class $$A$$, there is a class $$B$$ whose 3tuples are obtained by transposing the last two components of the 3tuples of $$A$$.
 * $$\forall A \,\exists B \,\forall x \,\forall y \,\forall z \,[(x,y,z) \in B \iff (x,z,y) \in A]$$

By extensionality, the product by $$V$$ axiom implies the existence of a unique class, which is denoted by $$A \times V.$$ This axiom is used to define the class $$V^n$$ of all $n$-tuples: $$V^1 = V$$ and $$V^{n+1} = V^n \times V.\,$$ If $$A$$ is a class, extensionality implies that $$A \cap V^n$$ is the unique class consisting of the $n$-tuples of $$A.$$ For example, the membership axiom produces a class $$E$$ that may contain elements that are not ordered pairs, while the intersection $$E \cap V^2$$ contains only the ordered pairs of $$E$$.

The circular permutation and transposition axioms do not imply the existence of unique classes because they specify only the 3tuples of class $$B.$$ By specifying the 3tuples, these axioms also specify the $n$-tuples for $$n \ge 4$$ since: $$(x_1, \ldots, x_{n-2}, x_{n-1}, x_n) = ((x_1, \ldots, x_{n-2}), x_{n-1}, x_n).$$ The axioms for handling tuples and the domain axiom imply the following lemma, which is used in the proof of the class existence theorem.

$$ $$

One more axiom is needed to prove the class existence theorem: the axiom of regularity. Since the existence of the empty class has been proved, the usual statement of this axiom is given.

Axiom of regularity. Every nonempty set has at least one element with which it has no element in common. $$\forall a\,[a \neq \empty \implies \exists u(u \in a \land u \cap a = \empty)].$$

This axiom implies that a set cannot belong to itself: Assume that $$x \in x$$ and let $$a = \{x\}.$$ Then $$x \cap a \ne \empty$$ since $$x \in x \cap a.$$ This contradicts the axiom of regularity because $$x$$ is the only element in $$a.$$ Therefore, $$x \notin x.$$ The axiom of regularity also prohibits infinite descending membership sequences of sets: $$\cdots \in x_{n+1} \in x_n \in \cdots \in x_1 \in x_0.$$

Gödel stated regularity for classes rather than for sets in his 1940 monograph, which was based on lectures given in 1938. In 1939, he proved that regularity for sets implies regularity for classes.

Class existence theorem
$$

The theorem's proof will be done in two steps:
 * 1) Transformation rules are used to transform the given formula $$\phi$$ into an equivalent formula that simplifies the inductive part of the proof. For example, the only logical symbols in the transformed formula are $$\neg$$, $$\land$$, and $$\exists$$, so the induction handles logical symbols with just three cases.
 * 2) The class existence theorem is proved inductively for transformed formulas. Guided by the structure of the transformed formula, the class existence axioms are used to produce the unique class of $n$-tuples satisfying the formula.

Transformation rules. In rules 1 and 2 below, $$\Delta$$ and $$\Gamma$$ denote set or class variables. These two rules eliminate all occurrences of class variables before an $$\in$$ and all occurrences of equality. Each time rule 1 or 2 is applied to a subformula, $$i$$ is chosen so that $$z_i$$ differs from the other variables in the current formula. The three rules are repeated until there are no subformulas to which they can be applied. This produces a formula that is built only with $$\neg$$, $$\land$$, $$\exists$$, $$\in$$, set variables, and class variables $$Y_k$$ where $$Y_k$$ does not appear before an $$\in$$.


 * 1) $$\,Y_k \in \Gamma$$ is transformed into $$\exists z_i(z_i = Y_k \,\land\, z_i \in \Gamma).$$
 * 2) Extensionality is used to transform $$\Delta = \Gamma$$ into $$\forall z_i(z_i \in \Delta \iff z_i \in \Gamma).$$
 * 3) Logical identities are used to transform subformulas containing $$\lor, \implies, \iff,$$ and $$\forall$$ to subformulas that only use $$\neg, \land,$$ and $$\exists.$$

Transformation rules: bound variables. Consider the composite function formula of example 1 with its free set variables replaced by $$x_1$$ and $$x_2$$: $$\exists t[(x_1, t) \in F \,\land\, (t, x_2) \in G].$$ The inductive proof will remove $$\exists t$$, which produces the formula $$(x_1, t) \in F \land (t, x_2) \in G.$$ However, since the class existence theorem is stated for subscripted variables, this formula does not have the form expected by the induction hypothesis. This problem is solved by replacing the variable $$t$$ with $$x_3.$$ Bound variables within nested quantifiers are handled by increasing the subscript by one for each successive quantifier. This leads to rule 4, which must be applied after the other rules since rules 1 and 2 produce quantified variables.


 * 1) If a formula contains no free set variables other than $$x_1, \dots, x_n,$$ then bound variables that are nested within $$q$$ quantifiers are replaced with $x_{n+q}$. These variables have (quantifier) nesting depth $$q$$.


 * {| class="wikitable"


 * - style="text-align: left; vertical-align: top; style="background: white"
 * Example 2: Rule 4 is applied to the formula $$\phi(x_1)$$ that defines the class consisting of all sets of the form $$\{\empty, \{\empty, \dots\}, \dots\}.$$ That is, sets that contain at least $$\empty$$ and a set containing $$\empty$$ — for example, $$\{\empty, \{\empty, a, b, c\}, d, e\}$$ where $$a, b, c, d,$$ and $$e$$ are sets.

$$\begin{align} \phi(x_1) \,&=\, \exists u\;\,[\,u \in x_1 \,\land\, \neg\exists v\;\,(\;v\, \in \,u\,)] \,\land\, \,\exists w\;\bigl(w \in x_1 \,\land\, \exists y\;\,[(\;y\, \in w \;\land\; \neg\exists z\;\,(\;z\, \in \,y\,)]\bigr) \\ \phi_r(x_1) \, &=\, \exists x_2[x_2 \!\in\! x_1 \,\land\, \neg\exists x_3(x_3 \!\in\! x_2)] \,\land\, \,\exists x_2\bigl(x_2 \!\in\! x_1 \,\land\, \exists x_3[(x_3 \!\in\! x_2 \,\land\, \neg\exists x_4(x_4 \!\in\! x_3)]\bigr) \end{align}$$

Since $$x_1$$ is the only free variable, $$n = 1.$$ The quantified variable $$x_3$$ appears twice in $$x_3 \in x_2$$ at nesting depth 2. Its subscript is 3 because $$n+q = 1+2 = 3.$$ If two quantifier scopes are at the same nesting depth, they are either identical or disjoint. The two occurrences of $$x_3$$ are in disjoint quantifier scopes, so they do not interact with each other.
 * }

Proof of the class existence theorem. The proof starts by applying the transformation rules to the given formula to produce a transformed formula. Since this formula is equivalent to the given formula, the proof is completed by proving the class existence theorem for transformed formulas.

Gödel pointed out that the class existence theorem "is a metatheorem, that is, a theorem about the system [NBG], not in the system …" It is a theorem about NBG because it is proved in the metatheory by induction on NBG formulas. Also, its proof—instead of invoking finitely many NBG axioms—inductively describes how to use NBG axioms to construct a class satisfying a given formula. For every formula, this description can be turned into a constructive existence proof that is in NBG. Therefore, this metatheorem can generate the NBG proofs that replace uses of NBG's class existence theorem.

A recursive computer program succinctly captures the construction of a class from a given formula. The definition of this program does not depend on the proof of the class existence theorem. However, the proof is needed to prove that the class constructed by the program satisfies the given formula and is built using the axioms. This program is written in pseudocode that uses a Pascal-style case statement. $$\begin{array}{l} \mathbf{function} \;\text{Class}(\phi, \,n) \\ \quad\begin{array}{rl} \mathbf{input}\!: \;\,&\phi \text{ is a transformed formula of the form } \phi(x_1, \ldots, x_n, Y_1, \ldots, Y_m); \\ &n \text{ specifies that a class of } n\text{-tuples is returned.} \\ \;\;\;\;\mathbf{output}\!: \;\,&\text{class } A \text{ of } n\text{-tuples satisfying } \\ &\,\forall x_1 \cdots \,\forall x_n [(x_1, \ldots, x_n) \in A \iff \phi(x_1, \ldots, x_n, Y_1, \ldots, Y_m)]. \end{array} \\ \mathbf{begin} \\ \quad \mathbf{case} \;\phi \;\mathbf{of} \\ \qquad \begin{alignat}{2} x_i \in x_j: \;\;&\mathbf{return} \;\,E_{i,j,n}; &&\text{// } E_{i,j,n} \;\,= \{(x_1, \dots, x_n): x_i \in x_j\} \\ x_i \in Y_k: \;\;&\mathbf{return} \;\,E_{i,Y_k,n}; &&\text{// } E_{i,Y_k,n} = \{(x_1, \dots, x_{n}): x_i \in Y_k\} \\ \neg\psi: \;\;&\mathbf{return} \;\,\complement_{V^n}\text{Class}(\psi, \,n); &&\text{// } \complement_{V^n}\text{Class}(\psi, \,n) = V^n \setminus \text{Class}(\psi, \,n) \\ \psi_1 \land \psi_2: \;\;&\mathbf{return} \;\,\text{Class}(\psi_1, \,n) \cap \text{Class}(\psi_2, \,n);&& \\ \;\;\;\;\,\exists x_{n+1}(\psi): \;\;&\mathbf{return} \;\,Dom(\text{Class}(\psi, \,n+1)); &&\text{// } x_{n+1} \text{ is free in } \psi; \text{ Class}(\psi, \,n+1) \\ &\ &&\text{// returns a class of } (n+1)\text{-tuples} \end{alignat} \\ \quad \mathbf{end} \\ \mathbf{end} \end{array}$$

Let $$\phi$$ be the formula of example 2. The function call $$A = Class(\phi, 1)$$ generates the class $$A,$$ which is compared below with $$\phi.$$ This shows that the construction of the class $$A$$ mirrors the construction of its defining formula $$\phi.$$

$$\begin{alignat}{2} &\phi \;&&= \;\;\exists x_2\,(x_2 \!\in\! x_1 \land \;\;\neg\;\;\;\;\exists x_3\;(x_3 \!\in\! x_2)) \,\land \;\;\,\exists x_2\,(x_2 \!\in\! x_1 \land \;\;\,\exists x_3\,(x_3 \!\in\! x_2 \,\land\;\;\neg\;\;\;\;\exists x_4\;(x_4 \!\in\! x_3))) \\ &A \;&&= Dom\,(\;E_{2,1,2}\; \cap \;\complement_{V^2}\,Dom\,(\;E_{3,2,3}\;)) \,\cap\, Dom\,(\;E_{2,1,2}\;\cap \, Dom\,(\;\,E_{3,2,3}\; \cap \;\complement_{V^3}\,Dom\,(\;E_{4,3,4}\;))) \end{alignat}$$

Extending the class existence theorem
Gödel extended the class existence theorem to formulas $$\phi$$ containing relations over classes (such as $$Y_1 \subseteq Y_2$$ and the unary relation $$M(Y_1)$$), special classes (such as $$Ord$$), and operations (such as $$(x_1, x_2)$$ and $$x_1 \cap Y_1$$). To extend the class existence theorem, the formulas defining relations, special classes, and operations must quantify only over sets. Then $$\phi$$ can be transformed into an equivalent formula satisfying the hypothesis of the class existence theorem.

The following definitions specify how formulas define relations, special classes, and operations:
 * 1) A relation $$R$$ is defined by: $$R(Z_1, \dots, Z_k) \iff \psi_R(Z_1, \dots, Z_k).$$
 * 2) A special class $$C$$ is defined by: $$u \in C \iff \psi_C(u).$$
 * 3) An operation $$P$$ is defined by: $$u \in P(Z_1, \dots, Z_k) \iff \psi_P(u, Z_1, \dots, Z_k).$$

A is defined by:
 * 1) Variables and special classes are terms.
 * 2) If $$P$$ is an operation with $$k$$ arguments and $$\Gamma_1, \dots, \Gamma_k$$ are terms, then $$P(\Gamma_1, \dots, \Gamma_k)$$ is a term.

The following transformation rules eliminate relations, special classes, and operations. Each time rule 2b, 3b, or 4 is applied to a subformula, $$i$$ is chosen so that $$z_i$$ differs from the other variables in the current formula. The rules are repeated until there are no subformulas to which they can be applied. $$\, \Gamma_1, \dots, \Gamma_k, \Gamma,$$ and $$\Delta$$ denote terms.


 * 1) A relation $$R(Z_1, \dots, Z_k)$$ is replaced by its defining formula $$\psi_R(Z_1, \dots, Z_k).$$
 * 2) Let $$\psi_C(u)$$ be the defining formula for the special class $$C.$$ 1. $\Delta \in C$ is replaced by $\psi_C(\Delta).$

2. $C \in \Delta$ is replaced by $\exists z_i[z_i = C \land z_i \in \Delta].$
 * 1) Let $$\psi_P(u, Z_1, \dots, Z_k)$$ be the defining formula for the operation $$P(Z_1, \dots, Z_k).$$ 1. $\Delta \in P(\Gamma_1, \dots, \Gamma_k)$ is replaced by $\psi_P(\Delta, \Gamma_1, \dots, \Gamma_k).$

2. $P(\Gamma_1, \dots, \Gamma_k) \in \Delta$ is replaced by $\exists z_i[z_i = P(\Gamma_1, \dots, \Gamma_k) \land z_i \in \Delta].$
 * 1) Extensionality is used to transform $$\Delta = \Gamma$$ into $$\forall z_i(z_i \in \Delta \iff z_i \in \Gamma).$$


 * {| class="wikitable"

$$Y_1 \subseteq Y_2 \iff \forall z_1(z_1 \in Y_1 \implies z_1 \in Y_2) \quad\text{(rule 1)}$$
 * - style="text-align: left; vertical-align: top; style="background: white"
 * Example 3: Transforming $$Y_1 \subseteq Y_2.$$
 * }


 * {| class="wikitable"

$$\begin{alignat}{2} x_1 \cap Y_1 \in x_2 &\iff \exists z_1[z_1 = x_1 \cap Y_1 \,\land\, z_1 \in x_2] &&\text{(rule 3b)} \\ &\iff \exists z_1[\forall z_2(z_2 \in z_1 \iff z_2 \in x_1 \cap Y_1) \,\land\, z_1 \in x_2] &&\text{(rule 4)} \\ &\iff \exists z_1[\forall z_2(z_2 \in z_1 \iff z_2 \in x_1 \land z_2 \in Y_1) \,\land\, z_1 \in x_2] \quad&&\text{(rule 3a)} \\ \end{alignat}$$
 * - style="text-align: left; vertical-align: top; style="background: white"
 * Example 4: Transforming $$x_1 \cap Y_1 \in x_2.$$

This example illustrates how the transformation rules work together to eliminate an operation.
 * }

$$

$$

Set axioms
The axioms of pairing and regularity, which were needed for the proof of the class existence theorem, have been given above. NBG contains four other set axioms. Three of these axioms deal with class operations being applied to sets.

Definition. $$F$$ is a function if $$F \subseteq V^2 \land \forall x\, \forall y\, \forall z\, [(x,y) \in F \,\land\, (x,z) \in F \implies y = z].$$

In set theory, the definition of a function does not require specifying the domain or codomain of the function (see Function (set theory)). NBG's definition of function generalizes ZFC's definition from a set of ordered pairs to a class of ordered pairs.

ZFC's definitions of the set operations of image, union, and power set are also generalized to class operations. The image of class $$A$$ under the function $$F$$ is $$F[A] = \{y: \exists x(x \in A \,\land\, (x, y) \in F)\}.$$ This definition does not require that $$A \subseteq Dom(F).$$ The union of class $$A$$ is $$\cup A = \{x: \exists y(x \in y\, \,\land\, y \in A)\}.$$ The power class of $$A$$ is $$\mathcal{P}(A) = \{x: x \subseteq A\}.$$ The extended version of the class existence theorem implies the existence of these classes. The axioms of replacement, union, and power set imply that when these operations are applied to sets, they produce sets.

Axiom of replacement. If $$F$$ is a function and $$a$$ is a set, then $$F[a]$$, the image of $$a$$ under $$F$$, is a set. $$\forall F \,\forall a \,[F \text{ is a function}\implies \exists b \,\forall y\,(y \in b \iff \exists x(x \in a \,\land\, (x, y) \in F))].$$

Not having the requirement $$A \subseteq Dom(F)$$ in the definition of $$F[A]$$ produces a stronger axiom of replacement, which is used in the following proof.

$$ $$

Axiom of union. If $$a$$ is a set, then there is a set containing $$\cup a.$$ $$\forall a\, \exists b\, \forall x\,[\,\exists y(x \in y\, \,\land\, y \in a) \implies x \in b\,].$$

Axiom of power set. If $$a$$ is a set, then there is a set containing $$\mathcal{P}(a).$$
 * $$\forall a\, \exists b\, \forall x\, (x \subseteq a \implies x \in b).$$

$$ $$

Axiom of infinity. There exists a nonempty set $$a$$ such that for all $$x$$ in $$a$$, there exists a $$y$$ in $$a$$ such that $$x$$ is a proper subset of $$y$$. $$\exists a\, [\exists u(u \in a) \,\land\, \forall x(x \in a \implies \exists y(y \in a \,\land\, x \subset y))].$$

The axioms of infinity and replacement prove the existence of the empty set. In the discussion of the class existence axioms, the existence of the empty class $$\empty$$ was proved. We now prove that $$\empty$$ is a set. Let function $$F = \empty$$ and let $$a$$ be the set given by the axiom of infinity. By replacement, the image of $$a$$ under $$F$$, which equals $$\empty$$, is a set.

NBG's axiom of infinity is implied by ZFC's axiom of infinity: $$\,\exists a\, [\empty \in a \,\land\, \forall x(x \in a \implies x \cup \{x\} \in a)].\,$$ The first conjunct of ZFC's axiom, $$\empty \in a$$, implies the first conjunct of NBG's axiom. The second conjunct of ZFC's axiom, $$\forall x(x \in a \implies x \cup \{x\} \in a)$$, implies the second conjunct of NBG's axiom since $$x \subset x \cup \{x\}.$$ To prove ZFC's axiom of infinity from NBG's axiom of infinity requires some of the other NBG axioms (see Weak axiom of infinity).

Axiom of global choice
The class concept allows NBG to have a stronger axiom of choice than ZFC. A choice function is a function $$f$$ defined on a set $$s$$ of nonempty sets such that $$f(x) \in x$$ for all $$x \in s.$$ ZFC's axiom of choice states that there exists a choice function for every set of nonempty sets. A global choice function is a function $$G$$ defined on the class of all nonempty sets such that $$G(x) \in x$$ for every nonempty set $$x.$$ The axiom of global choice states that there exists a global choice function. This axiom implies ZFC's axiom of choice since for every set $$s$$ of nonempty sets, $$G\vert_s$$ (the restriction of $$G$$ to $$s$$) is a choice function for $$s.$$ In 1964, William B. Easton proved that global choice is stronger than the axiom of choice by using forcing to construct a model that satisfies the axiom of choice and all the axioms of NBG except the axiom of global choice. The axiom of global choice is equivalent to every class having a well-ordering, while ZFC's axiom of choice is equivalent to every set having a well-ordering.

Axiom of global choice. There exists a function that chooses an element from every nonempty set.
 * $$\exists G\,[G \text{ is a function}\, \land \forall x(x \ne \empty \implies \exists y(y \in x \land (x,y) \in G))].$$

Von Neumann's 1925 axiom system
Von Neumann published an introductory article on his axiom system in 1925. In 1928, he provided a detailed treatment of his system. Von Neumann based his axiom system on two domains of primitive objects: functions and arguments. These domains overlap—objects that are in both domains are called argument-functions. Functions correspond to classes in NBG, and argument-functions correspond to sets. Von Neumann's primitive operation is function application, denoted by [a, x] rather than a(x) where a is a function and x is an argument. This operation produces an argument. Von Neumann defined classes and sets using functions and argument-functions that take only two values, A and B. He defined x ∈ a if [a, x] ≠ A.

Von Neumann's work in set theory was influenced by Georg Cantor's articles, Ernst Zermelo's 1908 axioms for set theory, and the 1922 critiques of Zermelo's set theory that were given independently by Abraham Fraenkel and Thoralf Skolem. Both Fraenkel and Skolem pointed out that Zermelo's axioms cannot prove the existence of the set {Z0, Z1, Z2, ...} where Z0 is the set of natural numbers and Zn+1 is the power set of Zn. They then introduced the axiom of replacement, which would guarantee the existence of such sets. However, they were reluctant to adopt this axiom: Fraenkel stated "that Replacement was too strong an axiom for 'general set theory'", while "Skolem only wrote that 'we could introduce' Replacement".

Von Neumann worked on the problems of Zermelo set theory and provided solutions for some of them:
 * A theory of ordinals
 * Problem: Cantor's theory of ordinal numbers cannot be developed in Zermelo set theory because it lacks the axiom of replacement.
 * Solution: Von Neumann recovered Cantor's theory by defining the ordinals using sets that are well-ordered by the ∈-relation, and by using the axiom of replacement to prove key theorems about the ordinals, such as every well-ordered set is order-isomorphic with an ordinal. In contrast to Fraenkel and Skolem, von Neumann emphasized how important the replacement axiom is for set theory: "In fact, I believe that no theory of ordinals is possible at all without this axiom."
 * A criterion identifying classes that are too large to be sets
 * Problem: Zermelo did not provide such a criterion. His set theory avoids the large classes that lead to the paradoxes, but it leaves out many sets, such as the one mentioned by Fraenkel and Skolem.
 * Solution: Von Neumann introduced the criterion: A class is too large to be a set if and only if it can be mapped onto the class V of all sets. Von Neumann realized that the set-theoretic paradoxes could be avoided by not allowing such large classes to be members of any class. Combining this restriction with his criterion, he obtained his axiom of limitation of size: A class C is not a member of any class if and only if C can be mapped onto V.
 * Finite axiomatization
 * Problem: Zermelo had used the imprecise concept of "definite propositional function" in his axiom of separation.
 * Solutions: Skolem introduced the axiom schema of separation that was later used in ZFC, and Fraenkel introduced an equivalent solution. However, Zermelo rejected both approaches "particularly because they implicitly involve the concept of natural number which, in Zermelo's view, should be based upon set theory." Von Neumann avoided axiom schemas by formalizing the concept of "definite propositional function" with his functions, whose construction requires only finitely many axioms. This led to his set theory having finitely many axioms. In 1961, Richard Montague proved that ZFC cannot be finitely axiomatized.
 * The axiom of regularity
 * Problem: Zermelo set theory starts with the empty set and an infinite set, and iterates the axioms of pairing, union, power set, separation, and choice to generate new sets. However, it does not restrict sets to these. For example, it allows sets that are not well-founded, such as a set x satisfying x ∈ x.
 * Solutions: Fraenkel introduced an axiom to exclude these sets. Von Neumann analyzed Fraenkel's axiom and stated that it was not "precisely formulated", but it would approximately say: "Besides the sets ... whose existence is absolutely required by the axioms, there are no further sets." Von Neumann proposed the axiom of regularity as a way to exclude non-well-founded sets, but did not include it in his axiom system. In 1930, Zermelo became the first to publish an axiom system that included regularity.

Von Neumann's 1929 axiom system


In 1929, von Neumann published an article containing the axioms that would lead to NBG. This article was motivated by his concern about the consistency of the axiom of limitation of size. He stated that this axiom "does a lot, actually too much." Besides implying the axioms of separation and replacement, and the well-ordering theorem, it also implies that any class whose cardinality is less than that of V is a set. Von Neumann thought that this last implication went beyond Cantorian set theory and concluded: "We must therefore discuss whether its [the axiom's] consistency is not even more problematic than an axiomatization of set theory that does not go beyond the necessary Cantorian framework."

Von Neumann started his consistency investigation by introducing his 1929 axiom system, which contains all the axioms of his 1925 axiom system except the axiom of limitation of size. He replaced this axiom with two of its consequences, the axiom of replacement and a choice axiom. Von Neumann's choice axiom states: "Every relation R has a subclass that is a function with the same domain as R."

Let S be von Neumann's 1929 axiom system. Von Neumann introduced the axiom system S + Regularity (which consists of S and the axiom of regularity) to demonstrate that his 1925 system is consistent relative to S. He proved: These results imply: If S is consistent, then von Neumann's 1925 axiom system is consistent. Proof: If S is consistent, then S + Regularity is consistent (result 1). Using proof by contradiction, assume that the 1925 axiom system is inconsistent, or equivalently: the 1925 axiom system implies a contradiction. Since S + Regularity implies the axioms of the 1925 system (result 2), S + Regularity also implies a contradiction. However, this contradicts the consistency of S + Regularity. Therefore, if S is consistent, then von Neumann's 1925 axiom system is consistent.
 * 1) If S is consistent, then S + Regularity is consistent.
 * 2) S + Regularity implies the axiom of limitation of size. Since this is the only axiom of his 1925 axiom system that S + Regularity does not have, S + Regularity implies all the axioms of his 1925 system.

Since S is his 1929 axiom system, von Neumann's 1925 axiom system is consistent relative to his 1929 axiom system, which is closer to Cantorian set theory. The major differences between Cantorian set theory and the 1929 axiom system are classes and von Neumann's choice axiom. The axiom system S + Regularity was modified by Bernays and Gödel to produce the equivalent NBG axiom system.

Bernays' axiom system
In 1929, Paul Bernays started modifying von Neumann's new axiom system by taking classes and sets as primitives. He published his work in a series of articles appearing from 1937 to 1954. Bernays stated that: "The purpose of modifying the von Neumann system is to remain nearer to the structure of the original Zermelo system and to utilize at the same time some of the set-theoretic concepts of the Schröder logic and of Principia Mathematica which have become familiar to logicians. As will be seen, a considerable simplification results from this arrangement."

Bernays handled sets and classes in a two-sorted logic and introduced two membership primitives: one for membership in sets and one for membership in classes. With these primitives, he rewrote and simplified von Neumann's 1929 axioms. Bernays also included the axiom of regularity in his axiom system.

Gödel's axiom system (NBG)
In 1931, Bernays sent a letter containing his set theory to Kurt Gödel. Gödel simplified Bernays' theory by making every set a class, which allowed him to use just one sort and one membership primitive. He also weakened some of Bernays' axioms and replaced von Neumann's choice axiom with the equivalent axiom of global choice. Gödel used his axioms in his 1940 monograph on the relative consistency of global choice and the generalized continuum hypothesis.

Several reasons have been given for Gödel choosing NBG for his monograph:
 * Gödel gave a mathematical reason—NBG's global choice produces a stronger consistency theorem: "This stronger form of the axiom [of choice], if consistent with the other axioms, implies, of course, that a weaker form is also consistent."
 * Robert Solovay conjectured: "My guess is that he [Gödel] wished to avoid a discussion of the technicalities involved in developing the rudiments of model theory within axiomatic set theory."
 * Kenneth Kunen gave a reason for Gödel avoiding this discussion: "There is also a much more combinatorial approach to L [the constructible universe], developed by ... [Gödel in his 1940 monograph] in an attempt to explain his work to non-logicians. ... This approach has the merit of removing all vestiges of logic from the treatment of L."
 * Charles Parsons provided a philosophical reason for Gödel's choice: "This view [that 'property of set' is a primitive of set theory] may be reflected in Gödel's choice of a theory with class variables as the framework for ... [his monograph]."

Gödel's achievement together with the details of his presentation led to the prominence that NBG would enjoy for the next two decades. In 1963, Paul Cohen proved his independence proofs for ZF with the help of some tools that Gödel had developed for his relative consistency proofs for NBG. Later, ZFC became more popular than NBG. This was caused by several factors, including the extra work required to handle forcing in NBG, Cohen's 1966 presentation of forcing, which used ZF, and the proof that NBG is a conservative extension of ZFC.

NBG, ZFC, and MK
NBG is not logically equivalent to ZFC because its language is more expressive: it can make statements about classes, which cannot be made in ZFC. However, NBG and ZFC imply the same statements about sets. Therefore, NBG is a conservative extension of ZFC. NBG implies theorems that ZFC does not imply, but since NBG is a conservative extension, these theorems must involve proper classes. For example, it is a theorem of NBG that the global axiom of choice implies that the proper class V can be well-ordered and that every proper class can be put into one-to-one correspondence with V.

One consequence of conservative extension is that ZFC and NBG are equiconsistent. Proving this uses the principle of explosion: from a contradiction, everything is provable. Assume that either ZFC or NBG is inconsistent. Then the inconsistent theory implies the contradictory statements ∅ = ∅ and ∅ ≠ ∅, which are statements about sets. By the conservative extension property, the other theory also implies these statements. Therefore, it is also inconsistent. So although NBG is more expressive, it is equiconsistent with ZFC. This result together with von Neumann's 1929 relative consistency proof implies that his 1925 axiom system with the axiom of limitation of size is equiconsistent with ZFC. This completely resolves von Neumann's concern about the relative consistency of this powerful axiom since ZFC is within the Cantorian framework.

Even though NBG is a conservative extension of ZFC, a theorem may have a shorter and more elegant proof in NBG than in ZFC (or vice versa). For a survey of known results of this nature, see.

Morse–Kelley set theory has an axiom schema of class comprehension that includes formulas whose quantifiers range over classes. MK is a stronger theory than NBG because MK proves the consistency of NBG, while Gödel's second incompleteness theorem implies that NBG cannot prove the consistency of NBG.

For a discussion of some ontological and other philosophical issues posed by NBG, especially when contrasted with ZFC and MK, see Appendix C of.

Models
ZFC, NBG, and MK have models describable in terms of the cumulative hierarchy Vα and the constructible hierarchy Lα. Let V include an inaccessible cardinal κ, let X ⊆ Vκ, and let Def(X) denote the class of first-order definable subsets of X with parameters. In symbols where "$$(X,\in)$$" denotes the model with domain $$X$$ and relation $$\in$$, and "$$\models$$" denotes the satisfaction relation: $$\operatorname{Def}(X) := \Bigl\{ \{ x \mid x \in X \text{ and } (X,\in) \models \phi(x,y_1,\ldots,y_n) \}: \phi \text{ is a first-order formula and } y_{1},\ldots,y_{n} \in X \Bigr\}.$$

Then:
 * $$(V_\kappa,\in)$$ and $$(L_\kappa,\in)$$ are models of ZFC.
 * (Vκ, Vκ+1, ∈) is a model of MK where Vκ consists of the sets of the model and Vκ+1 consists of the classes of the model. Since a model of MK is a model of NBG, this model is also a model of NBG.
 * (Vκ, Def(Vκ), ∈) is a model of Mendelson's version of NBG, which replaces NBG's axiom of global choice with ZFC's axiom of choice. The axioms of ZFC are true in this model because (Vκ, ∈) is a model of ZFC. In particular, ZFC's axiom of choice holds, but NBG's global choice may fail. NBG's class existence axioms are true in this model because the classes whose existence they assert can be defined by first-order definitions. For example, the membership axiom holds since the class $$E$$ is defined by: $$E = \{x \in V_\kappa: (V_\kappa,\in) \models \exists u \ \exists v [x = (u, v) \land u \in v]\}.$$
 * (Lκ, Lκ+, ∈), where κ+ is the successor cardinal of κ, is a model of NBG. NBG's class existence axioms are true in (Lκ, Lκ+, ∈). For example, the membership axiom holds since the class $$E$$ is defined by: $$E = \{x \in L_\kappa: (L_\kappa,\in) \models \exists u \ \exists v [x = (u, v) \land u \in v]\}.$$ So E ∈ 𝒫(Lκ). In his proof that GCH is true in L, Gödel proved that 𝒫(Lκ) ⊆ Lκ+. Therefore, E ∈ Lκ+, so the membership axiom is true in (Lκ, Lκ+, ∈). Likewise, the other class existence axioms are true. The axiom of global choice is true because Lκ is well-ordered by the restriction of Gödel's function (which maps the class of ordinals to the constructible sets) to the ordinals less than κ. Therefore, (Lκ, Lκ+, ∈) is a model of NBG.
 * If $$M$$ is a nonstandard model of $$\mathrm{ZFC}$$, then $$(M,\mathrm{Def}(M))\vDash \mathrm{GB}+\Delta^1_1\text{-CA}$$ is equivalent to "there exists an $$X$$ such that $$(M,X)\vDash\mathrm{GB}+\Delta^1_1\text{-CA}$$", where $$\mathrm{Def}(M)$$ is the set of subsets of $$M$$ that are definable over $$M$$. This provides a second-order part for extending a given first-order nonstandard model of $$\mathrm{ZFC}$$ to a nonstandard model of $$\mathrm{GB}$$, if there is such an extension at all.

Category theory
The ontology of NBG provides scaffolding for speaking about "large objects" without risking paradox. For instance, in some developments of category theory, a "large category" is defined as one whose objects and morphisms make up a proper class. On the other hand, a "small category" is one whose objects and morphisms are members of a set. Thus, we can speak of the "category of all sets" or "category of all small categories" without risking paradox since NBG supports large categories.

However, NBG does not support a "category of all categories" since large categories would be members of it and NBG does not allow proper classes to be members of anything. An ontological extension that enables us to talk formally about such a "category" is the conglomerate, which is a collection of classes. Then the "category of all categories" is defined by its objects: the conglomerate of all categories; and its morphisms: the conglomerate of all morphisms from A to B where A and B are objects. On whether an ontology including classes as well as sets is adequate for category theory, see.