The integer-transform family: field, flux label, pressure and field-line coordinates
Definitionlandreman_integer_iota_familyThis file records, in Cartesian coordinates, the objects of the integer-transform family of analytic MHD equilibria.
Fix a parameter and set and . For a point put
and define the magnetic field
on the open set . With and the Bernoulli function , the flux label and the pressure are
with an arbitrary constant, and the plasma domain is .
The file also records the field-line coordinates. For labels , with and , the position map is
the magnetic axis is , and rotation by an angle about the axis is recorded for the statement of non-axisymmetry.
Finally the complex poloidal displacement of a point from the axis is
where is the elevation of the magnetic axis at the toroidal angle of the point, since . Winding of this quantity along a field line is what measures the rotational transform.
Formalization Note. The definitions are total: outside the square root returns and the quotients by return the library's junk value at , so every theorem about them carries the hypothesis that the point lies in or in .
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
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 and is a real parameter, unrestricted in the definitions themselves.
The file defines and using the real square root, which returns on negative arguments; for this makes . Then
again with the truncated square root, so wherever . Division by , or by is the total division of the ambient library, which returns when the denominator is .
The magnetic field is the triple
The set is , a strict inequality, hence an open condition and possibly empty for some .
Further scalars: ; ; ; and, for a further real parameter , . The set consists of those that lie in and satisfy — a non-strict inequality, and no lower bound on is imposed in the definition.
For real , ; when the inner square root is by truncation, giving . The position map sends to
The axis curve sends to , with the truncated square root again for .
Rotation by about the third axis sends to .
The poloidal displacement is the complex number
whose second term is itself when , since the quotient is then by the division convention.
Every declaration in the file is a definition; nothing is asserted about any of them.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.