Reference. Intrinsically Correct Algorithms and Recursive Coalgebras
Cite
Cited by (1)
Definition. Recursive coalgebra recursive-coalgebra
Fix an endofunctor . A coalgebra is recursive when for every algebra there is exactly one hylomorphism from to , that is, exactly one solution of
Equivalently, the functor of the hylomorphism profunctor is constantly a singleton.
Recursiveness is a coalgebraic form of well-foundedness: decomposes each input into subproblems, and recursiveness says that every divide-and-conquer program built on this decomposition has a unique meaning, without mentioning an order on inputs. [1] use recursive coalgebras on categories of indexed families to obtain algorithms that are correct by the type of the map they compute.
Example. If is an initial algebra, then is invertible (Lambek’s lemma) and is a recursive coalgebra. Precomposing with the isomorphism , the equation is equivalent to , which says is an algebra map out of the initial algebra; there is exactly one, .
The dual notion is a corecursive algebra.
Cites 32 works (4 here)
With notes (4)
Intrinsic Verification of Parsers and Formal Grammar Theory in Dependent Lambek Calculus intrinsic-verification-of-parsers
We present Dependent Lambek Calculus (Lambek), a domain-specific dependent type theory for verified parsing and formal grammar theory. In Lambek, linear types are used as a syntax for formal grammars, and parsers can be written as linear terms. The linear typing restriction provides a form of intrinsic verification that a parser yields only valid parse trees for the input string. We demonstrate the expressivity of this system by showing that the combination of inductive linear types and dependency on non-linear data can be used to encode commonly used grammar formalisms such as regular and context-free grammars as well as traces of various types of automata. Using these encodings, we define parsers for regular expressions using deterministic automata, as well as examples of verified parsers of context-free grammars.
We present a denotational semantics of our type theory that interprets the linear types as functions from strings to sets of abstract parse trees and terms as parse transformers. Based on this denotational semantics, we have made a prototype implementation of Lambek using a shallow embedding in the Agda proof assistant. All of our examples parsers have been implemented in this prototype implementation.
Intrinsically Correct Sorting in Cubical Agda alexandruIntrinsicallyCorrectSorting2025
Cubical Agda: A Dependently Typed Programming Language with Univalence and Higher Inductive Types VezzosiMortbergAbel2019
Generalizing determinization from automata to coalgebras silva-2013-generalizing
External (28)
- Well-Founded Coalgebras Meet König's Lemma (2026)
- Initial Algebras and Terminal Coalgebras (2025)
- Program Optimisations via Hylomorphisms for Extraction of Executable Code (2025)
- Formalization accompanying the paper “Intrinsically Correct Sorting in Cubical Agda” version v0 (2024)
- Well-Founded Recursion Done Right (2024)
- Well-founded coalgebras, revisited (2017)
- Conjugate Hylomorphisms – Or (2015)
- Proving program termination (2011)
- Category Theory (2nd ed.) (2010)
- Recursive coalgebras from comonads (2006)
- Containers: Constructing strictly positive types (2005)
- Modelling general recursion in type theory (2005)
- Transition invariants (2004)
- Abstract and Concrete Categories: The Joy of Cats (2004)
- Fixed Point Objects Corresponding to Freyd Algebras (Eppendahl, manuscript) (2000)
- Practical Foundations of Mathematics (1999)
- Categories for the Working Mathematician (2nd ed.) (1998)
- Algebra of Programming (1997)
- The Art of Computer Programming, Volume 2: Seminumerical Algorithms (3rd ed.) (1997)
- Inductive families (1994)
- Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire (1991)
- Automata and Algebras in Categories (1990)
- Accessible Independence Results for Peano Arithmetic (1982)
- Introduction to Automata Theory, Languages, and Computation (1979)
- Categorical set theory: A characterization of the category of sets (1974)
- Quicksort (1962)
- Function Definitions : Dot Patterns — Agda 2.8.0 documentation
- Rocq-Prover/Rocq: Rocq