chapter 1 introduction to logic

102
7/21/2019 Chapter 1 Introduction to Logic http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 1/102 Math 29: Basic Concepts in Mathematics Reymart S. Lagunero Departamento ng Matematika at Agham Pangkompyuter Unibersidad ng Pilipinas Baguio 04 Agosto 2015 Reymart S. Lagunero (UP na, Baguio pa!)  Math 29: Introduction to Logic  04 Agosto 2015 1 / 91

Upload: reymart-s-lagunero

Post on 04-Mar-2016

25 views

Category:

Documents


6 download

DESCRIPTION

A beamer presentation I used in my Math 29 Basic Concepts in Mathematics course. The presentation was based on certain books i.e. Rosen, Barnier and Gerstein.

TRANSCRIPT

Page 1: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 1/102

Math 29: Basic Concepts in Mathematics

Reymart S. Lagunero

Departamento ng Matematika at Agham Pangkompyuter

Unibersidad ng Pilipinas Baguio

04 Agosto 2015

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 1 / 91

Page 2: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 2/102

Chapter 1: Introduction to Logic

What is Logic?

What is Logic?

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 2 / 91

Page 3: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 3/102

Chapter 1: Introduction to Logic

What is Logic?

What is Logic?

Definition

Logic is the study of the methods and principles used to distinguish good(correct) from bad (incorrect) reasoning. There are objective criteria withwhich correct reasoning may be defined. If these criteria are not known,then they cannot be used. The aim of the study of logic is to discover andmake available those criteria that can be used to test arguments, and to

sort good arguments from bad ones.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 2 / 91

Page 4: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 4/102

Chapter 1: Introduction to Logic   Statements

Statements

Definition

We define a  statement  intuitively as a sentence that can be assigned

either to the class of things we would call  TRUE or to the class of thingswe would call FALSE, but not both. The TRUTH VALUE of a statementis “true” if the statement is true and “false” if the statement is false.

We often use  P   or Q  to denote statements, or perhaps  P 1, P 2, . . . , P  n   if 

there are several statements involved.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 3 / 91

Page 5: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 5/102

Chapter 1: Introduction to Logic   Statements

Examples

Example

Some examples of statements are:

1 Today is Thursday.

2 I passed the final exam in Mathematics 53.

3 2 is a prime number.

4 There is an integer between 1 and 2.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 4 / 91

Page 6: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 6/102

Chapter 1: Introduction to Logic   Statements

Examples

Example

The sentence “The real number  r  is rational.” is a statement provided weknow precisely what real number  r   is being referred to. Without thisadditional information, however, it is impossible to judge whether thissentenced is true or false. Such a sentence is often referred to as an  opensentence  or an   indeterminate.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 5 / 91

Ch 1 I d i L i S

Page 7: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 7/102

Chapter 1: Introduction to Logic   Statements

Examples

Example

We do not want to consider  paradoxes as statements. For example “Thissentence is false.” cannot be either true or false. If you think this sentenceis true, then it is false. But, if it is false, then it is true. This sentence iscalled the   liar paradox.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 6 / 91

Ch t 1 I t d ti t L i L i l C ti

Page 8: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 8/102

Chapter 1: Introduction to Logic   Logical Connectives

Logical Connectives

Complex statements can be constructed from simple ones by means of logical connectives. Five logical connectives will be considered in thissection, namely:   ¬, ∨, ∧,   =⇒   and   ⇐⇒ .

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 7 / 91

Chapter 1: Introduction to Logic Logical Connectives

Page 9: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 9/102

Chapter 1: Introduction to Logic   Logical Connectives

Negation

Definition

Negation The  negation of a statement  P   is the statement  ¬P , read as

“not  P ”. The negation  ¬P   is true when  P   is false, and false when  P   istrue, that is

P    ¬P 

T F F T 

(1.1)

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 8 / 91

Chapter 1: Introduction to Logic Logical Connectives

Page 10: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 10/102

Chapter 1: Introduction to Logic   Logical Connectives

Example

Example

P    ¬P 

It is raining today. It is not raining today.

2 is a prime number. 2 is not a prime number.2 is a composite number.

My shirt is black. My shirt is not black.

Observe in the last example that negating the statement “My shirt is

black” into “My shirt is white” is not logically correct because not wearinga black shirt does not necessarily mean that a person is wearing a whiteshirt (perhaps, a pink shirt!).

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 9 / 91

Chapter 1: Introduction to Logic Logical Connectives

Page 11: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 11/102

Chapter 1: Introduction to Logic   Logical Connectives

Conjunction

Definition

Conjunction The  conjunction of two statements  P   and  Q   is thestatement  P  ∧ Q, read as “P   and  Q”. The conjuction  P  ∧ Q   is true only

if both  P   and  Q  are true; otherwise,  P  ∧ Q   is false, that is,

P Q P  ∧ Q

T T T T F F 

F T F F F F 

(1.2)

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 10 / 91

Chapter 1: Introduction to Logic Logical Connectives

Page 12: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 12/102

Chapter 1: Introduction to Logic   Logical Connectives

Example

Example

Suppose that

P   : John is a sophomore.

andQ : 2 is less than 1.

Then  P  ∧ Q   is the statement “John is a sophomore and 2 is less than 1.”

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 11 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 13: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 13/102

p g g

Disjunction

Definition

Disjunction The  disjunction  of two statements  P   and  Q   is the statementP  ∨ Q, read as “P   or Q”. The disjunction  P  ∨ Q   is true if at least one of 

P   and  Q   is true; otherwise,  P  ∨ Q   is false, that is,

P Q P  ∨ Q

T T T T F T 

F T T F F F 

(1.3)

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 12 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 14: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 14/102

g g

Example

Example

From the last example,  P  ∨ Q   is the statement “John is a sophomore or 2is less than 1.”

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 13 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 15: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 15/102

Exclusive Disjunction

Remark

To address a statement involving  P   and  Q  that is true when precisely oneof them is true, we use the  exclusive disjunction, denoted by  P  ∨̇Q, that

is,P Q P  ∨̇  Q

T T F T F T F T T F F F 

(1.4)

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 14 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 16: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 16/102

Implication

Definition

Implication For statements  P   and Q, the  implication  is the statement: “If P , then  Q”, and is denoted by  P   =⇒   Q. The truth table for  P   ⇒ Q   is

given byP Q P   ⇒ Q

T T T T F F F T T F F T 

(1.5)

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 15 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 17: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 17/102

Example

Example

A student is taking the Math 29 class and is currently receiving a  B+. Heconsults his instructor a few days before the final exam and asks him, “Is

there any chance that I can get an  A  in this course?” His instructor looksthrough his grade book and says, “If you earn an  A in the final exam, thenyou will receive a  A  for your final grade.”

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 16 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 18: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 18/102

Example

Example

A student is taking the Math 29 class and is currently receiving a  B+. Heconsults his instructor a few days before the final exam and asks him, “Is

there any chance that I can get an  A  in this course?” His instructor looksthrough his grade book and says, “If you earn an  A in the final exam, thenyou will receive a  A  for your final grade.” We now check the truth orfalseness of this implication based on the various combinations of truthtables of the statements  P : You earn an  A  on the final exam and  Q: Youreceive a  A  for your final grade, which make up the implication.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 16 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 19: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 19/102

...continuation: Example

Suppose first that  P   and  Q  are both true, that is, the student receives an

A  on his final exam and later learns that he got an  A for his final grade inthe course.  Did his instructor tell the truth?

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 17 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 20: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 20/102

...continuation: Example

Suppose first that  P   and  Q  are both true, that is, the student receives an

A  on his final exam and later learns that he got an  A for his final grade inthe course.  Did his instructor tell the truth?   I think we all agree thatshe did! So if  P   and  Q  are true, then so is  P   ⇒ Q, which agrees with thefirst row of the truth table.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 17 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 21: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 21/102

...continuation: Example

Suppose that  P   is true and  Q   is false. So the student got a  A on his final

exam but did not receive a  A  as final grade, say he received  B. Certainlyhis instructor did not do as she promised. What he said was false, whichagrees with the second row of the truth table.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 18 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 22: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 22/102

...continuation: Example

Suppose that P   is false and  Q   is true. In this case, the student did not getan  A on his final exam, say he earned  B, but when he received his final

grades, he learned that his final grade was an  A.   How could thishappen?

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 19 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 23: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 23/102

...continuation: Example

Suppose that P   is false and  Q   is true. In this case, the student did not getan  A on his final exam, say he earned  B, but when he received his final

grades, he learned that his final grade was an  A.   How could thishappen?   Perhaps his instructor made a mistake, or perhaps the finalexam was unusually difficult, and a grade of  B  on it was exceptionallygood performance. In either case, the instructor did not lie; he told thetruth. This agrees with the third row of the table.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 19 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 24: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 24/102

...continuation: Example

Suppose that  P   and  Q  are both false. That is, suppose the student didnot get an  A  on his final exam, and he also did not get an  A  for a finalgrade. The instructor did not lie here either. He promised nothing if thestudent did not get an  A  on the final exam. So the instructor told thetruth, and this agrees with the fourth row of the table.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 20 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 25: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 25/102

Indeterminates

We have concerned ourselves only with statements. In mathematics,however, we are often interested in sentences containing variables andwhose truthfulness or falseness is only known once we have assigned values

to the variables, previously known as indeterminate. Just as newstatements can be formed from two statements  P   and  Q  by taking theirnegation, conjunction, or disjunction, new indeterminate can be formedfrom two open sentences  P   and  Q  by taking their negation, conjunction,or disjunction. Surprisingly,  P   ⇒ Q  could be a statement even though  P 

and  Q  are not statements.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 21 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 26: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 26/102

Example

Example

Consider the indeterminate  p :  x = −3  and  q  : |x|= 3, where  x ∈  R.Indeed, it would be more appropriate to write

 p(x) : x = −3   and   q (x) : |x|= 3.

In this case, we have  p(x) ⇒ q (x)  can be stated as

If  x =  −3,   then   |x|= 3.

This implication is, in fact, a true statement.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 22 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 27: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 27/102

Biconditional

Definition

Biconditional The  biconditional  of  P   and  Q, denoted by  P   ⇐⇒   Q, istrue precisely when both  P   and  Q  have the same truth values, that is,

P Q P   ⇔ Q

T T T T F F F T F 

F F T 

(1.6)

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 23 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 28: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 28/102

Example

Suppose thatP   : An integer is divisible by 6.

andQ : An integer is divisible by 2 and 3.

Then  P   ⇔ Q   is the statement “An integer is divisible by 6 if and only if itis divisible by 2 and 3.”

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 24 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 29: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 29/102

Rules of Precedence

For statements expressed symbolically, punctuation is accomplished byparentheses. To keep statements from looking cluttered, we will usecertain conventions for leaving out parentheses.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 25 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 30: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 30/102

Rules of Precedence

For statements expressed symbolically, punctuation is accomplished byparentheses. To keep statements from looking cluttered, we will usecertain conventions for leaving out parentheses. The hierarchial order of the logical connectives is as follows:   ¬, then  ∨  or ∧ have the sameprecedence, followed by   =⇒ , and then   ⇐⇒ .

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 25 / 91

Chapter 1: Introduction to Logic   Logical Connectives

Page 31: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 31/102

Rules of Precedence

The following is a list of ambiguous statements and thus, groupingsymbols have to be present when writing them.

1 ¬P  ∧ Q  does not stand for  ¬(P  ∧ Q); it stands for  (¬P ) ∧ Q.

2 P  ∨ Q ⇒ Q  stands for  (P  ∨ Q) ⇒ R, not for  P  ∨ (Q ⇒ R).3 P  ∨ R ∧ T   is ambiguous, since it is not clear whether to apply  ∨ or ∧

first.

4 P   ⇒ Q  ⇒ R  is ambiguous, since either occurrence of  ⇒ can be

applied first.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 26 / 91

Tautologies, Contradictions and Logical Equivalence

Page 32: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 32/102

Prime, Composite, and Component Statements

Statements without logical connectives are called  prime statements while

statements with connectives are called composite statements. Thestatements which formed a composite statement are called its  componentstatements.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 27 / 91

Tautologies, Contradictions and Logical Equivalence   Tautology

Page 33: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 33/102

Definition (Tautology)

A statement  S   is called a  tautology  if it is true for all possiblecombinations of truth values of the component statements that composeS .

Remark

The symbol  I  will denote a statement that always has truth value  T .

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 28 / 91

Tautologies, Contradictions and Logical Equivalence   Tautology

Page 34: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 34/102

Example

Prove that the following compound statements is a tautology.

1 P  ∨ (¬P ).

2 (¬Q) ∨ (P   ⇒ Q).

3 P  ∧ (P   ⇒ Q) ⇒ Q  (Modus Ponens)

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 29 / 91

Tautologies, Contradictions and Logical Equivalence   Tautology

E i 5 Mi

Page 35: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 35/102

Exercise: 5 Minutes

1 Construct the truth table of the following complex statement:

¬(P  ∨ Q) ∧ (P  ∧ (¬Q ∨ (¬P  ∨ Q)))   .

When is the whole statement true?

2 When will the whole statement be true given

¬(P  ∧ Q) ∨ R   =⇒ ¬P  ∨ R.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 30 / 91

Tautologies, Contradictions and Logical Equivalence   Contradictions

Page 36: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 36/102

Definition (Contradiction)A statement  S   is called a  contradiction  if it is false for all possiblecombinations of truth values of the component statements that are usedto form  S .

Remark

In fact, if a compound statement  S   is a tautology, then the compoundstatement  ¬S   is a contradiction. The symbol  O  will denote a statementthat always has truth value  F .

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 31 / 91

Tautologies, Contradictions and Logical Equivalence   Contradictions

Page 37: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 37/102

Example

Prove that the following compound statements is a contradiction.

1

P  ∧ (¬P ).2 (P  ∧ Q) ∧ (Q ⇒ (¬P )).

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 32 / 91

Tautologies, Contradictions and Logical Equivalence   Logical Equivalence

Page 38: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 38/102

Definition (Logical equivalence)

We say that statements  P   and  Q  are logically equivalent, denoted by

P   ≡ Q, if they have the same truth values for all combinations of truthvalues of their component statements.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 33 / 91

Tautologies, Contradictions and Logical Equivalence   Logical Equivalence

Theorem

Page 39: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 39/102

Theorem

It is clear that logical equivalence is reflexive, commutative and transitive.

We list some of the well-known logical equivalence in the followingtheorem.

Theorem

For statements  P ,  Q   and  R, we have 

Commutative Laws

P  ∨ Q ≡ Q ∨ P P  ∧ Q ≡  Q ∧ P 

Associative Laws

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

Distributive Laws

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

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 34 / 91

Tautologies, Contradictions and Logical Equivalence   Logical Equivalence

continuation: Theorem

Page 40: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 40/102

...continuation: Theorem

DeMorgan’s Laws

¬(P  ∨ Q) ≡ (¬P ) ∧ (¬Q)   ¬(P  ∧ Q) ≡ (¬P ) ∨ (¬Q)

Rule of Double Negation

P   ≡ ¬(¬P )

Or-form of an ImplicationP   ⇒ Q ≡ (¬P ) ∨ Q

Contrapositive of an Implication

P   ⇒ Q ≡  (¬Q) ⇒  (¬P )

Rule for Direct Proof 

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

Biconditional

P   ⇔ Q ≡ (P   ⇒ Q) ∧ (Q ⇒  P )Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 35 / 91

Tautologies, Contradictions and Logical Equivalence   Logical Equivalence

continuation: Theorem

Page 41: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 41/102

...continuation: Theorem

Adjunction

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

Rule for proof by contradiction

(P  ∧ ¬Q) ⇒ O ≡ (P   ⇒ Q)

The symbol  ≡ has the least precedence among the logical connectivesintroduced above.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 36 / 91

Tautologies, Contradictions and Logical Equivalence   Quantified Statements

Page 42: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 42/102

Definition (Universal quantifier)

The  universal quantifier ∀x  means “for all  x” or “for any  x.”

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 37 / 91

Tautologies, Contradictions and Logical Equivalence   Quantified Statements

Page 43: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 43/102

Example

If  x   is a real number, then  x2 ≥ 0. This statement is an implication, of course, and can be rephrased by

The square of every real number is nonnegative

orFor every real number  x, we have  x2 ≥ 0.

If we define the open sentence  P (x)  by P (x) : x2 ≥ 0, then we can rewritethe above statement in terms of the universal quantifier as

(∀x ∈  R)(P (x)).

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 38 / 91

Tautologies, Contradictions and Logical Equivalence   Quantified Statements

Page 44: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 44/102

Notice that if the set of complex numbers were under consideration, thenthe statement in the previous example would be false, since  i2 = −1. Sothe truth value of a quantified statement may depend on the priorspecification of a set from which all elements are understood to come.

Such a set is called the  universal set. In general, the statement(∀x ∈  U )(P (x))  is true if  P (a)  is true for all substitutions  a ∈  U . If auniversal set  U  is not explicitly stated, the student can assume thatU  =  R.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 39 / 91

Tautologies, Contradictions and Logical Equivalence   Quantified Statements

Page 45: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 45/102

Definition (Existential quantifier)The  existential quantifier ∃x  means “there exists an  x  such that” or“there is an  x  such that.”

Example

There exists a real number  x  such that  x2 = 3. If we let  P (x) : x2 = 3then this statement can be rewritten in terms of the existential quantifieras

(∃x ∈  R)(P (x)).

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 40 / 91

Tautologies, Contradictions and Logical Equivalence   Quantified Statements

Page 46: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 46/102

In general, the statement  (∃x ∈  U )(P (x))  is true if there is at least onesubstitution  a ∈  U   for which  P (a)  is true.Some statements contain more than one quantifiers. As you will see, theorder of quantifiers is important. For instance, the statement

(∃u)(∀x)(P (x, u))   is read as “There exists an element  u  such that for allx, we have  P (x, u)” while the statement  (∀x)(∃u)(P (x, u))  represent thestatement “For every  x  there exists an element  u  such that  P (x, u).”

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 41 / 91

Tautologies, Contradictions and Logical Equivalence   Quantified Statements

Page 47: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 47/102

Example

The statement “Every person has a mother” is of the form

(∀x)(∃y)(y   is the mother of  x)

while the statement “Someone is the mother of everyone” is of the form(∃y)(∀x)(y   is the mother of  x).

If the universal set is the set of all people who have ever been alive, thefirst statement is true, but the second is false.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 42 / 91

Tautologies, Contradictions and Logical Equivalence   Quantified Statements

Page 48: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 48/102

Assignment

For each of the following statements, use your creativity and constructseveral statements that are logically equivalent to the given statement.

1 No elements of the set  A  exceeds  m.

2 Some element of the set  A  exceeds  m.

3 A  contains an element that is greater than every element of  B.

4 Every element of  A is greater than every element of  B.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 43 / 91

Tautologies, Contradictions and Logical Equivalence   Negating Statements

Page 49: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 49/102

Using DeMorgan’s laws, we saw that

¬(P  ∨ Q) ≡  (¬P ) ∧ (¬Q)   and   ¬(P  ∧ Q) ≡ (¬P ) ∨ (¬Q).

Using the or-form of an implication, we see that

¬(P   ⇒ Q) ≡ ¬(¬P  ∨ Q) ≡  P  ∧ (¬Q),

while using the fact that  P   ⇔ Q  ≡  (P   ⇒ Q) ∧ (Q ⇒ P ), we have

¬(P   ⇔ Q) ≡ ¬[(P   ⇒ Q) ∧ (Q →  P )] ≡ (P  ∧ (¬Q)) ∨ (Q ∧ (¬P )).

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 44 / 91

Tautologies, Contradictions and Logical Equivalence   Negating Statements

Now, we consider negating statements with quantifiers. Suppose someonek th f ll i l i

Page 50: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 50/102

makes the following claim

Every student in the class passed the first exam.

For you to deny this claim, what sort of statement would you make? Youwould probably say something like

At least one person in the class failed the first exam.

If we let  U  be the set of students in the class and let  Q  be the set of students who passed the first exam. We can write the original statementin terms of the universal quantifier as

(∀x ∈  U )(x ∈  Q)

and its negation would be

(∃x ∈  U )(x /∈ Q)

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 45 / 91

Tautologies, Contradictions and Logical Equivalence   Negating Statements

Page 51: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 51/102

In general, we can say that

¬[(∀x ∈  U )(P (x))] ≡  (∃x)(¬P (x)).

So the trick to negating a universal statement is that the  ¬ symbol crawlsover the  ∀x ∈  U  and converts it to  ∃x  as it goes.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 46 / 91

Tautologies, Contradictions and Logical Equivalence   Negating Statements

Page 52: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 52/102

Example

Write in terms of the quantifiers the negation of the following statements.

1 For all  x ∈  Z, x2 ≥ 0.

2 For all  x ∈  Z, if  x   is divisible by 6 then  x   is divisible by  3.3 For all  x ∈  R  and  x > 1, we have  x3 − x > 0.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 47 / 91

Tautologies, Contradictions and Logical Equivalence   Negating Statements

Page 53: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 53/102

Now we negate statements involving the existential quantifier. Considerthe following statement

There is a passenger traveling in the jeepney who didn’t pay his fare.

If we let  U  be the set of all passengers riding in the jeepney and  R  be the

set of passengers who didn’t pay his fare, in terms of the existentialquantifier, the statement becomes

(∃x ∈ U )(x ∈ R).

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 48 / 91

Tautologies, Contradictions and Logical Equivalence   Negating Statements

Page 54: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 54/102

To negate this, we could say

Every passenger in the jeepney paid his fare

which is equivalent to(∀x ∈ U )(x /∈ R).

In general, we can say that

(∃x ∈ U )(P (x)) ≡ (∀x ∈  U )(¬P (x)).

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 49 / 91

Tautologies, Contradictions and Logical Equivalence   Negating Statements

Page 55: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 55/102

Example

Write in terms of the quantifiers the negation of the following statements.

1 Someone in this class cheated on the final exam.

2 There exists a natural number  x  such that  x ≤ y   for all  y ∈ N .

3 For every   > 0  there exists a  δ > 0  such that,

if  0 <  |x − a|< δ , then  |f (x) − L|< .

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 50 / 91

Tautologies, Contradictions and Logical Equivalence   Negating Statements

Page 56: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 56/102

Sometimes it is important to know not only that something exists, butalso that exactly one such thing exists. If there exists exactly one thingwith a certain property, we say that it exists  uniquely. The mathematicalstatement

(∃!   x ∈ U )(P (x))is read “There exists a unique  x  such that  P (x).” The standard way of defining existence is the following.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 51 / 91

Tautologies, Contradictions and Logical Equivalence   Negating Statements

Page 57: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 57/102

Definition (Unique existence)We say that  there exists a unique x  with property  P  provided that

1 there exists  x ∈ U  with property  P , and

2 for all  x1 ∈ U   and  x2 ∈ U , if  x1  and  x2  both have property  P , then

x1 = x2.In other words

[(∃x ∈  U )(P (x))] ∧ [(∀x1 ∈ U )(∀x2 ∈ U )(P (x1) ∧ P (x2)) ⇒  (x1 = x2)].

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 52 / 91

Tautologies, Contradictions and Logical Equivalence   Disproving a Statement

Page 58: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 58/102

Sometimes we are presented with a mathematical statement and we areasked to verify whether it is a tautology. Of course, you can create a truthtable for the given statement and check if it is indeed a tautology, that is,if all entries in the main column are  T . The combination of truth valuesassigned to the component statements in any row that produces a false inthe main column of the truth table is called a  counterexample.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 53 / 91

Tautologies, Contradictions and Logical Equivalence   Disproving a Statement

Page 59: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 59/102

Example

Show that  (P   ⇒ Q) ∧ Q ⇒ P   is not a tautology.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 54 / 91

Tautologies, Contradictions and Logical Equivalence   Disproving a Statement

Page 60: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 60/102

Example

Show that  (P   ⇒ Q) ∧ Q ⇒ P   is not a tautology.

P Q   (P   ⇒ Q) ∧ Q ⇒ P 

T T T T F T 

F T F F F T 

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 54 / 91

Tautologies, Contradictions and Logical Equivalence   Disproving a Statement

Page 61: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 61/102

Example

Show that  (P   ⇒ Q) ∧ Q ⇒ P   is not a tautology.

P Q   (P   ⇒ Q) ∧ Q ⇒ P 

T T T T F T 

F T F F F T 

The counterexample is  P   false and  Q   is true. Claiming the above exampleto be a tautology is a well-known fallacy of logic. It is called the  fallacy of 

asserting the conclusion, since the conclusion  Q  has been asserted aspart of the hypothesis.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 54 / 91

Tautologies, Contradictions and Logical Equivalence   Disproving a Statement

Counterexamples will become important to us in disproving a givenmathematical statement. To disprove a given mathematical statement, we

Page 62: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 62/102

mathematical statement. To disprove a given mathematical statement, weprove that its negation is a tautology. This is where our techniques of negation come in handy.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 55 / 91

Tautologies, Contradictions and Logical Equivalence   Disproving a Statement

Counterexamples will become important to us in disproving a givenmathematical statement. To disprove a given mathematical statement, we

Page 63: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 63/102

p g ,prove that its negation is a tautology. This is where our techniques of negation come in handy.

Example

Consider the statement

For all sets  A, B, and  C , if  A ∪ C  = B  ∪ C , then  A =  B.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 55 / 91

Tautologies, Contradictions and Logical Equivalence   Disproving a Statement

Counterexamples will become important to us in disproving a givenmathematical statement. To disprove a given mathematical statement, we

Page 64: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 64/102

p g ,prove that its negation is a tautology. This is where our techniques of negation come in handy.

Example

Consider the statement

For all sets  A, B, and  C , if  A ∪ C  = B  ∪ C , then  A =  B.

We can disprove the statement by proving its negation to be true, that is,we would want to show that the statement

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 55 / 91

Tautologies, Contradictions and Logical Equivalence   Disproving a Statement

Counterexamples will become important to us in disproving a givenmathematical statement. To disprove a given mathematical statement, we

Page 65: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 65/102

p gprove that its negation is a tautology. This is where our techniques of negation come in handy.

Example

Consider the statement

For all sets  A, B, and  C , if  A ∪ C  = B  ∪ C , then  A =  B.

We can disprove the statement by proving its negation to be true, that is,we would want to show that the statement

There exists sets  A, B, and  C   such that  A ∪ C  = B  ∪ C   and  A = B

is true.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 55 / 91

Tautologies, Contradictions and Logical Equivalence   Disproving a Statement

Counterexamples will become important to us in disproving a givenmathematical statement. To disprove a given mathematical statement, we

Page 66: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 66/102

prove that its negation is a tautology. This is where our techniques of negation come in handy.

Example

Consider the statement

For all sets  A, B, and  C , if  A ∪ C  = B  ∪ C , then  A =  B.

We can disprove the statement by proving its negation to be true, that is,we would want to show that the statement

There exists sets  A, B, and  C   such that  A ∪ C  = B  ∪ C   and  A = B

is true. For instance, let  A =  {1},  B = {2}, and  C  = {1, 2}. ThenA ∪ C  = B ∪ C , but  A = B . Again, such an example is also called acounterexample.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 55 / 91

Tautologies, Contradictions and Logical Equivalence   Translating English Sentences to Logical Expressions

Page 67: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 67/102

Translating English Sentences to Logical Expressions

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 56 / 91

Tautologies, Contradictions and Logical Equivalence   Translating English Sentences to Logical Expressions

Example

Page 68: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 68/102

Translate the following English sentences into logical expressions.1 You can only access the Internet from campus only if you are a

computer science major or you are not a freshman.

Solution:

We let  a,  c, and  f  represent “You can access the Internet from campus”,“You are a computer science major”, and “You are a freshman”,

respectively. Noting that “only if” is one way a conditional statement canbe expressed, this sentence can be represented as  a   =⇒   (c ∨ ¬f ).

2 You cannot ride the roller coaster if you are under 4 feet tall unlessyou are older than 16 years old.

Solution:

Let  q ,  r, and  s  represent “You can ride the roller coaster”, “You are under4 feet tall” and “You are older than 16 years old”, respectively. Then thesentence can be translated to  (r ∧ ¬s) =⇒ ¬q .

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 57 / 91

Tautologies, Contradictions and Logical Equivalence   Logic Puzzles

Page 69: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 69/102

Logic Puzzles

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 58 / 91

Tautologies, Contradictions and Logical Equivalence   Logic Puzzles

Example

Page 70: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 70/102

Smullyan posed many puzzles about an island that has two kinds of inhabitants, knights, who always tell the truth, and their opposites, knaves,who always lie. You encounter two people  A and  B. What are  A  and  B   if A  says “B   is a knight” and  B  says “The two of us are opposite types?”

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 59 / 91

Tautologies, Contradictions and Logical Equivalence   Logic Puzzles

Example

Page 71: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 71/102

A father tells his two children, a boy and a girl, to play in their backyardwithout getting dirty. However, while playing, both children get mud ontheir foreheads. When the children stop playing, the father says “At leastone of you has a muddy forehead,” and then asks the children to answer

“Yes” or “No” to the question: “Do you know whether you have a muddyforehead?” The father asks this question twice. What will the childrenanswer each time this question is asked, assuming that a child can seewhether his or her sibling has a muddy forehead, but cannot see his or herown forehead? Assume that both children are honest and that the children

answer each question simultaneously.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 60 / 91

Tautologies, Contradictions and Logical Equivalence   Logic Puzzles

Example

Page 72: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 72/102

Four friends have been identified as suspects for an unauthorized accessinto a computer system. They have made statements to the investigatingauthorities. Alice said “Carlos did it.” John said “I did not do it.” Carlossaid “Diana did it.” Diana said “Carlos lied when he said that I did it.”

If the authorities also know that exactly one of the four suspects istelling the truth, who did it? Explain your reasoning.

If the authorities also know that exactly one is lying, who did it?Explain your reasoning.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 61 / 91

Tautologies, Contradictions and Logical Equivalence   Logic Puzzles

Example

Page 73: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 73/102

Vhong, Jinggy, and Juanito are all enrolled in Math 29. If Vhong comeslate then so is Jinggy. Either Jinggy or Juanito comes late but never both

at the same time. Either Vhong or Juanito or both are always late. If Vhong is on time then Juanito is also on time.  Who is always on time?Justify your answer using truth table.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 62 / 91

Rules of Inference for Propositional Logic

Page 74: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 74/102

Rules of Inference for Propositional Logic

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 63 / 91

Rules of Inference for Propositional Logic

Page 75: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 75/102

In this section, we introduce proof techniques and apply them to provingstatements from a collection of premises.

Definition

A  proof  is a step-by-step demonstration that a statement can be derivedfrom a collection of premises. A  premise is a statement that is assumed inthe context of a proof.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 64 / 91

Rules of Inference for Propositional Logic   Modus Ponens

Rule of Inference: Modus Ponens

Page 76: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 76/102

From P   and  P   implies  Q, infer  Q. In other words,

P  ∧ (P   =⇒   Q) =⇒   Q

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 65 / 91

Rules of Inference for Propositional Logic   Modus Ponens

Rule of Inference: Modus Ponens

Page 77: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 77/102

Example

1 Premises:   T ,  T   =⇒   S . Prove  S .

2 Premises:   T   =⇒   R,  R   =⇒   S ,  T . Prove  S .

3 Premises:x   is even or  x  is odd.If  x   is even or  x   is odd, then  x  is not even implies that  x  is odd.x   is not even.

Prove that  x   is odd.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 66 / 91

Rules of Inference for Propositional Logic   Modus Ponens

Rule of Inference: Modus Ponens

Page 78: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 78/102

Exercise

Premises:

¬(R ∧ T ) =⇒ ¬R ∨ ¬P 

¬(R ∧ T )

¬R

¬R ∨ ¬T   =⇒   (¬R   =⇒   T )

Prove:   T .

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 67 / 91

Rules of Inference for Propositional Logic   Adjoining Premises

Rule of Inference: Adjoining Premises

Page 79: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 79/102

Any statement can be adjoined to the premises in a proof if it can beproved from the premises.

Example

Premises:

P  ∨ Q   =⇒   (¬P   =⇒   Q)P  ∨ Q

¬P 

Q   =⇒   P 

Q   =⇒   RProve:   R.

Reymart S. Lagunero (UP na, Baguio pa!)   Math 29: Introduction to Logic   04 Agosto 2015 68 / 91

Rules of Inference for Propositional Logic   Adjoining Premises

Exercise

Page 80: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 80/102

Example

Premises:

P  ∨ Q   =⇒   (¬P   =⇒   Q)

P  ∨ Q¬P 

Q   =⇒   R

R   =⇒   S  ∧ T 

Prove:   S  ∧ T .

Reymart S. Lagunero (UP na, Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 69 / 91

Rules of Inference for Propositional Logic   Adjoining Premises

Remark

Page 81: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 81/102

We say that  P   is  provable from a set of premises if there is a proof of  P 

from the set of premises.

Reymart S. Lagunero (UP na, Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 70 / 91

Rules of Inference for Propositional Logic   Direct Proof of an Implication

Rule of Inference: Direct Proof of an Implication

Page 82: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 82/102

To prove an implication  P   =⇒   Q from a set of premises  R, it is sufficientto assert the hypothesis  (Hyp)  P  as an additional premises and show thatthe conclusion  Q   is provable from the augmented set of premises. DPI is

based on the tautology

(R   =⇒   (P   =⇒   Q))   ⇐⇒   (R ∧ P   =⇒   Q)  .

Reymart S. Lagunero (UP na, Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 71 / 91

Rules of Inference for Propositional Logic   Direct Proof of an Implication

Example

Page 83: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 83/102

Example

Premises:

x   is even or  x  is odd.

If  x  is odd, then  x2 is not even.

If  x   is even or  x   is odd, then  x   is not even implies that  x  is odd.

Prove:   If  x   is not even, then  x2 is not even.

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 72 / 91

Rules of Inference for Propositional Logic   Direct Proof of an Implication

Exercise

Page 84: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 84/102

Premises:

Q   =⇒   (P   =⇒ ¬R)

Prove:   Q   =⇒ ¬R.

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 73 / 91

Rules of Inference for Propositional Logic   Adjunction

Rule of Inference: Adjunction

Page 85: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 85/102

If  P   and  Q  are provable from the same set of premises, then  P  ∧ Q   is

provable from that set of premises. Adjunction is based on the tautology

(R   =⇒   P ) ∧ (R   =⇒   Q)   ⇐⇒   (R   =⇒   P  ∨ R)

Example

Premises:

P   =⇒   Q

Q ∧ (P  ∨ R) =⇒   S  ∧ T 

P P   =⇒   P  ∨ R

Prove:   S  ∧ T .

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 74 / 91

Rules of Inference for Propositional Logic   Adjunction

Exercise

Page 86: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 86/102

Premises:

Q   =⇒   P 

QP  ∧ Q   =⇒   R ∨ T 

Prove:   R ∨ T .

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 75 / 91

Rules of Inference for Propositional Logic   Substitution

Rule of Inference: Substitution

Page 87: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 87/102

Assume that  P 2   is obtained from  P 1  by substituting  R   for any occurrence

of  S   in  P 1. Then we can derive  P 2   from S   ⇐⇒   R  and  P 1. In otherwords, we may substitute  R  for S  using the premise  S   ⇐⇒   R. We mayalso substitute  S   for R  whenever  S   ⇐⇒   R  is a premise.

Example

Premises:

R ∨ Q   ⇐⇒   P  ∨ Q

R ∨ Q   =⇒   S 

P   =⇒   P  ∨ Q

Prove:   S .

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 76 / 91

Rules of Inference for Propositional Logic   Substitution

Exercise

Page 88: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 88/102

Premises:

Q ∨ P   ⇐⇒   (¬Q   =⇒   P )

¬Q

R   =⇒   (Q ∨ P )

R

Prove:   P .

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 77 / 91

Rules of Inference for Propositional Logic   Contradiction

Rule of Inference: Contradiction

To prove  Q  from a set of premises, it is sufficient to use  ¬Q  as an

Page 89: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 89/102

p Q p , Qadditional premise to prove any contradiction, for example, a statement of the form  R ∧ ¬R. Contradiction is based on the tautology

(P  ∧ ¬Q) =⇒ O ⇐⇒   (P   =⇒   Q)

ExamplePremises:

If Kathy is not the murderer, then Mary is the murderer.

If Kathy is the murderer, then Jane is an accomplice.

If Mary is the murderer, then Noreen does not have an alibi.Noreen has an alibi.

Prove:  Kathy is the murderer.

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 78 / 91

Rules of Inference for Propositional Logic   Contradiction

Exercise

Page 90: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 90/102

Premises:

¬(P  ∨ Q) =⇒ ¬P  ∧ ¬Q

¬P   =⇒   R

¬Q   =⇒ ¬R

¬P  ∧ ¬Q   =⇒ ¬P 

¬P  ∧ ¬Q   =⇒ ¬Q

Prove:   P  ∨ Q.

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 79 / 91

Rules of Inference for Propositional Logic   Contradiction

Page 91: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 91/102

Remark

If we can prove  P  from a set of premises, then we say that  P   logicallyfollows, or simply  follows, from the set of premises. An  argument   is asequence of steps proposed as a proof. If an argument is, in fact, a proof,

then it is called a  valid argument; if it is not a proof, then it is called aninvalid argument.

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 80 / 91

Rules of Inference for Propositional Logic   Contradiction

Additional Examples

Page 92: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 92/102

State which rule of inference is the basis of the following arguments:

It is below freezing now. Therefore, it is either below freezing orraining now.

It is below freezing and raining now. Therefore, it is below freezingnow.

If it rains today, then we will not have a barbecue today. If we do nothave a barbecue today, then we will have a barbecue tomorrow.Therefore, if it rains today, then we will have a barbecue tomorrow.

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 81 / 91

Rules of Inference for Propositional Logic   Contradiction

Additional Examples

Page 93: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 93/102

Show that the premises “It is not sunny this afternoon and it is colderthan yesterday”, “We will go swimming only if it is sunny”, “If we donot go swimming, then we will take a canoe trip”, and “If we take acanoe trip, then we will be home by sunset” lead to the conclusion

“We will be home by sunset”.Show that the premises “If you send me an e-mail message, then Iwill finish writing the program,” “If you do not send me an e-mailmessage, then I will go to sleep early,” and “If I go to sleep early, thenI will wake up feeling refreshed” lead to the conclusion “If I do not

finish writing the program, then I will wake up feeling refreshed.”

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 82 / 91

Rules of Inference for Propositional Logic   Contradiction

Additional Examples

Page 94: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 94/102

Is the following argument valid?

“If you do every problem in this book, then you will learn discretemathematics.You learned discrete mathematics. Therefore, you did every

problem in this book.”

Is it correct to assume that you did not learn discrete mathematics if youdid not do every problem in the book, assuming that if you do everyproblem in this book, then you will learn discrete mathematics?

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 83 / 91

Rules of Inference for Quantified Statements   Universal Instantiation

Universal Instantiation

Page 95: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 95/102

Universal instantiation   is the rule of inference used to conclude thatP (c)  is true, where  c  is a particular member of the domain, given the

premise ∀xP (x). Universal instantiation is used when we conclude fromthe statement “All women are wise” that “Lisa is wise,” where Lisa is amember of the domain of all women.

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 84 / 91

Rules of Inference for Quantified Statements   Universal Generalization

Universal Generalization

Page 96: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 96/102

Universal generalization  is the rule of inference that states that  ∀xP (x)is true, given the premise that  P (c)  is true for all elements  c  in thedomain. Universal generalization is used when we show that  ∀xP (x)   istrue by taking an arbitrary element  c  from the domain and showing that

P (c)   is true. The element  c  that we select must be an arbitrary, and not aspecific, element of the domain. That is, when we assert from  ∀xP (x)  theexistence of an element  c   in the domain, we have no control over  c  andcannot make any other assumptions about  c  other than it comes from thedomain.

Reymart S Lagunero (UP na Baguio pa!) Math 29: Introduction to Logic 04 Agosto 2015 85 / 91

Rules of Inference for Quantified Statements   Existential Instantiation

Existential Instantiation

Page 97: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 97/102

Existential instantiation  is the rule that allows us to conclude that thereis an element  c  in the domain for which  P (c)   is true if we know that∃xP (x)  is true. We cannot select an arbitrary value of  c  here, but rather it

must be a  c  for which  P (c)   is true. Usually we have no knowledge of whatc   is, only that it exists. Because it exists, we may give it a name  (c)  andcontinue our argument.

R t S L (UP B i !) M th 29 I t d ti t L i 04 A st 2015 86 / 91

Rules of Inference for Quantified Statements   Existential Generalization

Existential Generalization

Page 98: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 98/102

Existential generalization is the rule of inference that is used to concludethat  ∃xP (x)  is true when a particular element  c  with  P (c)  true is known.

That is, if we know one element  c  in the domain for which  P (c)  is true,then we know that  ∃xP (x)  is true.

R t S L (UP B i !) M th 29 I t d ti t L i 04 A t 2015 87 / 91

Combining Rules of Inferences   Universal Modus Ponens

Universal Modus Ponens

Page 99: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 99/102

This rule tells us that if  ∀x(P (x) =⇒   Q(x))  is true, and if  P (a)   is truefor a particular element  a  in the domain of the universal quantifier, then

Q(a)  must also be true. To see this, note that by universal instantiation,P (a) =⇒   Q(a)   is true. Then, by modus ponens,  Q(a)  must also be true.

R t S L (UP B i !) M th 29 I t d ti t L i 04 A t 2015 88 / 91

Combining Rules of Inferences   Universal Modus Tollens

Universal Modus Tollens

Page 100: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 100/102

Universal modus tollens combines universal instantiation and modus

tollens.

R t S L (UP B i !) M th 29 I t d ti t L i 04 A t 2015 89 / 91

Combining Rules of Inferences   Universal Modus Tollens

Page 101: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 101/102

Salamat sa pakikinig!

R S L (UP B i !) M h 29 I d i L i 04 A 2015 90 / 91

Combining Rules of Inferences   Universal Modus Tollens

Math 29: Basic Concepts in Mathematics

Page 102: Chapter 1 Introduction to Logic

7/21/2019 Chapter 1 Introduction to Logic

http://slidepdf.com/reader/full/chapter-1-introduction-to-logic 102/102

Reymart S. Lagunero

Departamento ng Matematika at Agham Pangkompyuter

Unibersidad ng Pilipinas Baguio

04 Agosto 2015

R S L (UP B i !) M h 29 I d i L i 0 A 201 91 / 91