Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Fact 1 — occupancy of a subset of bins concentrates around ∣B∣(1−1/e)|B|(1 - 1/e)∣B∣(1−1/e)

Proved
OnlineStochMatching.TSM.fact_1

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

balls-in-binsconcentrationp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1probability

Throw nnn balls independently and uniformly into nnn bins. Let BBB be a fixed set of bins and let SSS be the number of bins of BBB that receive at least one ball. Then for every ε>0\varepsilon > 0ε>0, with probability at least 1−2e−ε2n/21 - 2e^{-\varepsilon^2 n/2}1−2e−ε2n/2,

∣B∣(1−1e)−εn  ≤  S  ≤  ∣B∣(1−1e+1en)+εn.|B|\Big(1 - \frac1e\Big) - \varepsilon n \;\le\; S \;\le\; |B|\Big(1 - \frac1e + \frac1{en}\Big) + \varepsilon n.∣B∣(1−e1​)−εn≤S≤∣B∣(1−e1​+en1​)+εn.

This concentration bound is used twice in the analysis of the two suggested matchings algorithm: to lower-bound the number of advertisers in ABA_BAB​ that are assigned, and to upper-bound the number of crossing edges of EδE_\deltaEδ​ whose impression type arrives.

Formalization Note The paper prints the failure probability as 2e−εn/22e^{-\varepsilon n/2}2e−εn/2. Its own proof (Appendix A, p. 12) gives 2e−ε2n/22e^{-\varepsilon^2 n/2}2e−ε2n/2, and the printed form is false for small ε\varepsilonε and large nnn, since SSS has standard deviation of order n\sqrt nn​. The statement uses the exponent of the proof. The bins are Fin n and a ball placement is a function Fin n → Fin n.

Preamble
import Mathlib
import Definitions.Def_OnlineStochMatching_TSM_Model
Formal statement
namespace OnlineStochMatching.TSM

open Finset

/-- **Fact 1** (Feldman, Mehta, Mirrokni, Muthukrishnan, *Online Stochastic Matching: Beating
1-1/e*, arXiv:0905.4100v1, §2.1, p. 4; proof App. A, p. 12). Throw `n` balls i.i.d. uniformly into
`n` bins (`balls t` is the bin of ball `t`), fix a set `B` of bins, and let `S` be the number of
bins of `B` that receive at least one ball. For every `ε > 0`, with probability at least
`1 - 2 exp(-ε² n / 2)`,
`|B| (1 - 1/e) - ε n ≤ S ≤ |B| (1 - 1/e + 1/(e n)) + ε n`.

Correction to the page: the statement prints the failure probability as `2 e^{-ε n / 2}`; its own
proof (App. A, p. 12) gives `2 e^{-ε² n / 2}`, and the printed form is false for small `ε` and
large `n`. -/
theorem fact_1 (n : ℕ) (B : Finset (Fin n)) (ε : ℝ) (hε : 0 < ε) :
    1 - 2 * Real.exp (-(ε ^ 2 * n / 2)) ≤
      prob n (fun balls : Fin n → Fin n =>
        (B.card : ℝ) * (1 - 1 / Real.exp 1) - ε * n ≤
            ((B.filter fun b => ∃ t, balls t = b).card : ℝ) ∧
          ((B.filter fun b => ∃ t, balls t = b).card : ℝ) ≤
            (B.card : ℝ) * (1 - 1 / Real.exp 1 + 1 / (Real.exp 1 * n)) + ε * n) := by sorry

end OnlineStochMatching.TSM
Source
Feldman, Mehta, Mirrokni, Muthukrishnan, Online Stochastic Matching: Beating 1-1/e, arXiv:0905.4100v1, p. 4, Fact 1 (Section 2.1); restated with proof p. 12, Appendix A
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