Preprints, Working Papers, ... Year : 2025

Nested Inductive Types

Abstract

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 (e.g., 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 Lean and Rocq is unsatisfactory. Lean rejects many practical definitions while Rocq 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 Rocq. 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 Rocq, along with an implementation plan for Lean.

Fichier principal
Vignette du fichier
main.pdf (697.45 Ko) Télécharger le fichier
Origin Files produced by the author(s)
Licence

Dates and versions

hal-05366368 , version 1 (14-11-2025)

Licence

Identifiers

  • HAL Id : hal-05366368 , version 1

Cite

Thomas Lamiaux, Yannick Forster, Matthieu Sozeau, Nicolas Tabareau. Nested Inductive Types. 2025. ⟨hal-05366368⟩
309 View
160 Download

Share

  • More