AProofoftheChurh-RosserTheoremfortheLambdaCalulusinHigherOrderLogiPeterV.HomeierU.S.DepartmentofDefense,homeiersaul.is.upenn.edu~homeierAbstrat.ThispaperdesribesaproofoftheChurh-RossertheoremwithintheHigherOrderLogi(HOL)theoremprover.ThisfollowstheproofbyTait/Martin-L of,preservingtheeleganeofthelassipresenta-tionbyBarendregt.Wemodelthelambdaaluluswithaname-arryingsyntax,asinpratiallanguages.Theproofissimpli edbyformingaquotientofthename-arryingsyntaxbythe -equivalenerelation,thusseparatingtheonernsof -equivaleneand -redution.1IntrodutionTheChurh-Rossertheoremstatestheon ueneproperty,thatifanexpressionmaybeevaluatedintwodi erentways,bothwillleadtothesameresult.Sinethe rstattemptstoprovethisin1936,manyimprovementshavebeenfound,in-ludingtheTait/Martin-L ofsimpli ationandtheTakahashiTriangle.AlassipresentationmaybefoundinBarendregt[1℄.Theproofsinvolvesophistiatedindutivearguments,whosepatternshavealsointriguedresearhersinmehani-allyhekedproof.The rstmehanialproofwaspresentedbyShankar[9℄,andhasbeenfollowedbyHuet[5℄,Nipkow[7℄,Pfenning[8℄,Vestergaard/Brotherston[11℄,andFord/Mason[2℄.Ofthese,onlyNipkowextendstheworkbeyond -redutiontoproofsofon uenefor -and -redution.Onekeyissueintheseproofsiswhetherthesyntaxofthelambdaalulusisrepresentedusingnamesforvariables,oradeBruijnrepresentation,wherenumbersareusedfornames.ThedeBruijnsyntaxismoreagreeablefortheChurh-Rosserproof,asitevadestheproblemof -equivalene.However,thename-arryingsyntaxismorerealisti,asthisismorerepresentativeofpro-gramminglanguagesingeneraluse.Beauseofthegreaterfaility,manyofthemehanialChurh-Rosserproofsmentionedproveon ueneforthedeBruijnsyntax[5,7,8℄.However,asin[2℄,wewishtoaddresstheissuesofname-arryingsyntax,inordertorelatemorediretlytopratialprogramminglanguages.Thepreseneofnamesraisesaskeyissuesthede nitionsof -equivalene,substitution,and -redution.Intwooftheaboveproofswherenamesweretreated[9,11℄,on uenewasprovedforanarbitraryintermixtureof -and -redution.Thisintermixturebredanunfortunateomplexity.2P.V.HomeierTheelegantpresentationbyBarendregt[1℄axesthisomplexitybytheBarendregtVariableConvention(BVC).OuraimwastofollowBarendregtasloselyaspossible,inludingmehanizingtheBVC.Wedividedtheonsiderationof -and -redutionintotwolayers,forminganewmodelofthesyntaxasthequotientoftheoriginalname-arryingsyntaxdividedbythe -equivalenerela-tion.ThisquotientlayerisexatlyisomorphitothedeBruijnsyntaxandgreatlysimpli estheChurh-Rosserproof.ThisisthesameapproahasFord/Mason[2℄.Wefoundthattherewasatleastasmuhworkinvolvedinformingthequotientoftheoriginallanguageasinalltheremainingworkofprovingon uene.OurHOLproofofChurh-Rosserontains7maintheories,whihmake77de nitionsandprove359theoremsin6minutes,54seondsona300MHzPentiumII.Theproofsheremayseemtobereasonedinnormallambdaalulus,butareatuallyinterpretationsoftheHOLtatisintomathematialEnglish.AfterprovingChurh-Rosserfor -redution,wetestedthelarityofthefoundationbyextendingthisworkintwoways:provingthediamondlemmabytheTakahashitriangle,andprovingChurh-Rosserfor -and -redution[1℄.The rsttookonehalfday,andtheseondtookfourdays.Spaepreludestheirpresentationhere,buttheHOLproofsareavailable[6℄.TheauthorwishestothankRandolphJohnson,BillLegato,BradMartin,SylvanPinsky,andFrankTaylorformanyhelpfulommentsandimprovements.2ThePre-LambdaCalulusWede nethepre-lambdaalulus( 1),beginningwiththetypeofterms,term1.Thetypeofvariablesisvar.Wealsouse 1toabbreviateterm1.De nition1. 1::=varj 1 1j var: 1Thisde nestermsinthelambdaalulusindutivelyaseitherbeingvari-ables,appliationsofatermrepresentingafuntiontoanothertermrepresentinganargument,orabstrationsoftermsbyavariable,whihrepresentfuntionsofoneargument.Thesetermsmaybeomparedforsyntatiequality(=).Wewilluset,u,e,M,andNastypialvariablesoftype 1,w,x,y,andzastypialvariablesoftypevar,rforsetsofvariables,andsforsubstitutions.Thisde nitionisreatedintheHOLlogibytheodeval_=Hol_datatype‘term1=Var1ofvar|App1ofterm1=term1|Lam1ofvar=term1‘;Thisreatesterm1asanewonretereursivetypewithintheHOLlogi,andVar1,App1,andLam1asonstrutorfuntions.Whennoonfusionmayresult,wewillusexforVar1x,tuforApp1tu,and x:tforLam1xt.Whenterm1isreated,Holdatatypeautomatiallyprovesseveraltheoremsthatharaterizethebehaviorofvaluesofthisnewtyperegardingstruturalindution,funtionexistene,ases,andonstrutordistintivenessandone-to-oneproperties.TheChurh-RosserTheoreminHigherOrderLogi3Weusethefuntionexistanetheoremtode nethefollowingfuntionsbyprimitivereursion,byindutiononthestrutureofterms.Wehereusemaxasanin xoperatorthatyieldsthemaximumofitsarguments.De nition2(Heightofaterm).HEIGHT1(x)def=0HEIGHT1(tu)def=(HEIGHT1tmaxHEIGHT1u)+1HEIGHT1( x:u)def=HEIGHT1u+1De nition3(Freevariablesofaterm).FV1(x)def=fxgFV1(tu)def=FV1t[FV1uFV1( x:u)def=FV1u fxgWeexpresspropersubstitutiononatermusingexpliitsimultaneoussubsti-tutions,asaseparatedatastruture.Theseombinea nitenumberofindividualsubstitutionsofexpressionsforvariablesintoonesubstitution,whereallareap-pliedsimultaneously.Theatualappliationofasubstitutiontoanexpressionisdonebyversionsofthe