Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Fourier-based metric Lp,α\mathcal L_{p,\alpha}Lp,α​, DFT matrix and weight Wα\mathrm W_\alphaWα​ of ω\omegaω-FWI

Definition
Arxiv2205_09234_Basic

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

discrete-fourier-transformfourier-transformfull-waveform-inversionmisfit-functionweighted-l2-norm

Objects of Section 2.1 of Izzatullah and Alkhalifah (2022).

  1. Fourier transform. For a waveform d:R→Rd:\mathbb{R}\to\mathbb{R}d:R→R, d^(ω)=∫Rd(t) e−iωt dt\hat d(\omega)=\int_{\mathbb{R}}d(t)\,e^{-i\omega t}\,dtd^(ω)=∫R​d(t)e−iωtdt, where ω\omegaω is the angular frequency.
  2. Fourier-based metric (eq. 1). For real p,αp,\alphap,α and a modelled trace dmd_mdm​ and an observed trace dod_odo​,
Lp,α(dm,do)=(∫R∣ω∣α ∣d^m(ω)−d^o(ω)∣p dω)1/p.\mathcal L_{p,\alpha}(d_m,d_o)=\Big(\int_{\mathbb{R}}|\omega|^\alpha\,|\hat d_m(\omega)-\hat d_o(\omega)|^p\,d\omega\Big)^{1/p}.Lp,α​(dm​,do​)=(∫R​∣ω∣α∣d^m​(ω)−d^o​(ω)∣pdω)1/p.
  1. DFT matrix. For N=NtN=N_tN=Nt​ samples, Ω∈CN×N\Omega\in\mathbb{C}^{N\times N}Ω∈CN×N, Ωkj=e−2πikj/N\Omega_{kj}=e^{-2\pi ikj/N}Ωkj​=e−2πikj/N (unnormalised), and d^=Ωd\hat{\mathbf d}=\Omega\mathbf dd^=Ωd for a sampled trace d∈RN\mathbf d\in\mathbb{R}^Nd∈RN.
  2. Sample frequencies. For time step Δt\Delta tΔt, ωk=2πk/(NΔt)\omega_k=2\pi k/(N\Delta t)ωk​=2πk/(NΔt) if 2k<N2k<N2k<N and ωk=2π(k−N)/(NΔt)\omega_k=2\pi(k-N)/(N\Delta t)ωk​=2π(k−N)/(NΔt) otherwise, k=0,…,N−1k=0,\dots,N-1k=0,…,N−1.
  3. Weight matrix. Wα=diag⁡(w)\mathrm W_\alpha=\operatorname{diag}(w)Wα​=diag(w), where wk≥0w_k\ge0wk​≥0 for all kkk and wk=∣ωk∣αw_k=|\omega_k|^\alphawk​=∣ωk​∣α whenever ωk≠0\omega_k\ne0ωk​=0 or α≥0\alpha\ge0α≥0 (with 00=10^0=100=1). For α<0\alpha<0α<0 the zero-frequency entry w0w_0w0​ is left as an arbitrary nonnegative number, because the paper does not say how the infinite value ∣0∣α|0|^\alpha∣0∣α is replaced.
  4. Discrete metric. Lp,α(dm,do)=(∑kwk∣d^m,k−d^o,k∣p)1/p\mathcal L_{p,\alpha}(\mathbf d_m,\mathbf d_o)=\big(\sum_k w_k|\hat{\mathbf d}_{m,k}-\hat{\mathbf d}_{o,k}|^p\big)^{1/p}Lp,α​(dm​,do​)=(∑k​wk​∣d^m,k​−d^o,k​∣p)1/p, the integral of eq. (1) replaced by the sum over the DFT frequencies, as in eq. (2).

Formalization Note The paper's display integrates over RNt\mathbb{R}^{N_t}RNt​; it is read as an integral over the time axis R\mathbb{R}R. The DFT normalisation, the quadrature factor between the integral of eq. (1) and the sum of eq. (2), and the zero-frequency weight for α<0\alpha<0α<0 are not stated in the paper; the choices above are recorded in the mission description.

Definition code
import Mathlib

/-!
Izzatullah and Alkhalifah, *ω-FWI: Robust full-waveform inversion with Fourier-based metric*,
arXiv:2205.09234v1 (2022): the angular-frequency Fourier transform and the Fourier-based metric
`L_{p,α}` of Section 2.1 (eq. (1)), and its discrete form on sampled traces with the DFT matrix
`Ω`, the sample frequencies `ω` and the weight matrix `W_α = diag(|ω|^α)` (eq. (2)).
-/

open MeasureTheory

noncomputable section

namespace Arxiv2205_09234

/-- Section 2.1, display before eq. (1), p. 2: the Fourier transform of a waveform `d(t)` in the
angular frequency `ω`, `d̂(ω) = ∫ d(t) exp(-i ω t) dt` (the time axis is the real line). -/
def angFourier (d : ℝ → ℝ) (ω : ℝ) : ℂ :=
  ∫ t : ℝ, (d t : ℂ) * Complex.exp (-(Complex.I * ((ω * t : ℝ) : ℂ)))

/-- Section 2.1, eq. (1), p. 2: the Fourier-based metric
`L_{p,α}(d_m, d_o) = (∫ |ω|^α |d̂_m(ω) - d̂_o(ω)|^p dω)^{1/p}` of a modelled trace `d_m` and an
observed trace `d_o`. -/
def fourierMetric (p α : ℝ) (dm dobs : ℝ → ℝ) : ℝ :=
  (∫ ω : ℝ, |ω| ^ α * ‖angFourier dm ω - angFourier dobs ω‖ ^ p) ^ (1 / p)

/-- Section 2.1, eq. (2), p. 2: the Discrete Fourier Transform matrix `Ω` of size `N = N_t`
(unnormalised), `Ω_{kj} = exp(-2π i k j / N)`. -/
def dftMat (N : ℕ) : Matrix (Fin N) (Fin N) ℂ :=
  fun k j => Complex.exp (-(2 * Real.pi * Complex.I * (k : ℂ) * (j : ℂ) / (N : ℂ)))

/-- Section 2.1, eq. (2), p. 2: the DFT `d̂ = Ω d` of a sampled real trace `d ∈ ℝ^{N_t}`. -/
def dft (N : ℕ) (d : Fin N → ℝ) : Fin N → ℂ :=
  (dftMat N).mulVec (fun j => (d j : ℂ))

/-- Section 2.1, eq. (2), p. 2: the vector `ω` of the waveform's sample (angular) frequencies for
`N` samples at time step `dt`: `ω_k = 2πk/(N dt)` if `2k < N` and `ω_k = 2π(k - N)/(N dt)`
otherwise (the frequency ordering of the DFT). -/
def sampleFreq (N : ℕ) (dt : ℝ) (k : Fin N) : ℝ :=
  2 * Real.pi * (if 2 * (k : ℕ) < N then (k : ℝ) else (k : ℝ) - N) / (N * dt)

/-- Section 2.1, eq. (2), p. 2: `w` is the diagonal of `W_α = diag(|ω|^α)`. Every entry is
nonnegative and equals `|ω_k|^α` wherever this is a real number. The paper does not say what
`W_α` contains at the zero frequency when `α < 0` (where `|0|^α` is infinite), so that entry is
any nonnegative real number. -/
def IsFreqWeight (N : ℕ) (dt α : ℝ) (w : Fin N → ℝ) : Prop :=
  (∀ k, 0 ≤ w k) ∧ ∀ k, (sampleFreq N dt k ≠ 0 ∨ 0 ≤ α) → w k = |sampleFreq N dt k| ^ α

/-- Section 2.1, eq. (2), p. 2: the weight matrix `W_α = diag(w)` as a complex matrix. -/
def weightMat {N : ℕ} (w : Fin N → ℝ) : Matrix (Fin N) (Fin N) ℂ :=
  Matrix.diagonal (fun k => (w k : ℂ))

/-- Section 2.1, eqs. (1)-(2), p. 2: the Fourier-based metric of eq. (1) on sampled traces, with the
integral over `ω` replaced by the sum over the DFT frequencies as in eq. (2):
`L_{p,α}(d_m, d_o) = (∑_k w_k |d̂_{m,k} - d̂_{o,k}|^p)^{1/p}`, where `w` is the diagonal of `W_α`. -/
def discreteMetric (N : ℕ) (p : ℝ) (w : Fin N → ℝ) (dm dobs : Fin N → ℝ) : ℝ :=
  (∑ k, w k * ‖dft N dm k - dft N dobs k‖ ^ p) ^ (1 / p)

end Arxiv2205_09234
Source
Izzatullah and Alkhalifah, omega-FWI: Robust full-waveform inversion with Fourier-based metric, arXiv:2205.09234v1 (2022), Section 2.1, eqs. (1)-(2), PDF p. 2
Read-back

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

Conventions used throughout.

  • Powers xyx^{y}xy of real numbers with real exponent follow these rules:
    • for x>0x>0x>0, xyx^{y}xy is the usual power;
    • 00=10^{0}=100=1, and 0y=00^{y}=00y=0 for every y≠0y\neq 0y=0, including negative yyy;
    • for x<0x<0x<0, xy=∣x∣ycos⁡(πy)x^{y}=|x|^{y}\cos(\pi y)xy=∣x∣ycos(πy).
  • Division by zero returns 000. In particular, when p=0p=0p=0 the exponent 1/p1/p1/p equals 000.
  • An integral over R\mathbb{R}R is the Lebesgue integral. If the integrand is not integrable, the integral is defined to be 000; this is a convention, not an error.
  • ∣z∣|z|∣z∣ denotes the modulus of a complex number zzz.

Angular-frequency Fourier transform. Take any function d:R→Rd:\mathbb{R}\to\mathbb{R}d:R→R and any real ω\omegaω. Define

d^(ω)=∫Rd(t) e−iωt dt∈C.\hat d(\omega)=\int_{\mathbb{R}} d(t)\,e^{-i\omega t}\,dt\in\mathbb{C}.d^(ω)=∫R​d(t)e−iωtdt∈C.

No hypothesis is placed on ddd. Since ∣e−iωt∣=1|e^{-i\omega t}|=1∣e−iωt∣=1, the integrand is integrable exactly when ddd is Lebesgue integrable. If ddd is not integrable, then d^(ω)=0\hat d(\omega)=0d^(ω)=0 for every ω\omegaω.

Continuous Fourier-based metric. Take arbitrary real numbers ppp and α\alphaα, with no sign or size restrictions, and arbitrary functions dm,do:R→Rd_m,d_o:\mathbb{R}\to\mathbb{R}dm​,do​:R→R. Define

Lp,α(dm,do)=(∫R∣ω∣α ∣d^m(ω)−d^o(ω)∣p dω)1/p,L_{p,\alpha}(d_m,d_o)=\left(\int_{\mathbb{R}} |\omega|^{\alpha}\,\bigl|\hat d_m(\omega)-\hat d_o(\omega)\bigr|^{p}\,d\omega\right)^{1/p},Lp,α​(dm​,do​)=(∫R​∣ω∣α​d^m​(ω)−d^o​(ω)​pdω)1/p,

with d^\hat dd^ as above. Edge cases:

  • At ω=0\omega=0ω=0 the weight ∣0∣α|0|^{\alpha}∣0∣α is 111 if α=0\alpha=0α=0 and 000 otherwise. This is a single point, so it does not affect the integral.
  • Where d^m(ω)=d^o(ω)\hat d_m(\omega)=\hat d_o(\omega)d^m​(ω)=d^o​(ω), the factor ∣0∣p|0|^{p}∣0∣p is 111 if p=0p=0p=0 and 000 otherwise.
  • If the integrand is not integrable, the inner integral is 000. The value is then 000 when p≠0p\neq 0p=0.
  • If p=0p=0p=0, the outer exponent is 000, so L0,α(dm,do)=1L_{0,\alpha}(d_m,d_o)=1L0,α​(dm​,do​)=1 for all inputs.

DFT matrix. For a natural number NNN, ΩN\Omega_NΩN​ is the N×NN\times NN×N complex matrix with rows and columns indexed by k,j∈{0,…,N−1}k,j\in\{0,\dots,N-1\}k,j∈{0,…,N−1} and entries

(ΩN)kj=exp⁡ ⁣(−2πi k jN).(\Omega_N)_{kj}=\exp\!\left(-\frac{2\pi i\,k\,j}{N}\right).(ΩN​)kj​=exp(−N2πikj​).

There is no normalising factor. When N=0N=0N=0 the matrix is empty.

DFT of a sampled trace. For a real vector d=(d0,…,dN−1)d=(d_0,\dots,d_{N-1})d=(d0​,…,dN−1​), its DFT is the complex vector d^=ΩNd\hat d=\Omega_N dd^=ΩN​d, with ddd regarded as a complex vector. Componentwise:

d^k=∑j=0N−1dj e−2πikj/N,k=0,…,N−1.\hat d_k=\sum_{j=0}^{N-1} d_j\,e^{-2\pi i kj/N},\qquad k=0,\dots,N-1.d^k​=j=0∑N−1​dj​e−2πikj/N,k=0,…,N−1.

Sample frequencies. For a natural number NNN, any real dtdtdt and an index k∈{0,…,N−1}k\in\{0,\dots,N-1\}k∈{0,…,N−1}:

ωk=2π mkN dt,mk={k,2k<N,k−N,2k≥N,\omega_k=\frac{2\pi\,m_k}{N\,dt},\qquad m_k=\begin{cases}k,& 2k<N,\\ k-N,& 2k\ge N,\end{cases}ωk​=Ndt2πmk​​,mk​={k,k−N,​2k<N,2k≥N,​

with k−Nk-Nk−N computed as a real number, so it can be negative. No condition is placed on dtdtdt:

  • it may be negative;
  • if dt=0dt=0dt=0, the denominator is 000, so every ωk=0\omega_k=0ωk​=0.

Whenever N≥1N\ge 1N≥1, the first frequency is ω0=0\omega_0=0ω0​=0.

Admissible frequency weight. Given NNN, real dtdtdt and real α\alphaα, a real vector w=(w0,…,wN−1)w=(w_0,\dots,w_{N-1})w=(w0​,…,wN−1​) is called a frequency weight if both of the following hold:

  1. wk≥0w_k\ge 0wk​≥0 for every kkk;
  2. for every kkk with ωk≠0\omega_k\neq 0ωk​=0 or α≥0\alpha\ge 0α≥0, we have wk=∣ωk∣αw_k=|\omega_k|^{\alpha}wk​=∣ωk​∣α.

The consequences of these conditions are:

  • For an index with ωk=0\omega_k=0ωk​=0 and α<0\alpha<0α<0, the only constraint is wk≥0w_k\ge 0wk​≥0, so wkw_kwk​ can be any nonnegative real.
  • If ωk=0\omega_k=0ωk​=0 and α=0\alpha=0α=0, then wk=1w_k=1wk​=1.
  • If ωk=0\omega_k=0ωk​=0 and α>0\alpha>0α>0, then wk=0w_k=0wk​=0.
  • If dt=0dt=0dt=0 and α<0\alpha<0α<0, every entry is an arbitrary nonnegative real.
  • The condition can always be satisfied.

Weight matrix. For any real vector www of length NNN, WWW is the N×NN\times NN×N complex diagonal matrix with diagonal entries w0,…,wN−1w_0,\dots,w_{N-1}w0​,…,wN−1​ and zeros elsewhere. No condition on www is imposed.

Discrete Fourier-based metric. Take a natural number NNN, any real ppp, an arbitrary real vector www of length NNN, and real vectors dm,dod_m,d_odm​,do​ of length NNN. Define

Lpdisc(dm,do)=(∑k=0N−1wk ∣d^m,k−d^o,k∣p)1/p,L^{\mathrm{disc}}_{p}(d_m,d_o)=\left(\sum_{k=0}^{N-1} w_k\,\bigl|\hat d_{m,k}-\hat d_{o,k}\bigr|^{p}\right)^{1/p},Lpdisc​(dm​,do​)=(k=0∑N−1​wk​​d^m,k​−d^o,k​​p)1/p,

where d^m=ΩNdm\hat d_m=\Omega_N d_md^m​=ΩN​dm​ and d^o=ΩNdo\hat d_o=\Omega_N d_od^o​=ΩN​do​ are the unnormalised DFTs above. Points to note:

  • No link to α\alphaα, dtdtdt or the frequencies. The definition does not require www to be a frequency weight in the sense above, and it does not involve α\alphaα, dtdtdt or the frequencies ωk\omega_kωk​ at all.
  • Neither WWW nor any frequency spacing is used. The weight enters through www directly rather than through the matrix WWW, and there is no factor for the frequency spacing.
  • Negative weights. Entries of www may be negative. The sum may then be negative, and the power 1/p1/p1/p follows the negative-base convention stated at the start.
  • Edge cases:
    • p=0p=0p=0 gives the value 111;
    • N=0N=0N=0 gives an empty sum, so the value is 000 when p≠0p\ne 0p=0 and 111 when p=0p=0p=0.
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