"

Complex formulas and quantifiers

So far so good. Now comes the more confusing part. When we are forming more complex formulas in 1\mathcal{L}_1, we can not only use connectives, but also quantifiers. And quantifiers work nothing like the connectives! Moreover, quantifiers and variables have an important relation to each other.

Let’s start with the formulas of 1\mathcal{L}_1. It is not hard to define what it means for something to be a formula of our new language. We already know what the atomic formulas are, we still have our connectives as usual, and we add two other symbols, \forall (‘for all’, ‘for every’) for the universal quantifier, and \exists (‘for some’, ‘there exists’) for the existential quantifier. Thus:

\forall Universal quantifier ‘For all’, ‘For every’
\exists Existential quantifier ‘For some’, ‘There exists’

How the quantifiers show up in our formulas is as follows. In each case, for a formula XX, you can form a quantified formula by adding the quantifier with a specific variable in front of the formula. So again, if XX is any formula of 1\mathcal{L}_1, then for example, 𝐱1X\forall \mathbf{x}_{1} X is also a formula of 1\mathcal{L}_1. And so is 𝐱1X\exists \mathbf{x}_{1} X. And so is 𝐱45967X\exists \mathbf{x}_{45967} X. But of course, since XX can be any formula of 1\mathcal{L}_1, XX might already be a quantified formula (that is, it might already have quantifiers), and it might even be a complex formula with quantifiers and connectives (or just connectives). So this new rule of ours gets us infinitely many new formulas in a very strong sense. For example, it gets us infinitely many new formulas even if we fix a quantifier and a variable.

Thus, we have the definition:

Definition 6.3 (Formulas). The set of formulas 𝖥𝖮𝖱𝖬1\textsf{FORM}_{\mathcal{L}_1} of 1\mathcal{L}_1 is the smallest set such that:

  1. every X𝖠𝖳𝖮𝖬1X \in \textsf{ATOM}_{\mathcal{L}_1} is in 𝖥𝖮𝖱𝖬1\textsf{FORM}_{\mathcal{L}_1};

  2. if X,YX, Y are in 𝖥𝖮𝖱𝖬1\textsf{FORM}_{\mathcal{L}_1}, then ¬X\neg X, (XY)(X \wedge Y), (XY)(X \vee Y), and (XY)(X \rightarrow Y) are in 𝖥𝖮𝖱𝖬1\textsf{FORM}_{\mathcal{L}_1};

  3. if YY is in 𝖥𝖮𝖱𝖬1\textsf{FORM}_{\mathcal{L}_1} and xx is in 𝖵𝖠𝖱1\mathsf{VAR}_{\mathcal{L}_1}, then xY\forall x Y and xY\exists x Y are in 𝖥𝖮𝖱𝖬1\textsf{FORM}_{\mathcal{L}_1}.

Exercise 6.1. For each of the following expressions, determine if it is a formula of 1\mathcal{L}_1 or not. If it is, provide a linear or tree derivation of it. If it is not, explain why it is not.

  1. 𝐱3𝔓31(𝔠9)\forall \mathbf{x}_{3} \mathfrak{P}^{1}_{3}(\mathfrak{c}_{9})

  2. (𝔓52(𝐱9,𝐱3)¬𝐱4(𝔓11(𝐱9)¬𝔓11(𝐱7)))(\mathfrak{P}^{2}_{5}(\mathbf{x}_{9}, \mathbf{x}_{3}) \vee \neg \exists \mathbf{x}_{4}(\mathfrak{P}^{1}_{1}(\mathbf{x}_{9}) \vee \neg \mathfrak{P}^{1}_{1}(\mathbf{x}_{7})))

  3. ¬𝐱5(𝔓23(𝔠4,𝔠1,𝐱3)𝐱1𝔓21(𝔠13))\neg \forall \mathbf{x}_{5} (\mathfrak{P}^{3}_{2}(\mathfrak{c}_{4}, \mathfrak{c}_{1}, \mathbf{x}_{3}) \vee \exists \mathbf{x}_{1} \mathfrak{P}^{1}_{2}(\mathfrak{c}_{13}))

  4. 𝐱3(𝔓51(𝔠9))\exists \mathbf{x}_{3}(\mathfrak{P}^{1}_{5}(\mathfrak{c}_{9}))

  5. (𝐱6𝔓41(𝐱3))(\exists \mathbf{x}_{6} \mathfrak{P}^{1}_{4}(\mathbf{x}_{3}))

  6. x¬(𝔓12(𝔠2,𝐱4)𝐱3𝔓51(𝔠9))\forall x \neg (\mathfrak{P}^{2}_{1}(\mathfrak{c}_{2}, \mathbf{x}_{4}) \vee \exists \mathbf{x}_{3}\mathfrak{P}^{1}_{5}(\mathfrak{c}_{9}))

  7. ¬¬¬𝐱6𝔓41(𝐱3)\neg\neg\neg\exists \mathbf{x}_{6} \mathfrak{P}^{1}_{4}(\mathbf{x}_{3})

  8. ¬(𝐱3𝔓51(𝔠9))\neg(\exists \mathbf{x}_{3}\mathfrak{P}^{1}_{5}(\mathfrak{c}_{9}))

So far, not very complicated. But here’s the rub. In first-order logic, we are not (at least currently) interested in all formulas. Instead, we are interested in a special subset of them: those that are called ‘closed formulas’. The formulas that are not closed are called ‘open’. So there are open and closed formulas, and we want the closed ones. These closed formulas are also sometimes called ‘sentences’. Again, this way, sentences are just a special subset of all formulas – the closed ones.

Here is the basic idea behind what makes a formula closed or its opposite, open. Note that the quantifiers \forall and \exists always come with some specific variable after them. They also have a scope, which is just the formula which they flank from the left. In other words, the scope of xY\exists x Y is YY, and the scope of xY\forall x Y is, again, YY, and in either case, the variable is xx. This is important for the following reason.

If a certain variable that occurs after the quantifier also occurs in the scope of the quantifier (and is not already bound), then we say that the variable’s occurrence is bound by that quantifier. If an occurrence of a variable is bound, it is not free, and it is free if it is not bound.

Let’s look at some examples:

  1. 𝔓11(𝐱1)𝔓11(𝐱2)\mathfrak{P}^{1}_{1}(\mathbf{x}_{1}) \wedge \mathfrak{P}^{1}_{1}(\mathbf{x}_{2})

  2. 𝐱1(𝔓11(𝐱1¯)𝔓11(𝐱2))\forall \mathbf{x}_{1} (\mathfrak{P}^{1}_{1}(\overline{\mathbf{x}_{1}}) \wedge \mathfrak{P}^{1}_{1}(\mathbf{x}_{2}))

  3. 𝐱1(𝔓11(𝐱1¯)𝔓11(𝐱2))𝔓11(𝐱1)\forall \mathbf{x}_{1} (\mathfrak{P}^{1}_{1}(\overline{\mathbf{x}_{1}}) \wedge \mathfrak{P}^{1}_{1}(\mathbf{x}_{2})) \wedge \mathfrak{P}^{1}_{1}(\mathbf{x}_{1})

  4. 𝐱2𝐱1(𝔓11(𝐱1¯)𝔓11(𝐱2¯))\exists \mathbf{x}_{2} \forall \mathbf{x}_{1}(\mathfrak{P}^{1}_{1}(\overline{\mathbf{x}_{1}}) \wedge \mathfrak{P}^{1}_{1}(\overline{\mathbf{x}_{2}}))

  5. 𝐱1(𝔓11(𝐱1¯)𝐱2𝔓11(𝐱2¯))\forall \mathbf{x}_{1}(\mathfrak{P}^{1}_{1}(\overline{\mathbf{x}_{1}}) \wedge \exists \mathbf{x}_{2} \mathfrak{P}^{1}_{1}(\overline{\mathbf{x}_{2}}))

  6. 𝐱1𝐱1𝔓11(𝐱1¯)\forall \mathbf{x}_{1} \exists \mathbf{x}_{1} \mathfrak{P}^{1}_{1}(\overline{\mathbf{x}_{1}})

To have a visual representation, I put a horizontal line over each of the bound occurrences of the variables. Every other occurrence of a variable occurs free.

First, with formula (1), there are no quantifiers, so none of the occurrences of the variables are bound. In other words, all the variables occur free. In formula (2), 𝐱1\mathbf{x}_{1} is in the scope of the quantifier \forall with 𝐱1\mathbf{x}_{1}, so it gets bound by it. But there is no quantifier for 𝐱2\mathbf{x}_{2}, so that remains open.

The next formula, formula (3) shows something important. Sometimes, some occurrences of variables are bound, but some other occurrences remain free. As you can see, the first occurrence of 𝐱1\mathbf{x}_{1} gets bound by the universal quantifier with 𝐱1\mathbf{x}_{1}, but the second occurrence does not. Why? Because that occurrence of 𝐱1\mathbf{x}_{1} is not in the scope of the quantifier. If you made a syntax tree for the formula, that specific occurrence of the variable would not be underneath the quantifier, it would be on a different branch altogether, while the first occurrence would be. This is why we talk of occurrences of variables, and not simply variables.

Formulas (4) and (5) show two ways in which both variables can be bound. Note that though 𝐱2\exists \mathbf{x}_{2} takes a different place in the second, it still manages to have the sole occurrence of 𝐱2\mathbf{x}_{2} be in its scope, so it binds it either way.

Finally, (6) shows something unfortunate. As our syntax is defined, there can be overlapping quantifiers with identical variables. In such cases, we need a rule to determine which quantifier binds the variable. In this case, that quantifier is \exists. Why? Because in 𝔓11(𝐱1)\mathfrak{P}^{1}_{1}(\mathbf{x}_{1}), 𝐱1\mathbf{x}_{1} occurs free. In 𝐱1𝔓11(𝐱1)\exists \mathbf{x}_{1} \mathfrak{P}^{1}_{1}(\mathbf{x}_{1}), 𝐱1\mathbf{x}_{1} no longer occurs free, it gets bound by 𝐱1\exists \mathbf{x}_{1}. So when 𝐱1\forall \mathbf{x}_{1} arrives to the party late, it has no free occurrences of variables to bind anymore. Thus 𝐱1\forall \mathbf{x}_{1} does nothing – it binds no variables because there are no free variables to bind.

As mentioned above, formulas in which all the occurrences of the variables are bound are closed, and they are sentences. Formulas in which there is at least one unbound (free) occurrence of a variable are called open, and they are not sentences.

So above, (4), (5), and (6) are closed formulas, and are therefore sentences. On the other hand, (1), (2), (3) are open formulas, and are therefore not sentences.

Now there is a clever way to define what it means to be a sentence of 1\mathcal{L}_1, by keeping count at each turn of forming a formula which variables have at least one free occurrence. It is as follows:

Definition 6.4 (Sentences). Let Y,ZY, Z be any formulas and xx be any variable of 1\mathcal{L}_1. We define the variables with at least one occurrence free in a formula, the free variables of a formula, as follows:

  1. if YY is an atomic formula, all its variables are free;

  2. the free variables of ¬Y\neg Y are the same as the free variables of YY;

  3. the free variables of (YZ)(Y \wedge Z), (YZ)(Y \vee Z), (YZ)(Y \rightarrow Z) are the free variables of YY and of ZZ taken together;

  4. the free variables of xY\forall x Y and xY\exists x Y are the free variables of YY minus the variable xx.

A formula YY of 1\mathcal{L}_1 is open iff it does not have a free variable, and closed otherwise. The formula YY is a sentence iff it is closed.

Exercise 6.2. Determine for each of the following formulas whether they are a sentence of 1\mathcal{L}_1 or not. If any formula is not a sentence, underline the unbound occurrences of its variables.

  1. 𝔓41(𝐱4)\mathfrak{P}^{1}_{4}(\mathbf{x}_{4})

  2. 𝔓41(𝔠4)\mathfrak{P}^{1}_{4}(\mathfrak{c}_{4})

  3. 𝐱5𝔓52(𝐱3,𝔠1)\forall \mathbf{x}_{5}\mathfrak{P}^{2}_{5}(\mathbf{x}_{3}, \mathfrak{c}_{1})

  4. 𝔓71(𝐱9)𝐱4𝔓62(𝐱4,𝔠9)\mathfrak{P}^{1}_{7}(\mathbf{x}_{9}) \rightarrow \exists \mathbf{x}_{4}\mathfrak{P}^{2}_{6}(\mathbf{x}_{4}, \mathfrak{c}_{9})

  5. 𝔓71(𝔠9)𝐱4𝔓62(𝐱4,𝐱4)\mathfrak{P}^{1}_{7}(\mathfrak{c}_{9}) \rightarrow \exists \mathbf{x}_{4}\mathfrak{P}^{2}_{6}(\mathbf{x}_{4}, \mathbf{x}_{4})

  6. 𝐱1(𝔓41(𝐱1)¬𝐱1𝔓51(𝐱1))\forall \mathbf{x}_{1} (\mathfrak{P}^{1}_{4}(\mathbf{x}_{1}) \rightarrow \neg \forall \mathbf{x}_{1} \mathfrak{P}^{1}_{5}(\mathbf{x}_{1}))

Some further conventions

As before, we shall make some simplifications to our notation to make our formulas more readable, and our claims more general. We already know that we can refer to any predicate 𝔓kn\mathfrak{P}^{n}_{k} (for some n,k)n, k \in \mathbb{N}) by the metavariables PP, QQ, RR, ..., and we can refer to any constant 𝔠n\mathfrak{c}_{n} (nn \in \mathbb{N}) by the metavariables aa, bb, cc, .... We also had that formulas can be referred to by the metavariables XX, YY, ZZ, .... We can now further add that for each variable 𝐱n\mathbf{x}_{n} (nn \in \mathbb{N}), we can use the metavariables xx, yy, zz, ....

It’s important here to understand the distinction between metavariables and variables. Previously, we had less of a problem distinguishing between the two because we were using a language, 0\mathcal{L}_0, without variables. But now that we are using 1\mathcal{L}_1, with variables, we need to distinguish between the two types. We shall see how the variables of 1\mathcal{L}_1 function once we get to its semantics. But we can already say how its metavariables function. In particular, metavariables ‘range over’ the symbols of the language. In other words, if we write something like P(x)P(x), it means some formula of the language of form 𝔓n1(𝐱k)\mathfrak{P}^{1}_{n}(\mathbf{x}_{k}) for some n,kn, k \in \mathbb{N}. Given this, P(x)P(x) could be any one of infinitely many formulas of the language, of that form. In context, we may use this to mean one particular formula of that form, without specifying which one exactly we mean (e.g., in an exercise). Or we can talk about all of them at once, like when we specify that (XY)(¬XY)(X \rightarrow Y) \rightarrow (\neg X \vee Y) is a tautology, meaning all formulas of this form are tautologies.

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Learning Logic Backwards Copyright © by Peter Susanszky is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.