GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lean-forward/mathlib-classes: Use and abuse of instance parameters in the Lean mathematical library

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
README.md
README.md
 
 
leanpkg.toml
leanpkg.toml
 
 
typeclass-paper.pdf
typeclass-paper.pdf
 
 

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:

  • Section 2: Basic instance parameters in Lean 3
  • Section 3: has_mul: notation typeclass
  • Section 4: comm_monoid: algebraic hierarchy class
  • Section 5: multiplicative: multiple instances on a single type
  • Section 6: module: multi-parameter classes
  • Section 7: monoid_hom_class: generic bundled morphisms
  • Section 8: nsmul: ensuring equality of instances
  • Section 9: Instance parameters depending on out parameters
  • Section 10: unique: proof-carrying mixin
  • Section 11: fact: interfacing between instances and non-instances
  • Section 12: Performance and bundling
  • Section 13: Instances and tactics

About

Use and abuse of instance parameters in the Lean mathematical library

Resources

Readme
Activity
Custom properties

Stars

1 star

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.