Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

LeJEPA: Fisher information, mean-zero densities, covariance, probe bias/variance, characteristic-function distances

Definition
LeJEPA_Basic

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

fisher-informationmachine-learningself-supervised-learningstatistics

Objects used by the LeJEPA mission. Throughout, RK\mathbb{R}^KRK carries Lebesgue measure.

  1. Fisher information. For a differentiable p:RK→Rp:\mathbb{R}^K\to\mathbb{R}p:RK→R,
J(p)=∫{p>0}∥∇p(x)∥2p(x) dx=∫∥∇log⁡p∥2 p∈[0,∞].J(p)=\int_{\{p>0\}}\frac{\|\nabla p(x)\|^2}{p(x)}\,dx=\int\|\nabla\log p\|^2\,p\in[0,\infty].J(p)=∫{p>0}​p(x)∥∇p(x)∥2​dx=∫∥∇logp∥2p∈[0,∞].
  1. Mean-zero density. ppp is continuously differentiable, p≥0p\ge0p≥0, ∫p=1\int p=1∫p=1, ∫∥x∥2p(x) dx<∞\int\|x\|^2p(x)\,dx<\infty∫∥x∥2p(x)dx<∞ and ∫x p(x) dx=0\int x\,p(x)\,dx=0∫xp(x)dx=0.
  2. Covariance. Σ(p)=∫xx⊤p(x) dx\Sigma(p)=\int xx^\top p(x)\,dxΣ(p)=∫xx⊤p(x)dx, which is the paper's Σ=E[XX⊤]\Sigma=\mathbb{E}[XX^\top]Σ=E[XX⊤] for a mean-zero X∼pX\sim pX∼p.
  3. Gaussian density. N(0,S)\mathcal{N}(0,S)N(0,S) has density (2π)−K/2(det⁡S)−1/2exp⁡(−12x⊤S−1x)(2\pi)^{-K/2}(\det S)^{-1/2}\exp(-\tfrac12x^\top S^{-1}x)(2π)−K/2(detS)−1/2exp(−21​x⊤S−1x).
  4. Frobenius norm. ∥S∥F=(∑ijSij2)1/2\|S\|_F=(\sum_{ij}S_{ij}^2)^{1/2}∥S∥F​=(∑ij​Sij2​)1/2.
  5. Ridge probe bias. For data Z∈RN×KZ\in\mathbb{R}^{N\times K}Z∈RN×K, labels y=Zβ+εy=Z\beta+\varepsilony=Zβ+ε with Eε=0\mathbb{E}\varepsilon=0Eε=0, and λ≥0\lambda\ge0λ≥0, the estimator β^=(Z⊤Z+λI)−1Z⊤y\hat\beta=(Z^\top Z+\lambda I)^{-1}Z^\top yβ^​=(Z⊤Z+λI)−1Z⊤y has bias Eβ^−β=(Z⊤Z+λI)−1Z⊤Zβ−β\mathbb{E}\hat\beta-\beta=(Z^\top Z+\lambda I)^{-1}Z^\top Z\beta-\betaEβ^​−β=(Z⊤Z+λI)−1Z⊤Zβ−β.
  6. Least-squares total variance. With Var(ε)=σ2I\mathrm{Var}(\varepsilon)=\sigma^2IVar(ε)=σ2I, it is tr⁡Var(β^)=σ2tr⁡((Z⊤Z)−1)\operatorname{tr}\mathrm{Var}(\hat\beta)=\sigma^2\operatorname{tr}((Z^\top Z)^{-1})trVar(β^​)=σ2tr((Z⊤Z)−1).
  7. Moments. mk(P)=∫xk dPm_k(P)=\int x^k\,dPmk​(P)=∫xkdP.
  8. Characteristic functions. The standard Gaussian has φG(t)=e−t2/2\varphi_G(t)=e^{-t^2/2}φG​(t)=e−t2/2, and the empirical characteristic function of samples z1,…,zNz_1,\dots,z_Nz1​,…,zN​ is φ^N(t)=1N∑jeitzj\hat\varphi_N(t)=\frac1N\sum_je^{itz_j}φ^​N​(t)=N1​∑j​eitzj​.
  9. Characteristic-function distances. With weight ws(t)=e−s2t2w_s(t)=e^{-s^2t^2}ws​(t)=e−s2t2,
D^V(z)=∫ws(t) ∣φ^N(t)−φG(t)∣2 dt,D(P,G)=∫ws(t) ∣φP(t)−φG(t)∣2 dt.\hat D_V(z)=\int w_s(t)\,|\hat\varphi_N(t)-\varphi_G(t)|^2\,dt,\qquad D(P,G)=\int w_s(t)\,|\varphi_P(t)-\varphi_G(t)|^2\,dt.D^V​(z)=∫ws​(t)∣φ^​N​(t)−φG​(t)∣2dt,D(P,G)=∫ws​(t)∣φP​(t)−φG​(t)∣2dt.

These are the statistics of the paper's Appendix B.12–B.13. The Epps–Pulley statistic of Section 4.2.3 is ND^VN\hat D_VND^V​ with s=1/σs=1/\sigmas=1/σ.

Formalization Note Vectors in RK\mathbb{R}^KRK are functions Fin K→R\mathrm{Fin}\,K\to\mathbb{R}FinK→R, and gradients are written through partial derivatives. J(p)J(p)J(p) takes values in [0,∞][0,\infty][0,∞], so it is defined without any integrability assumption.

Definition code
import Mathlib

/-!
Balestriero and LeCun, *LeJEPA: Provable and Scalable Self-Supervised Learning Without the Heuristics*,
arXiv:2511.08544v3 (2025). Objects used by the formal statements of the mission.
-/

open MeasureTheory Matrix
open scoped ENNReal

noncomputable section

namespace LeJEPA

variable {K N : ℕ}

/-- The `i`-th partial derivative `∂_i p(x)` of `p : ℝ^K → ℝ`. -/
def partialDeriv (p : (Fin K → ℝ) → ℝ) (i : Fin K) (x : Fin K → ℝ) : ℝ :=
  fderiv ℝ p x (Pi.single i 1)

/-- Fisher-information functional `J(p) = ∫ ‖∇ log p‖² p = ∫_{p > 0} ‖∇ p‖² / p`, valued in `[0, ∞]`. -/
def fisherInfo (p : (Fin K → ℝ) → ℝ) : ℝ≥0∞ :=
  ∫⁻ x, if 0 < p x then ENNReal.ofReal ((∑ i, partialDeriv p i x ^ 2) / p x) else 0

/-- A mean-zero probability density on `ℝ^K` with finite second moments and continuously differentiable
(the regularity under which the score `∇ log p` and `J(p)` are defined). -/
structure IsMeanZeroDensity (p : (Fin K → ℝ) → ℝ) : Prop where
  contDiff : ContDiff ℝ 1 p
  nonneg : ∀ x, 0 ≤ p x
  integral_eq_one : ∫ x, p x = 1
  integrable_sq : Integrable (fun x => (∑ i, x i ^ 2) * p x)
  mean_zero : ∀ i, ∫ x, x i * p x = 0

/-- Covariance matrix `Σ = E[X Xᵀ]` of a mean-zero density `p`. -/
def covMat (p : (Fin K → ℝ) → ℝ) : Matrix (Fin K) (Fin K) ℝ := fun i j => ∫ x, x i * x j * p x

/-- Density of the Gaussian `N(0, S)` on `ℝ^K`. -/
def gaussDensity (S : Matrix (Fin K) (Fin K) ℝ) (x : Fin K → ℝ) : ℝ :=
  (2 * Real.pi) ^ (-(K : ℝ) / 2) * S.det ^ (-(1 : ℝ) / 2) * Real.exp (-(1 / 2) * (x ⬝ᵥ (S⁻¹ *ᵥ x)))

/-- Frobenius norm `‖S‖_F = (∑_{ij} S_{ij}²)^{1/2}`. -/
def frobNorm (S : Matrix (Fin K) (Fin K) ℝ) : ℝ := Real.sqrt (∑ i, ∑ j, S i j ^ 2)

/-- Bias `E[β̂] - β` of the ridge (Tikhonov) estimator `β̂ = (ZᵀZ + λI)⁻¹ Zᵀ y` when `y = Zβ + ε`, `E[ε] = 0`. -/
def ridgeBias (Z : Matrix (Fin N) (Fin K) ℝ) (lam : ℝ) (β : Fin K → ℝ) : Fin K → ℝ :=
  ((Zᵀ * Z + lam • (1 : Matrix (Fin K) (Fin K) ℝ))⁻¹ * (Zᵀ * Z)) *ᵥ β - β

/-- Total variance `tr Var(β̂) = σ² tr((ZᵀZ)⁻¹)` of the least-squares estimator under noise `Var(ε) = σ² I`. -/
def olsTotalVariance (Z : Matrix (Fin N) (Fin K) ℝ) (σ : ℝ) : ℝ := σ ^ 2 * ((Zᵀ * Z)⁻¹).trace

/-- The `k`-th raw moment `m_k(P) = ∫ x^k dP`. -/
def rawMoment (k : ℕ) (P : Measure ℝ) : ℝ := ∫ x, x ^ k ∂P

/-- Characteristic function of the standard Gaussian, `φ_G(t) = e^{-t²/2}`. -/
def stdGaussCF (t : ℝ) : ℂ := (Real.exp (-(t ^ 2) / 2) : ℂ)

/-- Empirical characteristic function `φ̂_N(t) = (1/N) ∑_j e^{i t z_j}`. -/
def empCF (z : Fin N → ℝ) (t : ℝ) : ℂ := (1 / (N : ℂ)) * ∑ j, Complex.exp (Complex.I * (t : ℂ) * (z j : ℂ))

/-- V-statistic `D̂_V = ∫ w_s(t) |φ̂_N(t) - φ_G(t)|² dt`, Gaussian weight `w_s(t) = e^{-s² t²}`. -/
def ecfDistance (s : ℝ) (z : Fin N → ℝ) : ℝ :=
  ∫ t : ℝ, Real.exp (-(s ^ 2 * t ^ 2)) * ‖empCF z t - stdGaussCF t‖ ^ 2

/-- Population distance `D(P, G) = ∫ w_s(t) |φ_P(t) - φ_G(t)|² dt`. -/
def cfDistance (s : ℝ) (P : Measure ℝ) : ℝ :=
  ∫ t : ℝ, Real.exp (-(s ^ 2 * t ^ 2)) * ‖charFun P t - stdGaussCF t‖ ^ 2

end LeJEPA
Source
Balestriero and LeCun, LeJEPA, arXiv:2511.08544v3 (2025), Sections 3.1, 4.2 and Appendices B.1, B.2, B.4, B.12, B.13
Read-back

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

Preamble context. Throughout, KKK and NNN are arbitrary natural numbers, and 000 is allowed for both. RK\mathbb{R}^KRK means real vectors x=(x1,…,xK)x = (x_1, \dots, x_K)x=(x1​,…,xK​) with KKK coordinates, and R0\mathbb{R}^0R0 is a single point. Unless stated otherwise, "∫… dx\int \dots \, dx∫…dx" over RK\mathbb{R}^KRK or R\mathbb{R}R is the Lebesgue integral. Two conventions apply to every definition below:

  • An integral written as a real number (a Bochner integral) is defined to be 000 whenever the integrand is not integrable.
  • The inverse A−1A^{-1}A−1 of a square matrix is defined to be the zero matrix whenever AAA is singular.

partialDeriv. For any function p:RK→Rp : \mathbb{R}^K \to \mathbb{R}p:RK→R, any coordinate index iii, and any point xxx, the quantity ∂ip(x)\partial_i p(x)∂i​p(x) is the Fréchet derivative of ppp at xxx applied to the iii-th standard basis vector eie_iei​:

∂ip(x)=Dp(x) [ei].\partial_i p(x) = Dp(x)\,[e_i].∂i​p(x)=Dp(x)[ei​].

If ppp is not Fréchet-differentiable at xxx, the derivative is taken to be the zero map, so ∂ip(x)=0\partial_i p(x) = 0∂i​p(x)=0. This applies even if the one-variable partial derivative in direction eie_iei​ happens to exist there.

fisherInfo. For any function p:RK→Rp : \mathbb{R}^K \to \mathbb{R}p:RK→R (no assumptions whatsoever), J(p)J(p)J(p) is the extended non-negative number in [0,∞][0, \infty][0,∞] given by the lower Lebesgue integral

J(p)=∫RKg(x) dx,g(x)={∑i=1K(∂ip(x))2p(x)if p(x)>0,0otherwise.J(p) = \int_{\mathbb{R}^K} g(x)\,dx, \qquad g(x) = \begin{cases} \dfrac{\sum_{i=1}^K (\partial_i p(x))^2}{p(x)} & \text{if } p(x) > 0,\\[2mm] 0 & \text{otherwise.} \end{cases}J(p)=∫RK​g(x)dx,g(x)=⎩⎨⎧​p(x)∑i=1K​(∂i​p(x))2​0​if p(x)>0,otherwise.​

Here ∂ip\partial_i p∂i​p is as in partialDeriv, so it is 000 at points where ppp is not differentiable. The integral may equal +∞+\infty+∞. Points where p≤0p \le 0p≤0 contribute nothing. When K=0K = 0K=0, the space is a single point of measure 111 and the sum is empty, so J(p)=0J(p) = 0J(p)=0.

IsMeanZeroDensity. A function p:RK→Rp : \mathbb{R}^K \to \mathbb{R}p:RK→R satisfies this predicate exactly when all five of the following hold:

  1. ppp is continuously differentiable (C1C^1C1) on RK\mathbb{R}^KRK.
  2. p(x)≥0p(x) \ge 0p(x)≥0 for every xxx.
  3. ∫RKp(x) dx=1\int_{\mathbb{R}^K} p(x)\,dx = 1∫RK​p(x)dx=1. Because a non-integrable ppp would have integral 000 by convention, this condition also forces ppp to be integrable.
  4. The function x↦(∑i=1Kxi2) p(x)x \mapsto \big(\sum_{i=1}^K x_i^2\big)\,p(x)x↦(∑i=1K​xi2​)p(x) is Lebesgue-integrable.
  5. For every coordinate iii, ∫RKxi p(x) dx=0\int_{\mathbb{R}^K} x_i\,p(x)\,dx = 0∫RK​xi​p(x)dx=0. This is a Bochner integral; under conditions 3 and 4 the integrand xi p(x)x_i\,p(x)xi​p(x) is integrable.

No positivity of ppp is required, and nothing is assumed about the covariance (in particular, it need not be non-degenerate). For K=0K = 0K=0, the conditions reduce to ppp taking the value 111 at the single point.

covMat. For any function p:RK→Rp : \mathbb{R}^K \to \mathbb{R}p:RK→R (no assumptions), Σ(p)\Sigma(p)Σ(p) is the K×KK \times KK×K real matrix with entries

Σ(p)ij=∫RKxi xj p(x) dx.\Sigma(p)_{ij} = \int_{\mathbb{R}^K} x_i\,x_j\,p(x)\,dx.Σ(p)ij​=∫RK​xi​xj​p(x)dx.

Any entry whose integrand is not integrable is 000. No mean is subtracted.

gaussDensity. For any K×KK \times KK×K real matrix SSS (not assumed symmetric, positive definite, or invertible) and any x∈RKx \in \mathbb{R}^Kx∈RK,

φS(x)=(2π)−K/2 (det⁡S)−1/2 exp⁡ ⁣(−12 x⊤S−1x).\varphi_S(x) = (2\pi)^{-K/2}\,(\det S)^{-1/2}\,\exp\!\Big(-\tfrac12\, x^\top S^{-1} x\Big).φS​(x)=(2π)−K/2(detS)−1/2exp(−21​x⊤S−1x).

The power (det⁡S)−1/2(\det S)^{-1/2}(detS)−1/2 uses the real power function, which gives the following edge cases:

  • If det⁡S=0\det S = 0detS=0, then (det⁡S)−1/2=0(\det S)^{-1/2} = 0(detS)−1/2=0, so φS≡0\varphi_S \equiv 0φS​≡0. In this case S−1S^{-1}S−1 is also the zero matrix.
  • If det⁡S<0\det S < 0detS<0, the real power evaluates to ∣det⁡S∣−1/2cos⁡(−π/2)=0|\det S|^{-1/2}\cos(-\pi/2) = 0∣detS∣−1/2cos(−π/2)=0, so again φS≡0\varphi_S \equiv 0φS​≡0.

frobNorm. For any K×KK \times KK×K real matrix SSS,

∥S∥F=∑i=1K∑j=1KSij2.\|S\|_F = \sqrt{\textstyle\sum_{i=1}^K \sum_{j=1}^K S_{ij}^2}.∥S∥F​=∑i=1K​∑j=1K​Sij2​​.

It equals 000 when K=0K = 0K=0.

ridgeBias. For any N×KN \times KN×K real matrix ZZZ, any real number λ\lambdaλ (which may be zero or negative), and any vector β∈RK\beta \in \mathbb{R}^Kβ∈RK,

b(Z,λ,β)=(Z⊤Z+λIK)−1(Z⊤Z) β  −  β  ∈RK.b(Z, \lambda, \beta) = \big(Z^\top Z + \lambda I_K\big)^{-1} \big(Z^\top Z\big)\,\beta \;-\; \beta \;\in \mathbb{R}^K.b(Z,λ,β)=(Z⊤Z+λIK​)−1(Z⊤Z)β−β∈RK.

This is a purely deterministic matrix expression. No response vector, noise, or expectation appears in it. If Z⊤Z+λIKZ^\top Z + \lambda I_KZ⊤Z+λIK​ is singular, its inverse is the zero matrix, and b=−βb = -\betab=−β. When N=0N = 0N=0, Z⊤Z=0Z^\top Z = 0Z⊤Z=0, so b=−βb = -\betab=−β if λ=0\lambda = 0λ=0, and b=0−β=−βb = 0 - \beta = -\betab=0−β=−β for any λ\lambdaλ.

olsTotalVariance. For any N×KN \times KN×K real matrix ZZZ and any real σ\sigmaσ (whose sign is irrelevant),

V(Z,σ)=σ2 tr⁡ ⁣((Z⊤Z)−1).V(Z, \sigma) = \sigma^2 \,\operatorname{tr}\!\big((Z^\top Z)^{-1}\big).V(Z,σ)=σ2tr((Z⊤Z)−1).

This is a deterministic expression with no noise model involved. If Z⊤ZZ^\top ZZ⊤Z is singular, which happens in particular whenever N<KN < KN<K, the inverse is the zero matrix and V=0V = 0V=0.

rawMoment. For any natural number kkk and any measure PPP on R\mathbb{R}R (not assumed to be a probability measure, or even finite),

mk(P)=∫Rxk dP(x).m_k(P) = \int_{\mathbb{R}} x^k\,dP(x).mk​(P)=∫R​xkdP(x).

The value is 000 if xkx^kxk is not PPP-integrable. For k=0k = 0k=0 the value is the total mass P(R)P(\mathbb{R})P(R) when that mass is finite, and 000 when PPP is infinite.

stdGaussCF. For real ttt, φG(t)=e−t2/2\varphi_G(t) = e^{-t^2/2}φG​(t)=e−t2/2, regarded as a complex number with zero imaginary part.

empCF. For a sample z=(z1,…,zN)∈RNz = (z_1, \dots, z_N) \in \mathbb{R}^Nz=(z1​,…,zN​)∈RN and real ttt,

φ^N(t)=1N∑j=1Ne itzj∈C.\hat\varphi_N(t) = \frac{1}{N} \sum_{j=1}^N e^{\,i t z_j} \in \mathbb{C}.φ^​N​(t)=N1​j=1∑N​eitzj​∈C.

When N=0N = 0N=0, both 1/01/01/0 (which is 000 by convention) and the empty sum vanish, so φ^0≡0\hat\varphi_0 \equiv 0φ^​0​≡0.

ecfDistance. For any real sss and sample z∈RNz \in \mathbb{R}^Nz∈RN,

D^V(s,z)=∫Re−s2t2 ∣φ^N(t)−e−t2/2∣2 dt,\hat D_V(s, z) = \int_{\mathbb{R}} e^{-s^2 t^2}\,\big|\hat\varphi_N(t) - e^{-t^2/2}\big|^2\,dt,D^V​(s,z)=∫R​e−s2t2​φ^​N​(t)−e−t2/2​2dt,

with φ^N\hat\varphi_Nφ^​N​ as in empCF. Edge cases:

  • The value depends on sss only through s2s^2s2.
  • For s=0s = 0s=0 the weight is identically 111. If the resulting integrand is not integrable, the value is 000 by convention.
  • For N=0N = 0N=0 the integrand is e−s2t2e−t2e^{-s^2 t^2} e^{-t^2}e−s2t2e−t2.

cfDistance. For any real sss and any measure PPP on R\mathbb{R}R (not assumed to be a probability measure),

D(s,P)=∫Re−s2t2 ∣φP(t)−e−t2/2∣2 dt,D(s, P) = \int_{\mathbb{R}} e^{-s^2 t^2}\,\big|\varphi_P(t) - e^{-t^2/2}\big|^2\,dt,D(s,P)=∫R​e−s2t2​φP​(t)−e−t2/2​2dt,

where φP(t)=∫Re itx dP(x)\varphi_P(t) = \int_{\mathbb{R}} e^{\,i t x}\,dP(x)φP​(t)=∫R​eitxdP(x). Edge cases:

  • If PPP has infinite total mass, then φP(t)=0\varphi_P(t) = 0φP​(t)=0 for every ttt, by the non-integrability convention.
  • If the outer integrand is not integrable, for example possibly when s=0s = 0s=0, the value is 000.
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