Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Fourier neural operators, Ψ\PsiΨ-FNOs and Sobolev spaces on the torus

Definition
FourierNeuralOperator_Basic

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

fourier-neural-operatoroperator-learningpseudo-spectral-methodssobolev-spacesuniversal-approximation

Objects of Sections 2 and 3.1 and Appendix B of Kovachki, Lanthaler and Mishra (2021).

  1. Torus and Fourier coefficients. The torus Td\mathbb T^dTd is identified with the box [0,2π]d[0,2\pi]^d[0,2π]d, with Lebesgue measure dxdxdx. A function v:Td→Rιv:\mathbb T^d\to\mathbb R^{\iota}v:Td→Rι (finitely many components) has Fourier coefficients v^k=(2π)−d∫Tdv(x)e−i⟨k,x⟩ dx\hat v_k=(2\pi)^{-d}\int_{\mathbb T^d}v(x)e^{-i\langle k,x\rangle}\,dxv^k​=(2π)−d∫Td​v(x)e−i⟨k,x⟩dx, k∈Zdk\in\mathbb Z^dk∈Zd (eq. B.1), and KN={k∈Zd:∣k∣∞≤N}\mathcal K_N=\{k\in\mathbb Z^d:|k|_\infty\le N\}KN​={k∈Zd:∣k∣∞​≤N} (eq. 2.10).
  2. Function spaces (Appendix B). v∈L2v\in L^2v∈L2 if every component is square integrable, with ∥v∥L2=(∫Td∣v(x)∣2dx)1/2\|v\|_{L^2}=(\int_{\mathbb T^d}|v(x)|^2dx)^{1/2}∥v∥L2​=(∫Td​∣v(x)∣2dx)1/2. For s≥0s\ge0s≥0, ∥v∥Hs2=(2π)d2∑k∈Zd(1+∣k∣2s)∣v^k∣2\|v\|_{H^s}^2=\frac{(2\pi)^d}{2}\sum_{k\in\mathbb Z^d}(1+|k|^{2s})|\hat v_k|^2∥v∥Hs2​=2(2π)d​∑k∈Zd​(1+∣k∣2s)∣v^k​∣2 (eq. B.3, ∣k∣|k|∣k∣ Euclidean), and Hs={v∈L2:∥v∥Hs<∞}H^s=\{v\in L^2:\|v\|_{H^s}<\infty\}Hs={v∈L2:∥v∥Hs​<∞}. LN2L^2_NLN2​ is the space of real trigonometric polynomials ∑∣k∣∞≤Nckei⟨k,x⟩\sum_{|k|_\infty\le N}c_ke^{i\langle k,x\rangle}∑∣k∣∞​≤N​ck​ei⟨k,x⟩ (eq. B.5). A continuous operator G:Hs→Hs′G:H^s\to H^{s'}G:Hs→Hs′ maps HsH^sHs into Hs′H^{s'}Hs′ and is continuous for the two norms; a compact K⊂HsK\subset H^sK⊂Hs is a subset of HsH^sHs in which every sequence has a subsequence converging in HsH^sHs to a point of KKK.
  3. Projections. PNv=∑∣k∣∞≤Nv^kei⟨k,x⟩P_Nv=\sum_{|k|_\infty\le N}\hat v_ke^{i\langle k,x\rangle}PN​v=∑∣k∣∞​≤N​v^k​ei⟨k,x⟩ (eq. B.6). On the grid xj=2πj/(2N+1)x_j=2\pi j/(2N+1)xj​=2πj/(2N+1), j∈JN={0,…,2N}dj\in\mathcal J_N=\{0,\dots,2N\}^dj∈JN​={0,…,2N}d, the discrete Fourier transform is FN(v)(k)=(2N+1)−d∑j∈JNv(xj)e−i⟨k,xj⟩\mathcal F_N(v)(k)=(2N+1)^{-d}\sum_{j\in\mathcal J_N}v(x_j)e^{-i\langle k,x_j\rangle}FN​(v)(k)=(2N+1)−d∑j∈JN​​v(xj​)e−i⟨k,xj​⟩, and the pseudo-spectral projection INv=∑∣k∣∞≤NFN(v)(k)ei⟨k,x⟩\mathcal I_Nv=\sum_{|k|_\infty\le N}\mathcal F_N(v)(k)e^{i\langle k,x\rangle}IN​v=∑∣k∣∞​≤N​FN​(v)(k)ei⟨k,x⟩ is the trigonometric polynomial of degree ≤N\le N≤N that interpolates vvv on the grid (eqs. B.9-B.14).
  4. Activation (Assumption 2.4). σ:R→R\sigma:\mathbb R\to\mathbb Rσ:R→R is not a polynomial, is globally Lipschitz and is C3C^3C3.
  5. FNO (eqs. 2.1, 2.2, 2.5-2.7, Definition 2.13). An FNO of finite width with lift dvd_vdv​, depth LLL and width WWW is
N(a)=Q∘LL∘⋯∘L1∘R(a),R(a)(x)=Ra(x),Q(v)(x)=Qv(x),\mathcal N(a)=\mathcal Q\circ\mathcal L_L\circ\cdots\circ\mathcal L_1\circ\mathcal R(a),\quad \mathcal R(a)(x)=Ra(x),\quad\mathcal Q(v)(x)=Qv(x),N(a)=Q∘LL​∘⋯∘L1​∘R(a),R(a)(x)=Ra(x),Q(v)(x)=Qv(x), Lℓ(v)(x)=σ(Wℓv(x)+bℓ(x)+F−1(Pℓ(k) v^k)(x)),\mathcal L_\ell(v)(x)=\sigma\Big(W_\ell v(x)+b_\ell(x)+\mathcal F^{-1}\big(P_\ell(k)\,\hat v_k\big)(x)\Big),Lℓ​(v)(x)=σ(Wℓ​v(x)+bℓ​(x)+F−1(Pℓ​(k)v^k​)(x)),

with R∈Rdv×daR\in\mathbb R^{d_v\times d_a}R∈Rdv​×da​, Q∈Rdu×dvQ\in\mathbb R^{d_u\times d_v}Q∈Rdu​×dv​, Wℓ∈Rdv×dvW_\ell\in\mathbb R^{d_v\times d_v}Wℓ​∈Rdv​×dv​, biases bℓ∈L2(Td;Rdv)b_\ell\in L^2(\mathbb T^d;\mathbb R^{d_v})bℓ​∈L2(Td;Rdv​) and Fourier multipliers Pℓ(k)∈Cdv×dvP_\ell(k)\in\mathbb C^{d_v\times d_v}Pℓ​(k)∈Cdv​×dv​ with Pℓ(k)=0P_\ell(k)=0Pℓ​(k)=0 for ∣k∣∞>W|k|_\infty>W∣k∣∞​>W. 6. Ψ\PsiΨ-FNO (Definitions 2.11, 2.12). For N≥1N\ge1N≥1, N(a)=Q∘IN∘LL∘IN∘⋯∘L1∘IN∘R(a)\mathcal N(a)=\mathcal Q\circ\mathcal I_N\circ\mathcal L_L\circ\mathcal I_N\circ\cdots\circ\mathcal L_1\circ\mathcal I_N\circ\mathcal R(a)N(a)=Q∘IN​∘LL​∘IN​∘⋯∘L1​∘IN​∘R(a), with depth=L\mathrm{depth}=Ldepth=L, lift=dv\mathrm{lift}=d_vlift=dv​ and width=(2N+1)ddv\mathrm{width}=(2N+1)^dd_vwidth=(2N+1)ddv​. 7. Universal approximation properties. UAFNO(s,s′)\mathrm{UA}_{\mathrm{FNO}}(s,s')UAFNO​(s,s′): for every continuous G:Hs→Hs′G:H^s\to H^{s'}G:Hs→Hs′, compact K⊂HsK\subset H^sK⊂Hs and ε>0\varepsilon>0ε>0 there is an FNO N\mathcal NN, continuous Hs→Hs′H^s\to H^{s'}Hs→Hs′, with sup⁡a∈K∥G(a)−N(a)∥Hs′≤ε\sup_{a\in K}\|G(a)-\mathcal N(a)\|_{H^{s'}}\le\varepsilonsupa∈K​∥G(a)−N(a)∥Hs′​≤ε. UAΨ(s,s′)\mathrm{UA}_{\Psi}(s,s')UAΨ​(s,s′): for every such GGG, compact K⊂HsK\subset H^sK⊂Hs of continuous functions and ε>0\varepsilon>0ε>0 there is N0N_0N0​ such that for every N≥N0N\ge N_0N≥N0​ some Ψ\PsiΨ-FNO on the grid of degree NNN satisfies sup⁡a∈K∥G(a)−N(a)∥Hs′≤ε\sup_{a\in K}\|G(a)-\mathcal N(a)\|_{H^{s'}}\le\varepsilonsupa∈K​∥G(a)−N(a)∥Hs′​≤ε. 8. Darcy problem (eq. 3.5, Setting 3.4). H˙s\dot H^sH˙s is the subspace of HsH^sHs with v^0=0\hat v_0=0v^0​=0. CtC_tCt​ is the norm of the embedding Ht↪L∞H^t\hookrightarrow L^\inftyHt↪L∞. Aλs\mathcal A^s_\lambdaAλs​ is the set of a=1+a~∈Hsa=1+\tilde a\in H^sa=1+a~∈Hs with ∥a∥Hs≤λ−1\|a\|_{H^s}\le\lambda^{-1}∥a∥Hs​≤λ−1 and ∥a~∥L∞≤Cd/2+δ∥a~∥Hd/2+δ≤1−λ\|\tilde a\|_{L^\infty}\le C_{d/2+\delta}\|\tilde a\|_{H^{d/2+\delta}}\le1-\lambda∥a~∥L∞​≤Cd/2+δ​∥a~∥Hd/2+δ​≤1−λ. uuu solves −∇⋅(a∇u)=f-\nabla\cdot(a\nabla u)=f−∇⋅(a∇u)=f, \fintu=0\fint u=0\fintu=0, if u∈H˙1u\in\dot H^1u∈H˙1, ∇u∈L2\nabla u\in L^2∇u∈L2, and −∑jikj (a ∂ju)^k=f^k-\sum_j ik_j\,\widehat{(a\,\partial_ju)}_k=\hat f_k−∑j​ikj​(a∂j​u)​k​=f^​k​ for every k∈Zdk\in\mathbb Z^dk∈Zd.

Formalization Note A function on Td\mathbb T^dTd is a function on Rd\mathbb R^dRd and only its values on [0,2π]d[0,2\pi]^d[0,2π]d matter. The norms ∥⋅∥L2\|\cdot\|_{L^2}∥⋅∥L2​, ∥⋅∥Hs\|\cdot\|_{H^s}∥⋅∥Hs​ and ∥⋅∥L∞\|\cdot\|_{L^\infty}∥⋅∥L∞​ take values in [0,∞][0,\infty][0,∞]. The paper requires Pℓ(−k)=Pℓ(k)†P_\ell(-k)=P_\ell(k)^\daggerPℓ​(−k)=Pℓ​(k)† for real outputs. The correct condition is Pℓ(−k)=Pℓ(k)‾P_\ell(-k)=\overline{P_\ell(k)}Pℓ​(−k)=Pℓ​(k)​, and the layers take the real part of F−1(Pℓv^)\mathcal F^{-1}(P_\ell\hat v)F−1(Pℓ​v^) instead. Over all PℓP_\ellPℓ​ this gives exactly the class of layers satisfying the correct condition. FNOs are taken of finite width (Definition 2.13); the proofs construct only such FNOs. FN\mathcal F_NFN​ uses the phase ⟨k,xj⟩=2π⟨j,k⟩/(2N+1)\langle k,x_j\rangle=2\pi\langle j,k\rangle/(2N+1)⟨k,xj​⟩=2π⟨j,k⟩/(2N+1) of the grid. The paper's eq. (B.13) prints 2π⟨j,k⟩/N2\pi\langle j,k\rangle/N2π⟨j,k⟩/N, which does not give an inverse pair with (B.14).

Definition code
import Mathlib

/-!
Kovachki, Lanthaler and Mishra, *On universal approximation and error bounds for Fourier Neural
Operators*, arXiv:2107.07562v1 (2021): the periodic setting of Appendix B (Fourier coefficients,
`L²`, the Sobolev spaces `H^s(𝕋^d)`, Fourier and pseudo-spectral projections), Fourier neural
operators (Section 2.3, eqs. (2.1), (2.2), (2.5)-(2.7), Definition 2.13), `Ψ`-FNOs
(Definitions 2.11 and 2.12), the activation hypotheses (Assumption 2.4) and the Darcy setting of
Section 3.1 (eq. (3.5), Setting 3.4).

The torus `𝕋^d` is identified with the box `[0, 2π]^d`, as in Section 2.3: a function on the
torus is a function on `ℝ^d`, and only its values on the box enter the norms below. A vector-valued
function `𝕋^d → ℝ^ι` is a map `(Fin d → ℝ) → ι → ℝ`.
-/

open MeasureTheory

noncomputable section

namespace FourierNeuralOperator

/-- Functions on the torus `𝕋^d` with values in `ℝ^ι`. -/
abbrev TorusFun (d : ℕ) (ι : Type) : Type := (Fin d → ℝ) → ι → ℝ

/-- Section 2.3 and Appendix B: the torus `𝕋^d` identified with the box `[0, 2π]^d`. -/
def torusBox (d : ℕ) : Set (Fin d → ℝ) := Set.Icc 0 (fun _ => 2 * Real.pi)

/-- Lebesgue measure on the box `[0, 2π]^d`, the measure `dx` of Appendix B. -/
abbrev torusMeasure (d : ℕ) : Measure (Fin d → ℝ) := volume.restrict (torusBox d)

/-- Eq. (2.10): the wavenumbers `𝒦_N = {k ∈ ℤ^d : |k|_∞ ≤ N}`. -/
def freqBox (d N : ℕ) : Finset (Fin d → ℤ) :=
  Fintype.piFinset fun _ => Finset.Icc (-(N : ℤ)) N

/-- The pairing `⟨k, x⟩ = ∑_i k_i x_i` of a wavenumber and a point. -/
def pairing {d : ℕ} (k : Fin d → ℤ) (x : Fin d → ℝ) : ℝ := ∑ i, (k i : ℝ) * x i

/-- The Fourier mode `e^{i⟨k, x⟩}` of Appendix B. -/
def fourierChar {d : ℕ} (k : Fin d → ℤ) (x : Fin d → ℝ) : ℂ :=
  Complex.exp ((pairing k x : ℂ) * Complex.I)

/-- Eq. (B.1): the `k`-th Fourier coefficient
`v̂_k = (2π)^{-d} ∫_{𝕋^d} v(x) e^{-i⟨k, x⟩} dx`, taken componentwise. -/
def fourierCoeff {d : ℕ} {ι : Type} (v : TorusFun d ι) (k : Fin d → ℤ) (i : ι) : ℂ :=
  ((((2 * Real.pi) ^ d)⁻¹ : ℝ) : ℂ) * ∫ x in torusBox d, (v x i : ℂ) * fourierChar (-k) x

/-- `v ∈ L²(𝕋^d; ℝ^ι)`: every component is square integrable on the torus. -/
def MemL2 {d : ℕ} {ι : Type} (v : TorusFun d ι) : Prop :=
  ∀ i, MemLp (fun x => v x i) 2 (torusMeasure d)

/-- The norm of `L²(𝕋^d; ℝ^ι)`, `‖v‖_{L²} = (∫_{𝕋^d} |v(x)|² dx)^{1/2}` with the Euclidean norm
on `ℝ^ι`, as an extended real (it is `∞` when `v ∉ L²`). -/
def l2Norm {d : ℕ} {ι : Type} [Fintype ι] (v : TorusFun d ι) : ENNReal :=
  (∫⁻ x in torusBox d, ∑ i, ENNReal.ofReal (v x i ^ 2)) ^ ((1 : ℝ) / 2)

/-- Eq. (B.3): the Sobolev norm
`‖v‖_{H^s}² = ((2π)^d / 2) ∑_{k ∈ ℤ^d} (1 + |k|^{2s}) |v̂_k|²`, with `|k|` the Euclidean norm of
`k` and `|v̂_k|² = ∑_i |v̂_{k,i}|²`, as an extended real (it is `∞` when the series diverges). -/
def sobolevNorm {d : ℕ} {ι : Type} [Fintype ι] (s : ℝ) (v : TorusFun d ι) : ENNReal :=
  (∑' k : Fin d → ℤ,
      ENNReal.ofReal ((2 * Real.pi) ^ d / 2 * (1 + (∑ j, ((k j : ℝ)) ^ 2) ^ s)) *
        ∑ i, (‖fourierCoeff v k i‖₊ : ENNReal) ^ 2) ^ ((1 : ℝ) / 2)

/-- Appendix B: `v ∈ H^s(𝕋^d; ℝ^ι)`, i.e. `v ∈ L²` and `‖v‖_{H^s} < ∞`. -/
def MemSobolev {d : ℕ} {ι : Type} [Fintype ι] (s : ℝ) (v : TorusFun d ι) : Prop :=
  MemL2 v ∧ sobolevNorm s v < ⊤

/-- Theorem 2.5: `G` is a continuous operator `H^s(𝕋^d; ℝ^{ι_a}) → H^{s'}(𝕋^d; ℝ^{ι_u})`: it maps
`H^s` into `H^{s'}` and is continuous for the `H^s` and `H^{s'}` norms. -/
def SobolevContinuous {d : ℕ} {ιa ιu : Type} [Fintype ιa] [Fintype ιu] (s s' : ℝ)
    (G : TorusFun d ιa → TorusFun d ιu) : Prop :=
  (∀ a, MemSobolev s a → MemSobolev s' (G a)) ∧
    ∀ a, MemSobolev s a → ∀ ε : ℝ, 0 < ε → ∃ δ : ℝ, 0 < δ ∧ ∀ b, MemSobolev s b →
      sobolevNorm s (b - a) < ENNReal.ofReal δ → sobolevNorm s' (G b - G a) < ENNReal.ofReal ε

/-- Theorem 2.5: `K` is a compact subset of `H^s(𝕋^d; ℝ^ι)`: `K ⊆ H^s`, and every sequence in `K`
has a subsequence converging in `H^s` to a point of `K`. -/
def IsSobolevCompact {d : ℕ} {ι : Type} [Fintype ι] (s : ℝ) (K : Set (TorusFun d ι)) : Prop :=
  (∀ a ∈ K, MemSobolev s a) ∧
    ∀ u : ℕ → TorusFun d ι, (∀ n, u n ∈ K) → ∃ a ∈ K, ∃ φ : ℕ → ℕ, StrictMono φ ∧
      Filter.Tendsto (fun n => sobolevNorm s (u (φ n) - a)) Filter.atTop (nhds 0)

/-- Eq. (B.5): `v ∈ L²_N(𝕋^d; ℝ^ι)`, i.e. every component of `v` is a (real-valued)
trigonometric polynomial `∑_{|k|_∞ ≤ N} c_k e^{i⟨k, x⟩}`. -/
def IsTrigPoly {d : ℕ} {ι : Type} (N : ℕ) (v : TorusFun d ι) : Prop :=
  ∀ i, ∃ c : (Fin d → ℤ) → ℂ, ∀ x, (v x i : ℂ) = ∑ k ∈ freqBox d N, c k * fourierChar k x

/-- Eq. (B.6): the `L²`-orthogonal Fourier projection
`P_N v = ∑_{|k|_∞ ≤ N} v̂_k e^{i⟨k, x⟩}` (real for real `v`; the real part is taken). -/
def fourierProj {d : ℕ} {ι : Type} (N : ℕ) (v : TorusFun d ι) : TorusFun d ι :=
  fun x i => (∑ k ∈ freqBox d N, fourierCoeff v k i * fourierChar k x).re

/-- Eqs. (B.11)-(B.12): the grid point `x_j = 2πj / (2N+1)`, `j ∈ 𝒥_N = {0, …, 2N}^d`. -/
def gridPoint {d : ℕ} (N : ℕ) (j : Fin d → Fin (2 * N + 1)) : Fin d → ℝ :=
  fun i => 2 * Real.pi * ((j i : ℕ) : ℝ) / (2 * N + 1)

/-- Eq. (B.13): the discrete Fourier transform
`𝓕_N(v)(k) = (2N+1)^{-d} ∑_{j ∈ 𝒥_N} v(x_j) e^{-i⟨k, x_j⟩}`, written with the phase
`⟨k, x_j⟩ = 2π⟨j, k⟩/(2N+1)` of the grid (B.11). -/
def dft {d : ℕ} {ι : Type} (N : ℕ) (v : TorusFun d ι) (k : Fin d → ℤ) (i : ι) : ℂ :=
  ((((2 * N + 1 : ℝ) ^ d)⁻¹ : ℝ) : ℂ) *
    ∑ j : Fin d → Fin (2 * N + 1), (v (gridPoint N j) i : ℂ) * fourierChar (-k) (gridPoint N j)

/-- Eqs. (B.9)-(B.10): the pseudo-spectral projection `ℐ_N v`, the trigonometric polynomial
of degree `≤ N` that interpolates `v` on the grid `{x_j}_{j ∈ 𝒥_N}`, written as
`∑_{|k|_∞ ≤ N} 𝓕_N(v)(k) e^{i⟨k, x⟩}` (real for real `v`; the real part is taken). -/
def interp {d : ℕ} {ι : Type} (N : ℕ) (v : TorusFun d ι) : TorusFun d ι :=
  fun x i => (∑ k ∈ freqBox d N, dft N v k i * fourierChar k x).re

/-- Assumption 2.4: the activation `σ` is non-polynomial, globally Lipschitz and `C³`. -/
def IsActivation (σ : ℝ → ℝ) : Prop :=
  (¬ ∃ p : Polynomial ℝ, ∀ x, σ x = p.eval x) ∧ (∃ L : NNReal, LipschitzWith L σ) ∧
    ContDiff ℝ 3 σ

/-- Eq. (2.5): the Fourier multiplier `𝓕^{-1}(P(k) · 𝓕(v)(k))` with coefficients supported in
`|k|_∞ ≤ W`; the real part is taken, which realises the reality condition on `P` (see the
Formalization Note of the definitions). -/
def fourierMultiplier {d n : ℕ} (W : ℕ) (P : (Fin d → ℤ) → Matrix (Fin n) (Fin n) ℂ)
    (v : TorusFun d (Fin n)) : TorusFun d (Fin n) :=
  fun x i => (∑ k ∈ freqBox d W, ∑ j, P k i j * fourierCoeff v k j * fourierChar k x).re

/-- Eqs. (2.1), (2.2), (2.6), (2.7) and Definition 2.13: a Fourier neural operator of finite
width `𝒩 = 𝒬 ∘ ℒ_L ∘ ⋯ ∘ ℒ_1 ∘ ℛ`, with lifting `ℛ(a)(x) = R a(x)`, projection
`𝒬(v)(x) = Q v(x)`, and layers `ℒ_ℓ(v)(x) = σ(W_ℓ v(x) + b_ℓ(x) + 𝓕^{-1}(P_ℓ(k) 𝓕(v)(k))(x))`
whose Fourier multipliers vanish for `|k|_∞ > modes`. The biases are `L²` functions on the
torus. -/
structure FNO (d : ℕ) (ιa ιu : Type) [Fintype ιa] [Fintype ιu] where
  /-- The lifting dimension `d_v`. -/
  lift : ℕ
  /-- The depth `L`. -/
  depth : ℕ
  /-- The width `W` of Definition 2.13: `P_ℓ(k) = 0` for `|k|_∞ > W`. -/
  modes : ℕ
  /-- The lifting matrix `R ∈ ℝ^{d_v × d_a}`. -/
  R : Matrix (Fin lift) ιa ℝ
  /-- The projection matrix `Q ∈ ℝ^{d_u × d_v}`. -/
  Q : Matrix ιu (Fin lift) ℝ
  /-- The weight matrices `W_ℓ ∈ ℝ^{d_v × d_v}`. -/
  W : Fin depth → Matrix (Fin lift) (Fin lift) ℝ
  /-- The bias functions `b_ℓ(x)`. -/
  b : Fin depth → TorusFun d (Fin lift)
  /-- The Fourier multipliers `P_ℓ(k) ∈ ℂ^{d_v × d_v}`. -/
  P : Fin depth → (Fin d → ℤ) → Matrix (Fin lift) (Fin lift) ℂ
  /-- The biases belong to `L²(𝕋^d; ℝ^{d_v})`. -/
  b_memL2 : ∀ ℓ, MemL2 (b ℓ)

/-- Eq. (2.7): the `ℓ`-th layer `ℒ_ℓ` of an FNO with activation `σ`. -/
def FNO.layer {d : ℕ} {ιa ιu : Type} [Fintype ιa] [Fintype ιu] (Nn : FNO d ιa ιu)
    (σ : ℝ → ℝ) (ℓ : Fin Nn.depth) (v : TorusFun d (Fin Nn.lift)) : TorusFun d (Fin Nn.lift) :=
  fun x i => σ ((Nn.W ℓ).mulVec (v x) i + Nn.b ℓ x i + fourierMultiplier Nn.modes (Nn.P ℓ) v x i)

/-- Eq. (2.6): the operator `𝒩(a) = 𝒬 ∘ ℒ_L ∘ ⋯ ∘ ℒ_1 ∘ ℛ(a)` defined by an FNO. -/
def FNO.eval {d : ℕ} {ιa ιu : Type} [Fintype ιa] [Fintype ιu] (Nn : FNO d ιa ιu)
    (σ : ℝ → ℝ) (a : TorusFun d ιa) : TorusFun d ιu :=
  let v₀ : TorusFun d (Fin Nn.lift) := fun x => Nn.R.mulVec (a x)
  let vL := (List.finRange Nn.depth).foldl (fun v ℓ => Nn.layer σ ℓ v) v₀
  fun x => Nn.Q.mulVec (vL x)

/-- Definition 2.11: a `Ψ`-FNO, i.e. the parameters of an FNO together with the degree
`N ≥ 1` of the pseudo-spectral projections inserted between its layers. -/
structure PsiFNO (d : ℕ) (ιa ιu : Type) [Fintype ιa] [Fintype ιu] extends FNO d ιa ιu where
  /-- The degree `N` of the grid `{x_j}_{j ∈ 𝒥_N}`. -/
  grid : ℕ
  /-- `N ∈ ℕ`, `N ≥ 1`. -/
  grid_pos : 0 < grid

/-- Eq. (2.14): the operator `𝒩(a) = 𝒬 ∘ ℐ_N ∘ ℒ_L ∘ ℐ_N ∘ ⋯ ∘ ℒ_1 ∘ ℐ_N ∘ ℛ(a)` defined by a
`Ψ`-FNO. -/
def PsiFNO.eval {d : ℕ} {ιa ιu : Type} [Fintype ιa] [Fintype ιu] (Np : PsiFNO d ιa ιu)
    (σ : ℝ → ℝ) (a : TorusFun d ιa) : TorusFun d ιu :=
  let v₀ : TorusFun d (Fin Np.lift) := interp Np.grid (fun x => Np.R.mulVec (a x))
  let vL := (List.finRange Np.depth).foldl
    (fun v ℓ => interp Np.grid (Np.toFNO.layer σ ℓ v)) v₀
  fun x => Np.Q.mulVec (vL x)

/-- Definition 2.12: `width(𝒩) = d_v |𝒥_N| = (2N+1)^d d_v`. -/
def PsiFNO.width {d : ℕ} {ιa ιu : Type} [Fintype ιa] [Fintype ιu] (Np : PsiFNO d ιa ιu) : ℕ :=
  (2 * Np.grid + 1) ^ d * Np.lift

/-- Theorem 2.5 and Lemma 2.6: the universal approximation property of FNOs for operators
`H^s → H^{s'}` with activation `σ` (the conclusion of Theorem 2.5): for every continuous
`G : H^s → H^{s'}`, compact `K ⊆ H^s` and `ε > 0` there is an FNO `𝒩`, continuous as an operator
`H^s → H^{s'}`, with `sup_{a ∈ K} ‖G(a) - 𝒩(a)‖_{H^{s'}} ≤ ε`. -/
def UniversalApproxFNO (σ : ℝ → ℝ) (d : ℕ) (ιa ιu : Type) [Fintype ιa] [Fintype ιu]
    (s s' : ℝ) : Prop :=
  ∀ G : TorusFun d ιa → TorusFun d ιu, SobolevContinuous s s' G →
    ∀ K : Set (TorusFun d ιa), IsSobolevCompact s K → ∀ ε : ℝ, 0 < ε →
      ∃ Nn : FNO d ιa ιu, SobolevContinuous s s' (Nn.eval σ) ∧
        ∀ a ∈ K, sobolevNorm s' (G a - Nn.eval σ a) ≤ ENNReal.ofReal ε

/-- Theorem 2.15, in the form used in the proof of Lemma 2.16 (Appendix D.6): for every
continuous `G : H^s → H^{s'}`, compact `K ⊆ H^s` (of continuous functions) and `ε > 0` there is
`N₀` such that for every `N ≥ N₀` some `Ψ`-FNO on the grid of degree `N` approximates `G` on `K`
to accuracy `ε` in `H^{s'}`. -/
def UniversalApproxPsiFNO (σ : ℝ → ℝ) (d : ℕ) (ιa ιu : Type) [Fintype ιa] [Fintype ιu]
    (s s' : ℝ) : Prop :=
  ∀ G : TorusFun d ιa → TorusFun d ιu, SobolevContinuous s s' G →
    ∀ K : Set (TorusFun d ιa), IsSobolevCompact s K → (∀ a ∈ K, ContinuousOn a (torusBox d)) →
      ∀ ε : ℝ, 0 < ε → ∃ N₀ : ℕ, ∀ N, N₀ ≤ N → ∃ Np : PsiFNO d ιa ιu, Np.grid = N ∧
        ∀ a ∈ K, sobolevNorm s' (G a - Np.eval σ a) ≤ ENNReal.ofReal ε

/-- Appendix B: `v̂_0 = 0`, i.e. `v` has mean zero (`v ∈ L̇²`, `Ḣ^s`). -/
def MeanZero {d : ℕ} {ι : Type} (v : TorusFun d ι) : Prop := ∀ i, fourierCoeff v 0 i = 0

/-- The norm `‖v‖_{L^∞(𝕋^d)}` (essential supremum on the torus of the largest component). -/
def linftyNorm {d : ℕ} {ι : Type} [Fintype ι] (v : TorusFun d ι) : ENNReal :=
  eLpNorm v ⊤ (torusMeasure d)

/-- Setting 3.4: the norm `C` of the embedding `H^t(𝕋^d) ↪ L^∞(𝕋^d)`,
`C = sup {‖v‖_{L^∞} : ‖v‖_{H^t} ≤ 1}`. -/
def sobolevEmbConst (d : ℕ) (t : ℝ) : ENNReal :=
  ⨆ (v : TorusFun d (Fin 1)) (_ : MemSobolev t v) (_ : sobolevNorm t v ≤ 1), linftyNorm v

/-- Setting 3.4: the set `𝒜^s_λ(𝕋^d)` of `λ`-coercive coefficients `a = 1 + ã ∈ H^s` with
`‖a‖_{H^s} ≤ λ⁻¹` and `‖ã‖_{L^∞} ≤ C ‖ã‖_{H^{d/2+δ}} ≤ 1 - λ`, `C` the norm of
`H^{d/2+δ} ↪ L^∞`. -/
def darcyCoeffSet (d : ℕ) (s δ lam : ℝ) : Set (TorusFun d (Fin 1)) :=
  {a | MemSobolev s a ∧ sobolevNorm s a ≤ ENNReal.ofReal lam⁻¹ ∧
    linftyNorm (fun x i => a x i - 1) ≤
      sobolevEmbConst d ((d : ℝ) / 2 + δ) * sobolevNorm ((d : ℝ) / 2 + δ) (fun x i => a x i - 1) ∧
    sobolevEmbConst d ((d : ℝ) / 2 + δ) * sobolevNorm ((d : ℝ) / 2 + δ) (fun x i => a x i - 1) ≤
      ENNReal.ofReal (1 - lam)}

/-- Eq. (3.5) and Setting 3.4: `u ∈ Ḣ¹(𝕋^d)` solves the periodic Darcy problem
`-∇ · (a ∇u) = f`, `⨍ u = 0`: `u` has weak gradient `g = ∇u ∈ L²` (`ĝ_{j,k} = i k_j û_k`), and the
Fourier coefficients of `-∇ · (a g)` equal those of `f`: `-∑_j i k_j (a g_j)^_k = f̂_k` for all `k`. -/
def IsDarcySolution {d : ℕ} (a f u : TorusFun d (Fin 1)) : Prop :=
  MemSobolev 1 u ∧ MeanZero u ∧
    ∃ g : Fin d → TorusFun d (Fin 1), (∀ j, MemL2 (g j)) ∧
      (∀ j k, fourierCoeff (g j) k 0 = Complex.I * (k j : ℂ) * fourierCoeff u k 0) ∧
      ∀ k, -(∑ j, Complex.I * (k j : ℂ) * fourierCoeff (fun x i => a x i * g j x i) k 0) =
        fourierCoeff f k 0

end FourierNeuralOperator
Source
Kovachki, Lanthaler and Mishra, On universal approximation and error bounds for Fourier Neural Operators, arXiv:2107.07562v1 (2021), Section 2.3 (eqs. (2.1), (2.2), (2.5)-(2.7)), Assumption 2.4, Definitions 2.11-2.13, Section 3.1 (eq. (3.5), Setting 3.4), Appendix B (eqs. (B.1)-(B.14))
Read-back

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

Torus functions (TorusFun\mathrm{TorusFun}TorusFun). For a natural number ddd and an index type ι\iotaι, a "torus function" is any map v:Rd→Rιv:\mathbb{R}^d\to\mathbb{R}^\iotav:Rd→Rι, assigning to each point x∈Rdx\in\mathbb{R}^dx∈Rd and each index i∈ιi\in\iotai∈ι a real number vi(x)v_i(x)vi​(x). No periodicity, measurability or other condition is imposed, and vvv is defined on all of Rd\mathbb{R}^dRd, not only on a box. The index type ι\iotaι is arbitrary; it may be empty or infinite.

The box (torusBox\mathrm{torusBox}torusBox). The set

Bd=[0,2π]d={x∈Rd: 0≤xi≤2π for all i},B_d=[0,2\pi]^d=\{x\in\mathbb{R}^d:\ 0\le x_i\le 2\pi \text{ for all } i\},Bd​=[0,2π]d={x∈Rd: 0≤xi​≤2π for all i},

which is closed, so it includes the faces xi=0x_i=0xi​=0 and xi=2πx_i=2\pixi​=2π. For d=0d=0d=0, R0\mathbb{R}^0R0 is a single point and B0B_0B0​ is that point.

The measure (torusMeasure\mathrm{torusMeasure}torusMeasure). The measure μd\mu_dμd​ is Lebesgue measure on Rd\mathbb{R}^dRd restricted to BdB_dBd​, so μd(E)=λd(E∩Bd)\mu_d(E)=\lambda^d(E\cap B_d)μd​(E)=λd(E∩Bd​). For d=0d=0d=0, it is the unit point mass on the single point of R0\mathbb{R}^0R0.

Frequency box (freqBox\mathrm{freqBox}freqBox). For d,N∈Nd,N\in\mathbb{N}d,N∈N, this is the finite set of integer vectors

KN={k∈Zd: −N≤ki≤N for all i}.\mathcal{K}_N=\{k\in\mathbb{Z}^d:\ -N\le k_i\le N \text{ for all } i\}.KN​={k∈Zd: −N≤ki​≤N for all i}.

It has (2N+1)d(2N+1)^d(2N+1)d elements. For d=0d=0d=0 it consists of the single empty vector.

Pairing (pairing\mathrm{pairing}pairing). For k∈Zdk\in\mathbb{Z}^dk∈Zd and x∈Rdx\in\mathbb{R}^dx∈Rd,

⟨k,x⟩=∑ikixi∈R.\langle k,x\rangle=\sum_{i} k_i x_i\in\mathbb{R}.⟨k,x⟩=i∑​ki​xi​∈R.

Fourier mode (fourierChar\mathrm{fourierChar}fourierChar). For k∈Zdk\in\mathbb{Z}^dk∈Zd and x∈Rdx\in\mathbb{R}^dx∈Rd, the complex number

ek(x)=ei⟨k,x⟩.e_k(x)=e^{\mathrm{i}\langle k,x\rangle}.ek​(x)=ei⟨k,x⟩.

Fourier coefficient (fourierCoeff\mathrm{fourierCoeff}fourierCoeff). For v:Rd→Rιv:\mathbb{R}^d\to\mathbb{R}^\iotav:Rd→Rι, k∈Zdk\in\mathbb{Z}^dk∈Zd and i∈ιi\in\iotai∈ι,

v^k,i=(2π)−d∫[0,2π]dvi(x) e−i⟨k,x⟩ dx∈C.\hat v_{k,i}=(2\pi)^{-d}\int_{[0,2\pi]^d} v_i(x)\,e^{-\mathrm{i}\langle k,x\rangle}\,dx\in\mathbb{C}.v^k,i​=(2π)−d∫[0,2π]d​vi​(x)e−i⟨k,x⟩dx∈C.

This is a Bochner integral over the box only; values of vvv outside [0,2π]d[0,2\pi]^d[0,2π]d play no role.

  • By convention, if x↦vi(x)e−i⟨k,x⟩x\mapsto v_i(x)e^{-\mathrm{i}\langle k,x\rangle}x↦vi​(x)e−i⟨k,x⟩ is not integrable on the box (for example viv_ivi​ non-measurable or not in L1L^1L1), the integral is taken to be 000, so v^k,i=0\hat v_{k,i}=0v^k,i​=0.

L2L^2L2 membership (MemL2\mathrm{MemL2}MemL2). A function v:Rd→Rιv:\mathbb{R}^d\to\mathbb{R}^\iotav:Rd→Rι is "in L2L^2L2" when, for every index i∈ιi\in\iotai∈ι, the component viv_ivi​ is almost-everywhere strongly measurable on [0,2π]d[0,2\pi]^d[0,2π]d and satisfies

∫[0,2π]d∣vi∣2 dx<∞.\int_{[0,2\pi]^d}|v_i|^2\,dx<\infty.∫[0,2π]d​∣vi​∣2dx<∞.

Nothing is required of vvv outside the box. When ι\iotaι is infinite, this is a separate condition for each component, with no uniformity across components. When ι\iotaι is empty, it holds vacuously.

L2L^2L2 norm (l2Norm\mathrm{l2Norm}l2Norm). For finite ι\iotaι, define the extended nonnegative real

∥v∥L2=(∫[0,2π]d∑i∈ιvi(x)2 dx)1/2∈[0,∞],\|v\|_{L^2}=\Big(\int_{[0,2\pi]^d}\sum_{i\in\iota} v_i(x)^2\,dx\Big)^{1/2}\in[0,\infty],∥v∥L2​=(∫[0,2π]d​i∈ι∑​vi​(x)2dx)1/2∈[0,∞],

using the lower Lebesgue integral. It equals ∞\infty∞ when the integral diverges.

Sobolev norm (sobolevNorm\mathrm{sobolevNorm}sobolevNorm). For finite ι\iotaι, a real number sss (any sign) and v:Rd→Rιv:\mathbb{R}^d\to\mathbb{R}^\iotav:Rd→Rι, define the extended nonnegative real

∥v∥Hs=(∑k∈Zd(2π)d2(1+(∣k∣2)s)∑i∈ι∣v^k,i∣2)1/2∈[0,∞].\|v\|_{H^s}=\Big(\sum_{k\in\mathbb{Z}^d}\frac{(2\pi)^d}{2}\Big(1+\big(|k|^2\big)^{s}\Big)\sum_{i\in\iota}|\hat v_{k,i}|^2\Big)^{1/2}\in[0,\infty].∥v∥Hs​=(k∈Zd∑​2(2π)d​(1+(∣k∣2)s)i∈ι∑​∣v^k,i​∣2)1/2∈[0,∞].

Here ∣k∣2=∑jkj2|k|^2=\sum_j k_j^2∣k∣2=∑j​kj2​, v^k,i\hat v_{k,i}v^k,i​ is the Fourier coefficient above, and the sum is an unconditional sum in [0,∞][0,\infty][0,∞], equal to ∞\infty∞ if it diverges.

  • The power (∣k∣2)s(|k|^2)^s(∣k∣2)s is the real power. At k=0k=0k=0 it equals 111 if s=0s=0s=0 and 000 if s≠0s\ne0s=0, including negative sss. So the k=0k=0k=0 term always has the finite weight (2π)d/2(2\pi)^d/2(2π)d/2 when s≠0s\neq 0s=0, and weight (2π)d(2\pi)^d(2π)d when s=0s=0s=0.
  • For s=0s=0s=0, every term has weight (2π)d(2\pi)^d(2π)d.
  • Because non-integrable components have all Fourier coefficients equal to 000, such functions get norm 000.

Sobolev membership (MemSobolev\mathrm{MemSobolev}MemSobolev). For finite ι\iotaι and real sss, vvv "is in HsH^sHs" when both hold:

  • vvv is in L2L^2L2 in the sense above (every component square-integrable on the box);
  • ∥v∥Hs<∞\|v\|_{H^s}<\infty∥v∥Hs​<∞.

Sobolev continuity (SobolevContinuous\mathrm{SobolevContinuous}SobolevContinuous). For finite ιa,ιu\iota_a,\iota_uιa​,ιu​, reals s,s′s,s's,s′ and an arbitrary map GGG from functions Rd→Rιa\mathbb{R}^d\to\mathbb{R}^{\iota_a}Rd→Rιa​ to functions Rd→Rιu\mathbb{R}^d\to\mathbb{R}^{\iota_u}Rd→Rιu​, the property says two things:

  1. For every a∈Hsa\in H^sa∈Hs, the image G(a)G(a)G(a) is in Hs′H^{s'}Hs′.
  2. For every a∈Hsa\in H^sa∈Hs and every real ε>0\varepsilon>0ε>0 there is a real δ>0\delta>0δ>0 such that, for every b∈Hsb\in H^sb∈Hs,
∥b−a∥Hs<δ ⟹ ∥G(b)−G(a)∥Hs′<ε.\|b-a\|_{H^s}<\delta\ \Longrightarrow\ \|G(b)-G(a)\|_{H^{s'}}<\varepsilon.∥b−a∥Hs​<δ ⟹ ∥G(b)−G(a)∥Hs′​<ε.

Here b−ab-ab−a and G(b)−G(a)G(b)-G(a)G(b)−G(a) are pointwise differences of functions. Nothing is required of GGG on inputs outside HsH^sHs.

Sobolev compactness (IsSobolevCompact\mathrm{IsSobolevCompact}IsSobolevCompact). For finite ι\iotaι, real sss and a set KKK of functions Rd→Rι\mathbb{R}^d\to\mathbb{R}^\iotaRd→Rι, the property says two things:

  1. Every a∈Ka\in Ka∈K is in HsH^sHs.
  2. For every sequence (un)n∈N(u_n)_{n\in\mathbb{N}}(un​)n∈N​ in KKK there exist a∈Ka\in Ka∈K and a strictly increasing φ:N→N\varphi:\mathbb{N}\to\mathbb{N}φ:N→N with
∥uφ(n)−a∥Hs→0(n→∞).\|u_{\varphi(n)}-a\|_{H^s}\to0 \quad (n\to\infty).∥uφ(n)​−a∥Hs​→0(n→∞).

The empty set satisfies this vacuously.

Trigonometric polynomials (IsTrigPoly\mathrm{IsTrigPoly}IsTrigPoly). For N∈NN\in\mathbb{N}N∈N, the function v:Rd→Rιv:\mathbb{R}^d\to\mathbb{R}^\iotav:Rd→Rι qualifies when, for each index iii, there exist complex numbers (ck)k∈Zd(c_k)_{k\in\mathbb{Z}^d}(ck​)k∈Zd​ such that for every x∈Rdx\in\mathbb{R}^dx∈Rd (not just the box)

vi(x)=∑k∈KNck ei⟨k,x⟩.v_i(x)=\sum_{k\in\mathcal{K}_N}c_k\,e^{\mathrm{i}\langle k,x\rangle}.vi​(x)=k∈KN​∑​ck​ei⟨k,x⟩.

The coefficients may differ from one component to another.

Fourier projection (fourierProj\mathrm{fourierProj}fourierProj). For N∈NN\in\mathbb{N}N∈N, the function PNvP_NvPN​v is defined at every x∈Rdx\in\mathbb{R}^dx∈Rd and index iii by

(PNv)i(x)=Re⁡∑k∈KNv^k,i ei⟨k,x⟩.(P_Nv)_i(x)=\operatorname{Re}\sum_{k\in\mathcal{K}_N}\hat v_{k,i}\,e^{\mathrm{i}\langle k,x\rangle}.(PN​v)i​(x)=Rek∈KN​∑​v^k,i​ei⟨k,x⟩.

The real part is taken explicitly.

Grid points (gridPoint\mathrm{gridPoint}gridPoint). For N∈NN\in\mathbb{N}N∈N and a multi-index j∈{0,1,…,2N}dj\in\{0,1,\dots,2N\}^dj∈{0,1,…,2N}d, the point xj∈Rdx_j\in\mathbb{R}^dxj​∈Rd has coordinates

(xj)i=2πji2N+1.(x_j)_i=\frac{2\pi j_i}{2N+1}.(xj​)i​=2N+12πji​​.

All grid points lie in [0,2π)d[0,2\pi)^d[0,2π)d. For N=0N=0N=0 the only grid point is the origin.

Discrete Fourier transform (dft\mathrm{dft}dft). For N∈NN\in\mathbb{N}N∈N, v:Rd→Rιv:\mathbb{R}^d\to\mathbb{R}^\iotav:Rd→Rι, k∈Zdk\in\mathbb{Z}^dk∈Zd and index iii,

FN(v)k,i=(2N+1)−d∑j∈{0,…,2N}dvi(xj) e−i⟨k,xj⟩.\mathcal{F}_N(v)_{k,i}=(2N+1)^{-d}\sum_{j\in\{0,\dots,2N\}^d}v_i(x_j)\,e^{-\mathrm{i}\langle k,x_j\rangle}.FN​(v)k,i​=(2N+1)−dj∈{0,…,2N}d∑​vi​(xj​)e−i⟨k,xj​⟩.

It depends on vvv only through its values at the (2N+1)d(2N+1)^d(2N+1)d grid points.

Pseudo-spectral projection (interp\mathrm{interp}interp). For N∈NN\in\mathbb{N}N∈N, the function INv\mathcal{I}_NvIN​v is defined at every x∈Rdx\in\mathbb{R}^dx∈Rd and index iii by

(INv)i(x)=Re⁡∑k∈KNFN(v)k,i ei⟨k,x⟩.(\mathcal{I}_Nv)_i(x)=\operatorname{Re}\sum_{k\in\mathcal{K}_N}\mathcal{F}_N(v)_{k,i}\,e^{\mathrm{i}\langle k,x\rangle}.(IN​v)i​(x)=Rek∈KN​∑​FN​(v)k,i​ei⟨k,x⟩.

It depends on vvv only through the grid values v(xj)v(x_j)v(xj​). No interpolation property is stated; the function is just this formula.

Activation hypotheses (IsActivation\mathrm{IsActivation}IsActivation). A function σ:R→R\sigma:\mathbb{R}\to\mathbb{R}σ:R→R qualifies when all three hold:

  1. There is no real polynomial ppp with σ(x)=p(x)\sigma(x)=p(x)σ(x)=p(x) for all x∈Rx\in\mathbb{R}x∈R.
  2. σ\sigmaσ is Lipschitz with some constant L≥0L\ge0L≥0, i.e. ∣σ(x)−σ(y)∣≤L∣x−y∣|\sigma(x)-\sigma(y)|\le L|x-y|∣σ(x)−σ(y)∣≤L∣x−y∣ for all x,yx,yx,y.
  3. σ\sigmaσ is three times continuously differentiable on R\mathbb{R}R.

Fourier multiplier (fourierMultiplier\mathrm{fourierMultiplier}fourierMultiplier). The inputs are:

  • natural numbers d,n,Wd,n,Wd,n,W;
  • a family of complex n×nn\times nn×n matrices P(k)P(k)P(k), one for each k∈Zdk\in\mathbb{Z}^dk∈Zd;
  • a function v:Rd→Rnv:\mathbb{R}^d\to\mathbb{R}^nv:Rd→Rn.

The output is a function Rd→Rn\mathbb{R}^d\to\mathbb{R}^nRd→Rn given at every x∈Rdx\in\mathbb{R}^dx∈Rd and i∈{1,…,n}i\in\{1,\dots,n\}i∈{1,…,n} by

(MW,Pv)i(x)=Re⁡∑k∈KW∑j=1nP(k)ij v^k,j ei⟨k,x⟩.\big(\mathcal{M}_{W,P}v\big)_i(x)=\operatorname{Re}\sum_{k\in\mathcal{K}_W}\sum_{j=1}^{n}P(k)_{ij}\,\hat v_{k,j}\,e^{\mathrm{i}\langle k,x\rangle}.(MW,P​v)i​(x)=Rek∈KW​∑​j=1∑n​P(k)ij​v^k,j​ei⟨k,x⟩.

Only the matrices P(k)P(k)P(k) with ∣k∣∞≤W|k|_\infty\le W∣k∣∞​≤W enter. No condition (such as a reality or Hermitian-symmetry condition) is imposed on PPP; the real part is taken instead.

Fourier neural operator (FNO\mathrm{FNO}FNO). For d∈Nd\in\mathbb{N}d∈N and finite index types ιa\iota_aιa​ (input components) and ιu\iota_uιu​ (output components), an FNO is a tuple consisting of:

  • natural numbers dvd_vdv​ (lifting dimension), LLL (depth) and WWW (number of modes), any of which may be 000;
  • a real matrix R∈Rdv×ιaR\in\mathbb{R}^{d_v\times\iota_a}R∈Rdv​×ιa​;
  • a real matrix Q∈Rιu×dvQ\in\mathbb{R}^{\iota_u\times d_v}Q∈Rιu​×dv​;
  • for each layer ℓ∈{0,…,L−1}\ell\in\{0,\dots,L-1\}ℓ∈{0,…,L−1}:
    • a real matrix Wℓ∈Rdv×dvW_\ell\in\mathbb{R}^{d_v\times d_v}Wℓ​∈Rdv​×dv​;
    • a bias function bℓ:Rd→Rdvb_\ell:\mathbb{R}^d\to\mathbb{R}^{d_v}bℓ​:Rd→Rdv​;
    • a family of complex matrices Pℓ(k)∈Cdv×dvP_\ell(k)\in\mathbb{C}^{d_v\times d_v}Pℓ​(k)∈Cdv​×dv​, one for each k∈Zdk\in\mathbb{Z}^dk∈Zd, unconstrained.

The only side condition is that each bias bℓb_\ellbℓ​ is in L2L^2L2 in the sense above: every component is square-integrable on [0,2π]d[0,2\pi]^d[0,2π]d, with no condition off the box and no regularity beyond that.

One FNO layer (FNO.layer\mathrm{FNO.layer}FNO.layer). For an FNO, a function σ:R→R\sigma:\mathbb{R}\to\mathbb{R}σ:R→R (no hypothesis on σ\sigmaσ), a layer index ℓ\ellℓ and v:Rd→Rdvv:\mathbb{R}^d\to\mathbb{R}^{d_v}v:Rd→Rdv​, the layer output is given at every x∈Rdx\in\mathbb{R}^dx∈Rd and i∈{1,…,dv}i\in\{1,\dots,d_v\}i∈{1,…,dv​} by

Lℓ(v)i(x)=σ((Wℓ v(x))i+(bℓ)i(x)+(MW,Pℓv)i(x)).\mathcal{L}_\ell(v)_i(x)=\sigma\Big((W_\ell\,v(x))_i+(b_\ell)_i(x)+\big(\mathcal{M}_{W,P_\ell}v\big)_i(x)\Big).Lℓ​(v)i​(x)=σ((Wℓ​v(x))i​+(bℓ​)i​(x)+(MW,Pℓ​​v)i​(x)).

Here MW,Pℓ\mathcal{M}_{W,P_\ell}MW,Pℓ​​ is the Fourier multiplier above with the FNO's mode count WWW, and σ\sigmaσ is applied componentwise.

FNO evaluation (FNO.eval\mathrm{FNO.eval}FNO.eval). For an FNO, a function σ:R→R\sigma:\mathbb{R}\to\mathbb{R}σ:R→R and an input a:Rd→Rιaa:\mathbb{R}^d\to\mathbb{R}^{\iota_a}a:Rd→Rιa​, the output N(a):Rd→Rιu\mathcal{N}(a):\mathbb{R}^d\to\mathbb{R}^{\iota_u}N(a):Rd→Rιu​ is built as follows:

  1. Lift: v0(x)=R a(x)v_0(x)=R\,a(x)v0​(x)=Ra(x).
  2. Apply the layers in order, vℓ+1=Lℓ(vℓ)v_{\ell+1}=\mathcal{L}_\ell(v_\ell)vℓ+1​=Lℓ​(vℓ​) for ℓ=0,1,…,L−1\ell=0,1,\dots,L-1ℓ=0,1,…,L−1.
  3. Project: N(a)(x)=Q vL(x)\mathcal{N}(a)(x)=Q\,v_L(x)N(a)(x)=QvL​(x) for every x∈Rdx\in\mathbb{R}^dx∈Rd.

When L=0L=0L=0 this is the pointwise linear map N(a)(x)=QR a(x)\mathcal{N}(a)(x)=QR\,a(x)N(a)(x)=QRa(x).

Ψ\PsiΨ-FNO (PsiFNO\mathrm{PsiFNO}PsiFNO). A Ψ\PsiΨ-FNO is all the data of an FNO, including the L2L^2L2 condition on the biases, together with one more natural number NNN (the grid degree) satisfying N≥1N\ge1N≥1.

Ψ\PsiΨ-FNO evaluation (PsiFNO.eval\mathrm{PsiFNO.eval}PsiFNO.eval). For a Ψ\PsiΨ-FNO, a function σ:R→R\sigma:\mathbb{R}\to\mathbb{R}σ:R→R and an input aaa, the output is built as follows, with IN\mathcal{I}_NIN​ the pseudo-spectral projection above:

  1. Lift and project onto the grid: v0=IN(x↦R a(x))v_0=\mathcal{I}_N\big(x\mapsto R\,a(x)\big)v0​=IN​(x↦Ra(x)).
  2. For ℓ=0,…,L−1\ell=0,\dots,L-1ℓ=0,…,L−1, set vℓ+1=IN(Lℓ(vℓ))v_{\ell+1}=\mathcal{I}_N\big(\mathcal{L}_\ell(v_\ell)\big)vℓ+1​=IN​(Lℓ​(vℓ​)). Here Lℓ\mathcal{L}_\ellLℓ​ is the FNO layer above, whose Fourier multiplier uses the integral Fourier coefficients v^\hat vv^, not the discrete transform.
  3. Project: N(a)(x)=Q vL(x)\mathcal{N}(a)(x)=Q\,v_L(x)N(a)(x)=QvL​(x) for all x∈Rdx\in\mathbb{R}^dx∈Rd.

Since v0v_0v0​ depends on aaa only through the values a(xj)a(x_j)a(xj​) at the grid points, so does the whole output.

Ψ\PsiΨ-FNO width (PsiFNO.width\mathrm{PsiFNO.width}PsiFNO.width). The natural number

(2N+1)d⋅dv.(2N+1)^d\cdot d_v.(2N+1)d⋅dv​.

Universal approximation for FNOs (UniversalApproxFNO\mathrm{UniversalApproxFNO}UniversalApproxFNO). This is a property of a function σ:R→R\sigma:\mathbb{R}\to\mathbb{R}σ:R→R, a dimension ddd, finite index types ιa,ιu\iota_a,\iota_uιa​,ιu​ and reals s,s′s,s's,s′. It is a definition, not an assertion that the property holds, and no hypothesis on σ\sigmaσ is built in. It says:

For every map GGG that is Sobolev-continuous from HsH^sHs to Hs′H^{s'}Hs′ (in the sense above), every Sobolev-compact set K⊆HsK\subseteq H^sK⊆Hs, and every real ε>0\varepsilon>0ε>0, there exists an FNO N\mathcal{N}N satisfying both:

  • its evaluation with σ\sigmaσ is itself Sobolev-continuous from HsH^sHs to Hs′H^{s'}Hs′;
  • for every a∈Ka\in Ka∈K,
∥G(a)−N(a)∥Hs′≤ε.\|G(a)-\mathcal{N}(a)\|_{H^{s'}}\le\varepsilon.∥G(a)−N(a)∥Hs′​≤ε.

The inequality is non-strict.

Universal approximation for Ψ\PsiΨ-FNOs (UniversalApproxPsiFNO\mathrm{UniversalApproxPsiFNO}UniversalApproxPsiFNO). This is a property of σ,d,ιa,ιu,s,s′\sigma,d,\iota_a,\iota_u,s,s'σ,d,ιa​,ιu​,s,s′ as above, again a definition with no built-in hypothesis on σ\sigmaσ. It says:

For every Sobolev-continuous GGG from HsH^sHs to Hs′H^{s'}Hs′, every Sobolev-compact K⊆HsK\subseteq H^sK⊆Hs such that every a∈Ka\in Ka∈K is continuous on the box [0,2π]d[0,2\pi]^d[0,2π]d, and every real ε>0\varepsilon>0ε>0, there is N0∈NN_0\in\mathbb{N}N0​∈N with the following property. For every N≥N0N\ge N_0N≥N0​ there exists a Ψ\PsiΨ-FNO N\mathcal{N}N with grid degree exactly NNN such that for every a∈Ka\in Ka∈K

∥G(a)−N(a)∥Hs′≤ε.\|G(a)-\mathcal{N}(a)\|_{H^{s'}}\le\varepsilon.∥G(a)−N(a)∥Hs′​≤ε.

Two points to note:

  • No continuity of N\mathcal{N}N, and no membership of N(a)\mathcal{N}(a)N(a) in Hs′H^{s'}Hs′, is required here.
  • Every Ψ\PsiΨ-FNO has N≥1N\ge1N≥1, so the case N=0N=0N=0 can never be witnessed. Any N0N_0N0​ that works must therefore be at least 111.

Mean zero (MeanZero\mathrm{MeanZero}MeanZero). A function vvv has mean zero when, for every index iii, the zeroth Fourier coefficient vanishes:

v^0,i=(2π)−d∫[0,2π]dvi dx=0.\hat v_{0,i}=(2\pi)^{-d}\int_{[0,2\pi]^d}v_i\,dx=0.v^0,i​=(2π)−d∫[0,2π]d​vi​dx=0.

By the integral convention, this also holds automatically for any component that is not integrable on the box.

L∞L^\inftyL∞ norm (linftyNorm\mathrm{linftyNorm}linftyNorm). For finite ι\iotaι, define

∥v∥L∞=ess sup⁡x∈[0,2π]d max⁡i∈ι∣vi(x)∣∈[0,∞],\|v\|_{L^\infty}=\operatorname*{ess\,sup}_{x\in[0,2\pi]^d}\ \max_{i\in\iota}|v_i(x)|\in[0,\infty],∥v∥L∞​=x∈[0,2π]desssup​ i∈ιmax​∣vi​(x)∣∈[0,∞],

the essential supremum with respect to Lebesgue measure on the box. It is 000 when ι\iotaι is empty.

Sobolev embedding constant (sobolevEmbConst\mathrm{sobolevEmbConst}sobolevEmbConst). For d∈Nd\in\mathbb{N}d∈N and real ttt, define

Cd,t=sup⁡{∥v∥L∞: v:Rd→R1, v∈Ht, ∥v∥Ht≤1}∈[0,∞].C_{d,t}=\sup\big\{\|v\|_{L^\infty}:\ v:\mathbb{R}^d\to\mathbb{R}^1,\ v\in H^t,\ \|v\|_{H^t}\le1\big\}\in[0,\infty].Cd,t​=sup{∥v∥L∞​: v:Rd→R1, v∈Ht, ∥v∥Ht​≤1}∈[0,∞].

The set always contains the zero function. The supremum may equal ∞\infty∞.

Darcy coefficient set (darcyCoeffSet\mathrm{darcyCoeffSet}darcyCoeffSet). For d∈Nd\in\mathbb{N}d∈N and reals s,δ,λs,\delta,\lambdas,δ,λ (no sign or range constraints on any of them), write a~=a−1\tilde a=a-1a~=a−1 for the pointwise difference with the constant function 111, t=d/2+δt=d/2+\deltat=d/2+δ, and C=Cd,tC=C_{d,t}C=Cd,t​. The set Aλs\mathcal{A}^s_\lambdaAλs​ consists of all scalar functions a:Rd→R1a:\mathbb{R}^d\to\mathbb{R}^1a:Rd→R1 satisfying all four conditions:

  1. a∈Hsa\in H^sa∈Hs.
  2. ∥a∥Hs≤max⁡(λ−1,0)\|a\|_{H^s}\le\max(\lambda^{-1},0)∥a∥Hs​≤max(λ−1,0), with the convention 0−1=00^{-1}=00−1=0. So if λ≤0\lambda\le0λ≤0, this forces ∥a∥Hs=0\|a\|_{H^s}=0∥a∥Hs​=0.
  3. ∥a~∥L∞≤C⋅∥a~∥Ht\|\tilde a\|_{L^\infty}\le C\cdot\|\tilde a\|_{H^{t}}∥a~∥L∞​≤C⋅∥a~∥Ht​, computed in [0,∞][0,\infty][0,∞] with ∞⋅0=0\infty\cdot0=0∞⋅0=0. This is imposed as a condition, not derived.
  4. C⋅∥a~∥Ht≤max⁡(1−λ,0)C\cdot\|\tilde a\|_{H^{t}}\le\max(1-\lambda,0)C⋅∥a~∥Ht​≤max(1−λ,0). So if λ≥1\lambda\ge1λ≥1, this forces C⋅∥a~∥Ht=0C\cdot\|\tilde a\|_{H^t}=0C⋅∥a~∥Ht​=0.

Membership of a~\tilde aa~ in HtH^tHt is not separately required, and no positivity of aaa is stated directly.

Darcy solution (IsDarcySolution\mathrm{IsDarcySolution}IsDarcySolution). For scalar functions a,f,u:Rd→R1a,f,u:\mathbb{R}^d\to\mathbb{R}^1a,f,u:Rd→R1, with no hypotheses on aaa or fff, the property holds when all of the following are true:

  1. u∈H1u\in H^1u∈H1.
  2. uuu has mean zero: u^0=0\hat u_0=0u^0​=0.
  3. There exist scalar functions g1,…,gdg_1,\dots,g_dg1​,…,gd​, each in L2L^2L2, such that:
    • for all jjj and all k∈Zdk\in\mathbb{Z}^dk∈Zd,  (gj)^k=i kj u^k\ \hat{(g_j)}_k=\mathrm{i}\,k_j\,\hat u_k (gj​)^​k​=ikj​u^k​;
    • for every k∈Zdk\in\mathbb{Z}^dk∈Zd,
−∑j=1di kj (a gj)^k=f^k,-\sum_{j=1}^{d}\mathrm{i}\,k_j\,\widehat{(a\,g_j)}_k=\hat f_k,−j=1∑d​ikj​(agj​)​k​=f^​k​,
 where $a\,g_j$ is the pointwise product.

Consequences of the conventions:

  • All Fourier coefficients are the integral ones above, so if a gja\,g_jagj​ or fff is not integrable on the box, the corresponding coefficients are 000.
  • At k=0k=0k=0 the left side is 000, so the definition forces f^0=0\hat f_0=0f^​0​=0.
  • For d=0d=0d=0 there are no gjg_jgj​, and the conditions reduce to u∈H1u\in H^1u∈H1, u^0=0\hat u_0=0u^0​=0 and f^0=0\hat f_0=0f^​0​=0.
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