一句话:提出嵌套归纳类型的有效性判据,保证可展开为互归纳类型,并自动生成正确的消去原理。
嵌套归纳类型允许构造子使用以待定义类型实例化的参数化类型,广泛用于大型验证项目,但 Lean 与 Rocq 对其处理均不理想:前者拒绝许多实用定义,后者接受无法定义可用消去原理的定义,且二者都不能可靠自动生成消去原理。本文提出新的有效性判据,保证嵌套归纳类型可展开为良构的互归纳类型;在该判据下,原定义的消去原理可证明等价于展开后互归纳形式的消去原理。该条件严格推广 Lean 当前检查,并恰好排除 Rocq 接受的问题情形。基于此,作者给出自动生成正确消去原理的系统化方法,并在 Rocq 中实现,同时给出 Lean 实现计划。
Inductive types are a fundamental abstraction mechanism in type theory and proof assistants, supporting the definition of data structures and rich specifications. Nested inductive types extend this mechanism by allowing constructors to use parametric types instantiated with the type being defined (lists or trees of the type to be defined). They are widely used in large verification projects – including CompCert, Iris, Verinum, and MetaRocq – to express complex, structured specifications. Despite this widespread use, the treatment of nested inductive types in both and is unsatisfactory. rejects many practical definitions while accepts definitions for which no usable elimination principle can be defined. Neither system provides reliable automatic generation of elimination principles. As a result, developers must define custom eliminators by hand, leading to fragility, duplication, and significant proof engineering overhead. This paper introduces a novel validity criterion for nested inductive types that guarantees that they can be elaborated into well-formed mutual inductive types. Under this criterion, the elimination principle for the original nested definition is provably equivalent to that of its elaborated mutual form. Our condition strictly generalizes Lean’s current check while ruling out exactly the problematic cases accepted in . Using this foundation, we give a systematic method for automatically generating correct elimination principles for nested inductive types, and we provide an implementation integrated into , along with an implementation plan for .
@article{LamiauxFST26,
title = {Nested Inductive Types: Justified and Usable Nested Inductive Types in Lean and Rocq},
author = {Thomas Lamiaux and Yannick Forster and Matthieu Sozeau and Nicolas Tabareau},
journal = {Proceedings of the ACM on Programming Languages},
volume = {10},
number = {PLDI},
year = {2026},
doi = {10.1145/3808322}
}