TITLE: Precise meaning of "extension"?
QUESTION [9 upvotes]: Halmos's Naive Set Theory explains the "extensionality" in "axiom of extensionality" as:

Every set is determined by its extension.

and that's it. What is a set's extension, then? Intuitively it seems to me that an (or maybe "the", who knows?) extension of $X$ is a set that contains all of $X$'s elements, and possibly some other ones too. Am I right? If not, could you please explain what an extension of a set is?

REPLY [2 votes]: Let $M$ denote a set equipped with a binary relation $R$. Then given $p \in M$, there is a corresponding predicate $$E_p : M \rightarrow \{\mathrm{true},\mathrm{false}\}$$
defined as follows.
$$E_p(x) \iff R(x,p)$$
We call $E_p$ the extension of $p$. The Axiom of Extensionality just says that every $p \in M$ is determined by its extension $E_p$. More precisely, $M$ satisfies the the axiom of extensionality iff for all $p,q \in M,$ we have that if $E_p = E_q$, then $p=q$.
Thinking of the elements of $M$ as being "sets" in some sense or another and $R$ as denoting membership, the definition of $E_p$ just says that $E_p(x)$ is true iff $x$ is an element of $p$, and false otherwise. Hence in this language, the Axiom of Extensionality says that a set is determined by its elements.
Of course, $M$ doesn't have to be a model of ZFC for this to make sense, and the elements of $M$ don't have to be set-like. Thinking of $(M,R)$ as a digraph, extensionality just says that if $p$ and $q$ have precisely the same vertexes immediately below them, then they're equal.