A project to digitalize high energy physics.
Aims of this project
๐ฏ Digitalize results (meaning calculations, definitions, and theorems) from high energy physics into Lean 4.
๐ฏ Develop structures to aid the creation of new results in high energy physics using Lean, with the potential future use of AI.
๐ฏ Create good documentation so that the project can be used for pedagogical purposes.
Some parts of HepLean
HepLean currently includes, but is not limited to, the following parts:
Lorentz ๐๏ธ: The Lorentz group, Lorentz algebra, Weyl fermions, Real Lorentz vectors, complex Lorentz vectors, complex Lorentz tensors, bispinors, Pauli matrices, etc.
Index notation ๐๏ธ ๐: Formalization of index notation using category theory allowing commands like
{A | ฮผ ฮฝ โ S | ฮผ ฮฝ = - A | ฮผ ฮฝ โ S | ฮผ ฮฝ}แต
Anomaly cancellation ๐๏ธ: Results related to solutions to the anomaly cancellation conditions of several theories.
Standard Model physics ๐๏ธ: Properties of the Higgs potential.
BSM physics ๐๏ธ: Starts to: Georgi Glashow model, Pati-Salam, Spin(10), Two Higgs doublet model.
Flavor physics ๐๏ธ: Properties of the CKM matrix.
Perturbation Theory ๐๏ธ ๐ง: Informal statements relating to Feynman diagrams, Wick contractions, Operator algebras.
Associated media and publications
- ๐ 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
- ๐ป Example code snippet related to Anomaly cancellation conditions.
- ๐ฅ Seminar recording of "HepLean: Lean and high energy physics" by J. Tooby-Smith
Papers referencing HepLean
- Hu, Jiewen, Thomas Zhu, and Sean Welleck. "miniCTX: Neural Theorem Proving with (Long-) Contexts." arXiv preprint arXiv:2408.03350 (2024). Project page
How 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.
Contributing
We follow here roughly the same contribution policies as MathLib4 (which can be found here).
A guide to contributing can be found here.
If you want permission to create a pull-request for this repository contact Joseph Tooby-Smith on the Lean Zulip, or email.
Installation
If you want to playaround with HepLean, but do not want to download Lean, then you can use GitPod.
Installing Lean 4
Installation instructions for Lean 4 can be found:
or
Installing HepLean
- 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).
Optional extras
- 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.