An open-source, community, project to digitalize results from physics into Lean 4.
π― Digitalize results (meaning calculations, definitions, and theorems) from physics into Lean 4.
π― Develop structures to aid the creation of new results in physics using Lean, with the potential future use of AI.
π― Create good documentation so that the project can be used for pedagogical purposes.
See the Get Involved for more details. Some suggestions:
π£ write informal results - no need to learn Lean for this - see the Getting Started page for more details,
π£ tackle a TODO item,
π£ or, start formalizing an area that you find intresting.
Feel free to come to the PhysLean zulip to ask questions and advice.
Good places to start an exploration of the project.
- ποΈ π» Maxwell's equations in electromagnetism.
- ποΈ π» Quantum Harmonic Oscillator in quantum mechanics.
- ποΈ π» The two state canonical ensemble in statistical mechanics.
- ποΈ π» The tight-binding model in condensed matter physics
- ποΈ π» The twin paradox in special relativity.
- ποΈ π» The two-Higgs doublet model in particle physics
- ποΈ π» Wick's theorem in quantum field theory.
- π Joseph Tooby-Smith, HepLean: Digitalising high energy physics, Computer Physics Communications, Volume 308, 2025, 109457, ISSN 0010-4655, https://doi.org/10.1016/j.cpc.2024.109457. [arXiv:2405.08863]
- π Joseph Tooby-Smith, Formalization of physics index notation in Lean 4, arXiv:2411.07667
- π Joseph Tooby-Smith, Digitalizing Wick's Theorem, arXiv:2505.07939
- π₯ Lean Together 2025: Joseph Tooby-Smith, Physics and Lean
- π₯ Seminar recording of "HepLean: Lean and high energy physics" by J. Tooby-Smith
- Hu, Jiewen, Thomas Zhu, and Sean Welleck. "miniCTX: Neural Theorem Proving with (Long-) Contexts." arXiv preprint arXiv:2408.03350 (2024). Project page
How PhysLean (then called HepLean) was used: Theorems from the space-time files of HepLean were included in a data set used to evaluate the ability of models to prove theorems from real-world repositories, which requires working with definitions, theorems, and other context not seen in training.
We would love to have you involved! See the Get Involved page to see how you can get involved. Any contributions are welcome! If you have any questions or want permission permission to create a pull-request for this repository contact Joseph Tooby-Smith on the Lean Zulip, or email.
If you want to play around with PhysLean, but do not want to download Lean, then you can use GitPod.
Installation instructions for Lean 4 can be found:
or
- 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 commandlake
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).
- Lean Copilot and LLMLean allow for the use of large language models in Lean
- tryAtEachStep allows one to apply a tactic, e.g.
exact?
at each step of a lemma in a file to see if it completes the goal. This is useful for golfing proofs.