






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























“Logic will get you from A to B. Imagination will take you every- where.” A. Einstein
In the previous chapter, we studied propositional logic. This chapter is dedicated to another type of logic, called predicate logic. Let us start with a motivating example.
Example 21. Consider the following two statements:
It looks “logical” to deduce that therefore, Jackson must study discrete math- ematics. However, this cannot be expressed by propositional logic...you may try it, but you can already notice that none of the logical operators we have learnt are applicable here.
We need new tools!
Definition 20. A predicate is a statement that contains variables (predicate variables), and they may be true or false depending on the values of these variables.
Example 22. P (x) = “x^2 is greater than x” is a predicate. It contains one predicate variable x. If we choose x = 1, P (1) is “1 is greater than 1”, which is a proposition (always false).
o e.g. the domain of x in P(x): integer o Different variables may have different domains.
4/
© Rovio
Symbol:
Definition 23. An existential quantification is a quantifier meaning “there exists”, “there is at least one” or “for some”. We use the following symbol:
∃ (existential quantification)
Example 26. Here is a formal way to say that for some values that a pred- icate variable x can take in a domain D, the predicate is true:
︸︷︷︸^ ∃x for some x
belonging to D
, P (x) (is true)
For example, for D = { birds }, P (x) = “x is angry”,
︸︷︷︸^ ∃x Some
birds
, P (x) (is true) ︸ ︷︷ ︸ are angry
The term nested quantification refers to statements involving several quantifiers. Here is a series of examples.
Example 27. All statements involve two predicate variables x and y, where x has for domain R = { rabbits }, while y has for domain T = { tortoises }. The predicate used is C(x, y) =“Rabbit x is faster than tortoise y”.
︸︷︷︸^ ∀x For any
rabbit x
, ∀y ︸︷︷︸ for any
tortoise y
C(x, y) (is true) ︸ ︷︷ ︸ x is faster than y
︸︷︷︸^ ∀x For any
rabbit x
, ∃y ︸︷︷︸ there is
a tortoise y
C(x, y) (is true) ︸ ︷︷ ︸ such that x is faster than y
︸︷︷︸^ ∃x There exists
a rabbit x such that
, ∀y ︸︷︷︸ for any
tortoise y
C(x, y) (is true) ︸ ︷︷ ︸ x is faster than y
Nested Quantification (II)
Nested Quantification (III)
There is some (at least one) student in this class who is not using Facebook or not using Google+ (or may be using neither)
How To Determine Truth Value
Statement When true When false xD,P(x) P(x) is true for every x.
There is one x for which P(x) is false. xD,P(x) There is one x for which P(x) is true.
P(x) is false for every x.
Method of Case. Suppose you want to show that the truth value of (∃ x, P (x)) is true. For this, you just need to find one case, one instantiation of x, for which P (x) is true.
Example 28. P (x) = “∃ x ∈ Z, x^2 = x is true, take x = 1 for example. Thus such an x exists.
Similarly, if you want to show that the truth value of (∀ x, P (x)) is false, it is enough to find one counterexmaple.
Example 29. P (x) = “∀ x ∈ R, x^2 > x is false, take x = 0.3 for example. Thus P (x) cannot be true for all x.
However, you cannot show that (∃ x, P (x)) is false using some examples, you need to prove that you cannot find a single x in your domain for which P (x) is true! Vice-versa, you cannot show that (∀ x, P (x)) is true by giving some examples, you need to show that this is always true, for every x in the domain considered. To do this, again, if the domain is small, one may use the exhaustion method of trying all options, but if the domain is big (or infinite), like Z, we need another method. Method of Logic Derivation. This method consists of using logical steps to transform one logical expression into another.
Example 30. Suppose you want to know the truth value of ∃ x, (P (x) ∨ Q(x)), x has for domain D = {x 1 ,... , xn}. Then ∃ x, (P (x) ∨ Q(x)) is true if there is an xi ∈ D for which P (xi) ∨ Q(xi) is true that is
(∃ x, (P (x) ∨ Q(x))) ≡ (P (x 1 ) ∨ Q(x 1 )) ∨... ∨ (P (xn) ∨ Q(xn))
but now this new expression becomes true exactly when at least one P (xi) or Q(xj ) is true, that is
(∃ x, (P (x) ∨ Q(x))) ≡ (∃ x, P (x)) ∨ (∃ x, Q(x)). When trying to derive logic steps involving quantifiers, one should be very careful with the ordering of the quantifiers...A typical example is that
∀ x, ∃ y, P (x, y) ≡ ∃ y, ∀ x, P (x, y)
does not hold in general!
Example 31. Consider the predicate P (x, y) = “x admires y”. Then ∀ x, ∃ y, P (x, y) means that everyone admires someone, while ∃ y, ∀ x, P (x, y) means that there exists one person who is admired by everyone!
Our motivating Example 21 to start predicate logic was:
Example 33. Consider the following two statements: (1) Every SCE student must study discrete mathematics. (2) Jackson is an SCE student. It looks “logical” to deduce that therefore, Jackson must study discrete mathematics.
We will now develop inference rules, that will allow us to express this example (see Exercise 28). Consider a predicate variable x taking value in the domain D. Then ∀x ∈ D, P (x); ∴ P (c) for any c ∈ D.
As we did for propositional logic, we look at when the premises are true. When ∀x, P (x) is true, P (x) is true for any choice of x in the domain D, in particular it is true for any choice of c, therefore P (c) is true for any c ∈ D. This rule says that if P (x) is true for any x in a domain, one is allowed to instantiate P (x) in x = c for any choice of c ∈ D.
Example 34. Suppose we have the following premises: (1) No cat can catch Jerry; (2) Tom is a cat. We want to deduce that therefore Tom cannot catch Jerry. We define two predicates: Cat(x)=“x is a cat”, Catch(x)=“x can catch Jerry”. The second premise, Tom is a cat, is the easiest to write, it becomes: Cat(Tom)=“Tom is a cat”. Now for the first premise, suppose we want to say “cats are catching Jerry”, this would be if x is a cat, then x catches Jerry, that is Cat(x) → Catch(x),
keeping in mind that we have not yet assigned a quantifier to this statement. To say that “cats are not catching Jerry”, then this would be if x is cat, then x cannot catch Jerry, that is
Cat(x) → ¬Catch(x),
and finally, to say that “no cat can catch Jerry”, we add a universal quantifier:
∀x(Cat(x) → ¬Catch(x)).
We then have the following premises in predicate logic:
We can then instantiate the first premise with x =Tom, to get
(Cat(Tom) → ¬Catch(Tom)).
But since the second premise says that Cat(Tom); modus ponens (p → q; p; ∴ q) tells us that therefore ¬Catch(Tom).
Consider a predicate variable x taking value in the domain D. Then
P (c) for an arbitrary c ∈ D; ∴ ∀x P (x) ∈ D.
This just means that if a predicate is true for an arbitrary element c ∈ D, then it is true for all x ∈ D. Indeed, if whichever premise you look at is true, then the conclusion is true. This rule allows us to infer P (x) for all x ∈ D based on P (c) being true for an arbitrary instance c ∈ D.
Example 35. Consider the premise for an arbitrary real number x, x^2 ≥ 0. Therefore the square of any real number is non-negative. Set P (x) = “x^2 ≥ 0”. In predicate logic, we have for any arbitrary c ∈ R, P (c). Therefore ∀x P (x).
In fact, we have already used this rule implicitly...In Exercise 2, we showed that if n^2 is even, then n is even, for n an integer. The way we did it, is that we showed the result for one arbitrary n, and concluded this is true for all of them! See Exercise 29 for a more complicated example. Consider a predicate variable x taking value in the domain D. Then
∃x ∈ D, P (x); ∴ P (c) for some c ∈ D.
We look at when the premises are true. When ∃x, P (x) is true, P (c) is true for at least one choice of c in the domain D. This rule allows to instantiate P (x) in some values of c for which P (c) is true.
Example 36. The premises are: (1) if any student gets > 80 in the exam, then (s)he gets an A, (2) there are students who get > 80 in the exam, (3) Sam is such a student. We want to conclude that therefore Sam gets an A. Set the predicates A(x) = “x gets an A”, M (x) = “x gets > 80 in the exam”, the domain D is D = { students }. In predicate logic, (1) and (2) are respectively given by
Now that Sam is such a student can be expressed using the above rule, to obtain M(Sam). Then we can instantiate 1. with Sam, to get M(Sam) → A(Sam), which combined with M(Sam) leads to therefore A(Sam).
Existential Instantiation
Domain={all students}; A(x)=“x gets an A” M(x) = “x gets 80 in the final exam”
Existential Generalization
Domain={all people} , Sell(x) =“x is selling stocks”. x Sell(x) x Sell(x)