Formal Logic/Predicate Logic/Free and Bound Variables
Template:Formal Logic:TOCPageNav
Free and Bound Variables
Informal notions
The two English sentences,
- If Socrates is a person, then Socrates is mortal,
- if Aristotle is a person, then Aristotle is mortal,
are both true. However, outside any context supplying a reference for 'it',
- (1) If it is a person, then it is mortal,
is neither true nor false. 'It' is not a name, but rather an empty placeholder. 'It' can refer to an object by picking up its reference from the surrounding context. But without such context, there is no reference and no truth or falsity. The same applies to the variable 'x' in
- (2) If x is a person, then x is mortal.
This situation changes with the two sentences:
- (3) For any object, if it is a person, then it is mortal,
- (4) For any object x, if x is a person, then x is mortal.
Neither the occurences of 'it' nor the occurences of 'x' in these sentences refer to specific objects as with 'Socrates' or 'Aristotle'. But (3) and (4) are nonetheless true. (3) is true if and only if:
- (5) Replacing both occurences of 'it' in (1) with a reference to any object whatsoever (the same object both times) yields a true result.
But (5) is true and so is (3). Similarly, (4) is true if and only if:
- (6) Replacing both occurences of 'x' in (2) with a reference to any object whatsoever (the same object both times) yields a true result.
But (6) is true and so is (4). We can call the occurences of 'it' in (1) free and the occurences of 'it' (3) bound. Indeed, the occurrances of 'it' in are bound by the phrase 'for any'. Similarly, the occurences 'x' in (2) are free while those in (4) are bound. Indeed, the occurences of 'x' in (4) are bound by the phrase 'for any'.
Formal definitions
An occurence of a variable is bound in if that occurence of stands within a subformula of having one of the two forms:
Consider the formula
Both instances of are bound in (7) because they stand within the subformula
Similarly, both instances of are bound in (7) because they stand withing the subformula
An occurence of a variable is free in if and only if is not bound in . The occurences of both and in
are free in (8) because neither is bound in (8).
We say that an occurence a variable is bound in by a particular occurence of if that occurence is also the first (and perhaps only) symbol in the shortest subformula of having the form
Consider the formula
The third and fouth occurences of in (9) are bound by the second occurence of in (9). However, they are not bound by the first occurence of in (9). The occurence of
in (9)—as well as the occurence of (9) itself in (9)—are subformulae of (9) beginning with a quantifier. That is, both are subformula of (9) having the form
Both contain the second third and fourth occurences of in (9). However, the occurence of (10) in (9) is the shortest subformula of (9) that meets these conditions. That is, the occurence of (10) in (9) is the shortest subformula of (9) that both (i) has this form and (ii) contains the third and fourth occurences of in (9). Thus it is the second, not the first, occurence of in (9) that binds the third and forth occurences of in (9). The first occurence of in (9) does, however, bind the first two occurences of in (9).
We also say that an occurence a variable is bound in by a particular occurence of if that occurence is also the first (and perhaps only) symbol in the shortest subformula of having the form
Finally, we say that a variable (not a particular occurence of it) is bound (or free) in a formula if the formula contains a bound (or free) occurence of . Thus is both bound and free in
since this formula contains both bound and free occurences of . In particular, the first two occurences of are bound and the last is free.
Sentences and formulae
A sentence is a formula with no free variables. Sentential logic had no variables at all, so all formulae of are also sentences of . In predicate logic and its language , however, we have formulae that are not sentences. All of (7), (8), (9), and (10) above are formulae. Of these, only (7), (9), and (10) are sentences. (8) is not a sentence because it contains free variables.
Examples
All occurences of in
are bound in the formula. The lone occurence of is free in the formula. (11) is a formula but not a sentence.
Only the first two occurences of in
are bound in the formula. The last occurence of and the lone occurence of in the formula are free in the formula. (12) is a formula but not a sentence.
All four occurences of in
are bound. The first two are bound by the universal quantifier, the last two are bound by the existential quantifier. The lone occurence of in the formula is free. (13) is a formula but not a sentence.
All three occurences of in
are bound by the universal quantifier. Both occurences of in the formula are bound by the existential quantifier. (14) has no free variables and so is a sentence and as well as a formula.