In

axiomatic set theory
Set theory is the branch of mathematical logic that studies sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory, as a branch of mathematics, is mostly concer ...

and the branches of logic
Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the science of deductively valid inferences or of logical truths. It is a formal science investigating how conclusions follow from premises ...

, mathematics, and computer science that use it, the axiom of extensionality, or axiom of extension, is one of the axiom
An axiom, postulate, or assumption is a statement that is taken to be true, to serve as a premise or starting point for further reasoning and arguments. The word comes from the Ancient Greek word (), meaning 'that which is thought worthy or f ...

s of Zermelo–Fraenkel set theory. It says that sets having the same elements are the same set.
Formal statement

In theformal language
In logic, mathematics, computer science, and linguistics, a formal language consists of words whose letters are taken from an alphabet and are well-formed according to a specific set of rules.
The alphabet of a formal language consists o ...

of the Zermelo–Fraenkel axioms, the axiom reads:
:$\backslash forall\; A\; \backslash ,\; \backslash forall\; B\; \backslash ,\; (\; \backslash forall\; X\; \backslash ,\; (X\; \backslash in\; A\; \backslash iff\; X\; \backslash in\; B)\; \backslash implies\; A\; =\; B)$
or in words:
:Given any
In mathematical logic, a universal quantification is a type of quantifier, a logical constant which is interpreted as "given any" or "for all". It expresses that a predicate can be satisfied by every member of a domain of discourse. In other ...

set ''A'' and any set ''B'', if for every set ''X'', ''X'' is a member of ''A'' if and only if ''X'' is a member of ''B'', then ''A'' is equal
Equal(s) may refer to:
Mathematics
* Equality (mathematics).
* Equals sign (=), a mathematical symbol used to indicate equality.
Arts and entertainment
* ''Equals'' (film), a 2015 American science fiction film
* ''Equals'' (game), a board game
...

to ''B''.
:(It is not really essential that ''X'' here be a ''set'' — but in ZF, everything is. See Ur-elements below for when this is violated.)
The converse, $\backslash forall\; A\; \backslash ,\; \backslash forall\; B\; \backslash ,\; (A\; =\; B\; \backslash implies\; \backslash forall\; X\; \backslash ,\; (X\; \backslash in\; A\; \backslash iff\; X\; \backslash in\; B)\; ),$ of this axiom follows from the substitution property of equality
Equality may refer to:
Society
* Political equality, in which all members of a society are of equal standing
** Consociationalism, in which an ethnically, religiously, or linguistically divided state functions by cooperation of each group's elite ...

.
Interpretation

To understand this axiom, note that the clause in parentheses in the symbolic statement above simply states that ''A'' and ''B'' have precisely the same members. Thus, what the axiom is really saying is that two sets are equal if and only if they have precisely the same members. The essence of this is: :A set is determined uniquely by its members. The axiom of extensionality can be used with any statement of the form $\backslash exists\; A\; \backslash ,\; \backslash forall\; X\; \backslash ,\; (X\; \backslash in\; A\; \backslash iff\; P(X)\; \backslash ,\; )$, where ''P'' is any unarypredicate
Predicate or predication may refer to:
* Predicate (grammar), in linguistics
* Predication (philosophy)
* several closely related uses in mathematics and formal logic:
**Predicate (mathematical logic)
**Propositional function
**Finitary relation, o ...

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 definition
A definition is a statement of the meaning of a term (a word, phrase, or other set of symbols). Definitions can be classified into two large categories: intensional definitions (which try to give the sense of a term), and extensional definiti ...

s in ordinary mathematics ultimately work when their statements are reduced to purely set-theoretic terms.
The axiom of extensionality is generally uncontroversial in set-theoretical foundations of mathematics, 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 inpredicate logic
First-order logic—also known as predicate logic, quantificational logic, and first-order predicate calculus—is a collection of formal systems used in mathematics, philosophy, linguistics, and computer science. First-order logic uses quanti ...

.
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 is necessary to include the usual axioms of equality from predicate logic as axioms about this defined symbol. Most of the axioms of equality still follow from the definition; the remaining one is the substitution property,
:$\backslash forall\; A\; \backslash ,\; \backslash forall\; B\; \backslash ,\; (\; \backslash forall\; X\; \backslash ,\; (X\; \backslash in\; A\; \backslash iff\; X\; \backslash in\; B)\; \backslash implies\; \backslash forall\; Y\; \backslash ,\; (A\; \backslash in\; Y\; \backslash iff\; B\; \backslash in\; Y)\; \backslash ,\; ),$
and it becomes ''this'' axiom that is referred to as the axiom of extensionality in this context.
In set theory with ur-elements

An ur-element is a member of a set that is not itself a set. In the Zermelo–Fraenkel axioms, there are no ur-elements, but they are included in some alternative axiomatisations of set theory. Ur-elements can be treated as a different logical type from sets; in this case, $B\; \backslash in\; A$ makes no sense if $A$ is an ur-element, so the axiom of extensionality simply applies only to sets. Alternatively, in untyped logic, we can require $B\; \backslash in\; A$ to be false whenever $A$ is an ur-element. In this case, the usual axiom of extensionality would then imply that every ur-element is equal to theempty set
In mathematics, the empty set is the unique set having no elements; its size or cardinality (count of elements in a set) is zero. Some axiomatic set theories ensure that the empty set exists by including an axiom of empty set, while in other ...

.
To avoid this consequence, we can modify the axiom of extensionality to apply only to nonempty sets, so that it reads:
:$\backslash forall\; A\; \backslash ,\; \backslash forall\; B\; \backslash ,\; (\; \backslash exists\; X\; \backslash ,\; (X\; \backslash in\; A)\; \backslash implies;\; href="/html/ALL/s/\backslash forall\_Y\_\backslash ,\_(Y\_\backslash in\_A\_\backslash iff\_Y\_\backslash in\_B)\_\backslash implies\_A\_=\_B\_.html"\; ;"title="\backslash forall\; Y\; \backslash ,\; (Y\; \backslash in\; A\; \backslash iff\; Y\; \backslash in\; B)\; \backslash implies\; A\; =\; B\; ">\backslash forall\; Y\; \backslash ,\; (Y\; \backslash in\; A\; \backslash iff\; Y\; \backslash in\; B)\; \backslash implies\; A\; =\; B$
That is:
:Given any set ''A'' and any set ''B'', ''if ''A'' is a nonempty set'' (that is, if there exists a member ''X'' of ''A''), ''then'' if ''A'' and ''B'' have precisely the same members, then they are equal.
Yet another alternative in untyped logic is to define $A$ itself to be the only element of $A$
whenever $A$ is an ur-element. While this approach can serve to preserve the axiom of extensionality, the axiom of regularity
In mathematics, the axiom of regularity (also known as the axiom of foundation) is an axiom of Zermelo–Fraenkel set theory that states that every non-empty set ''A'' contains an element that is disjoint from ''A''. In first-order logic, the ...

will need an adjustment instead.
See also

*Extensionality
In logic, extensionality, or extensional equality, refers to principles that judge objects to be equal if they have the same external properties. It stands in contrast to the concept of intensionality, which is concerned with whether the internal d ...

for a general overview.
References

*Paul Halmos
Paul Richard Halmos ( hu, Halmos Pál; March 3, 1916 – October 2, 2006) was a Hungarian-born American mathematician and statistician who made fundamental advances in the areas of mathematical logic, probability theory, statistics, operator ...

, ''Naive set theory''. Princeton, NJ: D. Van Nostrand Company, 1960. Reprinted by Springer-Verlag, New York, 1974. (Springer-Verlag edition).
* Jech, Thomas, 2003. ''Set Theory: The Third Millennium Edition, Revised and Expanded''. Springer. .
* Kunen, Kenneth, 1980. ''Set Theory: An Introduction to Independence Proofs''. Elsevier. .
{{Set theory
Axioms of set theory
Urelements