Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
โ† Formalpedia

Lemma EC.4, p. ec5 โ€” the cross moment E[๐Ÿ™_t ๐Ÿ™_{tโ€ฒ}] is 0 without overlapping points and (EC.6) otherwise

Proved
SwitchbackExp.Design.lemma_EC_4

by mikedeng1 ยท Oct 15, 2026 ยท Mathlib 0df444a (Lean v4.33.1)

horvitz-thompson-estimatorp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1switchback-experimentvariance

Let (T,Q)(\mathbb T,\mathbb Q)(T,Q) be a regular switchback design with qtkโˆˆ(0,1)q_{t_k}\in(0,1)qtkโ€‹โ€‹โˆˆ(0,1), let Y\mathbb YY satisfy Assumptions 1โ€“2, and let m+1โ‰คt<tโ€ฒโ‰คTm+1\le t<t'\le Tm+1โ‰คt<tโ€ฒโ‰คT. Let OT(t,tโ€ฒ)=fTm(t)โˆฉfTm(tโ€ฒ)={u1o<โ‹ฏ<uJoo}O_{\mathbb T}(t,t')=f^m_{\mathbb T}(t)\cap f^m_{\mathbb T}(t')=\{u^o_1<\dots<u^o_{J^o}\}OTโ€‹(t,tโ€ฒ)=fTmโ€‹(t)โˆฉfTmโ€‹(tโ€ฒ)={u1oโ€‹<โ‹ฏ<uJooโ€‹} be the overlapping randomization points.

  1. If Jo=0J^o=0Jo=0, then E[1t1tโ€ฒ]=0\mathbb E[\mathbb 1_t\mathbb 1_{t'}]=0E[1tโ€‹1tโ€ฒโ€‹]=0. (EC.5)
  2. If Joโ‰ฅ1J^o\ge1Joโ‰ฅ1, then
E[1t1tโ€ฒ]=(โˆj=1Jo1qujoโˆ’1)Yt(1m+1)Ytโ€ฒ(1m+1)+Yt(1m+1)Ytโ€ฒ(0m+1)+Yt(0m+1)Ytโ€ฒ(1m+1)+(โˆj=1Jo1qห‰ujoโˆ’1)Yt(0m+1)Ytโ€ฒ(0m+1).(EC.6)\mathbb E[\mathbb 1_t\mathbb 1_{t'}]=\Bigl(\prod_{j=1}^{J^o}\frac1{q_{u^o_j}}-1\Bigr)Y_t(\mathbf 1_{m+1})Y_{t'}(\mathbf 1_{m+1})+Y_t(\mathbf 1_{m+1})Y_{t'}(\mathbf 0_{m+1})+Y_t(\mathbf 0_{m+1})Y_{t'}(\mathbf 1_{m+1})+\Bigl(\prod_{j=1}^{J^o}\frac1{\bar q_{u^o_j}}-1\Bigr)Y_t(\mathbf 0_{m+1})Y_{t'}(\mathbf 0_{m+1}).\qquad\text{(EC.6)}E[1tโ€‹1tโ€ฒโ€‹]=(j=1โˆJoโ€‹qujoโ€‹โ€‹1โ€‹โˆ’1)Ytโ€‹(1m+1โ€‹)Ytโ€ฒโ€‹(1m+1โ€‹)+Ytโ€‹(1m+1โ€‹)Ytโ€ฒโ€‹(0m+1โ€‹)+Ytโ€‹(0m+1โ€‹)Ytโ€ฒโ€‹(1m+1โ€‹)+(j=1โˆJoโ€‹qห‰โ€‹ujoโ€‹โ€‹1โ€‹โˆ’1)Ytโ€‹(0m+1โ€‹)Ytโ€ฒโ€‹(0m+1โ€‹).(EC.6)

With Lemma EC.3 this gives the full expansion of the risk used in Lemma 1 and Theorem 1.

Formalization Note The page says t<tโ€ฒโˆˆ[T]t<t'\in[T]t<tโ€ฒโˆˆ[T]; the error terms are defined only for periods in {m+1,โ€ฆ,T}\{m+1,\dots,T\}{m+1,โ€ฆ,T}, so both ttt and tโ€ฒt'tโ€ฒ are taken there.

Preamble
import Mathlib
import Definitions.Def_SwitchbackExp_Design_Model
import Definitions.Def_SwitchbackExp_Design_Setting
Formal statement
namespace SwitchbackExp.Design

/-- Lemma EC.4 (p. ec5), (EC.5)โ€“(EC.6): the cross moment of the error terms `๐Ÿ™_t` and `๐Ÿ™_{tโ€ฒ}`. -/
theorem lemma_EC_4 (m T : โ„•) (hmT : m < T) (P : Finset โ„•) (q : โ„• โ†’ โ„)
    (hP : IsRegularPoints T P) (hq : IsRegularProbs P q) (Y : Outcomes)
    (hY1 : NonAnticipating T Y) (hY2 : Carryover m T Y)
    (t t' : โ„•) (ht : t โˆˆ Finset.Icc (m + 1) T) (ht' : t' โˆˆ Finset.Icc (m + 1) T) (htt : t < t') :
    (overlap P m t t' = โˆ… โ†’
      expect P q (fun w => errTerm m P q Y t w * errTerm m P q Y t' w) = 0) โˆง
    ((overlap P m t t').Nonempty โ†’
      expect P q (fun w => errTerm m P q Y t w * errTerm m P q Y t' w)
        = (โˆ u โˆˆ overlap P m t t', 1 / q u - 1) * Y1 Y t * Y1 Y t' + Y1 Y t * Y0 Y t'
          + Y0 Y t * Y1 Y t' + (โˆ u โˆˆ overlap P m t t', 1 / (1 - q u) - 1) * Y0 Y t * Y0 Y t') := by sorry

end SwitchbackExp.Design
Source
Bojinov, Simchi-Levi, Zhao, Design and Analysis of Switchback Experiments, arXiv:2009.00148v4 (Management Science 69(7), 2023), Lemma EC.4, p. ec5, (EC.5)โ€“(EC.6)
Human review
  • Endorsed by Shuze Chen ยท Oct 15, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 ยท Oct 15, 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