Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 3.13: the optimal projector of an affine reconstructor

Proved
DeepONetError.optimal_projection

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

covariance-operatordeeponeterror-decompositionoperator-learningprincipal-component-analysis

Let U⊂RnU\subset\mathbb{R}^nU⊂Rn. Let R(α)=τ0+∑k=1pαkτk\mathcal{R}(\alpha)=\tau_0+\sum_{k=1}^p\alpha_k\tau_kR(α)=τ0​+∑k=1p​αk​τk​ with τ0∈L2(U)\tau_0\in L^2(U)τ0​∈L2(U) and linearly independent τ1,…,τp∈L2(U)\tau_1,\dots,\tau_p\in L^2(U)τ1​,…,τp​∈L2(U), and let ν∈P2(L2(U))\nu\in\mathcal{P}_2(L^2(U))ν∈P2​(L2(U)). Let τ1∗,…,τp∗∈span(τ1,…,τp)\tau^*_1,\dots,\tau^*_p\in\mathrm{span}(\tau_1,\dots,\tau_p)τ1∗​,…,τp∗​∈span(τ1​,…,τp​) be the dual basis, ⟨τℓ,τk∗⟩=δℓk\langle\tau_\ell,\tau^*_k\rangle=\delta_{\ell k}⟨τℓ​,τk∗​⟩=δℓk​. Then:

  1. The reconstruction error E^R\widehat{\mathcal{E}}_{\mathcal{R}}ER​ is minimized over all Borel measurable projectors P:L2(U)→Rp\mathcal{P}:L^2(U)\to\mathbb{R}^pP:L2(U)→Rp by
P(u)=(⟨u−τ0,τ1∗⟩,…,⟨u−τ0,τp∗⟩).\mathcal{P}(u)=\big(\langle u-\tau_0,\tau^*_1\rangle,\dots,\langle u-\tau_0,\tau^*_p\rangle\big).P(u)=(⟨u−τ0​,τ1∗​⟩,…,⟨u−τ0​,τp∗​⟩).
  1. For this P\mathcal{P}P,
R∘P(u)=τ0⊥+∑k=1p⟨u,τk∗⟩τk,τ0⊥=τ0−∑k=1p⟨τ0,τk∗⟩τk,\mathcal{R}\circ\mathcal{P}(u)=\tau_0^\perp+\sum_{k=1}^p\langle u,\tau^*_k\rangle\tau_k,\qquad\tau_0^\perp=\tau_0-\sum_{k=1}^p\langle\tau_0,\tau^*_k\rangle\tau_k,R∘P(u)=τ0⊥​+k=1∑p​⟨u,τk∗​⟩τk​,τ0⊥​=τ0​−k=1∑p​⟨τ0​,τk∗​⟩τk​,

and τ0⊥\tau_0^\perpτ0⊥​ is the orthogonal projection of τ0\tau_0τ0​ onto span(τ1,…,τp)⊥\mathrm{span}(\tau_1,\dots,\tau_p)^\perpspan(τ1​,…,τp​)⊥.

Formalization Note The dual basis is defined explicitly through the inverse Gram matrix, τk∗=∑j(Gram−1)kjτj\tau^*_k=\sum_j(\mathrm{Gram}^{-1})_{kj}\tau_jτk∗​=∑j​(Gram−1)kj​τj​. Its two defining properties (it lies in the span and is dual to τ1,…,τp\tau_1,\dots,\tau_pτ1​,…,τp​) are included as conclusions. That τ0⊥\tau_0^\perpτ0⊥​ is the orthogonal projection onto the complement is stated as: τ0⊥\tau_0^\perpτ0⊥​ lies in the complement and τ0−τ0⊥\tau_0-\tau_0^\perpτ0​−τ0⊥​ lies in the span.

Preamble
import Mathlib
import Definitions.Def_DeepONetError_Basic

open MeasureTheory
Formal statement
namespace DeepONetError

theorem optimal_projection {n p : ℕ} {U : Set (Fin n → ℝ)}
    [MeasurableSpace (L2 U)] [BorelSpace (L2 U)]
    (tau : Fin (p + 1) → L2 U) (htau : LinearIndependent ℝ (fun k : Fin p => tau k.succ))
    (nu : Measure (L2 U)) (hnu : IsP2 nu) :
    (∀ k, dualBasis (fun j => tau j.succ) k ∈
      Submodule.span ℝ (Set.range fun j : Fin p => tau j.succ)) ∧
    (∀ k l : Fin p, inner ℝ (tau l.succ) (dualBasis (fun j => tau j.succ) k) =
      if l = k then 1 else 0) ∧
    (∀ Proj : L2 U → EuclideanSpace ℝ (Fin p), Measurable Proj →
      recErr nu (trunkRec tau) (optProj tau) ≤ recErr nu (trunkRec tau) Proj) ∧
    (∀ u : L2 U, trunkRec tau (optProj tau u) =
      (tau 0 - ∑ k, inner ℝ (tau 0) (dualBasis (fun j => tau j.succ) k) • tau k.succ) +
        ∑ k, inner ℝ u (dualBasis (fun j => tau j.succ) k) • tau k.succ) ∧
    (tau 0 - ∑ k, inner ℝ (tau 0) (dualBasis (fun j => tau j.succ) k) • tau k.succ ∈
        (Submodule.span ℝ (Set.range fun j : Fin p => tau j.succ))ᗮ ∧
      ∑ k, inner ℝ (tau 0) (dualBasis (fun j => tau j.succ) k) • tau k.succ ∈
        Submodule.span ℝ (Set.range fun j : Fin p => tau j.succ)) := by sorry

end DeepONetError
Source
Lanthaler, Mishra and Karniadakis, Error estimates for DeepOnets: A deep learning framework in infinite dimensions, arXiv:2102.09618v3 (2022), Section 3.4, Lemma 3.13, eqs. (3.19)-(3.20), p. 19; proof in Appendix C.4, p. 85
Read-back

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

Fix natural numbers nnn and ppp and an arbitrary set U⊆RnU \subseteq \mathbb{R}^nU⊆Rn. No boundedness or measurability of UUU is assumed. Let L2(U)L^2(U)L2(U) be the real Hilbert space of square-integrable functions on Rn\mathbb{R}^nRn with respect to Lebesgue measure restricted to UUU, modulo a.e. equality. Its inner product is ⟨f,g⟩=∫Ufg dx\langle f, g\rangle = \int_U f g \, dx⟨f,g⟩=∫U​fgdx. L2(U)L^2(U)L2(U) carries a σ\sigmaσ-algebra that is assumed to be its Borel σ\sigmaσ-algebra for the norm topology.

The data are:

  • elements τ0,τ1,…,τp∈L2(U)\tau_0, \tau_1, \dots, \tau_p \in L^2(U)τ0​,τ1​,…,τp​∈L2(U), such that τ1,…,τp\tau_1, \dots, \tau_pτ1​,…,τp​ are linearly independent (no condition is placed on τ0\tau_0τ0​);
  • a measure ν\nuν on L2(U)L^2(U)L2(U) that is a probability measure with finite second moment, ∫∥v∥2 dν(v)<∞\int \|v\|^2 \, d\nu(v) < \infty∫∥v∥2dν(v)<∞.

Write V=span⁡{τ1,…,τp}V = \operatorname{span}\{\tau_1,\dots,\tau_p\}V=span{τ1​,…,τp​}. Let GGG be the Gram matrix Gij=⟨τi,τj⟩G_{ij} = \langle \tau_i, \tau_j\rangleGij​=⟨τi​,τj​⟩ for i,j=1,…,pi,j = 1,\dots,pi,j=1,…,p, and let G−1G^{-1}G−1 be its matrix inverse. The inverse convention returns the zero matrix when GGG is singular, but GGG is invertible here by linear independence. Define the "dual vectors"

τk∗=∑j=1p(G−1)kj τj,k=1,…,p.\tau_k^* = \sum_{j=1}^p (G^{-1})_{kj}\, \tau_j, \qquad k = 1,\dots,p.τk∗​=j=1∑p​(G−1)kj​τj​,k=1,…,p.

Define the reconstructor R:Rp→L2(U)R : \mathbb{R}^p \to L^2(U)R:Rp→L2(U) and the projector P⋆:L2(U)→RpP^\star : L^2(U) \to \mathbb{R}^pP⋆:L2(U)→Rp, where Rp\mathbb{R}^pRp carries the Euclidean norm:

R(α)=τ0+∑k=1pαkτk,P⋆(u)=(⟨u−τ0,τ1∗⟩,…,⟨u−τ0,τp∗⟩).R(\alpha) = \tau_0 + \sum_{k=1}^p \alpha_k \tau_k, \qquad P^\star(u) = \bigl(\langle u - \tau_0, \tau_1^*\rangle, \dots, \langle u - \tau_0, \tau_p^*\rangle\bigr).R(α)=τ0​+k=1∑p​αk​τk​,P⋆(u)=(⟨u−τ0​,τ1∗​⟩,…,⟨u−τ0​,τp∗​⟩).

For any map P:L2(U)→RpP : L^2(U) \to \mathbb{R}^pP:L2(U)→Rp, the reconstruction error is the value in [0,∞][0,\infty][0,∞]

E(P)=(∫∥R(P(v))−v∥L2(U)2 dν(v))1/2.\mathcal{E}(P) = \Bigl(\int \|R(P(v)) - v\|_{L^2(U)}^2 \, d\nu(v)\Bigr)^{1/2}.E(P)=(∫∥R(P(v))−v∥L2(U)2​dν(v))1/2.

This is computed as a lower Lebesgue integral of a [0,∞][0,\infty][0,∞]-valued function, so it is defined even for non-measurable integrands and may equal +∞+\infty+∞.

The theorem asserts that all five of the following hold simultaneously:

  1. Each τk∗\tau_k^*τk∗​, for k=1,…,pk = 1,\dots,pk=1,…,p, lies in VVV.
  2. For all k,l∈{1,…,p}k, l \in \{1,\dots,p\}k,l∈{1,…,p}, ⟨τl,τk∗⟩\langle \tau_l, \tau_k^*\rangle⟨τl​,τk∗​⟩ equals 111 if l=kl = kl=k and 000 otherwise.
  3. For every Borel-measurable map P:L2(U)→RpP : L^2(U) \to \mathbb{R}^pP:L2(U)→Rp, E(P⋆)≤E(P)\mathcal{E}(P^\star) \le \mathcal{E}(P)E(P⋆)≤E(P). The comparison is only against measurable PPP and only for this fixed RRR; it is not asserted that P⋆P^\starP⋆ is the unique minimizer.
  4. For every u∈L2(U)u \in L^2(U)u∈L2(U):
R(P⋆(u))=(τ0−∑k=1p⟨τ0,τk∗⟩τk)+∑k=1p⟨u,τk∗⟩τk.R(P^\star(u)) = \Bigl(\tau_0 - \sum_{k=1}^p \langle \tau_0, \tau_k^*\rangle \tau_k\Bigr) + \sum_{k=1}^p \langle u, \tau_k^*\rangle \tau_k.R(P⋆(u))=(τ0​−k=1∑p​⟨τ0​,τk∗​⟩τk​)+k=1∑p​⟨u,τk∗​⟩τk​.
  1. The vector τ0−∑k⟨τ0,τk∗⟩τk\tau_0 - \sum_{k} \langle \tau_0, \tau_k^*\rangle \tau_kτ0​−∑k​⟨τ0​,τk∗​⟩τk​ lies in the orthogonal complement V⊥V^\perpV⊥, and ∑k⟨τ0,τk∗⟩τk\sum_k \langle \tau_0, \tau_k^*\rangle \tau_k∑k​⟨τ0​,τk∗​⟩τk​ lies in VVV.

The hypothesis on ν\nuν is not referenced by parts 1, 2, 4 and 5.

Edge cases.

  • p=0p = 0p=0. The linear-independence hypothesis holds vacuously and V={0}V = \{0\}V={0}. Parts 1 and 2 are vacuous. RRR is the constant τ0\tau_0τ0​, so every PPP gives the same error and part 3 is trivial. Part 4 reads τ0=τ0\tau_0 = \tau_0τ0​=τ0​. Part 5 says τ0∈{0}⊥=L2(U)\tau_0 \in \{0\}^\perp = L^2(U)τ0​∈{0}⊥=L2(U) and 0∈{0}0 \in \{0\}0∈{0}.
  • UUU of Lebesgue measure zero. L2(U)L^2(U)L2(U) is the zero space. The linear-independence hypothesis can then hold only when p=0p = 0p=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