with question/answer...

71
Chapter 1, Part III: Proofs With Question/Answer Animations

Upload: others

Post on 12-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Chapter1,PartIII:Proofs

WithQuestion/AnswerAnimations

Page 2: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Summary ValidArgumentsandRulesofInference ProofMethods ProofStrategies

Page 3: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Section1.6

Page 4: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Sec*onSummary ValidArguments InferenceRulesforPropositionalLogic UsingRulesofInferencetoBuildArguments RulesofInferenceforQuantifiedStatements BuildingArgumentsforQuantifiedStatements

Page 5: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Revisi*ngtheSocratesExample Wehavethetwopremises:

 “Allmenaremortal.” “Socratesisaman.”

 Andtheconclusion: “Socratesismortal.”

 Howdowegettheconclusionfromthepremises?

Page 6: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

TheArgument Wecanexpressthepremises(abovetheline)andtheconclusion(belowtheline)inpredicatelogicasanargument:

 Wewillseeshortlythatthisisavalidargument.

Page 7: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ValidArguments  Wewillshowhowtoconstructvalidargumentsin

twostages;firstforpropositionallogicandthenforpredicatelogic.Therulesofinferencearetheessentialbuildingblockintheconstructionofvalidarguments.

1.  PropositionalLogicInferenceRules

2.  PredicateLogicInferencerulesforpropositionallogicplusadditionalinference

rulestohandlevariablesandquantifiers.

Page 8: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ArgumentsinProposi*onalLogic Aargumentinpropositionallogicisasequenceofpropositions.

Allbutthefinalpropositionarecalledpremises.Thelaststatementistheconclusion.

  Theargumentisvalidifthepremisesimplytheconclusion.Anargumentformisanargumentthatisvalidnomatterwhatpropositionsaresubstitutedintoitspropositionalvariables.

  Ifthepremisesarep1 ,p2, …,pn andtheconclusionisqthen(p1 ∧ p2 ∧ … ∧ pn)→ q isatautology.   Inferencerulesareallargumentsimpleargumentformsthat

willbeusedtoconstructmorecomplexargumentforms.

Page 9: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

RulesofInferenceforProposi*onalLogic:ModusPonens

Example:Letpbe“Itissnowing.”Letqbe“Iwillstudydiscretemath.”

“Ifitissnowing,thenIwillstudydiscretemath.”“Itissnowing.”

“Therefore,Iwillstudydiscretemath.”

CorrespondingTautology:(p∧ (p →q)) → q

Page 10: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ModusTollens

Example:Letpbe“itissnowing.”Letqbe“Iwillstudydiscretemath.”

“Ifitissnowing,thenIwillstudydiscretemath.”“Iwillnotstudydiscretemath.”

“Therefore,itisnotsnowing.”

CorrespondingTautology:(¬p∧(p →q))→¬q

Page 11: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Hypothe*calSyllogism

Example:Letpbe“itsnows.”Letqbe“Iwillstudydiscretemath.”Letrbe“IwillgetanA.”

“Ifitsnows,thenIwillstudydiscretemath.”“IfIstudydiscretemath,IwillgetanA.”

“Therefore,Ifitsnows,IwillgetanA.”

CorrespondingTautology:((p →q) ∧(q→r))→(p→ r)

Page 12: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Disjunc*veSyllogism

Example:Letpbe“Iwillstudydiscretemath.”Letqbe“IwillstudyEnglishliterature.”

“IwillstudydiscretemathorIwillstudyEnglishliterature.”“Iwillnotstudydiscretemath.”

“Therefore,IwillstudyEnglishliterature.”

CorrespondingTautology:(¬p∧(p ∨q))→q

Page 13: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Addi*on

Example:Letpbe“Iwillstudydiscretemath.”Letqbe“IwillvisitLasVegas.”

“Iwillstudydiscretemath.”

“Therefore,IwillstudydiscretemathorIwillvisitLasVegas.”

CorrespondingTautology:p →(p ∨q)

Page 14: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Simplifica*on

Example:Letpbe“Iwillstudydiscretemath.”Letqbe“IwillstudyEnglishliterature.”

“IwillstudydiscretemathandEnglishliterature”

“Therefore,Iwillstudydiscretemath.”

CorrespondingTautology:(p∧q) →p

Page 15: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Conjunc*on

Example:Letpbe“Iwillstudydiscretemath.”Letqbe“IwillstudyEnglishliterature.”

“Iwillstudydiscretemath.”“IwillstudyEnglishliterature.”

“Therefore,IwillstudydiscretemathandIwillstudyEnglishliterature.”

CorrespondingTautology:((p)∧ (q)) →(p ∧ q)

Page 16: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Resolu*on

Example:Letpbe“Iwillstudydiscretemath.”Letrbe“IwillstudyEnglishliterature.”Letqbe“Iwillstudydatabases.”

“IwillnotstudydiscretemathorIwillstudyEnglishliterature.”“IwillstudydiscretemathorIwillstudydatabases.”

“Therefore,IwillstudydatabasesorIwillEnglishliterature.”

CorrespondingTautology:((¬p∨ r ) ∧ (p ∨ q)) →(q ∨ r)

ResolutionplaysanimportantroleinAIandisusedinProlog.

Page 17: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UsingtheRulesofInferencetoBuildValidArguments Avalidargumentisasequenceofstatements.Eachstatementis

eitherapremiseorfollowsfrompreviousstatementsbyrulesofinference.Thelaststatementiscalledconclusion.

 Avalidargumenttakesthefollowingform: S1

S2 ...Sn

C

Page 18: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ValidArgumentsExample1:Fromthesingleproposition

Showthatqisaconclusion.Solution:

Page 19: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ValidArgumentsExample2:  Withthesehypotheses:

“Itisnotsunnythisafternoonanditiscolderthanyesterday.”“Wewillgoswimmingonlyifitissunny.”“Ifwedonotgoswimming,thenwewilltakeacanoetrip.”“Ifwetakeacanoetrip,thenwewillbehomebysunset.”

  Usingtheinferencerules,constructavalidargumentfortheconclusion:“Wewillbehomebysunset.”

Solution:1.  Choosepropositionalvariables:

p:“Itissunnythisafternoon.”r:“Wewillgoswimming.”t:“Wewillbehomebysunset.”

q:“Itiscolderthanyesterday.”s:“Wewilltakeacanoetrip.”2.  Translationintopropositionallogic:

Continuedonnextslide

Page 20: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ValidArguments3.ConstructtheValidArgument

Page 21: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

HandlingQuan*fiedStatements Validargumentsforquantifiedstatementsareasequenceofstatements.Eachstatementiseitherapremiseorfollowsfrompreviousstatementsbyrulesofinferencewhichinclude: RulesofInferenceforPropositionalLogic RulesofInferenceforQuantifiedStatements

 Therulesofinferenceforquantifiedstatementsareintroducedinthenextseveralslides.

Page 22: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UniversalInstan*a*on(UI)

Example:

OurdomainconsistsofalldogsandFidoisadog.

“Alldogsarecuddly.”

“Therefore,Fidoiscuddly.”

Page 23: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UniversalGeneraliza*on(UG)

UsedoftenimplicitlyinMathematicalProofs.

Page 24: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Existen*alInstan*a*on(EI)

Example:

“ThereissomeonewhogotanAinthecourse.”“Let’scallheraandsaythatagotanA”

Page 25: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Existen*alGeneraliza*on(EG)

Example:

“MichellegotanAintheclass.”“Therefore,someonegotanAintheclass.”

Page 26: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UsingRulesofInferenceExample1:Usingtherulesofinference,constructavalidargumentto

showthat“JohnSmithhastwolegs”

isaconsequenceofthepremises:“Everymanhastwolegs.”“JohnSmithisaman.”

Solution:LetM(x)denote“xisaman”andL(x)“xhastwolegs”andletJohnSmithbeamemberofthedomain.ValidArgument:

Page 27: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UsingRulesofInferenceExample2:Usetherulesofinferencetoconstructavalidargumentshowing

thattheconclusion“Someonewhopassedthefirstexamhasnotreadthebook.”

followsfromthepremises“Astudentinthisclasshasnotreadthebook.”“Everyoneinthisclasspassedthefirstexam.”

Solution:LetC(x)denote“xisinthisclass,”B(x)denote“xhasreadthebook,”andP(x)denote“xpassedthefirstexam.”Firstwetranslatethepremisesandconclusionintosymbolicform.

Continuedonnextslide

Page 28: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UsingRulesofInferenceValidArgument:

Page 29: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ReturningtotheSocratesExample

Page 30: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Solu*onforSocratesExampleValidArgument

Page 31: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UniversalModusPonens

UniversalModusPonenscombinesuniversalinstantiationandmodusponensintoonerule.

ThisrulecouldbeusedintheSocratesexample.

Page 32: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Section1.7

Page 33: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Sec*onSummary MathematicalProofs FormsofTheorems DirectProofs IndirectProofs

 ProofoftheContrapositive ProofbyContradiction

Page 34: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProofsofMathema*calStatements  Aproofisavalidargumentthatestablishesthetruthofastatement.  Inmath,CS,andotherdisciplines,informalproofswhichare

generallyshorter,aregenerallyused.  Morethanoneruleofinferenceareoftenusedinastep.  Stepsmaybeskipped.  Therulesofinferenceusedarenotexplicitlystated.  Easierfortounderstandandtoexplaintopeople.  Butitisalsoeasiertointroduceerrors.

  Proofshavemanypracticalapplications:  verificationthatcomputerprogramsarecorrect  establishingthatoperatingsystemsaresecure  enablingprogramstomakeinferencesinartificialintelligence  showingthatsystemspecificationsareconsistent

Page 35: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Defini*ons Atheoremisastatementthatcanbeshowntobetrueusing:

  definitions  othertheorems  axioms(statementswhicharegivenastrue)  rulesofinference

 Alemmaisa‘helpingtheorem’oraresultwhichisneededtoproveatheorem.

 Acorollaryisaresultwhichfollowsdirectlyfromatheorem.  Lessimportanttheoremsaresometimescalledpropositions. Aconjectureisastatementthatisbeingproposedtobetrue.

Onceaproofofaconjectureisfound,itbecomesatheorem.Itmayturnouttobefalse.

Page 36: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

FormsofTheorems Manytheoremsassertthatapropertyholdsforallelementsinadomain,suchastheintegers,therealnumbers,orsomeofthediscretestructuresthatwewillstudyinthisclass.

 Oftentheuniversalquantifier(neededforaprecisestatementofatheorem)isomittedbystandardmathematicalconvention.

Forexample,thestatement:“Ifx>y,wherexandyarepositiverealnumbers,thenx2>y2”

reallymeans“Forallpositiverealnumbersxandy,ifx>y,thenx2>y2.”

Page 37: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProvingTheorems Manytheoremshavetheform:

 Toprovethem,weshowthatwherecisanarbitraryelementofthedomain,

 Byuniversalgeneralizationthetruthoftheoriginalformulafollows.

 So,wemustprovesomethingoftheform:

Page 38: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProvingCondi*onalStatements:p→ q

  TrivialProof:Ifweknowqistrue,thenp→ qistrueaswell.

“Ifitisrainingthen1=1.”

  VacuousProof:Ifweknowpisfalsethenp→ qistrueaswell.“IfIambothrichandpoorthen2 + 2 = 5.”

[Eventhoughtheseexamplesseemsilly,bothtrivialandvacuousproofsareoftenusedinmathematicalinduction,aswewillseeinChapter5)]

Page 39: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

EvenandOddIntegersDefinition:Theintegernisevenifthereexistsanintegerksuchthatn=2k,andnisoddifthereexistsanintegerk,suchthatn=2k+1.Notethateveryintegeriseitherevenoroddandnointegerisbothevenandodd.

Wewillneedthisbasicfactabouttheintegersinsomeoftheexampleproofstofollow.WewilllearnmoreabouttheintegersinChapter4.

Page 40: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProvingCondi*onalStatements:p→ q DirectProof:Assumethatpistrue.Userulesofinference,axioms,andlogicalequivalencestoshowthatqmustalsobetrue.

Example:Giveadirectproofofthetheorem“Ifnisanoddinteger,thenn2isodd.”

Solution:Assumethatnisodd.Thenn=2k+1foranintegerk.Squaringbothsidesoftheequation,weget:

n2=(2k+1)2 =4k2 + 4k +1 = 2(2k2 + 2k) + 1= 2r + 1, where r = 2k2 + 2k , an integer. Wehaveprovedthatifnisanoddinteger,thenn2isanoddinteger.

(markstheendoftheproof.SometimesQEDisusedinstead.)

Page 41: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProvingCondi*onalStatements:p→ qDefinition:Therealnumberrisrationalifthereexistintegerspandqwhereq≠0suchthatr=p/q

Example:Provethatthesumoftworationalnumbersisrational.

Solution:Assumerandsaretworationalnumbers.Thentheremustbeintegersp,qandalsot,usuchthat

Thusthesumisrational.

wherev = pu + qt w =qu≠ 0

Page 42: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProvingCondi*onalStatements:p→ q  ProofbyContraposition:Assume¬qandshow¬pistruealso.Thisis

sometimescalledanindirectproofmethod.Ifwegiveadirectproofof¬q→ ¬p then we have a proof of p→ q. Whydoesthiswork?

Example:Provethatifnisanintegerand3n+2isodd,thennisodd.

Solution:Assumeniseven.So,n=2kforsomeintegerk.Thus 3n+2 = 3(2k) + 2 =6k +2 = 2(3k + 1) = 2j for j=3k+1 Therefore3n+2 iseven. Since we have shown ¬q → ¬p ,p →

q must hold as well. Ifnisanintegerand3n+2isodd(noteven),thennisodd(noteven).

Page 43: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProvingCondi*onalStatements:p→ qExample:Provethatforanintegern,ifn2isodd,thennisodd.

Solution:Useproofbycontraposition.Assumeniseven(i.e.,notodd).Therefore,thereexistsanintegerksuchthatn=2k.Hence,

n2=4k2=2 (2k2)andn2iseven(i.e.,notodd).Wehaveshownthatifnisaneveninteger,thenn2iseven.Thereforebycontraposition,foranintegern,ifn2isodd,thennisodd.

Page 44: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProvingCondi*onalStatements:p→ q ProofbyContradiction:(AKAreductioadabsurdum).Toprovep,assume¬pandderiveacontradictionsuchasp∧ ¬p. (an indirect form of proof).Sincewehaveshownthat¬p→Fistrue,itfollowsthatthecontrapositiveT→p also holds.

Example:Provethatifyoupick22daysfromthecalendar,atleast4mustfallonthesamedayoftheweek.

Solution:Assumethatnomorethan3ofthe22daysfallonthesamedayoftheweek.Becausethereare7daysoftheweek,wecouldonlyhavepicked21days.Thiscontradictstheassumptionthatwehavepicked22days.

Page 45: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProofbyContradic*on  ApreviewofChapter4.Example:Useaproofbycontradictiontogiveaproofthat√2 is

irrational. Solution: Suppose √2 is rational. Then there exists integers a and b

with √2 = a/b, where b≠ 0 and a and b have no common factors (see Chapter 4). Then

Therefore a2 must be even. If a2 is even then a must be even (an exercise). Since a is even, a = 2c for some integer c. Thus,

Therefore b2 is even. Again then b must be even as well. But then 2 must divide both a and b. This contradicts our

assumption that a and b have no common factors. We have proved by contradiction that our initial assumption must be false and therefore √2 is irrational .

Page 46: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProofbyContradic*on ApreviewofChapter4.Example:Provethatthereisnolargestprimenumber.Solution:Assumethatthereisalargestprimenumber.Callitpn.Hence,wecanlistalltheprimes2,3,..,pn.Form

Noneoftheprimenumbersonthelistdividesr.Therefore,byatheoreminChapter4,eitherrisprimeorthereisasmallerprimethatdividesr.Thiscontradictstheassumptionthatthereisalargestprime.Therefore,thereisnolargestprime.

Page 47: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

TheoremsthatareBicondi*onalStatements Toproveatheoremthatisabiconditionalstatement,thatis,astatementoftheformp↔ q, we show that p → q and q →p are both true.

Example: Prove the theorem: “If n is an integer, then n is odd if and only if n2 is odd.”

Solution: We have already shown (previous slides) that both p →q and q →p. Therefore we can conclude p↔ q.

Sometimes iff is used as an abbreviation for “if an only if,” as in “If n is an integer, then n is odd iif n2 is odd.”

Page 48: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Whatiswrongwiththis?“Proof”that1=2

Solution:Step5.a‐b=0 by the premise and division by 0 is undefined.

Page 49: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

LookingAhead Ifdirectmethodsofproofdonotwork:

 Wemayneedacleveruseofaproofbycontraposition.  Oraproofbycontradiction.  Inthenextsection,wewillseestrategiesthatcanbeusedwhenstraightforwardapproachesdonotwork.

 InChapter5,wewillseemathematicalinductionandrelatedtechniques.

 InChapter6,wewillseecombinatorialproofs

Page 50: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Section1.8

Page 51: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Sec*onSummary ProofbyCases ExistenceProofs

 Constructive Nonconstructive

 DisproofbyCounterexample NonexistenceProofs UniquenessProofs ProofStrategies ProvingUniversallyQuantifiedAssertions OpenProblems

Page 52: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProofbyCases Toproveaconditionalstatementoftheform:

 Usethetautology

 Eachoftheimplicationsisacase.

Page 53: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProofbyCasesExample:Leta@b=max{a,b}=aifa ≥ b,otherwisea@b

=max{a,b}=b.Showthatforallrealnumbersa,b,c(a@b)@c=a@(b@c)(Thismeanstheoperation@isassociative.)Proof:Leta,b,andcbearbitraryrealnumbers.Thenoneofthefollowing6casesmusthold.1.  a≥ b ≥ c 2.  a≥ c ≥ b 3.  b≥ a ≥c 4.  b≥ c ≥a 5.  c≥ a ≥ b 6.  c≥ b ≥ a

Continuedonnextslide

Page 54: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProofbyCasesCase1:a≥ b ≥ c(a@b)=a,a@c=a,b@c=bHence(a@b)@c=a=a@(b@c)Thereforetheequalityholdsforthefirstcase.

Acompleteproofrequiresthattheequalitybeshowntoholdforall6cases.Buttheproofsoftheremainingcasesaresimilar.Trythem.

Page 55: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

WithoutLossofGeneralityExample:Showthatifxandyareintegersandbothx·yandx+yareeven,

thenbothxandyareeven.Proof:Useaproofbycontraposition.Supposexandyarenotbotheven.

Then,oneorbothareodd.Withoutlossofgenerality,assumethatxisodd.Thenx = 2m + 1 forsomeintegerk.Case1:yiseven.Theny = 2n forsomeintegern,so

x + y = (2m+ 1) + 2n = 2(m + n) + 1 is odd. Case 2:yisodd.Theny = 2n + 1 forsomeintegern,so

x · y = (2m+ 1) (2n + 1) = 2(2m ·n +m + n) + 1 is odd.

We only cover the case where x is odd because the case where y is odd is similar. The use phrase without loss of generality (WLOG) indicates this.

Page 56: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ExistenceProofs Proofoftheoremsoftheform. Constructiveexistenceproof:

  Findanexplicitvalueofc,forwhichP(c)istrue. ThenistruebyExistentialGeneralization(EG).

Example:Showthatthereisapositiveintegerthatcanbewrittenasthesumofcubesofpositiveintegersintwodifferentways:

Proof:1729 is such a number since 1729 = 103 + 93 = 123 + 13

GodfreyHaroldHardy(1877-1947)

SrinivasaRamanujan(1887-1920)

Page 57: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Nonconstruc*veExistenceProofs Inanonconstructiveexistenceproof,weassumenocexistswhichmakesP(c)trueandderiveacontradiction.

Example:Showthatthereexistirrationalnumbersxandysuchthatxyisrational.

Proof:Weknowthat√2 is irrational. Consider the number √2 √2 . If it is rational, we have two irrational numbers x and y with xyrational,namelyx=√2 and y = √2.Butif√2 √2 is irrational, then we can let x = √2 √2 and y = √2 so that aaaaa xy= (√2 √2 )√2 = √2 (√2 √2) = √2 2 = 2.

Page 58: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Counterexamples Recall. Toestablishthatistrue(orisfalse)findacsuchthat¬P(c)istrueorP(c)isfalse.

 Inthiscaseciscalledacounterexampletotheassertion.

Example:“Everypositiveintegeristhesumofthesquaresof3integers.”Theinteger7isacounterexample.Sotheclaimisfalse.

Page 59: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UniquenessProofs  Sometheoremsassettheexistenceofauniqueelementwitha

particularproperty,∃!xP(x).Thetwopartsofauniquenessproofare  Existence:Weshowthatanelementxwiththepropertyexists.  Uniqueness:Weshowthatify≠x, then y does not have the

property. Example: Show that if a and b are real numbers and a ≠0,

then there is a unique real number r such that ar + b = 0. Solution:

  Existence: The real number r = −b/a is a solution of ar + b = 0 because a(−b/a) + b = −b + b =0.

  Uniqueness: Suppose that s is a real number such that as + b = 0. Then ar + b = as + b, where r = −b/a. Subtracting b from both sides and dividing by a shows that r = s.

Page 60: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProofStrategiesforprovingp→ q  Choose a method.

1.  First try a direct method of proof. 2.  If this does not work, try an indirect method (e.g., try to

prove the contrapositive).  For whichever method you are trying, choose a strategy.

1.  Firsttryforwardreasoning.Startwiththeaxiomsandknowntheoremsandconstructasequenceofstepsthatendintheconclusion.Startwithpandproveq,orstartwith¬qandprove¬p.

2.  Ifthisdoesn’twork,trybackwardreasoning.Whentryingtoproveq,findastatementpthatwecanprovewiththepropertyp→ q.

Page 61: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

BackwardReasoningExample:Supposethattwopeopleplayagametakingturnsremoving,1,2,or3 stones

atatimefromapilethatbeginswith15stones.Thepersonwhoremovesthelaststonewinsthegame.Showthatthefirstplayercanwinthegamenomatterwhatthesecondplayerdoes.

Proof:Letnbethelaststepofthegame.Stepn:Player1canwinifthepilecontains1,2,or3stones.Stepn‐1:Player2willhavetoleavesuchapileifthepilethathe/sheisfacedwithhas4

stones.Stepn‐2:Player1canleave4stoneswhenthereare5,6,or7stonesleftatthebeginningof

his/herturn.Stepn‐3:Player2mustleavesuchapile,ifthereare8stones.Stepn‐4:Player1 hastohaveapilewith9,10,or11stonestoensurethatthereare8left.Stepn‐5:Player2needstobefacedwith12stonestobeforcedtoleave9,10,or11.Stepn‐6:Player1 canleave12stonesbyremoving3stones.

Nowreasoningforward,thefirstplayercanensureawinbyremoving3stonesandleaving12.

Page 62: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UniversallyQuan*fiedAsser*ons Toprovetheoremsoftheform,assumexisanarbitrarymemberofthedomainandshowthatP(x)mustbetrue.UsingUGitfollowsthat.

Example:Anintegerxisevenifandonlyifx2iseven.Solution:Thequantifiedassertionis∀x[xiseven↔x2iseven]Weassumexisarbitrary.RecallthatisequivalenttoSo,wehavetwocasestoconsider.Theseareconsideredinturn.

Continuedonnextslide

Page 63: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UniversallyQuan*fiedAsser*onsCase1.Weshowthatifxiseventhenx2isevenusingadirectproof(theonlyifpartornecessity).

Ifxiseventhenx=2kforsomeintegerk.Hencex2=4k2=2(2k2)whichisevensinceitisanintegerdivisibleby2.

Thiscompletestheproofofcase1.

Case2onnextslide

Page 64: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

UniversallyQuan*fiedAsser*onsCase2.Weshowthatifx2 iseventhenxmustbeeven(theifpartorsufficiency).Weuseaproofbycontraposition.

Assumexisnotevenandthenshowthatx2isnoteven.Ifxisnoteventhenitmustbeodd.So,x = 2k + 1 forsomek.Thenx2 = (2k + 1)2 = 4k2 + 4k + 1 = 2(2k2 + 2k) + 1

whichisoddandhencenoteven.Thiscompletestheproofofcase2.

Sincexwasarbitrary,theresultfollowsbyUG.Thereforewehaveshownthatxisevenifandonlyifx2iseven.

Page 65: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

ProofandDisproof:TilingsExample1:Canwetilethestandardcheckerboardusingdominos?

Solution:Yes!Oneexampleprovidesaconstructiveexistenceproof.

TheStandardCheckerboard

TwoDominoes

OnePossibleSolution

Page 66: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

TilingsExample2:Canwetileacheckerboardobtainedbyremovingoneofthefourcornersquaresofastandardcheckerboard?

Solution: Ourcheckerboardhas64 − 1=63squares. Sinceeachdominohastwosquares,aboardwithatilingmusthaveanevennumberofsquares.

 Thenumber63isnoteven. Wehaveacontradiction.

Page 67: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

TilingsExample3:Canwetileaboardobtainedbyremovingboththeupperleftandthelowerrightsquaresofastandardcheckerboard?

NonstandardCheckerboard Dominoes

Continuedonnextslide

Page 68: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

TilingsSolution: Thereare62squaresinthisboard. Totileitweneed31 dominos. Keyfact:Eachdominocoversoneblackandonewhitesquare.

 Thereforethetilingcovers31blacksquaresand31whitesquares.

 Ourboardhaseither30blacksquaresand32whitesquaresor32blacksquaresand30whitesquares.

 Contradiction!

Page 69: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

TheRoleofOpenProblems Unsolvedproblemshavemotivatedmuchworkinmathematics.Fermat’sLastTheoremwasconjecturedmorethan300yearsago.Ithasonlyrecentlybeenfinallysolved.

Fermat’sLastTheorem:Theequationxn+yn =zn

hasnosolutionsinintegersx,y,andz,withxyz≠0 whenever n is an integer with n > 2.

A proof was found by Andrew Wiles in the 1990s.

Page 70: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

AnOpenProblem The3x+1Conjecture:LetTbethetransformationthatsendsanevenintegerxtox/2 andanoddintegerxto3x+1.Forallpositiveintegersx,whenwerepeatedlyapplythetransformationT,wewilleventuallyreachtheinteger1.

Forexample,startingwithx=13:T(13)=3·13 + 1 = 40, T(40)=40/2 = 20, T(20)=20/2 = 10, T(10)=10/2 = 5, T(5)=3·5 + 1 = 16,T(16)=16/2 = 8, T(8)=8/2 = 4, T(4)=4/2 = 2, T(2)=2/2 = 1 The conjecture has been verified using computers

up to 5.6 · 1013 .

Page 71: With Question/Answer Animationsuser.ceng.metu.edu.tr/~mutlu/teaching/kesikliMatematik/Chapter1p3g.pdf · propositions are substituted into its propositional variables. If the premises

Addi*onalProofMethods Laterwewillseemanyotherproofmethods:

 Mathematicalinduction,whichisausefulmethodforprovingstatementsoftheform∀nP(n),wherethedomainconsistsofallpositiveintegers.

 Structuralinduction,whichcanbeusedtoprovesuchresultsaboutrecursivelydefinedsets.

 Cantordiagonalizationisusedtoproveresultsaboutthesizeofinfinitesets.

 Combinatorialproofsusecountingarguments.