Sovereign 8s.is mirror of standardgalactic/MaxwellEquations
  • Lean 55.4%
  • C 37.6%
  • Racket 7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-20 10:32:23 -04:00
implementations Pushing formally verified C implementations, Lean proofs of correctness, and real-time screen captures (showing Lanyon generating the specifications, implementations, and proofs), for the 1D, 2D, and 3D Maxwell equations and perfectly hyperbolic Maxwell equations. Also pushing README and a simulation example directly from Lanyon. 2026-07-20 10:32:23 -04:00
proofs Pushing formally verified C implementations, Lean proofs of correctness, and real-time screen captures (showing Lanyon generating the specifications, implementations, and proofs), for the 1D, 2D, and 3D Maxwell equations and perfectly hyperbolic Maxwell equations. Also pushing README and a simulation example directly from Lanyon. 2026-07-20 10:32:23 -04:00
screencaps Pushing formally verified C implementations, Lean proofs of correctness, and real-time screen captures (showing Lanyon generating the specifications, implementations, and proofs), for the 1D, 2D, and 3D Maxwell equations and perfectly hyperbolic Maxwell equations. Also pushing README and a simulation example directly from Lanyon. 2026-07-20 10:32:23 -04:00
specifications Pushing formally verified C implementations, Lean proofs of correctness, and real-time screen captures (showing Lanyon generating the specifications, implementations, and proofs), for the 1D, 2D, and 3D Maxwell equations and perfectly hyperbolic Maxwell equations. Also pushing README and a simulation example directly from Lanyon. 2026-07-20 10:32:23 -04:00
.gitattributes Pushing formally verified C implementations, Lean proofs of correctness, and real-time screen captures (showing Lanyon generating the specifications, implementations, and proofs), for the 1D, 2D, and 3D Maxwell equations and perfectly hyperbolic Maxwell equations. Also pushing README and a simulation example directly from Lanyon. 2026-07-20 10:32:23 -04:00
EM-pulse-ez_snapshots.png Pushing formally verified C implementations, Lean proofs of correctness, and real-time screen captures (showing Lanyon generating the specifications, implementations, and proofs), for the 1D, 2D, and 3D Maxwell equations and perfectly hyperbolic Maxwell equations. Also pushing README and a simulation example directly from Lanyon. 2026-07-20 10:32:23 -04:00
LICENSE Initial commit 2026-07-19 23:54:19 -04:00
README.md Pushing formally verified C implementations, Lean proofs of correctness, and real-time screen captures (showing Lanyon generating the specifications, implementations, and proofs), for the 1D, 2D, and 3D Maxwell equations and perfectly hyperbolic Maxwell equations. Also pushing README and a simulation example directly from Lanyon. 2026-07-20 10:32:23 -04:00

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.

Electromagnetic pulse interacting with a metal box in a 2D domain, simulated with 100x100 cells.