Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 10 (as proved): risk of the landmark embedding of an approximate solution

Proved
MultiViewRedundancy.error_landmark_embedding

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

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

Assume ∣Y∣≤1|Y|\le1∣Y∣≤1 almost surely, ZZZ valued in a standard Borel space and pX,Z≪pX⊗pZp_{X,Z}\ll p_X\otimes p_ZpX,Z​≪pX​⊗pZ​. Let GGG be a common upper bound, pX⊗pZp_X\otimes p_ZpX​⊗pZ​-almost everywhere, of g⋆g^\starg⋆ and of g:=exp⁡∘fg:=\exp\circ fg:=exp∘f for a measurable f:X×Z→Rf:\mathcal X\times\mathcal Z\to\mathbb Rf:X×Z→R with finite Llm(f)L_{\mathrm{lm}}(f)Llm​(f). Let εopt,lm=Llm(f)−Llm(log⁡∘g⋆)\varepsilon_{\mathrm{opt,lm}}=L_{\mathrm{lm}}(f)-L_{\mathrm{lm}}(\log\circ g^\star)εopt,lm​=Llm​(f)−Llm​(log∘g⋆) and φ(x)=(g(x,Z1),…,g(x,Zm))\varphi(x)=(g(x,Z_1),\dots,g(x,Z_m))φ(x)=(g(x,Z1​),…,g(x,Zm​)) with Z1,…,ZmZ_1,\dots,Z_mZ1​,…,Zm​ i.i.d. copies of ZZZ. Let 0<δ<10<\delta<10<δ<1, n=⌊m/⌈log⁡2(1/δ)⌉⌋n=\lfloor m/\lceil\log_2(1/\delta)\rceil\rfloorn=⌊m/⌈log2​(1/δ)⌉⌋, m≥⌈log⁡2(1/δ)⌉m\ge\lceil\log_2(1/\delta)\rceilm≥⌈log2​(1/δ)⌉ and ε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. With probability at least 1−δ1-\delta1−δ,

R(φ)≤2εlm+4(1+G)22εopt,lmεlm+16(1+G)4εopt,lm.R(\varphi)\le2\varepsilon_{\mathrm{lm}}+4(1+G)^2\sqrt{2\varepsilon_{\mathrm{opt,lm}}\varepsilon_{\mathrm{lm}}}+16(1+G)^4\varepsilon_{\mathrm{opt,lm}}.R(φ)≤2εlm​+4(1+G)22εopt,lm​εlm​​+16(1+G)4εopt,lm​.

The downstream risk of the landmark embedding of an imperfect contrastive solution degrades smoothly with its excess contrastive loss.

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 paper's gmax⁡=sup⁡supp⁡pX⊗pZg⋆g_{\max}=\sup_{\operatorname{supp}p_X\otimes p_Z}g^\stargmax​=supsupppX​⊗pZ​​g⋆ is replaced by any almost-everywhere upper bound GGG of g⋆g^\starg⋆ and ggg, which is all the proof uses; G=gmax⁡G=g_{\max}G=gmax​ is a special case. Finiteness of Llm(f)L_{\mathrm{lm}}(f)Llm​(f) is a hypothesis (otherwise the bound is infinite). Llm(log⁡∘g⋆)L_{\mathrm{lm}}(\log\circ g^\star)Llm​(log∘g⋆) is written in the equal form Ldirect(g⋆)L_{\mathrm{direct}}(g^\star)Ldirect​(g⋆). The paper's f:X×X→Rf:\mathcal X\times\mathcal X\to\mathbb Rf:X×X→R is a typo for X×Z\mathcal X\times\mathcal ZX×Z.

Preamble
import Mathlib
import Definitions.Def_MultiViewRedundancy_Basic

open MeasureTheory ProbabilityTheory
open scoped ENNReal NNReal
Formal statement
namespace MultiViewRedundancy

theorem error_landmark_embedding {X Z : Type*} [MeasurableSpace X] [MeasurableSpace Z]
    [StandardBorelSpace Z] [Nonempty Z]
    (ρ : Measure (X × Z × ℝ)) [IsProbabilityMeasure ρ] (hY : ∀ᵐ t ∂ρ, |t.2.2| ≤ 1)
    (hac : lawXZ ρ ≪ (lawXZ ρ).fst.prod (lawXZ ρ).snd)
    (f : X → Z → ℝ) (hf : Measurable (Function.uncurry f)) (G : ℝ)
    (hGs : ∀ᵐ p ∂(lawXZ ρ).fst.prod (lawXZ ρ).snd, densityRatio (lawXZ ρ) p.1 p.2 ≤ G)
    (hGf : ∀ᵐ p ∂(lawXZ ρ).fst.prod (lawXZ ρ).snd, Real.exp (f p.1 p.2) ≤ G)
    (hint : Integrable (fun t => Real.log (1 + Real.exp (-(t.2.2 * f t.1 t.2.1))))
      (contrastDist (lawXZ ρ)))
    (δ : ℝ) (hδ0 : 0 < δ) (hδ1 : δ < 1) (m : ℕ) (hm : ⌈Real.logb 2 (1 / δ)⌉₊ ≤ m) :
    Measure.pi (fun _ : Fin m => (lawXZ ρ).snd)
      {zs | ¬ risk ρ (landmarkEmbedding (fun x z => Real.exp (f x z)) zs) ≤
          ENNReal.ofReal (2 * epsLm ρ ⌊(m : ℝ) / ⌈Real.logb 2 (1 / δ)⌉₊⌋₊ +
            4 * (1 + G) ^ 2 * Real.sqrt (2 * epsOptLm (lawXZ ρ) f *
              epsLm ρ ⌊(m : ℝ) / ⌈Real.logb 2 (1 / δ)⌉₊⌋₊) +
            16 * (1 + G) ^ 4 * epsOptLm (lawXZ ρ) f)} ≤ ENNReal.ofReal δ := by sorry

end MultiViewRedundancy
Source
Tosh, Krishnamurthy and Hsu, Contrastive learning, multi-view redundancy, and linear models, arXiv:2008.10150v2 (2021), Section 5, Theorem 10, p. 12; proof in Appendix A.9, pp. 22-23
Read-back

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

Let XXX and ZZZ be measurable spaces. XXX is arbitrary, and ZZZ is a nonempty standard Borel space. Let ρ\rhoρ be a probability measure on X×Z×RX \times Z \times \mathbb{R}X×Z×R, the law of a triple (X,Z,Y)(X, Z, Y)(X,Z,Y).

Derived distributions.

  • pX,Zp_{X,Z}pX,Z​ is the pushforward of ρ\rhoρ under (x,z,y)↦(x,z)(x,z,y) \mapsto (x,z)(x,z,y)↦(x,z).
  • pXp_XpX​ and pZp_ZpZ​ are the two marginals of pX,Zp_{X,Z}pX,Z​.
  • pX⊗pZp_X \otimes p_ZpX​⊗pZ​ is the product of these marginals.

Density ratio. g⋆(x,z)g^\star(x,z)g⋆(x,z) is the real part of a fixed version of the Radon–Nikodym derivative dpX,Zd(pX⊗pZ)(x,z)\frac{d p_{X,Z}}{d(p_X \otimes p_Z)}(x,z)d(pX​⊗pZ​)dpX,Z​​(x,z). Its values lie in [0,∞][0,\infty][0,∞], and the value +∞+\infty+∞, if it occurs, is replaced by 000.

Conditional means. These are defined from fixed versions of the disintegration (conditional) kernels chosen by the library.

  • E[Y∣Z=z]E[Y \mid Z = z]E[Y∣Z=z] is the integral of yyy against the conditional law of YYY given Z=zZ = zZ=z. That law comes from the pushforward of ρ\rhoρ to (z,y)(z,y)(z,y).
  • μ(x)\mu(x)μ(x) is the integral of z↦E[Y∣Z=z]z \mapsto E[Y \mid Z = z]z↦E[Y∣Z=z] against the conditional law pZ∣X(⋅∣x)p_{Z \mid X}(\cdot \mid x)pZ∣X​(⋅∣x) of ZZZ given X=xX = xX=x. That law comes from disintegrating pX,Zp_{X,Z}pX,Z​.
  • Any integral of a non-integrable function is taken to be 000.

Hypotheses.

  1. ∣Y∣≤1|Y| \le 1∣Y∣≤1 holds ρ\rhoρ-almost surely.
  2. pX,Zp_{X,Z}pX,Z​ is absolutely continuous with respect to pX⊗pZp_X \otimes p_ZpX​⊗pZ​.
  3. f:X×Z→Rf : X \times Z \to \mathbb{R}f:X×Z→R is jointly measurable.
  4. GGG is a real number, not assumed positive, such that both of the following hold (pX⊗pZ)(p_X \otimes p_Z)(pX​⊗pZ​)-almost everywhere:
g⋆(x,z)≤G,ef(x,z)≤G.g^\star(x,z) \le G, \qquad e^{f(x,z)} \le G.g⋆(x,z)≤G,ef(x,z)≤G.
  1. The function (x,z,y)↦log⁡(1+e−yf(x,z))(x,z,y) \mapsto \log\bigl(1 + e^{-y f(x,z)}\bigr)(x,z,y)↦log(1+e−yf(x,z)) is integrable with respect to the contrastive distribution
D=12 (pX,Z placed at y=1)+12 (pX⊗pZ placed at y=−1).D = \tfrac12\,\bigl(p_{X,Z} \text{ placed at } y = 1\bigr) + \tfrac12\,\bigl(p_X \otimes p_Z \text{ placed at } y = -1\bigr).D=21​(pX,Z​ placed at y=1)+21​(pX​⊗pZ​ placed at y=−1).
  1. δ\deltaδ is a real number with 0<δ<10 < \delta < 10<δ<1.
  2. mmm is a natural number with k:=⌈log⁡2(1/δ)⌉≤mk := \lceil \log_2(1/\delta) \rceil \le mk:=⌈log2​(1/δ)⌉≤m. Since log⁡2(1/δ)>0\log_2(1/\delta) > 0log2​(1/δ)>0, we have k≥1k \ge 1k≥1, and therefore m≥1m \ge 1m≥1.

Block size. Set

n:=⌊m/k⌋,n := \lfloor m / k \rfloor,n:=⌊m/k⌋,

which is a natural number with n≥1n \ge 1n≥1.

Landmark error term. Define

εlm=2 Vn.\varepsilon_{\mathrm{lm}} = \frac{2\, V}{n}.εlm​=n2V​.

Here VVV is the variance, as an element of [0,∞][0,\infty][0,∞], of (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) under pX⊗pZp_X \otimes p_ZpX​⊗pZ​. If V=∞V = \inftyV=∞, it is converted to the real number 000.

Optimization error term. Define

εopt=Llm(f)−Ldirect(g⋆),\varepsilon_{\mathrm{opt}} = L_{\mathrm{lm}}(f) - L_{\mathrm{direct}}(g^\star),εopt​=Llm​(f)−Ldirect​(g⋆),

where

Llm(f)=12∫log⁡(1+e−f) dpX,Z+12∫log⁡(1+ef) d(pX⊗pZ),L_{\mathrm{lm}}(f) = \tfrac12 \int \log\bigl(1+e^{-f}\bigr)\, dp_{X,Z} + \tfrac12 \int \log\bigl(1+e^{f}\bigr)\, d(p_X\otimes p_Z),Llm​(f)=21​∫log(1+e−f)dpX,Z​+21​∫log(1+ef)d(pX​⊗pZ​), Ldirect(g⋆)=12∫log⁡(1+1/g⋆) dpX,Z+12∫log⁡(1+g⋆) d(pX⊗pZ).L_{\mathrm{direct}}(g^\star) = \tfrac12 \int \log\bigl(1+1/g^\star\bigr)\, dp_{X,Z} + \tfrac12 \int \log\bigl(1+g^\star\bigr)\, d(p_X\otimes p_Z).Ldirect​(g⋆)=21​∫log(1+1/g⋆)dpX,Z​+21​∫log(1+g⋆)d(pX​⊗pZ​).

In LdirectL_{\mathrm{direct}}Ldirect​, the convention 1/0=01/0 = 01/0=0 is used, so points where g⋆=0g^\star = 0g⋆=0 contribute log⁡1=0\log 1 = 0log1=0. The quantity εopt\varepsilon_{\mathrm{opt}}εopt​ is not assumed to be nonnegative.

Landmark embedding and risk. For a tuple of landmarks (z1,…,zm)∈Zm(z_1,\dots,z_m) \in Z^m(z1​,…,zm​)∈Zm, define the embedding φ:X→Rm\varphi : X \to \mathbb{R}^mφ:X→Rm by

φ(x)=(ef(x,z1),…,ef(x,zm)).\varphi(x) = \bigl(e^{f(x,z_1)}, \dots, e^{f(x,z_m)}\bigr).φ(x)=(ef(x,z1​),…,ef(x,zm​)).

Its risk is the infimum over w∈Rmw \in \mathbb{R}^mw∈Rm of the lower Lebesgue integral, with values in [0,∞][0,\infty][0,∞], of the squared error:

R(φ)=inf⁡w∈Rm∫(w⊤φ(x)−μ(x))2 dpX(x).R(\varphi) = \inf_{w \in \mathbb{R}^m} \int \bigl(w^\top \varphi(x) - \mu(x)\bigr)^2 \, dp_X(x).R(φ)=w∈Rminf​∫(w⊤φ(x)−μ(x))2dpX​(x).

Bound. Define the real number

B=2 εlm+4(1+G)22 εopt εlm+16(1+G)4 εopt.B = 2\,\varepsilon_{\mathrm{lm}} + 4(1+G)^2 \sqrt{2\,\varepsilon_{\mathrm{opt}}\,\varepsilon_{\mathrm{lm}}} + 16(1+G)^4\,\varepsilon_{\mathrm{opt}}.B=2εlm​+4(1+G)22εopt​εlm​​+16(1+G)4εopt​.

Here the square root of a negative number is 000. BBB is then mapped into [0,∞][0,\infty][0,∞], with negative values becoming 000.

Conclusion. Under all of the above hypotheses, the theorem asserts the following. Draw (z1,…,zm)(z_1,\dots,z_m)(z1​,…,zm​) i.i.d. from pZp_ZpZ​, that is, from the product measure pZ⊗mp_Z^{\otimes m}pZ⊗m​ on ZmZ^mZm. The set of tuples for which R(φ)≤BR(\varphi) \le BR(φ)≤B fails has pZ⊗mp_Z^{\otimes m}pZ⊗m​-measure at most δ\deltaδ. This is outer measure if the set is not measurable:

pZ⊗m({(z1,…,zm):R(φ)>B})≤δ.p_Z^{\otimes m}\Bigl(\bigl\{(z_1,\dots,z_m) : R(\varphi) > B\bigr\}\Bigr) \le \delta.pZ⊗m​({(z1​,…,zm​):R(φ)>B})≤δ.
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