0% found this document useful (0 votes)
45 views

L02 Predicate Logic

The document discusses propositional and predicate logic. It includes examples of propositional logic concepts like tautologies, contradictions, and proofs using propositional equivalences. It also covers predicate logic, defining predicates, quantifiers, and providing examples of quantified statements with universal and existential quantifiers over various domains. It discusses how to negate quantified statements by moving the negation inward and changing quantifiers according to generalized DeMorgan's laws.

Uploaded by

Abu OUbaida
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

L02 Predicate Logic

The document discusses propositional and predicate logic. It includes examples of propositional logic concepts like tautologies, contradictions, and proofs using propositional equivalences. It also covers predicate logic, defining predicates, quantifiers, and providing examples of quantified statements with universal and existential quantifiers over various domains. It discusses how to negate quantified statements by moving the negation inward and changing quantifiers according to generalized DeMorgan's laws.

Uploaded by

Abu OUbaida
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 22

CS103

Discrete Mathematics
Propositional Logic - say a bit…
This week we’re using propositional logic as a foundation for
formal proofs.

Propositional logic is also the key to writing good code…you can’t


do any kind of conditional (if) statement without understanding
the condition you’re testing.

10/15/20
Propositional Logic - 2 more defn…

A tautology is a proposition that’s always TRUE.

A contradiction is a proposition that’s always FALSE.

p p p  p p  p
T F T F
F T T F

10/15/20
Propositional Logic - an unfamous 
if NOT (blue AND NOT red) OR red then…

(p  q)  q  p  q

(p  q)  (p  q)  DeMorgan’s



q q
 (p  q)  Double negation
q
 p  (q  Associativity
q)
 p  q Idempotent

10/15/20
Propositional Logic - one last proof

 Show that [p  (p  q)]  q is a tautology.


 We use  to show that [p  (p  q)]  q  T.
[p  (p  q)]  q
 [p  (p  q)]  substitution
q [(p  p)  (p  q)]
  
for
distributive
q
 [ F  (p  q)]  q uniqueness
 (p  q)  q identity
 (p  q)  q substitution
 (p  q)  q for 
DeMorgan’s
 p  (q  q ) associative
 p  T excluded middle
 T domination
10/15/20
Predicate Logic - everybody loves somebody

Proposition, YES or NO?


3+2=5 YES
X+2=5 NO
X + 2 = 5 for any choice of X in {1, 2, 3}
YES
X + 2 = 5 for some X in {1, 2, 3}
YES

10/15/20
Predicate Logic - everybody loves somebody

Alicia eats pizza at least once a week.


Garrett eats pizza at least once a week.
Allison eats pizza at least once a week.
Gregg eats pizza at least once a week.
Ryan eats pizza at least once a week.
Meera eats pizza at least once a week.
Ariel eats pizza at least once a week.

10/15/20
Predicates

Alicia eats pizza at least once a week.


Define:
EP(x) = “x eats pizza at least once a week.”
Universe of Discourse - x is a student in
cse1207

A predicate, or propositional function, is a


function that takes some variable(s) as
arguments and returns True or False.

Note that EP(x) is not a proposition, EP(Ariel) is.

10/15/20
Predicates

Suppose Q(x,y) = “x > y”

Proposition, YES or NO?


Q(x,y)
NO
Q(3,4)
Predicate, YES or NO?
Q(x,9) YES
Q(x,y) YES
NO
Q(3,4) NO
Q(x,9)
YES
10/15/20
Predicates - the universal quantifier

Another way of changing a predicate into a proposition.

Suppose P(x) is a predicate on some universe of discourse.


Ex. B(x) = “x is carrying a backpack,” x is set of cse1207 students.

The universal quantifier of P(x) is the proposition:


“P(x) is true for all x in the universe of discourse.”

We write it x P(x), and say “for all x, P(x)”

x P(x) is TRUE if P(x) is true for every single x.


x P(x) is FALSE if there is an x for which P(x) is false.

x B(x)?
10/15/20
Predicates - the existential quantifier

Another way of changing a predicate into a proposition.

Suppose P(x) is a predicate on some universe of discourse.


Ex. C(x) = “x has a candy bar,” x is set of cs173 students.

The existential quantifier of P(x) is the proposition:


“P(x) is true for some x in the universe of discourse.”

We write it x P(x), and say “for some x, P(x)”

x P(x) is TRUE if there is an x for which P(x) is true.


x P(x) is FALSE if P(x) is false for every single x.

x C(x)?
10/15/20
Predicates - the existential quantifier

 A domain must always be specified when a statement ∃xP(x) is used.


Furthermore, the meaning of ∃xP(x) changes when the domain
changes. Without specifying the domain, the statement ∃xP(x) has no
meaning.

10/15/20
Predicates - more examples

L(x) = “x is a lion.” Universe of discourse


is all creatures.
F(x) = “x is fierce.”
C(x) = “x drinks coffee.”

All lions are fierce.


x (L(x) 
Some lions don’t drink coffee.
F(x))
Some fierce creatures don’t drink x (L(x) 
coffee.
C(x))

x (F(x) 
C(x))
10/15/20
Predicates - more examples

L(x) = “x is a lion.” Universe of discourse


is all creatures.
F(x) = “x is fierce.”
C(x) = “x drinks coffee.”

 Notice that the second statement cannot be written as


∃x(P(x)→ ¬ R(x)). The reason is that P(x)→ ¬ R(x)
is true whenever x is not a lion, so that ∃x(P(x)→ ¬
R(x)) is true as long as there is at least one creature that
is not a lion, even if every lion drinks coffee.

10/15/20
Predicates - more examples

B(x) = “x is a hummingbird.”
L(x) = “x is a large bird.” Universe of discourse
H(x) = “x lives on honey.” is all creatures.
R(x) = “x is richly colored.”

All hummingbirds are richly colored. x (B(x) 


No large birds live on honey. R(x))
xdully
Birds that do not live on honey are 
colored.
(L(x)
H(x))

x (H(x) 
10/15/20 R(x))
Predicates - quantifier negation

Not all large birds live on honey. x (L(x) 


H(x))
x P(x) means “P(x) is true for every x.”
What about x P(x) ?
Not [“P(x) is true for every x.”]
“There is an x for which P(x) is not true.”
x P(x)

So, x P(x) is the same as x P(x).

x (L(x) 
H(x))
10/15/20
Negations of Quantified Statements
Everyone likes football. Every mother loves her child.

What is the negation of this statement?

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.
10/15/20
Predicates - quantifier negation

No large birds live on honey. x (L(x) 


H(x))
x P(x) means “P(x) is true for some x.”
What about x P(x) ?
Not [“P(x) is true for some x.”]
“P(x) is not true for all x.”
x P(x)

So, x P(x) is the same as x P(x).

x (L(x) 
H(x))
10/15/20
Negations of Quantified Statements

There is a plant that can fly.

What is the negation of this statement?

Not exists a plant that can fly = 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.
10/15/20
Predicates - quantifier negation

So, x P(x) is the same as x P(x).


So, x P(x) is the same as x P(x).

General rule: to negate a quantifier, move


negation to the right, changing quantifiers as
you go.

10/15/20
Predicates - quantifier negation

No large birds live on honey.

x (L(x)  H(x))  x (L(x)  H(x)) Negation


rule
 x (L(x)  H(x)) DeMorgan’s

 x (L(x)  H(x)) Subst for 

What’s wrong with


this proof?

10/15/20
Predicates - quantifier negation

Show that ¬∀ x(P(x) → Q(x)) and ∃x(P(x)∧ ¬


Q(x)) are logically equivalent.

10/15/20

You might also like