This web page presents and discusses the precise notion of
semantics for first-order logic, in particular the definition
of what it means for a sentence $\sigma $ to be *true*
in a structure $M$.

The definition of what it means for $M\models \sigma $ is attributed to Tarski in the 1920s. It is not clear to me whether other people at the time even realised that this was a notion that could be defined adequately by mathematical means. (As a student I had various non-mathematical friends who clearly thought there was something heretical when I announced one day that I had just read an account of the definition of truth.) Tarski himself seemed at this time to regard his definition as methodological book-keeping, and not as useful mathematics, though it clearly is an important step before the question of completeness of first-order logic can be stated let alone proved. (The first proof of the Completeness theorem for first-order logic is due to Gödel in 1930.) In much more advanced work and certain specific circumstances (for instance the theory of satisfaction classes in models of Peano Arithmetic) this definition of truth has genuine mathematical importance, but in most contexts it really is just book-keeping, and so the discussion is relegated to these web pages.

This web page should be read in conjunction
with Section 9.1 of The Mathematics
of Logic

. In particular we aim here to give more
detail and information on Definition 9.23.

The formal definition of $M\models \sigma $ is by induction on the complexity of the statement $\sigma $, and there are several sub-clauses corresponding to the different kinds of sub-formulas that may occur in $\sigma $. But before we give these we indicate the main complication, which is that sub-formulas of $\sigma $ are not necessarily sentences but are formulas, and as such contain free-variables which must be given specific meanings too during the inductive definition.

There are two possible approaches to this problem, each with advantages and disadvantages. One approach is to work with a larger first-order language with constant symbols naming all elements of our structure $M$. This is convenient as it will eventually allow us to discuss with ease a great number of properties of $M$ and its elements. It does however rely on the idea of substitution of terms for variables, another tricky technical issue that is addressed in these web pages elsewhere. To make this web page more self-contained, we approach the definition of truth by starting with a different way of attaching meanings to free variables.

For the rest of this web page, we fix a first-order language $L$ with variables ${v}_{0},{v}_{1},\dots ,{v}_{i},\dots ,$ (for $i\in \mathbb{N}$) and various constant symbols, relation and function symbols (of possibily different arities) as described in Definition 9.1. We denote by ${\mathrm{VAR}}_{L}$ the set $\left\{{v}_{0},{v}_{1},\dots ,{v}_{i},\dots \right\}$ of variables of $L$. In particular, note that we assume a one-to-one correspondence $\mathbb{N}\to {\mathrm{VAR}}_{L}$ given by $i\mapsto {v}_{i}$. The definition of truth given below will rely on the fact that our first-order language has exactly these variables, and the variables ${v}_{i}$ are all distinct.

We also fix for this discussion an $L$-structure $M=(M,\dots ,c,\dots ,f,\dots ,R,\dots )$ as in Definition 9.22, where $M$ is a non-empty set, the domain of the structure, and for simplicty of notation we use the same symbol $M$ to denote both the structure and its domain.

Definition.

An assignment of variables into $M$ is a function $a:{\mathrm{VAR}}_{L}\to M$.

An assignment of variables into $M$ extends to a function (which we shall also denote $a$) that takes an arbitrary term $t$ of $L$ and gives an element $a\left(t\right)$ of the domain of $M$. This definition is very similar to the way a valution $v:X\to B$ extends to a map $v:\mathrm{BT}\left(X\right)\to B$ on a boolean algebra $B$.

Definition.

Let ${\mathrm{TERM}}_{L}$ denote the set of terms of $L$ as defined in Definition 9.2.

An assignment of variables into $M$ extends to a function $a:{\mathrm{TERM}}_{L}\to M$ as follows.

- if $t$ is a variable ${v}_{i}$, then $a\left(t\right)=a\left({v}_{i}\right)$, as before.
- if $t$ is a constant symbol $c$, then $a\left(t\right)$ is the element $c\in M$ of the $L$-structure $M$ realising that constant symbol.
- if $t=f({t}_{1},\dots ,{t}_{k})$ is built from a $k$-ary function symbol and $k$ subterms ${t}_{1},\dots ,{t}_{k}$, then $a\left(t\right)$ is the element $f\left(a\right({t}_{1}),\dots ,a({t}_{k}\left)\right)$ of the $L$-structure $M$ obtained by applying the function $f:{M}^{k}\to M$ realising the function symbol $f$ to the result of inductively applying the function $a$ to all of the subterms.

(We remark that the notation is potentially confusing as
the same symbol is used for different objects:
$M$ for both the structure and its domain;
$c$ for the constant symbol and the element of $M$ realising it;
$f$ for the function symbol and the function on $M$ realising it;
$a$ for the assignment of variables and for the assignment of
terms derived from it. However, the alternative would be
cumbersome and pedantic. Such use of overloading

of symbols is common
in computer programming and mathematics and is highly beneficial
to everyone once the reader has observed it and appreciated it.)

Because a term can be read in exactly one way (this is the unique readability of terms), the definition above shows that every assignment of variables extends in a unique way to an assignment of terms $a:{\mathrm{TERM}}_{L}\to M$.

The next step is to define an assignment of truth values in $2=\left\{\top ,\perp \right\}$ to each formula $\sigma $ of $L$, following Definition 9.4. The third clause here is exactly the extension of a valuation into a boolean algebra to the whole of $\mathrm{BT}\left(X\right)$ as given following Definition 7.1.

Definition.

If $a:{\mathrm{VAR}}_{L}\to M$ is an assignment of variables, $c\in M$ and $i\in \mathbb{N}$ then $a[c/{v}_{i}]$ denotes the assignment of variables $b:{\mathrm{VAR}}_{L}\to M$ given by $b\left({v}_{i}\right)=c$ and $b\left({v}_{j}\right)=a\left({v}_{j}\right)$ for all $j\ne i$. By the above definition, $a[c/{v}_{i}]$ can be considered as an assignment of terms of $L$ in the same way.

Definition.

Let ${\mathrm{FORM}}_{L}$ denote the set of formulas of $L$ as defined in Definition 9.4.

An assignment of terms $a:{\mathrm{TERM}}_{L}\to M$ gives rise to an assignment of formulas $a:{\mathrm{FORM}}_{L}\to 2=\left\{\top ,\perp \right\}$ as follows.

- If $\sigma $ is $(t=s)$ where $t,s$ are terms, then
$a\left(\sigma \right)=\top $ if $a\left(t\right)=a\left(s\right)$, i.e.
if these terms are assigned the same element of $M$. Otherwise $a\left(\sigma \right)=\perp $. - If $\sigma $ is $R({t}_{1},\dots ,{t}_{k})$ where
$R$ is a $k$-ary relation symbol and
${t}_{1},\dots ,{t}_{k}$ are terms, then
$a\left(\sigma \right)=\top $ if
$\left(a\right({t}_{1}),\dots ,a({t}_{k}\left)\right)\in R\subseteq {M}^{k}$,
i.e.
if this tuple of assignments of terms are in the relation in $M$ realising the symbol $R$. Otherwise $a\left(\sigma \right)=\perp $. - If $\sigma $ is $(\varphi \wedge \psi )$ then $a\left(\sigma \right)=a\left(\varphi \right)\wedge a\left(\psi \right)$ where $\wedge $ is computed in the boolean algebra $2$ on the right hand side. Similarly $a(\neg \sigma )=\neg a\left(\varphi \right)$, $a\left(\right(\varphi \vee \psi \left)\right)=a\left(\varphi \right)\vee a\left(\psi \right)$, $a(\top )=\top $ and $a(\perp )=\perp $.
- If $\sigma $ is $\forall {v}_{i}\u200a\varphi $ then $a\left(\sigma \right)=\top $ if $b\left(\varphi \right)=\top $ for all $b=a[c/{v}_{i}]$ and all $c\in M$. $a\left(\sigma \right)=\perp $ otherwise.
- If $\sigma $ is $\exists {v}_{i}\u200a\varphi $ then $a\left(\sigma \right)=\top $ if $b\left(\varphi \right)=\top $ for some $b=a[c/{v}_{i}]$ and some $c\in M$. $a\left(\sigma \right)=\perp $ otherwise.

Once again, by unique readability, an assignment $a:{\mathrm{VAR}}_{L}\to M$ extends in a unique way to an assignment $a:{\mathrm{FORM}}_{L}\to 2$.

The idea of a sentence of $L$ was outlined in Definition 9.6. (A further web page on free variables explain this idea in more detail.) We claimed there that sentences are independent of any choice of meaning of variables. This can now be formally stated as a proposition and proved. In fact we will prove something slightly stronger.

Proposition.

Let $\sigma $ be a formula of $L$ and $a,b:{\mathrm{VAR}}_{L}\to M$ be assignments such that $a\left({v}_{i}\right)=b\left({v}_{i}\right)$ for all variables ${v}_{i}\in {\mathrm{VAR}}_{L}$ that occur free in $\sigma $. Then $a\left(\sigma \right)=b\left(\sigma \right)$.

**Proof.**

By induction on $\sigma $, where the induction hypothesis $H\left(n\right)$ is the statement of the proposition for all formulas $\sigma $ that are constructed using a construction sequence of length at most $n$. We do some of the steps here, leaving the remaining steps as exercises for the reader.

If $\sigma $ is an atomic formula of type $R({t}_{1},\dots ,{t}_{k})$ or $({t}_{1}={t}_{2})$ then $a\left(\sigma \right)$ and $b\left(\sigma \right)$ can only depend on the values $a\left({v}_{j}\right)$ and $b\left({v}_{j}\right)$ for variables ${v}_{j}$ actually occuring in the terms ${t}_{i}$. (A formal proof of this fact requires a proof by induction on terms!). Therefore $a\left(\sigma \right)=b\left(\sigma \right)$ as these values $a\left({v}_{j}\right)$ and $b\left({v}_{j}\right)$ are equal.

If $\sigma $ is a quantified formula of the type $\forall {v}_{i}\varphi $ then suppose $a\left(\sigma \right)=\top $. We must use the indution hypothesis applied to $\varphi $ to show that $b\left(\varphi \right)=\top $. But $a\left(\sigma \right)=\top $ means that for all $c\in M$ we have $a[c/{v}_{i}]\left(\sigma \right)=\top $. but for each such $c\in M$ the assigment $b[c/{v}_{i}]$ agrees with $a[c/{v}_{i}]$ on all variables free in $\varphi $, since such a variable is either free in $\forall {v}_{i}\varphi $ or else is ${v}_{i}$ itself and both these assignments give $c$ to ${v}_{i}$. Therefore by the induction hypothesis $b[c/{v}_{i}]\left(\sigma \right)=\top $ and as this holds for all such $c\in M$ this proves the induction step in this case. The case of $\sigma $ of the type ${v}_{i}\varphi $ is similar.

Let $\sigma $ be a sentence of $L$ and $a,b:{\mathrm{VAR}}_{L}\to M$ assignments. Then $a\left(\sigma \right)=b\left(\sigma \right)$.

Definition.

For a sentence $\sigma $ of $L$, we write $M\models \sigma $ to mean $a\left(\sigma \right)=\top $ for every (equivalently some) assignment of variables into $M$.