Scope and Variables
Scope
In predicate logic, the scope of a quantifier refers to the part of a formula over which the quantifier ranges. The two main quantifiers in predicate logic are the universal quantifier (∀) and the existential quantifier (∃). The universal quantifier is used to assert that a statement is true for all values of a variable, while the existential quantifier is used to assert that there exists at least one value of the variable for which the statement is true.
The scope of a quantifier is determined by the set of variables it binds. For example, consider the following formula:
∀x[Q(x) ∧ ∃y[P(x, y)]].
- In this formula, the universal quantifier ∀x has a larger scope than the existential quantifier ∃y, because it binds the variable x for the entire formula Q(x) ∧ ∃y[P(x, y)], while ∃y only binds y within the scope of P(x, y). This means that the formula is saying that for every value of x, Q(x) is true and there exists a value of y such that P(x, y) is true.
Now consider the following formula, which is not too different from the one above:
∀x[Q(x)] ∧ ∃y[P(x, y)].
- In this formula, The scope of ∀x is only Q(x), while the scope of ∃y remains as P(x,y). Because of this, there is a free variable x in P(x,y) that is not in the scope of its binding quantifier. The variable "x" in P(x,y) is considered a free variable.
Free and Bound Variables
In predicate logic, a variable is a placeholder for a value that can vary. There are two types of variables: free variables and bound variables.
Free variables are variables that are not bound by any quantifiers. They can take on any value within the domain of discourse, which is the set of all objects being discussed in a particular context. For example, consider the formula P(x). In this formula, x is a free variable, because it is not bound by any quantifiers. It can take on any value within the domain of discourse.
- ∃y[P(x,y)]: x is free in P(x,y).
- ∀x[Q(x)] ∧ F(x): x is free in F(x).
- ∃z[S(z,y) → ∀x[∀y[R(x)→S(x,y)]]: y is free in S(z,y).
Bound variables, on the other hand, are variables that are bound by quantifiers. For example, consider the formula ∀x P(x). In this formula, x is a bound variable, because it is bound by the universal quantifier ∀. This means that the formula is saying that P(x) is true for all values of x within the domain of discourse. Similarly, in the formula ∃x P(x), x is a bound variable, because it is bound by the existential quantifier ∃. This means that the formula is saying that there exists at least one value of x for which P(x) is true.
- ∃y[P(x,y)]: y is bound in P(x,y).
- ∀x[Q(x)] ∧ F(x): x is bound in Q(x).
- ∃z[S(z,y) → ∀x[∀y[R(x)→S(x,y)]]: z is bound in S(z,y), x is bound in R(x), and both x and y are bound in S(x,y).
0 comments