In axiomatic set theory and the branches of logic, mathematics, and computer science that use it, the

**axiom of extensionality**, occasionally known as the axiom of extension, is one of the axioms of Zermelo-Fraenkel set theory.

In the formal language of the Zermelo-Fraenkel axioms, the axiom reads:

- ∀
*A*, ∀*B*,*A*=*B*↔ (∀*C*,*C*∈*A*↔*C*∈*B*);

- Given any set
*A*and any set*B*,*A*is equal to*B*if and only if, given any element*C*,*C*is a member of*A*if and only if*C*is a member of*B*.

*A*and

*B*have precisely the same members. Thus, what the axiom is really saying is that two sets are equal iff they have precisely the same members. The essence of this is:

- A set is determined uniquely by its members.

- ∃
*A*, ∀*C*,*C*∈*A*↔*P*(*C*),

*P*is any unary predicate that does not mention

*A*, to define a unique set

*A*whose members are precisely the sets satisfying the predicate

*P*. We can then introduce a new symbol for

*A*; it's in this way that definitions in ordinary mathematics ultimately work when their statements are reduced to purely set-theoretic terms.

The axiom of extensionality is generally considered uncontroversial, and it or an equivalent appears in just about any alternative axiomatisation of set theory. However, it may require modifications for some purposes, as below.

## In predicate logic without equality

The axiom given above assumes that equality is a primitive symbol in predicate logic.
Some treatments of axiomatic set theory prefer to do without this, and instead treat the above statement not as an axiom but as a *definition* of equality.
Then it's necessary to include the usual axioms of equality from predicate logic as axioms about this defined symbol, and it now *these* axioms that are referred to as the axioms of extensionality.

## In set theory with ur-elements

Alternatively, in untyped logic, we can require *C* ∈ *A* to be false whenever *A* is an ur-element.
In this case, the usual axiom of extensionality would imply that every ur-element is equal to the empty set.
To avoid this, we can modify the axiom of extensioality to apply only to nonempty sets, so that it reads:

- ∀
*A*, ∀*B*, (∃*C*, '\'C*∈*A*) → (*A*=*B*↔ (∀*C*,*C*∈*A*↔*C*∈*B'')).

- Given any set
*A*and any set*B*,*if*A*is a nonempty set*(that is, if there exists a member*C*of*A*),*then**A*and*B*are equal iff they have precisely the same members.