- Lean 55.4%
- C 37.6%
- Racket 7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| implementations | ||
| proofs | ||
| screencaps | ||
| specifications | ||
| .gitattributes | ||
| EM-pulse-ez_snapshots.png | ||
| LICENSE | ||
| README.md | ||
Maxwell's Equations for Electrodynamics with Lanyon
Highlights
- End-to-end formally verified solvers for the Maxwell equations and perfectly hyperbolic Maxwell equations (with electric and magnetic divergence error correction), in 1D, 2D, and 3D.
- Took ~130 seconds for Lanyon to generate everything.
- ~18 seconds for the Maxwell equations in 1D, ~23 seconds for the Maxwell equations in 2D, ~25 seconds for the Maxwell equations in 3D, ~12 seconds for the perfectly hyperbolic Maxwell equations in 1D, ~23 seconds for the perfectly hyperbolic Maxwell equations in 2D, ~29 seconds for the perfectly hyperbolic Maxwell equations in 3D.
- Real-time screen captures are shown in
/screencaps.
- 15,209 lines of Lean 4 code to prove end-to-end correctness properties.
- 1,187 for the Maxwell equations in 1D, 2,192 for the Maxwell equations in 2D, 3,259 for the Maxwell equations in 3D, 1,519 for the perfectly hyperbolic Maxwell equations in 1D, 2,833 for the perfectly hyperbolic Maxwell equations in 2D, and 4,219 for the perfectly hyperbolic Maxwell equations in 3D.
- 270 total definitions and 156 total theorems.
- 8,516 lines of formally verified C code.
- 728 for the Maxwell equations in 1D, 1,276 for the Maxwell equations in 2D, 1,862 for the Maxwell equations in 3D, 866 for the perfectly hyperbolic Maxwell equations in 1D, 1,536 for the perfectly hyperbolic Maxwell equations in 2D, and 2,248 for the perfectly hyperbolic Maxwell equations in 3D.
Further Details
The Maxwell equations of electromagnetism combine a pair of hyperbolic evolution equations:
\frac{\partial \mathbf{B}}{\partial t} + \nabla \times \mathbf{E} = 0
\varepsilon_0 \mu_0 \frac{\partial \mathbf{E}}{\partial t} - \nabla \times \mathbf{B} = - \mu_0 \mathbf{J}
with a pair of elliptic divergence constraints:
\nabla \cdot \mathbf{E} = \frac{\rho_c}{\varepsilon_0}
\nabla \cdot \mathbf{B} = 0
for electric field {\mathbf{E}}, magnetic field {\mathbf{B}}, permittivity and permeability of free space {\varepsilon_0} and {\mu_0} respectively, current density {\mathbf{J}}, and charge density {\rho_c}.
The extension to the perfectly hyperbolic Maxwell equations introduces the auxiliary scalar fields {\psi} and {\phi}, governed by error propagation speeds {\gamma} and {\chi}, respectively, to obtain the new pair of hyperbolic evolution equations:
\frac{\partial \mathbf{B}}{\partial t} + \nabla \times \mathbf{E} + \gamma \nabla \psi = 0
\varepsilon_0 \mu_0 \frac{\partial \mathbf{E}}{\partial t} - \nabla \times \mathbf{B} + \chi \nabla \phi = - \mu_0 \mathbf{J}
and a new pair of elliptic divergence constraints:
\frac{1}{\chi} \frac{\partial \phi}{\partial t} + \nabla \cdot \mathbf{E} = \frac{\rho_c}{\varepsilon_0}
\frac{\varepsilon_0 \mu_0}{\gamma} \frac{\partial \psi}{\partial t} + \nabla \cdot \mathbf{B} = 0
For full details of the equations, the numerical methods used for solving them, and the specific prompts used within Lanyon for running simulations, see our technical deep dive on the Maxwell equations of electromagnetism.
