Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Bayesian model, expected information gain and variational EIG bounds

Definition
VariationalBOED_Basic

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

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

Objects of Sections 2-4 and Appendices A-B of Foster et al. (2019). Everything is for one fixed design ddd, which is not written.

  1. Densities. The parameter θ\thetaθ ranges over a measurable space Θ\ThetaΘ and the outcome yyy over a measurable space Y\mathcal YY, carrying σ\sigmaσ-finite reference measures νΘ\nu_\ThetaνΘ​ and νY\nu_{\mathcal Y}νY​ (for instance Lebesgue or counting measure). A probability density is a measurable f≥0f\ge0f≥0 with ∫f dν=1\int f\,d\nu=1∫fdν=1; a conditional density f(b∣a)f(b\mid a)f(b∣a) is jointly measurable and a probability density in bbb for every aaa. Pf\mathbb P_fPf​ denotes the measure with density fff, and H[f]=−∫flog⁡f dνH[f]=-\int f\log f\,d\nuH[f]=−∫flogfdν is the (differential) entropy.
  2. Model (Section 2). A prior density p(θ)p(\theta)p(θ) and a likelihood p(y∣θ,d)p(y\mid\theta,d)p(y∣θ,d). The marginal is p(y∣d)=∫p(θ)p(y∣θ,d) dνΘ(θ)p(y\mid d)=\int p(\theta)p(y\mid\theta,d)\,d\nu_\Theta(\theta)p(y∣d)=∫p(θ)p(y∣θ,d)dνΘ​(θ), the posterior is p(θ∣y,d)=p(θ)p(y∣θ,d)/p(y∣d)p(\theta\mid y,d)=p(\theta)p(y\mid\theta,d)/p(y\mid d)p(θ∣y,d)=p(θ)p(y∣θ,d)/p(y∣d), and the joint law of (θ,y)(\theta,y)(θ,y) has density p(y,θ∣d)=p(θ)p(y∣θ,d)p(y,\theta\mid d)=p(\theta)p(y\mid\theta,d)p(y,θ∣d)=p(θ)p(y∣θ,d).
  3. Expected information gain (eq. 3). EIG(d)=Ep(y,θ∣d)[log⁡p(y∣θ,d)p(y∣d)]\mathrm{EIG}(d)=\mathbb E_{p(y,\theta\mid d)}\big[\log\frac{p(y\mid\theta,d)}{p(y\mid d)}\big]EIG(d)=Ep(y,θ∣d)​[logp(y∣d)p(y∣θ,d)​].
  4. Validity (Appendix A.1). An approximation is valid when it is a (conditional) density with the same support as the density it approximates: qp(θ∣y,d)>0  ⟺  p(θ∣y,d)>0q_p(\theta\mid y,d)>0\iff p(\theta\mid y,d)>0qp​(θ∣y,d)>0⟺p(θ∣y,d)>0 for every yyy with p(y∣d)>0p(y\mid d)>0p(y∣d)>0; qm(y∣d)>0  ⟺  p(y∣d)>0q_m(y\mid d)>0\iff p(y\mid d)>0qm​(y∣d)>0⟺p(y∣d)>0; qℓ(y∣θ,d)>0  ⟺  p(y∣θ,d)>0q_\ell(y\mid\theta,d)>0\iff p(y\mid\theta,d)>0qℓ​(y∣θ,d)>0⟺p(y∣θ,d)>0. A valid VNMC proposal qvq_vqv​ is a valid posterior approximation such that, for every yyy with p(y∣d)>0p(y\mid d)>0p(y∣d)>0, the weight p(y,θ∣d)/qv(θ∣y,d)p(y,\theta\mid d)/q_v(\theta\mid y,d)p(y,θ∣d)/qv​(θ∣y,d) is bounded in θ\thetaθ (the assumption used in the proof of Lemma 1).
  5. Bounds and estimates (Section 3).
    • Lpost(d)=Ep(y,θ∣d)[log⁡qp(θ∣y,d)p(θ)]\mathcal L_{\mathrm{post}}(d)=\mathbb E_{p(y,\theta\mid d)}\big[\log\frac{q_p(\theta\mid y,d)}{p(\theta)}\big]Lpost​(d)=Ep(y,θ∣d)​[logp(θ)qp​(θ∣y,d)​] (eq. 6);
    • Umarg(d)=Ep(y,θ∣d)[log⁡p(y∣θ,d)qm(y∣d)]\mathcal U_{\mathrm{marg}}(d)=\mathbb E_{p(y,\theta\mid d)}\big[\log\frac{p(y\mid\theta,d)}{q_m(y\mid d)}\big]Umarg​(d)=Ep(y,θ∣d)​[logqm​(y∣d)p(y∣θ,d)​] (eq. 9);
    • UVNMC(d,L)=E[log⁡p(y∣θ0,d)−log⁡1L∑ℓ=1Lp(y,θℓ∣d)qv(θℓ∣y,d)]\mathcal U_{\mathrm{VNMC}}(d,L)=\mathbb E\big[\log p(y\mid\theta_0,d)-\log\frac1L\sum_{\ell=1}^L\frac{p(y,\theta_\ell\mid d)}{q_v(\theta_\ell\mid y,d)}\big]UVNMC​(d,L)=E[logp(y∣θ0​,d)−logL1​∑ℓ=1L​qv​(θℓ​∣y,d)p(y,θℓ​∣d)​] with (θ0,y,θ1:L)∼p(y,θ0∣d)∏ℓ=1Lqv(θℓ∣y,d)(\theta_0,y,\theta_{1:L})\sim p(y,\theta_0\mid d)\prod_{\ell=1}^Lq_v(\theta_\ell\mid y,d)(θ0​,y,θ1:L​)∼p(y,θ0​∣d)∏ℓ=1L​qv​(θℓ​∣y,d) (eq. 10);
    • Im+ℓ(d)=Ep(y,θ∣d)[log⁡qℓ(y∣θ,d)qm(y∣d)]\mathcal I_{m+\ell}(d)=\mathbb E_{p(y,\theta\mid d)}\big[\log\frac{q_\ell(y\mid\theta,d)}{q_m(y\mid d)}\big]Im+ℓ​(d)=Ep(y,θ∣d)​[logqm​(y∣d)qℓ​(y∣θ,d)​] (eq. 12).
  6. Lemma 1 (3). For fixed yyy, the product law ∏ℓ=1Lqv(θℓ∣y,d)\prod_{\ell=1}^Lq_v(\theta_\ell\mid y,d)∏ℓ=1L​qv​(θℓ​∣y,d) and the mixture P(θ1:L∣y,d)=1L∑ℓ=1Lp(θℓ∣y,d)∏k≠ℓqv(θk∣y,d)P(\theta_{1:L}\mid y,d)=\frac1L\sum_{\ell=1}^Lp(\theta_\ell\mid y,d)\prod_{k\ne\ell}q_v(\theta_k\mid y,d)P(θ1:L​∣y,d)=L1​∑ℓ=1L​p(θℓ​∣y,d)∏k=ℓ​qv​(θk​∣y,d) on ΘL\Theta^LΘL.
  7. Monte Carlo (Theorem 1). For samples X1,X2,…X_1,X_2,\dotsX1​,X2​,… and f:X×Φ→Rf:\mathcal X\times\Phi\to\mathbb Rf:X×Φ→R: μ^N(ϕ)=1N∑n=1Nf(Xn,ϕ)\hat\mu_N(\phi)=\frac1N\sum_{n=1}^Nf(X_n,\phi)μ^​N​(ϕ)=N1​∑n=1N​f(Xn​,ϕ) and μ(ϕ)=E[f(X1,ϕ)]\mu(\phi)=\mathbb E[f(X_1,\phi)]μ(ϕ)=E[f(X1​,ϕ)].

Formalization Note Densities are real-valued, and every expectation is a Bochner integral. Lean gives a non-integrable integrand the integral 000, so each statement assumes outright that the expectations it uses are finite. log⁡0=0\log0=0log0=0 in Lean, but the support conditions make every logarithm that matters have a positive argument almost surely. The design ddd is fixed and suppressed. The samples XnX_nXn​ are indexed from 000.

Definition code
import Mathlib

/-!
Foster, Jankowiak, Bingham, Horsfall, Teh, Rainforth and Goodman, *Variational Bayesian Optimal
Experimental Design*, arXiv:1903.05480v3 (NeurIPS 2019): the Bayesian model and the expected
information gain of Section 2 (eq. (3)), the variational bounds and estimates `L_post`, `U_marg`,
`U_VNMC`, `I_{m+ℓ}` of Section 3 (eqs. (6), (9), (10), (12)) with the validity conventions of
Appendix A, and the Monte Carlo estimator of Theorem 1 (Section 4).

Conventions. All quantities are for one fixed design `d`, which is suppressed from the notation.
The parameter `θ` lives in a measurable space `Th` and the outcome `y` in a measurable space `Y`;
all densities (`p(θ)`, `p(y|θ,d)`, and the variational densities) are real-valued densities with
respect to fixed reference measures `nuT` on `Th` and `nuY` on `Y` (for instance Lebesgue or
counting measure). A conditional density of `θ` given `y` is a function `Y → Th → ℝ`; a
conditional density of `y` given `θ` is a function `Th → Y → ℝ`.
-/

open MeasureTheory

noncomputable section

namespace VariationalBOED

section Densities

variable {α β : Type*} [MeasurableSpace α] [MeasurableSpace β]

/-- Section 2: `f` is a probability density with respect to the reference measure `ν`:
measurable, nonnegative, and of total integral `1`. -/
def IsProbDensity (ν : Measure α) (f : α → ℝ) : Prop :=
  Measurable f ∧ (∀ x, 0 ≤ f x) ∧ ∫ x, f x ∂ν = 1

/-- Section 2: `f a ·` is a probability density with respect to `ν` for every `a`, and
`(a, b) ↦ f a b` is jointly measurable (a conditional density such as `p(y|θ,d)`). -/
def IsCondDensity (ν : Measure β) (f : α → β → ℝ) : Prop :=
  Measurable (Function.uncurry f) ∧ (∀ a b, 0 ≤ f a b) ∧ ∀ a, ∫ b, f a b ∂ν = 1

/-- The measure with density `f` with respect to `ν`, i.e. the distribution written `f(x)` in the
paper (Sections 2-3). -/
def densMeasure (ν : Measure α) (f : α → ℝ) : Measure α :=
  ν.withDensity (fun x => ENNReal.ofReal (f x))

/-- Lemma 2 and Appendix A.4: the (differential) entropy `H[f] = -E_f[log f]` of a density `f`
with respect to `ν`. -/
def diffEntropy (ν : Measure α) (f : α → ℝ) : ℝ :=
  -∫ x, f x * Real.log (f x) ∂ν

end Densities

section Model

variable {Th Y : Type*} [MeasurableSpace Th] [MeasurableSpace Y]

/-- Section 2: a Bayesian model `p(θ) p(y|θ,d)`: a prior density `p` on `Th` and a likelihood
`lik θ y = p(y|θ,d)` that is a probability density in `y` for every `θ`. -/
def IsModel (nuT : Measure Th) (nuY : Measure Y) (p : Th → ℝ) (lik : Th → Y → ℝ) : Prop :=
  IsProbDensity nuT p ∧ IsCondDensity nuY lik

/-- Section 2: the marginal density `p(y|d) = E_{p(θ)}[p(y|θ,d)]`. -/
def marginal (nuT : Measure Th) (p : Th → ℝ) (lik : Th → Y → ℝ) (y : Y) : ℝ :=
  ∫ θ, p θ * lik θ y ∂nuT

/-- Section 2, eq. (3): the posterior density `p(θ|y,d) = p(θ) p(y|θ,d) / p(y|d)` (meaningful
where `p(y|d) > 0`). -/
def posterior (nuT : Measure Th) (p : Th → ℝ) (lik : Th → Y → ℝ) (y : Y) (θ : Th) : ℝ :=
  p θ * lik θ y / marginal nuT p lik y

/-- Section 2: the joint distribution `p(y,θ|d) = p(θ) p(y|θ,d)` of `(θ, y)`. -/
def jointLaw (nuT : Measure Th) (nuY : Measure Y) (p : Th → ℝ) (lik : Th → Y → ℝ) :
    Measure (Th × Y) :=
  densMeasure (nuT.prod nuY) (fun z => p z.1 * lik z.1 z.2)

/-- Section 2: the marginal distribution `p(y|d)` of the outcome. -/
def marginalLaw (nuT : Measure Th) (nuY : Measure Y) (p : Th → ℝ) (lik : Th → Y → ℝ) :
    Measure Y :=
  densMeasure nuY (marginal nuT p lik)

/-- Eq. (3): the integrand `log (p(y|θ,d) / p(y|d))` of the expected information gain. -/
def eigIntegrand (nuT : Measure Th) (p : Th → ℝ) (lik : Th → Y → ℝ) (z : Th × Y) : ℝ :=
  Real.log (lik z.1 z.2 / marginal nuT p lik z.2)

/-- Eq. (3): the expected information gain
`EIG(d) = E_{p(y,θ|d)}[log (p(y|θ,d) / p(y|d))]`. -/
def eig (nuT : Measure Th) (nuY : Measure Y) (p : Th → ℝ) (lik : Th → Y → ℝ) : ℝ :=
  ∫ z, eigIntegrand nuT p lik z ∂jointLaw nuT nuY p lik

/-- Appendix A.1: a valid posterior approximation `q(θ|y,d)`: a conditional density of `θ` given
`y` with the same support as the posterior `p(θ|y,d)` at every `y` with `p(y|d) > 0`. -/
def IsValidPosteriorApprox (nuT : Measure Th) (p : Th → ℝ) (lik : Th → Y → ℝ)
    (q : Y → Th → ℝ) : Prop :=
  IsCondDensity nuT q ∧
    ∀ y, 0 < marginal nuT p lik y → ∀ θ, (0 < q y θ ↔ 0 < posterior nuT p lik y θ)

/-- Eq. (6): the integrand `log (q_p(θ|y,d) / p(θ))` of the variational posterior bound. -/
def postIntegrand (p : Th → ℝ) (q : Y → Th → ℝ) (z : Th × Y) : ℝ :=
  Real.log (q z.2 z.1 / p z.1)

/-- Eq. (6): the variational posterior bound
`L_post(d) = E_{p(y,θ|d)}[log (q_p(θ|y,d) / p(θ))]`. -/
def postBound (nuT : Measure Th) (nuY : Measure Y) (p : Th → ℝ) (lik : Th → Y → ℝ)
    (q : Y → Th → ℝ) : ℝ :=
  ∫ z, postIntegrand p q z ∂jointLaw nuT nuY p lik

/-- Appendix A.2 (with the validity convention of Appendix A.1): a valid marginal approximation
`q_m(y|d)`: a probability density on `Y` with the same support as `p(y|d)`. -/
def IsValidMarginalApprox (nuT : Measure Th) (nuY : Measure Y) (p : Th → ℝ)
    (lik : Th → Y → ℝ) (qm : Y → ℝ) : Prop :=
  IsProbDensity nuY qm ∧ ∀ y, (0 < qm y ↔ 0 < marginal nuT p lik y)

/-- Eq. (9): the integrand `log (p(y|θ,d) / q_m(y|d))` of the variational marginal bound. -/
def margIntegrand (lik : Th → Y → ℝ) (qm : Y → ℝ) (z : Th × Y) : ℝ :=
  Real.log (lik z.1 z.2 / qm z.2)

/-- Eq. (9): the variational marginal bound
`U_marg(d) = E_{p(y,θ|d)}[log (p(y|θ,d) / q_m(y|d))]`. -/
def margBound (nuT : Measure Th) (nuY : Measure Y) (p : Th → ℝ) (lik : Th → Y → ℝ)
    (qm : Y → ℝ) : ℝ :=
  ∫ z, margIntegrand lik qm z ∂jointLaw nuT nuY p lik

/-- Lemma 1 with its proof in Appendix A.3: a valid VNMC proposal `q_v(θ|y,d)`: a valid posterior
approximation (Appendix A.1) such that, at every `y` with `p(y|d) > 0`, the importance weight
`p(y,θ|d) / q_v(θ|y,d)` is bounded in `θ` (the assumption invoked in the proof in Appendix A.3). -/
def IsValidVNMCProposal (nuT : Measure Th) (p : Th → ℝ) (lik : Th → Y → ℝ)
    (qv : Y → Th → ℝ) : Prop :=
  IsValidPosteriorApprox nuT p lik qv ∧
    ∀ y, 0 < marginal nuT p lik y → ∃ B : ℝ, ∀ θ, p θ * lik θ y / qv y θ ≤ B

/-- Eq. (10): the sampling distribution of `(θ₀, y, θ_{1:L})`, namely
`p(y, θ₀|d) ∏_{ℓ=1}^L q_v(θ_ℓ|y,d)`. -/
def vnmcLaw (nuT : Measure Th) [SigmaFinite nuT] (nuY : Measure Y) (p : Th → ℝ)
    (lik : Th → Y → ℝ) (qv : Y → Th → ℝ) (L : ℕ) : Measure ((Th × Y) × (Fin L → Th)) :=
  densMeasure ((nuT.prod nuY).prod (Measure.pi fun _ : Fin L => nuT))
    (fun x => p x.1.1 * lik x.1.1 x.1.2 * ∏ i, qv x.1.2 (x.2 i))

/-- Eq. (10): the integrand
`log p(y|θ₀,d) - log ((1/L) ∑_{ℓ=1}^L p(y,θ_ℓ|d) / q_v(θ_ℓ|y,d))` of the VNMC bound. -/
def vnmcIntegrand (p : Th → ℝ) (lik : Th → Y → ℝ) (qv : Y → Th → ℝ) (L : ℕ)
    (x : (Th × Y) × (Fin L → Th)) : ℝ :=
  Real.log (lik x.1.1 x.1.2) -
    Real.log ((1 / (L : ℝ)) * ∑ i, p (x.2 i) * lik (x.2 i) x.1.2 / qv x.1.2 (x.2 i))

/-- Eq. (10): the variational nested Monte Carlo bound `U_VNMC(d, L)`. -/
def vnmcBound (nuT : Measure Th) [SigmaFinite nuT] (nuY : Measure Y) (p : Th → ℝ)
    (lik : Th → Y → ℝ) (qv : Y → Th → ℝ) (L : ℕ) : ℝ :=
  ∫ x, vnmcIntegrand p lik qv L x ∂vnmcLaw nuT nuY p lik qv L

/-- Lemma 1 (3): the distribution `∏_{ℓ=1}^L q_v(θ_ℓ|y,d)` of `L` independent proposal draws. -/
def vnmcProposalProd (nuT : Measure Th) [SigmaFinite nuT] (qv : Y → Th → ℝ) (L : ℕ) (y : Y) :
    Measure (Fin L → Th) :=
  densMeasure (Measure.pi fun _ : Fin L => nuT) (fun θs => ∏ i, qv y (θs i))

/-- Lemma 1 (3): the mixture
`(1/L) ∑_{ℓ=1}^L p(θ_ℓ|y,d) ∏_{k ≠ ℓ} q_v(θ_k|y,d)` on `L`-tuples of parameters. -/
def vnmcMixture (nuT : Measure Th) [SigmaFinite nuT] (p : Th → ℝ) (lik : Th → Y → ℝ)
    (qv : Y → Th → ℝ) (L : ℕ) (y : Y) : Measure (Fin L → Th) :=
  densMeasure (Measure.pi fun _ : Fin L => nuT)
    (fun θs => (1 / (L : ℝ)) *
      ∑ l, posterior nuT p lik y (θs l) * ∏ k ∈ Finset.univ.erase l, qv y (θs k))

/-- Section 3 (implicit likelihood, eq. (12)) with the validity convention of Appendix A.1: a valid
likelihood approximation `q_ℓ(y|θ,d)`: a conditional density of `y` given `θ` with the same
support as `p(y|θ,d)`. -/
def IsValidLikelihoodApprox (nuY : Measure Y) (lik : Th → Y → ℝ) (ql : Th → Y → ℝ) : Prop :=
  IsCondDensity nuY ql ∧ ∀ θ y, (0 < ql θ y ↔ 0 < lik θ y)

/-- Eq. (12): the integrand `log (q_ℓ(y|θ,d) / q_m(y|d))` of the marginal + likelihood
estimate. -/
def mlIntegrand (qm : Y → ℝ) (ql : Th → Y → ℝ) (z : Th × Y) : ℝ :=
  Real.log (ql z.1 z.2 / qm z.2)

/-- Eq. (12): the marginal + likelihood approximation
`I_{m+ℓ}(d) = E_{p(y,θ|d)}[log (q_ℓ(y|θ,d) / q_m(y|d))]`. -/
def mlEstimate (nuT : Measure Th) (nuY : Measure Y) (p : Th → ℝ) (lik : Th → Y → ℝ)
    (qm : Y → ℝ) (ql : Th → Y → ℝ) : ℝ :=
  ∫ z, mlIntegrand qm ql z ∂jointLaw nuT nuY p lik

end Model

section MonteCarlo

variable {Ω S E : Type*} [MeasurableSpace Ω]

/-- Theorem 1: the Monte Carlo estimator `μ̂_N(φ) = (1/N) ∑_{n=1}^N f(X_n, φ)` (the samples
`X_1, X_2, …` are indexed from `0` here). -/
def mcEstimate (f : S → E → ℝ) (X : ℕ → Ω → S) (N : ℕ) (φ : E) (ω : Ω) : ℝ :=
  (1 / (N : ℝ)) * ∑ n ∈ Finset.range N, f (X n ω) φ

/-- Theorem 1: the target `μ(φ) = E[f(X_1, φ)]` of the Monte Carlo estimator. -/
def mcMean (P : Measure Ω) (f : S → E → ℝ) (X : ℕ → Ω → S) (φ : E) : ℝ :=
  ∫ ω, f (X 0 ω) φ ∂P

end MonteCarlo

end VariationalBOED
Source
Foster, Jankowiak, Bingham, Horsfall, Teh, Rainforth and Goodman, Variational Bayesian Optimal Experimental Design, arXiv:1903.05480v3 (NeurIPS 2019), Section 2 (eq. 3), Section 3 (eqs. 6, 9, 10, 12), Section 4 (Theorem 1), Appendix A.1-A.4
Read-back

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

Probability density (IsProbDensity). Let α\alphaα be a measurable space with a measure ν\nuν, and let f:α→Rf:\alpha\to\mathbb Rf:α→R. The predicate holds when all three of the following are true:

  • fff is measurable;
  • f(x)≥0f(x)\ge 0f(x)≥0 for every xxx, everywhere and not just almost everywhere;
  • ∫αf dν=1\int_\alpha f\,d\nu = 1∫α​fdν=1.

The integral is the Bochner integral, which is defined to be 000 when fff is not ν\nuν-integrable. So the last condition also forces fff to be integrable. No finiteness or σ\sigmaσ-finiteness is assumed of ν\nuν.

Conditional density (IsCondDensity). Let α,β\alpha,\betaα,β be measurable spaces, ν\nuν a measure on β\betaβ, and f:α×β→Rf:\alpha\times\beta\to\mathbb Rf:α×β→R, written f(a,b)f(a,b)f(a,b). The predicate holds when:

  • (a,b)↦f(a,b)(a,b)\mapsto f(a,b)(a,b)↦f(a,b) is measurable for the product σ\sigmaσ-algebra on α×β\alpha\times\betaα×β;
  • f(a,b)≥0f(a,b)\ge 0f(a,b)≥0 for all a,ba,ba,b;
  • for every a∈αa\in\alphaa∈α, ∫βf(a,b) dν(b)=1\int_\beta f(a,b)\,d\nu(b)=1∫β​f(a,b)dν(b)=1, with the same Bochner convention, so each section f(a,⋅)f(a,\cdot)f(a,⋅) is ν\nuν-integrable.

No measure on α\alphaα is involved.

Measure with density (densMeasure). For a measure ν\nuν on α\alphaα and f:α→Rf:\alpha\to\mathbb Rf:α→R, this is the measure

μν,f(A)=∫Amax⁡(f(x),0) dν(x)∈[0,∞].\mu_{\nu,f}(A)=\int_A \max(f(x),0)\,d\nu(x)\in[0,\infty].μν,f​(A)=∫A​max(f(x),0)dν(x)∈[0,∞].

Negative values of fff are silently replaced by 000. The result is not required to be a probability measure, or even finite, unless fff happens to be a probability density.

Differential entropy (diffEntropy). For a measure ν\nuν on α\alphaα and f:α→Rf:\alpha\to\mathbb Rf:α→R,

Hν[f]=−∫αf(x) log⁡f(x) dν(x).H_\nu[f] = -\int_\alpha f(x)\,\log f(x)\,d\nu(x).Hν​[f]=−∫α​f(x)logf(x)dν(x).

Here log⁡\loglog is the real logarithm with the conventions log⁡0=0\log 0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣ for x<0x<0x<0, so points where f=0f=0f=0 contribute 000. The integral is 000 if the integrand is not integrable, in which case Hν[f]=0H_\nu[f]=0Hν​[f]=0. No hypothesis on fff is imposed.

Bayesian model (IsModel). Let Θ\ThetaΘ and YYY be measurable spaces with measures νΘ\nu_\ThetaνΘ​ and νY\nu_YνY​. Let p:Θ→Rp:\Theta\to\mathbb Rp:Θ→R and λ:Θ×Y→R\lambda:\Theta\times Y\to\mathbb Rλ:Θ×Y→R. The predicate holds when both of the following are true:

  • ppp is a probability density with respect to νΘ\nu_\ThetaνΘ​: measurable, everywhere ≥0\ge 0≥0, and ∫p dνΘ=1\int p\,d\nu_\Theta=1∫pdνΘ​=1.
  • λ\lambdaλ is a conditional density in yyy with respect to νY\nu_YνY​:
    • (θ,y)↦λ(θ,y)(\theta,y)\mapsto\lambda(\theta,y)(θ,y)↦λ(θ,y) is jointly measurable;
    • λ(θ,y)≥0\lambda(\theta,y)\ge 0λ(θ,y)≥0 everywhere;
    • ∫Yλ(θ,y) dνY(y)=1\int_Y\lambda(\theta,y)\,d\nu_Y(y)=1∫Y​λ(θ,y)dνY​(y)=1 for every θ\thetaθ.

No compatibility between νΘ\nu_\ThetaνΘ​ and νY\nu_YνY​ and no σ\sigmaσ-finiteness are required.

Marginal (marginal). For νΘ\nu_\ThetaνΘ​, ppp, λ\lambdaλ as above and any y∈Yy\in Yy∈Y,

m(y)=∫Θp(θ) λ(θ,y) dνΘ(θ).m(y)=\int_\Theta p(\theta)\,\lambda(\theta,y)\,d\nu_\Theta(\theta).m(y)=∫Θ​p(θ)λ(θ,y)dνΘ​(θ).

m(y)m(y)m(y) is defined to be 000 whenever θ↦p(θ)λ(θ,y)\theta\mapsto p(\theta)\lambda(\theta,y)θ↦p(θ)λ(θ,y) is not νΘ\nu_\ThetaνΘ​-integrable. No model assumptions are imposed, so mmm may be negative or junk for arbitrary p,λp,\lambdap,λ.

Posterior (posterior). For y∈Yy\in Yy∈Y and θ∈Θ\theta\in\Thetaθ∈Θ,

π(θ∣y)=p(θ) λ(θ,y)m(y),\pi(\theta\mid y)=\frac{p(\theta)\,\lambda(\theta,y)}{m(y)},π(θ∣y)=m(y)p(θ)λ(θ,y)​,

where mmm is the marginal above. Division by zero is defined to give 000, so π(θ∣y)=0\pi(\theta\mid y)=0π(θ∣y)=0 for all θ\thetaθ whenever m(y)=0m(y)=0m(y)=0. This includes the case where the marginal integral fails to exist.

Joint law (jointLaw). This is the measure on Θ×Y\Theta\times YΘ×Y given by

J(A)=∫Amax⁡(p(θ)λ(θ,y),0) d(νΘ⊗νY)(θ,y).J(A)=\int_A \max\bigl(p(\theta)\lambda(\theta,y),0\bigr)\,d(\nu_\Theta\otimes\nu_Y)(\theta,y).J(A)=∫A​max(p(θ)λ(θ,y),0)d(νΘ​⊗νY​)(θ,y).

Here νΘ⊗νY\nu_\Theta\otimes\nu_YνΘ​⊗νY​ is the library's product measure, with no σ\sigmaσ-finiteness assumed. Negative values of the product are clipped to 000. JJJ is not asserted to be a probability measure.

Marginal law (marginalLaw). This is the measure on YYY with density y↦max⁡(m(y),0)y\mapsto\max(m(y),0)y↦max(m(y),0) with respect to νY\nu_YνY​, where mmm is the marginal above (with its "non-integrable gives 000" convention).

EIG integrand (eigIntegrand). For (θ,y)∈Θ×Y(\theta,y)\in\Theta\times Y(θ,y)∈Θ×Y,

log⁡λ(θ,y)m(y).\log\frac{\lambda(\theta,y)}{m(y)}.logm(y)λ(θ,y)​.

The following conventions apply:

  • x/0=0x/0=0x/0=0, so the value is log⁡0=0\log 0=0log0=0 when m(y)=0m(y)=0m(y)=0.
  • log⁡0=0\log 0=0log0=0, so the value is 000 (not −∞-\infty−∞) when λ(θ,y)=0\lambda(\theta,y)=0λ(θ,y)=0.
  • log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣ for negative arguments.

Expected information gain (eig). For measures νΘ,νY\nu_\Theta,\nu_YνΘ​,νY​ and functions p,λp,\lambdap,λ (no model hypotheses assumed),

EIG=∫Θ×Ylog⁡λ(θ,y)m(y) dJ(θ,y).\mathrm{EIG}=\int_{\Theta\times Y}\log\frac{\lambda(\theta,y)}{m(y)}\,dJ(\theta,y).EIG=∫Θ×Y​logm(y)λ(θ,y)​dJ(θ,y).
  • JJJ is the joint law, with density max⁡(p(θ)λ(θ,y),0)\max(p(\theta)\lambda(\theta,y),0)max(p(θ)λ(θ,y),0) with respect to νΘ⊗νY\nu_\Theta\otimes\nu_YνΘ​⊗νY​.
  • m(y)=∫p(θ′)λ(θ′,y) dνΘ(θ′)m(y)=\int p(\theta')\lambda(\theta',y)\,d\nu_\Theta(\theta')m(y)=∫p(θ′)λ(θ′,y)dνΘ​(θ′), taken as 000 if not integrable.
  • The logarithm conventions are log⁡0=0\log 0=0log0=0, x/0=0x/0=0x/0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣.
  • The whole quantity is 000 if the integrand is not JJJ-integrable. It is a real number, never +∞+\infty+∞.

Valid posterior approximation (IsValidPosteriorApprox). For νΘ\nu_\ThetaνΘ​, ppp, λ\lambdaλ and q:Y×Θ→Rq:Y\times\Theta\to\mathbb Rq:Y×Θ→R, written q(y,θ)q(y,\theta)q(y,θ), the predicate holds when two conditions are met.

First, qqq is a conditional density in θ\thetaθ with respect to νΘ\nu_\ThetaνΘ​:

  • (y,θ)↦q(y,θ)(y,\theta)\mapsto q(y,\theta)(y,θ)↦q(y,θ) is jointly measurable;
  • q≥0q\ge 0q≥0 everywhere;
  • ∫Θq(y,θ) dνΘ(θ)=1\int_\Theta q(y,\theta)\,d\nu_\Theta(\theta)=1∫Θ​q(y,θ)dνΘ​(θ)=1 for every yyy, including those with m(y)=0m(y)=0m(y)=0.

Second, for every yyy with m(y)>0m(y)>0m(y)>0 and every θ\thetaθ,

q(y,θ)>0  ⟺  π(θ∣y)>0.q(y,\theta)>0 \iff \pi(\theta\mid y)>0.q(y,θ)>0⟺π(θ∣y)>0.

Since m(y)>0m(y)>0m(y)>0, the right-hand side is equivalent to p(θ)λ(θ,y)>0p(\theta)\lambda(\theta,y)>0p(θ)λ(θ,y)>0. This support condition is pointwise for every θ\thetaθ, not up to null sets. It says nothing about yyy with m(y)≤0m(y)\le 0m(y)≤0. No measure on YYY enters.

Posterior-bound integrand (postIntegrand). For (θ,y)(\theta,y)(θ,y),

log⁡q(y,θ)p(θ).\log\frac{q(y,\theta)}{p(\theta)}.logp(θ)q(y,θ)​.

The conventions are x/0=0x/0=0x/0=0 and log⁡0=0\log 0=0log0=0. So the value is 000 when p(θ)=0p(\theta)=0p(θ)=0 or q(y,θ)=0q(y,\theta)=0q(y,θ)=0, and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣ for negative arguments.

Variational posterior bound (postBound). For νΘ,νY,p,λ,q\nu_\Theta,\nu_Y,p,\lambda,qνΘ​,νY​,p,λ,q with no hypotheses,

Lpost=∫Θ×Ylog⁡q(y,θ)p(θ) dJ(θ,y).L_{\mathrm{post}}=\int_{\Theta\times Y}\log\frac{q(y,\theta)}{p(\theta)}\,dJ(\theta,y).Lpost​=∫Θ×Y​logp(θ)q(y,θ)​dJ(θ,y).
  • JJJ is the joint law with density max⁡(p(θ)λ(θ,y),0)\max(p(\theta)\lambda(\theta,y),0)max(p(θ)λ(θ,y),0) with respect to νΘ⊗νY\nu_\Theta\otimes\nu_YνΘ​⊗νY​.
  • The conventions are x/0=0x/0=0x/0=0, log⁡0=0\log 0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣.
  • The value is 000 if the integrand is not JJJ-integrable.

Nothing in this definition asserts that it is a bound on anything.

Valid marginal approximation (IsValidMarginalApprox). For νΘ,νY,p,λ\nu_\Theta,\nu_Y,p,\lambdaνΘ​,νY​,p,λ and qm:Y→Rq_m:Y\to\mathbb Rqm​:Y→R, the predicate holds when two conditions are met:

  • qmq_mqm​ is a probability density with respect to νY\nu_YνY​: measurable, everywhere ≥0\ge 0≥0, and ∫qm dνY=1\int q_m\,d\nu_Y=1∫qm​dνY​=1.
  • For every y∈Yy\in Yy∈Y, pointwise, qm(y)>0  ⟺  m(y)>0q_m(y)>0\iff m(y)>0qm​(y)>0⟺m(y)>0, where m(y)=∫p(θ)λ(θ,y) dνΘ(θ)m(y)=\int p(\theta)\lambda(\theta,y)\,d\nu_\Theta(\theta)m(y)=∫p(θ)λ(θ,y)dνΘ​(θ) (taken as 000 if not integrable).

Marginal-bound integrand (margIntegrand). For (θ,y)(\theta,y)(θ,y),

log⁡λ(θ,y)qm(y).\log\frac{\lambda(\theta,y)}{q_m(y)}.logqm​(y)λ(θ,y)​.

The conventions are x/0=0x/0=0x/0=0, log⁡0=0\log 0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣. So the value is 000 when qm(y)=0q_m(y)=0qm​(y)=0 or λ(θ,y)=0\lambda(\theta,y)=0λ(θ,y)=0.

Variational marginal bound (margBound). With no hypotheses on the inputs,

Umarg=∫Θ×Ylog⁡λ(θ,y)qm(y) dJ(θ,y).U_{\mathrm{marg}}=\int_{\Theta\times Y}\log\frac{\lambda(\theta,y)}{q_m(y)}\,dJ(\theta,y).Umarg​=∫Θ×Y​logqm​(y)λ(θ,y)​dJ(θ,y).
  • JJJ is the joint law with density max⁡(p(θ)λ(θ,y),0)\max(p(\theta)\lambda(\theta,y),0)max(p(θ)λ(θ,y),0) with respect to νΘ⊗νY\nu_\Theta\otimes\nu_YνΘ​⊗νY​.
  • The conventions are x/0=0x/0=0x/0=0, log⁡0=0\log 0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣.
  • The value is 000 if the integrand is not JJJ-integrable.

Valid VNMC proposal (IsValidVNMCProposal). For νΘ,p,λ\nu_\Theta,p,\lambdaνΘ​,p,λ and qv:Y×Θ→Rq_v:Y\times\Theta\to\mathbb Rqv​:Y×Θ→R, the predicate holds when two conditions are met.

First, qvq_vqv​ is a valid posterior approximation in the sense above:

  • it is a jointly measurable, everywhere nonnegative function;
  • ∫qv(y,θ) dνΘ(θ)=1\int q_v(y,\theta)\,d\nu_\Theta(\theta)=1∫qv​(y,θ)dνΘ​(θ)=1 for every yyy;
  • for every yyy with m(y)>0m(y)>0m(y)>0 and every θ\thetaθ, qv(y,θ)>0  ⟺  p(θ)λ(θ,y)>0q_v(y,\theta)>0\iff p(\theta)\lambda(\theta,y)>0qv​(y,θ)>0⟺p(θ)λ(θ,y)>0.

Second, for every yyy with m(y)>0m(y)>0m(y)>0 there is a real number BBB (depending on yyy) such that for all θ\thetaθ,

p(θ)λ(θ,y)qv(y,θ)≤B.\frac{p(\theta)\lambda(\theta,y)}{q_v(y,\theta)}\le B.qv​(y,θ)p(θ)λ(θ,y)​≤B.

Because x/0=0x/0=0x/0=0, the ratio equals 000 wherever qv(y,θ)=0q_v(y,\theta)=0qv​(y,θ)=0, so the bound only constrains points where qv(y,θ)≠0q_v(y,\theta)\ne0qv​(y,θ)=0. Only an upper bound is required, not a bound on the absolute value. Nothing is required at yyy with m(y)≤0m(y)\le 0m(y)≤0.

VNMC sampling law (vnmcLaw). Assume νΘ\nu_\ThetaνΘ​ is σ\sigmaσ-finite and fix L∈NL\in\mathbb NL∈N, with L=0L=0L=0 allowed. Write a point of (Θ×Y)×ΘL(\Theta\times Y)\times\Theta^L(Θ×Y)×ΘL as ((θ0,y),(θ1,…,θL))((\theta_0,y),(\theta_1,\dots,\theta_L))((θ0​,y),(θ1​,…,θL​)); the code indexes the LLL extra parameters by 0,…,L−10,\dots,L-10,…,L−1. The law is the measure with density

max⁡(p(θ0) λ(θ0,y)∏i=1Lqv(y,θi),  0)\max\Bigl(p(\theta_0)\,\lambda(\theta_0,y)\prod_{i=1}^{L}q_v(y,\theta_i),\;0\Bigr)max(p(θ0​)λ(θ0​,y)i=1∏L​qv​(y,θi​),0)

with respect to (νΘ⊗νY)⊗νΘ⊗L(\nu_\Theta\otimes\nu_Y)\otimes\nu_\Theta^{\otimes L}(νΘ​⊗νY​)⊗νΘ⊗L​.

When L=0L=0L=0, the product is empty (equal to 111) and Θ0\Theta^0Θ0 is a single point carrying unit mass. In that case the measure is just a copy of the joint law JJJ. No hypotheses on p,λ,qvp,\lambda,q_vp,λ,qv​ are imposed, and the measure is not asserted to be a probability measure.

VNMC integrand (vnmcIntegrand). For L∈NL\in\mathbb NL∈N and a point ((θ0,y),(θ1,…,θL))((\theta_0,y),(\theta_1,\dots,\theta_L))((θ0​,y),(θ1​,…,θL​)),

log⁡λ(θ0,y)  −  log⁡(1L∑i=1Lp(θi) λ(θi,y)qv(y,θi)).\log\lambda(\theta_0,y)\;-\;\log\Bigl(\frac1L\sum_{i=1}^{L}\frac{p(\theta_i)\,\lambda(\theta_i,y)}{q_v(y,\theta_i)}\Bigr).logλ(θ0​,y)−log(L1​i=1∑L​qv​(y,θi​)p(θi​)λ(θi​,y)​).

The conventions are:

  • log⁡0=0\log 0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣;
  • x/0=0x/0=0x/0=0, so any term with qv(y,θi)=0q_v(y,\theta_i)=0qv​(y,θi​)=0 contributes 000;
  • 1/L1/L1/L is computed in R\mathbb RR, with 1/0=01/0=01/0=0.

When L=0L=0L=0, the second logarithm is log⁡0=0\log 0=0log0=0, so the integrand reduces to log⁡λ(θ0,y)\log\lambda(\theta_0,y)logλ(θ0​,y).

VNMC bound (vnmcBound). With νΘ\nu_\ThetaνΘ​ σ\sigmaσ-finite and L∈NL\in\mathbb NL∈N (including L=0L=0L=0),

UVNMC(L)=∫[log⁡λ(θ0,y)−log⁡(1L∑i=1Lp(θi)λ(θi,y)qv(y,θi))] dVL.U_{\mathrm{VNMC}}(L)=\int \Bigl[\log\lambda(\theta_0,y)-\log\Bigl(\tfrac1L\sum_{i=1}^{L}\tfrac{p(\theta_i)\lambda(\theta_i,y)}{q_v(y,\theta_i)}\Bigr)\Bigr]\,dV_L.UVNMC​(L)=∫[logλ(θ0​,y)−log(L1​i=1∑L​qv​(y,θi​)p(θi​)λ(θi​,y)​)]dVL​.
  • VLV_LVL​ is the measure on (Θ×Y)×ΘL(\Theta\times Y)\times\Theta^L(Θ×Y)×ΘL with density max⁡(p(θ0)λ(θ0,y)∏iqv(y,θi),0)\max(p(\theta_0)\lambda(\theta_0,y)\prod_{i}q_v(y,\theta_i),0)max(p(θ0​)λ(θ0​,y)∏i​qv​(y,θi​),0) with respect to (νΘ⊗νY)⊗νΘ⊗L(\nu_\Theta\otimes\nu_Y)\otimes\nu_\Theta^{\otimes L}(νΘ​⊗νY​)⊗νΘ⊗L​.
  • The conventions are log⁡0=0\log 0=0log0=0, log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣, x/0=0x/0=0x/0=0 and 1/0=01/0=01/0=0.
  • The value is 000 if the integrand is not VLV_LVL​-integrable.
  • For L=0L=0L=0 it becomes ∫log⁡λ(θ0,y) dJ\int\log\lambda(\theta_0,y)\,dJ∫logλ(θ0​,y)dJ.

No hypotheses on p,λ,qvp,\lambda,q_vp,λ,qv​ are imposed.

Product of proposal draws (vnmcProposalProd). Assume νΘ\nu_\ThetaνΘ​ is σ\sigmaσ-finite and fix L∈NL\in\mathbb NL∈N and y∈Yy\in Yy∈Y. This is the measure on ΘL\Theta^LΘL with density

max⁡(∏i=1Lqv(y,θi),0)\max\Bigl(\prod_{i=1}^{L}q_v(y,\theta_i),0\Bigr)max(i=1∏L​qv​(y,θi​),0)

with respect to νΘ⊗L\nu_\Theta^{\otimes L}νΘ⊗L​. When L=0L=0L=0, it is the unit point mass on the single point of Θ0\Theta^0Θ0. It is a probability measure only if qv(y,⋅)q_v(y,\cdot)qv​(y,⋅) is a probability density, which is not assumed here.

VNMC mixture (vnmcMixture). Assume νΘ\nu_\ThetaνΘ​ is σ\sigmaσ-finite and fix L∈NL\in\mathbb NL∈N and y∈Yy\in Yy∈Y. This is the measure on ΘL\Theta^LΘL with density with respect to νΘ⊗L\nu_\Theta^{\otimes L}νΘ⊗L​ given by

max⁡(1L∑l=1Lπ(θl∣y)∏k≠lqv(y,θk),  0).\max\Bigl(\frac1L\sum_{l=1}^{L}\pi(\theta_l\mid y)\prod_{k\ne l}q_v(y,\theta_k),\;0\Bigr).max(L1​l=1∑L​π(θl​∣y)k=l∏​qv​(y,θk​),0).

Here π(θ∣y)=p(θ)λ(θ,y)/m(y)\pi(\theta\mid y)=p(\theta)\lambda(\theta,y)/m(y)π(θ∣y)=p(θ)λ(θ,y)/m(y), with π≡0\pi\equiv0π≡0 when m(y)=0m(y)=0m(y)=0, and 1/L1/L1/L uses 1/0=01/0=01/0=0. When L=0L=0L=0, the sum is empty, so the result is the zero measure. When m(y)=0m(y)=0m(y)=0, it is also the zero measure.

Valid likelihood approximation (IsValidLikelihoodApprox). For νY\nu_YνY​, λ\lambdaλ and qℓ:Θ×Y→Rq_\ell:\Theta\times Y\to\mathbb Rqℓ​:Θ×Y→R, the predicate holds when two conditions are met:

  • qℓq_\ellqℓ​ is a conditional density in yyy with respect to νY\nu_YνY​: jointly measurable, everywhere ≥0\ge 0≥0, and ∫Yqℓ(θ,y) dνY(y)=1\int_Y q_\ell(\theta,y)\,d\nu_Y(y)=1∫Y​qℓ​(θ,y)dνY​(y)=1 for every θ\thetaθ.
  • For every θ\thetaθ and yyy, pointwise, qℓ(θ,y)>0  ⟺  λ(θ,y)>0q_\ell(\theta,y)>0\iff\lambda(\theta,y)>0qℓ​(θ,y)>0⟺λ(θ,y)>0.

The prior plays no role.

Marginal-plus-likelihood integrand (mlIntegrand). For (θ,y)(\theta,y)(θ,y),

log⁡qℓ(θ,y)qm(y).\log\frac{q_\ell(\theta,y)}{q_m(y)}.logqm​(y)qℓ​(θ,y)​.

The conventions are x/0=0x/0=0x/0=0, log⁡0=0\log 0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣.

Marginal-plus-likelihood estimate (mlEstimate). With no hypotheses on the inputs,

Im+ℓ=∫Θ×Ylog⁡qℓ(θ,y)qm(y) dJ(θ,y).I_{m+\ell}=\int_{\Theta\times Y}\log\frac{q_\ell(\theta,y)}{q_m(y)}\,dJ(\theta,y).Im+ℓ​=∫Θ×Y​logqm​(y)qℓ​(θ,y)​dJ(θ,y).
  • JJJ is the joint law with density max⁡(p(θ)λ(θ,y),0)\max(p(\theta)\lambda(\theta,y),0)max(p(θ)λ(θ,y),0) with respect to νΘ⊗νY\nu_\Theta\otimes\nu_YνΘ​⊗νY​.
  • The conventions are x/0=0x/0=0x/0=0, log⁡0=0\log 0=0log0=0 and log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣.
  • The value is 000 if the integrand is not JJJ-integrable.

The true likelihood λ\lambdaλ enters only through JJJ.

Monte Carlo estimate (mcEstimate). Let Ω\OmegaΩ be a measurable space, and let SSS and EEE be arbitrary types. Take f:S×E→Rf:S\times E\to\mathbb Rf:S×E→R, a sequence of functions X0,X1,⋯:Ω→SX_0,X_1,\dots:\Omega\to SX0​,X1​,⋯:Ω→S, N∈NN\in\mathbb NN∈N, φ∈E\varphi\in Eφ∈E and ω∈Ω\omega\in\Omegaω∈Ω. Then

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

Only the first NNN functions X0,…,XN−1X_0,\dots,X_{N-1}X0​,…,XN−1​ are used, and 1/0=01/0=01/0=0, so μ^0≡0\hat\mu_0\equiv0μ^​0​≡0. No measurability, independence or identical-distribution assumptions are made on the XnX_nXn​, and none on fff.

Monte Carlo target (mcMean). For a measure PPP on Ω\OmegaΩ (not required to be a probability measure), fff, the sequence (Xn)(X_n)(Xn​) and φ∈E\varphi\in Eφ∈E,

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

Only X0X_0X0​ is used. The value is 000 if ω↦f(X0(ω),φ)\omega\mapsto f(X_0(\omega),\varphi)ω↦f(X0​(ω),φ) is not PPP-integrable.

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