← Back to PlasmaLean Exposition Hub
AI & Lean 4 Stellarator Engine

PlasmaLean: Designing a Practical Stellarator with Machine-Checked Mathematics

Bridging Small-Kernel Formal Verification, Differential & Complex Geometry, and 3D Fusion Engineering

Portal: siddhartha-gadgil.github.io/PlasmaLean/

Core philosophy: keep the basic physical laws in a small, human-auditable domain kernel (six modules, about 900 lines), test each law with sanity checks (an instance, a counterexample, risk-specific checks), audit it against its sources, and state every other supplied model explicitly, so that humans and AI agents prove theorems about the intended physics.

The Core Physics Problem

Why Stellarators: Rotational Transform Without Plasma Current

Tokamaks (axisymmetric)

  • An axisymmetric field with no plasma current has rotational transform $\iota = 0$: its field lines do not rotate poloidally, so it confines nothing.
  • A tokamak gets $\iota$ from a large toroidal plasma current (megaamperes), driven inductively or by current drive.
  • That current brings current-driven instabilities (kinks, tearing), disruptions, and pulsed operation or continuous current drive.

Stellarators (rotational transform from the external field)

  • Shaped external coils give $\iota \ge \iota_{\min} > 0$ with little or no plasma current. Such a field cannot be axisymmetric, so non-axisymmetry is a consequence of this requirement, not a goal.
  • The price: a generic 3-D field confines trapped particles poorly. Thermal ions and electrons need omnigeneity (vanishing bounce-averaged radial drift) or a small effective ripple $\epsilon_{\rm eff}$. Quasisymmetry and quasi-isodynamic fields are special cases.
Project Target (30 October 2026)

The Stellarator Contract C1–C5

Clause Requirement (one candidate, common witnesses) Status in Lean
C1 current-free rotational transform Net toroidal current small (vacuum as the limit); $\iota \ge \iota_{\min} > 0$ from the external field. Excludes tokamaks. Partial, vacuum only: exact rational vacuum field with one KAM-certified torus ($\iota \approx 0.137$).
C2 omnigeneity Bounded bounce-averaged radial drift or $\epsilon_{\rm eff}$ for thermal ions and electrons (QS, QI as special cases). Essentially open. Weak QS defined; Landreman families proved not weakly QS.
C3 finite-β MHD stability Mercier, ballooning and global modes at a stated $\beta > 0$. Mercier band for Landreman family 2, which carries net current (fails C1). Nothing for a current-free candidate.
C4 existence Nested flux surfaces and force balance $J \times B = \nabla p$ (vacuum: $J = 0$). Vacuum rational field inside one torus; finite β only for current-carrying or symmetric models.
C5 thermal performance On the same candidate: core $T \ge 10$ keV over the operating interval, from power balance; neoclassical losses from C2. Essentially open for stellarators: shown only on the Solov'ev field, which is a tokamak model, plus 0-D windows.

Sources: the contract section of notes/implementation-plan.md. Non-axisymmetric results with no other content (Grad counterexamples) are mathematical infrastructure, not design progress.

Pillar 3 · Architectural Trust

The Small-Kernel & Sanity-Check Pattern

Lean checks the proofs; a reader must check the statements and the supplied laws. How do we keep those honest and non-vacuous?

1. Small domain kernel (about 900 lines, six modules)

  • Kernel/{Equilibrium, Slab, ThermalSlab, Vacuum, Transport, Fusion}: force balance ForceBalance, vacuum fields VacuumField (divergence and curl via Fréchet derivatives), slab MHD and heat laws, radial transport, 0-D D-T burn.
  • Laws are Prop classes and structures (hypotheses), not axioms: the axiom check passes with only propext, Classical.choice, Quot.sound.

2. Sanity checks and the strict audit (30 October 2026)

  • Each law has an instance and a counterexample, e.g. rotationField_not_vacuum, slab_rejects_compressive.
  • Risk checks expose weak spots: forceBalance_of_cross (force balance means nothing until $g = \nabla p$ is proved, E-1), vacuumField_empty (empty regions, V-1).
  • All 52 kernel declarations reviewed: 1 medium finding (F-1, fixed), 9 low (recorded with regression theorems).
Pillar 4 · Compiled Milestone

A Field-Error and Clearance Certificate for a Calibration Fixture

Compiled in PlasmaLean (Design/VacuumPair, Design/VacuumTolerance): two coaxial circular filament loops, an axisymmetric calibration fixture (no rotational transform, no confinement claim).

  1. Clearance: every point of the 5 cm observation ball is at least 0.15 m from both filaments (source_clearance).
  2. Biot–Savart bounds and derivatives: $\|B\|$ bounded on the whole ball (field_bound); Fréchet derivative and its bound (manufactured_field_derivative).
  3. Manufacturing budget: for every pair of $C^1$ coils within 1 mm (position) and 1 mm per radian (tangent), and currents within 1 %, $\|B_{\rm actual} - B_{\rm nominal}\| \le \mu_0 I/4$ on the ball (combined_field_error); boundary-to-volume transfer on a cube (combined_volume_error).
  4. Assembled: a nonzero field in a 1 mm probe ball (robust_probe_field) and 388 mm clearance between 5 mm tube envelopes (manufactured_tube_clearance).
Pillar 1 · Rosetta Stone

Translating Physics into Pure Geometry

Stellarator Physics Differential / Complex / Symplectic Geometry
Flux surface $\psi = c$ Compact regular level set $\Sigma_c \cong T^2$ of a first integral ($\mathcal{L}_B \psi = 0$)
Vacuum field ($\nabla\cdot B=0, \nabla\times B=0$) Harmonic 1-form $\beta \in \mathcal{H}^1(M, g)$ ($d\beta = 0, d^*\beta = 0$)
Force-free field ($\nabla \times B = \lambda B$) Beltrami 1-form $\star d\beta = \lambda \beta$ (Contact structure $\beta \wedge d\beta \neq 0$ when $\lambda \neq 0$)
Rotational transform $\iota(\psi)$ Poincaré rotation number of area-preserving poloidal return map
Guiding-center particle drift Hamiltonian flow of Littlejohn's non-canonical symplectic 2-form $\Omega_{GC}$
Non-folding Fourier surfaces ($\sqrt{g} > 0$) Univalence of planar harmonic maps on $\mathbb{D} \subset \mathbb{C}$ (Radó–Kneser–Choquet)
Invitation #1 · Topology & Dynamical Systems

Open Targets for Topologists

1. Arnold–Poincaré–Hopf Toroidal Level Sets

From $\mathbf{J} \times \mathbf{B} = \nabla p \neq 0$, prove $(\mathbf{B}, \mathbf{J})$ trivializes $T\Sigma_c$ on a compact regular level set, forcing $\chi(\Sigma_c) = 0$ and $\Sigma_c \cong T^2$. Already in the library: the tangency (field_tangency, current_tangency), and tori for Landreman family 1 via torusMap.

Stub: Challenge1_PoincareHopfTorus.lean

2. Gauss Linking & Converse KAM

Formalize homotopy invariance of the Gauss linking integral $\mathrm{Lk}(\gamma_1, \gamma_2)$ for modular coils, and MacKay's Converse KAM criteria to bound magnetic island chaos.

Stub: Challenge2_GaussLinking.lean

Invitation #2 · Differential & Symplectic Geometry

Open Targets for Differential Geometers

3. Parallel Bishop Frames & Tubular Reach

Frenet frames fail when curvature $\kappa(s)=0$ (quasi-isodynamic stellarators). Formalize parallel Bishop frames $(T, N_1, N_2)$ and prove the tubular neighborhood Jacobian $\det(D\Phi) = 1 - r_1 k_1 - r_2 k_2 > 0$ for $r < 1/\kappa_{\max}$.

Stub: Challenge3_BishopFrameNearAxis.lean

4. Littlejohn Symplectic Form & Noether

Prove that $(M,N)$-quasisymmetry $\mathcal{L}_u |B| = 0$ generates an exact conserved helical momentum $P_{\text{hel}}$ under guiding-center symplectic dynamics.

Stub: Challenge4_QuasisymmetryNoether.lean

Invitation #3 · Complex Geometry & Harmonic Analysis

Open Targets for Complex Geometers

5. Univalence of Harmonic Fourier Maps

Certify that double Fourier series $(R_{m,n}, Z_{m,n})$ define non-overlapping flux surfaces ($\det D\Phi > 0$) using complex-analytic $\ell^1$ contraction and Nehari/Radó–Kneser–Choquet univalence criteria on $\mathbb{D} \subset \mathbb{C}$.

Stub: Challenge5_HarmonicUnivalence.lean

6. Riemann Surface Modulus $\tau(\psi) \in \mathbb{H}$

Every toroidal flux surface $\Sigma_\psi \cong \mathbb{C}/(\mathbb{Z} + \tau(\psi)\mathbb{Z})$ carries a Hodge star $\star_g^2 = -I_2$ and period matrix determined by its conformal modulus $\tau(\psi)$. Partly done for constant metrics: periodBound_eq, energy_ge (Theory/Geometry/TorusHodge).

Stub: Challenge6_ConformalTorusModulus.lean

Get Involved

How to Contribute in 15 Minutes

  1. Browse the Rosetta Stone & 10-Min Kernel Audit to see the real Lean 4 declarations and what is not yet in the library.
  2. Pick a Self-Contained Lean 4 Bounty Stub from lean_stubs/Challenge1..6.lean (each file imports only Mathlib—no physics solver setup needed!).
  3. Replace sorry with a Lean 4 Proof (using human insight, grind, or AI theorem-proving assistants) and open a PR to siddhartha-gadgil/PlasmaLean.