Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
20 views

Chapter 2

Uploaded by

2023239336
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Chapter 2

Uploaded by

2023239336
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

CHAPTER 2

Logical Equivalence and Soundness

1. INTRODUCTION

In this chapter we are going to explore another way to write an expression;


using a uniform symbol of logical connective called Normal Form. Two kinds
of normal form either use disjunctive or conjunctive symbols. Then we learn
that there are various forms of equivalence in writing expressions. This facility
is used in finding a conclusion in a group of statements. Rules of inferences
help us draw conclusions in a given statement problem. For problems involving
mathematical statements, we can use methods of proof to check the validity of
statement given.

2. NORMAL FORMS

Logical expression is said to be in disjunctive normal form (DNF) if it is written


as a disjunction, in which all terms are conjunctions of literals.
Logical expression is said to be in conjunctive normal form (CNF) if it is written
as a conjunction of disjunctions of literals.
Example:
DNF: (p ∧q) ∨ (p ∧ ¬q)
CNF: p ∧ (q ∨ r)

2.1 Conjunctive Normal Form

A compound statement is in conjunctive normal form if it is obtained by


operating AND among variables (negation of variables included) connected with
ORs. In terms of set operations, it is a compound statement obtained by
Intersection among variables connected with Unions.
1. Three steps to obtain a CNF using logical laws:
1. Remove all → and ↔
2. If the expression contains any negated compound subexpressions,
either remove the negation by using the double-negation law or use De
Morgan’s laws to reduce the scope of the negation
3. Simplify the expression using appropriate rules (distributive,
associative etc.)
Example: Convert the following expression into CNF
¬((P ∨ ¬Q) ∧ ¬R)
Solution:
¬((P ∨ ¬Q) ∧ ¬R)
≡ ¬(P ∨ ¬Q) ∨ ¬¬R De Morgan
≡ ¬(P ∨ ¬Q) ∨ R Double negation
≡ (¬P ∧ ¬¬Q) ∨ R De Morgan
≡ (¬P ∧ Q) ∨ R Double negation
≡ (¬P ∨ R) ∧ (Q ∨ R) Rule II

2. Three steps to obtain a CNF using truth table:


1. Get the 0 (False) value from the table
2. Read in disjunctive form of 0 (False) value
3. Complement of every item in disjunctive expression.

Example:
P Q R Output
1 1 1 1
1 1 0 1
1 0 1 0
1 0 0 0
0 1 1 1
0 1 0 1
0 0 1 0
0 0 0 1

Solution:
Get the F value from the table
Read in disjunctive form = (P ∧ ¬Q ∧ R) ∨ (P ∧ ¬Q ∧ ¬R) ∨ (¬P ∧ ¬Q ∧ R)
Complement the whole expressions
= (¬P ∨ Q ∨ ¬R) ∧ (¬P ∨ Q ∨ R) ∧ (P ∨ Q ∨ ¬R)
CNF : (¬P ∨ Q ∨ ¬R) ∧ (¬P ∨ Q ∨ R) ∧ (P ∨ Q ∨ ¬R)
2.2 Disjunctive Normal Form

A compound statement is in disjunctive normal form if it is obtained by operating


OR among variables (negation of variables included) connected with ANDs. In
terms of set operations, it is a compound statement obtained by Union among
variables connected with intersections.

1. Three steps to obtain a DNF using logical laws:


1. Remove all → and ↔
2. If the expression contains any negated compound subexpressions,
either remove the negation by using the double-negation law or use De
Morgan’s laws to reduce the scope of the negation.
3. Simplify the expression using appropriate rules.

Example: Convert the following expression into DNF

(P → (Q ∧ R)) ∨ ¬(P ∨ ¬(R∨S))

Solution:

(P → (Q ∧ R)) ∨ ¬(P ∨ ¬(R∨S))

≡ (¬P ∨ (Q ∧ R)) ∨ ¬(P ∨ ¬(R∨S)) Useful

≡ (¬P ∨ (Q ∧ R)) ∨ (¬P ∧ ¬¬(R∨S)) De Morgan

≡ (¬P ∨ (Q ∧ R)) ∨ (¬P ∧ (R∨S)) Double negation

≡ (¬P ∨ (Q ∧ R)) ∨ ((¬P ∧ R) ∨(¬P ∧ S)) Rule I


2. Two steps to obtain a DNF using truth table:
1. Get the T value from the table
2. Read in disjunctive form of T value

Example:
P Q R Output
1 1 1 1
1 1 0 0
1 0 1 1
1 0 0 0
0 1 1 0
0 1 0 0
0 0 1 1
0 0 0 0

Solution:
Get the T value from the table
Read in disjunctive form = (P ∧ Q ∧ R) ∨ (P ∧ ¬Q ∧ R) ∨ (¬P ∧ ¬Q ∧ R)

DNF : (P ∧ Q ∧ R) ∨ (P ∧ ¬Q ∧ R) ∨ (¬P ∧ ¬Q ∧ R)

Tips on how to use logical laws


Step 1. Eliminate the arrow using Useful rule

Step 2. Reduce the scope of negation

Step 3. Simplify the expression using appropriate rules


3. LOGICAL EQUIVALENCE AND EQUALITY

Definition: The propositions p and q are called logically equivalent if p ↔ q is


a tautology (alternately, if they have the same truth table). The notation p ↔ q
denotes p and q are logically equivalent.

We have seen that some of the propositions are equivalent.


Their truth values in the truth table are the same.

Example: p → q is equivalent to ¬q → ¬p (contrapositive). Proof using Truth


Table. We can show that these 2 expressions are logically equivalence by using
biconditional notation.

p q ¬p ¬q p→q ¬q → ¬p (p → q) ↔
(¬q → ¬p)

1 1 0 0 1 1 1

1 0 0 1 0 0 1

0 1 1 0 1 1 1

0 0 1 1 1 1 1

Can you notice that the last column (biconditional) produces TAUTOLOGY?

Equivalent statements are important for logical reasoning since they


can be substituted and can help us to make a logical argument.
3.1 Important Logical Equivalence

i. DeMorgan's Laws:
1) ¬( p ∨ q ) ↔ ¬p ∧ ¬q
2) ¬( p ∧ q ) ↔ ¬p ∨ ¬q

Example: Negate "The summer in Mexico is cold and sunny" with DeMorgan's
Laws.
Solution: "The summer in Mexico is not cold or not sunny."

ii. Identity
p∧T↔p
p∨F ↔ p

iii. Domination
p∨T↔T
p∧F ↔ F

iv. Idempotent
p∨p ↔p
p∧p ↔p

v. Double negation
¬(¬p) ↔ p

vi. Commutative
p∨q↔q∨p
p∧q↔q∧p

vii. Associative
(p ∨ q) ∨ r ↔ p ∨ (q ∨ r)
(p ∧ q) ∧ r ↔ p ∧ (q ∧ r)

viii. Distributive
p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r)
p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r)

ix. Useful
p ∨ ¬p ↔ T
p ∧ ¬p ↔ F
p → q ↔ (¬p ∨ q)
3.2 Proving Techniques

Two expression P1 and P2 are logically equivalent if and only if P1 and


P2 have the same truth value under any assignment of truth values to their
atomic parts.

To verify that two expressions are logically equivalent, we can check using
TWO methods; a truth table or rules of equivalence.

i. Using Truth Table

Example 1: Show (p ∧ q) → p is a tautology.

p q p∧q (p ∧ q) → p
1 1 1 1
1 0 0 1

0 1 0 1
0 0 0 1

ii. Using Equivalence Rules

Example 1: Show that (p ∧ q) → p is a tautology.


• Proof: (we must show (p ∧ q) → p ↔ T)
(p ∧ q) → p ↔ ¬(p ∧ q) ∨ p Useful
↔ [¬p ∨ ¬q] ∨ p DeMorgan
↔ [¬q ∨ ¬p] ∨ p Commutative
↔ ¬q ∨ [ ¬p ∨ p ] Associative
↔ ¬q ∨ [ T ] Useful
↔ T Domination
End of proof

Example 2: Show (p → q) ↔ (¬q → ¬p)


• Proof
(p → q) ↔ (¬q → ¬p)
↔ ¬(¬q) ∨ (¬p) Useful
↔ q ∨ (¬p) Double negation
↔ ¬p ∨ q Commutative
↔p→q Useful
End of proof
4. RULES OF INFERENCE

Mathematical logic is often used for logical proofs. Proofs are valid arguments
that determine the truth values of mathematical statements.
An argument is a sequence of statements. The last statement is the conclusion,
and all its preceding statements are called premises (or hypothesis). The symbol
“∴”, (read therefore) is placed before the conclusion. A valid argument is one
where the conclusion follows from the truth values of the premises.

Rules of Inference provide templates or guidelines for constructing valid


arguments from the statements that we already have.

4.1 Important Rules


i. Modus Ponens, or the Law of Detachment

in ROI form:

p→q

∴q

• Given p is true and the implication p → q is true then q is true.

Example: It is below freezing now. If it is below freezing then it is raining


snow. Therefore, it is raining snow.

ii. Addition

p → (p ∨ q)

in ROI form:

∴p∨q

Example: It is below freezing now. Therefore, it is below freezing or


raining snow.
iii. Simplification

(p ∧ q) → p

In ROI form:

p∧q

∴p

Example: It is below freezing and snowing. Therefore it is below


freezing.

iv. Modus Tollens

[ ¬q ∧ (p → q)] → ¬p

in ROI form:

¬q

p→q

∴ ¬p

Example:

v. Hypothetical Syllogism

[(p → q) ∧ (q → r)] → (p → r)

in ROI form:

p→q

q→r

∴p→r

Example:
vi. Disjunctive Syllogism

[(p ∨ q) ∧ ¬p] → q

in ROI form:

p∨q

¬p

∴q

Example:

4.2 Applying the Rules

Assume the following statements (hypotheses):

• It is not sunny this afternoon and it is colder than yesterday.

• We will go swimming only if it is sunny.

• If we do not go swimming then we will take a canoe trip.

• If we take a canoe trip, then we will be home by sunset.

Show that all these lead to a conclusion:

• We will be home by sunset.

Text:

• It is not sunny this afternoon and it is colder than yesterday.

• We will go swimming only if it is sunny.

• If we do not go swimming then we will take a canoe trip.

• If we take a canoe trip, then we will be home by sunset.

Propositions:
• p = It is sunny this afternoon, q = it is colder than yesterday,

r = We will go swimming , s= we will take a canoe trip

• t= We will be home by sunset

Translation:

• Assumptions: ¬ p ∧ q, r → p, ¬ r → s, s→ t

• Hypothesis: t

Translations:

• p = It is sunny this afternoon, q = it is colder than yesterday,

r = We will go swimming , s= we will take a canoe trip

Conclusion t= We will be home by sunset

Premises:

P1 ¬ p ∧ q

P2 r → p

P3 ¬ r → s,

P4 s→ t

Conclusion : t

Translations:

• Premises: P1 ¬ p ∧ q,P2 r → p, P3 ¬ r → s, P4 s→ t

• Conclusion: t

Proof:

1. ¬ p ∧ q Premise 1
2. ¬ p Simplification

3. r → p Premise 2

4. ¬ r Modus tollens (step 2 and 3)

5. ¬ r → s Premise 3

6. s Modus ponens (steps 4 and 5)

7. s→ t Premise 4

8. t Modus ponens (steps 6 and 7)

end of proof

5. PROOF TECHNIQUES

Proofs of equivalence
Previously we used the law of equivalence p ↔ q is replaced with (p → q) ∧
(q → p)’

General methods to prove the theorems:


i. Direct proof
– p → q is proved by showing that if p is true then q follows
ii. Indirect proof
– Show the contrapositive ¬q → ¬p. If ¬q holds then ¬p follows
iii. Proof by contradiction
– Show that (p ∧ ¬ q) contradicts the assumptions
iv. Proof by cases
- To proof all cases involved are true

Sometimes one method of proof does not go through as nicely as the


other method. You may need to try more than one approach.

5.1 Direct proof

p → q is proved by showing that if p is true then q follows.

Example: Prove that “If n is odd, then n2 is odd.”

Proof:
• Assume the hypothesis is true, i.e. suppose n is odd.
p: n is odd
q : n x n is odd

• Then n = 2k + 1, where k is an integer. n2 = (2k+1)2


= 4k2 + 4k + 1
= 2(2k2 + 2k) + 1
• Therefore, n2 is odd.

5.2 Indirect proof

To show p → q prove its contrapositive ¬q → ¬p


• Why? p → q and ¬q → ¬p are equivalent !!!
• Assume ¬q is true, show that ¬p is true.

Example: Prove If 3n + 2 is odd then n is odd.

Proof:
p: 3n + 2 is odd
q: n is odd

• Assume n is even, that is n = 2k, where k is an integer.


• Then: 3n + 2 = 3(2k) + 2
= 6k + 2
= 2(3k+1)
• Therefore 3n + 2 is even.
• We proved ¬ “n is odd” → ¬ “3n + 2 is odd”. This is equivalent to “3n
+ 2 is odd” → “n is odd”.

5.3 Proof by Contradiction

We want to prove p → q. The only way to reject (or disprove) p → q is to show


that (p ∧ ¬q ) can be true.
However, if we manage to prove that either q or ¬ p is True then we
contradict (p ∧ ¬q ) and subsequently p → q must be true

Proof by contradiction. Show that the assumption (p ∧ ¬q ) leads either


to q or ¬ p which generates a contradiction.

We want to prove p → q
• To reject p → q show that (p ∧ ¬q ) can be true
• To reject (p ∧ ¬q ) show that either q or ¬ p is True

Example: Prove If 3n + 2 is odd then n is odd.

Proof:
p: 3n + 2 is odd
q: n is odd, ¬q : n is even

• Assume 3n + 2 is odd and n is even, that is n = 2k, where k an integer.


• Then: 3n + 2 = 3(2k) + 2
= 6k + 2
= 2(3k + 1)
• Thus 3n + 2 is even. This is a contradiction with the assumption that
3n + 2 is odd. Therefore n is odd.

5.4 Proof by cases

We want to show p1 ∨ p2 ∨ … ∨ pn → q
Equivalent to (p1 → q) ∧ (p2 → q) ∧ … ∧ (pn → q)

Prove individual cases as before. All of them must be true.

Example: Show that |x||y|=|xy|.


Proof:
• 4 cases:
• x >=0, y>=0 ; xy >0 and |xy|=xy=|x||y|
• x>= 0, y <0 ; xy < 0 and |xy|=-xy =x (-y)=|x||y|
• x<0, y>=0 ; xy < 0 and |xy|=-xy =(-x) y=|x||y|
• x<0, y <0 ; xy >0 and |xy|= (-x)(-y) =|x||y|
• All cases proved.
SUMMARY
1. Normal forms
DNF and CNF
2 approaches:
i. Using rules/law
ii. Using Truth Table

2. Equivalence
Implication = contrapositive = useful

3. ROI
MP, MT, HS, DS, Simplification, addition, useful, etc

4. MOP
4 methods:
i. Direct
ii. Indirect/contrapositive
iii. Contradiction
iv. By cases

You might also like