Coco: Corecursion with Compositional Heterogeneous Productivity
Jaewoo Kim, Yeonwoo Nam, Chung-Kil Hur
TL;DR
This work addresses the limitations of existing coinductive reasoning in proof assistants by introducing Compositional Heterogeneous Productivity (CHP), a framework that computes productivity for corecursive definitions across heterogeneous domain and codomain types and supports compositional reasoning. CHP bases productivity on type-specific level sets and equality-up-to relations, enabling modular analysis of complex corecursive patterns and guaranteeing the existence of unique fixed points when productivity is sufficiently positive. Building on CHP, the Coco library automates productivity computation and fixed-point generation for a broad class of corecursive definitions in Rocq, while remaining extendable through user-defined CTTs/STTs and combinators; it can still require manual proofs in some cases, highlighting trade-offs with AmiCo. The approach significantly broadens automation and coverage for corecursion while preserving a modular structure, facilitating formal verification and synthesis of infinite data structures and transfinite computations in practical settings. The work lays a foundation for more automated second-order productivity and translation of generating functions to combinator forms, with implications for scalable, compositional corecursive reasoning in proof assistants.
Abstract
Contemporary proof assistants impose restrictive syntactic guardedness conditions that reject many valid corecursive definitions. Existing approaches to overcome these restrictions present a fundamental trade-off between coverage and automation. We present Compositional Heterogeneous Productivity (CHP), a theoretical framework that unifies high automation with extensive coverage for corecursive definitions. CHP introduces heterogeneous productivity applicable to functions with diverse domain and codomain types, including non-coinductive types. Its key innovation is compositionality: the productivity of composite functions is systematically computed from their components, enabling modular reasoning about complex corecursive patterns. Building on CHP, we develop Coco, a corecursion library for Rocq that provides extensive automation for productivity computation and fixed-point generation.
