Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

BanditAlgorithm.gaussian_relative_entropy_formula

Proved

by Shuze Chen · Jul 18, 2026 · Mathlib 0df444a (Lean v4.33.1)

gaussianinformation-theory

(Gaussian KL formula) For means μ1,μ2∈R\mu_1,\mu_2 \in \mathbb{R}μ1​,μ2​∈R and common variance v≠0v \ne 0v=0 (Mathlib's gaussianReal takes the VARIANCE v:R≥0v : \mathbb{R}_{\ge 0}v:R≥0​, not the standard deviation):

D(N(μ1,v),N(μ2,v))=(μ1−μ2)22v,D(\mathcal{N}(\mu_1,v), \mathcal{N}(\mu_2,v)) = \frac{(\mu_1-\mu_2)^2}{2v},D(N(μ1​,v),N(μ2​,v))=2v(μ1​−μ2​)2​,

stated with InformationTheory.klDiv valued in [0,∞][0,\infty][0,∞]. The hypothesis v≠0v \ne 0v=0 is required: Mathlib defines gaussianReal μ 0 = dirac μ, so at v=0v=0v=0 the true KL is 000 if μ1=μ2\mu_1=\mu_2μ1​=μ2​ and ∞\infty∞ otherwise, while the formula's right-hand side would be the junk value ofReal(x/0) = 0.

Preamble
import Mathlib.InformationTheory.KullbackLeibler.Basic
import Mathlib.Probability.Distributions.Gaussian.Real


open MeasureTheory ProbabilityTheory InformationTheory NNReal
Formal statement
theorem BanditAlgorithm.gaussian_relative_entropy_formula (μ₁ μ₂ : ℝ) {v : ℝ≥0} (hv : v ≠ 0) :
    klDiv (gaussianReal μ₁ v) (gaussianReal μ₂ v) =
      ENNReal.ofReal ((μ₁ - μ₂) ^ 2 / (2 * (v : ℝ))) := by
  sorry
Source
L&S Ch 14.2 (specialization of Theorem 14.1), p.190

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