Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Time-harmonic Maxwell fields, Sommerfeld kernels, and planar Mie and generalized Debye representations

Definition
Arxiv1310_4241_Basic

by Xeroth · Nov 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

debye-sourceslayered-medialow-frequency-breakdownmaxwell-equationssommerfeld-integrals

Objects of Sections I, II, IV and V of O'Neil (2013).

  1. Space and differential operators. Points of R3\mathbb R^3R3 are x=(x,y,z)\mathbf x=(x,y,z)x=(x,y,z); z>0z>0z>0 is the upper half-space. Fields are complex: a scalar field is f:R3→Cf:\mathbb R^3\to\mathbb Cf:R3→C, a vector field F:R3→C3\mathbf F:\mathbb R^3\to\mathbb C^3F:R3→C3. ∂i\partial_i∂i​, ∇\nabla∇, ∇⋅\nabla\cdot∇⋅, ∇×\nabla\times∇× and △\triangle△ are the usual real partial derivatives, gradient, divergence, curl and Laplacian. The transverse Laplacian is ∂x2+∂y2\partial_x^2+\partial_y^2∂x2​+∂y2​, and the tangential divergence of F\mathbf FF is ∂xFx+∂yFy\partial_xF_x+\partial_yF_y∂x​Fx​+∂y​Fy​, the divergence of its tangential projection −n×n×F-\mathbf n\times\mathbf n\times\mathbf F−n×n×F (eq. (38)). The normal is n=z^\mathbf n=\hat{\mathbf z}n=z^, so n×(a,b,c)=(−b,a,0)\mathbf n\times(a,b,c)=(-b,a,0)n×(a,b,c)=(−b,a,0).
  2. Maxwell fields (Section I). The wavenumber is k=ωεμk=\omega\sqrt{\varepsilon\mu}k=ωεμ​ (principal root) with ω∈R\omega\in\mathbb Rω∈R and ε,μ∈C\varepsilon,\mu\in\mathbb Cε,μ∈C, and the standing assumption is Re⁡k>0\operatorname{Re}k>0Rek>0, Im⁡k≥0\operatorname{Im}k\ge0Imk≥0. A source-free time-harmonic Maxwell field on an open set UUU is a pair (E,H)(\mathbf E,\mathbf H)(E,H) of fields differentiable on UUU with ∇×E=iωμH\nabla\times\mathbf E=i\omega\mu\mathbf H∇×E=iωμH, ∇×H=−iωεE\nabla\times\mathbf H=-i\omega\varepsilon\mathbf E∇×H=−iωεE, ∇⋅E=∇⋅H=0\nabla\cdot\mathbf E=\nabla\cdot\mathbf H=0∇⋅E=∇⋅H=0 on UUU (eq. (1) with J=0\mathbf J=0J=0, ρ=0\rho=0ρ=0). The radiation condition is eq. (3) exactly as printed, lim⁡∣x∣→∞, x∈U(H(x)×r^−μεE(x))=0\lim_{|\mathbf x|\to\infty,\ \mathbf x\in U}\big(\mathbf H(\mathbf x)\times\hat{\mathbf r}-\tfrac{\mu}{\varepsilon}\mathbf E(\mathbf x)\big)=0lim∣x∣→∞, x∈U​(H(x)×r^−εμ​E(x))=0 with r^=x/∣x∣\hat{\mathbf r}=\mathbf x/|\mathbf x|r^=x/∣x∣.
  3. Planar Mie fields (eq. (22)). For scalar u,vu,vu,v: E=∇×∇×(uz^)+iωμ∇×(vz^)\mathbf E=\nabla\times\nabla\times(u\hat{\mathbf z})+i\omega\mu\nabla\times(v\hat{\mathbf z})E=∇×∇×(uz^)+iωμ∇×(vz^), H=∇×∇×(vz^)−iωε∇×(uz^)\mathbf H=\nabla\times\nabla\times(v\hat{\mathbf z})-i\omega\varepsilon\nabla\times(u\hat{\mathbf z})H=∇×∇×(vz^)−iωε∇×(uz^). uuu solves the Helmholtz equation on UUU if △u+k2u=0\triangle u+k^2u=0△u+k2u=0 there.
  4. Green's function and Sommerfeld kernel (eqs. (9)-(10)). gk(x)=eik∣x∣/(4π∣x∣)g_k(\mathbf x)=e^{ik|\mathbf x|}/(4\pi|\mathbf x|)gk​(x)=eik∣x∣/(4π∣x∣). With β=ξ2+η2−k2\beta=\sqrt{\xi^2+\eta^2-k^2}β=ξ2+η2−k2​, g^k(ξ,η,z)=e−β∣z∣/(8π2β)\widehat g_k(\xi,\eta,z)=e^{-\beta|z|}/(8\pi^2\beta)g​k​(ξ,η,z)=e−β∣z∣/(8π2β). The branch of β\betaβ is the principal root, except on the negative real axis (only for real kkk and ξ2+η2<k2\xi^2+\eta^2<k^2ξ2+η2<k2), where β=−ik2−ξ2−η2\beta=-i\sqrt{k^2-\xi^2-\eta^2}β=−ik2−ξ2−η2​; this is the branch with Re⁡β≥0\operatorname{Re}\beta\ge0Reβ≥0 for which eq. (9) represents the outgoing gkg_kgk​. The kernels e−βz/(8π2β)e^{-\beta z}/(8\pi^2\beta)e−βz/(8π2β) and eβz/(8π2β)e^{\beta z}/(8\pi^2\beta)eβz/(8π2β) of eqs. (46) and (47) are used above and below an interface.
  5. Lorenz-gauge fields of a current (eq. (6)). For a current J\mathbf JJ: A=∫gk(x−x′)J(x′) dV′\mathbf A=\int g_k(\mathbf x-\mathbf x')\mathbf J(\mathbf x')\,dV'A=∫gk​(x−x′)J(x′)dV′, H=∇×A\mathbf H=\nabla\times\mathbf AH=∇×A, and E=iωμA−1iωε∇∫gk(x−x′) ∇⋅J(x′) dV′\mathbf E=i\omega\mu\mathbf A-\frac1{i\omega\varepsilon}\nabla\int g_k(\mathbf x-\mathbf x')\,\nabla\cdot\mathbf J(\mathbf x')\,dV'E=iωμA−iωε1​∇∫gk​(x−x′)∇⋅J(x′)dV′.
  6. Debye potentials (eq. (24)). For a spectral density σ^\widehat\sigmaσ on R2\mathbb R^2R2, u(x,y,z)=∫R2g^k(ξ,η,z)σ^(ξ,η)ei(ξx+ηy) dξ dηu(x,y,z)=\int_{\mathbb R^2}\widehat g_k(\xi,\eta,z)\widehat\sigma(\xi,\eta)e^{i(\xi x+\eta y)}\,d\xi\,d\etau(x,y,z)=∫R2​g​k​(ξ,η,z)σ(ξ,η)ei(ξx+ηy)dξdη.
  7. Generalized Debye sources on one Fourier mode (Section V). Fix (ξ,η)(\xi,\eta)(ξ,η) and write e=ei(ξx+ηy)e=e^{i(\xi x+\eta y)}e=ei(ξx+ηy). A planar density c ec\,ece has single-layer potential Sk[c e]=g^k(ξ,η,z) c e\mathcal S_k[c\,e]=\widehat g_k(\xi,\eta,z)\,c\,eSk​[ce]=g​k​(ξ,η,z)ce (eq. (40), with e−βze^{-\beta z}e−βz above and eβze^{\beta z}eβz below the plane), and ∇△−1[c e]\nabla\triangle^{-1}[c\,e]∇△−1[ce] has coefficient vector (iξ,iη,0)⋅(−c/(ξ2+η2))(i\xi,i\eta,0)\cdot(-c/(\xi^2+\eta^2))(iξ,iη,0)⋅(−c/(ξ2+η2)) (eq. (41)). On the plane, S0\mathcal S_0S0​ multiplies a function of frequency (ξ,η)(\xi,\eta)(ξ,η) by g^0(ξ,η,0)\widehat g_0(\xi,\eta,0)g​0​(ξ,η,0). The generalized Debye fields are E=μ (ikSk[j]−∇Sk[r]−∇×Sk[m])\mathbf E=\sqrt\mu\,(ik\mathcal S_k[\mathbf j]-\nabla\mathcal S_k[r]-\nabla\times\mathcal S_k[\mathbf m])E=μ​(ikSk​[j]−∇Sk​[r]−∇×Sk​[m]) and H=ε (ikSk[m]−∇Sk[q]+∇×Sk[j])\mathbf H=\sqrt\varepsilon\,(ik\mathcal S_k[\mathbf m]-\nabla\mathcal S_k[q]+\nabla\times\mathcal S_k[\mathbf j])H=ε​(ikSk​[m]−∇Sk​[q]+∇×Sk​[j]) (eqs. (32)-(34), (45)).
  8. Perfect conductor (eq. (35)). j=ik(∇△−1r−n×∇△−1q)\mathbf j=ik(\nabla\triangle^{-1}r-\mathbf n\times\nabla\triangle^{-1}q)j=ik(∇△−1r−n×∇△−1q), m=n×j\mathbf m=\mathbf n\times\mathbf jm=n×j, fields in z≥0z\ge0z≥0.
  9. Two layers (eqs. (45)-(48), (51), (53)). Real constants ε0,μ0\varepsilon_0,\mu_0ε0​,μ0​ in z>0z>0z>0 and ε1,μ1\varepsilon_1,\mu_1ε1​,μ1​ in z≤0z\le0z≤0, kj=ωεjμjk_j=\omega\sqrt{\varepsilon_j\mu_j}kj​=ωεj​μj​​; currents j0=iω(μ0ε0∇△−1r0−ε1μ1/ε0 n×∇△−1r1)\mathbf j_0=i\omega(\sqrt{\mu_0\varepsilon_0}\nabla\triangle^{-1}r_0-\varepsilon_1\sqrt{\mu_1/\varepsilon_0}\,\mathbf n\times\nabla\triangle^{-1}r_1)j0​=iω(μ0​ε0​​∇△−1r0​−ε1​μ1​/ε0​​n×∇△−1r1​), j1=n×ε0/ε1 j0\mathbf j_1=\mathbf n\times\sqrt{\varepsilon_0/\varepsilon_1}\,\mathbf j_0j1​=n×ε0​/ε1​​j0​, and m0,m1\mathbf m_0,\mathbf m_1m0​,m1​ likewise with qjq_jqj​ and ε↔μ\varepsilon\leftrightarrow\muε↔μ. The jumps [f]=f0−f1[f]=f_0-f_1[f]=f0​−f1​ of S0∇⋅E\mathcal S_0\nabla\cdot\mathbf ES0​∇⋅E, n⋅εE\mathbf n\cdot\varepsilon\mathbf En⋅εE, S0∇⋅H\mathcal S_0\nabla\cdot\mathbf HS0​∇⋅H, n⋅μH\mathbf n\cdot\mu\mathbf Hn⋅μH across z=0z=0z=0 define a linear map of (r^0,r^1,q^0,q^1)(\widehat r_0,\widehat r_1,\widehat q_0,\widehat q_1)(r0​,r1​,q​0​,q​1​), whose 4×44\times44×4 matrix is the system matrix of eq. (53).

Formalization Note The paper does not name the branch of ξ2+η2−k2\sqrt{\xi^2+\eta^2-k^2}ξ2+η2−k2​; the branch chosen is the one that makes eq. (9) true. Section V is formalised on one Fourier mode, on which the paper states every operator acts by multiplication (eqs. (39)-(41)); its eq. (40) is used as the definition of Sk\mathcal S_kSk​ on a mode. Section V.B uses positive real material constants, for which the square roots of ratios in eq. (48) are unambiguous. A matrix entry of eq. (53) is the Fourier coefficient of a jump, read off as its value at the origin, where e=1e=1e=1.

Definition code
import Mathlib

/-!
M. O'Neil, *A generalized Debye source approach to electromagnetic scattering in layered media*,
arXiv:1310.4241v1 (2013): time-harmonic Maxwell fields and the Helmholtz Green's function with its
Sommerfeld (spectral) representation (Sections I-II, eqs. (1)-(10)), the Lorenz-gauge fields of a
current (eq. (6)), the planar Lorenz-Debye-Mie representation (Section IV, eqs. (22)-(24)), and the
generalized Debye source representation on a perfectly conducting half-space and on a two-layer
medium, evaluated on one Fourier mode (Section V, eqs. (32)-(41) and (45)-(53)).
-/

open MeasureTheory

noncomputable section

namespace Arxiv1310_4241

/-- Physical space `ℝ³` (Section I); the point `p` has coordinates `(x, y, z) = (p 0, p 1, p 2)`. -/
abbrev Space := EuclideanSpace ℝ (Fin 3)

/-- The point `(x, y, z)` of space. -/
def pt (x y z : ℝ) : Space := !₂[x, y, z]

/-- Section II: the upper half-space `z > 0`, the homogeneous region where the scattered fields
are represented. -/
def upperHalfSpace : Set Space := {p | 0 < p 2}

/-- The partial derivative `∂f/∂x_i` at `p` (derivative along the `i`-th coordinate direction). -/
def pd {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] (i : Fin 3) (f : Space → F)
    (p : Space) : F :=
  fderiv ℝ f p (EuclideanSpace.single i 1)

/-- Gradient `∇f` of a complex scalar field. -/
def grad (f : Space → ℂ) (p : Space) : Fin 3 → ℂ := ![pd 0 f p, pd 1 f p, pd 2 f p]

/-- Divergence `∇ · F` of a complex vector field. -/
def divergence (F : Space → Fin 3 → ℂ) (p : Space) : ℂ :=
  pd 0 (fun q => F q 0) p + pd 1 (fun q => F q 1) p + pd 2 (fun q => F q 2) p

/-- Curl `∇ × F` of a complex vector field. -/
def curl (F : Space → Fin 3 → ℂ) (p : Space) : Fin 3 → ℂ :=
  ![pd 1 (fun q => F q 2) p - pd 2 (fun q => F q 1) p,
    pd 2 (fun q => F q 0) p - pd 0 (fun q => F q 2) p,
    pd 0 (fun q => F q 1) p - pd 1 (fun q => F q 0) p]

/-- Laplacian `△f = ∂²f/∂x² + ∂²f/∂y² + ∂²f/∂z²`. -/
def laplacian (f : Space → ℂ) (p : Space) : ℂ :=
  pd 0 (pd 0 f) p + pd 1 (pd 1 f) p + pd 2 (pd 2 f) p

/-- Eq. (23): the transverse Laplacian `∂²f/∂x² + ∂²f/∂y²`. -/
def transverseLaplacian (f : Space → ℂ) (p : Space) : ℂ :=
  pd 0 (pd 0 f) p + pd 1 (pd 1 f) p

/-- Section V: the divergence along the plane `z = const` of the tangential projection
`-n × n × F = (F_x, F_y, 0)` of a vector field (eq. (38)), `∂F_x/∂x + ∂F_y/∂y`. -/
def tangentialDivergence (F : Space → Fin 3 → ℂ) (p : Space) : ℂ :=
  pd 0 (fun q => F q 0) p + pd 1 (fun q => F q 1) p

/-- The vector field `u ẑ` (eq. (22)). -/
def zhatField (u : Space → ℂ) : Space → Fin 3 → ℂ := fun p => ![0, 0, u p]

/-- `n × v` with `n = ẑ` (Sections II and V: `n = ẑ` always). -/
def nCross (v : Fin 3 → ℂ) : Fin 3 → ℂ := ![-v 1, v 0, 0]

/-- Section I: the wavenumber `k = ω √(εμ)` (principal square root). -/
def wavenumber (ω : ℝ) (ε μ : ℂ) : ℂ := ω * (ε * μ) ^ (1 / 2 : ℂ)

/-- Section I: the standing causality assumption on the wavenumber, `Re k > 0` and `Im k ≥ 0`. -/
def IsCausalWavenumber (k : ℂ) : Prop := 0 < k.re ∧ 0 ≤ k.im

/-- Principal square root of a complex number (used for `√ε`, `√μ` of Section V). -/
def csqrt (z : ℂ) : ℂ := z ^ (1 / 2 : ℂ)

/-- Eq. (1) on an open region `U` free of sources (`J = 0`, `ρ = 0` there): the fields are
differentiable and `∇ × E = iωμH`, `∇ × H = -iωεE`, `∇ · E = 0`, `∇ · H = 0` on `U`. -/
def IsSourceFreeMaxwellOn (ω : ℝ) (ε μ : ℂ) (U : Set Space) (E H : Space → Fin 3 → ℂ) : Prop :=
  ∀ p ∈ U, DifferentiableAt ℝ E p ∧ DifferentiableAt ℝ H p ∧
    curl E p = (Complex.I * ω * μ) • H p ∧ curl H p = (-(Complex.I * ω * ε)) • E p ∧
    divergence E p = 0 ∧ divergence H p = 0

/-- The radial unit vector `r̂ = x / |x|`. -/
def radialUnit (p : Space) : Fin 3 → ℂ := fun i => ((p i / ‖p‖ : ℝ) : ℂ)

/-- Eq. (3), as printed: `lim_{|x| → ∞} (H(x) × r̂ - (μ/ε) E(x)) = 0`, the limit taken over
points of the region `U`. -/
def SilverMullerAsPrinted (ε μ : ℂ) (U : Set Space) (E H : Space → Fin 3 → ℂ) : Prop :=
  Filter.Tendsto (fun p => crossProduct (H p) (radialUnit p) - (μ / ε) • E p)
    (Bornology.cobounded Space ⊓ Filter.principal U) (nhds 0)

/-- `u` solves the homogeneous Helmholtz equation `△u + k²u = 0` on `U` (Section IV). -/
def IsHelmholtzOn (k : ℂ) (U : Set Space) (u : Space → ℂ) : Prop :=
  ∀ p ∈ U, laplacian u p + k ^ 2 * u p = 0

/-- Eq. (22): the planar Lorenz-Debye-Mie electric field
`E = ∇ × ∇ × (u ẑ) + iωμ ∇ × (v ẑ)`. -/
def mieE (ω : ℝ) (μ : ℂ) (u v : Space → ℂ) : Space → Fin 3 → ℂ :=
  fun p => curl (curl (zhatField u)) p + (Complex.I * ω * μ) • curl (zhatField v) p

/-- Eq. (22): the planar Lorenz-Debye-Mie magnetic field
`H = ∇ × ∇ × (v ẑ) - iωε ∇ × (u ẑ)`. -/
def mieH (ω : ℝ) (ε : ℂ) (u v : Space → ℂ) : Space → Fin 3 → ℂ :=
  fun p => curl (curl (zhatField v)) p - (Complex.I * ω * ε) • curl (zhatField u) p

/-- Eq. (9): the Helmholtz Green's function `g_k(x) = e^{ik|x|} / (4π|x|)`. -/
def greenFn (k : ℂ) (p : Space) : ℂ :=
  Complex.exp (Complex.I * k * ‖p‖) / (4 * Real.pi * ‖p‖)

/-- Eqs. (9)-(10): `β = √(ξ² + η² - k²)`. The paper does not name the branch; this is the root
with `Re β ≥ 0` for which the Sommerfeld formula (9) represents `e^{ik|x|}/(4π|x|)`: the principal
root, except on the negative real axis (reached only for real `k` and `ξ² + η² < k²`), where
`β = -i √(k² - ξ² - η²)`, the limit of the principal root from `Im k > 0`. -/
def sommerfeldRoot (k : ℂ) (ξ η : ℝ) : ℂ :=
  if ((ξ : ℂ) ^ 2 + (η : ℂ) ^ 2 - k ^ 2).im = 0 ∧ ((ξ : ℂ) ^ 2 + (η : ℂ) ^ 2 - k ^ 2).re < 0 then
    -Complex.I * (Real.sqrt (-((ξ : ℂ) ^ 2 + (η : ℂ) ^ 2 - k ^ 2).re) : ℂ)
  else ((ξ : ℂ) ^ 2 + (η : ℂ) ^ 2 - k ^ 2) ^ (1 / 2 : ℂ)

/-- Eq. (10): `ĝ_k(ξ, η, z) = e^{-β|z|} / (8π² β)`. -/
def ghat (k : ℂ) (ξ η z : ℝ) : ℂ :=
  Complex.exp (-(sommerfeldRoot k ξ η) * |z|) / (8 * Real.pi ^ 2 * sommerfeldRoot k ξ η)

/-- Eq. (46): the kernel used above an interface, `e^{-βz} / (8π² β)` (equal to `ĝ_k` for
`z ≥ 0`, continued as the same exponential). -/
def ghatUp (k : ℂ) (ξ η z : ℝ) : ℂ :=
  Complex.exp (-(sommerfeldRoot k ξ η) * z) / (8 * Real.pi ^ 2 * sommerfeldRoot k ξ η)

/-- Eq. (47): the kernel used below an interface, `e^{βz} / (8π² β)` (equal to `ĝ_k` for
`z ≤ 0`, continued as the same exponential). -/
def ghatDown (k : ℂ) (ξ η z : ℝ) : ℂ :=
  Complex.exp (sommerfeldRoot k ξ η * z) / (8 * Real.pi ^ 2 * sommerfeldRoot k ξ η)

/-- The plane wave `e^{i(ξx + ηy)}` (eqs. (24), (37)). -/
def planeWave (ξ η x y : ℝ) : ℂ := Complex.exp (Complex.I * (ξ * x + η * y))

/-- Eq. (6): the volume potential `∫ g_k(x - x') f(x') dV'`. -/
def volumePotential (k : ℂ) (f : Space → ℂ) (p : Space) : ℂ :=
  ∫ q, greenFn k (p - q) * f q

/-- Eq. (6): the vector potential `∫ g_k(x - x') J(x') dV'` of a current `J`, componentwise. -/
def vectorPotential (k : ℂ) (J : Space → Fin 3 → ℂ) : Space → Fin 3 → ℂ :=
  fun p i => volumePotential k (fun q => J q i) p

/-- Eq. (6): the Lorenz-gauge magnetic field `H = ∇ × ∫ g_k J dV'`. -/
def lorenzH (k : ℂ) (J : Space → Fin 3 → ℂ) : Space → Fin 3 → ℂ :=
  curl (vectorPotential k J)

/-- Eq. (6): the Lorenz-gauge electric field
`E = iωμ ∫ g_k J dV' - (1/(iωε)) ∇ ∫ g_k (∇ · J) dV'`, with `k = ω √(εμ)`. -/
def lorenzE (ω : ℝ) (ε μ : ℂ) (J : Space → Fin 3 → ℂ) : Space → Fin 3 → ℂ :=
  fun p => (Complex.I * ω * μ) • vectorPotential (wavenumber ω ε μ) J p -
    (1 / (Complex.I * ω * ε)) • grad (volumePotential (wavenumber ω ε μ) (divergence J)) p

/-- Eq. (24): the Debye potential `u(x, y, z) = ∫ ĝ_k(ξ, η, z) σ̂(ξ, η) e^{i(ξx + ηy)} dξ dη`
with spectral density `σ̂`. -/
def debyePotential (k : ℂ) (σh : ℝ × ℝ → ℂ) (p : Space) : ℂ :=
  ∫ ζ : ℝ × ℝ, ghat k ζ.1 ζ.2 (p 2) * σh ζ * planeWave ζ.1 ζ.2 (p 0) (p 1)

/-! ### Section V on one Fourier mode

The paper evaluates every operator of the generalized Debye representation on Fourier modes
`e^{i(ξx+ηy)}`, where it acts by multiplication (Section V.A, eqs. (39)-(41)). The definitions
below are the densities, currents, layer potentials and fields generated by one mode. -/

/-- The planar mode `e^{i(ξx + ηy)}` as a function on space (independent of `z`). -/
def mode (ξ η : ℝ) (p : Space) : ℂ := planeWave ξ η (p 0) (p 1)

/-- A planar vector density with constant coefficient vector `v` on the mode `(ξ, η)`. -/
def modeField (v : Fin 3 → ℂ) (ξ η : ℝ) : Space → Fin 3 → ℂ := fun p i => v i * mode ξ η p

/-- Eqs. (40), (46): the Helmholtz single layer `S_k` of the planar density `c e^{i(ξx+ηy)}` on
`z = 0`, on and above the plane: `ĝ_k(ξ, η, z) c e^{i(ξx+ηy)}` with `e^{-βz}`. -/
def slpUp (k : ℂ) (ξ η : ℝ) (c : ℂ) : Space → ℂ :=
  fun p => ghatUp k ξ η (p 2) * c * mode ξ η p

/-- Eqs. (40), (47): the single layer `S_k` of `c e^{i(ξx+ηy)}` on and below the plane, with
`e^{βz}`. -/
def slpDown (k : ℂ) (ξ η : ℝ) (c : ℂ) : Space → ℂ :=
  fun p => ghatDown k ξ η (p 2) * c * mode ξ η p

/-- Eqs. (39)-(41): the coefficient vector of `∇△⁻¹ f` for the planar density
`f = c e^{i(ξx+ηy)}`: `△⁻¹` multiplies by `-1/(ξ² + η²)` and `∇` by `(iξ, iη, 0)`. -/
def gradInvLap (ξ η : ℝ) (c : ℂ) : Fin 3 → ℂ :=
  ![Complex.I * ξ * (-c / ((ξ : ℂ) ^ 2 + (η : ℂ) ^ 2)),
    Complex.I * η * (-c / ((ξ : ℂ) ^ 2 + (η : ℂ) ^ 2)), 0]

/-- Eq. (40) with `k = 0`: the Laplace single layer `S_0` on the plane `z = 0` applied to a
function of frequency `(ξ, η)` on that plane, which multiplies it by `ĝ_0(ξ, η, 0)`. -/
def laplaceSingleLayerOnMode (ξ η : ℝ) (f : Space → ℂ) : Space → ℂ :=
  fun p => ghat 0 ξ η 0 * f p

/-- Eqs. (32)-(34), (45): the generalized Debye electric field
`E = √μ (ik S[j] - ∇ S[r] - ∇ × S[m])`, where `S c` is the layer potential of the mode with
coefficient `c`, and `j`, `m`, `r` are the coefficients of the currents and of the source `r`. -/
def debyeE (sqrtμ k : ℂ) (S : ℂ → Space → ℂ) (j m : Fin 3 → ℂ) (r : ℂ) :
    Space → Fin 3 → ℂ :=
  fun p => sqrtμ • ((Complex.I * k) • (fun i => S (j i) p) - grad (S r) p -
    curl (fun p' i => S (m i) p') p)

/-- Eqs. (32)-(34), (45): the generalized Debye magnetic field
`H = √ε (ik S[m] - ∇ S[q] + ∇ × S[j])`. -/
def debyeH (sqrtε k : ℂ) (S : ℂ → Space → ℂ) (j m : Fin 3 → ℂ) (q : ℂ) :
    Space → Fin 3 → ℂ :=
  fun p => sqrtε • ((Complex.I * k) • (fun i => S (m i) p) - grad (S q) p +
    curl (fun p' i => S (j i) p') p)

/-- Eq. (35) on a mode: `j = ik(∇△⁻¹ r - n × ∇△⁻¹ q)` for the perfect conductor. -/
def pecJ (k : ℂ) (ξ η : ℝ) (r q : ℂ) : Fin 3 → ℂ :=
  (Complex.I * k) • (gradInvLap ξ η r - nCross (gradInvLap ξ η q))

/-- Section V.A: the scattered electric field in `z ≥ 0` above the perfect conductor `z ≤ 0`
generated by the sources `r e^{i(ξx+ηy)}`, `q e^{i(ξx+ηy)}` (eqs. (32)-(35), `m = n × j`). -/
def pecE (ω : ℝ) (ε μ : ℂ) (ξ η : ℝ) (r q : ℂ) : Space → Fin 3 → ℂ :=
  debyeE (csqrt μ) (wavenumber ω ε μ) (slpUp (wavenumber ω ε μ) ξ η)
    (pecJ (wavenumber ω ε μ) ξ η r q) (nCross (pecJ (wavenumber ω ε μ) ξ η r q)) r

/-- Section V.A: the scattered magnetic field above the perfect conductor for the same sources. -/
def pecH (ω : ℝ) (ε μ : ℂ) (ξ η : ℝ) (r q : ℂ) : Space → Fin 3 → ℂ :=
  debyeH (csqrt ε) (wavenumber ω ε μ) (slpUp (wavenumber ω ε μ) ξ η)
    (pecJ (wavenumber ω ε μ) ξ η r q) (nCross (pecJ (wavenumber ω ε μ) ξ η r q)) q

/-- Eq. (48) on a mode: `j_0 = iω(√(μ₀ε₀) ∇△⁻¹ r_0 - ε₁ √(μ₁/ε₀) n × ∇△⁻¹ r_1)` (real material
constants `ε₀, μ₀` in `z > 0` and `ε₁, μ₁` in `z ≤ 0`). -/
def twoLayerJ0 (ω ε0 μ0 ε1 μ1 ξ η : ℝ) (r0 r1 : ℂ) : Fin 3 → ℂ :=
  (Complex.I * ω) • (((Real.sqrt (μ0 * ε0) : ℝ) : ℂ) • gradInvLap ξ η r0 -
    ((ε1 * Real.sqrt (μ1 / ε0) : ℝ) : ℂ) • nCross (gradInvLap ξ η r1))

/-- Eq. (48): `j_1 = n × √(ε₀/ε₁) j_0`. -/
def twoLayerJ1 (ω ε0 μ0 ε1 μ1 ξ η : ℝ) (r0 r1 : ℂ) : Fin 3 → ℂ :=
  nCross (((Real.sqrt (ε0 / ε1) : ℝ) : ℂ) • twoLayerJ0 ω ε0 μ0 ε1 μ1 ξ η r0 r1)

/-- Eq. (48): `m_0 = iω(√(μ₀ε₀) ∇△⁻¹ q_0 - μ₁ √(ε₁/μ₀) n × ∇△⁻¹ q_1)`. -/
def twoLayerM0 (ω ε0 μ0 ε1 μ1 ξ η : ℝ) (q0 q1 : ℂ) : Fin 3 → ℂ :=
  (Complex.I * ω) • (((Real.sqrt (μ0 * ε0) : ℝ) : ℂ) • gradInvLap ξ η q0 -
    ((μ1 * Real.sqrt (ε1 / μ0) : ℝ) : ℂ) • nCross (gradInvLap ξ η q1))

/-- Eq. (48): `m_1 = n × √(μ₀/μ₁) m_0`. -/
def twoLayerM1 (ω ε0 μ0 ε1 μ1 ξ η : ℝ) (q0 q1 : ℂ) : Fin 3 → ℂ :=
  nCross (((Real.sqrt (μ0 / μ1) : ℝ) : ℂ) • twoLayerM0 ω ε0 μ0 ε1 μ1 ξ η q0 q1)

/-- Eq. (45), layer 0 (`z ≥ 0`): `E_0 = √μ₀ (ik₀ S_{k₀}[j_0] - ∇ S_{k₀}[r_0] - ∇ × S_{k₀}[m_0])`,
`k₀ = ω √(ε₀μ₀)`, for the sources `r_j e^{i(ξx+ηy)}`, `q_j e^{i(ξx+ηy)}`. -/
def twoLayerE0 (ω ε0 μ0 ε1 μ1 ξ η : ℝ) (r0 r1 q0 q1 : ℂ) : Space → Fin 3 → ℂ :=
  debyeE (Real.sqrt μ0 : ℂ) (wavenumber ω ε0 μ0) (slpUp (wavenumber ω ε0 μ0) ξ η)
    (twoLayerJ0 ω ε0 μ0 ε1 μ1 ξ η r0 r1) (twoLayerM0 ω ε0 μ0 ε1 μ1 ξ η q0 q1) r0

/-- Eq. (45), layer 0: `H_0 = √ε₀ (ik₀ S_{k₀}[m_0] - ∇ S_{k₀}[q_0] + ∇ × S_{k₀}[j_0])`. -/
def twoLayerH0 (ω ε0 μ0 ε1 μ1 ξ η : ℝ) (r0 r1 q0 q1 : ℂ) : Space → Fin 3 → ℂ :=
  debyeH (Real.sqrt ε0 : ℂ) (wavenumber ω ε0 μ0) (slpUp (wavenumber ω ε0 μ0) ξ η)
    (twoLayerJ0 ω ε0 μ0 ε1 μ1 ξ η r0 r1) (twoLayerM0 ω ε0 μ0 ε1 μ1 ξ η q0 q1) q0

/-- Eq. (45), layer 1 (`z ≤ 0`): `E_1 = √μ₁ (ik₁ S_{k₁}[j_1] - ∇ S_{k₁}[r_1] - ∇ × S_{k₁}[m_1])`,
`k₁ = ω √(ε₁μ₁)`, with the kernel `e^{βz}` of eq. (47). -/
def twoLayerE1 (ω ε0 μ0 ε1 μ1 ξ η : ℝ) (r0 r1 q0 q1 : ℂ) : Space → Fin 3 → ℂ :=
  debyeE (Real.sqrt μ1 : ℂ) (wavenumber ω ε1 μ1) (slpDown (wavenumber ω ε1 μ1) ξ η)
    (twoLayerJ1 ω ε0 μ0 ε1 μ1 ξ η r0 r1) (twoLayerM1 ω ε0 μ0 ε1 μ1 ξ η q0 q1) r1

/-- Eq. (45), layer 1: `H_1 = √ε₁ (ik₁ S_{k₁}[m_1] - ∇ S_{k₁}[q_1] + ∇ × S_{k₁}[j_1])`. -/
def twoLayerH1 (ω ε0 μ0 ε1 μ1 ξ η : ℝ) (r0 r1 q0 q1 : ℂ) : Space → Fin 3 → ℂ :=
  debyeH (Real.sqrt ε1 : ℂ) (wavenumber ω ε1 μ1) (slpDown (wavenumber ω ε1 μ1) ξ η)
    (twoLayerJ1 ω ε0 μ0 ε1 μ1 ξ η r0 r1) (twoLayerM1 ω ε0 μ0 ε1 μ1 ξ η q0 q1) q1

/-- Eqs. (51), (53): the jumps `[f] = f_0 - f_1` (layer 0 minus layer 1) across `z = 0`, at the
point `p`, of the four interface quantities `S_0 ∇·E`, `n·εE`, `S_0 ∇·H`, `n·μH` of the scattered
field generated by the sources `s = (r_0, r_1, q_0, q_1)`, indexed as in eq. (53):
`inl 0, inl 1, inr 0, inr 1` for the rows and for `r_0, r_1, q_0, q_1`. -/
def twoLayerJumps (ω ε0 μ0 ε1 μ1 ξ η : ℝ) (s : Fin 2 ⊕ Fin 2 → ℂ) (p : Space) :
    Fin 2 ⊕ Fin 2 → ℂ :=
  Sum.elim
    ![laplaceSingleLayerOnMode ξ η (tangentialDivergence
          (twoLayerE0 ω ε0 μ0 ε1 μ1 ξ η (s (.inl 0)) (s (.inl 1)) (s (.inr 0)) (s (.inr 1)))) p -
        laplaceSingleLayerOnMode ξ η (tangentialDivergence
          (twoLayerE1 ω ε0 μ0 ε1 μ1 ξ η (s (.inl 0)) (s (.inl 1)) (s (.inr 0)) (s (.inr 1)))) p,
      (ε0 : ℂ) * twoLayerE0 ω ε0 μ0 ε1 μ1 ξ η (s (.inl 0)) (s (.inl 1)) (s (.inr 0)) (s (.inr 1)) p 2 -
        (ε1 : ℂ) * twoLayerE1 ω ε0 μ0 ε1 μ1 ξ η (s (.inl 0)) (s (.inl 1)) (s (.inr 0)) (s (.inr 1)) p 2]
    ![laplaceSingleLayerOnMode ξ η (tangentialDivergence
          (twoLayerH0 ω ε0 μ0 ε1 μ1 ξ η (s (.inl 0)) (s (.inl 1)) (s (.inr 0)) (s (.inr 1)))) p -
        laplaceSingleLayerOnMode ξ η (tangentialDivergence
          (twoLayerH1 ω ε0 μ0 ε1 μ1 ξ η (s (.inl 0)) (s (.inl 1)) (s (.inr 0)) (s (.inr 1)))) p,
      (μ0 : ℂ) * twoLayerH0 ω ε0 μ0 ε1 μ1 ξ η (s (.inl 0)) (s (.inl 1)) (s (.inr 0)) (s (.inr 1)) p 2 -
        (μ1 : ℂ) * twoLayerH1 ω ε0 μ0 ε1 μ1 ξ η (s (.inl 0)) (s (.inl 1)) (s (.inr 0)) (s (.inr 1)) p 2]

/-- Eq. (53): the matrix of the linear system for `(r̂_0, r̂_1, q̂_0, q̂_1)` at the mode `(ξ, η)`.
Its column for a source is the vector of Fourier coefficients of the four jumps generated by that
source with unit amplitude; the coefficient is the value at the origin, where
`e^{i(ξx+ηy)} = 1`. -/
def twoLayerSystem (ω ε0 μ0 ε1 μ1 ξ η : ℝ) : Matrix (Fin 2 ⊕ Fin 2) (Fin 2 ⊕ Fin 2) ℂ :=
  fun i j => twoLayerJumps ω ε0 μ0 ε1 μ1 ξ η (Pi.single j 1) (pt 0 0 0) i

end Arxiv1310_4241
Source
M. O'Neil, A generalized Debye source approach to electromagnetic scattering in layered media, arXiv:1310.4241v1 (2013), Sections I-II (eqs. (1)-(10)), Section IV (eqs. (22)-(24)), Section V (eqs. (32)-(41), (45)-(53)), https://arxiv.org/abs/1310.4241
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Read-back of twoLayerSystem. This is a definition, not a theorem. It asserts nothing; it constructs an object. It has seven real parameters and no hypotheses:

  • the frequency ω\omegaω;
  • the material constants ε0,μ0,ε1,μ1\varepsilon_0, \mu_0, \varepsilon_1, \mu_1ε0​,μ0​,ε1​,μ1​;
  • the spatial frequencies ξ,η\xi, \etaξ,η.

Each parameter may be any real number: zero, negative, or such that ξ=η=0\xi=\eta=0ξ=η=0. From these it builds a 4×44\times 44×4 complex matrix A(ω,ε0,μ0,ε1,μ1,ξ,η)A(\omega,\varepsilon_0,\mu_0,\varepsilon_1,\mu_1,\xi,\eta)A(ω,ε0​,μ0​,ε1​,μ1​,ξ,η). Rows and columns are both indexed, in order, by four labels r0,r1,q0,q1r_0, r_1, q_0, q_1r0​,r1​,q0​,q1​.

Columns. The column labelled jjj is obtained in two steps:

  1. Set the source vector s=(sr0,sr1,sq0,sq1)s=(s_{r_0},s_{r_1},s_{q_0},s_{q_1})s=(sr0​​,sr1​​,sq0​​,sq1​​) to the jjj-th standard basis vector: entry 111 at jjj, 000 elsewhere.
  2. Evaluate four "jump" quantities at the origin (0,0,0)(0,0,0)(0,0,0).

No Fourier transform is taken. The entry is simply the value of each quantity at the origin, where ei(ξx+ηy)=1e^{i(\xi x+\eta y)}=1ei(ξx+ηy)=1.

The four rows. For a source vector sss, the fields E0,H0E_0,H_0E0​,H0​ ("layer 0") and E1,H1E_1,H_1E1​,H1​ ("layer 1") are defined below. Write ∂x,∂y\partial_x,\partial_y∂x​,∂y​ for the partial derivatives along the first two coordinates of R3\mathbb R^3R3. These are Fréchet derivatives; a derivative at a point of non-differentiability is taken to be 000. The four rows, all evaluated at p=0p=0p=0, are:

row r0:  c0[(∂xE0,x+∂yE0,y)−(∂xE1,x+∂yE1,y)],row r1:  ε0 E0,z−ε1 E1,z,row q0:  c0[(∂xH0,x+∂yH0,y)−(∂xH1,x+∂yH1,y)],row q1:  μ0 H0,z−μ1 H1,z.\begin{aligned} \text{row } r_0 &: \; c_0\big[(\partial_x E_{0,x}+\partial_y E_{0,y}) - (\partial_x E_{1,x}+\partial_y E_{1,y})\big],\\ \text{row } r_1 &: \; \varepsilon_0\,E_{0,z} - \varepsilon_1\,E_{1,z},\\ \text{row } q_0 &: \; c_0\big[(\partial_x H_{0,x}+\partial_y H_{0,y}) - (\partial_x H_{1,x}+\partial_y H_{1,y})\big],\\ \text{row } q_1 &: \; \mu_0\,H_{0,z} - \mu_1\,H_{1,z}. \end{aligned}row r0​row r1​row q0​row q1​​:c0​[(∂x​E0,x​+∂y​E0,y​)−(∂x​E1,x​+∂y​E1,y​)],:ε0​E0,z​−ε1​E1,z​,:c0​[(∂x​H0,x​+∂y​H0,y​)−(∂x​H1,x​+∂y​H1,y​)],:μ0​H0,z​−μ1​H1,z​.​

The factor c0c_0c0​ is

c0=18π2β(0),β(0)=ξ2+η2  (the nonnegative real root).c_0=\frac{1}{8\pi^2\beta_{(0)}},\qquad \beta_{(0)}=\sqrt{\xi^2+\eta^2}\ \ (\text{the nonnegative real root}).c0​=8π2β(0)​1​,β(0)​=ξ2+η2​  (the nonnegative real root).

Division by zero yields 000. Hence when ξ=η=0\xi=\eta=0ξ=η=0 we have c0=0c_0=0c0​=0, and rows r0r_0r0​ and q0q_0q0​ vanish identically.

Wavenumbers and Sommerfeld roots. All square roots of complex numbers below are principal roots, written z1/2z^{1/2}z1/2. The wavenumbers are

k0=ω (ε0μ0)1/2,k1=ω (ε1μ1)1/2.k_0=\omega\,(\varepsilon_0\mu_0)^{1/2},\qquad k_1=\omega\,(\varepsilon_1\mu_1)^{1/2}.k0​=ω(ε0​μ0​)1/2,k1​=ω(ε1​μ1​)1/2.

Each is complex in general. It is purely imaginary times ω\omegaω if the product εℓμℓ\varepsilon_\ell\mu_\ellεℓ​μℓ​ is negative, and it is 000 if that product is 000.

For ℓ=0,1\ell=0,1ℓ=0,1 let wℓ=ξ2+η2−kℓ2w_\ell=\xi^2+\eta^2-k_\ell^2wℓ​=ξ2+η2−kℓ2​. The root βℓ\beta_\ellβℓ​ is defined case by case:

  • If wℓw_\ellwℓ​ is a negative real number, then βℓ=−i−wℓ\beta_\ell=-i\sqrt{-w_\ell}βℓ​=−i−wℓ​​.
  • Otherwise, βℓ=wℓ1/2\beta_\ell=w_\ell^{1/2}βℓ​=wℓ1/2​.

Basis functions. These are

φ0(x,y,z)=e−β0z ei(ξx+ηy)8π2β0,φ1(x,y,z)=eβ1z ei(ξx+ηy)8π2β1.\varphi_0(x,y,z)=\frac{e^{-\beta_0 z}\,e^{i(\xi x+\eta y)}}{8\pi^2\beta_0},\qquad \varphi_1(x,y,z)=\frac{e^{\beta_1 z}\,e^{i(\xi x+\eta y)}}{8\pi^2\beta_1}.φ0​(x,y,z)=8π2β0​e−β0​zei(ξx+ηy)​,φ1​(x,y,z)=8π2β1​eβ1​zei(ξx+ηy)​.

Both are defined for all z∈Rz\in\mathbb Rz∈R, not only on one side of the plane, and each is identically 000 if its βℓ=0\beta_\ell=0βℓ​=0.

Auxiliary vectors. For a scalar ccc, define

G(c)=(−iξ cξ2+η2, −iη cξ2+η2, 0).G(c)=\left(\frac{-i\xi\,c}{\xi^2+\eta^2},\ \frac{-i\eta\,c}{\xi^2+\eta^2},\ 0\right).G(c)=(ξ2+η2−iξc​, ξ2+η2−iηc​, 0).

This is the zero vector when ξ=η=0\xi=\eta=0ξ=η=0. Also define n×v=(−vy, vx, 0)n\times v=(-v_y,\,v_x,\,0)n×v=(−vy​,vx​,0).

In what follows, ⋅\sqrt{\cdot}⋅​ of a real number is the real square root, set to 000 for negative arguments. Real quotients with zero denominator are 000. The current vectors are:

J0=iω(μ0ε0 G(sr0)−ε1μ1/ε0  n×G(sr1)),J1=n×(ε0/ε1 J0),M0=iω(μ0ε0 G(sq0)−μ1ε1/μ0  n×G(sq1)),M1=n×(μ0/μ1 M0).\begin{aligned} J_0&=i\omega\Big(\sqrt{\mu_0\varepsilon_0}\,G(s_{r_0})-\varepsilon_1\sqrt{\mu_1/\varepsilon_0}\;n\times G(s_{r_1})\Big), & J_1&=n\times\big(\sqrt{\varepsilon_0/\varepsilon_1}\,J_0\big),\\ M_0&=i\omega\Big(\sqrt{\mu_0\varepsilon_0}\,G(s_{q_0})-\mu_1\sqrt{\varepsilon_1/\mu_0}\;n\times G(s_{q_1})\Big), & M_1&=n\times\big(\sqrt{\mu_0/\mu_1}\,M_0\big). \end{aligned}J0​M0​​=iω(μ0​ε0​​G(sr0​​)−ε1​μ1​/ε0​​n×G(sr1​​)),=iω(μ0​ε0​​G(sq0​​)−μ1​ε1​/μ0​​n×G(sq1​​)),​J1​M1​​=n×(ε0​/ε1​​J0​),=n×(μ0​/μ1​​M0​).​

Fields. Here ∇\nabla∇ is the gradient, ∇×\nabla\times∇× is the curl, and a constant vector times φℓ\varphi_\ellφℓ​ is a vector field. With real square roots as above:

E0=μ0 (ik0 J0φ0−∇(sr0φ0)−∇×(M0φ0)),H0=ε0 (ik0 M0φ0−∇(sq0φ0)+∇×(J0φ0)),E1=μ1 (ik1 J1φ1−∇(sr1φ1)−∇×(M1φ1)),H1=ε1 (ik1 M1φ1−∇(sq1φ1)+∇×(J1φ1)).\begin{aligned} E_0&=\sqrt{\mu_0}\,\big(ik_0\,J_0\varphi_0-\nabla(s_{r_0}\varphi_0)-\nabla\times(M_0\varphi_0)\big), & H_0&=\sqrt{\varepsilon_0}\,\big(ik_0\,M_0\varphi_0-\nabla(s_{q_0}\varphi_0)+\nabla\times(J_0\varphi_0)\big),\\ E_1&=\sqrt{\mu_1}\,\big(ik_1\,J_1\varphi_1-\nabla(s_{r_1}\varphi_1)-\nabla\times(M_1\varphi_1)\big), & H_1&=\sqrt{\varepsilon_1}\,\big(ik_1\,M_1\varphi_1-\nabla(s_{q_1}\varphi_1)+\nabla\times(J_1\varphi_1)\big). \end{aligned}E0​E1​​=μ0​​(ik0​J0​φ0​−∇(sr0​​φ0​)−∇×(M0​φ0​)),=μ1​​(ik1​J1​φ1​−∇(sr1​​φ1​)−∇×(M1​φ1​)),​H0​H1​​=ε0​​(ik0​M0​φ0​−∇(sq0​​φ0​)+∇×(J0​φ0​)),=ε1​​(ik1​M1​φ1​−∇(sq1​​φ1​)+∇×(J1​φ1​)).​

Scope. Each layer's field is evaluated directly at the origin from its own exponential formula. No limits, no restriction to a half-space, no Maxwell or Helmholtz equation, and no condition on the signs of ω\omegaω, εℓ\varepsilon_\ellεℓ​ or μℓ\mu_\ellμℓ​ is imposed anywhere in the definition.

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

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 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