Use and abuse of instance parameters in the Lean mathematical library
Official code: lean-forward/mathlib-classes (1 star, Lean, last commit 2023-04-01).
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.
Show full abstractHide
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.