Formalization: Graph-Adaptive Bernoulli Design for Bipartite Interference

The complete Lean development behind this paper — every definition, lemma, and theorem of its module, including helpers the paper text never cites. Identifiers link within this page, into the Causalean library, or out to the official Mathlib docs.

Basic 36 declarations BipartiteExperiment I O bundles the known bipartite graph G_n (as the intervention neighborhoods N i = N_i(G_n)) and the fixed potential-outcome schedule Yfun i (as a function of the treatment vector, later restricted to

Environment S2 — the bipartite interference / potential-outcome world

BipartiteExperiment I O bundles the known bipartite graph G_n (as the intervention neighborhoods N i = N_i(G_n)) and the fixed potential-outcome schedule Yfun i (as a function of the treatment vector, later restricted to N i by ass:bipartite-interference). The intervention index type I realizes I_n (and m_n = card I) and the outcome index type O realizes O_n (and n = card O).

structure BipartiteExperiment

A bipartite experiment: the known bipartite graph (via outcome-side neighborhoods) plus the fixed potential-outcome schedule.

Definition (Lean source)
I O :
Intervention neighborhood of each outcome unit.
N :
O → Finset I
Fixed potential-outcome schedule as a function of the treatment vector.
Yfun :
O → (I → Bool) → ℝ
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:49
def Y1

All-treated potential outcome Y_i^1 = Y_i(1_{N_i}).

Definition (Lean source)
noncomputable def Y1 (i : O) : ℝ := E.Yfun i (fun _ => true) -- @realizes Y_i^1(Yfun at all-treated)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.Y1 · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:61
def Y0

All-control potential outcome Y_i^0 = Y_i(0_{N_i}).

Definition (Lean source)
noncomputable def Y0 (i : O) : ℝ := E.Yfun i (fun _ => false) -- @realizes Y_i^0(Yfun at all-control)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.Y0 · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:64
def mu1

Finite-population all-treated mean μ_1 = n^{-1} ∑_i Y_i^1.

Definition (Lean source)
noncomputable def mu1 : ℝ := (Fintype.card O : ℝ)⁻¹ * ∑ i, E.Y1 i -- @realizes mu_1(mean of Y_i^1)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.mu1 · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:67
def mu0

Finite-population all-control mean μ_0 = n^{-1} ∑_i Y_i^0.

Definition (Lean source)
noncomputable def mu0 : ℝ := (Fintype.card O : ℝ)⁻¹ * ∑ i, E.Y0 i -- @realizes mu_0(mean of Y_i^0)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.mu0 · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:70
def tau

Target finite-population effect τ_n = μ_1 − μ_0.

Definition (Lean source)
noncomputable def tau : ℝ := E.mu1 - E.mu0 -- @realizes tau_n(mu_1 - mu_0)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.tau · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:73
def schedule

Potential-outcome schedule Y = ((Y_i^1, Y_i^0) : i ∈ O_n) ∈ ℝ^{2n}: the authoritative realization of the paper's fixed schedule symbol Y. Its ambient space ℝ^{2n} is carried by the pair-valued function O → ℝ × ℝ (each outcome unit i contributing the all-treated / all-control pair (Y_i^1, Y_i^0)), so the schedule's carrier O → ℝ × ℝ is (as a real vector space) ℝ^{card O} × ℝ^{card O} ≅ ℝ^{2n}.

Definition (Lean source)
noncomputable def schedule (i : O) : ℝ × ℝ := (E.Y1 i, E.Y0 i)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.schedule · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:76
def expT

All-treated exposure indicator T_i(Z) = ∏_{k∈N_i} Z_k.

Definition (Lean source)
noncomputable def expT (z : I → Bool) (i : O) : ℝ := ∏ k ∈ E.N i, (if z k then (1 : ℝ) else 0) -- @realizes T_i(Z)(product over N_i of Z_k); @realizes Z_k(coordinate assignment z k : Bool realizing {0,1} via if z k then 1 else 0); @realizes Z(assignment vector z : I→Bool = {0,1}^{m_n})
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.expT · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:84
def expC

All-control exposure indicator C_i(Z) = ∏_{k∈N_i} (1−Z_k).

Definition (Lean source)
noncomputable def expC (z : I → Bool) (i : O) : ℝ := ∏ k ∈ E.N i, (if z k then (0 : ℝ) else 1) -- @realizes C_i(Z)(product over N_i of 1−Z_k)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.expC · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:88
def piT

All-treated exposure probability π_i^1(p) = ∏_{k∈N_i} p_k.

Definition (Lean source)
noncomputable def piT (p : I → ℝ) (i : O) : ℝ := ∏ k ∈ E.N i, p k -- @realizes pi_i^1(p)(product over N_i of p_k; range (0,1] via p∈[0,1] from ProbVector/PositivityFloor)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.piT · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:92
def piC

All-control exposure probability π_i^0(p) = ∏_{k∈N_i} (1−p_k).

Definition (Lean source)
noncomputable def piC (p : I → ℝ) (i : O) : ℝ := ∏ k ∈ E.N i, (1 - p k) -- @realizes pi_i^0(p)(product over N_i of 1−p_k; range (0,1] via p∈[0,1] from ProbVector/PositivityFloor)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.piC · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:96
def deg

Outcome-side degree d_i = |N_i(G_n)|.

Definition (Lean source)
def deg (i : O) : ℕ := (E.N i).card -- @realizes d_i(card N_i)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.deg · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:100
def M

Outcome neighborhood of an intervention unit M_k(G_n) = {i : k ∈ N_i}.

Definition (Lean source)
def M (k : I) : Finset O := Finset.univ.filter (fun i => k ∈ E.N i) -- @realizes M_k(G_n)(outcome neighborhood)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.M · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:103
def sdeg

Intervention-side output degree s_k = |M_k(G_n)|.

Definition (Lean source)
def sdeg (k : I) : ℕ := (E.M k).card -- @realizes s_k(card M_k)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.sdeg · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:106
def shared

Shared intervention neighborhood S_{ij}(G_n) = N_i ∩ N_j.

Definition (Lean source)
def shared (i j : O) : Finset I := E.N i ∩ E.N j -- @realizes S_{ij}(G_n)(N_i ∩ N_j)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.shared · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:109
def overlapNbrs

Overlap-dependency neighbors of i: {j : S_{ij} ≠ ∅}.

Definition (Lean source)
def overlapNbrs (i : O) : Finset O := Finset.univ.filter (fun j => 0 < (E.shared i j).card) -- @realizes Delta_n(overlap neighbor set)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.overlapNbrs · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:112
def r1

Treated overlap load r_{ij}^1(G_n,p) = 1{S_{ij}≠∅}(∏_{k∈S_{ij}} p_k^{-1} − 1).

Definition (Lean source)
noncomputable def r1 (p : I → ℝ) (i j : O) : ℝ := if 0 < (E.shared i j).card then (∏ k ∈ E.shared i j, (p k)⁻¹) - 1 else 0
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r1 · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:116
def r0

Control overlap load r_{ij}^0(G_n,p) = 1{S_{ij}≠∅}(∏_{k∈S_{ij}} (1−p_k)^{-1} − 1).

Definition (Lean source)
noncomputable def r0 (p : I → ℝ) (i j : O) : ℝ := if 0 < (E.shared i j).card then (∏ k ∈ E.shared i j, (1 - p k)⁻¹) - 1 else 0
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r0 · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:121
def r10

Cross-arm overlap load r_{ij}^{10}(G_n) = 1{S_{ij}≠∅}.

Definition (Lean source)
noncomputable def r10 (i j : O) : ℝ := if 0 < (E.shared i j).card then 1 else 0 -- @realizes r_{ij}^{10}(G_n)(shared-neighborhood indicator)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r10 · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:126
def hajekDenominators Definition 2 in the paper ↗

Exposure-weighted Hájek denominators (D_1, D_0) with D_1 = ∑_i T_i/π_i^1 and D_0 = ∑_i C_i/π_i^0.

Definition (Lean source)
noncomputable def hajekDenominators (p : I → ℝ) (z : I → Bool) : ℝ × ℝ := -- @realizes D_1(p,Z)(first component ∑_i T_i(z)/π_i^1(p); space [0,∞): each `expT z i` is a product of -- `{0,1}`-valued factors, hence ≥ 0, and `piT p i > 0` on the feasible box ε ≤ p_k ≤ 1−ε) -- @realizes D_0(p,Z)(second component ∑_i C_i(z)/π_i^0(p); space [0,∞): each `expC z i` is a product of -- `{0,1}`-valued factors, hence ≥ 0, and `piC p i > 0` on the feasible box ε ≤ p_k ≤ 1−ε) (∑ i, E.expT z i / E.piT p i, ∑ i, E.expC z i / E.piC p i)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.hajekDenominators · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:131

The heterogeneous Bernoulli Hájek estimator with the explicit zero-denominator convention (each arm is 0 when its denominator vanishes).

Definition (Lean source)
noncomputable def hajekEstimator (p : I → ℝ) (z : I → Bool) : ℝ := (if 0 < (E.hajekDenominators p z).1 then (∑ i, E.expT z i * E.Yfun i z / E.piT p i) / (E.hajekDenominators p z).1 else 0) - (if 0 < (E.hajekDenominators p z).2 then (∑ i, E.expC z i * E.Yfun i z / E.piC p i) / (E.hajekDenominators p z).2 else 0)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.hajekEstimator · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:141

First-order heterogeneous Hájek linearization η_i = (T_i/π_i^1 − 1)(Y_i^1 − μ_1) − (C_i/π_i^0 − 1)(Y_i^0 − μ_0).

Definition (Lean source)
noncomputable def linScore (p : I → ℝ) (z : I → Bool) (i : O) : ℝ := (E.expT z i / E.piT p i - 1) * (E.Y1 i - E.mu1) - (E.expC z i / E.piC p i - 1) * (E.Y0 i - E.mu0)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.linScore · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:150

Asymptotic variance scale σ²_{G_n,p}(Y) = n · Var_p(n^{-1} ∑_i η_i) under the working design D (= bernoulliDesign p by ass:independent-heterogeneous-bernoulli).

Definition (Lean source)
noncomputable def varScale (D : FiniteDesign (I → Bool)) (p : I → ℝ) : ℝ := -- @realizes sigma_{G_n,p}^2(Y)(defining formula n · Var_p(n^{-1} ∑_i η_i); space [0,∞) since it is the -- nonnegative real `card O` times the design variance `FiniteDesign.Var`, itself a mean of squares) (Fintype.card O : ℝ) * D.Var (fun z => (Fintype.card O : ℝ)⁻¹ * ∑ i, E.linScore p z i)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.varScale · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:157
def ProbVector

Probability-vector well-formedness: every coordinate of the design variable lies in the unit interval, p ∈ [0,1]^{m_n}. This pins the declared space of the design variable p — the bare carrier I → ℝ does not force the [0,1] range, and every functional of p (π_i^1, π_i^0, r_{ij}^1, r_{ij}^0) inherits its range from this constraint (the positivity floor ε ≤ p_k ≤ 1 − ε further sharpens it to the open interval (0,1)).

Definition (Lean source)
def ProbVector (p : I → ℝ) : Prop := ∀ k, 0 ≤ p k ∧ p k ≤ 1 -- @realizes p(range p_k ∈ [0,1])
CausalSmith.Experimentation.BipartiteMinimaxDesign.ProbVector · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:179
def BipartiteInterference Assumption 1 in the paper ↗

Neighborhood SUTVA: Y_i depends on the treatment vector only through its restriction to N_i(G_n).

Definition (Lean source)
def BipartiteInterference (E : BipartiteExperiment I O) : Prop := ∀ (i : O) (z z' : I → Bool), (∀ k ∈ E.N i, z k = z' k) → E.Yfun i z = E.Yfun i z'
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteInterference · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:189
def IndepHeteroBernoulli Assumption 2 in the paper ↗

The working assignment law is the independent heterogeneous Bernoulli design: D = bernoulliDesign p (each Z_k independent Bernoulli(p_k)).

Definition (Lean source)
def IndepHeteroBernoulli (D : FiniteDesign (I → Bool)) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) : Prop := D = bernoulliDesign p hp0 hp1
CausalSmith.Experimentation.BipartiteMinimaxDesign.IndepHeteroBernoulli · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:195
def EpsilonAdmissible

Admissible positivity-floor domain: the global side-condition ε ∈ (0, 1/2) required by the paper's positivity floor. This pins the space of the floor symbol epsilon; without it the floor ε ≤ p_k ≤ 1 − ε fails to force p_k ∈ (0,1) and the uniform exposure-probability lower bounds ε^{d̄} > 0 are lost. Threaded into every statement that relies on strict overlap.

Definition (Lean source)
def EpsilonAdmissible (ε : ℝ) : Prop := 0 < ε ∧ ε < 1 / 2 -- @realizes epsilon(domain ε ∈ (0,1/2)); @realizes pi_i^1(p)(range (0,1] co-realizer: 0<ε<1/2 together with the floor ε≤p_k≤1−ε gives p_k∈(0,1), so 0<∏_{k∈N_i}p_k≤1); @realizes pi_i^0(p)(range (0,1] co-realizer: 0<ε<1/2 with the floor gives 1−p_k∈(0,1), so 0<∏_{k∈N_i}(1−p_k)≤1); @realizes V_env(G_n,p)(range [0,∞) co-realizer: 0<ε<1/2 with the floor gives p_k∈(0,1), so every load r_{ij}^1,r_{ij}^0,r_{ij}^{10}≥0 and V_env≥0); @realizes hat_V_cons(G_n,p)(range [0,∞) co-realizer: V̂_cons=V_env≥0 under the admissible ε-domain plus the floor)
CausalSmith.Experimentation.BipartiteMinimaxDesign.EpsilonAdmissible · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:202

Positivity floor: ε ≤ p_k ≤ 1 − ε for every intervention unit k. Its range-pinning force for π_i^1, π_i^0, V_env, V̂_cons is only released in conjunction with EpsilonAdmissible ε (which supplies 0 < ε < 1/2).

Definition (Lean source)
def PositivityFloor (ε : ℝ) (p : I → ℝ) : Prop := ∀ k, ε ≤ p k ∧ p k ≤ 1 - ε -- @realizes epsilon(floor ε ≤ p_k ≤ 1−ε); @realizes pi_i^1(p)(range (0,1] co-realizer, WITH EpsilonAdmissible ε: the floor ε≤p_k≤1−ε under 0<ε<1/2 makes 0<∏_{k∈N_i}p_k≤1; piT alone is the value, this clause plus EpsilonAdmissible pins its range); @realizes pi_i^0(p)(range (0,1] co-realizer, WITH EpsilonAdmissible ε: ε≤p_k≤1−ε and 0<ε<1/2 make 0<∏_{k∈N_i}(1−p_k)≤1); @realizes V_env(G_n,p)(range [0,∞) co-realizer, WITH EpsilonAdmissible ε: 0<ε≤p_k≤1−ε<1 ⟹ each load r_{ij}^1,r_{ij}^0,r_{ij}^{10}≥0, so V_env≥0); @realizes hat_V_cons(G_n,p)(range [0,∞) co-realizer, WITH EpsilonAdmissible ε: V̂_cons=V_env≥0 under the same admissible floor)
CausalSmith.Experimentation.BipartiteMinimaxDesign.PositivityFloor · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:217

Budget balance: the expected number of treated units is fixed at B_n, ∑_k p_k = B_n.

Definition (Lean source)
def BudgetBalance (B : ℝ) (p : I → ℝ) : Prop := ∑ k, p k = B -- @realizes B_n(budget hyperplane ∑ p_k = B_n; admissible interval carried by BudgetAdmissible)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BudgetBalance · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:224
def BudgetAdmissible

Admissible budget domain: B_n ∈ [m_n ε, m_n (1 − ε)]. This carries the declared space of the budget symbol B_nBudgetBalance alone only fixes the hyperplane ∑_k p_k = B_n and leaves B_n unconstrained, whereas the feasible set is nonempty (and the constant vector B_n/m_n lies in the box [ε,1−ε]^{m_n}) exactly when B_n lies in this interval.

Definition (Lean source)
def BudgetAdmissible (ε B : ℝ) : Prop := (Fintype.card I : ℝ) * ε ≤ B ∧ B ≤ (Fintype.card I : ℝ) * (1 - ε)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BudgetAdmissible · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:229

Bounded potential outcomes: |Y_i^1| ≤ 1 and |Y_i^0| ≤ 1.

Definition (Lean source)
def BoundedOutcomes (E : BipartiteExperiment I O) : Prop := ∀ i, |E.Y1 i| ≤ 1 ∧ |E.Y0 i| ≤ 1
CausalSmith.Experimentation.BipartiteMinimaxDesign.BoundedOutcomes · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:239
def BoundedOutcomeDegree Assumption 6 in the paper ↗

Bounded outcome-side degree: the constant is a positive real and max_i d_i ≤ d̄.

Definition (Lean source)
def BoundedOutcomeDegree (E : BipartiteExperiment I O) (dbar : ℝ) : Prop := 0 < dbar -- @realizes dbar(positive regularity constant, space (0,∞)) ∧ ∀ i, ((E.N i).card : ℝ) ≤ dbar -- @realizes dbar(uniform outcome-degree bound max d_i ≤ d̄)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BoundedOutcomeDegree · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:245
def BoundedOverlapDependency Assumption 7 in the paper ↗

Bounded overlap-dependency degree: the constant is a positive real and Δ_n ≤ D̄.

Definition (Lean source)
def BoundedOverlapDependency (E : BipartiteExperiment I O) (Dbar : ℝ) : Prop := 0 < Dbar -- @realizes Dbar(positive regularity constant, space (0,∞)) ∧ ∀ i, ((E.overlapNbrs i).card : ℝ) ≤ Dbar -- @realizes Dbar(uniform overlap-dependency bound Δ_n ≤ D̄)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BoundedOverlapDependency · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:252
def VarianceNondegenerate Assumption 8 in the paper ↗

Nondegenerate asymptotic design variance: liminf_n σ²_n > 0, encoded as an eventual uniform positive lower bound on the variance-scale sequence.

Definition (Lean source)
def VarianceNondegenerate (σ2 : ℕ → ℝ) : Prop := ∃ c : ℝ, 0 < c ∧ ∀ᶠ n in atTop, c ≤ σ2 n
CausalSmith.Experimentation.BipartiteMinimaxDesign.VarianceNondegenerate · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:259
structure FeasibleDesign

Feasible heterogeneous Bernoulli designs: the probability-vector membership p ∈ [0,1]^{m_n}, the positivity floor, and the budget balance bundled over a design variable p : I → ℝ. The prob field pins the declared ambient space of the class P_{n,B_n,ε} ⊆ [0,1]^{m_n} explicitly (the bare carrier I → ℝ and PositivityFloor/BudgetBalance alone leave the [0,1] box unenforced whenever the floor ε is not itself known admissible).

Definition (Lean source)
ε B :
p :
I → ℝ
Probability-vector membership `p ∈ [0,1]^{m_n}` (the class' ambient box).
prob :
Admissible floor domain `ε ∈ (0,1/2)`: the declared space of the floor symbol. Without it the `floor` field admits `ε ≤ 0` and the exposure probabilities `π_i^1(p), π_i^0(p)` are no longer pinned to `(0,1]`.
admissible :
Positivity floor `ε ≤ p_k ≤ 1 − ε`.
floor :
Budget balance `∑_k p_k = B`.
budget :
CausalSmith.Experimentation.BipartiteMinimaxDesign.FeasibleDesign · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:265
def feasibleSet

The feasible-design class P_{n,B_n,ε} as a subset of [0,1]^{m_n} (realized over the carrier I → ℝ, with the [0,1] box pinned by the prob field of FeasibleDesign).

Definition (Lean source)
def feasibleSet (ε B : ℝ) : Set (I → ℝ) := {p | FeasibleDesign ε B p}
CausalSmith.Experimentation.BipartiteMinimaxDesign.feasibleSet · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Basic.lean:283
Envelope 10 declarations

Graph-only conservative variance envelope V_env = 4 n^{-1} ∑_{i,j} {r_{ij}^1 + r_{ij}^0 + 2 r_{ij}^{10}}.

Definition (Lean source)
noncomputable def varEnvelope (p : I → ℝ) : ℝ := -- @realizes V_env(G_n,p)(defining formula 4 n^{-1} ∑_{i,j}{r_{ij}^1 + r_{ij}^0 + 2 r_{ij}^{10}}; space -- [0,∞) as a nonnegative multiple of a sum of the nonnegative overlap loads r1, r0, r10) 4 * (Fintype.card O : ℝ)⁻¹ * ∑ i, ∑ j, (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.varEnvelope · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Envelope.lean:32

Gradient of the normalized envelope V_env/4: g_k = n^{-1} ∑_{i,j : k∈S_{ij}} {−(∏_{ℓ∈S_{ij}} p_ℓ^{-1}) p_k^{-1} + (∏_{ℓ∈S_{ij}} (1−p_ℓ)^{-1}) (1−p_k)^{-1}}.

Definition (Lean source)
noncomputable def envelopeGrad (p : I → ℝ) (k : I) : ℝ := (Fintype.card O : ℝ)⁻¹ * ∑ i, ∑ j, (if k ∈ E.shared i j then -(∏ l ∈ E.shared i j, (p l)⁻¹) * (p k)⁻¹ + (∏ l ∈ E.shared i j, (1 - p l)⁻¹) * (1 - p k)⁻¹ else 0)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.envelopeGrad · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Envelope.lean:40

Graph-only conservative variance-scale estimator V̂_cons = V_env.

Definition (Lean source)
noncomputable def varEstCons (p : I → ℝ) : ℝ := E.varEnvelope p
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.varEstCons · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Envelope.lean:51
def hWeight

Observable degree-dispersion weight h_k(G_n) = n^{-1} ∑_{i,j : k∈S_{ij}} |S_{ij}|^{-1}.

Definition (Lean source)
noncomputable def hWeight (k : I) : ℝ := (Fintype.card O : ℝ)⁻¹ * ∑ i, ∑ j, (if k ∈ E.shared i j then ((E.shared i j).card : ℝ)⁻¹ else 0)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.hWeight · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Envelope.lean:55
def surrogateObjective

Additive degree-dispersion surrogate objective A(p) = ∑_k h_k(G_n){p_k^{-1} + (1−p_k)^{-1}}.

Definition (Lean source)
noncomputable def surrogateObjective (p : I → ℝ) : ℝ := ∑ k, E.hWeight k * ((p k)⁻¹ + (1 - p k)⁻¹)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.surrogateObjective · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Envelope.lean:61

Envelope-optimal design selector: any feasible minimizer of V_env, with a junk fallback (the homogeneous budget vector) when the argmin is empty.

Definition (Lean source)
noncomputable def optimalDesign (E : BipartiteExperiment I O) (ε B : ℝ) : I → ℝ := if h : ∃ p, p ∈ feasibleSet ε B ∧ ∀ q ∈ feasibleSet ε B, E.varEnvelope p ≤ E.varEnvelope q then h.choose else (fun _ => B / (Fintype.card I : ℝ))
CausalSmith.Experimentation.BipartiteMinimaxDesign.optimalDesign · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Envelope.lean:70
def envMin

The envelope minimum min_{p∈P} V_env(G_n,p), realized as the envelope value at the optimal design (the minimizer's value equals the minimum whenever it exists).

Definition (Lean source)
noncomputable def envMin (E : BipartiteExperiment I O) (ε B : ℝ) : ℝ := E.varEnvelope (optimalDesign E ε B)
CausalSmith.Experimentation.BipartiteMinimaxDesign.envMin · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Envelope.lean:77

Degree-dispersion surrogate design selector: any feasible minimizer of the additive surrogate objective A, with a junk fallback when the argmin is empty.

Definition (Lean source)
noncomputable def surrogateDesign (E : BipartiteExperiment I O) (ε B : ℝ) : I → ℝ := if h : ∃ p, p ∈ feasibleSet ε B ∧ ∀ q ∈ feasibleSet ε B, E.surrogateObjective p ≤ E.surrogateObjective q then h.choose else (fun _ => B / (Fintype.card I : ℝ))
CausalSmith.Experimentation.BipartiteMinimaxDesign.surrogateDesign · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Envelope.lean:84
def dirModulus

Directional second-order modulus of the normalized envelope V_env/4 along a budget-feasible direction d, over the feasible set: L_d = sup_{q∈P} g_q''(0) with g_q(t) = V_env(q + t·d)/4. This realizes the observable second-order modulus L_ab used in thm:heterogeneity-separation (the paper's directional Hessian modulus sup_{q∈P} (e_b−e_a)ᵀ Hess(V_env/4)(q) (e_b−e_a) along d = e_b − e_a).

Definition (Lean source)
noncomputable def dirModulus (E : BipartiteExperiment I O) (ε B : ℝ) (d : I → ℝ) : ℝ := ⨆ q : feasibleSet (I := I) ε B, deriv (deriv fun t : ℝ => E.varEnvelope (fun k => (q : I → ℝ) k + t * d k) / 4) 0
CausalSmith.Experimentation.BipartiteMinimaxDesign.dirModulus · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Envelope.lean:93

Observable approximation ratio α_cert = V_env(p^{deg}) / min_p V_env on the positive-minimum branch, with the no-loss convention α_cert = 1 when the envelope minimum is zero. Total and [1,∞)-valued.

Definition (Lean source)
noncomputable def approxRatio (E : BipartiteExperiment I O) (ε B : ℝ) : ℝ := if 0 < envMin E ε B then E.varEnvelope (surrogateDesign E ε B) / envMin E ε B else 1
CausalSmith.Experimentation.BipartiteMinimaxDesign.approxRatio · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Envelope.lean:106
Helpers.Denominator 3 declarations
theorem treatDenominator_zero_prob_le

The probability that the treated Hájek denominator is zero is bounded by the overlap-dependency and denominator-kernel bound divided by the number of outcomes.

Formal statement
ε B dbar Dbar :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hcardO :
0 < Fintype.card O
hdeg :
hdep :
q :
I → ℝ
hq0 :
∀ k, 0 ≤ q k
hq1 :
∀ k, q k ≤ 1
hq :
(bernoulliDesign q hq0 hq1).Pr (fun z => (E.hajekDenominators q z).1 = 0)
≤ Dbar * denominatorKernelBound ε dbar / (Fintype.card O : ℝ)
Proof (Lean source)
lemma treatDenominator_zero_prob_le (E : BipartiteExperiment I O) (ε B dbar Dbar : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hcardO : 0 < Fintype.card O) (hdeg : BoundedOutcomeDegree E dbar) (hdep : BoundedOverlapDependency E Dbar) (q : I → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1) (hq : FeasibleDesign ε B q) : (bernoulliDesign q hq0 hq1).Pr (fun z => (E.hajekDenominators q z).1 = 0) ≤ Dbar * denominatorKernelBound ε dbar / (Fintype.card O : ℝ) := by classical let D := bernoulliDesign q hq0 hq1 let X : (I → Bool) → ℝ := fun z => ∑ i, E.expT z i / E.piT q i let nR : ℝ := Fintype.card O have hnRpos : 0 < nR := by unfold nR exact_mod_cast hcardO have hpos : ∀ k, 0 < q k := fun k => lt_of_lt_of_le hε0 (hq.floor k).1 have hmean : D.E X = nR := by unfold D X nR exact treatDenominator_mean E q hq0 hq1 hpos have hmono : D.Pr (fun z => (E.hajekDenominators q z).1 = 0) ≤ D.Pr (fun z => nR ≤ |X z - D.E X|) := by apply D.Pr_mono intro z hz have hzX : X z = 0 := by simpa [X, BipartiteExperiment.hajekDenominators] using hz have habs : |X z - D.E X| = nR := by rw [hmean, hzX] simp [abs_of_nonneg hnRpos.le] exact le_of_eq habs.symm have hcheb : D.Pr (fun z => nR ≤ |X z - D.E X|) ≤ D.Var X / nR ^ 2 := D.chebyshev X hnRpos have hvar : D.Var X ≤ nR * (Dbar * denominatorKernelBound ε dbar) := by unfold D X nR exact treatDenominator_var_le E ε B dbar Dbar hε0 hε2 hdeg hdep q hq0 hq1 hq have hupper : D.Var X / nR ^ 2 ≤ Dbar * denominatorKernelBound ε dbar / nR := by calc D.Var X / nR ^ 2 ≤ (nR * (Dbar * denominatorKernelBound ε dbar)) / nR ^ 2 := div_le_div_of_nonneg_right hvar (sq_nonneg nR) _ = Dbar * denominatorKernelBound ε dbar / nR := by field_simp [ne_of_gt hnRpos] exact hmono.trans (hcheb.trans hupper)
CausalSmith.Experimentation.BipartiteMinimaxDesign.treatDenominator_zero_prob_le · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Denominator.lean:29
theorem ctrlDenominator_zero_prob_le

The probability that the control Hájek denominator is zero is bounded by the overlap-dependency and denominator-kernel bound divided by the number of outcomes.

Formal statement
ε B dbar Dbar :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hcardO :
0 < Fintype.card O
hdeg :
hdep :
q :
I → ℝ
hq0 :
∀ k, 0 ≤ q k
hq1 :
∀ k, q k ≤ 1
hq :
(bernoulliDesign q hq0 hq1).Pr (fun z => (E.hajekDenominators q z).2 = 0)
≤ Dbar * denominatorKernelBound ε dbar / (Fintype.card O : ℝ)
Proof (Lean source)
lemma ctrlDenominator_zero_prob_le (E : BipartiteExperiment I O) (ε B dbar Dbar : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hcardO : 0 < Fintype.card O) (hdeg : BoundedOutcomeDegree E dbar) (hdep : BoundedOverlapDependency E Dbar) (q : I → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1) (hq : FeasibleDesign ε B q) : (bernoulliDesign q hq0 hq1).Pr (fun z => (E.hajekDenominators q z).2 = 0) ≤ Dbar * denominatorKernelBound ε dbar / (Fintype.card O : ℝ) := by classical let D := bernoulliDesign q hq0 hq1 let X : (I → Bool) → ℝ := fun z => ∑ i, E.expC z i / E.piC q i let nR : ℝ := Fintype.card O have hnRpos : 0 < nR := by unfold nR exact_mod_cast hcardO have hlt : ∀ k, q k < 1 := fun k => by linarith [(hq.floor k).2, hε0] have hmean : D.E X = nR := by unfold D X nR exact ctrlDenominator_mean E q hq0 hq1 hlt have hmono : D.Pr (fun z => (E.hajekDenominators q z).2 = 0) ≤ D.Pr (fun z => nR ≤ |X z - D.E X|) := by apply D.Pr_mono intro z hz have hzX : X z = 0 := by simpa [X, BipartiteExperiment.hajekDenominators] using hz have habs : |X z - D.E X| = nR := by rw [hmean, hzX] simp [abs_of_nonneg hnRpos.le] exact le_of_eq habs.symm have hcheb : D.Pr (fun z => nR ≤ |X z - D.E X|) ≤ D.Var X / nR ^ 2 := D.chebyshev X hnRpos have hvar : D.Var X ≤ nR * (Dbar * denominatorKernelBound ε dbar) := by unfold D X nR exact ctrlDenominator_var_le E ε B dbar Dbar hε0 hε2 hdeg hdep q hq0 hq1 hq have hupper : D.Var X / nR ^ 2 ≤ Dbar * denominatorKernelBound ε dbar / nR := by calc D.Var X / nR ^ 2 ≤ (nR * (Dbar * denominatorKernelBound ε dbar)) / nR ^ 2 := div_le_div_of_nonneg_right hvar (sq_nonneg nR) _ = Dbar * denominatorKernelBound ε dbar / nR := by field_simp [ne_of_gt hnRpos] exact hmono.trans (hcheb.trans hupper)
CausalSmith.Experimentation.BipartiteMinimaxDesign.ctrlDenominator_zero_prob_le · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Denominator.lean:76
theorem denominator_positivity

Denominator positivity (eventual sequence-level O(n⁻¹) bound). This is the note's asymptotic claim sup_{q ∈ P_{n,B_n,ε}} P_q(D_1(q,Z) = 0 ∨ D_0(q,Z) = 0) = O(n^{-1}), rendered verbatim as a Big-O statement along the paper's sequence of bipartite experiments E n: the budget sequence B n (admissible at every stage) is fixed before the constant, exactly as the note fixes B_n inside the design class P_{n,B_n,ε}; there is then a constant C ≥ 0 such that, for all sufficiently large n, every feasible design q at stage n (i.e. the supremum over the design class P_{n,B_n,ε}) satisfies P_q(D_1 = 0 ∨ D_0 = 0) ≤ C / n.

Formal statement
Ix Ox :
ℕ → Type*
∀ n, Fintype (Ix n)
∀ n, Fintype (Ox n)
∀ n, DecidableEq (Ix n)
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
ε dbar Dbar :
@realizes B_n(carrier: the budget SEQUENCE, one budget per stage n, fixed before the rate constant exactly as the note fixes B_n inside P_{n,B_n,ε})
B :
ℕ → ℝ
@realizes B_n(cluster member: the authoritative admissible-interval predicate B_n ∈ [card I_n·ε, card I_n·(1−ε)] of `BudgetAdmissible`, pinning the B_n space at every stage independently of the FeasibleDesign hyperplane ∑ q_k = B_n)
_hB :
∀ n, BudgetAdmissible (I := Ix n) ε (B n)
@realizes O_n(carrier: the outcome-index set O_n = {1,…,n} of stage n, realized by the type `Ox n`) @realizes n(the core fixes O_n = {1,…,n}, so the stage index IS the outcome-population size: card (Ox n) = n)
hcard :
∀ n, card (Ox n) = n
hdeg :
∀ n, BoundedOutcomeDegree (E n) dbar
hdep :
∀ n, BoundedOverlapDependency (E n) Dbar
∃ C : ℝ
if
0 ≤ C ∧
∀ᶠ n in atTop,
∀ (q : Ix n → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1), FeasibleDesign ε (B n) q
then
(bernoulliDesign q hq0 hq1).Pr (fun z => ((E n).hajekDenominators q z).1 = 0 ∨ ((E n).hajekDenominators q z).2 = 0)
≤ C / (n : ℝ)
Proof (Lean source)
lemma denominator_positivity {Ix Ox : ℕ → Type*} [∀ n, Fintype (Ix n)] [∀ n, Fintype (Ox n)] [∀ n, DecidableEq (Ix n)] (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (ε dbar Dbar : ℝ) (hε : EpsilonAdmissible ε) -- @realizes B_n(carrier: the budget SEQUENCE, one budget per stage n, fixed before the rate constant exactly as the note fixes B_n inside P_{n,B_n,ε}) (B : ℕ → ℝ) -- @realizes B_n(cluster member: the authoritative admissible-interval predicate B_n ∈ [card I_n·ε, card I_n·(1−ε)] of `BudgetAdmissible`, pinning the B_n space at every stage independently of the FeasibleDesign hyperplane ∑ q_k = B_n) (_hB : ∀ n, BudgetAdmissible (I := Ix n) ε (B n)) -- @realizes O_n(carrier: the outcome-index set O_n = {1,…,n} of stage n, realized by the type `Ox n`) -- @realizes n(the core fixes O_n = {1,…,n}, so the stage index IS the outcome-population size: card (Ox n) = n) (hcard : ∀ n, card (Ox n) = n) (hdeg : ∀ n, BoundedOutcomeDegree (E n) dbar) (hdep : ∀ n, BoundedOverlapDependency (E n) Dbar) : ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ n in atTop, ∀ (q : Ix n → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1), FeasibleDesign ε (B n) q → -- @realizes P_{n,B_n,epsilon}(cluster member: the feasible-design predicate whose `prob` field pins q ∈ [0,1]^{m_n}, the ambient box of the design class P_{n,B_n,ε}, alongside the floor and budget clauses at the FIXED budget B n; the ∀-over-q IS the note's supremum over the class) (bernoulliDesign q hq0 hq1).Pr -- @realizes D_1(p,Z)(cluster member: `(hajekDenominators q z).1`, the [0,∞)-valued treated -- denominator, whose degenerate boundary value 0 this bound makes O(1/n)-rare) -- @realizes D_0(p,Z)(cluster member: `(hajekDenominators q z).2`, the [0,∞)-valued control -- denominator, whose degenerate boundary value 0 this bound makes O(1/n)-rare) (fun z => ((E n).hajekDenominators q z).1 = 0 ∨ ((E n).hajekDenominators q z).2 = 0) ≤ C / (n : ℝ) := by classical rcases hε with ⟨hε0, hε2⟩ refine ⟨2 * max 0 Dbar * denominatorKernelBound ε dbar, ?_, ?_⟩ · exact mul_nonneg (mul_nonneg (by positivity) (le_max_left _ _)) (denominatorKernelBound_nonneg hε0) · filter_upwards [eventually_ge_atTop 1] with n hn intro q hq0 hq1 hq have hcardO' : 0 < card (Ox n) := by rw [hcard n]; exact lt_of_lt_of_le Nat.zero_lt_one hn let D := bernoulliDesign q hq0 hq1 let nR : ℝ := card (Ox n) have hnR : nR = (n : ℝ) := by unfold nR; exact_mod_cast congrArg (Nat.cast : ℕ → ℝ) (hcard n) have hDbar : max 0 Dbar = Dbar := max_eq_right (hdep n).1.le have htreat := treatDenominator_zero_prob_le (E n) ε (B n) dbar Dbar hε0 hε2 hcardO' (hdeg n) (hdep n) q hq0 hq1 hq have hctrl := ctrlDenominator_zero_prob_le (E n) ε (B n) dbar Dbar hε0 hε2 hcardO' (hdeg n) (hdep n) q hq0 hq1 hq calc (bernoulliDesign q hq0 hq1).Pr (fun z => ((E n).hajekDenominators q z).1 = 0 ∨ ((E n).hajekDenominators q z).2 = 0) ≤ D.Pr (fun z => ((E n).hajekDenominators q z).1 = 0) + D.Pr (fun z => ((E n).hajekDenominators q z).2 = 0) := by exact FiniteDesign.Pr_or_le D _ _ _ ≤ Dbar * denominatorKernelBound ε dbar / nR + Dbar * denominatorKernelBound ε dbar / nR := by exact add_le_add htreat hctrl _ = (2 * max 0 Dbar * denominatorKernelBound ε dbar) / nR := by rw [hDbar] ring _ = (2 * max 0 Dbar * denominatorKernelBound ε dbar) / (n : ℝ) := by rw [hnR]
CausalSmith.Experimentation.BipartiteMinimaxDesign.denominator_positivity · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Denominator.lean:124
Helpers.DenominatorControl 1 declarations
theorem ctrlDenominator_var_le

The variance of the control Hájek denominator is bounded by the number of outcomes times the overlap-dependency and denominator-kernel bounds.

Formal statement
ε B dbar Dbar :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hdeg :
hdep :
q :
I → ℝ
hq0 :
∀ k, 0 ≤ q k
hq1 :
∀ k, q k ≤ 1
hq :
(bernoulliDesign q hq0 hq1).Var (fun z => ∑ i, E.expC z i / E.piC q i)
≤ (Fintype.card O : ℝ) * (Dbar * denominatorKernelBound ε dbar)
Proof (Lean source)
lemma ctrlDenominator_var_le (E : BipartiteExperiment I O) (ε B dbar Dbar : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hdeg : BoundedOutcomeDegree E dbar) (hdep : BoundedOverlapDependency E Dbar) (q : I → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1) (hq : FeasibleDesign ε B q) : (bernoulliDesign q hq0 hq1).Var (fun z => ∑ i, E.expC z i / E.piC q i) ≤ (Fintype.card O : ℝ) * (Dbar * denominatorKernelBound ε dbar) := by classical let D := bernoulliDesign q hq0 hq1 let X : O → (I → Bool) → ℝ := fun i z => E.expC z i / E.piC q i have hlt : ∀ k, q k < 1 := fun k => by linarith [(hq.floor k).2, hε0] have hmeanX : ∀ i, D.E (X i) = 1 := by intro i have hpi_pos : 0 < E.piC q i := by unfold BipartiteExperiment.piC exact Finset.prod_pos (fun k _ => sub_pos.mpr (hlt k)) have hE : D.E (fun z => E.expC z i) = E.piC q i := by unfold D BipartiteExperiment.expC BipartiteExperiment.piC exact bernoulli_E_ctrl_prod q hq0 hq1 (E.N i) change D.E (fun z => E.expC z i / E.piC q i) = 1 rw [show (fun z => E.expC z i / E.piC q i) = fun z => (E.piC q i)⁻¹ * E.expC z i by funext z; ring] rw [D.E_const_mul, hE] field_simp [(ne_of_gt hpi_pos)] have hcov : ∀ i j, D.Cov (X i) (X j) = E.r0 q i j := by intro i j unfold FiniteDesign.Cov rw [hmeanX i, hmeanX j] change D.E (fun z => (E.expC z i / E.piC q i - 1) * (E.expC z j / E.piC q j - 1)) = E.r0 q i j unfold D exact centered_ctrl_ctrl_moment E q hq0 hq1 hlt i j have hvar_eq : D.Var (fun z => ∑ i, X i z) = ∑ i : O, ∑ j : O, E.r0 q i j := by have hfun : (fun z => ∑ i, X i z) = fun z => ∑ i : O, (1 : ℝ) * X i z := by funext z simp rw [D.Var_congr (fun z => congrFun hfun z)] rw [D.Var_linear_comb Finset.univ (fun _ : O => (1 : ℝ)) X] simp [hcov] have hK_nonneg : 0 ≤ denominatorKernelBound ε dbar := denominatorKernelBound_nonneg hε0 have hrow : ∀ i, ∑ j : O, E.r0 q i j ≤ Dbar * denominatorKernelBound ε dbar := by intro i have hpoint : ∀ j : O, E.r0 q i j ≤ if j ∈ E.overlapNbrs i then denominatorKernelBound ε dbar else 0 := by intro j by_cases hj : j ∈ E.overlapNbrs i · simp [hj, r0_le_denominatorKernelBound E ε B dbar hε0 hε2 hdeg q hq i j] · have hnot : ¬ 0 < (E.shared i j).card := by simpa [BipartiteExperiment.overlapNbrs] using hj have hz : E.r0 q i j = 0 := by simp [BipartiteExperiment.r0, hnot] simp [hj, hz] calc ∑ j : O, E.r0 q i j ≤ ∑ j : O, if j ∈ E.overlapNbrs i then denominatorKernelBound ε dbar else 0 := Finset.sum_le_sum (fun j _ => hpoint j) _ = ∑ j ∈ E.overlapNbrs i, denominatorKernelBound ε dbar := by simpa using (Finset.sum_ite_mem (s := (Finset.univ : Finset O)) (t := E.overlapNbrs i) (f := fun _ => denominatorKernelBound ε dbar)) _ = ((E.overlapNbrs i).card : ℝ) * denominatorKernelBound ε dbar := by simp _ ≤ Dbar * denominatorKernelBound ε dbar := mul_le_mul_of_nonneg_right (hdep.2 i) hK_nonneg calc (bernoulliDesign q hq0 hq1).Var (fun z => ∑ i, E.expC z i / E.piC q i) = D.Var (fun z => ∑ i, X i z) := rfl _ = ∑ i : O, ∑ j : O, E.r0 q i j := hvar_eq _ ≤ ∑ _i : O, Dbar * denominatorKernelBound ε dbar := Finset.sum_le_sum (fun i _ => hrow i) _ = (Fintype.card O : ℝ) * (Dbar * denominatorKernelBound ε dbar) := by simp
CausalSmith.Experimentation.BipartiteMinimaxDesign.ctrlDenominator_var_le · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorControl.lean:25
Helpers.DenominatorMoment 8 declarations

Uniform reciprocal-product bound for one nonempty shared-neighborhood kernel.

Definition (Lean source)
noncomputable def denominatorKernelBound (ε dbar : ℝ) : ℝ := ε⁻¹ * max 1 (ε ^ (-(dbar - 1)))
CausalSmith.Experimentation.BipartiteMinimaxDesign.denominatorKernelBound · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorMoment.lean:27
theorem denominatorKernelBound_nonneg

The uniform reciprocal-product bound for a shared-neighborhood kernel is nonnegative whenever the positivity floor is strictly positive.

Formal statement
ε dbar :
hε0 :
0 < ε
Proof (Lean source)
lemma denominatorKernelBound_nonneg {ε dbar : ℝ} (hε0 : 0 < ε) : 0 ≤ denominatorKernelBound ε dbar := by unfold denominatorKernelBound exact mul_nonneg (inv_nonneg.mpr hε0.le) (le_trans zero_le_one (le_max_left _ _))
CausalSmith.Experimentation.BipartiteMinimaxDesign.denominatorKernelBound_nonneg · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorMoment.lean:32
theorem denominatorKernelBound_le_of_floor

The uniform kernel bound is decreasing in the positivity floor: for an admissible floor that is at least as large as a strictly positive reference floor, the bound at the larger floor is at most the bound at the reference floor. This lets a single bound computed at the smallest floor of interest serve uniformly over all admissible larger floors.

Formal statement
ε0 ε dbar :
hε0 :
0 < ε0
hε0le :
ε0 ≤ ε
Proof (Lean source)
lemma denominatorKernelBound_le_of_floor {ε0 ε dbar : ℝ} (hε0 : 0 < ε0) (hε0le : ε0 ≤ ε) (hε : EpsilonAdmissible ε) : denominatorKernelBound ε dbar ≤ denominatorKernelBound ε0 dbar := by unfold denominatorKernelBound have hεpos : 0 < ε := hε.1 have hεle1 : ε ≤ 1 := by linarith [hε.2] have hinv : ε⁻¹ ≤ ε0⁻¹ := (inv_le_inv₀ hεpos hε0).mpr hε0le have hpowMax : max 1 (ε ^ (-(dbar - 1))) ≤ max 1 (ε0 ^ (-(dbar - 1))) := by apply max_le · exact le_max_left _ _ · by_cases hexp : 0 ≤ -(dbar - 1) · have hpow_le_one : ε ^ (-(dbar - 1)) ≤ 1 := Real.rpow_le_one hεpos.le hεle1 hexp exact hpow_le_one.trans (le_max_left _ _) · have hexp_nonpos : -(dbar - 1) ≤ 0 := le_of_not_ge hexp have hpow_le : ε ^ (-(dbar - 1)) ≤ ε0 ^ (-(dbar - 1)) := Real.rpow_le_rpow_of_nonpos hε0 hε0le hexp_nonpos exact hpow_le.trans (le_max_right _ _) have hmax_nonneg : 0 ≤ max 1 (ε ^ (-(dbar - 1))) := le_trans zero_le_one (le_max_left _ _) exact mul_le_mul hinv hpowMax hmax_nonneg (inv_nonneg.mpr hε0.le)
CausalSmith.Experimentation.BipartiteMinimaxDesign.denominatorKernelBound_le_of_floor · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorMoment.lean:40
theorem r1_le_denominatorKernelBound

Under feasible floor-constrained propensities and bounded outcome degree, each treated-overlap kernel is bounded by the denominator-kernel bound.

Formal statement
ε B dbar :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hdeg :
q :
I → ℝ
hq :
i j :
O
E.r1 q i j ≤ denominatorKernelBound ε dbar
Proof (Lean source)
lemma r1_le_denominatorKernelBound (E : BipartiteExperiment I O) (ε B dbar : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hdeg : BoundedOutcomeDegree E dbar) (q : I → ℝ) (hq : FeasibleDesign ε B q) (i j : O) : E.r1 q i j ≤ denominatorKernelBound ε dbar := by classical unfold BipartiteExperiment.r1 by_cases hS : 0 < (E.shared i j).card · rw [if_pos hS] rcases Finset.card_pos.mp hS with ⟨k, hk⟩ have hSle : ((E.shared i j).card : ℝ) ≤ dbar := by have hnat : (E.shared i j).card ≤ (E.N i).card := Finset.card_le_card Finset.inter_subset_left have hreal : ((E.shared i j).card : ℝ) ≤ ((E.N i).card : ℝ) := by exact_mod_cast hnat exact hreal.trans (hdeg.2 i) have hcert := inv_pow_card_sub_one_le_certificate ε dbar (E.shared i j) hε0 hε2 hS hSle have ha0 : ∀ l ∈ E.shared i j, 0 ≤ (q l)⁻¹ := by intro l _ exact inv_nonneg.mpr (hq.prob l).1 have haε : ∀ l ∈ E.shared i j, (q l)⁻¹ ≤ ε⁻¹ := by intro l _ have hqpos : 0 < q l := lt_of_lt_of_le hε0 (hq.floor l).1 exact (inv_le_inv₀ hqpos hε0).mpr (hq.floor l).1 have hsdiff : ∏ l ∈ E.shared i j \ {k}, (q l)⁻¹ ≤ max 1 (ε ^ (-(dbar - 1))) := (prod_sdiff_le_inv_pow_card_sub_one (E.shared i j) (fun l => (q l)⁻¹) ε ha0 haε hk).trans hcert have hprod_nonneg : 0 ≤ ∏ l ∈ E.shared i j \ {k}, (q l)⁻¹ := by exact Finset.prod_nonneg (fun l hl => ha0 l (Finset.mem_sdiff.mp hl).1) have hprod : ∏ l ∈ E.shared i j, (q l)⁻¹ ≤ denominatorKernelBound ε dbar := by rw [Finset.prod_eq_mul_prod_diff_singleton_of_mem hk] unfold denominatorKernelBound exact mul_le_mul (haε k hk) hsdiff hprod_nonneg (inv_nonneg.mpr hε0.le) linarith · rw [if_neg hS] exact denominatorKernelBound_nonneg hε0
CausalSmith.Experimentation.BipartiteMinimaxDesign.r1_le_denominatorKernelBound · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorMoment.lean:68
theorem r0_le_denominatorKernelBound

Under feasible floor-constrained propensities and bounded outcome degree, each control-overlap kernel is bounded by the denominator-kernel bound.

Formal statement
ε B dbar :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hdeg :
q :
I → ℝ
hq :
i j :
O
E.r0 q i j ≤ denominatorKernelBound ε dbar
Proof (Lean source)
lemma r0_le_denominatorKernelBound (E : BipartiteExperiment I O) (ε B dbar : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hdeg : BoundedOutcomeDegree E dbar) (q : I → ℝ) (hq : FeasibleDesign ε B q) (i j : O) : E.r0 q i j ≤ denominatorKernelBound ε dbar := by classical unfold BipartiteExperiment.r0 by_cases hS : 0 < (E.shared i j).card · rw [if_pos hS] rcases Finset.card_pos.mp hS with ⟨k, hk⟩ have hSle : ((E.shared i j).card : ℝ) ≤ dbar := by have hnat : (E.shared i j).card ≤ (E.N i).card := Finset.card_le_card Finset.inter_subset_left have hreal : ((E.shared i j).card : ℝ) ≤ ((E.N i).card : ℝ) := by exact_mod_cast hnat exact hreal.trans (hdeg.2 i) have hcert := inv_pow_card_sub_one_le_certificate ε dbar (E.shared i j) hε0 hε2 hS hSle have ha0 : ∀ l ∈ E.shared i j, 0 ≤ (1 - q l)⁻¹ := by intro l _ have hnonneg : 0 ≤ 1 - q l := by linarith [(hq.prob l).2] exact inv_nonneg.mpr hnonneg have haε : ∀ l ∈ E.shared i j, (1 - q l)⁻¹ ≤ ε⁻¹ := by intro l _ have hq_lt_one : q l < 1 := by linarith [(hq.floor l).2, hε0] have hpos : 0 < 1 - q l := sub_pos.mpr hq_lt_one have hfloor : ε ≤ 1 - q l := by linarith [(hq.floor l).2] exact (inv_le_inv₀ hpos hε0).mpr hfloor have hsdiff : ∏ l ∈ E.shared i j \ {k}, (1 - q l)⁻¹ ≤ max 1 (ε ^ (-(dbar - 1))) := (prod_sdiff_le_inv_pow_card_sub_one (E.shared i j) (fun l => (1 - q l)⁻¹) ε ha0 haε hk).trans hcert have hprod_nonneg : 0 ≤ ∏ l ∈ E.shared i j \ {k}, (1 - q l)⁻¹ := by exact Finset.prod_nonneg (fun l hl => ha0 l (Finset.mem_sdiff.mp hl).1) have hprod : ∏ l ∈ E.shared i j, (1 - q l)⁻¹ ≤ denominatorKernelBound ε dbar := by rw [Finset.prod_eq_mul_prod_diff_singleton_of_mem hk] unfold denominatorKernelBound exact mul_le_mul (haε k hk) hsdiff hprod_nonneg (inv_nonneg.mpr hε0.le) linarith · rw [if_neg hS] exact denominatorKernelBound_nonneg hε0
CausalSmith.Experimentation.BipartiteMinimaxDesign.r0_le_denominatorKernelBound · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorMoment.lean:109
theorem treatDenominator_mean

The expected treated Hájek denominator equals the number of outcomes.

Formal statement
q :
I → ℝ
hq0 :
∀ k, 0 ≤ q k
hq1 :
∀ k, q k ≤ 1
hpos :
∀ k, 0 < q k
(bernoulliDesign q hq0 hq1).E (fun z => ∑ i, E.expT z i / E.piT q i)
= (Fintype.card O : ℝ)
Proof (Lean source)
lemma treatDenominator_mean (E : BipartiteExperiment I O) (q : I → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1) (hpos : ∀ k, 0 < q k) : (bernoulliDesign q hq0 hq1).E (fun z => ∑ i, E.expT z i / E.piT q i) = (Fintype.card O : ℝ) := by classical rw [(bernoulliDesign q hq0 hq1).E_sum univ (fun i z => E.expT z i / E.piT q i)] trans ∑ _i : O, (1 : ℝ) · apply Finset.sum_congr rfl intro i _ have hpi_pos : 0 < E.piT q i := by unfold BipartiteExperiment.piT exact Finset.prod_pos (fun k _ => hpos k) have hE : (bernoulliDesign q hq0 hq1).E (fun z => E.expT z i) = E.piT q i := by unfold BipartiteExperiment.expT BipartiteExperiment.piT exact bernoulli_E_treat_prod q hq0 hq1 (E.N i) rw [show (fun z => E.expT z i / E.piT q i) = fun z => (E.piT q i)⁻¹ * E.expT z i by funext z; ring] rw [(bernoulliDesign q hq0 hq1).E_const_mul, hE] field_simp [(ne_of_gt hpi_pos)] · simp
CausalSmith.Experimentation.BipartiteMinimaxDesign.treatDenominator_mean · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorMoment.lean:153
theorem ctrlDenominator_mean

The expected control Hájek denominator equals the number of outcomes.

Formal statement
q :
I → ℝ
hq0 :
∀ k, 0 ≤ q k
hq1 :
∀ k, q k ≤ 1
hlt :
∀ k, q k < 1
(bernoulliDesign q hq0 hq1).E (fun z => ∑ i, E.expC z i / E.piC q i)
= (Fintype.card O : ℝ)
Proof (Lean source)
lemma ctrlDenominator_mean (E : BipartiteExperiment I O) (q : I → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1) (hlt : ∀ k, q k < 1) : (bernoulliDesign q hq0 hq1).E (fun z => ∑ i, E.expC z i / E.piC q i) = (Fintype.card O : ℝ) := by classical rw [(bernoulliDesign q hq0 hq1).E_sum univ (fun i z => E.expC z i / E.piC q i)] trans ∑ _i : O, (1 : ℝ) · apply Finset.sum_congr rfl intro i _ have hpi_pos : 0 < E.piC q i := by unfold BipartiteExperiment.piC exact Finset.prod_pos (fun k _ => sub_pos.mpr (hlt k)) have hE : (bernoulliDesign q hq0 hq1).E (fun z => E.expC z i) = E.piC q i := by unfold BipartiteExperiment.expC BipartiteExperiment.piC exact bernoulli_E_ctrl_prod q hq0 hq1 (E.N i) rw [show (fun z => E.expC z i / E.piC q i) = fun z => (E.piC q i)⁻¹ * E.expC z i by funext z; ring] rw [(bernoulliDesign q hq0 hq1).E_const_mul, hE] field_simp [(ne_of_gt hpi_pos)] · simp
CausalSmith.Experimentation.BipartiteMinimaxDesign.ctrlDenominator_mean · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorMoment.lean:179
theorem treatDenominator_var_le

The variance of the treated Hájek denominator is bounded by the number of outcomes times the overlap-dependency and denominator-kernel bounds.

Formal statement
ε B dbar Dbar :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hdeg :
hdep :
q :
I → ℝ
hq0 :
∀ k, 0 ≤ q k
hq1 :
∀ k, q k ≤ 1
hq :
(bernoulliDesign q hq0 hq1).Var (fun z => ∑ i, E.expT z i / E.piT q i)
≤ (Fintype.card O : ℝ) * (Dbar * denominatorKernelBound ε dbar)
Proof (Lean source)
lemma treatDenominator_var_le (E : BipartiteExperiment I O) (ε B dbar Dbar : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hdeg : BoundedOutcomeDegree E dbar) (hdep : BoundedOverlapDependency E Dbar) (q : I → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1) (hq : FeasibleDesign ε B q) : (bernoulliDesign q hq0 hq1).Var (fun z => ∑ i, E.expT z i / E.piT q i) ≤ (Fintype.card O : ℝ) * (Dbar * denominatorKernelBound ε dbar) := by classical let D := bernoulliDesign q hq0 hq1 let X : O → (I → Bool) → ℝ := fun i z => E.expT z i / E.piT q i have hpos : ∀ k, 0 < q k := fun k => lt_of_lt_of_le hε0 (hq.floor k).1 have hmeanX : ∀ i, D.E (X i) = 1 := by intro i have hpi_pos : 0 < E.piT q i := by unfold BipartiteExperiment.piT exact Finset.prod_pos (fun k _ => hpos k) have hE : D.E (fun z => E.expT z i) = E.piT q i := by unfold D BipartiteExperiment.expT BipartiteExperiment.piT exact bernoulli_E_treat_prod q hq0 hq1 (E.N i) change D.E (fun z => E.expT z i / E.piT q i) = 1 rw [show (fun z => E.expT z i / E.piT q i) = fun z => (E.piT q i)⁻¹ * E.expT z i by funext z; ring] rw [D.E_const_mul, hE] field_simp [(ne_of_gt hpi_pos)] have hcov : ∀ i j, D.Cov (X i) (X j) = E.r1 q i j := by intro i j unfold FiniteDesign.Cov rw [hmeanX i, hmeanX j] change D.E (fun z => (E.expT z i / E.piT q i - 1) * (E.expT z j / E.piT q j - 1)) = E.r1 q i j unfold D exact centered_treat_treat_moment E q hq0 hq1 hpos i j have hvar_eq : D.Var (fun z => ∑ i, X i z) = ∑ i : O, ∑ j : O, E.r1 q i j := by have hfun : (fun z => ∑ i, X i z) = fun z => ∑ i : O, (1 : ℝ) * X i z := by funext z simp rw [D.Var_congr (fun z => congrFun hfun z)] rw [D.Var_linear_comb Finset.univ (fun _ : O => (1 : ℝ)) X] simp [hcov] have hK_nonneg : 0 ≤ denominatorKernelBound ε dbar := denominatorKernelBound_nonneg hε0 have hrow : ∀ i, ∑ j : O, E.r1 q i j ≤ Dbar * denominatorKernelBound ε dbar := by intro i have hpoint : ∀ j : O, E.r1 q i j ≤ if j ∈ E.overlapNbrs i then denominatorKernelBound ε dbar else 0 := by intro j by_cases hj : j ∈ E.overlapNbrs i · simp [hj, r1_le_denominatorKernelBound E ε B dbar hε0 hε2 hdeg q hq i j] · have hnot : ¬ 0 < (E.shared i j).card := by simpa [BipartiteExperiment.overlapNbrs] using hj have hz : E.r1 q i j = 0 := by simp [BipartiteExperiment.r1, hnot] simp [hj, hz] calc ∑ j : O, E.r1 q i j ≤ ∑ j : O, if j ∈ E.overlapNbrs i then denominatorKernelBound ε dbar else 0 := Finset.sum_le_sum (fun j _ => hpoint j) _ = ∑ j ∈ E.overlapNbrs i, denominatorKernelBound ε dbar := by simpa using (Finset.sum_ite_mem (s := (Finset.univ : Finset O)) (t := E.overlapNbrs i) (f := fun _ => denominatorKernelBound ε dbar)) _ = ((E.overlapNbrs i).card : ℝ) * denominatorKernelBound ε dbar := by simp _ ≤ Dbar * denominatorKernelBound ε dbar := mul_le_mul_of_nonneg_right (hdep.2 i) hK_nonneg calc (bernoulliDesign q hq0 hq1).Var (fun z => ∑ i, E.expT z i / E.piT q i) = D.Var (fun z => ∑ i, X i z) := rfl _ = ∑ i : O, ∑ j : O, E.r1 q i j := hvar_eq _ ≤ ∑ _i : O, Dbar * denominatorKernelBound ε dbar := Finset.sum_le_sum (fun i _ => hrow i) _ = (Fintype.card O : ℝ) * (Dbar * denominatorKernelBound ε dbar) := by simp
CausalSmith.Experimentation.BipartiteMinimaxDesign.treatDenominator_var_le · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorMoment.lean:205
Helpers.DenominatorRate 1 declarations
theorem denominatorKernelBound_div_card_tendsto_zero

If the number of outcomes diverges and the propensity floor stays eventually positive, the denominator-kernel bound divided by the number of outcomes converges to zero.

Formal statement
ε :
ℕ → ℝ
dbar :
hcardO :
Tendsto (fun n => card (Ox n)) atTop atTop
:
∀ n, EpsilonAdmissible (ε n)
hεfloor :
∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n
Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0)
Proof (Lean source)
lemma denominatorKernelBound_div_card_tendsto_zero (ε : ℕ → ℝ) (dbar : ℝ) (hcardO : Tendsto (fun n => card (Ox n)) atTop atTop) (hε : ∀ n, EpsilonAdmissible (ε n)) (hεfloor : ∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n) : Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0) := by rcases hεfloor with ⟨ε0, hε0_pos, hε0_ev⟩ let C : ℝ := denominatorKernelBound ε0 dbar have hcard_real : Tendsto (fun n => (card (Ox n) : ℝ)) atTop atTop := tendsto_natCast_atTop_atTop.comp hcardO have hinv : Tendsto (fun n => ((card (Ox n) : ℝ)⁻¹)) atTop (𝓝 0) := tendsto_inv_atTop_zero.comp hcard_real have hupper : Tendsto (fun n => C * ((card (Ox n) : ℝ)⁻¹)) atTop (𝓝 0) := by simpa using (tendsto_const_nhds.mul hinv) refine squeeze_zero' ?_ ?_ hupper · filter_upwards with n exact div_nonneg (denominatorKernelBound_nonneg (hε n).1) (by positivity) · filter_upwards [hε0_ev] with n hfloor have hkernel_le : denominatorKernelBound (ε n) dbar ≤ C := by dsimp [C] exact denominatorKernelBound_le_of_floor hε0_pos hfloor (hε n) calc denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ) = denominatorKernelBound (ε n) dbar * ((card (Ox n) : ℝ)⁻¹) := by ring _ ≤ C * ((card (Ox n) : ℝ)⁻¹) := by exact mul_le_mul_of_nonneg_right hkernel_le (inv_nonneg.mpr (by positivity))
CausalSmith.Experimentation.BipartiteMinimaxDesign.denominatorKernelBound_div_card_tendsto_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorRate.lean:22
Helpers.DenominatorRatioInProb 2 declarations
theorem treatDenominatorRatioCentered_tendstoInProb_zero

The centered treated-denominator ratio D₁/card Ox − 1 vanishes in probability.

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
hp0 :
∀ n k, 0 ≤ p n k
hp1 :
∀ n k, p n k ≤ 1
ε B :
ℕ → ℝ
dbar Dbar :
hcardO :
Tendsto (fun n => card (Ox n)) atTop atTop
hBern :
∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)
hdeg :
∀ n, BoundedOutcomeDegree (E n) dbar
hdep :
∀ n, BoundedOverlapDependency (E n) Dbar
hfeas :
∀ n, FeasibleDesign (ε n) (B n) (p n)
:
∀ n, EpsilonAdmissible (ε n)
hreg :
Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0)
TendstoInProb D (fun n z => (card (Ox n) : ℝ)⁻¹ * (∑ i, (E n).expT z i / (E n).piT (p n) i) - 1) (fun _ => 0)
Proof (Lean source)
lemma treatDenominatorRatioCentered_tendstoInProb_zero (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (hp0 : ∀ n k, 0 ≤ p n k) (hp1 : ∀ n k, p n k ≤ 1) (ε B : ℕ → ℝ) (dbar Dbar : ℝ) (hcardO : Tendsto (fun n => card (Ox n)) atTop atTop) (hBern : ∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)) (hdeg : ∀ n, BoundedOutcomeDegree (E n) dbar) (hdep : ∀ n, BoundedOverlapDependency (E n) Dbar) (hfeas : ∀ n, FeasibleDesign (ε n) (B n) (p n)) (hε : ∀ n, EpsilonAdmissible (ε n)) (hreg : Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0)) : TendstoInProb D (fun n z => (card (Ox n) : ℝ)⁻¹ * (∑ i, (E n).expT z i / (E n).piT (p n) i) - 1) (fun _ => 0) := by classical let X : ∀ n, (Ix n → Bool) → ℝ := fun n z => (card (Ox n) : ℝ)⁻¹ * (∑ i, (E n).expT z i / (E n).piT (p n) i) - 1 change TendstoInProb D X (fun _ => 0) have hcard : ∀ᶠ n in atTop, 0 < (card (Ox n) : ℝ) := by filter_upwards [hcardO.eventually (eventually_ge_atTop 1)] with n hn exact_mod_cast hn have hvar : Tendsto (fun n => (D n).Var (X n)) atTop (𝓝 0) := by apply squeeze_zero' · filter_upwards with n exact (D n).Var_nonneg _ · filter_upwards [hcard] with n hn let S : (Ix n → Bool) → ℝ := fun z => ∑ i, (E n).expT z i / (E n).piT (p n) i have hpos : ∀ k, 0 < p n k := fun k => lt_of_lt_of_le (hε n).1 ((hfeas n).floor k).1 have hbound : (D n).Var S ≤ (card (Ox n) : ℝ) * (Dbar * denominatorKernelBound (ε n) dbar) := by rw [hBern n] exact treatDenominator_var_le (E n) (ε n) (B n) dbar Dbar (hε n).1 (hε n).2 (hdeg n) (hdep n) (p n) (hp0 n) (hp1 n) (hfeas n) have hvar_eq : (D n).Var (X n) = (card (Ox n) : ℝ)⁻¹ ^ 2 * (D n).Var S := by have hshift : (D n).Var (fun z => (card (Ox n) : ℝ)⁻¹ * S z - 1) = (D n).Var (fun z => (card (Ox n) : ℝ)⁻¹ * S z) := by unfold FiniteDesign.Var rw [(D n).E_sub, (D n).E_const] apply (D n).E_congr intro z ring calc (D n).Var (X n) = (D n).Var (fun z => (card (Ox n) : ℝ)⁻¹ * S z - 1) := by rfl _ = (D n).Var (fun z => (card (Ox n) : ℝ)⁻¹ * S z) := hshift _ = (card (Ox n) : ℝ)⁻¹ ^ 2 * (D n).Var S := (D n).Var_const_mul _ _ calc (D n).Var (X n) = (card (Ox n) : ℝ)⁻¹ ^ 2 * (D n).Var S := hvar_eq _ ≤ (card (Ox n) : ℝ)⁻¹ ^ 2 * ((card (Ox n) : ℝ) * (Dbar * denominatorKernelBound (ε n) dbar)) := mul_le_mul_of_nonneg_left hbound (sq_nonneg _) _ = Dbar * (denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) := by field_simp [ne_of_gt hn] · simpa using hreg.const_mul Dbar have hmean : ∀ᶠ n in atTop, (D n).E (X n) = 0 := by filter_upwards [hcard] with n hn let S : (Ix n → Bool) → ℝ := fun z => ∑ i, (E n).expT z i / (E n).piT (p n) i have hpos : ∀ k, 0 < p n k := fun k => lt_of_lt_of_le (hε n).1 ((hfeas n).floor k).1 have hS : (D n).E S = (card (Ox n) : ℝ) := by rw [hBern n] exact treatDenominator_mean (E n) (p n) (hp0 n) (hp1 n) hpos calc (D n).E (X n) = (D n).E (fun z => (card (Ox n) : ℝ)⁻¹ * S z - 1) := by rfl _ = (card (Ox n) : ℝ)⁻¹ * (D n).E S - 1 := by rw [(D n).E_sub, (D n).E_const_mul, (D n).E_const] _ = 0 := by rw [hS] field_simp [ne_of_gt hn] ring have hprob := tendstoInProb_of_var D X hvar intro δ hδ refine (hprob δ hδ).congr' ?_ filter_upwards [hmean] with n hn simp [hn]
CausalSmith.Experimentation.BipartiteMinimaxDesign.treatDenominatorRatioCentered_tendstoInProb_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorRatioInProb.lean:32
theorem ctrlDenominatorRatioCentered_tendstoInProb_zero

The centered control-denominator ratio D₀/card Ox − 1 vanishes in probability.

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
hp0 :
∀ n k, 0 ≤ p n k
hp1 :
∀ n k, p n k ≤ 1
ε B :
ℕ → ℝ
dbar Dbar :
hcardO :
Tendsto (fun n => card (Ox n)) atTop atTop
hBern :
∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)
hdeg :
∀ n, BoundedOutcomeDegree (E n) dbar
hdep :
∀ n, BoundedOverlapDependency (E n) Dbar
hfeas :
∀ n, FeasibleDesign (ε n) (B n) (p n)
:
∀ n, EpsilonAdmissible (ε n)
hreg :
Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0)
TendstoInProb D (fun n z => (card (Ox n) : ℝ)⁻¹ * (∑ i, (E n).expC z i / (E n).piC (p n) i) - 1) (fun _ => 0)
Proof (Lean source)
lemma ctrlDenominatorRatioCentered_tendstoInProb_zero (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (hp0 : ∀ n k, 0 ≤ p n k) (hp1 : ∀ n k, p n k ≤ 1) (ε B : ℕ → ℝ) (dbar Dbar : ℝ) (hcardO : Tendsto (fun n => card (Ox n)) atTop atTop) (hBern : ∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)) (hdeg : ∀ n, BoundedOutcomeDegree (E n) dbar) (hdep : ∀ n, BoundedOverlapDependency (E n) Dbar) (hfeas : ∀ n, FeasibleDesign (ε n) (B n) (p n)) (hε : ∀ n, EpsilonAdmissible (ε n)) (hreg : Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0)) : TendstoInProb D (fun n z => (card (Ox n) : ℝ)⁻¹ * (∑ i, (E n).expC z i / (E n).piC (p n) i) - 1) (fun _ => 0) := by classical let X : ∀ n, (Ix n → Bool) → ℝ := fun n z => (card (Ox n) : ℝ)⁻¹ * (∑ i, (E n).expC z i / (E n).piC (p n) i) - 1 change TendstoInProb D X (fun _ => 0) have hcard : ∀ᶠ n in atTop, 0 < (card (Ox n) : ℝ) := by filter_upwards [hcardO.eventually (eventually_ge_atTop 1)] with n hn exact_mod_cast hn have hvar : Tendsto (fun n => (D n).Var (X n)) atTop (𝓝 0) := by apply squeeze_zero' · filter_upwards with n exact (D n).Var_nonneg _ · filter_upwards [hcard] with n hn let S : (Ix n → Bool) → ℝ := fun z => ∑ i, (E n).expC z i / (E n).piC (p n) i have hlt : ∀ k, p n k < 1 := fun k => lt_of_le_of_lt ((hfeas n).floor k).2 (by linarith [(hε n).1]) have hbound : (D n).Var S ≤ (card (Ox n) : ℝ) * (Dbar * denominatorKernelBound (ε n) dbar) := by rw [hBern n] exact ctrlDenominator_var_le (E n) (ε n) (B n) dbar Dbar (hε n).1 (hε n).2 (hdeg n) (hdep n) (p n) (hp0 n) (hp1 n) (hfeas n) have hvar_eq : (D n).Var (X n) = (card (Ox n) : ℝ)⁻¹ ^ 2 * (D n).Var S := by have hshift : (D n).Var (fun z => (card (Ox n) : ℝ)⁻¹ * S z - 1) = (D n).Var (fun z => (card (Ox n) : ℝ)⁻¹ * S z) := by unfold FiniteDesign.Var rw [(D n).E_sub, (D n).E_const] apply (D n).E_congr intro z ring calc (D n).Var (X n) = (D n).Var (fun z => (card (Ox n) : ℝ)⁻¹ * S z - 1) := by rfl _ = (D n).Var (fun z => (card (Ox n) : ℝ)⁻¹ * S z) := hshift _ = (card (Ox n) : ℝ)⁻¹ ^ 2 * (D n).Var S := (D n).Var_const_mul _ _ calc (D n).Var (X n) = (card (Ox n) : ℝ)⁻¹ ^ 2 * (D n).Var S := hvar_eq _ ≤ (card (Ox n) : ℝ)⁻¹ ^ 2 * ((card (Ox n) : ℝ) * (Dbar * denominatorKernelBound (ε n) dbar)) := mul_le_mul_of_nonneg_left hbound (sq_nonneg _) _ = Dbar * (denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) := by field_simp [ne_of_gt hn] · simpa using hreg.const_mul Dbar have hmean : ∀ᶠ n in atTop, (D n).E (X n) = 0 := by filter_upwards [hcard] with n hn let S : (Ix n → Bool) → ℝ := fun z => ∑ i, (E n).expC z i / (E n).piC (p n) i have hlt : ∀ k, p n k < 1 := fun k => lt_of_le_of_lt ((hfeas n).floor k).2 (by linarith [(hε n).1]) have hS : (D n).E S = (card (Ox n) : ℝ) := by rw [hBern n] exact ctrlDenominator_mean (E n) (p n) (hp0 n) (hp1 n) hlt calc (D n).E (X n) = (D n).E (fun z => (card (Ox n) : ℝ)⁻¹ * S z - 1) := by rfl _ = (card (Ox n) : ℝ)⁻¹ * (D n).E S - 1 := by rw [(D n).E_sub, (D n).E_const_mul, (D n).E_const] _ = 0 := by rw [hS] field_simp [ne_of_gt hn] ring have hprob := tendstoInProb_of_var D X hvar intro δ hδ refine (hprob δ hδ).congr' ?_ filter_upwards [hmean] with n hn simp [hn]
CausalSmith.Experimentation.BipartiteMinimaxDesign.ctrlDenominatorRatioCentered_tendstoInProb_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DenominatorRatioInProb.lean:119
Helpers.DependencyCLT 1 declarations
theorem bounded_degree_dependency_clt Lemma 1 in the paper ↗

Centered, uniformly bounded triangular arrays with a dependency graph of fixed maximum degree and an eventual linear variance lower bound satisfy the variance-standardized central limit theorem.

Formal statement
Ω :
ℕ → Type*
∀ n, MeasurableSpace (Ω n)
μ :
∀ n, Measure (Ω n)
∀ n, IsProbabilityMeasure (μ n)
ι :
ℕ → Type*
∀ n, Fintype (ι n)
∀ n, DecidableEq (ι n)
X :
∀ n
if
ι n
and
Ω n
then
Dep :
∀ n, DepGraph (X n) (μ n)
Dmax :
hdeg :
∀ n i, ((Dep n).nbhd i).card ≤ Dmax
M :
hM :
0 ≤ M
hbound :
∀ n i ω, |X n i ω| ≤ M
hmean :
∀ n i, ∫ ω, X n i ω ∂(μ n) = 0
v :
ℕ → ℝ
hv :
∀ n, ∫ ω, (depSum (X n) ω) ^ 2 ∂(μ n) = v n
c :
hc :
0 < c
hcard :
∀ n, card (ι n) = n
hvc :
∀ᶠ n : ℕ in atTop, c * (n : ℝ) ≤ v n
s :
Tendsto (fun n => ((μ n).map (fun ω => depSum (X n) ω / sqrt (v n))).real (Iic s)) atTop (nhds ((gaussianReal 0 1).real (Iic s)))
Proof (Lean source)
lemma bounded_degree_dependency_clt {Ω : ℕ → Type*} [∀ n, MeasurableSpace (Ω n)] (μ : ∀ n, Measure (Ω n)) [∀ n, IsProbabilityMeasure (μ n)] {ι : ℕ → Type*} [∀ n, Fintype (ι n)] [∀ n, DecidableEq (ι n)] (X : ∀ n, ι n → Ω n → ℝ) (Dep : ∀ n, DepGraph (X n) (μ n)) (Dmax : ℕ) (hdeg : ∀ n i, ((Dep n).nbhd i).card ≤ Dmax) (M : ℝ) (hM : 0 ≤ M) (hbound : ∀ n i ω, |X n i ω| ≤ M) (hmean : ∀ n i, ∫ ω, X n i ω ∂(μ n) = 0) (v : ℕ → ℝ) (hv : ∀ n, ∫ ω, (depSum (X n) ω) ^ 2 ∂(μ n) = v n) (c : ℝ) (hc : 0 < c) (hcard : ∀ n, card (ι n) = n) (hvc : ∀ᶠ n : ℕ in atTop, c * (n : ℝ) ≤ v n) (s : ℝ) : Tendsto (fun n => ((μ n).map (fun ω => depSum (X n) ω / sqrt (v n))).real (Iic s)) atTop (nhds ((gaussianReal 0 1).real (Iic s))) := by classical apply bounded_degree_dependency_clt μ X Dep Dmax hdeg M hM hbound hmean v hv c hc · simpa only [hcard] using hvc · simp only [hcard] exact tendsto_id
CausalSmith.Experimentation.BipartiteMinimaxDesign.bounded_degree_dependency_clt · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DependencyCLT.lean:23
Helpers.DispersionAsymptotics 3 declarations
theorem dispersionD_tendsto_atTop

The number of core outcomes in the dispersion construction diverges as the construction index grows.

Formal statement
Proof (Lean source)
lemma dispersionD_tendsto_atTop : Tendsto dispersionD atTop atTop := by apply tendsto_atTop_mono (fun n => ?_) tendsto_id unfold dispersionD dispersionT calc n ≤ n + 1 := Nat.le_succ n _ = 1 * (n + 1) := by omega _ ≤ (n + 1) * (n + 1) := Nat.mul_le_mul_right (n + 1) (by omega) _ = (n + 1) ^ 2 := by ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionD_tendsto_atTop · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionAsymptotics.lean:19
theorem dispersion_geometric_lower_bound

Eventually, a geometric lower bound controls the ratio formed by the dispersion construction's homogeneous and comparison envelope terms.

Formal statement
ε :
∀ᶠ n in atTop,
(1 / 3 : ℝ) * ((2 * dispersionRho ε)⁻¹ ^ dispersionD n)
≤ (dispersionRho ε)⁻¹ ^ dispersionD n / ((2 : ℝ) ^ (dispersionD n + 1) + 2 * reciprocalBarrier (dispersionFillerRho ε))
Proof (Lean source)
lemma dispersion_geometric_lower_bound {ε : ℝ} (hε : EpsilonAdmissible ε) : ∀ᶠ n in atTop, (1 / 3 : ℝ) * ((2 * dispersionRho ε)⁻¹ ^ dispersionD n) ≤ (dispersionRho ε)⁻¹ ^ dispersionD n / ((2 : ℝ) ^ (dispersionD n + 1) + 2 * reciprocalBarrier (dispersionFillerRho ε)) := by have htwo : Tendsto (fun n : ℕ => (2 : ℝ) ^ dispersionD n) atTop atTop := (tendsto_pow_atTop_atTop_of_one_lt (by norm_num : (1 : ℝ) < 2)).comp dispersionD_tendsto_atTop have hC := htwo.eventually_ge_atTop (2 * reciprocalBarrier (dispersionFillerRho ε)) filter_upwards [hC] with n hn have hr := dispersionRho_bounds hε have hr0 : 0 < dispersionRho ε := lt_trans hε.1 hr.1 have hf := dispersionFillerRho_bounds hε have hf0 : 0 < dispersionFillerRho ε := lt_trans hε.1 hf.1 have hf1 : dispersionFillerRho ε < 1 := lt_trans hf.2 (by norm_num) have hden : 0 < (2 : ℝ) ^ (dispersionD n + 1) + 2 * reciprocalBarrier (dispersionFillerRho ε) := by exact add_pos (pow_pos (by norm_num) _) (mul_pos (by norm_num) (reciprocalBarrier_pos hf0 hf1)) apply (le_div_iff₀ hden).2 have hbase : (dispersionRho ε)⁻¹ = 2 * (2 * dispersionRho ε)⁻¹ := by field_simp rw [hbase, mul_pow, pow_succ] have hb0 : 0 ≤ (2 * dispersionRho ε)⁻¹ ^ dispersionD n := by positivity have hp2 : 0 < (2 : ℝ) ^ dispersionD n := by positivity nlinarith
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersion_geometric_lower_bound · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionAsymptotics.lean:30
theorem dispersionApproxRatio_tendsto_atTop

The approximation ratio of the dispersion construction diverges to infinity as the construction index grows.

Formal statement
ε :
Proof (Lean source)
lemma dispersionApproxRatio_tendsto_atTop {ε : ℝ} (hε : EpsilonAdmissible ε) : Tendsto (fun n => approxRatio (dispersionExperiment n) ε (dispersionBudget n ε)) atTop atTop := by have hr := dispersionRho_bounds hε have hbase : 1 < (2 * dispersionRho ε)⁻¹ := by rw [one_lt_inv₀] <;> nlinarith [hε.1, hr.1, hr.2] have hgeom : Tendsto (fun n => (1 / 3 : ℝ) * ((2 * dispersionRho ε)⁻¹ ^ dispersionD n)) atTop atTop := by exact ((tendsto_pow_atTop_atTop_of_one_lt hbase).comp dispersionD_tendsto_atTop).const_mul_atTop (by norm_num) apply tendsto_atTop_mono' atTop ?_ hgeom filter_upwards [dispersion_geometric_lower_bound hε] with n hn exact hn.trans (dispersion_approxRatio_lower_bound n hε)
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionApproxRatio_tendsto_atTop · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionAsymptotics.lean:60
Helpers.DispersionConstruction 25 declarations

The stage parameter, shifted so that every stage is nonempty.

Definition (Lean source)
def dispersionT (n : ℕ) : ℕ := n + 1

The size d=t² of the growing clique.

Definition (Lean source)
def dispersionD (n : ℕ) : ℕ := dispersionT n ^ 2

Clique interventions together with 2d filler interventions.

Definition (Lean source)
abbrev DispersionIntervention (n : ℕ) := Fin (dispersionD n) ⊕ Fin (2 * dispersionD n)
CausalSmith.Experimentation.BipartiteMinimaxDesign.DispersionIntervention · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:27

d clique outcomes and t copies for each filler intervention.

Definition (Lean source)
abbrev DispersionOutcome (n : ℕ) := Fin (dispersionD n) ⊕ (Fin (2 * dispersionD n) × Fin (dispersionT n))
CausalSmith.Experimentation.BipartiteMinimaxDesign.DispersionOutcome · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:31
def dispersionCore

The clique intervention block as a finset in the full intervention type.

Definition (Lean source)
def dispersionCore (n : ℕ) : Finset (DispersionIntervention n) := Finset.univ.map ⟨Sum.inl, Sum.inl_injective⟩
theorem mem_dispersionCore_inl

Every clique intervention belongs to the clique block of the dispersion construction's intervention set.

Formal statement
n :
a :
Proof (Lean source)
@[simp] lemma mem_dispersionCore_inl (n : ℕ) (a : Fin (dispersionD n)) : inl a ∈ dispersionCore n := by simp [dispersionCore]
CausalSmith.Experimentation.BipartiteMinimaxDesign.mem_dispersionCore_inl · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:41
theorem mem_dispersionCore_inr

No filler intervention belongs to the clique block of the dispersion construction's intervention set.

Formal statement
n :
f :
Proof (Lean source)
@[simp] lemma mem_dispersionCore_inr (n : ℕ) (f : Fin (2 * dispersionD n)) : inr f ∉ dispersionCore n := by simp [dispersionCore]
CausalSmith.Experimentation.BipartiteMinimaxDesign.mem_dispersionCore_inr · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:48
theorem dispersionCore_card

The clique block contains exactly as many interventions as the clique size.

Formal statement
n :
Proof (Lean source)
@[simp] lemma dispersionCore_card (n : ℕ) : (dispersionCore n).card = dispersionD n := by simp [dispersionCore]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionCore_card · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:55
def dispersionExperiment

The graph whose clique outcomes see every clique intervention and whose filler outcomes see their associated filler intervention only.

Definition (Lean source)
noncomputable def dispersionExperiment (n : ℕ) : BipartiteExperiment (DispersionIntervention n) (DispersionOutcome n) := by classical exact { N := fun i => match i with | inl _ => dispersionCore n | inr fr => {inr fr.1} Yfun := fun _ _ => 0 }
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:61
theorem dispersionExperiment_N_core

Every clique outcome is connected to the whole clique intervention block, so all clique outcomes share the same intervention neighborhood.

Formal statement
n :
i :
Proof (Lean source)
lemma dispersionExperiment_N_core (n : ℕ) (i : Fin (dispersionD n)) : (dispersionExperiment n).N (inl i) = dispersionCore n := by rfl
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_N_core · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:74
theorem dispersionExperiment_N_filler

Every filler outcome is connected to precisely its designated filler intervention.

Formal statement
n :
f :
r :
(dispersionExperiment n).N (inr (f, r)) = {inr f}
Proof (Lean source)
lemma dispersionExperiment_N_filler (n : ℕ) (f : Fin (2 * dispersionD n)) (r : Fin (dispersionT n)) : (dispersionExperiment n).N (inr (f, r)) = {inr f} := by rfl
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_N_filler · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:82
theorem dispersionExperiment_sdeg_core

Every core outcome in the dispersion construction has the stated squared core-degree value.

Formal statement
n :
a :
Proof (Lean source)
lemma dispersionExperiment_sdeg_core (n : ℕ) (a : Fin (dispersionD n)) : (dispersionExperiment n).sdeg (inl a) = dispersionD n := by unfold BipartiteExperiment.sdeg BipartiteExperiment.M rw [Finset.card_eq_sum_ones, Finset.sum_filter, Fintype.sum_sum_type] simp [dispersionExperiment, dispersionCore]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_sdeg_core · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:89
theorem dispersionExperiment_sdeg_filler

Every filler outcome in the dispersion construction has squared degree one.

Formal statement
n :
f :
Proof (Lean source)
lemma dispersionExperiment_sdeg_filler (n : ℕ) (f : Fin (2 * dispersionD n)) : (dispersionExperiment n).sdeg (inr f) = dispersionT n := by unfold BipartiteExperiment.sdeg BipartiteExperiment.M rw [Finset.card_eq_sum_ones, Finset.sum_filter, Fintype.sum_sum_type, Fintype.sum_prod_type] simp [dispersionExperiment, dispersionCore]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_sdeg_filler · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:97
theorem dispersionExperiment_shared_core

Any two core outcomes share exactly the full core intervention set.

Formal statement
n :
i j :
Proof (Lean source)
lemma dispersionExperiment_shared_core (n : ℕ) (i j : Fin (dispersionD n)) : (dispersionExperiment n).shared (inl i) (inl j) = dispersionCore n := by simp [BipartiteExperiment.shared, dispersionExperiment, dispersionCore]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_shared_core · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:106
theorem dispersionExperiment_shared_filler

Two filler outcomes share their designated intervention exactly when they have the same filler label.

Formal statement
n :
f g :
r s :
(dispersionExperiment n).shared (inr (f, r)) (inr (g, s))
= if f = g then {inr f} else ∅
Proof (Lean source)
lemma dispersionExperiment_shared_filler (n : ℕ) (f g : Fin (2 * dispersionD n)) (r s : Fin (dispersionT n)) : (dispersionExperiment n).shared (inr (f, r)) (inr (g, s)) = if f = g then {inr f} else ∅ := by classical split_ifs with h · subst g simp [BipartiteExperiment.shared, dispersionExperiment] · simp [BipartiteExperiment.shared, dispersionExperiment, h]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_shared_filler · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:114
theorem dispersionExperiment_shared_core_filler

A core outcome and a filler outcome share no interventions.

Formal statement
n :
i :
f :
r :
(dispersionExperiment n).shared (inl i) (inr (f, r)) = ∅
Proof (Lean source)
lemma dispersionExperiment_shared_core_filler (n : ℕ) (i : Fin (dispersionD n)) (f : Fin (2 * dispersionD n)) (r : Fin (dispersionT n)) : (dispersionExperiment n).shared (inl i) (inr (f, r)) = ∅ := by simp [BipartiteExperiment.shared, dispersionExperiment, dispersionCore]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_shared_core_filler · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:126
theorem dispersionExperiment_shared_filler_core

A filler outcome and a core outcome share no interventions.

Formal statement
n :
f :
r :
i :
(dispersionExperiment n).shared (inr (f, r)) (inl i) = ∅
Proof (Lean source)
lemma dispersionExperiment_shared_filler_core (n : ℕ) (f : Fin (2 * dispersionD n)) (r : Fin (dispersionT n)) (i : Fin (dispersionD n)) : (dispersionExperiment n).shared (inr (f, r)) (inl i) = ∅ := by simp [BipartiteExperiment.shared, dispersionExperiment, dispersionCore]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_shared_filler_core · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:133
theorem dispersionExperiment_hWeight_core

Each core intervention has the stated common exposure weight in the dispersion construction.

Formal statement
n :
a :
Proof (Lean source)
lemma dispersionExperiment_hWeight_core (n : ℕ) (a : Fin (dispersionD n)) : (dispersionExperiment n).hWeight (inl a) = (card (DispersionOutcome n) : ℝ)⁻¹ * dispersionD n := by unfold BipartiteExperiment.hWeight congr 1 have hterm (i j : DispersionOutcome n) : (if inl a ∈ (dispersionExperiment n).shared i j then (((dispersionExperiment n).shared i j).card : ℝ)⁻¹ else 0) = match i, j with | inl _, inl _ => (dispersionD n : ℝ)⁻¹ | _, _ => 0 := by rcases i with i | ⟨f, r⟩ <;> rcases j with j | ⟨g, s⟩ · simp [dispersionExperiment_shared_core] · simp [dispersionExperiment_shared_core_filler] · simp [dispersionExperiment_shared_filler_core] · by_cases hfg : f = g · subst g simp [dispersionExperiment_shared_filler] · simp [dispersionExperiment_shared_filler, hfg] simp_rw [hterm] rw [Fintype.sum_sum_type] simp_rw [Fintype.sum_sum_type, Fintype.sum_prod_type] simp only [Finset.sum_const_zero, add_zero] have hdN : 0 < dispersionD n := by simp [dispersionD, dispersionT] have hd : (dispersionD n : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hdN) simp [hd]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_hWeight_core · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:140
theorem dispersionExperiment_hWeight_filler

Each filler intervention has the stated exposure weight in the dispersion construction.

Formal statement
n :
f :
Proof (Lean source)
lemma dispersionExperiment_hWeight_filler (n : ℕ) (f : Fin (2 * dispersionD n)) : (dispersionExperiment n).hWeight (inr f) = (card (DispersionOutcome n) : ℝ)⁻¹ * dispersionD n := by unfold BipartiteExperiment.hWeight congr 1 have hterm (i j : DispersionOutcome n) : (if inr f ∈ (dispersionExperiment n).shared i j then (((dispersionExperiment n).shared i j).card : ℝ)⁻¹ else 0) = match i, j with | inr (g, _), inr (h, _) => if f = g ∧ g = h then 1 else 0 | _, _ => 0 := by rcases i with i | ⟨g, r⟩ <;> rcases j with j | ⟨h, s⟩ · simp [dispersionExperiment_shared_core] · simp [dispersionExperiment_shared_core_filler] · simp [dispersionExperiment_shared_filler_core] · by_cases hgh : g = h · subst h simp [dispersionExperiment_shared_filler] · simp [dispersionExperiment_shared_filler, hgh] simp_rw [hterm] rw [Fintype.sum_sum_type] simp_rw [Fintype.sum_sum_type, Fintype.sum_prod_type] simp only [Finset.sum_const_zero, add_zero, zero_add] calc (∑ x, ∑ x₁, ∑ x₂, ∑ x₃, if f = x ∧ x = x₂ then (1 : ℝ) else 0) = ∑ x, ∑ _x₁ : Fin (dispersionT n), ∑ x₂, (dispersionT n : ℝ) * (if f = x ∧ x = x₂ then 1 else 0) := by apply Fintype.sum_congr intro x apply Fintype.sum_congr intro x₁ apply Fintype.sum_congr intro x₂ simp _ = ∑ x, ∑ _x₁ : Fin (dispersionT n), if f = x then (dispersionT n : ℝ) else 0 := by apply Fintype.sum_congr intro x apply Fintype.sum_congr intro x₁ by_cases hx : f = x · subst x simp · simp [hx] _ = (dispersionT n : ℝ) ^ 2 := by simp ring _ = (dispersionD n : ℝ) := by norm_num [dispersionD]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_hWeight_filler · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:169
theorem dispersionD_pos

The number of core outcomes in the dispersion construction is positive.

Formal statement
n :
Proof (Lean source)
lemma dispersionD_pos (n : ℕ) : 0 < dispersionD n := by simp [dispersionD, dispersionT]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionD_pos · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:220
theorem dispersionExperiment_degree_energy

The degree-energy of the dispersion experiment has the stated closed-form value.

Formal statement
n :
∑ k, ((dispersionExperiment n).sdeg k : ℝ) ^ 2
= (dispersionD n : ℝ) * (dispersionD n : ℝ) ^ 2
+ (2 * dispersionD n : ℕ) * (dispersionT n : ℝ) ^ 2
Proof (Lean source)
lemma dispersionExperiment_degree_energy (n : ℕ) : ∑ k, ((dispersionExperiment n).sdeg k : ℝ) ^ 2 = (dispersionD n : ℝ) * (dispersionD n : ℝ) ^ 2 + (2 * dispersionD n : ℕ) * (dispersionT n : ℝ) ^ 2 := by rw [Fintype.sum_sum_type] simp [dispersionExperiment_sdeg_core, dispersionExperiment_sdeg_filler]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_degree_energy · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:225
theorem dispersionExperiment_degree_energy_pos

The degree-energy of the dispersion experiment is strictly positive.

Formal statement
n :
0 < ∑ k, ((dispersionExperiment n).sdeg k : ℝ) ^ 2
Proof (Lean source)
lemma dispersionExperiment_degree_energy_pos (n : ℕ) : 0 < ∑ k, ((dispersionExperiment n).sdeg k : ℝ) ^ 2 := by rw [dispersionExperiment_degree_energy] have hd : 0 < (dispersionD n : ℝ) := by exact_mod_cast dispersionD_pos n positivity
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_degree_energy_pos · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:234
theorem dispersionExperiment_hWeight_eq

All interventions in the dispersion experiment have the same exposure weight.

Formal statement
n :
Proof (Lean source)
lemma dispersionExperiment_hWeight_eq (n : ℕ) (k l : DispersionIntervention n) : (dispersionExperiment n).hWeight k = (dispersionExperiment n).hWeight l := by rcases k with k | k <;> rcases l with l | l all_goals simp only [dispersionExperiment_hWeight_core, dispersionExperiment_hWeight_filler]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_hWeight_eq · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:242
theorem dispersionExperiment_hWeight_pos

Every intervention has strictly positive exposure weight in the dispersion experiment.

Formal statement
n :
Proof (Lean source)
lemma dispersionExperiment_hWeight_pos (n : ℕ) (k : DispersionIntervention n) : 0 < (dispersionExperiment n).hWeight k := by rcases k with k | k <;> simp only [dispersionExperiment_hWeight_core, dispersionExperiment_hWeight_filler] all_goals have hO : Nonempty (DispersionOutcome n) := ⟨Sum.inl ⟨0, dispersionD_pos n⟩⟩ exact mul_pos (inv_pos.mpr (Nat.cast_pos.mpr (Fintype.card_pos_iff.mpr hO))) (Nat.cast_pos.mpr (dispersionD_pos n))
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_hWeight_pos · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:251
theorem dispersionExperiment_boundedOutcomeDegree

The dispersion experiment satisfies the stated bounded-outcome-degree condition.

Formal statement
n :
BoundedOutcomeDegree (dispersionExperiment n) (dispersionD n : ℝ)
Proof (Lean source)
lemma dispersionExperiment_boundedOutcomeDegree (n : ℕ) : BoundedOutcomeDegree (dispersionExperiment n) (dispersionD n : ℝ) := by constructor · exact_mod_cast dispersionD_pos n · intro i cases i with | inl i => simp [dispersionExperiment, dispersionCore] | inr fr => simp [dispersionExperiment] exact_mod_cast dispersionD_pos n
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionExperiment_boundedOutcomeDegree · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionConstruction.lean:263
Helpers.DispersionDesign 12 declarations

Interior homogeneous propensity used by the surrogate.

Definition (Lean source)
noncomputable def dispersionRho (ε : ℝ) : ℝ := (ε + 1 / 2) / 2
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionRho · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:20

Filler propensity that compensates for moving clique coordinates to 1/2.

Definition (Lean source)
noncomputable def dispersionFillerRho (ε : ℝ) : ℝ := (3 * dispersionRho ε - 1 / 2) / 2
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionFillerRho · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:24

The homogeneous expected-treatment budget.

Definition (Lean source)
noncomputable def dispersionBudget (n : ℕ) (ε : ℝ) : ℝ := (card (DispersionIntervention n) : ℝ) * dispersionRho ε
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionBudget · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:29
def dispersionHomogeneousDesign

The constant propensity vector selected by the additive surrogate.

Definition (Lean source)
noncomputable def dispersionHomogeneousDesign (n : ℕ) (ε : ℝ) : DispersionIntervention n → ℝ := fun _ => dispersionRho ε
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionHomogeneousDesign · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:34
def dispersionComparisonDesign

The feasible comparison: fair coins on the clique and compensated fillers.

Definition (Lean source)
noncomputable def dispersionComparisonDesign (n : ℕ) (ε : ℝ) : DispersionIntervention n → ℝ | inl _ => 1 / 2 | inr _ => dispersionFillerRho ε
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionComparisonDesign · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:39
theorem dispersionRho_bounds

Under an admissible positivity floor, the interior homogeneous propensity used by the surrogate lies strictly between that floor and one half, so it is an interior point of the feasible propensity range.

Formal statement
ε :
ε < dispersionRho ε ∧ dispersionRho ε < 1 / 2
Proof (Lean source)
lemma dispersionRho_bounds {ε : ℝ} (hε : EpsilonAdmissible ε) : ε < dispersionRho ε ∧ dispersionRho ε < 1 / 2 := by rcases hε with ⟨h0, h2⟩ unfold dispersionRho constructor <;> linarith
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionRho_bounds · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:46
theorem dispersionFillerRho_bounds

Under an admissible positivity floor, the compensating filler propensity likewise lies strictly between that floor and one half, so the comparison design that moves the clique coordinates to a fair coin stays interior.

Formal statement
ε :
Proof (Lean source)
lemma dispersionFillerRho_bounds {ε : ℝ} (hε : EpsilonAdmissible ε) : ε < dispersionFillerRho ε ∧ dispersionFillerRho ε < 1 / 2 := by rcases hε with ⟨h0, h2⟩ unfold dispersionFillerRho dispersionRho constructor <;> linarith
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionFillerRho_bounds · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:56
theorem dispersionBudget_admissible

The dispersion construction's homogeneous expected-treatment budget satisfies the admissibility requirements for the stated propensity floor.

Formal statement
n :
ε :
Proof (Lean source)
lemma dispersionBudget_admissible (n : ℕ) {ε : ℝ} (hε : EpsilonAdmissible ε) : BudgetAdmissible (I := DispersionIntervention n) ε (dispersionBudget n ε) := by have hr := dispersionRho_bounds hε unfold BudgetAdmissible dispersionBudget constructor · exact mul_le_mul_of_nonneg_left hr.1.le (Nat.cast_nonneg _) · have : dispersionRho ε ≤ 1 - ε := by rcases hε with ⟨h0, h2⟩ linarith [hr.2] exact mul_le_mul_of_nonneg_left this (Nat.cast_nonneg _)
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionBudget_admissible · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:66
theorem dispersionHomogeneousDesign_feasible

The constant-propensity dispersion design is feasible for its associated budget and propensity floor.

Formal statement
n :
ε :
Proof (Lean source)
lemma dispersionHomogeneousDesign_feasible (n : ℕ) {ε : ℝ} (hε : EpsilonAdmissible ε) : FeasibleDesign ε (dispersionBudget n ε) (dispersionHomogeneousDesign n ε) := by have hr := dispersionRho_bounds hε constructor · intro k change 0 ≤ dispersionRho ε ∧ dispersionRho ε ≤ 1 constructor <;> linarith [hε.1, hr.2] · exact hε · intro k change ε ≤ dispersionRho ε ∧ dispersionRho ε ≤ 1 - ε constructor · exact hr.1.le · linarith [hε.1, hr.2] · simp [BudgetBalance, dispersionBudget, dispersionHomogeneousDesign]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionHomogeneousDesign_feasible · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:79
theorem dispersionComparisonDesign_feasible

The clique-and-filler comparison design is feasible for the same dispersion budget and propensity floor.

Formal statement
n :
ε :
Proof (Lean source)
lemma dispersionComparisonDesign_feasible (n : ℕ) {ε : ℝ} (hε : EpsilonAdmissible ε) : FeasibleDesign ε (dispersionBudget n ε) (dispersionComparisonDesign n ε) := by have hf := dispersionFillerRho_bounds hε have hhalf : ε < 1 / 2 := hε.2 constructor · intro k cases k with | inl k => simp [dispersionComparisonDesign]; linarith | inr k => simp [dispersionComparisonDesign]; constructor <;> linarith [hε.1] · exact hε · intro k cases k with | inl k => simp [dispersionComparisonDesign]; constructor <;> linarith | inr k => simp [dispersionComparisonDesign]; constructor <;> linarith · unfold BudgetBalance dispersionBudget rw [Fintype.sum_sum_type] simp [dispersionComparisonDesign, dispersionFillerRho] ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionComparisonDesign_feasible · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:97
theorem dispersion_surrogateObjective_eq_weighted_sum

In the dispersion construction, the surrogate objective is a constant weight times the sum of reciprocal barriers over interventions.

Formal statement
n :
p :
Proof (Lean source)
lemma dispersion_surrogateObjective_eq_weighted_sum (n : ℕ) (p : DispersionIntervention n → ℝ) : (dispersionExperiment n).surrogateObjective p = ((card (DispersionOutcome n) : ℝ)⁻¹ * dispersionD n) * ∑ k, reciprocalBarrier (p k) := by unfold BipartiteExperiment.surrogateObjective reciprocalBarrier calc ∑ k, (dispersionExperiment n).hWeight k * ((p k)⁻¹ + (1 - p k)⁻¹) = ∑ k, ((card (DispersionOutcome n) : ℝ)⁻¹ * dispersionD n) * ((p k)⁻¹ + (1 - p k)⁻¹) := by apply sum_congr rfl intro k _ congr 1 cases k with | inl k => exact dispersionExperiment_hWeight_core n k | inr k => exact dispersionExperiment_hWeight_filler n k _ = ((card (DispersionOutcome n) : ℝ)⁻¹ * dispersionD n) * ∑ k, ((p k)⁻¹ + (1 - p k)⁻¹) := by rw [mul_sum]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersion_surrogateObjective_eq_weighted_sum · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:119
theorem dispersion_surrogateDesign_eq_homogeneous

The surrogate-optimal design for the dispersion construction is exactly the constant homogeneous-propensity design.

Formal statement
n :
ε :
Proof (Lean source)
lemma dispersion_surrogateDesign_eq_homogeneous (n : ℕ) {ε : ℝ} (hε : EpsilonAdmissible ε) : surrogateDesign (dispersionExperiment n) ε (dispersionBudget n ε) = dispersionHomogeneousDesign n ε := by let E := dispersionExperiment n let B := dispersionBudget n ε let ps := surrogateDesign E ε B have hs := surrogateDesign_feasible_minimizes E ε B hε.1 hε.2 (dispersionBudget_admissible n hε) have hh := dispersionHomogeneousDesign_feasible n hε have hmin := hs.2 (dispersionHomogeneousDesign n ε) hh rw [dispersion_surrogateObjective_eq_weighted_sum, dispersion_surrogateObjective_eq_weighted_sum] at hmin have hw : 0 < (card (DispersionOutcome n) : ℝ)⁻¹ * dispersionD n := by have hO : Nonempty (DispersionOutcome n) := ⟨Sum.inl ⟨0, dispersionD_pos n⟩⟩ exact mul_pos (inv_pos.mpr (Nat.cast_pos.mpr (Fintype.card_pos_iff.mpr hO))) (Nat.cast_pos.mpr (dispersionD_pos n)) have hsumle : ∑ k, reciprocalBarrier (ps k) ≤ (card (DispersionIntervention n) : ℝ) * reciprocalBarrier (dispersionRho ε) := by apply (mul_le_mul_iff_of_pos_left hw).mp simpa [ps, E, B, dispersionHomogeneousDesign] using hmin have hp0 : ∀ k, 0 < ps k := fun k => lt_of_lt_of_le hε.1 (hs.1.floor k).1 have hp1 : ∀ k, ps k < 1 := fun k => by linarith [(hs.1.floor k).2, hε.1] have hr := dispersionRho_bounds hε have hmean : ∑ k, ps k = (card (DispersionIntervention n) : ℝ) * dispersionRho ε := by exact hs.1.budget exact reciprocalBarrier_sum_unique_minimizer ps (dispersionRho ε) hp0 hp1 (lt_trans hε.1 hr.1) (lt_trans hr.2 (by norm_num)) hmean hsumle
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersion_surrogateDesign_eq_homogeneous · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionDesign.lean:141
Helpers.DispersionEnvelope 6 declarations
theorem dispersionHomogeneous_envelope

Gives the exact variance-envelope value of the homogeneous dispersion design.

Formal statement
n :
ε :
= (card (DispersionOutcome n) : ℝ)⁻¹ * ((dispersionD n : ℝ) ^ 2 * ((dispersionRho ε)⁻¹ ^ dispersionD n + (1 - dispersionRho ε)⁻¹ ^ dispersionD n) + (2 * dispersionD n : ℕ) * (dispersionT n : ℝ) ^ 2 * reciprocalBarrier (dispersionRho ε))
Proof (Lean source)
lemma dispersionHomogeneous_envelope (n : ℕ) (ε : ℝ) : (dispersionExperiment n).varEnvelope (dispersionHomogeneousDesign n ε) / 4 = (card (DispersionOutcome n) : ℝ)⁻¹ * ((dispersionD n : ℝ) ^ 2 * ((dispersionRho ε)⁻¹ ^ dispersionD n + (1 - dispersionRho ε)⁻¹ ^ dispersionD n) + (2 * dispersionD n : ℕ) * (dispersionT n : ℝ) ^ 2 * reciprocalBarrier (dispersionRho ε)) := by classical have hcore (i j : Fin (dispersionD n)) : (dispersionExperiment n).r1 (dispersionHomogeneousDesign n ε) (inl i) (inl j) + (dispersionExperiment n).r0 (dispersionHomogeneousDesign n ε) (inl i) (inl j) + 2 * (dispersionExperiment n).r10 (inl i) (inl j) = (dispersionRho ε)⁻¹ ^ dispersionD n + (1 - dispersionRho ε)⁻¹ ^ dispersionD n := by unfold BipartiteExperiment.r1 BipartiteExperiment.r0 BipartiteExperiment.r10 simp [dispersionExperiment_shared_core, dispersionHomogeneousDesign, dispersionCore, dispersionD_pos] ring have hcross (i : Fin (dispersionD n)) (f : Fin (2 * dispersionD n)) (r : Fin (dispersionT n)) : (dispersionExperiment n).r1 (dispersionHomogeneousDesign n ε) (inl i) (inr (f, r)) + (dispersionExperiment n).r0 (dispersionHomogeneousDesign n ε) (inl i) (inr (f, r)) + 2 * (dispersionExperiment n).r10 (inl i) (inr (f, r)) = 0 := by simp [BipartiteExperiment.r1, BipartiteExperiment.r0, BipartiteExperiment.r10, dispersionExperiment_shared_core_filler] have hcross' (f : Fin (2 * dispersionD n)) (r : Fin (dispersionT n)) (i : Fin (dispersionD n)) : (dispersionExperiment n).r1 (dispersionHomogeneousDesign n ε) (inr (f, r)) (inl i) + (dispersionExperiment n).r0 (dispersionHomogeneousDesign n ε) (inr (f, r)) (inl i) + 2 * (dispersionExperiment n).r10 (inr (f, r)) (inl i) = 0 := by simp [BipartiteExperiment.r1, BipartiteExperiment.r0, BipartiteExperiment.r10, dispersionExperiment_shared_filler_core] have hfiller (f g : Fin (2 * dispersionD n)) (r s : Fin (dispersionT n)) : (dispersionExperiment n).r1 (dispersionHomogeneousDesign n ε) (inr (f, r)) (inr (g, s)) + (dispersionExperiment n).r0 (dispersionHomogeneousDesign n ε) (inr (f, r)) (inr (g, s)) + 2 * (dispersionExperiment n).r10 (inr (f, r)) (inr (g, s)) = if f = g then reciprocalBarrier (dispersionRho ε) else 0 := by by_cases h : f = g · subst g simp [BipartiteExperiment.r1, BipartiteExperiment.r0, BipartiteExperiment.r10, dispersionExperiment_shared_filler, dispersionHomogeneousDesign, reciprocalBarrier] ring · simp [BipartiteExperiment.r1, BipartiteExperiment.r0, BipartiteExperiment.r10, dispersionExperiment_shared_filler, h] unfold BipartiteExperiment.varEnvelope rw [Fintype.sum_sum_type] simp_rw [Fintype.sum_sum_type, Fintype.sum_prod_type] simp_rw [hcore, hcross, hcross', hfiller] simp ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionHomogeneous_envelope · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionEnvelope.lean:19
theorem dispersionComparison_envelope

Gives the exact variance-envelope value of the clique-and-filler comparison design.

Formal statement
n :
ε :
= (card (DispersionOutcome n) : ℝ)⁻¹ * ((dispersionD n : ℝ) ^ 2 * (2 : ℝ) ^ (dispersionD n + 1) + (2 * dispersionD n : ℕ) * (dispersionT n : ℝ) ^ 2 * reciprocalBarrier (dispersionFillerRho ε))
Proof (Lean source)
lemma dispersionComparison_envelope (n : ℕ) (ε : ℝ) : (dispersionExperiment n).varEnvelope (dispersionComparisonDesign n ε) / 4 = (card (DispersionOutcome n) : ℝ)⁻¹ * ((dispersionD n : ℝ) ^ 2 * (2 : ℝ) ^ (dispersionD n + 1) + (2 * dispersionD n : ℕ) * (dispersionT n : ℝ) ^ 2 * reciprocalBarrier (dispersionFillerRho ε)) := by classical have hcore (i j : Fin (dispersionD n)) : (dispersionExperiment n).r1 (dispersionComparisonDesign n ε) (inl i) (inl j) + (dispersionExperiment n).r0 (dispersionComparisonDesign n ε) (inl i) (inl j) + 2 * (dispersionExperiment n).r10 (inl i) (inl j) = (2 : ℝ) ^ (dispersionD n + 1) := by unfold BipartiteExperiment.r1 BipartiteExperiment.r0 BipartiteExperiment.r10 simp [dispersionExperiment_shared_core, dispersionComparisonDesign, dispersionCore, dispersionD_pos] rw [← inv_pow] norm_num rw [pow_succ] ring_nf have hcross (i : Fin (dispersionD n)) (f : Fin (2 * dispersionD n)) (r : Fin (dispersionT n)) : (dispersionExperiment n).r1 (dispersionComparisonDesign n ε) (inl i) (inr (f, r)) + (dispersionExperiment n).r0 (dispersionComparisonDesign n ε) (inl i) (inr (f, r)) + 2 * (dispersionExperiment n).r10 (inl i) (inr (f, r)) = 0 := by simp [BipartiteExperiment.r1, BipartiteExperiment.r0, BipartiteExperiment.r10, dispersionExperiment_shared_core_filler] have hcross' (f : Fin (2 * dispersionD n)) (r : Fin (dispersionT n)) (i : Fin (dispersionD n)) : (dispersionExperiment n).r1 (dispersionComparisonDesign n ε) (inr (f, r)) (inl i) + (dispersionExperiment n).r0 (dispersionComparisonDesign n ε) (inr (f, r)) (inl i) + 2 * (dispersionExperiment n).r10 (inr (f, r)) (inl i) = 0 := by simp [BipartiteExperiment.r1, BipartiteExperiment.r0, BipartiteExperiment.r10, dispersionExperiment_shared_filler_core] have hfiller (f g : Fin (2 * dispersionD n)) (r s : Fin (dispersionT n)) : (dispersionExperiment n).r1 (dispersionComparisonDesign n ε) (inr (f, r)) (inr (g, s)) + (dispersionExperiment n).r0 (dispersionComparisonDesign n ε) (inr (f, r)) (inr (g, s)) + 2 * (dispersionExperiment n).r10 (inr (f, r)) (inr (g, s)) = if f = g then reciprocalBarrier (dispersionFillerRho ε) else 0 := by by_cases h : f = g · subst g simp [BipartiteExperiment.r1, BipartiteExperiment.r0, BipartiteExperiment.r10, dispersionExperiment_shared_filler, dispersionComparisonDesign, reciprocalBarrier] ring · simp [BipartiteExperiment.r1, BipartiteExperiment.r0, BipartiteExperiment.r10, dispersionExperiment_shared_filler, h] unfold BipartiteExperiment.varEnvelope rw [Fintype.sum_sum_type] simp_rw [Fintype.sum_sum_type, Fintype.sum_prod_type] simp_rw [hcore, hcross, hcross', hfiller] simp ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionComparison_envelope · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionEnvelope.lean:74
theorem reciprocalBarrier_pos

The reciprocal barrier is strictly positive for every propensity strictly between zero and one.

Formal statement
x :
hx0 :
0 < x
hx1 :
x < 1
Proof (Lean source)
lemma reciprocalBarrier_pos {x : ℝ} (hx0 : 0 < x) (hx1 : x < 1) : 0 < reciprocalBarrier x := by unfold reciprocalBarrier exact add_pos (inv_pos.mpr hx0) (inv_pos.mpr (sub_pos.mpr hx1))
CausalSmith.Experimentation.BipartiteMinimaxDesign.reciprocalBarrier_pos · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionEnvelope.lean:129
theorem dispersion_envMin_pos

The minimum envelope value in the dispersion construction is strictly positive.

Formal statement
n :
ε :
Proof (Lean source)
lemma dispersion_envMin_pos (n : ℕ) {ε : ℝ} (hε : EpsilonAdmissible ε) : 0 < envMin (dispersionExperiment n) ε (dispersionBudget n ε) := by let E := dispersionExperiment n let B := dispersionBudget n ε let po := optimalDesign E ε B have hB := dispersionBudget_admissible n hε have hopt := optimalDesign_feasible_minimizes E ε B hε.1 hε.2 hB have hsand := (surrogate_certificate E ε B (dispersionD n : ℝ) hε.1 hε.2 (dispersionExperiment_boundedOutcomeDegree n) hB).1 po hopt.1 have hp0 : ∀ k, 0 < po k := fun k => lt_of_lt_of_le hε.1 (hopt.1.floor k).1 have hp1 : ∀ k, po k < 1 := fun k => by linarith [(hopt.1.floor k).2, hε.1] let k0 : DispersionIntervention n := inl ⟨0, dispersionD_pos n⟩ have hsum : 0 < ∑ k, reciprocalBarrier (po k) := by apply Finset.sum_pos · intro k hk exact reciprocalBarrier_pos (hp0 k) (hp1 k) · exact ⟨k0, mem_univ k0⟩ have hA : 0 < E.surrogateObjective po := by rw [dispersion_surrogateObjective_eq_weighted_sum] have hO : Nonempty (DispersionOutcome n) := ⟨Sum.inl ⟨0, dispersionD_pos n⟩⟩ exact mul_pos (mul_pos (inv_pos.mpr (Nat.cast_pos.mpr (Fintype.card_pos_iff.mpr hO))) (Nat.cast_pos.mpr (dispersionD_pos n))) hsum unfold envMin change 0 < E.varEnvelope po nlinarith [hsand.1]
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersion_envMin_pos · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionEnvelope.lean:136
theorem dispersion_approxRatio_ge_envelopeRatio

The dispersion approximation ratio is at least the ratio of the homogeneous design's envelope to the comparison design's envelope.

Formal statement
Proof (Lean source)
lemma dispersion_approxRatio_ge_envelopeRatio (n : ℕ) {ε : ℝ} (hε : EpsilonAdmissible ε) : (dispersionExperiment n).varEnvelope (dispersionHomogeneousDesign n ε) / (dispersionExperiment n).varEnvelope (dispersionComparisonDesign n ε) ≤ approxRatio (dispersionExperiment n) ε (dispersionBudget n ε) := by let E := dispersionExperiment n let B := dispersionBudget n ε have hminpos := dispersion_envMin_pos n hε have hopt := optimalDesign_feasible_minimizes E ε B hε.1 hε.2 (dispersionBudget_admissible n hε) have hcmp := dispersionComparisonDesign_feasible n hε have hminle : envMin E ε B ≤ E.varEnvelope (dispersionComparisonDesign n ε) := by exact hopt.2 _ hcmp have hcmppos : 0 < E.varEnvelope (dispersionComparisonDesign n ε) := lt_of_lt_of_le hminpos hminle have hhomnonneg : 0 ≤ E.varEnvelope (dispersionHomogeneousDesign n ε) := by rw [show E.varEnvelope (dispersionHomogeneousDesign n ε) = 4 * (E.varEnvelope (dispersionHomogeneousDesign n ε) / 4) by ring, dispersionHomogeneous_envelope] have hr := dispersionRho_bounds hε have hr0 : 0 < dispersionRho ε := lt_trans hε.1 hr.1 have hr1 : dispersionRho ε < 1 := lt_trans hr.2 (by norm_num) have hO : Nonempty (DispersionOutcome n) := ⟨Sum.inl ⟨0, dispersionD_pos n⟩⟩ have hc : 0 ≤ (card (DispersionOutcome n) : ℝ)⁻¹ := (inv_pos.mpr (Nat.cast_pos.mpr (Fintype.card_pos_iff.mpr hO))).le have hmain : 0 ≤ (dispersionD n : ℝ) ^ 2 * ((dispersionRho ε)⁻¹ ^ dispersionD n + (1 - dispersionRho ε)⁻¹ ^ dispersionD n) := by exact mul_nonneg (sq_nonneg _) (add_nonneg (pow_nonneg (inv_nonneg.mpr hr0.le) _) (pow_nonneg (inv_nonneg.mpr (sub_nonneg.mpr hr1.le)) _)) have hfill : 0 ≤ (2 * dispersionD n : ℕ) * (dispersionT n : ℝ) ^ 2 * reciprocalBarrier (dispersionRho ε) := by exact mul_nonneg (mul_nonneg (Nat.cast_nonneg _) (sq_nonneg _)) (reciprocalBarrier_pos hr0 hr1).le exact mul_nonneg (by norm_num) (mul_nonneg hc (add_nonneg hmain hfill)) unfold approxRatio rw [if_pos hminpos, dispersion_surrogateDesign_eq_homogeneous n hε] exact div_le_div_of_nonneg_left hhomnonneg hminpos hminle
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersion_approxRatio_ge_envelopeRatio · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionEnvelope.lean:167
theorem dispersion_approxRatio_lower_bound

The dispersion approximation ratio admits the stated explicit lower bound.

Formal statement
n :
ε :
Proof (Lean source)
lemma dispersion_approxRatio_lower_bound (n : ℕ) {ε : ℝ} (hε : EpsilonAdmissible ε) : (dispersionRho ε)⁻¹ ^ dispersionD n / ((2 : ℝ) ^ (dispersionD n + 1) + 2 * reciprocalBarrier (dispersionFillerRho ε)) ≤ approxRatio (dispersionExperiment n) ε (dispersionBudget n ε) := by have hratio := dispersion_approxRatio_ge_envelopeRatio n hε apply le_trans ?_ hratio let E := dispersionExperiment n let ph := dispersionHomogeneousDesign n ε let pc := dispersionComparisonDesign n ε have hpc : 0 < E.varEnvelope pc := by have hm := dispersion_envMin_pos n hε have ho := optimalDesign_feasible_minimizes E ε (dispersionBudget n ε) hε.1 hε.2 (dispersionBudget_admissible n hε) exact lt_of_lt_of_le hm (ho.2 pc (dispersionComparisonDesign_feasible n hε)) have hden : 0 < (2 : ℝ) ^ (dispersionD n + 1) + 2 * reciprocalBarrier (dispersionFillerRho ε) := by have hf := dispersionFillerRho_bounds hε have hf1 : dispersionFillerRho ε < 1 := lt_trans hf.2 (by norm_num) exact add_pos (pow_pos (by norm_num) _) (mul_pos (by norm_num) (reciprocalBarrier_pos (lt_trans hε.1 hf.1) hf1)) rw [div_le_div_iff₀ hden hpc] rw [show E.varEnvelope pc = 4 * (E.varEnvelope pc / 4) by ring, show E.varEnvelope ph = 4 * (E.varEnvelope ph / 4) by ring, dispersionComparison_envelope, dispersionHomogeneous_envelope] have hr := dispersionRho_bounds hε have hr0 : 0 < dispersionRho ε := lt_trans hε.1 hr.1 have hr1 : dispersionRho ε < 1 := lt_trans hr.2 (by norm_num) have hcoef : 0 < (card (DispersionOutcome n) : ℝ)⁻¹ * (dispersionD n : ℝ) ^ 2 := by have hO : Nonempty (DispersionOutcome n) := ⟨Sum.inl ⟨0, dispersionD_pos n⟩⟩ exact mul_pos (inv_pos.mpr (Nat.cast_pos.mpr (Fintype.card_pos_iff.mpr hO))) (sq_pos_of_pos (Nat.cast_pos.mpr (dispersionD_pos n))) have hd : (dispersionD n : ℝ) = (dispersionT n : ℝ) ^ 2 := by simp [dispersionD] rw [show (2 * dispersionD n : ℕ) * (dispersionT n : ℝ) ^ 2 = 2 * (dispersionD n : ℝ) ^ 2 by push_cast; rw [hd]; ring] have hY : 0 ≤ (1 - dispersionRho ε)⁻¹ ^ dispersionD n := pow_nonneg (inv_nonneg.mpr (sub_nonneg.mpr hr1.le)) _ have hR : 0 ≤ reciprocalBarrier (dispersionRho ε) := (reciprocalBarrier_pos hr0 hr1).le have hnum : (dispersionRho ε)⁻¹ ^ dispersionD n ≤ (dispersionRho ε)⁻¹ ^ dispersionD n + (1 - dispersionRho ε)⁻¹ ^ dispersionD n + 2 * reciprocalBarrier (dispersionRho ε) := by nlinarith have hscaled := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hnum (by positivity : 0 ≤ 4 * ((card (DispersionOutcome n) : ℝ)⁻¹ * (dispersionD n : ℝ) ^ 2))) hden.le convert hscaled using 1 <;> ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersion_approxRatio_lower_bound · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionEnvelope.lean:210
Helpers.DispersionOptimization 6 declarations

The one-coordinate additive surrogate barrier.

Definition (Lean source)
noncomputable def reciprocalBarrier (x : ℝ) : ℝ := x⁻¹ + (1 - x)⁻¹
CausalSmith.Experimentation.BipartiteMinimaxDesign.reciprocalBarrier · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionOptimization.lean:19

The derivative of reciprocalBarrier at an interior point.

Definition (Lean source)
noncomputable def reciprocalBarrierSlope (r : ℝ) : ℝ := -(r⁻¹ ^ 2) + (1 - r)⁻¹ ^ 2
CausalSmith.Experimentation.BipartiteMinimaxDesign.reciprocalBarrierSlope · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionOptimization.lean:23
theorem reciprocalBarrier_tangent_gap

The one-coordinate reciprocal barrier lies above each of its tangent lines: at any two interior propensities, the barrier's value at the first is at least its first-order expansion around the second. This is the convexity inequality that drives the surrogate minimization.

Formal statement
x r :
hx0 :
0 < x
hx1 :
x < 1
hr0 :
0 < r
hr1 :
r < 1
Proof (Lean source)
lemma reciprocalBarrier_tangent_gap {x r : ℝ} (hx0 : 0 < x) (hx1 : x < 1) (hr0 : 0 < r) (hr1 : r < 1) : reciprocalBarrier r + reciprocalBarrierSlope r * (x - r) ≤ reciprocalBarrier x := by have hxn : x ≠ 0 := ne_of_gt hx0 have hrn : r ≠ 0 := ne_of_gt hr0 have h1xn : 1 - x ≠ 0 := ne_of_gt (sub_pos.mpr hx1) have h1rn : 1 - r ≠ 0 := ne_of_gt (sub_pos.mpr hr1) have hA : 0 < r ^ 2 + 2 * r * x - 2 * r - x + 1 := by by_cases hhalf : r ≤ 1 / 2 · have hc : 0 ≤ (1 - 2 * r) * (1 - x) := mul_nonneg (by linarith) (by linarith) nlinarith [sq_pos_of_pos hr0] · have hc : 0 ≤ (2 * r - 1) * x := mul_nonneg (by linarith) (le_of_lt hx0) nlinarith [sq_pos_of_pos (sub_pos.mpr hr1)] have hgap : reciprocalBarrier x - (reciprocalBarrier r + reciprocalBarrierSlope r * (x - r)) = (x - r) ^ 2 * (r ^ 2 + 2 * r * x - 2 * r - x + 1) / (r ^ 2 * x * (1 - r) ^ 2 * (1 - x)) := by rw [reciprocalBarrier, reciprocalBarrier, reciprocalBarrierSlope, inv_pow] field_simp ring apply sub_nonneg.mp rw [hgap] apply div_nonneg · exact mul_nonneg (sq_nonneg _) (le_of_lt hA) · exact le_of_lt (mul_pos (mul_pos (mul_pos (sq_pos_of_pos hr0) hx0) (sq_pos_of_pos (sub_pos.mpr hr1))) (sub_pos.mpr hx1))
CausalSmith.Experimentation.BipartiteMinimaxDesign.reciprocalBarrier_tangent_gap · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionOptimization.lean:27
theorem reciprocalBarrier_tangent_eq_iff

The reciprocal barrier equals its tangent-line lower bound at the mean propensity exactly when every propensity equals that mean.

Formal statement
x r :
hx0 :
0 < x
hx1 :
x < 1
hr0 :
0 < r
hr1 :
r < 1
Proof (Lean source)
lemma reciprocalBarrier_tangent_eq_iff {x r : ℝ} (hx0 : 0 < x) (hx1 : x < 1) (hr0 : 0 < r) (hr1 : r < 1) : reciprocalBarrier r + reciprocalBarrierSlope r * (x - r) = reciprocalBarrier x ↔ x = r := by have hxn : x ≠ 0 := ne_of_gt hx0 have hrn : r ≠ 0 := ne_of_gt hr0 have h1xn : 1 - x ≠ 0 := ne_of_gt (sub_pos.mpr hx1) have h1rn : 1 - r ≠ 0 := ne_of_gt (sub_pos.mpr hr1) have hA : 0 < r ^ 2 + 2 * r * x - 2 * r - x + 1 := by by_cases hhalf : r ≤ 1 / 2 · have hc : 0 ≤ (1 - 2 * r) * (1 - x) := mul_nonneg (by linarith) (by linarith) nlinarith [sq_pos_of_pos hr0] · have hc : 0 ≤ (2 * r - 1) * x := mul_nonneg (by linarith) (le_of_lt hx0) nlinarith [sq_pos_of_pos (sub_pos.mpr hr1)] have hgap : reciprocalBarrier x - (reciprocalBarrier r + reciprocalBarrierSlope r * (x - r)) = (x - r) ^ 2 * (r ^ 2 + 2 * r * x - 2 * r - x + 1) / (r ^ 2 * x * (1 - r) ^ 2 * (1 - x)) := by rw [reciprocalBarrier, reciprocalBarrier, reciprocalBarrierSlope, inv_pow] field_simp ring constructor · intro h have hz : reciprocalBarrier x - (reciprocalBarrier r + reciprocalBarrierSlope r * (x - r)) = 0 := by linarith rw [hgap, div_eq_zero_iff] at hz rcases hz with hnum | hden · rcases mul_eq_zero.mp hnum with hs | hAz · exact sub_eq_zero.mp (sq_eq_zero_iff.mp hs) · exact elim ((ne_of_gt hA) hAz) · have hdenne : r ^ 2 * x * (1 - r) ^ 2 * (1 - x) ≠ 0 := by positivity exact elim (hdenne hden) · rintro rfl ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.reciprocalBarrier_tangent_eq_iff · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionOptimization.lean:63
theorem reciprocalBarrier_sum_minimized_at_mean

Among propensities with a fixed average, the sum of reciprocal barriers is minimized at the common mean propensity.

Formal statement
K :
Type*
p :
K → ℝ
r :
hp0 :
∀ k, 0 < p k
hp1 :
∀ k, p k < 1
hr0 :
0 < r
hr1 :
r < 1
hmean :
∑ k, p k = (Fintype.card K : ℝ) * r
(Fintype.card K : ℝ) * reciprocalBarrier r ≤ ∑ k, reciprocalBarrier (p k)
Proof (Lean source)
lemma reciprocalBarrier_sum_minimized_at_mean {K : Type*} [Fintype K] (p : K → ℝ) (r : ℝ) (hp0 : ∀ k, 0 < p k) (hp1 : ∀ k, p k < 1) (hr0 : 0 < r) (hr1 : r < 1) (hmean : ∑ k, p k = (Fintype.card K : ℝ) * r) : (Fintype.card K : ℝ) * reciprocalBarrier r ≤ ∑ k, reciprocalBarrier (p k) := by calc (Fintype.card K : ℝ) * reciprocalBarrier r = ∑ k : K, (reciprocalBarrier r + reciprocalBarrierSlope r * (p k - r)) := by rw [sum_add_distrib, sum_const, nsmul_eq_mul, ← mul_sum] simp only [sum_sub_distrib, sum_const, nsmul_eq_mul, card_univ, hmean] ring _ ≤ ∑ k, reciprocalBarrier (p k) := by exact sum_le_sum fun k _ => reciprocalBarrier_tangent_gap (hp0 k) (hp1 k) hr0 hr1
CausalSmith.Experimentation.BipartiteMinimaxDesign.reciprocalBarrier_sum_minimized_at_mean · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionOptimization.lean:105
theorem reciprocalBarrier_sum_unique_minimizer

The common-mean propensity vector is the unique minimizer of the reciprocal-barrier sum among vectors with the same average.

Formal statement
K :
Type*
p :
K → ℝ
r :
hp0 :
∀ k, 0 < p k
hp1 :
∀ k, p k < 1
hr0 :
0 < r
hr1 :
r < 1
hmean :
∑ k, p k = (Fintype.card K : ℝ) * r
hle :
∑ k, reciprocalBarrier (p k) ≤ (Fintype.card K : ℝ) * reciprocalBarrier r
p = fun _ => r
Proof (Lean source)
lemma reciprocalBarrier_sum_unique_minimizer {K : Type*} [Fintype K] (p : K → ℝ) (r : ℝ) (hp0 : ∀ k, 0 < p k) (hp1 : ∀ k, p k < 1) (hr0 : 0 < r) (hr1 : r < 1) (hmean : ∑ k, p k = (Fintype.card K : ℝ) * r) (hle : ∑ k, reciprocalBarrier (p k) ≤ (Fintype.card K : ℝ) * reciprocalBarrier r) : p = fun _ => r := by funext k have hsum := reciprocalBarrier_sum_minimized_at_mean p r hp0 hp1 hr0 hr1 hmean have heq : ∑ j : K, reciprocalBarrier (p j) = (Fintype.card K : ℝ) * reciprocalBarrier r := le_antisymm hle hsum have hterm : ∀ j ∈ (univ : Finset K), reciprocalBarrier r + reciprocalBarrierSlope r * (p j - r) ≤ reciprocalBarrier (p j) := fun j _ => reciprocalBarrier_tangent_gap (hp0 j) (hp1 j) hr0 hr1 have hsumTang : ∑ j : K, (reciprocalBarrier r + reciprocalBarrierSlope r * (p j - r)) = (Fintype.card K : ℝ) * reciprocalBarrier r := by rw [sum_add_distrib, sum_const, nsmul_eq_mul, ← mul_sum] simp only [sum_sub_distrib, sum_const, nsmul_eq_mul, card_univ, hmean] ring have hk := (sum_eq_sum_iff_of_le hterm).mp (hsumTang.trans heq.symm) k (mem_univ k) exact (reciprocalBarrier_tangent_eq_iff (hp0 k) (hp1 k) hr0 hr1).mp hk
CausalSmith.Experimentation.BipartiteMinimaxDesign.reciprocalBarrier_sum_unique_minimizer · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/DispersionOptimization.lean:121
Helpers.EnvelopeCalculus 19 declarations C² regularity of the floored envelope extension

regularity of the floored envelope extension

theorem r1Ext_contDiff_two

The floored treated-load extension is (it is by r1Ext_contDiff; the only input that needed strengthening is recipC, now Cⁿ for every n).

Formal statement
ε :
:
0 < ε
i j :
O
ContDiff ℝ 2 (fun p : I → ℝ => E.r1Ext ε p i j)
Proof (Lean source)
@[fun_prop] lemma r1Ext_contDiff_two (ε : ℝ) (hε : 0 < ε) (i j : O) : ContDiff ℝ 2 (fun p : I → ℝ => E.r1Ext ε p i j) := by unfold r1Ext by_cases hij : 0 < (E.shared i j).card · simp only [hij, ↓reduceIte] fun_prop (disch := assumption) · simp only [hij, ↓reduceIte] fun_prop
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r1Ext_contDiff_two · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:46
theorem r0Ext_contDiff_two

The floored control-load extension is .

Formal statement
ε :
:
0 < ε
i j :
O
ContDiff ℝ 2 (fun p : I → ℝ => E.r0Ext ε p i j)
Proof (Lean source)
@[fun_prop] lemma r0Ext_contDiff_two (ε : ℝ) (hε : 0 < ε) (i j : O) : ContDiff ℝ 2 (fun p : I → ℝ => E.r0Ext ε p i j) := by unfold r0Ext by_cases hij : 0 < (E.shared i j).card · simp only [hij, ↓reduceIte] fun_prop (disch := assumption) · simp only [hij, ↓reduceIte] fun_prop
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r0Ext_contDiff_two · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:58
theorem varEnvelopeExt_contDiff_two

The floored envelope extension is on all of I → ℝ.

Formal statement
ε :
:
0 < ε
ContDiff ℝ 2 (E.varEnvelopeExt ε)
Proof (Lean source)
lemma varEnvelopeExt_contDiff_two (ε : ℝ) (hε : 0 < ε) : ContDiff ℝ 2 (E.varEnvelopeExt ε) := by unfold varEnvelopeExt fun_prop (disch := assumption)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.varEnvelopeExt_contDiff_two · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:69
theorem envelopeQuarterExt_contDiff_two

The NORMALIZED floored envelope extension V_env^ext / 4 is . This is the function whose Hessian quadratic form the modulus dirModulus measures.

Formal statement
ε :
:
0 < ε
ContDiff ℝ 2 (fun p : I → ℝ => E.varEnvelopeExt ε p / 4)
Proof (Lean source)
lemma envelopeQuarterExt_contDiff_two (ε : ℝ) (hε : 0 < ε) : ContDiff ℝ 2 (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) := by unfold varEnvelopeExt fun_prop (disch := assumption)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.envelopeQuarterExt_contDiff_two · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:75
def envCurv

Directional curvature of the normalized envelope at base point q along d, i.e. Hess (V_env/4) q (d, d), computed on the globally- extension.

Definition (Lean source)
noncomputable def envCurv (E : BipartiteExperiment I O) (ε : ℝ) (d q : I → ℝ) : ℝ := secondDirDeriv (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) d q
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.envCurv · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:84
theorem envCurv_continuous

The curvature modulus is continuous in the base point. Combined with compactness of feasibleSet this is what makes dirModulus a genuine (bounded) supremum.

Formal statement
ε :
:
0 < ε
d :
I → ℝ
Continuous (E.envCurv ε d)
Proof (Lean source)
lemma envCurv_continuous (ε : ℝ) (hε : 0 < ε) (d : I → ℝ) : Continuous (E.envCurv ε d) := by exact continuous_secondDirDeriv (E.envelopeQuarterExt_contDiff_two ε hε) d
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.envCurv_continuous · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:89
theorem envelope_line_eventuallyEq

On an ε/2-ball of parameters, a line through a feasible point in a direction bounded by 1 stays in the region where recipC has saturated, so V_env and V_env^ext agree there.

Formal statement
ε B :
:
0 < ε
q :
I → ℝ
hq :
q ∈ feasibleSet (I := I) ε B
d :
I → ℝ
hd :
∀ k, |d k| ≤ 1
(fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4)
=ᶠ[𝓝 (0 : ℝ)] (fun s : ℝ => E.varEnvelopeExt ε (fun k => q k + s * d k) / 4)
Proof (Lean source)
lemma envelope_line_eventuallyEq (ε B : ℝ) (hε : 0 < ε) {q : I → ℝ} (hq : q ∈ feasibleSet (I := I) ε B) {d : I → ℝ} (hd : ∀ k, |d k| ≤ 1) : (fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) =ᶠ[𝓝 (0 : ℝ)] (fun s : ℝ => E.varEnvelopeExt ε (fun k => q k + s * d k) / 4) := by filter_upwards [Ioo_mem_nhds (a := -(ε / 2)) (b := ε / 2) (by linarith) (by linarith)] with s hs have hsabs : |s| < ε / 2 := (abs_lt).mpr ⟨by linarith [hs.1], by linarith [hs.2]⟩ have hbox : ∀ k, ε / 2 ≤ q k + s * d k ∧ ε / 2 ≤ 1 - (q k + s * d k) := by intro k have hsd : |s * d k| ≤ ε / 2 := by calc |s * d k| = |s| * |d k| := abs_mul _ _ _ ≤ |s| * 1 := mul_le_mul_of_nonneg_left (hd k) (abs_nonneg s) _ ≤ ε / 2 := le_of_lt (by simpa using hsabs) have hqk := hq.floor k constructor <;> linarith [le_abs_self (s * d k), neg_le_abs (s * d k)] exact congrArg (fun x : ℝ => x / 4) (E.varEnvelopeExt_eq_varEnvelope_of_box hε (fun k => (hbox k).1) (fun k => (hbox k).2)).symm
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.envelope_line_eventuallyEq · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:97
theorem contDiffOn_envelope_line

The envelope line is on any parameter set that keeps the line inside the saturated box.

Formal statement
ε :
:
0 < ε
q d :
I → ℝ
S :
Set
hbox :
∀ s ∈ S, ∀ k, ε / 2 ≤ q k + s * d k ∧ ε / 2 ≤ 1 - (q k + s * d k)
ContDiffOn ℝ 2 (fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) S
Proof (Lean source)
lemma contDiffOn_envelope_line (ε : ℝ) (hε : 0 < ε) {q d : I → ℝ} {S : Set ℝ} (hbox : ∀ s ∈ S, ∀ k, ε / 2 ≤ q k + s * d k ∧ ε / 2 ≤ 1 - (q k + s * d k)) : ContDiffOn ℝ 2 (fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) S := by have hext : ContDiff ℝ 2 (fun s : ℝ => E.varEnvelopeExt ε (fun k => q k + s * d k) / 4) := by apply (E.envelopeQuarterExt_contDiff_two ε hε).comp apply contDiff_pi.mpr intro k fun_prop apply hext.contDiffOn.congr intro s hs exact congrArg (fun x : ℝ => x / 4) (E.varEnvelopeExt_eq_varEnvelope_of_box hε (fun k => (hbox s hs k).1) (fun k => (hbox s hs k).2)).symm
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.contDiffOn_envelope_line · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:119
theorem differentiableAt_envelope_line_zero

The envelope line through a feasible point is differentiable at 0.

Formal statement
ε B :
:
0 < ε
q :
I → ℝ
hq :
q ∈ feasibleSet (I := I) ε B
d :
I → ℝ
hd :
∀ k, |d k| ≤ 1
DifferentiableAt ℝ (fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) 0
Proof (Lean source)
lemma differentiableAt_envelope_line_zero (ε B : ℝ) (hε : 0 < ε) {q : I → ℝ} (hq : q ∈ feasibleSet (I := I) ε B) {d : I → ℝ} (hd : ∀ k, |d k| ≤ 1) : DifferentiableAt ℝ (fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) 0 := by apply (E.envelope_line_eventuallyEq ε B hε hq hd).differentiableAt_iff.mpr have hext : ContDiff ℝ 2 (fun s : ℝ => E.varEnvelopeExt ε (fun k => q k + s * d k) / 4) := by apply (E.envelopeQuarterExt_contDiff_two ε hε).comp apply contDiff_pi.mpr intro k fun_prop exact (hext.differentiable two_ne_zero).differentiableAt
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.differentiableAt_envelope_line_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:135
theorem differentiableAt_envelope_line

The envelope line is differentiable at ANY parameter whose base point is feasible. Needed to feed ConvexOn.monotoneOn_deriv on the whole segment, not just at its midpoint.

Formal statement
ε B :
:
0 < ε
q d :
I → ℝ
hd :
∀ k, |d k| ≤ 1
t :
hqt :
(fun k => q k + t * d k) ∈ feasibleSet (I := I) ε B
DifferentiableAt ℝ (fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) t
Proof (Lean source)
lemma differentiableAt_envelope_line (ε B : ℝ) (hε : 0 < ε) {q d : I → ℝ} (hd : ∀ k, |d k| ≤ 1) (t : ℝ) (hqt : (fun k => q k + t * d k) ∈ feasibleSet (I := I) ε B) : DifferentiableAt ℝ (fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) t := by have hshift : DifferentiableAt ℝ (fun u : ℝ => E.varEnvelope (fun k => (q k + t * d k) + u * d k) / 4) 0 := E.differentiableAt_envelope_line_zero ε B hε hqt hd have heq : (fun u : ℝ => E.varEnvelope (fun k => q k + (t + u) * d k) / 4) = (fun u : ℝ => E.varEnvelope (fun k => (q k + t * d k) + u * d k) / 4) := by funext u congr 2 funext k ring apply (differentiableAt_iff_comp_const_add (f := fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) (a := t) (b := t)).mpr rw [heq] simpa using hshift
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.differentiableAt_envelope_line · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:148
theorem differentiableAt_deriv_envelope_line_zero

The DERIVATIVE of the envelope line is itself differentiable at 0 (the line is there). This is the hdd hypothesis of convexOn_deriv2_nonneg.

Formal statement
ε B :
:
0 < ε
q :
I → ℝ
hq :
q ∈ feasibleSet (I := I) ε B
d :
I → ℝ
hd :
∀ k, |d k| ≤ 1
DifferentiableAt ℝ (deriv fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) 0
Proof (Lean source)
lemma differentiableAt_deriv_envelope_line_zero (ε B : ℝ) (hε : 0 < ε) {q : I → ℝ} (hq : q ∈ feasibleSet (I := I) ε B) {d : I → ℝ} (hd : ∀ k, |d k| ≤ 1) : DifferentiableAt ℝ (deriv fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) 0 := by apply (E.envelope_line_eventuallyEq ε B hε hq hd).deriv.differentiableAt_iff.mpr have hext : ContDiff ℝ 2 (fun s : ℝ => E.varEnvelopeExt ε (fun k => q k + s * d k) / 4) := by apply (E.envelopeQuarterExt_contDiff_two ε hε).comp apply contDiff_pi.mpr intro k fun_prop have hder : ContDiff ℝ 1 (deriv fun s : ℝ => E.varEnvelopeExt ε (fun k => q k + s * d k) / 4) := by exact (contDiff_succ_iff_deriv.mp hext).2.2 exact (hder.differentiable one_ne_zero).differentiableAt
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.differentiableAt_deriv_envelope_line_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:169
theorem fderiv_envelopeQuarterExt_single

Partial derivative of the normalized floored envelope in coordinate k, in the Pi space. This is deriv_varEnvelope_div_four_coord_line (now public in TConvexDesign) restated as an fderiv applied to the basis vector Pi.single k 1.

Formal statement
ε B :
:
0 < ε
q :
I → ℝ
hq :
q ∈ feasibleSet (I := I) ε B
k :
I
fderiv ℝ (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) q (single k 1)
= E.envelopeGrad q k
Proof (Lean source)
lemma fderiv_envelopeQuarterExt_single (ε B : ℝ) (hε : 0 < ε) {q : I → ℝ} (hq : q ∈ feasibleSet (I := I) ε B) (k : I) : fderiv ℝ (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) q (single k 1) = E.envelopeGrad q k := by let f : (I → ℝ) → ℝ := fun p => E.varEnvelopeExt ε p / 4 let e : I → ℝ := single k 1 have he : ∀ l, |e l| ≤ 1 := by intro l by_cases hl : l = k · subst l simp [e] · simp [e, hl] have henv := E.envelope_line_eventuallyEq ε B hε hq he have hextline : (fun s : ℝ => f (q + s • e)) = (fun s : ℝ => E.varEnvelopeExt ε (fun l => q l + s * e l) / 4) := by funext s apply congrArg (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) funext l simp [smul_eq_mul] have hcoord : (fun s : ℝ => E.varEnvelope (fun l => q l + s * e l) / 4) = (fun s : ℝ => E.varEnvelope (fun l => q l + (if l = k then s else 0)) / 4) := by funext s apply congrArg (fun p : I → ℝ => E.varEnvelope p / 4) funext l by_cases hl : l = k <;> simp [e, hl] calc fderiv ℝ f q e = deriv (fun s : ℝ => f (q + s • e)) 0 := by rw [deriv_line] · simp · simpa [f] using ((E.envelopeQuarterExt_contDiff_two ε hε).differentiable two_ne_zero).differentiableAt _ = deriv (fun s : ℝ => E.varEnvelopeExt ε (fun l => q l + s * e l) / 4) 0 := by rw [hextline] _ = deriv (fun s : ℝ => E.varEnvelope (fun l => q l + s * e l) / 4) 0 := henv.deriv_eq.symm _ = deriv (fun s : ℝ => E.varEnvelope (fun l => q l + (if l = k then s else 0)) / 4) 0 := by rw [hcoord] _ = E.envelopeGrad q k := deriv_varEnvelope_div_four_coord_line E ε B hε hq k
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.fderiv_envelopeQuarterExt_single · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:188
theorem fderiv_envelopeQuarterExt_apply

The directional derivative of the normalized floored envelope is the gradient-score contraction ∑ k, d k * g_k(q).

Formal statement
ε B :
:
0 < ε
q :
I → ℝ
hq :
q ∈ feasibleSet (I := I) ε B
d :
I → ℝ
fderiv ℝ (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) q d = ∑ k, d k * E.envelopeGrad q k
Proof (Lean source)
lemma fderiv_envelopeQuarterExt_apply (ε B : ℝ) (hε : 0 < ε) {q : I → ℝ} (hq : q ∈ feasibleSet (I := I) ε B) (d : I → ℝ) : fderiv ℝ (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) q d = ∑ k, d k * E.envelopeGrad q k := by classical calc fderiv ℝ (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) q d = ∑ k, d k * fderiv ℝ (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) q (single k 1) := by conv_lhs => rw [pi_eq_sum_univ d] rw [map_sum] simp_rw [map_smul] simp only [smul_eq_mul] apply Finset.sum_congr rfl intro x _ congr 1 apply congrArg (fderiv ℝ (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) q) funext j by_cases h : x = j · subst j simp · have h' : j ≠ x := Ne.symm h simp [h, h'] _ = ∑ k, d k * E.envelopeGrad q k := by apply Finset.sum_congr rfl intro k _ rw [E.fderiv_envelopeQuarterExt_single ε B hε hq k]
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.fderiv_envelopeQuarterExt_apply · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:233
theorem deriv_envelope_line_zero

First derivative of the envelope line at 0.

Formal statement
ε B :
:
0 < ε
q :
I → ℝ
hq :
q ∈ feasibleSet (I := I) ε B
d :
I → ℝ
hd :
∀ k, |d k| ≤ 1
deriv (fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) 0
= ∑ k, d k * E.envelopeGrad q k
Proof (Lean source)
lemma deriv_envelope_line_zero (ε B : ℝ) (hε : 0 < ε) {q : I → ℝ} (hq : q ∈ feasibleSet (I := I) ε B) {d : I → ℝ} (hd : ∀ k, |d k| ≤ 1) : deriv (fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) 0 = ∑ k, d k * E.envelopeGrad q k := by let f : (I → ℝ) → ℝ := fun p => E.varEnvelopeExt ε p / 4 have hline : (fun s : ℝ => E.varEnvelopeExt ε (fun k => q k + s * d k) / 4) = (fun s : ℝ => f (q + s • d)) := by funext s apply congrArg (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) funext k simp [smul_eq_mul] calc deriv (fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) 0 = deriv (fun s : ℝ => E.varEnvelopeExt ε (fun k => q k + s * d k) / 4) 0 := (E.envelope_line_eventuallyEq ε B hε hq hd).deriv_eq _ = deriv (fun s : ℝ => f (q + s • d)) 0 := by rw [hline] _ = fderiv ℝ f q d := by rw [deriv_line] · simp · simpa [f] using ((E.envelopeQuarterExt_contDiff_two ε hε).differentiable two_ne_zero).differentiableAt _ = ∑ k, d k * E.envelopeGrad q k := E.fderiv_envelopeQuarterExt_apply ε B hε hq d
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.deriv_envelope_line_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:263
theorem deriv_deriv_envelope_line_zero

Second derivative of the envelope line at 0 equals the directional curvature at the base point.

Formal statement
ε B :
:
0 < ε
q :
I → ℝ
hq :
q ∈ feasibleSet (I := I) ε B
d :
I → ℝ
hd :
∀ k, |d k| ≤ 1
deriv (deriv fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) 0 = E.envCurv ε d q
Proof (Lean source)
lemma deriv_deriv_envelope_line_zero (ε B : ℝ) (hε : 0 < ε) {q : I → ℝ} (hq : q ∈ feasibleSet (I := I) ε B) {d : I → ℝ} (hd : ∀ k, |d k| ≤ 1) : deriv (deriv fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) 0 = E.envCurv ε d q := by let f : (I → ℝ) → ℝ := fun p => E.varEnvelopeExt ε p / 4 have hline : (fun s : ℝ => E.varEnvelopeExt ε (fun k => q k + s * d k) / 4) = (fun s : ℝ => f (q + s • d)) := by funext s apply congrArg (fun p : I → ℝ => E.varEnvelopeExt ε p / 4) funext k simp [smul_eq_mul] calc deriv (deriv fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) 0 = deriv (deriv fun s : ℝ => E.varEnvelopeExt ε (fun k => q k + s * d k) / 4) 0 := (E.envelope_line_eventuallyEq ε B hε hq hd).deriv.deriv_eq _ = deriv (deriv fun s : ℝ => f (q + s • d)) 0 := by rw [hline] _ = secondDirDeriv f d q := by simpa [f] using deriv_deriv_line (E.envelopeQuarterExt_contDiff_two ε hε) q d 0 _ = E.envCurv ε d q := rfl
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.deriv_deriv_envelope_line_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:289
theorem deriv_deriv_envelope_line_eq_envCurv

Second derivative of the envelope line at an arbitrary parameter t equals the directional curvature at the SHIFTED base point q + t·d. This is the form the EnvelopeLineC2Data curvature conjunct needs, since it quantifies over t ∈ Icc 0 T.

Formal statement
ε B :
:
0 < ε
q d :
I → ℝ
hd :
∀ k, |d k| ≤ 1
t :
hqt :
(fun k => q k + t * d k) ∈ feasibleSet (I := I) ε B
deriv (deriv fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) t
= E.envCurv ε d (fun k => q k + t * d k)
Proof (Lean source)
lemma deriv_deriv_envelope_line_eq_envCurv (ε B : ℝ) (hε : 0 < ε) {q d : I → ℝ} (hd : ∀ k, |d k| ≤ 1) (t : ℝ) (hqt : (fun k => q k + t * d k) ∈ feasibleSet (I := I) ε B) : deriv (deriv fun s : ℝ => E.varEnvelope (fun k => q k + s * d k) / 4) t = E.envCurv ε d (fun k => q k + t * d k) := by let F : ℝ → ℝ := fun s => E.varEnvelope (fun k => q k + s * d k) / 4 have hshift : (fun u : ℝ => F (t + u)) = (fun u : ℝ => E.varEnvelope (fun k => (q k + t * d k) + u * d k) / 4) := by funext u apply congrArg (fun p : I → ℝ => E.varEnvelope p / 4) funext k ring calc deriv (deriv F) t = deriv (fun u : ℝ => deriv F (t + u)) 0 := by symm simpa using (deriv_comp_const_add (deriv F) t 0) _ = deriv (deriv fun u : ℝ => F (t + u)) 0 := by congr 1 funext u exact (deriv_comp_const_add F t u).symm _ = deriv (deriv fun u : ℝ => E.varEnvelope (fun k => (q k + t * d k) + u * d k) / 4) 0 := by rw [hshift] _ = E.envCurv ε d (fun k => q k + t * d k) := E.deriv_deriv_envelope_line_zero ε B hε hqt hd
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.deriv_deriv_envelope_line_eq_envCurv · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:312
theorem dirModulus_eq_ciSup_envCurv

dirModulus is the supremum of envCurv over the feasible set: its defining body, stated with the singular V_env, agrees with envCurv at every feasible base point.

Formal statement
ε B :
:
0 < ε
d :
I → ℝ
hd :
∀ k, |d k| ≤ 1
dirModulus E ε B d = ⨆ q : feasibleSet (I := I) ε B, E.envCurv ε d (q : I → ℝ)
Proof (Lean source)
lemma dirModulus_eq_ciSup_envCurv (ε B : ℝ) (hε : 0 < ε) {d : I → ℝ} (hd : ∀ k, |d k| ≤ 1) : dirModulus E ε B d = ⨆ q : feasibleSet (I := I) ε B, E.envCurv ε d (q : I → ℝ) := by unfold dirModulus congr 1 funext q exact E.deriv_deriv_envelope_line_zero ε B hε q.property hd
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.dirModulus_eq_ciSup_envCurv · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:344
theorem bddAbove_envCurv_range

The curvature values over the feasible set are bounded above: envCurv is continuous and feasibleSet is compact. This is the BddAbove side condition of le_ciSup, and the fact whose absence stalled the original gate.

Formal statement
ε B :
:
0 < ε
hε2 :
ε < 1 / 2
hBlo :
(Fintype.card I : ℝ) * ε ≤ B
hBhi :
B ≤ (Fintype.card I : ℝ) * (1 - ε)
d :
I → ℝ
BddAbove (Set.range fun q : feasibleSet (I := I) ε B => E.envCurv ε d (q : I → ℝ))
Proof (Lean source)
lemma bddAbove_envCurv_range (ε B : ℝ) (hε : 0 < ε) (hε2 : ε < 1 / 2) (hBlo : (Fintype.card I : ℝ) * ε ≤ B) (hBhi : B ≤ (Fintype.card I : ℝ) * (1 - ε)) (d : I → ℝ) : BddAbove (Set.range fun q : feasibleSet (I := I) ε B => E.envCurv ε d (q : I → ℝ)) := by have hcpt : IsCompact (feasibleSet (I := I) ε B) := (convex_design E ε B hε hε2 hBlo hBhi).2.1 have hrange : Set.range (fun q : feasibleSet (I := I) ε B => E.envCurv ε d (q : I → ℝ)) = E.envCurv ε d '' feasibleSet (I := I) ε B := by ext x constructor · rintro ⟨q, rfl⟩ exact ⟨q, q.property, rfl⟩ · rintro ⟨q, hq, rfl⟩ exact ⟨⟨q, hq⟩, rfl⟩ rw [hrange] exact (hcpt.image (E.envCurv_continuous ε hε d)).bddAbove
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.bddAbove_envCurv_range · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:353
theorem envCurv_le_dirModulus

Every feasible base point's directional curvature is dominated by dirModulus.

Formal statement
ε B :
:
0 < ε
hε2 :
ε < 1 / 2
hBlo :
(Fintype.card I : ℝ) * ε ≤ B
hBhi :
B ≤ (Fintype.card I : ℝ) * (1 - ε)
d :
I → ℝ
hd :
∀ k, |d k| ≤ 1
q :
I → ℝ
hq :
q ∈ feasibleSet (I := I) ε B
E.envCurv ε d q ≤ dirModulus E ε B d
Proof (Lean source)
lemma envCurv_le_dirModulus (ε B : ℝ) (hε : 0 < ε) (hε2 : ε < 1 / 2) (hBlo : (Fintype.card I : ℝ) * ε ≤ B) (hBhi : B ≤ (Fintype.card I : ℝ) * (1 - ε)) {d : I → ℝ} (hd : ∀ k, |d k| ≤ 1) {q : I → ℝ} (hq : q ∈ feasibleSet (I := I) ε B) : E.envCurv ε d q ≤ dirModulus E ε B d := by rw [E.dirModulus_eq_ciSup_envCurv ε B hε hd] exact le_ciSup (E.bddAbove_envCurv_range ε B hε hε2 hBlo hBhi d) ⟨q, hq⟩
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.envCurv_le_dirModulus · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/EnvelopeCalculus.lean:374
Helpers.Kernel 4 declarations
theorem prod_union_div_prod_prod_eq_prod_inter_inv Lemma prod_union_div_prod_prod_eq_prod_inter_inv in the paper ↗

When no relevant factor is zero, the product over a union divided by the two setwise products equals the product of inverse factors over the overlap.

Formal statement
S T :
f :
I → ℝ
hne :
∀ k ∈ S ∪ T, f k ≠ 0
(∏ k ∈ S ∪ T, f k) / ((∏ k ∈ S, f k) * (∏ k ∈ T, f k)) = ∏ k ∈ S ∩ T, (f k)⁻¹
Proof (Lean source)
lemma prod_union_div_prod_prod_eq_prod_inter_inv (S T : Finset I) (f : I → ℝ) (hne : ∀ k ∈ S ∪ T, f k ≠ 0) : (∏ k ∈ S ∪ T, f k) / ((∏ k ∈ S, f k) * (∏ k ∈ T, f k)) = ∏ k ∈ S ∩ T, (f k)⁻¹ := by classical have hU_ne : (∏ k ∈ S ∪ T, f k) ≠ 0 := Finset.prod_ne_zero_iff.mpr hne have hA_ne : (∏ k ∈ S ∩ T, f k) ≠ 0 := by apply Finset.prod_ne_zero_iff.mpr intro k hk exact hne k (mem_union_left T (mem_of_mem_inter_left hk)) have hden : (∏ k ∈ S, f k) * (∏ k ∈ T, f k) = (∏ k ∈ S ∪ T, f k) * (∏ k ∈ S ∩ T, f k) := by simpa [mul_comm, mul_left_comm, mul_assoc] using (Finset.prod_union_inter (s₁ := S) (s₂ := T) (f := f)).symm rw [hden, Finset.prod_inv_distrib] field_simp [hU_ne, hA_ne]
CausalSmith.Experimentation.BipartiteMinimaxDesign.prod_union_div_prod_prod_eq_prod_inter_inv · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Kernel.lean:30
theorem centered_treat_treat_moment

Under independent Bernoulli assignment, the covariance of two centered treated-exposure ratios equals their treated-overlap kernel.

Formal statement
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hpos :
∀ k, 0 < p k
i j :
O
(bernoulliDesign p hp0 hp1).E (fun z => (E.expT z i / E.piT p i - 1) * (E.expT z j / E.piT p j - 1))
= E.r1 p i j
Proof (Lean source)
lemma centered_treat_treat_moment (E : BipartiteExperiment I O) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hpos : ∀ k, 0 < p k) (i j : O) : (bernoulliDesign p hp0 hp1).E (fun z => (E.expT z i / E.piT p i - 1) * (E.expT z j / E.piT p j - 1)) = E.r1 p i j := by classical have hpi_i_pos : 0 < E.piT p i := by unfold BipartiteExperiment.piT exact Finset.prod_pos (fun k _ => hpos k) have hpi_j_pos : 0 < E.piT p j := by unfold BipartiteExperiment.piT exact Finset.prod_pos (fun k _ => hpos k) have hEX : (bernoulliDesign p hp0 hp1).E (fun z => E.expT z i) = E.piT p i := by unfold BipartiteExperiment.expT BipartiteExperiment.piT exact bernoulli_E_treat_prod p hp0 hp1 (E.N i) have hEY : (bernoulliDesign p hp0 hp1).E (fun z => E.expT z j) = E.piT p j := by unfold BipartiteExperiment.expT BipartiteExperiment.piT exact bernoulli_E_treat_prod p hp0 hp1 (E.N j) have hEXY : (bernoulliDesign p hp0 hp1).E (fun z => E.expT z i * E.expT z j) = ∏ k ∈ E.N i ∪ E.N j, p k := by unfold BipartiteExperiment.expT exact bernoulli_E_treat_mul_treat p hp0 hp1 (E.N i) (E.N j) rw [E_centered_ratio_mul (D := bernoulliDesign p hp0 hp1) (X := fun z => E.expT z i) (Y := fun z => E.expT z j) (a := E.piT p i) (b := E.piT p j) (c := ∏ k ∈ E.N i ∪ E.N j, p k) (ne_of_gt hpi_i_pos) (ne_of_gt hpi_j_pos) hEX hEY hEXY] unfold BipartiteExperiment.r1 BipartiteExperiment.piT BipartiteExperiment.shared by_cases hcard : 0 < #(E.N i ∩ E.N j) · simp [hcard] rw [prod_union_div_prod_prod_eq_prod_inter_inv] · rw [Finset.prod_inv_distrib] · intro k _ exact ne_of_gt (hpos k) · have hdisj : Disjoint (E.N i) (E.N j) := by rw [Finset.disjoint_iff_inter_eq_empty] exact Finset.card_eq_zero.mp (Nat.eq_zero_of_not_pos hcard) have hratio : (∏ k ∈ E.N i ∪ E.N j, p k) / ((∏ k ∈ E.N i, p k) * (∏ k ∈ E.N j, p k)) = 1 := by have hden : (∏ k ∈ E.N i ∪ E.N j, p k) = (∏ k ∈ E.N i, p k) * (∏ k ∈ E.N j, p k) := by rw [Finset.prod_union hdisj] rw [hden] have hi_ne : (∏ k ∈ E.N i, p k) ≠ 0 := by exact ne_of_gt (Finset.prod_pos (fun k _ => hpos k)) have hj_ne : (∏ k ∈ E.N j, p k) ≠ 0 := by exact ne_of_gt (Finset.prod_pos (fun k _ => hpos k)) field_simp [hi_ne, hj_ne] simp [hcard, hratio]
CausalSmith.Experimentation.BipartiteMinimaxDesign.centered_treat_treat_moment · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Kernel.lean:54
theorem centered_ctrl_ctrl_moment

Under independent Bernoulli assignment, the covariance of two centered control-exposure ratios equals their control-overlap kernel.

Formal statement
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hlt :
∀ k, p k < 1
i j :
O
(bernoulliDesign p hp0 hp1).E (fun z => (E.expC z i / E.piC p i - 1) * (E.expC z j / E.piC p j - 1))
= E.r0 p i j
Proof (Lean source)
lemma centered_ctrl_ctrl_moment (E : BipartiteExperiment I O) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hlt : ∀ k, p k < 1) (i j : O) : (bernoulliDesign p hp0 hp1).E (fun z => (E.expC z i / E.piC p i - 1) * (E.expC z j / E.piC p j - 1)) = E.r0 p i j := by classical have hpi_i_pos : 0 < E.piC p i := by unfold BipartiteExperiment.piC exact Finset.prod_pos (fun k _ => sub_pos.mpr (hlt k)) have hpi_j_pos : 0 < E.piC p j := by unfold BipartiteExperiment.piC exact Finset.prod_pos (fun k _ => sub_pos.mpr (hlt k)) have hEX : (bernoulliDesign p hp0 hp1).E (fun z => E.expC z i) = E.piC p i := by unfold BipartiteExperiment.expC BipartiteExperiment.piC exact bernoulli_E_ctrl_prod p hp0 hp1 (E.N i) have hEY : (bernoulliDesign p hp0 hp1).E (fun z => E.expC z j) = E.piC p j := by unfold BipartiteExperiment.expC BipartiteExperiment.piC exact bernoulli_E_ctrl_prod p hp0 hp1 (E.N j) have hEXY : (bernoulliDesign p hp0 hp1).E (fun z => E.expC z i * E.expC z j) = ∏ k ∈ E.N i ∪ E.N j, (1 - p k) := by unfold BipartiteExperiment.expC exact bernoulli_E_ctrl_mul_ctrl p hp0 hp1 (E.N i) (E.N j) rw [E_centered_ratio_mul (D := bernoulliDesign p hp0 hp1) (X := fun z => E.expC z i) (Y := fun z => E.expC z j) (a := E.piC p i) (b := E.piC p j) (c := ∏ k ∈ E.N i ∪ E.N j, (1 - p k)) (ne_of_gt hpi_i_pos) (ne_of_gt hpi_j_pos) hEX hEY hEXY] unfold BipartiteExperiment.r0 BipartiteExperiment.piC BipartiteExperiment.shared by_cases hcard : 0 < #(E.N i ∩ E.N j) · simp [hcard] rw [prod_union_div_prod_prod_eq_prod_inter_inv] · rw [Finset.prod_inv_distrib] · intro k _ exact ne_of_gt (sub_pos.mpr (hlt k)) · have hdisj : Disjoint (E.N i) (E.N j) := by rw [Finset.disjoint_iff_inter_eq_empty] exact Finset.card_eq_zero.mp (Nat.eq_zero_of_not_pos hcard) have hratio : (∏ k ∈ E.N i ∪ E.N j, (1 - p k)) / ((∏ k ∈ E.N i, (1 - p k)) * (∏ k ∈ E.N j, (1 - p k))) = 1 := by have hden : (∏ k ∈ E.N i ∪ E.N j, (1 - p k)) = (∏ k ∈ E.N i, (1 - p k)) * (∏ k ∈ E.N j, (1 - p k)) := by rw [Finset.prod_union hdisj] rw [hden] have hi_ne : (∏ k ∈ E.N i, (1 - p k)) ≠ 0 := by exact ne_of_gt (Finset.prod_pos (fun k _ => sub_pos.mpr (hlt k))) have hj_ne : (∏ k ∈ E.N j, (1 - p k)) ≠ 0 := by exact ne_of_gt (Finset.prod_pos (fun k _ => sub_pos.mpr (hlt k))) field_simp [hi_ne, hj_ne] simp [hcard, hratio]
CausalSmith.Experimentation.BipartiteMinimaxDesign.centered_ctrl_ctrl_moment · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Kernel.lean:108
theorem centered_treat_ctrl_moment

Under independent Bernoulli assignment, the mixed treated-control centered-ratio moment equals minus the mixed overlap kernel.

Formal statement
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hpos :
∀ k, 0 < p k
hlt :
∀ k, p k < 1
i j :
O
(bernoulliDesign p hp0 hp1).E (fun z => (E.expT z i / E.piT p i - 1) * (E.expC z j / E.piC p j - 1))
= -E.r10 i j
Proof (Lean source)
lemma centered_treat_ctrl_moment (E : BipartiteExperiment I O) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hpos : ∀ k, 0 < p k) (hlt : ∀ k, p k < 1) (i j : O) : (bernoulliDesign p hp0 hp1).E (fun z => (E.expT z i / E.piT p i - 1) * (E.expC z j / E.piC p j - 1)) = -E.r10 i j := by classical have hpiT_pos : 0 < E.piT p i := by unfold BipartiteExperiment.piT exact Finset.prod_pos (fun k _ => hpos k) have hpiC_pos : 0 < E.piC p j := by unfold BipartiteExperiment.piC exact Finset.prod_pos (fun k _ => sub_pos.mpr (hlt k)) have hEX : (bernoulliDesign p hp0 hp1).E (fun z => E.expT z i) = E.piT p i := by unfold BipartiteExperiment.expT BipartiteExperiment.piT exact bernoulli_E_treat_prod p hp0 hp1 (E.N i) have hEY : (bernoulliDesign p hp0 hp1).E (fun z => E.expC z j) = E.piC p j := by unfold BipartiteExperiment.expC BipartiteExperiment.piC exact bernoulli_E_ctrl_prod p hp0 hp1 (E.N j) by_cases hcard : 0 < #(E.N i ∩ E.N j) · have hEXY : (bernoulliDesign p hp0 hp1).E (fun z => E.expT z i * E.expC z j) = 0 := by rw [(bernoulliDesign p hp0 hp1).E_congr] · exact (bernoulliDesign p hp0 hp1).E_const 0 · intro z unfold BipartiteExperiment.expT BipartiteExperiment.expC exact treat_ctrl_prod_eq_zero_of_inter_nonempty hcard z rw [E_centered_ratio_mul (D := bernoulliDesign p hp0 hp1) (X := fun z => E.expT z i) (Y := fun z => E.expC z j) (a := E.piT p i) (b := E.piC p j) (c := 0) (ne_of_gt hpiT_pos) (ne_of_gt hpiC_pos) hEX hEY hEXY] unfold BipartiteExperiment.r10 BipartiteExperiment.shared simp [hcard] · have hdisj : Disjoint (E.N i) (E.N j) := by rw [Finset.disjoint_iff_inter_eq_empty] exact Finset.card_eq_zero.mp (Nat.eq_zero_of_not_pos hcard) have hEXY : (bernoulliDesign p hp0 hp1).E (fun z => E.expT z i * E.expC z j) = E.piT p i * E.piC p j := by unfold BipartiteExperiment.expT BipartiteExperiment.expC BipartiteExperiment.piT BipartiteExperiment.piC rw [(bernoulliDesign p hp0 hp1).E_congr] · unfold bernoulliDesign rw [FiniteDesign.E_prod_prod (fun i => coinDesign (p i) (hp0 i) (hp1 i)) (fun k b => if k ∈ E.N i then (if b then (1 : ℝ) else 0) else if k ∈ E.N j then (if b then (0 : ℝ) else 1) else 1)] trans ∏ k : I, if k ∈ E.N i then p k else if k ∈ E.N j then (1 - p k) else 1 · apply Finset.prod_congr rfl intro k _ by_cases hkS : k ∈ E.N i <;> by_cases hkT : k ∈ E.N j <;> simp [coinDesign_E, hkS, hkT] · exact prod_ite_disjoint (E.N i) (E.N j) hdisj p (fun k => 1 - p k) · intro z exact treat_ctrl_prod_eq_mixed_of_disjoint hdisj z rw [E_centered_ratio_mul (D := bernoulliDesign p hp0 hp1) (X := fun z => E.expT z i) (Y := fun z => E.expC z j) (a := E.piT p i) (b := E.piC p j) (c := E.piT p i * E.piC p j) (ne_of_gt hpiT_pos) (ne_of_gt hpiC_pos) hEX hEY hEXY] unfold BipartiteExperiment.r10 BipartiteExperiment.shared have hratio : E.piT p i * E.piC p j / (E.piT p i * E.piC p j) = 1 := by field_simp [ne_of_gt hpiT_pos, ne_of_gt hpiC_pos] simp [hcard, hratio]
CausalSmith.Experimentation.BipartiteMinimaxDesign.centered_treat_ctrl_moment · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Kernel.lean:164
Helpers.LinScoreBounds 6 declarations
theorem mu1_abs_le_one

Under bounded potential outcomes, the treated potential-outcome mean is bounded by one in absolute value.

Formal statement
|E.mu1| ≤ 1
Proof (Lean source)
lemma mu1_abs_le_one (E : BipartiteExperiment I O) (hbdd : BoundedOutcomes E) : |E.mu1| ≤ 1 := by classical unfold BipartiteExperiment.mu1 by_cases hcard : (Fintype.card O : ℝ) = 0 · simp [hcard] have hcard_pos : 0 < (Fintype.card O : ℝ) := by have hn : 0 < Fintype.card O := Fintype.card_pos_iff.mpr (by by_contra hempty have : (Fintype.card O : ℝ) = 0 := by haveI : IsEmpty O := not_nonempty_iff.mp hempty simp exact hcard this) exact_mod_cast hn calc |(Fintype.card O : ℝ)⁻¹ * ∑ i, E.Y1 i| ≤ (Fintype.card O : ℝ)⁻¹ * ∑ _i : O, (1 : ℝ) := by rw [abs_mul, abs_of_pos (inv_pos.mpr hcard_pos)] exact mul_le_mul_of_nonneg_left ((Finset.abs_sum_le_sum_abs _ _).trans (Finset.sum_le_sum fun i _ => (hbdd i).1)) (inv_nonneg.mpr hcard_pos.le) _ = 1 := by simp [hcard]
CausalSmith.Experimentation.BipartiteMinimaxDesign.mu1_abs_le_one · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreBounds.lean:24
theorem mu0_abs_le_one

Under bounded potential outcomes, the control potential-outcome mean is bounded by one in absolute value.

Formal statement
|E.mu0| ≤ 1
Proof (Lean source)
lemma mu0_abs_le_one (E : BipartiteExperiment I O) (hbdd : BoundedOutcomes E) : |E.mu0| ≤ 1 := by classical unfold BipartiteExperiment.mu0 by_cases hcard : (Fintype.card O : ℝ) = 0 · simp [hcard] have hcard_pos : 0 < (Fintype.card O : ℝ) := by have hn : 0 < Fintype.card O := Fintype.card_pos_iff.mpr (by by_contra hempty have : (Fintype.card O : ℝ) = 0 := by haveI : IsEmpty O := not_nonempty_iff.mp hempty simp exact hcard this) exact_mod_cast hn calc |(Fintype.card O : ℝ)⁻¹ * ∑ i, E.Y0 i| ≤ (Fintype.card O : ℝ)⁻¹ * ∑ _i : O, (1 : ℝ) := by rw [abs_mul, abs_of_pos (inv_pos.mpr hcard_pos)] exact mul_le_mul_of_nonneg_left ((Finset.abs_sum_le_sum_abs _ _).trans (Finset.sum_le_sum fun i _ => (hbdd i).2)) (inv_nonneg.mpr hcard_pos.le) _ = 1 := by simp [hcard]
CausalSmith.Experimentation.BipartiteMinimaxDesign.mu0_abs_le_one · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreBounds.lean:51
theorem piT_inv_le_denominatorKernelBound_add_one

Each inverse treated exposure probability is bounded by one plus the denominator-kernel bound under the floor and degree conditions.

Formal statement
ε B dbar :
hdeg :
p :
I → ℝ
hp :
i :
O
(E.piT p i)⁻¹ ≤ denominatorKernelBound ε dbar + 1
Proof (Lean source)
lemma piT_inv_le_denominatorKernelBound_add_one (E : BipartiteExperiment I O) (ε B dbar : ℝ) (hε : EpsilonAdmissible ε) (hdeg : BoundedOutcomeDegree E dbar) (p : I → ℝ) (hp : FeasibleDesign ε B p) (i : O) : (E.piT p i)⁻¹ ≤ denominatorKernelBound ε dbar + 1 := by classical have hε0 := hε.1 have hε2 := hε.2 have hr := r1_le_denominatorKernelBound E ε B dbar hε0 hε2 hdeg p hp i i unfold BipartiteExperiment.r1 BipartiteExperiment.shared at hr unfold BipartiteExperiment.piT by_cases hN : 0 < (E.N i ∩ E.N i).card · rw [if_pos hN] at hr have hprod_inv : (∏ k ∈ E.N i, p k)⁻¹ = ∏ k ∈ E.N i, (p k)⁻¹ := by rw [Finset.prod_inv_distrib] rw [hprod_inv] simpa [Finset.inter_self] using (sub_le_iff_le_add.mp hr) · have hzero : E.N i = ∅ := by rw [← Finset.inter_self (E.N i)] exact Finset.card_eq_zero.mp (Nat.eq_zero_of_not_pos hN) simp [hzero] have hnonneg : 0 ≤ denominatorKernelBound ε dbar := denominatorKernelBound_nonneg hε0 linarith
CausalSmith.Experimentation.BipartiteMinimaxDesign.piT_inv_le_denominatorKernelBound_add_one · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreBounds.lean:78
theorem piC_inv_le_denominatorKernelBound_add_one

Each inverse control exposure probability is bounded by one plus the denominator-kernel bound under the floor and degree conditions.

Formal statement
ε B dbar :
hdeg :
p :
I → ℝ
hp :
i :
O
(E.piC p i)⁻¹ ≤ denominatorKernelBound ε dbar + 1
Proof (Lean source)
lemma piC_inv_le_denominatorKernelBound_add_one (E : BipartiteExperiment I O) (ε B dbar : ℝ) (hε : EpsilonAdmissible ε) (hdeg : BoundedOutcomeDegree E dbar) (p : I → ℝ) (hp : FeasibleDesign ε B p) (i : O) : (E.piC p i)⁻¹ ≤ denominatorKernelBound ε dbar + 1 := by classical have hε0 := hε.1 have hε2 := hε.2 have hr := r0_le_denominatorKernelBound E ε B dbar hε0 hε2 hdeg p hp i i unfold BipartiteExperiment.r0 BipartiteExperiment.shared at hr unfold BipartiteExperiment.piC by_cases hN : 0 < (E.N i ∩ E.N i).card · rw [if_pos hN] at hr have hprod_inv : (∏ k ∈ E.N i, (1 - p k))⁻¹ = ∏ k ∈ E.N i, (1 - p k)⁻¹ := by rw [Finset.prod_inv_distrib] rw [hprod_inv] simpa [Finset.inter_self] using (sub_le_iff_le_add.mp hr) · have hzero : E.N i = ∅ := by rw [← Finset.inter_self (E.N i)] exact Finset.card_eq_zero.mp (Nat.eq_zero_of_not_pos hN) simp [hzero] have hnonneg : 0 ≤ denominatorKernelBound ε dbar := denominatorKernelBound_nonneg hε0 linarith
CausalSmith.Experimentation.BipartiteMinimaxDesign.piC_inv_le_denominatorKernelBound_add_one · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreBounds.lean:104
theorem linScore_abs_le_uniform

Every linearization score is bounded in absolute value by the stated uniform denominator-kernel-based constant.

Formal statement
ε B dbar :
hbdd :
hdeg :
p :
I → ℝ
hp :
z :
I → Bool
i :
O
|E.linScore p z i| ≤ 4 * (denominatorKernelBound ε dbar + 2)
Proof (Lean source)
lemma linScore_abs_le_uniform (E : BipartiteExperiment I O) (ε B dbar : ℝ) (hε : EpsilonAdmissible ε) (hbdd : BoundedOutcomes E) (hdeg : BoundedOutcomeDegree E dbar) (p : I → ℝ) (hp : FeasibleDesign ε B p) (z : I → Bool) (i : O) : |E.linScore p z i| ≤ 4 * (denominatorKernelBound ε dbar + 2) := by classical let K : ℝ := denominatorKernelBound ε dbar + 1 have hK_nonneg : 0 ≤ K := by have hnonneg : 0 ≤ denominatorKernelBound ε dbar := denominatorKernelBound_nonneg hε.1 dsimp [K] linarith have hpiT_pos : 0 < E.piT p i := by unfold BipartiteExperiment.piT exact Finset.prod_pos (fun k _ => lt_of_lt_of_le hε.1 ((hp.floor k).1)) have hpiC_pos : 0 < E.piC p i := by unfold BipartiteExperiment.piC exact Finset.prod_pos (fun k _ => sub_pos.mpr (by linarith [((hp.floor k).2), hε.1])) have hexpT_abs : |E.expT z i| ≤ 1 := by unfold BipartiteExperiment.expT have hterm : ∀ k ∈ E.N i, |(if z k then (1 : ℝ) else 0)| ≤ 1 := by intro k hk by_cases hz : z k <;> simp [hz] have hprod_nonneg : 0 ≤ ∏ k ∈ E.N i, |(if z k then (1 : ℝ) else 0)| := Finset.prod_nonneg (fun k hk => abs_nonneg _) calc |∏ k ∈ E.N i, (if z k then (1 : ℝ) else 0)| = ∏ k ∈ E.N i, |(if z k then (1 : ℝ) else 0)| := Finset.abs_prod _ _ _ ≤ ∏ _k ∈ E.N i, (1 : ℝ) := by exact Finset.prod_le_prod (fun k hk => abs_nonneg _) hterm _ = 1 := by simp have hexpC_abs : |E.expC z i| ≤ 1 := by unfold BipartiteExperiment.expC have hterm : ∀ k ∈ E.N i, |(if z k then (0 : ℝ) else 1)| ≤ 1 := by intro k hk by_cases hz : z k <;> simp [hz] calc |∏ k ∈ E.N i, (if z k then (0 : ℝ) else 1)| = ∏ k ∈ E.N i, |(if z k then (0 : ℝ) else 1)| := Finset.abs_prod _ _ _ ≤ ∏ _k ∈ E.N i, (1 : ℝ) := by exact Finset.prod_le_prod (fun k hk => abs_nonneg _) hterm _ = 1 := by simp have hT_ratio : |E.expT z i / E.piT p i| ≤ K := by have hinv := piT_inv_le_denominatorKernelBound_add_one E ε B dbar hε hdeg p hp i have hinvK : (E.piT p i)⁻¹ ≤ K := by simpa [K] using hinv calc |E.expT z i / E.piT p i| = |E.expT z i| * (E.piT p i)⁻¹ := by rw [abs_div, abs_of_pos hpiT_pos, div_eq_mul_inv] _ ≤ 1 * K := mul_le_mul hexpT_abs hinvK (inv_nonneg.mpr hpiT_pos.le) zero_le_one _ = K := by ring have hC_ratio : |E.expC z i / E.piC p i| ≤ K := by have hinv := piC_inv_le_denominatorKernelBound_add_one E ε B dbar hε hdeg p hp i have hinvK : (E.piC p i)⁻¹ ≤ K := by simpa [K] using hinv calc |E.expC z i / E.piC p i| = |E.expC z i| * (E.piC p i)⁻¹ := by rw [abs_div, abs_of_pos hpiC_pos, div_eq_mul_inv] _ ≤ 1 * K := mul_le_mul hexpC_abs hinvK (inv_nonneg.mpr hpiC_pos.le) zero_le_one _ = K := by ring have hcenterT : |E.expT z i / E.piT p i - 1| ≤ K + 1 := by calc |E.expT z i / E.piT p i - 1| ≤ |E.expT z i / E.piT p i| + |(1 : ℝ)| := by simpa using (abs_sub_le (E.expT z i / E.piT p i) 0 (1 : ℝ)) _ ≤ K + 1 := by have h1 : |(1 : ℝ)| ≤ 1 := by norm_num exact add_le_add hT_ratio h1 have hcenterC : |E.expC z i / E.piC p i - 1| ≤ K + 1 := by calc |E.expC z i / E.piC p i - 1| ≤ |E.expC z i / E.piC p i| + |(1 : ℝ)| := by simpa using (abs_sub_le (E.expC z i / E.piC p i) 0 (1 : ℝ)) _ ≤ K + 1 := by have h1 : |(1 : ℝ)| ≤ 1 := by norm_num exact add_le_add hC_ratio h1 have hY1 : |E.Y1 i - E.mu1| ≤ 2 := by calc |E.Y1 i - E.mu1| ≤ |E.Y1 i| + |E.mu1| := by simpa using (abs_sub_le (E.Y1 i) 0 E.mu1) _ ≤ 1 + 1 := add_le_add (hbdd i).1 (mu1_abs_le_one E hbdd) _ = 2 := by norm_num have hY0 : |E.Y0 i - E.mu0| ≤ 2 := by calc |E.Y0 i - E.mu0| ≤ |E.Y0 i| + |E.mu0| := by simpa using (abs_sub_le (E.Y0 i) 0 E.mu0) _ ≤ 1 + 1 := add_le_add (hbdd i).2 (mu0_abs_le_one E hbdd) _ = 2 := by norm_num unfold BipartiteExperiment.linScore have hK1_nonneg : 0 ≤ K + 1 := by linarith have htermT : |(E.expT z i / E.piT p i - 1) * (E.Y1 i - E.mu1)| ≤ (K + 1) * 2 := by rw [abs_mul] exact mul_le_mul hcenterT hY1 (abs_nonneg _) hK1_nonneg have htermC : |(E.expC z i / E.piC p i - 1) * (E.Y0 i - E.mu0)| ≤ (K + 1) * 2 := by rw [abs_mul] exact mul_le_mul hcenterC hY0 (abs_nonneg _) hK1_nonneg calc |(E.expT z i / E.piT p i - 1) * (E.Y1 i - E.mu1) - (E.expC z i / E.piC p i - 1) * (E.Y0 i - E.mu0)| ≤ |(E.expT z i / E.piT p i - 1) * (E.Y1 i - E.mu1)| + |(E.expC z i / E.piC p i - 1) * (E.Y0 i - E.mu0)| := by simpa using (abs_sub_le ((E.expT z i / E.piT p i - 1) * (E.Y1 i - E.mu1)) 0 ((E.expC z i / E.piC p i - 1) * (E.Y0 i - E.mu0))) _ ≤ (K + 1) * 2 + (K + 1) * 2 := add_le_add htermT htermC _ = 4 * (denominatorKernelBound ε dbar + 2) := by dsimp [K] ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.linScore_abs_le_uniform · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreBounds.lean:130
theorem linScore_abs_le_uniform_floor

The linear-score bound only uses the probability-vector box, the positivity floor, and the outcome degree. This variant lets a stronger uniform floor ε0 control a design originally certified feasible at a possibly larger floor.

Formal statement
ε0 dbar :
hε0 :
hbdd :
hdeg :
p :
I → ℝ
hp_prob :
hfloor :
z :
I → Bool
i :
O
|E.linScore p z i| ≤ 4 * (denominatorKernelBound ε0 dbar + 2)
Proof (Lean source)
lemma linScore_abs_le_uniform_floor (E : BipartiteExperiment I O) (ε0 dbar : ℝ) (hε0 : EpsilonAdmissible ε0) (hbdd : BoundedOutcomes E) (hdeg : BoundedOutcomeDegree E dbar) (p : I → ℝ) (hp_prob : ProbVector p) (hfloor : PositivityFloor ε0 p) (z : I → Bool) (i : O) : |E.linScore p z i| ≤ 4 * (denominatorKernelBound ε0 dbar + 2) := by classical let B0 : ℝ := ∑ k, p k have hp : FeasibleDesign ε0 B0 p := { prob := hp_prob admissible := hε0 floor := hfloor budget := rfl } exact linScore_abs_le_uniform E ε0 B0 dbar hε0 hbdd hdeg p hp z i
CausalSmith.Experimentation.BipartiteMinimaxDesign.linScore_abs_le_uniform_floor · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreBounds.lean:238
Helpers.LinScoreCLT 7 declarations

The intervention-coordinate block supporting a finite tuple of outcome-side linear scores.

Definition (Lean source)
noncomputable def linScoreOutcomeBlock (E : BipartiteExperiment I O) (A : Finset O) : Finset I := A.biUnion E.N
CausalSmith.Experimentation.BipartiteMinimaxDesign.linScoreOutcomeBlock · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreCLT.lean:31

An outcome's all-treated exposure indicator depends on the assignment vector only through the outcome's own intervention neighborhood: two assignments that agree there give the same indicator.

Formal statement
i :
O
z z' :
I → Bool
h :
∀ k ∈ E.N i, z k = z' k
E.expT z i = E.expT z' i
Proof (Lean source)
lemma expT_depends_on_neighborhood (E : BipartiteExperiment I O) (i : O) {z z' : I → Bool} (h : ∀ k ∈ E.N i, z k = z' k) : E.expT z i = E.expT z' i := by classical unfold BipartiteExperiment.expT exact Finset.prod_congr rfl (fun k hk => by rw [h k hk])
CausalSmith.Experimentation.BipartiteMinimaxDesign.expT_depends_on_neighborhood · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreCLT.lean:38

An outcome's all-control exposure indicator depends on the assignment vector only through the outcome's own intervention neighborhood: two assignments that agree there give the same indicator.

Formal statement
i :
O
z z' :
I → Bool
h :
∀ k ∈ E.N i, z k = z' k
E.expC z i = E.expC z' i
Proof (Lean source)
lemma expC_depends_on_neighborhood (E : BipartiteExperiment I O) (i : O) {z z' : I → Bool} (h : ∀ k ∈ E.N i, z k = z' k) : E.expC z i = E.expC z' i := by classical unfold BipartiteExperiment.expC exact Finset.prod_congr rfl (fun k hk => by rw [h k hk])
CausalSmith.Experimentation.BipartiteMinimaxDesign.expC_depends_on_neighborhood · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreCLT.lean:49
theorem linScore_depends_on_neighborhood Lemma linScore-depends-on-neighborhood in the paper ↗

An outcome's linearization score depends only on the assignments in that outcome's intervention neighborhood.

Formal statement
p :
I → ℝ
i :
O
z z' :
I → Bool
h :
∀ k ∈ E.N i, z k = z' k
E.linScore p z i = E.linScore p z' i
Proof (Lean source)
lemma linScore_depends_on_neighborhood (E : BipartiteExperiment I O) (p : I → ℝ) (i : O) {z z' : I → Bool} (h : ∀ k ∈ E.N i, z k = z' k) : E.linScore p z i = E.linScore p z' i := by unfold BipartiteExperiment.linScore rw [expT_depends_on_neighborhood E i h, expC_depends_on_neighborhood E i h]
CausalSmith.Experimentation.BipartiteMinimaxDesign.linScore_depends_on_neighborhood · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreCLT.lean:60
theorem disjoint_linScoreOutcomeBlock_of_no_overlap

If no outcome in one block is identical to or overlaps an outcome in another block, the two blocks' supporting intervention neighborhoods are disjoint.

Formal statement
A B :
hAB :
∀ a ∈ A, ∀ b ∈ B, ¬ (a = b ∨ 0 < (E.shared a b).card)
Proof (Lean source)
lemma disjoint_linScoreOutcomeBlock_of_no_overlap (E : BipartiteExperiment I O) {A B : Finset O} (hAB : ∀ a ∈ A, ∀ b ∈ B, ¬ (a = b ∨ 0 < (E.shared a b).card)) : Disjoint (linScoreOutcomeBlock E A) (linScoreOutcomeBlock E B) := by classical rw [Finset.disjoint_left] intro k hkA hkB rw [linScoreOutcomeBlock, Finset.mem_biUnion] at hkA hkB rcases hkA with ⟨a, haA, hkNa⟩ rcases hkB with ⟨b, hbB, hkNb⟩ exact hAB a haA b hbB (inr (Finset.card_pos.mpr ⟨k, by simpa [BipartiteExperiment.shared] using intro hkNa hkNb⟩))
CausalSmith.Experimentation.BipartiteMinimaxDesign.disjoint_linScoreOutcomeBlock_of_no_overlap · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreCLT.lean:68
def linScoreDepGraph

The overlap relation is a dependency graph for linear scores under the heterogeneous Bernoulli product design.

Definition (Lean source)
noncomputable def linScoreDepGraph [MeasurableSpace Bool] [MeasurableSingletonClass Bool] (E : BipartiteExperiment I O) (D : FiniteDesign (I → Bool)) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hBern : IndepHeteroBernoulli D p hp0 hp1) : DepGraph (fun i z => E.linScore p z i) D.toMeasure where G i j := i = j ∨ 0 < (E.shared i j).card decG := inferInstance refl i := inl rfl symm i j h := by rcases h with h | h · exact inl h.symm · exact inr (by simpa [BipartiteExperiment.shared, Finset.inter_comm] using h) meas i := measurable_of_finite _ indep A B hAB := by rw [hBern] unfold bernoulliDesign have hST : Disjoint (linScoreOutcomeBlock E A) (linScoreOutcomeBlock E B) := disjoint_linScoreOutcomeBlock_of_no_overlap E hAB refine indepFun_prodDesign_of_depends_on_disjoint_blocks (fun k => coinDesign (p k) (hp0 k) (hp1 k)) hST (fun z => fun k : A => E.linScore p z k) (fun z => fun k : B => E.linScore p z k) ?_ ?_ · intro z z' hzz funext k exact linScore_depends_on_neighborhood E p k (fun l hl => hzz l (by rw [linScoreOutcomeBlock, Finset.mem_biUnion] exact ⟨k, k.property, hl⟩)) · intro z z' hzz funext k exact linScore_depends_on_neighborhood E p k (fun l hl => hzz l (by rw [linScoreOutcomeBlock, Finset.mem_biUnion] exact ⟨k, k.property, hl⟩))
CausalSmith.Experimentation.BipartiteMinimaxDesign.linScoreDepGraph · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreCLT.lean:87
theorem linScoreDepGraph_degree_le

The dependency-graph neighborhood of any outcome has size at most the ceiling of the overlap-dependency bound plus one.

Formal statement
D :
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hBern :
Dbar :
hdep :
i :
O
((linScoreDepGraph E D p hp0 hp1 hBern).nbhd i).card ≤ ceil Dbar + 1
Proof (Lean source)
lemma linScoreDepGraph_degree_le [MeasurableSpace Bool] [MeasurableSingletonClass Bool] (E : BipartiteExperiment I O) (D : FiniteDesign (I → Bool)) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hBern : IndepHeteroBernoulli D p hp0 hp1) {Dbar : ℝ} (hdep : BoundedOverlapDependency E Dbar) (i : O) : ((linScoreDepGraph E D p hp0 hp1 hBern).nbhd i).card ≤ ceil Dbar + 1 := by classical have hsub : (linScoreDepGraph E D p hp0 hp1 hBern).nbhd i ⊆ insert i (E.overlapNbrs i) := by intro j hj rw [DepGraph.mem_nbhd_iff] at hj rcases hj with hji | hover · simp [hji] · simp [BipartiteExperiment.overlapNbrs, Finset.card_pos.mp hover] have hcard : ((linScoreDepGraph E D p hp0 hp1 hBern).nbhd i).card ≤ (insert i (E.overlapNbrs i)).card := Finset.card_le_card hsub have hoverNat : (E.overlapNbrs i).card ≤ ceil Dbar := by exact Nat.cast_le.mp ((hdep.2 i).trans (Nat.le_ceil Dbar)) calc ((linScoreDepGraph E D p hp0 hp1 hBern).nbhd i).card ≤ (insert i (E.overlapNbrs i)).card := hcard _ ≤ (E.overlapNbrs i).card + 1 := Finset.card_insert_le _ _ _ ≤ ceil Dbar + 1 := Nat.add_le_add_right hoverNat 1
CausalSmith.Experimentation.BipartiteMinimaxDesign.linScoreDepGraph_degree_le · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/LinScoreCLT.lean:124
Helpers.Linearization 7 declarations
theorem linScore_mean_zero

Each outcome's Hájek linearization score has expectation zero under the heterogeneous independent Bernoulli design.

Formal statement
D :
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hpos :
∀ k, 0 < p k
hlt :
∀ k, p k < 1
hBern :
i :
O
D.E (fun z => E.linScore p z i) = 0
Proof (Lean source)
lemma linScore_mean_zero (E : BipartiteExperiment I O) (D : FiniteDesign (I → Bool)) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hpos : ∀ k, 0 < p k) (hlt : ∀ k, p k < 1) (hBern : IndepHeteroBernoulli D p hp0 hp1) (i : O) : D.E (fun z => E.linScore p z i) = 0 := by rw [hBern] unfold BipartiteExperiment.linScore have hpiT_pos : 0 < E.piT p i := by unfold BipartiteExperiment.piT exact Finset.prod_pos (fun k _ => hpos k) have hpiC_pos : 0 < E.piC p i := by unfold BipartiteExperiment.piC exact Finset.prod_pos (fun k _ => sub_pos.mpr (hlt k)) have hET : (bernoulliDesign p hp0 hp1).E (fun z => E.expT z i) = E.piT p i := by unfold BipartiteExperiment.expT BipartiteExperiment.piT exact bernoulli_E_treat_prod p hp0 hp1 (E.N i) have hEC : (bernoulliDesign p hp0 hp1).E (fun z => E.expC z i) = E.piC p i := by unfold BipartiteExperiment.expC BipartiteExperiment.piC exact bernoulli_E_ctrl_prod p hp0 hp1 (E.N i) have hA : (bernoulliDesign p hp0 hp1).E (fun z => E.expT z i / E.piT p i - 1) = 0 := E_centered_ratio _ _ _ (ne_of_gt hpiT_pos) hET have hB : (bernoulliDesign p hp0 hp1).E (fun z => E.expC z i / E.piC p i - 1) = 0 := E_centered_ratio _ _ _ (ne_of_gt hpiC_pos) hEC rw [(bernoulliDesign p hp0 hp1).E_sub] rw [(bernoulliDesign p hp0 hp1).E_mul_const, (bernoulliDesign p hp0 hp1).E_mul_const] rw [hA, hB] ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.linScore_mean_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Linearization.lean:29

The mixed overlap kernel is symmetric in the two outcomes.

Formal statement
i j :
O
E.r10 j i = E.r10 i j
Proof (Lean source)
lemma r10_comm (E : BipartiteExperiment I O) (i j : O) : E.r10 j i = E.r10 i j := by simp [BipartiteExperiment.r10, BipartiteExperiment.shared, Finset.inter_comm]

Summing the two symmetric mixed terms over all outcome pairs is equal to twice either one of them.

Formal statement
a b :
O → ℝ
(∑ i : O, ∑ j : O, E.r10 i j * (a i * b j + b i * a j))
= ∑ i : O, ∑ j : O, 2 * E.r10 i j * a i * b j
Proof (Lean source)
lemma cross_sum_symm_r10 (E : BipartiteExperiment I O) (a b : O → ℝ) : (∑ i : O, ∑ j : O, E.r10 i j * (a i * b j + b i * a j)) = ∑ i : O, ∑ j : O, 2 * E.r10 i j * a i * b j := by classical have hswap : (∑ i : O, ∑ j : O, E.r10 i j * (b i * a j)) = ∑ i : O, ∑ j : O, E.r10 i j * (a i * b j) := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ rw [r10_comm E i j] ring calc (∑ i : O, ∑ j : O, E.r10 i j * (a i * b j + b i * a j)) = (∑ i : O, ∑ j : O, E.r10 i j * (a i * b j)) + (∑ i : O, ∑ j : O, E.r10 i j * (b i * a j)) := by simp_rw [mul_add, Finset.sum_add_distrib] _ = (∑ i : O, ∑ j : O, E.r10 i j * (a i * b j)) + (∑ i : O, ∑ j : O, E.r10 i j * (a i * b j)) := by rw [hswap] _ = ∑ i : O, ∑ j : O, 2 * E.r10 i j * a i * b j := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro i _ rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro j _ ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.cross_sum_symm_r10 · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Linearization.lean:65
theorem linScore_pair_moment

The joint moment of two linearization scores equals the sum of their treated, control, and mixed overlap-kernel contributions.

Formal statement
D :
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hpos :
∀ k, 0 < p k
hlt :
∀ k, p k < 1
hBern :
i j :
O
D.E (fun z => E.linScore p z i * E.linScore p z j)
= E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1)
+ E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0)
+ E.r10 i j * ((E.Y1 i - E.mu1) * (E.Y0 j - E.mu0) + (E.Y0 i - E.mu0) * (E.Y1 j - E.mu1))
Proof (Lean source)
lemma linScore_pair_moment (E : BipartiteExperiment I O) (D : FiniteDesign (I → Bool)) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hpos : ∀ k, 0 < p k) (hlt : ∀ k, p k < 1) (hBern : IndepHeteroBernoulli D p hp0 hp1) (i j : O) : D.E (fun z => E.linScore p z i * E.linScore p z j) = E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + E.r10 i j * ((E.Y1 i - E.mu1) * (E.Y0 j - E.mu0) + (E.Y0 i - E.mu0) * (E.Y1 j - E.mu1)) := by classical rw [hBern] unfold BipartiteExperiment.linScore let A_i : (I → Bool) → ℝ := fun z => E.expT z i / E.piT p i - 1 let B_i : (I → Bool) → ℝ := fun z => E.expC z i / E.piC p i - 1 let A_j : (I → Bool) → ℝ := fun z => E.expT z j / E.piT p j - 1 let B_j : (I → Bool) → ℝ := fun z => E.expC z j / E.piC p j - 1 have hAA : (bernoulliDesign p hp0 hp1).E (fun z => A_i z * A_j z) = E.r1 p i j := centered_treat_treat_moment E p hp0 hp1 hpos i j have hBB : (bernoulliDesign p hp0 hp1).E (fun z => B_i z * B_j z) = E.r0 p i j := centered_ctrl_ctrl_moment E p hp0 hp1 hlt i j have hAB : (bernoulliDesign p hp0 hp1).E (fun z => A_i z * B_j z) = -E.r10 i j := centered_treat_ctrl_moment E p hp0 hp1 hpos hlt i j have hBA : (bernoulliDesign p hp0 hp1).E (fun z => B_i z * A_j z) = -E.r10 i j := by calc (bernoulliDesign p hp0 hp1).E (fun z => B_i z * A_j z) = (bernoulliDesign p hp0 hp1).E (fun z => A_j z * B_i z) := by exact (bernoulliDesign p hp0 hp1).E_congr (fun z => by ring) _ = -E.r10 j i := centered_treat_ctrl_moment E p hp0 hp1 hpos hlt j i _ = -E.r10 i j := by rw [r10_comm E i j] rw [E_lin_expand (D := bernoulliDesign p hp0 hp1) (A := A_i) (B := B_i) (C := A_j) (F := B_j) (ai := E.Y1 i - E.mu1) (bi := E.Y0 i - E.mu0) (aj := E.Y1 j - E.mu1) (bj := E.Y0 j - E.mu0) (AA := E.r1 p i j) (AB := -E.r10 i j) (BA := -E.r10 i j) (BB := E.r0 p i j) hAA hAB hBA hBB] ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.linScore_pair_moment · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Linearization.lean:96
theorem varScale_pair_moments

The variance scale is the average over all outcome pairs of the joint moments of their linearization scores.

Formal statement
D :
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hpos :
∀ k, 0 < p k
hlt :
∀ k, p k < 1
hBern :
E.varScale D p
= (Fintype.card O : ℝ)⁻¹ * ∑ i, ∑ j, D.E (fun z => E.linScore p z i * E.linScore p z j)
Proof (Lean source)
lemma varScale_pair_moments (E : BipartiteExperiment I O) (D : FiniteDesign (I → Bool)) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hpos : ∀ k, 0 < p k) (hlt : ∀ k, p k < 1) (hBern : IndepHeteroBernoulli D p hp0 hp1) : E.varScale D p = (Fintype.card O : ℝ)⁻¹ * ∑ i, ∑ j, D.E (fun z => E.linScore p z i * E.linScore p z j) := by classical set nR : ℝ := (Fintype.card O : ℝ) have hmean : ∀ i, D.E (fun z => E.linScore p z i) = 0 := fun i => linScore_mean_zero E D p hp0 hp1 hpos hlt hBern i have hsumfun : (fun z => nR⁻¹ * ∑ i : O, E.linScore p z i) = (fun z => ∑ i : O, nR⁻¹ * E.linScore p z i) := by funext z rw [Finset.mul_sum] unfold BipartiteExperiment.varScale change nR * D.Var (fun z => nR⁻¹ * ∑ i : O, E.linScore p z i) = nR⁻¹ * ∑ i, ∑ j, D.E (fun z => E.linScore p z i * E.linScore p z j) rw [D.Var_congr (by intro z; exact congrFun hsumfun z)] rw [D.Var_linear_comb univ (fun _ : O => nR⁻¹) (fun i z => E.linScore p z i)] have hcov : ∀ i j, D.Cov (fun z => E.linScore p z i) (fun z => E.linScore p z j) = D.E (fun z => E.linScore p z i * E.linScore p z j) := by intro i j rw [D.Cov_eq, hmean i, hmean j] ring simp [hcov] by_cases hn : nR = 0 · simp [hn] · rw [show (∑ x : O, ∑ y : O, nR⁻¹ * nR⁻¹ * D.E (fun z => E.linScore p z x * E.linScore p z y)) = (nR⁻¹ * nR⁻¹) * (∑ x : O, ∑ y : O, D.E (fun z => E.linScore p z x * E.linScore p z y)) by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ rw [Finset.mul_sum]] field_simp [hn]
CausalSmith.Experimentation.BipartiteMinimaxDesign.varScale_pair_moments · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Linearization.lean:135
theorem sum_pair_moment_cross_combined Lemma sum_pair_moment_cross_combined in the paper ↗

In a double sum, symmetric mixed overlap terms can be combined into twice the one-direction mixed term.

Formal statement
A B :
O → O → ℝ
a b :
O → ℝ
(∑ i : O, ∑ j : O, (A i j + B i j + E.r10 i j * (a i * b j + b i * a j)))
= ∑ i : O, ∑ j : O, (A i j + B i j + 2 * E.r10 i j * a i * b j)
Proof (Lean source)
lemma sum_pair_moment_cross_combined (E : BipartiteExperiment I O) (A B : O → O → ℝ) (a b : O → ℝ) : (∑ i : O, ∑ j : O, (A i j + B i j + E.r10 i j * (a i * b j + b i * a j))) = ∑ i : O, ∑ j : O, (A i j + B i j + 2 * E.r10 i j * a i * b j) := by classical have hcross := cross_sum_symm_r10 E a b calc (∑ i : O, ∑ j : O, (A i j + B i j + E.r10 i j * (a i * b j + b i * a j))) = (∑ i : O, ∑ j : O, A i j) + (∑ i : O, ∑ j : O, B i j) + (∑ i : O, ∑ j : O, E.r10 i j * (a i * b j + b i * a j)) := by simp_rw [Finset.sum_add_distrib] _ = (∑ i : O, ∑ j : O, A i j) + (∑ i : O, ∑ j : O, B i j) + (∑ i : O, ∑ j : O, 2 * E.r10 i j * a i * b j) := by rw [hcross] _ = ∑ i : O, ∑ j : O, (A i j + B i j + 2 * E.r10 i j * a i * b j) := by simp_rw [Finset.sum_add_distrib]
CausalSmith.Experimentation.BipartiteMinimaxDesign.sum_pair_moment_cross_combined · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Linearization.lean:175
theorem varScale_homogeneous_formula

The variance scale equals the outcome-pair average of the treated, control, and combined mixed overlap contributions.

Formal statement
D :
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hpos :
∀ k, 0 < p k
hlt :
∀ k, p k < 1
hBern :
E.varScale D p
= (Fintype.card O : ℝ)⁻¹ * ∑ i, ∑ j, (E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + 2 * E.r10 i j * (E.Y1 i - E.mu1) * (E.Y0 j - E.mu0))
Proof (Lean source)
lemma varScale_homogeneous_formula (E : BipartiteExperiment I O) (D : FiniteDesign (I → Bool)) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hpos : ∀ k, 0 < p k) (hlt : ∀ k, p k < 1) (hBern : IndepHeteroBernoulli D p hp0 hp1) : E.varScale D p = (Fintype.card O : ℝ)⁻¹ * ∑ i, ∑ j, (E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + 2 * E.r10 i j * (E.Y1 i - E.mu1) * (E.Y0 j - E.mu0)) := by rw [varScale_pair_moments E D p hp0 hp1 hpos hlt hBern] apply congrArg ((Fintype.card O : ℝ)⁻¹ * ·) simp_rw [linScore_pair_moment E D p hp0 hp1 hpos hlt hBern] let A : O → O → ℝ := fun i j => E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) let B : O → O → ℝ := fun i j => E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) let a : O → ℝ := fun i => E.Y1 i - E.mu1 let b : O → ℝ := fun i => E.Y0 i - E.mu0 have hsum := sum_pair_moment_cross_combined E A B a b simpa [A, B, a, b, mul_assoc, mul_left_comm, mul_comm] using hsum
CausalSmith.Experimentation.BipartiteMinimaxDesign.varScale_homogeneous_formula · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Linearization.lean:193
Helpers.Moments 9 declarations

For disjoint intervention sets, the product that uses one factor on the first set and another on the second factors into the two separate products.

Formal statement
S T :
hST :
a b :
I → ℝ
(∏ k : I, if k ∈ S then a k else if k ∈ T then b k else 1)
= (∏ k ∈ S, a k) * (∏ k ∈ T, b k)
Proof (Lean source)
lemma prod_ite_disjoint (S T : Finset I) (hST : Disjoint S T) (a b : I → ℝ) : (∏ k : I, if k ∈ S then a k else if k ∈ T then b k else 1) = (∏ k ∈ S, a k) * (∏ k ∈ T, b k) := by classical rw [show (∏ k ∈ S, a k) = ∏ k : I, if k ∈ S then a k else 1 by simpa using (Finset.prod_ite_mem_eq (s := S) (f := a)).symm] rw [show (∏ k ∈ T, b k) = ∏ k : I, if k ∈ T then b k else 1 by simpa using (Finset.prod_ite_mem_eq (s := T) (f := b)).symm] rw [← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro k _ by_cases hS : k ∈ S · have hT : k ∉ T := fun hT => Finset.disjoint_left.mp hST hS hT simp [hS, hT] · by_cases hT : k ∈ T <;> simp [hS, hT]
CausalSmith.Experimentation.BipartiteMinimaxDesign.prod_ite_disjoint · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Moments.lean:28
theorem treat_prod_mul_eq_union Lemma treat_prod_mul_eq_union in the paper ↗

The product of two all-treated exposure indicators equals the all-treated indicator for the union of their intervention sets.

Formal statement
S T :
z :
I → Bool
(∏ k ∈ S, (if z k then (1 : ℝ) else 0)) * (∏ k ∈ T, (if z k then (1 : ℝ) else 0))
= ∏ k ∈ S ∪ T, (if z k then (1 : ℝ) else 0)
Proof (Lean source)
lemma treat_prod_mul_eq_union (S T : Finset I) (z : I → Bool) : (∏ k ∈ S, (if z k then (1 : ℝ) else 0)) * (∏ k ∈ T, (if z k then (1 : ℝ) else 0)) = ∏ k ∈ S ∪ T, (if z k then (1 : ℝ) else 0) := by classical rw [show (∏ k ∈ S, (if z k then (1 : ℝ) else 0)) = ∏ k : I, if k ∈ S then (if z k then (1 : ℝ) else 0) else 1 by simpa using (Finset.prod_ite_mem_eq (s := S) (f := fun k => if z k then (1 : ℝ) else 0)).symm] rw [show (∏ k ∈ T, (if z k then (1 : ℝ) else 0)) = ∏ k : I, if k ∈ T then (if z k then (1 : ℝ) else 0) else 1 by simpa using (Finset.prod_ite_mem_eq (s := T) (f := fun k => if z k then (1 : ℝ) else 0)).symm] rw [← Finset.prod_mul_distrib] rw [show (∏ k : I, (if k ∈ S then (if z k then (1 : ℝ) else 0) else 1) * (if k ∈ T then (if z k then (1 : ℝ) else 0) else 1)) = ∏ k : I, if k ∈ S ∪ T then (if z k then (1 : ℝ) else 0) else 1 by apply Finset.prod_congr rfl intro k _ by_cases hS : k ∈ S <;> by_cases hT : k ∈ T <;> cases hz : z k <;> simp [hS, hT, hz]] simpa using (Finset.prod_ite_mem_eq (s := S ∪ T) (f := fun k => if z k then (1 : ℝ) else 0))
CausalSmith.Experimentation.BipartiteMinimaxDesign.treat_prod_mul_eq_union · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Moments.lean:46

The product of two all-control exposure indicators equals the all-control indicator for the union of their intervention sets.

Formal statement
S T :
z :
I → Bool
(∏ k ∈ S, (if z k then (0 : ℝ) else 1)) * (∏ k ∈ T, (if z k then (0 : ℝ) else 1))
= ∏ k ∈ S ∪ T, (if z k then (0 : ℝ) else 1)
Proof (Lean source)
lemma ctrl_prod_mul_eq_union (S T : Finset I) (z : I → Bool) : (∏ k ∈ S, (if z k then (0 : ℝ) else 1)) * (∏ k ∈ T, (if z k then (0 : ℝ) else 1)) = ∏ k ∈ S ∪ T, (if z k then (0 : ℝ) else 1) := by classical rw [show (∏ k ∈ S, (if z k then (0 : ℝ) else 1)) = ∏ k : I, if k ∈ S then (if z k then (0 : ℝ) else 1) else 1 by simpa using (Finset.prod_ite_mem_eq (s := S) (f := fun k => if z k then (0 : ℝ) else 1)).symm] rw [show (∏ k ∈ T, (if z k then (0 : ℝ) else 1)) = ∏ k : I, if k ∈ T then (if z k then (0 : ℝ) else 1) else 1 by simpa using (Finset.prod_ite_mem_eq (s := T) (f := fun k => if z k then (0 : ℝ) else 1)).symm] rw [← Finset.prod_mul_distrib] rw [show (∏ k : I, (if k ∈ S then (if z k then (0 : ℝ) else 1) else 1) * (if k ∈ T then (if z k then (0 : ℝ) else 1) else 1)) = ∏ k : I, if k ∈ S ∪ T then (if z k then (0 : ℝ) else 1) else 1 by apply Finset.prod_congr rfl intro k _ by_cases hS : k ∈ S <;> by_cases hT : k ∈ T <;> cases hz : z k <;> simp [hS, hT, hz]] simpa using (Finset.prod_ite_mem_eq (s := S ∪ T) (f := fun k => if z k then (0 : ℝ) else 1))
CausalSmith.Experimentation.BipartiteMinimaxDesign.ctrl_prod_mul_eq_union · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Moments.lean:72
theorem treat_ctrl_prod_eq_zero_of_inter_nonempty Lemma treat_ctrl_prod_eq_zero_of_inter_nonempty in the paper ↗

If two intervention sets overlap, their all-treated and all-control exposure indicators cannot both equal one, so their product is zero.

Formal statement
S T :
h :
0 < (S ∩ T).card
z :
I → Bool
(∏ k ∈ S, (if z k then (1 : ℝ) else 0)) * (∏ k ∈ T, (if z k then (0 : ℝ) else 1)) = 0
Proof (Lean source)
lemma treat_ctrl_prod_eq_zero_of_inter_nonempty {S T : Finset I} (h : 0 < (S ∩ T).card) (z : I → Bool) : (∏ k ∈ S, (if z k then (1 : ℝ) else 0)) * (∏ k ∈ T, (if z k then (0 : ℝ) else 1)) = 0 := by classical rcases Finset.card_pos.mp h with ⟨k, hk⟩ have hkS : k ∈ S := Finset.mem_of_mem_inter_left hk have hkT : k ∈ T := Finset.mem_of_mem_inter_right hk by_cases hz : z k · have hctrl : (∏ l ∈ T, (if z l then (0 : ℝ) else 1)) = 0 := by apply Finset.prod_eq_zero hkT simp [hz] simp [hctrl] · have htreat : (∏ l ∈ S, (if z l then (1 : ℝ) else 0)) = 0 := by apply Finset.prod_eq_zero hkS simp [hz] simp [htreat]
CausalSmith.Experimentation.BipartiteMinimaxDesign.treat_ctrl_prod_eq_zero_of_inter_nonempty · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Moments.lean:98
theorem treat_ctrl_prod_eq_mixed_of_disjoint Lemma treat_ctrl_prod_eq_mixed_of_disjoint in the paper ↗

For disjoint sets, the product of an all-treated indicator and an all-control indicator is the indicator for that mixed assignment pattern.

Formal statement
S T :
hST :
z :
I → Bool
(∏ k ∈ S, (if z k then (1 : ℝ) else 0)) * (∏ k ∈ T, (if z k then (0 : ℝ) else 1))
= ∏ k : I, if k ∈ S then (if z k then (1 : ℝ) else 0) else if k ∈ T then (if z k then (0 : ℝ) else 1) else 1
Proof (Lean source)
lemma treat_ctrl_prod_eq_mixed_of_disjoint {S T : Finset I} (hST : Disjoint S T) (z : I → Bool) : (∏ k ∈ S, (if z k then (1 : ℝ) else 0)) * (∏ k ∈ T, (if z k then (0 : ℝ) else 1)) = ∏ k : I, if k ∈ S then (if z k then (1 : ℝ) else 0) else if k ∈ T then (if z k then (0 : ℝ) else 1) else 1 := by classical rw [show (∏ k ∈ S, (if z k then (1 : ℝ) else 0)) = ∏ k : I, if k ∈ S then (if z k then (1 : ℝ) else 0) else 1 by simpa using (Finset.prod_ite_mem_eq (s := S) (f := fun k => if z k then (1 : ℝ) else 0)).symm] rw [show (∏ k ∈ T, (if z k then (0 : ℝ) else 1)) = ∏ k : I, if k ∈ T then (if z k then (0 : ℝ) else 1) else 1 by simpa using (Finset.prod_ite_mem_eq (s := T) (f := fun k => if z k then (0 : ℝ) else 1)).symm] rw [← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro k _ by_cases hS : k ∈ S · have hT : k ∉ T := fun hT => Finset.disjoint_left.mp hST hS hT cases hz : z k <;> simp [hS, hT, hz] · by_cases hT : k ∈ T <;> cases hz : z k <;> simp [hS, hT, hz]
CausalSmith.Experimentation.BipartiteMinimaxDesign.treat_ctrl_prod_eq_mixed_of_disjoint · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Moments.lean:118
theorem bernoulli_E_treat_prod

Under independent Bernoulli assignment, the probability that all interventions in a set are treated is the product of their treatment probabilities.

Formal statement
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
S :
(bernoulliDesign p hp0 hp1).E (fun z => ∏ k ∈ S, (if z k then (1 : ℝ) else 0))
= ∏ k ∈ S, p k
Proof (Lean source)
lemma bernoulli_E_treat_prod (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (S : Finset I) : (bernoulliDesign p hp0 hp1).E (fun z => ∏ k ∈ S, (if z k then (1 : ℝ) else 0)) = ∏ k ∈ S, p k := by classical rw [show (fun z : I → Bool => ∏ k ∈ S, (if z k then (1 : ℝ) else 0)) = (fun z => ∏ k : I, (fun (k : I) (b : Bool) => if k ∈ S then (if b then (1 : ℝ) else 0) else 1) k (z k)) by funext z simpa using (Finset.prod_ite_mem_eq (s := S) (f := fun k => if z k then (1 : ℝ) else 0)).symm] unfold bernoulliDesign rw [FiniteDesign.E_prod_prod (fun i => coinDesign (p i) (hp0 i) (hp1 i)) (fun k b => if k ∈ S then (if b then (1 : ℝ) else 0) else 1)] trans ∏ x : I, if x ∈ S then p x else 1 · apply Finset.prod_congr rfl intro x _ by_cases h : x ∈ S <;> simp [coinDesign_E, h] · simpa using (Finset.prod_ite_mem_eq (s := S) (f := p))
CausalSmith.Experimentation.BipartiteMinimaxDesign.bernoulli_E_treat_prod · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Moments.lean:144
theorem bernoulli_E_ctrl_prod

Under independent Bernoulli assignment, the probability that all interventions in a set are controlled is the product of their control probabilities.

Formal statement
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
S :
(bernoulliDesign p hp0 hp1).E (fun z => ∏ k ∈ S, (if z k then (0 : ℝ) else 1))
= ∏ k ∈ S, (1 - p k)
Proof (Lean source)
lemma bernoulli_E_ctrl_prod (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (S : Finset I) : (bernoulliDesign p hp0 hp1).E (fun z => ∏ k ∈ S, (if z k then (0 : ℝ) else 1)) = ∏ k ∈ S, (1 - p k) := by classical rw [show (fun z : I → Bool => ∏ k ∈ S, (if z k then (0 : ℝ) else 1)) = (fun z => ∏ k : I, (fun (k : I) (b : Bool) => if k ∈ S then (if b then (0 : ℝ) else 1) else 1) k (z k)) by funext z simpa using (Finset.prod_ite_mem_eq (s := S) (f := fun k => if z k then (0 : ℝ) else 1)).symm] unfold bernoulliDesign rw [FiniteDesign.E_prod_prod (fun i => coinDesign (p i) (hp0 i) (hp1 i)) (fun k b => if k ∈ S then (if b then (0 : ℝ) else 1) else 1)] trans ∏ x : I, if x ∈ S then (1 - p x) else 1 · apply Finset.prod_congr rfl intro x _ by_cases h : x ∈ S <;> simp [coinDesign_E, h] · simpa using (Finset.prod_ite_mem_eq (s := S) (f := fun k => 1 - p k))
CausalSmith.Experimentation.BipartiteMinimaxDesign.bernoulli_E_ctrl_prod · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Moments.lean:168
theorem bernoulli_E_treat_mul_treat

Under independent Bernoulli assignment, the expected product of two all-treated exposure indicators is the product of treatment probabilities over their union.

Formal statement
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
S T :
(bernoulliDesign p hp0 hp1).E (fun z => (∏ k ∈ S, (if z k then (1 : ℝ) else 0)) * (∏ k ∈ T, (if z k then (1 : ℝ) else 0)))
= ∏ k ∈ S ∪ T, p k
Proof (Lean source)
lemma bernoulli_E_treat_mul_treat (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (S T : Finset I) : (bernoulliDesign p hp0 hp1).E (fun z => (∏ k ∈ S, (if z k then (1 : ℝ) else 0)) * (∏ k ∈ T, (if z k then (1 : ℝ) else 0))) = ∏ k ∈ S ∪ T, p k := by rw [(bernoulliDesign p hp0 hp1).E_congr (fun z => treat_prod_mul_eq_union S T z)] exact bernoulli_E_treat_prod p hp0 hp1 (S ∪ T)
CausalSmith.Experimentation.BipartiteMinimaxDesign.bernoulli_E_treat_mul_treat · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Moments.lean:192
theorem bernoulli_E_ctrl_mul_ctrl

Under independent Bernoulli assignment, the expected product of two all-control exposure indicators is the product of control probabilities over their union.

Formal statement
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
S T :
(bernoulliDesign p hp0 hp1).E (fun z => (∏ k ∈ S, (if z k then (0 : ℝ) else 1)) * (∏ k ∈ T, (if z k then (0 : ℝ) else 1)))
= ∏ k ∈ S ∪ T, (1 - p k)
Proof (Lean source)
lemma bernoulli_E_ctrl_mul_ctrl (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (S T : Finset I) : (bernoulliDesign p hp0 hp1).E (fun z => (∏ k ∈ S, (if z k then (0 : ℝ) else 1)) * (∏ k ∈ T, (if z k then (0 : ℝ) else 1))) = ∏ k ∈ S ∪ T, (1 - p k) := by rw [(bernoulliDesign p hp0 hp1).E_congr (fun z => ctrl_prod_mul_eq_union S T z)] exact bernoulli_E_ctrl_prod p hp0 hp1 (S ∪ T)
CausalSmith.Experimentation.BipartiteMinimaxDesign.bernoulli_E_ctrl_mul_ctrl · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Moments.lean:204
Helpers.NumeratorMoment 8 declarations
def treatNumerator

Centered treated-arm numerator G₁(z) = ∑ᵢ (T_i(z)/π_i^1)(Y_i^1 − μ₁).

Definition (Lean source)
noncomputable def treatNumerator (E : BipartiteExperiment I O) (p : I → ℝ) (z : I → Bool) : ℝ := ∑ i, E.expT z i / E.piT p i * (E.Y1 i - E.mu1)
CausalSmith.Experimentation.BipartiteMinimaxDesign.treatNumerator · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/NumeratorMoment.lean:32
def ctrlNumerator

Centered control-arm numerator G₀(z) = ∑ᵢ (C_i(z)/π_i^0)(Y_i^0 − μ₀).

Definition (Lean source)
noncomputable def ctrlNumerator (E : BipartiteExperiment I O) (p : I → ℝ) (z : I → Bool) : ℝ := ∑ i, E.expC z i / E.piC p i * (E.Y0 i - E.mu0)
CausalSmith.Experimentation.BipartiteMinimaxDesign.ctrlNumerator · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/NumeratorMoment.lean:36
theorem treatNumerator_mean_zero

The treated-arm numerator has design mean zero under the Bernoulli design.

Formal statement
q :
I → ℝ
hq0 :
∀ k, 0 ≤ q k
hq1 :
∀ k, q k ≤ 1
hpos :
∀ k, 0 < q k
(bernoulliDesign q hq0 hq1).E (fun z => treatNumerator E q z) = 0
Proof (Lean source)
lemma treatNumerator_mean_zero (E : BipartiteExperiment I O) (q : I → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1) (hpos : ∀ k, 0 < q k) : (bernoulliDesign q hq0 hq1).E (fun z => treatNumerator E q z) = 0 := by classical simp only [treatNumerator] rw [(bernoulliDesign q hq0 hq1).E_sum univ (fun i z => E.expT z i / E.piT q i * (E.Y1 i - E.mu1))] trans ∑ i : O, (E.Y1 i - E.mu1) * 1 · apply Finset.sum_congr rfl intro i _ have hpi_pos : 0 < E.piT q i := by unfold BipartiteExperiment.piT exact Finset.prod_pos (fun k _ => hpos k) have hE : (bernoulliDesign q hq0 hq1).E (fun z => E.expT z i) = E.piT q i := by unfold BipartiteExperiment.expT BipartiteExperiment.piT exact bernoulli_E_treat_prod q hq0 hq1 (E.N i) rw [show (fun z => E.expT z i / E.piT q i * (E.Y1 i - E.mu1)) = fun z => ((E.Y1 i - E.mu1) * (E.piT q i)⁻¹) * E.expT z i by funext z; ring] rw [(bernoulliDesign q hq0 hq1).E_const_mul, hE] field_simp [(ne_of_gt hpi_pos)] · simp only [mul_one] rw [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] unfold BipartiteExperiment.mu1 rcases eq_or_ne (Fintype.card O : ℝ) 0 with hcard | hcard · have hc0 : Fintype.card O = 0 := by exact_mod_cast hcard haveI : IsEmpty O := Fintype.card_eq_zero_iff.mp hc0 simp · field_simp ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.treatNumerator_mean_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/NumeratorMoment.lean:40
theorem ctrlNumerator_mean_zero

The control-arm numerator has design mean zero under the Bernoulli design.

Formal statement
q :
I → ℝ
hq0 :
∀ k, 0 ≤ q k
hq1 :
∀ k, q k ≤ 1
hlt :
∀ k, q k < 1
(bernoulliDesign q hq0 hq1).E (fun z => ctrlNumerator E q z) = 0
Proof (Lean source)
lemma ctrlNumerator_mean_zero (E : BipartiteExperiment I O) (q : I → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1) (hlt : ∀ k, q k < 1) : (bernoulliDesign q hq0 hq1).E (fun z => ctrlNumerator E q z) = 0 := by classical simp only [ctrlNumerator] rw [(bernoulliDesign q hq0 hq1).E_sum univ (fun i z => E.expC z i / E.piC q i * (E.Y0 i - E.mu0))] trans ∑ i : O, (E.Y0 i - E.mu0) * 1 · apply Finset.sum_congr rfl intro i _ have hpi_pos : 0 < E.piC q i := by unfold BipartiteExperiment.piC exact Finset.prod_pos (fun k _ => sub_pos.mpr (hlt k)) have hE : (bernoulliDesign q hq0 hq1).E (fun z => E.expC z i) = E.piC q i := by unfold BipartiteExperiment.expC BipartiteExperiment.piC exact bernoulli_E_ctrl_prod q hq0 hq1 (E.N i) rw [show (fun z => E.expC z i / E.piC q i * (E.Y0 i - E.mu0)) = fun z => ((E.Y0 i - E.mu0) * (E.piC q i)⁻¹) * E.expC z i by funext z; ring] rw [(bernoulliDesign q hq0 hq1).E_const_mul, hE] field_simp [(ne_of_gt hpi_pos)] · simp only [mul_one] rw [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] unfold BipartiteExperiment.mu0 rcases eq_or_ne (Fintype.card O : ℝ) 0 with hcard | hcard · have hc0 : Fintype.card O = 0 := by exact_mod_cast hcard haveI : IsEmpty O := Fintype.card_eq_zero_iff.mp hc0 simp · field_simp ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.ctrlNumerator_mean_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/NumeratorMoment.lean:72
theorem treatNumerator_var_le

The treated-arm numerator has design variance at most card O · (4 · D̄ · denominatorKernelBound ε d̄).

Formal statement
ε B dbar Dbar :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hbdd :
hdeg :
hdep :
q :
I → ℝ
hq0 :
∀ k, 0 ≤ q k
hq1 :
∀ k, q k ≤ 1
hq :
(bernoulliDesign q hq0 hq1).Var (fun z => treatNumerator E q z)
≤ (Fintype.card O : ℝ) * (4 * (Dbar * denominatorKernelBound ε dbar))
Proof (Lean source)
lemma treatNumerator_var_le (E : BipartiteExperiment I O) (ε B dbar Dbar : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hbdd : BoundedOutcomes E) (hdeg : BoundedOutcomeDegree E dbar) (hdep : BoundedOverlapDependency E Dbar) (q : I → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1) (hq : FeasibleDesign ε B q) : (bernoulliDesign q hq0 hq1).Var (fun z => treatNumerator E q z) ≤ (Fintype.card O : ℝ) * (4 * (Dbar * denominatorKernelBound ε dbar)) := by classical let D := bernoulliDesign q hq0 hq1 let c : O → ℝ := fun i => E.Y1 i - E.mu1 let X : O → (I → Bool) → ℝ := fun i z => E.expT z i / E.piT q i have hpos : ∀ k, 0 < q k := fun k => lt_of_lt_of_le hε0 (hq.floor k).1 have hmu : |E.mu1| ≤ 1 := by unfold BipartiteExperiment.mu1 by_cases hcard : (Fintype.card O : ℝ) = 0 · simp [hcard] have hcard_pos : 0 < (Fintype.card O : ℝ) := by have hn : 0 < Fintype.card O := Fintype.card_pos_iff.mpr (by by_contra hempty have hzero : (Fintype.card O : ℝ) = 0 := by haveI : IsEmpty O := not_nonempty_iff.mp hempty simp exact hcard hzero) exact_mod_cast hn calc |(Fintype.card O : ℝ)⁻¹ * ∑ i, E.Y1 i| ≤ (Fintype.card O : ℝ)⁻¹ * ∑ _i : O, (1 : ℝ) := by rw [abs_mul, abs_of_pos (inv_pos.mpr hcard_pos)] exact mul_le_mul_of_nonneg_left ((Finset.abs_sum_le_sum_abs _ _).trans (Finset.sum_le_sum fun i _ => (hbdd i).1)) (inv_nonneg.mpr hcard_pos.le) _ = 1 := by simp [hcard] have hc : ∀ i, |c i| ≤ 2 := by intro i dsimp [c] calc |E.Y1 i - E.mu1| ≤ |E.Y1 i| + |E.mu1| := by simpa using (abs_sub_le (E.Y1 i) 0 E.mu1) _ ≤ 1 + 1 := add_le_add (hbdd i).1 hmu _ = 2 := by norm_num have hr : ∀ i j, 0 ≤ E.r1 q i j := by intro i j unfold BipartiteExperiment.r1 by_cases hcard : 0 < (E.shared i j).card · rw [if_pos hcard] have hprod : (1 : ℝ) ≤ ∏ k ∈ E.shared i j, (q k)⁻¹ := by refine Finset.one_le_prod ?_ intro k _ exact (one_le_inv₀ (hpos k)).mpr (hq1 k) exact sub_nonneg.mpr hprod · rw [if_neg hcard] have hmeanX : ∀ i, D.E (X i) = 1 := by intro i have hpi_pos : 0 < E.piT q i := by unfold BipartiteExperiment.piT exact Finset.prod_pos (fun k _ => hpos k) have hE : D.E (fun z => E.expT z i) = E.piT q i := by unfold D BipartiteExperiment.expT BipartiteExperiment.piT exact bernoulli_E_treat_prod q hq0 hq1 (E.N i) change D.E (fun z => E.expT z i / E.piT q i) = 1 rw [show (fun z => E.expT z i / E.piT q i) = fun z => (E.piT q i)⁻¹ * E.expT z i by funext z; ring] rw [D.E_const_mul, hE] field_simp [(ne_of_gt hpi_pos)] have hcov : ∀ i j, D.Cov (X i) (X j) = E.r1 q i j := by intro i j unfold FiniteDesign.Cov rw [hmeanX i, hmeanX j] change D.E (fun z => (E.expT z i / E.piT q i - 1) * (E.expT z j / E.piT q j - 1)) = E.r1 q i j unfold D exact centered_treat_treat_moment E q hq0 hq1 hpos i j have hvar_eq : D.Var (fun z => treatNumerator E q z) = ∑ i : O, ∑ j : O, c i * c j * E.r1 q i j := by have hfun : (fun z => treatNumerator E q z) = fun z => ∑ i : O, c i * X i z := by funext z unfold treatNumerator apply Finset.sum_congr rfl intro i _ dsimp [c, X] ring rw [D.Var_congr (fun z => congrFun hfun z)] rw [D.Var_linear_comb Finset.univ c X] simp [hcov] have hK_nonneg : 0 ≤ denominatorKernelBound ε dbar := denominatorKernelBound_nonneg hε0 have hrow : ∀ i, ∑ j : O, E.r1 q i j ≤ Dbar * denominatorKernelBound ε dbar := by intro i have hpoint : ∀ j : O, E.r1 q i j ≤ if j ∈ E.overlapNbrs i then denominatorKernelBound ε dbar else 0 := by intro j by_cases hj : j ∈ E.overlapNbrs i · simp [hj, r1_le_denominatorKernelBound E ε B dbar hε0 hε2 hdeg q hq i j] · have hnot : ¬ 0 < (E.shared i j).card := by simpa [BipartiteExperiment.overlapNbrs] using hj have hzero : E.r1 q i j = 0 := by simp [BipartiteExperiment.r1, hnot] simp [hj, hzero] calc ∑ j : O, E.r1 q i j ≤ ∑ j : O, if j ∈ E.overlapNbrs i then denominatorKernelBound ε dbar else 0 := Finset.sum_le_sum (fun j _ => hpoint j) _ = ∑ j ∈ E.overlapNbrs i, denominatorKernelBound ε dbar := by simpa using (Finset.sum_ite_mem (s := (Finset.univ : Finset O)) (t := E.overlapNbrs i) (f := fun _ => denominatorKernelBound ε dbar)) _ = ((E.overlapNbrs i).card : ℝ) * denominatorKernelBound ε dbar := by simp _ ≤ Dbar * denominatorKernelBound ε dbar := mul_le_mul_of_nonneg_right (hdep.2 i) hK_nonneg have hterm : ∀ i j, c i * c j * E.r1 q i j ≤ 4 * E.r1 q i j := by intro i j have hcc : c i * c j ≤ |c i| * |c j| := by calc c i * c j ≤ |c i * c j| := le_abs_self _ _ = |c i| * |c j| := abs_mul _ _ calc c i * c j * E.r1 q i j ≤ |c i| * |c j| * E.r1 q i j := mul_le_mul_of_nonneg_right hcc (hr i j) _ ≤ (2 * 2) * E.r1 q i j := mul_le_mul_of_nonneg_right (mul_le_mul (hc i) (hc j) (abs_nonneg _) (by norm_num)) (hr i j) _ = 4 * E.r1 q i j := by ring calc (bernoulliDesign q hq0 hq1).Var (fun z => treatNumerator E q z) = D.Var (fun z => treatNumerator E q z) := rfl _ = ∑ i : O, ∑ j : O, c i * c j * E.r1 q i j := hvar_eq _ ≤ ∑ i : O, ∑ j : O, 4 * E.r1 q i j := Finset.sum_le_sum (fun i _ => Finset.sum_le_sum (fun j _ => hterm i j)) _ = 4 * ∑ i : O, ∑ j : O, E.r1 q i j := by simp only [Finset.mul_sum] _ ≤ 4 * ∑ _i : O, Dbar * denominatorKernelBound ε dbar := mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun i _ => hrow i)) (by norm_num) _ = (Fintype.card O : ℝ) * (4 * (Dbar * denominatorKernelBound ε dbar)) := by simp [Finset.mul_sum] ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.treatNumerator_var_le · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/NumeratorMoment.lean:104
theorem ctrlNumerator_var_le

The control-arm numerator has design variance at most card O · (4 · D̄ · denominatorKernelBound ε d̄).

Formal statement
ε B dbar Dbar :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hbdd :
hdeg :
hdep :
q :
I → ℝ
hq0 :
∀ k, 0 ≤ q k
hq1 :
∀ k, q k ≤ 1
hq :
(bernoulliDesign q hq0 hq1).Var (fun z => ctrlNumerator E q z)
≤ (Fintype.card O : ℝ) * (4 * (Dbar * denominatorKernelBound ε dbar))
Proof (Lean source)
lemma ctrlNumerator_var_le (E : BipartiteExperiment I O) (ε B dbar Dbar : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hbdd : BoundedOutcomes E) (hdeg : BoundedOutcomeDegree E dbar) (hdep : BoundedOverlapDependency E Dbar) (q : I → ℝ) (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∀ k, q k ≤ 1) (hq : FeasibleDesign ε B q) : (bernoulliDesign q hq0 hq1).Var (fun z => ctrlNumerator E q z) ≤ (Fintype.card O : ℝ) * (4 * (Dbar * denominatorKernelBound ε dbar)) := by classical let D := bernoulliDesign q hq0 hq1 let c : O → ℝ := fun i => E.Y0 i - E.mu0 let X : O → (I → Bool) → ℝ := fun i z => E.expC z i / E.piC q i have hlt : ∀ k, q k < 1 := fun k => by linarith [(hq.floor k).2, hε0] have hmu : |E.mu0| ≤ 1 := by unfold BipartiteExperiment.mu0 by_cases hcard : (Fintype.card O : ℝ) = 0 · simp [hcard] have hcard_pos : 0 < (Fintype.card O : ℝ) := by have hn : 0 < Fintype.card O := Fintype.card_pos_iff.mpr (by by_contra hempty have hzero : (Fintype.card O : ℝ) = 0 := by haveI : IsEmpty O := not_nonempty_iff.mp hempty simp exact hcard hzero) exact_mod_cast hn calc |(Fintype.card O : ℝ)⁻¹ * ∑ i, E.Y0 i| ≤ (Fintype.card O : ℝ)⁻¹ * ∑ _i : O, (1 : ℝ) := by rw [abs_mul, abs_of_pos (inv_pos.mpr hcard_pos)] exact mul_le_mul_of_nonneg_left ((Finset.abs_sum_le_sum_abs _ _).trans (Finset.sum_le_sum fun i _ => (hbdd i).2)) (inv_nonneg.mpr hcard_pos.le) _ = 1 := by simp [hcard] have hc : ∀ i, |c i| ≤ 2 := by intro i dsimp [c] calc |E.Y0 i - E.mu0| ≤ |E.Y0 i| + |E.mu0| := by simpa using (abs_sub_le (E.Y0 i) 0 E.mu0) _ ≤ 1 + 1 := add_le_add (hbdd i).2 hmu _ = 2 := by norm_num have hr : ∀ i j, 0 ≤ E.r0 q i j := by intro i j unfold BipartiteExperiment.r0 by_cases hcard : 0 < (E.shared i j).card · rw [if_pos hcard] have hprod : (1 : ℝ) ≤ ∏ k ∈ E.shared i j, (1 - q k)⁻¹ := by refine Finset.one_le_prod ?_ intro k _ have hpos1 : 0 < 1 - q k := sub_pos.mpr (hlt k) have hle1 : 1 - q k ≤ 1 := by simpa using sub_le_self (1 : ℝ) (hq0 k) exact (one_le_inv₀ hpos1).mpr hle1 exact sub_nonneg.mpr hprod · rw [if_neg hcard] have hmeanX : ∀ i, D.E (X i) = 1 := by intro i have hpi_pos : 0 < E.piC q i := by unfold BipartiteExperiment.piC exact Finset.prod_pos (fun k _ => sub_pos.mpr (hlt k)) have hE : D.E (fun z => E.expC z i) = E.piC q i := by unfold D BipartiteExperiment.expC BipartiteExperiment.piC exact bernoulli_E_ctrl_prod q hq0 hq1 (E.N i) change D.E (fun z => E.expC z i / E.piC q i) = 1 rw [show (fun z => E.expC z i / E.piC q i) = fun z => (E.piC q i)⁻¹ * E.expC z i by funext z; ring] rw [D.E_const_mul, hE] field_simp [(ne_of_gt hpi_pos)] have hcov : ∀ i j, D.Cov (X i) (X j) = E.r0 q i j := by intro i j unfold FiniteDesign.Cov rw [hmeanX i, hmeanX j] change D.E (fun z => (E.expC z i / E.piC q i - 1) * (E.expC z j / E.piC q j - 1)) = E.r0 q i j unfold D exact centered_ctrl_ctrl_moment E q hq0 hq1 hlt i j have hvar_eq : D.Var (fun z => ctrlNumerator E q z) = ∑ i : O, ∑ j : O, c i * c j * E.r0 q i j := by have hfun : (fun z => ctrlNumerator E q z) = fun z => ∑ i : O, c i * X i z := by funext z unfold ctrlNumerator apply Finset.sum_congr rfl intro i _ dsimp [c, X] ring rw [D.Var_congr (fun z => congrFun hfun z)] rw [D.Var_linear_comb Finset.univ c X] simp [hcov] have hK_nonneg : 0 ≤ denominatorKernelBound ε dbar := denominatorKernelBound_nonneg hε0 have hrow : ∀ i, ∑ j : O, E.r0 q i j ≤ Dbar * denominatorKernelBound ε dbar := by intro i have hpoint : ∀ j : O, E.r0 q i j ≤ if j ∈ E.overlapNbrs i then denominatorKernelBound ε dbar else 0 := by intro j by_cases hj : j ∈ E.overlapNbrs i · simp [hj, r0_le_denominatorKernelBound E ε B dbar hε0 hε2 hdeg q hq i j] · have hnot : ¬ 0 < (E.shared i j).card := by simpa [BipartiteExperiment.overlapNbrs] using hj have hzero : E.r0 q i j = 0 := by simp [BipartiteExperiment.r0, hnot] simp [hj, hzero] calc ∑ j : O, E.r0 q i j ≤ ∑ j : O, if j ∈ E.overlapNbrs i then denominatorKernelBound ε dbar else 0 := Finset.sum_le_sum (fun j _ => hpoint j) _ = ∑ j ∈ E.overlapNbrs i, denominatorKernelBound ε dbar := by simpa using (Finset.sum_ite_mem (s := (Finset.univ : Finset O)) (t := E.overlapNbrs i) (f := fun _ => denominatorKernelBound ε dbar)) _ = ((E.overlapNbrs i).card : ℝ) * denominatorKernelBound ε dbar := by simp _ ≤ Dbar * denominatorKernelBound ε dbar := mul_le_mul_of_nonneg_right (hdep.2 i) hK_nonneg have hterm : ∀ i j, c i * c j * E.r0 q i j ≤ 4 * E.r0 q i j := by intro i j have hcc : c i * c j ≤ |c i| * |c j| := by calc c i * c j ≤ |c i * c j| := le_abs_self _ _ = |c i| * |c j| := abs_mul _ _ calc c i * c j * E.r0 q i j ≤ |c i| * |c j| * E.r0 q i j := mul_le_mul_of_nonneg_right hcc (hr i j) _ ≤ (2 * 2) * E.r0 q i j := mul_le_mul_of_nonneg_right (mul_le_mul (hc i) (hc j) (abs_nonneg _) (by norm_num)) (hr i j) _ = 4 * E.r0 q i j := by ring calc (bernoulliDesign q hq0 hq1).Var (fun z => ctrlNumerator E q z) = D.Var (fun z => ctrlNumerator E q z) := rfl _ = ∑ i : O, ∑ j : O, c i * c j * E.r0 q i j := hvar_eq _ ≤ ∑ i : O, ∑ j : O, 4 * E.r0 q i j := Finset.sum_le_sum (fun i _ => Finset.sum_le_sum (fun j _ => hterm i j)) _ = 4 * ∑ i : O, ∑ j : O, E.r0 q i j := by simp only [Finset.mul_sum] _ ≤ 4 * ∑ _i : O, Dbar * denominatorKernelBound ε dbar := mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun i _ => hrow i)) (by norm_num) _ = (Fintype.card O : ℝ) * (4 * (Dbar * denominatorKernelBound ε dbar)) := by simp [Finset.mul_sum] ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.ctrlNumerator_var_le · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/NumeratorMoment.lean:243
theorem treatNumerator_scaled_boundedInProb

The √(card Ox)-scaled treated-arm numerator is bounded in probability (uniformly tight).

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
hp0 :
∀ n k, 0 ≤ p n k
hp1 :
∀ n k, p n k ≤ 1
ε B :
ℕ → ℝ
dbar Dbar :
hBern :
∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)
hbdd :
∀ n, BoundedOutcomes (E n)
hdeg :
∀ n, BoundedOutcomeDegree (E n) dbar
hdep :
∀ n, BoundedOverlapDependency (E n) Dbar
hfeas :
∀ n, FeasibleDesign (ε n) (B n) (p n)
:
∀ n, EpsilonAdmissible (ε n)
hεfloor :
∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n
BoundedInProb D (fun n z => (sqrt (card (Ox n)))⁻¹ * treatNumerator (E n) (p n) z)
Proof (Lean source)
lemma treatNumerator_scaled_boundedInProb (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (hp0 : ∀ n k, 0 ≤ p n k) (hp1 : ∀ n k, p n k ≤ 1) (ε B : ℕ → ℝ) (dbar Dbar : ℝ) (hBern : ∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)) (hbdd : ∀ n, BoundedOutcomes (E n)) (hdeg : ∀ n, BoundedOutcomeDegree (E n) dbar) (hdep : ∀ n, BoundedOverlapDependency (E n) Dbar) (hfeas : ∀ n, FeasibleDesign (ε n) (B n) (p n)) (hε : ∀ n, EpsilonAdmissible (ε n)) (hεfloor : ∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n) : BoundedInProb D (fun n z => (sqrt (card (Ox n)))⁻¹ * treatNumerator (E n) (p n) z) := by classical rcases hεfloor with ⟨ε0, hε0, hfloor⟩ apply FiniteDesign.boundedInProb_of_var_bound D _ (V := 4 * (Dbar * denominatorKernelBound ε0 dbar)) (c := 0) · filter_upwards [hfloor] with n hε0le have hpos : ∀ k, 0 < p n k := fun k => lt_of_lt_of_le (hε n).1 ((hfeas n).floor k).1 have hDbar : 0 ≤ Dbar := (hdep n).1.le have hK0 : 0 ≤ denominatorKernelBound ε0 dbar := denominatorKernelBound_nonneg hε0 rcases Nat.eq_zero_or_pos (card (Ox n)) with hcard | hcard · rw [hBern n, FiniteDesign.Var_const_mul] simp [hcard, mul_nonneg hDbar hK0] · have hcardR : 0 < (card (Ox n) : ℝ) := by exact_mod_cast hcard have hvar := treatNumerator_var_le (E n) (ε n) (B n) dbar Dbar (hε n).1 (hε n).2 (hbdd n) (hdeg n) (hdep n) (p n) (hp0 n) (hp1 n) (hfeas n) have hK := denominatorKernelBound_le_of_floor (dbar := dbar) hε0 hε0le (hε n) rw [hBern n, FiniteDesign.Var_const_mul] calc (sqrt (card (Ox n)))⁻¹ ^ 2 * (bernoulliDesign (p n) (hp0 n) (hp1 n)).Var (fun z => treatNumerator (E n) (p n) z) = (card (Ox n) : ℝ)⁻¹ * (bernoulliDesign (p n) (hp0 n) (hp1 n)).Var (fun z => treatNumerator (E n) (p n) z) := by congr 1 rw [inv_pow, Real.sq_sqrt (by positivity)] _ ≤ (card (Ox n) : ℝ)⁻¹ * ((card (Ox n) : ℝ) * (4 * (Dbar * denominatorKernelBound (ε n) dbar))) := mul_le_mul_of_nonneg_left hvar (inv_nonneg.mpr hcardR.le) _ = 4 * (Dbar * denominatorKernelBound (ε n) dbar) := by field_simp _ ≤ 4 * (Dbar * denominatorKernelBound ε0 dbar) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hK hDbar) (by norm_num) · filter_upwards with n have hpos : ∀ k, 0 < p n k := fun k => lt_of_lt_of_le (hε n).1 ((hfeas n).floor k).1 rw [hBern n, FiniteDesign.E_const_mul] rw [treatNumerator_mean_zero (E n) (p n) (hp0 n) (hp1 n) hpos] simp
CausalSmith.Experimentation.BipartiteMinimaxDesign.treatNumerator_scaled_boundedInProb · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/NumeratorMoment.lean:388
theorem ctrlNumerator_scaled_boundedInProb

The √(card Ox)-scaled control-arm numerator is bounded in probability (uniformly tight).

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
hp0 :
∀ n k, 0 ≤ p n k
hp1 :
∀ n k, p n k ≤ 1
ε B :
ℕ → ℝ
dbar Dbar :
hBern :
∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)
hbdd :
∀ n, BoundedOutcomes (E n)
hdeg :
∀ n, BoundedOutcomeDegree (E n) dbar
hdep :
∀ n, BoundedOverlapDependency (E n) Dbar
hfeas :
∀ n, FeasibleDesign (ε n) (B n) (p n)
:
∀ n, EpsilonAdmissible (ε n)
hεfloor :
∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n
BoundedInProb D (fun n z => (sqrt (card (Ox n)))⁻¹ * ctrlNumerator (E n) (p n) z)
Proof (Lean source)
lemma ctrlNumerator_scaled_boundedInProb (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (hp0 : ∀ n k, 0 ≤ p n k) (hp1 : ∀ n k, p n k ≤ 1) (ε B : ℕ → ℝ) (dbar Dbar : ℝ) (hBern : ∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)) (hbdd : ∀ n, BoundedOutcomes (E n)) (hdeg : ∀ n, BoundedOutcomeDegree (E n) dbar) (hdep : ∀ n, BoundedOverlapDependency (E n) Dbar) (hfeas : ∀ n, FeasibleDesign (ε n) (B n) (p n)) (hε : ∀ n, EpsilonAdmissible (ε n)) (hεfloor : ∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n) : BoundedInProb D (fun n z => (sqrt (card (Ox n)))⁻¹ * ctrlNumerator (E n) (p n) z) := by classical rcases hεfloor with ⟨ε0, hε0, hfloor⟩ apply FiniteDesign.boundedInProb_of_var_bound D _ (V := 4 * (Dbar * denominatorKernelBound ε0 dbar)) (c := 0) · filter_upwards [hfloor] with n hε0le have hlt : ∀ k, p n k < 1 := fun k => by linarith [(hfeas n).floor k |>.2, (hε n).1] have hDbar : 0 ≤ Dbar := (hdep n).1.le have hK0 : 0 ≤ denominatorKernelBound ε0 dbar := denominatorKernelBound_nonneg hε0 rcases Nat.eq_zero_or_pos (card (Ox n)) with hcard | hcard · rw [hBern n, FiniteDesign.Var_const_mul] simp [hcard, mul_nonneg hDbar hK0] · have hcardR : 0 < (card (Ox n) : ℝ) := by exact_mod_cast hcard have hvar := ctrlNumerator_var_le (E n) (ε n) (B n) dbar Dbar (hε n).1 (hε n).2 (hbdd n) (hdeg n) (hdep n) (p n) (hp0 n) (hp1 n) (hfeas n) have hK := denominatorKernelBound_le_of_floor (dbar := dbar) hε0 hε0le (hε n) rw [hBern n, FiniteDesign.Var_const_mul] calc (sqrt (card (Ox n)))⁻¹ ^ 2 * (bernoulliDesign (p n) (hp0 n) (hp1 n)).Var (fun z => ctrlNumerator (E n) (p n) z) = (card (Ox n) : ℝ)⁻¹ * (bernoulliDesign (p n) (hp0 n) (hp1 n)).Var (fun z => ctrlNumerator (E n) (p n) z) := by congr 1 rw [inv_pow, Real.sq_sqrt (by positivity)] _ ≤ (card (Ox n) : ℝ)⁻¹ * ((card (Ox n) : ℝ) * (4 * (Dbar * denominatorKernelBound (ε n) dbar))) := mul_le_mul_of_nonneg_left hvar (inv_nonneg.mpr hcardR.le) _ = 4 * (Dbar * denominatorKernelBound (ε n) dbar) := by field_simp _ ≤ 4 * (Dbar * denominatorKernelBound ε0 dbar) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hK hDbar) (by norm_num) · filter_upwards with n have hlt : ∀ k, p n k < 1 := fun k => by linarith [(hfeas n).floor k |>.2, (hε n).1] rw [hBern n, FiniteDesign.E_const_mul] rw [ctrlNumerator_mean_zero (E n) (p n) (hp0 n) (hp1 n) hlt] simp
CausalSmith.Experimentation.BipartiteMinimaxDesign.ctrlNumerator_scaled_boundedInProb · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/NumeratorMoment.lean:450
Helpers.RatioRemainder 3 declarations
theorem expT_mul_Yfun_eq

Neighborhood-SUTVA exposure identity (treated arm): T_i(z)·Y_i(z) = T_i(z)·Y_i^1, because on {T_i = 1} the treatment vector is all-treated on N_i, so Y_i(z) = Y_i^1 by interference.

Formal statement
z :
I → Bool
i :
O
E.expT z i * E.Yfun i z = E.expT z i * E.Y1 i
Proof (Lean source)
lemma expT_mul_Yfun_eq (E : BipartiteExperiment I O) (hBI : BipartiteInterference E) (z : I → Bool) (i : O) : E.expT z i * E.Yfun i z = E.expT z i * E.Y1 i := by by_cases hzero : E.expT z i = 0 · simp [hzero] · have hfac : ∀ k ∈ E.N i, (if z k then (1 : ℝ) else 0) ≠ 0 := by rw [BipartiteExperiment.expT] at hzero exact Finset.prod_ne_zero_iff.mp hzero have hall : ∀ k ∈ E.N i, z k = true := by intro k hk specialize hfac k hk split at hfac <;> simp_all have hy : E.Yfun i z = E.Yfun i (fun _ => true) := hBI i z (fun _ => true) hall rw [hy] rfl
CausalSmith.Experimentation.BipartiteMinimaxDesign.expT_mul_Yfun_eq · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/RatioRemainder.lean:30
theorem expC_mul_Yfun_eq

Neighborhood-SUTVA exposure identity (control arm): C_i(z)·Y_i(z) = C_i(z)·Y_i^0.

Formal statement
z :
I → Bool
i :
O
E.expC z i * E.Yfun i z = E.expC z i * E.Y0 i
Proof (Lean source)
lemma expC_mul_Yfun_eq (E : BipartiteExperiment I O) (hBI : BipartiteInterference E) (z : I → Bool) (i : O) : E.expC z i * E.Yfun i z = E.expC z i * E.Y0 i := by by_cases hzero : E.expC z i = 0 · simp [hzero] · have hfac : ∀ k ∈ E.N i, (if z k then (0 : ℝ) else 1) ≠ 0 := by rw [BipartiteExperiment.expC] at hzero exact Finset.prod_ne_zero_iff.mp hzero have hall : ∀ k ∈ E.N i, z k = false := by intro k hk specialize hfac k hk split at hfac <;> simp_all have hy : E.Yfun i z = E.Yfun i (fun _ => false) := hBI i z (fun _ => false) hall rw [hy] rfl
CausalSmith.Experimentation.BipartiteMinimaxDesign.expC_mul_Yfun_eq · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/RatioRemainder.lean:48
theorem hajek_remainder_capped_bound

Capped Hájek ratio-remainder bound. When both denominator sums are at least card O / 2 (so both Hájek arms are on their nonzero branch and card O / D_arm ≤ 2), the scaled Hájek-minus-linear-score remainder is bounded by the sum over arms of 2 · |G_arm/√(card O)| · |D_arm/card O − 1|.

Formal statement
p :
I → ℝ
z :
I → Bool
hpos :
∀ k, 0 < p k
hlt :
∀ k, p k < 1
hcard :
0 < Fintype.card O
hD1 :
(Fintype.card O : ℝ) / 2 ≤ ∑ i, E.expT z i / E.piT p i
hD0 :
(Fintype.card O : ℝ) / 2 ≤ ∑ i, E.expC z i / E.piC p i
|sqrt (Fintype.card O) * (E.hajekEstimator p z - E.tau)
- (sqrt (Fintype.card O))⁻¹ * ∑ i, E.linScore p z i|
≤ 2 * |(sqrt (Fintype.card O))⁻¹ * treatNumerator E p z| * |(Fintype.card O : ℝ)⁻¹ * (∑ i, E.expT z i / E.piT p i)
- 1|
+ 2 * |(sqrt (Fintype.card O))⁻¹ * ctrlNumerator E p z| * |(Fintype.card O : ℝ)⁻¹ * (∑ i, E.expC z i / E.piC p i)
- 1|
Proof (Lean source)
lemma hajek_remainder_capped_bound (E : BipartiteExperiment I O) (p : I → ℝ) (z : I → Bool) (hBI : BipartiteInterference E) (hpos : ∀ k, 0 < p k) (hlt : ∀ k, p k < 1) (hcard : 0 < Fintype.card O) (hD1 : (Fintype.card O : ℝ) / 2 ≤ ∑ i, E.expT z i / E.piT p i) (hD0 : (Fintype.card O : ℝ) / 2 ≤ ∑ i, E.expC z i / E.piC p i) : |sqrt (Fintype.card O) * (E.hajekEstimator p z - E.tau) - (sqrt (Fintype.card O))⁻¹ * ∑ i, E.linScore p z i| ≤ 2 * |(sqrt (Fintype.card O))⁻¹ * treatNumerator E p z| * |(Fintype.card O : ℝ)⁻¹ * (∑ i, E.expT z i / E.piT p i) - 1| + 2 * |(sqrt (Fintype.card O))⁻¹ * ctrlNumerator E p z| * |(Fintype.card O : ℝ)⁻¹ * (∑ i, E.expC z i / E.piC p i) - 1| := by let n : ℝ := Fintype.card O let sn : ℝ := sqrt (Fintype.card O) let D1 : ℝ := ∑ i, E.expT z i / E.piT p i let D0 : ℝ := ∑ i, E.expC z i / E.piC p i let A1 : ℝ := ∑ i, E.expT z i * E.Yfun i z / E.piT p i let A0 : ℝ := ∑ i, E.expC z i * E.Yfun i z / E.piC p i let G1 : ℝ := treatNumerator E p z let G0 : ℝ := ctrlNumerator E p z have hnpos : 0 < n := by dsimp [n] exact_mod_cast hcard have hn0 : n ≠ 0 := ne_of_gt hnpos have hsn_sq : sn ^ 2 = n := by dsimp [sn, n] rw [Real.sq_sqrt] positivity have hsnpos : 0 < sn := by dsimp [sn] rw [Real.sqrt_pos] exact_mod_cast hcard have hsn0 : sn ≠ 0 := ne_of_gt hsnpos have hD1pos : 0 < D1 := by apply lt_of_lt_of_le (show 0 < n / 2 by linarith) simpa [D1, n] using hD1 have hD0pos : 0 < D0 := by apply lt_of_lt_of_le (show 0 < n / 2 by linarith) simpa [D0, n] using hD0 have hD10 : D1 ≠ 0 := ne_of_gt hD1pos have hD00 : D0 ≠ 0 := ne_of_gt hD0pos have hcap1 : n / D1 ≤ 2 := by apply (div_le_iff₀ hD1pos).2 nlinarith [hD1] have hcap0 : n / D0 ≤ 2 := by apply (div_le_iff₀ hD0pos).2 nlinarith [hD0] have hA1 : A1 = ∑ i, E.expT z i * E.Y1 i / E.piT p i := by dsimp [A1] apply Finset.sum_congr rfl intro i hi rw [expT_mul_Yfun_eq E hBI z i] have hA0 : A0 = ∑ i, E.expC z i * E.Y0 i / E.piC p i := by dsimp [A0] apply Finset.sum_congr rfl intro i hi rw [expC_mul_Yfun_eq E hBI z i] have hcenter1 : A1 - E.mu1 * D1 = G1 := by change A1 - E.mu1 * D1 = G1 rw [hA1] change (∑ i, E.expT z i * E.Y1 i / E.piT p i) - E.mu1 * (∑ i, E.expT z i / E.piT p i) = treatNumerator E p z calc (∑ i, E.expT z i * E.Y1 i / E.piT p i) - E.mu1 * (∑ i, E.expT z i / E.piT p i) = (∑ i, E.expT z i * E.Y1 i / E.piT p i) - ∑ i, E.mu1 * (E.expT z i / E.piT p i) := by rw [Finset.mul_sum] _ = ∑ i, (E.expT z i * E.Y1 i / E.piT p i - E.mu1 * (E.expT z i / E.piT p i)) := by rw [Finset.sum_sub_distrib] _ = treatNumerator E p z := by unfold treatNumerator apply Finset.sum_congr rfl intro i hi ring have hcenter0 : A0 - E.mu0 * D0 = G0 := by change A0 - E.mu0 * D0 = G0 rw [hA0] change (∑ i, E.expC z i * E.Y0 i / E.piC p i) - E.mu0 * (∑ i, E.expC z i / E.piC p i) = ctrlNumerator E p z calc (∑ i, E.expC z i * E.Y0 i / E.piC p i) - E.mu0 * (∑ i, E.expC z i / E.piC p i) = (∑ i, E.expC z i * E.Y0 i / E.piC p i) - ∑ i, E.mu0 * (E.expC z i / E.piC p i) := by rw [Finset.mul_sum] _ = ∑ i, (E.expC z i * E.Y0 i / E.piC p i - E.mu0 * (E.expC z i / E.piC p i)) := by rw [Finset.sum_sub_distrib] _ = ctrlNumerator E p z := by unfold ctrlNumerator apply Finset.sum_congr rfl intro i hi ring have hsum1 : ∑ i, (E.Y1 i - E.mu1) = 0 := by have hn : (Fintype.card O : ℝ) ≠ 0 := by exact_mod_cast Nat.ne_of_gt hcard rw [Finset.sum_sub_distrib] simp only [Finset.sum_const_zero, Finset.sum_const, Finset.card_univ] unfold BipartiteExperiment.mu1 simp only [nsmul_eq_mul] calc (∑ i, E.Y1 i) - (Fintype.card O : ℝ) * ((Fintype.card O : ℝ)⁻¹ * ∑ i, E.Y1 i) = (∑ i, E.Y1 i) * (1 - (Fintype.card O : ℝ) * (Fintype.card O : ℝ)⁻¹) := by ring _ = 0 := by rw [mul_inv_cancel₀ hn]; ring have hsum0 : ∑ i, (E.Y0 i - E.mu0) = 0 := by have hn : (Fintype.card O : ℝ) ≠ 0 := by exact_mod_cast Nat.ne_of_gt hcard rw [Finset.sum_sub_distrib] simp only [Finset.sum_const_zero, Finset.sum_const, Finset.card_univ] unfold BipartiteExperiment.mu0 simp only [nsmul_eq_mul] calc (∑ i, E.Y0 i) - (Fintype.card O : ℝ) * ((Fintype.card O : ℝ)⁻¹ * ∑ i, E.Y0 i) = (∑ i, E.Y0 i) * (1 - (Fintype.card O : ℝ) * (Fintype.card O : ℝ)⁻¹) := by ring _ = 0 := by rw [mul_inv_cancel₀ hn]; ring have hscore : ∑ i, E.linScore p z i = G1 - G0 := by have htreated : ∑ i, (E.expT z i / E.piT p i - 1) * (E.Y1 i - E.mu1) = G1 := by change (∑ i, (E.expT z i / E.piT p i - 1) * (E.Y1 i - E.mu1)) = treatNumerator E p z calc ∑ i, (E.expT z i / E.piT p i - 1) * (E.Y1 i - E.mu1) = ∑ i, (E.expT z i / E.piT p i * (E.Y1 i - E.mu1) - (E.Y1 i - E.mu1)) := by apply Finset.sum_congr rfl intro i hi ring _ = treatNumerator E p z - ∑ i, (E.Y1 i - E.mu1) := by rw [Finset.sum_sub_distrib] rfl _ = treatNumerator E p z := by rw [hsum1, sub_zero] have hcontrol : ∑ i, (E.expC z i / E.piC p i - 1) * (E.Y0 i - E.mu0) = G0 := by change (∑ i, (E.expC z i / E.piC p i - 1) * (E.Y0 i - E.mu0)) = ctrlNumerator E p z calc ∑ i, (E.expC z i / E.piC p i - 1) * (E.Y0 i - E.mu0) = ∑ i, (E.expC z i / E.piC p i * (E.Y0 i - E.mu0) - (E.Y0 i - E.mu0)) := by apply Finset.sum_congr rfl intro i hi ring _ = ctrlNumerator E p z - ∑ i, (E.Y0 i - E.mu0) := by rw [Finset.sum_sub_distrib] rfl _ = ctrlNumerator E p z := by rw [hsum0, sub_zero] unfold BipartiteExperiment.linScore rw [Finset.sum_sub_distrib, htreated, hcontrol] have hhajek : E.hajekEstimator p z = A1 / D1 - A0 / D0 := by dsimp [BipartiteExperiment.hajekEstimator, BipartiteExperiment.hajekDenominators] simp [A1, A0, D1, D0, hD1pos, hD0pos] -- Each arm's capped remainder is the promoted general -- `ratio_remainder_capped_bound`, instantiated with the -- arm's numerator/denominator/target and the centered-numerator identity `Gₐ = Aₐ − μₐ·Dₐ`. have harm1 : |sn * (A1 / D1 - E.mu1) - sn⁻¹ * G1| ≤ 2 * |sn⁻¹ * G1| * |n⁻¹ * D1 - 1| := ratio_remainder_capped_bound hnpos hsn_sq hD1pos hcap1 hcenter1.symm have harm0 : |sn * (A0 / D0 - E.mu0) - sn⁻¹ * G0| ≤ 2 * |sn⁻¹ * G0| * |n⁻¹ * D0 - 1| := ratio_remainder_capped_bound hnpos hsn_sq hD0pos hcap0 hcenter0.symm have hmain : sn * (E.hajekEstimator p z - E.tau) - sn⁻¹ * ∑ i, E.linScore p z i = (sn * (A1 / D1 - E.mu1) - sn⁻¹ * G1) - (sn * (A0 / D0 - E.mu0) - sn⁻¹ * G0) := by rw [hhajek, BipartiteExperiment.tau, hscore] ring change |sn * (E.hajekEstimator p z - E.tau) - sn⁻¹ * ∑ i, E.linScore p z i| ≤ 2 * |sn⁻¹ * G1| * |n⁻¹ * D1 - 1| + 2 * |sn⁻¹ * G0| * |n⁻¹ * D0 - 1| rw [hmain] calc |(sn * (A1 / D1 - E.mu1) - sn⁻¹ * G1) - (sn * (A0 / D0 - E.mu0) - sn⁻¹ * G0)| ≤ |sn * (A1 / D1 - E.mu1) - sn⁻¹ * G1| + |sn * (A0 / D0 - E.mu0) - sn⁻¹ * G0| := by rw [sub_eq_add_neg] calc |(sn * (A1 / D1 - E.mu1) - sn⁻¹ * G1) + -(sn * (A0 / D0 - E.mu0) - sn⁻¹ * G0)| ≤ |sn * (A1 / D1 - E.mu1) - sn⁻¹ * G1| + |-(sn * (A0 / D0 - E.mu0) - sn⁻¹ * G0)| := abs_add_le _ _ _ = |sn * (A1 / D1 - E.mu1) - sn⁻¹ * G1| + |sn * (A0 / D0 - E.mu0) - sn⁻¹ * G0| := by rw [abs_neg] _ ≤ 2 * |sn⁻¹ * G1| * |n⁻¹ * D1 - 1| + 2 * |sn⁻¹ * G0| * |n⁻¹ * D0 - 1| := add_le_add harm1 harm0
CausalSmith.Experimentation.BipartiteMinimaxDesign.hajek_remainder_capped_bound · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/RatioRemainder.lean:65
Helpers.Surrogate 8 declarations
theorem average_le_prod_of_one_le Lemma average_le_prod_of_one_le in the paper ↗

For positive factors all at least one, their arithmetic average does not exceed their product.

Formal statement
S :
a :
I → ℝ
hS :
0 < S.card
ha :
∀ k ∈ S, 1 ≤ a k
(S.card : ℝ)⁻¹ * (∑ k ∈ S, a k) ≤ ∏ k ∈ S, a k
Proof (Lean source)
lemma average_le_prod_of_one_le (S : Finset I) (a : I → ℝ) (hS : 0 < S.card) (ha : ∀ k ∈ S, 1 ≤ a k) : (S.card : ℝ)⁻¹ * (∑ k ∈ S, a k) ≤ ∏ k ∈ S, a k := by classical have hsingle : ∀ k ∈ S, a k ≤ ∏ l ∈ S, a l := by intro k hk rw [Finset.prod_eq_mul_prod_diff_singleton_of_mem hk] have hprod : 1 ≤ ∏ l ∈ S \ {k}, a l := by have hcmp : (∏ l ∈ S \ {k}, (1 : ℝ)) ≤ ∏ l ∈ S \ {k}, a l := by refine Finset.prod_le_prod ?_ ?_ · intro l hl exact zero_le_one · intro l hl exact ha l (Finset.mem_sdiff.mp hl).1 simpa using hcmp have hak : 0 ≤ a k := le_trans zero_le_one (ha k hk) calc a k = a k * 1 := by ring _ ≤ a k * (∏ l ∈ S \ {k}, a l) := mul_le_mul_of_nonneg_left hprod hak have hsum : (∑ k ∈ S, a k) ≤ ∑ k ∈ S, (∏ l ∈ S, a l) := Finset.sum_le_sum (fun k hk => hsingle k hk) have hcard_nonneg : 0 ≤ (S.card : ℝ)⁻¹ := by positivity have hscaled := mul_le_mul_of_nonneg_left hsum hcard_nonneg calc (S.card : ℝ)⁻¹ * (∑ k ∈ S, a k) ≤ (S.card : ℝ)⁻¹ * (∑ k ∈ S, (∏ l ∈ S, a l)) := hscaled _ = (∏ l ∈ S, a l) := by have hcard_ne : (S.card : ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt hS) simp [hcard_ne]
CausalSmith.Experimentation.BipartiteMinimaxDesign.average_le_prod_of_one_le · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Surrogate.lean:29
theorem prod_le_const_mul_average Lemma prod_le_const_mul_average in the paper ↗

If removing any one nonnegative factor leaves a product bounded by a constant, the full product is bounded by that constant times the factors' average.

Formal statement
S :
a :
I → ℝ
K :
hS :
0 < S.card
ha0 :
∀ k ∈ S, 0 ≤ a k
hK :
∀ k ∈ S, ∏ l ∈ S \ {k}, a l ≤ K
∏ k ∈ S, a k ≤ K * ((S.card : ℝ)⁻¹ * (∑ k ∈ S, a k))
Proof (Lean source)
lemma prod_le_const_mul_average (S : Finset I) (a : I → ℝ) (K : ℝ) (hS : 0 < S.card) (ha0 : ∀ k ∈ S, 0 ≤ a k) (hK : ∀ k ∈ S, ∏ l ∈ S \ {k}, a l ≤ K) : ∏ k ∈ S, a k ≤ K * ((S.card : ℝ)⁻¹ * (∑ k ∈ S, a k)) := by classical have hpoint : ∀ k ∈ S, (∏ l ∈ S, a l) ≤ a k * K := by intro k hk rw [Finset.prod_eq_mul_prod_diff_singleton_of_mem hk] exact mul_le_mul_of_nonneg_left (hK k hk) (ha0 k hk) have hsum : (∑ k ∈ S, (∏ l ∈ S, a l)) ≤ ∑ k ∈ S, a k * K := Finset.sum_le_sum (fun k hk => hpoint k hk) have hcard_ne : (S.card : ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt hS) have hcard_nonneg : 0 ≤ (S.card : ℝ)⁻¹ := by positivity have hscaled := mul_le_mul_of_nonneg_left hsum hcard_nonneg calc ∏ k ∈ S, a k = (S.card : ℝ)⁻¹ * (∑ k ∈ S, (∏ l ∈ S, a l)) := by simp [hcard_ne] _ ≤ (S.card : ℝ)⁻¹ * (∑ k ∈ S, a k * K) := hscaled _ = K * ((S.card : ℝ)⁻¹ * (∑ k ∈ S, a k)) := by rw [← Finset.sum_mul] ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.prod_le_const_mul_average · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Surrogate.lean:61
theorem prod_sdiff_le_inv_pow_card_sub_one Lemma prod_sdiff_le_inv_pow_card_sub_one in the paper ↗

If every propensity is at least the design floor, the product of reciprocals after omitting one member of a set is bounded by the floor raised to minus the set size plus one.

Formal statement
S :
a :
I → ℝ
ε :
ha0 :
∀ k ∈ S, 0 ≤ a k
haε :
∀ k ∈ S, a k ≤ ε⁻¹
k :
I
hk :
k ∈ S
∏ l ∈ S \ {k}, a l ≤ ε⁻¹ ^ (S.card - 1)
Proof (Lean source)
lemma prod_sdiff_le_inv_pow_card_sub_one (S : Finset I) (a : I → ℝ) (ε : ℝ) (ha0 : ∀ k ∈ S, 0 ≤ a k) (haε : ∀ k ∈ S, a k ≤ ε⁻¹) {k : I} (hk : k ∈ S) : ∏ l ∈ S \ {k}, a l ≤ ε⁻¹ ^ (S.card - 1) := by classical have hcmp : (∏ l ∈ S \ {k}, a l) ≤ ∏ l ∈ S \ {k}, ε⁻¹ := by refine Finset.prod_le_prod ?_ ?_ · intro l hl exact ha0 l (Finset.mem_sdiff.mp hl).1 · intro l hl exact haε l (Finset.mem_sdiff.mp hl).1 calc ∏ l ∈ S \ {k}, a l ≤ ∏ l ∈ S \ {k}, ε⁻¹ := hcmp _ = ε⁻¹ ^ (S.card - 1) := by rw [Finset.prod_const] congr 1 rw [Finset.card_sdiff_of_subset] · simp · simpa using (Finset.singleton_subset_iff.mpr hk)
CausalSmith.Experimentation.BipartiteMinimaxDesign.prod_sdiff_le_inv_pow_card_sub_one · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Surrogate.lean:85
theorem inv_pow_card_sub_one_le_certificate Lemma inv_pow_card_sub_one_le_certificate in the paper ↗

For a nonempty set whose size is at most the degree bound, the reciprocal-power bound is no larger than the stated degree-based certificate.

Formal statement
ε dbar :
S :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hS :
0 < S.card
hSle :
(S.card : ℝ) ≤ dbar
ε⁻¹ ^ (S.card - 1) ≤ max 1 (ε ^ (-(dbar - 1)))
Proof (Lean source)
lemma inv_pow_card_sub_one_le_certificate (ε dbar : ℝ) (S : Finset I) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hS : 0 < S.card) (hSle : (S.card : ℝ) ≤ dbar) : ε⁻¹ ^ (S.card - 1) ≤ max 1 (ε ^ (-(dbar - 1))) := by have hεle1 : ε ≤ 1 := by nlinarith have hcast : ((S.card - 1 : ℕ) : ℝ) = (S.card : ℝ) - 1 := Nat.cast_pred hS have hbase : ε⁻¹ ^ (S.card - 1) = ε ^ (-(((S.card - 1 : ℕ) : ℝ))) := by rw [Real.rpow_neg_eq_inv_rpow, Real.rpow_natCast] rw [hbase] have hexp : -(dbar - 1) ≤ -(((S.card - 1 : ℕ) : ℝ)) := by rw [hcast] linarith have hpow : ε ^ (-(((S.card - 1 : ℕ) : ℝ))) ≤ ε ^ (-(dbar - 1)) := Real.rpow_le_rpow_of_exponent_ge hε0 hεle1 hexp exact hpow.trans (le_max_right _ _)
CausalSmith.Experimentation.BipartiteMinimaxDesign.inv_pow_card_sub_one_le_certificate · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Surrogate.lean:107
theorem surrogateObjective_eq_pairAverage Lemma surrogateObjective_eq_pairAverage in the paper ↗

The surrogate objective equals the average, over outcome pairs sharing an intervention, of the reciprocal treatment and control probabilities.

Formal statement
q :
I → ℝ
E.surrogateObjective q
= ∑ i : O, ∑ j : O, ∑ k ∈ E.shared i j, (Fintype.card O : ℝ)⁻¹ * (((E.shared i j).card : ℝ)⁻¹ * ((q k)⁻¹ + (1 - q k)⁻¹))
Proof (Lean source)
lemma surrogateObjective_eq_pairAverage (E : BipartiteExperiment I O) (q : I → ℝ) : E.surrogateObjective q = ∑ i : O, ∑ j : O, ∑ k ∈ E.shared i j, (Fintype.card O : ℝ)⁻¹ * (((E.shared i j).card : ℝ)⁻¹ * ((q k)⁻¹ + (1 - q k)⁻¹)) := by classical unfold BipartiteExperiment.surrogateObjective BipartiteExperiment.hWeight simp_rw [Finset.mul_sum, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ trans ∑ k : I, if k ∈ E.shared i j then (Fintype.card O : ℝ)⁻¹ * (((E.shared i j).card : ℝ)⁻¹ * ((q k)⁻¹ + (1 - q k)⁻¹)) else 0 · apply Finset.sum_congr rfl intro k _ by_cases hk : k ∈ E.shared i j <;> simp [hk] ring · simpa using (Finset.sum_ite_mem (s := (Finset.univ : Finset I)) (t := E.shared i j) (f := fun k => (Fintype.card O : ℝ)⁻¹ * (((E.shared i j).card : ℝ)⁻¹ * ((q k)⁻¹ + (1 - q k)⁻¹))))
CausalSmith.Experimentation.BipartiteMinimaxDesign.surrogateObjective_eq_pairAverage · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Surrogate.lean:125
theorem varEnvelope_div_four_eq_pairSum Lemma varEnvelope_div_four_eq_pairSum in the paper ↗

One quarter of the variance envelope equals the sum over outcome pairs of their normalized envelope kernels.

Formal statement
q :
I → ℝ
E.varEnvelope q / 4
= ∑ i : O, ∑ j : O, (Fintype.card O : ℝ)⁻¹ * (E.r1 q i j + E.r0 q i j + 2 * E.r10 i j)
Proof (Lean source)
lemma varEnvelope_div_four_eq_pairSum (E : BipartiteExperiment I O) (q : I → ℝ) : E.varEnvelope q / 4 = ∑ i : O, ∑ j : O, (Fintype.card O : ℝ)⁻¹ * (E.r1 q i j + E.r0 q i j + 2 * E.r10 i j) := by unfold BipartiteExperiment.varEnvelope rw [div_eq_mul_inv] calc (4 * (Fintype.card O : ℝ)⁻¹ * ∑ i : O, ∑ j : O, (E.r1 q i j + E.r0 q i j + 2 * E.r10 i j)) * 4⁻¹ = (Fintype.card O : ℝ)⁻¹ * ∑ i : O, ∑ j : O, (E.r1 q i j + E.r0 q i j + 2 * E.r10 i j) := by ring _ = ∑ i : O, ∑ j : O, (Fintype.card O : ℝ)⁻¹ * (E.r1 q i j + E.r0 q i j + 2 * E.r10 i j) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i _ rw [Finset.mul_sum]
CausalSmith.Experimentation.BipartiteMinimaxDesign.varEnvelope_div_four_eq_pairSum · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Surrogate.lean:153
theorem pairAverage_le_envelopeKernel

For any feasible design, the average reciprocal propensity over a pair's shared interventions is no larger than that pair's envelope kernel.

Formal statement
ε B :
hε0 :
0 < ε
q :
I → ℝ
hq :
i j :
O
((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, ((q k)⁻¹ + (1 - q k)⁻¹))
≤ E.r1 q i j + E.r0 q i j + 2 * E.r10 i j
Proof (Lean source)
lemma pairAverage_le_envelopeKernel (E : BipartiteExperiment I O) (ε B : ℝ) (hε0 : 0 < ε) (q : I → ℝ) (hq : FeasibleDesign ε B q) (i j : O) : ((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, ((q k)⁻¹ + (1 - q k)⁻¹)) ≤ E.r1 q i j + E.r0 q i j + 2 * E.r10 i j := by classical by_cases hS : 0 < (E.shared i j).card · have ha : ∀ k ∈ E.shared i j, 1 ≤ (q k)⁻¹ := by intro k _ have hqpos : 0 < q k := lt_of_lt_of_le hε0 (hq.floor k).1 exact (one_le_inv₀ hqpos).mpr (hq.prob k).2 have hb : ∀ k ∈ E.shared i j, 1 ≤ (1 - q k)⁻¹ := by intro k _ have hq_lt_one : q k < 1 := by linarith [(hq.floor k).2, hε0] have hpos : 0 < 1 - q k := sub_pos.mpr hq_lt_one have hle : 1 - q k ≤ 1 := by linarith [(hq.prob k).1] exact (one_le_inv₀ hpos).mpr hle have hA := average_le_prod_of_one_le (E.shared i j) (fun k => (q k)⁻¹) hS ha have hB := average_le_prod_of_one_le (E.shared i j) (fun k => (1 - q k)⁻¹) hS hb unfold BipartiteExperiment.r1 BipartiteExperiment.r0 BipartiteExperiment.r10 rw [if_pos hS, if_pos hS, if_pos hS] have hsumsplit : ((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, ((q k)⁻¹ + (1 - q k)⁻¹)) = ((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, (q k)⁻¹) + ((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, (1 - q k)⁻¹) := by rw [Finset.sum_add_distrib] ring rw [hsumsplit] linarith · have hEmpty : E.shared i j = ∅ := Finset.card_eq_zero.mp (Nat.eq_zero_of_not_pos hS) simp [BipartiteExperiment.r1, BipartiteExperiment.r0, BipartiteExperiment.r10, hEmpty]
CausalSmith.Experimentation.BipartiteMinimaxDesign.pairAverage_le_envelopeKernel · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Surrogate.lean:173
theorem envelopeKernel_le_certificate_pairAverage

Under the degree and floor conditions, each envelope kernel is bounded by a degree-based certificate times the shared-intervention reciprocal average.

Formal statement
ε B dbar :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hdeg :
q :
I → ℝ
hq :
i j :
O
E.r1 q i j + E.r0 q i j + 2 * E.r10 i j
max 1 (ε ^ (-(dbar - 1))) * (((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, ((q k)⁻¹ + (1 - q k)⁻¹)))
Proof (Lean source)
lemma envelopeKernel_le_certificate_pairAverage (E : BipartiteExperiment I O) (ε B dbar : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hdeg : BoundedOutcomeDegree E dbar) (q : I → ℝ) (hq : FeasibleDesign ε B q) (i j : O) : E.r1 q i j + E.r0 q i j + 2 * E.r10 i j ≤ max 1 (ε ^ (-(dbar - 1))) * (((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, ((q k)⁻¹ + (1 - q k)⁻¹))) := by classical let C : ℝ := max 1 (ε ^ (-(dbar - 1))) by_cases hS : 0 < (E.shared i j).card · have hSle : ((E.shared i j).card : ℝ) ≤ dbar := by have hnat : (E.shared i j).card ≤ (E.N i).card := Finset.card_le_card Finset.inter_subset_left have hreal : ((E.shared i j).card : ℝ) ≤ ((E.N i).card : ℝ) := by exact_mod_cast hnat exact hreal.trans (hdeg.2 i) have hcert := inv_pow_card_sub_one_le_certificate ε dbar (E.shared i j) hε0 hε2 hS hSle have ha0 : ∀ k ∈ E.shared i j, 0 ≤ (q k)⁻¹ := by intro k _ exact inv_nonneg.mpr (hq.prob k).1 have hb0 : ∀ k ∈ E.shared i j, 0 ≤ (1 - q k)⁻¹ := by intro k _ have hnonneg : 0 ≤ 1 - q k := by linarith [(hq.prob k).2] exact inv_nonneg.mpr hnonneg have haε : ∀ k ∈ E.shared i j, (q k)⁻¹ ≤ ε⁻¹ := by intro k _ have hqpos : 0 < q k := lt_of_lt_of_le hε0 (hq.floor k).1 exact (inv_le_inv₀ hqpos hε0).mpr (hq.floor k).1 have hbε : ∀ k ∈ E.shared i j, (1 - q k)⁻¹ ≤ ε⁻¹ := by intro k _ have hq_lt_one : q k < 1 := by linarith [(hq.floor k).2, hε0] have hpos : 0 < 1 - q k := sub_pos.mpr hq_lt_one have hfloor : ε ≤ 1 - q k := by linarith [(hq.floor k).2] exact (inv_le_inv₀ hpos hε0).mpr hfloor have hKa : ∀ k ∈ E.shared i j, ∏ l ∈ E.shared i j \ {k}, (q l)⁻¹ ≤ C := by intro k hk exact (prod_sdiff_le_inv_pow_card_sub_one (E.shared i j) (fun l => (q l)⁻¹) ε ha0 haε hk).trans hcert have hKb : ∀ k ∈ E.shared i j, ∏ l ∈ E.shared i j \ {k}, (1 - q l)⁻¹ ≤ C := by intro k hk exact (prod_sdiff_le_inv_pow_card_sub_one (E.shared i j) (fun l => (1 - q l)⁻¹) ε hb0 hbε hk).trans hcert have hA := prod_le_const_mul_average (E.shared i j) (fun k => (q k)⁻¹) C hS ha0 hKa have hB := prod_le_const_mul_average (E.shared i j) (fun k => (1 - q k)⁻¹) C hS hb0 hKb unfold BipartiteExperiment.r1 BipartiteExperiment.r0 BipartiteExperiment.r10 rw [if_pos hS, if_pos hS, if_pos hS] have hsumsplit : ((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, ((q k)⁻¹ + (1 - q k)⁻¹)) = ((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, (q k)⁻¹) + ((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, (1 - q k)⁻¹) := by rw [Finset.sum_add_distrib] ring rw [hsumsplit] linarith · have hEmpty : E.shared i j = ∅ := Finset.card_eq_zero.mp (Nat.eq_zero_of_not_pos hS) simp [BipartiteExperiment.r1, BipartiteExperiment.r0, BipartiteExperiment.r10, hEmpty]
CausalSmith.Experimentation.BipartiteMinimaxDesign.envelopeKernel_le_certificate_pairAverage · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/Helpers/Surrogate.lean:208
TConvexDesign 19 declarations The original envelope is singular at the coordinate hyperplanes p_k = 0 and p_k = 1.

Smooth envelope extension

The original envelope is singular at the coordinate hyperplanes p_k = 0 and p_k = 1. The cutoff reciprocal recipC (agrees with x⁻¹ on the feasible box, globally ) was promoted to Causalean.Mathlib.Analysis.SmoothReciprocal (recipC, recipC_eq_inv, recipC_contDiff, opened via Causalean.Mathlib).

def r1Ext

Extends the treated-overlap kernel to all propensity vectors by replacing reciprocal probabilities with a smooth cutoff reciprocal; it agrees with the original kernel away from zero.

Definition (Lean source)
noncomputable def r1Ext (ε : ℝ) (p : I → ℝ) (i j : O) : ℝ := if 0 < (E.shared i j).card then (∏ k ∈ E.shared i j, recipC ε (p k)) - 1 else 0
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r1Ext · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:261
def r0Ext

Extends the control-overlap kernel to all propensity vectors by smoothly regularizing reciprocal control probabilities; it agrees with the original kernel away from one.

Definition (Lean source)
noncomputable def r0Ext (ε : ℝ) (p : I → ℝ) (i j : O) : ℝ := if 0 < (E.shared i j).card then (∏ k ∈ E.shared i j, recipC ε (1 - p k)) - 1 else 0
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r0Ext · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:265
def varEnvelopeExt

Defines a globally smooth extension of the variance envelope by combining the regularized treated and control overlap kernels.

Definition (Lean source)
noncomputable def varEnvelopeExt (ε : ℝ) (p : I → ℝ) : ℝ := 4 * (Fintype.card O : ℝ)⁻¹ * ∑ i, ∑ j, (E.r1Ext ε p i j + E.r0Ext ε p i j + 2 * E.r10 i j)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.varEnvelopeExt · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:269
theorem r1Ext_eq_r1_of_box

When every treatment probability is at least half the cutoff, the regularized treated-overlap kernel equals the original treated kernel.

Formal statement
ε :
:
0 < ε
p :
I → ℝ
hp :
∀ k, ε / 2 ≤ p k
i j :
O
E.r1Ext ε p i j = E.r1 p i j
Proof (Lean source)
lemma r1Ext_eq_r1_of_box {ε : ℝ} (hε : 0 < ε) {p : I → ℝ} (hp : ∀ k, ε / 2 ≤ p k) (i j : O) : E.r1Ext ε p i j = E.r1 p i j := by unfold r1Ext BipartiteExperiment.r1 by_cases hij : 0 < (E.shared i j).card · simp [hij] calc ∏ k ∈ E.shared i j, recipC ε (p k) = ∏ k ∈ E.shared i j, (p k)⁻¹ := by exact Finset.prod_congr rfl (by intro k _hk; exact recipC_eq_inv hε (hp k)) _ = (∏ k ∈ E.shared i j, p k)⁻¹ := by rw [Finset.prod_inv_distrib] · simp [hij]
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r1Ext_eq_r1_of_box · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:274
theorem r0Ext_eq_r0_of_box

When every control probability is at least half the cutoff, the regularized control-overlap kernel equals the original control kernel.

Formal statement
ε :
:
0 < ε
p :
I → ℝ
hp :
∀ k, ε / 2 ≤ 1 - p k
i j :
O
E.r0Ext ε p i j = E.r0 p i j
Proof (Lean source)
lemma r0Ext_eq_r0_of_box {ε : ℝ} (hε : 0 < ε) {p : I → ℝ} (hp : ∀ k, ε / 2 ≤ 1 - p k) (i j : O) : E.r0Ext ε p i j = E.r0 p i j := by unfold r0Ext BipartiteExperiment.r0 by_cases hij : 0 < (E.shared i j).card · simp [hij] calc ∏ k ∈ E.shared i j, recipC ε (1 - p k) = ∏ k ∈ E.shared i j, (1 - p k)⁻¹ := by exact Finset.prod_congr rfl (by intro k _hk; exact recipC_eq_inv hε (hp k)) _ = (∏ k ∈ E.shared i j, (1 - p k))⁻¹ := by rw [Finset.prod_inv_distrib] · simp [hij]
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r0Ext_eq_r0_of_box · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:288
theorem varEnvelopeExt_eq_varEnvelope_of_box

On the interior propensity box, the smooth extended variance envelope equals the original variance envelope.

Formal statement
ε :
:
0 < ε
p :
I → ℝ
hplo :
∀ k, ε / 2 ≤ p k
hphi :
∀ k, ε / 2 ≤ 1 - p k
E.varEnvelopeExt ε p = E.varEnvelope p
Proof (Lean source)
lemma varEnvelopeExt_eq_varEnvelope_of_box {ε : ℝ} (hε : 0 < ε) {p : I → ℝ} (hplo : ∀ k, ε / 2 ≤ p k) (hphi : ∀ k, ε / 2 ≤ 1 - p k) : E.varEnvelopeExt ε p = E.varEnvelope p := by unfold varEnvelopeExt BipartiteExperiment.varEnvelope apply congrArg (fun z : ℝ => 4 * (Fintype.card O : ℝ)⁻¹ * z) refine Finset.sum_congr rfl ?_ intro i _hi refine Finset.sum_congr rfl ?_ intro j _hj rw [E.r1Ext_eq_r1_of_box hε hplo i j, E.r0Ext_eq_r0_of_box hε hphi i j]
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.varEnvelopeExt_eq_varEnvelope_of_box · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:303
theorem r1Ext_contDiff

For a positive cutoff, the regularized treated-overlap kernel is continuously differentiable in all propensity coordinates.

Formal statement
ε :
:
0 < ε
i j :
O
ContDiff ℝ 1 (fun p : I → ℝ => E.r1Ext ε p i j)
Proof (Lean source)
@[fun_prop] lemma r1Ext_contDiff (ε : ℝ) (hε : 0 < ε) (i j : O) : ContDiff ℝ 1 (fun p : I → ℝ => E.r1Ext ε p i j) := by unfold r1Ext by_cases hij : 0 < (E.shared i j).card · simp [hij] fun_prop (disch := assumption) · simp [hij] fun_prop
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r1Ext_contDiff · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:315
theorem r0Ext_contDiff

For a positive cutoff, the regularized control-overlap kernel is continuously differentiable in all propensity coordinates.

Formal statement
ε :
:
0 < ε
i j :
O
ContDiff ℝ 1 (fun p : I → ℝ => E.r0Ext ε p i j)
Proof (Lean source)
@[fun_prop] lemma r0Ext_contDiff (ε : ℝ) (hε : 0 < ε) (i j : O) : ContDiff ℝ 1 (fun p : I → ℝ => E.r0Ext ε p i j) := by unfold r0Ext by_cases hij : 0 < (E.shared i j).card · simp [hij] fun_prop (disch := assumption) · simp [hij] fun_prop
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.r0Ext_contDiff · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:326
theorem varEnvelopeExt_contDiff

For a positive cutoff, the smooth extended variance envelope is continuously differentiable in the propensity vector.

Formal statement
ε :
:
0 < ε
ContDiff ℝ 1 (E.varEnvelopeExt ε)
Proof (Lean source)
lemma varEnvelopeExt_contDiff (ε : ℝ) (hε : 0 < ε) : ContDiff ℝ 1 (E.varEnvelopeExt ε) := by unfold varEnvelopeExt fun_prop (disch := assumption)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.varEnvelopeExt_contDiff · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:337
theorem varEnvelopeExt_differentiable

For a positive cutoff, the smooth extended variance envelope is differentiable in the propensity vector.

Formal statement
ε :
:
0 < ε
Differentiable ℝ (E.varEnvelopeExt ε)
Proof (Lean source)
lemma varEnvelopeExt_differentiable (ε : ℝ) (hε : 0 < ε) : Differentiable ℝ (E.varEnvelopeExt ε) := (E.varEnvelopeExt_contDiff ε hε).differentiable (by norm_num)
CausalSmith.Experimentation.BipartiteMinimaxDesign.BipartiteExperiment.varEnvelopeExt_differentiable · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:343
def designToEuclidean

Re-expresses a propensity vector indexed by interventions as a vector in finite-dimensional Euclidean space.

Definition (Lean source)
noncomputable def designToEuclidean (p : I → ℝ) : EuclideanSpace ℝ (Fin (card I)) := (EuclideanSpace.equiv (Fin (card I)) ℝ).symm (fun a => p ((equivFin I).symm a))
CausalSmith.Experimentation.BipartiteMinimaxDesign.designToEuclidean · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:352
def euclideanToDesign

Re-expresses a finite-dimensional Euclidean vector as a propensity vector indexed by interventions.

Definition (Lean source)
noncomputable def euclideanToDesign (x : EuclideanSpace ℝ (Fin (card I))) : I → ℝ := fun k => x ((equivFin I) k)
CausalSmith.Experimentation.BipartiteMinimaxDesign.euclideanToDesign · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:358
theorem euclideanToDesign_designToEuclidean

Converting a propensity vector to Euclidean coordinates and back recovers every original propensity.

Formal statement
p :
I → ℝ
k :
I
Proof (Lean source)
@[simp] lemma euclideanToDesign_designToEuclidean (p : I → ℝ) (k : I) : euclideanToDesign (I := I) (designToEuclidean p) k = p k := by simp [euclideanToDesign, designToEuclidean]
CausalSmith.Experimentation.BipartiteMinimaxDesign.euclideanToDesign_designToEuclidean · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:363
theorem designToEuclidean_euclideanToDesign

Converting a Euclidean vector to a propensity vector and back recovers the original Euclidean vector.

Formal statement
x :
Proof (Lean source)
CausalSmith.Experimentation.BipartiteMinimaxDesign.designToEuclidean_euclideanToDesign · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:369
def transportedEnvelopeExt

Expresses one quarter of the smooth extended variance envelope as a function on Euclidean coordinates.

Definition (Lean source)
noncomputable def transportedEnvelopeExt (E : BipartiteExperiment I O) (ε : ℝ) (x : EuclideanSpace ℝ (Fin (card I))) : ℝ := E.varEnvelopeExt ε (euclideanToDesign (I := I) x) / 4
CausalSmith.Experimentation.BipartiteMinimaxDesign.transportedEnvelopeExt · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:377
theorem transportedEnvelopeExt_differentiable

For a positive cutoff, the Euclidean-coordinate version of the smooth extended envelope is differentiable.

Formal statement
ε :
:
0 < ε
Proof (Lean source)
lemma transportedEnvelopeExt_differentiable (E : BipartiteExperiment I O) (ε : ℝ) (hε : 0 < ε) : Differentiable ℝ (transportedEnvelopeExt (I := I) E ε) := by unfold transportedEnvelopeExt have hobj : Differentiable ℝ (E.varEnvelopeExt ε) := E.varEnvelopeExt_differentiable ε hε have hcoord : Differentiable ℝ (fun x : EuclideanSpace ℝ (Fin (card I)) => euclideanToDesign (I := I) x) := by unfold euclideanToDesign fun_prop have hcomp : Differentiable ℝ (fun x : EuclideanSpace ℝ (Fin (card I)) => E.varEnvelopeExt ε (euclideanToDesign (I := I) x)) := by simpa [Function.comp_def] using hobj.comp hcoord simpa [div_eq_mul_inv] using hcomp.mul_const ((4 : ℝ)⁻¹)
CausalSmith.Experimentation.BipartiteMinimaxDesign.transportedEnvelopeExt_differentiable · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:383
theorem deriv_varEnvelope_div_four_coord_line

Coordinate-line derivative of the normalized envelope: the partial derivative of V_env/4 in coordinate k at a feasible p is exactly the gradient score envelopeGrad p k. Made public (was private) so the EnvelopeLineC2Data discharge in Helpers/EnvelopeCalculus can assemble the directional derivative along e_b - e_a from the two coordinate partials.

Formal statement
ε B :
:
0 < ε
p :
I → ℝ
hp :
p ∈ feasibleSet (I := I) ε B
k :
I
deriv (fun t : ℝ => E.varEnvelope (fun l => p l + (if l = k then t else 0)) / 4) 0
= E.envelopeGrad p k
Proof (Lean source)
lemma deriv_varEnvelope_div_four_coord_line (E : BipartiteExperiment I O) (ε B : ℝ) (hε : 0 < ε) {p : I → ℝ} (hp : p ∈ feasibleSet (I := I) ε B) (k : I) : deriv (fun t : ℝ => E.varEnvelope (fun l => p l + (if l = k then t else 0)) / 4) 0 = E.envelopeGrad p k := by classical have hpk : p k ≠ 0 := by have hfloor := (show FeasibleDesign ε B p from hp).floor k exact ne_of_gt (lt_of_lt_of_le hε hfloor.1) have h1pk : 1 - p k ≠ 0 := by have hfloor := (show FeasibleDesign ε B p from hp).floor k exact ne_of_gt (by linarith [hfloor.2, hε]) unfold BipartiteExperiment.varEnvelope BipartiteExperiment.envelopeGrad have hsum : deriv (fun t : ℝ => ∑ i, ∑ j, (E.r1 (fun l => p l + (if l = k then t else 0)) i j + E.r0 (fun l => p l + (if l = k then t else 0)) i j + 2 * E.r10 i j)) 0 = ∑ i, ∑ j, (if k ∈ E.shared i j then - (∏ l ∈ E.shared i j, (p l)⁻¹) * (p k)⁻¹ + (∏ l ∈ E.shared i j, (1 - p l)⁻¹) * (1 - p k)⁻¹ else 0) := by rw [deriv_fun_sum] · apply Finset.sum_congr rfl intro i _hi rw [deriv_fun_sum] · apply Finset.sum_congr rfl intro j _hj have hterm : (fun t : ℝ => E.r1 (fun l => p l + (if l = k then t else 0)) i j + E.r0 (fun l => p l + (if l = k then t else 0)) i j + 2 * E.r10 i j) = (fun t : ℝ => E.r1 (fun l => p l + (if l = k then t else 0)) i j) + (fun t : ℝ => E.r0 (fun l => p l + (if l = k then t else 0)) i j) + (fun _t : ℝ => 2 * E.r10 i j) := by rfl rw [hterm] rw [deriv_add] · rw [deriv_add] · rw [deriv_const] rw [deriv_r1_coord_line E p k hpk i j, deriv_r0_coord_line E p k h1pk i j] by_cases hk : k ∈ E.shared i j <;> simp [hk] · exact differentiableAt_r1_coord_line E p k hpk i j · exact differentiableAt_r0_coord_line E p k h1pk i j · exact (differentiableAt_r1_coord_line E p k hpk i j).add (differentiableAt_r0_coord_line E p k h1pk i j) · exact differentiableAt_const (2 * E.r10 i j) · intro j _hj exact ((differentiableAt_r1_coord_line E p k hpk i j).add (differentiableAt_r0_coord_line E p k h1pk i j)).add (differentiableAt_const (2 * E.r10 i j)) · intro i _hi exact DifferentiableAt.fun_sum fun j _hj => ((differentiableAt_r1_coord_line E p k hpk i j).add (differentiableAt_r0_coord_line E p k h1pk i j)).add (differentiableAt_const (2 * E.r10 i j)) rw [deriv_div_const] rw [deriv_const_mul] · rw [hsum] ring · exact DifferentiableAt.fun_sum fun i _hi => DifferentiableAt.fun_sum fun j _hj => ((differentiableAt_r1_coord_line E p k hpk i j).add (differentiableAt_r0_coord_line E p k h1pk i j)).add (differentiableAt_const (2 * E.r10 i j))
CausalSmith.Experimentation.BipartiteMinimaxDesign.deriv_varEnvelope_div_four_coord_line · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:663
theorem envelopeGrad_eq_gradient_varEnvelopeExt Lemma lemma:envelopeGrad-eq-gradient-varEnvelopeExt in the paper ↗

At every feasible design, the Euclidean gradient of the transported smooth envelope equals the stated envelope gradient in each intervention coordinate.

Formal statement
ε B :
:
0 < ε
p :
I → ℝ
hp :
p ∈ feasibleSet (I := I) ε B
k :
I
= E.envelopeGrad p k
Proof (Lean source)
lemma envelopeGrad_eq_gradient_varEnvelopeExt (E : BipartiteExperiment I O) (ε B : ℝ) (hε : 0 < ε) {p : I → ℝ} (hp : p ∈ feasibleSet (I := I) ε B) (k : I) : (gradient (transportedEnvelopeExt (I := I) E ε) (designToEuclidean p)) ((equivFin I) k) = E.envelopeGrad p k := by classical have hcoord := gradient_coord_eq_deriv (transportedEnvelopeExt (I := I) E ε) (designToEuclidean p) ((equivFin I) k) ((transportedEnvelopeExt_differentiable (I := I) E ε hε).differentiableAt) rw [hcoord] have hline : (fun t : ℝ => transportedEnvelopeExt (I := I) E ε (designToEuclidean p + t • single ((equivFin I) k) (1 : ℝ))) =ᶠ[𝓝 (0 : ℝ)] fun t : ℝ => E.varEnvelope (fun l => p l + (if l = k then t else 0)) / 4 := by have hsmall : ∀ᶠ t in 𝓝 (0 : ℝ), t ∈ Ioo (-(ε / 2)) (ε / 2) := Ioo_mem_nhds (by linarith [hε]) (by linarith [hε]) filter_upwards [hsmall] with t ht unfold transportedEnvelopeExt have hdesign : euclideanToDesign (I := I) (designToEuclidean p + t • single ((equivFin I) k) (1 : ℝ)) = fun l => p l + (if l = k then t else 0) := by funext l simp [euclideanToDesign, designToEuclidean] rw [hdesign] congr 1 apply E.varEnvelopeExt_eq_varEnvelope_of_box hε · intro l by_cases h : l = k · have hfloor := (show FeasibleDesign ε B p from hp).floor l have hfloor_k : ε ≤ p k ∧ p k ≤ 1 - ε := by simpa [h] using hfloor simp [h] linarith [hfloor_k.1, ht.1] · have hfloor := (show FeasibleDesign ε B p from hp).floor l simp [h] linarith [hfloor.1, hε] · intro l by_cases h : l = k · have hfloor := (show FeasibleDesign ε B p from hp).floor l have hfloor_k : ε ≤ p k ∧ p k ≤ 1 - ε := by simpa [h] using hfloor simp [h] linarith [hfloor_k.2, ht.2] · have hfloor := (show FeasibleDesign ε B p from hp).floor l simp [h] linarith [hfloor.2, hε] rw [hline.deriv_eq] exact deriv_varEnvelope_div_four_coord_line E ε B hε hp k
CausalSmith.Experimentation.BipartiteMinimaxDesign.envelopeGrad_eq_gradient_varEnvelopeExt · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:744
theorem convex_design Theorem 3 in the paper ↗

Convex design. For a feasible budget B ∈ [mε, m(1−ε)], the feasible set P_{n,B,ε} is nonempty, compact and convex, the envelope V_env is convex on it, and a minimizer exists. The multiplier/KKT certificate is kept separate because it needs a general finite-dimensional normal-cone KKT substrate theorem that is not currently available in Mathlib/Causalean.

Formal statement
ε B :
:
0 < ε
hε2 :
ε < 1 / 2
hBlo :
(Fintype.card I : ℝ) * ε ≤ B
hBhi :
B ≤ (Fintype.card I : ℝ) * (1 - ε)
(feasibleSet (I := I) ε B).Nonempty ∧
IsCompact (feasibleSet (I := I) ε B) ∧
Convex ℝ (feasibleSet (I := I) ε B) ∧
ConvexOn ℝ (feasibleSet (I := I) ε B) E.varEnvelope ∧
(∃ pstar ∈ feasibleSet (I := I) ε B, ∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope pstar ≤ E.varEnvelope q) ∧
(∀ pstar ∈ feasibleSet (I := I) ε B, (∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope pstar ≤ E.varEnvelope q) → ∃ (lam : ℝ) (νp νm : I → ℝ), (∀ k, 0 ≤ νp k) ∧ (∀ k, 0 ≤ νm k) ∧ (∀ k, E.envelopeGrad pstar k = lam - νp k + νm k) ∧ (∀ k, νp k * (pstar k - (1 - ε)) = 0) ∧ (∀ k, νm k * (ε - pstar k) = 0))
Proof (Lean source)
theorem convex_design (E : BipartiteExperiment I O) (ε B : ℝ) (hε : 0 < ε) (hε2 : ε < 1 / 2) (hBlo : (Fintype.card I : ℝ) * ε ≤ B) (hBhi : B ≤ (Fintype.card I : ℝ) * (1 - ε)) : (feasibleSet (I := I) ε B).Nonempty ∧ IsCompact (feasibleSet (I := I) ε B) ∧ Convex ℝ (feasibleSet (I := I) ε B) ∧ ConvexOn ℝ (feasibleSet (I := I) ε B) E.varEnvelope ∧ (∃ pstar ∈ feasibleSet (I := I) ε B, ∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope pstar ≤ E.varEnvelope q) ∧ (∀ pstar ∈ feasibleSet (I := I) ε B, (∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope pstar ≤ E.varEnvelope q) → ∃ (lam : ℝ) (νp νm : I → ℝ), -- @realizes lambda_n(carrier `lam : ℝ`, the budget multiplier introduced by this existential) -- @realizes nu_{k,n}^+(carrier `νp : I → ℝ`, the upper-box multiplier introduced here) -- @realizes nu_{k,n}^-(carrier `νm : I → ℝ`, the lower-box multiplier introduced here) (∀ k, 0 ≤ νp k) ∧ -- @realizes nu_{k,n}^+(range clause pinning the space [0,∞) of ν_k^+) (∀ k, 0 ≤ νm k) ∧ -- @realizes nu_{k,n}^-(range clause pinning the space [0,∞) of ν_k^-) (∀ k, E.envelopeGrad pstar k = lam - νp k + νm k) ∧ (∀ k, νp k * (pstar k - (1 - ε)) = 0) ∧ (∀ k, νm k * (ε - pstar k) = 0)) := by classical have hne : (feasibleSet (I := I) ε B).Nonempty := feasibleSet_nonempty (I := I) ε B hε hε2 hBlo hBhi have hcompact : IsCompact (feasibleSet (I := I) ε B) := feasibleSet_compact (I := I) ε B have hconv : Convex ℝ (feasibleSet (I := I) ε B) := feasibleSet_convex (I := I) ε B have hconvEnv : ConvexOn ℝ (feasibleSet (I := I) ε B) E.varEnvelope := by let P : Set (I → ℝ) := feasibleSet (I := I) ε B have hterm : ∀ i j : O, ConvexOn ℝ P (fun p : I → ℝ => E.r1 p i j + E.r0 p i j + 2 * E.r10 i j) := by intro i j have hr1 : ConvexOn ℝ P (fun p : I → ℝ => E.r1 p i j) := by unfold BipartiteExperiment.r1 by_cases hij : 0 < (E.shared i j).card · have hraw := prod_inv_convexOn_feasible (I := I) ε B hε (E.shared i j) have h2 : ConvexOn ℝ (feasibleSet (I := I) ε B) (fun p : I → ℝ => (∏ k ∈ E.shared i j, p k)⁻¹ + (-1 : ℝ)) := hraw.add_const (-1) simpa [P, hij, sub_eq_add_neg] using h2 · simpa [P, hij] using (convexOn_const (0 : ℝ) hconv : ConvexOn ℝ (feasibleSet (I := I) ε B) (fun _ : I → ℝ => (0 : ℝ))) have hr0 : ConvexOn ℝ P (fun p : I → ℝ => E.r0 p i j) := by unfold BipartiteExperiment.r0 by_cases hij : 0 < (E.shared i j).card · have hraw := prod_one_sub_inv_convexOn_feasible (I := I) ε B hε (E.shared i j) have h2 : ConvexOn ℝ (feasibleSet (I := I) ε B) (fun p : I → ℝ => (∏ k ∈ E.shared i j, (1 - p k))⁻¹ + (-1 : ℝ)) := hraw.add_const (-1) simpa [P, hij, sub_eq_add_neg] using h2 · simpa [P, hij] using (convexOn_const (0 : ℝ) hconv : ConvexOn ℝ (feasibleSet (I := I) ε B) (fun _ : I → ℝ => (0 : ℝ))) exact (hr1.add hr0).add (convexOn_const (2 * E.r10 i j) hconv) have hsum_j : ∀ i : O, ConvexOn ℝ P (fun p : I → ℝ => ∑ j ∈ (Finset.univ : Finset O), (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j)) := by intro i exact convexOn_finset_sum' (I := I) P hconv (Finset.univ : Finset O) (fun j p => E.r1 p i j + E.r0 p i j + 2 * E.r10 i j) (by intro j _; exact hterm i j) have hsum : ConvexOn ℝ P (fun p : I → ℝ => ∑ i ∈ (Finset.univ : Finset O), ∑ j ∈ (Finset.univ : Finset O), (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j)) := by exact convexOn_finset_sum' (I := I) P hconv (Finset.univ : Finset O) (fun i p => ∑ j ∈ (Finset.univ : Finset O), (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j)) (by intro i _; exact hsum_j i) have hscale_nonneg : 0 ≤ 4 * (Fintype.card O : ℝ)⁻¹ := by positivity have hscaled := hsum.smul hscale_nonneg have hfun : E.varEnvelope = fun p : I → ℝ => (4 * (Fintype.card O : ℝ)⁻¹) • ∑ i ∈ (Finset.univ : Finset O), ∑ j ∈ (Finset.univ : Finset O), (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j) := by funext p simp [BipartiteExperiment.varEnvelope, smul_eq_mul] rw [hfun] exact hscaled have hmin : ∃ pstar ∈ feasibleSet (I := I) ε B, ∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope pstar ≤ E.varEnvelope q := hcompact.exists_isMinOn hne (varEnvelope_continuousOn_feasible E ε B hε) have hcert : ∀ pstar ∈ feasibleSet (I := I) ε B, (∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope pstar ≤ E.varEnvelope q) → ∃ (lam : ℝ) (νp νm : I → ℝ), (∀ k, 0 ≤ νp k) ∧ (∀ k, 0 ≤ νm k) ∧ (∀ k, E.envelopeGrad pstar k = lam - νp k + νm k) ∧ (∀ k, νp k * (pstar k - (1 - ε)) = 0) ∧ (∀ k, νm k * (ε - pstar k) = 0) := by intro pstar hpstar hpmin let P := optDesignProblem (I := I) E ε B let loc := designToEuclidean pstar have hfeasLoc : P.FeasPoint loc := by simpa [P, loc] using (optFeasPoint_of_feasible (I := I) (O := O) (E := E) (ε := ε) (B := B) hpstar) have hloc : P.Local_Minimum loc := by refine ⟨hfeasLoc, ?_⟩ apply IsMinOn.localize rw [isMinOn_iff] intro y hy have hyfeas : euclideanToDesign (I := I) y ∈ feasibleSet (I := I) ε B := by simpa [P] using (feasible_of_optFeasPoint (I := I) (O := O) (E := E) (ε := ε) (B := B) hε hε2 y hy) have hobj_loc : P.objective loc = E.varEnvelope pstar / 4 := by have hlocdesign : euclideanToDesign (I := I) loc = pstar := by funext k simp [loc] simp [P, loc, optDesignProblem, transportedEnvelopeExt, hlocdesign] rw [E.varEnvelopeExt_eq_varEnvelope_of_box hε] · intro k have hk := (show FeasibleDesign ε B pstar from hpstar).floor k linarith [hk.1, hε] · intro k have hk := (show FeasibleDesign ε B pstar from hpstar).floor k linarith [hk.2, hε] have hobj_y : P.objective y = E.varEnvelope (euclideanToDesign (I := I) y) / 4 := by simp [P, optDesignProblem, transportedEnvelopeExt] rw [E.varEnvelopeExt_eq_varEnvelope_of_box hε] · intro k have hk := (show FeasibleDesign ε B (euclideanToDesign (I := I) y) from hyfeas).floor k linarith [hk.1, hε] · intro k have hk := (show FeasibleDesign ε B (euclideanToDesign (I := I) y) from hyfeas).floor k linarith [hk.2, hε] rw [hobj_loc, hobj_y] nlinarith [hpmin (euclideanToDesign (I := I) y) hyfeas] have hobjdiff : Differentiable ℝ P.objective := by simpa [P, optDesignProblem] using transportedEnvelopeExt_differentiable (I := I) E ε hε have hconte : ∀ i ∈ optEqIndexSet (Fintype.card I), ContDiffAt ℝ (1 : ℕ) (P.equality_constraints i) loc := by intro i hi simpa [P, optDesignProblem] using optBudgetConstraint_contDiffAt (n := Fintype.card I) B loc have hconti : ∀ j ∈ optBoxIndexSet (Fintype.card I), ContDiffAt ℝ (1 : ℕ) (P.inequality_constraints j) loc := by intro j hj simpa [P, optDesignProblem] using optBoxConstraint_contDiffAt (n := Fintype.card I) ε j loc have hLinearCQ : P.LinearCQ loc := by simpa [P] using optDesignProblem_LinearCQ (I := I) (O := O) E ε B loc have hdomain : P.domain = univ := by rfl obtain ⟨_hkfeas, lambda1, lambda2, hstat, hnonneg, hcomp⟩ := first_order_neccessary_LinearCQ P loc hloc hobjdiff hconte hconti hLinearCQ hdomain let lam : ℝ := lambda1 ⟨optBudgetIndex (Fintype.card I), by simp [optEqIndexSet]⟩ let νm : I → ℝ := fun k => lambda2 ⟨((equivFin I) k).val, optLower_mem_boxIndexSet (I := I) k⟩ let νp : I → ℝ := fun k => lambda2 ⟨Fintype.card I + ((equivFin I) k).val, optUpper_mem_boxIndexSet (I := I) k⟩ refine ⟨lam, νp, νm, ?_, ?_, ?_, ?_, ?_⟩ · intro k exact hnonneg ⟨Fintype.card I + ((equivFin I) k).val, optUpper_mem_boxIndexSet (I := I) k⟩ · intro k exact hnonneg ⟨((equivFin I) k).val, optLower_mem_boxIndexSet (I := I) k⟩ · intro k have hcoord : (gradient (fun m => P.Lagrange_function m lambda1 lambda2) loc) ((equivFin I) k) = 0 := by simpa using congrArg (fun v : EuclideanSpace ℝ (Fin (Fintype.card I)) => v ((equivFin I) k)) hstat have hobjAt : DifferentiableAt ℝ (transportedEnvelopeExt (I := I) E ε) loc := (transportedEnvelopeExt_differentiable (I := I) E ε hε).differentiableAt rw [optLagrange_gradient_coord (I := I) (O := O) E ε B loc hobjAt lambda1 lambda2 ((equivFin I) k)] at hcoord have hgrad := envelopeGrad_eq_gradient_varEnvelopeExt (I := I) (O := O) E ε B hε hpstar k simp [loc, lam, νp, νm] at hcoord rw [hgrad] at hcoord linarith · intro k have hc := hcomp ⟨Fintype.card I + ((equivFin I) k).val, optUpper_mem_boxIndexSet (I := I) k⟩ simp [P, loc, optDesignProblem, optBoxConstraint_upper, designToEuclidean, νp] at hc ⊢ rcases hc with hc | hc · left exact hc · right linarith [hc] · intro k have hc := hcomp ⟨((equivFin I) k).val, optLower_mem_boxIndexSet (I := I) k⟩ simp [P, loc, optDesignProblem, optBoxConstraint_lower, designToEuclidean, νm] at hc ⊢ rcases hc with hc | hc · left exact hc · right linarith [hc] exact ⟨hne, hcompact, hconv, hconvEnv, hmin, hcert⟩
CausalSmith.Experimentation.BipartiteMinimaxDesign.convex_design · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TConvexDesign.lean:1274
TDispersionCertificate 1 declarations
theorem dispersionCertificateUnbounded Theorem 8 in the paper ↗

For every admissible positivity floor, positive degree-dispersion constant, and nonvacuous weight-ratio constant, there is a sequence of finite bipartite experiments satisfying the positive-energy and first-order dispersion guards whose observable surrogate approximation ratio tends to infinity.

Formal statement
∀ (ε : ℝ) (cdisp : ℝ) (Cdisp : ℝ)
and
0 < cdisp
and
1 ≤ Cdisp
then
∃ (I O : ℕ → Type) (_ : ∀ n, Fintype (I n)) (_ : ∀ n, Fintype (O n)) (_ : ∀ n, DecidableEq (I n)) (E : ∀ n, BipartiteExperiment (I n) (O n)) (B : ℕ → ℝ),
(∀ n, BudgetAdmissible (I := I n) ε (B n)) ∧
(∀ n, 0 < ∑ k, ((E n).sdeg k : ℝ) ^ 2) ∧
(∀ᶠ n in atTop, ∀ k, ((E n).sdeg k : ℝ) ^ 2 ≤ cdisp * ∑ l, ((E n).sdeg l : ℝ) ^ 2) ∧
(∀ᶠ n in atTop, ∀ k l, 0 < (E n).hWeight l → (E n).hWeight k ≤ Cdisp * (E n).hWeight l) ∧
Tendsto (fun n ↦ approxRatio (E n) ε (B n)) atTop atTop
Proof (Lean source)
theorem dispersionCertificateUnbounded : ∀ (ε : ℝ) -- @realizes epsilon(carrier ℝ; range (0,1/2) pinned by EpsilonAdmissible below) (cdisp : ℝ) -- @realizes c_disp(carrier ℝ; positive range pinned below) (Cdisp : ℝ), -- @realizes C_disp(carrier ℝ; declared positive range pinned below) EpsilonAdmissible ε → -- @realizes epsilon(domain ε ∈ (0,1/2)) 0 < cdisp → -- @realizes c_disp(domain c_disp ∈ (0,∞)) 1 ≤ Cdisp → -- @realizes C_disp(nonvacuous theorem regime C_disp ∈ [1,∞), which pins the declared positive domain) ∃ (I O : ℕ → Type) (_ : ∀ n, Fintype (I n)) (_ : ∀ n, Fintype (O n)) (_ : ∀ n, DecidableEq (I n)) (E : ∀ n, BipartiteExperiment (I n) (O n)) (B : ℕ → ℝ), (∀ n, BudgetAdmissible (I := I n) ε (B n)) ∧ (∀ n, 0 < ∑ k, ((E n).sdeg k : ℝ) ^ 2) ∧ (∀ᶠ n in atTop, ∀ k, ((E n).sdeg k : ℝ) ^ 2 ≤ cdisp * ∑ l, ((E n).sdeg l : ℝ) ^ 2) ∧ (∀ᶠ n in atTop, ∀ k l, 0 < (E n).hWeight l → (E n).hWeight k ≤ Cdisp * (E n).hWeight l) ∧ Tendsto (fun n ↦ approxRatio (E n) ε (B n)) atTop atTop := by intro ε cdisp Cdisp hε hcdisp hCdisp refine ⟨DispersionIntervention, DispersionOutcome, fun n ↦ inferInstance, fun n ↦ inferInstance, fun n ↦ inferInstance, dispersionExperiment, fun n ↦ dispersionBudget n ε, fun n ↦ dispersionBudget_admissible n hε, fun n ↦ dispersionExperiment_degree_energy_pos n, ?_, ?_, dispersionApproxRatio_tendsto_atTop hε⟩ · have hdR : Tendsto (fun n ↦ (dispersionD n : ℝ)) atTop atTop := tendsto_natCast_atTop_atTop.comp dispersionD_tendsto_atTop have hcd : ∀ᶠ n in atTop, 1 ≤ cdisp * (dispersionD n : ℝ) := (hdR.const_mul_atTop hcdisp).eventually_ge_atTop 1 filter_upwards [hcd] with n hn intro k have henergy := dispersionExperiment_degree_energy n have hd1 : (1 : ℝ) ≤ dispersionD n := by exact_mod_cast dispersionD_pos n have ht : (dispersionT n : ℝ) ^ 2 = dispersionD n := by simp [dispersionD] push_cast at henergy cases k with | inl k => rw [dispersionExperiment_sdeg_core] rw [henergy] nlinarith [sq_nonneg (dispersionT n : ℝ)] | inr k => rw [dispersionExperiment_sdeg_filler] rw [ht, henergy] nlinarith [sq_nonneg (dispersionD n : ℝ)] · filter_upwards [] with n intro k l hl rw [dispersionExperiment_hWeight_eq n k l] have hk := dispersionExperiment_hWeight_pos n l nlinarith
CausalSmith.Experimentation.BipartiteMinimaxDesign.dispersionCertificateUnbounded · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TDispersionCertificate.lean:23
THeteroClt 11 declarations

The scaled Hájek-minus-linear-score remainder appearing in the first CLT conjunct.

Definition (Lean source)
noncomputable def heteroLinearizationRemainder (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (p : ∀ n, Ix n → ℝ) (n : ℕ) (z : Ix n → Bool) : ℝ := sqrt (card (Ox n)) * ((E n).hajekEstimator (p n) z - (E n).tau) - (sqrt (card (Ox n)))⁻¹ * ∑ i, (E n).linScore (p n) z i
CausalSmith.Experimentation.BipartiteMinimaxDesign.heteroLinearizationRemainder · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:33

Scaled Hájek ratio linearization conclusion.

Definition (Lean source)
def HeteroLinearization (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) : Prop := ∀ δ : ℝ, 0 < δ → Tendsto (fun n => (D n).Pr (fun z => δ ≤ |heteroLinearizationRemainder E p n z|)) atTop (𝓝 0)
CausalSmith.Experimentation.BipartiteMinimaxDesign.HeteroLinearization · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:43

Denominator/ratio-remainder tightness input. DISCHARGED (2026-07-09) by heteroDenominatorTightness_discharged: hetero_clt supplies it internally and does NOT assume it. It survives only as a named Prop, because the linearization lemma reads more clearly against it.

Definition (Lean source)
def HeteroDenominatorTightnessInput (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (ε : ℕ → ℝ) (dbar : ℝ) : Prop := ∃ productTail : ∀ n, (Ix n → Bool) → ℝ, (Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0) → ∀ δ : ℝ, 0 < δ → Tendsto (fun n => (D n).Pr (fun z => δ ≤ productTail n z)) atTop (𝓝 0)) ∧ ∀ᶠ n in atTop, ∀ z, 0 ≤ productTail n z ∧ |heteroLinearizationRemainder E p n z| ≤ productTail n z
CausalSmith.Experimentation.BipartiteMinimaxDesign.HeteroDenominatorTightnessInput · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:59
theorem hetero_linearization_of_denominator_tightness

The first CLT conjunct is derived from the denominator/ratio-remainder tightness gate plus the disclosed denominator-kernel regularity condition.

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
ε :
ℕ → ℝ
dbar :
hdenomKernel :
Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0)
hDenomTightness :
Proof (Lean source)
lemma hetero_linearization_of_denominator_tightness (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (ε : ℕ → ℝ) (dbar : ℝ) (hdenomKernel : Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0)) (hDenomTightness : HeteroDenominatorTightnessInput E D p ε dbar) : HeteroLinearization E D p := by rcases hDenomTightness with ⟨productTail, hProductTail, hDominates⟩ intro δ hδ exact squeeze_zero' (by filter_upwards with n exact (D n).Pr_nonneg _) (by filter_upwards [hDominates] with n hn exact (D n).Pr_mono _ _ (fun z hz => le_trans hz (hn z).2)) (hProductTail hdenomKernel δ hδ)
CausalSmith.Experimentation.BipartiteMinimaxDesign.hetero_linearization_of_denominator_tightness · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:85

Linear-score dependency-graph CLT input. DISCHARGED by hetero_linscore_clt_of_depgraph: hetero_clt supplies it internally and does NOT assume it. It survives only as a named Prop.

Definition (Lean source)
def HeteroLinScoreCLTInput (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) : Prop := ∀ s : ℝ, Tendsto (fun n => (D n).Pr (fun z => ((sqrt (card (Ox n)))⁻¹ * ∑ i, (E n).linScore (p n) z i) / sqrt ((E n).varScale (D n) (p n)) ≤ s)) atTop (𝓝 (stdNormalCdf s))
CausalSmith.Experimentation.BipartiteMinimaxDesign.HeteroLinScoreCLTInput · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:109
theorem linScore_sum_square_integral_eq_card_mul_varScale

The second moment of the raw linear-score sum is card(O) * varScale. The statement is used on the eventual nonempty outcome-array tail supplied by hcardO.

Formal statement
E :
BipartiteExperiment (Ix n) (Ox n)
D :
FiniteDesign (Ix n → Bool)
p :
Ix n → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hpos :
∀ k, 0 < p k
hlt :
∀ k, p k < 1
hBern :
hcard_pos :
0 < card (Ox n)
∫ z, (∑ i, E.linScore p z i) ^ 2 ∂D.toMeasure = (card (Ox n) : ℝ) * E.varScale D p
Proof (Lean source)
lemma linScore_sum_square_integral_eq_card_mul_varScale (E : BipartiteExperiment (Ix n) (Ox n)) (D : FiniteDesign (Ix n → Bool)) (p : Ix n → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hpos : ∀ k, 0 < p k) (hlt : ∀ k, p k < 1) (hBern : IndepHeteroBernoulli D p hp0 hp1) (hcard_pos : 0 < card (Ox n)) : ∫ z, (∑ i, E.linScore p z i) ^ 2 ∂D.toMeasure = (card (Ox n) : ℝ) * E.varScale D p := by classical rw [FiniteDesign.integral_toMeasure] have hsq : ∀ z, (∑ i, E.linScore p z i) ^ 2 = ∑ i : Ox n, ∑ j : Ox n, E.linScore p z i * E.linScore p z j := by intro z rw [pow_two, Finset.sum_mul] simp_rw [Finset.mul_sum] rw [D.E_congr hsq] rw [FiniteDesign.E_sum] simp_rw [FiniteDesign.E_sum] have hpair := varScale_pair_moments E D p hp0 hp1 hpos hlt hBern have hcard_ne : (card (Ox n) : ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt hcard_pos) calc (∑ x : Ox n, ∑ x_1 : Ox n, D.E fun z => E.linScore p z x * E.linScore p z x_1) = (card (Ox n) : ℝ) * ((card (Ox n) : ℝ)⁻¹ * ∑ i : Ox n, ∑ j : Ox n, D.E fun z => E.linScore p z i * E.linScore p z j) := by field_simp [hcard_ne] _ = (card (Ox n) : ℝ) * E.varScale D p := by rw [hpair]
CausalSmith.Experimentation.BipartiteMinimaxDesign.linScore_sum_square_integral_eq_card_mul_varScale · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:129
theorem hetero_linscore_clt_of_depgraph

The linear-score CDF CLT is discharged by the bounded-degree dependency-graph engine. The additional hεfloor regularity is only a uniform positivity floor: it turns the pointwise score bound into an eventual array-uniform summand bound.

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
hp0 :
∀ n k, 0 ≤ p n k
hp1 :
∀ n k, p n k ≤ 1
ε B :
ℕ → ℝ
dbar Dbar :
hcardO :
Tendsto (fun n => card (Ox n)) atTop atTop
hBern :
∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)
hbdd :
∀ n, BoundedOutcomes (E n)
hdeg :
∀ n, BoundedOutcomeDegree (E n) dbar
hdep :
∀ n, BoundedOverlapDependency (E n) Dbar
hfeas :
∀ n, FeasibleDesign (ε n) (B n) (p n)
:
∀ n, EpsilonAdmissible (ε n)
hεfloor :
∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n
hnd :
VarianceNondegenerate (fun n => (E n).varScale (D n) (p n))
Proof (Lean source)
lemma hetero_linscore_clt_of_depgraph (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (hp0 : ∀ n k, 0 ≤ p n k) (hp1 : ∀ n k, p n k ≤ 1) (ε B : ℕ → ℝ) (dbar Dbar : ℝ) (hcardO : Tendsto (fun n => card (Ox n)) atTop atTop) (hBern : ∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)) (hbdd : ∀ n, BoundedOutcomes (E n)) (hdeg : ∀ n, BoundedOutcomeDegree (E n) dbar) (hdep : ∀ n, BoundedOverlapDependency (E n) Dbar) (hfeas : ∀ n, FeasibleDesign (ε n) (B n) (p n)) (hε : ∀ n, EpsilonAdmissible (ε n)) (hεfloor : ∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n) (hnd : VarianceNondegenerate (fun n => (E n).varScale (D n) (p n))) : HeteroLinScoreCLTInput E D p := by classical intro s rcases hεfloor with ⟨ε0, hε0_pos, hε0_ev⟩ rcases eventually_atTop.1 hε0_ev with ⟨Nε, hNε⟩ have hε0_lt : ε0 < 1 / 2 := lt_of_le_of_lt (hNε Nε le_rfl) (hε Nε).2 have hε0 : EpsilonAdmissible ε0 := ⟨hε0_pos, hε0_lt⟩ let X : ∀ n, Ox n → (Ix n → Bool) → ℝ := fun n i z => (E n).linScore (p n) z i let μ : ∀ n, Measure (Ix n → Bool) := fun n => (D n).toMeasure let Dep : ∀ n, DepGraph (X n) (μ n) := fun n => linScoreDepGraph (E n) (D n) (p n) (hp0 n) (hp1 n) (hBern n) let v : ℕ → ℝ := fun n => ∫ z, (depSum (X n) z) ^ 2 ∂(μ n) let M : ℝ := 4 * (denominatorKernelBound ε0 dbar + 2) have hM : 0 ≤ M := by have hK : 0 ≤ denominatorKernelBound ε0 dbar := denominatorKernelBound_nonneg hε0_pos dsimp [M] nlinarith have hbound : ∀ᶠ n in atTop, ∀ i z, |X n i z| ≤ M := by filter_upwards [hε0_ev] with n hn i z have hfloor0 : PositivityFloor ε0 (p n) := by intro k constructor · exact hn.trans ((hfeas n).floor k).1 · linarith [((hfeas n).floor k).2, hn] exact linScore_abs_le_uniform_floor (E n) ε0 dbar hε0 (hbdd n) (hdeg n) (p n) (hfeas n).prob hfloor0 z i have hmean : ∀ n i, ∫ z, X n i z ∂(μ n) = 0 := by intro n i have hpos : ∀ k, 0 < p n k := by intro k exact lt_of_lt_of_le (hε n).1 ((hfeas n).floor k).1 have hlt : ∀ k, p n k < 1 := by intro k linarith [((hfeas n).floor k).2, (hε n).1] change ∫ z, (E n).linScore (p n) z i ∂(D n).toMeasure = 0 rw [FiniteDesign.integral_toMeasure] exact linScore_mean_zero (E n) (D n) (p n) (hp0 n) (hp1 n) hpos hlt (hBern n) i have hv : ∀ n, ∫ z, (depSum (X n) z) ^ 2 ∂(μ n) = v n := by intro n rfl rcases hnd with ⟨c, hc, hc_ev⟩ have hvc : ∀ᶠ n in atTop, c * (card (Ox n) : ℝ) ≤ v n := by filter_upwards [hc_ev, hcardO.eventually_ge_atTop 1] with n hvar hncard have hcard_pos : 0 < card (Ox n) := Nat.lt_of_lt_of_le Nat.zero_lt_one hncard have hpos : ∀ k, 0 < p n k := by intro k exact lt_of_lt_of_le (hε n).1 ((hfeas n).floor k).1 have hlt : ∀ k, p n k < 1 := by intro k linarith [((hfeas n).floor k).2, (hε n).1] have hv_eq : v n = (card (Ox n) : ℝ) * (E n).varScale (D n) (p n) := by change ∫ z, (∑ i, (E n).linScore (p n) z i) ^ 2 ∂(D n).toMeasure = (card (Ox n) : ℝ) * (E n).varScale (D n) (p n) exact linScore_sum_square_integral_eq_card_mul_varScale (E n) (D n) (p n) (hp0 n) (hp1 n) hpos hlt (hBern n) hcard_pos rw [hv_eq] have hmul := mul_le_mul_of_nonneg_left hvar (show 0 ≤ (card (Ox n) : ℝ) by positivity) nlinarith have hclt := bounded_degree_dependency_clt_eventually_bounded (μ := μ) (X := X) (Dep := Dep) (ceil Dbar + 1) (fun n i => by simpa [Dep] using linScoreDepGraph_degree_le (E n) (D n) (p n) (hp0 n) (hp1 n) (hBern n) (hdep n) i) M hM hbound hmean v hv c hc hvc hcardO s rw [show stdNormalCdf s = (gaussianReal 0 1).real (Iic s) from rfl] refine hclt.congr' ?_ filter_upwards [hc_ev, hcardO.eventually_ge_atTop 1] with n hvar hncard have hcard_pos_nat : 0 < card (Ox n) := Nat.lt_of_lt_of_le Nat.zero_lt_one hncard have hcard_pos : 0 < (card (Ox n) : ℝ) := by exact_mod_cast hcard_pos_nat have hvar_pos : 0 < (E n).varScale (D n) (p n) := lt_of_lt_of_le hc hvar have hpos : ∀ k, 0 < p n k := by intro k exact lt_of_lt_of_le (hε n).1 ((hfeas n).floor k).1 have hlt : ∀ k, p n k < 1 := by intro k linarith [((hfeas n).floor k).2, (hε n).1] have hv_eq : v n = (card (Ox n) : ℝ) * (E n).varScale (D n) (p n) := by change ∫ z, (∑ i, (E n).linScore (p n) z i) ^ 2 ∂(D n).toMeasure = (card (Ox n) : ℝ) * (E n).varScale (D n) (p n) exact linScore_sum_square_integral_eq_card_mul_varScale (E n) (D n) (p n) (hp0 n) (hp1 n) hpos hlt (hBern n) hcard_pos_nat have hWmeas : Measurable (fun z : Ix n → Bool => depSum (X n) z / sqrt (v n)) := by exact (measurable_sum _ fun i _ => (Dep n).meas i).div_const _ have hset : ({z : Ix n → Bool | ((sqrt (card (Ox n)))⁻¹ * ∑ i, (E n).linScore (p n) z i) / sqrt ((E n).varScale (D n) (p n)) ≤ s} : Set (Ix n → Bool)) = (fun z : Ix n → Bool => depSum (X n) z / sqrt (v n)) ⁻¹' Iic s := by ext z simp only [Set.mem_setOf_eq, Set.mem_preimage, Set.mem_Iic] rw [hv_eq, Real.sqrt_mul hcard_pos.le, div_eq_mul_inv, div_eq_mul_inv] dsimp [X, depSum] ring_nf rw [← FiniteDesign.toMeasure_real_setOf, hset, MeasureTheory.map_measureReal_apply hWmeas measurableSet_Iic]
CausalSmith.Experimentation.BipartiteMinimaxDesign.hetero_linscore_clt_of_depgraph · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:168
theorem hetero_studentized_slutsky

Studentized Slutsky/converging-together transfer for the heterogeneous Hájek CLT. The unstudentized linearization remainder vanishes in probability; the variance nondegeneracy floor makes the studentized remainder vanish in probability; the generic finite-design CDF converging-together helper then transfers the linear-score CLT to the studentized Hájek statistic.

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
hLinearization :
hLinScoreCLT :
hnd :
VarianceNondegenerate (fun n => (E n).varScale (D n) (p n))
∀ s : ℝ,
Tendsto (fun n => (D n).Pr (fun z => sqrt (card (Ox n)) * ((E n).hajekEstimator (p n) z - (E n).tau) / sqrt ((E n).varScale (D n) (p n)) ≤ s)) atTop (𝓝 (stdNormalCdf s))
Proof (Lean source)
lemma hetero_studentized_slutsky (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (hLinearization : HeteroLinearization E D p) (hLinScoreCLT : HeteroLinScoreCLTInput E D p) (hnd : VarianceNondegenerate (fun n => (E n).varScale (D n) (p n))) : ∀ s : ℝ, Tendsto (fun n => (D n).Pr (fun z => sqrt (card (Ox n)) * ((E n).hajekEstimator (p n) z - (E n).tau) / sqrt ((E n).varScale (D n) (p n)) ≤ s)) atTop (𝓝 (stdNormalCdf s)) := by classical let S : ∀ n, (Ix n → Bool) → ℝ := fun n z => sqrt (card (Ox n)) * ((E n).hajekEstimator (p n) z - (E n).tau) / sqrt ((E n).varScale (D n) (p n)) let T : ∀ n, (Ix n → Bool) → ℝ := fun n z => ((sqrt (card (Ox n)))⁻¹ * ∑ i, (E n).linScore (p n) z i) / sqrt ((E n).varScale (D n) (p n)) have hApprox : ∀ η : ℝ, 0 < η → Tendsto (fun n => (D n).Pr (fun z => η ≤ |S n z - T n z|)) atTop (𝓝 0) := by intro η hη rcases hnd with ⟨c, hc, hc_ev⟩ have hδpos : 0 < η * sqrt c := mul_pos hη (Real.sqrt_pos.mpr hc) refine squeeze_zero' (by filter_upwards with n exact (D n).Pr_nonneg _) ?_ (hLinearization (η * sqrt c) hδpos) filter_upwards [hc_ev] with n hn apply (D n).Pr_mono intro z hz set v : ℝ := (E n).varScale (D n) (p n) with hvdef have hvpos : 0 < v := lt_of_lt_of_le hc (by simpa [v] using hn) have hsvpos : 0 < sqrt v := Real.sqrt_pos.mpr hvpos have hsc_le : sqrt c ≤ sqrt v := Real.sqrt_le_sqrt (by simpa [v] using hn) have hdiff : S n z - T n z = heteroLinearizationRemainder E p n z / sqrt v := by simp [S, T, heteroLinearizationRemainder, v, div_eq_mul_inv] ring rw [hdiff, abs_div, abs_of_pos hsvpos] at hz have hmul : η * sqrt v ≤ |heteroLinearizationRemainder E p n z| := (le_div_iff₀ hsvpos).mp hz exact (mul_le_mul_of_nonneg_left hsc_le hη.le).trans hmul have hT : ∀ x : ℝ, Tendsto (fun n => (D n).Pr (fun z => T n z ≤ x)) atTop (𝓝 (stdNormalCdf x)) := by intro x simpa [T] using hLinScoreCLT x simpa [S] using finiteDesign_cdf_converging_together D S T stdNormalCdf hApprox hT continuous_stdNormalCdf
CausalSmith.Experimentation.BipartiteMinimaxDesign.hetero_studentized_slutsky · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:296
theorem remainder_tendstoInProb_zero

The scaled Hájek ratio remainder vanishes in probability. Under the design/feasibility regularity conditions and the vanishing denominator-kernel rate, the delta-method remainder √n·(τ̂_H − τ) − n^{-1/2}·∑ᵢ ηᵢ converges to zero in probability. This is the analytic core that discharges the disclosed denominator-tightness gate.

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
hp0 :
∀ n k, 0 ≤ p n k
hp1 :
∀ n k, p n k ≤ 1
ε B :
ℕ → ℝ
dbar Dbar :
hcardO :
Tendsto (fun n => card (Ox n)) atTop atTop
hBern :
∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)
hBI :
hbdd :
∀ n, BoundedOutcomes (E n)
hdeg :
∀ n, BoundedOutcomeDegree (E n) dbar
hdep :
∀ n, BoundedOverlapDependency (E n) Dbar
hfeas :
∀ n, FeasibleDesign (ε n) (B n) (p n)
:
∀ n, EpsilonAdmissible (ε n)
hεfloor :
∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n
hreg :
Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0)
TendstoInProb D (fun n z => heteroLinearizationRemainder E p n z) (fun _ => 0)
Proof (Lean source)
lemma remainder_tendstoInProb_zero (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (hp0 : ∀ n k, 0 ≤ p n k) (hp1 : ∀ n k, p n k ≤ 1) (ε B : ℕ → ℝ) (dbar Dbar : ℝ) (hcardO : Tendsto (fun n => card (Ox n)) atTop atTop) (hBern : ∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)) (hBI : ∀ n, BipartiteInterference (E n)) (hbdd : ∀ n, BoundedOutcomes (E n)) (hdeg : ∀ n, BoundedOutcomeDegree (E n) dbar) (hdep : ∀ n, BoundedOverlapDependency (E n) Dbar) (hfeas : ∀ n, FeasibleDesign (ε n) (B n) (p n)) (hε : ∀ n, EpsilonAdmissible (ε n)) (hεfloor : ∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n) (hreg : Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0)) : TendstoInProb D (fun n z => heteroLinearizationRemainder E p n z) (fun _ => 0) := by let R1 : ∀ n, (Ix n → Bool) → ℝ := fun n z => (sqrt (card (Ox n)))⁻¹ * treatNumerator (E n) (p n) z let R0 : ∀ n, (Ix n → Bool) → ℝ := fun n z => (sqrt (card (Ox n)))⁻¹ * ctrlNumerator (E n) (p n) z let D1 : ∀ n, (Ix n → Bool) → ℝ := fun n z => ∑ i, (E n).expT z i / (E n).piT (p n) i let D0 : ∀ n, (Ix n → Bool) → ℝ := fun n z => ∑ i, (E n).expC z i / (E n).piC (p n) i let Q1 : ∀ n, (Ix n → Bool) → ℝ := fun n z => (card (Ox n) : ℝ)⁻¹ * D1 n z - 1 let Q0 : ∀ n, (Ix n → Bool) → ℝ := fun n z => (card (Ox n) : ℝ)⁻¹ * D0 n z - 1 let RHS : ∀ n, (Ix n → Bool) → ℝ := fun n z => 2 * |R1 n z| * |Q1 n z| + 2 * |R0 n z| * |Q0 n z| have hR1 : BoundedInProb D R1 := by simpa [R1] using treatNumerator_scaled_boundedInProb E D p hp0 hp1 ε B dbar Dbar hBern hbdd hdeg hdep hfeas hε hεfloor have hR0 : BoundedInProb D R0 := by simpa [R0] using ctrlNumerator_scaled_boundedInProb E D p hp0 hp1 ε B dbar Dbar hBern hbdd hdeg hdep hfeas hε hεfloor have hQ1 : TendstoInProb D Q1 (fun _ => 0) := by simpa [Q1, D1] using treatDenominatorRatioCentered_tendstoInProb_zero E D p hp0 hp1 ε B dbar Dbar hcardO hBern hdeg hdep hfeas hε hreg have hQ0 : TendstoInProb D Q0 (fun _ => 0) := by simpa [Q0, D0] using ctrlDenominatorRatioCentered_tendstoInProb_zero E D p hp0 hp1 ε B dbar Dbar hcardO hBern hdeg hdep hfeas hε hreg have hT1 : TendstoInProb D (fun n z => Q1 n z * R1 n z) (fun _ => 0) := hQ1.mul_boundedInProb hR1 have hT0 : TendstoInProb D (fun n z => Q0 n z * R0 n z) (fun _ => 0) := hQ0.mul_boundedInProb hR0 have hRHS : TendstoInProb D RHS (fun _ => 0) := by have hst : RHS = (fun n (z : Ix n → Bool) => 2 * |Q1 n z * R1 n z| + 2 * |Q0 n z * R0 n z|) := by funext n z; simp only [RHS, abs_mul]; ring rw [hst] simpa using ((hT1.abs).const_mul 2).add ((hT0.abs).const_mul 2) have hRHS_nonneg : ∀ n z, 0 ≤ RHS n z := by intro n z dsimp [RHS] positivity intro δ hδ simp only [sub_zero] have hQ1half : Tendsto (fun n => (D n).Pr (fun z => (1 / 2 : ℝ) ≤ |Q1 n z|)) atTop (𝓝 0) := by simpa only [sub_zero] using hQ1 (1 / 2) (by norm_num) have hQ0half : Tendsto (fun n => (D n).Pr (fun z => (1 / 2 : ℝ) ≤ |Q0 n z|)) atTop (𝓝 0) := by simpa only [sub_zero] using hQ0 (1 / 2) (by norm_num) have hbad : Tendsto (fun n => (D n).Pr (fun z => (1 / 2 : ℝ) ≤ |Q1 n z| ∨ (1 / 2 : ℝ) ≤ |Q0 n z|)) atTop (𝓝 0) := by have hsum : Tendsto (fun n => (D n).Pr (fun z => (1 / 2 : ℝ) ≤ |Q1 n z|) + (D n).Pr (fun z => (1 / 2 : ℝ) ≤ |Q0 n z|)) atTop (𝓝 0) := by simpa using hQ1half.add hQ0half exact squeeze_zero (fun n => (D n).Pr_nonneg _) (fun n => (D n).Pr_or_le _ _) hsum have htail : Tendsto (fun n => (D n).Pr (fun z => δ ≤ RHS n z)) atTop (𝓝 0) := by have h := hRHS δ hδ simp only [sub_zero] at h have hEq : ∀ n, (fun z : Ix n → Bool => δ ≤ |RHS n z|) = (fun z : Ix n → Bool => δ ≤ RHS n z) := by intro n; funext z; rw [abs_of_nonneg (hRHS_nonneg n z)] simp only [hEq] at h exact h have hcard : ∀ᶠ n in atTop, 1 ≤ card (Ox n) := hcardO.eventually_ge_atTop 1 have hbound : ∀ᶠ n in atTop, (D n).Pr (fun z => δ ≤ |heteroLinearizationRemainder E p n z|) ≤ (D n).Pr (fun z => (1 / 2 : ℝ) ≤ |Q1 n z| ∨ (1 / 2 : ℝ) ≤ |Q0 n z|) + (D n).Pr (fun z => δ ≤ RHS n z) := by filter_upwards [hcard] with n hn refine le_trans ?_ ((D n).Pr_or_le _ _) apply (D n).Pr_mono intro z hz by_cases hden : (card (Ox n) : ℝ) / 2 ≤ D1 n z ∧ (card (Ox n) : ℝ) / 2 ≤ D0 n z · right have hcard_pos : 0 < card (Ox n) := Nat.lt_of_lt_of_le Nat.zero_lt_one hn have hpos : ∀ k, 0 < p n k := fun k => lt_of_lt_of_le (hε n).1 ((hfeas n).floor k).1 have hlt : ∀ k, p n k < 1 := fun k => by linarith [((hfeas n).floor k).2, (hε n).1] have hrem := hajek_remainder_capped_bound (E n) (p n) z (hBI n) hpos hlt hcard_pos hden.1 hden.2 have hrem' : |heteroLinearizationRemainder E p n z| ≤ RHS n z := by simpa [heteroLinearizationRemainder, RHS, R1, R0, Q1, Q0, D1, D0] using hrem exact hz.trans hrem' · left rw [not_and_or] at hden rcases hden with hD1 | hD0 · left push_neg at hD1 have hcard_pos : 0 < (card (Ox n) : ℝ) := by exact_mod_cast Nat.lt_of_lt_of_le Nat.zero_lt_one hn have hratio : (card (Ox n) : ℝ)⁻¹ * D1 n z < 1 / 2 := by have hstep := mul_lt_mul_of_pos_left hD1 (inv_pos.mpr hcard_pos) have heq : (card (Ox n) : ℝ)⁻¹ * ((card (Ox n) : ℝ) / 2) = 1 / 2 := by field_simp linarith [hstep, heq] have hq : Q1 n z < -(1 / 2 : ℝ) := by dsimp [Q1] linarith rw [abs_of_nonpos (by linarith [hq])] linarith · right push_neg at hD0 have hcard_pos : 0 < (card (Ox n) : ℝ) := by exact_mod_cast Nat.lt_of_lt_of_le Nat.zero_lt_one hn have hratio : (card (Ox n) : ℝ)⁻¹ * D0 n z < 1 / 2 := by have hstep := mul_lt_mul_of_pos_left hD0 (inv_pos.mpr hcard_pos) have heq : (card (Ox n) : ℝ)⁻¹ * ((card (Ox n) : ℝ) / 2) = 1 / 2 := by field_simp linarith [hstep, heq] have hq : Q0 n z < -(1 / 2 : ℝ) := by dsimp [Q0] linarith rw [abs_of_nonpos (by linarith [hq])] linarith exact squeeze_zero' (by filter_upwards with n exact (D n).Pr_nonneg _) hbound (by simpa using hbad.add htail)
CausalSmith.Experimentation.BipartiteMinimaxDesign.remainder_tendstoInProb_zero · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:355
theorem heteroDenominatorTightness_discharged

The disclosed denominator-tightness gate is discharged. Choosing the dominating product tail to be the remainder's own absolute value reduces HeteroDenominatorTightnessInput to remainder_tendstoInProb_zero.

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
hp0 :
∀ n k, 0 ≤ p n k
hp1 :
∀ n k, p n k ≤ 1
ε B :
ℕ → ℝ
dbar Dbar :
hcardO :
Tendsto (fun n => card (Ox n)) atTop atTop
hBern :
∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)
hBI :
hbdd :
∀ n, BoundedOutcomes (E n)
hdeg :
∀ n, BoundedOutcomeDegree (E n) dbar
hdep :
∀ n, BoundedOverlapDependency (E n) Dbar
hfeas :
∀ n, FeasibleDesign (ε n) (B n) (p n)
:
∀ n, EpsilonAdmissible (ε n)
hεfloor :
∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n
Proof (Lean source)
lemma heteroDenominatorTightness_discharged (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (hp0 : ∀ n k, 0 ≤ p n k) (hp1 : ∀ n k, p n k ≤ 1) (ε B : ℕ → ℝ) (dbar Dbar : ℝ) (hcardO : Tendsto (fun n => card (Ox n)) atTop atTop) (hBern : ∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)) (hBI : ∀ n, BipartiteInterference (E n)) (hbdd : ∀ n, BoundedOutcomes (E n)) (hdeg : ∀ n, BoundedOutcomeDegree (E n) dbar) (hdep : ∀ n, BoundedOverlapDependency (E n) Dbar) (hfeas : ∀ n, FeasibleDesign (ε n) (B n) (p n)) (hε : ∀ n, EpsilonAdmissible (ε n)) (hεfloor : ∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n) : HeteroDenominatorTightnessInput E D p ε dbar := by refine ⟨fun n z => |heteroLinearizationRemainder E p n z|, ?_, ?_⟩ · intro hreg δ hδ have h := remainder_tendstoInProb_zero E D p hp0 hp1 ε B dbar Dbar hcardO hBern hBI hbdd hdeg hdep hfeas hε hεfloor hreg δ hδ simpa only [sub_zero] using h · exact Filter.Eventually.of_forall (fun n z => ⟨abs_nonneg _, le_refl _⟩)
CausalSmith.Experimentation.BipartiteMinimaxDesign.heteroDenominatorTightness_discharged · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:505
theorem hetero_clt Theorem 4 in the paper ↗

Heterogeneous Hájek CLT. Along a sequence of feasible experiments whose design is the envelope-optimal design, √n{τ̂_H − τ_n} linearizes onto n^{-1/2} ∑_i η_i (the remainder vanishing in probability), and the studentized statistic converges in distribution to N(0,1) (in CDF form).

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
hp0 :
∀ n k, 0 ≤ p n k
hp1 :
∀ n k, p n k ≤ 1
ε B :
ℕ → ℝ
dbar Dbar :
hcardEq :
∀ᶠ n in atTop, card (Ox n) = n
@realizes n(the paper's stage index IS the outcome-population size: n = |O_n| = card (Ox n) on the eventual tail) @realizes O_n(carrier `Ox n`, the outcome-unit index set, whose cardinality is the paper's n)
hBern :
∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)
hBI :
hbdd :
∀ n, BoundedOutcomes (E n)
hdeg :
∀ n, BoundedOutcomeDegree (E n) dbar
hdep :
∀ n, BoundedOverlapDependency (E n) Dbar
hfeas :
∀ n, FeasibleDesign (ε n) (B n) (p n)
:
∀ n, EpsilonAdmissible (ε n)
hstar :
∀ n, p n = optimalDesign (E n) (ε n) (B n)
hεfloor :
∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n
hnd :
VarianceNondegenerate (fun n => (E n).varScale (D n) (p n))
(∀ s : ℝ, Tendsto (fun n => (D n).Pr (fun z => sqrt (card (Ox n)) * ((E n).hajekEstimator (p n) z - (E n).tau) / sqrt ((E n).varScale (D n) (p n)) ≤ s)) atTop (𝓝 (stdNormalCdf s)))
Proof (Lean source)
theorem hetero_clt (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (hp0 : ∀ n k, 0 ≤ p n k) (hp1 : ∀ n k, p n k ≤ 1) (ε B : ℕ → ℝ) (dbar Dbar : ℝ) (hcardEq : ∀ᶠ n in atTop, card (Ox n) = n) -- @realizes n(the paper's stage index IS the outcome-population size: n = |O_n| = card (Ox n) on the eventual tail) @realizes O_n(carrier `Ox n`, the outcome-unit index set, whose cardinality is the paper's n) (hBern : ∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)) (hBI : ∀ n, BipartiteInterference (E n)) (hbdd : ∀ n, BoundedOutcomes (E n)) (hdeg : ∀ n, BoundedOutcomeDegree (E n) dbar) (hdep : ∀ n, BoundedOverlapDependency (E n) Dbar) (hfeas : ∀ n, FeasibleDesign (ε n) (B n) (p n)) (hε : ∀ n, EpsilonAdmissible (ε n)) (hstar : ∀ n, p n = optimalDesign (E n) (ε n) (B n)) (hεfloor : ∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n) (hnd : VarianceNondegenerate (fun n => (E n).varScale (D n) (p n))) : HeteroLinearization E D p ∧ (∀ s : ℝ, Tendsto (fun n => (D n).Pr (fun z => sqrt (card (Ox n)) * ((E n).hajekEstimator (p n) z - (E n).tau) / sqrt ((E n).varScale (D n) (p n)) ≤ s)) atTop (𝓝 (stdNormalCdf s))) := by -- Derived (not assumed): `card (Ox n) = n` eventually forces `card (Ox n) → ∞`. have hcardO : Tendsto (fun n => card (Ox n)) atTop atTop := tendsto_id.congr' (hcardEq.mono fun n hn => hn.symm) -- Derived (not assumed): the uniform ε-floor bounds the denominator kernel by a -- constant `denominatorKernelBound ε0 dbar`, and `card (Ox n) → ∞` kills the ratio. have hdenomKernel : Tendsto (fun n => denominatorKernelBound (ε n) dbar / (card (Ox n) : ℝ)) atTop (𝓝 0) := by exact denominatorKernelBound_div_card_tendsto_zero (Ox := Ox) ε dbar hcardO hε hεfloor -- The ratio-remainder tightness is now DERIVED (formerly a disclosed substrate-gate hypothesis): -- the delta-method / product-tail `o_p` envelope for the Hájek ratio remainder is discharged by -- `heteroDenominatorTightness_discharged` from the same regularity conditions. have hDenomTightness : HeteroDenominatorTightnessInput E D p ε dbar := heteroDenominatorTightness_discharged E D p hp0 hp1 ε B dbar Dbar hcardO hBern hBI hbdd hdeg hdep hfeas hε hεfloor have hLinearization : HeteroLinearization E D p := hetero_linearization_of_denominator_tightness E D p ε dbar hdenomKernel hDenomTightness have hLinScoreCLT : HeteroLinScoreCLTInput E D p := hetero_linscore_clt_of_depgraph E D p hp0 hp1 ε B dbar Dbar hcardO hBern hbdd hdeg hdep hfeas hε hεfloor hnd refine ⟨?_, ?_⟩ · exact hLinearization · exact hetero_studentized_slutsky E D p hLinearization hLinScoreCLT hnd
CausalSmith.Experimentation.BipartiteMinimaxDesign.hetero_clt · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroClt.lean:532
THeteroEnvelope 11 declarations
theorem abs_scaled_univ_sum_le_one Lemma abs_scaled_univ_sum_le_one in the paper ↗

If every outcome-side quantity lies between minus one and one, its average also lies between minus one and one.

Formal statement
f :
O → ℝ
hf :
∀ i, |f i| ≤ 1
|(Fintype.card O : ℝ)⁻¹ * ∑ i, f i| ≤ 1
Proof (Lean source)
lemma abs_scaled_univ_sum_le_one (f : O → ℝ) (hf : ∀ i, |f i| ≤ 1) : |(Fintype.card O : ℝ)⁻¹ * ∑ i, f i| ≤ 1 := by classical by_cases hcard : (Fintype.card O : ℝ) = 0 · simp [hcard] · have hsum_abs : |∑ i : O, f i| ≤ ∑ i : O, |f i| := by exact Finset.abs_sum_le_sum_abs (s := univ) (f := f) have hsum_le : (∑ i : O, |f i|) ≤ ∑ i : O, (1 : ℝ) := by exact Finset.sum_le_sum (fun i _ => hf i) have hsum_card : (∑ i : O, (1 : ℝ)) = (Fintype.card O : ℝ) := by simp have hsum_bound : |∑ i : O, f i| ≤ (Fintype.card O : ℝ) := by calc |∑ i : O, f i| ≤ ∑ i : O, |f i| := hsum_abs _ ≤ ∑ i : O, (1 : ℝ) := hsum_le _ = (Fintype.card O : ℝ) := hsum_card have hscale_nonneg : 0 ≤ (Fintype.card O : ℝ)⁻¹ := by exact inv_nonneg.mpr (Nat.cast_nonneg (Fintype.card O)) have hmain : (Fintype.card O : ℝ)⁻¹ * |∑ i : O, f i| ≤ (Fintype.card O : ℝ)⁻¹ * (Fintype.card O : ℝ) := by exact mul_le_mul_of_nonneg_left hsum_bound hscale_nonneg rw [inv_mul_cancel₀ hcard] at hmain calc |(Fintype.card O : ℝ)⁻¹ * ∑ i : O, f i| = (Fintype.card O : ℝ)⁻¹ * |∑ i : O, f i| := by rw [abs_mul, abs_of_nonneg hscale_nonneg] _ ≤ 1 := hmain
CausalSmith.Experimentation.BipartiteMinimaxDesign.abs_scaled_univ_sum_le_one · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:30
theorem mu1_abs_le_one_of_bounded

Under outcomes bounded by one in absolute value, the treated potential-outcome mean is bounded by one in absolute value.

Formal statement
|E.mu1| ≤ 1
Proof (Lean source)
lemma mu1_abs_le_one_of_bounded (E : BipartiteExperiment I O) (hbdd : BoundedOutcomes E) : |E.mu1| ≤ 1 := by simpa [BipartiteExperiment.mu1] using abs_scaled_univ_sum_le_one (O := O) (fun i => E.Y1 i) (fun i => (hbdd i).1)
CausalSmith.Experimentation.BipartiteMinimaxDesign.mu1_abs_le_one_of_bounded · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:60
theorem mu0_abs_le_one_of_bounded

Under outcomes bounded by one in absolute value, the control potential-outcome mean is bounded by one in absolute value.

Formal statement
|E.mu0| ≤ 1
Proof (Lean source)
lemma mu0_abs_le_one_of_bounded (E : BipartiteExperiment I O) (hbdd : BoundedOutcomes E) : |E.mu0| ≤ 1 := by simpa [BipartiteExperiment.mu0] using abs_scaled_univ_sum_le_one (O := O) (fun i => E.Y0 i) (fun i => (hbdd i).2)
CausalSmith.Experimentation.BipartiteMinimaxDesign.mu0_abs_le_one_of_bounded · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:68
theorem centeredY1_abs_le_two

Under bounded outcomes, each treated potential outcome differs from its treated mean by at most two.

Formal statement
hbdd :
i :
O
|E.Y1 i - E.mu1| ≤ 2
Proof (Lean source)
lemma centeredY1_abs_le_two (E : BipartiteExperiment I O) (hbdd : BoundedOutcomes E) (i : O) : |E.Y1 i - E.mu1| ≤ 2 := by have hi := abs_le.mp (hbdd i).1 have hmu := abs_le.mp (mu1_abs_le_one_of_bounded E hbdd) have hleft : -(2 : ℝ) ≤ E.Y1 i - E.mu1 := by calc -(2 : ℝ) = (-1) - (1 : ℝ) := by ring _ ≤ E.Y1 i - E.mu1 := sub_le_sub hi.1 hmu.2 have hright : E.Y1 i - E.mu1 ≤ (2 : ℝ) := by calc E.Y1 i - E.mu1 ≤ (1 : ℝ) - (-1 : ℝ) := sub_le_sub hi.2 hmu.1 _ = (2 : ℝ) := by ring exact abs_le.mpr ⟨hleft, hright⟩
CausalSmith.Experimentation.BipartiteMinimaxDesign.centeredY1_abs_le_two · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:76
theorem centeredY0_abs_le_two

Under bounded outcomes, each control potential outcome differs from its control mean by at most two.

Formal statement
hbdd :
i :
O
|E.Y0 i - E.mu0| ≤ 2
Proof (Lean source)
lemma centeredY0_abs_le_two (E : BipartiteExperiment I O) (hbdd : BoundedOutcomes E) (i : O) : |E.Y0 i - E.mu0| ≤ 2 := by have hi := abs_le.mp (hbdd i).2 have hmu := abs_le.mp (mu0_abs_le_one_of_bounded E hbdd) have hleft : -(2 : ℝ) ≤ E.Y0 i - E.mu0 := by calc -(2 : ℝ) = (-1) - (1 : ℝ) := by ring _ ≤ E.Y0 i - E.mu0 := sub_le_sub hi.1 hmu.2 have hright : E.Y0 i - E.mu0 ≤ (2 : ℝ) := by calc E.Y0 i - E.mu0 ≤ (1 : ℝ) - (-1 : ℝ) := sub_le_sub hi.2 hmu.1 _ = (2 : ℝ) := by ring exact abs_le.mpr ⟨hleft, hright⟩
CausalSmith.Experimentation.BipartiteMinimaxDesign.centeredY0_abs_le_two · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:93

With strictly positive treatment probabilities no greater than one, every treated-overlap kernel is nonnegative.

Formal statement
p :
I → ℝ
hp1 :
∀ k, p k ≤ 1
hpos :
∀ k, 0 < p k
i j :
O
0 ≤ E.r1 p i j
Proof (Lean source)
lemma r1_nonneg (E : BipartiteExperiment I O) (p : I → ℝ) (hp1 : ∀ k, p k ≤ 1) (hpos : ∀ k, 0 < p k) (i j : O) : 0 ≤ E.r1 p i j := by classical unfold BipartiteExperiment.r1 by_cases hcard : 0 < (E.shared i j).card · rw [if_pos hcard] have hprod : (1 : ℝ) ≤ ∏ k ∈ E.shared i j, (p k)⁻¹ := by refine Finset.one_le_prod ?_ intro k _ exact (one_le_inv₀ (hpos k)).mpr (hp1 k) exact sub_nonneg.mpr hprod · rw [if_neg hcard]
CausalSmith.Experimentation.BipartiteMinimaxDesign.r1_nonneg · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:110

With control probabilities strictly positive and no greater than one, every control-overlap kernel is nonnegative.

Formal statement
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hlt :
∀ k, p k < 1
i j :
O
0 ≤ E.r0 p i j
Proof (Lean source)
lemma r0_nonneg (E : BipartiteExperiment I O) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hlt : ∀ k, p k < 1) (i j : O) : 0 ≤ E.r0 p i j := by classical unfold BipartiteExperiment.r0 by_cases hcard : 0 < (E.shared i j).card · rw [if_pos hcard] have hprod : (1 : ℝ) ≤ ∏ k ∈ E.shared i j, (1 - p k)⁻¹ := by refine Finset.one_le_prod ?_ intro k _ have hpos1 : 0 < 1 - p k := sub_pos.mpr (hlt k) have hle1 : 1 - p k ≤ 1 := by simpa using sub_le_self (1 : ℝ) (hp0 k) exact (one_le_inv₀ hpos1).mpr hle1 exact sub_nonneg.mpr hprod · rw [if_neg hcard]
CausalSmith.Experimentation.BipartiteMinimaxDesign.r0_nonneg · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:126

Every mixed treatment-control overlap kernel is nonnegative.

Formal statement
i j :
O
0 ≤ E.r10 i j
Proof (Lean source)
lemma r10_nonneg (E : BipartiteExperiment I O) (i j : O) : 0 ≤ E.r10 i j := by unfold BipartiteExperiment.r10 by_cases hcard : 0 < (E.shared i j).card · rw [if_pos hcard] exact zero_le_one · rw [if_neg hcard]
CausalSmith.Experimentation.BipartiteMinimaxDesign.r10_nonneg · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:145
theorem mul_centered_pair_le_four_mul_of_nonneg Lemma mul_centered_pair_le_four_mul_of_nonneg in the paper ↗

A nonnegative weight times two quantities each bounded in absolute value by two is at most four times that weight.

Formal statement
r a b :
hr :
0 ≤ r
ha :
|a| ≤ 2
hb :
|b| ≤ 2
r * a * b ≤ 4 * r
Proof (Lean source)
lemma mul_centered_pair_le_four_mul_of_nonneg (r a b : ℝ) (hr : 0 ≤ r) (ha : |a| ≤ 2) (hb : |b| ≤ 2) : r * a * b ≤ 4 * r := by have hab : a * b ≤ 4 := by calc a * b ≤ |a * b| := le_abs_self (a * b) _ = |a| * |b| := by rw [abs_mul] _ ≤ 2 * 2 := by exact mul_le_mul ha hb (abs_nonneg b) (by positivity) _ = 4 := by ring have hmul : r * (a * b) ≤ r * 4 := mul_le_mul_of_nonneg_left hab hr calc r * a * b = r * (a * b) := by ring _ ≤ r * 4 := hmul _ = 4 * r := by ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.mul_centered_pair_le_four_mul_of_nonneg · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:154
theorem pair_kernel_le_envelope_kernel

Under interior assignment probabilities and bounded outcomes, each pairwise covariance contribution is no larger than four times its graph-only envelope kernel.

Formal statement
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hpos :
∀ k, 0 < p k
hlt :
∀ k, p k < 1
hbdd :
i j :
O
E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1)
+ E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0)
+ 2 * E.r10 i j * (E.Y1 i - E.mu1) * (E.Y0 j - E.mu0)
≤ 4 * (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j)
Proof (Lean source)
lemma pair_kernel_le_envelope_kernel (E : BipartiteExperiment I O) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hpos : ∀ k, 0 < p k) (hlt : ∀ k, p k < 1) (hbdd : BoundedOutcomes E) (i j : O) : E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + 2 * E.r10 i j * (E.Y1 i - E.mu1) * (E.Y0 j - E.mu0) ≤ 4 * (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j) := by have h1 := mul_centered_pair_le_four_mul_of_nonneg (E.r1 p i j) (E.Y1 i - E.mu1) (E.Y1 j - E.mu1) (r1_nonneg E p hp1 hpos i j) (centeredY1_abs_le_two E hbdd i) (centeredY1_abs_le_two E hbdd j) have h0 := mul_centered_pair_le_four_mul_of_nonneg (E.r0 p i j) (E.Y0 i - E.mu0) (E.Y0 j - E.mu0) (r0_nonneg E p hp0 hlt i j) (centeredY0_abs_le_two E hbdd i) (centeredY0_abs_le_two E hbdd j) have h10 := mul_centered_pair_le_four_mul_of_nonneg (2 * E.r10 i j) (E.Y1 i - E.mu1) (E.Y0 j - E.mu0) (mul_nonneg (by positivity) (r10_nonneg E i j)) (centeredY1_abs_le_two E hbdd i) (centeredY0_abs_le_two E hbdd j) calc E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + 2 * E.r10 i j * (E.Y1 i - E.mu1) * (E.Y0 j - E.mu0) ≤ 4 * E.r1 p i j + 4 * E.r0 p i j + 4 * (2 * E.r10 i j) := by exact add_le_add (add_le_add h1 h0) h10 _ = 4 * (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j) := by ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.pair_kernel_le_envelope_kernel · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:172
theorem hetero_envelope Theorem 2 in the paper ↗

Heterogeneous envelope kernel. Under the independent heterogeneous Bernoulli design and bounded outcomes, the covariance of the linearization scores factors through the overlap loads, and the variance scale is dominated by the observable graph-only envelope.

Formal statement
D :
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hpos :
∀ k, 0 < p k
hlt :
∀ k, p k < 1
hBern :
hbdd :
(∀ i j, D.E (fun z => E.linScore p z i * E.linScore p z j) = E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + E.r10 i j * ((E.Y1 i - E.mu1) * (E.Y0 j - E.mu0) + (E.Y0 i - E.mu0) * (E.Y1 j - E.mu1))) ∧
E.varScale D p ≤ E.varEnvelope p
Proof (Lean source)
theorem hetero_envelope (E : BipartiteExperiment I O) (D : FiniteDesign (I → Bool)) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hpos : ∀ k, 0 < p k) (hlt : ∀ k, p k < 1) (hBern : IndepHeteroBernoulli D p hp0 hp1) (hbdd : BoundedOutcomes E) : (∀ i j, D.E (fun z => E.linScore p z i * E.linScore p z j) = E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + E.r10 i j * ((E.Y1 i - E.mu1) * (E.Y0 j - E.mu0) + (E.Y0 i - E.mu0) * (E.Y1 j - E.mu1))) ∧ E.varScale D p ≤ E.varEnvelope p := by refine ⟨fun i j => linScore_pair_moment E D p hp0 hp1 hpos hlt hBern i j, ?_⟩ rw [varScale_homogeneous_formula E D p hp0 hp1 hpos hlt hBern] unfold BipartiteExperiment.varEnvelope have hsum : (∑ i : O, ∑ j : O, (E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + 2 * E.r10 i j * (E.Y1 i - E.mu1) * (E.Y0 j - E.mu0))) ≤ ∑ i : O, ∑ j : O, 4 * (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j) := by refine Finset.sum_le_sum ?_ intro i _ refine Finset.sum_le_sum ?_ intro j _ exact pair_kernel_le_envelope_kernel E p hp0 hp1 hpos hlt hbdd i j have hn : 0 ≤ (Fintype.card O : ℝ)⁻¹ := by exact inv_nonneg.mpr (Nat.cast_nonneg (Fintype.card O)) have hscaled := mul_le_mul_of_nonneg_left hsum hn calc (Fintype.card O : ℝ)⁻¹ * ∑ i : O, ∑ j : O, (E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + 2 * E.r10 i j * (E.Y1 i - E.mu1) * (E.Y0 j - E.mu0)) ≤ (Fintype.card O : ℝ)⁻¹ * ∑ i : O, ∑ j : O, 4 * (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j) := hscaled _ = 4 * (Fintype.card O : ℝ)⁻¹ * ∑ i : O, ∑ j : O, (E.r1 p i j + E.r0 p i j + 2 * E.r10 i j) := by simp_rw [← Finset.mul_sum] ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.hetero_envelope · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeteroEnvelope.lean:202
THeterogeneitySeparation 11 declarations
theorem shared_card_eq_one_of_singleton Lemma shared_card_eq_one_of_singleton in the paper ↗

A nonempty shared neighborhood of singleton exposure neighborhoods has cardinality one.

Formal statement
hsingle :
∀ i, (E.N i).card = 1
i j :
O
k :
I
hk :
k ∈ E.shared i j
(E.shared i j).card = 1
Proof (Lean source)
lemma shared_card_eq_one_of_singleton (E : BipartiteExperiment I O) (hsingle : ∀ i, (E.N i).card = 1) {i j : O} {k : I} (hk : k ∈ E.shared i j) : (E.shared i j).card = 1 := by have hsub : E.shared i j ⊆ E.N i := by intro x hx exact (Finset.mem_inter.mp hx).1 have hpos : 0 < (E.shared i j).card := by exact Finset.card_pos.mpr ⟨k, hk⟩ have hle : (E.shared i j).card ≤ 1 := by simpa [hsingle i] using Finset.card_le_card hsub exact Nat.le_antisymm hle hpos
CausalSmith.Experimentation.BipartiteMinimaxDesign.shared_card_eq_one_of_singleton · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:28
theorem sum_indicator_shared_eq_sdeg_sq_mul Lemma sum_indicator_shared_eq_sdeg_sq_mul in the paper ↗

Counting ordered outcome pairs whose shared neighborhood contains k gives s_k^2.

Formal statement
k :
I
C :
(∑ i : O, ∑ j : O, if k ∈ E.shared i j then C else 0) = (E.sdeg k : ℝ) ^ 2 * C
Proof (Lean source)
lemma sum_indicator_shared_eq_sdeg_sq_mul (E : BipartiteExperiment I O) (k : I) (C : ℝ) : (∑ i : O, ∑ j : O, if k ∈ E.shared i j then C else 0) = (E.sdeg k : ℝ) ^ 2 * C := by classical simp only [BipartiteExperiment.shared, mem_inter] have hindicator : ∀ (P : O → Prop) [DecidablePred P] (A : ℝ), (∑ x : O, if P x then A else 0) = (((Finset.univ.filter P).card : ℝ) * A) := by intro P hP A rw [← Finset.sum_filter] simp have hinner : ∀ i : O, (∑ j : O, if k ∈ E.N i ∧ k ∈ E.N j then C else 0) = if k ∈ E.N i then ((E.M k).card : ℝ) * C else 0 := by intro i by_cases hi : k ∈ E.N i · simp [hi, hindicator, BipartiteExperiment.M] · simp [hi] simp_rw [hinner] rw [hindicator] simp [BipartiteExperiment.sdeg, BipartiteExperiment.M] ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.sum_indicator_shared_eq_sdeg_sq_mul · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:44
theorem singleton_envelopeGrad_eq_sdeg_sq Lemma singleton_envelopeGrad_eq_sdeg_sq in the paper ↗

In singleton-exposure graphs, the homogeneous-point envelope gradient reduces to the observable squared intervention-side degree summary.

Formal statement
rho :
phom :
I → ℝ
hphom :
phom = fun _ => rho
hsingle :
∀ i, (E.N i).card = 1
k :
I
E.envelopeGrad phom k
= (Fintype.card O : ℝ)⁻¹ * ((E.sdeg k : ℝ) ^ 2) * (((1 - rho) ^ 2)⁻¹ - (rho ^ 2)⁻¹)
Proof (Lean source)
lemma singleton_envelopeGrad_eq_sdeg_sq (E : BipartiteExperiment I O) (rho : ℝ) (phom : I → ℝ) (hphom : phom = fun _ => rho) (hsingle : ∀ i, (E.N i).card = 1) (k : I) : E.envelopeGrad phom k = (Fintype.card O : ℝ)⁻¹ * ((E.sdeg k : ℝ) ^ 2) * (((1 - rho) ^ 2)⁻¹ - (rho ^ 2)⁻¹) := by classical subst phom let C : ℝ := (((1 - rho) ^ 2)⁻¹ - (rho ^ 2)⁻¹) have hsummand : ∀ i j : O, (if k ∈ E.shared i j then -((rho ^ (E.shared i j).card)⁻¹ * rho⁻¹) + ((1 - rho) ^ (E.shared i j).card)⁻¹ * (1 - rho)⁻¹ else 0) = if k ∈ E.shared i j then C else 0 := by intro i j by_cases hk : k ∈ E.shared i j · have hcard := shared_card_eq_one_of_singleton E hsingle hk rw [if_pos hk, if_pos hk, hcard] simp only [pow_one] change -(rho⁻¹ * rho⁻¹) + (1 - rho)⁻¹ * (1 - rho)⁻¹ = (((1 - rho) ^ 2)⁻¹ - (rho ^ 2)⁻¹) rw [← inv_pow, ← inv_pow] ring · rw [if_neg hk, if_neg hk] simp only [BipartiteExperiment.envelopeGrad, prod_inv_distrib, prod_const, neg_mul] simp_rw [hsummand] rw [sum_indicator_shared_eq_sdeg_sq_mul] ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.singleton_envelopeGrad_eq_sdeg_sq · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:70
def SeparationConclusion

The shared non-homogeneity + strict-improvement + explicit-gap conclusion of thm:heterogeneity-separation, factored so that BOTH the general gradient-spread trigger and the standalone singleton-degree trigger deliver the same conclusion. Here a/b attain the max/min gradient score at p^hom; Δg = g_a − g_b > 0 is the gradient-score spread, η_box = min{ρ−ε, 1−ε−ρ}, and L_ab = dirModulus … (e_b−e_a) is the observable directional second-order modulus. The gap admits the explicit lower bound 2 Δg min{η_box, Δg/L_ab} (read as 2 Δg η_box when L_ab = 0).

Definition (Lean source)
def SeparationConclusion (E : BipartiteExperiment I O) (ε B rho : ℝ) (phom : I → ℝ) : Prop := (¬ ∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope phom ≤ E.varEnvelope q) ∧ (∃ a b : I, (∀ k, E.envelopeGrad phom k ≤ E.envelopeGrad phom a) ∧ (∀ k, E.envelopeGrad phom b ≤ E.envelopeGrad phom k) ∧ 0 < E.envelopeGrad phom a - E.envelopeGrad phom b ∧ ∀ pstar ∈ feasibleSet (I := I) ε B, (∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope pstar ≤ E.varEnvelope q) → pstar ≠ phom ∧ E.varEnvelope pstar < E.varEnvelope phom ∧ E.varEnvelope phom - E.varEnvelope pstar ≥ 2 * (E.envelopeGrad phom a - E.envelopeGrad phom b) * (let L := dirModulus E ε B (fun k => (if k = b then (1 : ℝ) else 0) - (if k = a then 1 else 0)); if L = 0 then min (rho - ε) (1 - ε - rho) else min (min (rho - ε) (1 - ε - rho)) ((E.envelopeGrad phom a - E.envelopeGrad phom b) / L)))
CausalSmith.Experimentation.BipartiteMinimaxDesign.SeparationConclusion · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:101

The one-dimensional calculus of the reciprocal-product envelope line g(s)=V_env(p^hom+s d)/4: regularity on the box segment, differentiability at the origin, the first derivative identity g'(0)=-(g_a-g_b), nonnegativity of the directional modulus, and the le_ciSup curvature bound by dirModulus.

Definition (Lean source)
def EnvelopeLineC2Data (E : BipartiteExperiment I O) (ε B rho : ℝ) (phom : I → ℝ) (a b : I) : Prop := let d := fun k => (if k = b then (1 : ℝ) else 0) - (if k = a then 1 else 0) let g := fun s : ℝ => E.varEnvelope (fun k => phom k + s * d k) / 4 let T := min (rho - ε) (1 - ε - rho) 0 ≤ dirModulus E ε B d ∧ ContDiffOn ℝ 2 g (Icc 0 T) ∧ DifferentiableAt ℝ g 0 ∧ deriv g 0 = -(E.envelopeGrad phom a - E.envelopeGrad phom b) ∧ (∀ t ∈ Icc (0 : ℝ) T, deriv (deriv g) t ≤ dirModulus E ε B d)
CausalSmith.Experimentation.BipartiteMinimaxDesign.EnvelopeLineC2Data · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:126

The homogeneous design is feasible when rho = B / card I and it lies strictly inside the positivity box.

Formal statement
ε B rho :
hm :
0 < Fintype.card I
hrho :
rho = B / (Fintype.card I : ℝ)
hrbox :
ε < rho ∧ rho < 1 - ε
phom :
I → ℝ
hphom :
phom = fun _ => rho
phom ∈ feasibleSet (I := I) ε B
Proof (Lean source)
lemma homogeneous_feasible (ε B rho : ℝ) (hε : EpsilonAdmissible ε) (hm : 0 < Fintype.card I) (hrho : rho = B / (Fintype.card I : ℝ)) (hrbox : ε < rho ∧ rho < 1 - ε) (phom : I → ℝ) (hphom : phom = fun _ => rho) : phom ∈ feasibleSet (I := I) ε B := by classical subst phom refine ⟨?_, hε, ?_, ?_⟩ · intro k constructor <;> linarith [hε.1, hε.2, hrbox.1, hrbox.2] · intro k constructor <;> linarith [hrbox.1, hrbox.2] · unfold BudgetBalance have hm_ne : (Fintype.card I : ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt hm) rw [Finset.sum_const, nsmul_eq_mul] rw [hrho] field_simp [hm_ne] change (Fintype.card I : ℝ) * B = B * (Fintype.card I : ℝ) ring
CausalSmith.Experimentation.BipartiteMinimaxDesign.homogeneous_feasible · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:211
theorem homogeneous_not_minimizer_of_gradient_spread Lemma homogeneous_not_minimizer_of_gradient_spread in the paper ↗

At an interior homogeneous point, KKT stationarity would force all envelope gradient coordinates to agree. Hence any gradient spread rules out optimality.

Formal statement
ε B rho :
hB :
BudgetAdmissible (I := I) ε B
hm :
0 < Fintype.card I
hrho :
rho = B / (Fintype.card I : ℝ)
hrbox :
ε < rho ∧ rho < 1 - ε
phom :
I → ℝ
hphom :
phom = fun _ => rho
hspread :
∃ a b : I, E.envelopeGrad phom a ≠ E.envelopeGrad phom b
¬ ∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope phom ≤ E.varEnvelope q
Proof (Lean source)
lemma homogeneous_not_minimizer_of_gradient_spread (E : BipartiteExperiment I O) (ε B rho : ℝ) (hε : EpsilonAdmissible ε) (hB : BudgetAdmissible (I := I) ε B) (hm : 0 < Fintype.card I) (hrho : rho = B / (Fintype.card I : ℝ)) (hrbox : ε < rho ∧ rho < 1 - ε) (phom : I → ℝ) (hphom : phom = fun _ => rho) (hspread : ∃ a b : I, E.envelopeGrad phom a ≠ E.envelopeGrad phom b) : ¬ ∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope phom ≤ E.varEnvelope q := by classical intro hmin have hfeas : phom ∈ feasibleSet (I := I) ε B := homogeneous_feasible (I := I) ε B rho hε hm hrho hrbox phom hphom obtain ⟨_hne, _hcompact, _hconv, _hconvEnv, _hexists, hcert⟩ := convex_design E ε B hε.1 hε.2 hB.1 hB.2 obtain ⟨lam, νp, νm, _hνp_nonneg, _hνm_nonneg, hgrad, hcomp_upper, hcomp_lower⟩ := hcert phom hfeas hmin have hνp_zero : ∀ k, νp k = 0 := by intro k have hfactor : phom k - (1 - ε) ≠ 0 := by subst phom linarith [hrbox.2] rcases mul_eq_zero.mp (hcomp_upper k) with hν | hfac · exact hν · exact elim (hfactor hfac) have hνm_zero : ∀ k, νm k = 0 := by intro k have hfactor : ε - phom k ≠ 0 := by subst phom linarith [hrbox.1] rcases mul_eq_zero.mp (hcomp_lower k) with hν | hfac · exact hν · exact elim (hfactor hfac) rcases hspread with ⟨a, b, hab⟩ have ha : E.envelopeGrad phom a = lam := by rw [hgrad a, hνp_zero a, hνm_zero a] ring have hb : E.envelopeGrad phom b = lam := by rw [hgrad b, hνp_zero b, hνm_zero b] ring exact hab (ha.trans hb.symm)
CausalSmith.Experimentation.BipartiteMinimaxDesign.homogeneous_not_minimizer_of_gradient_spread · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:235
theorem singleton_degree_spread_to_gradient_spread Lemma singleton_degree_spread_to_gradient_spread in the paper ↗

In the singleton-exposure case, unequal squared intervention-side degrees produce unequal homogeneous envelope-gradient coordinates when rho ≠ 1 / 2.

Formal statement
rho :
hrhalf :
rho ≠ 1 / 2
phom :
I → ℝ
hphom :
phom = fun _ => rho
hsingle :
∀ i, (E.N i).card = 1
hsdeg :
∃ a b : I, (E.sdeg a : ℝ) ^ 2 ≠ (E.sdeg b : ℝ) ^ 2
∃ a b : I, E.envelopeGrad phom a ≠ E.envelopeGrad phom b
Proof (Lean source)
lemma singleton_degree_spread_to_gradient_spread (E : BipartiteExperiment I O) (rho : ℝ) (hrhalf : rho ≠ 1 / 2) (phom : I → ℝ) (hphom : phom = fun _ => rho) (hsingle : ∀ i, (E.N i).card = 1) (hsdeg : ∃ a b : I, (E.sdeg a : ℝ) ^ 2 ≠ (E.sdeg b : ℝ) ^ 2) : ∃ a b : I, E.envelopeGrad phom a ≠ E.envelopeGrad phom b := by classical let C : ℝ := (((1 - rho) ^ 2)⁻¹ - (rho ^ 2)⁻¹) have hC : C ≠ 0 := by intro hzero have hinv : ((1 - rho) ^ 2)⁻¹ = (rho ^ 2)⁻¹ := by exact sub_eq_zero.mp hzero have hsquares : (1 - rho) ^ 2 = rho ^ 2 := inv_injective hinv rcases sq_eq_sq_iff_eq_or_eq_neg.mp hsquares with hlin | hlin · apply hrhalf linarith · linarith have hO_ne : (Fintype.card O : ℝ) ≠ 0 := by intro hOzero have hOcard : Fintype.card O = 0 := by exact_mod_cast hOzero rcases hsdeg with ⟨a, b, hab⟩ have ha0 : (E.sdeg a : ℝ) = 0 := by have hle : (E.M a).card ≤ 0 := by simpa [BipartiteExperiment.M, hOcard] using Finset.card_le_univ (E.M a) have hcard : (E.M a).card = 0 := Nat.eq_zero_of_le_zero hle simp [BipartiteExperiment.sdeg, hcard] have hb0 : (E.sdeg b : ℝ) = 0 := by have hle : (E.M b).card ≤ 0 := by simpa [BipartiteExperiment.M, hOcard] using Finset.card_le_univ (E.M b) have hcard : (E.M b).card = 0 := Nat.eq_zero_of_le_zero hle simp [BipartiteExperiment.sdeg, hcard] apply hab rw [ha0, hb0] let scale : ℝ := (Fintype.card O : ℝ)⁻¹ * C have hscale : scale ≠ 0 := by exact mul_ne_zero (inv_ne_zero hO_ne) hC rcases hsdeg with ⟨a, b, hab⟩ refine ⟨a, b, ?_⟩ have hgrad : ∀ k, E.envelopeGrad phom k = scale * ((E.sdeg k : ℝ) ^ 2) := by intro k rw [singleton_envelopeGrad_eq_sdeg_sq E rho phom hphom hsingle k] ring intro hgab apply hab rw [hgrad a, hgrad b] at hgab exact mul_left_cancel₀ hscale hgab
CausalSmith.Experimentation.BipartiteMinimaxDesign.singleton_degree_spread_to_gradient_spread · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:280
theorem envelopeLineC2Data_holds

The EnvelopeLineC2Data gate is discharged. Every conjunct is now derived, so thm:heterogeneity-separation no longer assumes any one-dimensional calculus input.

Formal statement
ε B :
hm :
0 < Fintype.card I
hB :
BudgetAdmissible (I := I) ε B
rho :
hrho :
rho = B / (Fintype.card I : ℝ)
hrbox :
ε < rho ∧ rho < 1 - ε
phom :
I → ℝ
hphom :
phom = fun _ => rho
a b :
I
EnvelopeLineC2Data E ε B rho phom a b
Proof (Lean source)
lemma envelopeLineC2Data_holds (E : BipartiteExperiment I O) (ε B : ℝ) (hε : EpsilonAdmissible ε) (hm : 0 < Fintype.card I) (hB : BudgetAdmissible (I := I) ε B) (rho : ℝ) (hrho : rho = B / (Fintype.card I : ℝ)) (hrbox : ε < rho ∧ rho < 1 - ε) (phom : I → ℝ) (hphom : phom = fun _ => rho) (a b : I) : EnvelopeLineC2Data E ε B rho phom a b := by classical let d : I → ℝ := fun k => (if k = b then (1 : ℝ) else 0) - (if k = a then 1 else 0) let g : ℝ → ℝ := fun s => E.varEnvelope (fun k => phom k + s * d k) / 4 let T : ℝ := min (rho - ε) (1 - ε - rho) have hT : 0 < T := by dsimp [T] exact lt_min (by linarith [hrbox.1]) (by linarith [hrbox.2]) have hd : ∀ k, |d k| ≤ 1 := by intro k exact pair_direction_abs_le_one a b k have hfeas : phom ∈ feasibleSet (I := I) ε B := homogeneous_feasible (I := I) ε B rho hε hm hrho hrbox phom hphom have hseg : ∀ s ∈ Icc (-T) T, (fun k => phom k + s * d k) ∈ feasibleSet (I := I) ε B := by intro s hs by_cases hs0 : 0 ≤ s · exact homogeneous_pair_segment_feasible (I := I) ε B rho hε hrbox hphom hfeas a b ⟨hs0, hs.2⟩ · have hneg : 0 ≤ -s := by linarith have hupper : -s ≤ T := by linarith [hs.1] have hswap := homogeneous_pair_segment_feasible (I := I) ε B rho hε hrbox hphom hfeas b a (s := -s) ⟨hneg, hupper⟩ convert hswap using 1 funext k simp only [d] ring have hbox : ∀ s ∈ Icc (0 : ℝ) T, ∀ k, ε / 2 ≤ phom k + s * d k ∧ ε / 2 ≤ 1 - (phom k + s * d k) := by intro s hs k have hsL : s ≤ rho - ε := le_trans hs.2 (min_le_left _ _) have hsR : s ≤ 1 - ε - rho := le_trans hs.2 (min_le_right _ _) have hsd : |s * d k| ≤ s := by calc |s * d k| = |s| * |d k| := abs_mul _ _ _ ≤ |s| * 1 := mul_le_mul_of_nonneg_left (hd k) (abs_nonneg s) _ = s := by simp [abs_of_nonneg hs.1] have hlow : -s ≤ s * d k := by linarith [neg_le_abs (s * d k)] have hupp : s * d k ≤ s := by linarith [le_abs_self (s * d k)] rw [hphom] constructor <;> linarith [hε.1] unfold EnvelopeLineC2Data dsimp only refine ⟨?_, ?_, ?_, ?_, ?_⟩ · apply le_trans ?_ (E.envCurv_le_dirModulus ε B hε.1 hε.2 hB.1 hB.2 hd hfeas) rw [← E.deriv_deriv_envelope_line_zero ε B hε.1 hfeas hd] apply Causalean.Mathlib.Analysis.convexOn_deriv2_nonneg · let A : ℝ →ᵃ[ℝ] (I → ℝ) := AffineMap.lineMap phom (phom + d) have hline : ∀ s : ℝ, A s = fun k => phom k + s * d k := by intro s ext k simp [A, AffineMap.lineMap_apply_module'] ring have hpre : ConvexOn ℝ (A ⁻¹' feasibleSet (I := I) ε B) (E.varEnvelope ∘ A) := (convex_design E ε B hε.1 hε.2 hB.1 hB.2).2.2.2.1.comp_affineMap A have hrestr : ConvexOn ℝ (Icc (-T) T) (E.varEnvelope ∘ A) := hpre.subset (by intro s hs change A s ∈ feasibleSet (I := I) ε B rw [hline s] exact hseg s hs) (convex_Icc _ _) convert hrestr.smul (show 0 ≤ (4 : ℝ)⁻¹ by norm_num) using 1 case e'_4 => rfl case e'_10 => rfl case e'_12 => funext s rw [← hline s] simp [Function.comp_apply, div_eq_inv_mul] · intro y hy exact E.differentiableAt_envelope_line ε B hε.1 hd y (hseg y hy) · rw [interior_Icc] exact ⟨by linarith, by linarith⟩ · exact E.differentiableAt_deriv_envelope_line_zero ε B hε.1 hfeas hd · exact E.contDiffOn_envelope_line ε hε.1 hbox · exact E.differentiableAt_envelope_line_zero ε B hε.1 hfeas hd · rw [E.deriv_envelope_line_zero ε B hε.1 hfeas hd] simp only [d] simp_rw [sub_mul] rw [Finset.sum_sub_distrib] simp only [ite_mul, one_mul, zero_mul, Finset.sum_ite_eq', Finset.mem_univ, if_true] ring · intro t ht rw [E.deriv_deriv_envelope_line_eq_envCurv ε B hε.1 hd t (hseg t ⟨le_trans (neg_nonpos.mpr hT.le) ht.1, ht.2⟩)] exact E.envCurv_le_dirModulus ε B hε.1 hε.2 hB.1 hB.2 hd (hseg t ⟨le_trans (neg_nonpos.mpr hT.le) ht.1, ht.2⟩)
CausalSmith.Experimentation.BipartiteMinimaxDesign.envelopeLineC2Data_holds · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:339
theorem envelope_segment_descent_gap Lemma envelope_segment_descent_gap in the paper ↗

General gradient-spread separation, with the one-dimensional Taylor/dirModulus gap estimate now DERIVED: the former EnvelopeLineC2Data hypothesis is supplied internally by envelopeLineC2Data_holds.

Formal statement
ε B :
hm :
0 < Fintype.card I
hB :
BudgetAdmissible (I := I) ε B
rho :
hrho :
rho = B / (Fintype.card I : ℝ)
hrbox :
ε < rho ∧ rho < 1 - ε
phom :
I → ℝ
hphom :
phom = fun _ => rho
hspread :
∃ a b : I, E.envelopeGrad phom a ≠ E.envelopeGrad phom b
SeparationConclusion E ε B rho phom
Proof (Lean source)
lemma envelope_segment_descent_gap (E : BipartiteExperiment I O) (ε B : ℝ) (hε : EpsilonAdmissible ε) (hm : 0 < Fintype.card I) (hB : BudgetAdmissible (I := I) ε B) (rho : ℝ) (hrho : rho = B / (Fintype.card I : ℝ)) (hrbox : ε < rho ∧ rho < 1 - ε) (phom : I → ℝ) (hphom : phom = fun _ => rho) (hspread : ∃ a b : I, E.envelopeGrad phom a ≠ E.envelopeGrad phom b) : SeparationConclusion E ε B rho phom := by classical have hdata : ∀ a b : I, EnvelopeLineC2Data E ε B rho phom a b := fun a b => envelopeLineC2Data_holds E ε B hε hm hB rho hrho hrbox phom hphom a b have hnot : ¬ ∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope phom ≤ E.varEnvelope q := homogeneous_not_minimizer_of_gradient_spread E ε B rho hε hB hm hrho hrbox phom hphom hspread have hI : Nonempty I := Fintype.card_pos_iff.mp hm obtain ⟨a, hmax⟩ := Finite.exists_max (fun k : I => E.envelopeGrad phom k) obtain ⟨b, hmin⟩ := Finite.exists_min (fun k : I => E.envelopeGrad phom k) have hne_ba : E.envelopeGrad phom b ≠ E.envelopeGrad phom a := by intro hba rcases hspread with ⟨x, y, hxy⟩ apply hxy have hx : E.envelopeGrad phom x = E.envelopeGrad phom a := by exact le_antisymm (hmax x) (by simpa [hba] using hmin x) have hy : E.envelopeGrad phom y = E.envelopeGrad phom a := by exact le_antisymm (hmax y) (by simpa [hba] using hmin y) exact hx.trans hy.symm have hdelta : 0 < E.envelopeGrad phom a - E.envelopeGrad phom b := by have hlt : E.envelopeGrad phom b < E.envelopeGrad phom a := lt_of_le_of_ne (hmin a) hne_ba linarith refine ⟨hnot, a, b, hmax, hmin, hdelta, ?_⟩ intro pstar hpstar hpmin have hfeas : phom ∈ feasibleSet (I := I) ε B := homogeneous_feasible (I := I) ε B rho hε hm hrho hrbox phom hphom have hpstar_ne : pstar ≠ phom := by intro hp_eq apply hnot intro q hq simpa [hp_eq] using hpmin q hq have hstrict : E.varEnvelope pstar < E.varEnvelope phom := by have hle : E.varEnvelope pstar ≤ E.varEnvelope phom := hpmin phom hfeas have hne_val : E.varEnvelope pstar ≠ E.varEnvelope phom := by intro heq apply hnot intro q hq calc E.varEnvelope phom = E.varEnvelope pstar := heq.symm _ ≤ E.varEnvelope q := hpmin q hq exact lt_of_le_of_ne hle hne_val refine ⟨hpstar_ne, hstrict, ?_⟩ let d : I → ℝ := fun k => (if k = b then (1 : ℝ) else 0) - (if k = a then 1 else 0) let g : ℝ → ℝ := fun s => E.varEnvelope (fun k => phom k + s * d k) / 4 let T : ℝ := min (rho - ε) (1 - ε - rho) let L : ℝ := dirModulus E ε B d let Δ : ℝ := E.envelopeGrad phom a - E.envelopeGrad phom b let s : ℝ := Causalean.Mathlib.Analysis.descentStep L Δ T have hT : 0 ≤ T := by dsimp [T] exact le_min (by linarith [hrbox.1]) (by linarith [hrbox.2]) have hdata_ab : EnvelopeLineC2Data E ε B rho phom a b := hdata a b have hdata_unfold : 0 ≤ L ∧ ContDiffOn ℝ 2 g (Icc 0 T) ∧ DifferentiableAt ℝ g 0 ∧ deriv g 0 = -Δ ∧ (∀ t ∈ Icc (0 : ℝ) T, deriv (deriv g) t ≤ L) := by simpa [EnvelopeLineC2Data, d, g, T, L, Δ] using hdata_ab rcases hdata_unfold with ⟨hLnn, hgC2, hgdiff, hgderiv0, hgcurv⟩ have hslope : deriv g 0 ≤ -Δ := by rw [hgderiv0] have hdesc : s ∈ Icc (0 : ℝ) T ∧ g 0 - g s ≥ (Δ / 2) * s := by simpa [s] using (second_order_descent_gap_half (f := g) (M := L) (c := Δ) (T := T) hT hdelta.le hLnn hgC2 hgdiff (fun t ht => hgcurv t (Set.Ioo_subset_Icc_self ht)) hslope) have hq_feas : (fun k => phom k + s * d k) ∈ feasibleSet (I := I) ε B := by exact homogeneous_pair_segment_feasible (I := I) ε B rho hε hrbox hphom hfeas a b (by simpa [T] using hdesc.1) have hpstar_le_q : E.varEnvelope pstar ≤ E.varEnvelope (fun k => phom k + s * d k) := hpmin (fun k => phom k + s * d k) hq_feas have hg0_eval : g 0 = E.varEnvelope phom / 4 := by simp [g] have hgs_eval : g s = E.varEnvelope (fun k => phom k + s * d k) / 4 := by rfl have henv_gap_to_step : E.varEnvelope phom - E.varEnvelope (fun k => phom k + s * d k) ≥ 2 * Δ * s := by nlinarith [hdesc.2, hg0_eval, hgs_eval] have henv_gap_to_q : E.varEnvelope phom - E.varEnvelope pstar ≥ E.varEnvelope phom - E.varEnvelope (fun k => phom k + s * d k) := by linarith have hgap_step : E.varEnvelope phom - E.varEnvelope pstar ≥ 2 * Δ * s := by exact le_trans henv_gap_to_step henv_gap_to_q simpa [d, T, L, Δ, s, Causalean.Mathlib.Analysis.descentStep] using hgap_step
CausalSmith.Experimentation.BipartiteMinimaxDesign.envelope_segment_descent_gap · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:447
theorem heterogeneity_separation Theorem 6 in the paper ↗

Heterogeneity separation. Set ρ = B/m and let p^hom ≡ ρ be the homogeneous feasible design (with ρ ∈ (ε,1−ε), ρ ≠ 1/2). (1) General trigger: if the gradient scores g_k(p^hom) are not all equal, then p^hom is not an envelope minimizer, every minimizer is non-homogeneous and strictly better, with the explicit 2 Δg min{η_box, Δg/L_ab} gap bound (SeparationConclusion). (2) Singleton reduction: for singleton-exposure graphs the gradient reduces to the observable degree summary g_k(p^hom) = n^{-1} s_k² ((1−ρ)^{-2} − ρ^{-2}). (3) Standalone singleton trigger: for a singleton-exposure graph whose observable degree summaries s_k² are not all equal, the SAME conclusion holds — WITHOUT assuming the gradient-spread hypothesis, which is instead derived from (2) together with ρ ≠ 1/2 (so (1−ρ)^{-2} − ρ^{-2} ≠ 0 scales unequal s_k² into unequal g_k).

Formal statement
ε B :
hm :
0 < Fintype.card I
hB :
BudgetAdmissible (I := I) ε B
rho :
hrho :
rho = B / (Fintype.card I : ℝ)
hrbox :
ε < rho ∧ rho < 1 - ε
hrhalf :
rho ≠ 1 / 2
phom :
I → ℝ
hphom :
phom = fun _ => rho
((∃ a b : I, E.envelopeGrad phom a ≠ E.envelopeGrad phom b) → SeparationConclusion E ε B rho phom) ∧
((∀ i, (E.N i).card = 1) → ∀ k, E.envelopeGrad phom k = (Fintype.card O : ℝ)⁻¹ * ((E.sdeg k : ℝ) ^ 2) * (((1 - rho) ^ 2)⁻¹ - (rho ^ 2)⁻¹)) ∧
((∀ i, (E.N i).card = 1) → (∃ a b : I, (E.sdeg a : ℝ) ^ 2 ≠ (E.sdeg b : ℝ) ^ 2) → SeparationConclusion E ε B rho phom)
Proof (Lean source)
theorem heterogeneity_separation (E : BipartiteExperiment I O) (ε B : ℝ) (hε : EpsilonAdmissible ε) (hm : 0 < Fintype.card I) (hB : BudgetAdmissible (I := I) ε B) (rho : ℝ) (hrho : rho = B / (Fintype.card I : ℝ)) (hrbox : ε < rho ∧ rho < 1 - ε) (hrhalf : rho ≠ 1 / 2) (phom : I → ℝ) (hphom : phom = fun _ => rho) : ((∃ a b : I, E.envelopeGrad phom a ≠ E.envelopeGrad phom b) → SeparationConclusion E ε B rho phom) ∧ ((∀ i, (E.N i).card = 1) → ∀ k, E.envelopeGrad phom k = (Fintype.card O : ℝ)⁻¹ * ((E.sdeg k : ℝ) ^ 2) * (((1 - rho) ^ 2)⁻¹ - (rho ^ 2)⁻¹)) ∧ ((∀ i, (E.N i).card = 1) → (∃ a b : I, (E.sdeg a : ℝ) ^ 2 ≠ (E.sdeg b : ℝ) ^ 2) → SeparationConclusion E ε B rho phom) := by refine ⟨?_, ?_, ?_⟩ · intro hspread exact envelope_segment_descent_gap E ε B hε hm hB rho hrho hrbox phom hphom hspread · intro hsingle k exact singleton_envelopeGrad_eq_sdeg_sq E rho phom hphom hsingle k · intro hsingle hsdeg exact envelope_segment_descent_gap E ε B hε hm hB rho hrho hrbox phom hphom (singleton_degree_spread_to_gradient_spread E rho hrhalf phom hphom hsingle hsdeg)
CausalSmith.Experimentation.BipartiteMinimaxDesign.heterogeneity_separation · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THeterogeneitySeparation.lean:552
THomogeneousReduction 1 declarations
theorem homogeneous_reduction Theorem 1 in the paper ↗

Homogeneous reduction. Under the independent heterogeneous Bernoulli design, if p_k = p is a common scalar in (0,1), the treated / control overlap loads collapse to p^{-|S_{ij}|} − 1 and (1−p)^{-|S_{ij}|} − 1, and the variance scale equals the homogeneous Bernoulli Hájek overlap formula.

Formal statement
D :
pc :
hpc0 :
0 < pc
hpc1 :
pc < 1
p :
I → ℝ
hp0 :
∀ k, 0 ≤ p k
hp1 :
∀ k, p k ≤ 1
hconst :
∀ k, p k = pc
hBern :
(∀ i j, E.r1 p i j = if 0 < (E.shared i j).card then (pc ^ (E.shared i j).card)⁻¹ - 1 else 0) ∧
(∀ i j, E.r0 p i j = if 0 < (E.shared i j).card then ((1 - pc) ^ (E.shared i j).card)⁻¹ - 1 else 0) ∧
E.varScale D p
= (Fintype.card O : ℝ)⁻¹ * ∑ i, ∑ j, (E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + 2 * E.r10 i j * (E.Y1 i - E.mu1) * (E.Y0 j - E.mu0))
Proof (Lean source)
theorem homogeneous_reduction (E : BipartiteExperiment I O) (D : FiniteDesign (I → Bool)) (pc : ℝ) (hpc0 : 0 < pc) (hpc1 : pc < 1) (p : I → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∀ k, p k ≤ 1) (hconst : ∀ k, p k = pc) (hBern : IndepHeteroBernoulli D p hp0 hp1) : (∀ i j, E.r1 p i j = if 0 < (E.shared i j).card then (pc ^ (E.shared i j).card)⁻¹ - 1 else 0) ∧ (∀ i j, E.r0 p i j = if 0 < (E.shared i j).card then ((1 - pc) ^ (E.shared i j).card)⁻¹ - 1 else 0) ∧ E.varScale D p = (Fintype.card O : ℝ)⁻¹ * ∑ i, ∑ j, (E.r1 p i j * (E.Y1 i - E.mu1) * (E.Y1 j - E.mu1) + E.r0 p i j * (E.Y0 i - E.mu0) * (E.Y0 j - E.mu0) + 2 * E.r10 i j * (E.Y1 i - E.mu1) * (E.Y0 j - E.mu0)) := by classical have hpos : ∀ k, 0 < p k := by intro k rw [hconst k] exact hpc0 have hlt : ∀ k, p k < 1 := by intro k rw [hconst k] exact hpc1 refine ⟨?_, ?_, ?_⟩ · intro i j by_cases h : 0 < (E.shared i j).card <;> simp [BipartiteExperiment.r1, h, hconst] · intro i j by_cases h : 0 < (E.shared i j).card <;> simp [BipartiteExperiment.r0, h, hconst] · exact varScale_homogeneous_formula E D p hp0 hp1 hpos hlt hBern
CausalSmith.Experimentation.BipartiteMinimaxDesign.homogeneous_reduction · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/THomogeneousReduction.lean:27
TPostdesignWald 1 declarations
theorem postdesign_wald Theorem 5 in the paper ↗

Post-design conservative Wald coverage. Under the assumptions of the heterogeneous Hájek CLT, the conservative estimator V̂_cons = V_env dominates the variance scale, and the conservative Wald interval has asymptotic coverage ≥ 1 − α, where z is the upper 1 − α/2 standard-normal quantile.

Formal statement
E :
∀ n, BipartiteExperiment (Ix n) (Ox n)
D :
∀ n, FiniteDesign (Ix n → Bool)
p :
∀ n
if
Ix n
then
hp0 :
∀ n k, 0 ≤ p n k
hp1 :
∀ n k, p n k ≤ 1
ε B :
ℕ → ℝ
dbar Dbar :
hcardEq :
∀ᶠ n in atTop, card (Ox n) = n
@realizes n(the paper's stage index IS the outcome-population size: n = |O_n| = card (Ox n) on the eventual tail)
hBern :
∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)
hBI :
hbdd :
∀ n, BoundedOutcomes (E n)
hdeg :
∀ n, BoundedOutcomeDegree (E n) dbar
hdep :
∀ n, BoundedOverlapDependency (E n) Dbar
hfeas :
∀ n, FeasibleDesign (ε n) (B n) (p n)
:
∀ n, EpsilonAdmissible (ε n)
hstar :
∀ n, p n = optimalDesign (E n) (ε n) (B n)
hεfloor :
∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n
hnd :
VarianceNondegenerate (fun n => (E n).varScale (D n) (p n))
α :
_hα0 :
0 < α
_hα1 :
α < 1
@realizes alpha_cov(nominal miscoverage level; carrier ℝ, range (0,1) pinned by _hα0/_hα1)
z :
hz0 :
0 ≤ z
hz :
stdNormalCdf z = 1 - α / 2
(∀ n, (E n).varScale (D n) (p n) ≤ (E n).varEstCons (p n)) ∧
(1 - α)
liminf (fun n => (D n).Pr (fun zz => |(E n).tau - (E n).hajekEstimator (p n) zz| ≤ z * sqrt ((E n).varEstCons (p n) / (card (Ox n))))) atTop
Proof (Lean source)
theorem postdesign_wald (E : ∀ n, BipartiteExperiment (Ix n) (Ox n)) (D : ∀ n, FiniteDesign (Ix n → Bool)) (p : ∀ n, Ix n → ℝ) (hp0 : ∀ n k, 0 ≤ p n k) (hp1 : ∀ n k, p n k ≤ 1) (ε B : ℕ → ℝ) (dbar Dbar : ℝ) (hcardEq : ∀ᶠ n in atTop, card (Ox n) = n) -- @realizes n(the paper's stage index IS the outcome-population size: n = |O_n| = card (Ox n) on the eventual tail) (hBern : ∀ n, IndepHeteroBernoulli (D n) (p n) (hp0 n) (hp1 n)) (hBI : ∀ n, BipartiteInterference (E n)) (hbdd : ∀ n, BoundedOutcomes (E n)) (hdeg : ∀ n, BoundedOutcomeDegree (E n) dbar) (hdep : ∀ n, BoundedOverlapDependency (E n) Dbar) (hfeas : ∀ n, FeasibleDesign (ε n) (B n) (p n)) (hε : ∀ n, EpsilonAdmissible (ε n)) (hstar : ∀ n, p n = optimalDesign (E n) (ε n) (B n)) (hεfloor : ∃ ε0 : ℝ, 0 < ε0 ∧ ∀ᶠ n in atTop, ε0 ≤ ε n) (hnd : VarianceNondegenerate (fun n => (E n).varScale (D n) (p n))) (α : ℝ) (_hα0 : 0 < α) (_hα1 : α < 1) -- @realizes alpha_cov(nominal miscoverage level; carrier ℝ, range (0,1) pinned by _hα0/_hα1) (z : ℝ) (hz0 : 0 ≤ z) (hz : stdNormalCdf z = 1 - α / 2) : (∀ n, (E n).varScale (D n) (p n) ≤ (E n).varEstCons (p n)) ∧ (1 - α) ≤ liminf (fun n => (D n).Pr (fun zz => |(E n).tau - (E n).hajekEstimator (p n) zz| ≤ z * sqrt ((E n).varEstCons (p n) / (card (Ox n))))) atTop := by classical have hcardO : Tendsto (fun n => card (Ox n)) atTop atTop := tendsto_id.congr' (hcardEq.mono fun n hn => hn.symm) have hvar_le : ∀ n, (E n).varScale (D n) (p n) ≤ (E n).varEstCons (p n) := by intro n have hpos : ∀ k, 0 < p n k := by intro k exact lt_of_lt_of_le (hε n).1 ((hfeas n).floor k).1 have hlt : ∀ k, p n k < 1 := by intro k linarith [((hfeas n).floor k).2, (hε n).1] have henv := hetero_envelope (E n) (D n) (p n) (hp0 n) (hp1 n) hpos hlt (hBern n) (hbdd n) simpa [BipartiteExperiment.varEstCons] using henv.2 refine ⟨hvar_le, ?_⟩ have hvarpos : ∀ᶠ n in atTop, 0 < (E n).varScale (D n) (p n) := by rcases hnd with ⟨c, hc, hc_ev⟩ exact hc_ev.mono fun n hn => lt_of_lt_of_le hc hn have hclt := hetero_clt E D p hp0 hp1 ε B dbar Dbar hcardEq hBern hBI hbdd hdeg hdep hfeas hε hstar hεfloor hnd -- `conservative_wald_liminf_of_studentized_cdf` promoted to -- `Causalean.Experimentation.DesignBased.WaldCoverage` as a paper-agnostic lemma over abstract -- sequences; instantiate it with the bipartite estimator / target / variance projections. have hmpos : ∀ᶠ n in atTop, 0 < (card (Ox n) : ℝ) := (hcardO.eventually_ge_atTop 1).mono fun n hn => by exact_mod_cast lt_of_lt_of_le Nat.zero_lt_one hn exact conservative_wald_liminf_of_studentized_cdf D (fun n => (E n).hajekEstimator (p n)) (fun n => (E n).tau) (fun n => (E n).varScale (D n) (p n)) (fun n => (E n).varEstCons (p n)) (fun n => (card (Ox n) : ℝ)) hmpos hvarpos (Filter.Eventually.of_forall hvar_le) α z (hclt.2 z) (hclt.2 (-z)) hz0 hz
CausalSmith.Experimentation.BipartiteMinimaxDesign.postdesign_wald · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TPostdesignWald.lean:34
TSurrogateCertificate 4 declarations
theorem surrogateObjective_continuousOn_feasible Lemma surrogateObjective_continuousOn_feasible in the paper ↗

The additive surrogate objective is continuous on the feasible design class under strict overlap.

Formal statement
ε B :
hε0 :
0 < ε
ContinuousOn E.surrogateObjective (feasibleSet (I := I) ε B)
Proof (Lean source)
lemma surrogateObjective_continuousOn_feasible (E : BipartiteExperiment I O) (ε B : ℝ) (hε0 : 0 < ε) : ContinuousOn E.surrogateObjective (feasibleSet (I := I) ε B) := by classical let s : Set (I → ℝ) := feasibleSet (I := I) ε B unfold BipartiteExperiment.surrogateObjective refine continuousOn_finset_sum univ ?_ intro k _ have hpk : ContinuousOn (fun p : I → ℝ => p k) s := (continuous_apply k).continuousOn have hp_ne : ∀ p ∈ s, p k ≠ 0 := by intro p hp exact ne_of_gt (lt_of_lt_of_le hε0 ((show FeasibleDesign ε B p from hp).floor k).1) have h1mp : ContinuousOn (fun p : I → ℝ => 1 - p k) s := by fun_prop have h1mp_ne : ∀ p ∈ s, 1 - p k ≠ 0 := by intro p hp have hlt : p k < 1 := by linarith [((show FeasibleDesign ε B p from hp).floor k).2, hε0] linarith have hterm1 : ContinuousOn (fun p : I → ℝ => (p k)⁻¹) s := hpk.inv₀ hp_ne have hterm2 : ContinuousOn (fun p : I → ℝ => (1 - p k)⁻¹) s := h1mp.inv₀ h1mp_ne exact continuousOn_const.mul (hterm1.add hterm2)
CausalSmith.Experimentation.BipartiteMinimaxDesign.surrogateObjective_continuousOn_feasible · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TSurrogateCertificate.lean:35
theorem optimalDesign_feasible_minimizes

The envelope-optimal selector is feasible and minimizes varEnvelope on the feasible set whenever the budget domain is admissible.

Formal statement
ε B :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hB :
BudgetAdmissible (I := I) ε B
FeasibleDesign ε B (optimalDesign E ε B) ∧
∀ q, FeasibleDesign ε B q → E.varEnvelope (optimalDesign E ε B) ≤ E.varEnvelope q
Proof (Lean source)
lemma optimalDesign_feasible_minimizes (E : BipartiteExperiment I O) (ε B : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hB : BudgetAdmissible (I := I) ε B) : FeasibleDesign ε B (optimalDesign E ε B) ∧ ∀ q, FeasibleDesign ε B q → E.varEnvelope (optimalDesign E ε B) ≤ E.varEnvelope q := by classical have hcv := convex_design E ε B hε0 hε2 hB.1 hB.2 obtain ⟨pstar, hpstar, hmin⟩ := hcv.2.2.2.2.1 let hex : ∃ p, p ∈ feasibleSet (I := I) ε B ∧ ∀ q ∈ feasibleSet (I := I) ε B, E.varEnvelope p ≤ E.varEnvelope q := ⟨pstar, hpstar, hmin⟩ have hsel : optimalDesign E ε B = hex.choose := by unfold optimalDesign rw [dif_pos hex] have hspec := hex.choose_spec constructor · rw [hsel] simpa [feasibleSet] using hspec.1 · intro q hq rw [hsel] exact hspec.2 q (by simpa [feasibleSet] using hq)
CausalSmith.Experimentation.BipartiteMinimaxDesign.optimalDesign_feasible_minimizes · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TSurrogateCertificate.lean:60
theorem surrogateDesign_feasible_minimizes

The surrogate selector is feasible and minimizes surrogateObjective on the feasible set whenever the budget domain is admissible.

Formal statement
ε B :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hB :
BudgetAdmissible (I := I) ε B
∀ q,
FeasibleDesign ε B q → E.surrogateObjective (surrogateDesign E ε B)
≤ E.surrogateObjective q
Proof (Lean source)
lemma surrogateDesign_feasible_minimizes (E : BipartiteExperiment I O) (ε B : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hB : BudgetAdmissible (I := I) ε B) : FeasibleDesign ε B (surrogateDesign E ε B) ∧ ∀ q, FeasibleDesign ε B q → E.surrogateObjective (surrogateDesign E ε B) ≤ E.surrogateObjective q := by classical have hcv := convex_design E ε B hε0 hε2 hB.1 hB.2 have hmin_exists := hcv.2.1.exists_isMinOn hcv.1 (surrogateObjective_continuousOn_feasible E ε B hε0) obtain ⟨pstar, hpstar, hmin⟩ := hmin_exists let hex : ∃ p, p ∈ feasibleSet (I := I) ε B ∧ ∀ q ∈ feasibleSet (I := I) ε B, E.surrogateObjective p ≤ E.surrogateObjective q := ⟨pstar, hpstar, hmin⟩ have hsel : surrogateDesign E ε B = hex.choose := by unfold surrogateDesign rw [dif_pos hex] have hspec := hex.choose_spec constructor · rw [hsel] simpa [feasibleSet] using hspec.1 · intro q hq rw [hsel] exact hspec.2 q (by simpa [feasibleSet] using hq)
CausalSmith.Experimentation.BipartiteMinimaxDesign.surrogateDesign_feasible_minimizes · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TSurrogateCertificate.lean:86
theorem surrogate_certificate Theorem 7 in the paper ↗

Surrogate certificate. With C(ε,d̄) = max{1, ε^{-(d̄-1)}}, the additive surrogate objective A and the normalized envelope V_env/4 satisfy the uniform sandwich A(p) ≤ V_env(p)/4 ≤ C(ε,d̄)·A(p) over feasible p, and consequently the observable approximation ratio is bounded by C(ε,d̄). The selector feasibility and optimality facts are derived from compact attainment under the regularity condition BudgetAdmissible ε B, rather than assumed as hypotheses.

Formal statement
ε B dbar :
hε0 :
0 < ε
hε2 :
ε < 1 / 2
hdeg :
hB :
BudgetAdmissible (I := I) ε B
(∀ q, FeasibleDesign ε B q → E.surrogateObjective q ≤ E.varEnvelope q / 4 ∧ E.varEnvelope q / 4 ≤ max 1 (ε ^ (-(dbar - 1))) * E.surrogateObjective q) ∧
approxRatio E ε B ≤ max 1 (ε ^ (-(dbar - 1)))
Proof (Lean source)
theorem surrogate_certificate (E : BipartiteExperiment I O) (ε B dbar : ℝ) (hε0 : 0 < ε) (hε2 : ε < 1 / 2) (hdeg : BoundedOutcomeDegree E dbar) (hB : BudgetAdmissible (I := I) ε B) : (∀ q, FeasibleDesign ε B q → E.surrogateObjective q ≤ E.varEnvelope q / 4 ∧ E.varEnvelope q / 4 ≤ max 1 (ε ^ (-(dbar - 1))) * E.surrogateObjective q) ∧ approxRatio E ε B ≤ max 1 (ε ^ (-(dbar - 1))) := by classical let C : ℝ := max 1 (ε ^ (-(dbar - 1))) have hopt := optimalDesign_feasible_minimizes E ε B hε0 hε2 hB have hsurr := surrogateDesign_feasible_minimizes E ε B hε0 hε2 hB have hCnonneg : 0 ≤ C := le_trans zero_le_one (le_max_left _ _) have hsand : ∀ q, FeasibleDesign ε B q → E.surrogateObjective q ≤ E.varEnvelope q / 4 ∧ E.varEnvelope q / 4 ≤ C * E.surrogateObjective q := by intro q hq constructor · rw [surrogateObjective_eq_pairAverage E q, varEnvelope_div_four_eq_pairSum E q] refine Finset.sum_le_sum ?_ intro i _ refine Finset.sum_le_sum ?_ intro j _ have hpair := pairAverage_le_envelopeKernel E ε B hε0 q hq i j have hn : 0 ≤ (Fintype.card O : ℝ)⁻¹ := by positivity calc ∑ k ∈ E.shared i j, (Fintype.card O : ℝ)⁻¹ * (((E.shared i j).card : ℝ)⁻¹ * ((q k)⁻¹ + (1 - q k)⁻¹)) = (Fintype.card O : ℝ)⁻¹ * (((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, ((q k)⁻¹ + (1 - q k)⁻¹))) := by rw [← Finset.mul_sum] rw [← Finset.mul_sum] _ ≤ (Fintype.card O : ℝ)⁻¹ * (E.r1 q i j + E.r0 q i j + 2 * E.r10 i j) := mul_le_mul_of_nonneg_left hpair hn · rw [varEnvelope_div_four_eq_pairSum E q, surrogateObjective_eq_pairAverage E q] calc ∑ i : O, ∑ j : O, (Fintype.card O : ℝ)⁻¹ * (E.r1 q i j + E.r0 q i j + 2 * E.r10 i j) ≤ ∑ i : O, ∑ j : O, C * (∑ k ∈ E.shared i j, (Fintype.card O : ℝ)⁻¹ * (((E.shared i j).card : ℝ)⁻¹ * ((q k)⁻¹ + (1 - q k)⁻¹))) := by refine Finset.sum_le_sum ?_ intro i _ refine Finset.sum_le_sum ?_ intro j _ have hpair := envelopeKernel_le_certificate_pairAverage E ε B dbar hε0 hε2 hdeg q hq i j have hn : 0 ≤ (Fintype.card O : ℝ)⁻¹ := by positivity calc (Fintype.card O : ℝ)⁻¹ * (E.r1 q i j + E.r0 q i j + 2 * E.r10 i j) ≤ (Fintype.card O : ℝ)⁻¹ * (C * (((E.shared i j).card : ℝ)⁻¹ * (∑ k ∈ E.shared i j, ((q k)⁻¹ + (1 - q k)⁻¹)))) := mul_le_mul_of_nonneg_left hpair hn _ = C * (∑ k ∈ E.shared i j, (Fintype.card O : ℝ)⁻¹ * (((E.shared i j).card : ℝ)⁻¹ * ((q k)⁻¹ + (1 - q k)⁻¹))) := by rw [← Finset.mul_sum] rw [← Finset.mul_sum] ring _ = C * (∑ i : O, ∑ j : O, ∑ k ∈ E.shared i j, (Fintype.card O : ℝ)⁻¹ * (((E.shared i j).card : ℝ)⁻¹ * ((q k)⁻¹ + (1 - q k)⁻¹))) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i _ rw [Finset.mul_sum] refine ⟨by simpa [C] using hsand, ?_⟩ by_cases henv : 0 < envMin E ε B · unfold approxRatio rw [if_pos henv] change E.varEnvelope (surrogateDesign E ε B) / envMin E ε B ≤ C have hsurr_sand := hsand (surrogateDesign E ε B) hsurr.1 have hopt_sand := hsand (optimalDesign E ε B) hopt.1 have hA_le : E.surrogateObjective (surrogateDesign E ε B) ≤ E.surrogateObjective (optimalDesign E ε B) := hsurr.2 _ hopt.1 have hCA_le : C * E.surrogateObjective (surrogateDesign E ε B) ≤ C * E.surrogateObjective (optimalDesign E ε B) := mul_le_mul_of_nonneg_left hA_le hCnonneg have hCF_le : C * E.surrogateObjective (optimalDesign E ε B) ≤ C * (E.varEnvelope (optimalDesign E ε B) / 4) := mul_le_mul_of_nonneg_left hopt_sand.1 hCnonneg have hF_le : E.varEnvelope (surrogateDesign E ε B) / 4 ≤ C * (E.varEnvelope (optimalDesign E ε B) / 4) := hsurr_sand.2.trans (hCA_le.trans hCF_le) have hV_le : E.varEnvelope (surrogateDesign E ε B) ≤ C * E.varEnvelope (optimalDesign E ε B) := by nlinarith have hden : 0 < E.varEnvelope (optimalDesign E ε B) := by simpa [envMin] using henv exact (div_le_iff₀ hden).mpr (by simpa [envMin] using hV_le) · unfold approxRatio rw [if_neg henv] exact le_max_left _ _
CausalSmith.Experimentation.BipartiteMinimaxDesign.surrogate_certificate · CausalSmith/Experimentation/EXP_BipartiteMinimaxDesign_Research/TSurrogateCertificate.lean:114