Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 3.12: optimal affine subspaces and the projection error

Proved
DeepONetError.optimal_affine_subspace

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

covariance-operatordeeponeterror-decompositionoperator-learningprincipal-component-analysis

Let HHH be a separable real Hilbert space, ν∈P2(H)\nu\in\mathcal{P}_2(H)ν∈P2​(H) and p≥1p\ge1p≥1. Let Γ=∫H(v−E[v])⊗(v−E[v]) dν(v)\Gamma=\int_H(v-\mathbb{E}[v])\otimes(v-\mathbb{E}[v])\,d\nu(v)Γ=∫H​(v−E[v])⊗(v−E[v])dν(v) be the covariance operator, with eigenvalues λ1≥λ2≥⋯\lambda_1\ge\lambda_2\ge\cdotsλ1​≥λ2​≥⋯ repeated according to multiplicity, and let V^0\hat V_0V^0​ be an affine subspace whose direction V^\hat VV^ has dimension ppp. Then:

  1. There is a unique v^0∈V^0\hat v_0\in\hat V_0v^0​∈V^0​ with ∥E[v]−v^0∥=inf⁡v^∈V^0∥E[v]−v^∥\|\mathbb{E}[v]-\hat v_0\|=\inf_{\hat v\in\hat V_0}\|\mathbb{E}[v]-\hat v\|∥E[v]−v^0​∥=infv^∈V^0​​∥E[v]−v^∥.
  2. For this v^0\hat v_0v^0​,
E^Proj(V^0)=∫Hinf⁡v^∈V^0∥v−v^∥2dν=∥E[v]−v^0∥2+∫Hinf⁡v^∈V^∥v−E[v]−v^∥2dν(v).\widehat{\mathcal{E}}_{\mathrm{Proj}}(\hat V_0)=\int_H\inf_{\hat v\in\hat V_0}\|v-\hat v\|^2d\nu=\|\mathbb{E}[v]-\hat v_0\|^2+\int_H\inf_{\hat v\in\hat V}\|v-\mathbb{E}[v]-\hat v\|^2d\nu(v).EProj​(V^0​)=∫H​v^∈V^0​inf​∥v−v^∥2dν=∥E[v]−v^0​∥2+∫H​v^∈V^inf​∥v−E[v]−v^∥2dν(v).
  1. Let EjE_jEj​ be the eigenspaces of Γ\GammaΓ for its distinct eigenvalues, with nnn chosen as in Theorem 3.10. Then V^0\hat V_0V^0​ minimizes E^Proj\widehat{\mathcal{E}}_{\mathrm{Proj}}EProj​ among affine subspaces of dimension ppp if and only if
v^0=E[v]and⨁j=1n−1Ej⊂V^⊂⨁j=1nEj.\hat v_0=\mathbb{E}[v]\quad\text{and}\quad\bigoplus_{j=1}^{n-1}E_j\subset\hat V\subset\bigoplus_{j=1}^nE_j.v^0​=E[v]andj=1⨁n−1​Ej​⊂V^⊂j=1⨁n​Ej​.
  1. In that case E^Proj(V^0)=∑j>pλj\widehat{\mathcal{E}}_{\mathrm{Proj}}(\hat V_0)=\sum_{j>p}\lambda_jEProj​(V^0​)=∑j>p​λj​.

This extends Theorem 3.10 to affine subspaces: the optimal affine space passes through the mean and is spanned by the top eigenvectors of the centered covariance.

Formalization Note The paper writes E^Proj(V^)\widehat{\mathcal{E}}_{\mathrm{Proj}}(\hat V)EProj​(V^) on the left of (3.17); the proof shows it is E^Proj(V^0)\widehat{\mathcal{E}}_{\mathrm{Proj}}(\hat V_0)EProj​(V^0​). Eigenvalues come from a spectral decomposition indexed from 000, as in Theorem 3.10.

Preamble
import Mathlib
import Definitions.Def_DeepONetError_Basic

open MeasureTheory
Formal statement
namespace DeepONetError

theorem optimal_affine_subspace {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H]
    [CompleteSpace H] [TopologicalSpace.SeparableSpace H] [MeasurableSpace H] [BorelSpace H]
    (nu : Measure H) (hnu : IsP2 nu)
    (lam : ℕ → ℝ) (phi : ℕ → H) (hspec : IsSpectralDecomp (covOp nu) lam phi)
    (p : ℕ) (hp : 1 ≤ p) (V0 : AffineSubspace ℝ H) (hV0 : Module.finrank ℝ V0.direction = p) :
    (∃! v0 : H, v0 ∈ V0 ∧ ∀ w ∈ V0, ‖mean nu - v0‖ ≤ ‖mean nu - w‖) ∧
    ∀ v0 ∈ V0, (∀ w ∈ V0, ‖mean nu - v0‖ ≤ ‖mean nu - w‖) →
      projErr nu (V0 : Set H) = ‖mean nu - v0‖ₑ ^ 2 +
          (∫⁻ v, Metric.infEDist (v - mean nu) (V0.direction : Set H) ^ 2 ∂nu) ∧
      (IsOptimalAffine nu p V0 ↔
        v0 = mean nu ∧ eigSpan (covOp nu) (Set.Ioi (lam (p - 1))) ≤ V0.direction ∧
          V0.direction ≤ eigSpan (covOp nu) (Set.Ici (lam (p - 1)))) ∧
      (IsOptimalAffine nu p V0 → projErr nu (V0 : Set H) = ∑' k, ENNReal.ofReal (lam (k + p))) := 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.3, Theorem 3.12, eqs. (3.16)-(3.18), p. 18; proof in Appendix C.3.2, pp. 84-85
Read-back

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

Setting. Let HHH be a real inner product space that is complete (a real Hilbert space) and separable, equipped with its Borel σ\sigmaσ-algebra. Let ν\nuν be a measure on HHH that lies in P2(H)\mathcal P_2(H)P2​(H): ν\nuν is a probability measure and

∫H∥v∥2 dν(v)<∞\int_H \|v\|^2 \, d\nu(v) < \infty∫H​∥v∥2dν(v)<∞

(a lower Lebesgue integral of a [0,∞][0,\infty][0,∞]-valued function).

Mean and covariance. Write m=Eν[v]=∫Hv dν(v)m = \mathbb E_\nu[v] = \int_H v \, d\nu(v)m=Eν​[v]=∫H​vdν(v) for the mean, a Bochner integral. By convention it is 000 if v↦vv \mapsto vv↦v is not Bochner integrable. Let Γ:H→H\Gamma : H \to HΓ:H→H be the covariance map, defined as the Bochner integral

Γw=∫H⟨v−m, w⟩ (v−m) dν(v),\Gamma w = \int_H \langle v - m,\, w\rangle\,(v - m)\, d\nu(v),Γw=∫H​⟨v−m,w⟩(v−m)dν(v),

which by the same convention is 000 wherever the integrand is not integrable.

Spectral hypothesis. We are given a real sequence (λk)k≥0(\lambda_k)_{k \ge 0}(λk​)k≥0​ and a sequence (φk)k≥0(\varphi_k)_{k \ge 0}(φk​)k≥0​ in HHH, both indexed by all natural numbers k=0,1,2,…k = 0, 1, 2, \dotsk=0,1,2,…. They are assumed to satisfy three conditions:

  • the φk\varphi_kφk​ are orthonormal;
  • λ0≥λ1≥λ2≥⋯\lambda_0 \ge \lambda_1 \ge \lambda_2 \ge \cdotsλ0​≥λ1​≥λ2​≥⋯ is non-increasing;
  • for every w∈Hw \in Hw∈H the series ∑kλk⟨φk,w⟩φk\sum_k \lambda_k \langle \varphi_k, w\rangle \varphi_k∑k​λk​⟨φk​,w⟩φk​ is unconditionally summable in HHH with sum Γw\Gamma wΓw.

The λk\lambda_kλk​ are not assumed nonnegative. Because an orthonormal family indexed by N\mathbb NN is required, this hypothesis cannot be satisfied when HHH is finite-dimensional, and the theorem is then vacuous.

The subspace. Fix an integer p≥1p \ge 1p≥1 and an affine subspace V0⊆HV_0 \subseteq HV0​⊆H whose direction (linear) subspace V⃗0\vec V_0V0​ has dimension exactly ppp. Here "dimension" is the finite rank, which is assigned the value 000 for infinite-dimensional spaces, so p≥1p \ge 1p≥1 forces V⃗0\vec V_0V0​ to be genuinely ppp-dimensional. It also forces V0≠∅V_0 \neq \emptysetV0​=∅, since the empty affine subspace has direction {0}\{0\}{0}.

Auxiliary notions used in the conclusion.

  • Projection error. For a set S⊆HS \subseteq HS⊆H,
PEν(S)=∫H(inf⁡w∈S∥v−w∥)2dν(v)∈[0,∞].\mathrm{PE}_\nu(S) = \int_H \Big(\inf_{w \in S} \|v - w\|\Big)^2 d\nu(v) \in [0,\infty].PEν​(S)=∫H​(w∈Sinf​∥v−w∥)2dν(v)∈[0,∞].
  • Optimal affine subspace. V0V_0V0​ is optimal for (ν,p)(\nu, p)(ν,p) if two conditions hold. First, dim⁡V⃗0=p\dim \vec V_0 = pdimV0​=p. Second, PEν(V0)≤PEν(W)\mathrm{PE}_\nu(V_0) \le \mathrm{PE}_\nu(W)PEν​(V0​)≤PEν​(W) for every affine subspace WWW with dim⁡W⃗=p\dim \vec W = pdimW=p, with dimension again meaning finite rank.
  • Eigenvector span. For S⊆RS \subseteq \mathbb RS⊆R, let ESE_SES​ be the linear span (no closure taken) of the set
{v∈H:Γv=c v for some c∈S}.\{v \in H : \Gamma v = c\,v \text{ for some } c \in S\}.{v∈H:Γv=cv for some c∈S}.

This set includes v=0v = 0v=0, and it consists of all eigenvectors of Γ\GammaΓ with eigenvalue in SSS, not only the φk\varphi_kφk​.

Conclusion. Two things hold.

(1) Unique nearest point. There exists a unique v0∈V0v_0 \in V_0v0​∈V0​ such that ∥m−v0∥≤∥m−w∥\|m - v_0\| \le \|m - w\|∥m−v0​∥≤∥m−w∥ for all w∈V0w \in V_0w∈V0​.

(2) Properties of the nearest point. Let v0∈V0v_0 \in V_0v0​∈V0​ be any point with ∥m−v0∥≤∥m−w∥\|m - v_0\| \le \|m - w\|∥m−v0​∥≤∥m−w∥ for all w∈V0w \in V_0w∈V0​. Then all three of the following hold.

  • (a) Error decomposition. In [0,∞][0,\infty][0,∞],
PEν(V0)=∥m−v0∥2+∫H(inf⁡w∈V⃗0∥(v−m)−w∥)2dν(v).\mathrm{PE}_\nu(V_0) = \|m - v_0\|^2 + \int_H \Big(\inf_{w \in \vec V_0} \|(v - m) - w\|\Big)^2 d\nu(v).PEν​(V0​)=∥m−v0​∥2+∫H​(w∈V0​inf​∥(v−m)−w∥)2dν(v).
  • (b) Characterization of optimality. V0V_0V0​ is an optimal affine subspace for (ν,p)(\nu,p)(ν,p) if and only if both of the following hold:
    • v0=mv_0 = mv0​=m;
    • with λp−1\lambda_{p-1}λp−1​ the ppp-th term of the sequence (counting from λ0\lambda_0λ0​),
E(λp−1,∞)⊆V⃗0⊆E[λp−1,∞).E_{(\lambda_{p-1},\infty)} \subseteq \vec V_0 \subseteq E_{[\lambda_{p-1},\infty)}.E(λp−1​,∞)​⊆V0​⊆E[λp−1​,∞)​.
  • (c) Optimal error. If V0V_0V0​ is an optimal affine subspace for (ν,p)(\nu,p)(ν,p), then
PEν(V0)=∑k=0∞max⁡(λk+p, 0)=∑k≥pmax⁡(λk,0).\mathrm{PE}_\nu(V_0) = \sum_{k=0}^{\infty} \max(\lambda_{k+p},\,0) = \sum_{k \ge p} \max(\lambda_k, 0).PEν​(V0​)=k=0∑∞​max(λk+p​,0)=k≥p∑​max(λk​,0).

The sum is taken in [0,∞][0,\infty][0,∞], so it always exists and may equal ∞\infty∞. Negative λ\lambdaλ's contribute 000.

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