Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§3.3, p. 11 — propensity weights: F¹(p) = E[(Z_i/p)Y_i], F⁰(p) = E[((1−Z_i)/(1−p))Y_i], E[f^a(Z)|Z_j = b] = E[1{Z_i=a}1{Z_j=b}Y_i/(Pr(Z_i=a)Pr(Z_j=b))]

Proved
DiffNeighbors.Bias.propensity_weights

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

bernoulli-designdifferences-in-neighborsp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1propensity-weighting

Under the Bernoulli design (ZlZ_lZl​ i.i.d. Bernoulli(p)(p)(p), 0<p<10 < p < 10<p<1), let Yi=fi(Z)Y_i = f_i(Z)Yi​=fi​(Z) and let fiaf^a_ifia​ be unit iii's conditional outcome function. Then

  1. F1(p)=E[fi1(Z)]=E[ZipYi]F^1(p) = \mathbb E[f^1_i(Z)] = \mathbb E\bigl[\tfrac{Z_i}{p} Y_i\bigr]F1(p)=E[fi1​(Z)]=E[pZi​​Yi​];
  2. F0(p)=E[fi0(Z)]=E[1−Zi1−pYi]F^0(p) = \mathbb E[f^0_i(Z)] = \mathbb E\bigl[\tfrac{1 - Z_i}{1 - p} Y_i\bigr]F0(p)=E[fi0​(Z)]=E[1−p1−Zi​​Yi​];
  3. for every unit j≠ij \neq ij=i and all a,b∈{0,1}a, b \in \{0,1\}a,b∈{0,1},
E[fia(Z)∣Zj=b]=E[1{Zi=a}Pr⁡(Zi=a)1{Zj=b}Pr⁡(Zj=b)Yi],\mathbb E[f^a_i(Z) \mid Z_j = b] = \mathbb E\Bigl[\frac{\mathbf 1\{Z_i = a\}}{\Pr(Z_i = a)} \frac{\mathbf 1\{Z_j = b\}}{\Pr(Z_j = b)} Y_i\Bigr],E[fia​(Z)∣Zj​=b]=E[Pr(Zi​=a)1{Zi​=a}​Pr(Zj​=b)1{Zj​=b}​Yi​],

with Pr⁡(Zi=1)=p\Pr(Z_i = 1) = pPr(Zi​=1)=p and Pr⁡(Zi=0)=1−p\Pr(Z_i = 0) = 1 - pPr(Zi​=0)=1−p.

These identities show that every term of the first-order approximation to the ATE can be estimated from the observed outcomes by inverse-propensity weighting; this is how the DN estimator is derived.

Differences from the source:

  • generalization: j ∈ N_i (so j ≠ i) and outcomes under Assumption 1 (standing) → every j ≠ i and any outcome functions, with no Assumption 1; reason: the identity uses only the independence of the design; it specializes to j ∈ N_i, where i ∉ N_i gives j ≠ i
  • encoding: a Bernoulli(p) design whose weights divide by p and 1 − p → hypotheses 0 < p and p < 1; reason: the weights 1/p and 1/(1 − p) and the design presuppose p ∈ (0,1); this only excludes undefined cases
  • encoding: E[·] over z_i i.i.d. Bernoulli(p) → bernExp p h = Σ_z (Π_j (p if z_j = 1 else 1 − p)) h(z), a finite sum; reason: the law of the design on the finite set {0,1}^N; same values
  • encoding: f^a_i as a function of z_{N_i}; E[f^a(Z) | Z_j = b] and E[f^a(Z) | Z_j = b, Z_k = c] → condOutcome f i a z = f_i(z with z_i := a), a function on all of {0,1}^N; conditional expectations are bernExp of the function with the conditioned coordinates overwritten by Function.update; reason: under Assumption 1 condOutcome f i a depends only on z_{N_i}; by independence of the coordinates, conditioning on Z_j = b is the same as setting z_j := b
Preamble
import Mathlib
import Definitions.Def_DiffNeighbors_Bias_Model
Formal statement
namespace DiffNeighbors.Bias

open Finset

/-- **Propensity weights**, §3.3, p. 11: under the Bernoulli(`p`) design,
(i) `F¹_i(p) = E[f¹_i(Z)] = E[(Z_i/p) Y_i]`, (ii) `F⁰_i(p) = E[f⁰_i(Z)] = E[((1 − Z_i)/(1 − p)) Y_i]`, and
(iii) for `a, b ∈ {0, 1}` and `j ≠ i`,
`E[f^a_i(Z) | Z_j = b] = E[(1{Z_i = a}/Pr(Z_i = a)) (1{Z_j = b}/Pr(Z_j = b)) Y_i]`. -/
theorem propensity_weights {ι : Type*} [Fintype ι] [DecidableEq ι]
    (f : ι → (ι → Bool) → ℝ) (i : ι) (p : ℝ) (hp0 : 0 < p) (hp1 : p < 1) :
    bernExp p (condOutcome f i true) = bernExp p (fun z => ind (z i) / p * f i z) ∧
    bernExp p (condOutcome f i false) = bernExp p (fun z => (1 - ind (z i)) / (1 - p) * f i z) ∧
    ∀ (j : ι), j ≠ i → ∀ a b : Bool,
      bernExp p (fun z => condOutcome f i a (Function.update z j b)) =
        bernExp p (fun z => (if z i = a then (1 : ℝ) else 0) / bernProb p a *
          ((if z j = b then (1 : ℝ) else 0) / bernProb p b) * f i z) := by sorry

end DiffNeighbors.Bias
Source
Peng, Ye, Zheng, Differences-in-Neighbors for Network Interference in Experiments, arXiv:2503.02271v1, p. 11, §3.3 (proof of Theorem 1), displays 'F¹(p) = E[f¹(Z)] = E[(Z_i/p)Y_i]', 'F⁰(p) = …' and 'E[f^a(Z)|Z_j = b] = E[…]'
Human review
  • Endorsed by Shuze Chen · Oct 23, 2026

    Confirmed by the moderator at approval.

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