Definable set

In mathematical logic, a definable set is an n-ary relation on the domain of a structure whose elements satisfy some formula in the first-order language of that structure. A set can be defined with or without parameters, which are elements of the domain that can be referenced in the formula defining the relation.

Definition
Let $$\mathcal{L}$$ be a first-order language, $$\mathcal{M}$$ an $$\mathcal{L}$$-structure with domain $$M$$, $$X$$ a fixed subset of $$M$$, and $$m$$ a natural number. Then:
 * A set $$A\subseteq M^m$$ is definable in $$\mathcal{M}$$ with parameters from $$X$$ if and only if there exists a formula $$\varphi[x_1,\ldots,x_m,y_1,\ldots,y_n]$$ and elements $$b_1,\ldots,b_n\in X$$ such that for all $$a_1,\ldots,a_m\in M$$,
 * $$(a_1,\ldots,a_m)\in A$$ if and only if $$\mathcal{M}\models\varphi[a_1,\ldots,a_m,b_1,\ldots,b_n].$$
 * The bracket notation here indicates the semantic evaluation of the free variables in the formula.


 * A set $$A$$ is definable in $$\mathcal{M}$$ without parameters if it is definable in $$\mathcal{M}$$ with parameters from the empty set (that is, with no parameters in the defining formula).
 * A function is definable in $$\mathcal{M}$$ (with parameters) if its graph is definable (with those parameters) in $$\mathcal{M}$$.
 * An element $$a$$ is definable in $$\mathcal{M}$$ (with parameters) if the singleton set $$\{a\}$$ is definable in $$\mathcal{M}$$ (with those parameters).

The natural numbers with only the order relation
Let $$\mathcal{N}=(\mathbb{N},<)$$ be the structure consisting of the natural numbers with the usual ordering. Then every natural number is definable in $$\mathcal{N}$$ without parameters. The number $$0$$ is defined by the formula $$\varphi(x)$$ stating that there exist no elements less than x:
 * $$\varphi=\neg\exists y(y0$$ is defined by the formula $$\varphi(x)$$ stating that there exist exactly $$n$$ elements less than x:
 * $$\varphi = \exists x_0\cdots\exists x_{n-1}(x_0<x_1 \land\cdots\land x_{n-1}<x \land \forall y(y<x \rightarrow (y \equiv x_0 \lor\cdots\lor y \equiv x_{n-1})))$$

In contrast, one cannot define any specific integer without parameters in the structure $$\mathcal{Z}=(\mathbb{Z},<)$$ consisting of the integers with the usual ordering (see the section on automorphisms below).

The natural numbers with their arithmetical operations
Let $$\mathcal{N}=(\mathbb{N},+, \cdot, <)$$ be the first-order structure consisting of the natural numbers and their usual arithmetic operations and order relation. The sets definable in this structure are known as the arithmetical sets, and are classified in the arithmetical hierarchy. If the structure is considered in second-order logic instead of first-order logic, the definable sets of natural numbers in the resulting structure are classified in the analytical hierarchy. These hierarchies reveal many relationships between definability in this structure and computability theory, and are also of interest in descriptive set theory.

The field of real numbers
Let $$\mathcal{R}=(\mathbb{R},0,1,+,\cdot)$$ be the structure consisting of the field of real numbers. Although the usual ordering relation is not directly included in the structure, there is a formula that defines the set of nonnegative reals, since these are the only reals that possess square roots:


 * $$\varphi = \exists y(y \cdot y \equiv x).$$

Thus any $$a\in\R$$ is nonnegative if and only if $$\mathcal{R}\models\varphi[a]$$. In conjunction with a formula that defines the additive inverse of a real number in $$\mathcal{R}$$, one can use $$\varphi$$ to define the usual ordering in $$\mathcal{R}$$: for $$a,b\in\R$$, set $$a\le b$$ if and only if $$b-a$$ is nonnegative. The enlarged structure $$\mathcal{R}^{\le}=(\mathbb{R},0,1,+,\cdot,\le)$$ is called a definitional extension of the original structure. It has the same expressive power as the original structure, in the sense that a set is definable over the enlarged structure from a set of parameters if and only if it is definable over the original structure from that same set of parameters.

The theory of $$\mathcal{R}^{\le}$$ has quantifier elimination. Thus the definable sets are Boolean combinations of solutions to polynomial equalities and inequalities; these are called semi-algebraic sets. Generalizing this property of the real line leads to the study of o-minimality.

Invariance under automorphisms
An important result about definable sets is that they are preserved under automorphisms.
 * Let $$\mathcal{M}$$ be an $$\mathcal{L}$$-structure with domain $$M$$, $$X\subseteq M$$, and $$A\subseteq M^m$$ definable in $$\mathcal{M}$$ with parameters from $$X$$. Let $$\pi:M\to M$$ be an automorphism of $$\mathcal{M}$$ that is the identity on $$X$$. Then for all $$a_1,\ldots,a_m\in M$$,


 * $$(a_1,\ldots,a_m)\in A$$ if and only if $$(\pi(a_1),\ldots,\pi(a_m))\in A.$$

This result can sometimes be used to classify the definable subsets of a given structure. For example, in the case of $$\mathcal{Z}=(\mathbb{Z},<)$$ above, any translation of $$\mathcal{Z}$$ is an automorphism preserving the empty set of parameters, and thus it is impossible to define any particular integer in this structure without parameters in $$\mathcal{Z}$$. In fact, since any two integers are carried to each other by a translation and its inverse, the only sets of integers definable in $$\mathcal{Z}$$ without parameters are the empty set and $$\mathbb{Z}$$ itself. In contrast, there are infinitely many definable sets of pairs (or indeed n-tuples for any fixed n >&thinsp;1) of elements of $$\mathcal{Z}$$: (in the case n = 2) Boolean combinations of the sets $$\{(a, b) \mid a - b = m\}$$ for $$m \in \mathbb Z$$. In particular, any automorphism (translation) preserves the "distance" between two elements.

Additional results
The Tarski–Vaught test is used to characterize the elementary substructures of a given structure.