Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 7 — second moments of Bernoulli likelihood ratios: E₀[dp_q/dp₀]² = 1 + ρ_n q²/(1 − ρ_n)

Proved
CPDNetworks.Lower.lemma_7

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

hypothesis-testinglikelihood-ratiop2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let ρn∈(0,1/2]\rho_n\in(0,1/2]ρn​∈(0,1/2] and q,q1,q2∈[−1,1]q,q_1,q_2\in[-1,1]q,q1​,q2​∈[−1,1]. Write p0p_0p0​ for the Bernoulli law with parameter ρn\rho_nρn​ and pqp_qpq​ for the Bernoulli law with parameter ρn(1+q)\rho_n(1+q)ρn​(1+q), with densities dp0dp_0dp0​, dpqdp_qdpq​ with respect to counting measure on {0,1}\{0,1\}{0,1}. For a Bernoulli variable X∼p0X\sim p_0X∼p0​,

E0[dpqdp0]2(X)=1+ρn1−ρn q2,E0[dpq1dp0dpq2dp0](X)=1+ρn1−ρn q1q2.\mathrm E_0\Big[\frac{dp_q}{dp_0}\Big]^2(X)=1+\frac{\rho_n}{1-\rho_n}\,q^2,\qquad \mathrm E_0\Big[\frac{dp_{q_1}}{dp_0}\frac{dp_{q_2}}{dp_0}\Big](X)=1+\frac{\rho_n}{1-\rho_n}\,q_1q_2.E0​[dp0​dpq​​]2(X)=1+1−ρn​ρn​​q2,E0​[dp0​dpq1​​​dp0​dpq2​​​](X)=1+1−ρn​ρn​​q1​q2​.

The two identities compute the second moment of the likelihood ratio entry by entry in Step 3 of the proof of Theorem 2.

Formalization Note The expectation under p0p_0p0​ is the two-term sum over X∈{0,1}X\in\{0,1\}X∈{0,1} (Bool), and the densities are the Bernoulli mass functions; dp0>0dp_0>0dp0​>0 on both points because ρn∈(0,1/2]\rho_n\in(0,1/2]ρn​∈(0,1/2].

Preamble
import Mathlib
import Definitions.Def_HighDimProb_RandomMatrices_matrixOpNorm
import Definitions.Def_CPDNetworks_Lower_Setting
Formal statement
namespace CPDNetworks.Lower

/-- **Lemma 7** (Enikeeva–Klopp, p. 34). Let `ρ_n ∈ (0, 1/2]` and `q, q₁, q₂ ∈ [−1, 1]`, and let
`p₀`, `p_q` be the Bernoulli laws with parameters `ρ_n` and `ρ_n(1 + q)`. For `X ∼ p₀`,
`E₀[(dp_q/dp₀)(X)]² = 1 + ρ_n/(1 − ρ_n) q²` and
`E₀[(dp_{q₁}/dp₀)(dp_{q₂}/dp₀)](X) = 1 + ρ_n/(1 − ρ_n) q₁q₂`. The densities w.r.t. counting measure
on `{0, 1}` (`Bool`) are the Bernoulli mass functions `bern`. -/
theorem lemma_7 (ρ q q₁ q₂ : ℝ) (hρ : 0 < ρ) (hρ2 : ρ ≤ 1 / 2)
    (hq : -1 ≤ q ∧ q ≤ 1) (hq₁ : -1 ≤ q₁ ∧ q₁ ≤ 1) (hq₂ : -1 ≤ q₂ ∧ q₂ ≤ 1) :
    ∑ x : Bool, bern ρ x * (bern (ρ * (1 + q)) x / bern ρ x) ^ 2 = 1 + ρ / (1 - ρ) * q ^ 2 ∧
    ∑ x : Bool, bern ρ x *
        (bern (ρ * (1 + q₁)) x / bern ρ x * (bern (ρ * (1 + q₂)) x / bern ρ x)) =
      1 + ρ / (1 - ρ) * (q₁ * q₂) := by sorry

end CPDNetworks.Lower
Source
Enikeeva and Klopp, Change-point detection in dynamic networks with missing links, arXiv:2106.14470v2, p. 34, Lemma 7
Human review
  • Endorsed by Shuze Chen · Oct 14, 2026

    Confirmed by the moderator at approval.

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