Definition (alphabet, terms, formulas, sentences in predicate logic)
Fix a signature $a: I \sqcup J \to \N$ and an infinite set $V$ of variables. ($I, J, V$ may not be countable.)
The function symbols are $Σ_0^a := \sb{s_i}{i\in I}$, the relation symbols are $Σ_1^a := \sb{r_j}{j\in J}$ and the logical symbols are $$ \begin{align*} L = \set{\wedge, \vee, \Rightarrow, \neg, \bot, \top, =, \exists, \forall, ), (}. \end{align*} $$ The alphabet of signature $a$ is $$ \begin{align*} Σ^a := Σ_0^a \cup Σ_1^a \cup V \cup L. \end{align*} $$
The set $\mathrm{Term}^a$ of $a$-terms is the smallest subset of $(Σ^a)^\ast$ containing $V$ such that $s_i t_0 t_1 \ldots t_{n-1}\in \mathrm{Term}^a$ for any $s_i\in Σ_0^a$ and $t_0, \ldots, t_{n-1} \in \mathrm{Term}^a$ with $n = a(i)$.
For $t\in \mathrm{Term}^a$, write $\op{occ}(t)$ for the set of variables occurring in $t$.
The set $\mathrm{Fml}^a$ of $a$-formulas is the smallest subset of $(Σ^a)^\ast$ containing
-
$\perp$ and $\top$,
-
$t = t'$ for any $t, t'\in \mathrm{Term}^\ast$, and
-
$r_j t_0 t_1 \ldots t_{n-1}$ for any $r_j\in Σ_1^\ast$ and $t_0, \ldots, t_{n-1} \in \mathrm{Term}^a$ with $n = a(j)$,
and such that, if $ϕ, ψ\in \mathrm{Fml}^a$, then so are the following:
-
$\exists v ϕ$ for any $v\in V$,
-
$\forall v ϕ$ for any $v\in V$,
-
$(ϕ \wedge ψ)$,
-
$(ϕ\vee ψ)$,
-
$(ϕ\Rightarrow ψ)$, and
-
$\neg ϕ$.
Define a function $\op{free}$ on $\mathrm{Fml}^a$ recursively:
-
$\op{free}(\bot) = \op{free}(\top) = \emptyset$,
-
$\op{free}(t = t') = \op{occ}(t) \cup \op{occ}(t')$,
-
$\op{free}(r_j t_0 \ldots t_{n-1}) = \op{occ}(t_0) \cup \ldots\op{occ}(t_{n-1})$,
-
$\op{free}((ϕ \wedge ψ)) = \op{free}((ϕ \vee ψ)) = \op{free}((ϕ \Rightarrow ψ)) = \op{free}(ϕ) \cup \op{free}(ψ)$,
-
$\op{free}(\neg ϕ) = \op{free}(\neg ϕ)$,
-
$\op{free}(\exists v ϕ) = \op{free}(\forall v ϕ) = \op{free}(ϕ) \setminus \set{v}$.
An $a$-formula $ϕ$ is an $a$-sentence if $\op{free}(ϕ) = \emptyset$.