Sectin 1.6
Sectin Summary Valid Arguments Inference Rules fr Prpsitinal Lgic Using Rules f Inference t Build Arguments Rules f Inference fr Quantified Statements Building Arguments fr Quantified Statements
Revisiting the Scrates Example We have the tw premises: if yu have a current passwrd, then yu can lg nt the netwrk yu have a current passwrd And the cnclusin: yu can lg nt the netwrk Hw d we get the cnclusin frm the premises?
The Argument Argument: a sequence f statements that end with a cnclusin Frmer example: Premises: if yu have a current passwrd, then yu can lg nt the netwrk and yu have a current passwrd Cnclusin : yu can lg nt the netwrk p: Yu have a current passwrd q : Yu can lg nt the netwrk.
Valid Arguments Valid arguments: the cnclusin r final statement f the argument must fllw frm the truth f the preceding statements r premises f the argument. the argument is true if and nly if it is impssible fr all the premises t be true and the cnclusin t be false. The rules f inference are the essential building blck in the cnstructin f valid arguments. Arguments in Prpsitinal Lgic Arguments in Predicate Lgic
Arguments in Prpsitinal Lgic Definitin 1: An argument in prpsitinal lgic is a sequence f prpsitins. All but the final prpsitin are called premises. The last statement is the cnclusin. The argument is valid if the premises imply the cnclusin. An argument frm in prpsitinal lgic is a sequence f cmpund prpsitins invlving prpsitinal variables. An argument frm is valid n matter what prpsitins are substituted int its prpsitinal variables in its premises, the cnclusin is true if the premises are all true. If the premises are p 1,p 2,,p n and the cnclusin is q then (p 1 p 2 p n ) q is a tautlgy.
Rules f Inference fr Prpsitinal Lgic rules f inference: the validity f sme relatively simple argument frms rules f inference can be used as building blcks t cnstruct mre cmplicated valid argument frms
Mdus pnens Crrespnding Tautlgy: (p (p q)) q Example: p : It is snwing. q : I will study discrete math. Premises: If it is snwing, then I will study discrete math. It is snwing. Cnclusin: Therefre, I will study discrete math.
Mdus Tllens Crrespnding Tautlgy: Example: p be it is snwing. q be I will study discrete math. Premises: If it is snwing, then I will study discrete math. I will nt study discrete math. Cnclusin: Therefre, it is nt snwing.
Hypthetical Syllgism Crrespnding Tautlgy: ((p q) (q r)) (p r) Example: Let p be it snws. Let q be I will study discrete math. Let r be I will get an A. Premises: If it snws, then I will study discrete math. If I study discrete math, I will get an A. Cnclusin: Therefre, If it snws, I will get an A.
Disjunctive Syllgism Crrespnding Tautlgy: ( p (p q)) q Example: Let p be I will study discrete math. Let q be I will study English literature. Premises: I will study discrete math r I will study English literature. I will nt study discrete math. Cnclusin: Therefre, I will study English literature.
Additin Crrespnding Tautlgy: p (p q) Example: Let p be I will study discrete math. Let q be I will visit Las Vegas. Premises: I will study discrete math. Cnclusin: Therefre, I will study discrete math r I will visit Las Vegas.
Simplificatin Crrespnding Tautlgy: (p q) p Example: Let p be I will study discrete math. Let q be I will study English literature. Premises: I will study discrete math and English literature Cnclusin: Therefre, I will study discrete math.
Cnjunctin Crrespnding Tautlgy: ((p) (q)) (p q) Example: Let p be I will study discrete math. Let q be I will study English literature. Premises: I will study discrete math. I will study English literature. Cnclusin: Therefre, I will study discrete math and I will study English literature.
Reslutin Crrespnding Tautlgy: (( p r ) (p q)) (q r) Example: Let p be I will study discrete math. Let r be I will study English literature. Let q be I will study databases. Premises: I will nt study discrete math r I will study English literature. I will study discrete math r I will study databases. Cnclusin: Therefre, I will study databases r I will English literature.
Rules f inference
Valid Arguments Example 1: Frm the single prpsitin Shw that q is a cnclusin. Slutin:
Valid Arguments Example 2: With these hyptheses: It is nt sunny this afternn and it is clder than yesterday. We will g swimming nly if it is sunny. If we d nt g swimming, then we will take a cane trip. If we take a cane trip, then we will be hme by sunset. Using the inference rules, cnstruct a valid argument fr the cnclusin: We will be hme by sunset. Slutin: 1. Chse prpsitinal variables: p : It is sunny this afternn, q : It is clder than yesterday, r : We will g swimming, s : We will take a cane trip, and t : We will be hme by sunset. 2. Translatin int prpsitinal lgic: Premises: Cnclusin: t
Valid Arguments p : It is sunny this afternn, q : It is clder than yesterday, r : We will g swimming, s : We will take a cane trip, and t : We will be hme by sunset. Premises: Cnclusin: t 3. Cnstruct the Valid Argument
Rules f Inference fr predicate Lgic Universal Instantiatin (UI) Example: Premises: Our dmain cnsists f all dgs and Fid is a dg. All dgs are cuddly. Cnclusin: Therefre, Fid is cuddly.
Rules f Inference fr predicate Lgic Universal Generalizatin (UG) Existential Instantiatin (EI) Existential Generalizatin (EG)
Using Rules f Inference Example 1: Using the rules f inference, cnstruct a valid argument t shw that Jhn Smith has tw legs is a cnsequence f the premises: Every man has tw legs. and Jhn Smith is a man. Slutin: Let M(x) dente x is a man and L(x) x has tw legs and let Jhn Smith be a member f the dmain. Valid Argument:
Using Rules f Inference Example 2: Use the rules f inference t cnstruct a valid argument shwing that the cnclusin Smene wh passed the first exam has nt read the bk. fllws frm the premises A student in this class has nt read the bk. Everyne in this class passed the first exam. Slutin: Let C(x) dente x is in this class, B(x) dente x has read the bk, and P(x) dente x passed the first exam. First we translate the premises and cnclusin int symblic frm. Cntinued n next slide
Using Rules f Inference Valid Argument:
Cmbining rules f inference fr prpsitins and quantified statements Universal mdus pnes (MP): cmbines universal instantiatin and mdus pnens int ne rule
Returning t the Scrates Example
Sectin 1.7
Sectin Summary Mathematical Prfs Frms f Therems Direct Prfs Indirect Prfs Prf f the Cntrapsitive Prf by Cntradictin
Prfs f Mathematical Statements A prf is a valid argument that establishes the truth f a statement. Prfs have many practical applicatins: verificatin that cmputer prgrams are crrect establishing that perating systems are secure enabling prgrams t make inferences in artificial intelligence shwing that system specificatins are cnsistent
Sme Terminlgy A therem is a statement that can be shwn t be true using: definitins ther therems axims (statements which are given as true) rules f inference A lemma is a helping therem r a result which is needed t prve a therem. A crllary is a result which fllws directly frm a therem. Less imprtant therems are smetimes called prpsitins. A cnjecture is a statement that is being prpsed t be true. Once a prf f a cnjecture is fund, it becmes a therem. It may turn ut t be false.
Frms f Therems Many therems assert that a prperty hlds fr all elements in a dmain, such as the integers, the real numbers, r sme f the discrete structures that we will study in this class. Often the universal quantifier (needed fr a precise statement f a therem) is mitted by standard mathematical cnventin. Fr example, the statement: If x > y, where x and y are psitive real numbers, then x 2 > y 2 really means Fr all psitive real numbers x and y, if x > y, then x 2 > y 2.
Methds f prving therems Direct prfs Prf by cntrapsitin Prfs by cntradictin
Even and Odd Integers Definitin: The integer n is even if there exists an integer k such that n = 2k, and n is dd if there exists an integer k, such that n = 2k + 1. Nte that every integer is either even r dd and n integer is bth even and dd.
Prving Cnditinal Statements: p q Direct Prf: Assume that p is true. Use rules f inference, axims, and lgical equivalences t shw that q must als be true. Example: Give a direct prf f the therem If n is an dd integer, then n 2 is dd. Slutin: Assume that n is dd. Then n = 2k + 1 fr an integer k. Squaring bth sides f the equatin, we get: n 2 = (2k + 1) 2 = 4k 2 + 4k +1 = 2(2k 2 + 2k) + 1= 2r + 1, where r = 2k 2 + 2k, an integer. We have prved that if n is an dd integer, then n 2 is an dd integer. ( marks the end f the prf. Smetimes QED is used instead. )
Prving Cnditinal Statements: p q Prf by Cntrapsitin: Assume q and shw p is true als. This is smetimes called an indirect prf methd. If we give a direct prf f q p then we have a prf f p q. Example: Prve that if n is an integer and 3n + 2 is dd, then n is dd. Slutin: Cntrapsitin: if n is even, then 3n+2 is even Assume n is even. S, n = 2k fr sme integer k. Thus 3n + 2 = 3(2k) + 2 =6k +2 = 2(3k + 1) = 2j fr j = 3k +1 Therefre 3n + 2 is even. Since we have shwn q p, p q must hld as well. If n is an integer and 3n + 2 is dd (nt even), then n is dd (nt even).
Prving Cnditinal Statements: p q Prf by Cntradictin: Because the statement r r is a cntradictin whenever r is a prpsitin, we can prve that p is true if we can shw that p (r r) is true fr sme prpsitin r. Example: Prve that if yu pick 22 days frm the calendar, at least 4 must fall n the same day f the week. Slutin: Assume that n mre than 3 f the 22 days fall n the same day f the week. Because there are 7 days f the week, we culd nly have picked 21 days. This cntradicts the assumptin that we have picked 22 days.
Therems that are Bicnditinal Statements T prve a therem that is a bicnditinal statement, that is, a statement f the frm p q, we shw that p q and q p are bth true. Example: Prve the therem: If n is an integer, then n is dd if and nly if n2 is dd. Slutin: We have already shwn (previus slides) that bth p q and q p. Therefre we can cnclude p q. Smetimes iff is used as an abbreviatin fr if an nly if, as in If n is an integer, then n is dd iif n 2 is dd.
Lking Ahead If direct methds f prf d nt wrk: We may need a clever use f a prf by cntrapsitin. Or a prf by cntradictin. In the next sectin, we will see strategies that can be used when straightfrward appraches d nt wrk. In Chapter 5, we will see mathematical inductin and related techniques. In Chapter 6, we will see cmbinatrial prfs
Sectin 1.8
Sectin Summary Prf by Cases Existence Prfs Cnstructive Nncnstructive Disprf by Cunterexample Nnexistence Prfs Uniqueness Prfs Prf Strategies Prving Universally Quantified Assertins Open Prblems
Prf by Cases T prve a cnditinal statement f the frm: Use the tautlgy Each f the implicatins is a case.
Prf by Cases Example: Let a @ b = max{a, b} = a if a b, therwise a @ b = max{a, b} = b. Shw that fr all real numbers a, b, c (a @b) @ c = a @ (b @ c) (This means the peratin @ is assciative.) Prf: Let a, b, and c be arbitrary real numbers. Then ne f the fllwing 6 cases must hld. 1. a b c 2. a c b 3. b a c 4. b c a 5. c a b 6. c b a Case 1: a b c (a @ b) = a, a @ c = a, b @ c = b Hence (a @ b) @ c = a = a @ (b @ c) Therefre the equality hlds fr the first case. Case 2: A cmplete prf requires that the equality be shwn t hld fr all 6 cases. But the prfs f the remaining cases are similar.
Withut Lss f Generality Example: Shw that if x and y are integers and bth x y and x+y are even, then bth x and y are even. Suppse x and y are nt bth even. Then, ne r bth are dd. Withut lss f generality, assume that x is dd. Then x = 2m + 1 fr sme integer k. Case 1: y is even. Then y = 2n fr sme integer n, s x + y = (2m + 1) + 2n = 2(m + n) + 1 is dd. Case 2: y is dd. Then y = 2n + 1 fr sme integer n, s x y = (2m + 1) (2n + 1) = 2(2m n +m + n) + 1 is dd. We nly cver the case where x is dd because the case where y is dd is similar. The use phrase withut lss f generality (WLOG) indicates this.
Existence Prfs Prf f therems f the frm. Cnstructive existence prf: Find an explicit value f c, fr which P(c) is true. Then is true by Existential Generalizatin (EG). Example: Shw that there is a psitive integer that can be written as the sum f cubes f psitive integers in tw different ways: Prf: 1729 is such a number since 1729 = 10 3 + 9 3 = 12 3 + 1 3 nncnstructive existence prf: assume n c exists which makes P(c) true and derive a cntradictin.
Cunterexamples An element fr which P(x) is false is called a cunterexample f x P(x) Example: Every psitive integer is the sum f the squares f 3 integers. The integer 7 is a cunterexample. S the claim is false.
Uniqueness Prfs therems asset the existence f a unique element with a particular prperty,!x P(x). The tw parts f a uniqueness prf are Existence: We shw that an element x with the prperty exists. Uniqueness: We shw that if y x, then y des nt have the prperty. Example: Shw that if a and b are real numbers and a 0, then there is a unique real number r such that ar + b = 0. Slutin: Existence: The real number r = b/a I s a slutin f ar + b = 0 because a( b/a) + b = b + b =0. Uniqueness: Suppse that s is a real number such that as + b = 0. Then ar + b = as + b, where r = b/a. Subtracting b frm bth sides and dividing by a shws that r = s.
Universally Quantified Assertins T prve therems f the frm,assume x is an arbitrary member f the dmain and shw that P(x) must be true. Using UG it fllws that.
Universally Quantified Assertins Example: An integer x is even if and nly if x 2 is even. Slutin: The quantified assertin is x [x is even x 2 is even] We assume x is arbitrary. Case 1. if x is even then x 2 is even using a direct prf. If x is even then x = 2k fr sme integer k. Hence x 2 = 4k 2 = 2(2k 2 ) which is even since it is an integer divisible by 2. This cmpletes the prf f case 1. Case 2. if x2 is even then x must be even (the if part r sufficiency). We use a prf by cntrapsitin. Assume x is nt even and then shw that x2 is nt even. If x is nt even then it must be dd. S, x = 2k + 1 fr sme k. Then x 2 = (2k + 1) 2 = 4k 2 + 4k + 1 = 2(2k 2 + 2k) + 1 which is dd and hence nt even. This cmpletes the prf f case 2. Since x was arbitrary, the result fllws by UG. Therefre we have shwn that x is even if and nly if x2 is even.
Prf and Disprf: Tilings Example 1: Can we tile the standard checkerbard using dmins? Slutin: Yes! One example prvides a cnstructive existence prf. Tw Dmines The Standard Checkerbard One Pssible Slutin
Tilings Example 2: Can we tile a checkerbard btained by remving ne f the fur crner squares f a standard checkerbard? Slutin: Our checkerbard has 64 1 = 63 squares. Since each dmin has tw squares, a bard with a tiling must have an even number f squares. The number 63 is nt even. We have a cntradictin.
Additinal Prf Methds Later we will see many ther prf methds: Mathematical inductin, which is a useful methd fr prving statements f the frm n P(n), where the dmain cnsists f all psitive integers. Structural inductin, which can be used t prve such results abut recursively defined sets. Cmbinatrial prfs use cunting arguments.