Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Locally rough surface scattering (Neumann case): problem (NP), layer potentials, the space XXX and the operators AAA, BBB

Definition
Arxiv1901_08703_Basic

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

boundary-integral-equationshelmholtz-equationinverse-scatteringneumann-problemrough-surfaces

Objects of Sections 1, 2, 3.1, 4 and Remark 5.2 of Qu, Zhang and Zhang (2019), A novel integral equation for scattering by locally rough surfaces and application to the inverse problem: the Neumann case.

  1. Surface and incident waves. A profile h∈C2(R)h\in C^2(\mathbb R)h∈C2(R) with compact support defines the locally rough surface Γ={(t,h(t))}\Gamma=\{(t,h(t))\}Γ={(t,h(t))}, the domain D+={x2>h(x1)}D_+=\{x_2>h(x_1)\}D+​={x2​>h(x1​)} above it and D−={x2<h(x1)}D_-=\{x_2<h(x_1)\}D−​={x2​<h(x1​)} below it. On Γ\GammaΓ, ds=1+h′(t)2 dtds=\sqrt{1+h'(t)^2}\,dtds=1+h′(t)2​dt and ν=(−h′(t),1)/1+h′(t)2\nu=(-h'(t),1)/\sqrt{1+h'(t)^2}ν=(−h′(t),1)/1+h′(t)2​ is the unit normal directed into D+D_+D+​. For k>0k>0k>0 and d∈S−1={∣d∣=1, d2<0}d\in\mathbb S^1_-=\{|d|=1,\ d_2<0\}d∈S−1​={∣d∣=1, d2​<0}, the incident wave is ui(x;d)=eikd⋅xu^i(x;d)=e^{ikd\cdot x}ui(x;d)=eikd⋅x and the wave reflected by the plane x2=0x_2=0x2​=0 is ur(x;d)=eik(d1x1−d2x2)u^r(x;d)=e^{ik(d_1x_1-d_2x_2)}ur(x;d)=eik(d1​x1​−d2​x2​). The Neumann data is f=−(∂ui/∂ν+∂ur/∂ν)f=-(\partial u^i/\partial\nu+\partial u^r/\partial\nu)f=−(∂ui/∂ν+∂ur/∂ν). S+1={∣x∣=1, x2>0}\mathbb S^1_+=\{|x|=1,\ x_2>0\}S+1​={∣x∣=1, x2​>0}.
  2. Bessel and Hankel functions. Jn(r)=∑m≥0(−1)mm!(m+n)!(r/2)2m+nJ_n(r)=\sum_{m\ge0}\frac{(-1)^m}{m!(m+n)!}(r/2)^{2m+n}Jn​(r)=∑m≥0​m!(m+n)!(−1)m​(r/2)2m+n for n≥0n\ge0n≥0 and J−n=(−1)nJnJ_{-n}=(-1)^nJ_nJ−n​=(−1)nJn​. Y0(r)=2π(log⁡r2+γE)J0(r)+2π∑m≥1(−1)m+1Hm(r/2)2m(m!)2Y_0(r)=\frac2\pi(\log\frac r2+\gamma_E)J_0(r)+\frac2\pi\sum_{m\ge1}(-1)^{m+1}H_m\frac{(r/2)^{2m}}{(m!)^2}Y0​(r)=π2​(log2r​+γE​)J0​(r)+π2​∑m≥1​(−1)m+1Hm​(m!)2(r/2)2m​ with HmH_mHm​ the harmonic numbers, H0(1)=J0+iY0H_0^{(1)}=J_0+iY_0H0(1)​=J0​+iY0​, and Φk(x,y)=i4H0(1)(k∣x−y∣)\Phi_k(x,y)=\frac i4H_0^{(1)}(k|x-y|)Φk​(x,y)=4i​H0(1)​(k∣x−y∣) is the fundamental solution of Δw+k2w=0\Delta w+k^2w=0Δw+k2w=0.
  3. The Neumann problem (NP). uuu solves (NP) with data fff if u∈C2(D+)u\in C^2(D_+)u∈C2(D+​) with Δu+k2u=0\Delta u+k^2u=0Δu+k2u=0 in D+D_+D+​; u∈Hloc1(D+)u\in H^1_{loc}(D_+)u∈Hloc1​(D+​), i.e. ∫D+∩Bρ(∣u∣2+∣∇u∣2) dx<∞\int_{D_+\cap B_\rho}(|u|^2+|\nabla u|^2)\,dx<\infty∫D+​∩Bρ​​(∣u∣2+∣∇u∣2)dx<∞ for every ρ\rhoρ; uuu satisfies the Sommerfeld radiation condition ∣x∣ (∂ru−iku)→0\sqrt{|x|}\,(\partial_ru-iku)\to0∣x∣​(∂r​u−iku)→0 as ∣x∣→∞|x|\to\infty∣x∣→∞ in D+D_+D+​; and ∂u/∂ν=f\partial u/\partial\nu=f∂u/∂ν=f on Γ\GammaΓ in the weak sense
∫D+(∇u⋅∇φ−k2uφ) dx=−∫Γfφ dsfor all φ∈Cc∞(R2).\int_{D_+}(\nabla u\cdot\nabla\varphi-k^2u\varphi)\,dx=-\int_\Gamma f\varphi\,ds\qquad\text{for all }\varphi\in C_c^\infty(\mathbb R^2).∫D+​​(∇u⋅∇φ−k2uφ)dx=−∫Γ​fφdsfor all φ∈Cc∞​(R2).

FFF is the far-field pattern of uuu on a set AAA of directions if u(x)=eik∣x∣∣x∣(F(x^)+O(∣x∣−1))u(x)=\frac{e^{ik|x|}}{\sqrt{|x|}}\big(F(\hat x)+O(|x|^{-1})\big)u(x)=∣x∣​eik∣x∣​(F(x^)+O(∣x∣−1)) uniformly for x^=x/∣x∣∈A\hat x=x/|x|\in Ax^=x/∣x∣∈A. λ\lambdaλ is a Dirichlet eigenvalue of −Δ-\Delta−Δ in an open set DDD if some u∈C2(D)∩C(D‾)u\in C^2(D)\cap C(\overline D)u∈C2(D)∩C(D), not identically zero, satisfies Δu+λu=0\Delta u+\lambda u=0Δu+λu=0 in DDD and u=0u=0u=0 on ∂D\partial D∂D. 4. Geometry of the integral equation. R>0R>0R>0 is such that the perturbation {(t,h(t)):t∈supp⁡h}\{(t,h(t)):t\in\operatorname{supp}h\}{(t,h(t)):t∈supph} lies in BR={∣x∣<R}B_R=\{|x|<R\}BR​={∣x∣<R}. Then ΓR={(t,h(t)):∣t∣<R}\Gamma_R=\{(t,h(t)):|t|<R\}ΓR​={(t,h(t)):∣t∣<R}, ∂BR−={R(cos⁡θ,sin⁡θ):π<θ<2π}\partial B_R^-=\{R(\cos\theta,\sin\theta):\pi<\theta<2\pi\}∂BR−​={R(cosθ,sinθ):π<θ<2π}, DR−=BR∩D−D_R^-=B_R\cap D_-DR−​=BR​∩D−​, and the corners are xA=(−R,0)x_A=(-R,0)xA​=(−R,0), xB=(R,0)x_B=(R,0)xB​=(R,0). The auxiliary domain D~\tilde DD~ is a bounded open set with D~‾⊂DR−\overline{\tilde D}\subset D_R^-D~⊂DR−​ whose boundary Γ~\tilde\GammaΓ~ is a closed C2C^2C2 curve. It is given with a 2π2\pi2π-periodic, regular, positively oriented C2C^2C2 parametrisation zzz, and ν\nuν on Γ~\tilde\GammaΓ~ points out of D~\tilde DD~. On ∂DR−\partial D_R^-∂DR−​, ν\nuν points out of DR−D_R^-DR−​. 5. The space XXX. X=L2(ΓR)×L2(∂BR−)×H−1/2(Γ~)X=L^2(\Gamma_R)\times L^2(\partial B_R^-)\times H^{-1/2}(\tilde\Gamma)X=L2(ΓR​)×L2(∂BR−​)×H−1/2(Γ~). A density φ3∈H−1/2(Γ~)\varphi_3\in H^{-1/2}(\tilde\Gamma)φ3​∈H−1/2(Γ~) is represented by b∈ℓ2(Z)b\in\ell^2(\mathbb Z)b∈ℓ2(Z): the Fourier coefficients of s↦φ3(z(s))∣z′(s)∣s\mapsto\varphi_3(z(s))|z'(s)|s↦φ3​(z(s))∣z′(s)∣ are an=(1+n2)1/4bna_n=(1+n^2)^{1/4}b_nan​=(1+n2)1/4bn​. Integrals over Γ~\tilde\GammaΓ~ are then ∫Γ~Kφ3 ds=∑nan∫02πK(z(s))eins ds\int_{\tilde\Gamma}K\varphi_3\,ds=\sum_na_n\int_0^{2\pi}K(z(s))e^{ins}\,ds∫Γ~​Kφ3​ds=∑n​an​∫02π​K(z(s))einsds. 6. Potentials and the operators AAA, BBB (eqs. (2.10), (2.14)-(2.16), (2.35)). The field is us=Sk,ΓRφ1+Sk,∂BR−φ2+Sk,Γ~φ3u^s=\mathcal S_{k,\Gamma_R}\varphi_1+\mathcal S_{k,\partial B_R^-}\varphi_2+\mathcal S_{k,\tilde\Gamma}\varphi_3us=Sk,ΓR​​φ1​+Sk,∂BR−​​φ2​+Sk,Γ~​φ3​ and its far-field pattern is S∞ΦS^\infty\PhiS∞Φ, where (Sk,I∞φ)(x^)=eiπ/48πk∫Ie−ikx^⋅yφ(y) ds(y)(S^\infty_{k,I}\varphi)(\hat x)=\frac{e^{i\pi/4}}{\sqrt{8\pi k}}\int_Ie^{-ik\hat x\cdot y}\varphi(y)\,ds(y)(Sk,I∞​φ)(x^)=8πk​eiπ/4​∫I​e−ikx^⋅yφ(y)ds(y). The rows of AAA are −2Kk′-2K'_k−2Kk′​ on ΓR\Gamma_RΓR​, −2(Kk′−Kk′,re)-2(K'_k-K'^{,re}_k)−2(Kk′​−Kk′,re​) on ∂BR−\partial B_R^-∂BR−​ and −2(Kk′+iρSk)-2(K'_k+i\rho S_k)−2(Kk′​+iρSk​) on Γ~\tilde\GammaΓ~. The third row is taken as an element of H−1/2(Γ~)H^{-1/2}(\tilde\Gamma)H−1/2(Γ~) through its Fourier coefficients. A33A_{33}A33​ acts on coefficients through the matrix 12π∫02π ⁣∫02πe−ims∣z′(s)∣(∂ν(z(s))Φk(z(s),z(t))+iρΦk(z(s),z(t)))eint dt ds\frac1{2\pi}\int_0^{2\pi}\!\int_0^{2\pi}e^{-ims}|z'(s)|\big(\partial_{\nu(z(s))}\Phi_k(z(s),z(t))+i\rho\Phi_k(z(s),z(t))\big)e^{int}\,dt\,ds2π1​∫02π​∫02π​e−ims∣z′(s)∣(∂ν(z(s))​Φk​(z(s),z(t))+iρΦk​(z(s),z(t)))eintdtds. G=(2(∂ui/∂ν+∂ur/∂ν)∣ΓR,0,0)G=(2(\partial u^i/\partial\nu+\partial u^r/\partial\nu)|_{\Gamma_R},0,0)G=(2(∂ui/∂ν+∂ur/∂ν)∣ΓR​​,0,0). BBB is the upper-left 2×22\times22×2 block of AAA. The corner part A^11⋆\hat A^\star_{11}A^11⋆​ of BBB keeps the kernel of BBB only where xxx and yyy are both within distance rrr of xAx_AxA​, or both within rrr of xBx_BxB​. 7. Inverse problem (Section 4). R+2∖BR‾={x2>0, ∣x∣>R}\mathbb R^2_+\setminus\overline{B_R}=\{x_2>0,\ |x|>R\}R+2​∖BR​​={x2​>0, ∣x∣>R}. The point-source Neumann data is f(⋅;y)=−∂ν(Φk(⋅,y)+Φk(⋅,yre))f(\cdot;y)=-\partial_\nu(\Phi_k(\cdot,y)+\Phi_k(\cdot,y^{re}))f(⋅;y)=−∂ν​(Φk​(⋅,y)+Φk​(⋅,yre)) with yre=(y1,−y2)y^{re}=(y_1,-y_2)yre=(y1​,−y2​). 8. Spline basis (Remark 5.2). ϕ(t)=∑j=05(−1)j4!(5j)(t+52−j)+4\phi(t)=\sum_{j=0}^{5}\frac{(-1)^j}{4!}\binom5j(t+\frac52-j)_+^4ϕ(t)=∑j=05​4!(−1)j​(j5​)(t+25​−j)+4​, h=2R/(M+5)h=2R/(M+5)h=2R/(M+5), ti=(i+2)h−Rt_i=(i+2)h-Rti​=(i+2)h−R, and ϕi,M(t)=ϕ((t−ti)/h)\phi_{i,M}(t)=\phi((t-t_i)/h)ϕi,M​(t)=ϕ((t−ti​)/h).

Formalization Note Points of R2\mathbb R^2R2 are elements of EuclideanSpace ℝ (Fin 2). Functions on ΓR\Gamma_RΓR​ and ∂BR−\partial B_R^-∂BR−​ are functions of the parameters t∈(−R,R)t\in(-R,R)t∈(−R,R) and θ∈(π,2π)\theta\in(\pi,2\pi)θ∈(π,2π), with the arc-length measures 1+h′2 dt\sqrt{1+h'^2}\,dt1+h′2​dt and R dθR\,d\thetaRdθ. L2L^2L2 spaces are Mathlib's Lp, and products carry the maximum norm, which is equivalent to the paper's sum norm. A solution of (NP) is taken in its representative that is C2C^2C2 in D+D_+D+​; every Hloc1H^1_{loc}Hloc1​ solution has one by interior elliptic regularity. With that representative the weak gradient is the classical gradient.

Definition code
import Mathlib

/-!
F. Qu, B. Zhang and H. Zhang, *A novel integral equation for scattering by locally rough surfaces
and application to the inverse problem: the Neumann case*, arXiv:1901.08703v1 (2019):
the locally rough surface, the incident and reflected plane waves, the Neumann problem (NP) and
the far-field pattern of Sections 1 and 2; the fundamental solution, the layer potentials, the
space `X`, the operator `A` and the right-hand side `G` of eqs. (2.4)-(2.16); the Dirichlet
eigenvalues of Theorem 2.4 and Remark 2.5; the far-field formulas (2.5), (2.33), (2.36); the
operator `B` of Remark 2.9 and its corner split (3.1); the point sources of Section 4; and the
spline basis of Remark 5.2.

Points of `ℝ²` are elements of `EuclideanSpace ℝ (Fin 2)`; the paper's `x = (x₁, x₂)` is
`x 0 = x₁`, `x 1 = x₂`. A function on `Γ = {(t, h t)}` or on `Γ_R` is written as a function of the
parameter `t = x₁`; a function on the lower semicircle `∂B_R^-` as a function of the angle
`θ ∈ (π, 2π)`; a function (or distribution) `φ₃` on the auxiliary curve `Γ̃ = {z(s)}` through the
Fourier coefficients of `s ↦ φ₃(z(s)) |z'(s)|`.
-/

open MeasureTheory

noncomputable section

namespace Arxiv1901_08703

/-- The plane `ℝ²` with its Euclidean norm. -/
abbrev R2 := EuclideanSpace ℝ (Fin 2)

/-- The point `(a, b) ∈ ℝ²`. -/
def pt (a b : ℝ) : R2 := !₂[a, b]

/-- The Euclidean inner product `x · y = x₁ y₁ + x₂ y₂` of `ℝ²`. -/
def dot (x y : R2) : ℝ := x 0 * y 0 + x 1 * y 1

/-- Section 2, p. 4: the reflection `x^{re} = (x₁, -x₂)` of `x` about the `x₁`-axis. -/
def refl (x : R2) : R2 := pt (x 0) (-(x 1))

/-! ### Bessel functions and the fundamental solution (Section 2, p. 5; Remark 2.5, p. 13) -/

/-- The Bessel function of the first kind of order `n ∈ ℕ`,
`J_n(r) = ∑_{m ≥ 0} (-1)^m / (m! (m+n)!) (r/2)^{2m+n}` (Remark 2.5, p. 13; `J₀` enters `Φ_k`). -/
def besselJNat (n : ℕ) (r : ℝ) : ℝ :=
  ∑' m : ℕ, (-1 : ℝ) ^ m / ((m.factorial : ℝ) * ((m + n).factorial : ℝ)) * (r / 2) ^ (2 * m + n)

/-- Remark 2.5, p. 13: the Bessel function `J_n` of integer order `n`, with the standard
convention `J_{-n} = (-1)^n J_n` for `n ∈ ℕ`. -/
def besselJ (n : ℤ) (r : ℝ) : ℝ :=
  if 0 ≤ n then besselJNat n.toNat r else (-1 : ℝ) ^ n.natAbs * besselJNat n.natAbs r

/-- The Bessel function of the second kind of order zero, for `r > 0`:
`Y₀(r) = (2/π)(log(r/2) + γ) J₀(r) + (2/π) ∑_{m ≥ 1} (-1)^{m+1} H_m (r/2)^{2m} / (m!)²`,
with `H_m` the harmonic numbers and `γ` the Euler–Mascheroni constant (Section 2, p. 5,
through `Φ_k`). -/
def besselY0 (r : ℝ) : ℝ :=
  2 / Real.pi * (Real.log (r / 2) + Real.eulerMascheroniConstant) * besselJNat 0 r +
    2 / Real.pi * ∑' m : ℕ, (-1 : ℝ) ^ m * (harmonic (m + 1) : ℝ) * (r / 2) ^ (2 * (m + 1)) /
      (((m + 1).factorial : ℝ) ^ 2)

/-- The Hankel function of the first kind of order zero, `H₀^{(1)} = J₀ + i Y₀`, for `r > 0`
(Section 2, p. 5). -/
def hankel01 (r : ℝ) : ℂ := (besselJNat 0 r : ℂ) + Complex.I * (besselY0 r : ℂ)

/-- Section 2, p. 5: the fundamental solution `Φ_k(x,y) = (i/4) H₀^{(1)}(k|x-y|)` of the
Helmholtz equation `Δw + k²w = 0`, for `k > 0` and `x ≠ y`. -/
def Phi (k : ℝ) (x y : R2) : ℂ := Complex.I / 4 * hankel01 (k * ‖x - y‖)

/-- Eq. (2.7), p. 5: the normal derivative `∂Φ_k(x,y)/∂ν(x) = ∇_x Φ_k(x,y) · ν` with respect to
the first variable, at the point `x`, in the direction of the normal vector `ν` at `x`. -/
def dPhi (k : ℝ) (x nu y : R2) : ℂ := fderiv ℝ (fun w => Phi k w y) x nu

/-! ### The locally rough surface and the Neumann problem (Sections 1 and 2, pp. 1-4) -/

/-- Section 1, p. 2: `h ∈ C²(ℝ)` has compact support; `Γ = {x₂ = h(x₁)}` is a locally rough
surface. -/
def IsLocalProfile (h : ℝ → ℝ) : Prop := ContDiff ℝ 2 h ∧ HasCompactSupport h

/-- Section 1, p. 2: the domain `D_+ = {(x₁, x₂) : x₂ > h(x₁)}` above `Γ`. -/
def Dplus (h : ℝ → ℝ) : Set R2 := {x | h (x 0) < x 1}

/-- Section 2, p. 4: the domain `D_- = {(x₁, x₂) : x₂ < h(x₁)}` below `Γ`. -/
def Dminus (h : ℝ → ℝ) : Set R2 := {x | x 1 < h (x 0)}

/-- The point `(t, h(t))` of `Γ`. -/
def gPt (h : ℝ → ℝ) (t : ℝ) : R2 := pt t (h t)

/-- The arc-length density `√(1 + h'(t)²)` of `Γ` in the parameter `t = x₁`. -/
def gSpeed (h : ℝ → ℝ) (t : ℝ) : ℝ := Real.sqrt (1 + deriv h t ^ 2)

/-- Section 1, p. 2: the unit normal `ν = (-h'(t), 1)/√(1 + h'(t)²)` to `Γ` at `(t, h(t))`,
directed into `D_+`; on `Γ_R` it is the unit normal of `∂D_R^-` pointing out of `D_R^-`
(Section 2, p. 5). -/
def gNormal (h : ℝ → ℝ) (t : ℝ) : R2 := (gSpeed h t)⁻¹ • pt (-deriv h t) 1

/-- Section 1, p. 2: `d ∈ 𝕊¹_- = {x : |x| = 1, x₂ < 0}`, an incident direction. -/
def IsLowerDir (d : R2) : Prop := ‖d‖ = 1 ∧ d 1 < 0

/-- Section 1, p. 2: the upper half `𝕊¹_+ = {x : |x| = 1, x₂ > 0}` of the unit circle. -/
def upperCircle : Set R2 := {x | ‖x‖ = 1 ∧ 0 < x 1}

/-- Section 1, p. 2: the incident plane wave `u^i(x;d) = exp(i k d · x)`. -/
def uInc (k : ℝ) (d x : R2) : ℂ := Complex.exp (Complex.I * (k : ℂ) * (dot d x : ℂ))

/-- Section 1, p. 2: the wave reflected by the plane `x₂ = 0`,
`u^r(x;d) = exp(i k (x₁ sin θ + x₂ cos θ))` for `d = (sin θ, -cos θ)`, that is
`u^r(x;d) = exp(i k (d₁ x₁ - d₂ x₂))`. -/
def uRefl (k : ℝ) (d x : R2) : ℂ :=
  Complex.exp (Complex.I * (k : ℂ) * ((d 0 * x 0 - d 1 * x 1 : ℝ) : ℂ))

/-- Section 2, p. 4: the Neumann data `f = -(∂u^i/∂ν + ∂u^r/∂ν)` at the point `(t, h(t))` of `Γ`,
`ν` the unit normal directed into `D_+`. -/
def incData (k : ℝ) (d : R2) (h : ℝ → ℝ) (t : ℝ) : ℂ :=
  -(fderiv ℝ (fun x => uInc k d x + uRefl k d x) (gPt h t) (gNormal h t))

/-- `∇u(x) · ∇v(x) = ∂₁u ∂₁v + ∂₂u ∂₂v` (bilinear, without complex conjugation). -/
def gradDot (u v : R2 → ℂ) (x : R2) : ℂ :=
  fderiv ℝ u x (pt 1 0) * fderiv ℝ v x (pt 1 0) + fderiv ℝ u x (pt 0 1) * fderiv ℝ v x (pt 0 1)

/-- `|∇u(x)|² = |∂₁u(x)|² + |∂₂u(x)|²`. -/
def gradSq (u : R2 → ℂ) (x : R2) : ℝ :=
  ‖fderiv ℝ u x (pt 1 0)‖ ^ 2 + ‖fderiv ℝ u x (pt 0 1)‖ ^ 2

/-- Section 2, p. 4: `u ∈ H¹_loc(D)` for a function `u` that is `C¹` in the open set `D` (so that
its weak gradient is its classical gradient): `∫_{D ∩ B_ρ} (|u|² + |∇u|²) dx < ∞` for every
`ρ`, i.e. `u ∈ H¹(D ∩ B)` for every bounded ball `B`, up to the boundary of `D`. -/
def IsH1Loc (D : Set R2) (u : R2 → ℂ) : Prop :=
  ∀ ρ : ℝ, IntegrableOn (fun x => ‖u x‖ ^ 2 + gradSq u x) (D ∩ Metric.ball 0 ρ)

/-- Theorem 2.7, p. 13: the norm `‖u‖_{H¹(D)} = (∫_D (|u|² + |∇u|²) dx)^{1/2}`. -/
def h1Norm (D : Set R2) (u : R2 → ℂ) : ℝ := Real.sqrt (∫ x in D, ‖u x‖ ^ 2 + gradSq u x)

/-- The norm `‖f‖_{L²(Γ)} = (∫_ℝ |f(t)|² √(1 + h'(t)²) dt)^{1/2}` of a function on `Γ`
written in the parameter `t` (Theorem 2.4, eq. (2.17), and Theorem 2.7, eq. (2.32)). -/
def l2Gam (h : ℝ → ℝ) (f : ℝ → ℂ) : ℝ := Real.sqrt (∫ t, ‖f t‖ ^ 2 * gSpeed h t)

/-- A test function: `φ ∈ C_c^∞(ℝ²)`, complex valued. -/
def IsTestFn (φ : R2 → ℂ) : Prop := ContDiff ℝ (⊤ : ℕ∞) φ ∧ HasCompactSupport φ

/-- Eq. (1.1), p. 2: `u ∈ C²(D)` and `Δu + k²u = 0` in `D`. -/
def IsHelmholtzOn (D : Set R2) (k : ℝ) (u : R2 → ℂ) : Prop :=
  ContDiffOn ℝ 2 u D ∧ ∀ x ∈ D, Laplacian.laplacian u x + (k : ℂ) ^ 2 * u x = 0

/-- Eq. (1.3), p. 2: the Sommerfeld radiation condition
`lim_{r → ∞} r^{1/2} (∂u/∂r - i k u) = 0`, `r = |x|`, `x ∈ D`, with `∂u/∂r = ∇u(x) · x/|x|`;
the limit is taken as `|x| → ∞` within `D`. -/
def IsRadiating (k : ℝ) (D : Set R2) (u : R2 → ℂ) : Prop :=
  ∀ ε > 0, ∃ ρ : ℝ, ∀ x ∈ D, ρ < ‖x‖ →
    ‖(Real.sqrt ‖x‖ : ℂ) * (fderiv ℝ u x (‖x‖⁻¹ • x) - Complex.I * (k : ℂ) * u x)‖ < ε

/-- Eq. (2.1), p. 4: the Neumann condition `∂u/∂ν = f` on `Γ` (`ν` directed into `D_+`) for
`u ∈ H¹_loc(D_+)` with `Δu + k²u = 0`, in its weak (Green's formula) form:
`∫_{D_+} (∇u · ∇φ - k² u φ) dx = -∫_Γ f φ ds` for every `φ ∈ C_c^∞(ℝ²)`. -/
def IsNeumannWeak (k : ℝ) (h : ℝ → ℝ) (f : ℝ → ℂ) (u : R2 → ℂ) : Prop :=
  ∀ φ : R2 → ℂ, IsTestFn φ →
    ∫ x in Dplus h, (gradDot u φ x - (k : ℂ) ^ 2 * u x * φ x) =
      -∫ t, f t * φ (gPt h t) * (gSpeed h t : ℂ)

/-- Section 2, p. 4: `u` solves the Neumann problem (NP) with data `f`: `u ∈ H¹_loc(D_+)`
(taken in its representative that is `C²` in `D_+`), `Δu + k²u = 0` in `D_+` (eq. (1.1)), `u`
satisfies the radiation condition (1.3), and `∂u/∂ν = f` on `Γ` (eq. (2.1)). -/
def IsNPSolution (k : ℝ) (h : ℝ → ℝ) (f : ℝ → ℂ) (u : R2 → ℂ) : Prop :=
  IsHelmholtzOn (Dplus h) k u ∧ IsH1Loc (Dplus h) u ∧ IsRadiating k (Dplus h) u ∧
    IsNeumannWeak k h f u

/-- Section 1, p. 2 and Remark 2.8, p. 14: `F` is the far-field pattern of `u` for the
observation directions in `A`: `u(x) = e^{ik|x|}/√|x| (F(x̂) + O(1/|x|))` as `|x| → ∞`,
uniformly for `x̂ = x/|x| ∈ A`. -/
def HasFarFieldOn (k : ℝ) (u : R2 → ℂ) (F : R2 → ℂ) (A : Set R2) : Prop :=
  ∃ C ρ : ℝ, 0 < ρ ∧ ∀ x : R2, ρ ≤ ‖x‖ → ‖x‖⁻¹ • x ∈ A →
    ‖u x - Complex.exp (Complex.I * (k : ℂ) * (‖x‖ : ℂ)) / (Real.sqrt ‖x‖ : ℂ) * F (‖x‖⁻¹ • x)‖ ≤
      C / (‖x‖ * Real.sqrt ‖x‖)

/-- Theorem 2.4, p. 8, and Remark 2.5, p. 13: `λ` is a Dirichlet eigenvalue of `-Δ` in the open
set `D`: there is `u ∈ C²(D) ∩ C(\overline D)`, not identically zero, with `Δu + λu = 0` in `D` and
`u = 0` on `∂D`. -/
def IsDirichletEigenvalue (D : Set R2) (lam : ℝ) : Prop :=
  ∃ u : R2 → ℂ, ContDiffOn ℝ 2 u D ∧ ContinuousOn u (closure D) ∧ (∀ x ∈ frontier D, u x = 0) ∧
    (∀ x ∈ D, Laplacian.laplacian u x + (lam : ℂ) * u x = 0) ∧ ∃ x ∈ D, u x ≠ 0

/-! ### The curve `∂D_R^-`, the auxiliary curve `Γ̃` and the space `X` (Section 2, pp. 4-7) -/

/-- Section 2, p. 4: `R > 0` and the local perturbation `Γ_p = {(x₁, h(x₁)) : x₁ ∈ supp(h)}`
lies in the open disc `B_R = {|x| < R}`. -/
def PerturbationInBall (h : ℝ → ℝ) (R : ℝ) : Prop :=
  0 < R ∧ ∀ t ∈ tsupport h, t ^ 2 + h t ^ 2 < R ^ 2

/-- Section 2, p. 4: `D_R^- = B_R ∩ D_-`. -/
def DRminus (h : ℝ → ℝ) (R : ℝ) : Set R2 := {x | x 1 < h (x 0) ∧ ‖x‖ < R}

/-- The point `R(cos θ, sin θ)` of `∂B_R`; for `π < θ < 2π` it lies on `∂B_R^-`. -/
def cPt (R θ : ℝ) : R2 := pt (R * Real.cos θ) (R * Real.sin θ)

/-- The unit normal `(cos θ, sin θ)` of `∂B_R` at `R(cos θ, sin θ)`, pointing out of `B_R`. -/
def cNormal (θ : ℝ) : R2 := pt (Real.cos θ) (Real.sin θ)

/-- Section 2, p. 4: the corner `x_A = (-R, 0)` of `∂D_R^-`. -/
def xA (R : ℝ) : R2 := pt (-R) 0

/-- Section 2, p. 4: the corner `x_B = (R, 0)` of `∂D_R^-`. -/
def xB (R : ℝ) : R2 := pt R 0

/-- Arc length on `Γ_R = {(t, h(t)) : -R < t < R}` in the parameter `t`:
`ds = √(1 + h'(t)²) dt` on `(-R, R)`. `L²(Γ_R)` is `L²` of this measure. -/
def muG (h : ℝ → ℝ) (R : ℝ) : Measure ℝ :=
  (volume.restrict (Set.Ioo (-R) R)).withDensity (fun t => ENNReal.ofReal (gSpeed h t))

/-- Arc length on `∂B_R^- = {R(cos θ, sin θ) : π < θ < 2π}` in the parameter `θ`: `ds = R dθ`.
`L²(∂B_R^-)` is `L²` of this measure. -/
def muB (R : ℝ) : Measure ℝ :=
  (volume.restrict (Set.Ioo Real.pi (2 * Real.pi))).withDensity (fun _ => ENNReal.ofReal R)

/-- The unit normal at `z(s)` of a positively oriented closed curve `z`:
`(z₂'(s), -z₁'(s))/|z'(s)|`, which points out of the domain the curve encloses. -/
def auxNormal (z : ℝ → R2) (s : ℝ) : R2 := ‖deriv z s‖⁻¹ • pt (deriv z s 1) (-(deriv z s 0))

/-- Section 2, p. 4: an auxiliary domain `D̃` with `\overline{D̃} ⊂ D_R^-` and `C²`-smooth boundary
`Γ̃ = ∂D̃`, given with a `2π`-periodic, regular, positively oriented `C²` parametrisation `z` of
`Γ̃` that is injective on one period. The field `outward` says that `auxNormal z` is the unit
normal pointing out of `D̃` (the normal `ν` of `Γ̃` used in eqs. (2.7), (2.13), (2.15)). -/
structure AuxDomain (h : ℝ → ℝ) (R : ℝ) where
  /-- The auxiliary domain `D̃`. -/
  D : Set R2
  /-- The parametrisation of `Γ̃ = ∂D̃`. -/
  z : ℝ → R2
  /-- `D̃` is open. -/
  isOpen_D : IsOpen D
  /-- `D̃` is bounded. -/
  isBounded_D : Bornology.IsBounded D
  /-- `z` is `2π`-periodic. -/
  periodic_z : Function.Periodic z (2 * Real.pi)
  /-- `z` is `C²`. -/
  contDiff_z : ContDiff ℝ 2 z
  /-- `z` is regular. -/
  deriv_ne : ∀ s, deriv z s ≠ 0
  /-- `z` is injective on one period. -/
  injOn_z : Set.InjOn z (Set.Ico 0 (2 * Real.pi))
  /-- `Γ̃ = ∂D̃` is the curve `z`. -/
  frontier_eq : frontier D = Set.range z
  /-- `\overline{D̃} ⊂ D_R^-`. -/
  closure_sub : closure D ⊆ DRminus h R
  /-- `auxNormal z` points out of `D̃` (positive orientation of `z`). -/
  outward : ∀ s, ∀ᶠ ε in nhdsWithin (0 : ℝ) (Set.Ioi 0),
    z s + ε • auxNormal z s ∉ closure D ∧ z s - ε • auxNormal z s ∈ D

/-- Section 2, p. 6: the space `H^{-1/2}(Γ̃)`, represented by `ℓ²(ℤ)`: `b ∈ ℓ²(ℤ)` stands for the
distribution `φ₃` on `Γ̃` such that `s ↦ φ₃(z(s)) |z'(s)|` has Fourier series
`∑_n a_n e^{ins}` with `a_n = (1 + n²)^{1/4} b_n` (so `‖b‖_{ℓ²}` is an equivalent
`H^{-1/2}(Γ̃)`-norm of `φ₃`). -/
abbrev Hm12 := lp (fun _ : ℤ => ℂ) 2

/-- The Fourier coefficients `a_n = (1 + n²)^{1/4} b_n` of `s ↦ φ₃(z(s)) |z'(s)|` for the element
`b` of `H^{-1/2}(Γ̃)` (see `Hm12`). -/
def hmhCoeff (b : Hm12) (n : ℤ) : ℂ := (((1 + (n : ℝ) ^ 2) ^ ((1 : ℝ) / 4) : ℝ) : ℂ) * b n

/-- Section 2, p. 6: `X = L²(Γ_R) × L²(∂B_R^-) × H^{-1/2}(Γ̃)` (product norm: the maximum of the
three norms, equivalent to the paper's sum). -/
abbrev Xsp (h : ℝ → ℝ) (R : ℝ) := Lp ℂ 2 (muG h R) × Lp ℂ 2 (muB R) × Hm12

/-- Remark 2.9, p. 14: `L²(Γ_R) × L²(∂B_R^-)` (product norm: the maximum of the two norms). -/
abbrev Ysp (h : ℝ → ℝ) (R : ℝ) := Lp ℂ 2 (muG h R) × Lp ℂ 2 (muB R)

/-- Eqs. (2.4)-(2.7), pp. 5-6: `∫_{Γ_R} K(y) φ₁(y) ds(y) + ∫_{∂B_R^-} K(y) φ₂(y) ds(y)`. -/
def bdryPair (h : ℝ → ℝ) (R : ℝ) (K : R2 → ℂ) (φ1 φ2 : ℝ → ℂ) : ℂ :=
  (∫ t, K (gPt h t) * φ1 t ∂(muG h R)) + ∫ θ, K (cPt R θ) * φ2 θ ∂(muB R)

/-- Eqs. (2.4)-(2.7), pp. 5-6: `∫_{Γ̃} K(y) φ₃(y) ds(y) = ∑_n a_n ∫_0^{2π} K(z(s)) e^{ins} ds`,
where `a_n` are the Fourier coefficients of `s ↦ φ₃(z(s)) |z'(s)|`. -/
def auxPair (z : ℝ → R2) (K : R2 → ℂ) (a : ℤ → ℂ) : ℂ :=
  ∑' n : ℤ, a n * ∫ s in (0 : ℝ)..(2 * Real.pi),
    K (z s) * Complex.exp (Complex.I * (n : ℂ) * (s : ℂ))

/-- Eq. (2.10), p. 6: the single-layer potential
`(𝒮_{k,Γ_R} φ₁)(x) + (𝒮_{k,∂B_R^-} φ₂)(x) = ∫_{Γ_R} Φ_k(x,y) φ₁ ds + ∫_{∂B_R^-} Φ_k(x,y) φ₂ ds`;
it is also the field (2.34) of Remark 2.9. -/
def slPotB (k : ℝ) (h : ℝ → ℝ) (R : ℝ) (φ1 φ2 : ℝ → ℂ) (x : R2) : ℂ :=
  bdryPair h R (fun y => Phi k x y) φ1 φ2

/-- Eq. (2.10), p. 6: the scattered field
`u^s = 𝒮_{k,Γ_R} φ₁ + 𝒮_{k,∂B_R^-} φ₂ + 𝒮_{k,Γ̃} φ₃`, `φ₃` given by its coefficients `a`. -/
def slPot (k : ℝ) (h : ℝ → ℝ) (R : ℝ) (z : ℝ → R2) (φ1 φ2 : ℝ → ℂ) (a : ℤ → ℂ) (x : R2) : ℂ :=
  slPotB k h R φ1 φ2 x + auxPair z (fun y => Phi k x y) a

/-- Eq. (2.5), p. 5: the constant `e^{iπ/4}/√(8πk)` of the far-field patterns (it is `γ` of
Lemma 4.2, p. 19). -/
def gammaInf (k : ℝ) : ℂ :=
  Complex.exp (Complex.I * (Real.pi : ℂ) / 4) / (Real.sqrt (8 * Real.pi * k) : ℂ)

/-- Eqs. (2.5) and (2.36), pp. 5, 14: `(S^∞_{k,Γ_R} φ₁)(x̂) + (S^∞_{k,∂B_R^-} φ₂)(x̂)` with
`(S^∞_{k,I} φ)(x̂) = e^{iπ/4}/√(8πk) ∫_I e^{-ik x̂ · y} φ(y) ds(y)`. -/
def ffPotB (k : ℝ) (h : ℝ → ℝ) (R : ℝ) (φ1 φ2 : ℝ → ℂ) (xhat : R2) : ℂ :=
  gammaInf k * bdryPair h R (fun y => Complex.exp (-(Complex.I * (k : ℂ) * (dot xhat y : ℂ))))
    φ1 φ2

/-- Eq. (2.33), p. 14: `u^∞ = S^∞Φ = S^∞_{k,Γ_R} φ₁ + S^∞_{k,∂B_R^-} φ₂ + S^∞_{k,Γ̃} φ₃`. -/
def ffPot (k : ℝ) (h : ℝ → ℝ) (R : ℝ) (z : ℝ → R2) (φ1 φ2 : ℝ → ℂ) (a : ℤ → ℂ)
    (xhat : R2) : ℂ :=
  ffPotB k h R φ1 φ2 xhat +
    gammaInf k * auxPair z (fun y => Complex.exp (-(Complex.I * (k : ℂ) * (dot xhat y : ℂ)))) a

/-! ### The operators `A`, `B` and the right-hand side `G` (eqs. (2.14)-(2.16), (2.35)) -/

/-- Eq. (2.15), p. 7: the kernel `y ↦ ∂Φ_k(x,y)/∂ν(x)` at `x = (t, h(t)) ∈ Γ_R` (first row of
`A`: `K'_{k, I_p → Γ_R}`). -/
def kerG (k : ℝ) (h : ℝ → ℝ) (t : ℝ) (y : R2) : ℂ := dPhi k (gPt h t) (gNormal h t) y

/-- Eq. (2.15), p. 7: the kernel `y ↦ ∂Φ_k(x,y)/∂ν(x) - ∂Φ_k(x^{re},y)/∂ν(x^{re})` at
`x = R(cos θ, sin θ) ∈ ∂B_R^-`, `ν(x^{re}) = x^{re}/R` (second row of `A`:
`K'_{k, I_p → ∂B_R^-} - K'^{,re}_{k, I_p → ∂B_R^-}`). -/
def kerB (k : ℝ) (R : ℝ) (θ : ℝ) (y : R2) : ℂ :=
  dPhi k (cPt R θ) (cNormal θ) y - dPhi k (refl (cPt R θ)) (refl (cNormal θ)) y

/-- Eq. (2.15), p. 7: the kernel `y ↦ ∂Φ_k(x,y)/∂ν(x) + iρ Φ_k(x,y)` at `x = z(s) ∈ Γ̃`, `ν` the
normal pointing out of `D̃` (third row of `A`: `K'_{k, I_p → Γ̃} + iρ S_{k, I_p → Γ̃}`). -/
def kerT (k ρ : ℝ) (z : ℝ → R2) (s : ℝ) (y : R2) : ℂ :=
  dPhi k (z s) (auxNormal z s) y + Complex.I * (ρ : ℂ) * Phi k (z s) y

/-- Eq. (2.15), p. 7, and eq. (2.35), p. 14: the first row of `B`,
`(B Φ)₁ = -2 K'_{k,Γ_R→Γ_R} φ₁ - 2 K'_{k,∂B_R^-→Γ_R} φ₂`, at `(t, h(t)) ∈ Γ_R`. -/
def opB1 (k : ℝ) (h : ℝ → ℝ) (R : ℝ) (φ1 φ2 : ℝ → ℂ) (t : ℝ) : ℂ :=
  -2 * bdryPair h R (kerG k h t) φ1 φ2

/-- Eq. (2.15), p. 7, and eq. (2.35), p. 14: the second row of `B`,
`(B Φ)₂ = -2 (K' - K'^{,re})_{k,Γ_R→∂B_R^-} φ₁ - 2 (K' - K'^{,re})_{k,∂B_R^-→∂B_R^-} φ₂`, at
`R(cos θ, sin θ) ∈ ∂B_R^-`. -/
def opB2 (k : ℝ) (h : ℝ → ℝ) (R : ℝ) (φ1 φ2 : ℝ → ℂ) (θ : ℝ) : ℂ :=
  -2 * bdryPair h R (kerB k R θ) φ1 φ2

/-- Eq. (2.15), p. 7: the first row of `A`, `(AΦ)₁ = A₁₁φ₁ + A₁₂φ₂ + A₁₃φ₃` on `Γ_R`. -/
def opA1 (k : ℝ) (h : ℝ → ℝ) (R : ℝ) (z : ℝ → R2) (φ1 φ2 : ℝ → ℂ) (a : ℤ → ℂ) (t : ℝ) : ℂ :=
  opB1 k h R φ1 φ2 t + -2 * auxPair z (kerG k h t) a

/-- Eq. (2.15), p. 7: the second row of `A`, `(AΦ)₂ = A₂₁φ₁ + A₂₂φ₂ + A₂₃φ₃` on `∂B_R^-`. -/
def opA2 (k : ℝ) (h : ℝ → ℝ) (R : ℝ) (z : ℝ → R2) (φ1 φ2 : ℝ → ℂ) (a : ℤ → ℂ) (θ : ℝ) : ℂ :=
  opB2 k h R φ1 φ2 θ + -2 * auxPair z (kerB k R θ) a

/-- The weight `e^{-ims} |z'(s)| / (2π)` that turns a function `F` on `Γ̃` into the `m`-th
Fourier coefficient `(1/2π) ∫_0^{2π} F(z(s)) |z'(s)| e^{-ims} ds` of `s ↦ F(z(s)) |z'(s)|`. -/
def fourierWeight (z : ℝ → R2) (m : ℤ) (s : ℝ) : ℂ :=
  Complex.exp (-(Complex.I * (m : ℂ) * (s : ℂ))) * (‖deriv z s‖ : ℂ) / (2 * Real.pi : ℂ)

/-- Eq. (2.15), p. 7: the third row of `A`, `(AΦ)₃ = A₃₁φ₁ + A₃₂φ₂ + A₃₃φ₃ ∈ H^{-1/2}(Γ̃)`, given
by its `m`-th Fourier coefficient (in the representation of `Hm12`). The term `A₃₃φ₃`, with
`A₃₃ = -2(K'_{k,Γ̃→Γ̃} + iρ S_{k,Γ̃→Γ̃})` acting on `H^{-1/2}(Γ̃)`, is the matrix
`∑_n a_n (1/2π) ∫_0^{2π} ∫_0^{2π} e^{-ims} |z'(s)| (∂Φ_k(z(s),z(t))/∂ν(z(s)) + iρ Φ_k(z(s),z(t)))
e^{int} dt ds`. -/
def opA3 (k ρ : ℝ) (h : ℝ → ℝ) (R : ℝ) (z : ℝ → R2) (φ1 φ2 : ℝ → ℂ) (a : ℤ → ℂ) (m : ℤ) : ℂ :=
  -2 * ((∫ s in (0 : ℝ)..(2 * Real.pi), fourierWeight z m s * bdryPair h R (kerT k ρ z s) φ1 φ2) +
    ∑' n : ℤ, a n * ∫ s in (0 : ℝ)..(2 * Real.pi), fourierWeight z m s *
      ∫ t in (0 : ℝ)..(2 * Real.pi), kerT k ρ z s (z t) * Complex.exp (Complex.I * (n : ℂ) * (t : ℂ)))

/-- Eq. (2.16), p. 7: the first component `2(∂u^i/∂ν + ∂u^r/∂ν)` of `G`, on `Γ_R`, at
`(t, h(t))`. -/
def gData (k : ℝ) (d : R2) (h : ℝ → ℝ) (t : ℝ) : ℂ := -2 * incData k d h t

/-- Eq. (2.14), p. 7: `Φ = (φ₁, φ₂, φ₃) ∈ X` solves `(I + A)Φ = G` with `A` of (2.15), `ρ` the
impedance constant of (2.13), and `G = (2(∂u^i/∂ν + ∂u^r/∂ν)|_{Γ_R}, 0, 0)` of (2.16). -/
def IsBIESolution (k ρ : ℝ) (h : ℝ → ℝ) (R : ℝ) (aux : AuxDomain h R) (d : R2)
    (sol : Xsp h R) : Prop :=
  (∀ᵐ t ∂(muG h R),
    sol.1 t + opA1 k h R aux.z ⇑sol.1 ⇑sol.2.1 (hmhCoeff sol.2.2) t = gData k d h t) ∧
  (∀ᵐ θ ∂(muB R), sol.2.1 θ + opA2 k h R aux.z ⇑sol.1 ⇑sol.2.1 (hmhCoeff sol.2.2) θ = 0) ∧
  ∀ m : ℤ, hmhCoeff sol.2.2 m + opA3 k ρ h R aux.z ⇑sol.1 ⇑sol.2.1 (hmhCoeff sol.2.2) m = 0

/-- Eq. (2.35), p. 14: `Ψ = (φ₁, φ₂) ∈ L²(Γ_R) × L²(∂B_R^-)` solves `(I + B)Ψ = (g₁, g₂)`. -/
def IsBSolution (k : ℝ) (h : ℝ → ℝ) (R : ℝ) (psi : Ysp h R) (g1 g2 : ℝ → ℂ) : Prop :=
  (∀ᵐ t ∂(muG h R), psi.1 t + opB1 k h R ⇑psi.1 ⇑psi.2 t = g1 t) ∧
  (∀ᵐ θ ∂(muB R), psi.2 θ + opB2 k h R ⇑psi.1 ⇑psi.2 θ = g2 θ)

/-- Section 3.1, eq. (3.1), p. 15: both `x` and `y` lie within distance `r` of the same corner
(`x_A` or `x_B`) of `∂D_R^-`. -/
def NearSameCorner (R r : ℝ) (x y : R2) : Prop :=
  (dist x (xA R) < r ∧ dist y (xA R) < r) ∨ (dist x (xB R) < r ∧ dist y (xB R) < r)

open Classical in
/-- Section 3.1, eq. (3.1), p. 15: the first row of `Â⋆₁₁`, the part of `Â₁₁ = B` whose kernel
is that of `B` when `x` and `y` are within distance `r` of the same corner and `0` otherwise. -/
def opBstar1 (k : ℝ) (h : ℝ → ℝ) (R r : ℝ) (φ1 φ2 : ℝ → ℂ) (t : ℝ) : ℂ :=
  -2 * bdryPair h R (fun y => if NearSameCorner R r (gPt h t) y then kerG k h t y else 0) φ1 φ2

open Classical in
/-- Section 3.1, eq. (3.1), p. 15: the second row of `Â⋆₁₁` (see `opBstar1`). -/
def opBstar2 (k : ℝ) (h : ℝ → ℝ) (R r : ℝ) (φ1 φ2 : ℝ → ℂ) (θ : ℝ) : ℂ :=
  -2 * bdryPair h R (fun y => if NearSameCorner R r (cPt R θ) y then kerB k R θ y else 0) φ1 φ2

/-! ### The inverse problem (Section 4, pp. 18-20) -/

/-- Lemma 4.1, p. 18: the exterior `ℝ²_+ \ \overline{B_R} = {x : x₂ > 0, |x| > R}` of the disc in
the upper half-plane. -/
def upperExt (R : ℝ) : Set R2 := {x | 0 < x 1 ∧ R < ‖x‖}

/-- Lemma 4.1, p. 18: the Neumann condition `∂u/∂ν = 0` on the flat part
`{(x₁, 0) : |x₁| > R}` of the boundary of `ℝ²_+ \ \overline{B_R}`, in weak form:
`∫_{ℝ²_+ \ \overline{B_R}} (∇u · ∇φ - k² u φ) dx = 0` for every `φ ∈ C_c^∞(ℝ²)` whose support
does not meet `\overline{B_R}`. -/
def IsFlatNeumannWeak (k R : ℝ) (u : R2 → ℂ) : Prop :=
  ∀ φ : R2 → ℂ, IsTestFn φ → tsupport φ ⊆ {x | R < ‖x‖} →
    ∫ x in upperExt R, (gradDot u φ x - (k : ℂ) ^ 2 * u x * φ x) = 0

/-- Section 4, p. 19: the Neumann data `f(·;y) = -(∂u^i(·;y)/∂ν + ∂u^r(·;y)/∂ν)` at `(t, h(t))`
for the point source `u^i(x;y) = Φ_k(x,y)` and its reflection `u^r(x;y) = Φ_k(x,y^{re})`. -/
def pointData (k : ℝ) (h : ℝ → ℝ) (y : R2) (t : ℝ) : ℂ :=
  -(fderiv ℝ (fun x => Phi k x y + Phi k x (refl y)) (gPt h t) (gNormal h t))

/-! ### The spline basis (Remark 5.2, p. 22) -/

/-- Remark 5.2, p. 22: the truncated power `z_+^m = z^m` for `z ≥ 0` and `0` for `z < 0`. -/
def truncPow (m : ℕ) (z : ℝ) : ℝ := if 0 ≤ z then z ^ m else 0

/-- Remark 5.2, p. 22: `φ(t) = ∑_{j=0}^{m+1} (-1)^j/m! · C(m+1, j) · (t + (m+1)/2 - j)_+^m`
(the paper writes `k` for the degree `m` and chooses `k = 4`). -/
def splinePhi (m : ℕ) (t : ℝ) : ℝ :=
  ∑ j ∈ Finset.range (m + 2), (-1 : ℝ) ^ j / (m.factorial : ℝ) * ((m + 1).choose j : ℝ) *
    truncPow m (t + ((m : ℝ) + 1) / 2 - j)

/-- Remark 5.2, p. 22: the mesh width `h = 2R/(M + 5)`. -/
def splineStep (R : ℝ) (M : ℕ) : ℝ := 2 * R / ((M : ℝ) + 5)

/-- Remark 5.2, p. 22: the knots `t_i = (i + 2)h - R`. -/
def splineKnot (R : ℝ) (M i : ℕ) : ℝ := ((i : ℝ) + 2) * splineStep R M - R

/-- Remark 5.2, p. 22: the basis function `φ_{i,M}(t) = φ((t - t_i)/h)` of `R_M`, with
`k = 4`. -/
def splineBasis (R : ℝ) (M i : ℕ) (t : ℝ) : ℝ :=
  splinePhi 4 ((t - splineKnot R M i) / splineStep R M)

end Arxiv1901_08703
Source
Qu, Zhang and Zhang, A novel integral equation for scattering by locally rough surfaces and application to the inverse problem: the Neumann case, arXiv:1901.08703v1 (2019), Sections 1, 2 (pp. 2-14), Section 3.1 (p. 15), Section 4 (pp. 18-20), Remark 5.2 (p. 22)
Read-back

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

General conventions used throughout.

  • Points of the plane are x=(x1,x2)∈R2x=(x_1,x_2)\in\mathbb R^2x=(x1​,x2​)∈R2 with the Euclidean norm ∣x∣|x|∣x∣.
  • For a function u:R2→Cu:\mathbb R^2\to\mathbb Cu:R2→C, Du(x)[v]Du(x)[v]Du(x)[v] is the real Fréchet derivative of uuu at xxx applied to the vector vvv. It is defined to be 000 wherever uuu is not differentiable at xxx.
  • For h:R→Rh:\mathbb R\to\mathbb Rh:R→R, h′(t)h'(t)h′(t) is the derivative. It is defined to be 000 wherever hhh is not differentiable at ttt.
  • Every integral is a Lebesgue/Bochner integral and is defined to be 000 when the integrand is not integrable.
  • Every infinite sum ∑′\sum'∑′ is an unconditional sum and is defined to be 000 when the family is not summable.
  • log⁡\loglog means the real logarithm extended by log⁡r=log⁡∣r∣\log r=\log|r|logr=log∣r∣ for r≠0r\neq 0r=0 and log⁡0=0\log 0=0log0=0.
  • r=0\sqrt{r}=0r​=0 for r<0r<0r<0.
  • Division by 000 gives 000, and 0−1=00^{-1}=00−1=0.

R2. The plane R2\mathbb R^2R2 with its Euclidean norm. A point xxx has coordinates x1x_1x1​ and x2x_2x2​.

pt. For real a,ba,ba,b, pt(a,b)\mathrm{pt}(a,b)pt(a,b) is the point (a,b)∈R2(a,b)\in\mathbb R^2(a,b)∈R2.

dot. For x,y∈R2x,y\in\mathbb R^2x,y∈R2, x⋅y=x1y1+x2y2x\cdot y = x_1y_1+x_2y_2x⋅y=x1​y1​+x2​y2​.

refl. For x∈R2x\in\mathbb R^2x∈R2, the reflection is xre=(x1,−x2)x^{re}=(x_1,-x_2)xre=(x1​,−x2​).

besselJNat. For n∈Nn\in\mathbb Nn∈N and every real rrr (including r≤0r\le 0r≤0),

Jn(r)=∑m=0∞(−1)mm! (m+n)!(r2)2m+n.J_n(r)=\sum_{m=0}^{\infty}\frac{(-1)^m}{m!\,(m+n)!}\Big(\frac r2\Big)^{2m+n}.Jn​(r)=m=0∑∞​m!(m+n)!(−1)m​(2r​)2m+n.

This series converges absolutely for every real rrr.

besselJ. For n∈Zn\in\mathbb Zn∈Z and real rrr:

  • if n≥0n\ge 0n≥0, it is Jn(r)J_n(r)Jn​(r) as in besselJNat;
  • if n<0n<0n<0, it is (−1)∣n∣J∣n∣(r)(-1)^{|n|}J_{|n|}(r)(−1)∣n∣J∣n∣​(r).

besselY0. For every real rrr,

Y0(r)=2π(log⁡r2+γ)J0(r)+2π∑m=1∞(−1)m+1Hm(m!)2(r2)2m.Y_0(r)=\frac 2\pi\Big(\log\frac r2+\gamma\Big)J_0(r)+\frac2\pi\sum_{m=1}^{\infty}\frac{(-1)^{m+1}H_m}{(m!)^2}\Big(\frac r2\Big)^{2m}.Y0​(r)=π2​(log2r​+γ)J0​(r)+π2​m=1∑∞​(m!)2(−1)m+1Hm​​(2r​)2m.

Here:

  • γ\gammaγ is the Euler–Mascheroni constant;
  • Hm=1+12+⋯+1mH_m=1+\tfrac12+\dots+\tfrac1mHm​=1+21​+⋯+m1​ is the mmm-th harmonic number.

Edge cases from the logarithm convention:

  • for r<0r<0r<0 the logarithm is log⁡(∣r∣/2)\log(|r|/2)log(∣r∣/2);
  • at r=0r=0r=0 the logarithm is taken to be 000, so Y0(0)=2γ/πY_0(0)=2\gamma/\piY0​(0)=2γ/π, a finite value.

hankel01. For every real rrr, H0(1)(r)=J0(r)+i Y0(r)H_0^{(1)}(r)=J_0(r)+i\,Y_0(r)H0(1)​(r)=J0​(r)+iY0​(r), using the definitions above. This includes r≤0r\le 0r≤0.

Phi. For real kkk and x,y∈R2x,y\in\mathbb R^2x,y∈R2,

Φk(x,y)=i4 H0(1)(k∣x−y∣).\Phi_k(x,y)=\frac i4\,H_0^{(1)}\big(k|x-y|\big).Φk​(x,y)=4i​H0(1)​(k∣x−y∣).

No sign condition is placed on kkk, and x=yx=yx=y is allowed. On the diagonal, Φk(x,x)=i4(1+2iγπ)\Phi_k(x,x)=\tfrac i4\big(1+\tfrac{2i\gamma}{\pi}\big)Φk​(x,x)=4i​(1+π2iγ​), a finite value. If k=0k=0k=0, then Φ0\Phi_0Φ0​ is this same constant for all x,yx,yx,y.

dPhi. For real kkk and x,ν,y∈R2x,\nu,y\in\mathbb R^2x,ν,y∈R2, this is the directional derivative in the first variable:

∂Φk(x,ν,y)=DwΦk(w,y)∣w=x[ν].\partial\Phi_k(x,\nu,y)=D_w\Phi_k(w,y)\big|_{w=x}[\nu].∂Φk​(x,ν,y)=Dw​Φk​(w,y)​w=x​[ν].

It is the real Fréchet derivative at xxx of w↦Φk(w,y)w\mapsto\Phi_k(w,y)w↦Φk​(w,y), applied to ν\nuν. Two points to note:

  • ν\nuν is any vector; it is not required to be a unit vector.
  • The value is 000 wherever w↦Φk(w,y)w\mapsto\Phi_k(w,y)w↦Φk​(w,y) is not differentiable at xxx. This includes x=yx=yx=y, where the logarithmic term is not differentiable.

IsLocalProfile. For h:R→Rh:\mathbb R\to\mathbb Rh:R→R, this holds exactly when both:

  • hhh is twice continuously differentiable on R\mathbb RR;
  • hhh has compact support, i.e. the closure of {h≠0}\{h\neq 0\}{h=0} is compact.

Dplus. For any h:R→Rh:\mathbb R\to\mathbb Rh:R→R, D+(h)={x∈R2:x2>h(x1)}D_+(h)=\{x\in\mathbb R^2: x_2>h(x_1)\}D+​(h)={x∈R2:x2​>h(x1​)}.

Dminus. For any h:R→Rh:\mathbb R\to\mathbb Rh:R→R, D−(h)={x:x2<h(x1)}D_-(h)=\{x: x_2<h(x_1)\}D−​(h)={x:x2​<h(x1​)}.

gPt. For hhh and t∈Rt\in\mathbb Rt∈R, the point is γh(t)=(t,h(t))∈R2\gamma_h(t)=(t,h(t))\in\mathbb R^2γh​(t)=(t,h(t))∈R2.

gSpeed. For hhh and ttt, σh(t)=1+h′(t)2\sigma_h(t)=\sqrt{1+h'(t)^2}σh​(t)=1+h′(t)2​. Where hhh is not differentiable, h′(t)=0h'(t)=0h′(t)=0 and so σh(t)=1\sigma_h(t)=1σh​(t)=1.

gNormal. For hhh and ttt,

νh(t)=11+h′(t)2(−h′(t), 1).\nu_h(t)=\frac{1}{\sqrt{1+h'(t)^2}}\big(-h'(t),\,1\big).νh​(t)=1+h′(t)2​1​(−h′(t),1).

This is a unit vector with positive second component.

IsLowerDir. For d∈R2d\in\mathbb R^2d∈R2, this holds exactly when ∣d∣=1|d|=1∣d∣=1 and d2<0d_2<0d2​<0.

upperCircle. S+1={x∈R2:∣x∣=1, x2>0}\mathbb S^1_+=\{x\in\mathbb R^2: |x|=1,\ x_2>0\}S+1​={x∈R2:∣x∣=1, x2​>0}.

uInc. For real kkk and d,x∈R2d,x\in\mathbb R^2d,x∈R2, ui(x;d)=eik d⋅xu^i(x;d)=e^{ik\,d\cdot x}ui(x;d)=eikd⋅x. No condition is placed on kkk or ddd.

uRefl. For real kkk and d,x∈R2d,x\in\mathbb R^2d,x∈R2, ur(x;d)=eik(d1x1−d2x2)u^r(x;d)=e^{ik(d_1x_1-d_2x_2)}ur(x;d)=eik(d1​x1​−d2​x2​). No condition is placed on kkk or ddd.

incData. For real kkk, d∈R2d\in\mathbb R^2d∈R2, hhh and ttt,

fk,d,h(t)=−D(ui(⋅;d)+ur(⋅;d))(t,h(t)) [νh(t)].f_{k,d,h}(t)=-D\big(u^i(\cdot;d)+u^r(\cdot;d)\big)(t,h(t))\,[\nu_h(t)].fk,d,h​(t)=−D(ui(⋅;d)+ur(⋅;d))(t,h(t))[νh​(t)].

This is minus the derivative of the sum of the two exponentials at (t,h(t))(t,h(t))(t,h(t)), in the direction νh(t)\nu_h(t)νh​(t) of gNormal.

gradDot. For u,v:R2→Cu,v:\mathbb R^2\to\mathbb Cu,v:R2→C and xxx,

∇u⋅∇v(x)=∂1u(x) ∂1v(x)+∂2u(x) ∂2v(x).\nabla u\cdot\nabla v(x)=\partial_1u(x)\,\partial_1v(x)+\partial_2u(x)\,\partial_2v(x).∇u⋅∇v(x)=∂1​u(x)∂1​v(x)+∂2​u(x)∂2​v(x).

Here ∂ju(x)=Du(x)[ej]\partial_ju(x)=Du(x)[e_j]∂j​u(x)=Du(x)[ej​] are the pointwise partial derivatives, taken as 000 where uuu is not differentiable. The product is bilinear; there is no complex conjugation.

gradSq. For u:R2→Cu:\mathbb R^2\to\mathbb Cu:R2→C and xxx, ∣∇u(x)∣2=∣∂1u(x)∣2+∣∂2u(x)∣2|\nabla u(x)|^2=|\partial_1u(x)|^2+|\partial_2u(x)|^2∣∇u(x)∣2=∣∂1​u(x)∣2+∣∂2​u(x)∣2. The partial derivatives are pointwise, taken as 000 where uuu is not differentiable.

IsH1Loc. For any set D⊆R2D\subseteq\mathbb R^2D⊆R2 and u:R2→Cu:\mathbb R^2\to\mathbb Cu:R2→C, this holds exactly when, for every real ρ\rhoρ, the function x↦∣u(x)∣2+∣∇u(x)∣2x\mapsto|u(x)|^2+|\nabla u(x)|^2x↦∣u(x)∣2+∣∇u(x)∣2 is Lebesgue integrable on D∩{∣x∣<ρ}D\cap\{|x|<\rho\}D∩{∣x∣<ρ}. Notes:

  • The gradient is the pointwise Fréchet gradient, 000 where uuu is not differentiable. It is not a weak gradient.
  • No openness of DDD and no differentiability of uuu is required.
  • For ρ≤0\rho\le 0ρ≤0 the region is empty, so the condition is trivial there.

h1Norm. For DDD and uuu,

∥u∥H1(D)=(∫D∣u∣2+∣∇u∣2 dx)1/2,\|u\|_{H^1(D)}=\Big(\int_D |u|^2+|\nabla u|^2\,dx\Big)^{1/2},∥u∥H1(D)​=(∫D​∣u∣2+∣∇u∣2dx)1/2,

with the pointwise gradient as in gradSq. If the integrand is not integrable on DDD, the integral is 000 and so the value is 000.

l2Gam. For hhh and f:R→Cf:\mathbb R\to\mathbb Cf:R→C,

∥f∥L2(Γ)=(∫R∣f(t)∣21+h′(t)2 dt)1/2.\|f\|_{L^2(\Gamma)}=\Big(\int_{\mathbb R}|f(t)|^2\sqrt{1+h'(t)^2}\,dt\Big)^{1/2}.∥f∥L2(Γ)​=(∫R​∣f(t)∣21+h′(t)2​dt)1/2.

The integral is over all of R\mathbb RR, and it is 000 if the integrand is not integrable.

IsTestFn. For φ:R2→C\varphi:\mathbb R^2\to\mathbb Cφ:R2→C, this holds exactly when both:

  • φ\varphiφ is infinitely differentiable (in the real sense);
  • φ\varphiφ has compact support.

IsHelmholtzOn. For any set D⊆R2D\subseteq\mathbb R^2D⊆R2, real kkk and u:R2→Cu:\mathbb R^2\to\mathbb Cu:R2→C, this holds exactly when both:

  • uuu is C2C^2C2 on DDD, in the sense of differentiability within DDD;
  • for every x∈Dx\in Dx∈D, Δu(x)+k2u(x)=0\Delta u(x)+k^2u(x)=0Δu(x)+k2u(x)=0.

Here Δu(x)=∂12u(x)+∂22u(x)\Delta u(x)=\partial_1^2u(x)+\partial_2^2u(x)Δu(x)=∂12​u(x)+∂22​u(x) is computed from the second Fréchet derivative of uuu on all of R2\mathbb R^2R2 at xxx. That second derivative is 000 where it does not exist. DDD is not required to be open.

IsRadiating. For real kkk, a set DDD and uuu, this holds exactly when: for every ε>0\varepsilon>0ε>0 there is a real ρ\rhoρ such that every x∈Dx\in Dx∈D with ∣x∣>ρ|x|>\rho∣x∣>ρ satisfies

∣∣x∣(Du(x)[x/∣x∣]−ik u(x))∣<ε.\Big|\sqrt{|x|}\Big(Du(x)\big[x/|x|\big]-ik\,u(x)\Big)\Big|<\varepsilon.​∣x∣​(Du(x)[x/∣x∣]−iku(x))​<ε.

Notes:

  • Du(x)Du(x)Du(x) is 000 where uuu is not differentiable.
  • If DDD is bounded, the condition holds trivially.

IsNeumannWeak. For real kkk, hhh, f:R→Cf:\mathbb R\to\mathbb Cf:R→C and uuu, this holds exactly when every complex test function φ\varphiφ on R2\mathbb R^2R2 satisfies

∫D+(h)(∇u⋅∇φ−k2u φ)dx=−∫Rf(t) φ(t,h(t))1+h′(t)2 dt.\int_{D_+(h)}\Big(\nabla u\cdot\nabla\varphi-k^2u\,\varphi\Big)dx=-\int_{\mathbb R}f(t)\,\varphi(t,h(t))\sqrt{1+h'(t)^2}\,dt.∫D+​(h)​(∇u⋅∇φ−k2uφ)dx=−∫R​f(t)φ(t,h(t))1+h′(t)2​dt.

Here φ\varphiφ ranges over all C∞C^\inftyC∞ functions with compact support, so its support may cross the curve {(t,h(t))}\{(t,h(t))\}{(t,h(t))}. Further notes:

  • ∇u⋅∇φ\nabla u\cdot\nabla\varphi∇u⋅∇φ is the bilinear gradDot, with pointwise derivatives.
  • There is no complex conjugation.
  • Either side is 000 if its integrand is not integrable.

IsNPSolution. For real kkk, any h:R→Rh:\mathbb R\to\mathbb Rh:R→R, fff and uuu, this is the conjunction of four conditions:

  1. IsHelmholtzOn holds on D+(h)D_+(h)D+​(h): uuu is C2C^2C2 there and Δu+k2u=0\Delta u+k^2u=0Δu+k2u=0 on D+(h)D_+(h)D+​(h).
  2. IsH1Loc holds on D+(h)D_+(h)D+​(h).
  3. IsRadiating holds with parameter kkk on D+(h)D_+(h)D+​(h).
  4. IsNeumannWeak holds with data fff.

No regularity or compact support is required of hhh, and no sign is required of kkk.

HasFarFieldOn. For real kkk, uuu, F:R2→CF:\mathbb R^2\to\mathbb CF:R2→C and A⊆R2A\subseteq\mathbb R^2A⊆R2, this holds exactly when there exist real CCC and ρ>0\rho>0ρ>0 such that every xxx with ∣x∣≥ρ|x|\ge\rho∣x∣≥ρ and x/∣x∣∈Ax/|x|\in Ax/∣x∣∈A satisfies

∣u(x)−eik∣x∣∣x∣F(x∣x∣)∣≤C∣x∣∣x∣.\Big|u(x)-\frac{e^{ik|x|}}{\sqrt{|x|}}F\Big(\frac x{|x|}\Big)\Big|\le\frac{C}{|x|\sqrt{|x|}}.​u(x)−∣x∣​eik∣x∣​F(∣x∣x​)​≤∣x∣∣x∣​C​.

Notes:

  • FFF matters only at points of AAA.
  • If AAA contains no unit vector (for example, if AAA is empty), the condition holds trivially.

IsDirichletEigenvalue. For any set D⊆R2D\subseteq\mathbb R^2D⊆R2 and real λ\lambdaλ, this holds exactly when there exists u:R2→Cu:\mathbb R^2\to\mathbb Cu:R2→C with all of the following:

  • uuu is C2C^2C2 on DDD;
  • uuu is continuous on the closure D‾\overline DD;
  • u=0u=0u=0 at every point of the topological boundary ∂D\partial D∂D;
  • Δu(x)+λu(x)=0\Delta u(x)+\lambda u(x)=0Δu(x)+λu(x)=0 for every x∈Dx\in Dx∈D;
  • u(x)≠0u(x)\neq0u(x)=0 for some x∈Dx\in Dx∈D.

DDD is not required to be open or bounded. No integrability or finite-energy condition is placed on uuu, and no sign condition on λ\lambdaλ. If ∂D\partial D∂D is empty (e.g. D=R2D=\mathbb R^2D=R2), the boundary condition is vacuous.

PerturbationInBall. For hhh and real RRR, this holds exactly when both:

  • R>0R>0R>0;
  • every ttt in the closed support {h≠0}‾\overline{\{h\neq0\}}{h=0}​ satisfies t2+h(t)2<R2t^2+h(t)^2<R^2t2+h(t)2<R2.

If h≡0h\equiv0h≡0, only R>0R>0R>0 is required.

DRminus. For hhh and RRR, DR−={x:x2<h(x1), ∣x∣<R}D_R^-=\{x: x_2<h(x_1),\ |x|<R\}DR−​={x:x2​<h(x1​), ∣x∣<R}.

cPt. For real RRR and θ\thetaθ, the point is (Rcos⁡θ,Rsin⁡θ)(R\cos\theta,R\sin\theta)(Rcosθ,Rsinθ).

cNormal. For real θ\thetaθ, the vector is (cos⁡θ,sin⁡θ)(\cos\theta,\sin\theta)(cosθ,sinθ).

xA. xA=(−R,0)x_A=(-R,0)xA​=(−R,0).

xB. xB=(R,0)x_B=(R,0)xB​=(R,0).

muG. For hhh and RRR, this is the measure on R\mathbb RR given by

dμG(t)=1(−R,R)(t)1+h′(t)2 dt.d\mu_{G}(t)=\mathbf 1_{(-R,R)}(t)\sqrt{1+h'(t)^2}\,dt.dμG​(t)=1(−R,R)​(t)1+h′(t)2​dt.

If R≤0R\le0R≤0, this is the zero measure.

muB. For RRR, this is the measure on R\mathbb RR given by

dμB(θ)=max⁡(R,0) 1(π,2π)(θ) dθ.d\mu_B(\theta)=\max(R,0)\,\mathbf 1_{(\pi,2\pi)}(\theta)\,d\theta.dμB​(θ)=max(R,0)1(π,2π)​(θ)dθ.

If R≤0R\le0R≤0, this is the zero measure.

auxNormal. For a curve z:R→R2z:\mathbb R\to\mathbb R^2z:R→R2 and real sss,

nz(s)=∣z′(s)∣−1(z2′(s),−z1′(s)).n_z(s)=|z'(s)|^{-1}\big(z_2'(s),-z_1'(s)\big).nz​(s)=∣z′(s)∣−1(z2′​(s),−z1′​(s)).

If z′(s)=0z'(s)=0z′(s)=0 (including where zzz is not differentiable), this is the zero vector.

AuxDomain. Given hhh and RRR, an auxiliary domain is data (D~,z)(\tilde D,z)(D~,z) with D~⊆R2\tilde D\subseteq\mathbb R^2D~⊆R2 and z:R→R2z:\mathbb R\to\mathbb R^2z:R→R2, satisfying all of the following:

  • D~\tilde DD~ is open and bounded;
  • zzz is 2π2\pi2π-periodic;
  • zzz is twice continuously differentiable;
  • z′(s)≠0z'(s)\neq0z′(s)=0 for every sss;
  • zzz is injective on [0,2π)[0,2\pi)[0,2π);
  • the topological boundary of D~\tilde DD~ equals the image of zzz;
  • D~‾⊆DR−\overline{\tilde D}\subseteq D_R^-D~⊆DR−​;
  • for every sss and all sufficiently small ε>0\varepsilon>0ε>0, both z(s)+ε nz(s)∉D~‾z(s)+\varepsilon\,n_z(s)\notin\overline{\tilde D}z(s)+εnz​(s)∈/D~ and z(s)−ε nz(s)∈D~z(s)-\varepsilon\,n_z(s)\in\tilde Dz(s)−εnz​(s)∈D~, with nzn_znz​ as in auxNormal.

No assumption is placed on hhh or RRR themselves.

Hm12. The Hilbert space ℓ2(Z;C)\ell^2(\mathbb Z;\mathbb C)ℓ2(Z;C) of square-summable complex sequences (bn)n∈Z(b_n)_{n\in\mathbb Z}(bn​)n∈Z​, with its ℓ2\ell^2ℓ2 norm.

hmhCoeff. For b∈ℓ2(Z)b\in\ell^2(\mathbb Z)b∈ℓ2(Z) and n∈Zn\in\mathbb Zn∈Z, an(b)=(1+n2)1/4 bna_n(b)=(1+n^2)^{1/4}\,b_nan​(b)=(1+n2)1/4bn​.

Xsp. The product space

X=L2(μG)×L2(μB)×ℓ2(Z).X=L^2(\mu_G)\times L^2(\mu_B)\times\ell^2(\mathbb Z).X=L2(μG​)×L2(μB​)×ℓ2(Z).

The first two factors are spaces of μG\mu_GμG​-a.e. and μB\mu_BμB​-a.e. equivalence classes of complex functions on R\mathbb RR. The norm is the maximum of the three component norms.

Ysp. The product space L2(μG)×L2(μB)L^2(\mu_G)\times L^2(\mu_B)L2(μG​)×L2(μB​), with the maximum of the two component norms.

bdryPair. For hhh, RRR, K:R2→CK:\mathbb R^2\to\mathbb CK:R2→C and φ1,φ2:R→C\varphi_1,\varphi_2:\mathbb R\to\mathbb Cφ1​,φ2​:R→C,

⟨K;φ1,φ2⟩=∫−RRK(t,h(t)) φ1(t)1+h′(t)2 dt+R∫π2πK(Rcos⁡θ,Rsin⁡θ) φ2(θ) dθ.\langle K;\varphi_1,\varphi_2\rangle=\int_{-R}^{R}K(t,h(t))\,\varphi_1(t)\sqrt{1+h'(t)^2}\,dt+R\int_\pi^{2\pi}K(R\cos\theta,R\sin\theta)\,\varphi_2(\theta)\,d\theta.⟨K;φ1​,φ2​⟩=∫−RR​K(t,h(t))φ1​(t)1+h′(t)2​dt+R∫π2π​K(Rcosθ,Rsinθ)φ2​(θ)dθ.

More precisely, the two terms are integrals against μG\mu_GμG​ and μB\mu_BμB​. Each term is separately 000 if its integrand is not integrable, and both measures vanish when R≤0R\le0R≤0.

auxPair. For zzz, KKK and a:Z→Ca:\mathbb Z\to\mathbb Ca:Z→C,

∑n∈Zan∫02πK(z(s)) eins ds.\sum_{n\in\mathbb Z}a_n\int_0^{2\pi}K(z(s))\,e^{ins}\,ds.n∈Z∑​an​∫02π​K(z(s))einsds.

Notes:

  • No factor ∣z′(s)∣|z'(s)|∣z′(s)∣ appears.
  • The sum is 000 if the family is not summable.
  • Each integral is 000 if its integrand is not integrable.

slPotB. For real kkk, hhh, RRR, φ1,φ2\varphi_1,\varphi_2φ1​,φ2​ and xxx, this is ⟨Φk(x,⋅);φ1,φ2⟩\langle \Phi_k(x,\cdot);\varphi_1,\varphi_2\rangle⟨Φk​(x,⋅);φ1​,φ2​⟩ in the sense of bdryPair:

∫−RRΦk(x,(t,h(t)))φ1(t)1+h′(t)2 dt+R∫π2πΦk(x,(Rcos⁡θ,Rsin⁡θ))φ2(θ) dθ.\int_{-R}^R\Phi_k\big(x,(t,h(t))\big)\varphi_1(t)\sqrt{1+h'(t)^2}\,dt+R\int_\pi^{2\pi}\Phi_k\big(x,(R\cos\theta,R\sin\theta)\big)\varphi_2(\theta)\,d\theta.∫−RR​Φk​(x,(t,h(t)))φ1​(t)1+h′(t)2​dt+R∫π2π​Φk​(x,(Rcosθ,Rsinθ))φ2​(θ)dθ.

slPot. This is slPotB plus the auxPair term:

slPotB(x)+∑n∈Zan∫02πΦk(x,z(s)) eins ds.\mathrm{slPotB}(x)+\sum_{n\in\mathbb Z}a_n\int_0^{2\pi}\Phi_k(x,z(s))\,e^{ins}\,ds.slPotB(x)+n∈Z∑​an​∫02π​Φk​(x,z(s))einsds.

gammaInf. For real kkk,

γk=eiπ/48πk.\gamma_k=\frac{e^{i\pi/4}}{\sqrt{8\pi k}}.γk​=8πk​eiπ/4​.

For k≤0k\le0k≤0, the square root is 000, so γk=0\gamma_k=0γk​=0.

ffPotB. For real kkk, hhh, RRR, φ1,φ2\varphi_1,\varphi_2φ1​,φ2​ and x^∈R2\hat x\in\mathbb R^2x^∈R2 (not required to be a unit vector),

γk ⟨e−ikx^⋅(⋅);φ1,φ2⟩,\gamma_k\,\langle e^{-ik\hat x\cdot(\cdot)};\varphi_1,\varphi_2\rangle,γk​⟨e−ikx^⋅(⋅);φ1​,φ2​⟩,

where ⟨⋅⟩\langle\cdot\rangle⟨⋅⟩ is bdryPair with kernel K(y)=e−ik x^⋅yK(y)=e^{-ik\,\hat x\cdot y}K(y)=e−ikx^⋅y.

ffPot. This is ffPotB plus an auxiliary-curve term:

ffPotB(x^)+γk∑n∈Zan∫02πe−ik x^⋅z(s)eins ds.\mathrm{ffPotB}(\hat x)+\gamma_k\sum_{n\in\mathbb Z}a_n\int_0^{2\pi}e^{-ik\,\hat x\cdot z(s)}e^{ins}\,ds.ffPotB(x^)+γk​n∈Z∑​an​∫02π​e−ikx^⋅z(s)einsds.

kerG. For real kkk, hhh, ttt and yyy, the kernel is ∂Φk((t,h(t)),νh(t),y)\partial\Phi_k\big((t,h(t)),\nu_h(t),y\big)∂Φk​((t,h(t)),νh​(t),y) as in dPhi. That is, the derivative of w↦Φk(w,y)w\mapsto\Phi_k(w,y)w↦Φk​(w,y) at (t,h(t))(t,h(t))(t,h(t)) in the direction νh(t)\nu_h(t)νh​(t). It is 000 if y=(t,h(t))y=(t,h(t))y=(t,h(t)).

kerB. For real kkk, RRR, θ\thetaθ and yyy, write p=(Rcos⁡θ,Rsin⁡θ)p=(R\cos\theta,R\sin\theta)p=(Rcosθ,Rsinθ) and c=(cos⁡θ,sin⁡θ)c=(\cos\theta,\sin\theta)c=(cosθ,sinθ). The kernel is

∂Φk(p,c,y)−∂Φk(pre,cre,y),\partial\Phi_k(p,c,y)-\partial\Phi_k\big(p^{re},c^{re},y\big),∂Φk​(p,c,y)−∂Φk​(pre,cre,y),

with pre=(Rcos⁡θ,−Rsin⁡θ)p^{re}=(R\cos\theta,-R\sin\theta)pre=(Rcosθ,−Rsinθ) and cre=(cos⁡θ,−sin⁡θ)c^{re}=(\cos\theta,-\sin\theta)cre=(cosθ,−sinθ).

kerT. For real kkk, ρ\rhoρ, curve zzz, sss and yyy, the kernel is

∂Φk(z(s),nz(s),y)+iρ Φk(z(s),y).\partial\Phi_k\big(z(s),n_z(s),y\big)+i\rho\,\Phi_k(z(s),y).∂Φk​(z(s),nz​(s),y)+iρΦk​(z(s),y).

opB1. For real kkk, hhh, RRR, φ1,φ2\varphi_1,\varphi_2φ1​,φ2​ and ttt, this is −2-2−2 times bdryPair with the kerG kernel at parameter ttt:

−2[∫−RRkerGt((τ,h(τ)))φ1(τ)1+h′(τ)2 dτ+R∫π2πkerGt((Rcos⁡θ,Rsin⁡θ))φ2(θ) dθ].-2\Big[\int_{-R}^R\mathrm{kerG}_t\big((\tau,h(\tau))\big)\varphi_1(\tau)\sqrt{1+h'(\tau)^2}\,d\tau+R\int_\pi^{2\pi}\mathrm{kerG}_t\big((R\cos\theta,R\sin\theta)\big)\varphi_2(\theta)\,d\theta\Big].−2[∫−RR​kerGt​((τ,h(τ)))φ1​(τ)1+h′(τ)2​dτ+R∫π2π​kerGt​((Rcosθ,Rsinθ))φ2​(θ)dθ].

Here kerGt\mathrm{kerG}_tkerGt​ is the kernel of kerG with kkk and hhh fixed.

opB2. This is the same as opB1, with the kernel kerB at parameter θ\thetaθ in place of kerG at parameter ttt:

−2 ⟨kerBθ;φ1,φ2⟩.-2\,\langle\mathrm{kerB}_\theta;\varphi_1,\varphi_2\rangle.−2⟨kerBθ​;φ1​,φ2​⟩.

opA1. This is opB1 at ttt plus an auxiliary-curve term:

opB1(t)−2∑nan∫02πkerGt(z(s)) eins ds.\mathrm{opB1}(t)-2\sum_{n}a_n\int_0^{2\pi}\mathrm{kerG}_t(z(s))\,e^{ins}\,ds.opB1(t)−2n∑​an​∫02π​kerGt​(z(s))einsds.

opA2. This is opB2 at θ\thetaθ plus an auxiliary-curve term:

opB2(θ)−2∑nan∫02πkerBθ(z(s)) eins ds.\mathrm{opB2}(\theta)-2\sum_n a_n\int_0^{2\pi}\mathrm{kerB}_\theta(z(s))\,e^{ins}\,ds.opB2(θ)−2n∑​an​∫02π​kerBθ​(z(s))einsds.

fourierWeight. For zzz, m∈Zm\in\mathbb Zm∈Z and sss,

wm(s)=e−ims ∣z′(s)∣2π.w_m(s)=\frac{e^{-ims}\,|z'(s)|}{2\pi}.wm​(s)=2πe−ims∣z′(s)∣​.

opA3. For real kkk, ρ\rhoρ, hhh, RRR, curve zzz, φ1,φ2\varphi_1,\varphi_2φ1​,φ2​, a:Z→Ca:\mathbb Z\to\mathbb Ca:Z→C and m∈Zm\in\mathbb Zm∈Z,

−2[∫02πwm(s) ⟨kerTs;φ1,φ2⟩ ds+∑n∈Zan∫02πwm(s)∫02πkerTs(z(t)) eint dt ds].-2\Bigg[\int_0^{2\pi}w_m(s)\,\big\langle \mathrm{kerT}_s;\varphi_1,\varphi_2\big\rangle\,ds+\sum_{n\in\mathbb Z}a_n\int_0^{2\pi}w_m(s)\int_0^{2\pi}\mathrm{kerT}_s(z(t))\,e^{int}\,dt\,ds\Bigg].−2[∫02π​wm​(s)⟨kerTs​;φ1​,φ2​⟩ds+n∈Z∑​an​∫02π​wm​(s)∫02π​kerTs​(z(t))eintdtds].

Notes:

  • kerTs\mathrm{kerT}_skerTs​ is the kernel y↦∂Φk(z(s),nz(s),y)+iρΦk(z(s),y)y\mapsto\partial\Phi_k(z(s),n_z(s),y)+i\rho\Phi_k(z(s),y)y↦∂Φk​(z(s),nz​(s),y)+iρΦk​(z(s),y) of kerT.
  • ⟨⋅⟩\langle\cdot\rangle⟨⋅⟩ is bdryPair.
  • On the diagonal t=st=st=s, the inner integrand uses the finite conventional values described under Phi and dPhi.
  • Each integral and the sum follow the junk-value conventions stated at the top.

gData. For kkk, ddd, hhh and ttt, g(t)=−2fk,d,h(t)g(t)=-2f_{k,d,h}(t)g(t)=−2fk,d,h​(t), which equals

2 D(ui+ur)(t,h(t))[νh(t)].2\,D\big(u^i+u^r\big)(t,h(t))[\nu_h(t)].2D(ui+ur)(t,h(t))[νh​(t)].

IsBIESolution. For real kkk, ρ\rhoρ, hhh, RRR, an auxiliary domain (D~,z)(\tilde D,z)(D~,z), d∈R2d\in\mathbb R^2d∈R2 and (φ1,φ2,b)∈X(\varphi_1,\varphi_2,b)\in X(φ1​,φ2​,b)∈X, this holds exactly when all three of the following hold, with a=(an)=((1+n2)1/4bn)na=(a_n)=\big((1+n^2)^{1/4}b_n\big)_na=(an​)=((1+n2)1/4bn​)n​ and φ1,φ2\varphi_1,\varphi_2φ1​,φ2​ evaluated through chosen representatives:

  1. For μG\mu_GμG​-almost every ttt (equivalently, a.e. t∈(−R,R)t\in(-R,R)t∈(−R,R) when R>0R>0R>0):
φ1(t)+opA1(t)=g(t),\varphi_1(t)+\mathrm{opA1}(t)=g(t),φ1​(t)+opA1(t)=g(t),

with ggg as in gData for the given k,d,hk,d,hk,d,h. 2. For μB\mu_BμB​-almost every θ\thetaθ:

φ2(θ)+opA2(θ)=0.\varphi_2(\theta)+\mathrm{opA2}(\theta)=0.φ2​(θ)+opA2(θ)=0.
  1. For every m∈Zm\in\mathbb Zm∈Z:
(1+m2)1/4bm+opA3(m)=0.(1+m^2)^{1/4}b_m+\mathrm{opA3}(m)=0.(1+m2)1/4bm​+opA3(m)=0.

Here opA3\mathrm{opA3}opA3 is taken with the given ρ\rhoρ. Only the curve zzz of the auxiliary domain enters the equations; D~\tilde DD~ itself does not. No conditions are placed on kkk, ρ\rhoρ, hhh or ddd.

IsBSolution. For real kkk, hhh, RRR, (φ1,φ2)∈L2(μG)×L2(μB)(\varphi_1,\varphi_2)\in L^2(\mu_G)\times L^2(\mu_B)(φ1​,φ2​)∈L2(μG​)×L2(μB​) and g1,g2:R→Cg_1,g_2:\mathbb R\to\mathbb Cg1​,g2​:R→C, this holds exactly when both:

  • φ1(t)+opB1(t)=g1(t)\varphi_1(t)+\mathrm{opB1}(t)=g_1(t)φ1​(t)+opB1(t)=g1​(t) for μG\mu_GμG​-a.e. ttt;
  • φ2(θ)+opB2(θ)=g2(θ)\varphi_2(\theta)+\mathrm{opB2}(\theta)=g_2(\theta)φ2​(θ)+opB2(θ)=g2​(θ) for μB\mu_BμB​-a.e. θ\thetaθ.

NearSameCorner. For real RRR, rrr and points x,yx,yx,y, this holds exactly when one of the following holds:

  • ∣x−xA∣<r|x-x_A|<r∣x−xA​∣<r and ∣y−xA∣<r|y-x_A|<r∣y−xA​∣<r; or
  • ∣x−xB∣<r|x-x_B|<r∣x−xB​∣<r and ∣y−xB∣<r|y-x_B|<r∣y−xB​∣<r.

Here xA=(−R,0)x_A=(-R,0)xA​=(−R,0) and xB=(R,0)x_B=(R,0)xB​=(R,0). If r≤0r\le0r≤0, it never holds.

opBstar1. This is the same as opB1, except that the kernel at yyy is replaced by:

  • kerGt(y)\mathrm{kerG}_t(y)kerGt​(y) if (t,h(t))(t,h(t))(t,h(t)) and yyy are near the same corner (in the sense of NearSameCorner with radius rrr);
  • 000 otherwise.

opBstar2. This is the same as opB2, except that the kernel at yyy is replaced by:

  • kerBθ(y)\mathrm{kerB}_\theta(y)kerBθ​(y) if (Rcos⁡θ,Rsin⁡θ)(R\cos\theta,R\sin\theta)(Rcosθ,Rsinθ) and yyy are near the same corner with radius rrr;
  • 000 otherwise.

upperExt. For real RRR, the set is {x:x2>0, ∣x∣>R}\{x: x_2>0,\ |x|>R\}{x:x2​>0, ∣x∣>R}.

IsFlatNeumannWeak. For real kkk, RRR and uuu, this holds exactly when every complex test function φ\varphiφ whose closed support lies in {∣x∣>R}\{|x|>R\}{∣x∣>R} satisfies

∫{x2>0, ∣x∣>R}(∇u⋅∇φ−k2u φ)dx=0.\int_{\{x_2>0,\ |x|>R\}}\Big(\nabla u\cdot\nabla\varphi-k^2u\,\varphi\Big)dx=0.∫{x2​>0, ∣x∣>R}​(∇u⋅∇φ−k2uφ)dx=0.

The gradient product is the bilinear gradDot with pointwise derivatives. The integral is 000 if the integrand is not integrable.

pointData. For real kkk, hhh, y∈R2y\in\mathbb R^2y∈R2 and ttt,

−D(Φk(⋅,y)+Φk(⋅,yre))(t,h(t)) [νh(t)].-D\big(\Phi_k(\cdot,y)+\Phi_k(\cdot,y^{re})\big)(t,h(t))\,[\nu_h(t)].−D(Φk​(⋅,y)+Φk​(⋅,yre))(t,h(t))[νh​(t)].

This is 000 if the sum is not differentiable at (t,h(t))(t,h(t))(t,h(t)), for example when (t,h(t))(t,h(t))(t,h(t)) equals yyy or yrey^{re}yre.

truncPow. For m∈Nm\in\mathbb Nm∈N and real zzz:

  • z+m=zmz_+^m=z^mz+m​=zm if z≥0z\ge0z≥0;
  • z+m=0z_+^m=0z+m​=0 if z<0z<0z<0.

In particular, 0+0=10_+^0=10+0​=1.

splinePhi. For m∈Nm\in\mathbb Nm∈N and real ttt,

ϕm(t)=∑j=0m+1(−1)jm!(m+1j)(t+m+12−j)+m.\phi_m(t)=\sum_{j=0}^{m+1}\frac{(-1)^j}{m!}\binom{m+1}{j}\Big(t+\frac{m+1}2-j\Big)_+^m.ϕm​(t)=j=0∑m+1​m!(−1)j​(jm+1​)(t+2m+1​−j)+m​.

splineStep. For real RRR and M∈NM\in\mathbb NM∈N, the mesh width is

δR,M=2RM+5.\delta_{R,M}=\frac{2R}{M+5}.δR,M​=M+52R​.

It is called hhh in the source, but it is unrelated to the profile hhh. It is 000 if R=0R=0R=0 and negative if R<0R<0R<0.

splineKnot. For RRR, MMM and i∈Ni\in\mathbb Ni∈N, the knot is ti=(i+2) δR,M−Rt_i=(i+2)\,\delta_{R,M}-Rti​=(i+2)δR,M​−R.

splineBasis. For RRR, MMM, iii and real ttt,

ϕi,M(t)=ϕ4(t−tiδR,M),\phi_{i,M}(t)=\phi_4\Big(\frac{t-t_i}{\delta_{R,M}}\Big),ϕi,M​(t)=ϕ4​(δR,M​t−ti​​),

with ϕ4\phi_4ϕ4​ the degree-4 case of splinePhi. If R=0R=0R=0, the division gives 000, so ϕi,M(t)=ϕ4(0)\phi_{i,M}(t)=\phi_4(0)ϕi,M​(t)=ϕ4​(0) for every ttt.

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

    Confirmed by the moderator at approval.

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