[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-82409-en":3,"doc-seo-82409-105":29,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},82409,13056703020460,"Valentina","https://ap-avatar.wpscdn.com/avatar/be000253dac470eee5d?_k=1778207105932848923",8,"Research & Report","Bidirectional Elaborators à la Carte","Bidirectional Elaborators à la Carte presents an executable specification framework for correct-by-construction elaboration algorithms in dependently typed proof assistants. It introduces a dependently typed monadic DSL abstracted from specific representations of normal forms or conversion checking, embedding a bidirectionally typed Martin-Löf surface language via shallow embedding. The translation into core terms is guaranteed well-typed, stable under judgemental equality and substitution, yielding a new denotational interpretation of suspension of elaboration. A concrete elaboration algorithm is extracted from a presheaf model built on the bi-initial natural model of Martin-Löf type theory.","arXiv :2607 .09564v 1 [ cs .PL] 10 Jul 2026  \nBidirectional Elaborators à la Carte  \nExtended version with supplementary appendices  \nANDREW SLATTERY, University of Cambridge, United Kingdom JONATHAN STERLING, University of Cambridge, United Kingdom  \nSurface syntax in proof assistants like Rocq, Lean, Agda, and Idris is highly implicit, lacking many details that are needed for user-written code to denote precisely defined mathematical objects. Elaboration is an algorithm that accounts for these details by translating surface syntax to an explicit enough core syntax. The reliability and predictability of elaboration relies on several critical properties of the core type system, including decidability of judgemental equality and the injectivity of type constructors; these dependencies are witnessed in a concrete system by explicit calls to conversion checking and weak-head reduction subroutines.  \nWe introduce a dependently typed monadic domain specific language for the executable specification of correct-by-construction elaboration algorithms that is abstracted from any particular representation of normal forms or algorithm for conversion checking. In particular, we represent a bidirectionally typed surface language for Martin-Löf type theory by shallow embedding in this DSL so that the translation of surface terms into core terms amounts to elementary equational calculation. This translation is correct by construction in the sense that it cannot produce ill-typed terms, and is automatically stable under judgemental equality of core terms and even under substitution; from the latter property, we obtain a new denotational interpretation of the suspension of elaboration problems. Finally, a concrete elaboration algorithm is extracted by algebraic means from a presheaf model of the DSL built out of the bi-initial natural model of Martin-Löftype theory.  \n1 Introduction  \nPresent-day proof assistants based on dependent type theory (e.g. Rocq, Lean, Agda, and Idris) are all based on elaboration: rather than merely “checking” that user-written code is well-formed, elaboration is a process that transforms user-written code to a more explicit core syntax or fails with an error. The difference between surface syntax and its core representation is that the latter must contain all the information needed to precisely describe and distinguish a well-defined mathematical object, whereas surface syntax often omits annotations and coercions that would be burdensome fora programmer to write. The design of surface and core syntax are dialectically linked, conditioned both by ergonomic and mathematical concerns:  \n(1) Ergonomics: it is desirable for a programmer to avoid typing in bureaucratic annotations, arguments, and coercions when these can be reliably and predictably inserted by a machine.  \n(2) Mathematics: whatever information is made implicit in the surface syntax must be unambiguously and effectively reconstructible: this depends on mathematical metatheorems about the core language, e.g. normalisation, decidability, strengthening, etc.  \nExperts know well what kinds of decisions in core language design might impede the implementability of a reliable surface language, and (conversely) what constraints on core languages maybe required in order to enable various desirable surface language features. This folklore has not, however, prevented the promulgation of high-profile surface languages such as Lean’s in which (for example) the relation of definitional equality fails to be transitive;1 for a user, such a failure might result in needing more than one proof step to verify 􀁇 = 􀁾 even when 􀁇 and 􀁾 are related by a sequence of definitional equations. Scenarios like this challenge the objectivity of proof assistants, which rests on a carefully negotiated division of labour between operator and machine.  \n1Lean’s language reference [20] comments that its definitional equality is “reflexive and symmetric, but not transitive”.  \nAuthors’ Contac","cbCais20kgu3yxdh","https://ap.wps.com/l/cbCais20kgu3yxdh","pdf",827732,1,37,"English","en",105,"# Introduction\n## Surface vs core syntax in proof assistants\n## Design goals for elaboration properties\n## Monadic DSL for elaboration combinators","[{\"question\":\"What problem does elaboration solve in proof assistants based on dependent type theory?\",\"answer\":\"Elaboration transforms user-written surface syntax into a more explicit core syntax that contains all information needed to represent precisely defined mathematical objects, or it fails with an error when requirements are not met.\"},{\"question\":\"What guarantees does the proposed DSL-based translation provide?\",\"answer\":\"The translation cannot produce ill-typed terms, is stable under judgemental equality of core terms, and remains stable under substitution, enabling a denotational interpretation of suspended elaboration problems.\"},{\"question\":\"How is a concrete elaboration algorithm obtained in the paper?\",\"answer\":\"A concrete elaboration algorithm is extracted algebraically from a presheaf model of the DSL constructed from the bi-initial natural model of Martin-Löf type theory.\"}]",1784180176,93,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":27},"bidirectional-elaborators-a-la-carte","",{"@graph":35,"@context":85},[36,53,68],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/bidirectional-elaborators-a-la-carte/82409/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-21","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What problem does elaboration solve in proof assistants based on dependent type theory?","Question",{"text":75,"@type":76},"Elaboration transforms user-written surface syntax into a more explicit core syntax that contains all information needed to represent precisely defined mathematical objects, or it fails with an error when requirements are not met.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What guarantees does the proposed DSL-based translation provide?",{"text":80,"@type":76},"The translation cannot produce ill-typed terms, is stable under judgemental equality of core terms, and remains stable under substitution, enabling a denotational interpretation of suspended elaboration problems.",{"name":82,"@type":73,"acceptedAnswer":83},"How is a concrete elaboration algorithm obtained in the paper?",{"text":84,"@type":76},"A concrete elaboration algorithm is extracted algebraically from a presheaf model of the DSL constructed from the bi-initial natural model of Martin-Löf type theory.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":45,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":45,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":45,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":45,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":45,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":45,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":45,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]