Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
CSE 311 Lecture 08: Inference Rules and Proofsfor Predicate LogicEmina Torlak and Kevin Zatloukal
1
TopicsPropositional logic proofs
A brief review of .A quick look at predicate logic proofs
Inference rules for quantifiers and a “hello” world example.An in-depth look at predicate logic proofs
Understanding rules for quantifiers through more advanced examples.
Lecture 07
2
Propositional logic proofsA brief review of .Lecture 07
Inference rules for propositional logicTwo rules per binary connective: to eliminate and introduce it.
Intro
Elim
Intro
Elim
Direct Proof Rule
Modus Ponens
Direct Proof Rule is special: not like the other rules.
∧ A; B∴ A ∧ B
∧ A ∧ B∴ A, B
∨ A∴ A ∨ B, B ∨ A
∨ A ∨ B; ¬A∴ B
A ⟹ B∴ A → B
A; A → B∴ B
4
Proving implications with the direct proof rule
Direct Proof Rule
The premise means “Given , we can prove .”
So the direct proof rule says that if we have such a proof, then we canconclude that is true.
A ⟹ B∴ A → B
A ⟹ B A B
A → B
5
Proving implications with the direct proof rule
Direct Proof Rule
The premise means “Given , we can prove .”
So the direct proof rule says that if we have such a proof, then we canconclude that is true.
Example: prove .
1.1. Assumption1.2.1.3.
2. Direct Proof Rule
A ⟹ B∴ A → B
A ⟹ B A B
A → B(p ∧ q) → (p ∨ q)
p ∧ qpp ∨ q
(p ∧ q) → (p ∨ q)
Indent the proof subroutine.Write the assumption and the goal.
5
Proving implications with the direct proof rule
Direct Proof Rule
The premise means “Given , we can prove .”
So the direct proof rule says that if we have such a proof, then we canconclude that is true.
Example: prove .
1.1. Assumption1.2. Elim : 1.11.3. Intro : 1.2
2. Direct Proof Rule
A ⟹ B∴ A → B
A ⟹ B A B
A → B(p ∧ q) → (p ∨ q)
p ∧ qp ∧p ∨ q ∨
(p ∧ q) → (p ∨ q)
Indent the proof subroutine.Write the assumption and the goal.Fill in the steps.
5
Why does the direct proof rule work?Inference rules let us derive facts that are implied by the existing facts.
6
Why does the direct proof rule work?Inference rules let us derive facts that are implied by the existing facts.
So, for every rule , is a tautology ( ).P
∴ QP → Q P → Q ≡ '
6
Why does the direct proof rule work?Inference rules let us derive facts that are implied by the existing facts.
So, for every rule , is a tautology ( ).
The proof shows that is a tautology ( ),since it just a series of implications that we know are tautologies.
P∴ Q
P → Q P → Q ≡ '
P ⟹ Q P → Q P → Q ≡ '
6
Why does the direct proof rule work?Inference rules let us derive facts that are implied by the existing facts.
So, for every rule , is a tautology ( ).
The proof shows that is a tautology ( ),since it just a series of implications that we know are tautologies.
So the Direct Proof Rule says that we can add to
our set of facts, if we can show that is a tautology.
P∴ Q
P → Q P → Q ≡ '
P ⟹ Q P → Q P → Q ≡ '
A ⟹ B∴ A → B
A → B
A → B
6
Why does the direct proof rule work?Inference rules let us derive facts that are implied by the existing facts.
So, for every rule , is a tautology ( ).
The proof shows that is a tautology ( ),since it just a series of implications that we know are tautologies.
So the Direct Proof Rule says that we can add to
our set of facts, if we can show that is a tautology.
One way to show that is by writing a subproof, using allthe facts we have inferred up to that point.
P∴ Q
P → Q P → Q ≡ '
P ⟹ Q P → Q P → Q ≡ '
A ⟹ B∴ A → B
A → B
A → BA → B ≡ '
6
An example proofProve .((p → q) ∧ (q → r)) → (p → r)
7
An example proofProve .
1.1. Assumption1.2.1.3.
1.5.
2. DirectProofRule
((p → q) ∧ (q → r)) → (p → r)(p → q) ∧ (q → r)
p → r((p → q) ∧ (q → r)) → (p → r)
Write the premise and the conclusion.
7
An example proofProve .
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
1.5.
2. DirectProofRule
((p → q) ∧ (q → r)) → (p → r)(p → q) ∧ (q → r)p → q ∧q → r ∧
p → r((p → q) ∧ (q → r)) → (p → r)
Write the premise and the conclusion.Work forwards and backwards.
We’ll need parts of 1.1 so Elim toget 1.2, 1.3.
∧
7
An example proofProve .
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
1.4.1. Assumption1.4.2.1.4.3.
1.5. Direct Proof Rule
2. DirectProofRule
((p → q) ∧ (q → r)) → (p → r)(p → q) ∧ (q → r)p → q ∧q → r ∧
p
rp → r
((p → q) ∧ (q → r)) → (p → r)
Write the premise and the conclusion.Work forwards and backwards.
We’ll need parts of 1.1 so Elim toget 1.2, 1.3.We can use DPR to get 1.5.
∧
7
An example proofProve .
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
1.4.1. Assumption1.4.2. MP: 1.2, 1.4.11.4.3.
1.5. Direct Proof Rule
2. DirectProofRule
((p → q) ∧ (q → r)) → (p → r)(p → q) ∧ (q → r)p → q ∧q → r ∧
pqr
p → r((p → q) ∧ (q → r)) → (p → r)
Write the premise and the conclusion.Work forwards and backwards.
We’ll need parts of 1.1 so Elim toget 1.2, 1.3.We can use DPR to get 1.5.Using MP on 1.2, 1.4.1 gives us 1.4.2.
∧
7
An example proofProve .
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
1.4.1. Assumption1.4.2. MP: 1.2, 1.4.11.4.3. MP: 1.3, 1.4.2
1.5. Direct Proof Rule
2. DirectProofRule
((p → q) ∧ (q → r)) → (p → r)(p → q) ∧ (q → r)p → q ∧q → r ∧
pqr
p → r((p → q) ∧ (q → r)) → (p → r)
Write the premise and the conclusion.Work forwards and backwards.
We’ll need parts of 1.1 so Elim toget 1.2, 1.3.We can use DPR to get 1.5.Using MP on 1.2, 1.4.1 gives us 1.4.2.Using MP on 1.3, 1.4.2 gives us 1.4.3.
∧
7
Which facts can be used in a subproof?
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
1.4.1. Assumption1.4.2. MP: 1.2, 1.4.11.4.3. MP: 1.3, 1.4.2
1.5. Direct Proof Rule
2. DirectProofRule
A line in a (sub)proof can use a factat line if the set of assumptions andgivens that is derived from containsall the assumptions and givens that is derived from.
(p → q) ∧ (q → r)p → q ∧q → r ∧
pqr
p → r((p → q) ∧ (q → r)) → (p → r)
ki
ki
8
Which facts can be used in a subproof?
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
1.4.1. Assumption1.4.2. MP: 1.2, 1.4.11.4.3. MP: 1.3, 1.4.2
1.5. Direct Proof Rule
2. DirectProofRule
A line in a (sub)proof can use a factat line if the set of assumptions andgivens that is derived from containsall the assumptions and givens that is derived from.So, 1.4.2 can use 1.2 because they arederived from the assumptions {1.1,1.4.1} and {1.1}, respectively.
(p → q) ∧ (q → r)p → q ∧q → r ∧
pqr
p → r((p → q) ∧ (q → r)) → (p → r)
ki
ki
8
Which facts can be used in a subproof?
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
1.4.1. Assumption1.4.2. MP: 1.2, 1.4.11.4.3. MP: 1.3, 1.4.2
1.5. Direct Proof Rule
2. DirectProofRule
A line in a (sub)proof can use a factat line if the set of assumptions andgivens that is derived from containsall the assumptions and givens that is derived from.So, 1.4.2 can use 1.2 because they arederived from the assumptions {1.1,1.4.1} and {1.1}, respectively.Can 1.5 use 1.4.3?
(p → q) ∧ (q → r)p → q ∧q → r ∧
pqr
p → r((p → q) ∧ (q → r)) → (p → r)
ki
ki
8
Which facts can be used in a subproof?
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
1.4.1. Assumption1.4.2. MP: 1.2, 1.4.11.4.3. MP: 1.3, 1.4.2
1.5. Direct Proof Rule
2. DirectProofRule
A line in a (sub)proof can use a factat line if the set of assumptions andgivens that is derived from containsall the assumptions and givens that is derived from.So, 1.4.2 can use 1.2 because they arederived from the assumptions {1.1,1.4.1} and {1.1}, respectively.Can 1.5 use 1.4.3?
No. Because 1.5 is derived from{1.1} and 1.4.3 from {1.1, 1.4.1}.
(p → q) ∧ (q → r)p → q ∧q → r ∧
pqr
p → r((p → q) ∧ (q → r)) → (p → r)
ki
ki
8
Which facts can be used in a subproof?
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
1.4.1. Assumption1.4.2. MP: 1.2, 1.4.11.4.3. MP: 1.3, 1.4.2
1.5. Direct Proof Rule
2. DirectProofRule
A line in a (sub)proof can use a factat line if the set of assumptions andgivens that is derived from containsall the assumptions and givens that is derived from.So, 1.4.2 can use 1.2 because they arederived from the assumptions {1.1,1.4.1} and {1.1}, respectively.Can 1.5 use 1.4.3?
No. Because 1.5 is derived from{1.1} and 1.4.3 from {1.1, 1.4.1}.
Can 2 use 1.2?
(p → q) ∧ (q → r)p → q ∧q → r ∧
pqr
p → r((p → q) ∧ (q → r)) → (p → r)
ki
ki
8
Which facts can be used in a subproof?
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
1.4.1. Assumption1.4.2. MP: 1.2, 1.4.11.4.3. MP: 1.3, 1.4.2
1.5. Direct Proof Rule
2. DirectProofRule
A line in a (sub)proof can use a factat line if the set of assumptions andgivens that is derived from containsall the assumptions and givens that is derived from.So, 1.4.2 can use 1.2 because they arederived from the assumptions {1.1,1.4.1} and {1.1}, respectively.Can 1.5 use 1.4.3?
No. Because 1.5 is derived from{1.1} and 1.4.3 from {1.1, 1.4.1}.
Can 2 use 1.2?No. Because 2 is derived from {}and 1.2 from {1.1}.
(p → q) ∧ (q → r)p → q ∧q → r ∧
pqr
p → r((p → q) ∧ (q → r)) → (p → r)
ki
ki
8
Which facts can be used in a subproof? A mnemonic{
{
1.1. Assumption1.2. Elim : 1.11.3. Elim : 1.1
{
1.4.1. Assumption1.4.2. MP: 1.2, 1.4.11.4.3. MP: 1.3, 1.4.2
}
1.5. Direct Proof Rule}
2. Direct ProofRule
}
(p → q) ∧ (q → r)p → q ∧q → r ∧
pqr
p → r
((p → q) ∧ (q → r)) → (p → r)
This is just like Java’s scoping rules.
9
A general proof strategy
1. Look at the rules for introducing connectives to see how you wouldbuild up the formula you want to prove from pieces of what is given.
2. Use the rules for eliminating connectives to break down the givenformulas so that you get the pieces need for 1
3. Write the proof beginning with what you figured out for 2 followed by 1.
Intro
Elim
Intro
Elim
Direct Proof Rule
Modus Ponens
∧ A; B∴ A ∧ B
∧ A ∧ B∴ A, B
∨ A∴ A ∨ B, B ∨ A
∨ A ∨ B; ¬A∴ B
A ⟹ B∴ A → B
A; A → B∴ B
10
A quick look at predicate logic proofsInference rules for quantifiers and a “hello” world example.
11
Inference rules for quantifiers
Elim
Intro
Intro
Elim
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
The name stands for anarbitrary value in the domain. Noother name in depends on .
a
P a
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
The name is fresh and stands for avalue in the domain where is true.List all dependencies for .
cP(c)
c
12
Predicate logic proofs can use …
Predicate logic inference rulesApplied to whole formulas only.
Predicate logic equivalencesEven on subformulas.
Propositional logic inference rulesApplied to whole formulas only.
Propositional logic equivalencesEven on subformulas.
13
A “hello world” proofProve .
Elim
Intro
Intro
Elim
(∀x. P(x)) → (∃x. P(x))
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
14
A “hello world” proofProve .
1.1. Assumption1.2.1.3.
2. Direct Proof Rule
Elim
Intro
Intro
Elim
(∀x. P(x)) → (∃x. P(x))∀x. P(x)
∃x. P(x)(∀x. P(x)) → (∃x. P(x))
Given , so use Direct Proof Rule.→
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
14
A “hello world” proofProve .
1.1. Assumption1.2.1.3. Intro : 1.2
2. Direct Proof Rule
Elim
Intro
Intro
Elim
(∀x. P(x)) → (∃x. P(x))∀x. P(x)P(c)∃x. P(x) ∃
(∀x. P(x)) → (∃x. P(x))
Given , so use Direct Proof Rule.We can use Intro to get 1.3, but
need for some .
→∃
P(c) c
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
14
A “hello world” proofProve .
1.1. Assumption1.2. Elim : 1.11.3. Intro : 1.2
2. Direct Proof Rule
Elim
Intro
Intro
Elim
(∀x. P(x)) → (∃x. P(x))∀x. P(x)P(c) ∀∃x. P(x) ∃
(∀x. P(x)) → (∃x. P(x))
Given , so use Direct Proof Rule.We can use Intro to get 1.3, but
need for some .We have from Elim on 1.1.
→∃
P(c) cP(c) ∀
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
14
A “hello world” proofProve .
1.1. Assumption1.2. Elim : 1.11.3. Intro : 1.2
2. Direct Proof Rule
Elim
Intro
Intro
Elim
Working forwards and backwards:In applying Intro rule, we didn’tknow what expression we mightbe able to prove for, so weworked forwards to figure outwhat might work.
(∀x. P(x)) → (∃x. P(x))∀x. P(x)P(c) ∀∃x. P(x) ∃
(∀x. P(x)) → (∃x. P(x))
Given , so use Direct Proof Rule.We can use Intro to get 1.3, but
need for some .We have from Elim on 1.1.
→∃
P(c) cP(c) ∀
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
∃
P(c)
14
An in-depth look at predicate logic proofsUnderstanding rules for quantifiers through more advanced examples.
15
Advanced proofs: considering domain semanticsSo far, we have treated the predicate definitions as black boxes, and thedomain of discourse as a set of objects with no additional properties.
In practice, we want to prove theorems for specific domains, and usethe properties of those domains in our proofs.
16
Advanced proofs: considering domain semanticsSo far, we have treated the predicate definitions as black boxes, and thedomain of discourse as a set of objects with no additional properties.
In practice, we want to prove theorems for specific domains, and usethe properties of those domains in our proofs.
For example, the set of integers is equipped with the operators .+, ⋅, =
16
Advanced proofs: considering domain semanticsSo far, we have treated the predicate definitions as black boxes, and thedomain of discourse as a set of objects with no additional properties.
In practice, we want to prove theorems for specific domains, and usethe properties of those domains in our proofs.
For example, the set of integers is equipped with the operators .
We can use these operators in our predicates (below) and proofs (next):
+, ⋅, =
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
16
A not so odd exampleProve that there is an even number: .
Elim
Intro
Intro
Elim
∃x. Even(x)
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
17
A not so odd exampleProve that there is an even number: .
1.2.3.4.
Elim
Intro
Intro
Elim
∃x. Even(x)
∃x. Even(x)
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
17
A not so odd exampleProve that there is an even number: .
1.2.3.4. Intro : 3
Elim
Intro
Intro
Elim
∃x. Even(x)
Even(2)∃x. Even(x) ∃
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
17
A not so odd exampleProve that there is an even number: .
1.2.3. Definition of Even: 24. Intro : 3
Elim
Intro
Intro
Elim
∃x. Even(x)
∃y. 2 = 2 ⋅ yEven(2)∃x. Even(x) ∃
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
17
A not so odd exampleProve that there is an even number: .
1. Arithmetic2. Intro : 13. Definition of Even: 24. Intro : 3
Elim
Intro
Intro
Elim
∃x. Even(x)2 = 2 ⋅ 1∃y. 2 = 2 ⋅ y ∃Even(2)∃x. Even(x) ∃
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
17
A prime exampleProve that there is an even prime number: .
Elim
Intro
Intro
Elim
We use a black-box definition of Prime because the proof won’t need to break it down further.
∃x. Even(x) ∧ Prime(x)
Domain of discourseIntegers
Predicate definitions
“ is prime”Even(x) ::= ∃y. x = 2 ⋅ yPrime(x) ::= x
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
18
A prime exampleProve that there is an even prime number: .
1.2.3.4.5.6.
Elim
Intro
Intro
Elim
We use a black-box definition of Prime because the proof won’t need to break it down further.
∃x. Even(x) ∧ Prime(x)
∃x. Even(x) ∧ Prime(x)
Domain of discourseIntegers
Predicate definitions
“ is prime”Even(x) ::= ∃y. x = 2 ⋅ yPrime(x) ::= x
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
18
A prime exampleProve that there is an even prime number: .
1.2.3.4.5.6. Intro : 5
Elim
Intro
Intro
Elim
We use a black-box definition of Prime because the proof won’t need to break it down further.
∃x. Even(x) ∧ Prime(x)
Even(2) ∧ Prime(2)∃x. Even(x) ∧ Prime(x) ∃
Domain of discourseIntegers
Predicate definitions
“ is prime”Even(x) ::= ∃y. x = 2 ⋅ yPrime(x) ::= x
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
18
A prime exampleProve that there is an even prime number: .
1.2.3.4.5. Intro : 3, 46. Intro : 5
Elim
Intro
Intro
Elim
We use a black-box definition of Prime because the proof won’t need to break it down further.
∃x. Even(x) ∧ Prime(x)
Even(2)Prime(2)Even(2) ∧ Prime(2) ∧∃x. Even(x) ∧ Prime(x) ∃
Domain of discourseIntegers
Predicate definitions
“ is prime”Even(x) ::= ∃y. x = 2 ⋅ yPrime(x) ::= x
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
18
A prime exampleProve that there is an even prime number: .
1.2.3.4. Property of integer 25. Intro : 3, 46. Intro : 5
Elim
Intro
Intro
Elim
We use a black-box definition of Prime because the proof won’t need to break it down further.
∃x. Even(x) ∧ Prime(x)
Even(2)Prime(2)Even(2) ∧ Prime(2) ∧∃x. Even(x) ∧ Prime(x) ∃
Domain of discourseIntegers
Predicate definitions
“ is prime”Even(x) ::= ∃y. x = 2 ⋅ yPrime(x) ::= x
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
18
A prime exampleProve that there is an even prime number: .
1. Arithmetic2. Intro : 13. Definition of Even: 24. Property of integer 25. Intro : 3, 46. Intro : 5
Elim
Intro
Intro
Elim
We use a black-box definition of Prime because the proof won’t need to break it down further.
∃x. Even(x) ∧ Prime(x)2 = 2 ⋅ 1∃y. 2 = 2 ⋅ y ∃Even(2)Prime(2)Even(2) ∧ Prime(2) ∧∃x. Even(x) ∧ Prime(x) ∃
Domain of discourseIntegers
Predicate definitions
“ is prime”Even(x) ::= ∃y. x = 2 ⋅ yPrime(x) ::= x
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
18
An equal exampleProve that follows from .
Elim
Intro
Intro
Elim
∀y. ∃z. y = z ∀x. x = x
Domain of discourseIntegers
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
19
An equal exampleProve that follows from .
1. Given2.3.4.
Elim
Intro
Intro
Elim
∀y. ∃z. y = z ∀x. x = x∀x. x = x
∀y. ∃z. y = z
Domain of discourseIntegers
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
19
An equal exampleProve that follows from .
1. Given2. Elim : 1, is arbitrary3.4.
Elim
Intro
Intro
Elim
∀y. ∃z. y = z ∀x. x = x∀x. x = xa = a ∀ a
∀y. ∃z. y = z
Domain of discourseIntegers
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
19
An equal exampleProve that follows from .
1. Given2. Elim : 1, is arbitrary3. Intro : 24.
Elim
Intro
Intro
Elim
∀y. ∃z. y = z ∀x. x = x∀x. x = xa = a ∀ a∃z. a = z ∃∀y. ∃z. y = z
Domain of discourseIntegers
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
19
An equal exampleProve that follows from .
1. Given2. Elim : 1, is arbitrary3. Intro : 24. Intro : 3
Elim
Intro
Intro
Elim
∀y. ∃z. y = z ∀x. x = x∀x. x = xa = a ∀ a∃z. a = z ∃∀y. ∃z. y = z ∀
Domain of discourseIntegers
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
19
A square exampleProve that the square of every even number is even: .
Elim
Intro
Intro
Elim
∀x. Even(x) → Even( )x2
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
20
A square exampleProve that the square of every even number is even: .
4.
Elim
Intro
Intro
Elim
∀x. Even(x) → Even( )x2
∀x. Even(x) → Even( )x2
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
20
A square exampleProve that the square of every even number is even: .
1. Let be an arbitrary integer.
3.4. Intro : 1, 3
Elim
Intro
Intro
Elim
∀x. Even(x) → Even( )x2
a
Even(a) → Even( )a2
∀x. Even(x) → Even( )x2 ∀
Use Intro on 1 and 2.∀
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
20
A square exampleProve that the square of every even number is even: .
1. Let be an arbitrary integer.
2.1. Assumption2.2.2.3.2.4.2.5.2.6.
3. Direct Proof Rule4. Intro : 1, 3
Elim
Intro
Intro
Elim
∀x. Even(x) → Even( )x2
aEven(a)
Even( )a2
Even(a) → Even( )a2
∀x. Even(x) → Even( )x2 ∀
Use Intro on 1 and 2. so use DRP to get 3.
∀→
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
20
A square exampleProve that the square of every even number is even: .
1. Let be an arbitrary integer.
2.1. Assumption2.2. Definition of Even: 2.12.3.2.4.2.5.2.6. Definition of Even: 2.5
3. Direct Proof Rule4. Intro : 1, 3
Elim
Intro
Intro
Elim
∀x. Even(x) → Even( )x2
aEven(a)∃y. a = 2y
∃y. = 2ya2
Even( )a2
Even(a) → Even( )a2
∀x. Even(x) → Even( )x2 ∀
Use Intro on 1 and 2. so use DRP to get 3.
Use definition of Even to breakdown 2.1 and 2.6.
∀→
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
20
A square exampleProve that the square of every even number is even: .
1. Let be an arbitrary integer.
2.1. Assumption2.2. Definition of Even: 2.12.3. Elim : 2.2, depends on 2.4.2.5.2.6. Definition of Even: 2.5
3. Direct Proof Rule4. Intro : 1, 3
Elim
Intro
Intro
Elim
∀x. Even(x) → Even( )x2
aEven(a)∃y. a = 2ya = 2b ∃ b a
∃y. = 2ya2
Even( )a2
Even(a) → Even( )a2
∀x. Even(x) → Even( )x2 ∀
Use Intro on 1 and 2. so use DRP to get 3.
Use definition of Even to breakdown 2.1 and 2.6.
Use Elim on 2.2.
∀→
∃
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
20
A square exampleProve that the square of every even number is even: .
1. Let be an arbitrary integer.
2.1. Assumption2.2. Definition of Even: 2.12.3. Elim : 2.2, depends on 2.4. Algebra2.5.2.6. Definition of Even: 2.5
3. Direct Proof Rule4. Intro : 1, 3
Elim
Intro
Intro
Elim
∀x. Even(x) → Even( )x2
aEven(a)∃y. a = 2ya = 2b ∃ b a
= 4 = 2(2 )a2 b2 b2
∃y. = 2ya2
Even( )a2
Even(a) → Even( )a2
∀x. Even(x) → Even( )x2 ∀
Use Intro on 1 and 2. so use DRP to get 3.
Use definition of Even to breakdown 2.1 and 2.6.
Use Elim on 2.2.Use algebra on 2.3 to match the
body of 2.5.
∀→
∃
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
20
A square exampleProve that the square of every even number is even: .
1. Let be an arbitrary integer.
2.1. Assumption2.2. Definition of Even: 2.12.3. Elim : 2.2, depends on 2.4. Algebra2.5. Intro : 2.42.6. Definition of Even: 2.5
3. Direct Proof Rule4. Intro : 1, 3
Elim
Intro
Intro
Elim
∀x. Even(x) → Even( )x2
aEven(a)∃y. a = 2ya = 2b ∃ b a
= 4 = 2(2 )a2 b2 b2
∃y. = 2ya2 ∃Even( )a2
Even(a) → Even( )a2
∀x. Even(x) → Even( )x2 ∀
Use Intro on 1 and 2. so use DRP to get 3.
Use definition of Even to breakdown 2.1 and 2.6.
Use Elim on 2.2.Use algebra on 2.3 to match the
body of 2.5.Use Intro on 2.4 to get 2.5.
∀→
∃
∃
Domain of discourseIntegers
Predicate definitionsEven(x) ::= ∃y. x = 2 ⋅ y
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
20
Why list dependencies? To avoid incorrect proofs.Over the integer domain: is True but is False.
Elim
Intro
Intro
Elim
∀x. ∃y. y ≥ x ∃y. ∀x. y ≥ x
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
The name stands for an arbitrary value in thedomain. No other name in depends on .
aP a
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
The name is fresh and stands for a value in the domainwhere is true. List all dependencies for .
cP(c) c
21
Why list dependencies? To avoid incorrect proofs.Over the integer domain: is True but is False.
1. Given2. 3.4.5.6.
Elim
Intro
Intro
Elim
∀x. ∃y. y ≥ x ∃y. ∀x. y ≥ x
∀x. ∃y. y ≥ x
∃y. ∀x. y ≥ x
Example: an incorrect proof.
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
The name stands for an arbitrary value in thedomain. No other name in depends on .
aP a
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
The name is fresh and stands for a value in the domainwhere is true. List all dependencies for .
cP(c) c
21
Why list dependencies? To avoid incorrect proofs.Over the integer domain: is True but is False.
1. Given2. Let be an arbitrary integer. 3.4.5.6. Intro : 5
Elim
Intro
Intro
Elim
∀x. ∃y. y ≥ x ∃y. ∀x. y ≥ x
∀x. ∃y. y ≥ xa
∃y. ∀x. y ≥ x ∃
Example: an incorrect proof.
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
The name stands for an arbitrary value in thedomain. No other name in depends on .
aP a
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
The name is fresh and stands for a value in the domainwhere is true. List all dependencies for .
cP(c) c
21
Why list dependencies? To avoid incorrect proofs.Over the integer domain: is True but is False.
1. Given2. Let be an arbitrary integer. 3. Elim : 14.5.6. Intro : 5
Elim
Intro
Intro
Elim
∀x. ∃y. y ≥ x ∃y. ∀x. y ≥ x
∀x. ∃y. y ≥ xa
∃y. y ≥ a ∀
∃y. ∀x. y ≥ x ∃
Example: an incorrect proof.
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
The name stands for an arbitrary value in thedomain. No other name in depends on .
aP a
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
The name is fresh and stands for a value in the domainwhere is true. List all dependencies for .
cP(c) c
21
Why list dependencies? To avoid incorrect proofs.Over the integer domain: is True but is False.
1. Given2. Let be an arbitrary integer. 3. Elim : 14. Elim : 3, depends on 5.6. Intro : 5
Elim
Intro
Intro
Elim
∀x. ∃y. y ≥ x ∃y. ∀x. y ≥ x
∀x. ∃y. y ≥ xa
∃y. y ≥ a ∀b ≥ a ∃ b a
∃y. ∀x. y ≥ x ∃
Example: an incorrect proof.
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
The name stands for an arbitrary value in thedomain. No other name in depends on .
aP a
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
The name is fresh and stands for a value in the domainwhere is true. List all dependencies for .
cP(c) c
21
Why list dependencies? To avoid incorrect proofs.Over the integer domain: is True but is False.
1. Given2. Let be an arbitrary integer. 3. Elim : 14. Elim : 3, depends on 5. Intro : 2, 46. Intro : 5
Elim
Intro
Intro
Elim
∀x. ∃y. y ≥ x ∃y. ∀x. y ≥ x
∀x. ∃y. y ≥ xa
∃y. y ≥ a ∀b ≥ a ∃ b a∀x. b ≥ x ∀∃y. ∀x. y ≥ x ∃
Example: an incorrect proof.
Can’t get rid of sinceanother name, , in thesame formula depends on it!
ab
∀ ∀x. P(x)∴ P(a) for any a
∀ P(a); a is arbitrary∴ ∀x. P(x)
The name stands for an arbitrary value in thedomain. No other name in depends on .
aP a
∃ P(c) for some c∴ ∃x. P(x)
∃ ∃x. P(x)∴ P(c) for a specific c
The name is fresh and stands for a value in the domainwhere is true. List all dependencies for .
cP(c) c
21
SummaryPredicate logic proofs extend propositional logic proofs.
Can use all rules and equivalences for propositional logic.Plus inference rules for quantifiers and equivalences for predicate logic.
When applying Intro to , make sure that is arbitrary, and
no other name depends on .When applying Elim to , make sure that
in is fresh, andall the dependencies for are listed.
∀ P(a)a
a∃ ∃x. P(x)
c P(c)c
22