Logical quantifiers binds a variable within some local scope. This means that whatever meaning we assign to a variable (by its quantifier) is only valid within the scope of said quantifier. More technically, the quantifier scope is the associated sub-formula after a quantifier and its variable.
It can be likened to program scope in coding, since a (programming) variable only makes sense within its function scope, just like a (logical) variable is only bound inside its quantifier scope.
Variable Binding
A quantifier over some variable binds in its scope. Alternatively, is said to be a bound variable. Any unbound variable is said to be a free variable.
Bad Conventions
Technically speaking, unlike in maths, we can assign the same symbol to multiple variables. I.e., if we were to have a mathematical equation, it would be something like , whereas a valid (here meaning obeying the rules) formula can just only use without any subscripts if each instance is in a different binding scope. That is, if we have a formula where is bound under different quantifiers (and/or is free) we can give it different meanings. This is similar to variable shadowing in programming, where variables with the same names have different purposes in different program scopes. It’s not good practice, but again, technically it’s possible.
Some examples:
- : is bound, is a free variable
- : is bound throughout the formula, while the first (on the left) is free. The second (after the ) is bound.
- : The first and last instances of are bound, while the middle one is free.
A formula is closed if it contains no free variables
Shadowing
Variable shadowing occurs when the same variable is allocated inside two different quantifier scopes, one inside another:
- The has shadowed the more ‘global’
- refers to the , not the