An Attempt to formalize physics in Lean4.
Find a file
2025-03-21 11:39:15 -04:00
.github feat: Update bump.yml 2025-03-21 11:39:09 -04:00
.vscode Add standard vscode lean settings 2024-07-26 01:03:25 +02:00
Archive/Papers chore: bump toolchain to v4.15.0 2025-01-20 15:42:53 +08:00
docs refactor: Improve TODO list 2025-03-13 10:11:46 +00:00
PhysLean refactor: lint 2025-03-21 11:12:58 -04:00
scripts feat: Update style lint 2025-03-21 11:22:23 -04:00
.gitignore chore: Remove .DS_Store 2024-07-09 10:21:57 -04:00
.gitpod.yml Add .gitpod.yml 2024-10-31 05:33:39 +00:00
CONTRIBUTING.md docs: Update Contributing file. 2024-05-16 10:17:31 -04:00
lake-manifest.json chore: Bump to v4.18.0-rc1 2025-03-20 12:56:28 -04:00
lakefile.toml feat: Update style lint 2025-03-21 11:22:23 -04:00
lean-toolchain chore: Bump to v4.18.0-rc1 2025-03-20 12:56:28 -04:00
LICENSE Create LICENSE 2024-05-31 16:18:33 -04:00
PhysLean.lean feat: Boosts of Lorentz vectors 2025-03-21 11:04:47 -04:00
README.md chore: Bump to v4.18.0-rc1 2025-03-20 12:56:28 -04:00

PhysLean

Gitpod Ready-to-Code

A project to digitalize physics.

(Formerly called HepLean)

Aims of this project

🎯 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.

Some parts of PhysLean

PhysLean 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 🗂️: Time-dependent version of Wick's theorem for both fermions and bosons.

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 PhysLean

  • 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 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.

Installation

If you want to play around 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 PhysLean

  • 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).

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.