(**Itisconvenienttobeabletotestdefinitionsbeforestartingtoprovethingsaboutthem.Wecanverifythatoursemanticsissensiblebyevaluatingsomesampleuses,usingthecommand%\index{Vernacularcommands!Eval}%[Eval].Thiscommandtakesanargumentexpressinga%\index{reductionstrategy}%_reductionstrategy_,oran%``%#"#order of evaluation.#"#%''%UnlikewithML,whichhardcodesan_eager_reductionstrategy,orHaskell,whichhardcodesa_lazy_strategy,inCoqwearefreetochoosebetweentheseandmanyotherordersofevaluation,becauseallCoqprogramsterminate.Infact,Coqsilentlychecked%\index{terminationchecking}%terminationofour[Fixpoint]definitionabove,usingasimpleheuristicbasedonmonotonicallydecreasingsizeofargumentsacrossrecursivecalls.Specifically,recursivecallsmustbemadeonargumentsthatwerepulledoutoftheoriginalrecursiveargumentwith[match]expressions.(InChapter7,wewillseesomewaysofgettingaroundthisrestriction,thoughsimplyremovingtherestrictionwouldleaveCoquselessasatheoremprovingtool,forreasonswewillstarttolearnaboutinthenextchapter.)
(**Itisconvenienttobeabletotestdefinitionsbeforestartingtoprovethingsaboutthem.Wecanverifythatoursemanticsissensiblebyevaluatingsomesampleuses,usingthecommand%\index{Vernacularcommands!Eval}%[Eval].Thiscommandtakesanargumentexpressinga%\index{reductionstrategy}%_reductionstrategy_,oran"order of evaluation."UnlikewithML,whichhardcodesan_eager_reductionstrategy,orHaskell,whichhardcodesa_lazy_strategy,inCoqwearefreetochoosebetweentheseandmanyotherordersofevaluation,becauseallCoqprogramsterminate.Infact,Coqsilentlychecked%\index{terminationchecking}%terminationofour[Fixpoint]definitionabove,usingasimpleheuristicbasedonmonotonicallydecreasingsizeofargumentsacrossrecursivecalls.Specifically,recursivecallsmustbemadeonargumentsthatwerepulledoutoftheoriginalrecursiveargumentwith[match]expressions.(InChapter7,wewillseesomewaysofgettingaroundthisrestriction,thoughsimplyremovingtherestrictionwouldleaveCoquselessasatheoremprovingtool,forreasonswewillstarttolearnaboutinthenextchapter.)
(**Thoughapencil-and-paperproofmightclockoutatthispoint,writing%``%#"#by a routine induction on [e],#"#%''%itturnsoutnottomakesensetoattackthisproofdirectly.Weneedtousethestandardtrickof%\index{strengtheningtheinductionhypothesis}%_strengtheningtheinductionhypothesis_.Wedothatbyprovinganauxiliarylemma,usingthecommand[Lemma]thatisasynonymfor[Theorem],conventionallyusedforlessimportanttheoremsthatappearintheproofsofprimarytheorems.%\index{Vernacularcommands!Lemma}%*)
(**Thoughapencil-and-paperproofmightclockoutatthispoint,writing"by a routine induction on [e],"itturnsoutnottomakesensetoattackthisproofdirectly.Weneedtousethestandardtrickof%\index{strengtheningtheinductionhypothesis}%_strengtheningtheinductionhypothesis_.Wedothatbyprovinganauxiliarylemma,usingthecommand[Lemma]thatisasynonymfor[Theorem],conventionallyusedforlessimportanttheoremsthatappearintheproofsofprimarytheorems.%\index{Vernacularcommands!Lemma}%*)