Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma A.2: the empirical JEPA risk is unbiased

Proved
JEPAGeneralization.empirical_jepa_risk_unbiased

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 observation space X\mathcal XX with positive marginals. Fix an encoder fff, a predictor ggg, an action aaa and n≥2n\ge2n≥2. Let x1,…,xnx_1,\dots,x_nx1​,…,xn​ be i.i.d. from PX\mathrm P_XPX​, and let

R^n(f,g,a)=−2 1n∑i=1nEx+∼P(⋅∣xi,a)[g(f(xi),a)⊤f(x+)]+1n(n−1)∑i≠jEx′∼P(⋅∣xj,a)[g(f(xi),a)⊤f(x′)]2.\hat{\mathcal R}_n(f,g,a)=-2\,\frac1n\sum_{i=1}^n\mathbb E_{x^+\sim\mathrm P(\cdot\mid x_i,a)}\big[g(f(x_i),a)^\top f(x^+)\big]+\frac1{n(n-1)}\sum_{i\ne j}\mathbb E_{x'\sim\mathrm P(\cdot\mid x_j,a)}\big[g(f(x_i),a)^\top f(x')\big]^2.R^n​(f,g,a)=−2n1​i=1∑n​Ex+∼P(⋅∣xi​,a)​[g(f(xi​),a)⊤f(x+)]+n(n−1)1​i=j∑​Ex′∼P(⋅∣xj​,a)​[g(f(xi​),a)⊤f(x′)]2.

Then R^n\hat{\mathcal R}_nR^n​ is an unbiased estimator of the population spectral loss:

Ex1,…,xnR^n(f,g,a)=E[(g(f(z),a)⊤f(z′))2−2 g(f(z),a)⊤f(z+)],\mathbb E_{x_1,\dots,x_n}\hat{\mathcal R}_n(f,g,a)=\mathbb E\Big[\big(g(f(z),a)^\top f(z')\big)^2-2\,g(f(z),a)^\top f(z^+)\Big],Ex1​,…,xn​​R^n​(f,g,a)=E[(g(f(z),a)⊤f(z′))2−2g(f(z),a)⊤f(z+)],

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 an independent z′∼w(⋅∣a)z'\sim w(\cdot\mid a)z′∼w(⋅∣a).

Formalization Note In Definition A.1 the first term reads g(f(x),a)⊤f(x′)g(f(x),a)^\top f(x')g(f(x),a)⊤f(x′) with x′x'x′ unbound, and it is read as f(x+)f(x^+)f(x+). The lemma's R(f,g,a)\mathcal R(f,g,a)R(f,g,a) is not defined in the paper. It is taken to be the spectral loss, the form of the risk used in the proof of Theorem 4.4. This equals RS-JEPA−∥Mˉ(a)∥F2\mathcal R_{\mathrm{S\text{-}JEPA}}-\|\bar M(a)\|_F^2RS-JEPA​−∥Mˉ(a)∥F2​, and for normalized (f,g)(f,g)(f,g) it equals RJEPA−2\mathcal R_{\mathrm{JEPA}}-2RJEPA​−2. The pairs (xi,xj)(x_i,x_j)(xi​,xj​), i≠ji\ne ji=j, are ordered.

Preamble
import Mathlib
import Definitions.Def_JEPAGeneralization_Basic

open Finset
Formal statement
namespace JEPAGeneralization

theorem empirical_jepa_risk_unbiased {X A : Type*} [Fintype X] {k : ℕ}
    (pX : X → ℝ) (w : X → X → A → ℝ) (hw : IsCoOccurrence pX w)
    (f : X → Fin k → ℝ) (g : (Fin k → ℝ) → A → Fin k → ℝ) (a : A) (n : ℕ) (hn : 2 ≤ n) :
    ∑ D : Fin n → X, datasetProb pX D * empRiskN pX w f g a D = spectralLoss pX w f g a := by sorry

end JEPAGeneralization
Source
Cui, Zhang, Wen, Cheng and Wang, A Generalization Theory for JEPA-Based World Models, arXiv:2606.27014v2 (2026), Appendix A.1, Definition A.1, eq. (26), and Lemma A.2, eq. (27), p. 12
Read-back

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

Setting. Let XXX be a finite set of observations and AAA an arbitrary set of actions. No finiteness or other structure is assumed on AAA, though it is nonempty because an action aaa is supplied. Let k≥0k \ge 0k≥0 be a natural number; latent vectors live in Rk\mathbb{R}^kRk. For u,v∈Rku, v \in \mathbb{R}^ku,v∈Rk, write ⟨u,v⟩=∑i=1kuivi\langle u, v\rangle = \sum_{i=1}^k u_i v_i⟨u,v⟩=∑i=1k​ui​vi​ for the Euclidean inner product. When k=0k = 0k=0 this is the empty sum 000.

Data and hypotheses. The theorem takes:

  • a function pX:X→Rp_X : X \to \mathbb{R}pX​:X→R;
  • a function w:X×X×A→Rw : X \times X \times A \to \mathbb{R}w:X×X×A→R, written w(x,x+,a)w(x, x^+, a)w(x,x+,a);
  • an arbitrary encoder f:X→Rkf : X \to \mathbb{R}^kf:X→Rk;
  • an arbitrary predictor g:Rk×A→Rkg : \mathbb{R}^k \times A \to \mathbb{R}^kg:Rk×A→Rk;
  • a fixed action a∈Aa \in Aa∈A;
  • a natural number nnn with n≥2n \ge 2n≥2.

No normalization, boundedness or other condition is placed on fff or ggg.

The pair (pX,w)(p_X, w)(pX​,w) is assumed to be a "co-occurrence model", meaning all of the following hold:

  1. w(x,x+,b)≥0w(x, x^+, b) \ge 0w(x,x+,b)≥0 for all x,x+∈Xx, x^+ \in Xx,x+∈X and b∈Ab \in Ab∈A.
  2. ∑xpX(x)=1\sum_{x} p_X(x) = 1∑x​pX​(x)=1, which forces XXX to be nonempty.
  3. pX(x)>0p_X(x) > 0pX​(x)>0 for every xxx.
  4. ∑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 b∈Ab \in Ab∈A.
  5. The second 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 bbb.

These conditions are imposed for every action b∈Ab \in Ab∈A, not only for aaa. Write the transition probability as

P(x+∣x,a)=w(x,x+,a)pX(x),P(x^+ \mid x, a) = \frac{w(x, x^+, a)}{p_X(x)},P(x+∣x,a)=pX​(x)w(x,x+,a)​,

which is well defined because pX>0p_X > 0pX​>0. Also abbreviate h(x):=g(f(x),a)∈Rkh(x) := g(f(x), a) \in \mathbb{R}^kh(x):=g(f(x),a)∈Rk.

Empirical risk. For a dataset D=(x1,…,xn)∈XnD = (x_1, \dots, x_n) \in X^nD=(x1​,…,xn​)∈Xn, define

R^n(D)=−2n∑i=1n∑x′∈XP(x′∣xi,a) ⟨h(xi),f(x′)⟩  +  1n(n−1)∑i,j=1i≠jn∑x′∈XP(x′∣xj,a) ⟨h(xi),f(x′)⟩2.\hat R_n(D) = -\frac{2}{n} \sum_{i=1}^n \sum_{x' \in X} P(x' \mid x_i, a)\, \langle h(x_i), f(x') \rangle \;+\; \frac{1}{n(n-1)} \sum_{\substack{i, j = 1 \\ i \ne j}}^n \sum_{x' \in X} P(x' \mid x_j, a)\, \langle h(x_i), f(x') \rangle^2 .R^n​(D)=−n2​i=1∑n​x′∈X∑​P(x′∣xi​,a)⟨h(xi​),f(x′)⟩+n(n−1)1​i,j=1i=j​∑n​x′∈X∑​P(x′∣xj​,a)⟨h(xi​),f(x′)⟩2.

The terms with i=ji = ji=j are set to 000. Because n≥2n \ge 2n≥2, the factor n(n−1)n(n-1)n(n−1) is nonzero.

Dataset weight and target quantity. Each dataset receives weight ∏i=1npX(xi)\prod_{i=1}^n p_X(x_i)∏i=1n​pX​(xi​). The target quantity is

R(f,g,a)=∑x,x′∈XpX(x) w(x′∣a) ⟨h(x),f(x′)⟩2  −  2∑x,x+∈Xw(x,x+,a) ⟨h(x),f(x+)⟩.R(f, g, a) = \sum_{x, x' \in X} p_X(x)\, w(x' \mid a)\, \langle h(x), f(x') \rangle^2 \;-\; 2 \sum_{x, x^+ \in X} w(x, x^+, a)\, \langle h(x), f(x^+) \rangle .R(f,g,a)=x,x′∈X∑​pX​(x)w(x′∣a)⟨h(x),f(x′)⟩2−2x,x+∈X∑​w(x,x+,a)⟨h(x),f(x+)⟩.

Conclusion. Under the above hypotheses, the sum over all ∣X∣n|X|^n∣X∣n datasets satisfies the exact equality

∑D∈Xn(∏i=1npX(xi)) R^n(D)  =  R(f,g,a).\sum_{D \in X^n} \Big( \prod_{i=1}^n p_X(x_i) \Big)\, \hat R_n(D) \;=\; R(f, g, a).D∈Xn∑​(i=1∏n​pX​(xi​))R^n​(D)=R(f,g,a).

In words, the expectation of R^n\hat R_nR^n​ under an i.i.d. sample of size nnn from pXp_XpX​ equals R(f,g,a)R(f, g, a)R(f,g,a).

Edge cases. The hypotheses cannot hold if XXX is empty. If k=0k = 0k=0, every inner product is 000, so both sides equal 000. The case n=1n = 1n=1 is excluded by hypothesis. The conclusion involves www only at the single action aaa, while the hypotheses constrain www at all actions.

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