University Press of Florida

A Problem Course in Mathematical Logic

Buy This Book ( Related URL )
MISSING IMAGE

Material Information

Title:
A Problem Course in Mathematical Logic
Physical Description:
Book
Language:
en-US
Creator:
Bilaniuk, Stefan
Publication Date:

Subjects

Subjects / Keywords:
logic, computability, incompleteness, Propositional Logic, First-Order Logic, 9781616100063
Mathematical Logic, Mathematics

Notes

Abstract:
A Problem Course in Mathematical Logic is intended to serve as the text for an introduction to mathematical logic for undergraduates with some mathematical sophistication. It supplies definitions, statements of results, and problems, along with some explanations, examples, and hints. The idea is for the students, individually or in groups, to learn the material by solving the problems and proving the results for themselves. The book should do as the text for a course taught using the modified Moore-method. The book is available in is available in LaTeX, PDF, and PostScript formats at: http://euclid.trentu.ca/math/sb/pcml/pcml.html
General Note:
Expositive
General Note:
Community College, Higher Education
General Note:
http://www.ogtp-cart.com/product.aspx?ISBN=978161610006
General Note:
Adobe Reader
General Note:
Stefan Bilaniuk
General Note:
Figure, Graph, Narrative text, Textbook
General Note:
sbilaniuk@trentu.ca, Department of Mathematics, Trent University, Peterborough, Ontario, Canada K9J 7B8
General Note:
MHF 300 - ELEMENTARY MATHEMATICAL LOGIC, MHF 302 - MATHEMATICAL LOGIC I
General Note:
http://florida.theorangegrove.org/og/file/b98210c1-f896-9122-63a2-c793ab9eb6ef/1/ProblemCourseMathLogic.pdf

Record Information

Source Institution:
University of Florida
Holding Location:
University Press of Florida
Rights Management:
A Problem Course in Mathematical Logic, Version 1.6, is Copyright (c) 1994-2003 by Stefan Bilaniuk. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and …
Resource Identifier:
isbn - 978161610006
System ID:
AA00011633:00001


This item is only available as the following downloads:


Full Text

PAGE 1

AProblemCourse in MathematicalLogic Version1.6 StefanBilaniukDepartmentofMathematics TrentUniversity Peterborough,Ontario CanadaK9J7B8 E-mailaddress : sbilaniuk@trentu.ca

PAGE 2

1991 MathematicsSubjectClassication. 03 Keywordsandphrases. logic,computability,incompletenessAbstract. Thisisatextforaproblem-orientedcourseonmathematicallogicandcomputability. Copyright c 1994-2003StefanBilaniuk. Permissionisgrantedtocopy,distributeand/ormodifythisdocumentunderthetermsoftheGNUFreeDocumentationLicense, Version1.2oranylaterversionpublishedbytheFreeSoftware Foundation;withnoInvariantSections,noFront-CoverTexts,and noBack-CoverTexts.Acopyofthelicenseisincludedinthesectionentitled\GNUFreeDocumentationLicense". ThisworkwastypesetwithLAT E X,usingthe A M S -LAT E Xand A M S FontspackagesoftheAmericanMathematicalSociety.

PAGE 3

ContentsPrefacev Introductionix PartI.PropositionalLogic 1 Chapter1.Language3 Chapter2.TruthAssignments7 Chapter3.Deductions11 Chapter4.SoundnessandCompleteness15 HintsforChapters1{417 PartII.First-OrderLogic 21 Chapter5.Languages23 Chapter6.StructuresandModels33 Chapter7.Deductions41 Chapter8.SoundnessandCompleteness47 Chapter9.ApplicationsofCompactness53 HintsforChapters5{959 PartIII.Computability 65 Chapter10.TuringMachines67 Chapter11.VariationsandSimulations75 Chapter12.ComputableandNon-ComputableFunctions81 Chapter13.RecursiveFunctions87 Chapter14.CharacterizingComputability95iii

PAGE 4

ivCONTENTSHintsforChapters10{14101 PartIV.Incompleteness 109 Chapter15.Preliminaries111 Chapter16.CodingFirst-OrderLogic113 Chapter17.DeningRecursiveFunctionsInArithmetic117 Chapter18.TheIncompletenessTheorem123 HintsforChapters15{18127 Appendices 131 AppendixA.ALittleSetTheory133 AppendixB.TheGreekAlphabet135 AppendixC.LogicLimericks137 AppendixD.GNUFreeDocumentationLicense139 Appendix.Bibliography147 Appendix.Index149

PAGE 5

PrefaceThisbookisafreetextintendedtobethebasisforaproblemorientedcourse(s)inmathematicallogicandcomputabilityforstudents withsomedegreeofmathematicalsophistication.PartsIandIIcover thebasicsofpropositionalandrst-orderlogicrespectively,PartIII coversthebasicsofcomputabilityusingTuringmachinesandrecursive functions,andPartIVcoversG odel'sIncompletenessTheorems.They canbeusedinvariouswaysforcoursesofvariouslengthsandmixesof material.TheauthortypicallyusesPartsIandIIforaone-termcourse onmathematicallogic,PartIIIforaone-termcourseoncomputability, and/ormuchofPartIIItogetherwithPartIVforaone-termcourse oncomputabilityandincompleteness. InkeepingwiththemodiedMoore-method,thisbooksupplies denitions,problems,andstatementsofresults,alongwithsomeexplanations,examples,andhints.Theintentisforthestudents,individuallyoringroups,tolearnthematerialbysolvingtheproblems andprovingtheresultsforthemselves.Besidesconstructivecriticism, itwillprobablybenecessaryfortheinstructortosupplyfurtherhints ordirectthestudentstoothersourcesfromtimetotime.Justhow thistextisusedwill,ofcourse,dependontheinstructorandstudents inquestion.However,itisprobably not appropriateforaconventional lecture-basedcoursenorforareallylargeclass. Thematerialpresentedinthistextissomewhatstripped-down. Variousconceptsandtopicsthatareoftencoveredinintroductory mathematicallogicandcomputabilitycoursesaregivenveryshort shriftoromittedentirely.1Instructorsmightconsiderhavingstudents doprojectsonadditionalmaterialiftheywishtotocoverit. Prerequisites. Thematerialinthistextislargelyself-contained, thoughsomeknowledgeof(verybasic)settheoryandelementarynumbertheoryisassumedatseveralpoints.Afewproblemsandexamples drawonconceptsfromotherpartsofmathematics;studentswhoare 1Futureversionsofbothvolumesmayincludemore{orless!{material.Feel freetosendsuggestions,corrections,criticisms,andthelike|I'llfeelfreetoignore themorusethem.v

PAGE 6

viPREFACEnotalreadyfamiliarwiththeseshouldconsulttextsintheappropriatesubjectsforthenecessarydenitions.Whatisreallyneededto getanywherewithallofthematerialdevelopedhereiscompetencein handlingabstractionandproofs,includingproofsbyinduction.The experienceprovidedbyarigorousintroductorycourseinabstractalgebra,analysis,ordiscretemathematicsoughttobesucient. ChapterDependencies. Thefollowingdiagramindicateshow thepartsandchaptersdependononeanother,withtheexception ofafewisolatedproblemsorsubsections. 1 10 2 3 11 12 4 13 5 14 6 7 15 8 16 17 9 18 I II III IV H H H H H j H H H H H j H H H H H j ? ? H H H H H j ? H H H H H j H H H H H j ? H H H H H j Acknowledgements. Variouspeopleandinstitutionsdeservesome creditforthistext. Foremostareallthepeoplewhodevelopedthesubject,eventhough almostnoattempthasbeenmadetogiveduecredittothosewho developedandrenedtheideas,results,andproofsmentionedinthis work.Inmitigation,itwouldoftenbediculttoassigncreditfairly becausemanypeoplewereinvolved,frequentlyhavinginteractedin complicatedways.Thoseinterestedinwhodidwhatshouldstartby consultingothertextsorreferenceworkscoveringsimilarmaterial.In

PAGE 7

PREFACEviiparticular,anumberofthekeypapersinthedevelopmentofmodern mathematicallogiccanbefoundin[ 9 ]and[ 6 ]. Otherswhoshouldbeacknowledgedincludemyteachersandcolleagues;mystudentsatTrentUniversitywhosuered,suer,andwill suerthroughassortedversionsofthistext;TrentUniversityandthe taxpayersofOntario,whopaidmysalary;OhioUniversity,whereI spentmysabbaticalin1995{96;allthepeopleandorganizationswho developedthesoftwareandhardwarewithwhichthisbookwasprepared.GregoryH.Moore,whosemathematicallogiccourseconvinced methatIwantedtodothestu,deservesparticularmention. Anyblameproperlyaccruestotheauthor. Availability. TheURLofthehomepagefor AProblemCourse InMathematicalLogic ,withlinkstoLAT E X,PostScript,andPortable DocumentFormat(pdf)lesofthelatestavailablereleaseis: http://euclid.trentu.ca/math/sb/pcml/ PleasenotethattotypesettheLAT E Xsourceles,youwillneedthe A M S -LAT E Xand A M S FontspackagesinadditiontoLAT E X. Ifyouhaveanyproblems,feelfreetocontacttheauthorforassistance,preferablybye-mail: StefanBilaniuk DepartmentofMathematics TrentUniversity Peterborough,Ontario K9J7B8 e-mail : sbilaniuk@trentu.ca Conditions. Seethe GNUFreeDocumentationLicense inAppendixDforwhatyoucandowiththistext.Thegististhatyouarefree tocopy,distribute,anduseitunchanged,buttherearesomerestrictionsonwhatyoucandoifyouwishtomakechanges.Ifyouwishto usethistextinamannernotcoveredbythe GNUFreeDocumentation License ,pleasecontacttheauthor. Author'sOpinion. It'snotgreat,butthepriceisright!

PAGE 9

IntroductionWhatsetsmathematicsasidefromotherdisciplinesisitsrelianceon proofastheprincipaltechniquefordeterminingtruth,wherescience, forexample,relieson(carefullyanalyzed)experience.Sowhatisa proof?Practicallyspeaking,aproofisanyreasonedargumentaccepted assuchbyothermathematicians.2Amoreprecisedenitionisneeded, however,ifonewishestodiscoverwhatmathematicalreasoningcan {orcannot{accomplishinprinciple.Thisisoneofthereasonsfor studyingmathematicallogic,whichisalsopursuedforitsownsake andinordertondnewtoolstouseintherestofmathematicsandin relatedelds. Inanycase,mathematicallogicisconcernedwithformalizingand analyzingthekindsofreasoningusedintherestofmathematics.The pointofmathematicallogicisnottotrytodomathematics perse completelyformally|thepracticalproblemsinvolvedindoingsoare usuallysuchastomakethisanexerciseinfrustration|buttostudy formallogicalsystemsasmathematicalobjectsintheirownrightin orderto(informally!)provethingsaboutthem.Forthisreason,the formalsystemsdevelopedinthispartandthenextareoptimizedto beeasytoprovethingsabout,ratherthantobeeasytouse.Natural deductivesystemssuchasthosedevelopedbyphilosopherstoformalize logicalreasoningareequallycapableinprincipleandmucheasierto actuallyuse,buthardertoprovethingsabout. Partoftheproblemwithformalizingmathematicalreasoningisthe necessityofpreciselyspecifyingthelanguage(s)inwhichitistobe done.Thenaturallanguagesspokenbyhumanswon'tdo:theyare socomplexandcontinuallychangingastobeimpossibletopindown completely.Bycontrast,thelanguageswhichunderlyformallogical systemsare,likeprogramminglanguages,rigidlydenedbutmuchsimplerandlessexiblethannaturallanguages.Aformallogicalsystem alsorequiresthecarefulspecicationoftheallowablerulesofreasoning, 2Ifyouarenotamathematician,gentlereader,youareherebytemporarily promoted.ix

PAGE 10

xINTRODUCTIONplussomenotionofhowtointerpretstatementsintheunderlyinglanguageanddeterminetheirtruth.Therealfunliesintherelationship betweeninterpretationofstatements,truth,andreasoning. The defacto standardforformalizingmathematicalsystemsisrstorderlogic,andthemainthrustofthistextisstudyingitwitha viewtounderstandingsomeofitsbasicfeaturesandlimitations.More specically,PartIofthistextisconcernedwithpropositionallogic, developedhereasawarm-upforthedevelopmentofrst-orderlogic properinPartII. Propositionallogicattemptstomakeprecisetherelationshipsthat certainconnectiveslike not and or ,and if...then areusedtoexpressinEnglish.Whileithasuses,propositionallogicisnotpowerful enoughtoformalizemostmathematicaldiscourse.Foronething,it cannothandletheconceptsexpressedbythequantiers all and there is .First-orderlogicaddsthesenotionstothosepropositionallogic handles,andsuces,inprinciple,toformalizemostmathematicalreasoning.Thegreaterexibilityandpowerofrst-orderlogicmakesita gooddealmorecomplicatedtoworkwith,bothinsyntaxandsemantics.However,anumberofresultsaboutpropositionallogiccarryover torst-orderlogicwithlittlechange. Giventhatrst-orderlogiccanbeusedtoformalizemostmathematicalreasoningitprovidesanaturalcontextinwhichtoaskwhether suchreasoningcanbeautomated.Thisquestionisthe Entscheidungsproblem3: Entscheidungsproblem. Givenasetofhypothesesandsome statement ,isthereaneectivemethodfordeterminingwhetheror notthehypothesesinsucetoprove ? Historically,thisquestionaroseoutofDavidHilbert'sschemeto securethefoundationsofmathematicsbyaxiomatizingmathematics inrst-orderlogic,showingthattheaxiomsinquestiondonotgive risetoanycontradictions,andthattheysucetoproveordisprove everystatement(whichiswheretheEntscheidungsproblemcomesin). IftheanswertotheEntscheidungsproblemwere\yes"ingeneral,the eectivemethod(s)inquestionmightputmathematiciansoutofbusiness...Ofcourse,thestatementoftheproblembegsthequestionof what\eectivemethod"issupposedtomean. Inthecourseoftryingtondasuitableformalizationofthenotionof\eectivemethod",mathematiciansdevelopedseveraldierent 3Entscheidungsproblem decisionproblem.

PAGE 11

INTRODUCTIONxiabstractmodelsofcomputationinthe1930's,includingrecursivefunctions, -calculus,Turingmachines,andgrammars4.Althoughthese modelsareverydierentfromeachotherinspiritandformaldenition,itturnedoutthattheywereallessentiallyequivalentinwhatthey coulddo.Thissuggestedthe(empirical,notmathematical!)principle: Church'sThesis. Afunctioniseectivelycomputableinprincipleintherealworldifandonlyifitiscomputableby(any)oneofthe abstractmodelsmentionedabove. PartIIIexplorestwoofthestandardformalizationsofthenotionof \eectivemethod",namelyTuringmachinesandrecursivefunctions, showing,amongotherthings,thatthesetwoformalizationsareactually equivalent.PartIVthenusesthetoolsdevelopedinPartsIIandsIII toanswertheEntscheidungsproblemforrst-orderlogic.Theanswer tothegeneralproblemisnegative,bytheway,thoughdecisionproceduresdoexistforpropositionallogic,andforsomeparticularrst-order languagesandsetsofhypothesesintheselanguages. Prerequisites. Inprinciple,notmuchisneededbywayofprior mathematicalknowledgetodeneandprovethebasicfactsabout propositionallogicandcomputability.Someknowledgeofthenaturalnumbersandalittlesettheorysuces;theformerwillbeassumed andthelatterisverybrieysummarizedinAppendixA.([ 10 ]isa goodintroductiontobasicsettheoryinastylenotunlikethisbook's; [ 8 ]isagoodoneinamoreconventionalmode.)Competenceinhandlingabstractionandproofs,especiallyproofsbyinduction,willbe needed,however.Inprinciple,theexperienceprovidedbyarigorous introductorycourseinalgebra,analysis,ordiscretemathematicsought tobesucient. OtherSourcesandFurtherReading. [ 2 ],[ 5 ],[ 7 ],[ 12 ],and[ 13 ] aretextswhichgooverlargepartsofthematerialcoveredhere(and oftenmuchmorebesides),while[ 1 ]and[ 4 ]aregoodreferencesformore advancedmaterial.Anumberofthekeypapersinthedevelopmentof modernmathematicallogicandrelatedtopicscanbefoundin[ 9 ]and [ 6 ].Entertainingaccountsofsomerelatedtopicsmaybefoundin[ 11 ], 4Thedevelopmentofthetheoryofcomputationthusactuallybeganbeforethe developmentofelectronicdigitalcomputers.Infact,thecomputersandprogramminglanguagesweusetodayowemuchtotheabstractmodelsofcomputation whichprecededthem.Forexample,thestandardvonNeumannarchitecturefor digitalcomputerswasinspiredbyTuringmachinesandtheprogramminglanguage LISPborrowsmuchofitsstructurefrom -calculus.

PAGE 12

xiiINTRODUCTION[ 14 ]and[ 15 ].Thoseinterestedinnaturaldeductivesystemsmighttry [ 3 ],whichhasaverycleanpresentation.

PAGE 13

PartIPropositionalLogic

PAGE 15

CHAPTER1LanguagePropositionallogic(sometimescalledsententialorpredicatelogic) attemptstoformalizethereasoningthatcanbedonewithconnectives like not and or ,and if...then .Wewilldenetheformallanguage ofpropositionallogic, LP,byspecifyingitssymbolsandrulesforassemblingthesesymbolsintotheformulasofthelanguage. Definition 1.1 The symbols of LPare: (1)Parentheses:(and). (2)Connectives: : and (3)Atomicformulas: A0, A1, A2,..., An,... Westillneedtospecifythewaysinwhichthesymbolsof LPcan beputtogether. Definition 1.2 The formulas of LParethosenitesequencesor stringsofthesymbolsgiveninDenition1.1whichsatisfythefollowing rules: (1)Everyatomicformulaisaformula. (2)If isaformula,then( : )isaformula. (3)If and areformulas,then( )isaformula. (4)Noothersequenceofsymbolsisaformula. Wewilloftenuselower-caseGreekcharacterstorepresentformulas, aswedidinthedenitionabove,andupper-caseGreekcharacters torepresentsetsofformulas.1AllformulasinChapters1{4willbe assumedtobeformulasof LPunlessstatedotherwise. Whatdothesedenitionsmean?Theparenthesesarejustpunctuation:theironlypurposeistogroupothersymbolstogether.(One couldgetbywithoutthem;seeProblem1.6.) : and aresupposedto representtheconnectives not and if...then respectively.Theatomic formulas, A0, A1,...,aremeanttorepresentstatementsthatcannot bebrokendownanyfurtherusingourconnectives,suchas\Themoon ismadeofcheese."Thus,onemighttranslatethetheEnglishsentence\Ifthemoonisred,itisnotmadeofcheese"intotheformula 1TheGreekalphabetisgiveninAppendixB.3

PAGE 16

41.LANGUAGE( A0! ( : A1))of LPbyusing A0torepresent\Themoonisred"and A1torepresent\Themoonismadeofcheese."Notethatthetruth oftheformuladependsontheinterpretationoftheatomicsentences whichappearinit.Usingtheinterpretationsjustgivenof A0and A1, theformula( A0! ( : A1))istrue,butifweinsteaduse A0and A1tointerpret\Mytelephoneisringing"and\Someoneiscallingme", respectively,( A0! ( : A1))isfalse. Denition1.2saysthatthateveryatomicformulaisaformulaand everyotherformulaisbuiltfromshorterformulasusingtheconnectives andparenthesesinparticularways.Forexample, A1123,( A2! ( : A0)), and((( : A1) ( A1! A7)) A7)areallformulas,but X3,( A5), () : A41, A5! A7,and( A2! ( : A0)arenot. Problem 1.1 Whyarethefollowing not formulasof LP?There mightbemorethanonereason... (1) A)Tj/F23 1 Tf0.8131 0 TD0.011 Tc(56(2)( Y A ) (3)( A7 A4) (4) A7! ( : A5)) (5)( A8A9! A1043998(6)((( : A1) ( A`! A7) A7) Problem 1.2 Showthateveryformulaof LPhasthesamenumber ofleftparenthesesasithasofrightparentheses. Problem 1.3 Suppose isanyformulaof LP.Let ` ( ) bethe lengthof asasequenceofsymbolsandlet p ( ) bethenumberof parentheses(countingbothleftandrightparentheses)in .Whatare theminimumandmaximumvaluesof p ( ) =` ( ) ? Problem 1.4 Suppose isanyformulaof LP.Let s ( ) bethe numberofatomicformulasin (countingrepetitions)andlet c ( ) be thenumberofoccurrencesof in .Showthat s ( )= c ( )+1 Problem 1.5 Whatarethepossiblelengthsofformulasof LP? Proveit. Problem 1.6 Findawayfordoingwithoutparenthesesorother punctuationsymbolsindeningaformallanguageforpropositional logic. Proposition 1.7 Showthatthesetofformulasof LPiscountable. InformalConventions. Atrstglance, LPmaynotseemcapable ofbreakingdownEnglishsentenceswithconnectivesotherthan not and if...then .However,thesenseofmanyotherconnectivescanbe

PAGE 17

1.LANGUAGE5capturedbythesetwobyusingsuitablecircumlocutions.Wewilluse thesymbols ^ ,and $ torepresent and or ,2and ifandonlyif respectively.Sincetheyarenotamongthesymbolsof LP,wewilluse themasabbreviationsforcertainconstructionsinvolvingonly : and .Namely, ( ^ )isshortfor( : ( ( : ))), ( )isshortfor(( : ) ),and ( $ )isshortfor(( ) ^ ( )). Interpreting A0and A1asbefore,forexample,onecouldtranslatethe Englishsentence\Themoonisredandmadeofcheese"as( A0^ A1). (Ofcoursethisisreally( : ( A0! ( : A1))), i.e. \Itisnotthecasethat ifthemoonisgreen,itisnotmadeofcheese.") ^ ,and $ werenot includedamongtheocialsymbolsof LPpartlybecausewecanget bywithoutthemandpartlybecauseleavingthemoutmakesiteasier toprovethingsabout LP. Problem 1.8 TakeacoupleofEnglishsentenceswithseveralconnectivesandtranslatethemintoformulasof LP.Youmayuse ^ and $ ifappropriate. Problem 1.9 Writeout (( ) ^ ( )) usingonly : and Forthesakeofreadability,wewilloccasionallyusesomeinformal conventionsthatletusgetawaywithwritingfewerparentheses: Wewillusuallydroptheoutermostparenthesesinaformula, writing insteadof( )and : insteadof( : ). Wewilllet : takeprecedenceover whenparenthesesare missing,so : isshortfor(( : ) ),andtthe informalconnectivesintothisschemebylettingtheorderof precedencebe : ^ ,and $ Finally,wewillgrouprepetitionsof ^ ,or $ tothe rightwhenparenthesesaremissing,so isshortfor ( ( )). Justlikeformulasusing ^ ,or : ,formulasinwhichparentheseshave beenomittedasabovearenotocialformulasof LP,theyareconvenientabbreviationsforocialformulasof LP.Notethataprecedent fortheprecedenceconventioncanbefoundinthewaythat commonly takesprecedenceover+inwritingarithmeticformulas. Problem 1.10 Writeout : ( $: ) ^ !: rstwiththe missingparenthesesincludedandthenasanocialformulaof LP. 2Wewilluse or inclusively,sothat\ A or B "isstilltrueifbothof A and B aretrue.

PAGE 18

61.LANGUAGEThefollowingnotionwillbeneededlateron. Definition 1.3 Suppose isaformulaof LP.Thesetof subformulas of S ( ),isdenedasfollows. (1)If isanatomicformula,then S ( )= f g (2)If is( : ),then S ( )= S ( ) [f ( : ) g (3)If is( ),then S ( )= S ( ) [S ( ) [f ( ) g Forexample,if is((( : A1) A7) ( A8! A1)),then S ( ) includes A1, A7, A8,( : A1),( A8! A1),(( : A1) A7),and((( : A1) A7) ( A8! A1))itself. Notethatifyouwriteoutaformulawithalltheocialparentheses,thenthesubformulasarejustthepartsoftheformulaenclosedby matchingparentheses,plustheatomicformulas.Inparticular,every formulaisasubformulaofitself.Notethatsomesubformulasofformulasinvolvingourinformalabbreviations ^ ,or $ willbemost convenientlywrittenusingtheseabbreviations.Forexample,if is A4! A1_ A4,then S ( )= f A1;A4; ( : A1) ; ( A1_ A4) ; ( A4! ( A1_ A4)) g : (Asanexercise,wheredid( : A1)comefrom?) Problem 1.11 Findallthesubformulasofeachofthefollowing formulas. (1)( : (( : A56) A56)) (2) A9! A8!: ( A78!:: A0) (3) : A0^: A1$: ( A0_ A1) UniqueReadability. Theslightlyparanoid|er,trulyrigorous |mightaskwhetherDenitions1.1and1.2actuallyensurethatthe formulasof LPareunambiguous, i.e. canbereadinonlyoneway accordingtotherulesgiveninDenition1.2.Toactuallyprovethis onemustaddtoDenition1.1therequirementthatallthesymbols of LParedistinctandthatnosymbolisasubsequenceofanyother symbol.Withthisaddition,onecanprovethefollowing: Theorem 1.12(UniqueReadabilityTheorem) Aformulaof LPmustsatisfyexactlyoneofconditions1{3inDenition1.2.

PAGE 19

CHAPTER2TruthAssignmentsWhetheragivenformula of LPistrueorfalseusuallydependson howweinterprettheatomicformulaswhichappearin .Forexample, if istheatomicformula A2andweinterpretitas\2+2=4",itistrue, butifweinterpretitas\Themoonismadeofcheese",itisfalse.Since wedon'twanttocommitourselvestoasingleinterpretation|after all,we'rereallyinterestedingenerallogicalrelationships|wewill denehowanyassignmentof truthvalues T (\true")and F (\false") toatomicformulasof LPcanbeextendedtoallotherformulas.We willalsogetareasonabledenitionofwhatitmeansforaformulaof LPtofollowlogicallyfromotherformulas. Definition 2.1 A truthassignment isafunction v whosedomain isthesetofallformulasof LPandwhoserangeistheset f T;F g of truthvalues,suchthat: (1) v ( An)isdenedforeveryatomicformula An. (2)Foranyformula v (( : ))= ( T if v ( )= F F if v ( )= T (3)Foranyformulas and v (( ))= ( F if v ( )= T and v ( )= F T otherwise. Giveninterpretationsofalltheatomicformulasof LP,thecorrespondingtruthassignmentwouldgiveeachatomicformularepresenting atruestatementthevalue T andeveryatomicformularepresentinga falsestatementthevalue F .Notethatwehavenotdenedhowto handleanytruthvaluesbesides T and F in LP.Logicswithother truthvalueshaveuses,butarenotrelevantinmostofmathematics. Foranexampleofhownon-atomicformulasaregiventruthvalues onthebasisofthetruthvaluesgiventotheircomponents,suppose v isatruthassignmentsuchthat v ( A0)= T and v ( A1)= F .Then v ((( : A1) ( A0! A1)))isdeterminedfrom v (( : A1))and v (( A0!7

PAGE 20

82.TRUTHASSIGNMENTSA1))accordingtoclause3ofDenition2.1.Inturn, v (( : A1))isdeterminedfromof v ( A1)accordingtoclause2and v (( A0! A1))isdeterminedfrom v ( A1)and v ( A0)accordingtoclause3.Finally,byclause1, ourtruthassignmentmustbedenedforallatomicformulastobegin with;inthiscase, v ( A0)= T and v ( A1)= F .Thus v (( : A1))= T and v (( A0! A1))= F ,so v ((( : A1) ( A0! A1)))= F Aconvenientwaytowriteoutthedeterminationofthetruthvalue ofaformulaonagiventruthassignmentistousea truthtable :listall thesubformulasofthegivenformulaacrossthetopinorderoflength andthenllintheirtruthvaluesonthebottomfromlefttoright. Exceptfortheatomicformulasattheextremeleft,thetruthvalueof eachsubformulawilldependonthetruthvaluesofthesubformulasto itsleft.Fortheexampleabove,onegetssomethinglike: A0 A1 ( : A1) ( A0! A1) ( : A1) ( A0! A1)) T F T F F Problem 2.1 Suppose v isatruthassignmentsuchthat v ( A0)= v ( A2)= T and v ( A1)= v ( A3)= F .Find v ( ) if is: (1) : A2!: A3(2) : A2! A3(3) : ( : A0! A1) (4) A0_ A1(5) A0^ A1Theuseofnitetruthtablestodeterminewhattruthvalueaparticulartruthassignmentgivesaparticularformulaisjustiedbythe followingproposition,whichassertsthatonlythetruthvaluesofthe atomicsentencesintheformulamatter. Proposition 2.2 Suppose isanyformulaand u and v aretruth assignmentssuchthat u ( An)= v ( An) forallatomicformulas Anwhich occurin .Then u ( )= v ( ) Corollary 2.3 Suppose u and v aretruthassignmentssuchthat u ( An)= v ( An) foreveryatomicformula An.Then u = v i.e. u ( )= v ( ) foreveryformula Proposition 2.4 If and areformulasand v isatruthassignment,then: (1) v ( : )= T ifandonlyif v ( )= F (2) v ( )= T ifandonlyif v ( )= T whenever v ( )= T ; (3) v ( ^ )= T ifandonlyif v ( )= T and v ( )= T ; (4) v ( )= T ifandonlyif v ( )= T or v ( )= T ;and (5) v ( $ )= T ifandonlyif v ( )= v ( ) .

PAGE 21

2.TRUTHASSIGNMENTS9Truthtablesareoftenusedevenwhentheformulainquestionis notbrokendownallthewayintoatomicformulas.Forexample,if and areanyformulasandweknowthat istruebut isfalse,then thetruthof( ( : ))canbedeterminedbymeansofthefollowing table: ( : ) ( ( : )) T F T T Definition 2.2 If v isatruthassignmentand isaformula,we willoftensaythat v satises if v ( )= T .Similarly,ifisaset offormulas,wewilloftensaythat v satisesif v ( )= T forevery 2 .Wewillsaythat (respectively,)is satisable ifthereis sometruthassignmentwhichsatisesit. Definition 2.3 Aformula isa tautology ifitissatisedbyevery truthassignment.Aformula isa contradiction ifthereisnotruth assignmentwhichsatisesit. Forexample,( A4! A4)isatautologywhile( : ( A4! A4))isa contradiction,and A4isaformulawhichisneither.Onecancheck whetheragivenformulaisatautology,contradiction,orneither,by grindingoutacompletetruthtableforit,withaseparatelineforeach possibleassignmentoftruthvaluestotheatomicsubformulasofthe formula.For A3! ( A4! A3)thisgives A3 A4 A4! A3 A3! ( A4! A3) T T T T T F T T F T F T F F T T so A3! ( A4! A3)isatautology.Notethat,byProposition2.2,we needonlyconsiderthepossibletruthvaluesoftheatomicsentences whichactuallyoccurinagivenformula. Onecanoftenusetruthtablestodeterminewhetheragivenformula isatautologyoracontradictionevenwhenitisnotbrokendownall thewayintoatomicformulas.Forexample,if isanyformula,then thetable ( ) ( : ( )) T T F F T F demonstratesthat( : ( ))isacontradiction,nomatterwhich formulaof LP actuallyis. Proposition 2.5 If isanyformula,then (( : ) ) isatautologyand (( : ) ^ ) isacontradiction.

PAGE 22

102.TRUTHASSIGNMENTSProposition 2.6 Aformula isatautologyifandonlyif : is acontradiction. Afterallthiswarmup,wearenallyinapositiontodenewhatit meansforoneformulatofollowlogicallyfromotherformulas. Definition 2.4 Asetofformulas implies aformula ,written as j = ,ifeverytruthassignment v whichsatisesalsosatises Wewilloftenwrite 2 ifitisnotthecasethat j = .Inthecase whereisempty,wewillusuallywrite j = insteadof ;j = Similarly,ifand)-251(aresetsofformulas,then implies )13(,written as j =)11(,ifeverytruthassignment v whichsatisesalsosatises Forexample, f A3; ( A3!: A7) gj = : A7,but f A8; ( A5! A8) g 2 A5.(Thereisatruthassignmentwhichmakes A8and A5! A8true, but A5false.)Notethataformula isatautologyifandonlyif j = andacontradictionifandonlyif j =( : ). Proposition 2.7 If )Tj/F30 1 Tf0.8833 0 TD0.002 Tc[(and aresetsofformulassuchthat )Tj/F22 1 Tf0.8833 0 TD( then j =)Tj/F30 1 Tf1.6461 0 TD0 Tc(. Problem 2.8 Howcanonecheckwhetherornot j = fora formula andanitesetofformulas ? Proposition 2.9 Suppose isasetofformulasand and are formulas.Then [f gj = ifandonlyif j = Proposition 2.10 Asetofformulas issatisableifandonlyif thereisnocontradiction suchthat j = .

PAGE 23

CHAPTER3DeductionsInthischapterwedevelopawayofdeninglogicalimplication thatdoesnotrelyonanynotionoftruth,butonlyonmanipulating sequencesofformulas,namelyformalproofsordeductions.(Ofcourse, anywayofdeninglogicalimplicationhadbetterbecompatiblewith thatgiveninChapter2.)Todenethese,werstspecifyasuitable setofformulaswhichwecanusefreelyaspremissesindeductions. Definition 3.1 Thethree axiomschema of LPare: A1: ( ( )) A2: (( ( )) (( ) ( ))) A3: ((( : ) ( : )) ((( : ) ) )). Replacing ,and byparticularformulasof LPinanyoneofthe schemasA1,A2,orA3givesan axiom of LP. Forexample,( A1! ( A4! A1))isanaxiom,beinganinstanceof axiomschemaA1,but( A9! ( : A0))isnotanaxiomasitisnotthe instanceofanyoftheschema.Ashadbetterbethecase,everyaxiom isalwaystrue: Proposition 3.1 Everyaxiomof LPisatautology. Second,wespecifyourone(andonly!)ruleofinference.1Definition 3.2(ModusPonens) Giventheformulas and( ),onemayinfer WewillusuallyrefertoModusPonensbyitsinitials,MP.Likeany ruleofinferenceworthitssalt,MPpreservestruth. Proposition 3.2 Suppose and areformulas.Then f '; ( ) gj = Withaxiomsandaruleofinferenceinhand,wecanexecuteformal proofsin LP. 1Naturaldeductivesystems,whichareusuallymoreconvenienttoactually executedeductionsinthanthesystembeingdevelopedhere,compensateforhaving fewornoaxiomsbyhavingmanyrulesofinference.11

PAGE 24

123.DEDUCTIONSDefinition 3.3 Letbeasetofformulas.A deduction or proof fromin LPisanitesequence '1'2:::'nofformulassuchthatfor each k n (1) 'kisanaxiom,or (2) 'k2 ,or (3)thereare i;j
PAGE 25

3.DEDUCTIONS13(2) : !: Example3.1 (3)( : ) 1,2MP Hence ` ( : ) ,asdesired.Tobecompletelyformal,one wouldhavetoinsertthedeductiongiveninExample3.1(with replacedby : throughout)inplaceofline2aboveandrenumberthe oldline3. Problem 3.3 Showthatif ,and areformulas,then (1) f ( ) ; g` (2) ` _: Example 3.4 Letusshowthat `:: (1)( : !:: ) (( : !: ) )A3 (2) :: ( : !:: )A1 (3) :: (( : !: ) )1,2Example3.2 (4) : !: Example3.1 (5) :: 3,4Problem3.3.1 Hence `:: ,asdesired. Certaingeneralfactsaresometimeshandy: Proposition 3.4 If '1'2:::'nisadeductionof LP,then '1:::'`isalsoadeductionof LPforany ` suchthat 1 ` n Proposition 3.5 If )Tj/F22 1 Tf0.8833 0 TD(` and )Tj/F22 1 Tf0.8833 0 TD(` ,then )Tj/F22 1 Tf0.8833 0 TD(` Proposition 3.6 If )Tj/F22 1 Tf0.8833 0 TD( and )Tj/F22 1 Tf0.8833 0 TD(` ,then ` Proposition 3.7 If )Tj/F22 1 Tf0.8833 0 TD(` and ` ,then )Tj/F22 1 Tf0.9034 0 TD(` Thefollowingtheoremoftenletsonetakesubstantialshortcuts whentryingtoshowthatcertaindeductionsexistin LP,eventhough itdoesn'tgiveusthedeductionsexplicitly. Theorem 3.8(DeductionTheorem) If isanysetofformulas and and areanyformulas,then ` ifandonlyif [f g` Example 3.5 Letusshowthat ` .BytheDeduction Theoremitisenoughtoshowthat f g` ,whichistrivial: (1) Premiss ComparethistothedeductioninExample3.1. Problem 3.9 AppealingtopreviousdeductionsandtheDeduction Theoremifyouwish,showthat: (1) f ; : g`

PAGE 26

143.DEDUCTIONS(2) ` !:: (3) ` ( : !: ) ( ) (4) ` ( ) ( : !: ) (5) ` ( !: ) ( !: ) (6) ` ( : ) ( : ) (7) ` ( ) (8) f ^ g` (9) f ^ g`

PAGE 27

CHAPTER4SoundnessandCompletenessHowaredeductionandimplicationrelated,giventhattheywere denedincompletelydierentways?Wehavesomeevidencethatthey behavealike;compare,forexample,Proposition2.9andtheDeduction Theorem.Ithadbetterbethecasethatifthereisadeductionofa formula fromasetofpremisses,then isimpliedby.(Otherwise, what'sthepointofdeningdeductions?)Itwouldalsobeniceforthe conversetohold:whenever isimpliedby,thereisadeductionof from.(Soanythingwhichistruecanbeproved.)TheSoundness andCompletenessTheoremssaythatbothwaysdohold,so ` if andonlyif j = i.e. ` and j =areequivalentforpropositionallogic. Onedirectionisrelativelystraightforwardtoprove... Theorem 4.1(SoundnessTheorem) If isasetofformulasand isaformulasuchthat ` ,then j = ...butfortheotherdirectionweneedsomeadditionalconcepts. Definition 4.1 Asetofformulas)-340(is inconsistent if)]TJ/F22 1 Tf1.8067 0 TD0.292 Tc(`: ( )forsomeformula ,and consistent ifitisnotinconsistent. Forexample, f A41g isconsistentbyProposition4.2,butitfollows fromProblem3.9that f A13; : A13g isinconsistent. Proposition 4.2 Ifasetofformulasissatisable,thenitisconsistent. Proposition 4.3 Suppose isaninconsistentsetofformulas. Then ` foranyformula Proposition 4.4 Suppose isaninconsistentsetofformulas. Thenthereisanitesubset of suchthat isinconsistent. Corollary 4.5 Asetofformulas )Tj/F30 1 Tf1.0238 0 TD0.001 Tc[(isconsistentifandonlyif everynitesubsetof )Tj/F30 1 Tf0.9636 0 TD[(isconsistent. ToobtaintheCompletenessTheoremrequiresonemoredenition. Definition 4.2 Asetofformulasis maximallyconsistent if isconsistentbut [f g isinconsistentforany '= 2 .15

PAGE 28

164.SOUNDNESSANDCOMPLETENESSThatis,asetofformulasismaximallyconsistentifitisconsistent, butthereisnowaytoaddanyotherformulatoitandkeepitconsistent. Problem 4.6 Suppose v isatruthassignment.Showthat = f j v ( )= T g ismaximallyconsistent. Wewillneedsomefactsconcerningmaximallyconsistenttheories. Proposition 4.7 If isamaximallyconsistentsetofformulas, isaformula,and ` ,then 2 Proposition 4.8 Suppose isamaximallyconsistentsetofformulasand isaformula.Then : 2 ifandonlyif '= 2 Proposition 4.9 Suppose isamaximallyconsistentsetofformulasand and areformulas.Then 2 ifandonlyif '= 2 or 2 Itisimportanttoknowthatanyconsistentsetofformulascanbe expandedtoamaximallyconsistentset. Theorem 4.10 Suppose )Tj/F30 1 Tf1.0238 0 TD0.001 Tc[(isaconsistentsetofformulas.Then thereisamaximallyconsistentsetofformulas suchthat )Tj/F22 1 Tf0.9034 0 TD( Nowforthemainevent! Theorem 4.11 Asetofformulasisconsistentifandonlyifitis satisable. Theorem4.11givestheequivalencebetween ` and j =inslightly disguisedform. Theorem 4.12(CompletenessTheorem) If isasetofformulas and isaformulasuchthat j = ,then ` Itfollowsthatanythingprovablefromagivensetofpremissesmust betrueifthepremissesare,and viceversa .Thefactthat ` and j =are actuallyequivalentcanbeveryconvenientinsituationswhereoneis easiertousethantheother.Forexample,mostpartsofProblems3.3 and3.9aremucheasiertodowithtruthtablesinsteadofdeductions, evenifonemakesuseoftheDeductionTheorem. Finally,onemoreconsequenceofTheorem4.11. Theorem 4.13(CompactnessTheorem) Asetofformulas )Tj/F30 1 Tf1.0439 0 TD0.001 Tc(is satisableifandonlyifeverynitesubsetof )Tj/F30 1 Tf0.9636 0 TD0.001 Tc[(issatisable. WewillnotlookatanyusesoftheCompactnessTheoremnow, butwewillconsiderafewapplicationsofitscounterpartforrst-order logicinChapter9.

PAGE 29

HintsforChapters1{4HintsforChapter1. 1.1. Symbolsnotinthelanguage,unbalancedparentheses,lackof connectives... 1.2. ThekeyideaistoexploittherecursivestructureofDenition1.2andproceedbyinductiononthelengthoftheformulaoron thenumberofconnectivesintheformula.Asthisisanideathatwill beneededrepeatedlyinPartsI,II,andIV,hereisaskeletonofthe argumentinthiscase: Proof. Byinductionon n ,thenumberofconnectives( i.e. occurrencesof : and/or )inaformula of LP,wewillshowthatany formula musthavejustasmanyleftparenthesesasrightparentheses. Basestep: ( n =0)If isaformulawithnoconnectives,thenit mustbeatomic.(Why?)Sinceanatomicformulahasnoparentheses atall,ithasjustasmanyleftparenthesesasrightparentheses. Inductionhypothesis: ( n k )Assumethatanyformulawith n k connectiveshasjustasmanyleftparenthesesasrightparentheses. Inductionstep: ( n = k +1)Suppose isaformulawith n = k +1 connectives.ItfollowsfromDenition1.2that mustbeeither (1)( : )forsomeformula with k connectivesor (2)( )forsomeformulas and whichhave k connectives each. (Why?)Wehandlethetwocasesseparately: (1)Bytheinductionhypothesis, hasjustasmanyleftparenthesesasrightparentheses.Since i.e. ( : ),hasonemore leftparenthesisandonemorerightparenthesesthan ,itmust havejustasmanyleftparenthesesasrightparenthesesaswell. (2)Bytheinductionhypothesis, and eachhavethesame numberofleftparenthesesasrightparentheses.Since i.e. ( ),hasonemoreleftparenthesisandonemoreright parnthesisthan and togetherhave,itmusthavejustas manyleftparnthesesasrightparenthesesaswell.17

PAGE 30

18HINTSFORCHAPTERS1{4Itfollowsbyinductionthateveryformula of LPhasjustasmany leftparenthesesasrightparentheses. 1.3. Compute p ( ) =` ( )foranumberofexamplesandlookfor patterns.Gettingaminimumvalueshouldbeprettyeasy. 1.4. Proceedbyinductiononthelengthoforonthenumberof connectivesintheformula. 1.5. Constructexamplesofformulasofalltheshortlengthsthat youcan,andthenseehowyoucanmakelongerformulasoutofshort ones. 1.6. Hewlett-Packardsellscalculatorsthatusesuchatrick.AsimilaroneisusedinDenition5.2. 1.7. Observethat LPhascountablymanysymbolsandthatevery formulaisanitesequenceofsymbols.Therelevantfactsfromset theoryaregiveninAppendixA. 1.8. Stickseveralsimplestatementstogetherwithsuitableconnectives. 1.9. Thisshouldbestraightforward. 1.10. Ditto. 1.11. Tomakesureyougetallthesubformulas,writeouttheformulainocialformwithalltheparentheses. 1.12. Proceedbyinductiononthelengthornumberofconnectives oftheformula. HintsforChapter2. 2.1. Usetruthtables. 2.2. Proceedbyinductiononthelengthof oronthenumberof connectivesin 2.3. UseProposition2.2. 2.4. Ineachcase,unwindDenition2.1andthedenitionsofthe abbreviations. 2.5. Usetruthtables. 2.6. UseDenition2.3andProposition2.4. 2.7. Ifatruthassignmentsatiseseveryformulainandevery formulain)-304(isalsoin,then...

PAGE 31

HINTSFORCHAPTERS1{4192.8. Grindingoutanappropriatetruthtablewilldothejob.Why isitimportantthatbenitehere? 2.9. UseDenition2.4andProposition2.4. 2.10. UseDenitions2.3and2.4.Ifyouhavetroubletryingto proveoneofthetwodirectionsdirectly,tryprovingitscontrapositive instead. HintsforChapter3. 3.1. Truthtablesareprobablythebestwaytodothis. 3.2. LookupProposition2.4. 3.3. Thereareusuallymanydierentdeductionswithagivenconclusion,soyoushouldn'ttakethefollowinghintsasgospel. (1)UseA2andA1. (2)Recallwhat abbreviates. 3.4. Youneedtocheckthat '1:::'`satisesthethreeconditions ofDenition3.3;youknow '1:::'ndoes. 3.5. Puttogetheradeductionof from)-333(fromthedeductionsof and from)12(. 3.6. ExamineDenition3.3carefully. 3.7. ThekeyideaissimilartothatforprovingProposition3.5. 3.8. OnedirectionfollowsfromProposition3.5.Fortheotherdirection,proceedbyinductiononthelengthoftheshortestproofof from [f g 3.9. Again,don'ttakethesehintsasgospel.TryusingtheDeductionTheoremineachcase,plus (1)A3. (2)A3andProblem3.3. (3)A3. (4)A3,Problem3.3,andExample3.2. (5)SomeoftheabovepartsandProblem3.3. (6)Ditto. (7)Usethedenitionof andoneoftheaboveparts. (8)Usethedenitionof ^ andoneoftheaboveparts. (9)Aimfor : ( !: )asanintermediatestep.

PAGE 32

20HINTSFORCHAPTERS1{4HintsforChapter4. 4.1. UseinductiononthelengthofthedeductionandProposition 3.2. 4.2. Assume,bywayofcontradiction,thatthegivensetofformulas isinconsistent.UsetheSoundnessTheoremtoshowthatitcan'tbe satisable. 4.3. Firstshowthat f: ( ) g` 4.4. Notethatdeductionsarenitesequencesofformulas. 4.5. UseProposition4.4. 4.6. UseProposition4.2,thedenitionof,andProposition2.4. 4.7. Assume,bywayofcontradiction,that '= 2 .UseDenition 4.2andtheDeductionTheoremtoshowthatmustbeinconsistent. 4.8. UseDenition4.2andProblem3.9. 4.9. UseDenition4.2andProposition4.8. 4.10. UseProposition1.7andinductiononalistofalltheformulas of LP. 4.11. OnedirectionisjustProposition4.2.Fortheother,expand thesetofformulasinquestiontoamaximallyconsistentsetofformulas usingTheorem4.10,anddeneatruthassignment v bysetting v ( An)= T ifandonlyif An2 .Nowuseinductiononthelengthof toshowthat 2 ifandonlyif v satises 4.12. ProvethecontrapositiveusingTheorem4.11. 4.13. PutCorollary4.5togetherwithTheorem4.11.

PAGE 33

PartIIFirst-OrderLogic

PAGE 35

CHAPTER5LanguagesAsnotedintheIntroduction,propositionallogichasobviousdecienciesasatoolformathematicalreasoning.First-orderlogicremedies enoughofthesetobeadequateforformalizingmostordinarymathematics.Itdoeshaveenoughincommonwithpropositionallogictolet usrecyclesomeofthematerialinChapters1{4. Afewinformalwordsabouthowrst-orderlanguagesworkarein order.Inmathematicsoneoftendealswithstructuresconsistingof asetofelementsplusvariousoperationsonthemorrelationsamong them.Tocitethreecommonexamples,agroupisasetofelements plusabinaryoperationontheseelementssatisfyingcertainconditions, aeldisasetofelementsplustwobinaryoperationsontheseelements satisfyingcertainconditions,andagraphisasetofelementsplusa binaryrelationwithcertainproperties.Inmostsuchcases,onefrequentlyusessymbolsnamingtheoperationsorrelationsinquestion, symbolsforvariableswhichrangeoverthesetofelements,symbols forlogicalconnectivessuchas not and forall ,plusauxiliarysymbols suchasparentheses,towriteformulaswhichexpresssomefactabout thestructureinquestion.Forexample,if( G; )isagroup,onemight expresstheassociativelawbywritingsomethinglike 8 x 8 y 8 zx ( y z )=( x y ) z; itbeingunderstoodthatthevariablesrangeovertheset G ofgroup elements.Aformallanguagetodoasmuchwillrequiresomeorallof these:symbolsforvariouslogicalnotionsandforvariables,somefor functionsorrelations,plusauxiliarysymbols.Itwillalsobenecessary tospecifyrulesforputtingthesymbolstogethertomakeformulas,for interpretingthemeaninganddeterminingthetruthoftheseformulas, andformakinginferencesindeductions. Foraconcreteexample,considerelementarynumbertheory.The setofelementsunderdiscussionisthesetofnaturalnumbers N = f 0 ; 1 ; 2 ; 3 ; 4 ;::: g .Onemightneedsymbolsornamesforcertaininterestingnumbers,say0and1;forvariablesover N suchas n and x ;for functionson N ,say and+;andforrelations,say=, < ,and j .In addition,oneislikelytoneedsymbolsforpunctuation,suchas(and23

PAGE 36

245.LANGUAGES);forlogicalconnectives,suchas : and ;andforquantiers,such as 8 (\forall")and 9 (\thereexists").Astatementofmathematical Englishsuchas\Forall n and m ,if n divides m ,then n islessthanor equalto m "canthenbewrittenasacoolformulalike 8 n 8 m ( n j m ( n
PAGE 37

5.LANGUAGES25assumethateveryrst-orderlanguageweencounterhasonlycountablymanynon-logicalsymbols. Mostoftheresultswewillproveactuallyholdforcountableanduncountablerst-orderlanguagesalike,but somerequireheaviermachinerytoproveforuncountablelanguages. Justasin LP,theparenthesesarejustpunctuationwhiletheconnectives, : and ,areintendedtoexpress not and if...then .However,therestofthesymbolsarenewandareintendedtoexpressideas thatcannotbehandledby LP.Thequantiersymbol, 8 ,ismeantto represent forall ,andisintendedtobeusedwiththevariablesymbols, e.g. 8 v4.Theconstantsymbolsaremeanttobenamesforparticular elementsofthestructureunderdiscussion. k -placefunctionsymbols aremeanttonameparticularfunctionswhichmap k -tuplesofelements ofthestructuretoelementsofthestructure. k -placerelationsymbols areintendedtonameparticular k -placerelationsamongelementsof thestructure.3Finally,=isaspecialbinaryrelationsymbolintended torepresentequality. Example 5.1 Sincethelogicalsymbolsarealwaysthesame,rstorderlanguagesareusuallydenedbyspecifyingthenon-logicalsymbols.Aformallanguageforelementarynumbertheorylikethatunofciallydescribedabove,callit LNT,canbedenedasfollows. Constantsymbols:0and1 Two2-placefunctionsymbols:+and Twobinaryrelationsymbols: < and j Eachofthesesymbolsisintendedtorepresentthesamethingitdoes ininformalmathematicalusage:0and1areintendedtobenames forthenumberszeroandone,+and namesfortheoperationsof additionandmultiplications,and < and j namesfortherelations\less than"and\divides".(Notethatwecould,inprinciple,interpretthings completelydierently{let0representthenumberforty-one,+the operationofexponentiation,andsoon{orevenusethelanguageto talkaboutadierentstructure{saytherealnumbers, R ,with0, 1,+, ,and < representingwhattheyusuallydoand,justforfun, j interpretedas\isnotequalto".MoreonthisinChapter6.)We willusuallyusethesamesymbolsinourformallanguagesthatweuse informallyforvariouscommonmathematicalobjects.Thisconvention 3Intuitively,arelationorpredicateexpressessome(possiblyarbitrary)relationshipamongoneormoreobjects.Forexample,\ n isprime"isa1-placerelation onthenaturalnumbers, < isa2-placeorbinaryrelationontherationals,and ~ a ( ~ b ~ c )= ~ 0isa3-placerelationon R3.Formally,a k -placerelationonaset X isjustasubsetof Xk, i.e. thecollectionofsequencesoflength k ofelementsof X forwhichtherelationistrue.

PAGE 38

265.LANGUAGEScanoccasionallycauseconfusionifitisnotclearwhetheranexpression involvingthesesymbolsissupposedtobeanexpressioninaformal languageornot. Example 5.2 Herearesomeotherrst-orderlanguages.Recall thatweneedonlyspecifythenon-logicalsymbolsineachcaseand notethatsomepartsofDenitions5.2and5.3maybeirrelevantfor agivenlanguageifitismissingtheappropriatesortsofnon-logical symbols. (1)Thelanguageofpureequality, L=: Nonon-logicalsymbolsatall. (2)Alanguageforelds, LF: Constantsymbols:0,1 2-placefunctionsymbols:+, (3)Alanguageforsettheory, LS: 2-placerelationsymbol: 2 (4)Alanguageforlinearorders, LO: 2-placerelationsymbol: < (5)Anotherlanguageforelementarynumbertheory, LN: Constantsymbol:0 1-placefunctionsymbol: S 2-placefunctionsymbols:+, E Here0isintendedtorepresentzero, S thesuccessorfunction, i.e. S ( n )= n +1,and E theexponentialfunction, i.e. E ( n;m )= nm. (6)A\worst-case"countablelanguage, L1: Constantsymbols: c1, c2, c3,... Foreach k 1, k -placefunctionsymbols: fk 1, fk 2, fk 3,... Foreach k 1, k -placerelationsymbols: Pk 1, Pk 2, Pk 3,... Thislanguagehasnouseexceptasanabstractexample. Itremainstospecifyhowtoformvalidformulasfromthesymbols ofarst-orderlanguage L .Thiswillbemorecomplicatedthanitwas for LP.Infact,werstneedtodeneatypeofexpressionin L which hasnocounterpartinpropositionallogic. Definition 5.2 The terms ofarst-orderlanguage L arethose nitesequencesofsymbolsof L whichsatisfythefollowingrules: (1)Everyvariablesymbol vnisaterm. (2)Everyconstantsymbol c isaterm. (3)If f isa k -placefunctionsymboland t1,..., tkareterms,then ft1:::tkisalsoaterm. (4)Nothingelseisaterm.

PAGE 39

5.LANGUAGES27Thatis,atermisanexpressionwhichrepresentssome(possibly indeterminate)elementofthestructureunderdiscussion.Forexample, in LNTor LN,+ v0v1(informally, v0+ v1)isaterm,thoughprecisely whichnaturalnumberitrepresentsdependsonwhatvaluesareassigned tothevariables v0and v1. Problem 5.1 WhichofthefollowingaretermsofoneofthelanguagesdenedinExamples5.1and5.2?Ifso,whichoftheselanguage(s)aretheytermsof;ifnot,whynot? (1) v2(2)+0 + v611 (3) j 1+ v30 (4)(
PAGE 40

285.LANGUAGESformulasarebuiltupinmakingdenitionsandinprovingresultsby inductiononthelengthofaformula.Wewillalsorecycletheuse oflower-caseGreekcharacterstorefertoformulasandofupper-case Greekcharacterstorefertosetsofformulas. Problem 5.4 Whichofthefollowingareformulasofoneofthe languagesdenedinExamples5.1and5.2?Ifso,whichoftheselanguage(s)aretheyformulasof;ifnot,whynot? (1)=0+ v7 1 v3(2)( : = v1v1) (3)( j v20 01) (4)( :8 v5(= v5v5)) (5) < +01 j v1v3(6)( v3= v3!8 v5v3= v5) (7) 8 v6(= v60 !8 v9( :j v9v6)) (8) 8 v8< +11 v4Problem 5.5 Showthateveryformulaofarst-orderlanguage hasthesamenumberofleftparenthesesasofrightparentheses. Problem 5.6 ChooseoneofthelanguagesdenedinExamples5.1 and5.2anddeterminethepossiblelengthsofformulasofthislanguage. Proposition 5.7 Acountablerst-orderlanguage L hascountably manyformulas. Inpractice,devisingaformallanguageintendedtodealwithaparticular(kindof)structureisn'ttheendofthejob:onemustalsospecify axiomsinthelanguagethatthestructure(s)onewishestostudyshould satisfy.Deningsatisfactionisociallydoneinthenextchapter,but itisusuallystraightforwardtounociallygureoutwhataformula inthelanguageissupposedtomean. Problem 5.8 Ineachcase,writedownaformulaofthegiven languageexpressingthegiveninformalstatement. (1) \Additionisassociative"in LF. (2) \Thereisanemptyset"in LS. (3) \Betweenanytwodistinctelementsthereisathirdelement" in LO. (4) \ n0=1 forevery n dierentfrom 0 "in LN. (5) \Thereisonlyonething"in L=. Problem 5.9 Denerst-orderlanguagestodealwiththefollowingstructuresand,ineachcase,anappropriatesetofaxiomsinyour language:

PAGE 41

5.LANGUAGES29(1) Groups. (2) Graphs. (3) Vectorspaces. Wewillneedafewadditionalconceptsandfactsaboutformulasof rst-orderlogiclateron.First,whatarethesubformulasofaformula? Problem 5.10 Denethesetofsubformulasofaformula ofa rst-orderlanguage L Forexample,if is ((( :8 v1( : = v1c7)) P2 3v5v8) !8 v8(= v8f3 5c0v1v5! P1 2v8)) inthelanguage L1,thenthesetofsubformulasof S ( ),oughtto include = v1c7, P2 3v5v8,= v8f3 5c0v1v5, P1 2v8, ( : = v1c7),(= v8f3 5c0v1v5! P1 2v8), v1( : = v1c7), 8 v8(= v8f3 5c0v1v5! P1 2v8), ( :8 v1( : = v1c7)), ( :8 v1( : = v1c7)) P2 3v5v8),and ((( :8 v1( : = v1c7)) P2 3v5v8) !8 v8(= v8f3 5c0v1v5! P1 2v8)) itself. Second,wewillneedaconceptthathasnocounterpartinpropositionallogic. Definition 5.4 Suppose x isavariableofarst-orderlanguage L .Then x occursfree inaformula of L isdenedasfollows: (1)If isatomic,then x occursfreein ifandonlyif x occurs in (2)If is( : ),then x occursfreein ifandonlyif x occursfree in (3)If is( ),then x occursfreein ifandonlyif x occurs freein orin (4)If is 8 vk ,then x occursfreein ifandonlyif x isdierent from vkand x occursfreein Anoccurrenceof x in whichisnotfreeissaidtobe bound .Aformula of L inwhichnovariableoccursfreeissaidtobea sentence Part4isthekey:itassertsthatanoccurrenceofavariable x isboundinsteadoffreeifitisinthe\scope"ofanoccurrenceof 8 x .Forexample, v7isfreein 8 v5= v5v7,but v5isnot.Dierent occurencesofagivenvariableinaformulamaybefreeorbound, dependingonwheretheyare; e.g. v6occursbothfreeandboundin 8 v0(= v0f1 3v6! ( :8 v6P1 9v6)).

PAGE 42

305.LANGUAGESProblem 5.11 Giveaprecisedenitionofthescopeofaquantier. NotethedistinctionbetweensentencesandordinaryformulasintroducedinthelastpartofDenition5.4.Asweshallsee,sentencesare oftenmoretractableandusefultheoreticallythanordinaryformulas. Problem 5.12 WhichoftheformulasyougaveinsolvingProblem5.8aresentences? Finally,wewilleventuallyneedtoconsiderarelationshipbetween rst-orderlanguages. Definition 5.5 Arst-orderlanguage L0isan extension ofarstorderlanguage L ,sometimeswrittenas LL0,ifeverynon-logical symbolof L isanon-logicalsymbolofthesamekindof L0. Forexample,everyrst-orderlanguageisanextensionof L=. Problem 5.13 WhichofthelanguagesgiveninExample5.2are extensionsofotherlanguagesgiveninExample5.2? Proposition 5.14 Suppose L isarst-orderlanguageand L0is anextensionof L .Theneveryformula of L isaformulaof L0. CommonConventions. Aswithpropositionallogic,wewilloften useabbreviationsandinformalconventionstosimplifythewritingof formulasinrst-orderlanguages.Inparticular,wewillusethesame additionalconnectivesweusedinpropositionallogic,plusanadditional quantier, 9 (\thereexists"): ( ^ )isshortfor( : ( ( : ))). ( )isshortfor(( : ) ). ( $ )isshortfor(( ) ^ ( )). vk' isshortfor( :8 vk( : )). ( 8 isoftencalledtheuniversalquantierand 9 isoftencalledthe existentialquantier.) Parentheseswilloftenbeomittedinformulasaccordingtothesame conventionsweusedinpropositionallogic,withthemodicationthat 8 and 9 takeprecedenceoverallthelogicalconnectives: Wewillusuallydroptheoutermostparenthesesinaformula, writing insteadof( )and : insteadof( : ). Wewilllet 8 takeprecedenceover : ,and : takeprecedence over whenparenthesesaremissing,andttheinformalabbreviationsintothisschemebylettingtheorderofprecedence be 8 9 : ^ ,and $ .

PAGE 43

5.LANGUAGES31 Finally,wewillgrouprepetitionsof ^ ,or $ tothe rightwhenparenthesesaremissing,so isshortfor ( ( )). Forexample, 9 vk: !8 vn isshortfor(( :8 vk( : ( : ))) !8 vn ). Ontheotherhand,wewillsometimesaddparenthesesandarrange thingsinunocialwaystomaketermsandformulaseasiertoread.In particularwewilloftenwrite (1) f ( t1;:::;tk)for ft1:::tkif f isa k -placefunctionsymboland t1,..., tkareterms, (2) s t for st if isa2-placefunctionsymboland s and t are terms, (3) P ( t1;:::;tk)for Pt1:::tkif P isa k -placerelationsymboland t1,..., tkareterms, (4) s t for st if isa2-placerelationsymboland s and t are terms,and (5) s = t for= st if s and t areterms,and (6)enclosetermsinparenthesestogroupthem. Thus,wecouldwritetheformula=+1 0 v6 11of LNTas1+(0 v6)= 1 1. AswasobservedinExample5.1,itiscustomaryindevisingaformal languagetorecyclethesamesymbolsusedinformallyforthegiven objects.Insituationswherewewanttotalkaboutsymbolswithout committingourselvestoaparticularone,suchaswhentalkingabout rst-orderlanguagesingeneral,wewilloftenuse\generic"choices: a b c ,...forconstantsymbols; x y z ,...forvariablesymbols; f g h ,...forfunctionsymbols; P Q R ,...forrelationsymbols;and r s t ,...forgenericterms. Thesecanbethoughtofasvariablesinthemetalanguage4rangingover dierentkindsobjectsofrst-orderlogic,muchaswe'realreadyusing lower-caseGreekcharactersasvariableswhichrangeoverformulas.(In fact,wehavealreadyusedsomeoftheseconventionsinthischapter...) UniqueReadability. Theslightlyparanoidmightaskwhether Denitions5.1,5.2and5.3actuallyensurethatthetermsandformulas ofarst-orderlanguage L areunambiguous, i.e. cannotbereadin 4Themetalanguageisthelanguage,mathematicalEnglishinthiscase,inwhich wetalk about alanguage.Thetheoremsweproveaboutformallogicare,strictly speaking,metatheorems,asopposedtothetheoremsprovedwithinaformallogical system.Formoreofthiskindofstu,readsomephilosophy...

PAGE 44

325.LANGUAGESmorethanoneway.Aswith LP,toactuallyprovethisonemust assumethatallthesymbolsof L aredistinctandthatnosymbolisa subsequenceofanyothersymbol.Itthenfollowsthat: Theorem 5.15 Anytermofarst-orderlanguage L satisesexactlyoneofconditions1{3inDenition5.2. Theorem 5.16(UniqueReadabilityTheorem) Anyformulaofa rst-orderlanguagesatisesexactlyoneofconditions1{5inDenition 5.3.

PAGE 45

CHAPTER6StructuresandModelsDeningtruthandimplicationinrst-orderlogicisalotharder thanitwasinpropositionallogic.First-orderlanguagesareintended todealwithmathematicalobjectslikegroupsorlinearorders,soit makeslittlesensetospeakofthetruthofaformulawithoutspecifying acontext.Forexample,onecanwritedownaformulaexpressingthe commutativelawinalanguageforgrouptheory, 8 x 8 yx y = y x butwhetheritistrueornotdependsonwhichgroupwe'redealing with.Itfollowsthatweneedtomakeprecisewhichmathematical objectsorstructuresagivenrst-orderlanguagecanbeusedtodiscuss andhow,givenasuitablestructure,formulasinthelanguageareto beinterpreted.Suchastructureforagivenlanguageshouldsupply mostoftheingredientsneededtointerpretformulasofthelanguage. Throughoutthischapter,let L beanarbitraryxedcountablerstorderlanguage.Allformulaswillbeassumedtobeformulasof L unless statedotherwise. Definition 6.1 A structure M for L consistsofthefollowing: (1)Anon-emptyset M ,oftenwrittenas j M j ,calledthe universe of M (2)Foreachconstantsymbol c of L ,anelement cMof M (3)Foreach k -placefunctionsymbol f of L ,afunction fM: Mk! M i.e. a k -placefunctionon M (4)Foreach k -placerelationsymbol P of L ,arelation PM Mk, i.e. a k -placerelationon M Thatis,astructuresuppliesanunderlyingsetofelementsplusinterpretationsforthevariousnon-logicalsymbolsofthelanguage:constantsymbolsareinterpretedbyparticularelementsoftheunderlying set,functionsymbolsbyfunctionsonthisset,andrelationsymbolsby relationsamongelementsofthisset. Itiscustomarytouseupper-case\gothic"characterssuchas M and N forstructures. Forexample,consider Q =( Q ;< ),where < istheusual\lessthan" relationontherationals.Thisisastructurefor LO,thelanguagefor linearordersdenedinExample5.2;itsuppliesa2-placerelationto33

PAGE 46

346.STRUCTURESANDMODELSinterpretthelanguage's2-placerelationsymbol. Q is not theonly possiblestructurefor LO:( R ;< ),( f 0 g ; ; ),and( N ; N2)arethreeothers amonginnitelymanymore.(Notethatinthesecasestherelation symbol < isinterpretedbyrelationsontheuniversewhicharenot linearorders.OnecanensurethatastructuresatisfyvariousconditionsbeyondwhatDenition6.1guaranteesbyrequiringappropriate formulastobetruewheninterpretedinthestructure.)Ontheother hand,( R )isnotastructurefor LObecauseitlacksabinaryrelation tointerpretthesymbol < by,while( N ; 0 ; 1 ; + ; ; j ;< )isnotastructure for LObecauseithastwobinaryrelationswhere LOhasasymbolonly forone,plusconstantsandfunctionsforwhich LOlackssymbols. Problem 6.1 Therst-orderlanguagesreferredtobelowwereall denedinExample5.2. (1) Is ( ; ) astructurefor L=? (2) Determinewhether Q =( Q ;< ) isastructureforeachof L=, LF,and LS. (3) Givethreedierentstructuresfor LFwhicharenotelds. Todeterminewhatitmeansforagivenformulatobetrueina structureforthecorrespondinglanguage,wewillalsoneedtospecify howtointerpretthevariableswhentheyoccurfree.(Boundvariables havetheassociatedquantiertotelluswhattodo.) Definition 6.2 Let V = f v0;v1;v2;::: g bethesetofallvariable symbolsof L andsuppose M isastructurefor L .Afunction s : V j M j issaidtobean assignment for M Notethattheseare not truthassignmentslikethosefor LP.An assignmentjustinterpretseachvariableinthelanguagebyanelement oftheuniverseofthestructure.Also,aslongastheuniverseofthe structurehasmorethanoneelement,anyvariablecanbeinterpreted inmorethanoneway.Hencethereareusuallymanydierentpossible assignmentsforagivenstructure. Example 6.1 Considerthestructure R =( R ; 0 ; 1 ; + ; )for LF. Eachofthefollowingfunctions V R isanassignmentfor R : (1) p ( vn)= foreach n (2) r ( vn)= enforeach n ,and (3) s ( vn)= n +1foreach n Infact, every function V R isanassignmentfor R Inordertouseassignmentstodeterminewhetherformulasaretrue inastructure,weneedtoknowhowtouseanassignmenttointerpret eachtermofthelanguageasanelementoftheuniverse.

PAGE 47

6.STRUCTURESANDMODELS35Definition 6.3 Suppose M isastructurefor L and s : V !j M j isanassignmentfor M .Let T bethesetofalltermsof L .Thenthe extendedassignment s : T !j M j isdenedinductivelyasfollows: (1)Foreachvariable x s ( x )= s ( x ). (2)Foreachconstantsymbol c s ( c )= cM. (3)Forevery k -placefunctionsymbol f andterms t1,..., tk, s ( ft1:::tk)= fM( s ( t1) ;:::; s ( tk)) : Example 6.2 Let R bethestructurefor LFgiveninExample 6.1,andlet p r ,and s betheextendedassignmentscorrespondingto theassignments p r ,and s denedinExample6.1.Considertheterm + v6v0+0 v3of LF.Then: (1) p (+ v6v0+0 v3)= 2+ (2) r (+ v6v0+0 v3)= e6+ e3,and (3) s (+ v6v0+0 v3)=11. Here'swhyforthelastone:since s ( v6)=7, s ( v0)=1, s ( v3)=4, and s (0)=0(bypart2ofDenition6.3),itfollowsfrompart3of Denition6.3that s (+ v6v0+0 v3)=(7 1)+(0+4)=7+4=11. Problem 6.2 N =( N ; 0 ;S; + ; ;E ) isastructurefor LN.Let s : V N betheassignmentdenedby s ( vk)= k +1 .Whatare s ( E + v19v1 0 v45) and s ( SSS + E 0 v6v7) ? Proposition 6.3 s isunique, i.e. givenanassignment s ,noother function T !j M j satisesconditions1{3inDenition6.3. WithDenitions6.2and6.3inhand,wecantakeourrstcutat deningwhatitmeansforarst-orderformulatobetrue. Definition 6.4 Suppose M isastructurefor L s isanassignment for M ,and isaformulaof L .Then M j = [ s ]isdenedasfollows: (1)If is t1= t2forsometerms t1and t2,then M j = [ s ]ifand onlyif s ( t1)= s ( t2). (2)If is Pt1:::tkforsome k -placerelationsymbol P andterms t1,..., tk,then M j = [ s ]ifandonlyif( s ( t1) ;:::; s ( tk)) 2 PM, i.e. PMistrueof( s ( t1) ;:::; s ( tk)). (3)If is( : )forsomeformula ,then M j = [ s ]ifandonlyif itisnotthecasethat M j = [ s ]. (4)If is( ),then M j = [ s ]ifandonlyif M j = [ s ] whenever M j = [ s ], i.e. unless M j = [ s ]butnot M j = [ s ]. (5)If is 8 x forsomevariable x ,then M j = [ s ]ifandonlyiffor all m 2j M j M j = [ s ( x j m )],where s ( x j m )istheassignment

PAGE 48

366.STRUCTURESANDMODELSgivenby s ( x j m )( vk)= ( s ( vk)if vkisdierentfrom x m if vkis x If M j = [ s ],weshallsaythat M satises onassignment s orthat istruein M onassignment s .Wewilloftenwrite M 2 [ s ]ifitis notthecasethat M j = [ s ].Also,if)-383(isasetofformulasof L ,we shalltake M j =)332([ s ]tomeanthat M j = [ s ]foreveryformula in)]TJ-28.205 -1.1643 TD-0.008 Tc[(andsaythat M satises )Tj/F30 1 Tf1.0037 0 TD-0.008 Tc[(onassignment s .Similarly,weshalltake M 2 [ s ]tomeanthat M 2 [ s ]for some formula in)19(. Clauses1and2areprettystraightforwardandclauses3and4are essentiallyidenticaltothecorrespondingpartsofDenition2.1.The keyclauseis5,whichsaysthat 8 shouldbeinterpretedas\forall elementsoftheuniverse". Example 6.3 Let R bethestructurefor LFand s theassignment for R giveninExample6.1,andconsidertheformula 8 v1(= v3 0 v1! = v30)of LF.Wecanverifythat R j = 8 v1(= v3 0 v1! = v30)[ s ]as follows: R j = 8 v1(= v3 0 v1! = v30)[ s ] () forall a 2j R j R j =(= v3 0 v1! = v30)[ s ( v1j a )] () forall a 2j R j ,if R j == v3 0 v1[ s ( v1j a )], then R j == v30[ s ( v1j a )] () forall a 2j R j ,if s ( v1j a )( v3)= s ( v1j a )( 0 v1), then s ( v1j a )( v3)= s ( v1j a )(0) () forall a 2j R j ,if s ( v3)= s ( v1j a )(0) s ( v1j a )( v1),then s ( v3)=0 () forall a 2j R j ,if s ( v3)=0 a ,then s ( v3)=0 () forall a 2j R j ,if4=0 a ,then4=0 () forall a 2j R j ,if4=0,then4=0 ...whichlastistruewhetherornot4=0istrueorfalse. Problem 6.4 Let N bethestructurefor LNinProblem6.2.Let p : V N bedenedby p ( v2 k)= k and p ( v2 k +1)= k .Verifythat (1) N j = 8 w ( : Sw =0)[ p ] and (2) N 2 8 x 9 yx + y =0[ p ] Proposition 6.5 Suppose M isastructurefor L s isanassignmentfor M x isavariable,and isaformulaofarst-order language L .Then M j = 9 x' [ s ] ifandonlyif M j = [ s ( x j m )] forsome m 2j M j .

PAGE 49

6.STRUCTURESANDMODELS37Workingwithparticularassignmentsisdicultbut,whilesometimesunavoidable,notalwaysnecessary. Definition 6.5 Suppose M isastructurefor L ,and aformula of L .Then M j = ifandonlyif M j = [ s ]foreveryassignment s : V !j M j for M M isa model of orthat is true in M if M j = .Wewilloftenwrite M 2 ifitisnotthecasethat M j = Similarly,if)-343(isasetofformulas,wewillwrite M j =)-50(if M j = foreveryformula 2 ,andsaythat M isa model of)-400(orthat M satises .Aformulaorsetofformulasis satisable ifthereissome structure M whichsatisesit.Wewilloftenwrite M 2 ifitisnot thecasethat M j =)272(. Note. M 2 does not meanthatforeveryassignment s : V j M j ,itisnotthecasethat M j = [ s ].Itonlymeansthatthatthereis some assignment r : V !j M j forwhich M j = [ r ]isnottrue. Problem 6.6 Q =( Q ;< ) isastructurefor LO.Foreachofthe followingformulas of LO,determinewhetherornot Q j = (1) 8 v09 v2v0
PAGE 50

386.STRUCTURESANDMODELSsimplifythingsonoccasionwhenprovingthingsaboutsentencesrather thanformulas. Werecycleasenseinwhichweused j =inpropositionallogic. Definition 6.6 Suppose)-413(isasetofformulasof L and isa formulaof L .Then)]TJ/F30 1 Tf4.0952 0 TD0.002 Tc[(implies ,writtenas)]TJ/F22 1 Tf5.9622 0 TD0 Tc(j = ,if M j = whenever M j =)-331(foreverystructure M for L Similarly,if)-372(andaresetsofformulasof L ,then)]TJ/F30 1 Tf3.8945 0 TD0.002 Tc[(implies writtenas)]TJ/F22 1 Tf5.5808 0 TD0 Tc(j =,if M j =whenever M j =)-331(foreverystructure M for L Wewillusuallywrite j = ::: for ;j = ::: Proposition 6.10 Suppose and areformulasofsomerstorderlanguage.Then f ( ) ; gj = Proposition 6.11 Suppose isasetofformulasand and areformulasofsomerst-orderlanguage.Then [f gj = ifand onlyif j =( ) Definition 6.7 Aformula of L isa tautology ifitistruein everystructure, i.e. if j = isa contradiction if : isatautology, i.e. if j = : Forsometrivialexamples,let beaformulaof L and M astructure for L .Then M j = f g ifandonlyif M j = ,soitmustbethecase that f gj = .Itisalsoeasytocheckthat isatautologyand : ( )isacontradiction. Problem 6.12 Showthat 8 yy = y isatautologyandthat 9 y : y = y isacontradiction. Problem 6.13 Suppose isacontradiction.Showthat M j = [ s ] isfalseforeverystructure M andassignment s : V !j M j for M Problem 6.14 Showthatasetofformulas issatisableifand onlyifthereisnocontradiction suchthat j = ThefollowingfactisacounterpartofProposition2.4. Proposition 6.15 Suppose M isastructurefor L and and aresentencesof L .Then: (1) M j = : ifandonlyif M 2 (2) M j = ifandonlyif M j = whenever M j = (3) M j = ifandonlyif M j = or M j = (4) M j = ^ ifandonlyif M j = and M j = (5) M j = $ ifandonlyif M j = exactlywhen M j = (6) M j = 8 x ifandonlyif M j = .

PAGE 51

6.STRUCTURESANDMODELS39(7) M j = 9 x ifandonlyifthereissome m 2j M j sothat M j = [ s ( x j m )] foreveryassignment s for M Problem 6.16 HowmuchofProposition6.15mustremaintrue if and arenotsentences? RecallthatbyProposition5.14aformulaofarst-orderlanguage isalsoaformulaofanyextensionofthelanguage.Thefollowingrelationshipbetweenextensionlanguagesandsatisabilitywillbeneeded lateron. Proposition 6.17 Suppose L isarst-orderlanguage, L0isan extensionof L ,and )Tj/F30 1 Tf0.9837 0 TD0.001 Tc[(isasetofformulasof L .Then )Tj/F30 1 Tf0.9837 0 TD0.001 Tc[(issatisable inastructurefor L ifandonlyif )Tj/F30 1 Tf0.9435 0 TD[(issatisableinastructurefor L0. Onelastbitofterminology... Definition 6.8 If M isastructurefor L ,thenthe theory of M is justthesetofallsentencesof L truein M i.e. Th( M )= f j isasentenceand M j = g : Ifisasetofsentencesand S isacollectionofstructures,thenis asetof(non-logical) axioms for S ifforeverystructure M M 2S if andonlyif M j =. Example 6.4 Considerthesentence 9 x 9 y (( : x = y ) ^8 z ( z = x z = y ))of L=.Everystructureof L=satisfyingthissentencemust haveexactlytwoelementsinitsuniverse,so f9 x 9 y (( : x = y ) ^8 z ( z = x z = y )) g isasetofnon-logicalaxiomsforthecollectionofsetsof cardinality2: f M j M isastructurefor L=withexactly2elements g : Problem 6.18 Ineachcase,ndasuitablelanguageandasetof axiomsinitforthegivencollectionofstructures. (1) Setsofsize3. (2) Bipartitegraphs. (3) Commutativegroups. (4) Fieldsofcharacteristic5.

PAGE 53

CHAPTER7DeductionsDeductionsinrst-orderlogicarenotunlikedeductionsinpropositionallogic.Ofcourse,somechangesarenecessarytohandlethe variousadditionalfeaturesofpropositionallogic,especiallyquantiers. Inparticular,oneofthenewaxiomsrequiresatrickypreliminarydefinition.Roughly,theproblemisthatweneedtoknowwhenwecan replaceoccurrencesofavariableinaformulabyatermwithoutletting anyvariableinthetermgetcapturedbyaquantier. Throughoutthischapter,let L beaxedarbitraryrst-orderlanguage.Unlessstatedotherwise,allformulaswillbeassumedtobe formulasof L Definition 7.1 Suppose x isavariable, t isaterm,and isa formula.Then t issubstitutablefor x in isdenedasfollows: (1)If isatomic,then t issubstitutablefor x in (2)If is( : ),then t issubstitutablefor x in ifandonlyif t issubstitutablefor x in (3)If is( ),then t issubstitutablefor x in ifandonly if t issubstitutablefor x in and t issubstitutablefor x in (4)If is 8 y ,then t issubstitutablefor x in ifandonlyif either (a) x doesnotoccurfreein ,or (b)if y doesnotoccurin t and t issubstitutablefor x in Forexample, x isalwayssubstitutableforitselfinanyformula and 'x xisjust (seeProblem7.1).Ontheotherhand, y isnot substitutablefor x in 8 yx = y becauseif x weretobereplacedby y thenewinstanceof y wouldbe\captured"bythequantier 8 y .This makesadierencetothetruthoftheformula.Thetruthof 8 yx = y dependsonthestructureinwhichitisinterpreted|it'strueifthe universehasonlyoneelementandfalseotherwise|but 8 yy = y is atautologybyProblem6.12soitistrueinanystructurewhatsoever. Thissortofdicultymakesitnecessarytobecarefulwhensubstituting forvariables.41

PAGE 54

427.DEDUCTIONSDefinition 7.2 Suppose x isavariable, t isaterm,and is aformula.If t issubstitutablefor x in ,then 'x t( i.e. with t substitutedfor x )isdenedasfollows: (1)If isatomic,then 'x tistheformulaobtainedbyreplacing eachoccurrenceof x in by t (2)If is( : ),then 'x tistheformula( : x t). (3)If is( ),then 'x tistheformula( x t! x t). (4)If is 8 y ,then 'x tistheformula (a) 8 y if x is y ,and (b) 8 yx tif x isn't y Problem 7.1 (1) Is x substitutablefor z in if is z = x !8 zz = x ?Ifso,whatis z x? (2) Showthatif t isanytermand isasentence,then t issubstitutablein foranyvariable x .Whatis x t? (3) Showthatif t isaterminwhichnovariableoccursthatoccurs intheformula ,then t issubstitutablein foranyvariable x (4) Showthat x issubstitutablefor x in foranyvariable x and anyformula ,andthat 'x xisjust Alongwiththenotionofsubstitutability,weneedanadditional notioninordertodenethelogicalaxiomsof L Definition 7.3 If isanyformulaand x1,..., xnareanyvariables,then 8 x1::: 8 xn' issaidtobea generalization of Forexample, 8 y 8 x ( x = y fx = fy )and 8 z ( x = y fx = fy ) are(dierent)generalizationsof x = y fx = fy ,but 8 x 9 y ( x = y fx = fy )isnot.Notethatthevariablesbeingquantieddon't havetooccurintheformulabeinggeneralized. Lemma 7.2 Anygeneralizationofatautologyisatautology. Definition 7.4 Everyrst-orderlanguage L haseight logicalaxiomschema : A1: ( ( )) A2: (( ( )) (( ) ( ))) A3: ((( : ) ( : )) ((( : ) ) )) A4: ( 8 x x t),if t issubstitutablefor x in A5: ( 8 x ( ) ( 8 x !8 x )) A6: ( !8 x ),if x doesnotoccurfreein A7: x = x

PAGE 55

7.DEDUCTIONS43A8: ( x = y ( )),if isatomicand isobtainedfrom byreplacingsomeoccurrences(possiblyallornone)of x in by y Plugginginanyparticularformulasof L for ,and ,andany particularvariablesfor x and y ,inanyofA1{A8givesa logicalaxiom of L .Inaddition,anygeneralizationofalogicalaxiomof L isalsoa logicalaxiomof L ThereasonforcallingtheinstancesofA1{A8thelogicalaxioms, insteadofjustaxioms,istoavoidconictwithDenition6.8. Problem 7.3 Determinewhetherornoteachofthefollowingformulasisalogicalaxiom. (1) 8 x 8 z ( x = y ( x = c x = y )) (2) x = y ( y = z z = x ) (3) 8 z ( x = y ( x = c y = c )) (4) 8 w 9 x ( Pwx Pww ) !9 x ( Pxx Pxx ) (5) 8 x ( 8 xc = fxc !8 x 8 xc = fxc ) (6)( 9 xPx !9 y 8 zRzfy ) (( 9 xPx !8 y :8 zRzfy ) !8 x : Px ) Proposition 7.4 Everylogicalaxiomisatautology. NotethatwehaverecycledouraxiomschemasA1|A3frompropositionallogic.WewillalsorecycleMPasthesoleruleofinferencefor rst-orderlogic. Definition 7.5(ModusPonens) Giventheformulas and( ),onemayinfer Asinpropositionallogic,wewillusuallyrefertoModusPonensby itsinitials,MP.ThatMPpreservestruthinthesenseofChapter6 followsfromProblem6.10.UsingthelogicalaxiomsandMP,wecan executedeductionsinrst-orderlogicjustaswedidinpropositional logic. Definition 7.6 Letbeasetofformulasoftherst-orderlanguage L .A deduction or proof fromin L isanitesequence '1'2:::'nofformulasof L suchthatforeach k n (1) 'kisalogicalaxiom,or (2) 'k2 ,or (3)thereare i;j
PAGE 56

447.DEDUCTIONSinsteadof ;` .Finally,if)-383(andaresetsofformulas,we'lltake )Tj/F22 1 Tf0.8833 0 TD(` tomeanthat)]TJ/F22 1 Tf7.9697 0 TD0 Tc(` foreveryformula 2 Note. Wehavereusedtheaxiomschema,theruleofinference,and thedenitionofdeductionfrompropositionallogic.Itfollowsthatany deductionofpropositionallogiccanbeconvertedintoadeductionof rst-orderlogicsimplybyreplacingtheformulasof LPoccurringin thedeductionbyrst-orderformulas.FeelfreetoappealtothedeductionsintheexercisesandproblemsofChapter3. Youshouldprobably reviewtheExamplesandProblemsofChapter3beforegoingon,since mostoftherestofthisChapterconcentratesonwhatis dierent about deductionsinrst-orderlogic. Example 7.1 We'llshowthat f g`9 x foranyrst-orderformula andanyvariable x (1)( 8 x : !: ) ( !:8 x : )Problem3.9.5 (2) 8 x : !: A4 (3) !:8 x : 1,2MP (4) Premiss (5) :8 x : 3,4MP (6) 9 x Denitionof 9 Strictlyspeaking,thelastlineisjustforourconvenience,like 9 itself. Problem 7.5 Showthat: (1) `8 x' !8 y'x y,if y doesnotoccuratallin (2) ` _: (3) f c = d g`8 zQazc Qazd (4) ` x = y y = x (5) f9 x g` if x doesnotoccurfreein Manygeneralfactsaboutdeductionscanberecycledfrompropositionallogic,includingtheDeductionTheorem. Proposition 7.6 If '1'2:::'nisadeductionof L ,then '1:::'`isalsoadeductionof L forany ` suchthat 1 ` n Proposition 7.7 If )Tj/F22 1 Tf0.8833 0 TD(` and )Tj/F22 1 Tf0.8833 0 TD(` ,then )Tj/F22 1 Tf0.8833 0 TD(` Proposition 7.8 If )Tj/F22 1 Tf0.8833 0 TD( and )Tj/F22 1 Tf0.8833 0 TD(` ,then ` Proposition 7.9 Thenif )Tj/F22 1 Tf0.8833 0 TD(` and ` ,then )Tj/F22 1 Tf0.9034 0 TD(` Theorem 7.10(DeductionTheorem) If isanysetofformulas and and areanyformulas,then ` ifandonlyif [f g` .

PAGE 57

7.DEDUCTIONS45Justasinpropositionallogic,theDeductionTheoremisusefulbecauseitoftenletsustakeshortcutswhentryingtoshowthatdeductions exist.Thereisalsoanotherresultaboutrst-orderdeductionswhich oftensuppliesusefulshortcuts. Theorem 7.11(GeneralizationTheorem) Suppose x isavariable, )Tj/F30 1 Tf0.8833 0 TD0.001 Tc[(isasetofformulasinwhich x doesnotoccurfree,and isaformula suchthat )Tj/F22 1 Tf0.9034 0 TD(` .Then )Tj/F22 1 Tf0.9034 0 TD0.272 Tc(`8 x' Theorem 7.12(GeneralizationOnConstants) Supposethat c isa constantsymbol, )Tj/F30 1 Tf0.9636 0 TD0.001 Tc[(isasetofformulasinwhich c doesnotoccur,and isaformulasuchthat )Tj/F22 1 Tf0.8833 0 TD(` .Thenthereisavariable x whichdoes notoccurin suchthat )Tj/F22 1 Tf0.9034 0 TD0.272 Tc(`8 x'c x.1Moreover,thereisadeductionof 8 x'c xfrom )Tj/F30 1 Tf0.9636 0 TD0.001 Tc[(inwhich c doesnotoccur. Example 7.2 We'llshowthatif and areanyformulas, x is anyvariable,and ` ,then `8 x' !8 x Since x doesnotoccurfreeinanyformulaof ; ,itfollowsfrom ` bytheGeneralizationTheoremthat `8 x ( ).Butthen (1) 8 x ( )above (2) 8 x ( ) ( 8 x' !8 x )A5 (3) 8 x' !8 x 1,2MP isthetailendofadeductionof 8 x' !8 x from ; Problem 7.13 Showthat: (1) `8 x 8 y 8 z ( x = y ( y = z x = z )) (2) `8 x !9 x (3) `9 x !8 x if x doesnotoccurfreein Weconcludewithabitofterminology. Definition 7.7 Ifisasetofsentences,thenthe theory ofis Th()= f j isasentenceand ` g : Thatis,thetheoryofisjustthecollectionofallsentenceswhich canbeprovedfrom. 1'c xis witheveryoccurenceoftheconstant c replacedby x .

PAGE 59

CHAPTER8SoundnessandCompletenessAswithpropositionallogic,rst-orderlogichadbettersatisfythe SoundnessTheoremanditisdesirablethatitsatisfytheCompleteness Theorem.Thesetheoremsdoholdforrst-orderlogic.TheSoundness Theoremisprovedinawaysimilartoitscounterpartforpropositional logic,buttheCompletenessTheoremwillrequireafairbitofadditional work.1Itisinthisextraworkthatthedistinctionbetweenformulas andsentencesbecomesuseful. Let L beaxedcountablerst-orderlanguagethroughoutthis chapter.Allformulaswillbeassumedtobeformulasof L unlessstated otherwise. First,werehashmanyofthedenitionsandfactsweprovedfor propositionallogicinChapter4forrst-orderlogic. Theorem 8.1(SoundnessTheorem) If isasentenceand is asetofsentencessuchthat ` ,then j = Definition 8.1 Asetofsentences)-306(is inconsistent if)]TJ/F22 1 Tf1.7666 0 TD0.272 Tc(`: ( )forsomeformula ,andis consistent ifitisnotinconsistent. Recallthatasetofsentences)-406(issatisableif M j =)11(forsome structure M Proposition 8.2 Ifasetofsentences )Tj/F30 1 Tf1.0037 0 TD0.001 Tc[(issatisable,thenitis consistent. Proposition 8.3 Suppose isaninconsistentsetofsentences. Then ` foranyformula Proposition 8.4 Suppose isaninconsistentsetofsentences. Thenthereisanitesubset of suchthat isinconsistent. Corollary 8.5 Asetofsentences )Tj/F30 1 Tf0.9837 0 TD0.001 Tc[(isconsistentifandonlyif everynitesubsetof )Tj/F30 1 Tf0.9636 0 TD[(isconsistent. 1Thisisnottoosurprisingbecauseofthegreatercomplexityofrst-orderlogic. Also,itturnsoutthatrst-orderlogicisaboutaspowerfulasalogiccangetand stillhavetheCompletenessTheoremhold.47

PAGE 60

488.SOUNDNESSANDCOMPLETENESSDefinition 8.2 Asetofsentencesis maximallyconsistent if isconsistentbut [f g isinconsistentwhenever isasentencesuch that = 2 Onequickwayofndingexamplesofmaximallyconsistentsetsis givenbythefollowingproposition. Proposition 8.6 If M isastructure,thenTh ( M ) isamaximally consistentsetofsentences. Example 8.1 M =( f 5 g )isastructurefor L=,soTh( M )isa maximallyconsistentsetofsentences.SinceitturnsoutthatTh( M )= Th( f8 x 8 yx = y g ),thisalsogivesusanexampleofasetofsentences = f8 x 8 yx = y g suchthatTh()ismaximallyconsistent. Proposition 8.7 If isamaximallyconsistentsetofsentences, isasentence,and ` ,then 2 Proposition 8.8 Suppose isamaximallyconsistentsetofsentencesand isasentence.Then : 2 ifandonlyif = 2 Proposition 8.9 Suppose isamaximallyconsistentsetofsentencesand and areanysentences.Then 2 ifandonlyif '= 2 or 2 Theorem 8.10 Suppose )Tj/F30 1 Tf1.0037 0 TD0.001 Tc[(isaconsistentsetofsentences.Then thereisamaximallyconsistentsetofsentences with )Tj/F22 1 Tf0.8833 0 TD( Thecounterpartsofthesenotionsandfactsforpropositionallogic sucedtoprovetheCompletenessTheorem,butherewewillneed someadditionaltools.Thebasicproblemisthatinsteadofdeninga suitabletruthassignmentfromamaximallyconsistentsetofformulas, weneedtoconstructasuitablestructurefromamaximallyconsistent setofsentences.Unfortunately,structuresforrst-orderlanguagesare usuallymorecomplexthantruthassignmentsforpropositionallogic. Thefollowingdenitionsuppliesthekeynewideawewillusetoprove theCompletenessTheorem. Definition 8.3 Supposeisasetofsentencesand C isasetof (someofthe)constantsymbolsof L .Then C isa setofwitnesses for in L ifforeveryformula of L withatmostonefreevariable x thereisaconstantsymbol c 2 C suchthat `9 x' 'x c. Theideaisthateveryelementoftheuniversewhichprovesmust existisnamed,or\witnessed",byaconstantsymbolin C .Notethat if `:9 x' ,then `9 x' 'x cforanyconstantsymbol c .

PAGE 61

8.SOUNDNESSANDCOMPLETENESS49Proposition 8.11 Suppose )Tj/F30 1 Tf1.0439 0 TD0.002 Tc[(and aresetsofsentencesof L )Tj/F22 1 Tf1.0238 0 TD( ,and C isasetofwitnessesfor )Tj/F30 1 Tf1.0439 0 TD0.001 Tc(in L .Then C isasetof witnessesfor in L Example 8.2 Let L0 Obetherst-orderlanguagewithasingle2placerelationsymbol, < ,andcountablymanyconstantsymbols, cqfor each q 2 Q .Letincludeallthesentences (1) cp
PAGE 62

508.SOUNDNESSANDCOMPLETENESScompleteroadmapofDublinonthebasisofthebook.Evenifithasno geographiccontradictions,youareunlikelytondalltheinformation inthenovelneededtodothejob.)Finally,evenifdoesproveallwe needtodenefunctionsandrelationsontheuniversetointerpretthe functionandrelationsymbols,justhowdowedoit?Gettingaround allthesedicultiesrequiresafairbitofwork.Onecangetaround manybystickingtomaximallyconsistentsetsofsentencesinsuitable languages. Lemma 8.12 Suppose isasetofsentences, isanyformula, and x isanyvariable.Then ` ifandonlyif `8 x' Theorem 8.13 Suppose )Tj/F30 1 Tf0.8833 0 TD0.001 Tc[(isaconsistentsetofsentencesof L .Let C beaninnitecountablesetofconstantsymbolswhichare not symbols of L ,andlet L0= L[ C bethelanguageobtainedbyaddingtheconstant symbolsin C tothesymbolsof L .Thenthereisamaximallyconsistent set ofsentencesof L0suchthat )Tj/F22 1 Tf0.9636 0 TD( and C isasetofwitnesses for Thistheoremallowsonetouseacertainmeasureofbruteforce: Nosetofwitnesses?Justaddone!Thesetofsentencesdoesn'tdecide enough?Decide everything onewayortheother! Theorem 8.14 Suppose isamaximallyconsistentsetofsentencesand C isasetofwitnessesfor .Thenthereisastructure M suchthat M j = Theimportantparthereistodene M |provingthat M j = istediousbutfairlystraightforwardifyouhavetherightdenition. Proposition6.17nowletsusdeducethefactwereallyneed. Corollary 8.15 Suppose )Tj/F30 1 Tf1.0037 0 TD0.001 Tc[(isaconsistentsetofsentencesofa rst-orderlanguage L .Thenthereisastructure M for L satisfying )Tj/F30 1 Tf0.6022 0 TD(. Withtheabovefactsinhand,wecanrejoinourproofofSoundness andCompleteness,alreadyinprogress: Theorem 8.16 Asetofsentences in L isconsistentifandonly ifitissatisable. Therestworksjustlikeitdidforpropositionallogic. Theorem 8.17(CompletenessTheorem) If isasentenceand isasetofsentencessuchthat j = ,then ` Itfollowsthatinarst-orderlogic,asinpropositionallogic,a sentenceisimpliedbysomesetofpremissesifandonlyifithasaproof fromthosepremisses.

PAGE 63

8.SOUNDNESSANDCOMPLETENESS51Theorem 8.18(CompactnessTheorem) Asetofsentences is satisableifandonlyifeverynitesubsetof issatisable.

PAGE 65

CHAPTER9ApplicationsofCompactnessAfterwadingthroughtheprecedingchapters,itshouldbeobvious thatrst-orderlogicis,inprinciple,adequateforthejobitwasoriginallydevelopedfor:theessentiallyphilosophicalexerciseofformalizing mostofmathematics.Assomethingofabonus,rst-orderlogiccan supplyusefultoolsfordoing\real"mathematics.TheCompactness Theoremisthesimplestofthesetoolsandglimpsesoftwowaysof usingitareprovidedbelow. Fromthenitetotheinnite. Perhapsthesimplestuseofthe CompactnessTheoremistoshowthatifthereexistarbitrarilylarge niteobjectsofsometype,thentheremustalsobeaninniteobject ofthistype. Example 9.1 WewillusetheCompactnessTheoremtoshowthat thereisaninnitecommutativegroupinwhicheveryelementisoforder 2, i.e. suchthat g g = e foreveryelement g Let LGbetherst-orderlanguagewithjusttwonon-logicalsymbols: Constantsymbol: e 2-placefunctionsymbol: Here e isintendedtonamethegroup'sidentityelementand thegroup operation.Letbethesetofsentencesof LGincluding: (1)Theaxiomsforacommutativegroup: xx e = x x 9 yx y = e x 8 y 8 zx ( y z )=( x y ) z x 8 yy x = x y (2)Asentencewhichassertsthateveryelementoftheuniverseis oforder2: xx x = e (3)Foreach n 2,asentence, n,whichassertsthatthereareat least n dierentelementsintheuniverse: x1::: 9 xn(( : x1= x2) ^ ( : x1= x3) ^^ ( : xn )Tj/F23 1 Tf0.8131 0 TD(1= xn))53

PAGE 66

549.APPLICATIONSOFCOMPACTNESSWeclaimthateverynitesubsetofissatisable.Themost directwaytoverifythisistoshowhow,givenanitesubsetof, toproduceamodel M of.Let n bethelargestintegersuchthat n2 [f 2g (Whyistheresuchan n ?)andchooseaninteger k such that2k n .Deneastructure( G; )for LGasfollows: G = fh a`j 1 ` k ij a`=0or1 g h a`j 1 ` k ih b`j 1 ` k i = h a`+ b`(mod2) j 1 ` k i Thatis, G isthesetofbinarysequencesoflength k and iscoordinatewiseadditionmodulo2ofthesesequences.Itiseasytocheckthat ( G; )isacommutativegroupwith2kelementsinwhicheveryelement hasorder2.Hence( G; ) j =,soissatisable. Sinceeverynitesubsetofissatisable,itfollowsbytheCompactnessTheoremthatissatisable.Amodelof,however,must beaninnitecommutativegroupinwhicheveryelementisoforder 2.(Tobesure,itisquiteeasytobuildsuchagroupdirectly;forexample,byusingcoordinatewiseadditionmodulo2ofinnitebinary sequences.) Problem 9.1 UsetheCompactnessTheoremtoshowthatthereis aninnite (1) bipartitegraph, (2) non-commutativegroup,and (3) eldofcharacteristic3, andalsogiveconcreteexamplesofsuchobjects. Mostapplicationsofthismethod,includingtheonesabove,are notreallyinteresting:itisusuallymorevaluable,andofteneasier,to directlyconstructexamplesoftheinniteobjectsinquestionrather thanjustshowsuchmustexist.Sometimes,though,thetechnique canbeusedtoobtainanon-trivialresultmoreeasilythanbydirect methods.We'lluseittoproveanimportantresultfromgraphtheory, Ramsey'sTheorem.Somedenitionsrst: Definition 9.1 If X isaset,letthesetofunorderedpairsof elementsof X be[ X ]2= ff a;b gj a;b 2 X and a 6 = b g .(SeeDenitionA.1.) (1)A graph isapair( V;E )suchthat V isanon-emptysetand E [ V ]2.Elementsof V arecalled vertices ofthegraphand elementsof E arecalled edges (2)A subgraph of( V;E )isapair( U;F ),where U V and F = E \ [ U ]2.

PAGE 67

9.APPLICATIONSOFCOMPACTNESS55(3)Asubgraph( U;F )of( V;E )isa clique if F =[ U ]2. (4)Asubgraph( U;F )of( V;E )isan independentset if F = ; Thatis,agraphissomecollectionofvertices,someofwhichare joinedtooneanother.Asubgraphisjustasubsetofthevertices, togetherwithalledgesjoiningverticesofthissubsetinthewholegraph. Itisacliqueifithappensthattheoriginalgraphjoinedeveryvertexin thesubgraphtoallotherverticesinthesubgraph,andanindependent setifithappensthattheoriginalgraphjoinednoneoftheverticesin thesubgraphtoeachother.Thequestionofwhenagraphmusthave acliqueorindependentsetofagivensizeisofsomeinterestinmany applications,especiallyindealingwithcolouringproblems. Theorem 9.2(Ramsey'sTheorem) Forevery n 1 thereisan integer Rnsuchthatanygraphwithatleast Rnverticeshasaclique with n verticesoranindependentsetwith n vertices. Rnisthe n thRamseynumber .Itiseasytoseethat R1=1and R2=2,but R3isalready6,and Rngrowsveryquicklyasafunction of n thereafter.Ramsey'sTheoremisfairlyhardtoprovedirectly,but thecorrespondingresultforinnitegraphsiscomparativelystraightforward. Lemma 9.3 If ( V;E ) isagraphwithinnitelymanyvertices,then ithasaninnitecliqueoraninniteindependentset. ArelativelyquickwaytoproveRamsey'sTheoremistorstprove itsinnitecounterpart,Lemma9.3,andthengetRamsey'sTheorem outofitbywayoftheCompactnessTheorem.(Ifyou'reanambitious minimalist,youcantrytodothisusingtheCompactnessTheoremfor propositionallogicinstead!) Elementaryequivalenceandnon-standardmodels. Oneof thecommonusesfortheCompactnessTheoremistoconstruct\nonstandard"modelsofthetheoriessatisedbyvariousstandardmathematicalstructures.Suchamodelsatisesallthesamerst-order sentencesasthestandardmodel,butdiersfromitinsomewaynot expressibleintherst-orderlanguageinquestion.Thisbringshome oneoftheintrinsiclimitationsofrst-orderlogic:itcan'talwaystell essentiallydierentstructuresapart.Ofcourse,weneedtodenejust whatconstitutesessentialdierence. Definition 9.2 Suppose L isarst-orderlanguageand N and M aretwostructuresfor L .Then N and M are: (1) isomorphic ,writtenas N = M ,ifthereisafunction F : j N j! j M j suchthat

PAGE 68

569.APPLICATIONSOFCOMPACTNESS(a) F is1 )Tj/F29 1 Tf1.0037 0 TD0.333 Tc[(1andonto, (b) F ( cN)= cMforeveryconstantsymbol c of L (c) F ( fN( a1;:::;ak)= fM( F ( a1) ;:::;F ( ak))forevery k -place functionsymbol f of L andelements a1;:::;ak2j N j ,and (d) PN( a1;:::;ak)holdsifandonlyif PN( F ( a1) ;:::;F ( ak)) forevery k -placerelationsymbolof L andelements a1, ..., akof j N j ; and (2) elementarilyequivalent ,writtenas N M ,ifTh( N )=Th( M ), i.e. if N j = ifandonlyif M j = foreverysentence of L Thatis,twostructuresforagivenlanguageareisomorphicifthey arestructurallyidenticalandelementarilyequivalentifnostatement inthelanguagecandistinguishbetweenthem.Isomorphicstructures areelementarilyequivalent: Proposition 9.4 Suppose L isarst-orderlanguageand N and M arestructuresfor L suchthat N = M .Then N M However,asthefollowingapplicationoftheCompactnessTheorem shows,elementarilyequivalentstructuresneednotbeisomorphic: Example 9.2 Notethat C =( N )isaninnitestructurefor L=. Expand L=to LRbyaddingaconstantsymbol crforeveryrealnumber r ,andletbethesetofsentencesof L=including everysentence ofTh( C ), i.e. suchthat C j = ,and : cr= csforeverypairofrealnumbers r and s suchthat r 6 = s Everynitesubsetofissatisable.(Why?)Thus,bytheCompactnessTheorem,thereisastructure U0for LRsatisfying,andhence Th( C ).Thestructure U obtainedbydroppingtheinterpretationsof alltheconstantsymbols crfrom U0isthenastructurefor L=which satisesTh( C ).Notethat j U j = j U0j isatleastlargeasthesetofall realnumbers R ,since U0requiresadistinctelementoftheuniverseto interpreteachconstantsymbol crof LR. SinceTh( C )isamaximallyconsistentsetofsentencesof L=by Problem8.6,itfollowsfromtheabovethat C U .Ontheotherhand, C cannotbeisomorphicto U becausetherecannotbeanontomap betweenacountableset,suchas N = j C j ,andasetwhichisatleast aslargeas R ,suchas j U j Ingeneral,themethodusedabovecanbeusedtoshowthatifa setofsentencesinarst-orderlanguagehasaninnitemodel,ithas manydierentones.In L=thatisessentiallyallthatcanhappen:

PAGE 69

9.APPLICATIONSOFCOMPACTNESS57Proposition 9.5 Twostructuresfor L=areelementarilyequivalentifandonlyiftheyareisomorphicorinnite. Problem 9.6 Let N =( N ; 0 ; 1 ;S; + ; ;E ) bethestandardstructure for LN.UsetheCompactnessTheoremtoshowthereisastructure M for LNsuchthat N N butnot N = M Notethatbecause N and M bothsatisfyTh( N ),whichismaximally consistentbyProblem8.6,thereisabsolutelynowayoftellingthem apartin LN. Proposition 9.7 Everymodelof Th( N ) whichis not isomorphic to N has (1) anisomorphiccopyof N embeddedinit, (2) aninnitenumber, i.e. onelargerthanallofthoseinthecopy of N ,and (3) aninnitedecreasingsequence. Theapparentlimitationofrst-orderlogicthatnon-isomorphic structuresmaybeelementarilyequivalentcanactuallybeuseful.A non-standardmodelmayhavefeaturesthatmakeiteasiertowork withthanthestandardmodeloneisreallyinterestedin.Sinceboth structuressatisfyexactlythesamesentences,ifoneusesthesefeatures toprovethatsomestatementexpressibleinthegivenrst-orderlanguageistrueaboutthenon-standardstructure,onegetsforfreethat itmustbetrueofthestandardstructureaswell.Aprimeexampleof thisideaistheuseofnon-standardmodelsoftherealnumberscontaininginnitesimals(numberswhichareinnitelysmallbutdierent fromzero)insomeareasofanalysis. Theorem 9.8 Let R =( R ; 0 ; 1 ; + ; ) betheeldofrealnumbers, consideredasastructurefor LF.ThenthereisamodelofTh ( R ) which containsacopyof R andinwhichthereisaninnitesimal. Thenon-standardmodelsoftherealnumbersactuallyusedinanalysisareusuallyobtainedinmoresophisticatedwaysinordertohave moreinformationabouttheirinternalstructure.Itisinterestingto notethatinnitesimalsweretheintuitionbehindcalculusforLeibniz whenitwasrstinvented,butnoonewasabletoputtheiruseona rigourousfootinguntilAbrahamRobinsondidsoin1950.

PAGE 71

HintsforChapters5{9HintsforChapter5. 5.1. TrytodisassembleeachstringusingDenition5.2.Notethat somemightbevalidtermsofmorethanoneofthegivenlanguages. 5.2. ThisissimilartoProblem1.5. 5.3. ThisissimilartoProposition1.7. 5.4. TrytodisassembleeachstringusingDenitions5.2and5.3. Notethatsomemightbevalidformulasofmorethanoneofthegiven languages. 5.5. ThisisjustlikeProblem1.2. 5.6. ThisissimilartoProblem1.5.Youmaywishtouseyour solutiontoProblem5.2. 5.7. ThisissimilartoProposition1.7. 5.8. Youmightwanttorephrasesomeofthegivenstatementsto makethemeasiertoformalize. (1)Lookupassociativityifyouneedto. (2)\Thereisanobjectsuchthateveryobjectisnotinit." (3)Thisshouldbeeasy. (4)Ditto. (5)\Anytwothingsmustbethesamething." 5.9. Ifnecessary,don'thesitatetolookupthedenitionsofthe givenstructures. (1)Readthediscussionatthebeginningofthechapter. (2)Youreallyneedonlyonenon-logicalsymbol. (3)Therearetwosortsofobjectsinavectorspace,thevectors themselvesandthescalarsoftheeld,whichyouneedtobe abletotellapart. 5.10. UseDenition5.3inthesamewaythatDenition1.2was usedinDenition1.3.59

PAGE 72

60HINTSFORCHAPTERS5{95.11. Thescopeofaquantieroughttobeacertainsubformulaof theformulainwhichthequantieroccurs. 5.12. ChecktoseewhethertheysatisfyDenition5.4. 5.13. ChecktoseewhichpairssatisfyDenition5.5. 5.14. Proceedbyinductiononthelengthof usingDenition5.3. 5.15. ThisissimilartoTheorem1.12. 5.16. ThisissimilartoTheorem1.12andusesTheorem5.15. HintsforChapter6. 6.1. Ineachcase,applyDenition6.1. (1)Thisshouldbeeasy. (2)Ditto. (3)Inventobjectswhicharecompletelydierentexceptthatthey happentohavetherightnumberoftherightkindofcomponents. 6.2. Figureouttherelevantvaluesof s ( vn)andapplyDenition 6.3. 6.3. Suppose s and r bothextendtheassignment s .Showthat s ( t )= r ( t )byinductiononthelengthoftheterm t 6.4. UnwindtheformulasusingDenition6.4togetinformalstatementswhosetruthyoucandetermine. 6.5. Unwindtheabbreviation 9 anduseDenition6.4. 6.6. UnwindeachoftheformulasusingDenitions6.4and6.5to getinformalstatementswhosetruthyoucandetermine. 6.7. ThisismuchlikeProposition6.3. 6.8. ProceedbyinductiononthelengthoftheformulausingDenition6.4andLemma6.7. 6.9. Howmanyfreevariablesdoesasentencehave? 6.10. UseDenition6.4. 6.12. UnwindthesentencesinquestionusingDenition6.4. 6.11. UseDenitions6.4and6.5;theproofissimilarinformto theproofofProposition2.9. 6.14. UseDenitions6.4and6.5;theproofissimilarinformto theproofforProblem2.10.

PAGE 73

HINTSFORCHAPTERS5{9616.15. UseDenitions6.4and6.5ineachcase,plusthemeanings ofourabbreviations. 6.17. Inonedirection,youneedtoaddappropriateobjectstoa structure;intheother,deletethem.Inbothcases,youstillhaveto verifythat)-331(isstillsatised. 6.18. Herearesomeappropriatelanguages. (1) L=(2)ModifyyourlanguageforgraphtheoryfromProblem5.9by addinga1-placerelationsymbol. (3)UseyourlanguageforgrouptheoryfromProblem5.9. (4) LFHintsforChapter7. 7.1. (1)UseDenition7.1. (2)Ditto. (3)Ditto. (4)Proceedbyinductiononthelengthoftheformula 7.2. Usethedenitionsandfactsabout j =fromChapter6. 7.3. CheckeachcaseagainsttheschemainDenition7.4.Don't forgetthatanygeneralizationofalogicalaxiomisalsoalogicalaxiom. 7.4. YouneedtoshowthatanyinstanceoftheschemasA1{A8is atautologyandthenapplyLemma7.2.Thateachinstanceofschemas A1{A3isatautologyfollowsfromProposition6.15.ForA4{A8you'll havetousethedenitionsandfactsabout j =fromChapter6. 7.5. Youmaywishtoappealtothedeductionsthatyoumadeor weregiveninChapter3. (1)TryusingA4andA6. (2)Youdon'tneedA4{A8here. (3)TryusingA4andA8. (4)A8isthekey;youmayneeditmorethanonce. (5)ThisisjustA6indisguise. 7.6. Thisisjustlikeitscounterpartforpropositionallogic. 7.7. Ditto. 7.8. Ditto. 7.9. Ditto. 7.10. Ditto.

PAGE 74

62HINTSFORCHAPTERS5{97.11. Proceedbyinductiononthelengthoftheshortestproofof from)12(. 7.12. Ditto. 7.13. Asusual,don'ttakethefollowingsuggestionsasgospel. (1)TryusingA8. (2)StartwithExample7.1. (3)StartwithpartofProblem7.5. HintsforChapter8. 8.1. ThisissimilartotheproofoftheSoundnessTheoremfor propositionallogic,usingProposition6.10inplaceofProposition3.2. 8.2. Thisissimilartoitscounterpartforprpositionallogic,Proposition4.2.UseProposition6.10insteadofProposition3.2. 8.3. Thisisjustlikeitscounterpartforpropositionallogic. 8.4. Ditto. 8.5. Ditto. 8.6. ThisisacounterparttoProblem4.6;useProposition8.2insteadofProposition4.2andProposition6.15insteadofProposition 2.4. 8.7. Thisisjustlikeitscounterpartforpropositionallogic. 8.8. Ditto 8.9. Ditto. 8.10. Thisismuchlikeitscounterpartforpropositionallogic,Theorem4.10. 8.11. UseProposition7.8. 8.12. UsetheGeneralizationTheoremfortheharddirection. 8.13. Thisisessentiallyasouped-upversionofTheorem8.10.To ensurethat C isasetofwitnessesofthemaximallyconsistentsetof sentences,enumeratealltheformulas of L0withonefreevariable andtakecareofoneateachstepintheinductiveconstruction.

PAGE 75

HINTSFORCHAPTERS5{9638.14. Toconstructtherequiredstructure, M ,proceedasfollows. Deneanequivalencerelation on C bysetting c d ifandonlyif c = d 2 ,andlet[ c ]= f a 2 C j a c g betheequivalenceclassof c 2 C .Theuniverseof M willbe M = f [ c ] j c 2 C g .Foreach k -place functionsymbol f dene fMbysetting fM([ a1] ;:::; [ ak])=[ b ]ifand onlyif fa1:::ak= b isin.Denetheinterpretationsofconstant symbolsandrelationsymbolsinasimilarway.Youneedtoshowthat allthesethingsarewell-dened,andthenshowthat M j =. 8.15. Expand)-325(toamaximallyconsistentsetofsentenceswitha setofwitnessesinasuitableextensionof L ,applyTheorem8.14,and thencutdowntheresultingstructuretoonefor L 8.16. OnedirectionisjustProposition8.2.Fortheother,use Corollary8.15. 8.17. ThisfollowsfromTheorem8.16inthesamewaythatthe CompletenessTheoremforpropositionallogicfollowedfromTheorem 4.11. 8.18. ThisfollowsfromTheorem8.16inthesamewaythatthe CompactnessTheoremforpropositionallogicfollowedfromTheorem 4.11. HintsforChapter9. 9.1. Ineachcase,applythetrickusedinExample9.1.Fordenitionsandtheconcreteexamples,consulttextsoncombinatoricsand abstractalgebra. 9.2. SupposeRamsey'sTheoremfailsforsome n .UsetheCompactnessTheoremtogetacontradictiontoLemma9.3byshowing theremustbeaninfnitegraphwithnocliqueorindependentsetof size n 9.3. Inductivelydeneasequence a0, a1,...,ofverticessothatfor every n ,eitheritisthecasethatforall k n thereisanedgejoining anto akoritisthecasethatforall k n thereisnoedgejoining anto ak.Therewillthenbeasubsequenceofthesequencewhichisan innitecliqueorasubsequencewhichisaninniteindependentset. 9.4. Thekeyistogureouthow,givenanassignmentforone structure,oneshoulddenethecorrespondingassignmentintheother structure.Afterthat,proceedbyinductionusingthedenitionof satisfaction. 9.5. Whenaretwonitestructuresfor L=elementarilyequivalent?

PAGE 76

64HINTSFORCHAPTERS5{99.6. Inasuitableexpandedlanguage,considerTh( N )togetherwith thesentences 9 x 0+ x = c 9 xS 0+ x = c 9 xSS 0+ x = c ,... 9.7. Suppose M j =Th( N )butisnotisomorphicto N (1)Considerthesubsetof j M j givenby0M, SM(0M), SM( SM(0M)), ... (2)Ifitdidn'thaveone,itwouldbeacopyof N (3)Startwithainnitenumberandworkdown. 9.8. Expand LFbythrowinginaconstantsymbolforeveryreal number,plusanextraone,andtakeitfromthere.

PAGE 77

PartIIIComputability

PAGE 79

CHAPTER10TuringMachinesOfthevariouswaystoformalizethenotionan\eectivemethod", themostcommonlyusedarethesimpleabstractcomputerscalledTuringmachines,whichwereintroducedmoreorlesssimultaneouslyby AlanTuringandEmilPostin1936.1Likemostreal-lifedigitalcomputers,Turingmachineshavetwomainparts,aprocessingunitand amemory(whichdoublesastheinput/outputdevice),whichwewill considerseparatelybeforeseeinghowtheyinteract.Thememorycan bethoughtofasaninnitetapewhichisdividedupintocellslikethe framesofamovie.TheTuringmachineproperistheprocessingunit. Ithasascannerorheadwhichcanreadfromorwritetoasinglecell ofthetape,andwhichcanbemovedtotheleftorrightonecellata time. Tapes. Tokeepthingssimple,inthischapterwewillonlyallow Turingmachinestoreadandwritethesymbols0and1.(Onesymbol percell!)Moreover,wewillallowthetapetobei nniteinonlyone direction.ThattheserestrictionsdonotaectwhataTuringmachine can,inprinciple,computefollowsfromtheresultsinthenextchapter. Definition 10.1 A tape isaninnitesequence a = a0a1a2a3::: suchthatforeachinteger i the cell ai2f 0 ; 1 g .The i thcellissaidto be blank if aiis0,and marked if aiis1. Ablanktapeisoneinwhicheverycellis0. Example 10.1 Ablanktapelookslike: 000000000000000000000000 The0thcellistheleftmostone,cell1istheoneimmediatelytothe right,cell2istheoneimmediatelytotherightofcell1,andsoon. Thefollowingisaslightlymoreexcitingtape: 0101101110001000000000000000 1Bothpapersarereprintedin[ 6 ].Post'sbriefpapergivesaparticularlylucid informaldescription.67

PAGE 80

6810.TURINGMACHINESInthiscase,cell1ismarked( i.e. containsa1),asdocells3,4,5,7, 8,and12;alltherestareblank( i.e. containa0). Problem 10.1 Writedowntapessatisfyingthefollowing. (1) Entirelyblankexceptforcells 3 12 ,and 20 (2) Entirelymarkedexceptforcells 0 2 ,and 3 (3) Entirelyblankexceptthat1025iswrittenoutinbinaryjustto therightofcell 2 TokeeptrackofwhichcelltheTuringmachine'sscannerisat,plus whichinstructiontheTuringmachineistoexecutenext,wewillusually attachadditionalinformationtoourdescriptionofthetape. Definition 10.2 A tapeposition isatriple( s;i; a ),where s and i arenaturalnumberswith s> 0,and a isatape.Givenatapeposition ( s;i; a ),wewillrefertocell i asthe scannedcell andto s asthe state Notethatif( s;i; a )isatapeposition,thenthecorrespondingTuringmachine'sscannerispresentlyreading ai(whichisoneof0or1). Conventionsfortapes. Unlessstatedotherwise,wewillassume thatallbutnitelymanycellsofanygiventapeareblank,andthatany cellsnotexplicitlydescribedordisplayedareblank.Wewillusually depictaslittleofatapeaspossibleandomitthe sweusedabove. Thus 0101101110001 representsthetapegivenintheExample10.1.Inmanycaseswewill alsouse zntoabbreviate n consecutivecopiesof z ,sothesametape couldberepresentedby 01012013031 : Similarly,if isanitesequenceofelementsof f 0 ; 1 g ,wemaywrite nforthesequenceconsistingof n copiesof stucktogetherend-to-end. Forexample,(010)3isshortfor010010010. Indisplayingtapepositionswewillusuallyunderlinethescanned cellandwrite s totheleftofthetape.Forexample,wewoulddisplay thetapepositionusingthetapefromExample10.1withcell3being scannedandstate2asfollows: 2:0101 101110001 Notethatinthisexample,thescannerisreadinga1. Problem 10.2 Usingthetapesyougaveinthecorrespondingpart ofProblem10.1,writedowntapepositionssatisfyingthefollowingconditions.

PAGE 81

10.TURINGMACHINES69(1) Cell 7 beingscannedandstate 4 (2) Cell 4 beingscannedandstate 3 (3) Cell 3 beingscannedandstate 413 Turingmachines. The\processingunit"ofaTuringmachineis justanitelistofspecicationsdescribingwhatthemachinewilldoin varioussituations.(Remember,thisisan abstract computer...)The formaldenitionmaynotseemtoamounttothisatrstglance. Definition 10.3 A Turingmachine isafunction M suchthatfor somenaturalnumber n dom( M ) f 1 ;:::;n gf 0 ; 1 g = f ( s;b ) j 1 s n and b 2f 0 ; 1 gg and ran( M ) f 0 ; 1 gf)]TJ/F29 1 Tf3.0112 0 TD0 Tc(1 ; 1 gf 1 ;:::;n g = f ( c;d;t ) j c 2f 0 ; 1 g and d 2f)]TJ/F29 1 Tf2.2283 0 TD0 Tc(1 ; 1 g and1 t n g : Notethat M doesnothavetobedenedforallpossiblepairs ( s;b ) 2f 1 ;:::;n gf 0 ; 1 g : WewillsometimesrefertoaTuringmachinesimplyasa machine orTM.If n 1isleastsuchthat M satisesthedenitionabove,we shallsaythat M isan n -stateTuringmachine andthat f 1 ;:::;n g is thesetof states of M Intuitively,wehaveaprocessingunitwhichhasanitelistofbasic instructions,thestates,whichitcanexecute.Givenacombinationof currentstateandthesymbolmarkedinthecurrentlyscannedcellof thetape,thelistspecies asymboltobewritteninthecurrentlyscannedcell,overwritingthesymbolbeingread,then amoveofthescanneronecelltotheleftorright,andthen thenextinstructiontobeexecuted. Thatis, M ( s;c )=( b;d;t )meansthatifourmachineisinstate s ( i.e. executinginstructionnumber s )andthescannerispresentlyreadinga c incell i ,thenthemachine M should set ai= b ( i.e. write b insteadof c inthescannedcell),then movethescannerto ai + d( i.e. moveonecellleftif d = )Tj/F29 1 Tf0.7829 0 TD0.293 Tc[(1and onecellrightif d =1),andthen enterstate t ( i.e. gotoinstruction t ).

PAGE 82

7010.TURINGMACHINESIfourprocessorisn'tequippedtohandleinput c forinstruction s ( i.e. M ( s;c )isundened),thenthecomputationinprogresswillsimply stopdeador halt Example 10.2 WewillusuallypresentTuringmachinesinthe formofatable,witharowforeachstateandacolumnforeachpossible entryinthescannedcell.Insteadof )Tj/F29 1 Tf0.7829 0 TD-0.003 Tc[(1and1,wewillusuallyuse L and R whenwritingsuchtablesinordertomakethemmorereadable. Thusthetable M 0 1 1 1 R 2 0 R 1 2 0 L 2 denesaTuringmachine M withtwostatessuchthat M (1 ; 0)= (1 ; 1 ; 2), M (1 ; 1)=(0 ; 1 ; 1),and M (2 ; 0)=(0 ; )Tj/F29 1 Tf0.7829 0 TD(1 ; 2),but M (2 ; 1)is undened.Inthiscase M hasdomain f (1 ; 0) ; (1 ; 1) ; (2 ; 0) g andrange f (1 ; 1 ; 2) ; (0 ; 1 ; 1) ; (0 ; )Tj/F29 1 Tf0.7829 0 TD(1 ; 2) g .Ifthemachine M werefacedwiththe tapeposition 1:0100 1111 ; itwould,sinceitwasinstate1whilescanningacellcontaining0, writea1inthescannedcell, movethescanneronecelltotheright,and gotostate2. Thiswouldgivethenewtapeposition 2:01011 111 : Since M doesn'tknowwhattodooninput1instate2,itwouldthen halt,endingthecomputation. Problem 10.3 Ineachcase,givethetableofaTuringmachine M meetingthegivenrequirement. (1) M hasthreestates. (2) M changes 0 to 1 and viceversa inanycellitscans. (3) M isassimpleaspossible.Howmanypossibilitiesarethere here? Computations. Informally,acomputationisasequenceofactions ofamachine M onatapeaccordingtotherulesabove,startingwith instruction1andthescanneratcell0onthegiventape.Acomputation ends(or halts )whenandifthemachineencountersatapeposition whichitdoesnotknowwhattodoinIfitneverhalts,anddoesn't crash byrunningthescannerotheleftendofthetape2either,the 2Bewarnedthatmostauthorsprefertotreatrunningthescannerotheleft endofthetapeasbeingjustanotherwayofhalting.Haltingwiththescanner

PAGE 83

10.TURINGMACHINES71computationwillneverend.Theformaldenitionmakesallthisseem muchmoreformidable. Definition 10.4 Suppose M isaTuringmachine.Then: If p =( s;i; a )isatapepositionand M ( s;ai)=( b;d;t )is dened,then M ( p )=( t;i + d; a0)isthe successortapeposition where a0 i= b and a0 j= ajwhenever j 6 = i A partialcomputation withrespectto M isasequence p1p2::: oftapepositionssuchthat p` +1= M ( p`)foreach `
PAGE 84

7210.TURINGMACHINESProblem 10.4 Givethe(partial)computationoftheTuringmachine M ofExample10.2startinginstate 1 withtheinputtape: (1)0 0 (2)11 0 (3) Thetapewithallcellsmarkedandcell 5 beingscanned. Problem 10.5 ForwhichpossibleinputtapesdoesthepartialcomputationoftheTuringmachine M ofExample10.2eventuallyterminate?Explainwhy. Problem 10.6 FindaTuringmachinethat(eventually!)llsa blankinputtapewiththepattern 010110001011000101100 ::: Problem 10.7 FindaTuringmachinethatneverhalts(orcrashes), nomatterwhatisonthetape. BuildingTuringMachines. Itwillbeusefullaterontohavea libraryofTuringmachinesthatmanipulateblocksof1sinvariousways, andveryusefultobeabletocombinemachinespeformingsimplertasks toperformmorecomplexones. Example 10.4 TheTuringmachine S givenbelowisintendedto haltwithoutput01k0 oninput0 1k,if k> 0;thatis,itjustmovespast asingleblockof1swithoutdisturbingit. S 0 1 1 0 R 2 2 1 R 2 Tracethismachine'scomputationon,say,input0 13toseehowitworks. Thefollowingmachine,whichisitselfavariationon S ,doesthe reverseofwhat S does:oninput01k0 ithaltswithoutput0 1k. T 0 1 1 0 L 2 2 1 L 2 Wecancombine S and T intoamachine U whichdoesnothingto ablockof1s:giveninput0 1kithaltswithoutput0 1k.(Ofcourse,a betterwaytodonothingistoreallydonothing!) T 0 1 1 0 R 2 2 0 L 3 1 R 2 3 1 L 3 Notehowthestatesof T hadtoberenumberedtomakethecombinationwork.

PAGE 85

10.TURINGMACHINES73Example 10.5 TheTuringmachine P givenbelowisintendedto moveablockof1s:oninput0 0n1k,where n 0and k> 0,ithalts withoutput0 1k. P 0 1 1 0 R 2 2 1 R 3 1 L 8 3 0 R 3 0 R 4 4 0 R 7 1 L 5 5 0 L 5 1 R 6 6 1 R 3 7 0 L 7 1 L 8 8 1 L 8 Trace P 'scomputationon,say,input0 0313toseehowitworks.Trace itoninputs0 12and0 021aswelltoseehowithandlescertainspecial cases. Note. InbothExamples10.4and10.5wedonotreallycarewhat thegivenmachinesdoonotherinputs,solongastheyperformas intendedontheparticularinputsweareconcernedwith. Problem 10.8 Wecancombinethemachine P ofExample10.5 withthemachines S and T ofExample10.4togetthefollowingmachine. R 0 1 1 0 R 2 2 0 R 3 1 R 2 3 1 R 4 1 L 9 4 0 R 4 0 R 5 5 0 R 8 1 L 6 6 0 L 6 1 R 7 7 1 R 4 8 0 L 8 1 L 9 9 0 L 10 1 L 9 10 1 L 10 Whattaskinvolvingblocksof 1 sisthismachineintendedtoperform? Problem 10.9 Ineachcase,deviseaTuringmachinethat: (1) Haltswithoutput 0 14oninput 0 (2) Haltswithoutput 01n0 oninput 0 0n1 (3) Haltswithoutput 0 12 noninput 0 1n. (4) Haltswithoutput 0 (10)noninput 0 1n. (5) Haltswithoutput 0 1moninput 0 1n01mwhenever n;m> 0 .

PAGE 86

7410.TURINGMACHINES(6) Haltswithoutput 0 1m01n01koninput 0 1n01k01m,if n;m;k> 0 (7) Haltswithoutput 0 1m01n01k01m01n01koninput 0 1m01n01k, if n;m;k> 0 (8) Oninput 0 1m01n,where m;n> 0 ,haltswithoutput 0 1 if m 6 = n andoutput 0 11 if m = n Itdoesn'tmatterwhatthemachineyoudeneineachcasemaydoon otherinputs,solongasitdoestherightthingonthegivenone(s).

PAGE 87

CHAPTER11VariationsandSimulationsThedenitionofaTuringmachinegiveninChapter10isarbitrary inanumberofways,amongthemtheuseofthesymbols0and1,a singleread-writescanner,andasingleone-wayinnitetape.Onecould furtherrestrictthedenitionwegavebyallowing themachinetomovethescanneronlytooneofleftorrightin eachstate, orexpanditbyallowingtheuseof anynitealphabetofatleasttwosymbols, separatereadandwriteheads, multipleheads, two-wayinnitetapes, multipletapes, two-andhigher-dimensionaltapes, orvariouscombinationsofthese,amongmanyotherpossibilities.We willconstructanumberofTuringmachinesthatsimulateotherswith additionalfeatures;thiswillshowthatvariousofthemodications mentionedabovereallychangewhatthemachinescancompute.(In fact,noneofthemturnouttodoso.) Example 11.1 ConsiderthefollowingTuringmachine: M 0 1 1 1 R 2 0 L 1 2 0 L 2 1 L 1 Notethatinstate1,thismachinemaymovethescannertoeithertheleftortheright,dependingonthecontentsofthecellbeing scanned.WewillconstructaTuringmachineusingthesamealphabetthatemulatestheactionof M onanyinput,butwhichmovesthe scannertoonlyoneofleftorrightineachstate.Thereisnoproblem withstate2of M ,bytheway,becauseinstate2 M alwaysmovesthe scannertotheleft. Thebasicideaistoaddsomestatesto M whichreplacepartofthe descriptionofstate1.75

PAGE 88

7611.VARIATIONSANDSIMULATIONSM0 0 1 1 1 R 2 0 R 3 2 0 L 2 1 L 1 3 0 L 4 1 L 4 4 0 L 1 Thismachineisjustlike M exceptthatinstate1withinput1, insteadofmovingthescannertotheleftandgoingtostate1,the machinemovesthescannertotherightandgoestothenewstate3. States3and4donothingbetweenthemexceptmovethescannertwo cellstotheleftwithoutchangingthetape,thusputtingitwhere M wouldhaveputit,andthenenteringstate1,as M wouldhave. Problem 11.1 Comparethecomputationsofthemachines M and M0ofExample11.1ontheinputtapes (1)0 (2)011 andexplainwhyisitnotnecessarytodene M0forstate 4 oninput 1 Problem 11.2 Explainindetailhow,givenanarbitraryTuring machine M ,onecanconstructamachine M0thatsimulateswhat M doesonanyinput,butwhichmovesthescanneronlytooneofleftor rightineachstate. Itshouldbeobviousthattheconverse,simulatingaTuringmachine thatmovesthescanneronlytooneofleftorrightineachstatebyan ordinaryTuringmachine,iseasytothepointofbeingtrivial. Itisoftenveryconvenienttoaddadditionalsymbolstothealphabet thatTuringmachinesarepermittedtouse.Forexample,onemight wanttohavespecialsymbolstouseasplacemarkersinthecourseof acomputation.(Foramorespectacularapplication,seeExample11.3 below.)Itisconventionaltoinclude0,the\blank"symbol,inan alphabetusedbyaTuringmachine,butotherwiseanynitesetof symbolsgoes. Problem 11.3 HowdoyouneedtochangeDenitions10.1and 10.3todeneTuringmachinesusinganitealphabet ? Whileallowingarbitaryalphabetsisoftenconvenientwhendesigningamachinetoperformsometask,itdoesn'tactuallychangewhat can,inprinciple,becomputed. Example 11.2 Considerthemachine W belowwhichusesthe alphabet f 0 ;x;y;z g W 0 x y z 1 0 R 1 xR 1 0 L 2 zR 1

PAGE 89

11.VARIATIONSANDSIMULATIONS77Forexample,oninput0 xzyxy W willeventuallyhaltwithoutput 0 xz 0 xy .Notethatstate2of W isusedonlytohalt,sowedon'tbother tomakearowforitonthetable. Tosimulate W withamachine Z usingthealphabet f 0 ; 1 g ,werst havetodecidehowtorepresent W 'stape.Wewillusethefollowing scheme,arbitrarilychosenamonganumberofalternatives.Everycell of W 'stapewillberepresentedbytwoconsecutivecellsof Z 'stape, witha0on W 'stapebeingstoredas00on Z 's,an x as01,a y as10, anda z as11.Thus,if W hadinputtape0 xzyxy ,thecorresponding inputtapefor Z wouldbe0 00111100110. Designingthemachine Z thatsimulatestheactionof W onthe representationof W 'stapeisalittletricky.Intheexamplebelow, eachstateof W correspondstoa\subroutine"ofstatesof Z which betweenthemreadtheinformationineachrepresentationofacellof W 'stapeandtakeappropriateaction. Z 0 1 1 0 R 2 1 R 3 2 0 L 4 1 L 6 3 0 L 8 1 L 13 4 0 R 5 5 0 R 1 6 0 R 7 7 1 R 1 8 0 R 9 9 0 L 10 10 0 L 11 11 0 L 12 1 L 12 12 0 L 15 1 L 15 13 1 R 14 14 1 R 1 States1{3of Z readtheinputforstate1of W andthenpassoncontrol tosubroutineshandlingeachentryforstate1in W 'stable.Thusstates 4{5of Z takeactionforstate1of W oninput0,states6{7of Z take actionforstate1of W oninput x ,states8{12of Z takeactionfor state1of W oninput y ,andstates13{14takeactionforstate1of W oninput z .State15of Z doeswhatstate2of W does:nothingbut halt. Problem 11.4 Tracethe(partial)computationsof W ,andtheir counterpartsfor Z ,fortheinput 0 xzyxy for W .Whyisthesubroutine forstate 1 of W oninput y somuchlongerthantheothers?Howmuch canyousimplifyit?

PAGE 90

7811.VARIATIONSANDSIMULATIONSProblem 11.5 GivenaTuringmachine M withanarbitraryalphabet ,explainindetailhowtoconstructamachine N withalphabet f 0 ; 1 g thatsimulates M Doingtheconverseofthisproblem,simulatingaTuringmachine withalphabet f 0 ; 1 g byoneusinganarbitraryalphabet,isprettyeasy. TodeneTuringmachineswithtwo-wayinnitetapesweneedonly changeDenition10.1:insteadofhavingtapes a = a0a1a2::: indexed by N ,weletthembe b = :::b)Tj/F23 1 Tf0.8131 0 TD(2b)Tj/F23 1 Tf0.8131 0 TD(1b0b1b2::: indexedby Z .Indening computationsformachineswithtwo-wayinnitetapes,weadoptthe sameconventionsthatwedidformachineswithone-wayinnitetapes, suchashavingthescannerstartoscanningcell0ontheinputtape. Theonlyrealdierenceisthatamachinewithatwo-wayinnitetape cannotcrashbyrunningotheleftendofthetape;itcanonlystop byhalting. Example 11.3 Considerthefollowingtwo-wayinnitetapeTuring machinewithalphabet f 0 ; 1 g : T 0 1 1 1 L 1 0 R 2 2 0 R 2 1 L 1 Toemulate T withaTuringmachine O thathasaone-wayinnite tape,weneedtodecidehowtorepresentatwo-wayinnitetapeona one-wayinnitetape.Thisiseasiertodoifweallowourselvestouse analphabetfor O otherthan f 0 ; 1 g ,chosenwithmaliceaforethought: f0 S;1 S;0 0;0 1;1 0;1 1g Wecannowrepresentthetape a = :::a)Tj/F23 1 Tf0.8131 0 TD(2a)Tj/F23 1 Tf0.8131 0 TD(1a0a1a2::: for T bythe tape a0=a 0 S a 1 a )Tj/F10 1 Tf0.9637 0 TD(1 a 2 a )Tj/F10 1 Tf0.9637 0 TD(2::: for O .Ineect,thistrickallowsustosplit O 's tapeintotwotracks,eachofwhichaccomodateshalfofthetapeof T Todene O ,wespliteachstateof T intoapairofstatesfor O oneforthelowertrackandonefortheuppertrack.Onemusttake caretokeepvariousdetailsstraight:when O changesa\cell"onone track,itshouldnotchangethecorresponding\cell"ontheothertrack; directionsarereversedonthelowertrack;onehasto\turnacorner" movingpastcell0;andsoon. O 0 0 S 0 0 0 1 1 S 1 0 1 1 1 1 0L 1 1 SR 3 1 0L 1 1 1L 1 0 SR 2 0 0R 2 0 1R 2 2 0 0R 2 0 SR 2 0 0R 2 0 1R 2 1 SR 3 1 0L 1 1 1L 1 3 0 1R 3 1 SR 3 0 1R 3 0 0L 4 0 SR 2 1 1R 3 1 0L 4 4 0 0L 4 0 SR 2 0 0L 4 0 1R 3 1 SR 3 1 0L 4 1 1R 3

PAGE 91

11.VARIATIONSANDSIMULATIONS79States1and3aretheupper-andlower-trackversions,respectively, of T 'sstate1;states2and4aretheupper-andlower-trackversions, respectively,of T 'sstate2.Weleaveittothereadertocheckthat O actuallydoessimulate T ... Problem 11.6 Tracethe(partial)computationsof T ,andtheir counterpartsfor O ,foreachofthefollowinginputtapesfor T : (1)0 ( i.e. ablanktape) (2)10 (3) ::: 1111 111 ::: ( i.e. everycellmarkedwith 1 ) Problem 11.7 Explainindetailhow,givenaTuringmachine N withalphabet andatwo-wayinnitetape,onecanconstructaTuring machine P withanone-wayinnitetapethatsimulates N Problem 11.8 Explainindetailhow,givenaTuringmachine P withalphabet andanone-wayinnitetape,onecanconstructaTuringmachine N withatwo-wayinnitetapethatsimulates P Combiningthetechniqueswe'veusedsofar,wecouldsimulateany Turingmachinewithatwo-wayinnitetapeandarbitraryalphabetby aTuringmachinewithaone-wayinnitetapeandalphabet f 0 ; 1 g Problem 11.9 GiveaprecisedenitionforTuringmachineswith twotapes.Explainhow,givenanysuchmachine,onecouldconstruct asingle-tapemachinetosimulateit. Problem 11.10 GiveaprecisedenitionforTuringmachineswith two-dimensionaltapes.Explainhow,givenanysuchmachine,one couldconstructasingle-tapemachinetosimulateit. Theseresults,andotherslikethem,implythatnoneofthevariant typesofTuringmachinesmentionedatthestartofthischapterdier essentiallyinwhattheycan,inprinciple,compute. InChapter14wewillconstructaTuringmachinethatcansimulate any (standard)Turingmachine.

PAGE 93

CHAPTER12ComputableandNon-ComputableFunctionsAlotofcomputationalproblemsintherealworldhavetodowith doingarithmetic,andanynotionofcomputationthatcan'tdealwith arithmeticisunlikelytobeofgreatuse. Notationandconventions. Tokeepthingsassimpleaspossible,wewillsticktocomputationsinvolvingthe naturalnumbers i.e. thenon-negativeintegers,thesetofwhichisusuallydenotedby N = f 0 ; 1 ; 2 ;::: g ..Thesetofall k -tuples( n1;:::;nk)ofnaturalnumbersisdenotedby Nk.Forallpracticalpurposes,wemaytake N1to be N byidentifyingthe1-tuple( n )withthenaturalnumber n For k 1, f isa k -placefunction (fromthenaturalnumberstothe naturalnumbers),oftenwrittenas f : Nk! N ,ifitassociatesavalue, f ( n1;:::;nk),toeach k -tuple( n1;n2;:::;nk) 2 Nk.Strictlyspeaking, thoughwewillfrequentlyforgettobeexplicitaboutit,wewilloften beworkingwith k -place partialfunctions whichmightnotbedened forallthe k -tuplesin Nk.If f isa k -placepartialfunction,the domain of f istheset dom( f )= f ( n1;:::;nk) 2 Nkj f ( n1;:::;nk)isdened g : Similarly,the range of f istheset ran( f )= f f ( n1;:::;nk) 2 N j ( n1;:::;nk) 2 dom( f ) g : Insubsequentchapterswewillalsoworkwithrelationsonthenaturalnumbers.Recallthata k -placerelation on N isformallyasubset P of Nk; P ( n1;:::;nk)is true if( n1;:::;nk) 2 P and false otherwise. Inparticular,a1-placerelationisreallyjustasubsetof N Relationsandfunctionsarecloselyrelated.Alloneneedstoknow abouta k -placefunction f canbeobtainedfromthe( k +1)-place relation Pfgivenby Pf( n1;:::;nk;nk +1) () f ( n1;:::;nk)= nk +1:81

PAGE 94

8212.COMPUTABLEANDNON-COMPUTABLEFUNCTIONSSimilarly,alloneneedstoknowaboutthe k -placerelation P canbe obtainedfromits characteristicfunction : P( n1;:::;nk)= ( 1if P ( n1;:::;nk)istrue; 0if P ( n1;:::;nk)isfalse. Thebasicconventionforrepresentingnaturalnumbersonthetape ofastandardTuringmachineisaslightvariationof unarynotation : n isrepresentedby1n +1.(Whywouldusing1nbeabadidea?)A k -tuple ( n1;n2;:::;nk) 2 N willberepresentedby1n1+101n2+10 ::: 01nk+1, i.e. withtherepresentationsoftheindividualnumbersseparatedby0s. Thisschemeisinecientinitsuseofspace|comparedtobinary notation,forexample|butitissimpleandcanbeimplementedon Turingmachinesrestrictedtothealphabet f 1 g Turingcomputablefunctions. Withsuitableconventionsfor representingtheinputandoutputofafunctiononthenaturalnumbers onthetapeofaTuringmachineinhand,wecandenewhatitmeans forafunctiontobecomputablebyaTuringmachine. Definition 12.1 A k -placefunction f is Turingcomputable ,or just computable ,ifthereisaTuringmachine M suchthatforany k -tuple( n1;:::;nk) 2 dom( f )thecomputationof M withinputtape 0 1n1+101n2+1::: 01nk+1eventuallyhaltswithoutputtape0 1f ( n1;:::;nk)+1. Suchamachine M issaidto compute f NotethatforaTuringmachine M tocomputeafunction f M needonlydotherightthingontherightkindofinput:what M does inothersituationsdoesnotmatter.Inparticular,itdoesnotmatter what M mightdowith k -tuplewhichisnotinthedomainof f Example 12.1 Theidentityfunction iN: N N i.e. iN( n )= n iscomputable.Itiscomputedby M = ; ,theTuringmachinewithan emptytablethatdoesabsolutelynothingonanyinput. Example 12.2 Theprojectionfunction 2 1: N2! N givenby 2 1( n;m )= n iscomputedbytheTuringmachine: P2 1 0 1 1 0 R 2 2 0 R 3 1 R 2 3 0 L 4 0 R 3 4 0 L 4 1 L 5 5 1 L 5

PAGE 95

12.COMPUTABLEANDNON-COMPUTABLEFUNCTIONS83P2 1actsasfollows:itmovestotherightpasttherstblockof1s withoutdisturbingit,erasesthesecondblockof1s,andthenreturns totheleftofrstblockandhalts. Theprojectionfunction 2 2: N2! N givenby 2 2( n;m )= m isalso computable:theTuringmachine P ofExample10.5doesthejob. Problem 12.1 FindTuringmachinesthatcomputethefollowing functionsandexplainhowtheywork. (1) O ( n )=0 (2) S ( n )= n +1 (3) Sum ( n;m )= n + m (4) Pred ( n )= ( n )Tj/F29 1 Tf1.0037 0 TD(1 n 1 0 n =0 (5) Diff ( n;m )= ( n )Tj/F21 1 Tf1.0037 0 TD0.99 Tc(mn m 0 n
PAGE 96

8412.COMPUTABLEANDNON-COMPUTABLEFUNCTIONSNotethatthereareonlynitelymanypossible n -stateentriesinthe busybeavercompetitionbecausethereareonlynitelymany( n +1)stateTuringmachineswithalphabet f 1 g .Sincethereisatleastone n -stateentryinthebusybeavercompetitionforevery n 0,itfollows that( n )iswell-denedforeach n 2 N Example 12.3 M = ; isthe only 0-stateentryinthebusybeaver competition,so(0)=0. Example 12.4 Themachine P givenby P 0 1 1 1 R 2 1 L 2 2 1 L 1 1 L 3 isa2-stateentryinthebusybeavercompetitionwithascoreof4,so (2) 4. Thefunctiongrowsextremelyquickly.Itisknownthat(0)=0, (1)=1,(2)=4,(3)=6,and(4)=13.Thevalueof(5)is stillunknown,butmustbequitelarge.1Problem 12.3 Showthat: (1) The 2 -stateentrygiveninExample12.4actuallyscores 4 (2)(1)=1 (3)(3) 6 (4)( n ) < ( n +1) forevery n 2 N Problem 12.4 Deviseashigh-scoring 4 -and 5 -stateentriesinthe busybeavercompetitionasyoucan. Theseriouspointofthebusybeavercompetitionisthatthefunctionis not aTuringcomputablefunction. Proposition 12.5 isnotcomputablebyanyTuringmachine. Anyoneinterestedinlearningmoreaboutthebusybeavercompetitionshouldstartbyreadingthepaper[ 16 ]inwhichitwasrst introduced. Buildingmorecomputablefunctions. Oneofthemostcommonmethodsforassemblingfunctionsfromsimpleronesinmanyparts ofmathematicsiscomposition.Itturnsoutthatcompositionsofcomputablefunctionsarecomputable. 1Thebestscoreknowntotheauthorbya5-stateentryinthebusybeaver competitionis4098.Oneofthetwomachinesachievingthisscoredoessoina computationthattakesover40millionsteps!Theotherrequiresonly11millionor so...

PAGE 97

12.COMPUTABLEANDNON-COMPUTABLEFUNCTIONS85Definition 12.3 Supposethat m;k 1, g isan m -placefunction, and h1,..., hmare k -placefunctions.Thenthe k -placefunction f is saidtobeobtainedfrom g h1,..., hmby composition ,writtenas f = g ( h1;:::;hm) ; ifforall( n1;:::;nk) 2 Nk, f ( n1;:::;nk)= g ( h1( n1;:::;nk) ;:::;hm( n1;:::;nk)) : Example 12.5 Theconstantfunction c1 1,where c1 1( n )=1forall n ,canbeobtainedbycompositionfromthefunctions S and O .For any n 2 N c1 1( n )=( S O )( n )= S ( O ( n ))= S (0)=0+1=1 : Problem 12.6 Suppose k 1 and a 2 N .Usecomposition todenetheconstantfunction ck a,where ck a( n1;:::;nk)= a forall ( n1;:::;nk) 2 Nk,fromfunctionsalreadyknowntobecomputable. Proposition 12.7 Supposethat 1 k 1 m g isaTuring computable m -placefunction,and h1,..., hmareTuringcomputable k -placefunctions.Then g ( h1;:::;hm) isalsoTuringcomputable. Startingwithasmallsetofcomputablefunctions,andapplying computableways(suchascomposition)ofbuildingfunctionsfromsimplerones,wewillbuildupausefulcollectionofcomputablefunctions. Thiswillalsoprovideacharacterizationofcomputablefunctionswhich doesnotmentionanytypeofcomputingdevice. The\smallsetofcomputablefunctions"thatwillbethefundamentalbuildingblocksisinniteonlybecauseitincludesalltheprojection functions. Definition 12.4 Thefollowingarethe initialfunctions : O ,the1-placefunctionsuchthat O ( n )=0forall n 2 N ; S ,the1-placefunctionsuchthat S ( n )= n +1forall n 2 N ; and, foreach k 1and1 i k k i,the k -placefunctionsuch that k i( n1;:::;nk)= niforall( n1;:::;nk) 2 Nk. O isoftenreferredtoasthe zerofunction S isthe successorfunction andthefunctions k iarecalledthe projectionfunctions Notethat 1 1isjusttheidentityfunctionon N Wehavealreadyshown,inProblem12.1,thatalltheinitialfunctionsarecomputable.ItfollowsfromProposition12.7thateveryfunctiondenedfromtheinitialfunctionsusingcomposition(anynumber oftimes)iscomputabletoo.Sinceonecanbuildrelativelyfewfunctionsfromtheinitialfunctionsusingonlycomposition...

PAGE 98

8612.COMPUTABLEANDNON-COMPUTABLEFUNCTIONSProposition 12.8 Suppose f isa 1 -placefunctionobtainedfrom theinitialfunctionsbynitelymanyapplicationsofcomposition.Then thereisaconstant c 2 N suchthat f ( n ) n + c forall n 2 N ...inthenextchapterwewilladdothermethodsofbuildingfunctionstoourrepertoirethatwillallowustobuildallcomputablefunctionsfromtheinitialfunctions.

PAGE 99

CHAPTER13RecursiveFunctionsWewilladdtwoothermethodsofbuildingcomputablefunctions fromcomputablefunctionstocomposition,andshowthatonecanuse thethreemethodstoconstructallcomputablefunctionson N fromthe initialfunctions. Primitiverecursion. Thesecondofourmethodsissimplycalled recursioninmostpartsofmathematicsandcomputerscience.Historically,theterm\primitiverecursion"hasbeenusedtodistinguish itfromtheotherrecursivemethodofdeningfunctionsthatwewill consider,namelyunboundedminimalization....Primitiverecursion boilsdowntodeningafunctioninductively,usingdierentfunctions totelluswhattodoatthebaseandinductivesteps.Togetherwith composition,itsucestobuildupjustaboutallfamiliararithmetic functionsfromtheinitialfunctions. Definition 13.1 Supposethat k 1, g isa k -placefunction,and h isa k +2-placefunction.Let f bethe( k +1)-placefunctionsuch that (1) f ( n1;:::;nk; 0)= g ( n1;:::;nk)and (2) f ( n1;:::;nk;m +1)= h ( n1;:::;nk;m;f ( n1;:::;nk;m )) forevery( n1;:::;nk) 2 Nkand m 2 N .Then f issaidtobeobtained from g and h by primitiverecursion Thatis,theinitialvaluesof f aregivenby g ,andtherestaregiven by h operatingonthegiveninputandtheprecedingvalueof f Forastart,primitiverecursionandcompositionletusdeneadditionandmultiplicationfromtheinitialfunctions. Example 13.1 .Sum ( n;m )= n + m isobtainedbyprimitiverecursionfromtheinitialfunction 1 1andthecomposition S 3 3ofinitial functionsasfollows: Sum ( n; 0)= 1 1( n ); Sum ( n;m +1)=( S 3 3)( n;m; Sum ( n;m )). Toseethatthisworks,onecanproceedbyinductionon m :87

PAGE 100

8813.RECURSIVEFUNCTIONSAtthebasestep, m =0,wehave Sum ( n; 0)= 1 1( n )= n = n +0 : Assumethat m 0and Sum ( n;m )= n + m .Then Sum ( n;m +1)=( S 3 3)( n;m; Sum ( n;m )) = S ( 3 3( n;m; Sum ( n;m ))) = S ( Sum ( n;m )) = Sum ( n;m )+1 = n + m +1 ; asdesired. Asadditionistothesuccessorfunction,somultiplicationisto addition. Example 13.2 .Mult ( n;m )= nm isobtainedbyprimitiverecursionfrom O and Sum ( 3 3;3 1): Mult ( n; 0)= O ( n ); Mult ( n;m +1)=( Sum ( 3 3;3 1))( n;m; Mult ( n;m )). Weleaveittothereadertocheckthatthisworks. Problem 13.1 Usecompositionandprimitiverecursiontoobtain eachofthefollowingfunctionsfromtheinitialfunctionsorotherfunctionsalreadyobtainedfromtheinitialfunctions. (1) Exp ( n;m )= nm(2) Pred ( n ) (denedinProblem12.1) (3) Diff ( n;m ) (denedinProblem12.1) (4) Fact ( n )= n Proposition 13.2 Suppose k 1 g isaTuringcomputable k placefunction,and h isaTuringcomputable ( k +2) -placefunction.If f isobtainedfrom g and h byprimitiverecursion,then f isalsoTuring computable. Primitiverecursivefunctionsandrelations. Thecollectionof functionswhichcanbeobtainedfromtheinitialfunctionsby(possibly repeatedly)usingcompositionandprimitiverecursionisusefulenough tohaveaname. Definition 13.2 Afunction f is primitiverecursive ifitcanbe denedfromtheinitialfunctionsbynitelymanyapplicationsofthe operationsofcompositionandprimitiverecursion. Sowealreadyknowthatalltheinitialfunctions,addition,and multiplication,amongothers,areprimitiverecursive.

PAGE 101

13.RECURSIVEFUNCTIONS89Problem 13.3 Showthateachofthefollowingfunctionsisprimitiverecursive. (1) Forany k 0 andprimitiverecursive ( k +1) -placefunction g ,the ( k +1) -placefunction f givenby f ( n1;:::;nk;m )=m i =0g ( n1;:::;nk;i ) = g ( n1;:::;nk; 0) ::: g ( n1;:::;nk;m ) : (2) Foranyconstant a 2 N f a g( n )= ( 0 n 6 = a 1 n = a: (3) h ( n1;:::;nk)= ( f ( n1;:::;nk)( n1;:::;nk) 6 =( c1;:::;ck) a ( n1;:::;nk)=( c1;:::;ck) ,if f isaprimitiverecursive k -placefunctionand a;c1;:::;ck2 N areconstants. Theorem 13.4 EveryprimitiverecursivefunctionisTuringcomputable. Bewarned,however,thattherearecomputablefunctionswhichare notprimitiverecursive. Wecanextendtheideaof\primitiverecursive"torelationsbyusing theircharacteristicfunctions. Definition 13.3 Suppose k 1.A k -placerelation P Nkis primitiverecursive ifitscharacteristicfunction P( n1;:::;nk)= ( 1( n1;:::;nk) 2 P 0( n1;:::;nk) = 2 P isprimitiverecursive. Example 13.3 P = f 2 g N isprimitiverecursivesince f 2 gis recursivebyProblem13.3. Problem 13.5 Showthatthefollowingrelationsandfunctionsare primitiverecursive. (1) : P i.e. Nkn P ,if P isaprimitiverecursive k -placerelation. (2) P Q i.e. P [ Q ,if P and Q areprimitiverecursive k -place relations. (3) P ^ Q i.e. P \ Q ,if P and Q areprimitiverecursive k -place relations. (4) Equal ,where Equal ( n;m ) () n = m (5) h ( n1;:::;nk;m )= Pm i =0g ( n1;:::;nk;i ) ,forany k 0 and primitiverecursive ( k +1) -placefunction g (6) Div ,where Div ( n;m ) () n j m .

PAGE 102

9013.RECURSIVEFUNCTIONS(7) IsPrime ,where IsPrime ( n ) () n isprime. (8) Prime ( k )= pk,where p0=1 and pkisthe k thprimeif k 1 (9) Power ( n;m )= k ,where k 0 ismaximalsuchthat nkj m (10) Length ( n )= ` ,where ` ismaximalsuchthat p`j n (11) Element ( n;i )= ni,if n = pn11:::pnkk(and ni=0 if i>k ). (12) Subseq ( n;i;j )= ( pniipni +1i +1:::pnjjif 1 i j k 0 otherwise ,whenever n = pn11:::pnkk. (13) Concat ( n;m )= pn11:::pnkkpm1k +1:::pmlk + `,if n = pn11:::pnkkand m = pm11:::pm``. PartsofProblem13.5giveustoolsforrepresentingnitesequences ofintegersbysingleintegers,aswellassometoolsformanipulating theserepresentations.Thisletsusreduce,inprinciple,allproblems involvingprimitiverecursivefunctionsandrelationstoproblemsinvolvingonly1-placeprimitiverecursivefunctionsandrelations. Theorem 13.6 A k -place g isprimitiverecursiveifandonlyif the 1 -placefunction h givenby h ( n )= g ( n1;:::;nk) if n = pn11:::pnkkisprimitiverecursive. Note. Itdoesn'tmatterwhatthefunction h maydoonan n which doesnotrepresentasequenceoflength k Corollary 13.7 A k -placerelation P isprimitiverecursiveifand onlyifthe 1 -placerelation P0isprimitiverecursive,where ( n1;:::;nk) 2 P () pn11:::pnkk2 P0: Acomputablebutnotprimitiverecursivefunction. While primitiverecursionandcompositiondonotquitesucetobuildall Turingcomputablefunctionsfromtheinitialfunctions,theyarepowerfulenoughthatspeciccounterexamplesarenotallthateasytond. Example 13.4(Ackerman'sFunction) Denethe2-placefunction A fromasfollows: A (0 ;` )= S ( ` ) A ( S ( k ) ; 0)= A ( k; 1) A ( S ( k ) ; S ( ` ))= A ( k; A ( S ( k ) ;` )) Given A ,denethe1-placefunction by ( n )= A ( n;n ). Itisn'ttoohardtoshowthat A ,andhencealso ,areTuring computable.However,thoughittakesconsiderableeorttoproveit, growsfasterwith n thananyprimitiverecursivefunction.(Try workingouttherstfewvaluesof ...)

PAGE 103

13.RECURSIVEFUNCTIONS91Problem 13.8 Showthatthefunctions A and denedinExample13.4areTuringcomputable. Ifyouareveryambitious,youcantrytoprovethefollowingtheorem. Theorem 13.9 Suppose isthefunctiondenedinExample13.4 and f isanyprimitiverecursivefunction.Thenthereisan n 2 N such thatforall k>n ( k ) >f ( k ) Corollary 13.10 Thefunction denedinExample13.4isnot primitiverecursive. ...butifyouaren't,youcanstilltrythefollowingexercise. Problem 13.11 Informally,deneacomputablefunctionwhich mustbedierentfromeveryprimitiverecursivefunction. Unboundedminimalization. Thelastofourthreemethodof buildingcomputablefunctionsfromcomputablefunctionsisunbounded minimalization.Thefunctionswhichcanbedenedfromtheinitial functionsusingunboundedminimalization,aswellascompositionand primitiverecursion,turnouttobepreciselytheTuringcomputable functions. Unboundedminimalizationisthecounterpartforfunctionsof\brute force"algorithmsthattryeverypossibilityuntiltheysucceed.(Which, ofcourse,theymightnot...) Definition 13.4 Suppose k 1and g isa( k +1)-placefunction.Thenthe unboundedminimalization of g isthe k -placefunction f denedby f ( n1;:::;nk)= m where m isleastsothat g ( n1;:::;nk;m )=0. Thisisoftenwrittenas f ( n1;:::;nk)= m [ g ( n1;:::;nk;m )=0]. Note. Ifthereisno m suchthat g ( n1;:::;nk;m )=0,thenthe unboundedminimalizationof g isnotdenedon( n1;:::;nk).Thisis onereasonwewilloccasionallyneedtodealwithpartialfunctions. Iftheunboundedminimalizationofacomputablefunctionistobe computable,wehaveaproblemevenifweaskforsomedefaultoutput(0,say)toensurethatitisdenedforall k -tuples.Theobvious procedurewhichtestssuccessivevaluesof g tondtheneeded m will runforeverifthereisnosuch m ,andtheincomputabilityoftheHaltingProblemsuggeststhatotherprocedure'swon'tnecessarilysucceed either.Itfollowsthatitisdesirabletobecareful,sofaraspossible, whichfunctionsunboundedminimalizationisappliedto.

PAGE 104

9213.RECURSIVEFUNCTIONSDefinition 13.5 A( k +1)-placefunction g issaidtobe regular ifforevery( n1;:::;nk) 2 Nk,thereisatleastone m 2 N sothat g ( n1;:::;nk;m )=0. Thatis, g isregularpreciselyiftheobviousstrategyofcomputing g ( n1;:::;nk;m )for m =0,1,...insu ccessionuntilan m isfoundwith g ( n1;:::;nk;m )=0alwayssucceeds. Proposition 13.12 If g isaTuringcomputableregular ( k +1) placefunction,thentheunboundedminimalizationof g isalsoTuring computable. Whileunboundedminimalizationaddssomethingessentiallynewto ourrepertoire,itisworthnoticingthat boundedminimalization does not. Problem 13.13 Suppose g isa ( k +1) -placeprimitiverecursive regularfunctionsuchthatforsomeprimitiverecursive k -placefunction h m [ g ( n1;:::;nk;m )=0] h ( n1;:::;nk) forall ( n1;:::;nk) 2 N .Showthat m [ g ( n1;:::;nk;m )=0] isalso primitiverecursive. Recursivefunctionsandrelations. Wecannallydenean equivalentnotionofcomputabilityforfunctionsonthenaturalnumbers whichmakesnomentionofanycomputationaldevice. Definition 13.6 A k -placefunction f is recursive ifitcanbe denedfromtheinitialfunctionsbynitelymanyapplicationsofcomposition,primitiverecursion,andtheunboundedminimalizationof regularfunctions. Similarly, k -placepartialfunctionis recursive ifitcanbedened fromtheinitialfunctionsbynitelymanyapplicationsofcomposition, primitiverecursion,andtheunboundedminimalizationof(possibly non-regular)functions. Inparticular,everyprimitiverecursivefunctionisarecursivefunction. Theorem 13.14 EveryrecursivefunctionisTuringcomputable. WeshallshowthateveryTuringcomputablefunctionisrecursive lateron.Similarlytoprimitiverecursiverelationswehavethefollowing. Definition 13.7 A k -placerelation P issaidtobe recursive ( Turingcomputable )ifitscharacteristicfunction Pisrecursive(Turing computable).

PAGE 105

13.RECURSIVEFUNCTIONS93SinceeveryrecursivefunctionisTuringcomputable,and viceversa \recursive"isjustasynonymof\Turingcomputable",forfunctionsand relationsalike. Also,similarlytoTheorem13.6andCorollary13.7wehavethe following. Theorem 13.15 A k -placefunction g isrecursiveifandonlyif the 1 -placefunction h givenby h ( n )= g ( n1;:::;nk) if n = pn11:::pnkkisrecursive. Asbefore,itdoesn'treallymatterwhatthefunction h doesonan n whichdoesnotrepresentasequenceoflength k Corollary 13.16 A k -placerelation P isrecursiveifandonlyif the 1 -placerelation P0isrecursive,where ( n1;:::;nk) 2 P () pn11:::pnkk2 P0:

PAGE 107

CHAPTER14CharacterizingComputabilityByputtingtogethersomeoftheideasinChapters12and13,wecan userecursivefunctionstosimulateTuringmachines.Thiswillletus showthatTuringcomputablefunctionsarerecursive,completingthe argumentthatTuringmachinesandrecursivefunctionsareessentially equivalentmodelsofcomputation.Wewillalsousethesetechniquesto constructan universalTuringmachine (or UTM ):amachine U that, whengivenasinput(asuitabledescriptionof)someTuringmachine M andaninputtape a for M ,simulatesthecomputationof M oninput a .Ineect,anuniversalTuringmachineisasinglepieceofhardware thatletsustreatotherTuringmachinesassoftware. Turingcomputablefunctionsarerecursive. OurbasicstrategyistoshowthatanyTuringmachinecanbesimulatedbysome recursivefunction.Sincerecursivefunctionsoperateonintegers,we willneedtoencodethetapepositionsofTuringmachines,aswellas Turingmachinesthemselves,byintegers.Forsimplicity,weshallstick toTuringmachineswithalphabet f 1 g ;wealreadyknowfromChapter11thatsuchmachinescansimulateTuringmachineswithbigger alphabets. Definition 14.1 Suppose( s;i; a )isatapepositionsuchthatall butnitelymanycellsof a areblank.Let n beanypositiveinteger suchthat ak=0forall k>n .Thenthe code of( s;i; a )is p ( s;i; a ) q =2s3i5a07a111a2:::pann +3: Example 14.1 Considerthetapeposition(2 ; 1 ; 1001).Then p (2 ; 1 ; 1001) q =22315170110131=780 : Problem 14.1 Findthecodesofthefollowingtapepositions. (1)(1 ; 0 ; a ) ,where a isentirelyblank. (2)(4 ; 3 ; a ) ,where a is 1011100101 Problem 14.2 Whatisthetapepositionwhosecodeis 10314720 ? Whendealingwithcomputations,wewillalsoneedtoencodesequencesoftapepositionsbyintegers.95

PAGE 108

9614.CHARACTERIZINGCOMPUTABILITYDefinition 14.2 Suppose t1t2:::tnisasequenceoftapepositions. Thenthe code ofthissequenceis p t1t2:::tnq =2pt1q3pt2q:::pptnqn: Note. Bothtapepositionsandsequencesoftapepositionshave uniquecodes. Problem 14.3 Picksome(short!)sequenceoftapepositionsand nditscode. Havingdenedhowtorepresenttapepositionsasintegers,wenow needtomanipulatetheserepresentationsusingrecursivefunctions. TherecursivefunctionsandrelationsinProblems13.3and13.5provide mostofthenecessarytools. Problem 14.4 Showthatbothofthefollowingrelationsareprimitiverecursive. (1) TapePos ,where TapePos ( n ) () n isthecodeofatape position. (2) TapePosSeq ,where TapePosSeq ( n ) () n isthecodeof asequenceoftapepositions. Problem 14.5 Showthateachofthefollowingisprimitiverecursive. (1) The 4 -placefunction Entry suchthat Entry ( j;w;t;n ) = 8 > > > < > > > : p ( t;i + w )Tj/F29 1 Tf1.0037 0 TD(1 ; a0) q if n = p ( s;i; a ) q j 2f 0 ; 1 g w 2f 0 ; 2 g i + w )Tj/F29 1 Tf0.9837 0 TD(1 0 ,and t 1 where a0 k= akfor k 6 = i and a0 i= j ; 0 otherwise. (2) ForanyTuringmachine M withalphabet f 1 g ,the 1 -place function StepMsuchthat StepM( n )= 8 > < > : p M ( s;i; a ) q if n = p ( s;i; a ) q and M ( s;i; a ) isdened; 0 otherwise. (3) ForanyTuringmachine M withalphabet f 1 g ,the 1 -placerelation CompM,where CompM( n ) () n isthecodeofacomputationof M .

PAGE 109

14.CHARACTERIZINGCOMPUTABILITY97Thefunctionsandrelationsabovemaybeprimitiverecursive,but thelastbigstepinshowingthatTuringcomputablefunctionsarerecursiverequiresunboundedminimalization. Proposition 14.6 ForanyTuringmachine M withalphabet f 1 g the 1 -place(partial)function SimMisrecursive,where SimM( n )= p ( t;j; b ) q if n = p (1 ; 0 ; a ) q forsomeinputtape a and M eventuallyhaltsin position ( t;j; b ) oninput a .(Notethat SimM( n ) maybeundenedif n 6 = p (1 ; 0 ; a ) q foraninputtape a ,orif M doesnoteventuallyhalton input a .) Lemma 14.7 Showthatthefollowingfunctionsareprimitiverecursive: (1) Foranyxed k 1 Codek( n1;:::;nk)= p (1 ; 0 ; 01n10 ::: 01nk) q (2) Decode ( t )= n if t = p ( s;i; 01n +1) q (andanythingyoulike otherwise). Theorem 14.8 Any k -placeTuringcomputablefunctionisrecursive. Corollary 14.9 Afunction f : Nk! N isTuringcomputableif andonlyifitisrecursive. ThusTuringmachinesandrecursivefunctionsareessentiallyequivalentmodelsofcomputation. AnuniversalTuringmachine. Onecanpushthetechniques usedabovelittlefarthertogetarecursivefunctionthatcansimulate any Turingmachine.Sinceeveryrecursivefunctioncanbecomputed bysomeTuringmachine,thiseectivelygivesusanuniversalTuring machine. Problem 14.10 Deviseasuitabledenitionforthecode p M q of aTuringmachine M withalphabet f 1 g Problem 14.11 Show,usingyourdenitionof p M q fromProblem 14.10,thatthefollowingareprimitiverecursive. (1) The 2 -placefunction Step ,where Step ( m;n )= 8 > < > : p M ( s;i; a ) q if m = p M q forsomemachine M n = p ( s;i; a ) q ,& M ( s;i; a ) isdened; 0 otherwise.

PAGE 110

9814.CHARACTERIZINGCOMPUTABILITY(2) The 2 -placerelation Comp ,where Comp ( m;n ) () m = p M q forsomeTuringmachine M and n isthecodeofacomputation of M Proposition 14.12 The 2 -place(partial)function Sim isrecursive,where,foranyTuringmachine M withalphabet f 1 g andinput tape a for M Sim ( p M q ; p (1 ; 0 ; a ) q )= p ( t;j; b ) q if M eventuallyhaltsinposition ( t;j; b ) oninput a .(Notethat Sim ( m;n ) maybeundenedif m isnotthecodeofsomeTuringmachine M ,or if n 6 = p (1 ; 0 ; a ) q foraninputtape a ,orif M doesnoteventuallyhalt oninput a .) Corollary 14.13 ThereisaTuringmachine U whichcansimulateanyTuringmachine M Corollary 14.14 Thereisarecursivefunction f whichcancomputeanyotherrecursivefunction. TheHaltingProblem. Aneectivemethodtodeterminewhether ornotagivenmachinewilleventuallyhaltonagiveninput|short ofwaitingforever!|wouldbenicetohave.Forexample,assuming Church'sThesisistrue,suchamethodwouldletusidentifycomputer programswhichhaveinniteloopsbeforeweattempttoexecutethem. TheHaltingProblem. GivenaTuringmachine M andaninputtape a ,isthereaneectivemethodtodeterminewhetherornot M eventuallyhaltsoninput a ? GiventhatweareusingTuringmachinestoformalizethenotion ofaneectivemethod,oneofthedicultieswithsolvingtheHalting ProblemisrepresentingagivenTuringmachineanditsinputtapeas inputforanothermachine.AsthisisoneofthethingsthatwasaccomplishedinthecourseofconstructinganuniversalTuringmachine,we cannowformulateapreciseversionoftheHaltingProblemandsolve it. TheHaltingProblem. IsthereaTuringmachine T which,for anyTuringmachine M withalphabet f 1 g andtape a for M ,haltson input 0 1pMq+101p(1 ; 0 ; a )q+1withoutput0 11if M haltsoninput a ,andwithoutput0 1if M does nothaltoninput a ?

PAGE 111

14.CHARACTERIZINGCOMPUTABILITY99NotethatthispreciseversionoftheHaltingProblemisequivalent totheinformaloneaboveonlyifChurch'sThesisistrue. Problem 14.15 ShowthatthereisaTuringmachine C which,for anyTuringmachine M withalphabet f 1 g ,oninput 0 1pMq+1eventuallyhaltswithoutput 0 1pMq+101p(0 ; 1 ; 01pMq+1)q+1Theorem 14.16 Theanswerto(thepreciseversionof)theHalting Problemis\No." Recursivelyenumerablesets. Thefollowingnotionisofparticularinterestintheadvancedstudyofcomputability. Definition 14.3 Asubset( i.e. a1-placerelation) P of N is recursivelyenumerable ,oftenabbreviatedas r.e. ,ifthereisa1-place recursivefunction f suchthat P =im( f )= f f ( n ) j n 2 N g Sincetheimageofanyrecursive1-placefunctionisrecursivelyenumerablebydenition,wedonotlackforexamples.Forone,theset E ofevennaturalnumbersisrecursivelyenumerable,sinceitistheimage of f ( n )= Mult ( S ( S ( O ( n ))) ;n ). Proposition 14.17 If P isa 1 -placerecursiverelation,then P is recursivelyenumerable. Thispropositionisnotreversible,butitdoescomeclose. Proposition 14.18 P N isrecursiveifandonlyifboth P and N n P arerecursivelyenumerable. Problem 14.19 Findanexampleofarecursivelyenumerableset whichisnotrecursive. Problem 14.20 Is P N primitiverecursiveifandonlyifboth P and N n P areenumerablebyprimitiverecursivefunctions? Problem 14.21 P N recursivelyenumerableifandonlyifthere isa 1 -placerecursivepartialfunction g suchthat P = dom ( g )= f n j g ( n ) isdened g

PAGE 113

HintsforChapters10{14HintsforChapter10. 10.1. Thisshouldbeeasy... 10.2. Ditto. 10.3. (1)Anymachinewiththegivenalphabetandatable withthreenon-emptyrowswilldo. (2)Everyentryinthetableinthe0columnmustwritea1inthe scannedcell;similarly,everyentryinthe1columnmustwrite a0inthescannedcell. (3)What'sthesimplestpossibletableforagivenalphabet? 10.4. Unwindthedenitionsstepbystepineachcase.Notallof thesearecomputations... 10.5. Examineyoursolutionstothepreviousproblemand,ifnecessary,takethecomputationsalittlefarther. 10.6. Havethemachinerunonforevertotheright,writingdown thedesiredpatternasitgoesnomatterwhatmaybeonthetape already. 10.7. ConsideryoursolutiontoProblem10.6foronepossibleapproach.Itshouldbeeasytondsimplersolutions,though. 10.8. Considerthetasks S and T areintendedtoperform. 10.9. (1)Usefourstatestowritethe1s,oneforeach. (2)Theinputhasaconvenientmarker. (3)Runbackandforthtomoveonemarker n cells from theblock of1'swhilemovinganother through theblock,andthenllin. (4)Modifythepreviousmachinebyhavingitdeleteeveryother 1afterwritingout12 n. (5)Runbackandforthtomovetherightblockof1scellbycell tothedesiredposition. (6)Runbackandforthtomovetheleftblockof1scellbycell pasttheothertwo,andthenapplyaminormodicationof themachineinpart5.101

PAGE 114

102HINTSFORCHAPTERS10{14(7)Variationsontheideasusedinpart6shoulddothejob. (8)Runbackandforthbetweentheblocks,movingamarker througheach.Aftertheracebetweenthemarkerstotheends oftheirrespectiveblockshasbeendecided,eraseeverything andwritedownthedesiredoutput. HintsforChapter11. 11.1. Thisoughttobeeasy. 11.2. GeneralizethetechniqueofExample11.1,addingtwonew statestohelpwitheacholdstatethatmaycauseamoveindierent directions.Youdohavetobeabitcarefulnottomakeamachinethat wouldrunotheendofthetapewhentheoriginalwouldnot. 11.3. Youonlyneedtochangethepartsofthedenitionsinvolving thesymbols0and1. 11.4. Ifyouhavetroubleguringoutwhetherthesubroutineof Z simulatingstate1of W oninput y ,trytracingthepartialcomputations of W and Z onothertapesinvolving y 11.5. GeneralizetheconceptsusedinExample11.2.Notethatthe simulationmustoperatewithcodedversionsof M stape,unless= f 1 g .Thekeyideaistousethetapeofthesimulatorinblocksofsome xedsize,withthepatternsof0sand1sineachblockcorresponding toelementsof. 11.6. Thisshouldbestraightforward,ifsomewhattedious.Youdo needtobecarefulincomingupwiththeappropriateinputtapesfor O 11.7. GeneralizethetechniqueofExample11.3,splittingupthe tapeofthesimulatorintoupperandlowertracksandsplittingeach stateof N intotwostatesin P .Youwillneedtobequitecarefulin describingjusthowthelatteristobedone. 11.8. Thisismostlyprettyeasy.Theonlyproblemistodevise N sothatonecantellfromitsoutputwhether P haltedorcrashed,and thisiseasytoindicateusingsomeextrasymbolin N salphabet. 11.9. Ifyou'reindoubt,gowithoneread/writescannerforeach tape,andhaveeachentryinthetableofatwo-tapemachinetake bothscannersintoaccount.Simulatingsuchamachineisreallyjusta variationonthetechniquesusedinExample11.3.

PAGE 115

HINTSFORCHAPTERS10{1410311.10. Suchamachineshouldbeabletomoveitsscannertocells upanddownfromthecurrentone,aswelltotheside.(Diagonallytoo, ifyouwantto!)Simulatingsuchamachineonasingletapemachineis achallenge.Youmightnditeasiertorstdescribehowtosimulate itonasuitablemultiple-tapemachine. HintsforChapter12. 12.1. (1)Deletemostoftheinput. (2)Addaonetothefarendoftheinput. (3)Addalittletotheinput,anddeletealittlemoreelsewhere. (4)Deletealittlefromtheinput most ofthetime. (5)Runbackandforthbetweenthetwoblocksintheinput,deletinguntilonesidedisappears.Cleanupappropriately!(This isarelativeofProblem10.9.8.) (6)Deletetwoofblocksandmovetheremainingone. (7)Thisisjustasouped-upversionofthemachineimmediately preceding... 12.2. Therearejustasmanyfunctions N N astherearereal numbers,butonlyasmanyTuringmachinesastherearenaturalnumbers. 12.3. (1)Tracethecomputationthroughstep-by-step. (2)Considerthescoresofeachofthe1-stateentriesinthebusy beavercompetition. (3)Finda3-stateentryinthebusybeavercompetitionwhich scoressix. (4)Showhowtoturnan n -stateentryinthebusybeavercompetitionintoan( n +1)-stateentrythatscoresjustonebetter. 12.4. Youcouldstartbylookingatmodicationsofthe3-state entryyoudevisedinProblem12.3.3,butyouwillprobablywanttodo someseriousddlingtodobetterthanwhatProblem12.3.4dofrom there. 12.5. SupposewascomputablebyaTuringmachine M .Modify M togetan n -stateentryinthebusybeavercompetitionforsome n whichachievesascoregreaterthan( n ).Thekeyideaistoadd a\pre-processor"to M whichwritesablockwithmore1sthanthe numberodfstatesthat M andthepre-processorhavebetweenthem. 12.6. GeneralizeExample12.5.

PAGE 116

104HINTSFORCHAPTERS10{1412.7. Usemachinescomputing g h1,..., hmassub-machinesof themachinecomputingthecomposition.Youmightalsondsubmachinesthatcopytheoriginalinputandvariousstagesoftheoutput useful.Itisimportantthateachsub-machinegetallthedataitneeds anddoesnotdamagethedataneededbyothersub-machines. 12.8. Proceedbyinductiononthenumberofapplicationsofcompositionusedtodene f fromtheinitialfunctions. HintsforChapter13. 13.1. (1)Exponentiationistomultiplicationasmultiplication istoaddition. (2)Thisisstraightforwardexceptfortakingcareof Pred (0)= Pred (1)=0. (3) Diff isto Pred as S isto Sum (4)Thisisstraightforwardifyoulet0!=1. 13.2. Machinesusedtocompute g and h aretheprincipalparts ofthemachinecomputing f ,alongwithpartstocopy,move,and/or deletedataonthetapebetweenstagesintherecursiveprocess. 13.3. (1) f isto g as Fact istotheidentityfunction. (2)Use Diff andasuitableconstantfunctionasthebasicbuilding blocks. (3)Thisisaslightgeneralizationoftheprecedingpart. 13.4. Proceedbyinductiononthenumberofapplicationsofprimitiverecursionandcomposition. 13.5. (1)Useacompositionincluding Diff P,andasuitableconstantfunction. (2)Asuitablecompositionwilldothejob;it'sjustalittleharder thanitlooks. (3)Asuitablecompositionwilldothejob;it'srathermorestraightforwardthanthepreviouspart. (4)Notethat n = m exactlywhen n )Tj/F21 1 Tf1.0037 0 TD(m =0= m )Tj/F21 1 Tf0.9837 0 TD(n (5)AdaptyoursolutionfromtherstpartofProblem13.3. (6)Firstdeviseacharacteristicfunctionfortherelation Product ( n;k;m ) () nk = m; andthensumup. (7)Use Divandsumup. (8)Use IsPrime andsomeingenuity. (9)Use Exp and Div andsomemoreingenuity. (10)Asuitablecombinationof Prime withotherthingswilldo.

PAGE 117

HINTSFORCHAPTERS10{14105(11)Asuitablecombinationof Prime and Power willdo. (12)Throwthekitchensinkatthisone... (13)Ditto. 13.6. Ineachdirection,useacompositionoffunctionsalready knowntobeprimitiverecursivetomodifytheinputasnecessary. 13.7. AstraightforwardapplicationofTheorem13.6. 13.8. Thisisnotunlike,thoughalittlemorecomplicatedthan, showingthatprimitiverecursionpreservescomputability. 13.9. It's not easy!Lookitup... 13.10. ThisisaveryeasyconsequenceofTheorem13.9. 13.11. Listingthedenitionsofallpossibleprimitiverecursive functionsisacomputabletask.NowborrowatrickfromCantor's proofthattherealnumbersareuncountable.(Aformalargumentto thiseectcouldbemadeusingtechniquessimilartothoseusedtoshow thatallTuringcomputablefunctionsarerecursiveinthenextchapter.) 13.12. Thestrategyshouldbeeasy.Makesurethatateachstage youpreserveacopyoftheoriginalinputforuseatlaterstages. 13.13. Theprimitiverecursivefunctionyoudeneonlyneedsto checkvaluesof g ( n1;:::;nk;m )for m suchthat0 m h ( n1;:::;nk), butitstillneedstopicktheleast m suchthat g ( n1;:::;nk;m )=0. 13.14. ThisisverysimilartoTheorem13.4. 13.15. ThisisvirtuallyidenticaltoTheorem13.6. 13.16. ThisisvirtuallyidenticaltoCorollary13.7. HintsforChapter14. 14.1. EmulateExample14.1inbothparts. 14.2. Writeouttheprimepowerexpansionofthegivennumber andunwindDenition14.1. 14.3. Findthecodesofeachofthepositionsinthesequenceyou choseandthenapplyDenition14.2. 14.4. (1) TapePos( n )=1exactlywhenthepowerof2inthe primepowerexpansionof n isatleast1andeveryotherprime appearsintheexpansionwithapowerof0or1.Thiscan beachievedwithacompositionofrecursivefunctionsfrom Problems13.3and13.5.

PAGE 118

106HINTSFORCHAPTERS10{14(2) TapePosSeq( n )=1exactlywhen n isthecodeofasequenceof tapepositions, i.e. everypowerintheprimepowerexpansion of n isthecodeofatapeposition. 14.5. (1)Iftheinputisofthecorrectform,makethenecessary changestotheprimepowerexpansionof n usingthetoolsin Problem13.5. (2)Piece StepMtogetherbycasesusingthefunction Entry in eachcase.Thepiecing-togetherworksalotlikeredeninga functionataparticularpointinProblem13.3. (3)Iftheinputisofthecorrectform,usethefunction StepMtocheckthatthesuccessiveelementsofthesequenceoftape positionsarecorrect. 14.6. Thekeyideaistouseunboundedminimalizationon Comp, withsomeadditionstomakesurethecomputationfound(ifany)starts withthegiveninput,andthentoextracttheoutputfromthecodeof thecomputation. 14.7. (1)Todene Codek,considerwhat p (1 ; 0 ; 01n10 ::: 01nk) q isasaprimepowerexpansion,andarrangeasuitablecompositiontoobrtainitfrom( n1;:::;nk). (2)Todene Decode youonlyneedtocounthowmanypowersofprimesotherthan3intheprime-powerexpansionof p ( s;i; 01n +1) q areequalto1. 14.8. UseProposition14.6andLemma14.7. 14.9. ThisfollowsdirectlyfromTheorems13.14and14.8. 14.10. TakesomecreativeinspirationfromDenitions14.1and 14.2.Forexample,if( s;i ) 2 dom( M )and M ( s;i )=( j;d;t ),youcould letthecodeof M ( s;i )be p M ( s;i ) q =2s3i5j7d +111t: 14.11. Muchofwhatyouneedforbothpartsisjustwhatwas neededforProblem14.5,exceptthat Step isprobablyeasiertodene than StepMwas.(Deneitasacomposition...)Theadditional ingredientsmainlyhavetodowithusing m = p M q properly. 14.12. Essentially,thisistoProblem14.11asprovingProposition 14.6istoProblem14.5. 14.13. Themachinethatcomputes SIM doesthejob.

PAGE 119

HINTSFORCHAPTERS10{1410714.14. Amodicationof SIM doesthejob.Themodicationsare neededtohandleappropriateinputandoutput.CheckTheorem13.15 forsomeideasonwhatmaybeappropriate. 14.15. Thiscanbedonedirectly,butmaybeeasiertothinkofin termsofrecursivefunctions. 14.16. Supposetheanswerwasyesandsuchamachine T didexist. Createamachine U asfollows.Give T themachine C fromProblem 14.15asapre-processorandalteritsbehaviourbyhavingitrunforever if M haltsandhaltif M runsforever.Whatwill T dowhenitgets itselfasinput? 14.17. Use Ptohelpdeneafunction f suchthatim( f )= P 14.18. OnedirectionisaneasyapplicationofProposition14.17. Fortheother,givenan n 2 N ,runthefunctionsenumerating P and N n P concurrentlyuntiloneortheotheroutputs n 14.19. Considerthesetofnaturalnumberscoding(accordingto someschemeyoumustdevise)Turingmachinestogetherwithinput tapesonwhichtheyhalt. 14.20. SeehowfaryoucanadaptyourargumentforProposition 14.18. 14.21. ThismaywellbeeasiertothinkofintermsofTuringmachines.RunaTuringmachinethatcomputes g forafewstepsonthe rstpossibleinput,afewonthesecond,afewmoreontherst,afew moreonthesecond,afewonthethird,afewmoreontherst,...

PAGE 121

PartIVIncompleteness

PAGE 123

CHAPTER15PreliminariesItwasmentionedintheIntroductionthatoneofthemotivationsfor thedevelopmentofnotionsofcomputabilitywasthefollowingquestion. Entscheidungsproblem. Givenareasonablesetofformulas ofarst-orderlanguage L andaformula of L ,isthereaneective methodfordeterminingwhetherornot ` ? Armedwithknowledgeofrst-orderlogicontheonehandand ofcomputabilityontheother,weareinapositiontoformulatethis questionpreciselyandthensolveit.Tocuttothechase,theansweris usually\no".G odel'sIncompletenessTheoremasserts,roughly,that givenanysetofaxiomsinarst-orderlanguagewhicharecomputable andalsopowerfulenoughtoprovecertainfactsaboutarithmetic,it ispossibletoformulatestatementsinthelanguagewhosetruthisnot decidedbytheaxioms.Inparticular,itturnsoutthatnoconsistent setofaxiomscanhopetoproveitsownconsistency. WewilltackletheIncompletenessTheoreminthreestages.First, wewillcodetheformulasandproofsofarst-orderlanguageasnumbersandshowthatthefunctionsandrelationsinvolvedarerecursive. Thiswill,inparticular,makeitpossibleforustodenea\computable setofaxioms"precisely.Second,wewillshowthatallrecursivefunctionsandrelationscanbedenedbyrst-orderformulasinthepresence ofafairlyminimalsetofaxiomsaboutelementarynumbertheory.Finally,byputtingrecursivefunctionstalkingaboutrst-orderformulas togetherwithrst-orderformulasdeningrecursivefunctions,wewill manufactureaself-referentialsentencewhichassertsitsownunprovability. Note. Itwillbeassumedinwhatfollowsthatyouarefamiliarwith thebasicsofthesyntaxandsemanticsofrst-orderlanguages,aslaid outinChapters5{8ofthistext.Evenifyouarealreadyfamiliarwith thematerial,youmaywishtolookoverChapters5{8tofamiliarize yourselfwiththenotation,denitions,andconventionsusedhere,or atleastkeepthemhandyincaseyouneedtochecksomesuchpoint.111

PAGE 124

11215.PRELIMINARIESAlanguageforrst-ordernumbertheory. Tokeepthingsas concreteaspossiblewewillworkwithandinthefollowinglanguage forrst-ordernumbertheory,mentionedinExample5.2. Definition 15.1 LNistherst-orderlanguagewiththefollowing symbols: (1)Parentheses:(and) (2)Connectives: : and (3)Quantier: 8 (4)Equality:= (5)Variablesymbols: v0, v2, v3,... (6)Constantsymbol:0 (7)1-placefunctionsymbol: S (8)2-placefunctionsymbols:+, ,and E Thenon-logicalsymbolsof LN,0, S ,+, ,and E ,areintended toname,respectively,thenumberzero,andthesuccessor,addition, multiplication,andexponentiationfunctionsonthenaturalnumbers. Thatis,the(standard!)structurethislanguageisintendedtodiscuss is N =( N ; 0 ; S ; + ; ; E ). Completeness. ThenotionofcompletenessusedintheIncompletenessTheoremisdierentfromtheoneusedintheCompleteness Theorem.1\Completeness"inthelattersenseisapropertyofalogic: itassertsthatwhenever)]TJ/F22 1 Tf11.3021 0 TD0 Tc(j = ( i.e. thetruthofthesentence follows fromthatofthesetofsentences\,)]TJ/F22 1 Tf15.9995 0 TD0 Tc(` ( i.e. thereisadeductionof from)8().Thesenseof\completeness"intheIncompletenessTheorem, denedbelow,isapropertyofasetofsentences. Definition 15.2 Asetofsentencesofarst-orderlanguage L issaidtobe complete ifforeverysentence either ` or `: Thatis,asetofsentences,ornon-logicalaxioms,iscompleteifit sucestoproveordisproveeverysentenceofthelangageininquestion. Proposition 15.1 Aconsistentset ofsentencesofarst-order language L iscompleteifandonlyifthetheoryof Th()= f j isasentenceof L and ` g ; ismaximallyconsistent. 1Which,toconfusetheissue,wasalsorstprovedbyKurtG odel.

PAGE 125

CHAPTER16CodingFirst-OrderLogicWewillencodethesymbols,formulas,anddeductionsof LNas naturalnumbersinsuchawaythattheoperationsnecessarytomanipulatethesecodesarerecursive.Althoughwewilldosojustfor LN, anycountablerst-orderlanguagecanbecodedinasimilarway. G odelcoding. Thebasicapproachofthecodingschemewewill usewasdevisedbyG odelinthecourseofhisproofoftheIncompletenessTheorem. Definition 16.1 Toeachsymbol s of LNweassignanunique positiveinteger p s q ,the G odelcode of s ,asfollows: (1) p ( q =1and p ) q =2 (2) p : q =3and p q =4 (3) p 8 q =5 (4) p = q =6. (5) p vkq = k +12 (6) p 0 q =7 (7) p S q =8 (8) p + q =9, p q =10,and p E q =11 NotethateachpositiveintegeristheG odelcodeofoneandonlyone symbolof LN.Wewillalsoneedtocodesequencesofthesymbolsof LN,suchastermsandformulas,asnumbers,nottomentionsequences ofsequencesofsymbolsof LN,suchasdeductions. Definition 16.2 Suppose s1s2:::skisasequenceofsymbolsof LN.Thenthe G odelcode ofthissequenceis p s1:::skq = pps1q1:::ppskqk; where pnisthe n thprimenumber. Similarly,if 12:::`isasequenceofsequencesofsymbolsof LN, thenthe G odelcode ofthissequenceis p 1:::`q = pp1q1:::pp`qk:113

PAGE 126

11416.CODINGFIRST-ORDERLOGICExample 16.1 Thecodeoftheformula 8 v1= v1S 0 v1(theocial formof 8 v1v1 S 0= v1), p 8 v1= v1S 0 v1q ,worksoutto 2p8q3pv1q5p=q7pq11pv1q13pSq17p0q19pv1q=253135671011131381771913=109425289274918632559342112641443058962750733001979829025245569500000: Thisis not themostecientconceivablecodingscheme! Example 16.2 Thecodeofthesequenceofformulas =00 i.e. 0=0 (=00 = S 0 S 0) i.e. 0=0 S 0= S 0 = S 0 S 0 i.e. S 0= S 0 worksoutto 2p=00q3p(=00 = S 0 S 0)q5p= S 0 S 0q=22p=q3p0q5p0q 32p(q3p=q5p0q7p0q11p!q13p=q17pSq19p0q23pSq29p0q31p)q 52p=q3pSq5p0q7pSq11p0q=2263757321365777114136178197238297312526385778117; whichislargeenoughnottobeworththebotherofworkingitout explicitly. Problem 16.1 Pickashortsequenceofshortformulasof LNand ndthecodeofthesequence. Aparticularinteger n maysimultaneouslybetheG odelcodeofa symbol,asequenceofsymbols,andasequenceofsequencesofsymbols of LN.Weshallrelyoncontexttoavoidconfusion,but,withsome morework,onecouldsetthingsupsothatnointegerwasthecodeof morethanonekindofthing.Inanycase,wewillbemostinterested inthecaseswheresequencesofsymbolsare(ocial)termsorformulas andwheresequencesofsequencesofsymbolsaresequencesof(ocial) formulas.Inthesecasesthingsarealittlesimpler. Problem 16.2 Isthereanaturalnumber n whichissimultaneously thecodeofasymbolof LN,thecodeofaformulaof LN,andthecode ofasequenceofformulasof LN?Ifnot,howmanyofthesethreethings cananaturalnumberbe? RecursiveoperationsonG odelcodes. Wewillneedtoknow thatvariousrelationsandfunctionswhichrecognizeandmanipulate G odelcodesarerecursive,andhencecomputable.

PAGE 127

16.CODINGFIRST-ORDERLOGIC115Problem 16.3 Showthateachofthefollowingrelationsisprimitiverecursive. (1) Term ( n ) () n = p t q forsometerm t of LN. (2) Formula ( n ) () n = p q forsomeformula of LN. (3) Sentence ( n ) () n = p q forsomesentence of LN. (4) Logical ( n ) () n = p q forsomelogicalaxiom of LN. Usingtheserelationsasbuildingblocks,wewilldeveloprelations andfunctionstohandledeductionsof LN.First,though,weneedto make\acomputablesetofformulas"precise. Definition 16.3 Asetofformulasof LNissaidtobe recursive ifthesetofG odelcodesofformulasof, p q = f p q j 2 g ; isarecursivesubsetof N ( i.e. arecursive1-placerelation).Similarly, issaidtobe recursivelyenumerable if p q isrecursivelyenumerable. Problem 16.4 Suppose isarecursivesetofsentencesof LN. Showthateachofthefollowingrelationsisrecursive. (1) Premiss( n ) () n = p q forsomeformula of LNwhich iseitheralogicalaxiomorin (2) Formulas ( n ) () n = p '1:::'kq forsomesequence '1:::'kofformulasof LN. (3) Inference ( n;i;j ) () n = p '1:::'kq forsomesequence '1:::'kofformulasof LN, 1 i;j k ,and 'kfollowsfrom 'iand 'jbyModusPonens. (4) Deduction( n ) () n = p '1:::'kq foradeduction '1:::'kfrom in LN. (5) Conclusion( n;m ) () n = p '1:::'kq foradeduction '1:::'kfrom in LNand m = p 'kq If p q isprimitiverecursive,whichoftheseareprimitiverecursive? Itisatthispointthattheconnectionbetweencomputabilityand completenessbeginstoappear. Theorem 16.5 Suppose isarecursivesetofsentencesof LN. Then p Th() q is (1) recursivelyenumerable,and (2) recursiveifandonlyif iscomplete. Note. Itfollowsthatifisnotcomplete,then p Th() q isan exampleofarecursivelyenumerablebutnotrecursiveset.

PAGE 129

CHAPTER17DeningRecursiveFunctionsInArithmeticThedenitionsandresultsinChapter17letususenaturalnumbers andrecursivefunctionstocodeandmanipulateformulasof LN.We willalsoneedcomplementaryresultsthatletususetermsandformulasof LNtorepresentandmanipulatenaturalnumbersandrecursive functions. Axiomsforbasicarithmetic. Wewilldeneasetofnon-logical axiomsin LNwhichproveenoughabouttheoperationsofsuccessor, addition,mutliplication,andexponentiationtoletusdeneallthe recursivefunctionsusingformulasof LN.Thenon-logicalaxiomsin questionessentiallyguaranteethatbasicarithmeticworksproperly. Definition 17.1 Let A bethefollowingsetofsentencesof LN, writtenoutinocialform. N1: 8 v0( : = Sv00) N2: 8 v0(( : = v00) ( :8 v1( : = Sv1v0))) N3: 8 v08 v1(= Sv0Sv1! = v0v1) N4: 8 v0=+ v00 v0N5: 8 v08 v1=+ v0Sv1S + v0v1N6: 8 v0= v000 N7: 8 v08 v1= v0Sv1+ v0v1v0N8: 8 v0= Ev00 S 0 N9: 8 v08 v1= Ev0Sv1 Ev0v1v0Translatedfromtheocialforms, A consistsofthefollowingaxiomsaboutthenaturalnumbers: N1: Forall n n +1 6 =0. N2: Forall n n 6 =0thereisa k suchthat k +1= n N3: Forall n and k n +1= k +1impliesthat n = k N4: Forall n n +0= n N5: Forall n and k n +( k +1)=( n + k )+1. N6: Forall n n 0=0. N7: Forall n and k n ( k +1)=( n k )+ n N8: Forall n n0=1. N9: Forall n and k nk +1=( nk) n .117

PAGE 130

11817.DEFININGRECURSIVEFUNCTIONSINARITHMETICEachoftheaxiomsin A istrueofthenaturalnumbers: Proposition 17.1 N j = A ,where N =( N ; 0 ; S ; + ; ; E ) isthe structureconsistingofthenaturalnumberswiththeusualzeroand theusualsuccessor,addition,multiplication,andexponentiationoperations. However, A isalongwayfrombeingabletoproveallthesentences ofrst-orderarithmetictruein N .Forexample,thoughwewon'tprove it,itturnsoutthat A isnotenoughtoensurethatinductionworks: thatforeveryformula withatmostthevariable x free,if 'x 0and 8 y ( 'x y! 'x Sy)hold,thensodoes 8 x' .Ontheotherhand,neither LNnor A arequiteasminimalastheymightbe.Forexample,withsome (considerable)extraeortonecoulddowithout E anddeneitfrom and+. Representingfunctionsandrelations. Forconvenience,we willadoptthefollowingconventions.First,wewilloftenabbreviate thetermof LNconsistingof mS sfollowedby0by Sm0.Forexample, S30abbreviates SSS 0.Theterm Sm0isaconvenientnameforthe naturalnumber m inthelanguage LNsincetheinterpretationof Sm0 in N is m : Lemma 17.2 Forevery m 2 N andeveryassignment s for N s ( Sm0)= m Second,if isaformulaof LNwithallofitsfreevariablesamong v1,..., vk,and m0, m1,..., mkarenaturalnumbers,wewillwrite ( Sm10 ;:::;Smk0)forthesentence 'v1:::vkSm 10 ;:::;Sm k0, i.e. with Smi0substitutedforeveryfreeoccurrenceof vi.Sincetheterm Smi0involves novariables,itissubstitutablefor viin Definition 17.2 Supposeisasetofsentencesof LN.A k -place function f issaidtobe representable inTh()= f j ` g ifthere isaformula of LNwithatmost v1,..., vk,and vk +1asfreevariables suchthat f ( n1;:::;nk)= m () ( Sn10 ;:::;Snk0 ;Sm0) 2 Th() () ` ( Sn10 ;:::;Snk0 ;Sm0) forall n1,..., nk,and m in N .Theformula issaidto represent f in Th(). Wewillusethisdenitionmainlywith= A Example 17.1 Theconstantfunction c1 3givenby c1 3( n )=3is representableinTh( A ); v2= S30isaformularepresentingit.Note

PAGE 131

17.DEFININGRECURSIVEFUNCTIONSINARITHMETIC119thatthatthisformulahasnofreevariablefortheinputofthe1-place function,butthentheinputisirrelevant... Toseethat v2= S30reallydoesrepresent c1 3inTh( A ),weneedto verifythat c1 3( n )= m ()A` v2= S30( Sn0 ;Sm0) ()A` Sm0= S30 forall n;m 2 N Inonedirection,supposethat c1 3( n )= m .Then,bythedenition of c1 3,wemusthave m =3.Now (1) 8 xx = x S30= S30A4 (2) 8 xx = x A8 (3) S30= S301,2MP isadeductionof S30= S30from A .Henceif c1 3( n )= m ,then A` Sm0= S30. Intheotherdirection,supposethat A` Sm0= S30.Since N j = A itfollowsthat N j = Sm0= S30.ItfollowsfromLemma17.2that m =3,so c1 3( n )= m .Henceif A` Sm0= S30,then c1 3( n )= m Problem 17.3 Showthattheprojectionfunction 3 2canberepresentedin Th( A ) Definition 17.3 A k -placerelation P Nkissaidtobe representable inTh()ifthereisaformula of LNwithatmost v1,..., vkasfreevariablessuchthat P ( n1;:::;nk) () ( Sn10 ;:::;Snk0) 2 Th() () ` ( Sn10 ;:::;Snk0) forall n1,..., nkin N .Theformula issaidto represent P inTh(). Wewillalsousethisdenitionmainlywith= A Example 17.2 Almostthesameformula, v1= S30,servesto representtheset| i.e. 1-placerelation| f 3 g inTh( A ).Showing that v1= S30reallydoesrepresent f 3 g inTh( A )isvirtuallyidentical tothecorrespondingargumentinExample17.1. Problem 17.4 Explainwhy v2= SSS 0 doesnotrepresenttheset f 3 g in Th( A ) and v1= SSS 0 doesnotrepresenttheconstantfunction c1 3in Th( A ) Problem 17.5 Showthatthesetofallevennumberscanrepresentablein Th( A ) .

PAGE 132

12017.DEFININGRECURSIVEFUNCTIONSINARITHMETICProblem 17.6 Showthattheinitialfunctionsarerepresentablein Th( A ) : (1) Thezerofunction O ( n )=0 (2) Thesuccessorfunction S ( n )= n +1 (3) Foreverypositive k and i k ,theprojectionfunction k i. ItturnsoutthatallrecursivefunctionsandrelationsarerepresentableinTh( A ). Proposition 17.7 A k -placefunction f isrepresentablein Th( A ) ifandonlyifthe k +1 -placerelation Pfdenedby Pf( n1;:::;nk;nk +1) () f ( n1;:::;nk)= nk +1isrepresentablein Th( A ) Also,arelation P Nkisrepresentablein Th( A ) ifandonlyifits characteristicfunction Pisrepresentablein Th( A ) Proposition 17.8 Suppose g1,..., gmare k -placefunctionsand h isan m -placefunction,allofthemrepresentablein Th( A ) .Then f = h ( g1;:::;gm) isa k -placefunctionrepresentablein Th( A ) Proposition 17.9 Suppose g isa k +1 -placeregularfunction whichisrepresentablein Th( A ) .Thentheunboundedminimalization of g isa k -placefunctionrepresentablein Th( A ) Betweenthem,theaboveresultssupplymostofwhatisneeded toconcludethatallrecursivefunctionsandrelationsonthenatural numbersarerepresentable.Theexceptionisshowingthatfunctions denedbyprimitiverecursionfromrepresentablefunctionsarealso representable,whichrequiressomeadditionaleort.Thebasicproblem isthatitisnotobvioushowaformuladeningafunctioncangetat previousvaluesofthefunction.Toaccomplishthis,wewillborrowa trickfromChapter13. Problem 17.10 Showthateachofthefollowingrelationsandfunctions(rstdenedinProblem13.5)isrepresentablein Th( A ) (1) Div ( n;m ) () n j m (2) IsPrime ( n ) () n isprime (3) Prime ( k )= pk,where p0=1 and pkisthe k thprimeif k 1 (4) Power ( n;m )= k ,where k 0 ismaximalsuchthat nkj m (5) Length ( n )= ` ,where ` ismaximalsuchthat p`j n (6) Element ( n;i )= ni,where n = pn11:::pnkk(and ni=0 if i>k ). Usingtherepresentablefunctionsandrelationsgivenabove,wecan representa\historyfunction"ofanyrepresentablefunction...

PAGE 133

17.DEFININGRECURSIVEFUNCTIONSINARITHMETIC121Problem 17.11 Suppose f isa k -placefunctionrepresentablein Th( A ) .Showthat F ( n1;:::;nk;m )= pf ( n1;:::;nk; 0) 1:::pf ( n1;:::;nk;m ) m +1=mYi =0pf ( n1;:::;nk;i ) iisalsorepresentablein Th( A ) ...anduseit! Proposition 17.12 Suppose g isa k -placefunctionand h isa k +2 -placefunction,bothrepresentablein Th( A ) .Thenthe k +1 placefunction f denedbyprimitiverecursionfrom g and h isalso representablein Th( A ) Theorem 17.13 Recursivefunctionsarerepresentablein Th( A ) Inparticular,itfollowsthatthereareformulasof LNrepresentingeachofthefunctionsfromChapter16formanipulatingthecodes offormulas.Thiswillpermitustoconstructformulaswhichencode assertionsaboutterms,formulas,anddeductions;wewillultimately provetheIncompletenessTheorembyshowingthereisaformulawhich codesitsownunprovab ility. Representability. Weconcludewithsomemoregeneralfactsabout representability. Proposition 17.14 Suppose isasetofsentencesof LNand f isa k -placefunctionwhichisrepresentablein Th() .Then mustbe consistent. Problem 17.15 If isasetofsentencesof LNand P isa k -place relationwhichisrepresentablein Th() ,does havetobeconsistent? Proposition 17.16 Suppose and )Tj/F30 1 Tf1.0037 0 TD[(areconsistentsetsofsentencesof LNand ` )Tj/F30 1 Tf0.6022 0 TD(, i.e. ` forevery 2 )Tj/F30 1 Tf0.6022 0 TD-0.008 Tc[(.Thenevery functionandrelationwhichisrepresentablein Th()6() isrepresentable in Th() ThisletsususeeverythingwecandowithrepresentabilityinTh( A ) withanysetofaxiomsin LNthatisatleastaspowerfulas A Corollary 17.17 Functionsandrelationswhichrepresentablein Th( A ) arealsorepresentablein Th() ,foranyconsistentsetofsentences suchthat `A .

PAGE 135

CHAPTER18TheIncompletenessTheoremThematerialinChapter16eectivelyallowsustouserecursive functionstomanipulatecodedformulasof LN,whilethematerialin Chapter17allowsustorepresentrecursivefunctionsusingformulas LN.Combiningthesetechniquesallowsustouseformulasof LNto refertoandmanipulatecodesofformulasof LN.Thisisthekeyto provingG odel'sIncompletenessTheoremandrelatedresults. Inparticular,wewillneedtoknowonefurthertrickaboutmanipulatingthecodesofformulasrecursively,thattheoperationofsubstituting(thecodeof)theterm Sk0into(thecodeof)aformulawithone freevariableisrecursive. Problem 18.1 Showthatthefunction Sub ( n;k )= 8 > < > : p ( Sk0) q if n = p q foraformula of LNwithatmost v1free 0 otherwise isrecursive,andhencerepresentable Th( A ) InordertocombinethetheresultsfromChapter16withthose fromChapter17,wewillalsoneedtoknowthefollowing. Lemma 18.2 A isarecursivesetofsentencesof LN. TheFirstIncompletenessTheorem. Thekeyresultneededto provetheFirstIncompletenessTheorem(anotherwillfollowshortly!) isthefollowinglemma.Itasserts,ineect,thatforanystatement about(thecodeof)somesentence,thereisasentence whichistrue orfalseexactlywhenthestatementistrueoraseof(thecodeof) Thisfactwillallowustoshowthattheself-referentialsentencewewill needtoverifytheIncompletenesstheoremexists. Lemma 18.3(Fixed-PointLemma) Suppose isaformulaof LNwithonly v1asafreevariable.Thenthereisasentence of LNsuch that A` $ ( Spq0) :123

PAGE 136

12418.THEINCOMPLETENESSTHEOREMNotethat mustbedierentfromthesentence ( Spq0):thereis nowaytondaformula withonefreevariableandaninteger k such that p ( Sk0) q = k .(ThinkabouthowG odelcodesaredened...) WiththeFixed-PointLemmainhand,G odel'sFirstIncompleteness Theoremcanbeputawayinfairlyshortorder. Theorem 18.4(G odel'sFirstIncompletenessTheorem) Suppose isaconsistentrecursivesetofsentencesof LNsuchthat `A Then isnotcomplete. Thatis,anyconsistentsetofsentenceswhichprovesatleastas muchaboutthenaturalnumbersas A doescan'tbebothcomplete andrecursive.TheFirstIncompletenessTheoremhasmanyvariations, corollaries,andrelatives,afewofwhichwillbementionedbelow.[ 17 ] isagoodplacetolearnaboutmoreofthem. Corollary 18.5 (1) Let )Tj/F30 1 Tf0.9636 0 TD-0.007 Tc[(beacompletesetofsentencesof LNsuchthat )Tj/F22 1 Tf0.8231 0 TD0.237 Tc([A isconsistent.Then )Tj/F30 1 Tf0.9636 0 TD-0.007 Tc[(isnotrecursive. (2) Let bearecursivesetofsentencessuchthat [A isconsistent.Then isnotcomplete. (3) Thetheoryof N Th( N )= f j isasentenceof LNand N j = g ; isnotrecursive. Thereisnothingreallyspecialaboutworkingin LN.Theproof ofG odel'sIncompletenessTheoremcanbeexecutedforanyrstorder languageandrecursivesetofaxiomswhichallowonetocodeandprove enoughfactsaboutarithmetic.Inparticular,itcanbedonewhenever thelanguageandaxiomsarepowerfulenough|asinZermelo-Fraenkel settheory,forexample|todenethenaturalnumbersandprovesome modestfactsaboutthem. TheSecondIncompletenessTheorem. G odelalsoproveda strengthenedversionoftheIncompletenessTheoremwhichassertsthat, inparticular,aconsistentrecursivesetofsentencesof LNcannot proveitsownconsistency.Togetatit,weneedtoexpressthestatement\isconsistent"in LN. Problem 18.6 Suppose isarecursivesetofsentencesof LN. Findasentenceof LN,whichwe'lldenoteby Con() ,suchthat is consistentifandonlyif A` Con() Theorem 18.7(G odel'sSecondIncompletenessTheorem) Let beaconsistentrecursivesetofsentencesof LNsuchthat `A .Then 0 Con() .

PAGE 137

18.THEINCOMPLETENESSTHEOREM125AswiththeFirstIncompletenessTheorem,theSecondIncompletenessTheoremholdsforanyrecursivesetofsentencesinarst-order languagewhichallowonetocodeandproveenoughfactsaboutarithmetic.TheperverseconsequenceoftheSecondIncompletenessTheoremisthatonlyaninconsistentsetofaxiomscanproveitsownconsistency. Truthanddenability. AcloserelativeoftheIncompleteness Theoremistheassertionthattruthin N =( N ; S ; + ; ; E ; 0)isnot denablein N .Tomakesenseofthis,ofcourse,weneedtosortout what\truth"and\denablein N "meanhere. \Truth"meanswhatitusuallydoesinrst-orderlogic:allwemean whenwesaythatasentence of LNistruein N isthatwhen is truewheninterpretedasastatementaboutthenaturalnumberswith theusualoperations.Thatis, istruein N exactlywhen N satises i.e. exactlywhen N j = \Denablein N "wedohavetodene... Definition 18.1 A k -placerelationis denable in N ifthereisa formula of LNwithatmost v1,..., vkasfreevariablessuchthat P ( n1;:::;nk) () N j = [ s ( v1j n1) ::: ( vkj nk)] foreveryassignment s of N .Theformula issaidto dene P in N Adenitionof\functiondenablein N "couldbemadeinasimilar way,ofcourse.Denabilityisacloserelativeofrepresentability: Proposition 18.8 Suppose P isa k -placerelationwhichisrepresentablein Th( A ) .Then P isdenablein N Problem 18.9 IstheconversetoProposition18.8true? Thequestionofwhethertruthin N isdenableisthenthequestion ofwhetherthesetofG odelcodesofsentencesof LNtruein N p Th( N ) q = f p q j isasentenceof LNand N j = g ; isdenablein N .Itisn't: Theorem 18.10(Tarski'sUndenabilityTheorem) p Th( N ) q is notdenablein N Theimplications. G odel'sIncompletenessTheoremshavesome seriousconsequences. Sincealmostallofmathematicscanbeformalizedinrst-order logic,theFirstIncompletenessTheoremimpliesthatthereisnoeectiveprocedurethatwillndandprovealltheorems.Thismightbe consideredasjobsecurityforresearchmathematicians.

PAGE 138

12618.THEINCOMPLETENESSTHEOREMTheSecondIncompletenessTheorem,ontheotherhand,implies thatwecanneverbecompletelysurethatanyreasonablesetofaxioms isactuallyconsistentunlesswetakeamorepowerfulsetofaxiomson faith.Itfollowsthatonecanneverbecompletelysure|faithaside| thatthetheoremsprovedinmathematicsarereallytrue.Thismight beconsideredasjobsecurityforphilosophersofmathematics. WeleavethequestionofwhogetsjobsecurityfromTarski'sUndenabilityTheoremtoyou,gentlereader...

PAGE 139

HintsforChapters15{18HintsforChapter15. 15.1. CompareDenition15.2withthedenitionofmaximalconsistency. HintsforChapter16. 16.1. DowhatisdoneinExample16.2forsomeothersequenceof formulas. 16.2. YouneedtounwindDenitions16.1and16.2,keepingin mindthatyouaredealingwithformulasandsequencesofformulas, notjustarbitrarysequencesofsymbolsof LNorsequencesofsequences ofsymbols. 16.3. Ineachcase,useDenitions16.1and16.2,alongwiththe appropriatedenitionsfromrst-orderlogicandthetoolsdeveloped inProblems13.3and13.5. (1)Recallthatin LN,atermiseitheravariablesymbol, i.e. vkforsome k ,theconstantsymbol0,oftheform St forsome (shorter)term t ,or+ t1t2forsome(shorter)terms t1and t2. Term( n )needstocheckthelengthofthesequencecodedby n Ifthisisoflength1,itwillneedtocheckifthesymbolcodedis 0or vkforsome k ;otherwise,itneedstocheckifthesequence codedby n beginswithan S or+,andthenwhethertherest ofthesequenceconsistsofoneortwovalidterms.Primitive recursionislikelytobenecessaryinthelattercaseifyoucan't gureouthowtodoitusingthetoolsfromProblems13.3and 13.5. (2)Thisissimilartoshowing Term ( n )isprimitiverecursive.Recallthatin LN,aformulaisoftheformeither= t1t2forsome terms t1and t2,( 6 )forsome(shorter)formula ,( ) forsome(shorter)formulas and ,or 8 vi forsomevariable symbol viandsome(shorter)formula Formula( n )needsto checktherstsymbolofthesequencecodedby n toidentify whichcaseoughttoapplyandthentakeitfromthere.127

PAGE 140

128HINTSFORCHAPTERS15{18(3)Recallthatasentenceisjustaformulawithnofreevariable; thatis,everyoccurrenceofavariableisinthescopeofa quantier. (4)EachlogicalaxiomisaninstanceofoneoftheschemaA1{A8, orisageneralizationthereof. 16.4. Ineachcase,useDenitions16.1and16.2,togetherwiththe appropriatedenitionsfromrst-orderlogicandthetoolsdeveloped inProblems13.5and16.3. (1) p q isrecursiveand Logical isprimitiverecursive,so... (2)All Formulas( n )hastodoischeckthateveryelementofthe sequencecodedby n isthecodeofaformula,and Formula isalreadyknowntobeprimitiverecursive. (3) Inference( n )needstocheckthat n isthecodeofasequenceof formulas,withtheadditionalpropertythateither 'iis( 'j! 'k)or 'jis( 'i! 'k).Partofwhatgoesinto Formula( n ) maybehandyforcheckingtheadditionalproperty. (4)Recallthatadeductionfromisasequenceofformulas '1:::'kwhereeachformulaiseitherapremissorfollowsfrom precedingformulasbyModusPonens. (5) Conclusion( n;m )needstocheckthat n isthecodeofadeductionandthat m isthecodeofthelastformulainthat deduction. They'reallprimitiverecursiveif p q is,bytheway. 16.5. (1)Useunboundedminimalizationandtherelationsin Problem16.4todeneafunctionwhich,given n ,returnsthe n thintegerwhichcodesanelementofTh(). (2)Ifiscomplete,thenforanysentence ,either d e or d: musteventuallyturnupinanenumerationof p Th() q .The otherdirectionisreallyjustamatterofunwindingthedenitionsinvolved. HintsforChapter17. 17.16. Everydeductionfrom)-359(canbereplacedbyadeductionof withthesameconclusion. 17.14. Ifwereinsconsistentitwouldproveentirelytoomuch... 17.6. (1)AdaptExample17.1. (2)Usethe1-placefunctionsymbol S of LN. (3)Thereismuchlesstothispartthanmeetstheeye...

PAGE 141

HINTSFORCHAPTERS15{1812917.7. Ineachcase,youneedtousethegivenrepresentingformula todenetheoneyouneed. 17.8. Stringtogethertheformulasrepresenting g1,..., gm,and h with ^ sandputsomeexistentialquantiersinfront. 17.9. Firstshowthatthat < isrepresentableinTh( A )andthen exploitthisfact. 17.10. (1) n j m ifandonlyifthereissome k suchthat n k = m (2) n isprimeifandonlyifthereisno ` suchthat ` j n and 1 <`
PAGE 142

130HINTSFORCHAPTERS15{1818.5. (1)If)-310(wererecursive,youcouldgetacontradictionto theIncompletenessTheorem. (2)Ifwerecomplete,itcouldn'talsoberecursive. (3)Notethat A Th( N ). 18.6. Modifytheformularepresentingthefunction Conclusion(denedinProblem16.4)togetCon(). 18.7. Trytodoaproofbycontradictioninthreestages.First, ndaformula (withjust v1free)thatrepresents\ n isthecodeof asentencewhichcannotbeprovenfrom"andusetheFixed-Point Lemmatondasentence suchthat ` $ ( Spq).Second,show thatifisconsistent,then 0 .Third|the hard part|show that ` Con() ( Spq).Thisleadsdirectlytoacontradiction. 18.8. Notethat N j = A 18.9. Iftheconversewastrue, A wouldrunafoulofthe(First) IncompletenessTheorem. 18.10. Suppose,bywayofcontradiction,that p Th( N ) q wasdenablein N .Nowfollowtheproofofthe(First)IncompletenessTheorem ascloselyasyoucan.

PAGE 143

Appendices

PAGE 145

APPENDIXAALittleSetTheoryThisapppendixismeanttoprovideaninformalsummaryofthe notation,denitions,andfactsaboutsetsneededinChapters1{9.For aproperintroductiontoelementarysettheory,try[ 8 ]or[ 10 ]. Definition A.1 Suppose X and Y aresets.Then (1) a 2 X meansthat a isan element of( i.e. athingin)theset X (2) X isasubsetof Y ,writtenas X Y ,if a 2 Y forevery a 2 X (3)The union of X and Y is X [ Y = f a j a 2 X or a 2 Y g (4)The intersection of X and Y is X \ Y = f a j a 2 X and a 2 Y g (5)The complementof Y relativeto X is X n Y = f a j a 2 X and a= 2 Y g (6)The crossproduct of X and Y is X Y = f ( a;b ) j a 2 X and b 2 Y g (7)The powerset of X is P ( X )= f Z j Z X g (8)[ X ]k= f Z j Z X and j Z j = k g isthesetofsubsetsof X of size k Ifallthesetsbeingdealtwithareallsubsetsofsomexedset Z thecomplementof Y Y ,isusuallytakentomeanthecomplement of Y relativeto Z .Itmaysometimesbenecessarytotakeunions, intersections,andcrossproductsofmorethantwosets. Definition A.2 Suppose A isasetand X = f Xaj a 2 A g isa familyofsetsindexedby A .Then (1)Theunionof X istheset S X = f z j9 a 2 A : z 2 Xag (2)Theintersectionof X istheset T X = f z j8 a 2 A : z 2 Xag (3)Thecrossproductof X isthesetofsequences(indexedby A ) Q X = Qa 2 AXa= f ( zaj a 2 A ) j8 a 2 A : za2 Xag Wewilldenotethecrossproductofaset X withitselftaken n times ( i.e. thesetofallsequencesoflength n ofelementsof X )by Xn. Definition A.3 If X isanyset,a k -placerelationon X isasubset R Xk.133

PAGE 146

134A.ALITTLESETTHEORYForexample,theset E = f 0 ; 2 ; 3 ;::: g ofevennaturalnumbersis a1-placerelationon N D = f ( x;y ) 2 N2j x divides y g isa2-place relationon N ,and S = f ( a;b;c ) 2 N3j a + b = c g isa3-placerelation on N .2-placerelationsareusuallycalledbinaryrelations. Definition A.4 Aset X is nite ifthereissome n 2 N such that X has n elements,andis innite otherwise. X is countable ifitis inniteandthereisa1-1ontofunction f : N X ,and uncountable if itisinnitebutnotcountable. Variousinnitesetsoccurfrequentlyinmathematics,suchas N (the naturalnumbers), Q (therationalnumbers),and R (therealnumbers). Manyoftheseareuncountable,suchas R .Thebasicfactsabout countablesetsneededtodotheproblemsarethefollowing. Proposition A.1 (1) If X isacountablesetand Y X then Y iseitherniteoracountable. (2) Suppose X = f Xnj n 2 N g isaniteorcountablefamilyof setssuchthateach Xniseitherniteorcountable.Then S X isalsoniteorcountable. (3) If X isanon-emptyniteorcountableset,then Xnisnite orcountableforeach n 1 (4) If X isanon-emptyniteorcountableset,thenthesetofall nitesequencesofelementsof X X
PAGE 147

APPENDIXBTheGreekAlphabetA alpha B beta )Tj/F21 1 Tf1.6261 0 TD( gamma delta E epsilon Z zeta H eta # theta I iota K kappa lambda M mu N nu O o omicron xi $ pi P % rho & sigma T tau upsilon phi X chi psi omega135

PAGE 149

APPENDIXCLogicLimericksDeductionTheorem ATheoremneisDeduction, Foritallowswork-reduction: Toshow\AimpliesB", AssumeAandproveB; Quiteoftenasimplerproduction. GeneralizationTheorem Wheninpremissthevariable'sbound, Togeta\forall"withoutwound, Generalization. Forcivilization Couldusesomehelpforreasoningsound. SoundnessTheorem It'sacriticallogicalcreed: Alwayscheckthatit'ssafetoproceed. Totellusdeductions Aretruthfulproductions, It'stheSoundnessoflogicweneed. CompletenessTheorem TheCompletenessoflogicsisG odel's. 'Tisadviceforlookingform odels: They'realwaysexistent Forstatementsconsistent, Mosthelpfulforlogicallab ors.137

PAGE 151

APPENDIXDGNUFreeDocumentationLicenseVersion1.2,November2002Copyright c 2000,2001,2002FreeSoftwareFoundation,Inc. 59TemplePlace,Suite330,Boston,MA02111-1307USA Everyoneispermittedtocopyanddistributeverbatimcopiesof thislicensedocument,butchangingitisnotallowed.0.PREAMBLE ThepurposeofthisLicenseistomakeamanual,textbook,or otherfunctionalandusefuldocument\free"inthesenseoffreedom: toassureeveryonetheeectivefreedomtocopyandredistributeit, withorwithoutmodifyingit,eithercommerciallyornoncommercially. Secondarily,thisLicensepreservesfortheauthorandpublisheraway togetcreditfortheirwork,whilenotbeingconsideredresponsiblefor modicationsmadebyothers. ThisLicenseisakindof\copyleft",whichmeansthatderivative worksofthedocumentmustthemselvesbefreeinthesamesense. ItcomplementstheGNUGeneralPublicLicense,whichisacopyleft licensedesignedforfreesoftware. WehavedesignedthisLicenseinordertouseitformanualsfor freesoftware,becausefreesoftwareneedsfreedocumentation:afree programshouldcomewithmanualsprovidingthesamefreedomsthat thesoftwaredoes.ButthisLicenseisnotlimitedtosoftwaremanuals; itcanbeusedforanytextualwork,regardlessofsubjectmatteror whetheritispublishedasaprintedbook.WerecommendthisLicense principallyforworkswhosepurposeisinstructionorreference. 1.APPLICABILITYANDDEFINITIONS ThisLicenseappliestoanymanualorotherwork,inanymedium, thatcontainsanoticeplacedbythecopyrightholdersayingitcan bedistributedunderthetermsofthisLicense.Suchanoticegrantsa world-wide,royalty-freelicense,unlimitedinduration,tousethatwork undertheconditionsstatedherein.The\Document",below,refersto anysuchmanualorwork.Anymemberofthepublicisalicensee,and139

PAGE 152

140D.GNUFREEDOCUMENTATIONLICENSEisaddressedas\you".Youacceptthelicenseifyoucopy,modifyor distributetheworkinawayrequiringpermissionundercopyrightlaw. A\ModiedVersion"oftheDocumentmeansanyworkcontainingtheDocumentoraportionofit,eithercopiedverbatim,orwith modicationsand/ortranslatedintoanotherlanguage. A\SecondarySection"isanamedappendixorafront-mattersectionoftheDocumentthatdealsexclusivelywiththerelationshipof thepublishersorauthorsoftheDocumenttotheDocument'soverall subject(ortorelatedmatters)andcontainsnothingthatcouldfall directlywithinthatoverallsubject.(Thus,iftheDocumentisinpart atextbookofmathematics,aSecondarySectionmaynotexplainany mathematics.)Therelationshipcouldbeamatterofhistoricalconnectionwiththesubjectorwithrelatedmatters,oroflegal,commercial, philosophical,ethicalorpoliticalpositionregardingthem. The\InvariantSections"arecertainSecondarySectionswhosetitlesaredesignated,asbeingthoseofInvariantSections,inthenotice thatsaysthattheDocumentisreleasedunderthisLicense.Ifasection doesnotttheabovedenitionofSecondarythenitisnotallowedto bedesignatedasInvariant.TheDocumentmaycontainzeroInvariantSections.IftheDocumentdoesnotidentifyanyInvariantSections thentherearenone. The\CoverTexts"arecertainshortpassagesoftextthatarelisted, asFront-CoverTextsorBack-CoverTexts,inthenoticethatsaysthat theDocumentisreleasedunderthisLicense.AFront-CoverTextmay beatmost5words,andaBack-CoverTextmaybeatmost25words. A\Transparent"copyoftheDocumentmeansamachine-readable copy,representedinaformatwhosespecicationisavailabletothe generalpublic,thatissuitableforrevisingthedocumentstraightforwardlywithgenerictexteditorsor(forimagescomposedofpixels) genericpaintprogramsor(fordrawings)somewidelyavailabledrawing editor,andthatissuitableforinputtotextformattersorforautomatic translationtoavarietyofformatssuitableforinputtotextformatters. AcopymadeinanotherwiseTransparentleformatwhosemarkup, orabsenceofmarkup,hasbeenarrangedtothwartordiscouragesubsequentmodicationbyreadersisnotTransparent.Animageformat isnotTransparentifusedforanysubstantialamountoftext.Acopy thatisnot\Transparent"iscalled\Opaque". ExamplesofsuitableformatsforTransparentcopiesincludeplain ASCIIwithoutmarkup,Texinfoinputformat,LaTeXinputformat, SGMLorXMLusingapubliclyavailableDTD,andstandard-conforming simpleHTML,PostScriptorPDFdesignedforhumanmodication. ExamplesoftransparentimageformatsincludePNG,XCFandJPG.

PAGE 153

2.VERBATIMCOPYING141Opaqueformatsincludeproprietaryformatsthatcanbereadand editedonlybyproprietarywordprocessors,SGMLorXMLforwhich theDTDand/orprocessingtoolsarenotgenerallyavailable,andthe machine-generatedHTML,PostScriptorPDFproducedbysomeword processorsforoutputpurposesonly. The\TitlePage"means,foraprintedbook,thetitlepageitself, plussuchfollowingpagesasareneededtohold,legibly,thematerial thisLicenserequirestoappearinthetitlepage.Forworksinformats whichdonothaveanytitlepageassuch,\TitlePage"meansthetext nearthemostprominentappearanceofthework'stitle,precedingthe beginningofthebodyofthetext. Asection\EntitledXYZ"meansanamedsubunitoftheDocumentwhosetitleeitherispreciselyXYZorcontainsXYZinparenthesesfollowingtextthattranslatesXYZinanotherlanguage.(Here XYZstandsforaspecicsectionnamementionedbelow,suchas\Acknowledgements",\Dedications",\Endorsements",or\History".)To \PreservetheTitle"ofsuchasectionwhenyoumodifytheDocument meansthatitremainsasection\EntitledXYZ"accordingtothisdefinition. TheDocumentmayincludeWarrantyDisclaimersnexttothenoticewhichstatesthatthisLicenseappliestotheDocument.These WarrantyDisclaimersareconsideredtobeincludedbyreferencein thisLicense,butonlyasregardsdisclaimingwarranties:anyotherimplicationthattheseWarrantyDisclaimersmayhaveisvoidandhasno eectonthemeaningofthisLicense. 2.VERBATIMCOPYING YoumaycopyanddistributetheDocumentinanymedium,eithercommerciallyornoncommercially,providedthatthisLicense,the copyrightnotices,andthelicensenoticesayingthisLicenseappliesto theDocumentarereproducedinallcopies,andthatyouaddnoother conditionswhatsoevertothoseofthisLicense.Youmaynotusetechnicalmeasurestoobstructorcontrolthereadingorfurthercopyingof thecopiesyoumakeordistribute.However,youmayacceptcompensationinexchangeforcopies.Ifyoudistributealargeenoughnumber ofcopiesyoumustalsofollowtheconditionsinsection3. Youmayalsolendcopies,underthesameconditionsstatedabove, andyoumaypubliclydisplaycopies.

PAGE 154

142D.GNUFREEDOCUMENTATIONLICENSE3.COPYINGINQUANTITY Ifyoupublishprintedcopies(orcopiesinmediathatcommonly haveprintedcovers)oftheDocument,numberingmorethan100,and theDocument'slicensenoticerequiresCoverTexts,youmustenclose thecopiesincoversthatcarry,clearlyandlegibly,alltheseCover Texts:Front-CoverTextsonthefrontcover,andBack-CoverTextson thebackcover.Bothcoversmustalsoclearlyandlegiblyidentifyyouas thepublisherofthesecopies.Thefrontcovermustpresentthefulltitle withallwordsofthetitleequallyprominentandvisible.Youmayadd othermaterialonthecoversinaddition.Copyingwithchangeslimited tothecovers,aslongastheypreservethetitleoftheDocumentand satisfytheseconditions,canbetreatedasverbatimcopyinginother respects. Iftherequiredtextsforeithercoveraretoovoluminoustotlegibly, youshouldputtherstoneslisted(asmanyastreasonably)onthe actualcover,andcontinuetherestontoadjacentpages. IfyoupublishordistributeOpaquecopiesoftheDocumentnumberingmorethan100,youmusteitherincludeamachine-readable TransparentcopyalongwitheachOpaquecopy,orstateinorwith eachOpaquecopyacomputer-networklocationfromwhichthegeneralnetwork-usingpublichasaccesstodownloadusingpublic-standard networkprotocolsacompleteTransparentcopyoftheDocument,free ofaddedmaterial.Ifyouusethelatteroption,youmusttakereasonablyprudentsteps,whenyoubegindistributionofOpaquecopiesin quantity,toensurethatthisTransparentcopywillremainthusaccessibleatthestatedlocationuntilatleastoneyearafterthelasttimeyou distributeanOpaquecopy(directlyorthroughyouragentsorretailers) ofthateditiontothepublic. Itisrequested,butnotrequired,thatyoucontacttheauthorsof theDocumentwellbeforeredistributinganylargenumberofcopies, togivethemachancetoprovideyouwithanupdatedversionofthe Document. 4.MODIFICATIONS YoumaycopyanddistributeaModiedVersionoftheDocument undertheconditionsofsections2and3above,providedthatyoureleasetheModiedVersionunderpreciselythisLicense,withtheModiedVersionllingtheroleoftheDocument,thuslicensingdistribution andmodicationoftheModiedVersiontowhoeverpossessesacopy ofit.Inaddition,youmustdothesethingsintheModiedVersion:

PAGE 155

4.MODIFICATIONS143A.UseintheTitlePage(andonthecovers,ifany)atitledistinct fromthatoftheDocument,andfromthoseofpreviousversions(whichshould,iftherewereany,belistedintheHistory sectionoftheDocument).Youmayusethesametitleasa previousversioniftheoriginalpublisherofthatversiongives permission. B.ListontheTitlePage,asauthors,oneormorepersonsor entitiesresponsibleforauthorshipofthemodicationsinthe ModiedVersion,togetherwithatleastveoftheprincipal authorsoftheDocument(allofitsprincipalauthors,ifithas fewerthanve),unlesstheyreleaseyoufromthisrequirement. C.StateontheTitlepagethenameofthepublisheroftheModiedVersion,asthepublisher. D.PreserveallthecopyrightnoticesoftheDocument. E.Addanappropriatecopyrightnoticeforyourmodications adjacenttotheothercopyrightnotices. F.Include,immediatelyafterthecopyrightnotices,alicensenoticegivingthepublicpermissiontousetheModiedVersion underthetermsofthisLicense,intheformshownintheAddendumbelow. G.PreserveinthatlicensenoticethefulllistsofInvariantSectionsandrequiredCoverTextsgivenintheDocument'slicense notice. H.IncludeanunalteredcopyofthisLicense. I.PreservethesectionEntitled\History",PreserveitsTitle,and addtoitanitemstatingatleastthetitle,year,newauthors, andpublisheroftheModiedVersionasgivenontheTitle Page.IfthereisnosectionEntitled\History"intheDocument,createonestatingthetitle,year,authors,andpublisher oftheDocumentasgivenonitsTitlePage,thenaddanitem describingtheModiedVersionasstatedintheprevioussentence. J.Preservethenetworklocation,ifany,givenintheDocument forpublicaccesstoaTransparentcopyoftheDocument,and likewisethenetworklocationsgivenintheDocumentforpreviousversionsitwasbasedon.Thesemaybeplacedinthe "History"section.Youmayomitanetworklocationforawork thatwaspublishedatleastfouryearsbeforetheDocumentitself,oriftheoriginalpublisheroftheversionitreferstogives permission. K.ForanysectionEntitled\Acknowledgements"or\Dedications", PreservetheTitleofthesection,andpreserveinthesection

PAGE 156

144D.GNUFREEDOCUMENTATIONLICENSEallthesubstanceandtoneofeachofthecontributoracknowledgementsand/ordedicationsgiventherein. L.PreservealltheInvariantSectionsoftheDocument,unaltered intheirtextandintheirtitles.Sectionnumbersortheequivalentarenotconsideredpartofthesectiontitles. M.DeleteanysectionEntitled\Endorsements".Suchasection maynotbeincludedintheModiedVersion. N.DonotretitleanyexistingsectiontobeEntitled\Endorsements"ortoconictintitlewithanyInvariantSection. O.PreserveanyWarrantyDisclaimers. IftheModiedVersionincludesnewfront-mattersectionsorappendicesthatqualifyasSecondarySectionsandcontainnomaterialcopied fromtheDocument,youmayatyouroptiondesignatesomeorallof thesesectionsasinvariant.Todothis,addtheirtitlestothelistof InvariantSectionsintheModiedVersion'slicensenotice.Thesetitles mustbedistinctfromanyothersectiontitles. YoumayaddasectionEntitled\Endorsements",provideditcontainsnothingbutendorsementsofyourModiedVersionbyvarious parties{forexample,statementsofpeerrevieworthatthetexthas beenapprovedbyanorganizationastheauthoritativedenitionofa standard. YoumayaddapassageofuptovewordsasaFront-CoverText, andapassageofupto25wordsasaBack-CoverText,totheend ofthelistofCoverTextsintheModiedVersion.Onlyonepassage ofFront-CoverTextandoneofBack-CoverTextmaybeaddedby (orthrougharrangementsmadeby)anyoneentity.IftheDocument alreadyincludesacovertextforthesamecover,previouslyaddedby youorbyarrangementmadebythesameentityyouareactingon behalfof,youmaynotaddanother;butyoumayreplacetheoldone, onexplicitpermissionfromthepreviouspublisherthataddedtheold one. Theauthor(s)andpublisher(s)oftheDocumentdonotbythis Licensegivepermissiontousetheirnamesforpublicityforortoassert orimplyendorsementofanyModiedVersion. 5.COMBININGDOCUMENTS YoumaycombinetheDocumentwithotherdocumentsreleasedunderthisLicense,underthetermsdenedinsection4aboveformodied versions,providedthatyouincludeinthecombinationalloftheInvariantSectionsofalloftheoriginaldocuments,unmodied,andlistthem

PAGE 157

7.AGGREGATIONWITHINDEPENDENTWORKS145allasInvariantSectionsofyourcombinedworkinitslicensenotice, andthatyoupreservealltheirWarrantyDisclaimers. ThecombinedworkneedonlycontainonecopyofthisLicense, andmultipleidenticalInvariantSectionsmaybereplacedwithasingle copy.IftherearemultipleInvariantSectionswiththesamenamebut dierentcontents,makethetitleofeachsuchsectionuniquebyadding attheendofit,inparentheses,thenameoftheoriginalauthoror publisherofthatsectionifknown,orelseauniquenumber.Makethe sameadjustmenttothesectiontitlesinthelistofInvariantSections inthelicensenoticeofthecombinedwork. Inthecombination,youmustcombineanysectionsEntitled\History"inthevariousoriginaldocuments,formingonesectionEntitled\History";likewisecombineanysectionsEntitled\Acknowledgements",andanysectionsEntitled\Dedications".Youmustdeleteall sectionsEntitled\Endorsements." 6.COLLECTIONSOFDOCUMENTS YoumaymakeacollectionconsistingoftheDocumentandother documentsreleasedunderthisLicense,andreplacetheindividualcopies ofthisLicenseinthevariousdocumentswithasinglecopythatis includedinthecollection,providedthatyoufollowtherulesofthis Licenseforverbatimcopyingofeachofthedocumentsinallother respects. Youmayextractasingledocumentfromsuchacollection,and distributeitindividuallyunderthisLicense,providedyouinsertacopy ofthisLicenseintotheextracteddocument,andfollowthisLicensein allotherrespectsregardingverbatimcopyingofthatdocument. 7.AGGREGATIONWITHINDEPENDENTWORKS AcompilationoftheDocumentoritsderivativeswithotherseparateandindependentdocumentsorworks,inoronavolumeofa storageordistributionmedium,iscalledan\aggregate"ifthecopyrightresultingfromthecompilationisnotusedtolimitthelegalrights ofthecompilation'susersbeyondwhattheindividualworkspermit. WhentheDocumentisincludedanaggregate,thisLicensedoesnot applytotheotherworksintheaggregatewhicharenotthemselves derivativeworksoftheDocument. IftheCoverTextrequirementofsection3isapplicabletothese copiesoftheDocument,theniftheDocumentislessthanonehalfofthe entireaggregate,theDocument'sCoverTextsmaybeplacedoncoversthatbrackettheDocumentwithintheaggregate,ortheelectronic

PAGE 158

146D.GNUFREEDOCUMENTATIONLICENSEequivalentofcoversiftheDocumentisinelectronicform.Otherwise theymustappearonprintedcoversthatbracketthewholeaggregate. 8.TRANSLATION Translationisconsideredakindofmodication,soyoumaydistributetranslationsoftheDocumentunderthetermsofsection4.ReplacingInvariantSectionswithtranslationsrequiresspecialpermission fromtheircopyrightholders,butyoumayincludetranslationsofsome orallInvariantSectionsinadditiontotheoriginalversionsofthese InvariantSections.YoumayincludeatranslationofthisLicense,and allthelicensenoticesintheDocument,andanyWarranyDisclaimers, providedthatyoualsoincludetheoriginalEnglishversionofthisLicenseandtheoriginalversionsofthosenoticesanddisclaimers.Incase ofadisagreementbetweenthetranslationandtheoriginalversionof thisLicenseoranoticeordisclaimer,theoriginalversionwillprevail. IfasectionintheDocumentisEntitled\Acknowledgements",\Dedications",or\History",therequirement(section4)toPreserveitsTitle (section1)willtypicallyrequirechangingtheactualtitle. 9.TERMINATION Youmaynotcopy,modify,sublicense,ordistributetheDocument exceptasexpresslyprovidedforunderthisLicense.Anyotherattempt tocopy,modify,sublicenseordistributetheDocumentisvoid,and willautomaticallyterminateyourrightsunderthisLicense.However, partieswhohavereceivedcopies,orrights,fromyouunderthisLicense willnothavetheirlicensesterminatedsolongassuchpartiesremain infullcompliance. 10.FUTUREREVISIONSOFTHISLICENSE TheFreeSoftwareFoundationmaypublishnew,revisedversionsof theGNUFreeDocumentationLicensefromtimetotime.Suchnewversionswillbesimilarinspirittothepresentversion,butmaydierindetailtoaddressnewproblemsorconcerns.Seehttp://www.gnu.org/copyleft/. EachversionoftheLicenseisgivenadistinguishingversionnumber. IftheDocumentspeciesthataparticularnumberedversionofthis License\oranylaterversion"appliestoit,youhavetheoptionof followingthetermsandconditionseitherofthatspeciedversionor ofanylaterversionthathasbeenpublished(notasadraft)bythe FreeSoftwareFoundation.IftheDocumentdoesnotspecifyaversion numberofthisLicense,youmaychooseanyversioneverpublished(not asadraft)bytheFreeSoftwareFoundation.

PAGE 159

Bibliography[1]JonBarwise(ed.), HandbookofMathematicalLogic ,NorthHolland,Amsterdam,1977,ISBN0-7204-2285-X. [2]J.BarwiseandJ.Etchemendy, Language,ProofandLogic ,SevenBridges Press,NewYork,2000,ISBN1-889119-08-3. [3]MerrieBergman,JamesMoor,andJackNelson, TheLogicBook ,Random House,NY,1980,ISBN0-394-32323-8. [4]C.C.ChangandH.J.Keisler, ModelTheory ,thirded.,NorthHolland,Amsterdam,1990. [5]MartinDavis, ComputabilityandUnsolvability ,McGraw-Hill,NewYork,1958; Dover,NewYork,1982,ISBN0-486-61471-9. [6]MartinDavis(ed.), TheUndecidable;BasicPapersOnUndecidablePropositions,UnsolvableProblemsAndComputableFunctions ,RavenPress,New York,1965. [7]HerbertB.Enderton, AMathematicalIntroductiontoLogic ,AcademicPress, NewYork,1972. [8]PaulR.Halmos, NaiveSetTheory ,UndergraduateTextsinMathematics, Springer-Verlag,NewYork,1974,ISBN0-387-90092-6. [9]JeanvanHeijenoort, FromFregetoG odel ,HarvardUniversityPress,Cambridge,1967,ISBN0-674-32449-8. [10]JamesM.Henle, AnOutlineofSetTheory ,ProblemBooksinMathematics, Springer-Verlag,NewYork,1986,ISBN0-387-96368-5. [11]DouglasR.Hofstadter, G odel,Escher,Bach ,RandomHouse,NewYork,1979, ISBN0-394-74502-7. [12]JeromeMalitz, IntroductiontoMathematicalLogic ,Springer-Verlag,New York,1979,ISBN0-387-90346-1. [13]Yu.I.Manin, ACourseinMathematicalLogic ,GraduateTextsinMathematics53,Springer-Verlag,NewYork,1977,ISBN0-387-90243-0. [14]RogerPenrose, TheEmperor'sNewMind ,OxfordUniversityPress,Oxford, 1989. [15]RogerPenrose, ShadowsoftheMind ,OxfordUniversityPress,Oxford,1994, ISBN0099582112. [16]T.Rado, Onnon-computablefunctions ,BellSystemTech.J. 41 (1962),877{ 884. [17]RaymondM.Smullyan, G odel'sIncompletenessTheorems ,OxfordUniversity Press,Oxford,1992,ISBN0-19-504672-2.147

PAGE 161

Index(,3,24 ),3,24 =,24,25 \ ,89,133 [ ,89,133 9 ,30 8 ,24,25,30 $ ,5,30 2 ,133 ^ ,5,30,89 : P ,89 : ,3,24,25,89 ,5,30,89 j =,10,35,37,38 2 ,10,36,37 Q ,133 ` ,12,43 n ,133 ,133 ,133 ,3,24,25 A ,117 A1,11,42 A2,11,42 A3,11,42 A4,42 A5,42 A6,42 A7,42 A8,43 An,3 Con(),124 p q ,115 dom( f ),81 F ,7 f : Nk! N ,81 ( Sm10 ;:::;Smk0),118 'x t,42 L ,24 L1,26 L=,26 LF,26 LG,53 LN,26,112 LO,26 LP,3 LS,26 LNT,25 M ,33 N ,81,134 N ,33,112 N1,117 N2,117 N3,117 N4,117 N5,117 N6,117 N7,117 N8,117 N9,117 Nk,81 Nkn P ,89 P ,133 P \ Q ,89 P [ Q ,89 P ^ Q ,89 P Q ,89 k i,85,120 Q ,134 R ,134 ran( f ),81 Rn,55 S ,6149

PAGE 162

150INDEXSm0,118 T ,7 Th,39,45 Th(),112 Th( N ),124 vn,24 Xn,133 [ X ]k,133 Y ,133 A ,90 ,90 Codek,97,106 Comp ,98 CompM,96 Conclusion,115 Decode ,97,106 Deduction,115 Diff ,83,88 Div ,90,120 Element ,90,120 Entry ,96 Equal ,89 Exp ,88 Fact ,88 Formulas ,115 Formula ,115 iN,82 Inference ,115 IsPrime ,90,120 Length ,90,120 Logical ,115 Mult ,88 O ,83,85,120 Power ,90,120 Pred ,83,88 Premiss,115 Prime ,90,120 SIM ,106,107 Sentence ,115 Sim ,98 SimM,97 Step ,97,106 StepM,96,106 Subseq ,90 Sub ,123 Sum ,83,87 S ,83,85,120 TapePosSeq ,96,106 TapePos ,96,105 Term ,115 abbreviations,5,30 Ackerman'sFunction,90 all,x alphabet,75 and,x,5 assignment,7,34,35 extended,35 truth,7 atomicformulas,3,27 axiom,11,28,39 forbasicarithmetic,117 N1,117 N2,117 N3,117 N4,117 N5,117 N6,117 N7,117 N8,117 N9,117 logical,43 schema,11,42 A1,11,42 A2,11,42 A3,11,42 A4,42 A5,42 A6,42 A7,42 A8,43 blankcell,67 blanktape,67 boundvariable,29 boundedminimalization,92 busybeavercompetition,83 n -stateentry,83 scorein,83 cell,67 blank,67 marked,67 scanned,68 characteristicfunction,82 chicken,134 Church'sThesis,xi

PAGE 163

INDEX151clique,55 code G odel,113 ofsequences,113 ofsymbolsof LN,113 ofasequenceoftapepositions,96 ofatapeposition,95 ofaTuringmachine,97 CompactnessTheorem,16,51 applicationsof,53 complement,133 completesetofsentences,112 completeness,112 CompletenessTheorem,16,50,137 composition,85 computable function,82 setofformulas,115 computation,71 partial,71 connectives,3,4,24 consistent,15,47 maximally,15,48 constant,24,25,31,33,35 constantfunction,85 contradiction,9,38 convention commonsymbols,25 parentheses,5,30 countable,134 crash,70,78 crossproduct,133 decisionproblem,x deduction,12,43 DeductionTheorem,13,44,137 denable function,125 relation,125 domain(ofafunction),81 edge,54 egg,134 element,133 elementaryequivalence,56 Entscheidungsproblem,x,111 equality,24,25 equivalence elementary,56 existentialquantier,30 extensionofalanguage,30 nite,134 rst-order languagefornumbertheory,112 languages,23 logic,x,23 Fixed-PointLemma,123 forall,25 formula,3,27 atomic,3,27 uniquereadability,6,32 freevariable,29 function,24,31,33,35 k -place,24,25,81 boundedminimalizationof,92 compositionof,85 computable,82 constant,85 denablein N ,125 domainof,81 identity,82 initial,85 partial,81 primitiverecursionof,87 primitiverecursive,88 projection,85 recursive,x,92 regular,92 successor,85 Turingcomputable,82 unboundedminimalizationof,91 zero,85 G odelcode ofsequences,113 ofsymbolsof LN,113 G odelIncompletenessTheorem,111 FirstIncompletenessTheorem,124 SecondIncompletenessTheorem,124 generalization,42 GeneralizationTheorem,45,137 OnConstants,45 gothiccharacters,33 graph,54 Greekcharacters,3,28,135 halt,70,78

PAGE 164

152INDEXHaltingProblem,98 head,67 multiple,75 separate,75 identityfunction,82 if...then,x,3,25 ifandonlyif,5 implies,10,38 IncompletenessTheorem,111 G odel'sFirst,124 G odel'sSecond,124 inconsistent,15,47 independentset,55 inferencerule,11 innite,134 InniteRamsey'sTheorem,55 innitesimal,57 initialfunction,85 inputtape,71 intersection,133 isomorphismofstructures,55 John,134 k -placefunction,81 k -placerelation,81 language,26,31 extensionof,30 rst-order,23 rst-ordernumbertheory,112 formal,ix natural,ix propositional,3 limericks,137 logic rst-order,x,23 mathematical,ix naturaldeductive,ix predicate,3 propositional,x,3 sentential,3 logicalaxiom,43 machine,69 Turing,xi,67,69 markedcell,67 mathematicallogic,ix maximallyconsistent,15,48 metalanguage,31 metatheorem,31 minimalization bounded,92 unbounded,91 model,37 ModusPonens,11,43 MP,11,43 naturaldeductivelogic,ix naturalnumbers,81 non-standardmodel,55,57 oftherealnumbers,57 not,x,3,25 n -state Turingmachine,69 entryinbusybeavercompetition, 83 numbertheory rst-orderlanguagefor,112 or,x,5 outputtape,71 parentheses,3,24 conventions,5,30 doingwithout,4 partial computation,71 function,81 position tape,68 powerset,133 predicate,24,25 predicatelogic,3 premiss,12,43 primitiverecursion,87 primitiverecursive function,88 recursiverelation,89 projectionfunction,85 proof,12,43 propositionallogic,x,3 proves,12,43 punctuation,3,25 quantier existential,30 scopeof,30 universal,24,25,30

PAGE 165

INDEX153Ramseynumber,55 Ramsey'sTheorem,55 Innite,55 rangeofafunction,81 r.e.,99 recursionprimitive,87 recursive function,92 functions,xi relation,93 setofformulas,115 recursivelyenumerable,99 setofformulas,115 regularfunction,92 relation,24,31,33 binary,25,134 characteristicfunctionof,82 denablein N ,125 k -place,24,25,81,133 primitiverecursive,89 recursive,93 Turingcomputable,93 represent(inTh()) afunction,118 arelation,119 representable(inTh()) function,118 relation,119 ruleofinference,11,43 satisable,9,37 satises,9,36,37 scannedcell,68 scanner,67,75 scopeofaquantier,30 score inbusybeavercompetition,83 sentence,29 sententiallogic,3 sequenceoftapepositions codeof,96 settheory,133 SoundnessTheorem,15,47,137 state,68,69 structure,33 subformula,6,29 subgraph,54 subset,133 substitutable,41 substitution,41 successor function,85 tapeposition,71 symbols,3,24 logical,24 non-logical,24 table ofaTuringmachine,70 tape,67 blank,67 higher-dimensional,75 input,71 multiple,75 output,71 tapeposition,68 codeof,95 codeofasequenceof,96 successor,71 two-wayinnite,75,78 Tarski'sUndenabilityTheorem,125 tautology,9,38 term,26,31,35 theorem,31 theory,39,45 of N ,124 ofasetofsentences,112 thereis,x TM,69 trueinastructure,37 truth assignment,7 inastructure,36,37 table,8,9 values,7 Turingcomputable function,82 relation,93 Turingmachine,xi,67,69 codeof,97 crash,70 halt,70 n -state,69 tablefor,70 universal,95,97 two-wayinnitetape,75,78 unarynotation,82

PAGE 166

154INDEXunboundedminimalization,91 uncountable,134 UndenabilityTheorem,Tarski's,125 union,133 uniquereadability offormulas,6,32 ofterms,32 UniqueReadabilityTheorem,6,32 universal quantier,30 Turingmachine,95,97 universe(ofastructure),33 UTM,95 variable,24,31,34,35 bound,29 free,29 vertex,54 witnesses,48 Word,134 zerofunction,85