L03fol MSR2023
L03fol MSR2023
L03fol MSR2023
(Predicate Calculus)
This Lecture
This time we will talk about first order logic, a logic on quantified statements.
Quantifiers
Negation
Multiple quantifiers
b c
a
How to formulate the statement that there are infinitely many primes?
Predicates
Predicates are propositions (i.e. sentences) with variables
And becomes a statement when specific values are substituted for the variables
Given a set, the (only) important question is whether an element belongs to it.
Example: x Z y Z, x + y = y + x.
Pythagorean’s theorem
– Take x = ½ . Clearly x R
– (½)2 = ¼ ½
Counterexample
– So, this is false
The Existential Quantifier
e.g.
x y. x y
Domain Truth value
integers T
positive integers + T
negative reals - T
Truth and Falsity of Existential Statements
n Z, n > 2
Translating Mathematical Theorem
Goldbach’s conjecture: Every even number is the sum of two prime numbers.
Negation
Multiple quantifiers
Not (everyone likes football) = There exists someone who doesn’t like football.
(generalized) DeMorgan’s Law Say the domain has only three values.
The same idea can be used to prove it for any number of variables, by mathematical induction.
Negations of Quantified Statements
Not (exists a plant that can fly) = All plants/ Every plant cannot fly.
(generalized) DeMorgan’s Law Say the domain has only three values.
The same idea can be used to prove it for any number of variables, by mathematical induction.
Negation Exercises
• primes p, p is odd.
– a prime p such that p is not odd.
• a triangle T such that the sum of the
angles of T equals 200°
– triangles T, the sum of the angles of T does
not equal 200°
Informal -> Formal -> Negate
• No politicians are honest
– Formal: politicians x, x is not honest.
– Negation: a politician x such that x is
Negate
honest.
– Informal Negation: Some politicians are
honest
• All politicians are honest
Informal Negation: Ambiguity
• All mathematicians wear glasses Depends on the
verbal stress
Informally Negate:
• All mathematicians do not wear glasses
– Meaning 1: There are mathematicians who do
not wear glasses.
Contrapositive
Contrapositive
Quantifiers
Negation
Multiple quantifiers
For every computer virus, there is an anti-virus program that kills it.
There is one (single) anti-virus program that kills all computer viruses.
Order of Quantifiers
There is an anti-virus program killing every computer virus.
For every computer virus, there is an anti-virus program that kills it.
is expensive!
Order of Quantifiers
There is an anti-virus program killing every computer virus.
There is one single anti-virus program that kills all computer viruses.
Example: P is CSE-antivirus,
protects against ALL viruses
For every program, there is some virus that it can not kill.
Exercises
B
º sZ+ xZ+ (s x)
º sZ+ xZ+ s ≰ x
º sZ+ xZ+ x < s
2. There is no smallest positive real number.
Negation
Multiple quantifiers
Propositional validity
A B B A
True no matter what the truth values of A and B are
Propositional validity
A B B A
True no matter what the truth values of A and B are
Universal instantiation:
2 & UI
Formally
x, E(x) S(x)
E(6)
S(6)
Arguments with Quantified Statements
Universal modus tollens:
H(x) M(x)
Formally
x, H(x) M(x)
M(Zeus)
H(Zeus)
All professors are absent-minded
1 c
Sohel Rahman is not absent-minded
Calculate c.
1
Conclusion:???
Are you using any argument we taught?
Sohel Rahman is not a professor.
x professor(x) absent-minded(x)
~absent-minded(Sohel)
~professor(Sohel)
valid rule
Then z [Q(z) P(z)] is true, because every number is either even or odd.
But x.Q(x) is not true, since not every number is an even number.