Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The integer-transform family: field, flux label, pressure and field-line coordinates

Definition
landreman_integer_iota_family

by LG · Sep 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

mathematical-physicsmhd-equilibriumplasma-physics

This file records, in Cartesian coordinates, the objects of the integer-transform family of analytic MHD equilibria.

Fix a parameter ϵ\epsilonϵ and set a=1+ϵa=\sqrt{1+\epsilon}a=1+ϵ​ and b=1−ϵb=\sqrt{1-\epsilon}b=1−ϵ​. For a point x=(x0,x1,x2)x=(x_0,x_1,x_2)x=(x0​,x1​,x2​) put

s=x02a2+x12b2,ρ=1−(1−s)2−4x22,F=ρ,s=\frac{x_0^2}{a^2}+\frac{x_1^2}{b^2},\qquad \rho = 1-(1-s)^2-4x_2^2,\qquad F=\sqrt{\rho},s=a2x02​​+b2x12​​,ρ=1−(1−s)2−4x22​,F=ρ​,

and define the magnetic field

B=(2x2x0−(a/b)Fx1s, 2x2x1+(b/a)Fx0s, 1−s),B=\left(\frac{2x_2x_0-(a/b)Fx_1}{s},\ \frac{2x_2x_1+(b/a)Fx_0}{s},\ 1-s\right),B=(s2x2​x0​−(a/b)Fx1​​, s2x2​x1​+(b/a)Fx0​​, 1−s),

on the open set Uϵ={x:ρ>0}U_\epsilon=\{x:\rho>0\}Uϵ​={x:ρ>0}. With Q=12(x02+x12+4x22)Q=\tfrac12(x_0^2+x_1^2+4x_2^2)Q=21​(x02​+x12​+4x22​) and the Bernoulli function H=Q+12∣B∣2H=Q+\tfrac12|B|^2H=Q+21​∣B∣2, the flux label and the pressure are

ψ=H−1+ϵ2/22,p=pa−2ψ,\psi=\frac{H-1+\epsilon^2/2}{2},\qquad p=p_a-2\psi,ψ=2H−1+ϵ2/2​,p=pa​−2ψ,

with pap_apa​ an arbitrary constant, and the plasma domain is Ωδ={x∈Uϵ:ψ≤δ}\Omega_\delta=\{x\in U_\epsilon:\psi\le\delta\}Ωδ​={x∈Uϵ​:ψ≤δ}.

The file also records the field-line coordinates. For labels (u,v)(u,v)(u,v), with q2=u2+v2q^2=u^2+v^2q2=u2+v2 and L=((1+1−4q2)/2)1/2L=\big((1+\sqrt{1-4q^2})/2\big)^{1/2}L=((1+1−4q2​)/2)1/2, the position map is

r(u,v,ζ)=(a[Lcos⁡ζ+ucos⁡ζ+vsin⁡ζL], b[Lsin⁡ζ+vcos⁡ζ−usin⁡ζL], vcos⁡2ζ−usin⁡2ζ),r(u,v,\zeta)=\Big(a\big[L\cos\zeta+\tfrac{u\cos\zeta+v\sin\zeta}{L}\big],\ b\big[L\sin\zeta+\tfrac{v\cos\zeta-u\sin\zeta}{L}\big],\ v\cos 2\zeta-u\sin 2\zeta\Big),r(u,v,ζ)=(a[Lcosζ+Lucosζ+vsinζ​], b[Lsinζ+Lvcosζ−usinζ​], vcos2ζ−usin2ζ),

the magnetic axis is γ(ζ)=(1−ϵ2cos⁡ζ, 1−ϵ2sin⁡ζ, ϵ2sin⁡2ζ)\gamma(\zeta)=\big(\sqrt{1-\epsilon^2}\cos\zeta,\ \sqrt{1-\epsilon^2}\sin\zeta,\ \tfrac{\epsilon}{2}\sin2\zeta\big)γ(ζ)=(1−ϵ2​cosζ, 1−ϵ2​sinζ, 2ϵ​sin2ζ), and rotation by an angle ttt about the zzz axis is recorded for the statement of non-axisymmetry.

Finally the complex poloidal displacement of a point from the axis is

(R−Ra)−i(x2−Za),R=x02+x12,Ra=1−ϵ2,Za=ϵx0x1R2,\big(R-R_a\big)-i\big(x_2-Z_a\big),\qquad R=\sqrt{x_0^2+x_1^2},\quad R_a=\sqrt{1-\epsilon^2},\quad Z_a=\frac{\epsilon x_0x_1}{R^2},(R−Ra​)−i(x2​−Za​),R=x02​+x12​​,Ra​=1−ϵ2​,Za​=R2ϵx0​x1​​,

where ZaZ_aZa​ is the elevation of the magnetic axis at the toroidal angle of the point, since ϵ2sin⁡2ϕ=ϵx0x1/R2\tfrac{\epsilon}{2}\sin 2\phi=\epsilon x_0x_1/R^22ϵ​sin2ϕ=ϵx0​x1​/R2. Winding of this quantity along a field line is what measures the rotational transform.

Formalization Note. The definitions are total: outside UϵU_\epsilonUϵ​ the square root returns 000 and the quotients by sss return the library's junk value at s=0s=0s=0, so every theorem about them carries the hypothesis that the point lies in UϵU_\epsilonUϵ​ or in Ωδ\Omega_\deltaΩδ​.

Definition code
import Mathlib
import Definitions.Def_landreman_vector_calculus

namespace Landreman3DEquilibria

/-- `a = √(1 + ε)`, the first semiaxis parameter of the stretching. -/
noncomputable def aCoef (e : ℝ) : ℝ := Real.sqrt (1 + e)

/-- `b = √(1 - ε)`, the second semiaxis parameter of the stretching. -/
noncomputable def bCoef (e : ℝ) : ℝ := Real.sqrt (1 - e)

/-- `s = x²/a² + y²/b²`. -/
noncomputable def sFun (e : ℝ) (x : LVec) : ℝ :=
  x 0 ^ 2 / aCoef e ^ 2 + x 1 ^ 2 / bCoef e ^ 2

/-- The radicand `1 - (1 - s)² - 4 z²` appearing under the square root in `F`. -/
noncomputable def radicand (e : ℝ) (x : LVec) : ℝ := 1 - (1 - sFun e x) ^ 2 - 4 * x 2 ^ 2

/-- `F = √(1 - (1 - s)² - 4 z²)`. -/
noncomputable def FFun (e : ℝ) (x : LVec) : ℝ := Real.sqrt (radicand e x)

/-- The magnetic field of the integer-transform family. -/
noncomputable def Bfield (e : ℝ) (x : LVec) : LVec :=
  ![(2 * x 2 * x 0 - (aCoef e / bCoef e) * FFun e x * x 1) / sFun e x,
    (2 * x 2 * x 1 + (bCoef e / aCoef e) * FFun e x * x 0) / sFun e x,
    1 - sFun e x]

/-- The open domain `U_ε` on which the radicand is positive. -/
def domainU (e : ℝ) : Set LVec := {x | 0 < radicand e x}

/-- `Q = (x² + y² + 4 z²)/2`, the hydrodynamic pressure of the associated Euler flow. -/
noncomputable def Qfun (x : LVec) : ℝ := (x 0 ^ 2 + x 1 ^ 2 + 4 * x 2 ^ 2) / 2

/-- The Bernoulli function `H = Q + |B|²/2`. -/
noncomputable def Hfun (e : ℝ) (x : LVec) : ℝ := Qfun x + normSq (Bfield e x) / 2

/-- The flux label `ψ = (H - 1 + ε²/2)/2`. -/
noncomputable def psiFun (e : ℝ) (x : LVec) : ℝ := (Hfun e x - 1 + e ^ 2 / 2) / 2

/-- The scalar pressure `p = p_a - 2 ψ`. -/
noncomputable def pressure (e pa : ℝ) (x : LVec) : ℝ := pa - 2 * psiFun e x

/-- The toroidal plasma domain `Ω_δ = {x ∈ U_ε : ψ ≤ δ}`. -/
def domainOmega (e d : ℝ) : Set LVec := {x ∈ domainU e | psiFun e x ≤ d}

/-- `L`, determined by the field-line labels through `L² + q²/L² = 1`, `q² = u² + v²`. -/
noncomputable def Lfun (u v : ℝ) : ℝ :=
  Real.sqrt ((1 + Real.sqrt (1 - 4 * (u ^ 2 + v ^ 2))) / 2)

/-- The position map `r(u, v, ζ)` of field-line coordinates. -/
noncomputable def posMap (e u v z : ℝ) : LVec :=
  ![aCoef e * (Lfun u v * Real.cos z + (u * Real.cos z + v * Real.sin z) / Lfun u v),
    bCoef e * (Lfun u v * Real.sin z + (v * Real.cos z - u * Real.sin z) / Lfun u v),
    v * Real.cos (2 * z) - u * Real.sin (2 * z)]

/-- The magnetic axis curve `γ(ζ)`. -/
noncomputable def axisCurve (e z : ℝ) : LVec :=
  ![Real.sqrt (1 - e ^ 2) * Real.cos z, Real.sqrt (1 - e ^ 2) * Real.sin z,
    e / 2 * Real.sin (2 * z)]

/-- Rotation of Cartesian space by the angle `t` about the `z` axis. -/
noncomputable def rotZ (t : ℝ) (x : LVec) : LVec :=
  ![Real.cos t * x 0 - Real.sin t * x 1, Real.sin t * x 0 + Real.cos t * x 1, x 2]

/-- The complex poloidal displacement of a point from the magnetic axis: its real part is
`R - R_a` with `R = √(x² + y²)` and `R_a = √(1 - ε²)`, and its imaginary part is
`-(z - Z_a)` with the axis elevation `Z_a = (ε/2) sin 2φ = ε x y / R²` at the same
toroidal angle `φ`. -/
noncomputable def poloidalDisp (e : ℝ) (x : LVec) : ℂ :=
  ((Real.sqrt (x 0 ^ 2 + x 1 ^ 2) - Real.sqrt (1 - e ^ 2) : ℝ) : ℂ) -
    Complex.I * ((x 2 - e * x 0 * x 1 / (x 0 ^ 2 + x 1 ^ 2) : ℝ) : ℂ)

end Landreman3DEquilibria
Source
M. Landreman, Analytic toroidal 3D MHD equilibria and steady Euler flows with invariant surfaces, J. Plasma Phys. (submitted), arXiv:2609.26742v1 (2026), https://arxiv.org/abs/2609.26742 , Section 2, eqs. (2.1)-(2.4), (2.11), (2.12), (2.16)-(2.19), (2.23)
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic)

Disclosure — non-blind read-back. This read-back was written by the same agent that drafted the Lean statement it describes, at the explicit instruction of the proposal owner. It is therefore not independent testimony from a blind auditor: the author already knew what the statement was intended to say, so it cannot be relied on to expose an unfaithful formalization. Reviewers should compare the Lean code against the cited source directly rather than treating this text as corroboration.

Throughout, points are triples of reals x=(x0,x1,x2)x=(x_0,x_1,x_2)x=(x0​,x1​,x2​) and eee is a real parameter, unrestricted in the definitions themselves.

The file defines a(e)=1+ea(e)=\sqrt{1+e}a(e)=1+e​ and b(e)=1−eb(e)=\sqrt{1-e}b(e)=1−e​ using the real square root, which returns 000 on negative arguments; for e>1e>1e>1 this makes b(e)=0b(e)=0b(e)=0. Then

s(e,x)=x02a(e)2+x12b(e)2,ρ(e,x)=1−(1−s(e,x))2−4x22,F(e,x)=ρ(e,x),s(e,x)=\frac{x_0^2}{a(e)^2}+\frac{x_1^2}{b(e)^2},\qquad \rho(e,x)=1-\big(1-s(e,x)\big)^2-4x_2^2,\qquad F(e,x)=\sqrt{\rho(e,x)},s(e,x)=a(e)2x02​​+b(e)2x12​​,ρ(e,x)=1−(1−s(e,x))2−4x22​,F(e,x)=ρ(e,x)​,

again with the truncated square root, so F=0F=0F=0 wherever ρ≤0\rho\le 0ρ≤0. Division by a(e)2a(e)^2a(e)2, b(e)2b(e)^2b(e)2 or by sss is the total division of the ambient library, which returns 000 when the denominator is 000.

The magnetic field is the triple

B(e,x)=(2x2x0−a(e)b(e)F(e,x) x1s(e,x),2x2x1+b(e)a(e)F(e,x) x0s(e,x),1−s(e,x)).B(e,x)=\left(\frac{2x_2x_0-\frac{a(e)}{b(e)}F(e,x)\,x_1}{s(e,x)},\quad \frac{2x_2x_1+\frac{b(e)}{a(e)}F(e,x)\,x_0}{s(e,x)},\quad 1-s(e,x)\right).B(e,x)=​s(e,x)2x2​x0​−b(e)a(e)​F(e,x)x1​​,s(e,x)2x2​x1​+a(e)b(e)​F(e,x)x0​​,1−s(e,x)​.

The set UeU_eUe​ is {x:ρ(e,x)>0}\{x:\rho(e,x)>0\}{x:ρ(e,x)>0}, a strict inequality, hence an open condition and possibly empty for some eee.

Further scalars: Q(x)=12(x02+x12+4x22)Q(x)=\tfrac12\big(x_0^2+x_1^2+4x_2^2\big)Q(x)=21​(x02​+x12​+4x22​); H(e,x)=Q(x)+12∑iB(e,x)i2H(e,x)=Q(x)+\tfrac12\sum_{i}B(e,x)_i^2H(e,x)=Q(x)+21​∑i​B(e,x)i2​; ψ(e,x)=12(H(e,x)−1+e22)\psi(e,x)=\tfrac12\big(H(e,x)-1+\tfrac{e^2}{2}\big)ψ(e,x)=21​(H(e,x)−1+2e2​); and, for a further real parameter pap_apa​, p(e,pa,x)=pa−2ψ(e,x)p(e,p_a,x)=p_a-2\psi(e,x)p(e,pa​,x)=pa​−2ψ(e,x). The set Ωe,d\Omega_{e,d}Ωe,d​ consists of those xxx that lie in UeU_eUe​ and satisfy ψ(e,x)≤d\psi(e,x)\le dψ(e,x)≤d — a non-strict inequality, and no lower bound on ψ\psiψ is imposed in the definition.

For real u,vu,vu,v, L(u,v)=(1+1−4(u2+v2))/2L(u,v)=\sqrt{\big(1+\sqrt{1-4(u^2+v^2)}\big)/2}L(u,v)=(1+1−4(u2+v2)​)/2​; when u2+v2>1/4u^2+v^2>1/4u2+v2>1/4 the inner square root is 000 by truncation, giving L=1/2L=\sqrt{1/2}L=1/2​. The position map sends (e,u,v,ζ)(e,u,v,\zeta)(e,u,v,ζ) to

(a(e)[Lcos⁡ζ+ucos⁡ζ+vsin⁡ζL],  b(e)[Lsin⁡ζ+vcos⁡ζ−usin⁡ζL],  vcos⁡2ζ−usin⁡2ζ).\Big(a(e)\big[L\cos\zeta+\tfrac{u\cos\zeta+v\sin\zeta}{L}\big],\ \ b(e)\big[L\sin\zeta+\tfrac{v\cos\zeta-u\sin\zeta}{L}\big],\ \ v\cos 2\zeta-u\sin 2\zeta\Big).(a(e)[Lcosζ+Lucosζ+vsinζ​],  b(e)[Lsinζ+Lvcosζ−usinζ​],  vcos2ζ−usin2ζ).

The axis curve sends (e,ζ)(e,\zeta)(e,ζ) to (1−e2cos⁡ζ, 1−e2sin⁡ζ, e2sin⁡2ζ)\big(\sqrt{1-e^2}\cos\zeta,\ \sqrt{1-e^2}\sin\zeta,\ \tfrac{e}{2}\sin 2\zeta\big)(1−e2​cosζ, 1−e2​sinζ, 2e​sin2ζ), with the truncated square root again for ∣e∣>1|e|>1∣e∣>1.

Rotation by ttt about the third axis sends xxx to (x0cos⁡t−x1sin⁡t, x0sin⁡t+x1cos⁡t, x2)\big(x_0\cos t-x_1\sin t,\ x_0\sin t+x_1\cos t,\ x_2\big)(x0​cost−x1​sint, x0​sint+x1​cost, x2​).

The poloidal displacement is the complex number

(x02+x12−1−e2)  −  i(x2−e x0x1x02+x12),\Big(\sqrt{x_0^2+x_1^2}-\sqrt{1-e^2}\Big)\;-\;i\left(x_2-\frac{e\,x_0x_1}{x_0^2+x_1^2}\right),(x02​+x12​​−1−e2​)−i(x2​−x02​+x12​ex0​x1​​),

whose second term is x2x_2x2​ itself when x0=x1=0x_0=x_1=0x0​=x1​=0, since the quotient is then 000 by the division convention.

Every declaration in the file is a definition; nothing is asserted about any of them.

Human review
  • Endorsed by Shuze Chen · Sep 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by LG · Sep 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me