Windows, Sommerfeld densities, Helmholtz Green's function and layer potentials of the hybrid representation
DefinitionArxiv1507_03491_BasicObjects of Sections 1–3 and 5 of Lai, Greengard and O'Neil (2015). Points of the plane are ; the interface is the line with unit normal , and is the window segment. The Helmholtz parameter satisfies , .
- Windows (eqs. 2.8–2.11). for and otherwise; ; ; the bump window is . With , the window used in practice is .
- Fourier transform and decay. . A function decays superalgebraically if for every there are with for ; a family , , does so independently of if can be chosen the same for all .
- Square root and source spectrum (eq. 2.3). (principal power): it is positive for real , equals for real , and has nonnegative real part. The spectrum of a source at is .
- Dirichlet Sommerfeld density (eq. 2.13). with .
- Green's function (eq. 2.1). , (principal logarithm, harmonic numbers , Euler's constant ), and .
- Potentials and fields. The double-layer kernel is at , the derivative in . The Dirichlet scattered field (eq. 2.4) is with . The single-layer potential (eq. 3.7) is . For a source at , the impedance data (eq. 3.4) is on .
Formalization Note Mathlib has no Bessel or Hankel functions, so is defined by its power series (DLMF 10.2.2, 10.8.2). The distribution in (2.13) is read as , and the convolution as , the normalization for which . All integrals are Lebesgue integrals; each one used in a statement converges absolutely.
import Mathlib
/-!
Lai, Greengard and O'Neil, *A new hybrid integral representation for frequency domain scattering
in layered media*, arXiv:1507.03491v2 (2015): the window functions, Fourier transform, free-space
Helmholtz Green's function, Sommerfeld spectral density, layer potentials on the window segment
`Γ₀ = (-M₀, M₀)` and the decay notion of Sections 2, 3 and 5.
Points of the plane are written by their coordinates `(x, y)`; the interface `Γ` is the line
`y = 0` with unit normal `n = (0, 1)` (Section 1).
-/
noncomputable section
namespace Arxiv1507_03491
/-- Section 2, display before eq. (2.9): the standard bump function
`Ψ(x) = exp(-1 / (1 - x²))` for `|x| < 1` and `Ψ(x) = 0` otherwise. -/
def bumpPsi (x : ℝ) : ℝ :=
if |x| < 1 then Real.exp (-1 / (1 - x ^ 2)) else 0
/-- Section 2, before eq. (2.9): the normalising constant `A = ∫₀¹ Ψ(t) dt`. -/
def bumpA : ℝ := ∫ t in (0 : ℝ)..1, bumpPsi t
/-- Section 2, before eq. (2.9): `Φ(x) = (1/A) ∫₀ˣ Ψ(t) dt`. -/
def bumpPhi (x : ℝ) : ℝ := (1 / bumpA) * ∫ t in (0 : ℝ)..x, bumpPsi t
/-- Eq. (2.9): the window function `W_{M₀}(x) = (Φ(x + M₀/2) - Φ(x - M₀/2)) / 2`. -/
def window (M0 x : ℝ) : ℝ := (1 / 2) * (bumpPhi (x + M0 / 2) - bumpPhi (x - M0 / 2))
/-- Eq. (2.11) (Remark 2): the error function `erf(x) = (2/√π) ∫₀ˣ e^{-t²} dt`. -/
def erf (x : ℝ) : ℝ := 2 / Real.sqrt Real.pi * ∫ t in (0 : ℝ)..x, Real.exp (-t ^ 2)
/-- Eq. (2.10) (Remark 2): the window used in practice,
`W̃_{M₀}(x) = (erf(x + M₀/2) - erf(x - M₀/2)) / 2`. -/
def erfWindow (M0 x : ℝ) : ℝ := (1 / 2) * (erf (x + M0 / 2) - erf (x - M0 / 2))
/-- Section 2, display after eq. (2.13): the Fourier transform
`f̂(λ) = ∫_{-∞}^{∞} f(x) e^{-iλx} dx` (a Lebesgue integral). -/
def fourierT (f : ℝ → ℂ) (lam : ℝ) : ℂ :=
∫ x : ℝ, f x * Complex.exp (-(Complex.I * (lam : ℂ) * (x : ℂ)))
/-- Lemma 2.1, Theorems 2.2, 6.1, 6.2: `F` decays superalgebraically, i.e. faster than every
inverse power of `|λ|` as `|λ| → ∞`: for every `n` there are `C, R` with `|λ|ⁿ ‖F(λ)‖ ≤ C`
whenever `|λ| ≥ R`. -/
def SuperalgDecay (F : ℝ → ℂ) : Prop :=
∀ n : ℕ, ∃ C R : ℝ, ∀ lam : ℝ, R ≤ |lam| → |lam| ^ n * ‖F lam‖ ≤ C
/-- Theorems 2.2, 6.1, 6.2: the family `F h` decays superalgebraically independently of the
parameter `h ∈ s`: the constants `C, R` are the same for every `h ∈ s`. -/
def SuperalgDecayUniform (F : ℝ → ℝ → ℂ) (s : Set ℝ) : Prop :=
∀ n : ℕ, ∃ C R : ℝ, ∀ h ∈ s, ∀ lam : ℝ, R ≤ |lam| → |lam| ^ n * ‖F h lam‖ ≤ C
/-- Eq. (2.3): the branch of `√(λ² - k²)` in the Sommerfeld integral, for `Re k > 0`,
`Im k ≥ 0` and real `λ`: `√(λ² - k²) = -i (k² - λ²)^{1/2}` with the principal power. It is
positive for real `|λ| > k`, equals `-i√(k² - λ²)` for real `|λ| < k`, and has nonnegative real
part. -/
def sqrtLK (k : ℂ) (lam : ℝ) : ℂ :=
-Complex.I * (k ^ 2 - (lam : ℂ) ^ 2) ^ (1 / 2 : ℂ)
/-- Section 2, text before Figure 2 and eq. (2.13): the spectral function
`e^{-√(λ²-k²) y₀} e^{-iλx₀} / √(λ²-k²)` of a source at `(x₀, y₀)`. -/
def sourceSpectrum (k : ℂ) (x0 y0 lam : ℝ) : ℂ :=
Complex.exp (-(sqrtLK k lam) * (y0 : ℂ)) / sqrtLK k lam *
Complex.exp (-(Complex.I * (lam : ℂ) * (x0 : ℂ)))
/-- Eq. (2.13): the Sommerfeld density of the Dirichlet problem,
`ξ̂_W(λ) = -2 [(1 - W)^ ∗ F](λ)` with `F = sourceSpectrum`, where `(1 - W)^ = 2πδ - Ŵ` and the
convolution is `(a ∗ b)(λ) = (1/2π) ∫ a(λ - μ) b(μ) dμ`; thus
`ξ̂_W(λ) = -2 (F(λ) - (1/2π) ∫ Ŵ(λ - μ) F(μ) dμ)`, with `W = W_{M₀}` of eq. (2.9). -/
def dirSommerfeldDensity (M0 : ℝ) (k : ℂ) (x0 y0 lam : ℝ) : ℂ :=
-2 * (sourceSpectrum k x0 y0 lam -
(1 / (2 * (Real.pi : ℂ))) *
∫ mu : ℝ, fourierT (fun x => (window M0 x : ℂ)) (lam - mu) * sourceSpectrum k x0 y0 mu)
/-- Eq. (2.1): the Bessel function `J₀(z) = ∑_{m ≥ 0} (-1)^m (z/2)^{2m} / (m!)²`
(DLMF 10.2.2). -/
def besselJ0 (z : ℂ) : ℂ :=
∑' m : ℕ, (-1 : ℂ) ^ m * (z / 2) ^ (2 * m) / ((m.factorial : ℂ) ^ 2)
/-- Eq. (2.1): the Bessel function of the second kind
`Y₀(z) = (2/π)(log(z/2) + γ) J₀(z) + (2/π) ∑_{m ≥ 1} (-1)^{m+1} H_m (z/2)^{2m} / (m!)²`,
with `H_m` the harmonic numbers, `γ` Euler's constant and the principal logarithm
(DLMF 10.8.2). -/
def besselY0 (z : ℂ) : ℂ :=
(2 / (Real.pi : ℂ)) * ((Complex.log (z / 2) + (Real.eulerMascheroniConstant : ℂ)) * besselJ0 z) +
(2 / (Real.pi : ℂ)) *
∑' m : ℕ, (-1 : ℂ) ^ (m + 1) * (harmonic m : ℂ) * (z / 2) ^ (2 * m) / ((m.factorial : ℂ) ^ 2)
/-- Eq. (2.1): the Hankel function of the first kind and order zero, `H₀^{(1)} = J₀ + i Y₀`. -/
def hankel0 (z : ℂ) : ℂ := besselJ0 z + Complex.I * besselY0 z
/-- Eq. (2.1): the free-space Green's function `G_k(x, x') = (i/4) H₀^{(1)}(k |x - x'|)` for
`x = (x, y)` and `x' = (x', y')`. -/
def greenK (k : ℂ) (x y x' y' : ℝ) : ℂ :=
Complex.I / 4 * hankel0 (k * (Real.sqrt ((x - x') ^ 2 + (y - y') ^ 2) : ℂ))
/-- Eqs. (2.6) and (2.12): the double-layer kernel `∂G_k(x, x')/∂n'` at a point `x' = (x', 0)`
of `Γ`, the derivative taken in the second variable along `n' = (0, 1)`. -/
def dlKernel (k : ℂ) (x y x' : ℝ) : ℂ :=
deriv (fun t : ℝ => greenK k x y x' t) 0
/-- Eq. (2.4): the scattered field of the sound-soft (Dirichlet) half-space for a source at
`x₀ = (x₀, y₀)`, `y₀ > 0`: `u^s(x) = -(i/4) H₀^{(1)}(k |x - x₀^R|)` with `x₀^R = (x₀, -y₀)`. -/
def dirScattered (k : ℂ) (x0 y0 x y : ℝ) : ℂ := -greenK k x y x0 (-y0)
/-- Eq. (3.7): the single-layer potential on `Γ₀ = (-M₀, M₀)`,
`S_{Γ₀}[σ](x) = ∫_{-M₀}^{M₀} G_k(x, (x', 0)) σ(x') dx'`, at the point `x = (x, y)`. -/
def singleLayer (k : ℂ) (M0 : ℝ) (sigma : ℝ → ℂ) (x y : ℝ) : ℂ :=
∫ x' in Set.Ioo (-M0) M0, greenK k x y x' 0 * sigma x'
/-- Eq. (3.4): the right-hand side `g = -∂G_k/∂n - ikα G_k` on `Γ` of the impedance problem
(3.3) for a source at `(0, h)`, evaluated at `(x, 0)`; `∂/∂n` is `∂/∂y` in the target
variable. -/
def impedanceRHS (k alpha : ℂ) (h x : ℝ) : ℂ :=
-deriv (fun t : ℝ => greenK k x t 0 h) 0 - Complex.I * k * alpha * greenK k x 0 0 h
end Arxiv1507_03491
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Preliminary conventions. Points of the plane are given by real coordinates. Several definitions rely on these conventions:
- Division by zero returns .
- An integral of a non-integrable function is assigned the value .
- An infinite sum of a non-summable series is assigned the value .
- The derivative of a function at a point where it is not differentiable is assigned the value .
- is the principal complex logarithm (imaginary part in ), with .
- for , and for .
bumpPsi (). For a real number ,
bumpA (). The real number
bumpPhi (). For real ,
where the integral is oriented, so for it equals . If were , the factor would be . Because is even and vanishes outside :
- for ;
- for ;
- .
window (). For real parameters (any sign, including ) and ,
erf. For real ,
with an oriented integral.
erfWindow (). For real and ,
fourierT (). For any function (no integrability assumed) and real ,
a Lebesgue integral over the whole line. If is not Lebesgue integrable, then .
SuperalgDecay. A function has this property when the following holds. For every natural number (including ) there exist real numbers and such that
Both and may depend on . is not required to be positive; if , the bound must hold for all real .
SuperalgDecayUniform. A two-parameter function , written , has this property on a set when the following holds. For every natural there exist real and , depending only on , such that
If is empty, the property holds vacuously.
sqrtLK (). For any complex and real ,
where is the principal complex power . In particular, when . The definition places no restriction on : no condition on or is imposed.
sourceSpectrum (). For complex and real ,
At any with the quotient is , so . No sign condition on is imposed.
dirSommerfeldDensity (). For real , complex , and real ,
Here is the Fourier transform (as in fourierT) of the window , viewed as a complex-valued function. The -integral is a Lebesgue integral over ; if its integrand is not integrable, it is taken to be .
besselJ0 (). For complex ,
where the term equals , including at . If the series were not summable, the value would be .
besselY0 (). For complex ,
The symbols are:
- is the Euler–Mascheroni constant;
- is the -th harmonic number, with , so the term vanishes;
- is the principal logarithm.
At the convention gives .
hankel0 (). For complex ,
greenK (). For complex and points , of the plane,
At coincident points the argument is , giving the value .
dlKernel. For complex , a point , and real , the value is
This is the ordinary derivative, with respect to the real variable , of the second point's vertical coordinate, evaluated at . If the function is not differentiable at , the value is .
dirScattered (). For complex and real ,
No condition such as is imposed.
singleLayer (). For complex , real , any function , and a point ,
This is a Lebesgue integral over the open interval. Two degenerate cases apply:
- If , the interval is empty and the value is .
- If the integrand is not integrable, the value is .
impedanceRHS (). For complex and , and real and ,
The derivative is taken in the vertical coordinate of the first (target) point, with the value if that function is not differentiable at . No conditions on , , or are imposed.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.