Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition E.1, Eq. (59): the contrastive term tends to a log kernel-density value

Proved
IActThereforeIAm.contrastive_term_kde_limit

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

causal-representation-learningidentifiabilityjepamutual-informationworld-models

Let σ,τ>0\sigma,\tau>0σ,τ>0, let d≥0d\ge0d≥0, and set b=τσ2b=\sqrt{\tau\sigma^2}b=τσ2​. There is a constant Cσ,τC_{\sigma,\tau}Cσ,τ​ with the following property. Take any probability law pzp_{\mathbf z}pz​ on Rd\mathbb R^dRd, i.i.d. samples z(1),z(2),…\mathbf z^{(1)},\mathbf z^{(2)},\dotsz(1),z(2),… from pzp_{\mathbf z}pz​, and any zt∈Rd\mathbf z_t\in\mathbb R^dzt​∈Rd, and let the prediction be locally accurate, μϕ(zt−1,at−1)=zt\boldsymbol\mu_\phi(\mathbf z_{t-1},\mathbf a_{t-1})=\mathbf z_tμϕ​(zt−1​,at−1​)=zt​. Then almost surely

UK=log⁡[1K∑k=1Kexp⁡(−ℓϕ(z(k)∣zt−1,at−1)τ)]⟶log⁡[(pz∗φb)(zt)]+Cσ,τ(K→∞).U_K=\log\Big[\frac1K\sum_{k=1}^K\exp\Big(-\frac{\ell_\phi(\mathbf z^{(k)}\mid\mathbf z_{t-1},\mathbf a_{t-1})}{\tau}\Big)\Big]\longrightarrow\log\big[(p_{\mathbf z}*\varphi_b)(\mathbf z_t)\big]+C_{\sigma,\tau}\qquad(K\to\infty).UK​=log[K1​k=1∑K​exp(−τℓϕ​(z(k)∣zt−1​,at−1​)​)]⟶log[(pz​∗φb​)(zt​)]+Cσ,τ​(K→∞).

Here ℓϕ\ell_\phiℓϕ​ is the negative log-likelihood of N(zt,σ2I)\mathcal N(\mathbf z_t,\sigma^2I)N(zt​,σ2I) and φb\varphi_bφb​ the Gaussian kernel of bandwidth bbb.

This relates the contrastive term of A-JEPA to a Gaussian kernel-density estimate of the representation law.

Formalization Note Only Eq. (59) is stated. Its convergence mode is taken as almost sure for each fixed zt\mathbf z_tzt​, as the law-of-large-numbers proof gives. "Independent of the representation distribution" is encoded by choosing CCC before pzp_{\mathbf z}pz​. The samples are a mutually independent sequence. Eqs. (60) and (62) are not included.

Preamble
import Mathlib
import Definitions.Def_IActThereforeIAm_Basic

open MeasureTheory Filter Topology
open scoped ENNReal NNReal ContDiff
Formal statement
namespace IActThereforeIAm

theorem contrastive_term_kde_limit {d : ℕ} (σ τ : ℝ) (hσ : 0 < σ) (hτ : 0 < τ) :
    ∃ C : ℝ, ∀ (Ω : Type) [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P]
      (μ : Measure (Fin d → ℝ)) [IsProbabilityMeasure μ] (Zs : ℕ → Ω → Fin d → ℝ),
      (∀ k, Measurable (Zs k)) → ProbabilityTheory.iIndepFun Zs P → (∀ k, P.map (Zs k) = μ) →
      ∀ zt : Fin d → ℝ, ∀ᵐ w ∂P,
        Tendsto (fun K => contrastiveU σ τ zt (fun k => Zs k w) K) atTop
          (𝓝 (Real.log (kernelSmoothed μ (Real.sqrt (τ * σ ^ 2)) zt) + C)) := by sorry

end IActThereforeIAm
Source
Liu, Huang and Shi, I Act Therefore I Am: When Is JEPA's Action-Conditioning Enough to Learn Causal Mechanisms?, arXiv:2609.31161v1 (2026), Appendix E, Proposition E.1, Eqs. (56)-(59), p. 22
Read-back

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

Fix a dimension d∈Nd \in \mathbb{N}d∈N (the case d=0d = 0d=0 is included) and real numbers σ,τ\sigma, \tauσ,τ with σ>0\sigma > 0σ>0 and τ>0\tau > 0τ>0. The statement asserts that there is a real constant CCC, depending only on ddd, σ\sigmaσ and τ\tauτ, with the property below. Its value is not specified.

The property must hold for all of the following data:

  • every measurable space Ω\OmegaΩ with a probability measure PPP;
  • every Borel probability measure μ\muμ on Rd\mathbb{R}^dRd;
  • every sequence of maps Z0,Z1,Z2,⋯:Ω→RdZ_0, Z_1, Z_2, \dots : \Omega \to \mathbb{R}^dZ0​,Z1​,Z2​,⋯:Ω→Rd such that
    • each ZkZ_kZk​ is measurable (Borel σ\sigmaσ-algebra on Rd\mathbb{R}^dRd),
    • the whole family (Zk)k∈N(Z_k)_{k \in \mathbb{N}}(Zk​)k∈N​ is mutually independent under PPP,
    • each ZkZ_kZk​ has law μ\muμ under PPP, i.e. the pushforward P∘Zk−1P \circ Z_k^{-1}P∘Zk−1​ equals μ\muμ.

For every such choice and every point zt∈Rdz_t \in \mathbb{R}^dzt​∈Rd, there is a PPP-null set outside of which the stated convergence holds. The null set may depend on ztz_tzt​ and on all the other data. For PPP-almost every ω∈Ω\omega \in \Omegaω∈Ω:

lim⁡K→∞UK(ω)  =  log⁡((μ∗φb)(zt))+C,b=τσ2=στ.\lim_{K \to \infty} U_K(\omega) \;=\; \log\big( (\mu * \varphi_b)(z_t) \big) + C, \qquad b = \sqrt{\tau \sigma^2} = \sigma\sqrt{\tau}.K→∞lim​UK​(ω)=log((μ∗φb​)(zt​))+C,b=τσ2​=στ​.

The limit is an ordinary limit of real numbers as K→∞K \to \inftyK→∞ through the natural numbers.

The quantity UK(ω)U_K(\omega)UK​(ω) is defined as follows. For K≥1K \ge 1K≥1, write ∥v∥2=∑i=1dvi2\|v\|^2 = \sum_{i=1}^d v_i^2∥v∥2=∑i=1d​vi2​ for the squared Euclidean norm. Then

UK(ω)=log⁡ ⁣(1K∑k=0K−1exp⁡ ⁣(−ℓ(Zk(ω))/τ)),U_K(\omega) = \log\!\Big( \frac{1}{K} \sum_{k=0}^{K-1} \exp\!\big(-\ell(Z_k(\omega))/\tau\big) \Big),UK​(ω)=log(K1​k=0∑K−1​exp(−ℓ(Zk​(ω))/τ)),

where

ℓ(z)=∥z−zt∥22σ2+d2log⁡(2πσ2).\ell(z) = \frac{\|z - z_t\|^2}{2\sigma^2} + \frac{d}{2}\log(2\pi\sigma^2).ℓ(z)=2σ2∥z−zt​∥2​+2d​log(2πσ2).

So ℓ\ellℓ is the Gaussian negative log-likelihood of zzz under N(zt,σ2I)\mathcal{N}(z_t, \sigma^2 I)N(zt​,σ2I). Note that the point ztz_tzt​ plays the role of the mean. The samples used are the first KKK terms Z0(ω),…,ZK−1(ω)Z_0(\omega), \dots, Z_{K-1}(\omega)Z0​(ω),…,ZK−1​(ω).

For K=0K = 0K=0 the expression is defined by convention as log⁡(0⋅0)=0\log(0 \cdot 0) = 0log(0⋅0)=0. This has no effect on the limit.

The right-hand side uses a smoothed density defined by

(μ∗φb)(zt)=∫Rdφb(z−zt) dμ(z),(\mu * \varphi_b)(z_t) = \int_{\mathbb{R}^d} \varphi_b(z - z_t)\, d\mu(z),(μ∗φb​)(zt​)=∫Rd​φb​(z−zt​)dμ(z),

with the Gaussian kernel

φb(x)=(2πb2)−d/2exp⁡ ⁣(−∥x∥22b2),b2=τσ2.\varphi_b(x) = (2\pi b^2)^{-d/2} \exp\!\Big(-\frac{\|x\|^2}{2b^2}\Big), \qquad b^2 = \tau\sigma^2.φb​(x)=(2πb2)−d/2exp(−2b2∥x∥2​),b2=τσ2.

The integrand is continuous, strictly positive and bounded by (2πb2)−d/2(2\pi b^2)^{-d/2}(2πb2)−d/2. Since μ\muμ is a probability measure, this integral is a strictly positive real number, and its logarithm is the ordinary real logarithm.

In the degenerate case d=0d = 0d=0, the space R0\mathbb{R}^0R0 is a single point. Every norm is then 000, so ℓ≡0\ell \equiv 0ℓ≡0, UK=log⁡1=0U_K = \log 1 = 0UK​=log1=0 for K≥1K \ge 1K≥1, and (μ∗φb)(zt)=1(\mu * \varphi_b)(z_t) = 1(μ∗φb​)(zt​)=1.

Human review
  • Endorsed by Shuze Chen · Nov 23, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 23, 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