Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§3.3, p. 11 — ∂²F/∂w_j∂w_k = E[Δ_jk h(Z)] for j ≠ k, and ∂²F/∂w_j² = 0

Proved
DiffNeighbors.Bias.second_partial

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

differences-in-neighborsmultilinear-extensionp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1second-order-difference

Let h:{0,1}N→Rh : \{0,1\}^N \to \mathbb Rh:{0,1}N→R with multilinear extension FFF, and write

Dj(w)=Ew[h(Z)∣Zj=1]−Ew[h(Z)∣Zj=0]D_j(w) = \mathbb E_w[h(Z) \mid Z_j = 1] - \mathbb E_w[h(Z) \mid Z_j = 0]Dj​(w)=Ew​[h(Z)∣Zj​=1]−Ew​[h(Z)∣Zj​=0]

for the first partial derivative ∂F/∂wj\partial F / \partial w_j∂F/∂wj​, where Ew\mathbb E_wEw​ is the expectation under independent Zl∼Bernoulli(wl)Z_l \sim \mathrm{Bernoulli}(w_l)Zl​∼Bernoulli(wl​), extended multilinearly to all w∈RNw \in \mathbb R^Nw∈RN. Then for every www:

  1. for j≠kj \neq kj=k,
∂2F∂wj∂wk(w)=Ew[h(Z)∣Zj=1,Zk=1]+Ew[h(Z)∣Zj=0,Zk=0]−Ew[h(Z)∣Zj=1,Zk=0]−Ew[h(Z)∣Zj=0,Zk=1]=Ew[Δjkh(Z)];\frac{\partial^2 F}{\partial w_j \partial w_k}(w) = \mathbb E_w[h(Z) \mid Z_j = 1, Z_k = 1] + \mathbb E_w[h(Z) \mid Z_j = 0, Z_k = 0] - \mathbb E_w[h(Z) \mid Z_j = 1, Z_k = 0] - \mathbb E_w[h(Z) \mid Z_j = 0, Z_k = 1] = \mathbb E_w[\Delta_{jk} h(Z)];∂wj​∂wk​∂2F​(w)=Ew​[h(Z)∣Zj​=1,Zk​=1]+Ew​[h(Z)∣Zj​=0,Zk​=0]−Ew​[h(Z)∣Zj​=1,Zk​=0]−Ew​[h(Z)∣Zj​=0,Zk​=1]=Ew​[Δjk​h(Z)];
  1. ∂2F∂wj2=0\dfrac{\partial^2 F}{\partial w_j^2} = 0∂wj2​∂2F​=0.

So the Hessian of FFF has the expected second-order finite differences off the diagonal and zeros on it; the proof of Theorem 1 bounds the Taylor remainder through these entries.

Formalization Note The second derivative is the derivative of DjD_jDj​ in the coordinate wkw_kwk​, stated as HasDerivAt of t↦Dj(w with wk:=t)t \mapsto D_j(w \text{ with } w_k := t)t↦Dj​(w with wk​:=t) at t=wkt = w_kt=wk​, with DjD_jDj​ written out as the difference of the two multilinear extensions.

Differences from the source:

  • generalization: F^a of node i, for j, k ∈ N_i → the multilinear extension of any h : {0,1}^ι → ℝ, at any w ∈ ℝ^ι, for all coordinates j, k; reason: specializes with h = condOutcome f i a and j, k ∈ N_i
  • encoding: ∂²F/∂w_j∂w_k and E[Δ_jk f^a(Z)] → HasDerivAt in the k-th coordinate of the first partial D_j of first_partial, with value mlExt (secondDiff h j k) w; reason: the mixed partial derivative; E_w[Δ_jk h(Z)] equals the four conditional expectations by linearity and independence
  • encoding: units [N] = {1,…,N}, treatment vectors z ∈ {0,1}^N, an undirected graph without self-loops, d = max_i |N_i| → a finite type ι with N = card ι, z : ι → Bool with 1/0 read through ind, G : SimpleGraph ι, N_i = G.neighborFinset i, d = G.maxDegree; reason: a simple graph is exactly an undirected graph without self-loops; same instances
Preamble
import Mathlib
import Definitions.Def_DiffNeighbors_Bias_Model
Formal statement
namespace DiffNeighbors.Bias

open Finset

/-- **Second partial derivatives of the multilinear extension**, §3.3, p. 11. Write
`D_j(w) = E_w[h(Z) | Z_j = 1] − E_w[h(Z) | Z_j = 0]` for the first partial derivative `∂F/∂w_j`
(p. 10). Then (i) for `j ≠ k`, `∂²F/∂w_j∂w_k (w) = E_w[Δ_jk h(Z)]`, and (ii) `∂²F/∂w_j² = 0`. -/
theorem second_partial {ι : Type*} [Fintype ι] [DecidableEq ι] (h : (ι → Bool) → ℝ) (w : ι → ℝ)
    (j : ι) :
    (∀ k, j ≠ k →
      HasDerivAt (fun t => mlExt (fun z => h (Function.update z j true)) (Function.update w k t)
          - mlExt (fun z => h (Function.update z j false)) (Function.update w k t))
        (mlExt (fun z => secondDiff h j k z) w) (w k)) ∧
    HasDerivAt (fun t => mlExt (fun z => h (Function.update z j true)) (Function.update w j t)
        - mlExt (fun z => h (Function.update z j false)) (Function.update w j t))
      0 (w j) := 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), display '∂²F^a/∂w_j∂w_k = … = E[Δ_jk f^a(Z)] for j, k ∈ N_i and j ≠ k, and ∂²F/∂w_j² = 0 for j = k'
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