Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

One-sided Bernoulli relative entropy

Definition
klucbTruncatedRelativeEntropy

by Harry_Xu · Jul 29, 2026 · Mathlib c5ea003 (Lean v4.30.0)

bandit-algorithmskl-ucbrelative-entropy

For Bernoulli parameters p,qp,qp,q, define the one-sided, or truncated, relative entropy by

dˉ(p,q)={d(p,q),p≤q,0,p>q,\bar d(p,q)= \begin{cases} d(p,q),&p\le q,\\ 0,&p>q, \end{cases}dˉ(p,q)={d(p,q),0,​p≤q,p>q,​

where d(p,q)d(p,q)d(p,q) is the relative entropy between Bernoulli distributions with means ppp and qqq.

This is the divergence used in the KL-UCB analysis to express whether an upper confidence threshold qqq remains feasible. It makes the one-sided nature of an upper-confidence index explicit and is reused in the optimal-arm underestimation and suboptimal-arm overshoot counts.

Formalization Note The definition is real-valued and inherits the endpoint convention of bernoulliRelativeEntropy.

Definition code
import Definitions.Def_bernoulliRelativeEntropy

/-!
Lattimore--Szepesvári, *Bandit Algorithms* (CUP 2020), immediately before
Lemma 10.7, printed p. 138.
-/

namespace BanditAlgorithm

/-- The one-sided binary divergence used in Lemmas 10.7 and 10.8:
`d⁺(p,q) = d(p,q) 𝟙{p ≤ q}`. -/
noncomputable def klucbTruncatedRelativeEntropy (p q : ℝ) : ℝ :=
  if p ≤ q then bernoulliRelativeEntropy p q else 0

end BanditAlgorithm
Source
Lattimore and Szepesvari, Bandit Algorithms (CUP 2020), Chapter 10, immediately before Lemma 10.7, printed p. 138 / PDF p. 147: d-bar(p,q)=d(p,q) I{p <= q}.

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