Set Equality and Extensionality

When are two sets the same set? This question sounds trivial until you try to answer it. Consider sets built in different ways — say, the set of even prime numbers. Compare it with the set containing only the number 2. Both descriptions pick out exactly one object. Intuition insists they are "the same set." But nothing in the mere idea of a "collection" explains why. Specifically, why should how you describe a set be irrelevant to what the set is? The Axiom of Extensionality is the foundational commitment that settles this. It declares that a set is completely determined by its members, nothing more and nothing less. This matters because set theory is meant to serve as a universal foundation for mathematics. A foundation needs an unambiguous criterion of identity. Without extensionality, "{1,2}\{1,2\}" and "{2,1}\{2,1\}" could in principle denote different objects. Arithmetic built from sets could depend on bookkeeping choices. The very notion of a mathematical object would become unstable. Extensionality removes this ambiguity by fiat: content, not description, is destiny. The technique that flows directly from this axiom is the mutual inclusion method of proving A=BA = B. Show every element of AA lies in BB. Then show every element of BB lies in AA. This converts an equality of sets — a single global claim — into two separate claims. Each claim concerns arbitrary elements, provable by direct, element-by-element reasoning. It is the workhorse method behind essentially every set identity you will ever prove. This article gives the precise statement of the Axiom of Extensionality. It proves the mutual-inclusion criterion for set equality as a direct consequence. It works through two genuinely asymmetric examples. It also examines what fails if extensionality is weakened. It builds directly on Subsets and Set Inclusion. It sets up the machinery needed for Union and Intersection. It also prepares for the general craft of Proving Set Identities.

Key takeaways
  • The Axiom of Extensionality says: two sets are equal exactly when they have the same elements.
  • Sets are identified purely by membership — order, repetition, and method of description are irrelevant.
  • The mutual inclusion technique proves A=BA = B by proving A⊆BA \subseteq B and B⊆AB \subseteq A separately.
  • This converts a "for all sets" statement into two "for all elements" statements, each amenable to direct proof.
  • Extensionality is what makes {x:φ(x)}\{x : \varphi(x)\} well-defined: any two properties with the same extension yield the same set.
  • Key idea: a set has no identity beyond its membership, so proving equality is proving mutual membership.

Where this lives today

Extensionality and the mutual-inclusion method are not museum pieces; they are load-bearing walls in modern mathematics and computing.

Mathematical logic and foundations. Every axiomatic development of mathematics from set theory — real numbers as Dedekind cuts or Cauchy sequence classes, ordered pairs as Kuratowski pairs, functions as sets of ordered pairs — implicitly relies on extensionality to guarantee that these constructions, once their membership conditions match, really are the same mathematical object regardless of construction route.

Computer science and formal verification. Proof assistants such as Coq, Agda, Lean, and Isabelle must decide when two data structures (finite sets, in particular) count as equal; "set extensionality" principles in these systems mirror exactly the axiom here, and mutual-inclusion is the standard tactic (often literally called `Set.Subset.antisymm` or similar) used to discharge equality goals about sets, finsets, and related structures.

Abstract algebra and topology. Verifying that two subgroups, subspaces, ideals, or topologies coincide is routinely done by mutual inclusion: show every element/generator of one lies in the other and vice versa. This is the direct generalization of the technique introduced here to richer algebraic and topological settings.

Database theory and semantics of programming languages. Relational databases model tables as sets of tuples; query equivalence (two SQL queries always returning the "same" result set) is formally a set-equality question resolved by mutual inclusion of the resulting tuple-sets, up to the semantics chosen for duplicates.

Combinatorics and discrete mathematics. Bijective and double-counting proofs of identities between finite sets frequently reduce, at the bookkeeping level, to showing two finite sets are equal (or in bijection) via explicit mutual inclusion or explicit element correspondence, connecting directly forward to the identity-proving toolbox developed in Proving Set Identities and to the operations studied in Union and Intersection.

Ask the tutor: If A⊆BA \subseteq B but I can't find an element of BB that's missing from AA, does that already prove A=BA = B, or do I still need a general argument for B⊆AB \subseteq A?

DefinitionThe Axiom of Extensionality and Set Equality

Axiom of Extensionality. For all sets AA and BB,

A=B  ⟺  ∀x (x∈A↔x∈B).A = B \iff \forall x\,(x \in A \leftrightarrow x \in B).

In words: two sets are equal if and only if they have exactly the same elements.

Equivalent formulation via inclusion. Recall that A⊆BA \subseteq B means ∀x (x∈A→x∈B)\forall x\,(x \in A \rightarrow x \in B). The biconditional x∈A↔x∈Bx \in A \leftrightarrow x \in B (for all xx) is logically equivalent to the conjunction of x∈A→x∈Bx \in A \rightarrow x \in B and x∈B→x∈Ax \in B \rightarrow x \in A (for all xx), i.e. to A⊆B∧B⊆AA \subseteq B \wedge B \subseteq A. Hence Extensionality is equivalent to:

A=B  ⟺  (A⊆B and B⊆A).A = B \iff (A \subseteq B \text{ and } B \subseteq A).

This equivalence is the formal basis of the mutual inclusion method, proved as a theorem below.

Intuition

Think of a set as a bag whose only property is which items are in it — not the color of the bag, not the order the items were dropped in, not how many times you happened to mention an item while describing it. Extensionality is the axiom that makes this metaphor precise and forces it to be the whole story: nothing about a set is extra baggage beyond its membership. Two bags with the same contents are declared, by fiat, to be the same bag. This has an immediate practical consequence. Suppose you want to show A=BA=B but AA and BB are given by different-looking definitions — say A={n∈Z:n2<10}A = \{n \in \mathbb{Z} : n^2 < 10\} and B={−3,−2,−1,0,1,2,3}B = \{-3,-2,-1,0,1,2,3\}. You cannot directly "see" that these are equal; you must unfold the definition of equality. Extensionality tells you that unfolding is precisely: check that every element satisfying one description satisfies the other, in both directions. This double-containment strategy is what turns an abstract, seemingly holistic claim ("these two sets, as wholes, coincide") into two very concrete, local claims ("take an arbitrary element of AA..." and "take an arbitrary element of BB..."). A useful picture is two overlapping regions in a Venn-diagram-like universe, where equality means the regions are literally the same region — no sliver of one sticking out beyond the other in either direction.

Figure
Mutual inclusion as two overlapping containments forming exact equality
A A = B same elements A ⊆ B B ⊆ A overlap forces A = B

The right side of the figure is the proof strategy itself: two separate inclusion arrows, pointing in opposite directions, whose conjunction — not either one alone — pins down full equality.

TheoremMutual Inclusion Criterion for Set Equality

Let AA and BB be sets. Then

A=B  ⟺  A⊆B and B⊆A.A = B \iff A \subseteq B \text{ and } B \subseteq A.
Proof

We assume the Axiom of Extensionality: A=B  ⟺  ∀x (x∈A↔x∈B)A = B \iff \forall x\,(x \in A \leftrightarrow x \in B). We assume the definition of subset: A⊆B  ⟺  ∀x (x∈A→x∈B)A \subseteq B \iff \forall x\,(x \in A \rightarrow x \in B). We prove the biconditional in both directions. The technique throughout is direct proof plus elementary predicate logic (unfolding quantifiers and biconditionals).

(⇒\Rightarrow) Suppose A=BA = B. By Extensionality, ∀x (x∈A↔x∈B)\forall x\,(x \in A \leftrightarrow x \in B). Claim A⊆BA \subseteq B: let xx be arbitrary with x∈Ax \in A. Since ∀x (x∈A↔x∈B)\forall x\,(x\in A \leftrightarrow x \in B) holds, in particular x∈A↔x∈Bx \in A \leftrightarrow x \in B, and from x∈Ax \in A together with the left-to-right direction of this biconditional we get x∈Bx \in B. Since xx was arbitrary, ∀x (x∈A→x∈B)\forall x\,(x \in A \rightarrow x \in B), i.e. A⊆BA \subseteq B. Claim B⊆AB \subseteq A: let xx be arbitrary with x∈Bx \in B. Again x∈A↔x∈Bx \in A \leftrightarrow x \in B holds for this xx, and from x∈Bx \in B together with the right-to-left direction of the biconditional we get x∈Ax \in A. Since xx was arbitrary, B⊆AB \subseteq A. Hence A⊆BA \subseteq B and B⊆AB \subseteq A, as required.

(⇐\Leftarrow) Suppose A⊆BA \subseteq B and B⊆AB \subseteq A. We must show ∀x (x∈A↔x∈B)\forall x\,(x \in A \leftrightarrow x \in B), and then invoke Extensionality to conclude A=BA = B. Let xx be arbitrary.

  • If x∈Ax \in A, then since A⊆BA \subseteq B (i.e. ∀x (x∈A→x∈B)\forall x\,(x \in A \rightarrow x \in B)), instantiating at this xx gives x∈Bx \in B. So x∈A→x∈Bx \in A \rightarrow x \in B.
  • If x∈Bx \in B, then since B⊆AB \subseteq A (i.e. ∀x (x∈B→x∈A)\forall x\,(x \in B \rightarrow x \in A)), instantiating at this xx gives x∈Ax \in A. So x∈B→x∈Ax \in B \rightarrow x \in A.

Combining the two implications, x∈A↔x∈Bx \in A \leftrightarrow x \in B. Since xx was arbitrary, ∀x (x∈A↔x∈B)\forall x\,(x \in A \leftrightarrow x \in B). By the Axiom of Extensionality, this universally quantified biconditional is exactly the condition for A=BA = B. Hence A=BA = B. Both directions are established, so A=B  ⟺  A⊆B and B⊆AA = B \iff A \subseteq B \text{ and } B \subseteq A. ■\blacksquare

∎
CorollaryReflexivity, Symmetry, Antisymmetry of ⊆\subseteq, and the Practical Proof Template

1. Reflexivity of == via ⊆\subseteq: For any set AA, A⊆AA \subseteq A (immediate from the definition of ⊆\subseteq, taking the hypothesis x∈Ax\in A and concluding x∈Ax \in A by identity), so by the theorem A=AA = A. 2. Antisymmetry of ⊆\subseteq: The theorem, read left to right, says precisely that ⊆\subseteq is antisymmetric: A⊆B∧B⊆A  ⟹  A=BA \subseteq B \wedge B \subseteq A \implies A = B. This is the standard order-theoretic fact that ⊆\subseteq makes the collection of sets into a partial order. 3. Proof template: To prove A=BA = B for arbitrary sets A,BA, B, it suffices to give two sub-proofs: (a) an arbitrary x∈Ax \in A implies x∈Bx \in B; (b) an arbitrary x∈Bx \in B implies x∈Ax \in A. This is the template used in every worked example below and throughout Proving Set Identities.

Proof

(1) By the definition of ⊆\subseteq, A⊆AA \subseteq A holds iff ∀x(x∈A→x∈A)\forall x (x \in A \to x \in A), and x∈A→x∈Ax \in A \to x \in A is an instance of the logical law P→PP \to P, true for every proposition PP. Hence A⊆AA \subseteq A holds for every set AA; taking B:=AB := A in the Mutual Inclusion Criterion gives A=AA = A. (2) This is exactly the left-to-right direction of the biconditional already proved in the Mutual Inclusion Criterion, restated as an inference rather than an equivalence; no further argument is needed beyond citing that half of the proof. (3) This restates the right-to-left direction of the Mutual Inclusion Criterion as a proof strategy: to establish the hypothesis of that direction (A⊆BA\subseteq B and B⊆AB\subseteq A), one proves each inclusion by the direct-proof method for universally quantified conditionals, i.e. by fixing an arbitrary element and tracing the implication. ■\blacksquare

∎

Worked examples

Example 1 (arithmetic sets defined by different predicates). Let

A={n∈Z:n is divisible by 6},B={n∈Z:n is divisible by 2 and by 3}.A = \{ n \in \mathbb{Z} : n \text{ is divisible by } 6 \}, \qquad B = \{ n \in \mathbb{Z} : n \text{ is divisible by } 2 \text{ and by } 3 \}.

These look like different rules, so equality is not obvious by inspection. We prove A=BA = B by mutual inclusion. Step 1: A⊆BA \subseteq B. Let n∈An \in A be arbitrary. Then 6∣n6 \mid n, so n=6kn = 6k for some integer kk. Since 6k=2(3k)6k = 2(3k), we have 2∣n2 \mid n; since 6k=3(2k)6k = 3(2k), we have 3∣n3 \mid n. Hence nn is divisible by both 22 and 33, so n∈Bn \in B. As nn was arbitrary, A⊆BA \subseteq B. Step 2: B⊆AB \subseteq A. Let n∈Bn \in B be arbitrary. Then 2∣n2 \mid n and 3∣n3 \mid n. Since gcd⁡(2,3)=1\gcd(2,3) = 1, and 22 and 33 are both divisors of nn with gcd⁡(2,3)=1\gcd(2,3)=1, it follows that their product 2⋅3=62\cdot 3 = 6 divides nn (this is the standard fact that if two coprime integers each divide nn, their product divides nn; concretely, n=2mn = 2m for some integer mm, and since 3∣n=2m3 \mid n = 2m with gcd⁡(3,2)=1\gcd(3,2)=1, we get 3∣m3 \mid m, so m=3jm = 3j for some integer jj, giving n=6jn = 6j). Hence 6∣n6 \mid n, so n∈An \in A. As nn was arbitrary, B⊆AB \subseteq A. By Steps 1 and 2 and the Mutual Inclusion Criterion, A=BA = B. Notice the asymmetry: Step 1 was a two-line direct computation, while Step 2 genuinely used the coprimality of 22 and 33 — had we instead compared "divisible by 44" with "divisible by 22 and by 66," the corresponding "Step 2" argument would fail, since 22 and 66 are not coprime (n=6n=6 itself is divisible by 2 and 6 but not 4), illustrating that the two inclusion proofs really are logically independent tasks, not mirror images of each other.

Example 2 (a set-builder identity with an asymmetric structure). Let U={1,2,3,4,5,6,7,8,9,10}U = \{1,2,3,4,5,6,7,8,9,10\} and define

A={x∈U:x is even and x≤8},B={2,4,6,8}.A = \{ x \in U : x \text{ is even and } x \le 8 \}, \qquad B = \{2,4,6,8\}.

We prove A=BA = B. Step 1: A⊆BA \subseteq B. Let x∈Ax \in A be arbitrary. By definition of AA, x∈Ux \in U, xx is even, and x≤8x \le 8. Since x∈U={1,…,10}x \in U = \{1,\dots,10\} and xx is even, x∈{2,4,6,8,10}x \in \{2,4,6,8,10\}. Combined with x≤8x \le 8, the possibility x=10x = 10 is excluded, so x∈{2,4,6,8}=Bx \in \{2,4,6,8\} = B. As xx was arbitrary, A⊆BA \subseteq B. Step 2: B⊆AB \subseteq A. Let x∈Bx \in B be arbitrary, so x∈{2,4,6,8}x \in \{2,4,6,8\}; we check each of the four cases directly (a finite case analysis is a legitimate direct proof when the domain is finite and small). In each case x∈{2,4,6,8}⊆{1,…,10}=Ux \in \{2,4,6,8\} \subseteq \{1,\dots,10\} = U, xx is even, and x≤8x \le 8. Hence in every case x∈Ax \in A. As xx was arbitrary, B⊆AB \subseteq A. By the Mutual Inclusion Criterion, A=BA = B. Here the asymmetry is structural rather than computational: Step 1 required unpacking a compound condition ("even and ≤8\le 8" restricted to UU) into an explicit list and then trimming it, while Step 2 was a finite verification over an explicitly given four-element set — genuinely different proof shapes, not a copy-paste of one direction into the other.

CounterexampleWhy we need both directions of inclusion — dropping the second inclusion breaks equality

The Mutual Inclusion Criterion has two hypotheses joined by "and": A⊆BA \subseteq B and B⊆AB \subseteq A. Suppose we (incorrectly) tried to conclude A=BA = B from A⊆BA \subseteq B alone, discarding the requirement B⊆AB \subseteq A. Take

A={1,2},B={1,2,3}.A = \{1, 2\}, \qquad B = \{1, 2, 3\}.

Certainly A⊆BA \subseteq B: every element of AA (namely 11 and 22) is an element of BB. If one-directional inclusion sufficed for equality, we would be forced to conclude A=BA = B. But by Extensionality, A=BA = B would require ∀x (x∈A↔x∈B)\forall x\,(x \in A \leftrightarrow x \in B). Test x=3x = 3: we have 3∈B3 \in B (true) but 3∈A3 \in A is false (the elements of AA are exactly 11 and 22, and 33 is neither). So the biconditional fails at x=3x=3, hence ∀x(x∈A↔x∈B)\forall x (x\in A \leftrightarrow x \in B) is false, hence by Extensionality A≠BA \ne B. This confirms concretely that A⊆BA \subseteq B can hold while A≠BA \ne B: here A⊊BA \subsetneq B is a strict subset relation. The missing hypothesis B⊆AB \subseteq A is not a redundant technicality — it is precisely what rules out BB having "extra" elements beyond AA, which is exactly what happened here with the extra element 33. Both inclusions are jointly necessary; neither alone is sufficient, and this example shows the failure occurs already in the smallest possible way — a single extra element.

Scope, edge cases & common traps

SituationWhat to checkCommon pitfall
Proving A=BA = B for infinite or abstractly defined setsBoth directions, each via an arbitrary-element argumentProving only A⊆BA \subseteq B and declaring victory
Sets given by different set-builder predicatesUnfold both predicates explicitly before comparingAssuming "looks similar" implies "is equal"
Sets with repeated listing, e.g. {1,1,2}\{1,1,2\} vs. {1,2}\{1,2\}Extensionality only cares about membership, not multiplicityTreating {1,1,2}\{1,1,2\} as "different" from {1,2}\{1,2\}
Sets with different orderings, e.g. {a,b}\{a,b\} vs. {b,a}\{b,a\}Membership sets are identical, so the sets are equalThinking order matters (it matters for tuples, not sets)
Empty set uniquenessVacuous inclusion ∅⊆A\varnothing \subseteq A holds for all AAForgetting that ∅⊆∅\varnothing \subseteq \varnothing needs no case check
Proving A≠BA \ne BExhibit one xx with x∈A↔x∈Bx \in A \leftrightarrow x \in B falseTrying to prove non-equality via one-directional subset failure alone without naming a witness

The mathematician behind it

Origins · 1 minErnst Zermelo and how this was discovered
EZ
Ernst Zermelo
1871–1953 · Foundational axiomatic set theory, Göttingen and Zürich

Ernst Zermelo was a German mathematician who, in the early 1900s, undertook the project of placing Georg Cantor's set theory on a rigorous axiomatic footing after Bertrand Russell's paradox exposed contradictions in naive comprehension. Zermelo's 1908 axiom system — later refined by Abraham Fraenkel and Thoralf Skolem into what is now called Zermelo–Fraenkel (ZF) set theory — included an axiom of extensionality essentially in the form given here, asserting that sets with the same elements are identical. This single axiom fixed, once and for all, the criterion of identity for the objects the rest of the theory would build: numbers, functions, relations, and eventually all of ordinary mathematics as encoded within set theory.

History
- 1874 — Georg Cantor begins developing set theory informally, treating sets as determined by their elements without a formal axiom.
- 1901 — Bertrand Russell discovers Russell's Paradox, showing unrestricted set formation is inconsistent and motivating an axiomatic approach.
- 1908 — Ernst Zermelo publishes his axiom system for set theory, including an explicit axiom of extensionality.
- 1922 — Abraham Fraenkel and Thoralf Skolem independently strengthen and refine Zermelo's axioms, yielding Zermelo–Fraenkel (ZF) set theory.
- 1930s–present — Extensionality becomes a standard, uncontroversial axiom retained across essentially all mainstream set-theoretic foundations, including ZFC and its variants.
Is the Axiom of Extensionality provable from other axioms, or is it truly primitive?

In standard formulations of ZF(C) set theory, Extensionality is taken as a primitive axiom, not derived from the others. It cannot be proved from axioms like Pairing, Union, or Power Set, because those axioms only assert the existence of certain sets; none of them, by itself, forces two sets with identical elements to be literally the same object. Some alternative foundations (e.g. certain type-theoretic or non-well-founded set theories) modify or replace extensionality, which shows it is an independent, non-redundant commitment. It is universally adopted because rejecting it would make "the set with elements a,ba,b" ambiguous, undermining the entire enterprise of using sets as a uniform foundation.

Does extensionality mean sets can never have "extra structure" beyond their elements?

Yes, and this is exactly the point. A set, as a mathematical object, carries no information beyond its membership. Two definitions, however differently phrased, that pick out the same collection of elements name the same set. Ordered pairs, sequences, and multisets are different mathematical objects precisely because they need to encode order or multiplicity; they are built (via encodings like Kuratowski's (a,b)={{a},{a,b}}(a,b) = \{\{a\},\{a,b\}\}) so that this extra information is recoverable from the underlying plain-set membership structure, without weakening extensionality itself.

How is this different from proving A ⊆ B alone?

Proving A⊆BA \subseteq B only shows every element of AA is in BB; it leaves open whether BB has additional elements not in AA. Set equality is a strictly stronger claim requiring no asymmetry in either direction. The counterexample in this article (A={1,2}A=\{1,2\}, B={1,2,3}B=\{1,2,3\}) shows A⊆BA \subseteq B can hold with A≠BA \ne B. Only when you also establish B⊆AB \subseteq A — ruling out any such extra elements — can you invoke the Mutual Inclusion Criterion and conclude full equality.

Can mutual inclusion fail to be the easiest method for some equalities?

Sometimes a direct algebraic manipulation of set-builder conditions (using logical equivalences on the defining predicates) is faster than splitting into two separate inclusion proofs, especially for equalities like De Morgan's laws for sets. But mutual inclusion is the most universally applicable method: it always works, requires no cleverness beyond fixing an arbitrary element, and is the default fallback whenever a slicker algebraic identity isn't immediately visible. Many textbooks (and this one) teach mutual inclusion first precisely because it is algorithm-like and rarely gets stuck.

Does extensionality apply to proper classes as well as sets?

In systems like NBG or MK class theory that distinguish sets from proper classes (collections too large to be sets, such as "the collection of all sets"), an analogous extensionality principle is typically adopted for classes: two classes are equal iff they have the same members. Within pure ZF(C), which does not formally include proper classes as objects, extensionality is stated only for sets, but informal class-builder notation used in practice (e.g. "the class of all groups") is generally understood to obey the same membership-determines-identity principle.

Why does the empty set's uniqueness follow from extensionality?

Suppose ∅1\varnothing_1 and ∅2\varnothing_2 are both sets with no elements. Then vacuously, ∀x(x∈∅1→x∈∅2)\forall x (x \in \varnothing_1 \to x \in \varnothing_2) holds, because the hypothesis x∈∅1x \in \varnothing_1 is never true, making each conditional true vacuously; hence ∅1⊆∅2\varnothing_1 \subseteq \varnothing_2. Symmetrically ∅2⊆∅1\varnothing_2 \subseteq \varnothing_1. By the Mutual Inclusion Criterion (itself a consequence of Extensionality), ∅1=∅2\varnothing_1 = \varnothing_2. This is why we may speak of "the" empty set, a fact used constantly alongside Subsets and Set Inclusion.

Is mutual inclusion the only way to prove a set equality?

No — other valid methods include direct manipulation of set-builder predicates using logical equivalences (rewriting "x∈Ax \in A" as an equivalent logical formula and matching it to "x∈Bx \in B" in one pass), using previously established set identities as lemmas (as will be developed for unions and intersections in Union and Intersection), or exhibiting an explicit bijection in contexts about cardinality rather than literal set equality. Mutual inclusion remains the most fundamental and universally taught method because it reduces directly to the axiom of extensionality without any extra machinery.

Before this

Where this leads