Skip to content

Use and abuse of instance parameters in the Lean mathematical library

Notifications You must be signed in to change notification settings

lean-forward/mathlib-classes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

Use and abuse of instance parameters in the Lean mathematical library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages