A formal verification library for fundamental physics written in Lean 4 and supported by Mathlib 4[cite: 6].
This project aims to formally define and prove core physical theorems, bridging the gap between theoretical models, experimental bounds (such as relativistic PPN metrics), and quantum mechanical frameworks[cite: 6].
The workspace covers three main physical domains[cite: 6]:
-
Analytical Mechanics & Variational Principles[cite: 6]
- Formalization of configuration paths, variations, and action functionals[cite: 6].
- Rigorous formal statement of the Calculus of Variations and the Euler-Lagrange equations[cite: 6].
- Modular definitions split across dedicated analytical mechanics submodules.
-
General Relativity & Post-Newtonian Formalism (PPN)[cite: 6]
- Formalization of the Parameterized Post-Newtonian (PPN) parameter space (
$\gamma, \beta, \alpha_1, \alpha_2$ )[cite: 6]. - Proof of Local Lorentz Invariance (LLI) under General Relativity (
$\alpha_1 = 0$ )[cite: 4, 6]. - Orbital dynamics modeling anomalous node precession for satellite orbits (
$\text{LAGEOS}$ )[cite: 1, 2, 6]. - Experimental verification bounds based on the SaToR-G experiment (INAF/INFN), establishing strict constraint checks (
$\vert{}\alpha_1\vert{} \le 2 \times 10^{-5}$ )[cite: 6].
- Formalization of the Parameterized Post-Newtonian (PPN) parameter space (
-
Quantum Mechanics & Hilbert Spaces[cite: 6]
- Definitions of normalized quantum states in complex Hilbert spaces (
$\Vert{}\psi\Vert{} = 1$ )[cite: 6]. - Self-adjoint linear operators modeling physical observables (
$\langle Ax, y \rangle = \langle x, Ay \rangle$ )[cite: 6]. - Formal proof of the Reality Theorem of Expectation Values:
$\text{Im}(\langle \psi, A\psi \rangle) = 0$ [cite: 6].
- Definitions of normalized quantum states in complex Hilbert spaces (
Based on the core library imports, the workspace is organized as follows:
PhysicsFormalization/
├── Physics/
│ ├── AnalyticalMechanics/
│ │ ├── Variation.lean # Path variations and boundary conditions
│ │ ├── Action.lean # Action functional and Lagrangian integration
│ │ └── EulerLagrange.lean # Stationary action and Euler-Lagrange equations
│ ├── GeneralRelativity/
│ │ ├── PPN/
│ │ │ └── Basic.lean # PPN parameters definition and GR LLI proof
│ │ ├── Dynamics/
│ │ │ └── Orbital.lean # Orbital elements and LLI-induced precession
│ │ └── Experiments/
│ │ └── SatorG.lean # Experimental bounds and compatibility proofs
│ └── QuantumMechanics/
│ └── Basic.lean # Quantum states, observables, and expectation values
├── Physics.lean # Library entry point and module exports
├── lakefile.lean # Lake build configuration
└── lean-toolchain # Lean 4 toolchain specification
⚙️ Environment & Requirements
To successfully build and verify this library, ensure you have the following toolchain versions installed:
Lean 4 Version: v4.33.0-rc1 (or compatible versions specified in lean-toolchain)
Dependency Manager: elan (the Lean version manager) and lake (Lean's build system)
You can manage Lean toolchains easily via elan.
🛠️ Build & Compilation Instructions
Clone the repository:
Bash
git clone [https://github.com/toshiro881967-coder/PhysicsFormalization.git](https://github.com/toshiro881967-coder/PhysicsFormalization.git)
cd PhysicsFormalization
Fetch dependencies and build Mathlib/Project components:
lake will automatically download the correct Lean toolchain specified in the lean-toolchain file and fetch precompiled Mathlib build caches.
Bash
lake update
lake build
Verify individual modules:
To check a specific file (e.g., the variational mechanics module):
Bash
lake build Physics.AnalyticalMechanics.EulerLagrange