Use and Abuse of Instance Parameters in the Lean Mathematical Library

Anne Baanen*

*Corresponding author for this work

Research output: Contribution to JournalArticleAcademicpeer-review

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.

Original languageEnglish
Article number1
Pages (from-to)1-30
Number of pages30
JournalJournal of Automated Reasoning
Volume69
Early online date12 Dec 2024
DOIs
Publication statusPublished - 2025

Bibliographical note

Publisher Copyright:
© The Author(s) 2024.

Keywords

  • Algebraic hierarchy
  • Dependent type theory
  • Formalization of mathematics
  • Lean prover
  • Typeclasses

Fingerprint

Dive into the research topics of 'Use and Abuse of Instance Parameters in the Lean Mathematical Library'. Together they form a unique fingerprint.

Cite this