(**ThemostpopularCoqsyntaxencodingtodayisthe%\textit{%#<i>#locallynameless#</i>#%}%style,whichhasbeenaroundforawhilebutwaspopularizedrecentlybyAydemiretal.,followingamethodologysummarizedintheirpaper"Engineering Formal Metatheory."#<ahref="http://www.cis.upenn.edu/~plclub/oregon08/">#Aspecializedtutorialbythatgroup#</a>#%\footnote{\url{http://www.cis.upenn.edu/~plclub/oregon08/}}% explains the approach, based on a library. In this section, we will build up all of the necessary ingredients from scratch.
(**ThemostpopularCoqsyntaxencodingtodayisthe%\textit{%#<i>#locallynameless#</i>#%}%style,whichhasbeenaroundforawhilebutwaspopularizedrecentlybyAydemiretal.,followingamethodologysummarizedintheirpaper%``%#"#Engineering Formal Metatheory.#"#%''%#<ahref="http://www.cis.upenn.edu/~plclub/oregon08/">#Aspecializedtutorialbythatgroup#</a>#%\footnote{\url{http://www.cis.upenn.edu/~plclub/oregon08/}}% explains the approach, based on a library. In this section, we will build up all of the necessary ingredients from scratch.
(**Thefirstunusualoperationweneedis%\textit{%#<i>#opening#</i>#%}%,wherewereplaceaparticularboundvariablewithaparticularfreevariable.Wheneverwe"go under a binder,"inthetypingjudgmentorelsewhere,wechooseanewfreevariabletoreplacetheoldboundvariableofthebinder.Openingimplementsthereplacementofonebytheother.ItislikeaspecializedversionofthesubstitutionfunctionweusedforpuredeBruijnterms.*)
(**Thefirstunusualoperationweneedis%\textit{%#<i>#opening#</i>#%}%,wherewereplaceaparticularboundvariablewithaparticularfreevariable.Wheneverwe%``%#"#go under a binder,#"#%''%inthetypingjudgmentorelsewhere,wechooseanewfreevariabletoreplacetheoldboundvariableofthebinder.Openingimplementsthereplacementofonebytheother.ItislikeaspecializedversionofthesubstitutionfunctionweusedforpuredeBruijnterms.Weimplementopeningwithboththerichly-typednaturalnumberequalitytest[eq_nat_dec]thatwehavediscussedpreviouslyandwithanotherstandardlibraryfunction[le_lt_dec],whichisananalogousrichly-typedtestfor[<=].*)