Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 2.67 KB

README.md

File metadata and controls

27 lines (20 loc) · 2.67 KB

Use and abuse of instance parameters in the Lean mathematical library

This repository contains interactive full versions of the source code showcased in the paper "Use and abuse of instance parameters in the Lean mathematical library", submitted to the Journal of Automated Reasoning.

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.

Installation instructions

The code showcased in the paper is based on mathlib commit 3e068ece210, which requires the community fork of Lean 3. To install a full Lean development environment, please follow the "Regular install" instructions at https://leanprover-community.github.io/get_started.html. After installation, you can run the command leanproject get lean-forward/mathlib-classes to obtain copies of the source code and precompiled binaries.

When opening a Lean project in VS Code, you must use the "Open Folder" menu option to open the project's root directory. On the command line, you can run code path/to/mathlib-classes.

Code overview

Each section of the paper has a corresponding source code file: