equivalence and implication

35
Outline Properties of Propositions Logical Equivalences Practice with Boolean Operators and Algebra Implication Summary Equivalence and Implication Alice E. Fischer CSCI 1166 Discrete Mathematics for Computing February 14, 2018 Alice E. Fischer Laws of Logic. . . 1/34

Upload: others

Post on 18-Apr-2022

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Equivalence and Implication

Alice E. Fischer

CSCI 1166 Discrete Mathematics for ComputingFebruary 14, 2018

Alice E. Fischer Laws of Logic. . . 1/34

Page 2: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

1 Properties of PropositionsLogical EquivalenceContradictions and Tautologies

2 Logical Equivalences

3 Practice with Boolean Operators and Algebra

4 ImplicationNecessary and Sufficient ConditionsInside out and Backwards

5 Summary

Alice E. Fischer Laws of Logic. . . 2/34

Page 3: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Logical EquivalenceContradictions and Tautologies

Properties of Propositions

Logical EquivalenceContradictions and Tautologies

Alice E. Fischer Laws of Logic. . . 3/34

Page 4: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Logical EquivalenceContradictions and Tautologies

Logical Equivalence: ≡Two propositions are logically equivalent (≡) if they have thesame outcomes under all input conditions.

We can determine whether two propositions are equivalent (≡) bycomparing the last column in the truth tables for the twostatements.

P Q P ∨ Q Q ∨ P

T T T TT F T TF T T TF F F F

For example, The column for P ∨ Q is the same as the column forQ ∨ P, so the two propositions are equivalent .

Alice E. Fischer Laws of Logic. . . 4/34

Page 5: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Logical EquivalenceContradictions and Tautologies

Example: The Supervisor’s Critique

Do you remember John and his elevator design from last time?John’s supervisor looked at his logic and told him “It’s toocomplex, O is just the opposite of M”. Simplify! So John thoughta bit and added a column with a simpler formula to his truth table.

(O ∧ ∼M)∨

O M ∼O ∼M O ∧ ∼M ∼O ∧M (∼O ∧M) O ⊕MT T F F F F F FT F F T T F T TF T T F F T T TF F T T F F F F

Indeed, the boss was right. They are equivalent!

Alice E. Fischer Laws of Logic. . . 5/34

Page 6: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Logical EquivalenceContradictions and Tautologies

Contradictions

A contradiction is a proposition that is always false, no matterwhat the input truth values are.

For example, this is a contradiction:An odd number, X, equals 2 * some even number, Y.

And this is a contradiction: P ∧ ∼PLet P be All dogs are black.All dogs are black and not (all dogs are black).

A contradiction can be symbolized by c.

Alice E. Fischer Laws of Logic. . . 6/34

Page 7: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Logical EquivalenceContradictions and Tautologies

Tautologies

A tautology is a proposition that is always true, no matter whatthe input truth values are.

For example:Let Q be the proposition Today is Tuesday.

Then this is a tautology: Q ∨ ∼QToday is Tuesday or today is not Tuesday.

A tautology can be symbolized by t.

Alice E. Fischer Laws of Logic. . . 7/34

Page 8: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Logical Equivalences

A set of rules for logical calculation can be proven from thedefinitions using truth tables. They will be presented in thefollowing slides.

These laws are analogs of the laws for algebra and for sets that youalready know. They are essential in making logical proofs andseveral are also important in programming.

The following slides define the laws for symbolic logic. Thecorresponding set-theory law(s) will be given at the bottom of eachslide.

Alice E. Fischer Laws of Logic. . . 8/34

Page 9: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

1. Commutative Laws

Both and and or are commutative, that is, the left and right sidescan be reversed without changing the meaning of the proposition.

P ∧ Q ≡ Q ∧ P

P ∨ Q ≡ Q ∨ P

This is important in programming.

Set theory: ∩ and ∪ are commutative. Given sets A and B,A ∩ B ≡ B ∩ AA ∪ B ≡ B ∪ A

Alice E. Fischer Laws of Logic. . . 9/34

Page 10: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

2. Associative Laws

Both and and or are associative operators, that is, you mayparenthesize the expression any way you wish without changing itsmeaning.

(P ∧ Q) ∧ R ≡ P ∧ (Q ∧ R)

(P ∨ Q) ∨ R ≡ P ∨ (Q ∨ R)

This is important in programming.

Set theory: ∩ and ∪ are associative. Given sets P, Q, and R,(P ∩ Q) ∩ R ≡ P ∩ (Q ∩ R)(P ∪ Q) ∪ R ≡ P ∪ (Q ∪ R)

Alice E. Fischer Laws of Logic. . . 10/34

Page 11: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

3. Distributive Laws

Both and and or can be distributed over the other operator.

P ∧ (Q ∨ R) ≡ (P ∧ Q) ∨ (P ∧ R)

P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R)

This is important in programming.

Set theory: ∩ and ∪ can be distributed over each other.Given sets P, Q, and R,

P ∩ (Q ∪ R) ≡ (P ∩ Q) ∪ (P ∩ R)P ∪ (Q ∩ R) ≡ (P ∪ Q) ∩ (P ∪ R)

Alice E. Fischer Laws of Logic. . . 11/34

Page 12: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

4. Identity Laws

The identity laws are based on the definitions of and and or.

P ∧ t ≡ P

P ∨ c ≡ P

Set Theory: The set identity laws are based on definitions of theUniversal set and the empty set.Given set A,

A ∩ U ≡ AA ∪ ∅ ≡ A

Alice E. Fischer Laws of Logic. . . 12/34

Page 13: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

5. Negation Laws

The negation laws are based on the definitions of and, or, and not.

P ∨ ∼P ≡ t

P ∧ ∼P ≡ c

Set Theory: Complement LawsThe set complement laws are based on definitions of the Universalset, empty set, and complement.Given set A,

A ∪ Ac ≡ UA ∩ Ac ≡ ∅

Alice E. Fischer Laws of Logic. . . 13/34

Page 14: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

6. Double Negative Law

The double-negative law is based on the definitions of not.

∼ (∼P) ≡ P

Set Theory: Double Complement LawThis is based on the definitions of complement.Given set A,

(Ac)c ≡ A

Alice E. Fischer Laws of Logic. . . 14/34

Page 15: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

7. Idempotent Laws

and, or are idempotent, meaning that the trivial computationshave no effect and can be repeated without changing the meaningof the expression.

P ∧ P ≡ P

P ∨ P ≡ P

Set Theory: intersection and union are idempotent.Given set A,

A ∩ A ≡ AA ∪ A ≡ A

Alice E. Fischer Laws of Logic. . . 15/34

Page 16: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

8. Universal Bound Laws

A contradiction and anything is a contradiction.A tautology or anything is a tautology.

P ∧ c ≡ c

P ∨ t ≡ t

The shortcut evaluation of logical operators in C is based on these.

Set Theory: The empty set is as small as you can get and theuniversal set is as large as you can get. Given set A,

A ∩ ∅ ≡ ∅A ∪ U ≡ U

Alice E. Fischer Laws of Logic. . . 16/34

Page 17: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

9. DeMorgan’s Laws

To distribute not over and, change the and to or.To distribute not over or, change the or to and.

∼ (P ∧ Q) ≡ ∼P ∨ ∼Q∼ (P ∨ Q) ≡ ∼P ∧ ∼Q

These laws are very important in programming and in databases.

Set Theory:To distribute complement over ∩, change the ∩ to ∪.To distribute complement over ∪, change the ∪ to ∩.Given sets A,B,

(A ∩ B)c ≡ Ac ∪ Bc

(A ∪ B)c ≡ Ac ∩ Bc

Alice E. Fischer Laws of Logic. . . 17/34

Page 18: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

10. Absorption Laws

A truth table can be used to verify these absorptions.

P ∨ (P ∧ Q) ≡ P

P ∧ (P ∨ Q) ≡ P

These laws are important in proofs.

Set Theory:Given sets A,B,

A ∪ (A ∩ B) ≡ A That is, A ∪ a subset of A is still A.A ∩ (A ∪ B) ≡ A That is, A ∩ a superset of A is still A.

Alice E. Fischer Laws of Logic. . . 18/34

Page 19: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

11. Negations of t and c

The negation of a tautology is a contradiction and vice versa.

∼ t ≡ c

∼ c ≡ t

Set Theory:The complement of the Universal set is the empty set, and viceversa.

Uc ≡ ∅∅c ≡ U

Alice E. Fischer Laws of Logic. . . 19/34

Page 20: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Practice

This section contains three logical expressions to simplified byapplying the rules, and one law to prove using truth tables.

Alice E. Fischer Laws of Logic. . . 20/34

Page 21: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

1. Proving DeMorgan’s Law

Construct a truth table to prove that ∼(P ∧ Q) ≡ ∼P ∨ ∼Q

P Q P ∧ Q ∼(P ∧ Q) ∼P ∼Q (∼P ∨ ∼Q)T T T F F F FT F F T F T TF T F T T F TF F F T T T T

Compare the contents of the fourth and seventh columns.They are the same, so the two expressions are equivalent.

Alice E. Fischer Laws of Logic. . . 21/34

Page 22: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

2. Two small messes to simplify.

(P∧ ∼ Q) ∨ (P ∧ Q) Initial expression.P ∧ (∼ Q ∨ Q) Use the distributive law, backwards.P ∧ (t) Use negation law.P Use identity law.

P ∧ (∼ Q ∨ P)(P∧ ∼ Q) ∨ (P ∧ P) Distributive law.(P∧ ∼ Q) ∨ P Idempotent lawP ∨ (P∧ ∼ Q) Commutative lawP Absorption law.

Alice E. Fischer Laws of Logic. . . 22/34

Page 23: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

3. A big mess.

(P ∧ (∼ (∼P ∨ Q))) ∨ (P ∧ Q) Initial expression(P ∧ (∼∼P) ∧ ∼Q)) ∨ (P ∧ Q) DeMorgan’s law.(P ∧ ( P ∧ ∼ Q)) ∨ (P ∧ Q) Double negative law.((P ∧ P) ∧ ∼Q) ∨ (P ∧ Q) Associative law.( P ∧ ∼Q) ∨ (P ∧ Q) Idempotent law.

P ∧ (∼Q ∨ Q) Distributive law, backwards.P ∧ (t) Negation law.P Identity law.

Alice E. Fischer Laws of Logic. . . 23/34

Page 24: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Necessary and Sufficient ConditionsInside out and Backwards

Implication

→ and its Truth TableNecessary and Sufficient Conditions

Inside out and Backwards

Alice E. Fischer Laws of Logic. . . 24/34

Page 25: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Necessary and Sufficient ConditionsInside out and Backwards

→ and its Truth Table

The symbol → is called if. . . then in the textbook.

It is more traditional to call it implies.

The proposition P → Q is read P implies Q or if P, then Q

We say that P is the premise and Q is the conclusion.

The truth table for P → Q is:

P Q P → Q ∼ P ∼ P ∨ Q

T T T F TT F F F FF T T T TF F T T T

It is also true that P → Q ≡ ∼ P ∨ Q

Alice E. Fischer Laws of Logic. . . 25/34

Page 26: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Necessary and Sufficient ConditionsInside out and Backwards

Implication Can be Confusing.

Sometimes, but not always, P → Q means that P causes Q:I didn’t increment my loop variable so my program had aninfinite loop.

Sometimes P → Q is used to define a term:If a creature is bipedal, it has two feet.

The conclusion can be true independently of the premise: Ifthe moon is made of green cheese then UNH is a university.This is often called a vacuous truth.

The implication is true when both the premise and theconclusion are false. if 0 = 1 then 1 = 2.

A truth table is the most reliable way to figure out the correctinterpretation of an implication.

Alice E. Fischer Laws of Logic. . . 26/34

Page 27: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Necessary and Sufficient ConditionsInside out and Backwards

If and Only If ↔

P → Q is a conditional statement that can be read if P then Q.

Now suppose that P → Q and also Q → P.

Then we write P ↔ Q, which can be read P if and only if Q.

This statement is called a biconditional.

P Q P → Q Q → P P ↔ Q

T T T T TT F F T FF T T F FF F T T T

Alice E. Fischer Laws of Logic. . . 27/34

Page 28: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Necessary and Sufficient ConditionsInside out and Backwards

Necessary and Sufficient Conditions ↔

A sufficient condition is a premise or set of premises that areenough, without any more premises, to prove the conclusion.

If C is a sufficient condition for S , then C → S .

A necessary condition is a premise that must be true in orderfor the conclusion to be true.

If C is a necessary condition for S , then ∼C → ∼S .

If a condition C is both necessary and sufficient for S , thenC ↔ S .

Alice E. Fischer Laws of Logic. . . 28/34

Page 29: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Necessary and Sufficient ConditionsInside out and Backwards

Inside Out and Backwards

There are four ways to “reverse” the proposition P → Q:

The contrapositive is ∼ Q → ∼P.

The converse is Q → P.

The inverse is ∼P → ∼Q.

The negation is ∼(P → Q), which is equivalent to P ∧ ∼Q.

A proposition and its contrapositive are equivalent.

A proposition is not equivalent to its converse, inverse, ornegation. For example,“If it is a bee, it can fly” is not ≡ to “If it can fly, it is a bee”.

Alice E. Fischer Laws of Logic. . . 29/34

Page 30: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Necessary and Sufficient ConditionsInside out and Backwards

The four “opposites” of P → Q:

A conditional is equivalent to its contrapositive.

The inverse is equivalent to the converse and has the oppositetruth value of the proposition.

Conditional ConverseP → Q Q → P

Inverse Contrapositive∼P → ∼Q ∼Q → ∼P

P Q ∼P ∼Q P → Q ∼Q → ∼P Q → P ∼P → ∼QT T F F T T T TT F F T F F T TF T T F T T F FF F T T T T T T

Alice E. Fischer Laws of Logic. . . 30/34

Page 31: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Necessary and Sufficient ConditionsInside out and Backwards

The Negation of P → Q:

When you need to negate an implication, it is usually best to workwith the form on the right.

∼(P → Q) ≡ ∼Q ∧ P

P Q ∼Q P → Q ∼(P → Q) ∼Q ∧ PT T F T F FT F T F T TF T F T F FF F T T F F

Alice E. Fischer Laws of Logic. . . 31/34

Page 32: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

/enddocument

Alice E. Fischer Laws of Logic. . . 32/34

Page 33: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Summary

Alice E. Fischer Laws of Logic. . . 32/34

Page 34: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

Summary of Terminology

A conjunction is two propositions joined by ∧.

A disjunction is two propositions joined by ∨.

A negation is ∼ applied to a proposition.

Two propositions are equivalent (≡) if the results in the lastcolumn of their truth tables are identical.

An implication is two propositions joined by →.

A biconditional is two propositions joined by ↔.

Alice E. Fischer Laws of Logic. . . 33/34

Page 35: Equivalence and Implication

OutlineProperties of Propositions

Logical EquivalencesPractice with Boolean Operators and Algebra

ImplicationSummary

More Terminology

A proposition that is always true is called a tautology.

A proposition that is always false is called a contradiction.

Given a proposition P → Q,

The contrapositive is ∼Q → ∼P (equivalent to proposition)

The converse is Q → P (equivalent to inverse)

The inverse is ∼P → ∼Q (equivalent to converse)

The negation is ∼(P → Q) (equivalent to P ∧ ∼Q)

Alice E. Fischer Laws of Logic. . . 34/34