chapter 1. the foundations: logic and proofs 1.4 logical

Post on 25-Feb-2022

3 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CSI30

Chapter 1. The Foundations: Logic and Proofs

1.4 Logical Equivalences1.5 Laws of Propositional Logic

1

CSI30Propositional Equivalences

An important step used in a mathematical argument is the replacement of a statement with another statement with the same truth value.

tautology is a compound proposition that is always true, no matter what the truth values of the propositions that occur in it.

contradiction is a compound proposition that always false.

contingency is a compound statement that is neither a tautology nor a contradiction.

2

CSI30Propositional Equivalences

An important step used in a mathematical argument is the replacement of a statement with another statement with the same truth value.

tautology is a compound proposition that is always true, no matter what the truth values of the propositions that occur in it.

example: p p

contradiction is a compound proposition that always false.

example: p p

contingency is a compound statement that is neither a tautology nor a contradiction.

example: p q p 3

p p p p0 1 1

1 0 1

p p p p0 1 0

1 0 0

CSI30Propositional Equivalences

Two compound propositions, p and q, are logically equivalent if p q is a tautology.

We'll write p q or p q

Ways to determine whether two compound proposition are equivalent:● truth tables (columns giving their truth values agree)● use laws

Example 1: proof by truth tables that p q and p q are logically equivalent.

4

p q p p q p q

T T F

T F F

F T T

F F T

CSI30Propositional Equivalences

Two compound propositions, p and q, are logically equivalent if p q is a tautology.

We'll write p q or p q

Ways to determine whether two compound proposition are equivalent:● truth tables (columns giving their truth values agree)● use laws

Example 1: proof by truth tables that p q and p q are logically equivalent.

5

p q p p q p q

T T F T

T F F F

F T T T

F F T T

CSI30Propositional Equivalences

Two compound propositions, p and q, are logically equivalent if p q is a tautology.

We'll write p q or p q

Ways to determine whether two compound proposition are equivalent:● truth tables (columns giving their truth values agree)● use laws

Example 1: proof by truth tables that p q and p q are logically equivalent.

6

p q p p q p q

T T F T T

T F F F F

F T T T T

F F T T T

CSI30Propositional Equivalences

Two compound propositions, p and q, are logically equivalent if p q is a tautology.

We'll write p q or p q

Ways to determine whether two compound proposition are equivalent:● truth tables (columns giving their truth values agree)● use laws

Example 1: proof by truth tables that p q and p q are logically equivalent.

Reading of both compound propositions:Let p: “the weather is good” and q: “we'll go swimming” Then,p q: “If the weather is good, we'll go swimming”; andp q: “the weather is not good or we'll go swimming”

7

CSI30Laws of Propositional Logic

Here is a list of some important equalities:

8

(p q) p q(p q) p q

De Morgan's Laws

p p pp p p

Idempotent laws

( p) p Double negation law

p T Tp F F

Domination laws

p q q pp q q p

Commutative laws

p T pp F p

Identity laws

p (p q) pp (p q) p

Absorption lawsp p Tp p F

Negation laws

(p q) r p (q r)(p q) r p (q r)

Associative laws

p (q r) (p q) (p r)p (q r) (p q) (p r)

Distributive laws

(1)

(2)

(3)

(4)

(5)

(6)

(7)

(8)

(9)

(10)

CSI30

Here is more of important equalities:

9

p q p q p q (p q) (q p)

p q q p p q p q

p q p q p q (p q) (p q)

p q (p q) (p q) p q

(p q) p q

(p q) (p r) p (q r)

(p q) (p r) p (q r)

(p r) (q r) (p q) r

(p r) (q r) (p q) r

(11) (12)

(13) (14)

(15) (16)

(17) (18)

(19)

(20)

(21)

(22)

(23)

Laws of Propositional Logic

CSI30

Example 2: Show that p q and q p are logically equivalent using the above laws.

10

Laws of Propositional Logic

CSI30

Example 2: Show that p q and q p are logically equivalent using the above laws.

We'll start from q p:

11

Laws of Propositional Logic

CSI30Propositional Equivalences

Example 2: Show that p q and q p are logically equivalent using the above laws.

We'll start from q p:q p q p by (11)

12

p q p q

CSI30Propositional Equivalences

Example 2: Show that p q and q p are logically equivalent using the above laws.

We'll start from q p:q p q p by (11)

q p by double negation law (2)

13

( p) p

CSI30Propositional Equivalences

Example 2: Show that p q and q p are logically equivalent using the above laws.

We'll start from q p:q p q p by (11)

q p by double negation law (2) p q by commutative laws (3)

14

p q q p

CSI30Propositional Equivalences

Example 2: Show that p q and q p are logically equivalent using the above laws.

We'll start from q p:q p q p by (11)

q p by double negation law (2) p q by commutative laws (3) p q by (11)

15

p q p q

CSI30Propositional Equivalences

Example 2: Show that p q and q p are logically equivalent using the above laws.

We'll start from q p:q p q p by (11)

q p by double negation law (2) p q by commutative laws (3) p q by (11)

Example 3: Show that (p q) and p q are logically equivalent.

16

CSI30Propositional Equivalences

Example 2: Show that p q and q p are logically equivalent using the above laws.

We'll start from q p:q p q p by (11)

q p by double negation law (2) p q by commutative laws (3) p q by (11)

Example 3: Show that (p q) and p q are logically equivalent.

(p q)

17

p q

CSI30Propositional Equivalences

Example 2: Show that p q and q p are logically equivalent using the above laws.

We'll start from q p:q p q p by (11)

q p by double negation law (2) p q by commutative laws (3) p q by (11)

Example 3: Show that (p q) and p q are logically equivalent.

(p q) ((p q) (q p)) by (12)

18

p q (p q) (q p) by (12)

CSI30Propositional Equivalences

Example 2: Show that p q and q p are logically equivalent using the above laws.

We'll start from q p:q p q p by (11)

q p by double negation law (2) p q by commutative laws (3) p q by (11)

Example 3: Show that (p q) and p q are logically equivalent.

(p q) ((p q) (q p)) by (12) (p q) (q p) by (1) (p q) (q p) by (11) (p q) (q p) (1) (p q) (q p) by (2)

19

p q (p q) (q p) by (12)

CSI30Propositional Equivalences

Example 2: Show that p q and q p are logically equivalent using the above laws.

We'll start from q p:q p q p by (11)

q p by double negation law (2) p q by commutative laws (3) p q by (11)

Example 3: Show that (p q) and p q are logically equivalent.

(p q) ((p q) (q p)) by (12) (p q) (q p) by (1) (p q) (q p) by (11) (p q) (q p) (1) (p q) (q p) by (2)

20

p q (p q) (q p) by (12) (p q) (q p) by (11) (p q) (q p) by (2) ((p q) q) ((p q) p) by (10) (p q) (q q) (p p) (q p) (p q) F F (q p) by (8) (p q) (q p) by (7)

CSI30Propositional Equivalences

Example 4: Show that ((p q) (q r)) (p r) is a tautology without using truth tables.

Let's prove by contrapositive (see lecture 1 slides, slide 12)(having p q, ¬q ¬p)

(p r) ((p q) (q r)) (p r) ((p q) (q r)) by (11)

(p r) ((p q) (q r)) by double negation law (2) (p r) ((p q) (q r)) by (1) (p r) ((p q) (q r)) by (11) three times (p r) ((p q) (q r)) by (1) twice (p r) ((p q) (q r)) by double negation law (2) twice p r (p q) (q r) re-writing (p (p q)) (r (q r)) re-grouping by (3)

((p p) (p q)) ((r q) (r r)) by (10) (T (p q)) ((r q) T) by (8) twice (p q) (r q) by (7) twice p q r q p r T by (8)

T by (6) 21

top related