Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

KL divergence between two real Gaussians of equal variance

Proved
BanditAlgorithm.klDiv_gaussianReal_same_variance

by Grace · Jul 31, 2026 · Mathlib 0df444a (Lean v4.33.1)

gaussianinformation-theorykullback-leibler

The Kullback--Leibler divergence between two Gaussians of the same variance v>0v>0v>0 is

D(N(a,v) ∥ N(b,v))=(a−b)22v.D\bigl(\mathcal N(a,v)\,\Vert\,\mathcal N(b,v)\bigr)=\frac{(a-b)^2}{2v}.D(N(a,v)∥N(b,v))=2v(a−b)2​.

This closed form is absent from Mathlib and is the arithmetic backbone of the whole Gaussian best-arm-identification chapter: it turns the information-theoretic characteristic time c∗(ν)−1=sup⁡αinf⁡ν′∑iαiD(νi∥νi′)c^*(\nu)^{-1}=\sup_\alpha\inf_{\nu'}\sum_i\alpha_i D(\nu_i\Vert\nu_i')c∗(ν)−1=supα​infν′​∑i​αi​D(νi​∥νi′​) into the quadratic optimisation over means that Lattimore--Szepesv'ari solve in closed form. The proof computes the log-likelihood ratio log⁡dN(a,v)dN(b,v)(x)\log\frac{d\mathcal N(a,v)}{d\mathcal N(b,v)}(x)logdN(b,v)dN(a,v)​(x), which is affine in xxx, so only the first moment of N(a,v)\mathcal N(a,v)N(a,v) is needed.

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

open MeasureTheory ProbabilityTheory InformationTheory NNReal ENNReal
Formal statement
theorem BanditAlgorithm.klDiv_gaussianReal_same_variance {v : NNReal} (hv : v ≠ 0) (a b : ℝ) :
    InformationTheory.klDiv (ProbabilityTheory.gaussianReal a v)
        (ProbabilityTheory.gaussianReal b v)
      = ENNReal.ofReal ((a - b) ^ 2 / (2 * v)) := by
  sorry
Source
Standard; see e.g. Lattimore & Szepesvari, Bandit Algorithms (CUP 2020), Section 33.1 (the Gaussian class E^k_N(1)), and Cover & Thomas, Elements of Information Theory, Chapter 8.
Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Oct 31, 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