Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Gaussian world, LeJEPA alignment loss, Hermite basis, and latent planning

Definition
LeJEPAWorldModel_Basic

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

gaussian-measurehermite-polynomialsidentifiabilityself-supervised-learningworld-models

Objects of Klindt, LeCun and Balestriero (2026), When Does LeJEPA Learn a World Model?

  1. Gaussian world (Section 2.1.1, eq. 1). The latent is z∼γN=N(0,IN)z\sim\gamma_N=\mathcal N(0,I_N)z∼γN​=N(0,IN​) on RN\mathbb R^NRN, the law with independent standard normal coordinates. For ρ∈(0,1)\rho\in(0,1)ρ∈(0,1) a positive pair is (z,z′)(z,z')(z,z′) with z′=ρz+1−ρ2 ηz'=\rho z+\sqrt{1-\rho^2}\,\etaz′=ρz+1−ρ2​η, where η∼N(0,IN)\eta\sim\mathcal N(0,I_N)η∼N(0,IN​) is independent of zzz. Its law on RN×RN\mathbb R^N\times\mathbb R^NRN×RN is the image of γN⊗γN\gamma_N\otimes\gamma_NγN​⊗γN​ under (z,η)↦(z,ρz+1−ρ2η)(z,\eta)\mapsto(z,\rho z+\sqrt{1-\rho^2}\eta)(z,η)↦(z,ρz+1−ρ2​η). Here ∥v∥2=∑ivi2\|v\|^2=\sum_iv_i^2∥v∥2=∑i​vi2​.
  2. LeJEPA objective (Section 2.2, eq. 2). For h:RN→RNh:\mathbb R^N\to\mathbb R^Nh:RN→RN, the alignment loss is L(h)=E∥h(z′)−h(z)∥2\mathcal L(h)=\mathbb E\|h(z')-h(z)\|^2L(h)=E∥h(z′)−h(z)∥2.
  3. Second-order quantities (Theorem 3, Appendix C). Cov(h(z))ij=E[(hi(z)−Ehi(z))(hj(z)−Ehj(z))]\mathrm{Cov}(h(z))_{ij}=\mathbb E[(h_i(z)-\mathbb Eh_i(z))(h_j(z)-\mathbb Eh_j(z))]Cov(h(z))ij​=E[(hi​(z)−Ehi​(z))(hj​(z)−Ehj​(z))], and ∥A∥F=(∑ijAij2)1/2\|A\|_F=(\sum_{ij}A_{ij}^2)^{1/2}∥A∥F​=(∑ij​Aij2​)1/2. The linear part of hhh is the matrix Mij=E[hi(z)zj]M_{ij}=\mathbb E[h_i(z)z_j]Mij​=E[hi​(z)zj​] (eq. 36), and the nonlinear energy is Wnl=E∥h(z)−Mz∥2W_{\mathrm{nl}}=\mathbb E\|h(z)-Mz\|^2Wnl​=E∥h(z)−Mz∥2 (eq. 37).
  4. Hermite polynomials (Appendix A.2). Hek\mathrm{He}_kHek​ is the probabilists' Hermite polynomial of degree kkk (eq. 7), h^k=Hek/k!\hat h_k=\mathrm{He}_k/\sqrt{k!}h^k​=Hek​/k!​, and for a multi-index α∈NN\alpha\in\mathbb N^Nα∈NN, Hα(z)=∏jh^αj(zj)H_\alpha(z)=\prod_j\hat h_{\alpha_j}(z_j)Hα​(z)=∏j​h^αj​​(zj​) (eq. 10).
  5. Sturm–Liouville generator (Appendix B.1, eq. 30). For a diffusion constant KKK and a density ppp on R\mathbb RR, Dφ=1pddz[Kp φ′]\mathcal D\varphi=\frac1p\frac{d}{dz}\big[Kp\,\varphi'\big]Dφ=p1​dzd​[Kpφ′].
  6. Planning (Section 4.4, Appendix D). States lie in RN\mathbb R^NRN and actions in a set A\mathcal AA. The transition zt∼P(zt−1,at)z_t\sim P(z_{t-1},a_t)zt​∼P(zt−1​,at​) is given by a probability measure P(z,a)P(z,a)P(z,a) for each state and action. The stage cost is ℓ(z,a)\ell(z,a)ℓ(z,a) and the terminal cost is ℓT(z)\ell_T(z)ℓT​(z). The expected cost of a plan a1:Ta_{1:T}a1:T​ from z0z_0z0​ is J(a1:T;z0)=E[ℓT(zT)+∑t=1Tℓ(zt−1,at)]J(a_{1:T};z_0)=\mathbb E[\ell_T(z_T)+\sum_{t=1}^T\ell(z_{t-1},a_t)]J(a1:T​;z0​)=E[ℓT​(zT​)+∑t=1T​ℓ(zt−1​,at​)], computed backwards: J(∅;z)=ℓT(z)J(\varnothing;z)=\ell_T(z)J(∅;z)=ℓT​(z) and J(a a2:T;z)=ℓ(z,a)+∫J(a2:T;z′) P(z,a)(dz′)J(a\,a_{2:T};z)=\ell(z,a)+\int J(a_{2:T};z')\,P(z,a)(dz')J(aa2:T​;z)=ℓ(z,a)+∫J(a2:T​;z′)P(z,a)(dz′). The value is V∗(z0)=inf⁡a1:TJ(a1:T;z0)V^*(z_0)=\inf_{a_{1:T}}J(a_{1:T};z_0)V∗(z0​)=infa1:T​​J(a1:T​;z0​) over plans of length TTT (by convention it is 000 if this set of costs is empty or unbounded below). A plan of length TTT is optimal if its cost is at most the cost of every plan of length TTT. For Q∈O(N)Q\in O(N)Q∈O(N), the learned-latent transitions are P^(z^,a)\hat P(\hat z,a)P^(z^,a), the image of P(Q⊤z^,a)P(Q^\top\hat z,a)P(Q⊤z^,a) under z↦Qzz\mapsto Qzz↦Qz.
  7. Dirichlet-energy setting (Appendix E.1). A C1C^1C1 diffeomorphism is a C1C^1C1 bijection of RN\mathbb R^NRN with a C1C^1C1 inverse. For ε>0\varepsilon>0ε>0, the quotient is 1ε E∥h(z+ε η)−h(z)∥2∈[0,∞]\frac1\varepsilon\,\mathbb E\|h(z+\sqrt\varepsilon\,\eta)-h(z)\|^2\in[0,\infty]ε1​E∥h(z+ε​η)−h(z)∥2∈[0,∞], where z,η∼N(0,IN)z,\eta\sim\mathcal N(0,I_N)z,η∼N(0,IN​) are independent. Its limit as ε→0+\varepsilon\to0^+ε→0+ is the loss L(h)\mathcal L(h)L(h) of Appendix E.

Formalization Note Vectors in RN\mathbb R^NRN are functions Fin N→R\mathrm{Fin}\,N\to\mathbb RFinN→R, and the squared norm is written out as a sum of squares. The Hermite polynomials are Mathlib's Polynomial.hermite, which Mathlib proves equal to the Rodrigues formula (7). The expected cost of a plan is defined by the backward recursion, which equals the trajectory expectation by the tower property. The Dirichlet quotient is a lower Lebesgue integral with values in [0,∞][0,\infty][0,∞], so it is defined for every hhh.

Definition code
import Mathlib

/-!
Klindt, LeCun and Balestriero, *When Does LeJEPA Learn a World Model?*, arXiv:2605.26379v2
(2026): the Gaussian world and the LeJEPA objective of Section 2, the Hermite basis of
Appendix A.2, the Sturm–Liouville generator of Appendix B.1, the linear part and nonlinear energy
of Appendix C, the planning problem of Section 4.4 and Appendix D, and the Dirichlet-energy
objective of Appendix E.1.
-/

open MeasureTheory ProbabilityTheory
open scoped ENNReal

noncomputable section

namespace LeJEPAWorldModel

/-- Squared Euclidean norm `‖v‖² = ∑ᵢ vᵢ²` of a vector `v ∈ ℝ^N` (Section 2.2). -/
def sqNorm {N : ℕ} (v : Fin N → ℝ) : ℝ := ∑ i, v i ^ 2

/-- Section 2.1.1: the standard Gaussian `γ_N = N(0, I_N)` on `ℝ^N`, the law of the latent `z`
(independent standard normal coordinates). -/
def stdGaussian (N : ℕ) : Measure (Fin N → ℝ) :=
  Measure.pi fun _ => gaussianReal 0 1

/-- Eq. (1): the law of a positive pair `(z, z')` of the Gaussian world, where `z ∼ N(0, I_N)`,
`η ∼ N(0, I_N)` is independent of `z`, and `z' = ρ z + √(1 - ρ²) η`. -/
def ouPairLaw (N : ℕ) (ρ : ℝ) : Measure ((Fin N → ℝ) × (Fin N → ℝ)) :=
  ((stdGaussian N).prod (stdGaussian N)).map
    (fun p => (p.1, ρ • p.1 + Real.sqrt (1 - ρ ^ 2) • p.2))

/-- Eq. (2), Section 2.2: the LeJEPA alignment loss `𝓛(h) = E ‖h(z') - h(z)‖²` over positive
pairs of the Gaussian world. -/
def alignLoss (N : ℕ) (ρ : ℝ) (h : (Fin N → ℝ) → Fin N → ℝ) : ℝ :=
  ∫ p, sqNorm (h p.2 - h p.1) ∂ouPairLaw N ρ

/-- Section 2.2 and Theorem 3: the covariance matrix `Cov(h(z))`, `z ∼ N(0, I_N)`. -/
def covMat (N : ℕ) (h : (Fin N → ℝ) → Fin N → ℝ) : Matrix (Fin N) (Fin N) ℝ :=
  fun i j => ∫ z, (h z i - ∫ y, h y i ∂stdGaussian N) * (h z j - ∫ y, h y j ∂stdGaussian N)
    ∂stdGaussian N

/-- Frobenius norm `‖A‖_F = (∑ᵢⱼ Aᵢⱼ²)^{1/2}` (Theorem 3). -/
def frobNorm {N : ℕ} (A : Matrix (Fin N) (Fin N) ℝ) : ℝ :=
  Real.sqrt (∑ i, ∑ j, A i j ^ 2)

/-- Eq. (36), Appendix C: the linear part `M` of `h`, `M_ij = E[h_i(z) z_j]`, `z ∼ N(0, I_N)`. -/
def linearPart (N : ℕ) (h : (Fin N → ℝ) → Fin N → ℝ) : Matrix (Fin N) (Fin N) ℝ :=
  fun i j => ∫ z, h z i * z j ∂stdGaussian N

/-- Eq. (37), Appendix C: the nonlinear energy `W_nl = E ‖ν(z)‖²` of the residual
`ν(z) = h(z) - M z`. -/
def nonlinearEnergy (N : ℕ) (h : (Fin N → ℝ) → Fin N → ℝ) : ℝ :=
  ∫ z, sqNorm (h z - (linearPart N h).mulVec z) ∂stdGaussian N

/-- Eq. (7), Appendix A.2: the probabilists' Hermite polynomial `He_k`, evaluated at `x`
(Mathlib's `Polynomial.hermite`, which equals the Rodrigues formula (7) by
`Polynomial.hermite_eq_deriv_gaussian`). -/
def hermiteHe (k : ℕ) (x : ℝ) : ℝ :=
  Polynomial.aeval x (Polynomial.hermite k)

/-- Appendix A.2: the normalized Hermite polynomial `ĥ_k(x) = He_k(x) / √(k!)`. -/
def hermiteNormalized (k : ℕ) (x : ℝ) : ℝ :=
  hermiteHe k x / Real.sqrt (k.factorial : ℝ)

/-- Eq. (10), Appendix A.2: the multivariate Hermite function `H_α(z) = ∏ⱼ ĥ_{αⱼ}(zⱼ)` for a
multi-index `α ∈ ℕ^N`. -/
def multiHermite {N : ℕ} (α : Fin N → ℕ) (z : Fin N → ℝ) : ℝ :=
  ∏ j, hermiteNormalized (α j) (z j)

/-- Eq. (30), Appendix B.1: the Sturm–Liouville generator of a scalar latent with constant
diffusion `K` and stationary density `p`, `𝒟φ = (1/p) d/dz [K p φ']`. -/
def slGenerator (K : ℝ) (p φ : ℝ → ℝ) (x : ℝ) : ℝ :=
  (1 / p x) * deriv (fun y => K * p y * deriv φ y) x

section Planning

variable {N : ℕ} {A : Type*}

/-- Section 4.4: the expected cost `E[ℓ_T(z_T) + ∑_{t=1}^T ℓ(z_{t-1}, a_t) | z_0]` of the plan
`[a_1, …, a_T]` started at `z_0`, where `z_t ∼ P(z_{t-1}, a_t)`, computed backwards:
the empty plan costs `ℓ_T(z)` and the plan `a :: as` costs `ℓ(z, a) + ∫ cost(as, z') dP(z, a)(z')`. -/
def planCost (P : (Fin N → ℝ) → A → Measure (Fin N → ℝ)) (c : (Fin N → ℝ) → A → ℝ)
    (cT : (Fin N → ℝ) → ℝ) : List A → (Fin N → ℝ) → ℝ
  | [], z => cT z
  | a :: as, z => c z a + ∫ z', planCost P c cT as z' ∂(P z a)

/-- Section 4.4: the minimal cost `V*(z_0)` over plans `a_{1:T}` of length `T`. -/
def optimalValue (P : (Fin N → ℝ) → A → Measure (Fin N → ℝ)) (c : (Fin N → ℝ) → A → ℝ)
    (cT : (Fin N → ℝ) → ℝ) (T : ℕ) (z0 : Fin N → ℝ) : ℝ :=
  ⨅ as : {l : List A // l.length = T}, planCost P c cT as.1 z0

/-- Section 4.4: `as` is an optimal plan `a*_{1:T}(z_0)`: it has length `T` and its cost is at
most the cost of every plan of length `T`. -/
def IsOptimalPlan (P : (Fin N → ℝ) → A → Measure (Fin N → ℝ)) (c : (Fin N → ℝ) → A → ℝ)
    (cT : (Fin N → ℝ) → ℝ) (T : ℕ) (z0 : Fin N → ℝ) (as : List A) : Prop :=
  as.length = T ∧ ∀ bs : List A, bs.length = T → planCost P c cT as z0 ≤ planCost P c cT bs z0

/-- Theorem 4 and Appendix D: the transitions `p̂(· | ẑ, a)` of the learned latent `ẑ = h(z) = Q z`,
the pushforward under `h` of `p(· | h⁻¹(ẑ), a)`, with `h⁻¹(ẑ) = Qᵀ ẑ` for orthogonal `Q`. -/
def pushDynamics (Q : Matrix (Fin N) (Fin N) ℝ) (P : (Fin N → ℝ) → A → Measure (Fin N → ℝ)) :
    (Fin N → ℝ) → A → Measure (Fin N → ℝ) :=
  fun zh a => (P (Q.transpose.mulVec zh) a).map (fun z => Q.mulVec z)

end Planning

/-- Appendix E.1: `h : ℝ^N → ℝ^N` is a `C¹` diffeomorphism (a `C¹` bijection with `C¹` inverse). -/
def IsC1Diffeo {N : ℕ} (h : (Fin N → ℝ) → Fin N → ℝ) : Prop :=
  ContDiff ℝ 1 h ∧ ∃ g : (Fin N → ℝ) → Fin N → ℝ,
    ContDiff ℝ 1 g ∧ Function.LeftInverse g h ∧ Function.RightInverse g h

/-- Appendix E.1: the quotient `(1/ε) E ‖h(z + √ε η) - h(z)‖²`, `z, η ∼ N(0, I_N)` independent,
whose limit as `ε → 0⁺` is the normalized loss `𝓛(h)`; valued in `[0, ∞]`. -/
def dirichletQuotient (N : ℕ) (h : (Fin N → ℝ) → Fin N → ℝ) (ε : ℝ) : ℝ≥0∞ :=
  ENNReal.ofReal (1 / ε) *
    ∫⁻ p, ENNReal.ofReal (sqNorm (h (p.1 + Real.sqrt ε • p.2) - h p.1))
      ∂((stdGaussian N).prod (stdGaussian N))

end LeJEPAWorldModel
Source
Klindt, LeCun and Balestriero, When Does LeJEPA Learn a World Model?, arXiv:2605.26379v2 (2026), Sections 2.1.1, 2.2, 4.4 (eqs. (1)-(2), (6)), Appendix A.2 (eqs. (7), (10)), Appendix B.1 (eq. (30)), Appendix C (eqs. (36)-(37)), Appendix D, Appendix E.1
Read-back

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

Squared norm (sqNorm). For a natural number NNN and a vector v=(v1,…,vN)∈RNv=(v_1,\dots,v_N)\in\mathbb{R}^Nv=(v1​,…,vN​)∈RN, this is the sum of the squared coordinates:

∥v∥2:=∑i=1Nvi2.\|v\|^2 := \sum_{i=1}^{N} v_i^2 .∥v∥2:=i=1∑N​vi2​.

When N=0N=0N=0 the sum is empty and the value is 000.

Standard Gaussian (stdGaussian). For a natural number NNN, γN\gamma_NγN​ is the product measure on RN\mathbb{R}^NRN of NNN copies of the one-dimensional normal law with mean 000 and variance 111:

γN:=⨂i=1NN(0,1).\gamma_N := \bigotimes_{i=1}^{N} \mathcal{N}(0,1).γN​:=i=1⨂N​N(0,1).

Equivalently, the coordinates are independent standard normals. When N=0N=0N=0, R0\mathbb{R}^0R0 is a single point and γ0\gamma_0γ0​ is the unit point mass there.

Positive-pair law (ouPairLaw). For a natural number NNN and an arbitrary real number ρ\rhoρ, ΠN,ρ\Pi_{N,\rho}ΠN,ρ​ is a measure on RN×RN\mathbb{R}^N\times\mathbb{R}^NRN×RN. It is the image of the product measure γN⊗γN\gamma_N\otimes\gamma_NγN​⊗γN​ under the map

(x,y)  ⟼  (x,  ρ x+1−ρ2 y).(x,y)\;\longmapsto\;\bigl(x,\;\rho\,x+\sqrt{1-\rho^2}\,y\bigr).(x,y)⟼(x,ρx+1−ρ2​y).

So it is the joint law of (z,z′)(z,z')(z,z′), where z,ηz,\etaz,η are independent with law γN\gamma_NγN​ and z′=ρz+1−ρ2 ηz'=\rho z+\sqrt{1-\rho^2}\,\etaz′=ρz+1−ρ2​η.

  • No restriction is placed on ρ\rhoρ.
  • The square root is the real square root with the convention t=0\sqrt{t}=0t​=0 for t<0t<0t<0. Hence when ∣ρ∣>1|\rho|>1∣ρ∣>1 the law is that of (z,ρz)(z,\rho z)(z,ρz), with no noise term.
  • When ∣ρ∣=1|\rho|=1∣ρ∣=1 it is also the law of (z,ρz)(z,\rho z)(z,ρz).

Alignment loss (alignLoss). For NNN, a real ρ\rhoρ, and an arbitrary function h:RN→RNh:\mathbb{R}^N\to\mathbb{R}^Nh:RN→RN (no measurability, continuity or integrability is assumed), the loss is the integral against the positive-pair law ΠN,ρ\Pi_{N,\rho}ΠN,ρ​:

LN,ρ(h):=∫∥h(z′)−h(z)∥2 dΠN,ρ(z,z′).\mathcal{L}_{N,\rho}(h) := \int \bigl\|h(z')-h(z)\bigr\|^2 \, d\Pi_{N,\rho}(z,z').LN,ρ​(h):=∫​h(z′)−h(z)​2dΠN,ρ​(z,z′).

Here ∥⋅∥2\|\cdot\|^2∥⋅∥2 is the sum of squared coordinates defined above. The integral is a real-valued (Bochner) integral, and there is no normalising factor. If the integrand is not integrable, including the case where it is not measurable or has infinite integral, the value is by convention 000.

Covariance matrix (covMat). For NNN and an arbitrary h:RN→RNh:\mathbb{R}^N\to\mathbb{R}^Nh:RN→RN with coordinates h1,…,hNh_1,\dots,h_Nh1​,…,hN​, this is the N×NN\times NN×N real matrix with entries

Cov⁡(h)ij:=∫(hi(z)−∫hi dγN)(hj(z)−∫hj dγN) dγN(z).\operatorname{Cov}(h)_{ij} := \int \Bigl(h_i(z)-\int h_i\,d\gamma_N\Bigr)\Bigl(h_j(z)-\int h_j\,d\gamma_N\Bigr)\,d\gamma_N(z).Cov(h)ij​:=∫(hi​(z)−∫hi​dγN​)(hj​(z)−∫hj​dγN​)dγN​(z).

Every integral is a real-valued integral against γN\gamma_NγN​. Any integral whose integrand is not integrable is replaced by 000. In particular, the "mean" ∫hi dγN\int h_i\,d\gamma_N∫hi​dγN​ is 000 when hih_ihi​ is not γN\gamma_NγN​-integrable, and the whole entry is 000 when the product is not integrable.

Frobenius norm (frobNorm). For an N×NN\times NN×N real matrix AAA:

∥A∥F:=∑i=1N∑j=1NAij2.\|A\|_F := \sqrt{\sum_{i=1}^{N}\sum_{j=1}^{N} A_{ij}^2}.∥A∥F​:=i=1∑N​j=1∑N​Aij2​​.

This equals 000 when N=0N=0N=0.

Linear part (linearPart). For NNN and an arbitrary h:RN→RNh:\mathbb{R}^N\to\mathbb{R}^Nh:RN→RN, M(h)M(h)M(h) is the N×NN\times NN×N real matrix with entries

M(h)ij:=∫hi(z) zj dγN(z).M(h)_{ij} := \int h_i(z)\,z_j\,d\gamma_N(z).M(h)ij​:=∫hi​(z)zj​dγN​(z).

An entry is 000 by convention if the integrand is not γN\gamma_NγN​-integrable.

Nonlinear energy (nonlinearEnergy). For NNN and an arbitrary h:RN→RNh:\mathbb{R}^N\to\mathbb{R}^Nh:RN→RN, let M(h)M(h)M(h) be the matrix just defined. Then

Wnl(h):=∫∥h(z)−M(h) z∥2 dγN(z).W_{\mathrm{nl}}(h) := \int \bigl\|h(z)-M(h)\,z\bigr\|^2\,d\gamma_N(z).Wnl​(h):=∫​h(z)−M(h)z​2dγN​(z).

Here M(h)zM(h)zM(h)z is the ordinary matrix–vector product and ∥⋅∥2\|\cdot\|^2∥⋅∥2 is the sum of squared coordinates. The value is 000 by convention if the integrand is not integrable.

Hermite polynomial (hermiteHe). For k∈Nk\in\mathbb{N}k∈N and x∈Rx\in\mathbb{R}x∈R, Hek(x)\mathrm{He}_k(x)Hek​(x) is the value at xxx of the kkk-th probabilists' Hermite polynomial. This is the monic integer polynomial determined by

He0=1,Hek+1(x)=x Hek(x)−Hek′(x),\mathrm{He}_0=1,\qquad \mathrm{He}_{k+1}(x)=x\,\mathrm{He}_k(x)-\mathrm{He}_k'(x),He0​=1,Hek+1​(x)=xHek​(x)−Hek′​(x),

so for example He1(x)=x\mathrm{He}_1(x)=xHe1​(x)=x and He2(x)=x2−1\mathrm{He}_2(x)=x^2-1He2​(x)=x2−1.

Normalised Hermite polynomial (hermiteNormalized). For k∈Nk\in\mathbb{N}k∈N and x∈Rx\in\mathbb{R}x∈R:

h^k(x):=Hek(x)k!.\hat h_k(x) := \frac{\mathrm{He}_k(x)}{\sqrt{k!}}.h^k​(x):=k!​Hek​(x)​.

Since k!≥1k!\ge 1k!≥1, the denominator is never zero.

Multivariate Hermite function (multiHermite). For NNN, a multi-index α=(α1,…,αN)∈NN\alpha=(\alpha_1,\dots,\alpha_N)\in\mathbb{N}^Nα=(α1​,…,αN​)∈NN, and z∈RNz\in\mathbb{R}^Nz∈RN:

Hα(z):=∏j=1Nh^αj(zj).H_\alpha(z) := \prod_{j=1}^{N}\hat h_{\alpha_j}(z_j).Hα​(z):=j=1∏N​h^αj​​(zj​).

When N=0N=0N=0 this is the empty product, which equals 111.

Sturm–Liouville generator (slGenerator). The inputs are:

  • a real constant KKK;
  • arbitrary functions p,φ:R→Rp,\varphi:\mathbb{R}\to\mathbb{R}p,φ:R→R, with no positivity, differentiability or integrability assumed;
  • a point x∈Rx\in\mathbb{R}x∈R.

The value is

(Dφ)(x):=1p(x)⋅ddy[K p(y) φ′(y)]y=x.(\mathcal{D}\varphi)(x) := \frac{1}{p(x)}\cdot\frac{d}{dy}\Bigl[K\,p(y)\,\varphi'(y)\Bigr]_{y=x}.(Dφ)(x):=p(x)1​⋅dyd​[Kp(y)φ′(y)]y=x​.

Several conventions apply in degenerate cases:

  • Each derivative is the derivative where it exists and is taken to be 000 at any point where the function is not differentiable. This applies both to φ′(y)\varphi'(y)φ′(y) and to the outer derivative.
  • Division by zero gives 000, so the value is 000 wherever p(x)=0p(x)=0p(x)=0.
  • ppp is not required to be a probability density, and KKK may be zero or negative.

Plan cost (planCost). The setting is:

  • a natural number NNN and an arbitrary type AAA of actions;
  • a family PPP assigning to each state z∈RNz\in\mathbb{R}^Nz∈RN and action a∈Aa\in Aa∈A a measure P(z,a)P(z,a)P(z,a) on RN\mathbb{R}^NRN;
  • a stage cost c:RN×A→Rc:\mathbb{R}^N\times A\to\mathbb{R}c:RN×A→R;
  • a terminal cost cT:RN→Rc_T:\mathbb{R}^N\to\mathbb{R}cT​:RN→R.

The measures P(z,a)P(z,a)P(z,a) are not required to be probability measures, or even finite, and there is no measurability assumption in (z,a)(z,a)(z,a). For a finite list of actions and a state zzz, the cost is defined by recursion on the list:

Cost([ ],z)=cT(z),Cost(a::as, z)=c(z,a)+∫Cost(as,z′) dP(z,a)(z′).\mathrm{Cost}([\,],z) = c_T(z),\qquad \mathrm{Cost}(a::as,\,z) = c(z,a) + \int \mathrm{Cost}(as,z')\,dP(z,a)(z').Cost([],z)=cT​(z),Cost(a::as,z)=c(z,a)+∫Cost(as,z′)dP(z,a)(z′).

Here a::asa::asa::as is the list with first action aaa followed by the list asasas. The first action in the list is applied first, and the stage cost is evaluated at the state before that action. Each integral is a real-valued integral, set to 000 when the integrand is not integrable with respect to P(z,a)P(z,a)P(z,a). In particular, it is 000 whenever P(z,a)P(z,a)P(z,a) is the zero measure.

Optimal value (optimalValue). For P,c,cTP,c,c_TP,c,cT​ as above, a horizon T∈NT\in\mathbb{N}T∈N, and an initial state z0∈RNz_0\in\mathbb{R}^Nz0​∈RN:

VT∗(z0):=inf⁡{Cost(as,z0):as a list of actions of length exactly T},V^*_T(z_0) := \inf\bigl\{\mathrm{Cost}(as,z_0) : as \text{ a list of actions of length exactly } T\bigr\},VT∗​(z0​):=inf{Cost(as,z0​):as a list of actions of length exactly T},

taken as a real number. Under the real-infimum convention, the value is 000 in two cases:

  • the set of costs is unbounded below;
  • the set is empty, which happens when AAA is empty and T>0T>0T>0.

The infimum need not be attained. When T=0T=0T=0, the only list is the empty one, and the value is cT(z0)c_T(z_0)cT​(z0​).

Optimal plan (IsOptimalPlan). For P,c,cT,T,z0P,c,c_T,T,z_0P,c,cT​,T,z0​ as above and a list of actions asasas, the statement "asasas is optimal" means both of the following hold:

  • asasas has length exactly TTT;
  • for every list bsbsbs of length TTT, Cost(as,z0)≤Cost(bs,z0)\mathrm{Cost}(as,z_0)\le \mathrm{Cost}(bs,z_0)Cost(as,z0​)≤Cost(bs,z0​).

The definition makes no reference to VT∗V^*_TVT∗​. Costs here include the junk value 000 for non-integrable integrands.

Pushed-forward dynamics (pushDynamics). For an arbitrary N×NN\times NN×N real matrix QQQ and a family PPP as above, this defines a new family P^\hat PP^. For each z^∈RN\hat z\in\mathbb{R}^Nz^∈RN and a∈Aa\in Aa∈A, P^(z^,a)\hat P(\hat z,a)P^(z^,a) is the image of the measure P(Q⊤z^, a)P(Q^{\top}\hat z,\,a)P(Q⊤z^,a) under the linear map z↦Qzz\mapsto Qzz↦Qz:

P^(z^,a)(B)=P(Q⊤z^,a)({z:Qz∈B}).\hat P(\hat z,a)(B) = P(Q^{\top}\hat z,a)\bigl(\{z : Qz\in B\}\bigr).P^(z^,a)(B)=P(Q⊤z^,a)({z:Qz∈B}).

QQQ is not required to be orthogonal, invertible or nonzero, and Q⊤Q^{\top}Q⊤ is simply the transpose. It is not an inverse of QQQ unless QQQ happens to be orthogonal.

C1C^1C1 diffeomorphism (IsC1Diffeo). For h:RN→RNh:\mathbb{R}^N\to\mathbb{R}^Nh:RN→RN, the property holds when both of the following are true:

  • hhh is continuously differentiable (C1C^1C1);
  • there exists a C1C^1C1 map g:RN→RNg:\mathbb{R}^N\to\mathbb{R}^Ng:RN→RN with g(h(x))=xg(h(x))=xg(h(x))=x for all xxx and h(g(y))=yh(g(y))=yh(g(y))=y for all yyy.

In other words, hhh is a C1C^1C1 bijection with C1C^1C1 inverse. When N=0N=0N=0 every hhh satisfies this.

Dirichlet quotient (dirichletQuotient). For NNN, an arbitrary h:RN→RNh:\mathbb{R}^N\to\mathbb{R}^Nh:RN→RN, and a real ε\varepsilonε, the value lies in the extended non-negative reals [0,∞][0,\infty][0,∞]:

Qε(h):=(1ε)+⋅∫∥h(x+ε y)−h(x)∥2 d(γN⊗γN)(x,y).Q_\varepsilon(h) := \Bigl(\tfrac{1}{\varepsilon}\Bigr)^{+}\cdot\int \bigl\|h(x+\sqrt{\varepsilon}\,y)-h(x)\bigr\|^2\,d(\gamma_N\otimes\gamma_N)(x,y).Qε​(h):=(ε1​)+⋅∫​h(x+ε​y)−h(x)​2d(γN​⊗γN​)(x,y).

Here (t)+=max⁡(t,0)(t)^{+}=\max(t,0)(t)+=max(t,0), and the integral is the non-negative (lower Lebesgue) integral over independent x,yx,yx,y with law γN\gamma_NγN​, which may equal +∞+\infty+∞. The degenerate cases are:

  • The convention 0⋅∞=00\cdot\infty=00⋅∞=0 applies to the product.
  • For ε<0\varepsilon<0ε<0, 1/ε<01/\varepsilon<01/ε<0, so the prefactor is 000 and Qε(h)=0Q_\varepsilon(h)=0Qε​(h)=0.
  • For ε=0\varepsilon=0ε=0, 1/0=01/0=01/0=0, so again Q0(h)=0Q_0(h)=0Q0​(h)=0.

Only for ε>0\varepsilon>0ε>0 is this the quotient 1ε E∥h(z+ε η)−h(z)∥2\tfrac1\varepsilon\,\mathbb{E}\|h(z+\sqrt\varepsilon\,\eta)-h(z)\|^2ε1​E∥h(z+ε​η)−h(z)∥2. No limit in ε\varepsilonε is taken in this definition.

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