Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 7.2 — subset of powers of two with prescribed sum

Proved
WeightedMajority.Shattered.lemma_7_2

by mikedeng1 · Oct 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

arithmeticonline-learningp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1weighted-majority

Let r1,…,rjr_1,\ldots,r_jr1​,…,rj​ be positive powers of two with integer exponents, and let ℓ∈Z\ell\in\mathbb Zℓ∈Z. If every ri≤2ℓr_i\le2^\ellri​≤2ℓ and 2ℓ≤∑i=1jri2^\ell\le\sum_{i=1}^j r_i2ℓ≤∑i=1j​ri​, then a subset KKK has exactly the target weight:

∑i∈Kri=2ℓ.\sum_{i\in K}r_i=2^\ell.i∈K∑​ri​=2ℓ.

The lemma extracts a prescribed weight from a collection of dyadic weights.

Formalization Note Each hypothesis log⁡2ri∈Z\log_2 r_i\in\mathbb Zlog2​ri​∈Z is represented as ri=2kir_i=2^{k_i}ri​=2ki​ for an integer kik_iki​. The upper bound on each weight expresses the source's maximum condition without taking a maximum of an empty family; when j=0j=0j=0, the total-weight condition is impossible.

Preamble
import Mathlib
Formal statement
namespace WeightedMajority.Shattered

/-- Littlestone--Warmuth, Lemma 7.2, p. 244. `r i = 2 ^ k i` encodes
the assertion that `log₂ (r i)` is an integer. -/
theorem lemma_7_2 {j : ℕ} (r : Fin j → ℝ) (k : Fin j → ℤ)
    (hr : ∀ i, r i = (2 : ℝ) ^ (k i)) (l : ℤ)
    (hmax : ∀ i, r i ≤ (2 : ℝ) ^ l)
    (hsum : (2 : ℝ) ^ l ≤ ∑ i, r i) :
    ∃ K : Finset (Fin j), ∑ i ∈ K, r i = (2 : ℝ) ^ l := by sorry

end WeightedMajority.Shattered
Source
Littlestone and Warmuth, The Weighted Majority Algorithm, Information and Computation 108 (1994), p. 244, Lemma 7.2; https://doi.org/10.1006/inco.1994.1009
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 6, 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