一句话:提出在内涵类型论中严格化 CwF 语法、避免 transport 的方法,并在 Agda 中形式化典范性证明。
依赖类型元理论近年因范畴胶合等语义方法而取得进展,但此类证明仍难以计算机形式化:以 CwF 为代表的语义呈现依赖精巧的索引归纳类型,容易陷入 transport hell,导致形式化仍停留在繁琐的句法证明。本文提出在内涵类型论中操作 CwF 的新技术,构造初始 CwF 的替代呈现,将代换编码为元理论函数,从而严格化代换演算中的等式,显著减少 transport 需求。作为应用,作者用该严格化初始 CwF 为带依赖积与含大消去的布尔类型的类型论给出简短优雅的典范性(canonicity)证明,并在 Agda 中完全形式化。
The metatheory of dependent types has seen a lot of progress in recent years. In particular, the development of categorical gluing finally lets us work with semantic presentations of type theory (such as categories with families) to establish fundamental properties of type theory such as canonicity and normalisation. However, proofs by gluing have yet to reach the stage of computer formalisation: formal proofs for the metatheory of dependent types are still stuck in the age of tedious syntactic proofs. The main reason for this is that semantic presentations of type theory are defined using sophisticated indexed inductive types, which are prone to “transport hell”. In this paper, we introduce a new technique to work with CwFs in intensional type theory without getting stuck in transport hell. More specifically, we construct an alternative presentation of the initial CwF which encodes the substitutions as metatheoretical functions. This has the effect of strictifying all the equations that are involved in the substitution calculus, which greatly reduces the need for transports. As an application, we use our strictified initial CwF to give a short and elegant proof of canonicity for a type theory with dependent products and booleans with large elimination. The resulting proof is fully formalised in Agda.