https://github.com/leanprover-community/physlib
A project to digitalise results from physics into Lean.
https://github.com/leanprover-community/physlib
lean physics theorem-proving
Last synced: about 2 months ago
JSON representation
A project to digitalise results from physics into Lean.
- Host: GitHub
- URL: https://github.com/leanprover-community/physlib
- Owner: leanprover-community
- License: apache-2.0
- Created: 2024-04-16T19:31:13.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2026-03-28T00:36:17.000Z (2 months ago)
- Last Synced: 2026-03-28T07:39:13.574Z (2 months ago)
- Topics: lean, physics, theorem-proving
- Language: Lean
- Homepage: https://physlean.com
- Size: 11.2 MB
- Stars: 527
- Watchers: 11
- Forks: 86
- Open Issues: 77
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
> [!NOTE]
> Things look different? We've recently undergone a name change and move from /lean-phys-community/PhysLean
> to /leanprover-community/physlib. Same repo, different location and name. This shouldn't affect
> the average user, but please be patient as we update things.
## An open-source, community, project to digitalize results from physics into Lean 4
[](https://physlean.com/GettingStarted.html)
[](https://physlean.com)
[](https://physlean.com/GetInvolved.html)
[](https://leanprover.zulipchat.com/#narrow/channel/479953-PhysLean/)
[](https://physlean.com/TODOList)
[](https://loogle.physlean.com)
[](https://live.physlean.com)
[](https://physlean.com/Stats)
[](https://github.com/leanprover/lean4/releases/tag/v4.28.0)
[](https://gitpod.io/#https://github.com/HEPLean/HepLean)
[](https://deepwiki.com/HEPLean/PhysLean)
[](https://physlean.com/docs/)
## Requirements of the project
đ¯ The project shall contain results (definitions, theorems, lemmas and calculations) from **physics**,
including quantum information, formalized (or **digitalized**) into the interactive theorem prover **Lean 4**.
đ¯ The project shall be **organized** by **physics**.
đ¯ Each definition in the project shall carry a physics-based **documentation**.
đ¯ Each module (file) in the project shall carry a physics-based **documentation**.
đ¯ The project shall contain Physics Lean **tactics**, **notation** and **syntax** for physicists.
đ¯ The project shall *not* be tied to physics axiomizations (e.g. axiomatic QFT), but rather flexiable enough to accommodate different approaches and starting points.
đ¯ The content of the project shall be carefully **reviewed** and curated, to ensure reusability, readability and fit.
đ¯ The project shall be completely open-source, community run and independent from any company or organization.
đ¯ The project shall not be tied to any specific AI model or tool.
đ¯ The project shall be for **main-stream** physics only.
## Contributing to PhysLib
PhysLib is open-source and community run, and we welcome contributions from anyone.
All you need to do is open a pull-request with your changes
and our team of maintainers will review it and iterate with you on feedback until it
can be merged.
If you unsure where you would like to contribute, you may find ideas on:
- our [open issues](https://github.com/leanprover-community/physlib/issues).
- our [todo list](https://physlean.com/TODOList)
- our [Get Involved page](https://physlean.com/GetInvolved.html)
> [!NOTE]
> If stuck at any point there are lots of people happly to help on the [PhysLib zulip](https://leanprover.zulipchat.com/#narrow/channel/479953-PhysLib)
### Installing Lean 4
Installation instructions for Lean 4 can be found:
- https://lean-lang.org/lean4/doc/quickstart.html
or
- https://leanprover-community.github.io/get_started.html
### Installing PhysLib
- Clone this repository (or download the repository as a Zip file)
- Open a terminal at the top-level in the corresponding directory.
- Run `lake exe cache get`. The command `lake` should have been installed when you installed Lean.
- Run `lake build`.
- Open the directory (not a single file) in Visual Studio Code (or another Lean compatible code editor).
### Making a pull-request
There are lots of guides on how to make a pull-request on GitHub. The first thing you
need to do is fork the repository. Once you've made your pull request we will review it:
- Guide to [PhysLib reviews](https://github.com/leanprover-community/physlib/blob/master/docs/ReviewGuidelines.md).
It will also undergo a number of automated checks called linters. Sometimes these are easier
to run locally:
- Guide to [linters and running them locally](https://github.com/leanprover-community/physlib/blob/master/scripts/README.md).
Most importantly:
> [!NOTE]
> When making contributing to PhysLib it is much better to do it with small steps. This makes it easier for us to review, and allows you to get feedback sooner.
## Maintainers
Below are the maintainers of the project, however the best way to reach them is by posting
on the [Lean Zulip](https://leanprover.zulipchat.com/#narrow/channel/479953-PhysLib)
- LÊo Lessa (@Megaleo)
- Alex Meiburg (@Timeroot)
- Daniel Morrison (@morrison-daniel)
- Zhi-Kai Pong (@zhikaip)
- Rodolfo Soldati (@rodolfor-s)
- Joseph Tooby-Smith (@jstoobysmith)
- Winston Yin (@winstonyin)
## Citing the project
If you want to cite the project as a whole please cite:
```
@misc{physlib,
author = {The PhysLib community},
title = {PhysLib: The Lean Physics Library},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/leanprover-community/physlib}},
}
```
PhysLib was formed by merging the general physics Lean library PhysLean (formerly called HepLean)
with the quantum-information library Lean-QuantumInfo. Where appropriate please also consider
citing the papers associated with the origin of these projects. For the former please use:
```
@article{Tooby-Smith:2024vqu,
author = "Tooby-Smith, Joseph",
title = "{HepLean: Digitalising high energy physics}",
eprint = "2405.08863",
archivePrefix = "arXiv",
primaryClass = "hep-ph",
doi = "10.1016/j.cpc.2024.109457",
journal = "Comput. Phys. Commun.",
volume = "308",
pages = "109457",
year = "2025"
}
```
and for the latter please use:
```
@article{Meiburg:2025mwn,
author = "Meiburg, Alex and Lessa, Leonardo A. and Soldati, Rodolfo R.",
title = "{A Formalization of the Generalized Quantum Stein's Lemma in Lean}",
eprint = "2510.08672",
archivePrefix = "arXiv",
primaryClass = "quant-ph",
month = "10",
year = "2025"
}
```