Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1 (first assertion): uniform L2L^2L2 rate O(N−1/2)O(N^{-1/2})O(N−1/2) of the Monte Carlo estimator

Proved
VariationalBOED.mc_uniform_l2_rate

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

bayesian-experimental-designexpected-information-gainkl-divergencemonte-carlovariational-bounds

Let X\mathcal XX be a measurable space and Φ\PhiΦ a convex subset of a finite-dimensional real inner product space. Let X1,X2,…X_1,X_2,\dotsX1​,X2​,… be i.i.d. random variables with values in X\mathcal XX, and f:X×Φ→Rf:\mathcal X\times\Phi\to\mathbb Rf:X×Φ→R a measurable function. Put

μ(ϕ)=E[f(X1,ϕ)],μ^N(ϕ)=1N∑n=1Nf(Xn,ϕ).\mu(\phi)=\mathbb E[f(X_1,\phi)],\qquad\hat\mu_N(\phi)=\frac1N\sum_{n=1}^Nf(X_n,\phi).μ(ϕ)=E[f(X1​,ϕ)],μ^​N​(ϕ)=N1​n=1∑N​f(Xn​,ϕ).

If sup⁡ϕ∈Φ∥f(X1,ϕ)∥2<∞\sup_{\phi\in\Phi}\|f(X_1,\phi)\|_2<\inftysupϕ∈Φ​∥f(X1​,ϕ)∥2​<∞, where ∥Z∥2=E[Z2]\|Z\|_2=\sqrt{\mathbb E[Z^2]}∥Z∥2​=E[Z2]​, then

sup⁡ϕ∈Φ∥μ^N(ϕ)−μ(ϕ)∥2=O(N−1/2)(N→∞).\sup_{\phi\in\Phi}\big\|\hat\mu_N(\phi)-\mu(\phi)\big\|_2=O(N^{-1/2})\qquad(N\to\infty).ϕ∈Φsup​​μ^​N​(ϕ)−μ(ϕ)​2​=O(N−1/2)(N→∞).

This is the Monte Carlo part of the paper's convergence theorem: for any fixed variational parameter, the estimator of a bound converges to the bound at rate N−1/2N^{-1/2}N−1/2, uniformly in the parameter.

Formalization Note The L2L^2L2 norm is Mathlib's eLpNorm _ 2, with values in [0,∞][0,\infty][0,∞]. O(N−1/2)O(N^{-1/2})O(N−1/2) is stated as a finite constant CCC with sup⁡ϕ∥μ^N(ϕ)−μ(ϕ)∥2≤CN−1/2\sup_\phi\|\hat\mu_N(\phi)-\mu(\phi)\|_2\le C N^{-1/2}supϕ​∥μ^​N​(ϕ)−μ(ϕ)∥2​≤CN−1/2 for all large NNN. Theorem 1's second and third assertions, on stochastic gradient descent, are not formalized; see the mission description.

Preamble
import Mathlib
import Definitions.Def_VariationalBOED_Basic

open MeasureTheory ProbabilityTheory InformationTheory Filter Topology
open scoped ENNReal
Formal statement
namespace VariationalBOED

theorem mc_uniform_l2_rate {Ω S E : Type*} [MeasurableSpace Ω] (P : Measure Ω)
    [IsProbabilityMeasure P] [MeasurableSpace S]
    [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E]
    [MeasurableSpace E] [BorelSpace E] (Phi : Set E) (hPhi : Convex ℝ Phi)
    (X : ℕ → Ω → S) (hXm : ∀ n, Measurable (X n)) (hXind : iIndepFun X P)
    (hXid : ∀ n, IdentDistrib (X n) (X 0) P P)
    (f : S → Phi → ℝ) (hf : Measurable (Function.uncurry f))
    (hbd : (⨆ φ : Phi, eLpNorm (fun ω => f (X 0 ω) φ) 2 P) < ⊤) :
    ∃ C : ℝ≥0∞, C < ⊤ ∧ ∀ᶠ N : ℕ in atTop,
      (⨆ φ : Phi, eLpNorm (fun ω => mcEstimate f X N φ ω - mcMean P f X φ) 2 P) ≤
        C * ENNReal.ofReal (1 / Real.sqrt N) := by sorry

end VariationalBOED
Source
Foster, Jankowiak, Bingham, Horsfall, Teh, Rainforth and Goodman, Variational Bayesian Optimal Experimental Design, arXiv:1903.05480v3 (NeurIPS 2019), Section 4, Theorem 1, first assertion, p. 6; proof in Appendix B, eqs. (63)-(68), pp. 16-17
Read-back

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

Fix the following data:

  • A probability space (Ω,P)(\Omega, P)(Ω,P).
  • A measurable space SSS (no further structure assumed).
  • A finite-dimensional real inner product space EEE, carrying its Borel σ\sigmaσ-algebra.
  • A convex subset Φ⊆E\Phi \subseteq EΦ⊆E. It may be empty or a single point. Elements φ∈Φ\varphi \in \Phiφ∈Φ carry the σ\sigmaσ-algebra induced from EEE.
  • A sequence of random variables X0,X1,X2,⋯:Ω→SX_0, X_1, X_2, \dots : \Omega \to SX0​,X1​,X2​,⋯:Ω→S with these properties:
    • each XnX_nXn​ is measurable;
    • the whole family (Xn)n≥0(X_n)_{n \ge 0}(Xn​)n≥0​ is mutually independent under PPP;
    • every XnX_nXn​ has the same distribution under PPP as X0X_0X0​.
  • A function f:S×Φ→Rf : S \times \Phi \to \mathbb{R}f:S×Φ→R, (s,φ)↦f(s,φ)(s, \varphi) \mapsto f(s, \varphi)(s,φ)↦f(s,φ), that is jointly measurable on the product σ\sigmaσ-algebra. Nothing else is assumed: no continuity or convexity in φ\varphiφ.

Hypothesis on fff. Assume the L2(P)L^2(P)L2(P)-norms of f(X0,φ)f(X_0, \varphi)f(X0​,φ) are uniformly finite over Φ\PhiΦ:

sup⁡φ∈Φ(∫Ω∣f(X0(ω),φ)∣2 dP(ω))1/2<∞.\sup_{\varphi \in \Phi} \Big( \int_\Omega |f(X_0(\omega), \varphi)|^2 \, dP(\omega) \Big)^{1/2} < \infty .φ∈Φsup​(∫Ω​∣f(X0​(ω),φ)∣2dP(ω))1/2<∞.

Here each norm is an extended nonnegative number, and the supremum is taken in [0,∞][0, \infty][0,∞]. When Φ=∅\Phi = \emptysetΦ=∅ the supremum is 000.

Estimator and target. For N∈NN \in \mathbb{N}N∈N, φ∈Φ\varphi \in \Phiφ∈Φ and ω∈Ω\omega \in \Omegaω∈Ω, the Monte Carlo estimator averages the first NNN samples, indexed from 000:

μ^N(φ)(ω)=1N∑n=0N−1f(Xn(ω),φ).\hat\mu_N(\varphi)(\omega) = \frac{1}{N} \sum_{n=0}^{N-1} f(X_n(\omega), \varphi).μ^​N​(φ)(ω)=N1​n=0∑N−1​f(Xn​(ω),φ).

For N=0N = 0N=0 this equals 000, because 1/0=01/0 = 01/0=0 by convention.

The target is

μ(φ)=∫Ωf(X0(ω),φ) dP(ω),\mu(\varphi) = \int_\Omega f(X_0(\omega), \varphi) \, dP(\omega),μ(φ)=∫Ω​f(X0​(ω),φ)dP(ω),

a Bochner integral, which by convention is 000 if the integrand is not integrable. It uses only X0X_0X0​.

Conclusion. There exists a constant C∈[0,∞)C \in [0, \infty)C∈[0,∞), an extended nonnegative real required to be finite, with the following property. For all sufficiently large NNN, meaning there is some N0N_0N0​ such that the bound holds for every N≥N0N \ge N_0N≥N0​,

sup⁡φ∈Φ∥μ^N(φ)−μ(φ)∥L2(P)  ≤  C⋅1N.\sup_{\varphi \in \Phi} \big\| \hat\mu_N(\varphi) - \mu(\varphi) \big\|_{L^2(P)} \;\le\; C \cdot \frac{1}{\sqrt{N}} .φ∈Φsup​​μ^​N​(φ)−μ(φ)​L2(P)​≤C⋅N​1​.

In this bound:

  • ∥g∥L2(P)=(∫Ω∣g∣2 dP)1/2∈[0,∞]\|g\|_{L^2(P)} = \big(\int_\Omega |g|^2 \, dP\big)^{1/2} \in [0, \infty]∥g∥L2(P)​=(∫Ω​∣g∣2dP)1/2∈[0,∞];
  • the supremum is taken in [0,∞][0, \infty][0,∞];
  • 1/N1/\sqrt{N}1/N​ is the real number N−1/2N^{-1/2}N−1/2, read as an extended nonnegative real.

The constant CCC does not depend on NNN or on φ\varphiφ. Nothing is asserted about the value of CCC beyond its finiteness, and nothing is asserted for any particular small NNN.

The convexity of Φ\PhiΦ and the inner-product and finite-dimensional structure of EEE enter only as hypotheses; they do not appear in the conclusion. If Φ\PhiΦ is empty, the left-hand side is 000 and the conclusion holds trivially.

Human review
  • Endorsed by Shuze Chen · Nov 25, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 25, 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