Use and Abuse of Instance Parameters in the Lean Mathematical Library
Abstract The Lean mathematical library Mathlib features extensive use of the typeclass pattern for organising mathematical structures, based on Lean’s mechanism of instance parameters. Related mechanisms for typeclasses are available in other provers including Agda, Coq and Isabelle with varying degrees of adoption. This paper analyses representative examples of design patterns involving instance parameters in the finalized Lean 3 version of Mathlib, focussing on complications arising at scale and how the Mathlib community deals with them.
Authors
- Anne Baanen (ORCID: https://orcid.org/0000-0001-8497-3683)
Institutions
- Vrije Universiteit Amsterdam (NL)
Publication Details
- Journal
- Journal of Automated Reasoning
- Published
- 2024-12-12
- DOI
- https://doi.org/10.1007/s10817-024-09712-7
- Citations
- 2
- Primary Topic
- Logic, programming, and type systems
- Type
- article
- Field-Weighted Citation Impact
- 0.69
Funders
- Nederlandse Organisatie voor Wetenschappelijk Onderzoek