Logic Charles L Dodgson 1832 - 1898 It s so easy even - - PowerPoint PPT Presentation

logic
SMART_READER_LITE
LIVE PREVIEW

Logic Charles L Dodgson 1832 - 1898 It s so easy even - - PowerPoint PPT Presentation

IIT Bombay :: Autumn 2020 :: CS 207 :: Discrete Structures :: Manoj Prabhakaran Logic Charles L Dodgson 1832 - 1898 It s so easy even Quantifiers computers can do it! Predicates & Propositions Winged(x) Flies(x) Pink(x) x


slide-1
SLIDE 1

IIT Bombay :: Autumn 2020 :: CS 207 :: Discrete Structures :: Manoj Prabhakaran

Quantifiers

Logic

It’ s so easy even computers can do it!

Charles L Dodgson
 1832 - 1898

slide-2
SLIDE 2

Predicates & Propositions

A predicate is a column in this table A proposition like Winged(Alice) refers to a single cell. Can build more complex propositions using propositional calculus (formulas) Next: Propositions involving quantifiers.

x Winged(x) Flies(x) Pink(x) Alice FALSE FALSE FALSE Jabberwock TRUE TRUE FALSE Flamingo TRUE TRUE TRUE

slide-3
SLIDE 3

x Winged(x) Flies(x) Pink(x) Alice FALSE FALSE FALSE Jabberwock TRUE TRUE FALSE Flamingo TRUE TRUE TRUE

Quantified Propositions

All characters in AIW are winged. (False!) For every character x in AIW, Winged(x) holds Some character in AIW is winged. (True) There exists a character x in AIW, such that Winged(x) holds ∀x Winged(x) ∃x Winged(x)

(First-Order) Predicate Calculus

∈ AIW

slide-4
SLIDE 4

x Winged(x) Flies(x) Pink(x) Alice FALSE FALSE FALSE Jabberwock TRUE TRUE FALSE Flamingo TRUE TRUE TRUE

Quantified Propositions

∀x Winged(x) ∃x Winged(x)

(First-Order) Predicate Calculus

Quantifiers: To what “extent” does a predicate evaluate to TRUE in the domain of discourse Universal quantifier, ∀ Existential quantifier, ∃

slide-5
SLIDE 5

x Winged(x) Flies(x) Pink(x) Alice FALSE FALSE FALSE Jabberwock TRUE TRUE FALSE Flamingo TRUE TRUE TRUE

Quantified Propositions

Could write ∀x Winged(x) as: Winged(Alice) ∧ Winged(J’wock) ∧ Winged(Flamingo) And ∃x Winged(x) as: Winged(Alice) ∨ Winged(J’wock) ∨ Winged(Flamingo) But need to list the entire domain (works only if finite)

(First-Order) Predicate Calculus

slide-6
SLIDE 6

∀x Winged(x) ↔ Flies(x) ∃x Winged(x) → ¬Flies(x) ∀x Pink(x) → Flies(x)

x Winged(x) Flies(x) Pink(x) Alice FALSE FALSE FALSE Jabberwock TRUE TRUE FALSE Flamingo TRUE TRUE TRUE

Examples

Winged(x)↔Flies(x) TRUE TRUE TRUE Winged(x)→ ¬Flies(x) TRUE FALSE FALSE

is True is True is True

Pink(x)→ Flies(x) TRUE TRUE TRUE

slide-7
SLIDE 7

¬Winged(x) TRUE FALSE FALSE x Winged(x) Flies(x) Pink(x) Alice FALSE FALSE FALSE Jabberwock TRUE TRUE FALSE Flamingo TRUE TRUE TRUE

∀x Winged(x) is False Not everyone is winged Same as saying, there is someone who is not winged i.e., ∃x ¬Winged(x) is True ¬ ( ∀x W(x) ) ≡ ∃x ¬W(x)

Quantified Propositions

(First-Order) Predicate Calculus

¬( W(a) ∧ W(j) ∧ W(f) ) ≡ ¬W(a) ∨ ¬W(j) ∨ ¬W(f)

slide-8
SLIDE 8

Predicates, again

A predicate can be defined over any number of elements from the domain e.g., Likes(x,y): “x likes y”

x,y Likes(x,y)

Alice, Alice TRUE Alice, Jabberwock FALSE Alice, Flamingo TRUE Jabberwock, Alice FALSE Jabberwock, Jabberwock TRUE Jabberwock, Flamingo FALSE Flamingo, Alice FALSE Flamingo, Jabberwock FALSE Flamingo, Flamingo TRUE

slide-9
SLIDE 9

Two quantifiers

And we can quantify all the variables of a predicate e.g. ∀x,y Likes(x,y) Everyone likes everyone False!

x,y Likes(x,y)

Alice, Alice TRUE Alice, Jabberwock FALSE Alice, Flamingo TRUE Jabberwock, Alice FALSE Jabberwock, Jabberwock TRUE Jabberwock, Flamingo FALSE Flamingo, Alice FALSE Flamingo, Jabberwock FALSE Flamingo, Flamingo TRUE

slide-10
SLIDE 10

Two quantifiers

∀x ∃y Likes(x,y) Everyone likes someone (True)

x,y Likes(x,y)

Alice, Alice TRUE Alice, Jabberwock FALSE Alice, Flamingo TRUE Jabberwock, Alice FALSE Jabberwock, Jabberwock TRUE Jabberwock, Flamingo FALSE Flamingo, Alice FALSE Flamingo, Jabberwock FALSE Flamingo, Flamingo TRUE

Order of quantifiers is important!

∃y ∀x Likes(x,y) Someone is liked by everyone (False)

slide-11
SLIDE 11

Two quantifiers

∀x ∃y Likes(x,y)

x y Likes(x,y)

Alice Alice TRUE Jabberwock FALSE Flamingo TRUE Jabberwock Alice FALSE Jabberwock TRUE Flamingo FALSE Flamingo Alice FALSE Jabberwock FALSE Flamingo TRUE

∃y Likes(x,y) i.e., LikesSomeone(x)

TRUE TRUE TRUE

∀x LikesSomeone(x) True Everyone likes someone

slide-12
SLIDE 12

Moving the Quantifiers

∀x ∀y P(x,y) ≡ ∀y ∀x P(x,y) for all pairs (x,y), P(x,y) holds ∃x ∃y P(x,y) ≡ ∃y ∃x P(x,y) for some pair (x,y), P(x,y) holds Below R is a proposition not involving x ∀x P(x) ∨ R ≡ (∀x P(x) ) ∨ R

Scope of x extends to the end: ∀x (P(x) ∨ R) i.e., if domain is {a1,…,aN} (P(a1)∨R) ∧ … ∧ (P(aN)∨R) R evaluates to True or False (indep of x) When R is True, both equivalent (to True) Also, when R is False, both equivalent Hence both equivalent

slide-13
SLIDE 13

∃x P(x) ∨ R ≡ (∃x P(x) ) ∨ R ∃x P(x) ∧ R ≡ (∃x P(x) ) ∧ R

Moving the Quantifiers

∀x ∀y P(x,y) ≡ ∀y ∀x P(x,y) for all pairs (x,y), P(x,y) holds ∃x ∃y P(x,y) ≡ ∃y ∃x P(x,y) for some pair (x,y), P(x,y) holds Below R is a proposition not involving x ∀x P(x) ∨ R ≡ (∀x P(x) ) ∨ R ∀x R → P(x) ≡ R → (∀x P(x) ) ∃x R → P(x) ≡ R → (∃x P(x) ) ∀x P(x) ∧ R ≡ (∀x P(x) ) ∧ R ∀x P(x) → R ≡

∀x ¬P(x) ∨ R ≡ (∀x ¬P(x)) ∨ R ≡ ¬ (∃x P(x)) ∨ R

(∃x P(x)) → R ∃x P(x) → R ≡ (∀x P(x)) → R

slide-14
SLIDE 14

(∀x P(x)) ∧ (∀x Q(x)) ≡ ∀x (P(x) ∧ Q(x)) (∃x P(x)) ∨ (∃x Q(x)) ≡ ∃x (P(x) ∨ Q(x)) ∃x P(x) ∨ R ≡ (∃x P(x) ) ∨ R ∃x P(x) ∧ R ≡ (∃x P(x) ) ∧ R

Moving the Quantifiers

∀x ∀y P(x,y) ≡ ∀y ∀x P(x,y) for all pairs (x,y), P(x,y) holds ∃x ∃y P(x,y) ≡ ∃y ∃x P(x,y) for some pair (x,y), P(x,y) holds Below R is a proposition not involving x ∀x P(x) ∨ R ≡ (∀x P(x) ) ∨ R ∀x R → P(x) ≡ R → (∀x P(x) ) ∃x R → P(x) ≡ R → (∃x P(x) ) ∀x P(x) ∧ R ≡ (∀x P(x) ) ∧ R ∀x P(x) → R ≡ (∃x P(x)) → R ∃x P(x) → R ≡ (∀x P(x)) → R (∀x P(x)) ∨ (∀x Q(x)) ≡ (∀x P(x)) ⋁ (∀y Q(y)) ≡ ∀x ( P(x) ⋁ (∀y Q(y)) ) ≡ ∀x ( ∀y (P(x) ⋁ Q(y)) ) ≡ ∀x ∀y (P(x) ⋁ Q(y))

P Q

slide-15
SLIDE 15

(∀x P(x)) ∧ (∀x Q(x)) ≡ ∀x (P(x) ∧ Q(x)) (∃x P(x)) ∨ (∃x Q(x)) ≡ ∃x (P(x) ∨ Q(x)) ∃x P(x) ∨ R ≡ (∃x P(x) ) ∨ R ∃x P(x) ∧ R ≡ (∃x P(x) ) ∧ R

Moving the Quantifiers

∀x ∀y P(x,y) ≡ ∀y ∀x P(x,y) for all pairs (x,y), P(x,y) holds ∃x ∃y P(x,y) ≡ ∃y ∃x P(x,y) for some pair (x,y), P(x,y) holds Below R is a proposition not involving x ∀x P(x) ∨ R ≡ (∀x P(x) ) ∨ R ∀x R → P(x) ≡ R → (∀x P(x) ) ∃x R → P(x) ≡ R → (∃x P(x) ) ∀x P(x) ∧ R ≡ (∀x P(x) ) ∧ R ∀x P(x) → R ≡ (∃x P(x)) → R ∃x P(x) → R ≡ (∀x P(x)) → R (∀x P(x)) ∨ (∀x Q(x)) ≡ ∀x ∀y P(x) ⋁ Q(y) (∃x P(x)) ⋀ (∃x Q(x)) ≡ ∃x ∃y P(x) ⋀ Q(y) ¬(∀x P(x)) ≡ ∃x ¬P(x) ¬(∃x P(x)) ≡ ∀x ¬P(x)

∄x P(x)