/mathlib4

Work in progress mathlib port for lean 4

Primary LanguageLeanApache License 2.0Apache-2.0

mathlib4

Bors enabled project chat

This is the work in progress port of mathlib to Lean 4.

Contributing

A guide on how to port a file from mathlib3 to mathlib4 can be found in the wiki. The porting effort is coordinated through zulip, if you want to contribute to the port please come to the mathlib4 stream.

Build instructions

  • Make sure Lean is not running, and close all instances of VSCode running Lean processes.
  • Get the newest version of elan. If you already have installed a version of Lean, you can run
    elan self update
    
    If the above command fails, or if you need to install elan, run
    curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh
    
    If this also fails, follow the instructions under Regular install here.
  • To build mathlib4 run lake build. To build and run all tests, run make.
  • If you added a new file, run the following command to update Mathlib.lean
    find Mathlib -name "*.lean" | env LC_ALL=C sort | sed 's/\.lean//;s,/,.,g;s/^/import /' > Mathlib.lean
    

Building HTML documentation

Building HTML documentation locally is straightforward:

lake -Kdoc=on build Mathlib:docs

The HTML files can then be found in build/doc.

Dependencies

If you want to update dependencies, use lake update -Kdoc=on. This will update the lean_packages/manifest.json file correctly. You will need to make a PR after committing the changes to this file.