Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4.4 (as proved): sample error bound for spectral JEPA risk

Proved
JEPAGeneralization.sample_error_bound_spectral_jepa

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

jepamatrix-factorizationrademacher-complexityspectral-graph-theoryworld-models

Let www be an action-conditioned co-occurrence model on a finite nonempty observation space X\mathcal XX with positive marginals, and fix an action aaa and k≥1k\ge1k≥1. Let F\mathcal FF be a nonempty class of encoders f:X→Rkf:\mathcal X\to\mathbb R^kf:X→Rk and G\mathcal GG a nonempty class of predictors g:Rk×A→Rkg:\mathbb R^k\times\mathcal A\to\mathbb R^kg:Rk×A→Rk, all with sup-norm below κ\kappaκ: ∣f(x)ℓ∣<κ|f(x)_\ell|<\kappa∣f(x)ℓ​∣<κ and ∣g(y,a′)ℓ∣<κ|g(y,a')_\ell|<\kappa∣g(y,a′)ℓ​∣<κ for all arguments and coordinates. Let n=2mn=2mn=2m with m≥1m\ge1m≥1. Let S=((zi,zi+,zi′))i≤mS=((z_i,z_i^+,z_i'))_{i\le m}S=((zi​,zi+​,zi′​))i≤m​ be the sample of Definition A.3, i.e. mmm i.i.d. tuples with z∼PXz\sim\mathrm P_Xz∼PX​, z+∼P(⋅∣z,a)z^+\sim\mathrm P(\cdot\mid z,a)z+∼P(⋅∣z,a) and z′∼w(⋅∣a)z'\sim w(\cdot\mid a)z′∼w(⋅∣a). Let δ∈(0,1)\delta\in(0,1)δ∈(0,1). Then with probability at least 1−δ1-\delta1−δ over SSS, every minimizer (f^,g^)(\hat f,\hat g)(f^​,g^​) of the tuple risk R^S(⋅,⋅,a)\hat{\mathcal R}_S(\cdot,\cdot,a)R^S​(⋅,⋅,a) over F×G\mathcal F\times\mathcal GF×G satisfies

RS-JEPA(f^,g^,a)−inf⁡f∈F, g∈GRS-JEPA(f,g,a)≤c1[Rn/2(G∘F)+Rn/2(F)]+c2(log⁡(2/δ)n+δ),\mathcal R_{\mathrm{S\text{-}JEPA}}(\hat f,\hat g,a)-\inf_{f\in\mathcal F,\,g\in\mathcal G}\mathcal R_{\mathrm{S\text{-}JEPA}}(f,g,a)\le c_1\big[\mathfrak R_{n/2}(\mathcal G\circ\mathcal F)+\mathfrak R_{n/2}(\mathcal F)\big]+c_2\Big(\sqrt{\tfrac{\log(2/\delta)}{n}}+\delta\Big),RS-JEPA​(f^​,g^​,a)−f∈F,g∈Ginf​RS-JEPA​(f,g,a)≤c1​[Rn/2​(G∘F)+Rn/2​(F)]+c2​(nlog(2/δ)​​+δ),

with c1=32k2κ3+32kκc_1=32k^2\kappa^3+32k\kappac1​=32k2κ3+32kκ and c2=8kκ2+2k2κ4c_2=8k\kappa^2+2k^2\kappa^4c2​=8kκ2+2k2κ4. Here

Rm(F)=max⁡ℓmax⁡z1,…,zmEσsup⁡f∈F1m∑i=1mσifℓ(zi)\mathfrak R_m(\mathcal F)=\max_\ell\max_{z_1,\dots,z_m}\mathbb E_\sigma\sup_{f\in\mathcal F}\frac1m\sum_{i=1}^m\sigma_if_\ell(z_i)Rm​(F)=ℓmax​z1​,…,zm​max​Eσ​f∈Fsup​m1​i=1∑m​σi​fℓ​(zi​)

and

Rm(G∘F)=max⁡ℓmax⁡z1,…,zmEσsup⁡f∈F,g∈G1m∑i=1mσi g(f(zi),a)ℓ.\mathfrak R_m(\mathcal G\circ\mathcal F)=\max_\ell\max_{z_1,\dots,z_m}\mathbb E_\sigma\sup_{f\in\mathcal F,g\in\mathcal G}\frac1m\sum_{i=1}^m\sigma_i\,g(f(z_i),a)_\ell.Rm​(G∘F)=ℓmax​z1​,…,zm​max​Eσ​f∈F,g∈Gsup​m1​i=1∑m​σi​g(f(zi​),a)ℓ​.

This is the sample-error half of the paper's approximation–sample error trade-off. Richer encoder and predictor classes, or a larger kkk, raise the right-hand side.

Formalization Note This is the version the proof establishes. (1) The comparison point is the infimum of the risk over F×G\mathcal F\times\mathcal GF×G, not the unrestricted minimizer (f∗,g∗)(f^*,g^*)(f∗,g∗) of Section 3.1. The proof needs R^S(f∗,g∗)≤R(f∗,g∗)+ϵn\hat{\mathcal R}_S(f^*,g^*)\le\mathcal R(f^*,g^*)+\epsilon_nR^S​(f∗,g∗)≤R(f∗,g∗)+ϵn​, which uses (f∗,g∗)∈F×G(f^*,g^*)\in\mathcal F\times\mathcal G(f∗,g∗)∈F×G. With the unrestricted minimizer the printed bound fails: take F={0}\mathcal F=\{0\}F={0}, G={0}\mathcal G=\{0\}G={0} and small κ\kappaκ. (2) R(G∘F)\mathfrak R(\mathcal G\circ\mathcal F)R(G∘F) is the coordinatewise complexity of x↦g(f(x),a)x\mapsto g(f(x),a)x↦g(f(x),a) used in the proof (the classes Ha,ℓ\mathcal H_{a,\ell}Ha,ℓ​). The display in the theorem defines it instead as the complexity of the loss class. (3) The sample is the i.i.d. tuple law of Definition A.3, which is the law of the permutation construction. Its probability is an exact finite sum. (4) Minimizers are quantified universally; the paper takes their existence for granted.

Preamble
import Mathlib
import Definitions.Def_JEPAGeneralization_Basic

open Finset
Formal statement
namespace JEPAGeneralization

theorem sample_error_bound_spectral_jepa {X A : Type*} [Fintype X] [Nonempty X] {k : ℕ}
    (hk : 1 ≤ k) (pX : X → ℝ) (w : X → X → A → ℝ) (hw : IsCoOccurrence pX w) (a : A)
    (F : Set (X → Fin k → ℝ)) (hF : F.Nonempty)
    (G : Set ((Fin k → ℝ) → A → Fin k → ℝ)) (hG : G.Nonempty) (κ : ℝ)
    (hFκ : ∀ f ∈ F, ∀ x i, |f x i| < κ) (hGκ : ∀ g ∈ G, ∀ y a' i, |g y a' i| < κ)
    (m : ℕ) (hm : 1 ≤ m) (δ : ℝ) (hδ0 : 0 < δ) (hδ1 : δ < 1) :
    1 - δ ≤ sampleProb w a m (fun S => ∀ fh ∈ F, ∀ gh ∈ G,
      (∀ f ∈ F, ∀ g ∈ G, empRiskS fh gh a S ≤ empRiskS f g a S) →
        sJepaRisk pX w fh gh a - (⨅ p : F × G, sJepaRisk pX w p.1.1 p.2.1 a) ≤
          (32 * (k : ℝ) ^ 2 * κ ^ 3 + 32 * k * κ) * (radPred m F G a + radEnc m F) +
            (8 * (k : ℝ) * κ ^ 2 + 2 * (k : ℝ) ^ 2 * κ ^ 4) *
              (Real.sqrt (Real.log (2 / δ) / (2 * m : ℝ)) + δ)) := by sorry

end JEPAGeneralization
Source
Cui, Zhang, Wen, Cheng and Wang, A Generalization Theory for JEPA-Based World Models, arXiv:2606.27014v2 (2026), Section 4.2, Theorem 4.4, eq. (20), p. 6; proof in Appendix A.2, eq. (54)-(60), pp. 15-16
Read-back

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

Setting. XXX is a finite, nonempty set of observations and AAA is an arbitrary set of actions. k≥1k \ge 1k≥1 is a natural number, and latent vectors live in Rk\mathbb{R}^kRk with the Euclidean inner product u⊤v=∑i=1kuiviu^\top v = \sum_{i=1}^k u_i v_iu⊤v=∑i=1k​ui​vi​. An encoder is a map f:X→Rkf : X \to \mathbb{R}^kf:X→Rk. A predictor is a map g:Rk×A→Rkg : \mathbb{R}^k \times A \to \mathbb{R}^kg:Rk×A→Rk.

We are given pX:X→Rp_X : X \to \mathbb{R}pX​:X→R and w:X×X×A→Rw : X \times X \times A \to \mathbb{R}w:X×X×A→R, assumed to form a co-occurrence model:

  • w(x,x+,b)≥0w(x,x^+,b) \ge 0w(x,x+,b)≥0 for all x,x+,bx, x^+, bx,x+,b;
  • ∑xpX(x)=1\sum_x p_X(x) = 1∑x​pX​(x)=1 and pX(x)>0p_X(x) > 0pX​(x)>0 for every xxx;
  • ∑x+w(x,x+,b)=pX(x)\sum_{x^+} w(x,x^+,b) = p_X(x)∑x+​w(x,x+,b)=pX​(x) for every xxx and every action bbb;
  • the next-state marginal w(x+∣b):=∑xw(x,x+,b)w(x^+\mid b) := \sum_x w(x,x^+,b)w(x+∣b):=∑x​w(x,x+,b) is strictly positive for every x+x^+x+ and every bbb.

A fixed action a∈Aa \in Aa∈A is chosen. We are also given:

  • a nonempty set F\mathcal FF of encoders and a nonempty set G\mathcal GG of predictors;
  • a real κ\kappaκ with ∣f(x)i∣<κ|f(x)_i| < \kappa∣f(x)i​∣<κ for all f∈Ff \in \mathcal Ff∈F, all x∈Xx \in Xx∈X and all coordinates iii;
  • ∣g(y,a′)i∣<κ|g(y,a')_i| < \kappa∣g(y,a′)i​∣<κ for all g∈Gg \in \mathcal Gg∈G, all y∈Rky \in \mathbb{R}^ky∈Rk, all actions a′∈Aa' \in Aa′∈A and all iii.

These bounds are strict, and since F\mathcal FF, XXX and kkk are nonempty they force κ>0\kappa > 0κ>0. Finally, m≥1m \ge 1m≥1 is a natural number and δ\deltaδ is a real number with 0<δ<10 < \delta < 10<δ<1. No normalization of fff or ggg is assumed.

Objects. The normalized co-occurrence matrix Mˉ(a)\bar M(a)Mˉ(a) is the X×XX \times XX×X matrix with entries

Mˉ(a)x,x′=w(x,x′,a)pX(x) w(x′∣a).\bar M(a)_{x,x'} = \frac{w(x,x',a)}{\sqrt{p_X(x)\, w(x'\mid a)}}.Mˉ(a)x,x′​=pX​(x)w(x′∣a)​w(x,x′,a)​.

The spectral JEPA risk is

RS(f,g)=∑x,x′∈X(Mˉ(a)x,x′−pX(x) w(x′∣a)  g(f(x),a)⊤f(x′))2.R_{S}(f,g) = \sum_{x,x'\in X}\Big(\bar M(a)_{x,x'} - \sqrt{p_X(x)}\,\sqrt{w(x'\mid a)}\; g(f(x),a)^\top f(x')\Big)^2.RS​(f,g)=x,x′∈X∑​(Mˉ(a)x,x′​−pX​(x)​w(x′∣a)​g(f(x),a)⊤f(x′))2.

This is ∥Mˉ(a)−G⊤F∥F2\|\bar M(a) - G^\top F\|_F^2∥Mˉ(a)−G⊤F∥F2​, where:

  • GGG is the k×∣X∣k\times|X|k×∣X∣ matrix with columns pX(x) g(f(x),a)\sqrt{p_X(x)}\,g(f(x),a)pX​(x)​g(f(x),a);
  • FFF is the k×∣X∣k\times|X|k×∣X∣ matrix with columns w(x∣a) f(x)\sqrt{w(x\mid a)}\,f(x)w(x∣a)​f(x).

A sample is an mmm-tuple S=((zi,zi+,zi′))i=1mS = ((z_i,z_i^+,z_i'))_{i=1}^mS=((zi​,zi+​,zi′​))i=1m​ of triples in X3X^3X3. Its empirical risk is

R^S(f,g)=1m∑i=1m[(g(f(zi),a)⊤f(zi′))2−2 g(f(zi),a)⊤f(zi+)].\hat R_S(f,g) = \frac1m\sum_{i=1}^m\Big[\big(g(f(z_i),a)^\top f(z_i')\big)^2 - 2\,g(f(z_i),a)^\top f(z_i^+)\Big].R^S​(f,g)=m1​i=1∑m​[(g(f(zi​),a)⊤f(zi′​))2−2g(f(zi​),a)⊤f(zi+​)].

The probability of an event about SSS is the sum, over all S∈(X3)mS \in (X^3)^mS∈(X3)m in the event, of

∏i=1mw(zi,zi+,a) w(zi′∣a).\prod_{i=1}^m w(z_i,z_i^+,a)\,w(z_i'\mid a).i=1∏m​w(zi​,zi+​,a)w(zi′​∣a).

In other words, the mmm triples are treated as independent, each with law w(z,z+,a)⋅w(z′∣a)w(z,z^+,a)\cdot w(z'\mid a)w(z,z+,a)⋅w(z′∣a); under the hypotheses this law has total mass 111. No underlying dataset or permutation enters.

Rademacher complexities. For a class HHH of real functions on XXX and points z∈Xmz \in X^mz∈Xm, define

R^(H;z)=2−m∑σ∈{±1}m sup⁡φ∈H1m∑i=1mσiφ(zi),\widehat{\mathfrak R}(H;z) = 2^{-m}\sum_{\sigma\in\{\pm1\}^m}\ \sup_{\varphi\in H}\frac1m\sum_{i=1}^m\sigma_i\varphi(z_i),R(H;z)=2−mσ∈{±1}m∑​ φ∈Hsup​m1​i=1∑m​σi​φ(zi​),

and the worst-case version Rm(H)=max⁡z∈XmR^(H;z)\mathfrak R_m(H) = \max_{z\in X^m}\widehat{\mathfrak R}(H;z)Rm​(H)=maxz∈Xm​R(H;z). Two classes are used:

  • the encoder complexity
Nm(F)=max⁡1≤ℓ≤kRm({x↦f(x)ℓ:f∈F});\mathfrak N_m(\mathcal F) = \max_{1\le \ell\le k}\mathfrak R_m\big(\{x\mapsto f(x)_\ell : f\in\mathcal F\}\big);Nm​(F)=1≤ℓ≤kmax​Rm​({x↦f(x)ℓ​:f∈F});
  • the prediction complexity
Pm=max⁡1≤ℓ≤kRm({x↦g(f(x),a)ℓ:f∈F, g∈G}),\mathfrak P_m = \max_{1\le\ell\le k}\mathfrak R_m\big(\{x\mapsto g(f(x),a)_\ell : f\in\mathcal F,\ g\in\mathcal G\}\big),Pm​=1≤ℓ≤kmax​Rm​({x↦g(f(x),a)ℓ​:f∈F, g∈G}),

which uses the fixed action aaa.

The classes are nonempty and bounded by κ\kappaκ, so these suprema are genuine.

Assertion. With probability at least 1−δ1-\delta1−δ over the sample SSS, the following holds. For every f^∈F\hat f\in\mathcal Ff^​∈F and g^∈G\hat g\in\mathcal Gg^​∈G, if (f^,g^)(\hat f,\hat g)(f^​,g^​) minimizes R^S\hat R_SR^S​ over F×G\mathcal F\times\mathcal GF×G (that is, R^S(f^,g^)≤R^S(f,g)\hat R_S(\hat f,\hat g) \le \hat R_S(f,g)R^S​(f^​,g^​)≤R^S​(f,g) for all f∈Ff\in\mathcal Ff∈F, g∈Gg\in\mathcal Gg∈G), then

RS(f^,g^)−inf⁡f∈F, g∈GRS(f,g)  ≤  (32k2κ3+32kκ)(Pm+Nm(F))+(8kκ2+2k2κ4)(ln⁡(2/δ)2m+δ).R_S(\hat f,\hat g) - \inf_{f\in\mathcal F,\,g\in\mathcal G}R_S(f,g) \;\le\; \big(32k^2\kappa^3 + 32k\kappa\big)\big(\mathfrak P_m + \mathfrak N_m(\mathcal F)\big) + \big(8k\kappa^2 + 2k^2\kappa^4\big)\left(\sqrt{\frac{\ln(2/\delta)}{2m}} + \delta\right).RS​(f^​,g^​)−f∈F,g∈Ginf​RS​(f,g)≤(32k2κ3+32kκ)(Pm​+Nm​(F))+(8kκ2+2k2κ4)(2mln(2/δ)​​+δ).

Here ln⁡\lnln is the natural logarithm. The infimum is a genuine infimum, since RS≥0R_S \ge 0RS​≥0 and the class is nonempty. The bound carries an additive +δ+\delta+δ term inside the second factor.

For a sample on which no empirical minimizer exists in F×G\mathcal F\times\mathcal GF×G, the condition holds vacuously, and such samples count toward the probability.

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