Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Example:
All men are mortal.
Socrates is a man.
··· Socrates is mortal.
Note: We need logic laws that work for statements involving quan-
tities like “some” and “all”.
In English, the predicate is the part of the sentence that tells you
something about the subject.
1
More on predicates
2
Domains and Truth Sets
3
The Universal Quantifier: ∀
4
More on the universal quantifier
Some Examples
Example: P(x, y): x + y = 8
Assign x to be 1, and y to be 7. We get proposition P(1, 7) which is
true.
Proposition P(2, 5) is false since 2 + 5 6= 8.
Example: ∀x[x ≥ 0]
U = N (non-negative integers)
We could re-write this proposition as: ∀x ∈ N, x ≥ 0
Is the proposition true?
What if the universe is R?
5
The Existential Quantifier: ∃
Note: If P(x) is true for at least one element in the domain, then
∃xP (x) is true. Otherwise it is false.
6
Translating Quantified Statements
1. ∀x[x2 ≥ 0] where U = R.
2. ∃t[(t > 3) ∧ (t3 > 27)] where U = R.
3. ∀x[(2|x) ∨ (2 6 |x)] where U = N
7
Bound and Free Variables
Example: Let U = N.
P (x, y, z) : x + y = z ← 3 free variables
Let Q(y, z) = P (2, y, z) : 2 + y = z ← 2 free variables
8
Examples with Quantifiers
Example: U = Z
N(x): x is a non-negative integer
E(x): x is even
O(x): x is odd
P(x): x is prime
Translate into logical notation.
1. There exists an even integer.
2. Every integer is even or odd.
3. All prime integers are non-negative.
4. The only even prime is 2.
5. Not all integers are odd.
6. Not all primes are odd.
7. If an integer is not odd, then it is even.
9
Examples with Nested Quantifiers
Exercise: U = N.
L(x, y) : x < y
S(x, y, z): x + y = z
P (x, y, z) : xy = z
Rewrite the following in logic notation.
1. For every x and y, there is a z such that x + y = z.
2. No x is less than 0.
3. For all x, x + 0 = x.
4. There is some x such that xy = y for all y.
10
Negating Quantified Statements
11
More Examples - Negating Statements with
Quantifiers
12
Some Definitions
13
Quantifiers plus ∧ and ∨
Example: ∀x(P (x) ∧ Q(x)) ≡ ∀xP (x) ∧ ∀xQ(x) (That is, no matter what
the domain is, these two propositions always have the same truth value)
This shouldn’t be surprising, since we know that for a finite domain, say
{1,2,3}, ∀xP (x) ≡ P (1) ∧ P (2) ∧ P (3). We also know that ∧ is commutative
and associative, so:
1
Distributing ∃ over ∧
Proof: exercise
15
Distributing the Existential Quantifier
16
∃ does not distribute over →
Note: ∃ does not distribute over →. I.e.,
∃x(P (x) → Q(x)) 6≡ ∃xP (x) → ∃xQ(x).
Proof:
∃x(P (x) → Q(x)) ≡ ∃x(Q(x) ∨ ¬P (x)) by implication
≡ ∃xQ(x) ∨ ∃x¬P (x) by distributivity of ∃ over ∨
≡ ∃xQ(x) ∨ ¬∀xP (x) by DeMorgan’s law
≡ ∀xP (x) → ∃xQ(x) by implication law
17
Logical Relationships with Quantifiers
Law Name
¬∀xP (x) ≡ ∃x¬P (x) DeMorgan’s laws for quantifiers
¬∃xP (x) ≡ ∀x¬P (x)
∀xP (x) ∧ ∀xQ(x) ≡ ∀x(P (x) ∧ Q(x)) distributivity of ∀ over ∧
∃x(P (x) ∨ Q(x)) ≡ ∃xP (x) ∨ ∃xQ(x) distributivity of ∃ over ∨
18
Compact Notation
Example:
Definition: The limit of f(x) as x approaches c is k (denoted
limx→cf (x) = k) if for every ε > 0, there exists δ > 0 such that for
all x, if |x − c| < δ, then |f (x) − k| < ε.
19
Arguments with Quantified Statements
P(x): x is mortal.
Argument:
∀xP (x)
··· P(Dijkstra)
20
Universal Modus Ponens
Example:
All politicians are crooks.
Joe Lieberman is a politician.
··· Joe Lieberman is a crook.
21
Universal Modus Tollens
Example:
All dogs bark.
Otis does not bark.
··· Otis is not a dog.
22
Universal Hypothetical Syllogism
Example:
If integer x is even, then 2x is even.
If 2x is even, then 4x2 is even.
··· If x is even, then 4x2 is even.
23
Universal Generalization
Universal Generalization:
P (c) for arbitrary c ∈ U
———————————
∴ ∀xP (x)
Note: We will be using this rule a lot. We use it to prove statements of the
form ∀xP (x). We assume that some c is an arbitrary element of the domain,
and prove that P (c) is true. Then we use the rule of Universal Generalization
to conclude that ∀xP (x).
1
Existential Instantiation and Existential Generalization
Existential Instantiation
∃xP (x)
··· P(c) for some c
Existential Generalization
P(c) for some element c
··· ∃xP (x)
25
Arguments with Quantifiers
Proof:
Step Reason
1. ∃x(P (x) ∧ ¬Q(x)) premise
2. P (a) ∧ ¬Q(a) for some a step 1, existential instantiation
3. P (a) simplification, step 2
4. ∀x(P (x) → R(x)) premise
5. P (a) → R(a) universal instantiation, step 4
6. R(a) modus ponens, steps 3 and 5
7. ¬Q(a) step 2, simplification
8. R(a) ∧ ¬Q(a) conjunction, steps 6 and 7
9. ∃x(R(x) ∧ ¬Q(x)) existential generalization, step 8
26
More Proofs
Prove: ∀x(P (x) ∧ Q(x)) ≡ ∀xP (x) ∧ ∀xQ(x) (from earlier in notes)
Recall: Two formulas are “equivalent” if replacing the ≡ symbol with a ↔
(bi-conditional) results in a tautology, i.e. a formula that is always true. So,
we want to show that ∀x(P (x) ∧ Q(x)) ↔ ∀xP (x) ∧ ∀xQ(x) is true. This can
be accomplished with two inference proofs.
1
Proving ∀x(P (x) ∧ Q(x)) ≡ ∀xP (x) ∧ ∀xQ(x), continued
Now we have two separate proofs, which can be used to prove the original
equivalence:
1. ∀x(P (x) ∧ Q(x)) → ∀xP (x) ∧ ∀xQ(x) {Proven}
2. ∀xP (x) ∧ ∀xQ(x) → ∀x(P (x) ∧ Q(x)) {Proven}
3. (∀x(P (x) ∧ Q(x)) → ∀xP (x) ∧ ∀xQ(x))∧
(∀xP (x) ∧ ∀xQ(x) → ∀x(P (x) ∧ Q(x))) {Conjunction: 1,2}
4. ∀x(P (x) ∧ Q(x)) ↔ ∀xP (x) ∧ ∀xQ(x) {Equivalence/Biconditional: 3}
Since we have proven that ∀x(P (x) ∧ Q(x)) ↔ ∀xP (x) ∧ ∀xQ(x) is true,
can also say that ∀x(P (x) ∧ Q(x)) ≡ ∀xP (x) ∧ ∀xQ(x), thus completing our
proof.
In fact, these last few steps are so common that they are generally left out
of any proof of the form A ↔ B (more on this later).
2
P ≡P ∧P Idempotence of ∧
P ≡P ∨P Idempotence of ∨
P ∧Q≡Q∧P Commutativity of ∧
P ∨Q≡Q∨P Commutativity of ∨
(P ∧ Q) ∧ R ≡ P ∧ (Q ∧ R) Associativity of ∧
(P ∨ Q) ∨ R ≡ P ∨ (Q ∨ R) Associativity of ∨
¬(P ∧ Q) ≡ ¬P ∨ ¬Q De Morgan’s Laws
¬(P ∨ Q) ≡ ¬P ∧ ¬Q
P ∧ (Q ∨ R) ≡ (P ∧ Q) ∨ (P ∧ R) Distributivity of ∧ over ∨
P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R) Distributivity of ∨ over ∧
P ∧F≡F ∧ Domination
P ∨T≡T ∨ Domination
P ∧T≡P ∧ Identity
P ∨F≡P ∨ Identity
P ∧ ¬P ≡ F ∧ Negation
P ∨ ¬P ≡ T ∨ Negation
¬¬P ≡ P Double Negation
P ∧ (P ∨ Q) ≡ P Absorbtion Laws
P ∨ (P ∧ Q) ≡ P
P → Q ≡ ¬P ∨ Q Implication
P → Q ≡ ¬Q → ¬P Contrapositive
P ↔ Q ≡ (P → Q) ∧ (Q → P ) Equivalence/Biconditional
(P ∧ Q) → R ≡ P → (Q → R) Exportation
¬∀xP (x) ≡ ∃x¬P (x) De Morgan’s Laws for Quantifiers
¬∃xP (x) ≡ ∀x¬P (x)
∀xP (x) ∧ ∀xQ(x) ≡ ∀x(P (x) ∧ Q(x)) Distributivity of ∀ over ∧
∃xP (x) ∨ ∃xQ(x) ≡ ∃x(P (x) ∨ Q(x)) Distributivity of ∃ over ∨
[P → Q] ∧ [P ] ⇒ Q Modus ponens
[P → Q] ∧ [¬Q] ⇒ ¬P Modus tollens
[P → Q] ∧ [Q → R] ⇒ (P → R) Hypothetical syllogism
[P ∨ Q] ∧ [¬P ] ⇒ Q Disjunctive syllogism
[P ] ⇒ P ∨ Q Addition
[P ∧ Q] ⇒ P Simplification
[P ] ∧ [Q] ⇒ P ∧ Q Conjunction (Adding a premise)
[P ∨ Q] ∧ [¬P ∨ R] ⇒ Q ∨ R Resolution
[P → Q] ∧ [R → S] ∧ [P ∨ R] ⇒ Q ∨ S Constructive dilemma
[P → Q] ∧ [R → S] ∧ [¬Q ∨ ¬S] ⇒ ¬P ∨ ¬R Destructive dilemma
[∀x ∈ U P (x)] ∧ [c ∈ U ] ⇒ P (c) Universal instantiation
[∀x(P (x) → Q(x))] ∧ [P (c)] ⇒ Q(c) Universal modus ponens
[∀x(P (x) → Q(x))] ∧ [¬Q(c)] ⇒ ¬P (c) Universal modus tollens
[∀x(P (x) → Q(x))] ∧ [∀x(Q(x) → R(x))] ⇒ ∀x(P (x) → R(x)) Universal hypothetical syllogism
[P (c) for arbitrary c ∈ U ] ⇒ [∀x ∈ U P (x)] Universal generalization
[∃x ∈ U P (x)] ⇒ P (c) for some c ∈ U Existential instantiation
[P (c)] ∧ [c ∈ U ] ⇒ ∃x ∈ U P (x) Existential generalization