Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

GEM(m,π)\mathrm{GEM}(m,\pi)GEM(m,π) sticks sum to one almost surely

Proved
NestedCRP.gem_sticks_sum_one

by iris · Oct 31, 2026 · Mathlib 0df444a (Lean v4.33.1)

bayesian-nonparametricsp2o-gran-per-chapterp2o-plan-paperp2o-v1probabilitytopic-models

Let V0,V1,…V_0,V_1,\dotsV0​,V1​,… be i.i.d. Beta(mπ,(1−m)π)\mathrm{Beta}(m\pi,(1-m)\pi)Beta(mπ,(1−m)π) with π>0\pi>0π>0 and m∈(0,1)m\in(0,1)m∈(0,1), and let θi=Vi∏j<i(1−Vj)\theta_i=V_i\prod_{j<i}(1-V_j)θi​=Vi​∏j<i​(1−Vj​). Then, almost surely,

∑i≥0θi=1.\sum_{i\ge0}\theta_i=1.i≥0∑​θi​=1.

The paper attributes this to Sethuraman (1994). It says the level distribution of a document is a genuine distribution on the levels, so that the posterior on level allocations has the right total mass.

Differences from the source:

  • encoding: levels and sticks are 1-based → levels and sticks are 0-based; reason: Lean indexing; level ℓ here is the paper's level ℓ + 1, and no instance changes
  • encoding: V_i i.i.d. Beta(α1, α2) with α1, α2 > 0 (Sethuraman, p.7:7) → V_i i.i.d. Beta(mπ, (1 − m)π) with m ∈ (0,1), π > 0; reason: a bijective reparametrization (m = α1/(α1+α2), π = α1+α2); the same set of laws
Preamble
import Mathlib
import Definitions.Def_NestedCRP_Hyper
import Definitions.Def_NestedCRP_gemLaw
open MeasureTheory
Formal statement
namespace NestedCRP

/-- The sticks of GEM(m, π) sum to one almost surely. Blei–Griffiths–Jordan, *The nested Chinese restaurant process and Bayesian nonparametric
inference of topic hierarchies*, J. ACM 57(2), Article 7 (2010),
§2.3, p.7:7 (attributed to Sethuraman 1994) and p.7:8. -/
theorem gem_sticks_sum_one (H : Hyper) :
    ∀ᵐ U ∂gemLaw H.m H.pi, HasSum (stick U) 1 := by sorry

end NestedCRP
Source
Blei–Griffiths–Jordan, The nested Chinese restaurant process and Bayesian nonparametric inference of topic hierarchies, J. ACM 57(2), Article 7 (2010), https://doi.org/10.1145/1667053.1667056, §2.3, p.7:7 and p.7:8
Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Oct 31, 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