Use and Abuse of Instance Parameters in the Lean Mathematical Library
Author:
Open Access
- 12 December 2024
- journal article
- research article
- Published by Springer Nature in Journal of Automated Reasoning
- Vol. 69 (1) , 1-30
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.Keywords
All Related Versions
Funding Information
- Nederlandse Organisatie voor Wetenschappelijk Onderzoek (016.Vidi.189.037, Lean Forward)
This publication has 28 references indexed in Scilit:
- Multiple-Inheritance Hazards in Dependently-Typed Algebraic Hierarchies2023
- The Lean 4 Theorem Prover and Programming Language2021
- Maintaining a Library of Formal Mathematics2020
- Competing Inheritance Paths in Dependent Type Theory: A Case Study in Functional Analysis2020
- Validating Mathematical Structures2020
- The Lean Theorem Prover (System Description)2015
- Packaging Mathematical Structures2009
- First-Class Type Classes2008
- Type Classes with Functional Dependencies2000
- Locales A Sectioning Concept for Isabelle1999