Helmholtz boundary-value problem and residual scattering problem on a rectangle
DefinitionArxiv2602_11197_BasicObjects of Section 3 and Section 3.2 of Balaji, Teolis, Mis, Lara Benitez, Wang and de Hoop (2026).
- Domain. For side lengths , , with horizontal and the depth. The free surface is the top edge , end points included. The absorbing boundary consists of the left, right and bottom edges without their end points. On these edges the outward unit normal is , and respectively.
- Normal derivative. is the derivative of within the closed rectangle at , in the direction .
- Helmholtz problem, eq. (1). For an angular frequency , a wavespeed and a source , a complex field solves eq. (1) if three conditions hold:
- in , at almost every , where is twice continuously differentiable near each such ;
- on , where is differentiable within ;
- on .
- Contrast. .
- Residual problem, eq. (2), as printed. solves eq. (2) for if three conditions hold:
- in , in the same almost-everywhere sense as above;
- on ;
- on .
- Residual problem with the derived absorbing condition. This is the same as item 5, except that on the condition is
This is the condition that subtracting eq. (1) for from eq. (1) for produces.
Formalization Note The printed absorbing line of eq. (1) reads "" with neither nor "". It is read as , the form used in eq. (2).
The paper does not say in what sense eq. (1) holds. For the paper's piecewise-constant wavespeeds, cannot be twice differentiable across a salt interface. For this reason the interior equation is required at almost every point of , with of class near each such point, rather than at every point.
Functions are defined on all of . Only their values on enter the boundary conditions, and only their values near points of enter the interior equation.
The paper does not say which end points of the edges belong to or . The corners are assigned as stated in item 1.
import Mathlib
/-!
Balaji, Teolis, Mis, Lara Benitez, Wang and de Hoop, *Hybrid operator learning of wave scattering
maps in high-contrast media*, arXiv:2602.11197v1 (2026): the rectangular domain and its boundary parts,
the Helmholtz boundary-value problem, eq. (1) of Section 3, and the residual (scattering) problem,
eq. (2) of Section 3.2.
-/
open MeasureTheory
noncomputable section
namespace Arxiv2602_11197
/-- The plane `ℝ²` with its Euclidean structure (Section 3: `Ω ⊂ ℝ²`). -/
abbrev Plane := EuclideanSpace ℝ (Fin 2)
/-- Section 3: the rectangular domain `Ω = (0, L₁) × (0, L₂)`. Coordinate `0` is horizontal and
coordinate `1` is depth, so the edge `x 1 = 0` is the top of the domain. -/
def domain (L₁ L₂ : ℝ) : Set Plane :=
{x | 0 < x 0 ∧ x 0 < L₁ ∧ 0 < x 1 ∧ x 1 < L₂}
/-- Section 3: the closed rectangle `[0, L₁] × [0, L₂]`, the closure of `Ω`. -/
def closedDomain (L₁ L₂ : ℝ) : Set Plane :=
{x | 0 ≤ x 0 ∧ x 0 ≤ L₁ ∧ 0 ≤ x 1 ∧ x 1 ≤ L₂}
/-- Section 3: the free-surface edge `Γ_Free`, the top edge `{x 1 = 0}` of the rectangle
(the point source of Appendix C sits at its centre), including its two end points. -/
def freeBoundary (L₁ : ℝ) : Set Plane :=
{x | 0 ≤ x 0 ∧ x 0 ≤ L₁ ∧ x 1 = 0}
/-- Section 3: the absorbing boundary `Γ_ABC`, consisting of the other three edges of the rectangle
(left, right and bottom), each without its end points, where the outward normal is defined. -/
def absorbingBoundary (L₁ L₂ : ℝ) : Set Plane :=
{x | x 0 = 0 ∧ 0 < x 1 ∧ x 1 < L₂} ∪ {x | x 0 = L₁ ∧ 0 < x 1 ∧ x 1 < L₂} ∪
{x | 0 < x 0 ∧ x 0 < L₁ ∧ x 1 = L₂}
open Classical in
/-- Section 3: the outward unit normal `ν` on `Γ_ABC`: `(-1, 0)` on the left edge, `(1, 0)` on the
right edge and `(0, 1)` on the bottom edge. -/
def outwardNormal (L₁ : ℝ) (x : Plane) : Plane :=
if x 0 = 0 then EuclideanSpace.single 0 (-1)
else if x 0 = L₁ then EuclideanSpace.single 0 1
else EuclideanSpace.single 1 1
/-- Section 3, eq. (1): the normal derivative `∂_ν u(x)` on `Γ_ABC`, the derivative of `u` within
the closed rectangle in the direction of the outward normal. -/
def normalDeriv (L₁ L₂ : ℝ) (u : Plane → ℂ) (x : Plane) : ℂ :=
fderivWithin ℝ u (closedDomain L₁ L₂) x (outwardNormal L₁ x)
/-- Section 3, eq. (1): the Helmholtz operator `[Δ + ω² / c(x)²] u(x)` for a wavespeed `c`. -/
def helmholtzOp (ω : ℝ) (c : Plane → ℝ) (u : Plane → ℂ) (x : Plane) : ℂ :=
Laplacian.laplacian u x + ((ω ^ 2 / c x ^ 2 : ℝ) : ℂ) * u x
/-- Section 3, eq. (1): `p` solves the Helmholtz problem with wavespeed `c`, source `s` and angular
frequency `ω`: `[Δ + ω²/c²] p = -s` in `Ω` (at almost every point of `Ω`, at which `p` is twice
continuously differentiable), `∂_ν p - (iω/c) p = 0` on `Γ_ABC`, and `p = 0` on `Γ_Free`.
The absorbing condition is read with `p` and `= 0`, as in eq. (2); the printed line of eq. (1)
omits both. -/
def IsHelmholtzSolution (L₁ L₂ ω : ℝ) (c : Plane → ℝ) (s p : Plane → ℂ) : Prop :=
(∀ᵐ x ∂(volume.restrict (domain L₁ L₂)),
ContDiffAt ℝ 2 p x ∧ helmholtzOp ω c p x = -s x) ∧
(∀ x ∈ absorbingBoundary L₁ L₂, DifferentiableWithinAt ℝ p (closedDomain L₁ L₂) x ∧
normalDeriv L₁ L₂ p x - Complex.I * (ω : ℂ) / (c x : ℂ) * p x = 0) ∧
(∀ x ∈ freeBoundary L₁, p x = 0)
/-- Section 3.2: the squared-slowness contrast `δm(x) = v(x)⁻² - v_bg(x)⁻²`. -/
def deltaM (v vbg : Plane → ℝ) (x : Plane) : ℝ :=
(v x ^ 2)⁻¹ - (vbg x ^ 2)⁻¹
/-- Section 3.2, eq. (2), as printed: `δp` solves the residual problem
`[Δ + ω²/v_bg²] δp = -ω² δm (δp + p_bg)` in `Ω` (at almost every point of `Ω`, at which `δp` is
twice continuously differentiable), `∂_ν δp - (iω/v) δp = 0` on `Γ_ABC`, and `δp = 0` on
`Γ_Free`. -/
def IsResidualSolution (L₁ L₂ ω : ℝ) (v vbg : Plane → ℝ) (pbg dp : Plane → ℂ) : Prop :=
(∀ᵐ x ∂(volume.restrict (domain L₁ L₂)),
ContDiffAt ℝ 2 dp x ∧
helmholtzOp ω vbg dp x = -((ω ^ 2 * deltaM v vbg x : ℝ) : ℂ) * (dp x + pbg x)) ∧
(∀ x ∈ absorbingBoundary L₁ L₂, DifferentiableWithinAt ℝ dp (closedDomain L₁ L₂) x ∧
normalDeriv L₁ L₂ dp x - Complex.I * (ω : ℂ) / (v x : ℂ) * dp x = 0) ∧
(∀ x ∈ freeBoundary L₁, dp x = 0)
/-- Section 3.2, eq. (2), with the absorbing condition that subtracting eq. (1) for `v_bg` from
eq. (1) for `v` produces: the interior equation and the free-surface condition of eq. (2), and
`∂_ν δp - (iω/v) δp = iω (1/v - 1/v_bg) p_bg` on `Γ_ABC` in place of the printed `= 0`. -/
def IsResidualSolutionDerived (L₁ L₂ ω : ℝ) (v vbg : Plane → ℝ) (pbg dp : Plane → ℂ) : Prop :=
(∀ᵐ x ∂(volume.restrict (domain L₁ L₂)),
ContDiffAt ℝ 2 dp x ∧
helmholtzOp ω vbg dp x = -((ω ^ 2 * deltaM v vbg x : ℝ) : ℂ) * (dp x + pbg x)) ∧
(∀ x ∈ absorbingBoundary L₁ L₂, DifferentiableWithinAt ℝ dp (closedDomain L₁ L₂) x ∧
normalDeriv L₁ L₂ dp x - Complex.I * (ω : ℂ) / (v x : ℂ) * dp x =
Complex.I * (ω : ℂ) * (((v x)⁻¹ - (vbg x)⁻¹ : ℝ) : ℂ) * pbg x) ∧
(∀ x ∈ freeBoundary L₁, dp x = 0)
end Arxiv2602_11197
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Plane. This is the Euclidean plane , with points written , the usual Euclidean norm and inner product, and Lebesgue measure as its volume measure. Coordinate is called horizontal and is called depth.
domain . For arbitrary real numbers (no sign assumption), this is the open rectangle
It is empty whenever or .
closedDomain . For arbitrary real , this is the closed rectangle
Its shape depends on the signs of :
- it is empty if or ;
- it is a segment or a single point if or ;
- it equals the closure of only when .
freeBoundary . For a real number , this is the closed segment
that is, the edge of the rectangle, including both end points and . It does not depend on . It is empty if and is the single point if .
absorbingBoundary . For real , this is the union of three open segments:
These are the left edge, the right edge and the edge , each without end points. None of the four corners belongs to . In particular, the corners and lie in neither nor .
Degenerate cases:
- if , the left and right edges are empty;
- if , the edge is empty;
- if , the left and right edges coincide.
outwardNormal . This vector is defined at every point , not only on the boundary:
It does not depend on , and it equals at every point not on the lines or , including interior points. If , the second case never occurs, so every point with receives .
normalDeriv . For a function and a point , this is the real Fréchet derivative of at relative to the set (a one-sided derivative within the closed rectangle), applied to the vector :
Three conventions govern this value:
- If is not differentiable at within , the derivative is taken to be .
- If is not an accumulation point of , the derivative is taken to be .
- When the closed rectangle is degenerate ( or ), the within-set derivative is not uniquely determined in all directions, and the value is some chosen derivative.
For the derivative is uniquely determined.
helmholtzOp . For a real number , a real function on and , define
The two terms are read as follows:
- is the full (not one-sided) Laplacian. It is computed from the second Fréchet derivative and is taken to be wherever is not twice differentiable.
- The coefficient is a real number embedded in . Division by zero gives , so when the operator reduces to .
IsHelmholtzSolution. Let , , and be arbitrary. No sign, positivity, measurability or regularity assumptions are placed on any of them; in particular , , and vanishing somewhere are all allowed. The statement " solves the Helmholtz problem" is the conjunction of three conditions.
- For Lebesgue-almost every , is on some neighbourhood of and
- For every , is differentiable at within and
Here complex division by zero gives , so where the condition becomes . When it is also just . 3. For every , .
The following are not required:
- any continuity of up to the boundary, beyond what condition 2 implies on ;
- any condition at the corners and ;
- any relation between the interior equation and the boundary values.
The interior condition only needs to hold off a Lebesgue-null set. It is vacuous when is empty ( or ), and the boundary conditions then apply only on whatever and remain.
deltaM . For real functions on , define
with the convention . Thus wherever the first term is , and wherever the second term is .
IsResidualSolution. Let , , and be arbitrary, with no further assumptions. In particular, is not required to solve any equation and need not be related to . The statement is the conjunction of three conditions.
- For Lebesgue-almost every , is on a neighbourhood of and
with as in deltaM and division by zero giving .
2. For every , is differentiable at within and
Note that this condition uses , not , and has right-hand side . Where it reduces to . 3. For every , .
The same remarks apply as for IsHelmholtzSolution: the interior condition holds only almost everywhere, there are no conditions at the corners and , and the interior condition is vacuous when or .
IsResidualSolutionDerived. The data are the same as in IsResidualSolution, with no assumptions. The definition has the identical interior condition (1) and free-surface condition (3). The only change is the absorbing condition: for every , is differentiable at within and
All reciprocals use the convention . Consequently:
- where , or where , the right-hand side is and this coincides with the condition in
IsResidualSolution; - otherwise, the right-hand side depends on the arbitrary function , which again is not required to satisfy any equation.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.