Matching-Logic-Based Understanding of Polynomial Functors and their Initial/Final Models Revisited
Dorel Lucanu
Key points
From the paper's conclusion- We prove that, in every model, the algebra extracted from the model is an initial algebra (a W-type) and the extracted coalgebra is a final coalgebra (an M-type) of the container extracted from the model, i.e., the one given by the model's interpretation of the shapes and positions, and that such models exist.
Abstract
Many data types used in programming are initial algebras or final coalgebras of polynomial functors. We show how to specify them uniformly in matching logic, using the representation of polynomial functors as unary container functors $X\mapsto\sum_{a:A}X^{B[a]}$. For each container functor, we give a matching logic theory of its initial algebra and one of its final coalgebra. Besides the no-junk and no-confusion axioms and their duals, these theories include axioms about the elements that represent functions, for the initial algebra, and a bisimilarity axiom and a realisation axiom, for the final coalgebra; the existence axioms use free set variables to range over all subsets of a model. We prove that, in every model, the algebra extracted from the model is an initial algebra (a W-type) and the extracted coalgebra is a final coalgebra (an M-type) of the container extracted from the model, i.e., the one given by the model's interpretation of the shapes and positions, and that such models exist. So the data types are captured relative to the interpretation of the sorts of shapes and positions, and absolutely whenever these sorts are fixed by auxiliary specifications, which we show for finite sets, products, dependent sums, and (co)inductive sorts built from them. We derive the induction, coinduction, and bisimulation principles as theorems, and illustrate the approach on lists and on Moore machines. This paper revises and substantially extends a paper published in EPTCS 389 (FROM 2023): several axioms are corrected, and the adequacy and satisfiability proofs are new.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Final coalgebras over R-modulesarXiv · 2026
- A Fibrational Framework For Multi-Conclusion LogicsarXiv · 2026
- The list object endofunctor is polynomialMathematical Structures in Computer Science · 2026
- Tableau Consequence under Positive Contexts: A Reconstruction of Walukiewicz's Completeness ProofarXiv · 2026
- Presenting Point-Glued Self-Similar Objects as Final Coalgebras in Metric Spaces via Completion: A Categorical Hutchinson TheoremarXiv · 2026
- Monadic Second-Order Logic in HOL: Deep and Shallow with Automated Faithfulness (Extended Preprint)arXiv · 2026