#include" the theory, and then you get
some pre-defined predicates/functions/constants, and perhaps
also some formulas about them, the axioms, which you
can take as "givens" in your proofs.
Equal(·,·)
that works like we expect equality to work, which means we
have the following two axioms:
| an example proof using the theory of equality | the same proof with the "=" operator as syntactic sugar |
|---|---|
Given Equal(bruce,batman), prove equal(mother(bruce),mother(batman)). 1: Equal(bruce,batman) [Given] 2: ∀x[Equal(x,x)] [Refelxivity of equality] 3: Equal(mother(bruce),mother(bruce)) [Specialization of 2 with x=mother(bruce)] 4: Equal(mother(bruce),mother(batman)) [Substitutivity of equality on 3 (using 1)] |
Given bruce = batman, prove mother(bruce) = mother(batman). 1: bruce=batman [Given] 2: ∀x[x=x] [Refelxivity of equality] 3: mother(bruce)=mother(bruce) [Specialization of 2 with x=mother(bruce)] 4: mother(bruce)=mother(batman) [Substitutivity of equality on 3 (using 1)] |
ACTIVITY Using first-order logic + the theory of equality, we add ... Predicates: ismid(.), inDTA(.) constants: bancroft, jones functions: home(.) Given: ∀x[ismid(x) => bancroft=home(x)], inDTA(bancroft), and ismid(jones) Prove: inDTA(home(jones))Note: Break up into groups and solve at the board.
SOLUTION
Given: ∀x[ismid(x) => home(x)=bancroft], inDTA(bancroft), and ismid(jones)
Prove: inDTA(home(jones))
1: ∀x[ismid(x) => bancroft=home(x)] [Given]
2: inDTA(bancroft) [Given]
3: ismid(jones) [Given]
4: ismid(jones) => bancroft=home(jones) [Specialization of 1 with x=jones]
5: bancroft=home(jones) [Modus ponens 4, 3]
6: inDTA(home(jones)) [Substitutivity of equality on 2 (using equality 5)]
This might not mean a lot to you right now, but for completeness I feel compelled to make this clear: We will not attempt to formally describe a a complete set of rules of deduction for first order logic, as one would in a course dedicated to formal logic. Our goal is to learn what one might call "practical" first-order logic, which is how we use first-order logic to model the world and to produce proofs. A more theoretically oriented course would actually prove things about first-order logic, e.g. is it consistent, is it complete, what is the smallest, simplest set of deduction rules that suffice for first-order logic, etc.
everyone loves computer scienceFrom that can we then deduce
Taylor Swift loves computer scienceis also a fact? Yes! This is an example of specialization, because "everyone loves computer science" is ∀x[lovesCS(x)]. Suppose we have the following fact:
someone is 10 feet tallFrom that can we then deduce
Taylor Swift is 10 feet tallis a fact? No! This is not specialization, since "someone is 10 feet tall" is ∃x[tall10ft(x)]. It is not a "∀", so specialization doesn not apply. What we do with existential instantiation is say, given a completely new name like
JoeTacoOrange, that
tall10ft(JoeTacoOrange)where we treat "JoeTacoOrange" as an alias for this mystery 10-foot-tall giant. That allows us to more easily say things like "Go find JoeTacoOrange and offer him a lot of money to play for our basketball team."
ACTIVITY - activity (do on paper in pairs, not at board). Note: Problem 2 may feel a little odd, since there are no constants, which means that there are no natural specializations to be made. This is a clue that maybe specialization should not be your first step!
Below is a proof that makes use of existential instantiation. In this case, we are proving a basic fact of mathematics, so we can see first order logic allowing us to express the kinds of deductions we require in mathematical proof.
Given: ∀x[Even(x) => ∃y[x = 2*y]], ∀x[∃z[x = 2*z+1] => Odd(x)] and Even(n)
Prove: Odd(n+1)
NOTE: we will use + and * as usual rather than Plus(a,b) and Times(a,b)
1: Even(n) [given]
2: ∀x[Even(x) => ∃y[x = 2*y]] [given]
4: Even(n) => ∃y[n = 2*y] [specialize x to n in 2]
5: ∃y[n = 2*y] [modus ponens with 4 and 1]
6: n = 2*k [existential instantiation - new constant is k]
7: n+1 = n+1 [reflexivity of equality]
8: n+1 = 2*k+1 [substitutivity of equality]
9: ∃z[n+1 = 2*z+1] [existential introduction replacing k with variable z]
10: ∀x[∃z[x = 2*z+1] => Odd(x)] [given]
11: ∃z[n+1 = 2*z+1] => Odd(n+1) [specialize x to n+1 in 10]
12: Odd(n+1) [modus ponens on 11 and 9]
Given: ∀x[Even(x) => ∃y[x = 2*y]], ∀x[∃z[x = 2*z+1] => Odd(x)] and Even(n) Prove: Odd(n+1) Even(n) => Odd(n+1) NOTE: we will use + and * as usual rather than Plus(a,b) and Times(a,b) A1: Even(n) [new assumption A] A2: ∀x[Even(x) => ∃y[x = 2*y]] [given] A4: Even(n) => ∃y[n = 2*y] [specialize x to n in A2] A5: ∃y[n = 2*y] [modus ponens with A4 and A1] A6: n = 2*k [existential instantiation - new constant is k A5] A7: n+1 = n+1 [reflexivity of equality] A8: n+1 = 2*k+1 [substitutivity of equality on A7 using A6] A9: ∃z[n+1 = 2*z+1] [existential introduction replacing k with new var z in A8] A10: ∀x[∃z[x = 2*z+1] => Odd(x)] [given] A11: ∃z[n+1 = 2*z+1] => Odd(n+1) [specialize x to n+1 in A10] A12: Odd(n+1) [modus ponens on A11 and A9] 13: Even(n) => Odd(n+1) [closing assumption A]
Given: ∀x[Even(x) => ∃y[x = 2*y]], ∀x[∃z[x = 2*z+1] => Odd(x)] Prove: Even(n) => Odd(n+1) ∀n[Even(n) => Odd(n+1)] NOTE: we will use + and * as usual rather than Plus(a,b) and Times(a,b) 0: [let n be arbitrary but fixed] A1: Even(n) [new assumption A] A2: ∀x[Even(x) => ∃y[x = 2*y]] [given] A4: Even(n) => ∃y[n = 2*y] [specialize x to n in A2] A5: ∃y[n = 2*y] [modus ponens with A4 and A1] A6: n = 2*k [existential instantiation - new constant is k is k A5] A7: n+1 = n+1 [reflexivity of equality] A8: n+1 = 2*k+1 [substitutivity of equality] A9: ∃z[n+1 = 2*z+1] [existential introduction replacing k with new var z in A8] A10: ∀x[∃z[x = 2*z+1] => Odd(x)] [given] A11: ∃z[n+1 = 2*z+1] => Odd(n+1) [specialize x to n+1 in A10] A12: Odd(n+1) [modus ponens on A11 and A9] 13: Even(n) => Odd(n+1) [closing assumption A] 14: ∀n[Even(n) => Odd(n+1)] [arbitrary but fixed n to ∀]
1: [Let x be arbitrary but fixed] 2: [Let y be arbitrary but fixed] A.1: x = y [new assumption A] A.2: ∀z[z = z] [Reflexivity of equality] A.3: x = x [Specialization of z to x in A.2] A.4: y = x [Substitutivity of equality on A.3 using A.1] 3: x = y => y = x [Closing assumption A] 4: ∀y[x = y => y = x] [arbitrary but fixed y to ∀ on 3] 5: ∀x[∀y[x = y => y = x]] [arbitrary but fixed x to ∀ on 4] note: ∀x,y[x = y => y = x] is shorthand for #5.
Hopefully you see the correspondence: