Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4.2 [JS68] — mean–median inequality for sums of independent Bernoulli random variables

Proved
StratifyMarkets.DoubleAuction.theorem_4_2

by Shuze Chen · Nov 11, 2026 · Mathlib 0df444a (Lean v4.33.1)

p2o-gran-per-chapterp2o-plan-paperp2o-v1poisson-binomialprobability

Let X=∑i=1lXiX=\sum_{i=1}^{l}X_iX=∑i=1l​Xi​ be a sum of l≥0l\ge0l≥0 independent Bernoulli random variables (arbitrary, possibly different success probabilities) on a probability space. If the mean of XXX lies between the integers kkk and k+1k+1k+1, then a median of XXX is kkk or k+1k+1k+1; equivalently,

Pr⁡[X>E[X]−1]≥12andPr⁡[X<E[X]+1]≥12.\Pr\big[X>\mathbb E[X]-1\big]\ge\tfrac12\qquad\text{and}\qquad\Pr\big[X<\mathbb E[X]+1\big]\ge\tfrac12.Pr[X>E[X]−1]≥21​andPr[X<E[X]+1]≥21​.

This is a cited result of Jogdeo and Samuels [JS68], used throughout §4 (Lemmas 4.4, 4.5, 4.8).

Formalization Note. A median of XXX is an MMM with Pr⁡[X≤M]≥1/2\Pr[X\le M]\ge1/2Pr[X≤M]≥1/2 and Pr⁡[X≥M]≥1/2\Pr[X\ge M]\ge1/2Pr[X≥M]≥1/2. The statement is the conjunction of the median clause (for every integer kkk with k≤E[X]≤k+1k\le\mathbb E[X]\le k+1k≤E[X]≤k+1, some M∈{k,k+1}M\in\{k,k+1\}M∈{k,k+1} is a median) and both displayed inequalities. Each XiX_iXi​ is measurable and almost surely 000 or 111, and the family is iIndepFun.

Differences from the source:

  • reading: 'a median of X is either k or k + 1' → some M ∈ {k, k + 1} is a median (Pr[X ≤ M] ≥ 1/2 and Pr[X ≥ M] ≥ 1/2); reason: the universal reading 'every median is k or k + 1' is false (for one Bernoulli(1/2) every point of [0, 1] is a median); the existential reading is the theorem of [JS68]
  • reading: the mean 'between the integers k and k + 1' → k ≤ E[X] ≤ k + 1 with k ∈ ℤ (closed); reason: the closed reading also covers an integer mean, so it is at least as strong as the open one
  • encoding: a sum of independent Bernoulli random variables → X = Σ_{i<l} X_i with X_i measurable, a.s. in {0, 1}, mutually independent (iIndepFun), any l ≥ 0; reason: same objects
  • encoding: 'Equivalently, …' → the median clause and both displayed inequalities as one conjunction; reason: every clause of the printed statement is stated
Preamble
import Mathlib

open MeasureTheory
Formal statement
namespace StratifyMarkets.DoubleAuction

/-- Theorem 4.2 [JS68] (p. 26): let `X = Σ_{i<l} X_i` be a sum of independent Bernoulli random
variables. If `k ≤ E[X] ≤ k + 1` for an integer `k`, then `k` or `k + 1` is a median of `X`; and
`Pr[X > E[X] − 1] ≥ 1/2`, `Pr[X < E[X] + 1] ≥ 1/2`. -/
theorem theorem_4_2 {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P]
    (l : ℕ) (X : Fin l → Ω → ℝ) (hmeas : ∀ i, Measurable (X i))
    (hbern : ∀ i, ∀ᵐ ω ∂P, X i ω = 0 ∨ X i ω = 1) (hindep : ProbabilityTheory.iIndepFun X P) :
    (∀ k : ℤ, (k : ℝ) ≤ ∫ ω, ∑ i, X i ω ∂P → ∫ ω, ∑ i, X i ω ∂P ≤ (k : ℝ) + 1 →
      ∃ M : ℤ, (M = k ∨ M = k + 1) ∧
        (1 / 2 : ENNReal) ≤ P {ω | ∑ i, X i ω ≤ (M : ℝ)} ∧
        (1 / 2 : ENNReal) ≤ P {ω | (M : ℝ) ≤ ∑ i, X i ω}) ∧
    (1 / 2 : ENNReal) ≤ P {ω | (∫ ω', ∑ i, X i ω' ∂P) - 1 < ∑ i, X i ω} ∧
    (1 / 2 : ENNReal) ≤ P {ω | ∑ i, X i ω < (∫ ω', ∑ i, X i ω' ∂P) + 1} := by sorry

end StratifyMarkets.DoubleAuction
Source
Deng, Lin, Schoepflin, Wang, Stratifying Markets for Efficient Trade, STOC 2027 submission (manuscript sha256 49372bcf…), p. 26, Theorem 4.2 (cited: [JS68])
Human review
  • Endorsed by Community (Bot) · Nov 11, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Shuze Chen · Nov 11, 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