# 6.1 Definable Sets and Functions

Definability is one of the central ideas of model theory. Once a first order language and a structure have been fixed, formulas can be used to describe subsets of the domain, relations on the domain, and functions between definable sets. In this way, syntax gives rise to geometry inside a structure: a formula becomes a description of a set of points satisfying a condition.

In this section, we work with a first order language $L$ and an $L$-structure $\mathcal M$. The domain of $\mathcal M$ will be denoted by $M$. Variables range over elements of $M$, and formulas are interpreted in $\mathcal M$ using the satisfaction relation developed earlier.

### Definable Sets

Let $\varphi(x)$ be an $L$-formula with one free variable $x$. The formula $\varphi(x)$ defines a subset of $M$ by collecting exactly those elements of $M$ that satisfy the formula in $\mathcal M$.

### Definition 6.1 (Definable Subset)

Let $\mathcal M$ be an $L$-structure with domain $M$. A subset $X \subseteq M$ is definable in $\mathcal M$ if there is an $L$-formula $\varphi(x)$ with one free variable such that:
$$
X = \{a \in M : \mathcal M \models \varphi(a)\}.
$$

In this case, we say that $\varphi(x)$ defines $X$ in $\mathcal M$.

The notation $\mathcal M \models \varphi(a)$ means that the formula $\varphi(x)$ is true in $\mathcal M$ when the variable $x$ is assigned the value $a$. More formally, if $s$ is an assignment with $s(x)=a$, then:
$$
\mathcal M \models \varphi[s].
$$

The set defined by $\varphi(x)$ is often denoted:
$$
\varphi(\mathcal M) = \{a \in M : \mathcal M \models \varphi(a)\}.
$$

This notation emphasizes that the same formula may define different sets in different structures.

### Example 6.2

Consider the structure:
$$
\mathcal N = (\mathbb N; 0, 1, +, \times, <).
$$

The formula:
$$
\varphi(x) := \exists y\,(x = y+y)
$$
defines the set of even natural numbers.

Indeed:
$$
\varphi(\mathcal N) = \{x \in \mathbb N : x \text{ is even}\}.
$$

The formula says that $x$ is the sum of some natural number with itself. Since $y+y=2y$, this is exactly the condition that $x$ is divisible by $2$.

### Example 6.3

In the ordered field:
$$
\mathcal R = (\mathbb R; 0, 1, +, \times, <),
$$
the formula:
$$
\psi(x) := x > 0
$$
defines the positive real numbers:
$$
\psi(\mathcal R) = \{a \in \mathbb R : a > 0\}.
$$

The formula:
$$
\theta(x) := \exists y\,(y \times y = x)
$$
defines the set of nonnegative real numbers:
$$
\theta(\mathcal R) = \{a \in \mathbb R : a \geq 0\}.
$$

This is because a real number is a square of another real number exactly when it is nonnegative.

### Definable Relations

A formula may have more than one free variable. If $\varphi(x_1,\dots,x_n)$ is a formula with free variables among $x_1,\dots,x_n$, then it defines a subset of $M^n$.

### Definition 6.4 (Definable Relation)

Let $\mathcal M$ be an $L$-structure with domain $M$. An $n$-ary relation $R \subseteq M^n$ is definable in $\mathcal M$ if there is an $L$-formula $\varphi(x_1,\dots,x_n)$ such that:
$$
R = \{(a_1,\dots,a_n) \in M^n : \mathcal M \models \varphi(a_1,\dots,a_n)\}.
$$

Thus definable subsets of $M$ are the special case $n=1$, and definable relations are the general case.

### Example 6.5

In the structure:
$$
(\mathbb N; 0, 1, +, \times, <),
$$
the formula:
$$
\varphi(x,y) := \exists z\,(y = x+z)
$$
defines the relation:
$$
\{(x,y) \in \mathbb N^2 : x \leq y\}.
$$

Indeed, $x \leq y$ in $\mathbb N$ exactly when there exists $z \in \mathbb N$ such that $y=x+z$.

This example shows that a relation can be definable even if its symbol is not included as a primitive symbol of the language, provided that it can be expressed using the available symbols.

### Definability With Parameters

Sometimes we want to define a set using particular elements of the structure as fixed constants. This leads to definability with parameters.

### Definition 6.6 (Definability With Parameters)

Let $\mathcal M$ be an $L$-structure with domain $M$, and let $A \subseteq M$. A subset $X \subseteq M^n$ is definable over $A$, or $A$-definable, if there is an $L$-formula:
$$
\varphi(x_1,\dots,x_n,y_1,\dots,y_m)
$$
and parameters $a_1,\dots,a_m \in A$ such that:
$$
X = \{(b_1,\dots,b_n) \in M^n : \mathcal M \models \varphi(b_1,\dots,b_n,a_1,\dots,a_m)\}.
$$

If $A=\emptyset$, then $X$ is said to be definable without parameters.

A definable set without parameters is sometimes called $\emptyset$-definable.

### Example 6.7

In the structure:
$$
(\mathbb R; 0, 1, +, \times, <),
$$
the interval:
$$
(0,1)
$$
is definable without parameters by:
$$
0 < x \land x < 1.
$$

The interval:
$$
(a,b)
$$
for arbitrary real numbers $a,b \in \mathbb R$ is definable with parameters $a$ and $b$ by:
$$
a < x \land x < b.
$$

Unless $a$ and $b$ are already named by terms of the language, the formula defining $(a,b)$ uses parameters.

### Remark 6.8

There is a useful way to think about definability with parameters. If $A \subseteq M$, then one can expand the language $L$ by adding a new constant symbol $c_a$ for each $a \in A$, and interpret $c_a$ as $a$ in $\mathcal M$. In that expanded language, $A$-definable sets become definable without parameters.

This does not change the underlying structure $M$, but it changes the language available for describing subsets of $M$.

### Boolean Closure of Definable Sets

Definable sets are closed under the usual Boolean operations. This follows from the fact that formulas are closed under logical connectives.

### Lemma 6.9 (Closure Under Complement)

Let $X \subseteq M^n$ be definable in $\mathcal M$. Then $M^n \setminus X$ is definable in $\mathcal M$.

Proof

Since $X$ is definable, there is a formula $\varphi(x_1,\dots,x_n)$ such that:
$$
X = \{a \in M^n : \mathcal M \models \varphi(a)\}.
$$

Consider the formula:
$$
¬\varphi(x_1,\dots,x_n).
$$

For any tuple $a \in M^n$, we have:
$$
\mathcal M \models ¬\varphi(a)
$$
if and only if:
$$
\mathcal M \not\models \varphi(a).
$$

This is true if and only if $a \notin X$. Hence:
$$
M^n \setminus X = \{a \in M^n : \mathcal M \models ¬\varphi(a)\}.
$$

Therefore $M^n \setminus X$ is definable.

### Lemma 6.10 (Closure Under Intersection)

Let $X,Y \subseteq M^n$ be definable in $\mathcal M$. Then $X \cap Y$ is definable in $\mathcal M$.

Proof

Since $X$ and $Y$ are definable, there are formulas $\varphi(x_1,\dots,x_n)$ and $\psi(x_1,\dots,x_n)$ such that:
$$
X = \{a \in M^n : \mathcal M \models \varphi(a)\}
$$
and:
$$
Y = \{a \in M^n : \mathcal M \models \psi(a)\}.
$$

Consider the formula:
$$
\varphi(x_1,\dots,x_n) \land \psi(x_1,\dots,x_n).
$$

For any $a \in M^n$, we have:
$$
\mathcal M \models \varphi(a) \land \psi(a)
$$
if and only if:
$$
\mathcal M \models \varphi(a)
$$
and:
$$
\mathcal M \models \psi(a).
$$

This is equivalent to saying:
$$
a \in X
\quad \text{and} \quad
a \in Y.
$$

Thus:
$$
X \cap Y = \{a \in M^n : \mathcal M \models \varphi(a) \land \psi(a)\}.
$$

Therefore $X \cap Y$ is definable.

### Lemma 6.11 (Closure Under Union)

Let $X,Y \subseteq M^n$ be definable in $\mathcal M$. Then $X \cup Y$ is definable in $\mathcal M$.

Proof

Choose formulas $\varphi(x_1,\dots,x_n)$ and $\psi(x_1,\dots,x_n)$ defining $X$ and $Y$, respectively.

Consider:
$$
\varphi(x_1,\dots,x_n) \lor \psi(x_1,\dots,x_n).
$$

For any $a \in M^n$, the formula is true exactly when $\varphi(a)$ is true or $\psi(a)$ is true. This is exactly the condition that $a \in X$ or $a \in Y$.

Therefore:
$$
X \cup Y = \{a \in M^n : \mathcal M \models \varphi(a) \lor \psi(a)\}.
$$

Hence $X \cup Y$ is definable.

### Lemma 6.12 (Closure Under Difference)

Let $X,Y \subseteq M^n$ be definable in $\mathcal M$. Then $X \setminus Y$ is definable in $\mathcal M$.

Proof

Choose formulas $\varphi(x_1,\dots,x_n)$ and $\psi(x_1,\dots,x_n)$ defining $X$ and $Y$.

The difference $X \setminus Y$ consists of those tuples that belong to $X$ and do not belong to $Y$. Therefore it is defined by:
$$
\varphi(x_1,\dots,x_n) \land ¬\psi(x_1,\dots,x_n).
$$

Indeed, for any $a \in M^n$:
$$
\mathcal M \models \varphi(a) \land ¬\psi(a)
$$
if and only if:
$$
a \in X
\quad \text{and} \quad
a \notin Y.
$$

Thus $X \setminus Y$ is definable.

### Projection and Existential Quantification

Definable sets are also closed under projection. This is the semantic counterpart of existential quantification.

### Definition 6.13 (Projection)

Let $X \subseteq M^{n+1}$. The projection of $X$ onto the first $n$ coordinates is:
$$
\pi(X) = \{(a_1,\dots,a_n) \in M^n : \exists b \in M,\ (a_1,\dots,a_n,b) \in X\}.
$$

Projection forgets one coordinate while remembering whether there exists a value of that coordinate making the tuple belong to $X$.

### Lemma 6.14 (Closure Under Projection)

Let $X \subseteq M^{n+1}$ be definable in $\mathcal M$. Then its projection $\pi(X) \subseteq M^n$ is definable in $\mathcal M$.

Proof

Since $X$ is definable, there is a formula:
$$
\varphi(x_1,\dots,x_n,y)
$$
such that:
$$
X = \{(a_1,\dots,a_n,b) \in M^{n+1} : \mathcal M \models \varphi(a_1,\dots,a_n,b)\}.
$$

We claim that $\pi(X)$ is defined by:
$$
\exists y\,\varphi(x_1,\dots,x_n,y).
$$

Let $a=(a_1,\dots,a_n) \in M^n$. Then:
$$
a \in \pi(X)
$$
if and only if there exists $b \in M$ such that:
$$
(a_1,\dots,a_n,b) \in X.
$$

By the definition of $X$, this is equivalent to:
$$
\mathcal M \models \varphi(a_1,\dots,a_n,b)
$$
for some $b \in M$.

By the semantics of the existential quantifier, this is equivalent to:
$$
\mathcal M \models \exists y\,\varphi(a_1,\dots,a_n,y).
$$

Therefore:
$$
\pi(X) = \{a \in M^n : \mathcal M \models \exists y\,\varphi(a,y)\}.
$$

Hence $\pi(X)$ is definable.

### Universal Quantification

Universal quantification can also be understood in terms of definable sets. If a formula $\varphi(x,y)$ defines a subset of $M^{n+1}$, then the formula:
$$
\forall y\,\varphi(x,y)
$$
defines the set of $x$ such that every possible $y$ satisfies the relation.

This can be reduced to complement and projection, since:
$$
\forall y\,\varphi(x,y)
$$
is equivalent to:
$$
¬\exists y\,¬\varphi(x,y).
$$

Thus closure under universal quantification follows from closure under complement and projection.

### Lemma 6.15 (Closure Under Universal Quantification)

Let $\varphi(x_1,\dots,x_n,y)$ be an $L$-formula. The set:
$$
\{a \in M^n : \mathcal M \models \forall y\,\varphi(a,y)\}
$$
is definable in $\mathcal M$.

Proof

The set is defined directly by the formula:
$$
\forall y\,\varphi(x_1,\dots,x_n,y)
$$

Equivalently, using negation and existential quantification, the same set is defined by:
$$
¬\exists y\,¬\varphi(x_1,\dots,x_n,y)
$$

For any $a \in M^n$, this formula holds exactly when there is no $b \in M$ such that $\varphi(a,b)$ fails, which is exactly the condition that $\varphi(a,b)$ holds for all $b \in M$.

### Definable Functions

A function is definable when its graph is definable. This is the standard model theoretic definition because first order formulas naturally define relations, and the graph of a function is a relation.

### Definition 6.16 (Definable Function)

Let $X \subseteq M^n$ and $Y \subseteq M^m$. A function:
$$
f : X \to Y
$$
is definable in $\mathcal M$ if its graph:
$$
\Gamma_f = \{(a,b) \in X \times Y : f(a)=b\}
$$
is a definable subset of $M^{n+m}$.

Equivalently, there is a formula:
$$
\varphi(x_1,\dots,x_n,y_1,\dots,y_m)
$$
such that:
$$
\mathcal M \models \varphi(a,b)
$$
if and only if:
$$
b=f(a).
$$
The formula defining the graph must determine a unique output for each input in $X$.

### Example 6.17

In the structure:
$$
(\mathbb N; 0, 1, +, \times),
$$
the function:
$$
f(x)=x+x
$$
is definable.

Its graph is:
$$
\Gamma_f = \{(x,y) \in \mathbb N^2 : y=x+x\}.
$$
This graph is defined by the formula:
$$
y = x+x.
$$
Therefore $f$ is definable.

### Example 6.18

In the ordered field:
$$
(\mathbb R; 0, 1, +, \times, <),
$$
the function:
$$
f(x)=x^2
$$
is definable by the formula:
$$
y = x \times x.
$$
The function:
$$
g(x)=|x|
$$
is also definable, because its graph is defined by:
$$
(x \geq 0 \land y=x) \lor (x<0 \land y=-x).
$$
Here $-x$ can be expressed as the unique element $z$ such that:
$$
x+z=0.
$$
If the language includes subtraction or unary minus, the formula can be written more directly.

### Lemma 6.19 (Composition of Definable Functions)

Let $f : X \to Y$ and $g : Y \to Z$ be definable functions in $\mathcal M$. Then:
$$
g \circ f : X \to Z
$$
is definable in $\mathcal M$.

Proof

Since $f$ is definable, its graph is defined by a formula:
$$
\varphi_f(x,y).
$$
Since $g$ is definable, its graph is defined by a formula:
$$
\varphi_g(y,z).
$$
The graph of $g \circ f$ consists of pairs $(x,z)$ such that there exists $y$ with:
$$
y=f(x)
$$
and:
$$
z=g(y).
$$
Therefore the graph of $g \circ f$ is defined by:
$$
\exists y\,(\varphi_f(x,y) \land \varphi_g(y,z)).
$$
For any $x$ and $z$, this formula holds exactly when there is an intermediate value $y$ such that $(x,y)$ lies in the graph of $f$ and $(y,z)$ lies in the graph of $g$. Since $f$ and $g$ are functions, this means precisely that:
$$
z=(g \circ f)(x).
$$
Hence $g \circ f$ is definable.

### Lemma 6.20 (Preimage of a Definable Set)

Let $f : X \to Y$ be a definable function, and let $D \subseteq Y$ be definable. Then:
$$
f^{-1}(D)
$$
is definable.

Proof

Let $\varphi_f(x,y)$ define the graph of $f$, and let $\psi(y)$ define $D$.

The preimage $f^{-1}(D)$ consists of those $x \in X$ for which $f(x) \in D$. This is expressed by:
$$
\exists y\,(\varphi_f(x,y) \land \psi(y)).
$$
For any $x$, this formula holds if and only if there exists $y$ such that $y=f(x)$ and $y \in D$. Since $f$ is a function, this is equivalent to $f(x) \in D$.

Therefore the preimage is definable.

### Lemma 6.21 (Image of a Definable Set)

Let $f : X \to Y$ be a definable function, and let $D \subseteq X$ be definable. Then:
$$
f(D)
$$
is definable.

Proof

Let $\varphi_f(x,y)$ define the graph of $f$, and let $\psi(x)$ define $D$.

The image $f(D)$ consists of all $y \in Y$ such that $y=f(x)$ for some $x \in D$. This is expressed by:
$$
\exists x\,(\psi(x) \land \varphi_f(x,y)).
$$
For any $y$, this formula holds exactly when there exists $x$ satisfying $\psi(x)$ and lying in the graph relation with $y$. This is precisely the condition that $y$ belongs to the image of $D$ under $f$.

Therefore $f(D)$ is definable.

### Definable Families

Definable families are collections of definable sets that vary with parameters. They are important because many constructions in model theory involve a single formula whose parameters define many different sets.

### Definition 6.22 (Definable Family)

Let $\varphi(x,y)$ be a formula, where $x$ may stand for a tuple of object variables and $y$ may stand for a tuple of parameter variables.

For each parameter tuple $b \in M^{|y|}$, define:
$$
X_b = \{a \in M^{|x|} : \mathcal M \models \varphi(a,b)\}.
$$
The collection:
$$
\{X_b : b \in M^{|y|}\}
$$
is called the definable family determined by $\varphi(x,y)$.

### Example 6.23

In the ordered field of real numbers, the formula:
$$
a < x \land x < b
$$
defines a family of open intervals:
$$
(a,b)
$$
as the parameters $a$ and $b$ vary over $\mathbb R$.

Thus one formula defines many subsets of $\mathbb R$, each obtained by choosing different parameter values.

### Definability and Automorphisms

Definable sets without parameters are preserved by automorphisms. This gives a useful test for non-definability.

### Definition 6.24 (Automorphism)

An automorphism of an $L$-structure $\mathcal M$ is a bijection:
$$
\sigma : M \to M
$$
that preserves the interpretations of all symbols of $L$.

This means that constants, functions, and relations are respected by $\sigma$.

For example, if $R$ is a binary relation symbol, then:
$$
\mathcal M \models R(a,b)
$$
if and only if:
$$
\mathcal M \models R(\sigma(a),\sigma(b)).
$$
### Lemma 6.25 (Parameter Free Definable Sets Are Automorphism Invariant)

Let $X \subseteq M^n$ be definable without parameters in $\mathcal M$. If $\sigma$ is an automorphism of $\mathcal M$, then:
$$
(a_1,\dots,a_n) \in X
$$
if and only if:
$$
(\sigma(a_1),\dots,\sigma(a_n)) \in X.
$$
Proof

Since $X$ is definable without parameters, there is a formula $\varphi(x_1,\dots,x_n)$ such that:
$$
X = \{a \in M^n : \mathcal M \models \varphi(a)\}.
$$
We prove by induction on formulas that automorphisms preserve truth of parameter free formulas. For atomic formulas, preservation follows from the definition of automorphism, since automorphisms preserve equality, relations, functions, and constants.

The Boolean connectives are preserved because truth of compound formulas is determined from truth of their immediate subformulas. For example, if truth of $\varphi(a)$ is preserved, then truth of $¬\varphi(a)$ is also preserved. Similarly, preservation for conjunction, disjunction, implication, and biconditional follows from the corresponding truth rules.

For quantifiers, suppose:
$$
\mathcal M \models \exists y\,\psi(a,y).
$$
Then there is $b \in M$ such that:
$$
\mathcal M \models \psi(a,b).
$$
By the induction hypothesis:
$$
\mathcal M \models \psi(\sigma(a),\sigma(b)).
$$
Hence:
$$
\mathcal M \models \exists y\,\psi(\sigma(a),y).
$$
The converse follows by applying the same argument to $\sigma^{-1}$, since an automorphism is a bijection whose inverse is also an automorphism.

Thus:
$$
\mathcal M \models \varphi(a)
$$
if and only if:
$$
\mathcal M \models \varphi(\sigma(a)).
$$
Therefore $X$ is invariant under $\sigma$.

### Example 6.26

Consider the pure equality structure:
$$
\mathcal M = (M; =)
$$
with no non-logical symbols besides equality, and suppose $M$ has at least two elements.

No singleton $\{a\}$ is definable without parameters.

Indeed, if $\{a\}$ were definable without parameters, it would be fixed by every automorphism of $\mathcal M$. But in the pure equality structure, every permutation of $M$ is an automorphism. If $b \neq a$, there is a permutation sending $a$ to $b$. Such a permutation does not preserve the set $\{a\}$. Hence $\{a\}$ is not definable without parameters.

However, $\{a\}$ is definable with parameter $a$ by the formula:
$$
x=a.
$$
### Definable Closure

Definable closure records which elements are uniquely determined by parameters.

### Definition 6.27 (Definable Closure)

Let $\mathcal M$ be an $L$-structure and let $A \subseteq M$. An element $b \in M$ belongs to the definable closure of $A$, written:
$$
b \in \operatorname{dcl}(A),
$$
if there is a formula $\varphi(x,\bar a)$ with parameters $\bar a$ from $A$ such that:
$$
\mathcal M \models \varphi(b,\bar a)
$$
and:
$$
\mathcal M \models \exists! x\,\varphi(x,\bar a).
$$
Here $\exists! x$ means "there exists a unique $x$".

Thus $b$ lies in $\operatorname{dcl}(A)$ if $b$ is uniquely definable using parameters from $A$.

### Example 6.28

In the ordered field:
$$
(\mathbb R; 0, 1, +, \times, <),
$$
the element:
$$
2
$$
is definable without parameters because it is the unique element satisfying:
$$
x = 1+1.
$$
More generally, every rational number is definable without parameters in this structure, since it can be described using $0$, $1$, addition, multiplication, and additive inverses.

If $a \in \mathbb R$, then $a+1$ belongs to $\operatorname{dcl}(\{a\})$, since it is uniquely defined by:
$$
x = a+1.
$$
### Lemma 6.29 (Basic Properties of Definable Closure)

For any $A \subseteq M$, the following hold:
$$
A \subseteq \operatorname{dcl}(A).
$$
If $A \subseteq B$, then:
$$
\operatorname{dcl}(A) \subseteq \operatorname{dcl}(B).
$$
Also:
$$
\operatorname{dcl}(\operatorname{dcl}(A)) = \operatorname{dcl}(A).
$$
Proof

First, let $a \in A$. Then $a$ is uniquely defined over $A$ by the formula:
$$
x=a.
$$
Therefore:
$$
a \in \operatorname{dcl}(A).
$$
This proves:
$$
A \subseteq \operatorname{dcl}(A).
$$
Second, suppose $A \subseteq B$ and let $c \in \operatorname{dcl}(A)$. Then $c$ is uniquely defined by some formula with parameters from $A$. Since every parameter from $A$ is also a parameter from $B$, the same formula defines $c$ uniquely over $B$. Hence:
$$
c \in \operatorname{dcl}(B).
$$
This proves monotonicity:
$$
\operatorname{dcl}(A) \subseteq \operatorname{dcl}(B).
$$
It remains to prove idempotence. By monotonicity and the inclusion $A \subseteq \operatorname{dcl}(A)$, we have:
$$
\operatorname{dcl}(A) \subseteq \operatorname{dcl}(\operatorname{dcl}(A)).
$$
For the reverse inclusion, suppose:
$$
b \in \operatorname{dcl}(\operatorname{dcl}(A)).
$$
Then $b$ is uniquely defined by a formula using finitely many parameters:
$$
c_1,\dots,c_n \in \operatorname{dcl}(A).
$$
For each $c_i$, choose a formula $\theta_i(z_i,\bar a_i)$ with parameters from $A$ that uniquely defines $c_i$ over $A$.

The element $b$ is defined over the parameters $c_1,\dots,c_n$ by some formula:
$$
\varphi(x,c_1,\dots,c_n).
$$
Replace the parameters $c_i$ by variables $z_i$, and define a new formula over $A$:
$$
\exists z_1 \cdots \exists z_n\,
\left(
\bigwedge_{i=1}^n \theta_i(z_i,\bar a_i)
\land
\varphi(x,z_1,\dots,z_n)
\right).
$$
Because each $\theta_i$ uniquely defines $c_i$, this formula uniquely defines the same element $b$ over $A$. Therefore:
$$
b \in \operatorname{dcl}(A).
$$
Thus:
$$
\operatorname{dcl}(\operatorname{dcl}(A)) \subseteq \operatorname{dcl}(A).
$$
Combining both inclusions gives:
$$
\operatorname{dcl}(\operatorname{dcl}(A)) = \operatorname{dcl}(A).
$$
