Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Good Views Are Not Enough: Epps–Pulley discrepancy, four-state scalar model and 512-dimensional whitened model

Definition
GoodViewsNotEnough_Basic

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

characteristic-functionepps-pulleyjepanonuniquenessself-supervised-learning

Objects of Sections 3–5 and Appendices A–E of Xu (2026), Good Views Are Not Enough.

  1. Characteristic-function discrepancy (eq. 6). For a law μ\muμ on R\mathbb{R}R with characteristic function φμ(t)=EμeitX\varphi_\mu(t)=\mathbb{E}_\mu e^{itX}φμ​(t)=Eμ​eitX, the standard Gaussian characteristic function g(t)=e−t2/2g(t)=e^{-t^2/2}g(t)=e−t2/2 and a finite frequency measure ν\nuν on R\mathbb{R}R: Dν(μ)=∫∣φμ(t)−g(t)∣2 dν(t)D_\nu(\mu)=\int|\varphi_\mu(t)-g(t)|^2\,d\nu(t)Dν​(μ)=∫∣φμ​(t)−g(t)∣2dν(t), Aν=ν(R)A_\nu=\nu(\mathbb{R})Aν​=ν(R) and Jν(μ)=∫∣φμ(t)∣2 dν(t)J_\nu(\mu)=\int|\varphi_\mu(t)|^2\,d\nu(t)Jν​(μ)=∫∣φμ​(t)∣2dν(t).
  2. Epps–Pulley statistic. For a batch y∈RNy\in\mathbb{R}^Ny∈RN with empirical law μ^N=1N∑nδyn\hat\mu_N=\frac1N\sum_n\delta_{y_n}μ^​N​=N1​∑n​δyn​​, the statistic is N Dν(μ^N)N\,D_\nu(\hat\mu_N)NDν​(μ^​N​). Its expectation over an i.i.d. batch from μ\muμ is RN,ν(μ)R_{N,\nu}(\mu)RN,ν​(μ).
  3. Frequency measures. The analytic measure is dν=e−t2/2 dtd\nu=e^{-t^2/2}\,dtdν=e−t2/2dt. The scalar grid is νgr=∑j=−88ωjδtj\nu_{\rm gr}=\sum_{j=-8}^{8}\omega_j\delta_{t_j}νgr​=∑j=−88​ωj​δtj​​ with tj=5j/8t_j=5j/8tj​=5j/8, ωj=58cje−tj2/2\omega_j=\frac58c_je^{-t_j^2/2}ωj​=85​cj​e−tj2​/2, c±8=12c_{\pm8}=\frac12c±8​=21​ and cj=1c_j=1cj​=1 otherwise (eq. 11).
  4. Four-state scalar model (Section 4). There are four observations (S,U)=(1,1),(1,−1),(−1,1),(−1,−1)(S,U)=(1,1),(1,-1),(-1,1),(-1,-1)(S,U)=(1,1),(1,−1),(−1,1),(−1,−1) with uniform law, scene signs s=(1,1,−1,−1)s=(1,1,-1,-1)s=(1,1,−1,−1) and the pair law πij=(1+sisj/2)/16\pi_{ij}=(1+s_is_j/2)/16πij​=(1+si​sj​/2)/16. A scalar encoder is x∈R4x\in\mathbb{R}^4x∈R4 with output law μx=14∑iδxi\mu_x=\frac14\sum_i\delta_{x_i}μx​=41​∑i​δxi​​. The prediction term is Pπ(x)=14∑i,jπij(xi−xj)2P_\pi(x)=\frac14\sum_{i,j}\pi_{ij}(x_i-x_j)^2Pπ​(x)=41​∑i,j​πij​(xi​−xj​)2 and the centred domain is X0={x:∑ixi=0}X_0=\{x:\sum_ix_i=0\}X0​={x:∑i​xi​=0}. The objectives are Fπ(x)=Pπ(x)+149R1024,gr(μx)F_\pi(x)=P_\pi(x)+\frac1{49}R_{1024,\rm gr}(\mu_x)Fπ​(x)=Pπ​(x)+491​R1024,gr​(μx​) (eq. 1), Pπ+γDν(μx)P_\pi+\gamma D_\nu(\mu_x)Pπ​+γDν​(μx​) and Pπ+αRN,ν(μx)P_\pi+\alpha R_{N,\nu}(\mu_x)Pπ​+αRN,ν​(μx​). The within-scene swaps are T+=(12)T_+=(12)T+​=(12) and T−=(34)T_-=(34)T−​=(34). The comparator is w=(1/10,13/10,−1/10,−13/10)w=(1/10,13/10,-1/10,-13/10)w=(1/10,13/10,−1/10,−13/10), and d∗=2π2+2π3−74π 2−3/14d_*=\frac{\sqrt{2\pi}}2+\sqrt{\frac{2\pi}3}-\frac74\sqrt\pi\,2^{-3/14}d∗​=22π​​+32π​​−47​π​2−3/14. Further: ∥x∥p2=14∑ixi2\|x\|_p^2=\frac14\sum_ix_i^2∥x∥p2​=41​∑i​xi2​, d±(x,z)=min⁡{∥x−z∥p,∥x+z∥p}d_\pm(x,z)=\min\{\|x-z\|_p,\|x+z\|_p\}d±​(x,z)=min{∥x−z∥p​,∥x+z∥p​}, E[x∣S]\mathbb{E}[x\mid S]E[x∣S] is the scene average, and u(x)=EVar⁡(x∣S)u(x)=\mathbb{E}\operatorname{Var}(x\mid S)u(x)=EVar(x∣S). A pair law with uniform marginals is a symmetric nonnegative π′\pi'π′ with ∑jπij′=14\sum_j\pi'_{ij}=\frac14∑j​πij′​=41​.
  5. 512-dimensional model (Section 5). The scene SSS takes 513 values with p1=p2=14p_1=p_2=\frac14p1​=p2​=41​ and ps=11022p_s=\frac1{1022}ps​=10221​ otherwise. The nuisance UUU is uniform on {−1,1}512\{-1,1\}^{512}{−1,1}512, independent of SSS. An encoder is any map h(S,U)∈R512h(S,U)\in\mathbb{R}^{512}h(S,U)∈R512. It is whitened if Eh=0\mathbb{E}h=0Eh=0 and Ehh⊤=I512\mathbb{E}hh^\top=I_{512}Ehh⊤=I512​, and its nuisance fraction is u(h)=1512E∥h−E[h∣S]∥2u(h)=\frac1{512}\mathbb{E}\|h-\mathbb{E}[h\mid S]\|^2u(h)=5121​E∥h−E[h∣S]∥2.
  6. Pooled statistic (eqs. 19–21). The nodes are tj=3j/16t_j=3j/16tj​=3j/16, 0≤j≤160\le j\le160≤j≤16, with weights ωj=316djgj\omega_j=\frac3{16}d_jg_jωj​=163​dj​gj​, where d0=d16=1d_0=d_{16}=1d0​=d16​=1 and dj=2d_j=2dj​=2 otherwise. A batch B\mathcal BB has N=256N=256N=256 i.i.d. scenes and V=8V=8V=8 independent nuisances per scene, giving M=2048M=2048M=2048 outputs. For a direction θ\thetaθ uniform on S511\mathbb{S}^{511}S511, R^B,θ(h)=M∑jωj∣1M∑i,veitjθ⊤h(Si,Uiv)−gj∣2\widehat R_{\mathcal B,\theta}(h)=M\sum_j\omega_j\big|\frac1M\sum_{i,v}e^{it_j\theta^\top h(S_i,U_{iv})}-g_j\big|^2RB,θ​(h)=M∑j​ωj​​M1​∑i,v​eitj​θ⊤h(Si​,Uiv​)−gj​​2. Then Rˉ(h)=EB,θR^B,θ(h)\bar R(h)=\mathbb{E}_{\mathcal B,\theta}\widehat R_{\mathcal B,\theta}(h)Rˉ(h)=EB,θ​RB,θ​(h) and F(h)=54u(h)+150Rˉ(h)F(h)=\frac54u(h)+\frac1{50}\bar R(h)F(h)=45​u(h)+501​Rˉ(h). The direction-averaged terms are JJJ, JcJ_cJc​ and XXX of Appendix D.2.
  7. Single batch (eq. 28). F^B(h)=1NVk∑i,v∥hiv−hˉi,G∥2+150EθR^B,θ(h)\widehat F_{\mathcal B}(h)=\frac1{NVk}\sum_{i,v}\|h_{iv}-\bar h_{i,G}\|^2+\frac1{50}\mathbb{E}_\theta\widehat R_{\mathcal B,\theta}(h)FB​(h)=NVk1​∑i,v​∥hiv​−hˉi,G​∥2+501​Eθ​RB,θ​(h), where hˉi,G\bar h_{i,G}hˉi,G​ averages the first G=2G=2G=2 views.
  8. Alignment and the linear class. The alignment error is 1512E∥h1(S,U1)−Qh2(S,U2)∥2\frac1{512}\mathbb{E}\|h_1(S,U_1)-Qh_2(S,U_2)\|^25121​E∥h1​(S,U1​)−Qh2​(S,U2​)∥2 with U1,U2U_1,U_2U1​,U2​ independent. Here rrr is a centred orthonormal scene basis (Er=0\mathbb{E}r=0Er=0, Err⊤=I\mathbb{E}rr^\top=IErr⊤=I), and hW(S,U)=W(r(S),U)h_W(S,U)=W(r(S),U)hW​(S,U)=W(r(S),U) with W∈R512×1024W\in\mathbb{R}^{512\times1024}W∈R512×1024 and WW⊤=IWW^\top=IWW⊤=I.

Formalization Note Observation (S,U)(S,U)(S,U) of the scalar model is index i∈{0,1,2,3}i\in\{0,1,2,3\}i∈{0,1,2,3} in the listed order, and scenes 1,21,21,2 of the 512-dimensional model are indices 0,10,10,1. A cube point is a Boolean vector, mapped to ±1\pm1±1. All expectations over the finite observation spaces are finite weighted sums. The uniform law on S511\mathbb{S}^{511}S511 is Mathlib's surface measure on the sphere, normalised to total mass one.

Definition code
import Mathlib

/-!
Anran Xu, *Good Views Are Not Enough: Global Counterexamples for Gaussian-Regularized JEPAs*,
arXiv:2611.12137v1 (2026): the characteristic-function discrepancy and the expected Epps–Pulley
statistic of Section 3 and Appendix A, the four-state scalar model of Section 4 and Appendices B–C,
and the 512-dimensional whitened model with pooled Epps–Pulley regularization of Section 5 and
Appendices D–E.
-/

open MeasureTheory Complex
open scoped ENNReal

noncomputable section

namespace GoodViewsNotEnough

/-! ### Characteristic-function discrepancy and the Epps–Pulley statistic -/

/-- Section 3 and Appendix A, eq. (6): the standard Gaussian characteristic function
`g(t) = exp(-t²/2)`. -/
def gaussCF (t : ℝ) : ℝ := Real.exp (-t ^ 2 / 2)

/-- Appendix A, eq. (6): the weighted characteristic-function discrepancy
`D_ν(μ) = ∫ |φ_μ(t) - g(t)|² dν(t)` of a law `μ` on `ℝ` for a frequency measure `ν`. -/
def discrepancy (ν μ : Measure ℝ) : ℝ := ∫ t, ‖charFun μ t - (gaussCF t : ℂ)‖ ^ 2 ∂ν

/-- Appendix A, eq. (6): the total mass `A_ν = ∫ dν` of a frequency measure. -/
def freqMass (ν : Measure ℝ) : ℝ := (ν Set.univ).toReal

/-- Appendix A, eq. (6): the self term `J_ν(μ) = ∫ |φ_μ(t)|² dν(t)`. -/
def selfTerm (ν μ : Measure ℝ) : ℝ := ∫ t, ‖charFun μ t‖ ^ 2 ∂ν

/-- Appendix A: the empirical law `(1/N) ∑_n δ_{y_n}` of a batch `y` of size `N`. -/
def empiricalLaw {N : ℕ} (y : Fin N → ℝ) : Measure ℝ :=
  ∑ n, (N : ℝ≥0∞)⁻¹ • Measure.dirac (y n)

/-- Section 3 and Appendix A: the Epps–Pulley statistic of a batch of size `N`, which is `N` times
the empirical discrepancy, `N · D_ν(μ̂_N)`. -/
def epStat {N : ℕ} (ν : Measure ℝ) (y : Fin N → ℝ) : ℝ := N * discrepancy ν (empiricalLaw y)

/-- Section 4 and Appendix A, before eq. (7): `R_{N,ν}(μ)`, the exact expectation of the
Epps–Pulley statistic on an i.i.d. batch of size `N` drawn from `μ`. -/
def iidEP (N : ℕ) (ν μ : Measure ℝ) : ℝ := ∫ y, epStat ν y ∂(Measure.pi fun _ : Fin N => μ)

/-- Appendix B.2: the analytic frequency measure `dν = e^{-t²/2} dt` on `ℝ`. -/
def analyticFreq : Measure ℝ := volume.withDensity fun t => ENNReal.ofReal (gaussCF t)

/-- Section 4 and Appendix B.2, eq. (11): the scalar grid nodes `t_j = 5j/8`, `-8 ≤ j ≤ 8`, indexed
by `j + 8 ∈ {0, …, 16}`. -/
def scalarNode (j : Fin 17) : ℝ := 5 * (((j : ℕ) : ℝ) - 8) / 8

/-- Section 4 and Appendix B.2, eq. (11): the grid weights `ω_j = (5/8) c_j e^{-t_j²/2}` with
`c_{±8} = 1/2` and `c_j = 1` otherwise. -/
def scalarWeight (j : Fin 17) : ℝ :=
  5 / 8 * (if (j : ℕ) = 0 ∨ (j : ℕ) = 16 then 1 / 2 else 1) * gaussCF (scalarNode j)

/-- Section 4 and Appendix B.2, eq. (11): the grid frequency measure `∑_j ω_j δ_{t_j}`, for which
`D_ν = D_gr = ∑_j ω_j |φ(t_j) - g_j|²`. -/
def gridFreq : Measure ℝ :=
  ∑ j, ENNReal.ofReal (scalarWeight j) • Measure.dirac (scalarNode j)

/-! ### The four-state scalar model (Section 4, Appendices B and C) -/

/-- Section 4 and Appendix B.1: the scene sign `s = (1, 1, -1, -1)` of the four observations
`(S,U) = (1,1), (1,-1), (-1,1), (-1,-1)`. -/
def scalarScene : Fin 4 → ℝ := ![1, 1, -1, -1]

/-- Section 4 and Appendix B.1, eq. (8): the positive-pair law `π_ij = (1 + s_i s_j / 2) / 16`. -/
def scalarPairLaw (i j : Fin 4) : ℝ := (1 + scalarScene i * scalarScene j / 2) / 16

/-- Appendix C, Corollary 6: `π` is a symmetric pair law on the four observations with uniform
marginals `∑_j π_ij = 1/4`. -/
def IsUniformPairLaw (π : Fin 4 → Fin 4 → ℝ) : Prop :=
  (∀ i j, 0 ≤ π i j) ∧ (∀ i j, π i j = π j i) ∧ ∀ i, ∑ j, π i j = 1 / 4

/-- Section 4: the prediction term `P_π(x) = (1/4) ∑_{i,j} π_ij (x_i - x_j)²` of a scalar
encoder `x ∈ ℝ⁴`. -/
def scalarPred (π : Fin 4 → Fin 4 → ℝ) (x : Fin 4 → ℝ) : ℝ :=
  1 / 4 * ∑ i, ∑ j, π i j * (x i - x j) ^ 2

/-- Section 4, eq. (1): the output law `μ_x = (1/4) ∑_i δ_{x_i}` of a scalar encoder. -/
def scalarLaw (x : Fin 4 → ℝ) : Measure ℝ := ∑ i, (4 : ℝ≥0∞)⁻¹ • Measure.dirac (x i)

/-- Appendix B.2, Lemma 3: the equally weighted two-atom law `(δ_b + δ_c)/2`. -/
def twoAtomLaw (b c : ℝ) : Measure ℝ := (2 : ℝ≥0∞)⁻¹ • (Measure.dirac b + Measure.dirac c)

/-- Section 4: the centred domain `X₀ = {x ∈ ℝ⁴ : ∑_i x_i = 0}` (that is, `E_p x = 0`). -/
def centeredDomain : Set (Fin 4 → ℝ) := {x | ∑ i, x i = 0}

/-- Section 4, eq. (1), and Appendix C, Lemma 5: `F_π(x) = P_π(x) + R_{1024,gr}(μ_x)/49`. -/
def scalarObjective (π : Fin 4 → Fin 4 → ℝ) (x : Fin 4 → ℝ) : ℝ :=
  scalarPred π x + 1 / 49 * iidEP 1024 gridFreq (scalarLaw x)

/-- Appendix B.3, Theorem 4: the deterministic objective `P_π + γ D_ν(μ_x)`. -/
def detObjective (ν : Measure ℝ) (γ : ℝ) (x : Fin 4 → ℝ) : ℝ :=
  scalarPred scalarPairLaw x + γ * discrepancy ν (scalarLaw x)

/-- Appendix B.3, Theorem 4: the i.i.d. objective `P_π + α R_{N,ν}(μ_x)`. -/
def iidObjective (ν : Measure ℝ) (N : ℕ) (α : ℝ) (x : Fin 4 → ℝ) : ℝ :=
  scalarPred scalarPairLaw x + α * iidEP N ν (scalarLaw x)

/-- Appendix B.1: the within-scene swaps `T₊ = (12)` and `T₋ = (34)` (0-indexed: `(0 1)`, `(2 3)`). -/
def sceneSwaps : Set (Equiv.Perm (Fin 4)) := {Equiv.swap 0 1, Equiv.swap 2 3}

/-- Appendix B.3, Theorem 4: the conclusion of the theorem for an objective `F` on a domain `X`.
`F` attains its minimum on `X`, and for every global minimiser `x` some within-scene swap `x ∘ T`
lies in `X`, has the same value, and lies outside the sign orbit `{x, -x}`. -/
def SwapNonuniqueness (F : (Fin 4 → ℝ) → ℝ) (X : Set (Fin 4 → ℝ)) : Prop :=
  (∃ x ∈ X, IsMinOn F X x) ∧
    ∀ x ∈ X, IsMinOn F X x →
      ∃ T ∈ sceneSwaps, x ∘ ⇑T ∈ X ∧ F (x ∘ ⇑T) = F x ∧ x ∘ ⇑T ≠ x ∧ x ∘ ⇑T ≠ -x

/-- Section 4 and Appendix B.2, Lemma 3: the rational comparator `w = (1/10, 13/10, -1/10, -13/10)`. -/
def scalarComparator : Fin 4 → ℝ := ![1 / 10, 13 / 10, -1 / 10, -13 / 10]

/-- Appendix B.2, eq. (12): `d_* = √(2π)/2 + √(2π/3) - (7/4) √π 2^{-3/14}`. -/
def analyticTwoAtomMin : ℝ :=
  Real.sqrt (2 * Real.pi) / 2 + Real.sqrt (2 * Real.pi / 3) -
    7 / 4 * Real.sqrt Real.pi * (2 : ℝ) ^ (-(3 : ℝ) / 14)

/-- Appendix A: the norm `‖x‖_p = (E_p x²)^{1/2}` under the uniform law `p` on four observations. -/
def pNorm (x : Fin 4 → ℝ) : ℝ := Real.sqrt (1 / 4 * ∑ i, x i ^ 2)

/-- Appendix A: the scalar sign-orbit distance `d_±(x,z) = min{‖x - z‖_p, ‖x + z‖_p}`. -/
def signOrbitDist (x z : Fin 4 → ℝ) : ℝ := min (pNorm (x - z)) (pNorm (x + z))

/-- Appendix C: the conditional scene mean `E[x | S]` of a scalar encoder. -/
def sceneCondMean (x : Fin 4 → ℝ) : Fin 4 → ℝ :=
  fun i => if (i : ℕ) < 2 then (x 0 + x 1) / 2 else (x 2 + x 3) / 2

/-- Appendix C: the within-scene variance `u(x) = E Var(x | S)`. -/
def scalarNuisance (x : Fin 4 → ℝ) : ℝ := 1 / 4 * ∑ i, (x i - sceneCondMean x i) ^ 2

/-! ### The 512-dimensional whitened model (Section 5, Appendices D and E) -/

/-- Section 5 and Appendix D.1, eq. (16): the scene law on 513 scenes, `p₁ = p₂ = 1/4` and
`p_s = 1/1022` otherwise (scenes 1, 2 of the paper are indices 0, 1). -/
def hdSceneProb (s : Fin 513) : ℝ := if (s : ℕ) < 2 then 1 / 4 else 1 / 1022

/-- Section 5: the probability `2^{-512}` of each nuisance `U ∈ {-1,1}^{512}`, drawn uniformly. -/
def cubeProb : ℝ := ((2 : ℝ) ^ 512)⁻¹

/-- Section 5: the nuisance vector `U ∈ {-1,1}^{512}` encoded by a Boolean vector. -/
def cubeVec (U : Fin 512 → Bool) : Fin 512 → ℝ := fun a => if U a then 1 else -1

/-- Section 5: the population expectation `E f(S,U)` with `S ∼ p` and `U` uniform on the cube,
independent. -/
def popMean (f : Fin 513 → (Fin 512 → Bool) → ℝ) : ℝ :=
  ∑ s, ∑ U, hdSceneProb s * cubeProb * f s U

/-- Section 5 and Appendix D.1, eq. (17): an encoder `h(S,U) ∈ ℝ^{512}` is exactly whitened,
`E h = 0` and `E h hᵀ = I_{512}`. -/
def IsWhitenedHD (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) : Prop :=
  (∀ a, popMean (fun s U => h s U a) = 0) ∧
    ∀ a b, popMean (fun s U => h s U a * h s U b) = if a = b then 1 else 0

/-- Section 5: the conditional scene mean `E[h | S = s]`. -/
def hdCondMean (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) (s : Fin 513) : Fin 512 → ℝ :=
  fun a => ∑ U, cubeProb * h s U a

/-- Section 5 and eq. (17): the nuisance fraction `u(h) = (1/512) E ‖h - E[h | S]‖²`. -/
def nuisanceFrac (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) : ℝ :=
  1 / 512 * popMean (fun s U => ∑ a, (h s U a - hdCondMean h s a) ^ 2)

/-- Section 5 and Appendix D.2, eq. (19): the pooled nodes `t_j = 3j/16`, `0 ≤ j ≤ 16`. -/
def pooledNode (j : Fin 17) : ℝ := 3 * ((j : ℕ) : ℝ) / 16

/-- Section 5 and Appendix D.2, eq. (19): the pooled weights `ω_j = (3/16) d_j g_j` with
`d_0 = d_16 = 1`, `d_j = 2` otherwise, and `g_j = e^{-t_j²/2}`. -/
def pooledWeight (j : Fin 17) : ℝ :=
  3 / 16 * (if (j : ℕ) = 0 ∨ (j : ℕ) = 16 then 1 else 2) * gaussCF (pooledNode j)

/-- Section 5 and Appendix D.2: a batch of `N = 256` examples, each a scene `S_i` and `V = 8`
nuisances `U_{i1}, …, U_{i8}` (one per view). -/
abbrev HDBatch := Fin 256 → Fin 513 × (Fin 8 → Fin 512 → Bool)

/-- Section 5 and Appendix E: the probability of a batch; scenes are i.i.d. `∼ p` and the
`8 · 256` nuisances are i.i.d. uniform on the cube, independent of the scenes. -/
def batchProb (B : HDBatch) : ℝ := ∏ i, (hdSceneProb (B i).1 * cubeProb ^ 8)

/-- Appendix E: the law of a batch, as a measure on batches. -/
def batchLaw : Measure HDBatch := ∑ B, ENNReal.ofReal (batchProb B) • Measure.dirac B

/-- Section 5 and Appendix A: the uniform probability measure on the unit sphere `𝕊^{511}`. -/
def sphereDir : Measure (Metric.sphere (0 : EuclideanSpace ℝ (Fin 512)) 1) :=
  ((volume : Measure (EuclideanSpace ℝ (Fin 512))).toSphere Set.univ)⁻¹ •
    (volume : Measure (EuclideanSpace ℝ (Fin 512))).toSphere

/-- Section 5: the projection `θᵀ v` of an embedding onto a direction `θ ∈ 𝕊^{511}`. -/
def dirProj (θ : Metric.sphere (0 : EuclideanSpace ℝ (Fin 512)) 1) (v : Fin 512 → ℝ) : ℝ :=
  ∑ a, (θ : EuclideanSpace ℝ (Fin 512)) a * v a

/-- Appendix D.2: the pooled statistic `R̂_{B,θ}(h) = M ∑_j ω_j |M⁻¹ ∑_{i,v} e^{i t_j θᵀ h(S_i,U_iv)} - g_j|²`
with `M = NV = 2048`. -/
def pooledStat (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) (B : HDBatch)
    (θ : Metric.sphere (0 : EuclideanSpace ℝ (Fin 512)) 1) : ℝ :=
  2048 * ∑ j, pooledWeight j *
    ‖(1 / 2048 : ℂ) * (∑ i, ∑ v, Complex.exp ((pooledNode j * dirProj θ (h (B i).1 ((B i).2 v)) : ℝ) * I)) -
      (gaussCF (pooledNode j) : ℂ)‖ ^ 2

/-- Appendix E, eq. (28): the direction-averaged pooled statistic `E_θ R̂_{B,θ}(h)` of one batch. -/
def dirAvgPooledStat (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) (B : HDBatch) : ℝ :=
  ∫ θ, pooledStat h B θ ∂sphereDir

/-- Section 5, eq. (2), and Appendix D.2: the expected pooled statistic `R̄(h) = E_{B,θ} R̂_{B,θ}(h)`. -/
def pooledEP (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) : ℝ :=
  ∑ B, batchProb B * dirAvgPooledStat h B

/-- Section 5, eq. (2), and Appendix D.2, eq. (21): `F(h) = (5/4) u(h) + R̄(h)/50`. -/
def highObjective (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) : ℝ :=
  5 / 4 * nuisanceFrac h + 1 / 50 * pooledEP h

/-- Appendix D.2: the characteristic function `φ_{h,θ}(t) = E e^{i t θᵀ h(S,U)}` of the projected
output. -/
def hdCF (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ)
    (θ : Metric.sphere (0 : EuclideanSpace ℝ (Fin 512)) 1) (t : ℝ) : ℂ :=
  ∑ s, ∑ U, ((hdSceneProb s * cubeProb : ℝ) : ℂ) * Complex.exp ((t * dirProj θ (h s U) : ℝ) * I)

/-- Appendix D.2: the conditional characteristic function `φ_{h|S=s,θ}(t) = E[e^{i t θᵀ h} | S = s]`. -/
def hdCondCF (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) (s : Fin 513)
    (θ : Metric.sphere (0 : EuclideanSpace ℝ (Fin 512)) 1) (t : ℝ) : ℂ :=
  ∑ U, ((cubeProb : ℝ) : ℂ) * Complex.exp ((t * dirProj θ (h s U) : ℝ) * I)

/-- Appendix D.2: the direction-averaged marginal self term `J(h) = ∑_j ω_j E_θ |φ_{h,θ}(t_j)|²`. -/
def pooledJ (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) : ℝ :=
  ∑ j, pooledWeight j * ∫ θ, ‖hdCF h θ (pooledNode j)‖ ^ 2 ∂sphereDir

/-- Appendix D.2: the direction-averaged conditional self term
`J_c(h) = ∑_j ω_j E_{S,θ} |φ_{h|S,θ}(t_j)|²`. -/
def pooledJc (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) : ℝ :=
  ∑ j, pooledWeight j * ∑ s, hdSceneProb s * ∫ θ, ‖hdCondCF h s θ (pooledNode j)‖ ^ 2 ∂sphereDir

/-- Appendix D.2: the direction-averaged target cross term
`X(h) = ∑_j ω_j g_j E_θ Re φ_{h,θ}(t_j)`. -/
def pooledX (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) : ℝ :=
  ∑ j, pooledWeight j * gaussCF (pooledNode j) * ∫ θ, (hdCF h θ (pooledNode j)).re ∂sphereDir

/-- Appendix E, eq. (28): the single-batch prediction term
`(1/(NVk)) ∑_{i,v} ‖h_{iv} - h̄_{i,G}‖²`, where `h̄_{i,G}` averages the `G = 2` global views
(the first two views). -/
def batchPred (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) (B : HDBatch) : ℝ :=
  1 / (256 * 8 * 512) * ∑ i, ∑ v, ∑ a,
    (h (B i).1 ((B i).2 v) a - (h (B i).1 ((B i).2 0) a + h (B i).1 ((B i).2 1) a) / 2) ^ 2

/-- Appendix E, eq. (28): the single-batch objective `F̂_B(h)`. -/
def batchObjective (B : HDBatch) (h : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) : ℝ :=
  batchPred h B + 1 / 50 * dirAvgPooledStat h B

/-- Appendix A and Theorem 2: the cross-modal alignment error `E ‖h₁ - Q h₂‖² / k`, the two
encoders seeing the same scene `S ∼ p` with independent nuisances `U₁, U₂`. -/
def alignErr (h₁ h₂ : Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ) (Q : Matrix (Fin 512) (Fin 512) ℝ) :
    ℝ :=
  1 / 512 * ∑ s, ∑ U₁, ∑ U₂, hdSceneProb s * cubeProb * cubeProb *
    ∑ a, (h₁ s U₁ a - Q.mulVec (h₂ s U₂) a) ^ 2

/-- Section 5 and Appendix D.1: `r` is a complete centred orthonormal basis of the scene functions
in `L²(p)`, that is, `E r(S) = 0` and `E r(S) r(S)ᵀ = I_{512}`. -/
def IsCenteredOrthonormalBasis (r : Fin 513 → Fin 512 → ℝ) : Prop :=
  (∀ a, ∑ s, hdSceneProb s * r s a = 0) ∧
    ∀ a b, ∑ s, hdSceneProb s * r s a * r s b = if a = b then 1 else 0

/-- Theorem 2 and Appendix D.4, Theorem 8: the linear encoder `h_W(S,U) = W (r(S), U)` with
`W = [A, B] ∈ ℝ^{512 × 1024}`. -/
def linEncoder (r : Fin 513 → Fin 512 → ℝ) (W : Matrix (Fin 512) (Fin 512 ⊕ Fin 512) ℝ) :
    Fin 513 → (Fin 512 → Bool) → Fin 512 → ℝ :=
  fun s U a => ∑ b, W a (Sum.inl b) * r s b + ∑ b, W a (Sum.inr b) * cubeVec U b

/-- Theorem 2 and Appendix D.4: the Stiefel constraint `W Wᵀ = I_{512}`. -/
def IsStiefel (W : Matrix (Fin 512) (Fin 512 ⊕ Fin 512) ℝ) : Prop := W * W.transpose = 1

end GoodViewsNotEnough
Source
Anran Xu, Good Views Are Not Enough: Global Counterexamples for Gaussian-Regularized JEPAs, arXiv:2611.12137v1 (2026), Section 3, Section 4 (eq. 1), Section 5 (eq. 2), Appendix A (eqs. 6-7), Appendix B.1-B.2 (eqs. 8, 11), Appendix C, Appendix D.1-D.2 (eqs. 16, 17, 19-21), Appendix E (eq. 28)
Read-back

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

Conventions used throughout. All objects are real-valued unless marked complex. Observations of the scalar model are labelled i∈{1,2,3,4}i\in\{1,2,3,4\}i∈{1,2,3,4} (code indices 0,…,30,\dots,30,…,3). Scenes of the high-dimensional model are labelled s∈{1,…,513}s\in\{1,\dots,513\}s∈{1,…,513} (code indices 0,…,5120,\dots,5120,…,512), embedding coordinates a,b∈{1,…,512}a,b\in\{1,\dots,512\}a,b∈{1,…,512}, batch slots i∈{1,…,256}i\in\{1,\dots,256\}i∈{1,…,256}, and views v∈{1,…,8}v\in\{1,\dots,8\}v∈{1,…,8} (code indices 0,…,70,\dots,70,…,7). Grid indices jjj run over {0,…,16}\{0,\dots,16\}{0,…,16} exactly as in the code.

Every integral ∫⋅ dν\int\cdot\,d\nu∫⋅dν below is a Bochner integral. If the integrand is not integrable with respect to the measure, the integral is defined to be 000 rather than undefined or infinite.

For a measure μ\muμ on R\mathbb RR, φμ(t)=∫eitx dμ(x)\varphi_\mu(t)=\int e^{itx}\,d\mu(x)φμ​(t)=∫eitxdμ(x) is its characteristic function. It is not normalised by the mass of μ\muμ, and it equals 000 whenever x↦eitxx\mapsto e^{itx}x↦eitx is not μ\muμ-integrable, for example when μ\muμ has infinite mass.


gaussCF. For real ttt,

g(t)=e−t2/2,g(t)=e^{-t^2/2},g(t)=e−t2/2,

a real number.

discrepancy. For arbitrary measures ν\nuν ("frequency measure") and μ\muμ on R\mathbb RR, with no requirement that either be finite or a probability measure,

Dν(μ)=∫R∣φμ(t)−g(t)∣2 dν(t).D_\nu(\mu)=\int_{\mathbb R}\big|\varphi_\mu(t)-g(t)\big|^2\,d\nu(t).Dν​(μ)=∫R​​φμ​(t)−g(t)​2dν(t).

This is 000 by convention if the integrand is not ν\nuν-integrable.

freqMass. Aν=ν(R)A_\nu=\nu(\mathbb R)Aν​=ν(R) converted to a real number. If ν(R)=∞\nu(\mathbb R)=\inftyν(R)=∞ the value is 000, not ∞\infty∞.

selfTerm. For arbitrary measures ν,μ\nu,\muν,μ on R\mathbb RR,

Jν(μ)=∫R∣φμ(t)∣2 dν(t),J_\nu(\mu)=\int_{\mathbb R}|\varphi_\mu(t)|^2\,d\nu(t),Jν​(μ)=∫R​∣φμ​(t)∣2dν(t),

which is 000 if the integrand is not ν\nuν-integrable.

empiricalLaw. For N∈NN\in\mathbb NN∈N and a list y=(y1,…,yN)∈RNy=(y_1,\dots,y_N)\in\mathbb R^Ny=(y1​,…,yN​)∈RN,

μ^y=∑n=1N1N δyn.\hat\mu_y=\sum_{n=1}^N \tfrac1N\,\delta_{y_n}.μ^​y​=n=1∑N​N1​δyn​​.

Repeated values add their masses. When N=0N=0N=0 the sum is empty and μ^y\hat\mu_yμ^​y​ is the zero measure, not a probability measure.

epStat. For a measure ν\nuν on R\mathbb RR and y∈RNy\in\mathbb R^Ny∈RN, the value is N⋅Dν(μ^y)N\cdot D_\nu(\hat\mu_y)N⋅Dν​(μ^​y​), with DνD_\nuDν​ and μ^y\hat\mu_yμ^​y​ as above. For N=0N=0N=0 the value is 000.

iidEP. For N∈NN\in\mathbb NN∈N and measures ν,μ\nu,\muν,μ on R\mathbb RR,

RN,ν(μ)=∫RNN Dν(μ^y)  dμ⊗N(y),R_{N,\nu}(\mu)=\int_{\mathbb R^N} N\,D_\nu(\hat\mu_y)\;d\mu^{\otimes N}(y),RN,ν​(μ)=∫RN​NDν​(μ^​y​)dμ⊗N(y),

where μ⊗N\mu^{\otimes N}μ⊗N is the NNN-fold product measure of μ\muμ with itself.

  • μ\muμ is not required to be a probability measure, so this is an expectation only when it is.
  • The value is 000 if the integrand is not integrable.
  • For N=0N=0N=0 the value is 000.

analyticFreq. The measure on R\mathbb RR with density e−t2/2e^{-t^2/2}e−t2/2 with respect to Lebesgue measure: dν(t)=e−t2/2 dtd\nu(t)=e^{-t^2/2}\,dtdν(t)=e−t2/2dt. Its total mass is 2π\sqrt{2\pi}2π​, so it is not a probability measure.

scalarNode. For j∈{0,…,16}j\in\{0,\dots,16\}j∈{0,…,16},

tj=5(j−8)8.t_j=\frac{5(j-8)}{8}.tj​=85(j−8)​.

These are the 17 equally spaced points −5,−358,…,0,…,5-5,-\tfrac{35}{8},\dots,0,\dots,5−5,−835​,…,0,…,5 with spacing 5/85/85/8.

scalarWeight. For j∈{0,…,16}j\in\{0,\dots,16\}j∈{0,…,16},

ωj=58 cj e−tj2/2,c0=c16=12,cj=1 otherwise,\omega_j=\tfrac58\,c_j\,e^{-t_j^2/2},\qquad c_0=c_{16}=\tfrac12,\quad c_j=1 \text{ otherwise},ωj​=85​cj​e−tj2​/2,c0​=c16​=21​,cj​=1 otherwise,

with tjt_jtj​ the scalar nodes above. All weights are strictly positive.

gridFreq. The finitely supported measure

νgr=∑j=016ωj δtj\nu_{\mathrm{gr}}=\sum_{j=0}^{16}\omega_j\,\delta_{t_j}νgr​=j=0∑16​ωj​δtj​​

with the scalar nodes and weights above. Its mass is ∑jωj\sum_j\omega_j∑j​ωj​, which is not 111. Consequently

Dνgr(μ)=∑jωj∣φμ(tj)−g(tj)∣2.D_{\nu_{\mathrm{gr}}}(\mu)=\sum_j\omega_j|\varphi_\mu(t_j)-g(t_j)|^2.Dνgr​​(μ)=j∑​ωj​∣φμ​(tj​)−g(tj​)∣2.

scalarScene. The scene signs of the four observations: s=(s1,s2,s3,s4)=(1,1,−1,−1)s=(s_1,s_2,s_3,s_4)=(1,1,-1,-1)s=(s1​,s2​,s3​,s4​)=(1,1,−1,−1).

scalarPairLaw. For i,j∈{1,2,3,4}i,j\in\{1,2,3,4\}i,j∈{1,2,3,4},

πij∗=1+sisj/216.\pi^*_{ij}=\frac{1+s_is_j/2}{16}.πij∗​=161+si​sj​/2​.

So πij∗=3/32\pi^*_{ij}=3/32πij∗​=3/32 when i,ji,ji,j lie in the same scene (both in {1,2}\{1,2\}{1,2} or both in {3,4}\{3,4\}{3,4}, including i=ji=ji=j), and πij∗=1/32\pi^*_{ij}=1/32πij∗​=1/32 otherwise. Each row sums to 1/41/41/4 and the total is 111.

IsUniformPairLaw. A 4×44\times44×4 real array π\piπ satisfies this property iff all three of the following hold:

  • πij≥0\pi_{ij}\ge0πij​≥0 for all i,ji,ji,j;
  • πij=πji\pi_{ij}=\pi_{ji}πij​=πji​ for all i,ji,ji,j;
  • ∑j=14πij=14\sum_{j=1}^4\pi_{ij}=\tfrac14∑j=14​πij​=41​ for every iii.

Nothing else is required. In particular the diagonal entries are unconstrained beyond these conditions.

scalarPred. For any 4×44\times44×4 real array π\piπ (no positivity or symmetry assumed) and x∈R4x\in\mathbb R^4x∈R4,

Pπ(x)=14∑i=14∑j=14πij(xi−xj)2.P_\pi(x)=\frac14\sum_{i=1}^4\sum_{j=1}^4\pi_{ij}(x_i-x_j)^2.Pπ​(x)=41​i=1∑4​j=1∑4​πij​(xi​−xj​)2.

scalarLaw. For x∈R4x\in\mathbb R^4x∈R4,

μx=14∑i=14δxi,\mu_x=\frac14\sum_{i=1}^4\delta_{x_i},μx​=41​i=1∑4​δxi​​,

a probability measure on R\mathbb RR. Coinciding coordinates merge into a heavier atom.

twoAtomLaw. For b,c∈Rb,c\in\mathbb Rb,c∈R, the measure 12(δb+δc)\tfrac12(\delta_b+\delta_c)21​(δb​+δc​). When b=cb=cb=c this is the single atom δb\delta_bδb​.

centeredDomain. The set

X0={x∈R4: ∑i=14xi=0}.X_0=\Big\{x\in\mathbb R^4:\ \sum_{i=1}^4x_i=0\Big\}.X0​={x∈R4: i=1∑4​xi​=0}.

There is no normalisation constraint; for instance x=0x=0x=0 belongs to X0X_0X0​.

scalarObjective. For a 4×44\times44×4 array π\piπ and x∈R4x\in\mathbb R^4x∈R4,

Fπ(x)=Pπ(x)+149 R1024,νgr(μx).F_\pi(x)=P_\pi(x)+\frac1{49}\,R_{1024,\nu_{\mathrm{gr}}}(\mu_x).Fπ​(x)=Pπ​(x)+491​R1024,νgr​​(μx​).

Here R1024,νgr(μx)R_{1024,\nu_{\mathrm{gr}}}(\mu_x)R1024,νgr​​(μx​) is the integral, over 102410241024 i.i.d. draws y1,…,y1024y_1,\dots,y_{1024}y1​,…,y1024​ from μx\mu_xμx​, of

1024∑jωj∣11024∑neitjyn−g(tj)∣2,1024\sum_j\omega_j\Big|\frac1{1024}\sum_n e^{it_jy_n}-g(t_j)\Big|^2,1024j∑​ωj​​10241​n∑​eitj​yn​−g(tj​)​2,

with the scalar nodes and weights tj,ωjt_j,\omega_jtj​,ωj​.

detObjective. For any measure ν\nuν on R\mathbb RR, any real γ\gammaγ (any sign, including 000 or negative), and x∈R4x\in\mathbb R^4x∈R4,

Pπ∗(x)+γ Dν(μx),P_{\pi^*}(x)+\gamma\,D_\nu(\mu_x),Pπ∗​(x)+γDν​(μx​),

where π∗\pi^*π∗ is the fixed pair law of scalarPairLaw.

iidObjective. For any measure ν\nuν on R\mathbb RR, N∈NN\in\mathbb NN∈N, any real α\alphaα (any sign), and x∈R4x\in\mathbb R^4x∈R4,

Pπ∗(x)+α RN,ν(μx),P_{\pi^*}(x)+\alpha\,R_{N,\nu}(\mu_x),Pπ∗​(x)+αRN,ν​(μx​),

with π∗\pi^*π∗ the fixed pair law above.

sceneSwaps. The two-element set of permutations of {1,2,3,4}\{1,2,3,4\}{1,2,3,4}

{T+,T−},\{T_+,T_-\},{T+​,T−​},

where T+T_+T+​ transposes 1↔21\leftrightarrow21↔2 and T−T_-T−​ transposes 3↔43\leftrightarrow43↔4.

SwapNonuniqueness. For a function F:R4→RF:\mathbb R^4\to\mathbb RF:R4→R and a set X⊆R4X\subseteq\mathbb R^4X⊆R4, the statement holds iff both of the following are true.

  1. Existence of a minimiser. There is some x∈Xx\in Xx∈X with F(x)≤F(y)F(x)\le F(y)F(x)≤F(y) for all y∈Xy\in Xy∈X.
  2. Swap property. For every such minimiser x∈Xx\in Xx∈X, there is T∈{T+,T−}T\in\{T_+,T_-\}T∈{T+​,T−​} such that the permuted vector x∘T=(xT(1),…,xT(4))x\circ T=(x_{T(1)},\dots,x_{T(4)})x∘T=(xT(1)​,…,xT(4)​) satisfies all of:
    • x∘T∈Xx\circ T\in Xx∘T∈X;
    • F(x∘T)=F(x)F(x\circ T)=F(x)F(x∘T)=F(x);
    • x∘T≠xx\circ T\ne xx∘T=x;
    • x∘T≠−xx\circ T\ne -xx∘T=−x.

scalarComparator. The vector

w=(110,1310,−110,−1310)∈R4.w=\big(\tfrac1{10},\tfrac{13}{10},-\tfrac1{10},-\tfrac{13}{10}\big)\in\mathbb R^4.w=(101​,1013​,−101​,−1013​)∈R4.

analyticTwoAtomMin. The real number

d∗=2π2+2π3−74π  2−3/14.d_*=\frac{\sqrt{2\pi}}2+\sqrt{\frac{2\pi}3}-\frac74\sqrt\pi\;2^{-3/14}.d∗​=22π​​+32π​​−47​π​2−3/14.

pNorm. For x∈R4x\in\mathbb R^4x∈R4,

∥x∥p=14∑i=14xi2.\|x\|_p=\sqrt{\tfrac14\textstyle\sum_{i=1}^4x_i^2}.∥x∥p​=41​∑i=14​xi2​​.

signOrbitDist. For x,z∈R4x,z\in\mathbb R^4x,z∈R4,

d±(x,z)=min⁡{∥x−z∥p, ∥x+z∥p}.d_\pm(x,z)=\min\{\|x-z\|_p,\ \|x+z\|_p\}.d±​(x,z)=min{∥x−z∥p​, ∥x+z∥p​}.

sceneCondMean. For x∈R4x\in\mathbb R^4x∈R4, this is the vector m(x)∈R4m(x)\in\mathbb R^4m(x)∈R4 given by

m(x)1=m(x)2=x1+x22,m(x)3=m(x)4=x3+x42.m(x)_1=m(x)_2=\frac{x_1+x_2}2,\qquad m(x)_3=m(x)_4=\frac{x_3+x_4}2.m(x)1​=m(x)2​=2x1​+x2​​,m(x)3​=m(x)4​=2x3​+x4​​.

scalarNuisance. For x∈R4x\in\mathbb R^4x∈R4, with m(x)m(x)m(x) from sceneCondMean,

u(x)=14∑i=14(xi−m(x)i)2=18[(x1−x2)2+(x3−x4)2].u(x)=\frac14\sum_{i=1}^4\big(x_i-m(x)_i\big)^2=\frac18\big[(x_1-x_2)^2+(x_3-x_4)^2\big].u(x)=41​i=1∑4​(xi​−m(x)i​)2=81​[(x1​−x2​)2+(x3​−x4​)2].

hdSceneProb. A weight on 513513513 scenes:

p1=p2=14,ps=11022  for s=3,…,513.p_1=p_2=\tfrac14,\qquad p_s=\tfrac1{1022}\ \text{ for } s=3,\dots,513.p1​=p2​=41​,ps​=10221​  for s=3,…,513.

These sum to 111.

cubeProb. The number 2−5122^{-512}2−512.

cubeVec. A Boolean vector U∈{true,false}512U\in\{\text{true},\text{false}\}^{512}U∈{true,false}512 is mapped to the vector in {−1,1}512\{-1,1\}^{512}{−1,1}512 with coordinate 111 where UaU_aUa​ is true and −1-1−1 where it is false.

popMean. For any fff of a scene sss and a Boolean vector UUU of length 512512512,

Ef=∑s=1513 ∑U∈{true,false}512ps 2−512 f(s,U).\mathbb E f=\sum_{s=1}^{513}\ \sum_{U\in\{\text{true},\text{false}\}^{512}}p_s\,2^{-512}\,f(s,U).Ef=s=1∑513​ U∈{true,false}512∑​ps​2−512f(s,U).

This is the expectation with S∼pS\sim pS∼p and UUU uniform on all 25122^{512}2512 Boolean vectors, independent of SSS.

IsWhitenedHD. An encoder hhh, assigning a vector h(s,U)∈R512h(s,U)\in\mathbb R^{512}h(s,U)∈R512 to each scene sss and Boolean vector UUU, satisfies this property iff for all coordinates a,ba,ba,b:

E ha=0,E hahb={1a=b,0a≠b,\mathbb E\,h_a=0,\qquad \mathbb E\,h_ah_b=\begin{cases}1&a=b,\\0&a\ne b,\end{cases}Eha​=0,Eha​hb​={10​a=b,a=b,​

with E\mathbb EE the population expectation of popMean.

hdCondMean. For an encoder hhh and scene sss, the vector

hˉs=∑U2−512 h(s,U)∈R512,\bar h_s=\sum_U2^{-512}\,h(s,U)\in\mathbb R^{512},hˉs​=U∑​2−512h(s,U)∈R512,

the average of h(s,⋅)h(s,\cdot)h(s,⋅) over all Boolean vectors UUU.

nuisanceFrac. For an encoder hhh, with hˉs\bar h_shˉs​ from hdCondMean and E\mathbb EE from popMean,

u(h)=1512 E∑a=1512(h(S,U)a−(hˉS)a)2.u(h)=\frac1{512}\,\mathbb E\sum_{a=1}^{512}\big(h(S,U)_a-(\bar h_S)_a\big)^2.u(h)=5121​Ea=1∑512​(h(S,U)a​−(hˉS​)a​)2.

pooledNode. For j∈{0,…,16}j\in\{0,\dots,16\}j∈{0,…,16},

τj=3j16.\tau_j=\frac{3j}{16}.τj​=163j​.

These are 17 points from 000 to 333.

pooledWeight. For j∈{0,…,16}j\in\{0,\dots,16\}j∈{0,…,16},

ϖj=316 dj e−τj2/2,d0=d16=1,dj=2 otherwise,\varpi_j=\tfrac3{16}\,d_j\,e^{-\tau_j^2/2},\qquad d_0=d_{16}=1,\quad d_j=2\text{ otherwise},ϖj​=163​dj​e−τj2​/2,d0​=d16​=1,dj​=2 otherwise,

with τj\tau_jτj​ the pooled nodes.

HDBatch. A batch BBB is a list of 256256256 entries. Entry iii is a pair (Si,(Ui1,…,Ui8))(S_i,(U_{i1},\dots,U_{i8}))(Si​,(Ui1​,…,Ui8​)): a scene Si∈{1,…,513}S_i\in\{1,\dots,513\}Si​∈{1,…,513} and eight Boolean vectors of length 512512512.

batchProb. For a batch BBB,

P(B)=∏i=1256pSi (2−512)8.\mathbb P(B)=\prod_{i=1}^{256}p_{S_i}\,(2^{-512})^8.P(B)=i=1∏256​pSi​​(2−512)8.

Summed over all batches this equals 111.

batchLaw. The finitely supported measure ∑BP(B) δB\sum_B\mathbb P(B)\,\delta_B∑B​P(B)δB​ on the set of all batches, using batchProb.

sphereDir. The uniform probability measure σ\sigmaσ on the unit sphere S511⊂R512\mathbb S^{511}\subset\mathbb R^{512}S511⊂R512 (Euclidean norm). It is obtained by taking the sphere measure induced by Lebesgue measure on R512\mathbb R^{512}R512 and dividing by its total mass.

dirProj. For a unit vector θ∈S511\theta\in\mathbb S^{511}θ∈S511 and v∈R512v\in\mathbb R^{512}v∈R512, the inner product θ⊤v=∑aθava\theta^\top v=\sum_a\theta_av_aθ⊤v=∑a​θa​va​.

pooledStat. For an encoder hhh, a batch BBB and a direction θ∈S511\theta\in\mathbb S^{511}θ∈S511,

R^B,θ(h)=2048∑j=016ϖj ∣12048∑i=1256∑v=18e i τj θ⊤h(Si,Uiv)−g(τj)∣2,\hat R_{B,\theta}(h)=2048\sum_{j=0}^{16}\varpi_j\,\Big|\frac1{2048}\sum_{i=1}^{256}\sum_{v=1}^{8}e^{\,i\,\tau_j\,\theta^\top h(S_i,U_{iv})}-g(\tau_j)\Big|^2,R^B,θ​(h)=2048j=0∑16​ϖj​​20481​i=1∑256​v=1∑8​eiτj​θ⊤h(Si​,Uiv​)−g(τj​)​2,

with the pooled nodes and weights τj,ϖj\tau_j,\varpi_jτj​,ϖj​. Note that 2048=256⋅82048=256\cdot82048=256⋅8.

dirAvgPooledStat. For an encoder hhh and a batch BBB, the average over directions

∫S511R^B,θ(h) dσ(θ),\int_{\mathbb S^{511}}\hat R_{B,\theta}(h)\,d\sigma(\theta),∫S511​R^B,θ​(h)dσ(θ),

with σ\sigmaσ the uniform measure of sphereDir.

pooledEP. For an encoder hhh, the sum over all batches

Rˉ(h)=∑BP(B)∫R^B,θ(h) dσ(θ).\bar R(h)=\sum_B\mathbb P(B)\int\hat R_{B,\theta}(h)\,d\sigma(\theta).Rˉ(h)=B∑​P(B)∫R^B,θ​(h)dσ(θ).

highObjective. For an encoder hhh, with u(h)u(h)u(h) from nuisanceFrac and Rˉ(h)\bar R(h)Rˉ(h) from pooledEP,

F(h)=54 u(h)+150 Rˉ(h).F(h)=\tfrac54\,u(h)+\tfrac1{50}\,\bar R(h).F(h)=45​u(h)+501​Rˉ(h).

No whitening or other constraint is built in.

hdCF. For an encoder hhh, a direction θ∈S511\theta\in\mathbb S^{511}θ∈S511 and real ttt,

φh,θ(t)=∑s∑Ups2−512 e it θ⊤h(s,U)∈C.\varphi_{h,\theta}(t)=\sum_s\sum_U p_s2^{-512}\,e^{\,it\,\theta^\top h(s,U)}\in\mathbb C.φh,θ​(t)=s∑​U∑​ps​2−512eitθ⊤h(s,U)∈C.

hdCondCF. For an encoder hhh, a scene sss, a direction θ\thetaθ and real ttt,

φh∣s,θ(t)=∑U2−512 e it θ⊤h(s,U)∈C.\varphi_{h|s,\theta}(t)=\sum_U2^{-512}\,e^{\,it\,\theta^\top h(s,U)}\in\mathbb C.φh∣s,θ​(t)=U∑​2−512eitθ⊤h(s,U)∈C.

pooledJ. For an encoder hhh,

J(h)=∑j=016ϖj∫∣φh,θ(τj)∣2 dσ(θ),J(h)=\sum_{j=0}^{16}\varpi_j\int|\varphi_{h,\theta}(\tau_j)|^2\,d\sigma(\theta),J(h)=j=0∑16​ϖj​∫∣φh,θ​(τj​)∣2dσ(θ),

with the pooled nodes and weights and the characteristic function of hdCF.

pooledJc. For an encoder hhh,

Jc(h)=∑j=016ϖj∑s=1513ps∫∣φh∣s,θ(τj)∣2 dσ(θ),J_c(h)=\sum_{j=0}^{16}\varpi_j\sum_{s=1}^{513}p_s\int|\varphi_{h|s,\theta}(\tau_j)|^2\,d\sigma(\theta),Jc​(h)=j=0∑16​ϖj​s=1∑513​ps​∫∣φh∣s,θ​(τj​)∣2dσ(θ),

with the conditional characteristic function of hdCondCF.

pooledX. For an encoder hhh,

X(h)=∑j=016ϖj g(τj)∫Re⁡φh,θ(τj) dσ(θ).X(h)=\sum_{j=0}^{16}\varpi_j\,g(\tau_j)\int\operatorname{Re}\varphi_{h,\theta}(\tau_j)\,d\sigma(\theta).X(h)=j=0∑16​ϖj​g(τj​)∫Reφh,θ​(τj​)dσ(θ).

Because ϖj\varpi_jϖj​ already contains the factor e−τj2/2e^{-\tau_j^2/2}e−τj2​/2, the total coefficient on the jjj-th term is

316 dj e−τj2.\tfrac3{16}\,d_j\,e^{-\tau_j^2}.163​dj​e−τj2​.

batchPred. For an encoder hhh and a batch BBB, write hiv=h(Si,Uiv)h_{iv}=h(S_i,U_{iv})hiv​=h(Si​,Uiv​). Then

1256⋅8⋅512∑i=1256∑v=18∑a=1512(hiv,a−hi1,a+hi2,a2)2.\frac1{256\cdot8\cdot512}\sum_{i=1}^{256}\sum_{v=1}^{8}\sum_{a=1}^{512}\Big(h_{iv,a}-\frac{h_{i1,a}+h_{i2,a}}2\Big)^2.256⋅8⋅5121​i=1∑256​v=1∑8​a=1∑512​(hiv,a​−2hi1,a​+hi2,a​​)2.

The sum over vvv includes the two averaged views v=1,2v=1,2v=1,2 themselves.

batchObjective. For a batch BBB and an encoder hhh, the batch prediction term of batchPred plus 150\tfrac1{50}501​ times the direction-averaged pooled statistic ∫R^B,θ(h) dσ(θ)\int\hat R_{B,\theta}(h)\,d\sigma(\theta)∫R^B,θ​(h)dσ(θ) of the same batch.

alignErr. For two encoders h1,h2h_1,h_2h1​,h2​ and an arbitrary real 512×512512\times512512×512 matrix QQQ (not required to be orthogonal),

1512∑s∑U1∑U2ps 2−512 2−512 ∥h1(s,U1)−Q h2(s,U2)∥2.\frac1{512}\sum_s\sum_{U_1}\sum_{U_2}p_s\,2^{-512}\,2^{-512}\,\big\|h_1(s,U_1)-Q\,h_2(s,U_2)\big\|^2.5121​s∑​U1​∑​U2​∑​ps​2−5122−512​h1​(s,U1​)−Qh2​(s,U2​)​2.

That is, S∼pS\sim pS∼p, and U1,U2U_1,U_2U1​,U2​ are independent and uniform, independent of SSS.

IsCenteredOrthonormalBasis. A map rrr assigning a vector r(s)∈R512r(s)\in\mathbb R^{512}r(s)∈R512 to each of the 513513513 scenes satisfies this property iff for all coordinates a,ba,ba,b:

∑sps r(s)a=0,∑sps r(s)ar(s)b={1a=b,0a≠b.\sum_sp_s\,r(s)_a=0,\qquad \sum_sp_s\,r(s)_ar(s)_b=\begin{cases}1&a=b,\\0&a\ne b.\end{cases}s∑​ps​r(s)a​=0,s∑​ps​r(s)a​r(s)b​={10​a=b,a=b.​

No further condition is imposed.

linEncoder. For rrr as above and a real 512×1024512\times1024512×1024 matrix W=[A  B]W=[A\ \ B]W=[A  B], where AAA and BBB are 512×512512\times512512×512 blocks, the encoder

hW(s,U)=A r(s)+B U~.h_W(s,U)=A\,r(s)+B\,\tilde U.hW​(s,U)=Ar(s)+BU~.

Here U~∈{−1,1}512\tilde U\in\{-1,1\}^{512}U~∈{−1,1}512 is the ±1\pm1±1 vector of UUU from cubeVec.

IsStiefel. A real 512×1024512\times1024512×1024 matrix WWW satisfies this property iff

WW⊤=I512,WW^\top=I_{512},WW⊤=I512​,

that is, its rows are orthonormal.

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