Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma A.4: the tuple risk is unbiased for the empirical JEPA risk

Proved
JEPAGeneralization.tuple_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 fff, ggg, aaa, m≥1m\ge1m≥1 and a dataset x1,…,x2mx_1,\dots,x_{2m}x1​,…,x2m​. Draw a uniform permutation π\piπ of {1,…,2m}\{1,\dots,2m\}{1,…,2m} and, for i=1,…,mi=1,\dots,mi=1,…,m, set zi=xπ(2i−1)z_i=x_{\pi(2i-1)}zi​=xπ(2i−1)​, then draw zi+∼P(⋅∣zi,a)z_i^+\sim\mathrm P(\cdot\mid z_i,a)zi+​∼P(⋅∣zi​,a) and zi′∼P(⋅∣xπ(2i),a)z_i'\sim\mathrm P(\cdot\mid x_{\pi(2i)},a)zi′​∼P(⋅∣xπ(2i)​,a), all independently given π\piπ. Then the tuple risk is an unbiased estimator of the empirical JEPA risk:

ES 1m∑i=1m[(g(f(zi),a)⊤f(zi′))2−2 g(f(zi),a)⊤f(zi+)]=R^2m(f,g,a),\mathbb E_S\,\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]=\hat{\mathcal R}_{2m}(f,g,a),ES​m1​i=1∑m​[(g(f(zi​),a)⊤f(zi′​))2−2g(f(zi​),a)⊤f(zi+​)]=R^2m​(f,g,a),

where R^2m\hat{\mathcal R}_{2m}R^2m​ is the empirical JEPA risk of Definition A.1 on x1,…,x2mx_1,\dots,x_{2m}x1​,…,x2m​.

Formalization Note The expectation over π\piπ is the average over all (2m)!(2m)!(2m)! permutations, and the expectations over zi+,zi′z_i^+,z_i'zi+​,zi′​ are exact sums against the transition probabilities. As in Lemma A.2, f(x′)f(x')f(x′) in the first term of Definition A.1 is read as f(x+)f(x^+)f(x+).

Preamble
import Mathlib
import Definitions.Def_JEPAGeneralization_Basic

open Finset
Formal statement
namespace JEPAGeneralization

theorem tuple_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) (m : ℕ) (hm : 1 ≤ m)
    (D : Fin (2 * m) → X) :
    expEmpRiskS pX w f g a D = empRiskN pX w f g a D := 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.3, eq. (28)-(29), and Lemma A.4, eq. (30), 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 any set of actions. Let k∈Nk \in \mathbb{N}k∈N be the latent dimension; k=0k = 0k=0 is allowed. The theorem is stated for every choice of the following data:

  • a function pX:X→Rp_X : X \to \mathbb{R}pX​:X→R and 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), satisfying the co-occurrence hypotheses:

    • w(x,x+,a)≥0w(x, x^+, a) \ge 0w(x,x+,a)≥0 for all x,x+,ax, x^+, ax,x+,a;
    • ∑x∈XpX(x)=1\sum_{x \in X} p_X(x) = 1∑x∈X​pX​(x)=1;
    • pX(x)>0p_X(x) > 0pX​(x)>0 for every x∈Xx \in Xx∈X;
    • ∑x+∈Xw(x,x+,a)=pX(x)\sum_{x^+ \in X} w(x, x^+, a) = p_X(x)∑x+∈X​w(x,x+,a)=pX​(x) for every x∈Xx \in Xx∈X and a∈Aa \in Aa∈A;
    • the second marginal w(x+∣a):=∑x∈Xw(x,x+,a)w(x^+ \mid a) := \sum_{x \in X} w(x, x^+, a)w(x+∣a):=∑x∈X​w(x,x+,a) is strictly positive for every x+∈Xx^+ \in Xx+∈X and a∈Aa \in Aa∈A.

    These force XXX to be nonempty.

  • an arbitrary encoder f:X→Rkf : X \to \mathbb{R}^kf:X→Rk and an arbitrary predictor g:Rk×A→Rkg : \mathbb{R}^k \times A \to \mathbb{R}^kg:Rk×A→Rk. No normalization, boundedness, or membership in any function class is assumed.

  • a fixed action a∈Aa \in Aa∈A.

  • an integer m≥1m \ge 1m≥1.

  • an arbitrary dataset D=(x0,x1,…,x2m−1)D = (x_0, x_1, \dots, x_{2m-1})D=(x0​,x1​,…,x2m−1​) of n=2mn = 2mn=2m observations, indexed by {0,…,2m−1}\{0, \dots, 2m-1\}{0,…,2m−1}. Repetitions are allowed. No probabilistic assumption is made on how DDD arises; the statement holds for each fixed DDD.

Notation. 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 on Rk\mathbb{R}^kRk. Write h(x):=g(f(x),a)∈Rkh(x) := g(f(x), a) \in \mathbb{R}^kh(x):=g(f(x),a)∈Rk. The transition probability is

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)​.

This is well defined because pX>0p_X > 0pX​>0. By the hypotheses, it is nonnegative and sums to 111 over x+x^+x+.

Left-hand side: the expected tuple risk. For a permutation π\piπ of {0,…,2m−1}\{0, \dots, 2m-1\}{0,…,2m−1} and i∈{0,…,m−1}i \in \{0, \dots, m-1\}i∈{0,…,m−1}, the iii-th pair of indices is (π(2i),π(2i+1))(\pi(2i), \pi(2i+1))(π(2i),π(2i+1)). Given π\piπ and sequences z+=(z0+,…,zm−1+)∈Xmz^+ = (z^+_0, \dots, z^+_{m-1}) \in X^mz+=(z0+​,…,zm−1+​)∈Xm and z′=(z0′,…,zm−1′)∈Xmz' = (z'_0, \dots, z'_{m-1}) \in X^mz′=(z0′​,…,zm−1′​)∈Xm, the iii-th tuple is

(xπ(2i),  zi+,  zi′).\bigl(x_{\pi(2i)},\; z^+_i,\; z'_i\bigr).(xπ(2i)​,zi+​,zi′​).

Its loss is

ℓi=⟨h(xπ(2i)),f(zi′)⟩2−2⟨h(xπ(2i)),f(zi+)⟩,\ell_i = \bigl\langle h(x_{\pi(2i)}), f(z'_i) \bigr\rangle^2 - 2 \bigl\langle h(x_{\pi(2i)}), f(z^+_i) \bigr\rangle,ℓi​=⟨h(xπ(2i)​),f(zi′​)⟩2−2⟨h(xπ(2i)​),f(zi+​)⟩,

and the tuple risk is R^S=1m∑i=0m−1ℓi\widehat R_S = \frac{1}{m}\sum_{i=0}^{m-1} \ell_iRS​=m1​∑i=0m−1​ℓi​. The left-hand side averages this risk uniformly over all (2m)!(2m)!(2m)! permutations. For each permutation, it weights each (z+,z′)(z^+, z')(z+,z′) by the product of transition probabilities:

LHS=1(2m)!∑π∑z+∈Xm∑z′∈Xm(∏i=0m−1P(zi+∣xπ(2i),a) P(zi′∣xπ(2i+1),a))⋅1m∑i=0m−1ℓi.\mathrm{LHS} = \frac{1}{(2m)!} \sum_{\pi} \sum_{z^+ \in X^m} \sum_{z' \in X^m} \Biggl( \prod_{i=0}^{m-1} P\bigl(z^+_i \mid x_{\pi(2i)}, a\bigr)\, P\bigl(z'_i \mid x_{\pi(2i+1)}, a\bigr) \Biggr) \cdot \frac{1}{m} \sum_{i=0}^{m-1} \ell_i.LHS=(2m)!1​π∑​z+∈Xm∑​z′∈Xm∑​(i=0∏m−1​P(zi+​∣xπ(2i)​,a)P(zi′​∣xπ(2i+1)​,a))⋅m1​i=0∑m−1​ℓi​.

In words:

  • zi+z^+_izi+​ is drawn from the transition law out of xπ(2i)x_{\pi(2i)}xπ(2i)​;
  • zi′z'_izi′​ is drawn from the transition law out of the partner xπ(2i+1)x_{\pi(2i+1)}xπ(2i+1)​;
  • all these draws are independent given π\piπ.

Right-hand side: the empirical JEPA risk with n=2mn = 2mn=2m:

RHS=−2⋅1n∑i=0n−1∑x+∈XP(x+∣xi,a) ⟨h(xi),f(x+)⟩  +  1n(n−1)∑i,j=0i≠jn−1∑x′∈XP(x′∣xj,a) ⟨h(xi),f(x′)⟩2.\mathrm{RHS} = -2 \cdot \frac{1}{n} \sum_{i=0}^{n-1} \sum_{x^+ \in X} P(x^+ \mid x_i, a)\, \bigl\langle h(x_i), f(x^+) \bigr\rangle \;+\; \frac{1}{n(n-1)} \sum_{\substack{i, j = 0 \\ i \ne j}}^{n-1} \sum_{x' \in X} P(x' \mid x_j, a)\, \bigl\langle h(x_i), f(x') \bigr\rangle^2.RHS=−2⋅n1​i=0∑n−1​x+∈X∑​P(x+∣xi​,a)⟨h(xi​),f(x+)⟩+n(n−1)1​i,j=0i=j​∑n−1​x′∈X∑​P(x′∣xj​,a)⟨h(xi​),f(x′)⟩2.

The second sum runs over ordered pairs of distinct indices i≠ji \ne ji=j, not over distinct values. If the dataset contains repeated observations, pairs with xi=xjx_i = x_jxi​=xj​ but i≠ji \ne ji=j are included. Since m≥1m \ge 1m≥1, we have n≥2n \ge 2n≥2 and n(n−1)≥2n(n-1) \ge 2n(n−1)≥2, so no division by zero occurs.

Assertion. Under the co-occurrence hypotheses, for every f,g,af, g, af,g,a, every m≥1m \ge 1m≥1, and every dataset DDD of length 2m2m2m:

LHS=RHS.\mathrm{LHS} = \mathrm{RHS}.LHS=RHS.

The averaged tuple risk exactly equals the empirical JEPA risk of DDD, with exact equality of real numbers.

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