chapter 2 fundamentals of logic dept of information management national central university yen-liang...

64
Chapter 2 Chapter 2 Fundamentals of Fundamentals of Logic Logic Dept of Information manag Dept of Information manag ement ement National Central Universi National Central Universi ty ty Yen-Liang Chen Yen-Liang Chen

Upload: clifford-dobbyn

Post on 14-Dec-2015

222 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Chapter 2 Chapter 2 Fundamentals of Fundamentals of

LogicLogic

Dept of Information managemDept of Information managementent

National Central UniversityNational Central UniversityYen-Liang ChenYen-Liang Chen

Page 2: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

2.1 Basic connectives and 2.1 Basic connectives and truth tabletruth table

• Assertions, called statements or Assertions, called statements or propositions, are declarative propositions, are declarative sentences that are either true or falsesentences that are either true or false

• New statements can be obtained New statements can be obtained from existing ones in two ways.from existing ones in two ways.– Transform a given statement Transform a given statement pp into the into the

statement statement pp– Combine two or more statements into a Combine two or more statements into a

compound statementcompound statement

Page 3: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Forming a compound Forming a compound statementstatement

Page 4: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.1Ex 2.1

• s: Phyllis goes out for a walks: Phyllis goes out for a walk• t: The moon is outt: The moon is out• u: It is snowing u: It is snowing • (t(tu)u)ss• tt((uus)s)(s(s(u(ut))t))

Page 5: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.2Ex 2.2

• ““If I weigh more than 120 pounds, theIf I weigh more than 120 pounds, then I shall enroll in an exercise class”n I shall enroll in an exercise class”

• p: I weigh more than 120 poundsp: I weigh more than 120 pounds• q: I shall enroll in an exercise classq: I shall enroll in an exercise class• the four cases of pthe four cases of pqq

Page 6: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

A word of cautionA word of caution

• In our everyday language, we often finIn our everyday language, we often find situations where an implications is ud situations where an implications is used when the intention actually calls fosed when the intention actually calls for a biconditional.r a biconditional.

• If you do your homework, then you wilIf you do your homework, then you will get to watch the baseball game.l get to watch the baseball game.

Page 7: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

pp(q(qr)r)(p(pq)q)r r

Page 8: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

pp(p(pq), pq), p((ppq) q)

Page 9: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Key ideasKey ideas

• A compound statement is a tautology if it is truA compound statement is a tautology if it is true for all truth value assignments and a contradie for all truth value assignments and a contradiction if it is false for all truth value assignmentsction if it is false for all truth value assignments

• To show (To show (pp11pp22……ppnn))qq a valid argument, we n a valid argument, we need to show this statement is a tautology. If any eed to show this statement is a tautology. If any ppii is not true, then no matter what is not true, then no matter what qq is the state is the statement is true. Thus, we only need to show that ment is true. Thus, we only need to show that q q follows from (follows from (pp11pp22……ppnn), when all of them are ), when all of them are true.true.

• Premises and conclusionPremises and conclusion

Page 10: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

2.2 Logic equivalence: the 2.2 Logic equivalence: the laws of logic laws of logic

• Ex 2.7, Ex 2.7, ppqq is equivalent to is equivalent to ppqq• Definition 2.2.Definition 2.2. Two statements are said to be Two statements are said to be

logically equivalent,logically equivalent, s1 s1s2, s2, when the statemwhen the statementent s1 s1 is true if and only if the statementis true if and only if the statement s2 s2 is is truetrue

Page 11: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

((ppqq))((ppqq))((qqpp) )

Page 12: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

((ppqq))((ppqq)) ( (ppqq) )

Page 13: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

DeMorgan’s law DeMorgan’s law ((ppqq) ) ppqq; ; ((ppqq))ppqq

Page 14: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

The distributive law The distributive law

• pp((qqrr) ) ((ppqq) ) ( (pprr))• pp ( (qqrr) ) ((ppqq) ) ( (pprr))

Page 15: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

ObservationsObservations

• When When ss11ss2, then 2, then ss11ss2 is a tautology; 2 is a tautology; when when ss11ss2; then 2; then ss11ss2 is a 2 is a tautologytautology

• When When ss11ss2 and 2 and ss22ss3, then 3, then ss11ss33

Page 16: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

The laws of logicThe laws of logic

pppp (p(pq)q)ppqq (p(pq)q)ppqq• ppqqqqp; p; • ppqqqqpp• pp(q(qr) r) (p (pq)q)rr• pp(q(qr) r) (p (pq) q) rr• pp(q(qr) r) (p (pq) q) (p(pr)r)• pp(q(qr) r) (p (pq) q) (p (pr)r)

• pppppp• pppppp• ppFFpp• ppTTpp• ppppTT• ppppFF• ppTTTT• ppFFFF• pp(p(pq) q) p p• pp(p(pq) q) p p

Page 17: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

ObservationObservation

• Definition 2.3, Definition 2.3, ssdd, the dual of , the dual of ss, is obtai, is obtained by replacing ned by replacing with with , , with with , T wit, T with F and F with T.h F and F with T.

• Theorem 2.1. The principle of duality. Theorem 2.1. The principle of duality. Let s and t be statements that contain Let s and t be statements that contain no logical connectives other than no logical connectives other than and and . If . If sstt, then, then s sddttdd..

Page 18: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Two substitution rulesTwo substitution rules

• Suppose that the compound statement Suppose that the compound statement PP is a t is a tautology. If autology. If pp is a primitive statement that ap is a primitive statement that appears in pears in PP and we replace each occurrence of and we replace each occurrence of pp by the same statement by the same statement qq, then the resulting , then the resulting compound statement compound statement PP1 is also a tautology.1 is also a tautology.

• Let Let PP be a compound statement where be a compound statement where pp is an is an arbitrary statement that appears in arbitrary statement that appears in PP, and let , and let qq be such a statement such that be such a statement such that ppqq. Suppos. Suppose that ine that in P P we replace one or more occurrenc we replace one or more occurrences of es of pp by by qq. Then this replacement yields the . Then this replacement yields the compound statement compound statement PP1. Under these circum1. Under these circumstances stances PP PP1.1.

Page 19: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.10Ex 2.10

• P: P: (p(pq)q)((ppq) is a tautologyq) is a tautology• P1: P1: ((r((rs)s)q)q)(( (r (rs)s)q)q)• P2: P2: ((r((rs)s) (t (tu))u))(( (r (rs)s) (t (tu))u))

Page 20: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.11Ex 2.11

• Let P: (pLet P: (pq)q)r be a compound statemer be a compound statement.nt.– Because (pBecause (pq)q)ppq, if P1: (q, if P1: (ppq)q)r, then r, then

P1P1P.P.• Let P: pLet P: p(p(pq) be a compound statemeq) be a compound stateme

nt.nt.– Because Because ppp, if P1: p, if P1: p p ((p p q), theq), the

n P1n P1P.P.

Page 21: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.12, Ex 2.13Ex 2.12, Ex 2.13

[(p[(pq)q)r]r] [[(p(pq)q) r] r] (p(pq)q) r r• (p(pq)q) r r

(p(pq)q) ((ppq)q) ppqq• ppqq

Page 22: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

DefinitionsDefinitions

• Implication Implication ppqq • contrapositive, contrapositive, qq

pp• converse, converse, qq pp• inverse inverse p p q q

Page 23: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.16, Ex 2.17Ex 2.16, Ex 2.17

• (p(pq)q)((ppq)q)• (p(pq)q)((ppq)q)• (p(pq)q)(p(pq)q)• pp(q(qq)q)• ppFFpp

[[[(p[(pq)q)r]r]q] q] [(p[(pq)q)r]r]q q • [(p[(pq)q)r]r]q q • (p(pq)q)(q(qr) r) • [(p[(pq)q)q]q]r r • qqrr

Page 24: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Simplifying the switch Simplifying the switch networknetwork

• (p(pqqr)r)(p(pttq)q)(p(pttr)r)pp[r[r(t(tq)] q)]

Page 25: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

2.3 Logic implication: rules 2.3 Logic implication: rules of inference of inference

• ((pp11pp22……ppnn))qq is a valid argument, if the pre is a valid argument, if the premises are true, then the conclusion is also trumises are true, then the conclusion is also true.e.

• If any one of If any one of pp11, , pp22,…,,…, p pnn is false, the implicati is false, the implication is automatically true.on is automatically true.

• To establish the validity of a given argument iTo establish the validity of a given argument is to show that the statement (s to show that the statement (pp11pp22……ppnn))qq is is a tautology.a tautology.

• The conclusion is deduced or inferred from thThe conclusion is deduced or inferred from the truth of premises.e truth of premises.

Page 26: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.19Ex 2.19

• [(p[(pr)r)((qqp)p)r]r]q q

Page 27: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.20Ex 2.20

• [p[p((p((pr)r)s)]s)](r(rs) s)

Page 28: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Key conceptsKey concepts

• Definition 2.4. If Definition 2.4. If pp and and qq are arbitrary stat are arbitrary statements such that ements such that ppqq is a tautology, then is a tautology, then we say that we say that pp is logically implies is logically implies qq and we and we write write ppqq to denote this situation. to denote this situation.

• When When ppqq, we refer to , we refer to ppqq as a logical i as a logical implication.mplication.

• If If ppqq, then , then ppqq is a tautology, and we h is a tautology, and we have ave ppqq and and qq p p. Conversely, suppose t. Conversely, suppose that hat ppqq and and qq p p, then we have , then we have ppqq..

Page 29: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

The rule of inferencesThe rule of inferences

• The rule of Modus PonensThe rule of Modus Ponens– (method of affirming), the rule of detach(method of affirming), the rule of detach

mentment– [[pp(( p pqq)])]qq – [(r[(rs)s)[(r[(rs)s)((ttu)]u)] ( (ttu) u)

• The rule of syllogismThe rule of syllogism– [([( p pqq))(( q qrr)])] ( ( p prr) )

Page 30: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.24Ex 2.24

• [ (p)[ (p) (p (pq) q) ( (qqr) ] r) ] rr

Page 31: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

the rule of Modus Tollensthe rule of Modus Tollens• (method of denying),(method of denying),

[ [qq(( p pqq)])] pp• Ex 2.25Ex 2.25• [(p[(pr)r) (r (rs)s) (t (ts)s)

((ttu)u) ( (u)] u)] pp

Page 32: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Some notesSome notes

• Some arguments look similar in appeaSome arguments look similar in appearance but are indeed invalid. rance but are indeed invalid. – [[qq(( p pqq)])]pp– [[pp(( p pqq)])]qq

• the rule of conjunction, [(the rule of conjunction, [(pp))((qq)])]((ppqq) ) • the rule of disjunctive syllogism, [(the rule of disjunctive syllogism, [( p p

qq))((pp)])] q q

Page 33: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

the rule of contradiction the rule of contradiction • [([(pp))((FF)])]((pp) )

Page 34: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

The rule of contradictionThe rule of contradiction

• When we want to establish the validity of the argumeWhen we want to establish the validity of the argument (nt (pp11pp22……ppnn))q, q, we can establish the validity of the we can establish the validity of the logically equivalent argument (logically equivalent argument (pp11pp22……ppnnqq))FF

Page 35: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen
Page 36: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.30Ex 2.30

Page 37: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.31Ex 2.31

Page 38: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.32Ex 2.32• [([(ppq)q)(q(qr)r)rrp]p]F F

Page 39: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Another inference ruleAnother inference rule

• [([( p p))((qqrr)] )] [([( p pqq) ) rr]]• [(([((pp11pp22……ppnn))((qqrr)) )) [([(pp11pp22……ppnnqq) )

rr]]• This result tells us that if we want to esThis result tells us that if we want to es

tablish the validity of the first argumetablish the validity of the first argument, we may be able to do so by establisnt, we may be able to do so by establishing the validity of the corresponding hing the validity of the corresponding argument.argument.

Page 40: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.33Ex 2.33

Page 41: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen
Page 42: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

2.4 The use of 2.4 The use of Quantifiers Quantifiers

• Definition 2.5. A declarative sentence is an Definition 2.5. A declarative sentence is an open statement if open statement if – (1) it contains one or more variables, and(1) it contains one or more variables, and– (2) it is not a statement, but (2) it is not a statement, but – (3) it becomes a statement when the variables in (3) it becomes a statement when the variables in

it are replaced by certain allowable choices.it are replaced by certain allowable choices.

• These allowable choices constitute what is These allowable choices constitute what is called the universe or universe of discourse. called the universe or universe of discourse. The universe comprises the choices we wish The universe comprises the choices we wish to consider or allow for the variables in the to consider or allow for the variables in the open statement.open statement.

Page 43: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

definitionsdefinitions

• Existential quantifier (Existential quantifier () and universal qua) and universal quantifier (ntifier () are used to quantify the open sta) are used to quantify the open statements.tements.

• In an open statement In an open statement pp((xx) the variable ) the variable xx is is called a free variable. In the statement called a free variable. In the statement xx pp((xx) the variable ) the variable xx is called a bound variabl is called a bound variable—it is bound by the existential quantifier e—it is bound by the existential quantifier . Similarly, in the statement . Similarly, in the statement xx pp((xx) the v) the variable ariable xx is bound by the universal quantifi is bound by the universal quantifier er ..

Page 44: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.36Ex 2.36

• p(x): xp(x): x00• r(x): xr(x): x22-3x-4=0-3x-4=0• q(x): xq(x): x2 2 00• s(x): xs(x): x22-3>0-3>0

x [p(x)x [p(x)r(x)] r(x)] x [p(x)x [p(x)q(x)]q(x)] x [q(x)x [q(x)s(x)]s(x)] x [r(x)x [r(x)s(x)]s(x)] x [r(x)x [r(x)p(x)]p(x)]

Page 45: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.37Ex 2.37

• p(x): x is a rational number, q(x): x is a p(x): x is a rational number, q(x): x is a real numberreal number x [p(x)x [p(x)q(x)]q(x)]

• e(t): triangle t is equilateral, a(t): triange(t): triangle t is equilateral, a(t): triangle t has three angles of 60le t has three angles of 60

t [e(t)t [e(t)a(t)]a(t)]x [sinx [sin22x+cosx+cos22x=1]x=1]mmn [41=mn [41=m22+n+n22]]

Page 46: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.39Ex 2.39

• For n:=1 to 20 do A[n]:=nFor n:=1 to 20 do A[n]:=nn-nn-nn (A[n]n (A[n]0)0)n (A[n+1]=2A[n])n (A[n+1]=2A[n])n [(1n [(1nn19)19)(A[n]<A[n+1])(A[n]<A[n+1])m m n [(mn [(mn)n)(A[m](A[m]A[n])]A[n])]

Page 47: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Definitions Definitions

• pp((xx) and ) and qq((xx) are called logically equivalent, ) are called logically equivalent, written as written as x x [[pp((xx))qq((xx)], when )], when pp((aa) ) qq((aa) i) is true for each replacement s true for each replacement aa from the unive from the universe. We say that rse. We say that pp((xx) logically implies ) logically implies qq((xx), ), written as written as x x [[pp((xx))qq((xx)], when )], when pp((aa))qq((aa) is ) is true for each replacement true for each replacement aa from the univer from the universe.se.

x x [[pp((xx))qq((xx)] if and only if )] if and only if x x [[pp((xx))qq((xx)] a)] and nd x x [[qq((xx))pp((xx)])]

x px pqq; contrapositive, ; contrapositive, xx [ [qq pp]; conver]; converse, se, x x [[qq pp]; inverse ]; inverse xx [ [ p p q q];];

Page 48: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

ExamplesExamples

• Ex 2.40. Ex 2.40. – s(x): x is a square; e(x): x is a equilateral; s(x): x is a square; e(x): x is a equilateral; x [s(x)x [s(x)e(x)]; contrapositive, converse, inversee(x)]; contrapositive, converse, inverse

• Ex 2.41. Ex 2.41. – p(x): p(x): xx>3; q(x) x>3; >3; q(x) x>3; x [p(x)x [p(x)q(x)]; contrapositive, converse, inversq(x)]; contrapositive, converse, invers

ee• Ex 2.42. r(x): 2x+1=5; s(x): xEx 2.42. r(x): 2x+1=5; s(x): x22=9=9

– xx [ [rr((xx))ss((xx)] )] xx [ [rr((xx)] )] xx [ [ss((xx)]; )]; – but we have but we have xx [ [rr((xx))ss((xx)] )] xx [ [rr((xx)] )] xx [ [ss((xx)])]

Page 49: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Table 2.22Table 2.22

xx [ [rr((xx))ss((xx)] )] xx [ [rr((xx)] )] xx [ [ss((xx)])]xx [ [rr((xx)) s s((xx)] )] xx [ [rr((xx)] )] xx [ [ss((xx)])]xx [ [rr((xx))ss((xx)] )] xx [ [rr((xx)] )] xx [ [ss((xx)])]xx [ [rr((xx))ss((xx)] )] xx [ [rr((xx)] )] xx [ [ss((xx)])]

Page 50: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.43Ex 2.43

xx [ [pp((xx))((qq((xx))rr((xx))] ))] xx [( [(pp((xx))qq((xx))))rr((xx)])]

x [p(x)x [p(x)q(x)]q(x)]x(x(p(x)p(x)q(x))q(x))x x p(x)p(x)x p(x)x p(x)x x [p(x)[p(x)q(x)]q(x)]x [x [p(x)p(x)q(x)]q(x)]x x [p(x)[p(x)q(x)]q(x)]x [x [p(x)p(x)q(x)]q(x)]

Page 51: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Rules for negationRules for negation

[[x px p((xx)] )] x x p p((xx))• [[x px p((xx)] )] x x p p((xx) ) [[x x p p((xx)] )] xx p p((xx) ) x px p((xx))[[x x p p((xx)] )] xx p p((xx) ) x px p((xx))

Page 52: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.44Ex 2.44

• p(x): x is odd, q(x): xp(x): x is odd, q(x): x22-1 is even-1 is even x (p(x)x (p(x)q(x)). If x is odd, xq(x)). If x is odd, x22-1 is even.-1 is even. [[x (p(x)x (p(x)q(x))]q(x))] x x (p(x)(p(x)q(x))q(x)) x x ((p(x)p(x)q(x))q(x)) x x p(x)p(x)q(x))q(x)) x [p(x)x [p(x)q(x)]q(x)]• There exists an integer x such that x is odd aThere exists an integer x such that x is odd a

nd xnd x22-1 is odd.-1 is odd.

Page 53: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

examplesexamples

• Ex 2.45Ex 2.45 xx yy [ [pp((xx, , yy)] )] yy xx [ [pp((xx, , yy)] )]

• Ex 2.46Ex 2.46 xx yy zz [ [pp((xx, , yy, , zz)] can be written as )] can be written as xx,, y y,,

z z [ [pp((xx, , yy, , zz)] )] • Ex 2.47Ex 2.47

xx yy [ [pp((xx, , yy)] )] yy xx [ [pp((xx, , yy)] )]

Page 54: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.48Ex 2.48

• when a statement involves both existewhen a statement involves both existential and universal quantifiers, we muntial and universal quantifiers, we must be careful about the order in which tst be careful about the order in which the quantifiers are written.he quantifiers are written.

• p(x, y): x+y=17p(x, y): x+y=17x x y p(x, y) is different from y p(x, y) is different from y y x px p

(x, y) (x, y)

Page 55: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.49Ex 2.49

• What is the negation of What is the negation of xxy[(p(x,y)y[(p(x,y)q(x,y)) q(x,y)) r(x,y)]r(x,y)]

Page 56: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.50Ex 2.50

Page 57: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

2.5 Quantifiers, definitions 2.5 Quantifiers, definitions and the proofs of theorems and the proofs of theorems • Ex 2.52. Ex 2.52.

– For all n in 2, 4, 6,…, 26, we can write n as For all n in 2, 4, 6,…, 26, we can write n as the sum of at most three perfect squares. the sum of at most three perfect squares.

– Table 2.4 shows this by the method of Table 2.4 shows this by the method of exhaustion.exhaustion.

– The method is reasonable when we dealing The method is reasonable when we dealing with a fairly small universe.with a fairly small universe.

– When the universe is very large, it is When the universe is very large, it is impossible to use the method of impossible to use the method of exhaustion.exhaustion.

Page 58: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

The rule of universal The rule of universal specification. specification.

• If If pp((xx) is an open statement for a given ) is an open statement for a given universe, and if universe, and if x px p((xx) is true, then ) is true, then pp((aa) is true for each ) is true for each aa in the universe. in the universe.

• Note that this Note that this aa is a specific but arbitra is a specific but arbitrarily chosen member from the prescribrily chosen member from the prescribed universe.ed universe.

Page 59: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.53 (b)(c)Ex 2.53 (b)(c)

Page 60: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

The rule of universal The rule of universal generalization. generalization.

• If an open statement If an open statement pp((xx) is proved to ) is proved to be true when be true when xx is replaced by a specifi is replaced by a specific but arbitrarily chosen element c but arbitrarily chosen element cc fro from our universe, then the universally qm our universe, then the universally quantified statement uantified statement x px p((xx) is true.) is true.

• Furthermore, the rule extends beyond Furthermore, the rule extends beyond a single variable. That is, the same hola single variable. That is, the same holds for ds for xx yy [ [pp((xx, , yy)], )], xx yy zz [ [pp((xx, , yy, , zz)] or more variables. )] or more variables.

Page 61: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.54Ex 2.54

Page 62: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Ex 2.56Ex 2.56

Page 63: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Theorems ProvingTheorems Proving

• The rule of universal specification and The rule of universal specification and the rule of universal generalization cathe rule of universal generalization can be applied to prove theorems.n be applied to prove theorems.

• Theorem 2.2. If k and l are both odd, tTheorem 2.2. If k and l are both odd, then k+l is even.hen k+l is even.

• Theorem 2.3. If k and l are both odd, tTheorem 2.3. If k and l are both odd, then khen kl is also odd.l is also odd.

Page 64: Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen

Theorem 2.4Theorem 2.4

• If m is an even integer, the m+7 is odd.If m is an even integer, the m+7 is odd.• Theorem 2.4 uses three different ways Theorem 2.4 uses three different ways

to prove the theorem. to prove the theorem. • (1) p(1) pq, if m is even then m+7 is evenq, if m is even then m+7 is even• (2) (2) qqp, if m+7 is even then m is odp, if m+7 is even then m is od

dd• (3)p(3)pqqF, if m and m+7 are both even,F, if m and m+7 are both even,

then it is a contradiction. then it is a contradiction.