Transcript PPT

Propositional Logic
School of Athens
Fresco by Raphael
Wikimedia Commons
Discrete Structures (CS 173)
Madhusudan Parthasarathy, University of Illinois
Mathematical logic (symbolic logic)
Study of inference using abstract rules that does
not assume any particular knowledge of things
or of properties.
E.g.: All men are mortal
Socrates is a man
Inference: Socrates is mortal.
E.g. All pigs are boisterous
Alfred is a pig.
Inference: Alfred is boisterous
All snarks are frabjous
Yeti is a snark.
Inference: Yeti is frabjous
Key idea: Inference is independent of the
subjects (men, pigs, snarks) and properties
(mortality, boisterousness, frabjousness).
Inference follows simply from language!
All p’s are q.
h is a p.
Inference: h is q.
βˆ€π‘₯. 𝑝 π‘₯ β‡’ π‘ž π‘₯
𝑝 β„Ž
Inference: q(h)
But inference rules needn’t hold in natural
language!
… quirks of English
Sam and Sally are programmers.
Inference: Sam is a programmer
Sam and Sally are together.
Inference: Sam is together!
So we need a formal language…. logic!
Propositional logic
A proposition is a statement that is either true or false.
Examples:
β€’ Socrates is a man
β€’ This car is purple
β€’ 43 is prime
Non-examples:
β€’ Trucks
β€’ Hello
β€’ Trkjkjugirtu
Propositional logic
Propositional logic talks about Boolean combinations of
propositions and inferences we can make about them.
E.g., If it is raining, then it is cloudy.
It is not cloudy.
Inference: It is not raining.
Abstraction: p: it is raining q: it is cloudy
(𝑝 β‡’ π‘ž) ∼ π‘ž
Inference: ~ 𝑝
Propositional logic
Propositions: p, q, r, s, ….
Constants: T, F
Operators (boolean):
∧∢ and
∨: π‘œπ‘Ÿ
¬, ~ ∢ π‘›π‘œπ‘‘
β‡’: π‘–π‘šπ‘π‘™π‘–π‘’π‘ 
⟺∢ bi-implication; iff
Syntax: Any formula that combines propositions and
constants using these operators
Propositional logic: Semantics
A formula f, in general, doesn’t have a β€œtruth”
value associated to it.
Model: M
- Assigns truth/falsehood to each proposition
Any formula f evaluates to true/false in such a
model.
Implication can be non-intuitive
π‘β‡’π‘ž
says β€œif p is true then q is true”
If the model sets p to true, and q to true,
then 𝑝 β‡’ π‘ž evaluates to true.
If the model sets p to true, and q to false,
then 𝑝 β‡’ π‘ž evaluates to false.
If the model sets p to false and q to true,
then 𝑝 β‡’ π‘ž evaluates to true.
If the model sets p to false and q to false,
then 𝑝 β‡’ π‘ž evaluates to true! (vacuosly)
Implication
So 𝑝 β‡’ π‘ž is really the same as ~𝑝 β‹π‘ž
β€œIf p then q” is same as
β€œeither p is false or q is true”
Tautology
A formula is a tautology if it evaluates to true in every model.
E.g. 𝒑 ∨ ~𝒑
If model sets p to true, then formula is true.
If model sets p to false, then formula is true.
E.g., ( 𝒑 β‡’ 𝒒 ∧ 𝒒 β‡’ 𝒓 ) β‡’ (𝒑 β‡’ 𝒓)
Why?
β€œDo you like this or not?” --- β€œYes”
Non-example: 𝒑,
𝒑 βˆ¨π’’
Equivalence
Formulas f and g are equivalent (𝑓 ≑ 𝑔) if
in every model M,
either both f and g evaluate to true in M
or both evaluate to false in M.
E.g., ~𝑝 ⋁ π‘ž ≑ 𝑝 β‡’ π‘ž
Some important equivalences
β€’ ~~𝑓 ≑ 𝑓
β€’ 𝑓 β‡’ 𝑔 ≑ ~𝑓 ⋁ 𝑔
β€’ 𝑓 β‡’ 𝑔 ≑ ~𝑓 ⋁ 𝑔 ≑ ~~𝑔 ⋁ ~𝑓 ≑ ~𝑔 β‡’ ~𝑓
~𝑔 β‡’ ~𝑓 𝑖𝑠 π‘‘β„Žπ‘’ π‘π‘œπ‘›π‘‘π‘Ÿπ‘Žπ‘π‘œπ‘ π‘–π‘‘π‘–π‘£π‘’ π‘œπ‘“ 𝑓 β‡’ 𝑔
β€’ ~ 𝑓 ∧ 𝑔 ≑ ~𝑓 ∨ ~𝑔
β€’ ~ 𝑓 ∨ 𝑔 ≑ ~𝑓 ∧ ~𝑔
β€’ ~ 𝑓 β‡’ 𝑔 ≑ 𝑓 ∧ ~𝑔
De Morgan’s laws
Some important equivalences
Distributive laws:
β€’ β„Žβˆ§ π‘“βˆ¨π‘” ≑ β„Žβˆ§π‘“ ∨ β„Žβˆ§π‘”
β€’ β„Žβˆ¨ π‘“βˆ§π‘” ≑ β„Žβˆ¨π‘“ ∧ β„Žβˆ¨π‘”
Commutativity
β€’ π‘“βˆ§π‘”β‰‘π‘”βˆ§π‘“
β€’ π‘“βˆ¨π‘”β‰‘π‘”βˆ¨π‘“
Associativity
β€’ π‘“βˆ§ π‘”βˆ§β„Ž ≑ π‘“βˆ§π‘” βˆ§β„Ž
β€’ π‘“βˆ¨ π‘”βˆ¨β„Ž ≑ π‘“βˆ¨π‘” βˆ¨β„Ž
Contrapositive, converse, negation
Proposition:
β€œIf the sky is green, then I’m a monkey’s uncle.”
β€’ Converse
– If I’m a monkey’s uncle, then the sky is green.
β€’ Contrapositive
– If I’m not a monkey’s uncle, then the sky is not green.
β€’ Negation
– The sky is green, but I am not a monkey’s uncle.
Contrapositive, converse, negation
Proposition:
β€œIf the sky is green, then I’m a monkey’s uncle.”
β€’ Converse
– If I’m a monkey’s uncle, then the sky is green.
β€’ Contrapositive
– If I’m not a monkey’s uncle, then the sky is not green.
β€’ Negation
– The sky is green, but I am not a monkey’s uncle.
More manipulation examples
Show that these are tautologies:
~π‘ž ∧ 𝑝 β‡’ π‘ž
β‡’ ~𝑝
𝑝 ∨ π‘ž ∧ ~𝑝 β‡’ π‘ž
Logistics
β€’ If you’re not registered yet and
– Sign sheet at end of class (again)
– Sign up for moodle and piazza
– Keep on top of homeworks
β€’ only mini-homework for next week
β€’ will be released by Friday
β€’ No discussion sections this week
See you next week!
β€’ Tuesday
– More logic
β€’ Predicate logic
β€’ Quantifiers
β€’ Binding and scope
– Direct proofs
β€’ Thursday
– More proof practice and strategies