EinsteinPy Lean Check
I modelled all of einsteinpy, the Python library for general relativity, in Lean 4 on top of Physlib and tested it against the real library. Ask it how big the Sun would be as a black hole and it says 10⁻²⁷ metres.
- 33 bug records, 24 of them new to einsteinpy, with 173 properties proved and 47 refuted
- The findings are raised upstream as einsteinpy/einsteinpy#712
November 2026After NumPy I wanted to try the same method on a physics library, with Physlib as the reference for the physics. Twenty differential tests agree with einsteinpy on 2.9 million cases, and the Lean proofs also check that my own fixes for lorentz_transform and the 4-momentum are right.
