Experimentation.Two­Stage­Interference.Asymptotic

Asymptotic theory for two-stage interference experiments: setup, consistency, CLT discharge, studentized direct effects, and Wald intervals.

Setup 7 core · 0 supporting LHExperiment packages one Hudgens-Halloran two-stage experiment for Liu-Hudgens large-sample inference on the treatment-minus-control direct-effect contrast. ★ LHExperiment★ E_estD★ var_estD

Liu-Hudgens asymptotic setup

LHExperiment packages one Hudgens-Halloran two-stage experiment for Liu-Hudgens large-sample inference on the treatment-minus-control direct-effect contrast.

The structure carries the group population, group sizes, stage-1 strategy design, within-group strategies ψ and φ, partial-interference potential outcomes, fixed treated/control counts, the number C of ψ-selected groups, and the known design propensities needed by the finite-sample unbiasedness and variance theorems. Its namespace defines the joint two-stage design jointD, the Horvitz-Thompson direct-effect estimator estD, the estimand DEbar, and the closed-form variance directVar.

The main theorems are the reusable bridges E_estD and var_estD: they specialize the finite-sample Hudgens-Halloran unbiasedness and variance results to each packaged experiment, so later consistency, CLT, and Wald arguments can reason through LHExperiment alone.

structure LHExperiment reviewed
Causalean.Experimentation.TwoStageInterference

A single Liu–Hudgens (2014) two-stage experiment, packaged so that a sequence of them can be studied for large-sample inference. Carries a finite population of groups with per-group sizes, a stage-1 design assigning each group a strategy, the per-group allocation strategies ψ and φ, partial-interference potential outcomes, and design-fixed control and treatment unit counts per group, together with the regularity conditions that the number C of ψ-selected groups is nonzero, every group has nonzero control and treatment counts and nonzero size, the population has at least one group and at least two groups, every unit's within-group control propensity equals m0 i / nᵢ and its treatment propensity equals m1 i / nᵢ, every group's stage-1 selection propensity equals C/N, and every pair's joint selection propensity equals C(C−1)/(N(N−1)) — exactly the hypothesis lists of E_estDirect and Var_estDirect.

Definition (Lean source)
Finite population of groups.
ι :
Size of each group.
gsize :
ι → ℕ
Stage-1 strategy-assignment design (which groups receive ψ vs. φ).
Per-group treatment-allocation strategy ψ (the strategy of interest).
ψ :
∀ i, FiniteDesign (Fin (gsize i) → Bool)
Per-group treatment-allocation strategy φ (the comparison strategy).
φ :
∀ i, FiniteDesign (Fin (gsize i) → Bool)
Partial-interference potential outcomes: `Y i j w` is unit `(i,j)`'s outcome under the within-group assignment `w` of group `i`.
Y :
∀ i
if
Fin (gsize i)
and
(Fin (gsize i) → Bool)
then
Design-fixed number of control units per group.
m0 :
ι → ℝ
Design-fixed number of treated units per group.
m1 :
ι → ℝ
Number of groups selected for strategy ψ at stage 1.
C :
Carried regularity (exactly the `E_estDirect` / `Var_estDirect` hypotheses): The ψ-selection count is nonzero.
hC :
C ≠ 0
Each group has a nonzero control count.
hm0 :
∀ i, m0 i ≠ 0
Each group has a nonzero treated count.
hm1 :
∀ i, m1 i ≠ 0
Each group is nonempty.
hn :
∀ i, (gsize i : ℝ) ≠ 0
There is at least one group.
hN :
(Fintype.card ι : ℝ) ≠ 0
There are at least two groups (needed for the pair propensity).
hN1 :
(Fintype.card ι : ℝ) - 1 ≠ 0
Within-group control propensity of every unit is `m0 i / nᵢ`.
hprop0 :
∀ i, ∀ j : Fin (gsize i), (ψ i).Pr (fun w => w j = false) = m0 i / (gsize i)
Within-group treatment propensity of every unit is `m1 i / nᵢ`.
hprop1 :
∀ i, ∀ j : Fin (gsize i), (ψ i).Pr (fun w => w j = true) = m1 i / (gsize i)
Stage-1 first-order selection propensity of every group is `C/N`.
hstage1 :
∀ i, D₁.Pr (fun s => s i = true) = C / (Fintype.card ι : ℝ)
Stage-1 second-order (pair) selection propensity is `C(C−1)/(N(N−1))`.
hstage1pair :
∀ i j
if
i ≠ j
then
D₁.E (fun s => FiniteDesign.ind (fun s => s i = true) s * FiniteDesign.ind (fun s => s j = true) s)
= (C * (C - 1)) / ((Fintype.card ι : ℝ) * ((Fintype.card ι : ℝ) - 1))
Causalean.Experimentation.TwoStageInterference.LHExperiment · Causalean/Experimentation/TwoStageInterference/Asymptotic/Setup.lean:52
def jointD reviewed
Causalean.Experimentation.TwoStageInterference.LHExperiment

For a Liu--Hudgens experiment, the joint two-stage randomization design first draws the group-level strategy assignment and then draws each group's within-group assignment from the design corresponding to its assigned strategy.

Definition (Lean source)
E :
shared
jointD E :
FiniteDesign (StratAssign E.ι × ∀ i, Fin (E.gsize i) → Bool)
jointDesign E.D₁ E.ψ E.φ
Causalean.Experimentation.TwoStageInterference.LHExperiment.jointD · Causalean/Experimentation/TwoStageInterference/Asymptotic/Setup.lean:118 · uses FiniteDesign , LHExperiment , StratAssign
def estD reviewed
Causalean.Experimentation.TwoStageInterference.LHExperiment

For a Liu--Hudgens experiment, the Horvitz--Thompson estimator of its treatment-minus-control direct effect assigns a real-valued estimate to every joint realization of the group-level strategy assignment and all within-group assignments.

Definition (Lean source)
E :
shared
estD E :
(StratAssign E.ι × ∀ i, Fin (E.gsize i) → Bool) → ℝ
estDirect E.Y E.m0 E.m1 E.C
Causalean.Experimentation.TwoStageInterference.LHExperiment.estD · Causalean/Experimentation/TwoStageInterference/Asymptotic/Setup.lean:122 · uses LHExperiment , StratAssign
def DEbar reviewed
Causalean.Experimentation.TwoStageInterference.LHExperiment

For a Liu--Hudgens experiment, the population-average treatment-minus-control direct effect is the mean potential outcome under treatment minus the mean potential outcome under control, with both means evaluated under the experiment's treatment strategy.

Definition (Lean source)
E :
shared
DEbar E :
CE_direct E.ψ E.Y
Causalean.Experimentation.TwoStageInterference.LHExperiment.DEbar · Causalean/Experimentation/TwoStageInterference/Asymptotic/Setup.lean:126 · uses LHExperiment
def directVar reviewed
Causalean.Experimentation.TwoStageInterference.LHExperiment

For a Liu--Hudgens experiment, the closed-form two-stage design variance of the treatment-minus-control direct-effect estimator equals (1C/N)Sμ2/C+(CN)1iVi(1-C/N)S_\mu^2/C+(CN)^{-1}\sum_i V_i, where NN is the number of groups, CC is the number assigned the treatment strategy, Sμ2S_\mu^2 is the population sample variance of the group-level direct-effect contrasts, and ViV_i is the variance of group ii's within-group contrast estimator under the treatment strategy.

Definition (Lean source)
E :
shared
directVar E :
(1 - E.C / (Fintype.card E.ι : ℝ)) / E.C * SmuVar (fun i => groupMean E.ψ E.Y i true - groupMean E.ψ E.Y i false)
+ (1 / (E.C * (Fintype.card E.ι : ℝ))) * ∑ i, (E.ψ i).Var (fun w => groupEst E.Y i true (E.m1 i) w - groupEst E.Y i false (E.m0 i) w)
Causalean.Experimentation.TwoStageInterference.LHExperiment.directVar · Causalean/Experimentation/TwoStageInterference/Asymptotic/Setup.lean:129 · uses LHExperiment
theorem E_estD reviewed
Causalean.Experimentation.TwoStageInterference.LHExperiment

Unbiasedness bridge. The Horvitz–Thompson estimator is unbiased for the population average treatment-minus-control direct-effect contrast.

Formal statement
E :
shared
E.jointD.E E.estD = E.DEbar
Proof (Lean source)
theorem E_estD : E.jointD.E E.estD = E.DEbar := E_estDirect E.D₁ E.ψ E.φ E.Y E.m0 E.m1 E.C E.hC E.hm0 E.hm1 E.hn E.hprop0 E.hprop1 E.hstage1
theorem var_estD reviewed
Causalean.Experimentation.TwoStageInterference.LHExperiment

Variance bridge. The design variance of the treatment-minus-control direct-effect contrast estimator equals the closed-form two-stage variance directVar.

Formal statement
E :
shared
E.jointD.Var E.estD = E.directVar
Proof (Lean source)
theorem var_estD : E.jointD.Var E.estD = E.directVar := Var_estDirect E.D₁ E.ψ E.φ E.Y E.m0 E.m1 E.C E.hC E.hN E.hN1 E.hm0 E.hm1 E.hn E.hprop0 E.hprop1 E.hstage1 E.hstage1pair
CLTDischarge 8 core · 8 supporting This file develops the conditional-design ingredients for a central limit theorem for the studentized direct-effect estimator in homogeneous two-stage interference experiments. ★ DEbar_eq_of_homogeneous★ directVar_eq_of_homogeneous★ stud_eq_sum_of_homogeneous

Ingredients for the homogeneous two-stage central limit theorem

This file develops the conditional-design ingredients for a central limit theorem for the studentized direct-effect estimator in homogeneous two-stage interference experiments. It defines group-level contrasts, conditional assignment designs, normalized summands, and a reference selection, and derives the estimand and variance reductions needed for the final asymptotic result.

def groupDiff reviewed
Causalean.Experimentation.TwoStageInterference

For a Liu--Hudgens experiment, one of its groups, and a within-group treatment assignment, the per-group treatment-minus-control direct-effect estimator is the treated-strategy group estimator minus the control-strategy group estimator.

Definition (Lean source)
i :
E.ι
w :
Fin (E.gsize i) → Bool
groupDiff E i w :
groupEst E.Y i true (E.m1 i) w - groupEst E.Y i false (E.m0 i) w
Causalean.Experimentation.TwoStageInterference.groupDiff · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischarge.lean:105 · uses LHExperiment
def condDesign reviewed
Causalean.Experimentation.TwoStageInterference

For a Liu--Hudgens experiment and a stage-one strategy assignment, the conditional stage-two design independently assigns each group according to its treatment design when that group is assigned treatment and according to its control design otherwise.

Definition (Lean source)
s :
condDesign E s :
FiniteDesign (∀ i, Fin (E.gsize i) → Bool)
prodDesign (fun i => if s i then E.ψ i else E.φ i)
structure Homogeneous reviewed
Causalean.Experimentation.TwoStageInterference

Homogeneity and regularity bundle for a sequence of Liu–Hudgens experiments. Faithfully encodes the hypotheses of Proposition 5.1 for the Hudgens-Halloran orientation: the studentized statistic is the standardized contrast estimator; every group-level direct-effect contrast equals a common value δ (homogeneity); every within-group contrast-estimator variance equals a common value v(n) that is positive; the centered per-group contrast estimator is uniformly bounded; every stage-1 selection supported by the design flags exactly C groups; the resulting rate sequence tends to zero together with its cubed Lyapunov rate (the many-groups asymptotic regime); and the conditional distribution of the studentized statistic does not depend on which stage-1 selection occurred, the analytic form of homogeneity that lifts the conditional CLT to the average.

Definition (Lean source)
Exp :
ℕ → LHExperiment
t :
stud :
∀ n
if
(StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool)
then
δ M :
v :
ℕ → ℝ
The studentized statistic is `(estD − DEbar)/√directVar`.
hstud :
∀ n sw, stud n sw = ((Exp n).estD sw - (Exp n).DEbar) / sqrt ((Exp n).directVar)
All group-level treatment-minus-control direct-effect contrasts equal the common value `δ` (homogeneity).
:
∀ n i, groupMean (Exp n).ψ (Exp n).Y i true - groupMean (Exp n).ψ (Exp n).Y i false = δ
All within-group contrast-estimator variances equal the common value `v n`.
hv :
∀ n i, ((Exp n).ψ i).Var (groupDiff (Exp n) i) = v n
The common within-group variance is positive.
hvpos :
∀ n, 0 < v n
The centered per-group contrast estimator is bounded by `M`.
hMbound :
∀ n i w, |groupDiff (Exp n) i w - δ| ≤ M
Every supported stage-1 selection flags exactly `C` groups.
hcount :
∀ n s
if
(Exp n).D₁.p s ≠ 0
then
(∑ i, if s i then (1 : ℝ) else 0) = (Exp n).C
The many-groups rate: `B n := M / √(C n · v n) → 0`.
hB0 :
Tendsto (fun n => M / sqrt ((Exp n).C * v n)) atTop (𝓝 0)
The Lyapunov rate: `card · B³ → 0`.
hNB3 :
Tendsto (fun n => (card (Exp n).ι : ℝ) * (M / sqrt ((Exp n).C * v n)) ^ 3) atTop (𝓝 0)
The conditional studentized CDF is selection-independent over the stage-1 support.
hhom :
∀ n s s'
if
(Exp n).D₁.p s ≠ 0
and
(Exp n).D₁.p s' ≠ 0
then
(condDesign (Exp n) s).Pr (fun w => stud n (s, w) ≤ t)
= (condDesign (Exp n) s').Pr (fun w => stud n (s', w) ≤ t)
lemma DEbar_eq_of_homogeneous reviewed
Causalean.Experimentation.TwoStageInterference

Estimand reduction. Under the homogeneity and regularity bundle, the population average treatment-minus-control direct-effect contrast collapses to the common group-level contrast δ.

Formal statement
Exp :
ℕ → LHExperiment
shared
t :
shared
δ :
shared
M :
shared
v :
ℕ → ℝ
shared
stud :
(n : ℕ) → StratAssign (Exp n).ι × ((i : (Exp n).ι) → Fin ((Exp n).gsize i) → Bool) → ℝ
shared
h :
Homogeneous Exp t stud δ M v
n :
(Exp n).DEbar = δ
Proof (Lean source)
lemma DEbar_eq_of_homogeneous (h : Homogeneous Exp t stud δ M v) (n : ℕ) : (Exp n).DEbar = δ := by simp only [LHExperiment.DEbar, CE_direct, popMean, ← sub_div, ← Finset.sum_sub_distrib] rw [Finset.sum_congr rfl (fun i _ => h.hδ n i), Finset.sum_const, Finset.card_univ, nsmul_eq_mul] rw [mul_comm, mul_div_assoc, div_self (Exp n).hN, mul_one]
lemma directVar_eq_of_homogeneous reviewed
Causalean.Experimentation.TwoStageInterference

Variance reduction. Under the homogeneity and regularity bundle, the two-stage design variance of the direct-effect contrast collapses to v n / C: the between-group term vanishes since the population variance of a constant is zero, and the within-group term averages to v n / C.

Formal statement
Exp :
ℕ → LHExperiment
shared
t :
shared
δ :
shared
M :
shared
v :
ℕ → ℝ
shared
stud :
(n : ℕ) → StratAssign (Exp n).ι × ((i : (Exp n).ι) → Fin ((Exp n).gsize i) → Bool) → ℝ
shared
h :
Homogeneous Exp t stud δ M v
n :
(Exp n).directVar = v n / (Exp n).C
Proof (Lean source)
lemma directVar_eq_of_homogeneous (h : Homogeneous Exp t stud δ M v) (n : ℕ) : (Exp n).directVar = v n / (Exp n).C := by have hSmu : SmuVar (fun i => groupMean (Exp n).ψ (Exp n).Y i true - groupMean (Exp n).ψ (Exp n).Y i false) = 0 := by simp only [SmuVar] have hmubar : (∑ i, (groupMean (Exp n).ψ (Exp n).Y i true - groupMean (Exp n).ψ (Exp n).Y i false)) / (card (Exp n).ι : ℝ) = δ := by rw [Finset.sum_congr rfl (fun i _ => h.hδ n i), Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_comm, mul_div_assoc, div_self (Exp n).hN, mul_one] rw [hmubar] rw [Finset.sum_congr rfl (fun i _ => by rw [h.hδ n i, sub_self]; ring : ∀ i ∈ univ, (groupMean (Exp n).ψ (Exp n).Y i true - groupMean (Exp n).ψ (Exp n).Y i false - δ) ^ 2 = 0)] simp have hwithin : ∑ i, ((Exp n).ψ i).Var (fun w => groupEst (Exp n).Y i true ((Exp n).m1 i) w - groupEst (Exp n).Y i false ((Exp n).m0 i) w) = (card (Exp n).ι : ℝ) * v n := by rw [show (∑ i, ((Exp n).ψ i).Var (fun w => groupEst (Exp n).Y i true ((Exp n).m1 i) w - groupEst (Exp n).Y i false ((Exp n).m0 i) w)) = ∑ i, ((Exp n).ψ i).Var (groupDiff (Exp n) i) from rfl, Finset.sum_congr rfl (fun i _ => h.hv n i), Finset.sum_const, Finset.card_univ, nsmul_eq_mul] simp only [LHExperiment.directVar] rw [hSmu, hwithin] have hC := (Exp n).hC have hN := (Exp n).hN field_simp ring
Causalean.Experimentation.TwoStageInterference.directVar_eq_of_homogeneous · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischarge.lean:187 · uses Homogeneous , LHExperiment , directVar , StratAssign
def cltSummand reviewed
Causalean.Experimentation.TwoStageInterference

For a sequence of Liu--Hudgens experiments, an experiment index nn, a common group-level contrast δ\delta, a sequence of within-group variances, a stage-one strategy assignment, a group, and that group's within-group treatment assignment, the scaled per-coordinate summand of the conditional studentized statistic is the selected-group indicator times the centered group contrast estimator, divided by Cnvn\sqrt{C_n v_n}.

Definition (Lean source)
Exp :
ℕ → LHExperiment
shared
n :
δ :
v :
ℕ → ℝ
s :
StratAssign (Exp n).ι
i :
(Exp n).ι
a :
Fin ((Exp n).gsize i) → Bool
cltSummand n δ v s i a :
(if s i then (1 : ℝ) else 0) * (groupDiff (Exp n) i a - δ) / sqrt ((Exp n).C * v n)
lemma stud_eq_sum_of_homogeneous reviewed
Causalean.Experimentation.TwoStageInterference

Studentized = independent sum. For a stage-1 stratified assignment s that the design supports with positive probability, then, under homogeneity, for every within-group assignment pattern w, the conditional studentized statistic decomposes as the normalized independent sum stud(s,w) = ∑ᵢ cltSummand n δ v s i (w i).

Formal statement
Exp :
ℕ → LHExperiment
shared
t :
shared
δ :
shared
M :
shared
v :
ℕ → ℝ
shared
stud :
(n : ℕ) → StratAssign (Exp n).ι × ((i : (Exp n).ι) → Fin ((Exp n).gsize i) → Bool) → ℝ
shared
h :
Homogeneous Exp t stud δ M v
n :
s :
StratAssign (Exp n).ι
hs :
(Exp n).D₁.p s ≠ 0
w :
∀ i
if
Fin ((Exp n).gsize i)
then
stud n (s, w) = ∑ i, cltSummand n δ v s i (w i)
Proof (Lean source)
lemma stud_eq_sum_of_homogeneous (h : Homogeneous Exp t stud δ M v) (n : ℕ) (s : StratAssign (Exp n).ι) (hs : (Exp n).D₁.p s ≠ 0) (w : ∀ i, Fin ((Exp n).gsize i) → Bool) : stud n (s, w) = ∑ i, cltSummand n δ v s i (w i) := by have hCpos : 0 < (Exp n).C := by rcases lt_or_gt_of_ne (Exp n).hC with h0 | h0 · -- if C < 0, contradiction with hcount (sum of indicators ≥ 0) exfalso have hnn : (0 : ℝ) ≤ ∑ i, if s i then (1 : ℝ) else 0 := sum_nonneg (fun i _ => by positivity) rw [h.hcount n s hs] at hnn linarith · exact h0 have hvpos := h.hvpos n have hcount := h.hcount n s hs -- `√(C·v) > 0` and `C·√(v/C) = √(C·v)`. have hCv : (0 : ℝ) < (Exp n).C * v n := mul_pos hCpos hvpos have hsqrtCv : 0 < sqrt ((Exp n).C * v n) := Real.sqrt_pos.mpr hCv have hsqrtvC : 0 < sqrt (v n / (Exp n).C) := Real.sqrt_pos.mpr (div_pos hvpos hCpos) have hkey : (Exp n).C * sqrt (v n / (Exp n).C) = sqrt ((Exp n).C * v n) := by rw [show (Exp n).C * v n = (Exp n).C ^ 2 * (v n / (Exp n).C) by field_simp, Real.sqrt_mul (by positivity), Real.sqrt_sq hCpos.le] rw [h.hstud, estD_eq_agg, DEbar_eq_of_homogeneous h, directVar_eq_of_homogeneous h] -- Recenter: `(∑ 1(sᵢ)·dᵢ)/C − δ = (∑ 1(sᵢ)·(dᵢ−δ))/C` using `∑ 1(sᵢ) = C`. have hrecenter : (∑ i, (if s i then (1 : ℝ) else 0) * groupDiff (Exp n) i (w i)) / (Exp n).C - δ = (∑ i, (if s i then (1 : ℝ) else 0) * (groupDiff (Exp n) i (w i) - δ)) / (Exp n).C := by rw [Finset.sum_congr rfl (fun i _ => mul_sub _ _ _ : ∀ i ∈ univ, (if s i then (1:ℝ) else 0) * (groupDiff (Exp n) i (w i) - δ) = (if s i then (1:ℝ) else 0) * groupDiff (Exp n) i (w i) - (if s i then (1:ℝ) else 0) * δ), Finset.sum_sub_distrib, ← Finset.sum_mul, hcount, sub_div, mul_div_cancel_left₀ _ (ne_of_gt hCpos)] rw [hrecenter] -- Distribute the scalar `1/(C·√(v/C)) = 1/√(C·v)` into the sum. simp only [cltSummand] rw [div_div, hkey, Finset.sum_div]
def refSel reviewed
Causalean.Experimentation.TwoStageInterference

For a sequence of Liu--Hudgens experiments and an experiment index nn, the reference stage-one selection is a fixed strategy assignment having positive probability under that experiment's stage-one design.

Definition (Lean source)
Exp :
ℕ → LHExperiment
n :
refSel Exp n :
StratAssign (Exp n).ι
(exists_support_selection (Exp n)).choose
8 supporting declarations (lemmas, instances)
  • Var_sub_const lemma — Shifting a random variable by a constant leaves its variance unchanged.
    Ω :
    Type u_1
    shared
    D :
    shared
    X :
    Ω → ℝ
    c :
    D.Var (fun z => X z - c) = D.Var X
    Proof (Lean source)
    lemma Var_sub_const (X : Ω → ℝ) (c : ℝ) : D.Var (fun z => X z - c) = D.Var X := by rw [Var_eq, Var_eq, E_sub, E_const] have h : (fun z => (X z - c) ^ 2) = (fun z => (X z) ^ 2 + ((-(2 * c)) * X z + c ^ 2)) := by funext z; ring rw [h, E_add, E_add, E_const_mul, E_const]; ring
    Causalean.Experimentation.DesignBased.FiniteDesign.Var_sub_const · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischarge.lean:63
  • tendsto_E_of_uniformBound_ae theorem — Design expectations converge to a constant when the random variables converge uniformly on the support of each design.
    Ω :
    ℕ → Type*
    ∀ n, Fintype (Ω n)
    D :
    ∀ n, FiniteDesign (Ω n)
    F :
    ∀ n
    if
    Ω n
    then
    L :
    B :
    ℕ → ℝ
    hbound :
    ∀ n s
    if
    (D n).p s ≠ 0
    then
    |F n s - L| ≤ B n
    hB :
    Tendsto B atTop (𝓝 0)
    Tendsto (fun n => (D n).E (F n)) atTop (𝓝 L)
    Proof (Lean source)
    theorem tendsto_E_of_uniformBound_ae {Ω : ℕ → Type*} [∀ n, Fintype (Ω n)] (D : ∀ n, FiniteDesign (Ω n)) (F : ∀ n, Ω n → ℝ) (L : ℝ) (B : ℕ → ℝ) (hbound : ∀ n s, (D n).p s ≠ 0 → |F n s - L| ≤ B n) (hB : Tendsto B atTop (𝓝 0)) : Tendsto (fun n => (D n).E (F n)) atTop (𝓝 L) := by rw [tendsto_iff_norm_sub_tendsto_zero] refine squeeze_zero (fun n => norm_nonneg _) (fun n => ?_) hB have hrecenter : (D n).E (F n) - L = (D n).E (fun s => F n s - L) := by rw [(D n).E_sub (F n) (fun _ => L), (D n).E_const] rw [Real.norm_eq_abs, hrecenter] -- `|∑ p s (F s − L)| ≤ ∑ p s |F s − L| ≤ ∑ p s · B n = B n` on the support. unfold FiniteDesign.E calc |∑ s, (D n).p s * (F n s - L)| ≤ ∑ s, |(D n).p s * (F n s - L)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ _s, (D n).p _s * B n := by refine Finset.sum_le_sum (fun s _ => ?_) rw [abs_mul, abs_of_nonneg ((D n).p_nonneg s)] by_cases hps : (D n).p s = 0 · simp [hps] · exact mul_le_mul_of_nonneg_left (hbound n s hps) ((D n).p_nonneg s) _ = B n := by rw [← Finset.sum_mul, (D n).p_sum, one_mul]
    Causalean.Experimentation.DesignBased.FiniteDesign.tendsto_E_of_uniformBound_ae · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischarge.lean:71
  • estD_eq_agg lemma — The experiment-level contrast estimator is the mean of the selected groups' per-group treatment-minus-control contrast estimators.
    s :
    w :
    ∀ i
    if
    Fin (E.gsize i)
    then
    E.estD (s, w) = (∑ i, (if s i then (1 : ℝ) else 0) * groupDiff E i (w i)) / E.C
    Proof (Lean source)
    lemma estD_eq_agg (E : LHExperiment) (s : StratAssign E.ι) (w : ∀ i, Fin (E.gsize i) → Bool) : E.estD (s, w) = (∑ i, (if s i then (1 : ℝ) else 0) * groupDiff E i (w i)) / E.C := by simp only [LHExperiment.estD, estDirect, popEst, groupDiff] rw [← sub_div] congr 1 rw [← Finset.sum_sub_distrib] refine Finset.sum_congr rfl (fun i _ => ?_) by_cases h : s i = true · simp only [h, if_pos, one_mul] · simp [h]
    Causalean.Experimentation.TwoStageInterference.estD_eq_agg · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischarge.lean:118
  • E_groupDiff_eq_of_homogeneous lemma — The conditional mean of the per-group contrast estimator under the ψ-design is the common group-level contrast: (ψ i).E (dᵢ) = δ. Immediate from E_groupEst (twice) and homogeneity.
    Exp :
    ℕ → LHExperiment
    shared
    t :
    shared
    δ :
    shared
    M :
    shared
    v :
    ℕ → ℝ
    shared
    stud :
    (n : ℕ) → StratAssign (Exp n).ι × ((i : (Exp n).ι) → Fin ((Exp n).gsize i) → Bool) → ℝ
    shared
    h :
    Homogeneous Exp t stud δ M v
    n :
    i :
    (Exp n).ι
    ((Exp n).ψ i).E (groupDiff (Exp n) i) = δ
    Proof (Lean source)
    lemma E_groupDiff_eq_of_homogeneous (h : Homogeneous Exp t stud δ M v) (n : ℕ) (i : (Exp n).ι) : ((Exp n).ψ i).E (groupDiff (Exp n) i) = δ := by unfold groupDiff rw [FiniteDesign.E_sub, E_groupEst (Exp n).ψ (Exp n).Y i true ((Exp n).m1 i) ((Exp n).hm1 i) ((Exp n).hn i) ((Exp n).hprop1 i), E_groupEst (Exp n).ψ (Exp n).Y i false ((Exp n).m0 i) ((Exp n).hm0 i) ((Exp n).hn i) ((Exp n).hprop0 i), h.hδ n i]
    Causalean.Experimentation.TwoStageInterference.E_groupDiff_eq_of_homogeneous · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischarge.lean:268
  • M_nonneg_of_homogeneous lemma — Nonnegativity of the bound constant M, available whenever the experiment has at least one group.
    Exp :
    ℕ → LHExperiment
    shared
    t :
    shared
    δ :
    shared
    M :
    shared
    v :
    ℕ → ℝ
    shared
    stud :
    (n : ℕ) → StratAssign (Exp n).ι × ((i : (Exp n).ι) → Fin ((Exp n).gsize i) → Bool) → ℝ
    shared
    h :
    Homogeneous Exp t stud δ M v
    n :
    Nonempty (Exp n).ι
    0 ≤ M
    Proof (Lean source)
    lemma M_nonneg_of_homogeneous (h : Homogeneous Exp t stud δ M v) (n : ℕ) [Nonempty (Exp n).ι] : 0 ≤ M := by obtain ⟨i⟩ := (inferInstance : Nonempty (Exp n).ι) exact le_trans (abs_nonneg _) (h.hMbound n i (fun _ => false))
    Causalean.Experimentation.TwoStageInterference.M_nonneg_of_homogeneous · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischarge.lean:280
  • exists_support_selection lemma — Some stage-1 selection lies in the support of D₁ (its probabilities sum to one).
    ∃ s, E.D₁.p s ≠ 0
    Proof (Lean source)
    lemma exists_support_selection (E : LHExperiment) : ∃ s, E.D₁.p s ≠ 0 := by by_contra hcon push_neg at hcon have : ∑ s, E.D₁.p s = 0 := Finset.sum_eq_zero (fun s _ => hcon s) rw [E.D₁.p_sum] at this exact one_ne_zero this
    Causalean.Experimentation.TwoStageInterference.exists_support_selection · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischarge.lean:287
  • refSel_mem lemma — The fixed reference selection has positive stage-one design probability.
    Exp :
    ℕ → LHExperiment
    n :
    (Exp n).D₁.p (refSel Exp n) ≠ 0
    Proof (Lean source)
    lemma refSel_mem (Exp : ℕ → LHExperiment) (n : ℕ) : (Exp n).D₁.p (refSel Exp n) ≠ 0 := (exists_support_selection (Exp n)).choose_spec
    Causalean.Experimentation.TwoStageInterference.refSel_mem · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischarge.lean:300
  • nonempty_of_refSel lemma — The reference selection flags at least one group, so the group index type is nonempty.
    Exp :
    ℕ → LHExperiment
    shared
    t :
    shared
    δ :
    shared
    M :
    shared
    v :
    ℕ → ℝ
    shared
    stud :
    (n : ℕ) → StratAssign (Exp n).ι × ((i : (Exp n).ι) → Fin ((Exp n).gsize i) → Bool) → ℝ
    shared
    h :
    Homogeneous Exp t stud δ M v
    n :
    Nonempty (Exp n).ι
    Proof (Lean source)
    lemma nonempty_of_refSel (h : Homogeneous Exp t stud δ M v) (n : ℕ) : Nonempty (Exp n).ι := by by_contra hcon rw [not_nonempty_iff] at hcon have h0 : (∑ i, if refSel Exp n i then (1 : ℝ) else 0) = 0 := by rw [Finset.univ_eq_empty, Finset.sum_empty] rw [h.hcount n (refSel Exp n) (refSel_mem Exp n)] at h0 exact (Exp n).hC h0
    Causalean.Experimentation.TwoStageInterference.nonempty_of_refSel · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischarge.lean:305
CLT 1 core · 2 supporting The unconditional CLT for the treatment-minus-control direct-effect contrast is obtained by averaging uniformly convergent conditional laws across the first-stage strategy assignment. ★ directEffect_clt

Direct-contrast central limit theorem

The unconditional CLT for the treatment-minus-control direct-effect contrast is obtained by averaging uniformly convergent conditional laws across the first-stage strategy assignment.

The design-level lemmas are FiniteDesign.tendsto_E_of_uniformBound, which says expectations preserve a uniform limit over finite assignment spaces, and FiniteDesign.Pr_compound_eq_E_condPr, the tower bridge rewriting a compound-design probability as the stage-1 average of stage-2 conditional probabilities.

The headline theorem directEffect_clt proves Liu-Hudgens Proposition 5.1 conditional on the uniform conditional studentized CDF hypothesis hcond: the joint-design CDF of the studentized direct-effect contrast converges to stdNormalCdf t.

theorem directEffect_clt reviewed
Causalean.Experimentation.TwoStageInterference

Proposition 5.1 (Liu–Hudgens 2014), asymptotic normality of the treatment-minus-control direct-effect contrast — conditional on the uniform conditional CLT. Along a sequence of two-stage Hudgens–Halloran experiments Exp : ℕ → LHExperiment, let stud n be the studentized statistic (D̂E − DE̅)/√directVar for the treatment-minus-control direct-effect contrast and cond n s the within-selection (stage-2 product) design when stage 1 selects the strategy assignment s. Assume the conditional studentized CDFs at t converge to the standard normal CDF Φ(t) uniformly over selections s, with a vanishing uniform bound. Then the unconditional (joint-design) studentized CDF at t converges to Φ(t):

Formal statement
Exp :
ℕ → LHExperiment
t :
stud :
∀ n
if
(StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool)
then
_hstud :
∀ n sw, stud n sw = ((Exp n).estD sw - (Exp n).DEbar) / sqrt ((Exp n).directVar)
cond :
∀ n
if
StratAssign (Exp n).ι
then
FiniteDesign (∀ i, Fin ((Exp n).gsize i) → Bool)
hcondDef :
∀ n s, cond n s = prodDesign (fun i => if s i then (Exp n).ψ i else (Exp n).φ i)
hcond :
∃ B,
Tendsto B atTop (𝓝 0) ∧
∀ n s, |(cond n s).Pr (fun w => stud n (s, w) ≤ t) - stdNormalCdf t| ≤ B n
Tendsto (fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ t)) atTop (𝓝 (stdNormalCdf t))
Proof (Lean source)
theorem directEffect_clt (Exp : ℕ → LHExperiment) (t : ℝ) (stud : ∀ n, (StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool) → ℝ) (_hstud : ∀ n sw, stud n sw = ((Exp n).estD sw - (Exp n).DEbar) / sqrt ((Exp n).directVar)) (cond : ∀ n, StratAssign (Exp n).ι → FiniteDesign (∀ i, Fin ((Exp n).gsize i) → Bool)) (hcondDef : ∀ n s, cond n s = prodDesign (fun i => if s i then (Exp n).ψ i else (Exp n).φ i)) (hcond : ∃ B, Tendsto B atTop (𝓝 0) ∧ ∀ n s, |(cond n s).Pr (fun w => stud n (s, w) ≤ t) - stdNormalCdf t| ≤ B n) : Tendsto (fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ t)) atTop (𝓝 (stdNormalCdf t)) := by obtain ⟨B, hB, hbound⟩ := hcond -- Rewrite each unconditional CDF as the stage-1 average of conditional CDFs. have hrw : ∀ n, (Exp n).jointD.Pr (fun sw => stud n sw ≤ t) = (Exp n).D₁.E (fun s => (cond n s).Pr (fun w => stud n (s, w) ≤ t)) := by intro n rw [LHExperiment.jointD, jointDesign, FiniteDesign.Pr_compound_eq_E_condPr] apply (Exp n).D₁.E_congr intro s rw [hcondDef n s] simp_rw [hrw] -- Apply the mixture-lifting lemma with `F n s := (cond n s).Pr (…)`, `L := Φ(t)`, bound `B`. exact FiniteDesign.tendsto_E_of_uniformBound (fun n => (Exp n).D₁) (fun n s => (cond n s).Pr (fun w => stud n (s, w) ≤ t)) (stdNormalCdf t) B hbound hB
2 supporting declarations (lemmas, instances)
  • tendsto_E_of_uniformBound theorem — Mixture-lifting lemma. If a sequence of design random variables F n : Ω n → ℝ converges to a constant L *uniformly* over the assignment space — |F n s − L| ≤ B n for every s, with B n → 0 — then their expectations converge to L: (D n).E (F n) → L. Averaging a uniformly convergent family preserves the limit, since the expectation of a B n-bounded deviation is itself B n-bounded. This is the abstract content of the two-stage mixture-lifting argument: the joint law is the stage-1 average of conditional laws, and a uniform conditional limit lifts to the average.
    Ω :
    ℕ → Type*
    ∀ n, Fintype (Ω n)
    D :
    ∀ n, FiniteDesign (Ω n)
    F :
    ∀ n
    if
    Ω n
    then
    L :
    B :
    ℕ → ℝ
    hbound :
    ∀ n s, |F n s - L| ≤ B n
    hB :
    Tendsto B atTop (𝓝 0)
    Tendsto (fun n => (D n).E (F n)) atTop (𝓝 L)
    Proof (Lean source)
    theorem tendsto_E_of_uniformBound {Ω : ℕ → Type*} [∀ n, Fintype (Ω n)] (D : ∀ n, FiniteDesign (Ω n)) (F : ∀ n, Ω n → ℝ) (L : ℝ) (B : ℕ → ℝ) (hbound : ∀ n s, |F n s - L| ≤ B n) (hB : Tendsto B atTop (𝓝 0)) : Tendsto (fun n => (D n).E (F n)) atTop (𝓝 L) := by -- It suffices that `|(D n).E (F n) − L| → 0`. rw [tendsto_iff_norm_sub_tendsto_zero] -- Squeeze `‖(D n).E (F n) − L‖` between `0` and `B n → 0`. refine squeeze_zero (fun n => norm_nonneg _) (fun n => ?_) hB -- `(D n).E (F n) − L = (D n).E (fun s => F n s − L)` by linearity (`E_sub` + `E_const`). have hrecenter : (D n).E (F n) - L = (D n).E (fun s => F n s - L) := by rw [(D n).E_sub (F n) (fun _ => L), (D n).E_const] -- `|(D n).E (fun s => F n s − L)| ≤ B n` by the pointwise bound `hbound`. rw [Real.norm_eq_abs, hrecenter] exact (D n).abs_E_le (fun s => hbound n s)
    Causalean.Experimentation.DesignBased.FiniteDesign.tendsto_E_of_uniformBound · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLT.lean:63
  • Pr_compound_eq_E_condPr lemma — Tower bridge for probabilities. Under the two-stage compound design, the unconditional probability of an event P equals the stage-1 expectation of its stage-2 conditional probability:
    Ω₁ ι :
    Type*
    Fintype Ω₁
    ι → Type*
    ∀ i, Fintype (α i)
    D₁ :
    D₂ :
    Ω₁ → ∀ i, FiniteDesign (α i)
    P :
    (Ω₁ × ∀ i, α i) → Prop
    (compound D₁ D₂).Pr P = D₁.E (fun s => (prodDesign (D₂ s)).Pr (fun w => P (s, w)))
    Proof (Lean source)
    lemma Pr_compound_eq_E_condPr {Ω₁ ι : Type*} [Fintype Ω₁] [Fintype ι] [DecidableEq ι] {α : ι → Type*} [∀ i, Fintype (α i)] (D₁ : FiniteDesign Ω₁) (D₂ : Ω₁ → ∀ i, FiniteDesign (α i)) (P : (Ω₁ × ∀ i, α i) → Prop) [DecidablePred P] : (compound D₁ D₂).Pr P = D₁.E (fun s => (prodDesign (D₂ s)).Pr (fun w => P (s, w))) := by -- `Pr P = E (ind P)`, then push `E` through the tower. rw [FiniteDesign.Pr, E_compound_tower] -- The inner stage-2 expectation of `ind P (s, ·)` is exactly the conditional probability. apply D₁.E_congr intro s rw [FiniteDesign.Pr] -- `ind P (s, w) = ind (fun w => P (s, w)) w` definitionally (both `if … then 1 else 0`). apply (prodDesign (D₂ s)).E_congr intro w rfl
    Causalean.Experimentation.DesignBased.FiniteDesign.Pr_compound_eq_E_condPr · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLT.lean:85
CLTDischarge­Main 1 core · 1 supporting The primitive Liu-Hudgens treatment-minus-control direct-effect CLT follows from the independent-summands product-design CLT. ★ directEffect_clt_homogeneous

Primitive direct-contrast CLT

The primitive Liu-Hudgens treatment-minus-control direct-effect CLT follows from the independent-summands product-design CLT.

The lemma condCLT_ref applies prodDesign_clt to the homogeneity-reduced per-coordinate summands at the reference first-stage selection. The theorem directEffect_clt_homogeneous then uses selection homogeneity and the support-restricted mixture-lifting lemma to prove that the joint studentized direct-effect CDF converges to stdNormalCdf t.

theorem directEffect_clt_homogeneous reviewed
Causalean.Experimentation.TwoStageInterference

Proposition 5.1 (Liu–Hudgens 2014), fully primitive. Under the homogeneity and regularity bundle, the studentized treatment-minus-control direct-effect contrast is asymptotically standard normal: its joint-design CDF at t converges to Φ(t).

Formal statement
Exp :
ℕ → LHExperiment
shared
t :
shared
δ :
shared
M :
shared
v :
ℕ → ℝ
shared
stud :
(n : ℕ) → StratAssign (Exp n).ι × ((i : (Exp n).ι) → Fin ((Exp n).gsize i) → Bool) → ℝ
shared
h :
Homogeneous Exp t stud δ M v
Tendsto (fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ t)) atTop (𝓝 (stdNormalCdf t))
Proof (Lean source)
theorem directEffect_clt_homogeneous (h : Homogeneous Exp t stud δ M v) : Tendsto (fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ t)) atTop (𝓝 (stdNormalCdf t)) := by -- Reference-selection conditional CDF and its distance to `Φ(t)`. set F : ∀ n, StratAssign (Exp n).ι → ℝ := fun n s => (condDesign (Exp n) s).Pr (fun w => stud n (s, w) ≤ t) with hF set B : ℕ → ℝ := fun n => |F n (refSel Exp n) - stdNormalCdf t| with hBdef -- `B n → 0` since the reference conditional CDF converges to `Φ(t)`. have hB : Tendsto B atTop (𝓝 0) := by have hc := condCLT_ref h rw [tendsto_iff_norm_sub_tendsto_zero] at hc simpa only [hBdef, hF, Real.norm_eq_abs] using hc -- Rewrite each joint CDF as the stage-1 average of conditional CDFs. have hrw : ∀ n, (Exp n).jointD.Pr (fun sw => stud n sw ≤ t) = (Exp n).D₁.E (F n) := by intro n rw [LHExperiment.jointD, jointDesign, FiniteDesign.Pr_compound_eq_E_condPr] apply (Exp n).D₁.E_congr intro s rw [hF] rfl simp_rw [hrw] -- Average via the support-restricted mixture-lifting lemma. refine FiniteDesign.tendsto_E_of_uniformBound_ae (fun n => (Exp n).D₁) F (stdNormalCdf t) B (fun n s hs => ?_) hB -- On the support, `hhom` identifies `F n s` with `F n (refSel)`. simp only [hBdef, hF] rw [h.hhom n s (refSel Exp n) hs (refSel_mem Exp n)]
1 supporting declaration (lemmas, instances)
  • condCLT_ref lemma — Conditional CLT for the reference selection. Applying the independent-summands CLT prodDesign_clt to the per-coordinate summands gₛ₀,ᵢ over the conditional product design gives the conditional studentized CDF at the reference selection refSel Exp n converging to Φ(t).
    Exp :
    ℕ → LHExperiment
    shared
    t :
    shared
    δ :
    shared
    M :
    shared
    v :
    ℕ → ℝ
    shared
    stud :
    (n : ℕ) → StratAssign (Exp n).ι × ((i : (Exp n).ι) → Fin ((Exp n).gsize i) → Bool) → ℝ
    shared
    h :
    Homogeneous Exp t stud δ M v
    Tendsto (fun n => (condDesign (Exp n) (refSel Exp n)).Pr (fun w => stud n (refSel Exp n, w) ≤ t)) atTop (𝓝 (stdNormalCdf t))
    Proof (Lean source)
    lemma condCLT_ref (h : Homogeneous Exp t stud δ M v) : Tendsto (fun n => (condDesign (Exp n) (refSel Exp n)).Pr (fun w => stud n (refSel Exp n, w) ≤ t)) atTop (𝓝 (stdNormalCdf t)) := by classical set s₀ : ∀ n, StratAssign (Exp n).ι := fun n => refSel Exp n with hs₀ -- Coordinate designs and per-coordinate summands. set D : ∀ n, ∀ i : (Exp n).ι, FiniteDesign (Fin ((Exp n).gsize i) → Bool) := fun n i => if s₀ n i then (Exp n).ψ i else (Exp n).φ i with hD set g : ∀ n, ∀ i : (Exp n).ι, (Fin ((Exp n).gsize i) → Bool) → ℝ := fun n i => cltSummand n δ v (s₀ n) i with hg set B : ℕ → ℝ := fun n => M / sqrt ((Exp n).C * v n) with hBdef -- Positivity facts. have hCpos : ∀ n, 0 < (Exp n).C := by intro n have := nonempty_of_refSel h n rcases lt_or_gt_of_ne (Exp n).hC with h0 | h0 · exfalso have hnn : (0 : ℝ) ≤ ∑ i, if s₀ n i then (1 : ℝ) else 0 := sum_nonneg (fun i _ => by positivity) rw [h.hcount n (s₀ n) (refSel_mem Exp n)] at hnn; linarith · exact h0 have hsqrt : ∀ n, 0 < sqrt ((Exp n).C * v n) := fun n => Real.sqrt_pos.mpr (mul_pos (hCpos n) (h.hvpos n)) -- `0 ≤ B n`. have hB : ∀ n, 0 ≤ B n := by intro n have := nonempty_of_refSel h n exact div_nonneg (M_nonneg_of_homogeneous h n) (hsqrt n).le -- Uniform bound `|g n i a| ≤ B n`. have hbound : ∀ n i a, |g n i a| ≤ B n := by intro n i a rw [hg, hBdef] change |cltSummand n δ v (s₀ n) i a| ≤ M / sqrt ((Exp n).C * v n) unfold cltSummand rw [abs_div, abs_mul, abs_of_nonneg (Real.sqrt_nonneg _)] rw [div_le_div_iff_of_pos_right (hsqrt n)] calc |if s₀ n i then (1:ℝ) else 0| * |groupDiff (Exp n) i a - δ| ≤ 1 * |groupDiff (Exp n) i a - δ| := by apply mul_le_mul_of_nonneg_right _ (abs_nonneg _) by_cases hh : s₀ n i = true <;> simp [hh] _ = |groupDiff (Exp n) i a - δ| := one_mul _ _ ≤ M := h.hMbound n i a -- Mean-zero summands. have hmean : ∀ n i, (D n i).E (g n i) = 0 := by intro n i change (if s₀ n i then (Exp n).ψ i else (Exp n).φ i).E (cltSummand n δ v (s₀ n) i) = 0 rw [show cltSummand n δ v (s₀ n) i = (fun a => ((if s₀ n i then (1:ℝ) else 0) / sqrt ((Exp n).C * v n)) * (groupDiff (Exp n) i a - δ)) from funext fun a => by unfold cltSummand; ring] rw [FiniteDesign.E_const_mul] by_cases hh : s₀ n i = true · rw [if_pos hh, if_pos hh] have : ((Exp n).ψ i).E (fun a => groupDiff (Exp n) i a - δ) = 0 := by rw [FiniteDesign.E_sub, FiniteDesign.E_const, E_groupDiff_eq_of_homogeneous h, sub_self] rw [this, mul_zero] · rw [if_neg hh]; ring -- Unit total variance. have hvar : ∀ n, (prodDesign (D n)).Var (fun w => ∑ i, g n i (w i)) = 1 := by intro n have := nonempty_of_refSel h n -- Write `g n i a = c i * gtil i a`. set c : (Exp n).ι → ℝ := fun i => (if s₀ n i then (1:ℝ) else 0) / sqrt ((Exp n).C * v n) with hc set gtil : ∀ i : (Exp n).ι, (Fin ((Exp n).gsize i) → Bool) → ℝ := fun i a => groupDiff (Exp n) i a - δ with hgtil rw [show (fun w : ∀ i, Fin ((Exp n).gsize i) → Bool => ∑ i, g n i (w i)) = (fun w => ∑ i, c i * gtil i (w i)) from funext fun w => by refine Finset.sum_congr rfl (fun i _ => ?_) rw [hg, hc, hgtil]; simp only [cltSummand]; ring] rw [FiniteDesign.Var_prod_linear_comb] -- Each term: `(c i)² · Var(gtil i) = if s₀ᵢ then v/(C·v) else 0`. have hterm : ∀ i, (c i) ^ 2 * (D n i).Var (gtil i) = (if s₀ n i then (1:ℝ) else 0) * (v n / ((Exp n).C * v n)) := by intro i change ((if s₀ n i then (1:ℝ) else 0) / sqrt ((Exp n).C * v n)) ^ 2 * (if s₀ n i then (Exp n).ψ i else (Exp n).φ i).Var (fun a => groupDiff (Exp n) i a - δ) = (if s₀ n i then (1:ℝ) else 0) * (v n / ((Exp n).C * v n)) by_cases hh : s₀ n i = true · rw [if_pos hh, if_pos hh, FiniteDesign.Var_sub_const, h.hv n i] rw [div_pow, one_pow, Real.sq_sqrt (mul_pos (hCpos n) (h.hvpos n)).le, one_mul, one_div, inv_mul_eq_div] · rw [if_neg hh, if_neg hh]; simp rw [Finset.sum_congr rfl (fun i _ => hterm i), ← Finset.sum_mul, h.hcount n (s₀ n) (refSel_mem Exp n)] rw [mul_div_assoc', div_eq_one_iff_eq (mul_ne_zero (ne_of_gt (hCpos n)) (ne_of_gt (h.hvpos n)))] -- Assemble `prodDesign_clt`. have hclt := DesignBased.prodDesign_clt D g B hB h.hB0 hbound h.hNB3 hmean hvar t -- Rewrite the prelimit to the conditional studentized CDF. refine hclt.congr (fun n => ?_) rw [condDesign] congr 1 funext w rw [stud_eq_sum_of_homogeneous h n (s₀ n) (refSel_mem Exp n) w]
    Causalean.Experimentation.TwoStageInterference.condCLT_ref · Causalean/Experimentation/TwoStageInterference/Asymptotic/CLTDischargeMain.lean:45
Consistency 1 core · 0 supporting The two-stage estimator of the treatment-minus-control direct-effect contrast is consistent when its design variance vanishes. ★ estDirect_consistent

Direct-contrast consistency

The two-stage estimator of the treatment-minus-control direct-effect contrast is consistent when its design variance vanishes.

This file proves Chebyshev consistency for the Liu-Hudgens direct-contrast estimator along a sequence of two-stage experiments.

theorem estDirect_consistent reviewed
Causalean.Experimentation.TwoStageInterference

Consistency of the direct-effect contrast estimator (Liu–Hudgens 2014). Along a sequence of two-stage experiments, if the closed-form design variance directVar tends to zero as the number of groups grows, then for every positive tolerance ε, the Horvitz-Thompson estimator is consistent for the population average treatment-minus-control direct-effect contrast: the probability that the deviation exceeds ε tends to zero.

Formal statement
Exp :
ℕ → LHExperiment
hVar0 :
Tendsto (fun n => (Exp n).directVar) atTop (𝓝 0)
ε :
:
0 < ε
Tendsto (fun n => (Exp n).jointD.Pr (fun sw => ε ≤ |(Exp n).estD sw - (Exp n).DEbar|)) atTop (𝓝 0)
Proof (Lean source)
theorem estDirect_consistent (Exp : ℕ → LHExperiment) (hVar0 : Tendsto (fun n => (Exp n).directVar) atTop (𝓝 0)) {ε : ℝ} (hε : 0 < ε) : Tendsto (fun n => (Exp n).jointD.Pr (fun sw => ε ≤ |(Exp n).estD sw - (Exp n).DEbar|)) atTop (𝓝 0) := by refine squeeze_zero (g := fun n => (Exp n).directVar / ε ^ 2) (fun n => ?_) (fun n => ?_) ?_ · -- `0 ≤ Pr_n`: a probability is nonnegative. exact (Exp n).jointD.Pr_nonneg _ · -- `Pr_n ≤ directVar_n / ε²` by Chebyshev, recentering via unbiasedness. have hcenter : (Exp n).DEbar = (Exp n).jointD.E (Exp n).estD := ((Exp n).E_estD).symm change (Exp n).jointD.Pr (fun sw => ε ≤ |(Exp n).estD sw - (Exp n).DEbar|) ≤ (Exp n).directVar / ε ^ 2 rw [hcenter, ← (Exp n).var_estD] exact (Exp n).jointD.chebyshev (Exp n).estD hε · -- `directVar_n / ε² → 0 / ε² = 0`. simpa using hVar0.div_const (ε ^ 2)
Identical 9 core · 8 supporting This file turns literal group-level symmetry into the homogeneity hypothesis used by the Liu-Hudgens direct-effect CLT. ★ IdenticalRef★ directEffect_clt_identical

Identical-groups discharge for the direct-effect CLT

This file turns literal group-level symmetry into the homogeneity hypothesis used by the Liu-Hudgens direct-effect CLT.

The reference bundle IdenticalRef stores one identical-groups experiment: a common group size, common within-group strategies, common potential outcomes, common treated/control counts, the stage-1 design, and the propensities/nondegeneracy hypotheses needed to build `toExp : LHExperiment. It also defines the common per-group contrast groupDiff₀`, the concrete studentized statistic studId, the common group effect refDelta, and the common within-group variance refVar.

The theorem hhom_of_identical proves the selection-symmetry hypothesis by relabeling equal-size selected sets with exists_equiv_selection and prodDesign_Pr_reindex. The definition homogeneous_of_identical assembles the resulting Homogeneous bundle, and directEffect_clt_identical derives asymptotic normality without assuming analytic homogeneity as a separate premise.

structure IdenticalRef reviewed
Causalean.Experimentation.TwoStageInterference

Reference data for one identical-groups experiment. All groups in the population share a common size K, a common pair of within-group allocation strategies ψ₀ and φ₀, common potential outcomes Y₀, and common control and treatment unit counts, each assumed nonzero, as is the group size K. A stage-1 design D₁ assigns each group a strategy, selecting a nonzero number C of groups for ψ, out of a population of at least two groups; every unit's within-group control propensity equals m0₀/K and its treatment propensity equals m1₀/K, every group's stage-1 selection propensity equals C/N, and every pair's joint selection propensity equals C(C−1)/(N(N−1)). Together these assemble the constant LHExperiment toExp.

Definition (Lean source)
Finite population of groups.
ι :
The common group size.
K :
The common allocation strategy ψ.
ψ₀ :
The common comparison strategy φ.
φ₀ :
The common partial-interference potential outcomes.
Y₀ :
Fin K → (Fin K → Bool) → ℝ
The common control-unit count.
m0₀ :
The common treated-unit count.
m1₀ :
Stage-1 strategy-assignment design.
Number of groups selected for ψ at stage 1.
C :
The ψ-selection count is nonzero.
hC :
C ≠ 0
The common control count is nonzero.
hm0 :
m0₀ ≠ 0
The common treated count is nonzero.
hm1 :
m1₀ ≠ 0
The common group size is nonzero.
hn :
(K : ℝ) ≠ 0
There is at least one group.
hN :
(Fintype.card ι : ℝ) ≠ 0
There are at least two groups, needed for the pair propensity.
hN1 :
(Fintype.card ι : ℝ) - 1 ≠ 0
Within-group control propensity of every unit is `m0₀ / K`.
hprop0 :
∀ j : Fin K, ψ₀.Pr (fun w => w j = false) = m0₀ / (K : ℝ)
Within-group treatment propensity of every unit is `m1₀ / K`.
hprop1 :
∀ j : Fin K, ψ₀.Pr (fun w => w j = true) = m1₀ / (K : ℝ)
Stage-1 first-order selection propensity of every group is `C/N`.
hstage1 :
∀ i, D₁.Pr (fun s => s i = true) = C / (Fintype.card ι : ℝ)
Stage-1 second-order (pair) selection propensity is `C(C−1)/(N(N−1))`.
hstage1pair :
∀ i j
if
i ≠ j
then
D₁.E (fun s => FiniteDesign.ind (fun s => s i = true) s * FiniteDesign.ind (fun s => s j = true) s)
= (C * (C - 1)) / ((Fintype.card ι : ℝ) * ((Fintype.card ι : ℝ) - 1))
Causalean.Experimentation.TwoStageInterference.IdenticalRef · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:107
def toExp reviewed
Causalean.Experimentation.TwoStageInterference.IdenticalRef

Given reference data for one identical-groups experiment, the constant Liu--Hudgens experiment assigns every group the common size, two common within-group randomization designs, common potential outcomes, and common treated and control counts in that reference data. Thus its conditional within-group randomization is a product across groups.

Definition (Lean source)
R :
shared
toExp R :
clause 1
ι := R.ι
clause 2
gsize := fun _ => R.K
clause 3
D₁ := R.D₁
clause 4
ψ := fun _ => R.ψ₀
clause 5
φ := fun _ => R.φ₀
clause 6
Y := fun _ => R.Y₀
clause 7
m0 := fun _ => R.m0₀
clause 8
m1 := fun _ => R.m1₀
clause 9
C := R.C
clause 10
hC := R.hC
clause 11
hm0 := fun _ => R.hm0
clause 12
hm1 := fun _ => R.hm1
clause 13
hn := fun _ => R.hn
clause 14
hN := R.hN
clause 15
hN1 := R.hN1
clause 16
hprop0 := fun _ => R.hprop0
clause 17
hprop1 := fun _ => R.hprop1
clause 18
hstage1 := R.hstage1
clause 19
hstage1pair := R.hstage1pair
Causalean.Experimentation.TwoStageInterference.IdenticalRef.toExp · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:168 · uses IdenticalRef , LHExperiment
def groupDiff₀ reviewed
Causalean.Experimentation.TwoStageInterference.IdenticalRef

Given reference data for one identical-groups experiment and a realized assignment within its common-size group, the common per-group treatment-minus-control contrast estimator is the sum of potential outcomes for treated units divided by the common treated count minus the analogous sum for control units divided by the common control count.

Definition (Lean source)
R :
shared
w :
Fin R.K → Bool
groupDiff₀ R w :
(∑ j, if w j = true then R.Y₀ j w else 0) / R.m1₀
- (∑ j, if w j = false then R.Y₀ j w else 0) / R.m0₀
Causalean.Experimentation.TwoStageInterference.IdenticalRef.groupDiff₀ · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:195 · uses IdenticalRef
def studId reviewed
Causalean.Experimentation.TwoStageInterference.IdenticalRef

Given reference data for one identical-groups experiment and a realized first-stage strategy assignment together with a realized within-group assignment for every group, the studentized treatment-minus-control contrast statistic is the aggregate direct-effect estimator minus its population direct effect, divided by the square root of its direct-effect variance.

Definition (Lean source)
R :
shared
sw :
StratAssign R.ι × (R.ι → (Fin R.K → Bool))
studId R sw :
(R.toExp.estD sw - R.toExp.DEbar) / sqrt (R.toExp.directVar)
Causalean.Experimentation.TwoStageInterference.IdenticalRef.studId · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:212 · uses IdenticalRef , StratAssign
def refGroupMean reviewed
Causalean.Experimentation.TwoStageInterference.IdenticalRef

Given reference data for one identical-groups experiment and a treatment status, the common group-average potential outcome is the arithmetic mean over units in the common group of their expected potential outcomes under the reference allocation strategy, conditional on their own treatment having that status.

Definition (Lean source)
R :
shared
z :
refGroupMean R z :
(∑ j : Fin R.K, R.ψ₀.E (fun w => if w j = z then R.Y₀ j w else 0) / R.ψ₀.Pr (fun w => w j = z)) / (R.K : ℝ)
Causalean.Experimentation.TwoStageInterference.IdenticalRef.refGroupMean · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:288 · uses IdenticalRef
def refDelta reviewed
Causalean.Experimentation.TwoStageInterference.IdenticalRef

Given reference data for one identical-groups experiment, the common group-level direct-effect contrast is its common group-average potential outcome under treatment minus that under control.

Definition (Lean source)
R :
shared
refDelta R :
R.refGroupMean true - R.refGroupMean false
Causalean.Experimentation.TwoStageInterference.IdenticalRef.refDelta · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:296 · uses IdenticalRef
def refVar reviewed
Causalean.Experimentation.TwoStageInterference.IdenticalRef

Given reference data for one identical-groups experiment, the common within-group contrast-estimator variance is the variance, under the reference first allocation strategy, of the common per-group treatment-minus-control contrast estimator.

Definition (Lean source)
R :
shared
refVar R :
R.ψ₀.Var R.groupDiff₀
Causalean.Experimentation.TwoStageInterference.IdenticalRef.refVar · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:301 · uses IdenticalRef
def homogeneous_of_identical reviewed
Causalean.Experimentation.TwoStageInterference

Given a sequence of identical-groups reference experiments, a real evaluation threshold, a real common direct-effect contrast, a real uniform bound, the assumption that every reference direct-effect contrast equals that common contrast, the assumption that every reference within-group contrast variance is positive, the assumption that, for every experiment, group, and within-group assignment, the absolute difference between the realized group contrast and the common contrast is at most the uniform bound, the assumption that every first-stage assignment with positive probability selects exactly its prescribed number of groups, the assumption that, as the sequence index grows, M/CnvnM/\sqrt{C_n v_n} converges to zero, where CnC_n is the prescribed selected-group count and vnv_n the reference within-group variance, and the assumption that the number of groups times (M/Cnvn)3(M/\sqrt{C_n v_n})^3 converges to zero, the homogeneity bundle for this sequence has the stated threshold, studentized statistics, common contrast, bound, and reference within-group variances. Its conditional-distribution homogeneity follows from literal identity of the groups.

Definition (Lean source)
R :
ℕ → IdenticalRef
t δ M :
:
∀ n, (R n).refDelta = δ
hvpos :
∀ n, 0 < (R n).refVar
hMbound :
∀ n i w, |groupDiff (R n).toExp i w - δ| ≤ M
hcount :
∀ n s
if
(R n).toExp.D₁.p s ≠ 0
then
(∑ i, if s i then (1 : ℝ) else 0) = (R n).toExp.C
hB0 :
Tendsto (fun n => M / sqrt ((R n).toExp.C * (R n).refVar)) atTop (𝓝 0)
hNB3 :
Tendsto (fun n => (card (R n).toExp.ι : ℝ) * (M / sqrt ((R n).toExp.C * (R n).refVar)) ^ 3) atTop (𝓝 0)
homogeneous_of_identical R t δ M hδ hvpos hMbound hcount hB0 hNB3 :
Homogeneous (fun n => (R n).toExp) t (fun n => (R n).studId) δ M (fun n => (R n).refVar)
clause 1
hstud := fun n sw => rfl
clause 2
hδ := fun n i => by rw [(R n).hδ_toExp i, hδ n]
clause 3
hv := fun n i => (R n).hv_toExp i
clause 4
hvpos := hvpos
clause 5
hMbound := hMbound
clause 6
hcount := hcount
clause 7
hB0 := hB0
clause 8
hNB3 := hNB3
clause 9
hhom := fun n s s' hs hs'
=> (R n).hhom_of_identical t s s' (hcount n s hs) (hcount n s' hs')
theorem directEffect_clt_identical reviewed
Causalean.Experimentation.TwoStageInterference

Proposition 5.1 under literally identical groups. Along a sequence of identical-groups experiments R — common size, allocation strategies, potential outcomes, and unit counts — sharing one group-level treatment-minus-control direct-effect contrast δ with a positive common within-group variance, a uniform bound M on the centered per-group contrast estimator, every supported stage-1 selection flagging exactly C groups, and the many-groups rate M/√(C·v) → 0 together with its Lyapunov cube card·(M/√(C·v))³ → 0the studentized contrast statistic is asymptotically standard normal. No analytic homogeneity hypothesis is assumed: it is derived from the concrete identical-groups structure via hhom_of_identical.

Formal statement
R :
ℕ → IdenticalRef
t δ M :
:
∀ n, (R n).refDelta = δ
hvpos :
∀ n, 0 < (R n).refVar
hMbound :
∀ n i w, |groupDiff (R n).toExp i w - δ| ≤ M
hcount :
∀ n s
if
(R n).toExp.D₁.p s ≠ 0
then
(∑ i, if s i then (1 : ℝ) else 0) = (R n).toExp.C
hB0 :
Tendsto (fun n => M / sqrt ((R n).toExp.C * (R n).refVar)) atTop (𝓝 0)
hNB3 :
Tendsto (fun n => (card (R n).toExp.ι : ℝ) * (M / sqrt ((R n).toExp.C * (R n).refVar)) ^ 3) atTop (𝓝 0)
Tendsto (fun n => (R n).toExp.jointD.Pr (fun sw => (R n).studId sw ≤ t)) atTop (𝓝 (stdNormalCdf t))
Proof (Lean source)
theorem directEffect_clt_identical (R : ℕ → IdenticalRef) (t δ M : ℝ) (hδ : ∀ n, (R n).refDelta = δ) (hvpos : ∀ n, 0 < (R n).refVar) (hMbound : ∀ n i w, |groupDiff (R n).toExp i w - δ| ≤ M) (hcount : ∀ n s, (R n).toExp.D₁.p s ≠ 0 → (∑ i, if s i then (1 : ℝ) else 0) = (R n).toExp.C) (hB0 : Tendsto (fun n => M / sqrt ((R n).toExp.C * (R n).refVar)) atTop (𝓝 0)) (hNB3 : Tendsto (fun n => (card (R n).toExp.ι : ℝ) * (M / sqrt ((R n).toExp.C * (R n).refVar)) ^ 3) atTop (𝓝 0)) : Tendsto (fun n => (R n).toExp.jointD.Pr (fun sw => (R n).studId sw ≤ t)) atTop (𝓝 (stdNormalCdf t)) := directEffect_clt_homogeneous (homogeneous_of_identical R t δ M hδ hvpos hMbound hcount hB0 hNB3)
8 supporting declarations (lemmas, instances)
  • exists_equiv_selection lemma — Selection-symmetry permutation. Given two Boolean selections s, s' on a finite type ι that flag the same number of indices (card {i | s i} = card {i | s' i}), there is a permutation σ : ι ≃ ι aligning their patterns: s' i = s (σ i) for every i. Built by gluing a bijection of the selected sets (equal cardinality) with a bijection of their complements (equal cardinality, since the total is fixed) through Equiv.sumCompl.
    ι :
    Type*
    s s' :
    ι → Bool
    hcard :
    (Finset.univ.filter (fun i => s i = true)).card
    = (Finset.univ.filter (fun i => s' i = true)).card
    ∃ σ : ι ≃ ι, ∀ i, s' i = s (σ i)
    Proof (Lean source)
    lemma exists_equiv_selection {ι : Type*} [Fintype ι] (s s' : ι → Bool) (hcard : (Finset.univ.filter (fun i => s i = true)).card = (Finset.univ.filter (fun i => s' i = true)).card) : ∃ σ : ι ≃ ι, ∀ i, s' i = s (σ i) := by classical -- Predicates with the carried `Fintype`/`DecidablePred` instances. -- True-sets have equal cardinality (`hcard`); complements then also (total `card ι` fixed). have hcardT : card {i // s' i = true} = card {i // s i = true} := by simp only [Fintype.card_subtype] exact hcard.symm have hcardF : card {i // ¬ s' i = true} = card {i // ¬ s i = true} := by have h1 := Fintype.card_subtype_compl (fun i => s' i = true) have h2 := Fintype.card_subtype_compl (fun i => s i = true) rw [h1, h2, hcardT] -- Bijections of selected sets and of complements. let eT : {i // s' i = true} ≃ {i // s i = true} := Fintype.equivOfCardEq hcardT let eF : {i // ¬ s' i = true} ≃ {i // ¬ s i = true} := Fintype.equivOfCardEq hcardF -- Glue via `sumCompl` on both sides. let σ : ι ≃ ι := (Equiv.sumCompl (fun i => s' i = true)).symm.trans ((eT.sumCongr eF).trans (Equiv.sumCompl (fun i => s i = true))) refine ⟨σ, fun i => ?_⟩ -- Compute `σ i` explicitly: it is the underlying element of the image of `i` under the glued -- bijection, which by construction lies in the matching set of `s`. have hσ : ∀ i, σ i = (Equiv.sumCompl (fun i => s i = true)) ((eT.sumCongr eF) ((Equiv.sumCompl (fun i => s' i = true)).symm i)) := fun i => rfl rw [hσ] -- Case on `s' i`; in each branch `σ i` lands in the matching set of `s`. by_cases hi : s' i = true · rw [Equiv.sumCompl_symm_apply_of_pos (p := fun i => s' i = true) hi] rw [Equiv.sumCongr_apply, Sum.map_inl, Equiv.sumCompl_apply_inl] exact hi.trans ((eT ⟨i, hi⟩).2).symm · rw [Equiv.sumCompl_symm_apply_of_neg (p := fun i => s' i = true) hi] rw [Equiv.sumCongr_apply, Sum.map_inr, Equiv.sumCompl_apply_inr] have hF : s (↑(eF ⟨i, hi⟩)) = false := Bool.not_eq_true _ ▸ (eF ⟨i, hi⟩).2 rw [hF]; simpa using hi
    Causalean.Experimentation.TwoStageInterference.exists_equiv_selection · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:63
  • groupDiff_toExp lemma — In the constant experiment, every group's contrast estimator equals the common groupDiff₀.
    R :
    shared
    i :
    R.ι
    groupDiff R.toExp i = R.groupDiff₀
    Proof (Lean source)
    lemma groupDiff_toExp (i : R.ι) : groupDiff R.toExp i = R.groupDiff₀ := by rfl
    Causalean.Experimentation.TwoStageInterference.IdenticalRef.groupDiff_toExp · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:203
  • condDesign_toExp lemma — The conditional design of the constant experiment is the genuine product, over the non-dependent space R.ι → (Fin K → Bool), of the per-group strategy designs.
    R :
    shared
    s :
    condDesign R.toExp s = prodDesign (fun i => if s i then R.ψ₀ else R.φ₀)
    Proof (Lean source)
    lemma condDesign_toExp (s : StratAssign R.ι) : condDesign R.toExp s = prodDesign (fun i => if s i then R.ψ₀ else R.φ₀) := rfl
    Causalean.Experimentation.TwoStageInterference.IdenticalRef.condDesign_toExp · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:207
  • estD_equivariant lemma — Estimator equivariance. Because all groups are identical, the aggregate contrast estimator sees a selection only through its pattern: if σ aligns the patterns of s' and s (s' i = s (σ i)), then evaluating at s' and the relabeled assignment w ∘ σ equals the value at s and w.
    R :
    shared
    s s' :
    σ :
    R.ι ≃ R.ι
    :
    ∀ i, s' i = s (σ i)
    w :
    R.ι → (Fin R.K → Bool)
    R.toExp.estD (s', fun i => w (σ i)) = R.toExp.estD (s, w)
    Proof (Lean source)
    lemma estD_equivariant (s s' : StratAssign R.ι) (σ : R.ι ≃ R.ι) (hσ : ∀ i, s' i = s (σ i)) (w : R.ι → (Fin R.K → Bool)) : R.toExp.estD (s', fun i => w (σ i)) = R.toExp.estD (s, w) := by rw [estD_eq_agg R.toExp s' (fun i => w (σ i)), estD_eq_agg R.toExp s w] congr 1 refine Fintype.sum_equiv σ (fun i => (if s' i then (1 : ℝ) else 0) * groupDiff R.toExp i (w (σ i))) (fun i => (if s i then (1 : ℝ) else 0) * groupDiff R.toExp i (w i)) (fun i => ?_) simp only [groupDiff_toExp, hσ i]
    Causalean.Experimentation.TwoStageInterference.IdenticalRef.estD_equivariant · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:220
  • studId_equivariant lemma — Studentized equivariance. The studentized statistic is likewise selection-pattern equivariant, since DEbar and directVar are scalars and the estimator is equivariant.
    R :
    shared
    s s' :
    σ :
    R.ι ≃ R.ι
    :
    ∀ i, s' i = s (σ i)
    w :
    R.ι → (Fin R.K → Bool)
    R.studId (s', fun i => w (σ i)) = R.studId (s, w)
    Proof (Lean source)
    lemma studId_equivariant (s s' : StratAssign R.ι) (σ : R.ι ≃ R.ι) (hσ : ∀ i, s' i = s (σ i)) (w : R.ι → (Fin R.K → Bool)) : R.studId (s', fun i => w (σ i)) = R.studId (s, w) := by unfold studId congr 2 exact estD_equivariant R s s' σ hσ w
    Causalean.Experimentation.TwoStageInterference.IdenticalRef.studId_equivariant · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:234
  • hhom_of_identical lemma — Derived homogeneity hypothesis under identical groups. For two stage-1 selections each flagging exactly C groups, the conditional studentized CDF is the same. This is exactly the analytic homogeneity hypothesis hhom, now a theorem: the selection-symmetry permutation σ (exists_equiv_selection) relabels the conditional product design (prodDesign_Pr_reindex) while carrying the studentized statistic (studId_equivariant), so the two CDFs coincide.
    R :
    shared
    t :
    s s' :
    hs :
    (∑ i, if s i then (1 : ℝ) else 0) = R.C
    hs' :
    (∑ i, if s' i then (1 : ℝ) else 0) = R.C
    (condDesign R.toExp s).Pr (fun w => R.studId (s, w) ≤ t)
    = (condDesign R.toExp s').Pr (fun w => R.studId (s', w) ≤ t)
    Proof (Lean source)
    lemma hhom_of_identical (t : ℝ) (s s' : StratAssign R.ι) (hs : (∑ i, if s i then (1 : ℝ) else 0) = R.C) (hs' : (∑ i, if s' i then (1 : ℝ) else 0) = R.C) : (condDesign R.toExp s).Pr (fun w => R.studId (s, w) ≤ t) = (condDesign R.toExp s').Pr (fun w => R.studId (s', w) ≤ t) := by -- The two selections flag the same number of groups, so their selected sets have equal card. have hsum : (∑ i, if s i then (1 : ℝ) else 0) = (∑ i, if s' i then (1 : ℝ) else 0) := by rw [hs, hs'] have hcardℝ : ((Finset.univ.filter (fun i => s i = true)).card : ℝ) = ((Finset.univ.filter (fun i => s' i = true)).card : ℝ) := by have e : ∀ u : StratAssign R.ι, (∑ i, if u i then (1 : ℝ) else 0) = ((Finset.univ.filter (fun i => u i = true)).card : ℝ) := by intro u rw [Finset.sum_ite, Finset.sum_const, Finset.sum_const_zero, add_zero, nsmul_eq_mul, mul_one] rw [← e s, ← e s', hsum] have hcard : (Finset.univ.filter (fun i => s i = true)).card = (Finset.univ.filter (fun i => s' i = true)).card := by exact_mod_cast hcardℝ -- The selection-symmetry permutation aligning `s'` to `s`. obtain ⟨σ, hσ⟩ := exists_equiv_selection s s' hcard -- Relabel `condDesign s'` to `condDesign s` via `prodDesign_Pr_reindex`, carrying the statistic. rw [condDesign_toExp, condDesign_toExp] -- The permuted product `D ∘ σ` equals the conditional design at `s'` (since `s' i = s (σ i)`). have hdesign : (fun i => if s (σ i) then R.ψ₀ else R.φ₀) = (fun i => if s' i then R.ψ₀ else R.φ₀) := by funext i; rw [hσ i] calc (prodDesign (fun i => if s i then R.ψ₀ else R.φ₀)).Pr (fun w => R.studId (s, w) ≤ t) = (prodDesign (fun i => if s i then R.ψ₀ else R.φ₀)).Pr (fun w => R.studId (s', fun i => w (σ i)) ≤ t) := FiniteDesign.Pr_congr _ _ _ (fun w => by rw [studId_equivariant R s s' σ hσ w]) _ = (prodDesign (fun i => (fun i => if s i then R.ψ₀ else R.φ₀) (σ i))).Pr (fun w => R.studId (s', w) ≤ t) := FiniteDesign.prodDesign_Pr_reindex σ (fun i => if s i then R.ψ₀ else R.φ₀) (fun w => R.studId (s', w) ≤ t) _ = (prodDesign (fun i => if s' i then R.ψ₀ else R.φ₀)).Pr (fun w => R.studId (s', w) ≤ t) := by rw [hdesign]
    Causalean.Experimentation.TwoStageInterference.IdenticalRef.hhom_of_identical · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:244
  • hδ_toExp lemma — In the constant experiment every group's level contrast equals the common refDelta.
    R :
    shared
    i :
    R.ι
    groupMean R.toExp.ψ R.toExp.Y i true - groupMean R.toExp.ψ R.toExp.Y i false = R.refDelta
    Proof (Lean source)
    lemma hδ_toExp (i : R.ι) : groupMean R.toExp.ψ R.toExp.Y i true - groupMean R.toExp.ψ R.toExp.Y i false = R.refDelta := by rfl
    Causalean.Experimentation.TwoStageInterference.IdenticalRef.hδ_toExp · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:306
  • hv_toExp lemma — In the constant experiment every group's within-group variance equals the common refVar.
    R :
    shared
    i :
    R.ι
    (R.toExp.ψ i).Var (groupDiff R.toExp i) = R.refVar
    Proof (Lean source)
    lemma hv_toExp (i : R.ι) : (R.toExp.ψ i).Var (groupDiff R.toExp i) = R.refVar := by rfl
    Causalean.Experimentation.TwoStageInterference.IdenticalRef.hv_toExp · Causalean/Experimentation/TwoStageInterference/Asymptotic/Identical.lean:311
Wald 1 core · 0 supporting Oracle Wald intervals for Liu-Hudgens treatment-minus-control direct-effect contrasts have asymptotic coverage from the CLT. ★ wald_coverage_oracle

Oracle Wald coverage

Oracle Wald intervals for Liu-Hudgens treatment-minus-control direct-effect contrasts have asymptotic coverage from the CLT.

The public theorem wald_coverage_oracle proves the lower-coverage result for intervals using the true design variance. It takes the two one-sided studentized CLT limits at the normal quantile and its negative as inputs, then converts the event |stud| ≤ zq into coverage of DEbar by multiplying through the positive square-root design variance.

theorem wald_coverage_oracle reviewed
Causalean.Experimentation.TwoStageInterference

Asymptotic oracle Wald coverage (Liu–Hudgens 2014). Along a sequence of two-stage Hudgens–Halloran experiments Exp, let stud n be the studentized statistic (D̂E − DE̅)/√directVar for the treatment-minus-control direct-effect contrast, and assume the design variance is everywhere positive. Let zq ≥ 0 be the standard-normal upper quantile at level γ, i.e. Φ(zq) = 1 − γ/2, and assume the two studentized-CDF limits of stud at zq and −zq converge to Φ(zq) and Φ(−zq) — exactly the conclusion of the direct-contrast CLT. Then the oracle Wald interval D̂E ± zq·√directVar attains asymptotic coverage of DE̅ at least 1 − γ.

Formal statement
Exp :
ℕ → LHExperiment
stud :
∀ n
if
(StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool)
then
hstud :
∀ n sw, stud n sw = ((Exp n).estD sw - (Exp n).DEbar) / sqrt ((Exp n).directVar)
hVar :
∀ n, 0 < (Exp n).directVar
γ :
zq :
hzq0 :
0 ≤ zq
hzq :
stdNormalCdf zq = 1 - γ / 2
hcltPos :
Tendsto (fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ zq)) atTop (𝓝 (stdNormalCdf zq))
hcltNeg :
Tendsto (fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ -zq)) atTop (𝓝 (stdNormalCdf (-zq)))
1 - γ
liminf (fun n => (Exp n).jointD.Pr (fun sw => |(Exp n).estD sw - (Exp n).DEbar| ≤ zq * sqrt ((Exp n).directVar))) atTop
Proof (Lean source)
theorem wald_coverage_oracle (Exp : ℕ → LHExperiment) (stud : ∀ n, (StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool) → ℝ) (hstud : ∀ n sw, stud n sw = ((Exp n).estD sw - (Exp n).DEbar) / sqrt ((Exp n).directVar)) (hVar : ∀ n, 0 < (Exp n).directVar) {γ : ℝ} (zq : ℝ) (hzq0 : 0 ≤ zq) (hzq : stdNormalCdf zq = 1 - γ / 2) (hcltPos : Tendsto (fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ zq)) atTop (𝓝 (stdNormalCdf zq))) (hcltNeg : Tendsto (fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ -zq)) atTop (𝓝 (stdNormalCdf (-zq)))) : 1 - γ ≤ liminf (fun n => (Exp n).jointD.Pr (fun sw => |(Exp n).estD sw - (Exp n).DEbar| ≤ zq * sqrt ((Exp n).directVar))) atTop := by -- The studentized lower-CDF probabilities at `zq` and `-zq`. set S : ℕ → ℝ := fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ zq) with hSdef set Lo : ℕ → ℝ := fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ -zq) with hLodef set I : ℕ → ℝ := fun n => (Exp n).jointD.Pr (fun sw => |(Exp n).estD sw - (Exp n).DEbar| ≤ zq * sqrt ((Exp n).directVar)) with hIdef -- (1) Limit of `S - Lo`. have hlim : Tendsto (fun n => S n - Lo n) atTop (𝓝 (1 - γ)) := by have h := hcltPos.sub hcltNeg rw [stdNormalCdf_neg zq, hzq] at h have he : (1 - γ / 2) - (1 - (1 - γ / 2)) = 1 - γ := by ring rwa [he] at h -- (2) Pointwise lower bound `S - Lo ≤ I`. have hbound : ∀ n, S n - Lo n ≤ I n := by intro n -- Abbreviate the studentized statistic and the square-root denominator. set W : (StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool) → ℝ := fun sw => stud n sw with hWdef -- Split `S` by the event `W ≤ -zq`. have hsplit := (Exp n).jointD.Pr_split (fun sw => W sw ≤ zq) (fun sw => W sw ≤ -zq) -- The first piece equals `Lo`. have hfirst : (Exp n).jointD.Pr (fun sw => W sw ≤ zq ∧ W sw ≤ -zq) = Lo n := by apply (Exp n).jointD.Pr_congr intro sw constructor · exact fun h => h.2 · intro h2 exact ⟨le_trans h2 (by linarith [hzq0]), h2⟩ -- So `S - Lo` is the probability of the second piece. have hSLo : S n - Lo n = (Exp n).jointD.Pr (fun sw => W sw ≤ zq ∧ ¬ W sw ≤ -zq) := by have : S n = (Exp n).jointD.Pr (fun sw => W sw ≤ zq ∧ W sw ≤ -zq) + (Exp n).jointD.Pr (fun sw => W sw ≤ zq ∧ ¬ W sw ≤ -zq) := hsplit rw [this, hfirst]; ring rw [hSLo] -- That second piece is contained in `I`'s event. apply (Exp n).jointD.Pr_mono intro sw hz obtain ⟨hz1, hz2⟩ := hz rw [not_le] at hz2 -- `|W sw| ≤ zq`. have habs : |W sw| ≤ zq := abs_le.mpr ⟨le_of_lt hz2, hz1⟩ -- Unfold the studentized statistic. set s : ℝ := sqrt ((Exp n).directVar) with hsdef have hs : 0 < s := Real.sqrt_pos.mpr (hVar n) rw [hWdef] at habs simp only at habs rw [hstud n sw, ← hsdef] at habs rw [abs_div, abs_of_pos hs, div_le_iff₀ hs] at habs exact habs -- (3) Conclude with liminf. have hbdd : IsBoundedUnder (· ≥ ·) atTop (fun n => S n - Lo n) := hlim.isBoundedUnder_ge have hcobdd : IsCoboundedUnder (· ≥ ·) atTop I := isCoboundedUnder_ge_of_le atTop (x := (1 : ℝ)) (fun n => (Exp n).jointD.Pr_le_one _) calc 1 - γ = liminf (fun n => S n - Lo n) atTop := hlim.liminf_eq.symm _ ≤ liminf I atTop := Filter.liminf_le_liminf (Filter.Eventually.of_forall hbound) hbdd hcobdd
Wald­Feasible 1 core · 0 supporting Feasible Wald intervals retain asymptotic coverage when the estimated variance does not undershoot. ★ wald_coverage_feasible

Feasible Wald coverage

Feasible Wald intervals retain asymptotic coverage when the estimated variance does not undershoot.

The helper lemma clt_interval_liminf_lb turns per-threshold CLT limits into a lower bound for two-sided studentized bands. The public theorem wald_coverage_feasible then combines that band bound with a conservative-consistency hypothesis on the variance estimator Vh, proving asymptotic lower coverage for intervals of the form estD ± zq * sqrt (Vh).

theorem wald_coverage_feasible reviewed
Causalean.Experimentation.TwoStageInterference

Asymptotic feasible Wald coverage (Liu–Hudgens 2014). Along a sequence of two-stage Hudgens–Halloran experiments Exp, let stud n be the studentized statistic (D̂E − DE̅)/√directVar for the treatment-minus-control direct-effect contrast, and assume its per-threshold CDF converges to the standard normal CDF at every threshold and the design variance is everywhere positive. Let Vh n be an arbitrary variance estimator that is conservative-consistent — for every slack ε > 0 the probability it undershoots (1−ε) times the true variance tends to zero, and let zq ≥ 0 be the standard-normal upper quantile at level γ, Φ(zq) = 1 − γ/2. Then the feasible Wald interval D̂E ± zq·√(Vh) attains asymptotic coverage of DE̅ at least 1 − γ.

Formal statement
Exp :
ℕ → LHExperiment
stud :
∀ n
if
(StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool)
then
hstud :
∀ n sw, stud n sw = ((Exp n).estD sw - (Exp n).DEbar) / sqrt ((Exp n).directVar)
Vh :
∀ n
if
(StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool)
then
hclt :
∀ t,
Tendsto (fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ t)) atTop (𝓝 (stdNormalCdf t))
hVar :
∀ n, 0 < (Exp n).directVar
hVhat :
∀ ε : ℝ
if
0 < ε
then
Tendsto (fun n => (Exp n).jointD.Pr (fun sw => Vh n sw < (1 - ε) * (Exp n).directVar)) atTop (𝓝 0)
γ :
zq :
hzq0 :
0 ≤ zq
hzq :
stdNormalCdf zq = 1 - γ / 2
1 - γ
liminf (fun n => (Exp n).jointD.Pr (fun sw => |(Exp n).estD sw - (Exp n).DEbar| ≤ zq * sqrt (Vh n sw))) atTop
Proof (Lean source)
theorem wald_coverage_feasible (Exp : ℕ → LHExperiment) (stud : ∀ n, (StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool) → ℝ) (hstud : ∀ n sw, stud n sw = ((Exp n).estD sw - (Exp n).DEbar) / Real.sqrt ((Exp n).directVar)) (Vh : ∀ n, (StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool) → ℝ) (hclt : ∀ t, Tendsto (fun n => (Exp n).jointD.Pr (fun sw => stud n sw ≤ t)) atTop (𝓝 (stdNormalCdf t))) (hVar : ∀ n, 0 < (Exp n).directVar) (hVhat : ∀ ε : ℝ, 0 < ε → Tendsto (fun n => (Exp n).jointD.Pr (fun sw => Vh n sw < (1 - ε) * (Exp n).directVar)) atTop (𝓝 0)) {γ : ℝ} (zq : ℝ) (hzq0 : 0 ≤ zq) (hzq : stdNormalCdf zq = 1 - γ / 2) : 1 - γ ≤ liminf (fun n => (Exp n).jointD.Pr (fun sw => |(Exp n).estD sw - (Exp n).DEbar| ≤ zq * Real.sqrt (Vh n sw))) atTop := by -- The coverage probability sequence. set I : ℕ → ℝ := fun n => (Exp n).jointD.Pr (fun sw => |(Exp n).estD sw - (Exp n).DEbar| ≤ zq * Real.sqrt (Vh n sw)) with hIdef -- `I` is coboundedly below (always ≤ 1). have hIcobdd : IsCoboundedUnder (· ≥ ·) atTop I := isCoboundedUnder_ge_of_le atTop (x := (1 : ℝ)) (fun n => (Exp n).jointD.Pr_le_one _) -- For each `ε ∈ (0,1)`, `liminf I ≥ 2·Φ(zq·√(1-ε)) - 1`. have key : ∀ ε : ℝ, 0 < ε → ε < 1 → 2 * stdNormalCdf (zq * Real.sqrt (1 - ε)) - 1 ≤ liminf I atTop := by intro ε hε0 hε1 set c : ℝ := zq * Real.sqrt (1 - ε) with hcdef have h1mε : (0 : ℝ) < 1 - ε := by linarith have hc0 : 0 ≤ c := mul_nonneg hzq0 (Real.sqrt_nonneg _) -- The CLT band probability and the "bad variance" probability. set B : ℕ → ℝ := fun n => (Exp n).jointD.Pr (fun sw => -c ≤ stud n sw ∧ stud n sw ≤ c) with hBdef set A : ℕ → ℝ := fun n => (Exp n).jointD.Pr (fun sw => Vh n sw < (1 - ε) * (Exp n).directVar) with hAdef have hA0 : Tendsto A atTop (𝓝 0) := hVhat ε hε0 -- STEP 2: pointwise `B n - A n ≤ I n`. have hstep2 : ∀ n, B n - A n ≤ I n := by intro n set Vr : ℝ := (Exp n).directVar with hVrdef set σ : ℝ := Real.sqrt Vr with hσdef have hσpos : 0 < σ := Real.sqrt_pos.mpr (hVar n) set W : (StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool) → ℝ := fun sw => stud n sw with hWdef -- Split `B` by the bad-variance event. set Abad : (StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool) → Prop := fun sw => Vh n sw < (1 - ε) * Vr with hAbaddef set Bev : (StratAssign (Exp n).ι × ∀ i, Fin ((Exp n).gsize i) → Bool) → Prop := fun sw => -c ≤ W sw ∧ W sw ≤ c with hBevdef have hsplit := (Exp n).jointD.Pr_split Bev Abad -- `Pr(Bev ∧ Abad) ≤ A n`. have hBA : (Exp n).jointD.Pr (fun sw => Bev sw ∧ Abad sw) ≤ A n := by apply (Exp n).jointD.Pr_mono; intro sw hz; exact hz.2 -- So `B n - A n ≤ Pr(Bev ∧ ¬Abad)`. have hBmA : B n - A n ≤ (Exp n).jointD.Pr (fun sw => Bev sw ∧ ¬ Abad sw) := by have hBeq : B n = (Exp n).jointD.Pr (fun sw => Bev sw ∧ Abad sw) + (Exp n).jointD.Pr (fun sw => Bev sw ∧ ¬ Abad sw) := hsplit linarith [hBeq, hBA] refine le_trans hBmA ?_ -- `Pr(Bev ∧ ¬Abad) ≤ I n` by event inclusion. apply (Exp n).jointD.Pr_mono intro sw hz obtain ⟨⟨hzlo, hzhi⟩, hznotbad⟩ := hz rw [hAbaddef, not_lt] at hznotbad -- `|W sw| ≤ c`. have habsW : |W sw| ≤ c := abs_le.mpr ⟨hzlo, hzhi⟩ -- `estD - DEbar = W sw * σ`. have hWσ : (Exp n).estD sw - (Exp n).DEbar = W sw * σ := by change (Exp n).estD sw - (Exp n).DEbar = stud n sw * σ rw [hstud n sw, ← hVrdef, ← hσdef] field_simp rw [hWσ, abs_mul, abs_of_pos hσpos] -- `|W sw| * σ ≤ c * σ = zq * √((1-ε)*Vr) ≤ zq * √(V̂)`. calc |W sw| * σ ≤ c * σ := by apply mul_le_mul_of_nonneg_right habsW hσpos.le _ = zq * Real.sqrt ((1 - ε) * Vr) := by rw [hcdef, hσdef, mul_assoc, ← Real.sqrt_mul h1mε.le] _ ≤ zq * Real.sqrt (Vh n sw) := by apply mul_le_mul_of_nonneg_left _ hzq0 exact Real.sqrt_le_sqrt hznotbad -- STEP 3: liminf chain. -- `liminf B ≤ liminf (B - A)` since `A → 0`. have hBAliminf : liminf B atTopliminf (fun n => B n - A n) atTop := by have hnegA : Tendsto (fun n => -A n) atTop (𝓝 0) := by simpa using hA0.neg have hBbdd_ge : IsBoundedUnder (· ≥ ·) atTop B := isBoundedUnder_of ⟨0, fun n => (Exp n).jointD.Pr_nonneg _⟩ have hBbdd_le : IsBoundedUnder (· ≤ ·) atTop B := isBoundedUnder_of ⟨1, fun n => (Exp n).jointD.Pr_le_one _⟩ have hnegAbdd_ge : IsBoundedUnder (· ≥ ·) atTop (fun n => -A n) := hnegA.isBoundedUnder_ge have hnegAcobdd : IsCoboundedUnder (· ≥ ·) atTop (fun n => -A n) := hnegA.isBoundedUnder_le.isCoboundedUnder_ge have h := le_liminf_add (u := B) (v := fun n => -A n) hBbdd_ge hBbdd_le hnegAbdd_ge hnegAcobdd rw [hnegA.liminf_eq] at h simp only [add_zero] at h have hsub : (B + fun n => -A n) = fun n => B n - A n := by funext n; simp [sub_eq_add_neg] rwa [hsub] at h -- `liminf (B - A) ≤ liminf I` by pointwise bound. have hABI : liminf (fun n => B n - A n) atTopliminf I atTop := by have hBAbelow : IsBoundedUnder (· ≥ ·) atTop (fun n => B n - A n) := by refine isBoundedUnder_of ⟨-1, fun n => ?_⟩ have hBn : 0 ≤ B n := by rw [hBdef]; exact (Exp n).jointD.Pr_nonneg _ have hAn : A n ≤ 1 := by rw [hAdef]; exact (Exp n).jointD.Pr_le_one _ change (-1 : ℝ) ≤ B n - A n linarith exact Filter.liminf_le_liminf (Filter.Eventually.of_forall hstep2) hBAbelow hIcobdd -- STEP 1 gives `Φ(c) - Φ(-c) ≤ liminf B`. have hstep1 := clt_interval_liminf_lb Exp stud hclt c hc0 -- Chain and rewrite `Φ(c) - Φ(-c) = 2·Φ(c) - 1`. have hΦ : stdNormalCdf c - stdNormalCdf (-c) = 2 * stdNormalCdf c - 1 := by rw [stdNormalCdf_neg c]; ring calc 2 * stdNormalCdf (zq * Real.sqrt (1 - ε)) - 1 = stdNormalCdf c - stdNormalCdf (-c) := by rw [hcdef, hΦ] _ ≤ liminf B atTop := hstep1 _ ≤ liminf (fun n => B n - A n) atTop := hBAliminf _ ≤ liminf I atTop := hABI -- STEP 4: let `ε → 0⁺` along `ε = 1/(k+1)`. The RHS bound tends to `1 - γ`. set g : ℝ → ℝ := fun ε => 2 * stdNormalCdf (zq * Real.sqrt (1 - ε)) - 1 with hgdef have hgcont : Tendsto g (𝓝 0) (𝓝 (1 - γ)) := by have hsqrt : Tendsto (fun ε : ℝ => Real.sqrt (1 - ε)) (𝓝 0) (𝓝 1) := by have : Tendsto (fun ε : ℝ => (1 - ε)) (𝓝 0) (𝓝 (1 - 0)) := (tendsto_const_nhds.sub tendsto_id) rw [sub_zero] at this have hc := (Real.continuous_sqrt.tendsto (1 : ℝ)).comp this rw [Real.sqrt_one] at hc exact hc have hzqsqrt : Tendsto (fun ε : ℝ => zq * Real.sqrt (1 - ε)) (𝓝 0) (𝓝 zq) := by have := tendsto_const_nhds (x := zq) |>.mul hsqrt simpa using this have hΦc : Tendsto (fun ε : ℝ => stdNormalCdf (zq * Real.sqrt (1 - ε))) (𝓝 0) (𝓝 (stdNormalCdf zq)) := (continuous_stdNormalCdf.tendsto zq).comp hzqsqrt have : Tendsto g (𝓝 0) (𝓝 (2 * stdNormalCdf zq - 1)) := by rw [hgdef] exact (tendsto_const_nhds.mul hΦc).sub tendsto_const_nhds have heq : 2 * stdNormalCdf zq - 1 = 1 - γ := by rw [hzq]; ring rwa [heq] at this -- Evaluate along `ε_k = 1/(k+1) → 0`, eventually in `(0,1)`. have hseq : Tendsto (fun k : ℕ => (1 : ℝ) / (k + 1)) atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat have hgseq : Tendsto (fun k : ℕ => g (1 / (k + 1))) atTop (𝓝 (1 - γ)) := hgcont.comp hseq -- `g (1/(k+1)) ≤ liminf I` eventually (for `k ≥ 1`, so `1/(k+1) ≤ 1/2 < 1`). have hev : ∀ᶠ k : ℕ in atTop, g (1 / (k + 1)) ≤ liminf I atTop := by rw [Filter.eventually_atTop] refine ⟨1, fun k hk => ?_⟩ have hk1 : (1 : ℝ) ≤ (k : ℝ) := by exact_mod_cast hk have hden : (0 : ℝ) < (k : ℝ) + 1 := by linarith have hpos : (0 : ℝ) < 1 / (k + 1) := by positivity have hlt1 : (1 : ℝ) / (k + 1) < 1 := by rw [div_lt_one hden]; linarith exact key _ hpos hlt1 exact le_of_tendsto hgseq hev