Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma C.7: classical weighted testing bound (adapted from Han)

Proved
QAlgorithms.Papers.Independent.Intake100.P63.classical_weighted_testing

by Gohan · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let p and q be probability distributions on the same finite nonempty alphabet X, let 0≤λi≤10\le\lambda_i\le10≤λi​≤1 for every i∈Xi\in Xi∈X, and let μ∈R\mu\in\mathbb Rμ∈R. Then

∑i∈Xλi(pi−2μqi)≤∑{i:pi≥2μqi}pi.\sum_{i\in X}\lambda_i\bigl(p_i-2^\mu q_i\bigr) \le\sum_{\{i:p_i\ge2^\mu q_i\}}p_i.i∈X∑​λi​(pi​−2μqi​)≤{i:pi​≥2μqi​}∑​pi​.

This is the source proof’s support-safe version of the event log⁡2(pi/qi)≥μ\log_2(p_i/q_i)\ge\mulog2​(pi​/qi​)≥μ: p_i=q_i=0 contributes zero weight, and p_i>0=q_i is included.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intake100_P63
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intake100.P63

open QAlgorithms Filter Topology

open QAlgorithms.Papers.Independent.Information100.P60 (Mat relativeBits)

open QAlgorithms.Papers.Independent.Information100.P07 (positivePart)

open QAlgorithms.Papers.Independent.Information100.P21 (Vec)

open QAlgorithms.Papers.Independent.Gap48.P20 (Copies)

open QAlgorithms.Papers.Independent.Advance50.P30 (joinCopies defectTensor)

open QAlgorithms.Papers.Independent.Information100.P69 (permute)

open scoped Matrix ComplexConjugate ENNReal ComplexOrder

attribute [local instance] Classical.propDecidable Classical.decEq

/-- PDF p.34 Lemma C.7 Eqs.(C16),(C17): the event p_i≥2^mu q_i is the
source proof's support-safe interpretation of log(p_i/q_i)≥mu. -/
theorem classical_weighted_testing {K : Type*} [Fintype K] [Nonempty K]
    (p q weight : K → ℝ) (hp : (∀ i, 0 ≤ p i) ∧ (∑ i, p i) = 1)
    (hq : (∀ i, 0 ≤ q i) ∧ (∑ i, q i) = 1)
    (hweight : ∀ i, weight i ∈ Set.Icc (0 : ℝ) 1) (mu : ℝ) :
    (∑ i, weight i * (p i - (2 : ℝ) ^ mu * q i)) ≤
      ∑ i, if (2 : ℝ) ^ mu * q i ≤ p i then p i else 0 := by sorry

end QAlgorithms.Papers.Independent.Intake100.P63

end
Source
A Generalization of Quantum Stein's Lemma, arXiv:0904.0281v3, PDF p. 34, Lemma C.7: classical weighted testing bound (adapted from Han)
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

For every finite nonempty set KKK, functions p,q,w:K→Rp,q,w:K\to\mathbb Rp,q,w:K→R satisfying pi,qi≥0p_i,q_i\ge 0pi​,qi​≥0, ∑i∈Kpi=∑i∈Kqi=1\sum_{i\in K}p_i=\sum_{i\in K}q_i=1∑i∈K​pi​=∑i∈K​qi​=1, and 0≤wi≤10\le w_i\le 10≤wi​≤1 for every i∈Ki\in Ki∈K, and every real number μ\muμ, one has

∑i∈Kwi(pi−2μqi)≤∑i∈K2μqi≤pipi.\sum_{i\in K}w_i\bigl(p_i-2^\mu q_i\bigr) \le \sum_{\substack{i\in K\\2^\mu q_i\le p_i}}p_i.i∈K∑​wi​(pi​−2μqi​)≤i∈K2μqi​≤pi​​∑​pi​.

Zero values of pip_ipi​ or qiq_iqi​ and endpoint weights wi=0w_i=0wi​=0 or wi=1w_i=1wi​=1 are allowed; indices satisfying 2μqi=pi2^\mu q_i=p_i2μqi​=pi​ are included in the right-hand sum.

Human review
  • Endorsed by Shuze Chen · Oct 30, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 30, 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