Predicate
Predicate
More examples:
We shall discuss each informally, and later treat syntax and semantics
formally.
Normally, one or more objects in the domain will have a name; e.g., 0,
Stephen Harper, T, etc. Such names are called constant symbols.
“ is a student”.
〈x, y〉 ∈ D2 | x < y
.
S(x): x is a student
I(x): x is an instructor
Y (x, y): x is younger than y
In general, we use variables that range over the domain to make general
statements, such as
x2 ≥ 0 ,
and in expressing conditions which individuals may or may not satisfy,
such as
x+x=x∗x .
This latter condition is satisfied by only two numbers: 0 and 2.
For all " > 0, there exists δ > 0 such that for all y ,
if |x − y| < δ then | f (x) − f ( y)| < " .
For example, the statement “Not all birds can fly” can be written as
where m denotes the function that takes one argument and returns the
mother of that argument.
More examples:
m(m(a)) = m(m(s)) .
∃p · ∀x · r(p, x) = x ∗ x .
P(t 1 , . . . , t n )
Parse trees for FOL formulas are similar to parse trees for propositional
formulas.
We shall cover more about syntax later, but we first start the discussion
of semantics.
• If α is R(t 1 , . . . , t n ), then
(
T if 〈t 1M , . . . , t nM 〉 ∈ RM
αM =
F otherwise.
N
E f (0) means “1 is an integer”, and E f (0) is T.
N
E f f (0) means “1/2 is an integer”, and E f f (0) is F.
Exercise: in both M and N , the formula E f f (0) ∧ E f (0) receives
value F. Find another interpretation which gives it the value T.
A formula has the same free variables as its parts, except that a
quantified variable becomes bound.
Examples.
• If α is the formula E f (x) , then α[ y + y/x] is E f ( y + y) .
• α[ f (x)/x] is E f f (x) .
• E f (x + y) [ y/x] is E f ( y + y) .
Huth and Ryan opt for the first method. We shall use the second.
(Huth and Ryan specify that the substitution is undefined if capture would
occur—case 5(b) above. With this more complex definition, one never has to
add a condition regarding undefined substitutions. Substitution always behaves
“the way it should”.)
Syntax, Continued Substitution 181/448
Example, Revisited
Example. If α is ∀x · ∃ y · x + y = z , what is α[( y − 1)/z]?
This falls under case 5(b): the term to be substituted, namely y − 1,
contains a variable y quantified in formula α.
Let β be x + y = z ; thus α is ∀x · ∃ y · β .
β[w/ y] is x + w = z,
and
β[w/ y][( y − 1)/z] is x + w = y − 1.
∀x · ∃w· x + w = y − 1 .
Semantics 183/448
FOL Adds to Propositional Logic
Semantics 184/448
Environments
If the interpretation specifies < is less-than, then x < y gets value false.
If the interpretation specifies < is “was created before”, then x < y gets
value true.
• dom{J } is the collection of all words over the alphabet {a, b},
0J = a ,
sJ appends a to the end of a string, and
+J is concatenation.
Let θ (x) = a ba. Then
(J ,θ )
s s(0) + s(x) = aaa baaa
and (J ,θ )
s x + s x + s(0) = a baa baaaaa .
Note: The values of (∀x · α)(M,θ ) and (∃x · α)(M,θ ) do not depend on the
value of θ (x).
The value θ (x) only matters for free occurrences of x .
/ RM , we have
Since b, a ∈
/ RM , we have
Since b, a ∈
(M,θ )
• What about ∀x · ∃ y · R(x, y) ?
R(b, a) = F
or perhaps
R(b, a)(M,θ ) = F ?
R(b, a) = F
or perhaps
R(b, a)(M,θ ) = F ?
Let α be the formula P f g(x), g( y) , g(z) . The formula is satisfiable:
• dom(M): N
• f M : summation
• g M : squaring
• P M : equality
• θ (x) = 3, θ ( y) = 4 and θ (z) = 5.
where R is a property.
Lemma:
Let α be a first-order formula, M be an interpretation, and θ1 and θ2 be
two environments such that
Then
M |=θ1 α if and only if M |=θ2 α .
Then we must have M |=θ ∀x ·(α → β) and M 6|=θ (∀x · α) → (∀x · β);
the second gives M |=θ ∀x · α and M 6|=θ ∀x · β .
Using the definition of |= for formulas with ∀, we have
for every a ∈ dom(M), M |=θ [x7→a] α → β and M |=θ [x7→a] α.
Thus also M |=θ [x7→a] β for every a ∈ dom(M).
Thus M |=θ ∀x · β , a contradiction.
and also
(That is, find α and β such that consequence does not hold.)
(That is, find α and β such that consequence does not hold.)
(That is, find α and β such that consequence does not hold.)
|= (∀x · α) → α[t/x] .
Other proof techniques and tricks remain the same as natural deduction
for propositional logic.
∀-elimination If Σ ` ∀x · α ∀x · α
(∀e) then Σ ` α[t/x] α[t/x]
“All fish can swim. Nemo is a fish. Therefore, Nemo can swim.”
In FOL: show that ∀x ·(F (x) → S(x)), F (Nemo) ` S(Nemo)..
Proof:
The proof doesn’t care what F and S mean. Fishiness and swimming ability
really have nothing to do with the argument.
Example. Show ¬P( y) ` ∃x · P(x) → Q( y) .
1. ¬P( y) Premise
2. P( y) Assumption
3. ⊥ ¬e: 2, 1
4. Q( y) ⊥e: 3
5. P( y) → Q( y) →i: 2–4
6. ∃x · P(x) → Q( y) ∃i: 5
(The last step could have produced ∃x · P(x) → Q(x) , if desired.)
ϕ (M,E[x7→d]) = T .
If we have no information about who might have the name “Sam”, this is
essentially the same as
If we have no information about who might have the name “Sam”, this is
essentially the same as
To further clarify the rule ∀i, we show that it is sound. That is,
1. ¬ ∃x · α Premise
2. u fresh
¬α[u/x] ??
n. ∀x · ¬α ∀i: 2–6
1. ¬ ∃x · α Premise
2. u fresh
3. α[u/x] Assumption
4. ∃x · α ∃i: 3
5. ⊥ ¬e: 1, 4
6. ¬α[u/x] ¬i: 3–5
7. ∀x · ¬α ∀i: 2–6
1. ∀x ·(α → β) Premise
Note: do not apply rule ∀e until you know which term to use.
1. ∀x ·(α → β) Premise
2. ∀x · α Assumption
∀x · β ∀i???
8. (∀x · α) → (∀x · β) →i??
Note: do not apply rule ∀e until you know which term to use.
1. ∀x ·(α → β) Premise
2. ∀x · α Assumption
3. u fresh
6. β[u/x] ??
7. ∀x · β ∀i???
8. (∀x · α) → (∀x · β) →i??
Note: do not apply rule ∀e until you know which term to use.
1. ∀x ·(α → β) Premise
2. ∀x · α Assumption
3. u fresh
4. α[u/x] → β[u/x] ∀e: 1
5. α[u/x] ∀e: 2
6. β[u/x] →e: 4, 5
7. ∀x · β ∀i: 3–6
8. (∀x · α) → (∀x · β) →i: 2–7
Note: do not apply rule ∀e until you know which term to use.
1. ∃x · R(x) Premise
2. R(u), u fresh Assumption
3. ∃ y · R( y) ∃i: 2 (term u)
4. ∃ y · R( y) ∃e: 1, 2–3
1. ∃x · α Premise
2. α[u/x], u fresh Assumption
3. α[ y/x][u/ y] ????
4. ∃ y · α[ y/x] ∃i: 3 (term u)
5. ∃ y · α[ y/x] ∃e: 1, 2–4
1. ∃x · α Premise
2. α[u/x], u fresh Assumption
3. α[ y/x][u/ y] ????
4. ∃ y · α[ y/x] ∃i: 3 (term u)
5. ∃ y · α[ y/x] ∃e: 1, 2–4
1. ∃x · ¬α Premise
¬ ∀x · α ∃e ??
1. ∃x · ¬α Premise
2. ¬α[u/x], u fresh Assumption
¬ ∀x · α ¬i ??
7. ¬ ∀x · α ∃e ??
1. ∃x · ¬α Premise
2. ¬α[u/x], u fresh Assumption
3. ∀x · α Assumption
4. α[u/x] ∀e: 3
5. ⊥ ¬e: 4, 2
6. ¬ ∀x · α ¬i: 3–5
7. ¬ ∀x · α ∃e: 1, 2–6
1. ∀x · ¬α Assumption
2. ∃x · α Assumption
3. α[u/x] (u fresh) Assumption
4. ¬α[u/x] ∀e: 1
5. ⊥ ¬e: 3, 4
6. ⊥ ∃e: 2, 3–5
7. ¬ ∃x · α ¬i: 2–6
1. ¬ ∀x · α Premise
¬α[t/x] ??
∃x · ¬α ∃i: ??
1. ¬ ∀x · α Premise
¬α[t/x] ??
∃x · ¬α ∃i: ??
1. ¬ ∀x · α Premise
¬α[t/x] ??
∃x · ¬α ∃i: ??
1. ¬ ∀x · α Premise
2. ¬ ∃x · ¬α Assumption
3. u fresh
4. ¬α[u/x] Assumption
5. ∃x · ¬α ∃i: 4
6. ⊥ ¬e: 5, 2
7. ¬¬α[u/x] ¬i: 4–6
8. α[u/x] ¬¬e: 7
9. ∀x · α ∀i: 3–8
10. ⊥ ¬e: 9, 1
11. ¬¬ ∃x · ¬α ¬i: 2–10
12. ∃x · ¬α ¬¬e: 11
1. ∀x · ∀ y · A(x, y) Premise
2. u, v fresh
3. A(u, v) ∀e (×2): 1
4. ∀ y · ∀x · A(x, y) ∀i (×2): 3
Left to you.
Equals-Introduction:
t = t =i
EQ1: ∀x · x = x is an axiom.
EQ2: For each formula α and variable z ,
∀x · ∀ y · x = y → α[x/z] → α[ y/z]
is an axiom.
Lemma. ` ∀x · ∀ y · x = y → y = x .
1.
∀x · ∀ y · x = y → y = x ∀i (×2): 1–?
Lemma. ` ∀x · ∀ y · x = y → y = x .
1. u, v fresh
Lemma. ` ∀x · ∀ y · x = y → y = x .
1. u, v fresh
2. u=v Assumption
v=u ??
u=v → v=u →i: 2–?
∀x · ∀ y · x = y → y = x ∀i (×2): 1–?
Lemma. ` ∀x · ∀ y · x = y → y = x .
1. u, v fresh
2. u=v Assumption
3. u=u =i
4. v=u =e: 2, 3 [ x = u]
5. u=v → v=u →i: 2–4
6. ∀x · ∀ y · x = y → y = x ∀i (×2): 1–5
1. u, v , w fresh
2. u=v Assumption
3. u=v → v=u Symmetry of =, + ∀e
4. v=u →e: 2, 3
5. v=w Assumption
6. u=w =e: 3, 5 [ x = w]
7. v=w→u=w →i: 5–6
8. u = v → (v = w → u = w) →i: 3–7
9. ∀x · ∀ y · ∀w· ∀i (×3): 1–8
x = y → ( y = w → x = w)
k-Way Transitivity:
Substitution of Equals:
EQsubs( r ): t1 = t2 for any variable z and terms t 1 and t 2 .
r[t 1 /z] = r[t 2 /z]
Theorem.
Proof outline:
Soundness: Each application of a rule is sound. By induction, any finite
number of rule applications is sound.
Completeness: We shall show the contrapositive:
if Σ 6` α, then Σ 6|= α .
We shall not give the full proof, but we will sketch the main points.
Given: Σ ∪ {¬α} 6` α.
Required: interpretation D and environment E that satisfy Σ ∪ {¬α}.
Given: Σ ∪ {¬α} 6` α.
Required: interpretation D and environment E that satisfy Σ ∪ {¬α}.