leanprover-community / mathlib4
- понедельник, 3 июня 2024 г. в 00:00:09
The math library of Lean 4
This is a complete port of mathlib to Lean 4. Development of mathlib now takes place in this repository.
Mathlib is a user maintained library for the Lean theorem prover. It contains both programming infrastructure and mathematics, as well as tactics that use the former and allow to develop the latter.
You can find detailed instructions to install Lean, mathlib, and supporting tools on our website.
Please refer to https://github.com/leanprover-community/mathlib4/wiki/Using-mathlib4-as-a-dependency
Got everything installed? Why not start with the tutorial project?
For more pointers, see Learning Lean.
Besides the installation guides above and Lean's general documentation, the documentation of mathlib consists of:
.lean
files.Much of the discussion surrounding mathlib occurs in a Zulip chat room, and you are welcome to join, or read along without signing up. Questions from users at all levels of expertise are welcome! We also provide an archive of the public discussions, which is useful for quick reference.
For users familiar with Lean 3 who want to get up to speed in Lean 4 and migrate their existing Lean 3 code we have:
mathport
on a project other than mathlib. mathport
is the tool the community used to port the entirety
of mathlib
from Lean 3 to Lean 4.The complete documentation for contributing to mathlib
is located
on the community guide contribute to mathlib
The process is different from other projects where one should not fork the repository.
Instead write permission for non-master branches should be requested on Zulip
by introducing yourself, providing your GitHub handle and what contribution you are planning on doing.
You may want to subscribe to the mathlib4
stream
To obtain precompiled olean
files, run lake exe cache get
. (Skipping this step means the next step will be very slow.)
To build mathlib4
run lake build
.
To build and run all tests, run make
.
You can use lake build Mathlib.Import.Path
to build a particular file, e.g. lake build Mathlib.Algebra.Group.Defs
.
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
Mathlib has the following guidelines and conventions that must be followed
You can run lake exe cache get
to download cached build files that are computed by mathlib4
's automated workflow.
If tar
terminates with an error, it means that you might have ended up with corrupted files.
In this case, run lake exe cache get!
to overwrite them (get
won't try to download the same file again).
Call lake exe cache
to see its help menu.
Building HTML documentation locally is straightforward, but it may take a while:
lake -Kdoc=on build Mathlib:docs
The HTML files can then be found in build/doc
.
If you are a mathlib contributor and want to update dependencies, use lake update -Kdoc=on
.
This will update the lake-manifest.json
file correctly.
You will need to make a PR after committing the changes to this file.
For a list containing more detailed information, see https://leanprover-community.github.io/teams/maintainers.html