Upload
others
View
45
Download
0
Embed Size (px)
Citation preview
Chapter 2.
Sanguk Noh
Logic
Propositions and logical operations
Conditional statements
Methods of proof
Mathematical Induction
Propositions and logical operations
Propositions and logical operations
Def.) statement or proposition
A declarative sentence that is either true or false, but not both.
e.g.)
statement Not a statement
The earth is round. Do you play tennis?
2+3=5 3-x=5
Take two aspirins.
Propositions and logical operations Logical connectives and compound statements
Propositional variables : can be replaced by statements
Compound statements : by logical connectives
syntax
Syntax
Negation ~p
Conjunction p∧q
Disjunction p∨q
Implication p⇒q
Equivalence p⇔q
Universal ∀x
Existential ∃x
Relation R(x,y)
Propositions and logical operations
Negation of p
Conjunction of p and q (⇒ and)
p ~p
T F
F T
~: not ⇒ a unary operation
p q p∧q
T T T
T F F
F T F
F F F
Propositions and logical operations
Disjunction of p and q (⇒ or)
e.g.) p : It is snowing. q: 3<5
p∧q : It is snowing and 3<5.
p∨q : It is snowing or 3<5.
p q p∨q
T T T
T F T
F T T
F F F
Propositions and logical operations
Quantifiers A predicate or a propositional function P(x)
{x | P(x)} - properties of objects or
- relations between objects
Universal quantification For all values of x, P(x) is true.
⇒ ∀x P(x)
Existential quantification There exists a value of x for which P(x) is true.
⇒ ∃x P(x)
Universal quantifier
existential quantifier
*negation ~(∀x P(x)) = ∃x~P(x) ~(∃x P(x)) = ∀x~P(x)
Conditional statements Conditional statements
Conditional statement or implication If p then q : p ⇒ q conclusion
hypothesis (premise)
p q p⇒q ~p∨q ~q⇒~p
T T T T T
T F F F F
F T T T T
F F T T T
A false hypothesis implies any conclusion.
~q⇒~p ≡ q∨~p ≡ ~p∨q Contrapositive of p⇒q
Conditional statements Equivalence (or biconditional)
p if and only if q : p⇔q
e.g.) 3>2 if and only if 0<(3-2)
p q p⇒q q⇒p p⇔q
T T T T T
T F F T F
F T T F F
F F T T T
Conditional statements Tautology
A statement that is “true for all possible values” of its propositional variables
Contradiction : always false
Contingency : either true or false e.g.)
(p⇒q)⇔(~p∨q) : tautology
p∧~p: contradiction (nil)⇒empty clause
(p⇒q)∧(p∨q) : contingency
p and q are logically equivalent, p≡q, if p⇔q is a tautology.
e.g.) p∨q≡q∨p, if (p∨q) ⇔ (q∨p) is a tautology.
Conditional statements Theorem 1. the operations for propositions
(a) commutativity p∨q ≡ q∨p, p∧q ≡ q∧p
(b) associativity p∨(q∨r)≡(p∨q)∨r, p∧(q∧r)≡(p∧q)∧r
(c) distributivity p∨(q∧r)≡(p∨q)∧(p∨r) p∧(q∨r)≡(p∧q)∨(p∧r)
(d) Idempotency p∨p≡p, p∧p≡p
(e) negation ~(~p)≡p, ~(p∨q)≡~p∧~q ~(p∧q)≡~p∨~q
Conditional statements Theorem 2. The implication operation
(a) (p⇒q) ≡ (~p∨q) ≡ (~q⇒~p)
(b) (p⇔q) ≡ (p⇒q)∧(q⇒p)
(c) ~(p⇒q) ≡ ~(~p∨q) ≡ p∧~q
(d) ~(p⇔q) ≡ ~(~p∨q)∨~(~q∨p)
≡ (p∧~q)∨(q∧~p)
Conditional statements Formal system or formal languages
Propositional logic : facts(exists in the world)
First-order predicate logic : facts, objects, relations
Objects(things) : people, numbers, colors…..
Relations : brother of, owns, bigger than, equals..
Functions : plus, cosine, father of,….
We can quantify over objects but not over relations or functions on those objects.
Conditional statements
Theorem 3. The universal and existential quantifiers (a) ~(∀xP(x)) ≡ ∃x~P(x)
(b) ~(∃xP(x)) ≡ ∀x~P(x)
(c) ∀xP(x) ≡ ~∃x~P(x) e.g.) ∀x Likes(x, IceCream) ≡ ~∃x ~Likes(x, IceCream)
Everyone likes ice cream.
There is no one who does not like ice cream.
(d) ∃xP(x) ≡ ~∀x~P(x) e.g.) ∃x Likes(x, IceCream) ≡ ~∀x ~Likes(x, IceCream)
Someone likes ice cream.
Not everyone doesn’t like ice cream.
Methods of proof Methods of proof
q logically follows from p, if p⇒q is a tautology.
e.g.) (p1∧ p2∧… ∧ pn)⇒q : tautology
hypotheses P1
P2
⋮ pn
∴ q
conclusion
q logically follows from p 1, p2, …, pn
*mathematical proofs: if the p i‘s are all true, q has to be true. As beginning w/ the hypotheses, →each step is justified by rules of inference, →arriving at the conclusion.
Methods of proof Theorem 4. inference rules : tautology
(a) (p∧q)⇒p (b)(p∧q)⇒q
→ and-elimination
~(p∧q)∨p=~p∨~q∨p
~(p∧q)∨q=~p∨~q∨q
(c) p⇒(p∨q) (d) q⇒(p∨q)
→ or-introduction
~p∨p∨q ~q∨p∨q
Methods of proof (e) ~p⇒(p⇒q) (f) ~(p⇒q)⇒p
p∨(~p∨q) ~p∨q∨p
(g) (p∧(p⇒q)) ⇒ q
→modus ponens
=~(p∧(~p∨q))∨q
=(~p∨(p∧~q))∨q
=((~p∨p)∧(~p∨~q))∨q
=(~p∨~q)∨q=~p∨(~q∨q)
p p→q ∴q
Methods of proof (h)(~p∧(p∨q))⇒q = ~(~p∧(p∨q))∨q
= p∨~(p∨q)∨q
= (p∨q)∨~(p∨q)
(i) (~q∧(p⇒q)) ⇒~p
=~(~q∧(~p∨q))∨~p
=q∨~(~p∨q)∨~p=(q∨~p)∨~(q∨~p)
(j) ((p⇒q)∧(q⇒r)) ⇒ (p⇒r)
((~p∨q)∧(~q∨r)) ⇒ ~p∨r
→Unit resolution
→resolution
Mathematical induction We wish to show that P(n) is true ∀n≥n0, where n0
is some fixed integer.
(1) 『In the basis step we show that P(n0)is true.』
That is, P is true of n0.
(2) 『 The induction hypothesis is the assumption that for
some fixed but arbitrary k≥n0, P(k) is true. 』
(3) 『 In the induction step we show, using the induction
hypothesis, that P(k+1) must also be true. 』