Use and abuse of instance parameters in the Lean mathematical library

Anne Baanen

Preprint: not peer reviewed. Results may change in later versions.

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 current Lean 3 version of mathlib, focussing on complications arising at scale and how the mathlib community deals with them.

Abstract: arXiv descriptive metadata (CC0). Thank you to arXiv for use of its open access interoperability. This service was not reviewed or approved by, nor does it necessarily express or reflect the policies or opinions of, arXiv.

Record

Archive ID
arxiv:2202.01629
Published
Feb 3, 2022
Updated
May 2, 2022
arXiv
2202.01629
Categories
cs.LO
Provenance
arxiv