Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 3 (as proved): linear predictors on landmark embeddings are nearly optimal

Proved
MultiViewRedundancy.landmark_embedding_error

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

conditional-expectationcontrastive-learningdensity-ratiomulti-view-learningrepresentation-learning

Let (X1,Z1,Y1),…,(Xm,Zm,Ym),(X,Z,Y)(X_1,Z_1,Y_1),\dots,(X_m,Z_m,Y_m),(X,Z,Y)(X1​,Z1​,Y1​),…,(Xm​,Zm​,Ym​),(X,Z,Y) be i.i.d. with E[Y2]<∞\mathbb E[Y^2]<\inftyE[Y2]<∞, ZZZ valued in a standard Borel space and pX,Z≪pX⊗pZp_{X,Z}\ll p_X\otimes p_ZpX,Z​≪pX​⊗pZ​. Let φ⋆(x)=(g⋆(x,Z1),…,g⋆(x,Zm))\varphi^\star(x)=(g^\star(x,Z_1),\dots,g^\star(x,Z_m))φ⋆(x)=(g⋆(x,Z1​),…,g⋆(x,Zm​)) be the landmark embedding of the density ratio g⋆=pX,Z/(pX⊗pZ)g^\star=p_{X,Z}/(p_X\otimes p_Z)g⋆=pX,Z​/(pX​⊗pZ​). Let 0<δ<10<\delta<10<δ<1, let n=⌊m/⌈log⁡2(1/δ)⌉⌋n=\lfloor m/\lceil\log_2(1/\delta)\rceil\rfloorn=⌊m/⌈log2​(1/δ)⌉⌋, and assume m≥⌈log⁡2(1/δ)⌉m\ge\lceil\log_2(1/\delta)\rceilm≥⌈log2​(1/δ)⌉. Let εlm=2var⁡(E[Y1∣Z1] g⋆(X,Z1))/n\varepsilon_{\mathrm{lm}}=2\operatorname{var}(\mathbb E[Y_1\mid Z_1]\,g^\star(X,Z_1))/nεlm​=2var(E[Y1​∣Z1​]g⋆(X,Z1​))/n, assumed finite, and let εμ=εX+2εXεZ+εZ\varepsilon_\mu=\varepsilon_X+2\sqrt{\varepsilon_X\varepsilon_Z}+\varepsilon_Zεμ​=εX​+2εX​εZ​​+εZ​. Then with probability at least 1−δ1-\delta1−δ over Z1,…,ZmZ_1,\dots,Z_mZ1​,…,Zm​ there is w∈Rmw\in\mathbb R^mw∈Rm with

E[(w⊤φ⋆(X)−E[Y∣X,Z])2∣Z1,…,Zm]≤εμ+2εμεlm+εlm.\mathbb E\big[(w^\top\varphi^\star(X)-\mathbb E[Y\mid X,Z])^2\mid Z_1,\dots,Z_m\big]\le\varepsilon_\mu+2\sqrt{\varepsilon_\mu\varepsilon_{\mathrm{lm}}}+\varepsilon_{\mathrm{lm}}.E[(w⊤φ⋆(X)−E[Y∣X,Z])2∣Z1​,…,Zm​]≤εμ​+2εμ​εlm​​+εlm​.

This is the paper's main result: a linear function of the landmark embedding built from the contrastive solution is nearly as good as the Bayes predictor E[Y∣X,Z]\mathbb E[Y\mid X,Z]E[Y∣X,Z] when the views are redundant and there are many landmarks.

Formalization Note The paper uses the block size ⌊m/log⁡2(1/δ)⌋\lfloor m/\log_2(1/\delta)\rfloor⌊m/log2​(1/δ)⌋. Its proof splits the mmm landmarks into ⌊m/n⌋\lfloor m/n\rfloor⌊m/n⌋ disjoint blocks and needs at least log⁡2(1/δ)\log_2(1/\delta)log2​(1/δ) of them. That number can be smaller, for example m=3m=3m=3 and log⁡2(1/δ)=1.5\log_2(1/\delta)=1.5log2​(1/δ)=1.5 give one block, so the statement is the one the proof establishes, with block size n=⌊m/⌈log⁡2(1/δ)⌉⌋n=\lfloor m/\lceil\log_2(1/\delta)\rceil\rfloorn=⌊m/⌈log2​(1/δ)⌉⌋. The two coincide when log⁡2(1/δ)\log_2(1/\delta)log2​(1/δ) is an integer. "With probability at least 1−δ1-\delta1−δ" is written as: the set of landmark tuples for which the conclusion fails has (outer) probability at most δ\deltaδ. The conditional expectation is the integral over a fresh (X,Z,Y)∼ρ(X,Z,Y)\sim\rho(X,Z,Y)∼ρ at fixed landmarks.

Preamble
import Mathlib
import Definitions.Def_MultiViewRedundancy_Basic

open MeasureTheory ProbabilityTheory
open scoped ENNReal NNReal
Formal statement
namespace MultiViewRedundancy

theorem landmark_embedding_error {X Z : Type*} [MeasurableSpace X] [MeasurableSpace Z]
    [StandardBorelSpace Z] [Nonempty Z]
    (ρ : Measure (X × Z × ℝ)) [IsProbabilityMeasure ρ] (hY : MemLp (fun t => t.2.2) 2 ρ)
    (hac : lawXZ ρ ≪ (lawXZ ρ).fst.prod (lawXZ ρ).snd) (hV : landmarkVar ρ ≠ ⊤)
    (δ : ℝ) (hδ0 : 0 < δ) (hδ1 : δ < 1) (m : ℕ) (hm : ⌈Real.logb 2 (1 / δ)⌉₊ ≤ m) :
    Measure.pi (fun _ : Fin m => (lawXZ ρ).snd)
      {zs | ¬ ∃ w : Fin m → ℝ,
        ∫⁻ t, ENNReal.ofReal
            ((∑ i, w i * landmarkEmbedding (densityRatio (lawXZ ρ)) zs t.1 i -
              regXZ ρ t.1 t.2.1) ^ 2) ∂ρ ≤
          ENNReal.ofReal (epsMu ρ +
            2 * Real.sqrt (epsMu ρ * epsLm ρ ⌊(m : ℝ) / ⌈Real.logb 2 (1 / δ)⌉₊⌋₊) +
            epsLm ρ ⌊(m : ℝ) / ⌈Real.logb 2 (1 / δ)⌉₊⌋₊)} ≤ ENNReal.ofReal δ := by sorry

end MultiViewRedundancy
Source
Tosh, Krishnamurthy and Hsu, Contrastive learning, multi-view redundancy, and linear models, arXiv:2008.10150v2 (2021), Section 3.1, Theorem 3, p. 8 (restated in Section 1.1, p. 3)
Read-back

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

Let XXX and ZZZ be measurable spaces, where ZZZ is additionally assumed to be a standard Borel space and nonempty; XXX carries no further assumption. Let ρ\rhoρ be a probability measure on X×Z×RX \times Z \times \mathbb{R}X×Z×R, the joint law of a triple (X,Z,Y)(X, Z, Y)(X,Z,Y). Write:

  • pX,Zp_{X,Z}pX,Z​ for the image of ρ\rhoρ under (x,z,y)↦(x,z)(x,z,y) \mapsto (x,z)(x,z,y)↦(x,z);
  • pXp_XpX​ and pZp_ZpZ​ for the two marginals of pX,Zp_{X,Z}pX,Z​.

Notation used in the statement.

  • Density ratio. g⋆(x,z)g^\star(x,z)g⋆(x,z) is the value at (x,z)(x,z)(x,z) of a fixed version of the Radon–Nikodym derivative dpX,Zd(pX⊗pZ)\frac{dp_{X,Z}}{d(p_X \otimes p_Z)}d(pX​⊗pZ​)dpX,Z​​, converted to a real number. The value +∞+\infty+∞ becomes 000.
  • Regression functions.
    • E[Y∣Z=z]E[Y \mid Z = z]E[Y∣Z=z] is the mean ∫y κZ(z)(dy)\int y \, \kappa_{Z}(z)(dy)∫yκZ​(z)(dy) of a fixed disintegration kernel κZ\kappa_ZκZ​ of the law of (Z,Y)(Z,Y)(Z,Y) at the point zzz.
    • E[Y∣X=x]E[Y \mid X = x]E[Y∣X=x] and E[Y∣X=x,Z=z]E[Y \mid X = x, Z = z]E[Y∣X=x,Z=z] are defined in the same way, from the laws of (X,Y)(X,Y)(X,Y) and ((X,Z),Y)((X,Z),Y)((X,Z),Y).
    • Each of these is a Bochner integral, so it is set to 000 wherever yyy is not integrable against the kernel. They are defined at every point, not only almost everywhere.
  • The two errors and their combination.
εX=∫(E[Y∣X=x]−E[Y∣X=x,Z=z])2 dρ(x,z,y),\varepsilon_X = \int \big(E[Y\mid X=x] - E[Y\mid X=x,Z=z]\big)^2 \, d\rho(x,z,y),εX​=∫(E[Y∣X=x]−E[Y∣X=x,Z=z])2dρ(x,z,y), εZ=∫(E[Y∣Z=z]−E[Y∣X=x,Z=z])2 dρ(x,z,y).\varepsilon_Z = \int \big(E[Y\mid Z=z] - E[Y\mid X=x,Z=z]\big)^2 \, d\rho(x,z,y).εZ​=∫(E[Y∣Z=z]−E[Y∣X=x,Z=z])2dρ(x,z,y).

Both are Bochner integrals, taken to be 000 if the integrand is not integrable. From these,

εμ=εX+2εXεZ+εZ.\varepsilon_\mu = \varepsilon_X + 2\sqrt{\varepsilon_X \varepsilon_Z} + \varepsilon_Z.εμ​=εX​+2εX​εZ​​+εZ​.
  • The variance term. V∈[0,∞]V \in [0,\infty]V∈[0,∞] is the extended-valued variance, under pX⊗pZp_X \otimes p_ZpX​⊗pZ​, of the function
(x,z)↦E[Y∣Z=z] g⋆(x,z).(x,z) \mapsto E[Y\mid Z=z]\, g^\star(x,z).(x,z)↦E[Y∣Z=z]g⋆(x,z).

This variance is computed as ∫(f−fˉ)2\int (f - \bar f)^2∫(f−fˉ​)2 with fˉ\bar ffˉ​ the Bochner mean of fff, and fˉ=0\bar f = 0fˉ​=0 if fff is not integrable. For n∈Nn \in \mathbb{N}n∈N, set

εlm(n)=2Vn.\varepsilon_{\mathrm{lm}}(n) = \frac{2V}{n}.εlm​(n)=n2V​.
  • Landmark embedding. For landmarks z=(z1,…,zm)∈Zmz = (z_1,\dots,z_m) \in Z^mz=(z1​,…,zm​)∈Zm, the embedding is
φz(x)=(g⋆(x,z1),…,g⋆(x,zm))∈Rm.\varphi_z(x) = \big(g^\star(x,z_1), \dots, g^\star(x,z_m)\big) \in \mathbb{R}^m.φz​(x)=(g⋆(x,z1​),…,g⋆(x,zm​))∈Rm.

Hypotheses.

  1. The coordinate YYY (the map (x,z,y)↦y(x,z,y)\mapsto y(x,z,y)↦y) lies in L2(ρ)L^2(\rho)L2(ρ).
  2. pX,Zp_{X,Z}pX,Z​ is absolutely continuous with respect to pX⊗pZp_X \otimes p_ZpX​⊗pZ​.
  3. V<∞V < \inftyV<∞.
  4. δ\deltaδ is a real number with 0<δ<10 < \delta < 10<δ<1.
  5. mmm is a natural number with k≤mk \le mk≤m, where
k=⌈log⁡2(1/δ)⌉.k = \lceil \log_2(1/\delta) \rceil.k=⌈log2​(1/δ)⌉.

Since 0<δ<10<\delta<10<δ<1, we have k≥1k \ge 1k≥1. Set

n=⌊m/k⌋.n = \lfloor m / k \rfloor.n=⌊m/k⌋.

Then n≥1n \ge 1n≥1, because m≥km \ge km≥k; in particular, εlm(n)\varepsilon_{\mathrm{lm}}(n)εlm​(n) never involves division by zero.

Conclusion. Draw z=(z1,…,zm)z = (z_1,\dots,z_m)z=(z1​,…,zm​) from the product measure pZ⊗mp_Z^{\otimes m}pZ⊗m​, that is, mmm i.i.d. landmarks from pZp_ZpZ​. The measure (outer measure, if the set is not measurable) of the "bad" set of landmark tuples is at most δ\deltaδ. The bad set consists of those zzz for which there is no w∈Rmw \in \mathbb{R}^mw∈Rm satisfying

∫(∑i=1mwi g⋆(x,zi)−E[Y∣X=x,Z=z′])2 dρ(x,z′,y)  ≤  εμ+2εμ εlm(n)+εlm(n).\int \Big(\sum_{i=1}^m w_i\, g^\star(x, z_i) - E[Y\mid X=x, Z=z']\Big)^2 \, d\rho(x,z',y) \;\le\; \varepsilon_\mu + 2\sqrt{\varepsilon_\mu\, \varepsilon_{\mathrm{lm}}(n)} + \varepsilon_{\mathrm{lm}}(n).∫(i=1∑m​wi​g⋆(x,zi​)−E[Y∣X=x,Z=z′])2dρ(x,z′,y)≤εμ​+2εμ​εlm​(n)​+εlm​(n).

Equivalently, with probability at least 1−δ1-\delta1−δ over the landmarks, some www achieves this bound.

Two features of this inequality:

  • The left side is computed in [0,∞][0,\infty][0,∞]. It is integrated against the full joint law ρ\rhoρ, and the target is the regression E[Y∣X,Z]E[Y \mid X, Z]E[Y∣X,Z] evaluated at the same sample's (x,z′)(x, z')(x,z′).
  • The right side is a nonnegative real number.
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