Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Same-state pairs: hard-whitening objective, world kernel, scene-explained fraction, same-state operator and Procrustes objects

Definition
SameStatePairs_Basic

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

identifiabilityjepaorthogonal-procrustesrepresentation-learningspectral-methods

Objects of Sections 2–4 and Appendix A of Li (2026), arXiv:2611.16182.

  1. Encoders, centring, whitening. On a finite set α\alphaα carrying a law www, an encoder is h:α→Rkh:\alpha\to\mathbb{R}^kh:α→Rk, with ∥v∥2=∑ivi2\|v\|^2=\sum_i v_i^2∥v∥2=∑i​vi2​. It is centred if ∑aw(a)h(a)=0\sum_a w(a)h(a)=0∑a​w(a)h(a)=0 and whitened if ∑aw(a)h(a)h(a)⊤=Ik\sum_a w(a)h(a)h(a)^\top=I_k∑a​w(a)h(a)h(a)⊤=Ik​. An orthogonal Q∈O(k)Q\in O(k)Q∈O(k) acts by v↦Qvv\mapsto Qvv↦Qv.
  2. Hard-whitening objective (Section 2.1). For a law π\piπ of positive pairs on α\alphaα, the prediction term is Lπ(h)=∑a,a′π(a,a′)∥h(a)−h(a′)∥2L_\pi(h)=\sum_{a,a'}\pi(a,a')\|h(a)-h(a')\|^2Lπ​(h)=∑a,a′​π(a,a′)∥h(a)−h(a′)∥2. The hard anti-collapse term is Ω(h)=0\Omega(h)=0Ω(h)=0 if hhh is centred and whitened and Ω(h)=+∞\Omega(h)=+\inftyΩ(h)=+∞ otherwise. A global minimiser is a centred, whitened hhh with Lπ(h)≤Lπ(h′)L_\pi(h)\le L_\pi(h')Lπ​(h)≤Lπ​(h′) for every centred, whitened h′h'h′. The span of hhh is the span of its coordinate functions h1,…,hk:α→Rh_1,\dots,h_k:\alpha\to\mathbb{R}h1​,…,hk​:α→R. The centred function space is {φ:∑aw(a)φ(a)=0}\{\varphi:\sum_a w(a)\varphi(a)=0\}{φ:∑a​w(a)φ(a)=0}.
  3. World (Section 2.1). ZZZ is a finite world with p(z)>0p(z)>0p(z)>0, ∑zp(z)=1\sum_zp(z)=1∑z​p(z)=1, dz=∣Z∣d_z=|Z|dz​=∣Z∣. The same-state law is π=diag⁡(p)\pi=\operatorname{diag}(p)π=diag(p): π(z,z)=p(z)\pi(z,z)=p(z)π(z,z)=p(z) and π(z,z′)=0\pi(z,z')=0π(z,z′)=0 for z≠z′z\ne z'z=z′. The world kernel is Kπ=D−1/2ΠD−1/2K_\pi=D^{-1/2}\Pi D^{-1/2}Kπ​=D−1/2ΠD−1/2 and the Markov operator is Tπ=D−1ΠT_\pi=D^{-1}\PiTπ​=D−1Π, with D=diag⁡(p)D=\operatorname{diag}(p)D=diag(p), Πzz′=π(z,z′)\Pi_{zz'}=\pi(z,z')Πzz′​=π(z,z′). The squared residual of state functions f,gf,gf,g under QQQ is E∥f−Qg∥2=∑zp(z)∥f(z)−Qg(z)∥2\mathbb{E}\|f-Qg\|^2=\sum_zp(z)\|f(z)-Qg(z)\|^2E∥f−Qg∥2=∑z​p(z)∥f(z)−Qg(z)∥2.
  4. Scene-explained fraction (Section 3). An observation of state zzz is (z,ν)(z,\nu)(z,ν) with a nuisance ν∼q\nu\sim qν∼q independent of zzz, and an encoder is written e(z,ν)e(z,\nu)e(z,ν). CfC_fCf​ is the covariance under z∼pz\sim pz∼p of E[f∣Z=z]=∑νq(ν)e(z,ν)\mathbb{E}[f\mid Z=z]=\sum_\nu q(\nu)e(z,\nu)E[f∣Z=z]=∑ν​q(ν)e(z,ν), and ρ(f)=tr⁡(Cf1/2)/k\rho(f)=\operatorname{tr}(C_f^{1/2})/kρ(f)=tr(Cf1/2​)/k. The bound of eq. (2) is 2k(1−min⁡(ρ1,ρ2))2k(1-\min(\rho_1,\rho_2))2k(1−min(ρ1​,ρ2​)). The paired residual is E∥f1(X1)−Qf2(X2)∥2=∑z,ν1,ν2p(z)q1(ν1)q2(ν2)∥e1(z,ν1)−Qe2(z,ν2)∥2\mathbb{E}\|f_1(X_1)-Qf_2(X_2)\|^2=\sum_{z,\nu_1,\nu_2}p(z)q_1(\nu_1)q_2(\nu_2)\|e_1(z,\nu_1)-Qe_2(z,\nu_2)\|^2E∥f1​(X1​)−Qf2​(X2​)∥2=∑z,ν1​,ν2​​p(z)q1​(ν1​)q2​(ν2​)∥e1​(z,ν1​)−Qe2​(z,ν2​)∥2.
  5. Same-state operator (Section 4.1). A channel κ(z,x)=PX∣Z(x∣z)\kappa(z,x)=P_{X\mid Z}(x\mid z)κ(z,x)=PX∣Z​(x∣z) maps the world to a finite observation space XXX, with PX(x)=∑zp(z)κ(z,x)P_X(x)=\sum_zp(z)\kappa(z,x)PX​(x)=∑z​p(z)κ(z,x). The same-state pair law is Ps(x,x′)=∑zp(z)κ(z,x)κ(z,x′)P_s(x,x')=\sum_zp(z)\kappa(z,x)\kappa(z,x')Ps​(x,x′)=∑z​p(z)κ(z,x)κ(z,x′), and the mixture is P+ε=εPs+(1−ε)PX⊗PXP_+^\varepsilon=\varepsilon P_s+(1-\varepsilon)P_X\otimes P_XP+ε​=εPs​+(1−ε)PX​⊗PX​. The operator is Ts=AA∗T_s=AA^*Ts​=AA∗, with matrix Ts(x,x′)=Ps(x,x′)/PX(x)T_s(x,x')=P_s(x,x')/P_X(x)Ts​(x,x′)=Ps​(x,x′)/PX​(x), and ∑j⟨fj,Tsfj⟩L2(PX)\sum_j\langle f_j,T_sf_j\rangle_{L^2(P_X)}∑j​⟨fj​,Ts​fj​⟩L2(PX​)​ is the quadratic term of eq. (3).
  6. Spectrum of TsT_sTs​. 1=λ0≥λ1≥⋯≥λ∣X∣−11=\lambda_0\ge\lambda_1\ge\cdots\ge\lambda_{|X|-1}1=λ0​≥λ1​≥⋯≥λ∣X∣−1​ are the eigenvalues of TsT_sTs​ with multiplicity. λ0=1\lambda_0=1λ0​=1 belongs to the constant function, and λ1,λ2,…\lambda_1,\lambda_2,\dotsλ1​,λ2​,… are the eigenvalues on the centred subspace. rank⁡(Ts)\operatorname{rank}(T_s)rank(Ts​) on the centred subspace is the matrix rank of TsT_sTs​ minus one. The top eigenspace is the span of the centred eigenfunctions with eigenvalue ≥λk\ge\lambda_k≥λk​. The positive eigenspace and ker⁡Ts\ker T_skerTs​ are also taken within the centred subspace.
  7. Pairing (Section 4.2). For pairs (xi,yi)i≤m(x_i,y_i)_{i\le m}(xi​,yi​)i≤m​ in Rk\mathbb{R}^kRk, the orthogonal Procrustes objective is ∑i∥yi−Rxi∥2\sum_i\|y_i-Rx_i\|^2∑i​∥yi​−Rxi​∥2 over R∈O(k)R\in O(k)R∈O(k). The exact solutions are the R∈O(k)R\in O(k)R∈O(k) with Rxi=yiRx_i=y_iRxi​=yi​ for all iii. Ir⊕SI_r\oplus SIr​⊕S is block-diagonal with IrI_rIr​ on the first rrr coordinates.

Formalization Note The eigenvalues are the roots of the characteristic polynomial of the matrix TsT_sTs​, sorted in decreasing order. Index 000 is the constant eigenfunction's eigenvalue 111, which is the largest, so index i≥1i\ge1i≥1 is the paper's λi\lambda_iλi​ on the centred subspace. tr⁡(Cf1/2)\operatorname{tr}(C_f^{1/2})tr(Cf1/2​) is the sum of the square roots of the eigenvalues of CfC_fCf​. The observation-level objects are for a finite world and a finite observation space.

Definition code
import Mathlib

/-!
Xin Li, *Same-State Pairs Make One JEPA Proof of the Platonic Representation Hypothesis Vacuous:
A Correction and a Gauge Ledger*, arXiv:2611.16182v1 (2026): the finite world, positive-pair
laws, world kernel and hard-whitening objective of Section 2.1, the scene-explained fraction of
Section 3, the same-state pair operator `T_s` and its spectrum of Section 4.1 and Appendix A.1, and
the orthogonal Procrustes objects of Section 4.2 and Appendix A.2.
-/

noncomputable section

namespace SameStatePairs

/-- Section 2.1: the squared Euclidean norm `‖v‖² = ∑ᵢ vᵢ²` of an embedding `v ∈ ℝ^k`. -/
def sqNorm {k : ℕ} (v : Fin k → ℝ) : ℝ := ∑ i, v i ^ 2

/-- Section 2.1: the action `v ↦ Q v` of an orthogonal matrix `Q ∈ O(k)` on `ℝ^k`. -/
def rot {k : ℕ} (Q : Matrix.orthogonalGroup (Fin k) ℝ) (v : Fin k → ℝ) : Fin k → ℝ :=
  (Q : Matrix (Fin k) (Fin k) ℝ).mulVec v

section Encoders

variable {α : Type*} [Fintype α] {k : ℕ}

/-- Section 2.1 (Notation): an encoder `h : α → ℝ^k` on a finite set `α` carrying the law `w` is
centred if `E h = ∑ₐ w(a) h(a) = 0`. -/
def IsCentered (w : α → ℝ) (h : α → Fin k → ℝ) : Prop :=
  ∀ i, ∑ a, w a * h a i = 0

/-- Section 2.1 (Notation): an encoder `h` is whitened under `w` if
`E h hᵀ = ∑ₐ w(a) h(a) h(a)ᵀ = I_k`. -/
def IsWhitened (w : α → ℝ) (h : α → Fin k → ℝ) : Prop :=
  ∀ i j, ∑ a, w a * h a i * h a j = if i = j then 1 else 0

/-- Section 2.1: the prediction term `L_π(h) = E_{(a,a')∼π} ‖h(a) - h(a')‖²` for a law `π` of
positive pairs on `α`. -/
def pairLoss (π : α → α → ℝ) (h : α → Fin k → ℝ) : ℝ :=
  ∑ a, ∑ a', π a a' * sqNorm (h a - h a')

open Classical in
/-- Section 2.1: the hard anti-collapse term `Ω ∈ {0, ∞}` of the hard-whitening objective:
`Ω(h) = 0` if `h` is centred and whitened under `w`, and `Ω(h) = +∞` otherwise. -/
def hardOmega (w : α → ℝ) (h : α → Fin k → ℝ) : EReal :=
  if IsCentered w h ∧ IsWhitened w h then 0 else ⊤

/-- Section 2.1: `h` is a global minimiser of the hard-whitening population objective, i.e. of the
prediction term `L_π` subject to `Ω(h) = 0`: `h` is centred and whitened under `w`, and
`L_π(h) ≤ L_π(h')` for every centred, whitened `h'`. -/
def IsGlobalMin (w : α → ℝ) (π : α → α → ℝ) (h : α → Fin k → ℝ) : Prop :=
  IsCentered w h ∧ IsWhitened w h ∧
    ∀ h' : α → Fin k → ℝ, IsCentered w h' → IsWhitened w h' → pairLoss π h ≤ pairLoss π h'

/-- Lemma 1 and Theorem 1: the span of an encoder `h`, i.e. the span of its coordinate functions
`h_1, …, h_k : α → ℝ` in the function space. -/
def coordSpan (h : α → Fin k → ℝ) : Submodule ℝ (α → ℝ) :=
  Submodule.span ℝ (Set.range fun i a => h a i)

/-- Lemma 1 and Section 4.1: the centred function space `{φ : α → ℝ | ∑ₐ w(a) φ(a) = 0}`. -/
def centeredSpace (w : α → ℝ) : Submodule ℝ (α → ℝ) :=
  LinearMap.ker (dotProductBilin ℝ ℝ w)

end Encoders

section StateLevel

variable {Z : Type*} [Fintype Z]

/-- Section 2.1, Lemma 1: the same-state positive-pair law `π = diag(p)`:
`π(z, z') = p(z)` if `z = z'` and `0` otherwise. -/
def sameStateLaw [DecidableEq Z] (p : Z → ℝ) (z z' : Z) : ℝ :=
  if z = z' then p z else 0

/-- Section 2.1 (Notation): the world kernel `K_π = D^{-1/2} Π D^{-1/2}` with `D = diag(p)` and
`Π_{zz'} = π(z, z')`. -/
def worldKernel (p : Z → ℝ) (π : Z → Z → ℝ) : Matrix Z Z ℝ :=
  fun z z' => π z z' / Real.sqrt (p z * p z')

/-- Section 2.1 (Notation): the Markov operator `T_π = D^{-1} Π` on state functions. -/
def markovOp (p : Z → ℝ) (π : Z → Z → ℝ) : Matrix Z Z ℝ :=
  fun z z' => π z z' / p z

/-- Proposition 1, eq. (1): the squared residual `E‖f - Q g‖² = ∑_z p(z) ‖f(z) - Q g(z)‖²` of two
state functions `f, g : Z → ℝ^k` under a rotation `Q ∈ O(k)`. -/
def rotResidual {k : ℕ} (p : Z → ℝ) (f g : Z → Fin k → ℝ)
    (Q : Matrix.orthogonalGroup (Fin k) ℝ) : ℝ :=
  ∑ z, p z * sqNorm (f z - rot Q (g z))

end StateLevel

section Nuisance

variable {Z N : Type*} [Fintype Z] [Fintype N] {k : ℕ}

/-- Section 3 and Appendix A.3: an encoder `f` of observations `X = (z, ν)` of world state `z`
with a nuisance `ν ∼ q` independent of `z` is written `e(z, ν) = f(X)`; this is
`E[f(X) | Z = z] = ∑_ν q(ν) e(z, ν)`. -/
def condMean (q : N → ℝ) (e : Z → N → Fin k → ℝ) (z : Z) : Fin k → ℝ :=
  fun i => ∑ ν, q ν * e z ν i

/-- Section 3: `C_f = Cov(E[f(X) | Z])`, the covariance under `z ∼ p` of the scene-related part
of `f`. -/
def sceneCov (p : Z → ℝ) (q : N → ℝ) (e : Z → N → Fin k → ℝ) : Matrix (Fin k) (Fin k) ℝ :=
  fun i j => ∑ z, p z * (condMean q e z i - ∑ z', p z' * condMean q e z' i) *
    (condMean q e z j - ∑ z', p z' * condMean q e z' j)

/-- Section 3: the scene-explained fraction `ρ(f) = tr(C_f^{1/2}) / k`, where `tr(C_f^{1/2})` is the
sum of the square roots of the eigenvalues of `C_f` (the roots of its characteristic polynomial,
with multiplicity). -/
def sceneFraction (p : Z → ℝ) (q : N → ℝ) (e : Z → N → Fin k → ℝ) : ℝ :=
  ((sceneCov p q e).charpoly.roots.map Real.sqrt).sum / k

/-- Section 3, eq. (2): the lower bound `2k (1 - min(ρ₁, ρ₂))` on the aligned error. -/
def survivorBound (k : ℕ) (ρ₁ ρ₂ : ℝ) : ℝ :=
  2 * k * (1 - min ρ₁ ρ₂)

/-- Section 3, eq. (2), and Proposition 2: `E‖f₁(X₁) - Q f₂(X₂)‖²` over paired observations
`X₁ = (z, ν₁)`, `X₂ = (z, ν₂)` of one state `z ∼ p` with independent nuisances `ν₁ ∼ q₁`,
`ν₂ ∼ q₂`. -/
def pairedResidual {N₁ N₂ : Type*} [Fintype N₁] [Fintype N₂] (p : Z → ℝ) (q₁ : N₁ → ℝ)
    (q₂ : N₂ → ℝ) (e₁ : Z → N₁ → Fin k → ℝ) (e₂ : Z → N₂ → Fin k → ℝ)
    (Q : Matrix.orthogonalGroup (Fin k) ℝ) : ℝ :=
  ∑ z, ∑ ν₁, ∑ ν₂, p z * q₁ ν₁ * q₂ ν₂ * sqNorm (e₁ z ν₁ - rot Q (e₂ z ν₂))

end Nuisance

section Observation

variable {Z X : Type*} [Fintype Z] [Fintype X] [DecidableEq X] {k : ℕ}

/-- Section 4.1: `κ(z, x) = P_{X|Z}(x | z)` is an observation channel from the finite world `Z` to
the finite observation space `X`. -/
def IsChannel (κ : Z → X → ℝ) : Prop :=
  (∀ z x, 0 ≤ κ z x) ∧ ∀ z, ∑ x, κ z x = 1

/-- Section 4.1: the observation law `P_X(x) = ∑_z p(z) κ(z, x)`. -/
def obsLaw (p : Z → ℝ) (κ : Z → X → ℝ) (x : X) : ℝ :=
  ∑ z, p z * κ z x

/-- Section 4.1: the same-state pair law `P_s`: given `Z = z`, the two views are conditionally
independent with common law `κ(z, ·)`, so `P_s(x, x') = ∑_z p(z) κ(z, x) κ(z, x')`. -/
def sameStatePairLaw (p : Z → ℝ) (κ : Z → X → ℝ) (x x' : X) : ℝ :=
  ∑ z, p z * κ z x * κ z x'

/-- Section 4.1: the positive-pair mixture `P_+^ε = ε P_s + (1 - ε) P_X ⊗ P_X`. -/
def mixPairLaw (p : Z → ℝ) (κ : Z → X → ℝ) (ε : ℝ) (x x' : X) : ℝ :=
  ε * sameStatePairLaw p κ x x' + (1 - ε) * (obsLaw p κ x * obsLaw p κ x')

/-- Section 4.1: the operator `T_s = A A*` on functions of the observation, with
`(A φ)(x) = E[φ(Z) | X = x]` and `(A* f)(z) = E[f(X) | Z = z]`; as a matrix,
`T_s(x, x') = ∑_z p(z) κ(z, x) κ(z, x') / P_X(x)`. -/
def sameStateOp (p : Z → ℝ) (κ : Z → X → ℝ) : Matrix X X ℝ :=
  fun x x' => sameStatePairLaw p κ x x' / obsLaw p κ x

/-- Section 4.1, eq. (3): `∑_{j=1}^k ⟨f_j, T_s f_j⟩_{L²(P_X)}`. -/
def topQuad (p : Z → ℝ) (κ : Z → X → ℝ) (f : X → Fin k → ℝ) : ℝ :=
  ∑ j, ∑ x, obsLaw p κ x * f x j * (sameStateOp p κ).mulVec (fun x' => f x' j) x

/-- Section 4.1 and Appendix A.1: the eigenvalues of `T_s`, with multiplicity, as the roots of its
characteristic polynomial sorted in decreasing order. Index `0` is the eigenvalue `1` of the
constant function; for `1 ≤ i ≤ |X| - 1`, `obsEig p κ i` is `λ_i`, the `i`-th eigenvalue of `T_s` on
the centred subspace (`0` for `i ≥ |X|`; statements do not use those values). -/
def obsEig (p : Z → ℝ) (κ : Z → X → ℝ) (i : ℕ) : ℝ :=
  ((sameStateOp p κ).charpoly.roots.sort (· ≥ ·)).getD i 0

/-- Theorem 1: `rank(T_s)` on the centred subspace, i.e. the rank of the matrix `T_s` minus the
contribution `1` of the constant function. -/
def obsRank (p : Z → ℝ) (κ : Z → X → ℝ) : ℕ :=
  (sameStateOp p κ).rank - 1

/-- Theorem 1: the top eigenspace of `T_s`, the span of the centred eigenfunctions of `T_s` with
eigenvalue at least `λ_k`. -/
def topSpace (p : Z → ℝ) (κ : Z → X → ℝ) (k : ℕ) : Submodule ℝ (X → ℝ) :=
  (⨆ (μ : ℝ) (_ : obsEig p κ k ≤ μ), Module.End.eigenspace (Matrix.toLin' (sameStateOp p κ)) μ) ⊓
    centeredSpace (obsLaw p κ)

/-- Theorem 1: the span of the centred eigenfunctions of `T_s` with eigenvalue greater than
`λ_k`. -/
def strictTopSpace (p : Z → ℝ) (κ : Z → X → ℝ) (k : ℕ) : Submodule ℝ (X → ℝ) :=
  (⨆ (μ : ℝ) (_ : obsEig p κ k < μ), Module.End.eigenspace (Matrix.toLin' (sameStateOp p κ)) μ) ⊓
    centeredSpace (obsLaw p κ)

/-- Theorem 1: the positive eigenspace of `T_s` on the centred subspace. -/
def posSpace (p : Z → ℝ) (κ : Z → X → ℝ) : Submodule ℝ (X → ℝ) :=
  (⨆ (μ : ℝ) (_ : 0 < μ), Module.End.eigenspace (Matrix.toLin' (sameStateOp p κ)) μ) ⊓
    centeredSpace (obsLaw p κ)

/-- Theorem 1: `ker T_s` on the centred subspace. -/
def obsKerSpace (p : Z → ℝ) (κ : Z → X → ℝ) : Submodule ℝ (X → ℝ) :=
  LinearMap.ker (Matrix.toLin' (sameStateOp p κ)) ⊓ centeredSpace (obsLaw p κ)

end Observation

section Pairing

variable {m k : ℕ}

/-- Section 4.2: the orthogonal Procrustes objective `∑_i ‖y_i - R x_i‖²` of `m` synchronized
pairs `(x_i, y_i)` in whitened coordinates, for `R ∈ O(k)`. -/
def procrustesObj (x y : Fin m → Fin k → ℝ) (R : Matrix.orthogonalGroup (Fin k) ℝ) : ℝ :=
  ∑ i, sqNorm (y i - rot R (x i))

/-- Section 4.2 and Appendix A.2: the exact solutions `{R ∈ O(k) : 𝐗 Rᵀ = 𝐘}`, i.e. `R x_i = y_i`
for every pair. -/
def pairSolutions (x y : Fin m → Fin k → ℝ) : Set (Matrix.orthogonalGroup (Fin k) ℝ) :=
  {R | ∀ i, rot R (x i) = y i}

/-- Section 4.2, Theorem 2: the block-diagonal matrix `I_r ⊕ S` on `ℝ^k`, with `I_r` on the first
`r` coordinates and the `(k - r) × (k - r)` block `S` on the remaining ones. -/
def blockEmbed (r : ℕ) (S : Matrix (Fin (k - r)) (Fin (k - r)) ℝ) : Matrix (Fin k) (Fin k) ℝ :=
  fun i j =>
    if hij : r ≤ i.val ∧ r ≤ j.val then
      S ⟨i.val - r, by have := i.isLt; omega⟩ ⟨j.val - r, by have := j.isLt; omega⟩
    else if i = j then 1 else 0

end Pairing

end SameStatePairs
Source
Xin Li, Same-State Pairs Make One JEPA Proof of the Platonic Representation Hypothesis Vacuous: A Correction and a Gauge Ledger, arXiv:2611.16182v1 (2026), Section 2.1 (Notation, pp. 2-3), Section 3 (scene-explained fraction, eq. (2), p. 5), Section 4.1 (eq. (3), p. 6), Section 4.2 (p. 7), Appendix A.1-A.3 (pp. 11-12)
Read-back

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

sqNorm. For a natural number kkk and a vector v=(v0,…,vk−1)∈Rkv=(v_0,\dots,v_{k-1})\in\mathbb{R}^kv=(v0​,…,vk−1​)∈Rk, the squared Euclidean norm is

∥v∥2=∑i=0k−1vi2.\|v\|^2=\sum_{i=0}^{k-1} v_i^2 .∥v∥2=i=0∑k−1​vi2​.

When k=0k=0k=0 this is the empty sum, 000.

rot. For k∈Nk\in\mathbb{N}k∈N, a real k×kk\times kk×k orthogonal matrix Q∈O(k)Q\in O(k)Q∈O(k) (so Q⊤Q=QQ⊤=IkQ^\top Q = QQ^\top = I_kQ⊤Q=QQ⊤=Ik​), and v∈Rkv\in\mathbb{R}^kv∈Rk, this is the matrix–vector product Qv∈RkQv\in\mathbb{R}^kQv∈Rk, with (Qv)i=∑jQijvj(Qv)_i=\sum_j Q_{ij}v_j(Qv)i​=∑j​Qij​vj​.

IsCentered. The setting is:

  • α\alphaα is any finite type, possibly empty.
  • k∈Nk\in\mathbb{N}k∈N.
  • w:α→Rw:\alpha\to\mathbb{R}w:α→R is an arbitrary real function. It is not required to be nonnegative or to sum to 111.
  • h:α→Rkh:\alpha\to\mathbb{R}^kh:α→Rk, with coordinates hi(a)h_i(a)hi​(a).

hhh is centred under www if, for every coordinate i∈{0,…,k−1}i\in\{0,\dots,k-1\}i∈{0,…,k−1},

∑a∈αw(a) hi(a)=0.\sum_{a\in\alpha} w(a)\,h_i(a)=0 .a∈α∑​w(a)hi​(a)=0.

This holds automatically when k=0k=0k=0, when α\alphaα is empty, or when w≡0w\equiv 0w≡0.

IsWhitened. With α,k,w,h\alpha,k,w,hα,k,w,h as above (no conditions on www), hhh is whitened under www if, for all i,j∈{0,…,k−1}i,j\in\{0,\dots,k-1\}i,j∈{0,…,k−1},

∑a∈αw(a) hi(a) hj(a)=δij={1i=j0i≠j.\sum_{a\in\alpha} w(a)\,h_i(a)\,h_j(a)=\delta_{ij}=\begin{cases}1 & i=j\\ 0 & i\ne j.\end{cases}a∈α∑​w(a)hi​(a)hj​(a)=δij​={10​i=ji=j.​

This is vacuously true when k=0k=0k=0. It is impossible when k≥1k\ge 1k≥1 and α\alphaα is empty or w≡0w\equiv0w≡0. More generally, it is impossible whenever kkk exceeds the number of points aaa with w(a)≠0w(a)\neq 0w(a)=0, because the left-hand matrix has rank at most that number.

pairLoss. For an arbitrary real function π:α×α→R\pi:\alpha\times\alpha\to\mathbb{R}π:α×α→R (not required to be a probability law) and h:α→Rkh:\alpha\to\mathbb{R}^kh:α→Rk,

Lπ(h)=∑a∈α∑a′∈απ(a,a′) ∥h(a)−h(a′)∥2,L_\pi(h)=\sum_{a\in\alpha}\sum_{a'\in\alpha}\pi(a,a')\,\|h(a)-h(a')\|^2 ,Lπ​(h)=a∈α∑​a′∈α∑​π(a,a′)∥h(a)−h(a′)∥2,

where ∥⋅∥2\|\cdot\|^2∥⋅∥2 is the sum of squared coordinates.

hardOmega. For w:α→Rw:\alpha\to\mathbb{R}w:α→R and h:α→Rkh:\alpha\to\mathbb{R}^kh:α→Rk, this is an extended-real value Ω(h)∈[−∞,+∞]\Omega(h)\in[-\infty,+\infty]Ω(h)∈[−∞,+∞]:

  • Ω(h)=0\Omega(h)=0Ω(h)=0 if hhh is both centred and whitened under www (in the senses above);
  • Ω(h)=+∞\Omega(h)=+\inftyΩ(h)=+∞ otherwise.

IsGlobalMin. For w:α→Rw:\alpha\to\mathbb{R}w:α→R, π:α×α→R\pi:\alpha\times\alpha\to\mathbb{R}π:α×α→R and h:α→Rkh:\alpha\to\mathbb{R}^kh:α→Rk, the statement "hhh is a global minimiser" means all three of the following hold:

  1. hhh is centred under www;
  2. hhh is whitened under www;
  3. for every h′:α→Rkh':\alpha\to\mathbb{R}^kh′:α→Rk that is centred and whitened under www, Lπ(h)≤Lπ(h′)L_\pi(h)\le L_\pi(h')Lπ​(h)≤Lπ​(h′).

The definition does not refer to Ω\OmegaΩ directly. If no centred whitened encoder exists (see the impossibility cases above), the predicate is false for every hhh.

coordSpan. For h:α→Rkh:\alpha\to\mathbb{R}^kh:α→Rk, this is the real linear span, inside the space Rα\mathbb{R}^\alphaRα of all functions α→R\alpha\to\mathbb{R}α→R, of the kkk coordinate functions h0,…,hk−1h_0,\dots,h_{k-1}h0​,…,hk−1​ (where hi(a)h_i(a)hi​(a) is the iii-th coordinate of h(a)h(a)h(a)). When k=0k=0k=0 it is the zero subspace.

centeredSpace. For w:α→Rw:\alpha\to\mathbb{R}w:α→R, this is the linear subspace

{φ:α→R ∣ ∑a∈αw(a) φ(a)=0},\Big\{\varphi:\alpha\to\mathbb{R}\ \Big|\ \sum_{a\in\alpha}w(a)\,\varphi(a)=0\Big\},{φ:α→R ​ a∈α∑​w(a)φ(a)=0},

the kernel of the linear functional φ↦∑aw(a)φ(a)\varphi\mapsto\sum_a w(a)\varphi(a)φ↦∑a​w(a)φ(a). If w≡0w\equiv0w≡0, it is the whole space Rα\mathbb{R}^\alphaRα.

sameStateLaw. For a finite type ZZZ with decidable equality and an arbitrary p:Z→Rp:Z\to\mathbb{R}p:Z→R, this is the function on Z×ZZ\times ZZ×Z given by

π(z,z′)={p(z)z=z′0z≠z′,\pi(z,z')=\begin{cases}p(z)&z=z'\\0&z\neq z',\end{cases}π(z,z′)={p(z)0​z=z′z=z′,​

that is, the diagonal matrix diag⁡(p)\operatorname{diag}(p)diag(p). No positivity or normalisation of ppp is assumed.

worldKernel. For arbitrary p:Z→Rp:Z\to\mathbb{R}p:Z→R and π:Z×Z→R\pi:Z\times Z\to\mathbb{R}π:Z×Z→R, this is the Z×ZZ\times ZZ×Z real matrix

Kπ(z,z′)=π(z,z′)p(z) p(z′).K_\pi(z,z')=\frac{\pi(z,z')}{\sqrt{p(z)\,p(z')}} .Kπ​(z,z′)=p(z)p(z′)​π(z,z′)​.

It follows these conventions:

  • The square root is of the product p(z)p(z′)p(z)p(z')p(z)p(z′).
  • The square root of a negative number is taken to be 000.
  • Division by 000 yields 000.

So Kπ(z,z′)=0K_\pi(z,z')=0Kπ​(z,z′)=0 whenever p(z)p(z′)≤0p(z)p(z')\le 0p(z)p(z′)≤0. When p(z)p(z)p(z) and p(z′)p(z')p(z′) are both negative, the product is positive and the entry is π(z,z′)/p(z)p(z′)\pi(z,z')/\sqrt{p(z)p(z')}π(z,z′)/p(z)p(z′)​.

markovOp. For arbitrary p:Z→Rp:Z\to\mathbb{R}p:Z→R and π:Z×Z→R\pi:Z\times Z\to\mathbb{R}π:Z×Z→R, this is the Z×ZZ\times ZZ×Z matrix

Tπ(z,z′)=π(z,z′)p(z),T_\pi(z,z')=\frac{\pi(z,z')}{p(z)},Tπ​(z,z′)=p(z)π(z,z′)​,

with the entry set to 000 whenever p(z)=0p(z)=0p(z)=0.

rotResidual. For arbitrary p:Z→Rp:Z\to\mathbb{R}p:Z→R, functions f,g:Z→Rkf,g:Z\to\mathbb{R}^kf,g:Z→Rk and Q∈O(k)Q\in O(k)Q∈O(k),

∑z∈Zp(z) ∥f(z)−Q g(z)∥2.\sum_{z\in Z}p(z)\,\big\|f(z)-Q\,g(z)\big\|^2 .z∈Z∑​p(z)​f(z)−Qg(z)​2.

condMean. The setting is:

  • ZZZ and NNN are finite types.
  • q:N→Rq:N\to\mathbb{R}q:N→R is arbitrary (not required to be a probability law).
  • e:Z×N→Rke:Z\times N\to\mathbb{R}^ke:Z×N→Rk.

For z∈Zz\in Zz∈Z, this is the vector m(z)∈Rkm(z)\in\mathbb{R}^km(z)∈Rk with coordinates

mi(z)=∑ν∈Nq(ν) ei(z,ν).m_i(z)=\sum_{\nu\in N}q(\nu)\,e_i(z,\nu).mi​(z)=ν∈N∑​q(ν)ei​(z,ν).

sceneCov. For arbitrary p:Z→Rp:Z\to\mathbb{R}p:Z→R, q:N→Rq:N\to\mathbb{R}q:N→R and e:Z×N→Rke:Z\times N\to\mathbb{R}^ke:Z×N→Rk, let mmm be as in condMean and let mˉi=∑z′p(z′) mi(z′)\bar m_i=\sum_{z'}p(z')\,m_i(z')mˉi​=∑z′​p(z′)mi​(z′). This is the k×kk\times kk×k matrix

Cij=∑z∈Zp(z) (mi(z)−mˉi)(mj(z)−mˉj).C_{ij}=\sum_{z\in Z}p(z)\,\big(m_i(z)-\bar m_i\big)\big(m_j(z)-\bar m_j\big).Cij​=z∈Z∑​p(z)(mi​(z)−mˉi​)(mj​(z)−mˉj​).

It is symmetric. It is a genuine covariance only if ppp is a probability law, which is not assumed.

sceneFraction. With CCC as in sceneCov, this is

ρ=1k∑λλ,\rho=\frac{1}{k}\sum_{\lambda}\sqrt{\lambda},ρ=k1​λ∑​λ​,

where λ\lambdaλ ranges over the real roots of the characteristic polynomial of CCC, counted with multiplicity. Because CCC is symmetric, these are all kkk of its eigenvalues. The definition uses these conventions:

  • The square root of a negative eigenvalue is taken to be 000. Negative eigenvalues can occur, since ppp may take negative values.
  • When k=0k=0k=0, the division by 000 gives ρ=0\rho=0ρ=0.

survivorBound. For k∈Nk\in\mathbb{N}k∈N and real numbers ρ1,ρ2\rho_1,\rho_2ρ1​,ρ2​, this is the real number

2k (1−min⁡(ρ1,ρ2)).2k\,\big(1-\min(\rho_1,\rho_2)\big).2k(1−min(ρ1​,ρ2​)).

pairedResidual. The setting is:

  • ZZZ, N1N_1N1​, N2N_2N2​ are finite types.
  • p:Z→Rp:Z\to\mathbb{R}p:Z→R, q1:N1→Rq_1:N_1\to\mathbb{R}q1​:N1​→R, q2:N2→Rq_2:N_2\to\mathbb{R}q2​:N2​→R are arbitrary real functions.
  • e1:Z×N1→Rke_1:Z\times N_1\to\mathbb{R}^ke1​:Z×N1​→Rk and e2:Z×N2→Rke_2:Z\times N_2\to\mathbb{R}^ke2​:Z×N2​→Rk.
  • Q∈O(k)Q\in O(k)Q∈O(k).

The quantity is

∑z∈Z∑ν1∈N1∑ν2∈N2p(z) q1(ν1) q2(ν2) ∥e1(z,ν1)−Q e2(z,ν2)∥2.\sum_{z\in Z}\sum_{\nu_1\in N_1}\sum_{\nu_2\in N_2}p(z)\,q_1(\nu_1)\,q_2(\nu_2)\,\big\|e_1(z,\nu_1)-Q\,e_2(z,\nu_2)\big\|^2 .z∈Z∑​ν1​∈N1​∑​ν2​∈N2​∑​p(z)q1​(ν1​)q2​(ν2​)​e1​(z,ν1​)−Qe2​(z,ν2​)​2.

IsChannel. For finite types ZZZ and XXX (with XXX having decidable equality), κ:Z×X→R\kappa:Z\times X\to\mathbb{R}κ:Z×X→R is a channel if both of the following hold:

  1. κ(z,x)≥0\kappa(z,x)\ge 0κ(z,x)≥0 for all z,xz,xz,x;
  2. ∑x∈Xκ(z,x)=1\sum_{x\in X}\kappa(z,x)=1∑x∈X​κ(z,x)=1 for every z∈Zz\in Zz∈Z.

If ZZZ is empty this holds for every κ\kappaκ. If ZZZ is nonempty and XXX is empty it is impossible.

obsLaw. For arbitrary p:Z→Rp:Z\to\mathbb{R}p:Z→R and κ:Z×X→R\kappa:Z\times X\to\mathbb{R}κ:Z×X→R (neither assumed to be a law or a channel here), this is the function on XXX given by

PX(x)=∑z∈Zp(z) κ(z,x).P_X(x)=\sum_{z\in Z}p(z)\,\kappa(z,x).PX​(x)=z∈Z∑​p(z)κ(z,x).

sameStatePairLaw. For arbitrary ppp and κ\kappaκ, this is the function on X×XX\times XX×X given by

Ps(x,x′)=∑z∈Zp(z) κ(z,x) κ(z,x′).P_s(x,x')=\sum_{z\in Z}p(z)\,\kappa(z,x)\,\kappa(z,x').Ps​(x,x′)=z∈Z∑​p(z)κ(z,x)κ(z,x′).

mixPairLaw. For arbitrary ppp, κ\kappaκ and an arbitrary real ε\varepsilonε (not restricted to [0,1][0,1][0,1]), this is the function on X×XX\times XX×X given by

P+ε(x,x′)=ε Ps(x,x′)+(1−ε) PX(x) PX(x′).P_+^\varepsilon(x,x')=\varepsilon\,P_s(x,x')+(1-\varepsilon)\,P_X(x)\,P_X(x').P+ε​(x,x′)=εPs​(x,x′)+(1−ε)PX​(x)PX​(x′).

sameStateOp. For arbitrary ppp and κ\kappaκ, this is the X×XX\times XX×X matrix

Ts(x,x′)=Ps(x,x′)PX(x),T_s(x,x')=\frac{P_s(x,x')}{P_X(x)},Ts​(x,x′)=PX​(x)Ps​(x,x′)​,

with the entry set to 000 whenever PX(x)=0P_X(x)=0PX​(x)=0. It acts on functions φ:X→R\varphi:X\to\mathbb{R}φ:X→R by

(Tsφ)(x)=∑x′Ts(x,x′) φ(x′).(T_s\varphi)(x)=\sum_{x'}T_s(x,x')\,\varphi(x').(Ts​φ)(x)=x′∑​Ts​(x,x′)φ(x′).

topQuad. For arbitrary ppp, κ\kappaκ and f:X→Rkf:X\to\mathbb{R}^kf:X→Rk with coordinate functions f0,…,fk−1:X→Rf_0,\dots,f_{k-1}:X\to\mathbb{R}f0​,…,fk−1​:X→R, this is

∑j=0k−1∑x∈XPX(x) fj(x) (Tsfj)(x).\sum_{j=0}^{k-1}\sum_{x\in X}P_X(x)\,f_j(x)\,(T_s f_j)(x).j=0∑k−1​x∈X∑​PX​(x)fj​(x)(Ts​fj​)(x).

It equals 000 when k=0k=0k=0.

obsEig. For arbitrary ppp, κ\kappaκ and i∈Ni\in\mathbb{N}i∈N, the construction is:

  1. Take the real roots of the characteristic polynomial of the matrix TsT_sTs​, counted with multiplicity. Any non-real complex roots are omitted, and TsT_sTs​ is not assumed symmetric.
  2. Sort these real roots in decreasing order, indexed from 000.
  3. λi\lambda_iλi​ is the entry at position iii, or 000 if iii is at least the number of real roots.

So λ0\lambda_0λ0​ is the largest real eigenvalue of TsT_sTs​, whatever its value. The value 000 arises both as a genuine eigenvalue and as padding beyond the end of the list.

obsRank. For arbitrary ppp and κ\kappaκ, this is the natural number rank⁡(Ts)−1\operatorname{rank}(T_s)-1rank(Ts​)−1, using truncated subtraction. It is 000 when rank⁡(Ts)=0\operatorname{rank}(T_s)=0rank(Ts​)=0.

topSpace. For arbitrary ppp, κ\kappaκ and k∈Nk\in\mathbb{N}k∈N, let λk\lambda_kλk​ be the position-kkk entry from obsEig (0-indexed, so this is the (k+1)(k+1)(k+1)-th largest real root, or 000 if there are at most kkk real roots). This is the subspace of RX\mathbb{R}^XRX given by

(∑μ∈R, μ≥λkEμ(Ts)) ∩ {φ:X→R ∣ ∑xPX(x)φ(x)=0}.\Big(\sum_{\mu\in\mathbb{R},\ \mu\ge\lambda_k}E_\mu(T_s)\Big)\ \cap\ \Big\{\varphi:X\to\mathbb{R}\ \Big|\ \sum_x P_X(x)\varphi(x)=0\Big\}.(μ∈R, μ≥λk​∑​Eμ​(Ts​)) ∩ {φ:X→R ​ x∑​PX​(x)φ(x)=0}.

Here:

  • Eμ(Ts)={φ:Tsφ=μφ}E_\mu(T_s)=\{\varphi : T_s\varphi=\mu\varphi\}Eμ​(Ts​)={φ:Ts​φ=μφ} is the eigenspace of the linear map φ↦Tsφ\varphi\mapsto T_s\varphiφ↦Ts​φ. It is {0}\{0\}{0} if μ\muμ is not an eigenvalue.
  • The sum is the span of the union of these eigenspaces.

strictTopSpace. This is the same as topSpace, except that the eigenspaces summed are those with μ>λk\mu>\lambda_kμ>λk​ (strict inequality):

(∑μ>λkEμ(Ts))∩{φ ∣ ∑xPX(x)φ(x)=0}.\Big(\sum_{\mu>\lambda_k}E_\mu(T_s)\Big)\cap\Big\{\varphi\ \Big|\ \textstyle\sum_x P_X(x)\varphi(x)=0\Big\}.(μ>λk​∑​Eμ​(Ts​))∩{φ ​ ∑x​PX​(x)φ(x)=0}.

posSpace. For arbitrary ppp and κ\kappaκ, this is

(∑μ>0Eμ(Ts))∩{φ:X→R ∣ ∑xPX(x)φ(x)=0},\Big(\sum_{\mu>0}E_\mu(T_s)\Big)\cap\Big\{\varphi:X\to\mathbb{R}\ \Big|\ \sum_x P_X(x)\varphi(x)=0\Big\},(μ>0∑​Eμ​(Ts​))∩{φ:X→R ​ x∑​PX​(x)φ(x)=0},

the span of all eigenvectors of TsT_sTs​ with strictly positive real eigenvalue, intersected with the PXP_XPX​-centred functions.

obsKerSpace. For arbitrary ppp and κ\kappaκ, this is

{φ:X→R∣Tsφ=0}∩{φ ∣ ∑xPX(x)φ(x)=0}.\{\varphi:X\to\mathbb{R}\mid T_s\varphi=0\}\cap\Big\{\varphi\ \Big|\ \sum_x P_X(x)\varphi(x)=0\Big\}.{φ:X→R∣Ts​φ=0}∩{φ ​ x∑​PX​(x)φ(x)=0}.

procrustesObj. For m,k∈Nm,k\in\mathbb{N}m,k∈N, families x0,…,xm−1x_0,\dots,x_{m-1}x0​,…,xm−1​ and y0,…,ym−1y_0,\dots,y_{m-1}y0​,…,ym−1​ in Rk\mathbb{R}^kRk, and R∈O(k)R\in O(k)R∈O(k), this is

∑i=0m−1∥yi−R xi∥2.\sum_{i=0}^{m-1}\|y_i-R\,x_i\|^2 .i=0∑m−1​∥yi​−Rxi​∥2.

It equals 000 when m=0m=0m=0.

pairSolutions. For x0,…,xm−1x_0,\dots,x_{m-1}x0​,…,xm−1​ and y0,…,ym−1y_0,\dots,y_{m-1}y0​,…,ym−1​ in Rk\mathbb{R}^kRk, this is the set

{R∈O(k)∣R xi=yi for all i<m}.\{R\in O(k)\mid R\,x_i=y_i\ \text{for all } i<m\}.{R∈O(k)∣Rxi​=yi​ for all i<m}.

When m=0m=0m=0 this is all of O(k)O(k)O(k). It may be empty.

blockEmbed. For k,r∈Nk,r\in\mathbb{N}k,r∈N and an arbitrary real (k−r)×(k−r)(k-r)\times(k-r)(k−r)×(k−r) matrix SSS (with k−rk-rk−r truncated at 000; SSS is not required to be orthogonal), this is the k×kk\times kk×k matrix MMM with rows and columns indexed 0,…,k−10,\dots,k-10,…,k−1 and entries

Mij={S i−r,  j−rif i≥r and j≥r,δijotherwise.M_{ij}=\begin{cases}S_{\,i-r,\;j-r}&\text{if } i\ge r \text{ and } j\ge r,\\ \delta_{ij}&\text{otherwise}.\end{cases}Mij​={Si−r,j−r​δij​​if i≥r and j≥r,otherwise.​

That is, M=(Ir00S)M=\begin{pmatrix}I_r&0\\0&S\end{pmatrix}M=(Ir​0​0S​). When r≥kr\ge kr≥k, SSS is the empty matrix and M=IkM=I_kM=Ik​.

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