Experimentation.Design­Based.Optimality

This file treats a randomization design as the object being chosen from a finite family under an ordered risk criterion.

Optimality 5 core · 5 supporting This file treats a randomization design as the object being chosen from a finite family under an ordered risk criterion. ★ DesignFamily★ exists_isOptimalOn

Design-family optimality criteria

This file treats a randomization design as the object being chosen from a finite family under an ordered risk criterion.

The declarations DesignFamily, Dominates, and IsOptimalOn formalize candidate sets, weak domination, and least-risk designs. The theorem exists_isOptimalOn shows that every nonempty finite design family has an optimal member. The risk functional mseRisk packages the mean squared error of a design-indexed estimator, with mseRisk_nonneg and mseRisk_eq_var_of_unbiased connecting it to nonnegativity and variance for unbiased estimators.

abbrev DesignFamily reviewed
Causalean.Experimentation.DesignBased

A design family: a set of candidate randomization designs on a common assignment space Ω, among which the experimenter chooses.

Definition (Lean source)
abbrev DesignFamily (Ω : Type*) [Fintype Ω] : Type _ := Set (FiniteDesign Ω)
Causalean.Experimentation.DesignBased.DesignFamily · Causalean/Experimentation/DesignBased/Optimality.lean:41
def Dominates reviewed
Causalean.Experimentation.DesignBased

D₁ weakly dominates D₂ under the risk criterion R when it carries no larger risk: R D₁ ≤ R D₂.

Definition (Lean source)
def Dominates {α : Type*} [Preorder α] (R : FiniteDesign Ω → α) (D₁ D₂ : FiniteDesign Ω) : Prop := R D₁ ≤ R D₂
Causalean.Experimentation.DesignBased.Dominates · Causalean/Experimentation/DesignBased/Optimality.lean:45 · uses FiniteDesign
def IsOptimalOn reviewed
Causalean.Experimentation.DesignBased

A design D₀ is optimal in the family 𝒟 under risk R when it belongs to 𝒟 and carries the least risk among all members.

Definition (Lean source)
def IsOptimalOn {α : Type*} [Preorder α] (𝒟 : DesignFamily Ω) (R : FiniteDesign Ω → α) (D₀ : FiniteDesign Ω) : Prop := D₀ ∈ 𝒟 ∧ ∀ D ∈ 𝒟, R D₀ ≤ R D
Causalean.Experimentation.DesignBased.IsOptimalOn · Causalean/Experimentation/DesignBased/Optimality.lean:60 · uses DesignFamily , FiniteDesign
theorem exists_isOptimalOn reviewed
Causalean.Experimentation.DesignBased

Existence of an optimal design. For a design family 𝒟 and a risk criterion R valued in a linear order, if 𝒟 is finite and 𝒟 is nonempty, then there exists a design in 𝒟 that is optimal — it dominates every other member of the family under R.

Formal statement
α :
Type*
𝒟 :
R :
FiniteDesign Ω → α
hfin :
𝒟.Finite
hne :
𝒟.Nonempty
∃ D₀, IsOptimalOn 𝒟 R D₀
Proof (Lean source)
theorem exists_isOptimalOn {α : Type*} [LinearOrder α] (𝒟 : DesignFamily Ω) (R : FiniteDesign Ω → α) (hfin : 𝒟.Finite) (hne : 𝒟.Nonempty) : ∃ D₀, IsOptimalOn 𝒟 R D₀ := by let s := hfin.toFinset have hs : s.Nonempty := by simpa [s] using hfin.toFinset_nonempty.mpr hne rcases Finset.exists_min_image s R hs with ⟨D₀, hD₀, hmin⟩ refine ⟨D₀, hfin.mem_toFinset.mp hD₀, ?_⟩ intro D hD exact hmin D (hfin.mem_toFinset.mpr hD)
Causalean.Experimentation.DesignBased.exists_isOptimalOn · Causalean/Experimentation/DesignBased/Optimality.lean:72 · uses DesignFamily , FiniteDesign , IsOptimalOn
def mseRisk reviewed
Causalean.Experimentation.DesignBased

The mean-squared-error risk of a design-indexed estimator est for target μ: the risk assigned to a design D is est D's mean squared error under D.

Definition (Lean source)
def mseRisk (est : FiniteDesign Ω → Ω → ℝ) (μ : ℝ) : FiniteDesign Ω → ℝ := fun D => D.mse (est D) μ
Causalean.Experimentation.DesignBased.mseRisk · Causalean/Experimentation/DesignBased/Optimality.lean:91 · uses FiniteDesign
5 supporting declarations (lemmas, instances)
Minimax 5 core · 3 supporting Minimax designs minimize worst-case risk over a finite family of states of nature. ★ exists_isMinimaxOn

Minimax design criteria

Minimax designs minimize worst-case risk over a finite family of states of nature.

The definition worstRisk takes the maximum of R y D over a nonempty finite state set, and IsMinimaxOn asks a design to minimize that criterion inside a design family. The theorem exists_isMinimaxOn inherits finite-family existence from exists_isOptimalOn. The declarations bestRisk, regret, and regret_nonneg formalize statewise regret relative to the best design available in the same finite family.

def worstRisk reviewed
Causalean.Experimentation.DesignBased

The worst-case risk of a design D over a nonempty finite set s of states of nature: the largest risk R y D incurred as the state y ranges over s.

Definition (Lean source)
noncomputable def worstRisk {α : Type*} [SemilatticeSup α] (s : Finset Y) (hs : s.Nonempty) (R : Y → FiniteDesign Ω → α) (D : FiniteDesign Ω) : α := s.sup' hs (fun y => R y D)
Causalean.Experimentation.DesignBased.worstRisk · Causalean/Experimentation/DesignBased/Optimality/Minimax.lean:38 · uses FiniteDesign
def IsMinimaxOn reviewed
Causalean.Experimentation.DesignBased

A design is minimax in the family 𝒟 over the states s when it belongs to 𝒟 and has the least worst-case risk among all members.

Definition (Lean source)
def IsMinimaxOn (𝒟 : DesignFamily Ω) (s : Finset Y) (hs : s.Nonempty) {α : Type*} [SemilatticeSup α] (R : Y → FiniteDesign Ω → α) (D₀ : FiniteDesign Ω) : Prop := D₀ ∈ 𝒟 ∧ ∀ D ∈ 𝒟, worstRisk s hs R D₀ ≤ worstRisk s hs R D
theorem exists_isMinimaxOn reviewed
Causalean.Experimentation.DesignBased

Existence of a minimax design. For a design family 𝒟 and a risk criterion R indexed by states of nature, if the state set s is nonempty, the design family 𝒟 is finite, and 𝒟 is nonempty, then there exists a design in 𝒟 that is minimax — it minimizes the worst-case risk over s among all members of 𝒟. Immediate from exists_isOptimalOn applied to the worst-case-risk criterion.

Formal statement
𝒟 :
s :
hs :
s.Nonempty
α :
Type*
R :
Y → FiniteDesign Ω → α
hfin :
𝒟.Finite
hne :
𝒟.Nonempty
∃ D₀, IsMinimaxOn 𝒟 s hs R D₀
Proof (Lean source)
theorem exists_isMinimaxOn (𝒟 : DesignFamily Ω) (s : Finset Y) (hs : s.Nonempty) {α : Type*} [LinearOrder α] (R : Y → FiniteDesign Ω → α) (hfin : 𝒟.Finite) (hne : 𝒟.Nonempty) : ∃ D₀, IsMinimaxOn 𝒟 s hs R D₀ := exists_isOptimalOn 𝒟 (worstRisk s hs R) hfin hne
def bestRisk reviewed
Causalean.Experimentation.DesignBased

The best achievable risk at state y over the finite design family 𝒟: the least risk R y D as D ranges over 𝒟. (Defined via a chosen minimizer, which exists by exists_isOptimalOn; bestRisk_le and le_bestRisk characterize it.)

Definition (Lean source)
noncomputable def bestRisk {α : Type*} [LinearOrder α] (𝒟 : DesignFamily Ω) (hfin : 𝒟.Finite) (hne : 𝒟.Nonempty) (R : Y → FiniteDesign Ω → α) (y : Y) : α := R y (choose (exists_isOptimalOn 𝒟 (R y) hfin hne))
def regret reviewed
Causalean.Experimentation.DesignBased

The regret of a design D at state y, relative to the finite family 𝒟: how much worse its risk is than the best risk achievable in 𝒟 at that state.

Definition (Lean source)
noncomputable def regret (𝒟 : DesignFamily Ω) (hfin : 𝒟.Finite) (hne : 𝒟.Nonempty) {α : Type*} [AddGroup α] [LinearOrder α] [AddRightMono α] (R : Y → FiniteDesign Ω → α) (y : Y) (D : FiniteDesign Ω) : α := R y D - bestRisk 𝒟 hfin hne R y
3 supporting declarations (lemmas, instances)
Neyman 3 core · 3 supporting Neyman allocation minimizes the two-arm variance proxy by assigning in proportion to standard deviations. ★ neyman_allocation_eq_at_fraction

Neyman allocation

Neyman allocation minimizes the two-arm variance proxy by assigning in proportion to standard deviations.

The definitions neymanFraction and neymanOptimalValue package the optimizer sqrt A / (sqrt A + sqrt B) and the value (sqrt A + sqrt B)^2. Theorems neyman_allocation_lower_bound, neyman_allocation_eq_at_fraction, and neyman_allocation_isMinimizer prove the lower bound, show equality at the Neyman fraction, and state the resulting minimization property on the interval (0, 1).

def neymanFraction reviewed
Causalean.Experimentation.DesignBased

The Neyman-fraction formula: √A / (√A + √B), the treatment fraction that minimizes the two-arm variance A/x + B/(1−x) when the arm variances are positive.

Definition (Lean source)
noncomputable def neymanFraction (A B : ℝ) : ℝ := sqrt A / (sqrt A + sqrt B)
Causalean.Experimentation.DesignBased.neymanFraction · Causalean/Experimentation/DesignBased/Optimality/Neyman.lean:37
def neymanOptimalValue reviewed
Causalean.Experimentation.DesignBased

The Neyman optimal-value formula: (√A + √B)², the minimized two-arm variance when the arm variances are positive.

Definition (Lean source)
noncomputable def neymanOptimalValue (A B : ℝ) : ℝ := (sqrt A + sqrt B) ^ 2
Causalean.Experimentation.DesignBased.neymanOptimalValue · Causalean/Experimentation/DesignBased/Optimality/Neyman.lean:41
theorem neyman_allocation_eq_at_fraction reviewed
Causalean.Experimentation.DesignBased

Neyman allocation optimum. For nonnegative treated-arm and control-arm outcome variances A and B, evaluating the two-arm variance A/x + B/(1−x) at the Neyman fraction x* = √A/(√A+√B) yields exactly its lower bound (√A + √B)²; hence the Neyman fraction minimizes the variance over (0,1).

Formal statement
A B :
hA :
0 ≤ A
hB :
0 ≤ B
A / neymanFraction A B + B / (1 - neymanFraction A B) = neymanOptimalValue A B
Proof (Lean source)
theorem neyman_allocation_eq_at_fraction {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) : A / neymanFraction A B + B / (1 - neymanFraction A B) = neymanOptimalValue A B := by rcases eq_or_lt_of_le hA with rfl | hA · simp [neymanFraction, neymanOptimalValue, Real.sq_sqrt hB] rcases eq_or_lt_of_le hB with rfl | hB · simp [neymanFraction, neymanOptimalValue, Real.sq_sqrt (le_of_lt hA), ne_of_gt (Real.sqrt_pos.2 hA)] unfold neymanFraction neymanOptimalValue have hs : 0 < sqrt A := Real.sqrt_pos.2 hA have ht : 0 < sqrt B := Real.sqrt_pos.2 hB have hsum : sqrt A + sqrt B ≠ 0 := ne_of_gt (add_pos hs ht) have hsne : sqrt A ≠ 0 := ne_of_gt hs have htne : sqrt B ≠ 0 := ne_of_gt ht have hsub : 1 - sqrt A / (sqrt A + sqrt B) = sqrt B / (sqrt A + sqrt B) := by field_simp [hsum] ring rw [hsub] field_simp [hsum, hsne, htne] ring_nf rw [Real.sq_sqrt (le_of_lt hA), Real.sq_sqrt (le_of_lt hB)] ring
Causalean.Experimentation.DesignBased.neyman_allocation_eq_at_fraction · Causalean/Experimentation/DesignBased/Optimality/Neyman.lean:76 · uses neymanFraction , neymanOptimalValue
3 supporting declarations (lemmas, instances)
  • neyman_allocation_lower_bound theorem — Neyman allocation lower bound. For nonnegative arm variances A, B and any treatment fraction x ∈ (0,1), the two-arm variance is at least (√A + √B)².
    A B x :
    hA :
    0 ≤ A
    hB :
    0 ≤ B
    hx0 :
    0 < x
    hx1 :
    x < 1
    neymanOptimalValue A B ≤ A / x + B / (1 - x)
    Proof (Lean source)
    theorem neyman_allocation_lower_bound {A B x : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hx0 : 0 < x) (hx1 : x < 1) : neymanOptimalValue A B ≤ A / x + B / (1 - x) := by -- A/x + B/(1−x) − (√A+√B)² = (√(A(1−x)/x) − √(Bx/(1−x)))² ≥ 0 (the cross term √(AB) cancels x). unfold neymanOptimalValue have hx1' : 0 < 1 - x := sub_pos.mpr hx1 have hxne : x ≠ 0 := ne_of_gt hx0 have h1xne : 1 - x ≠ 0 := ne_of_gt hx1' have hden : 0 < x * (1 - x) := mul_pos hx0 hx1' have hcommon : A / x + B / (1 - x) = (A * (1 - x) + B * x) / (x * (1 - x)) := by field_simp [hxne, h1xne] rw [hcommon] rw [le_div_iff₀ hden] have hsqA : sqrt A ^ 2 = A := Real.sq_sqrt hA have hsqB : sqrt B ^ 2 = B := Real.sq_sqrt hB nlinarith [sq_nonneg (sqrt A - (sqrt A + sqrt B) * x)]
    Causalean.Experimentation.DesignBased.neyman_allocation_lower_bound · Causalean/Experimentation/DesignBased/Optimality/Neyman.lean:45
  • neymanFraction_mem_Ioo theorem — The Neyman fraction lies in (0,1).
    A B :
    hA :
    0 < A
    hB :
    0 < B
    0 < neymanFraction A B ∧ neymanFraction A B < 1
    Proof (Lean source)
    theorem neymanFraction_mem_Ioo {A B : ℝ} (hA : 0 < A) (hB : 0 < B) : 0 < neymanFraction A B ∧ neymanFraction A B < 1 := by unfold neymanFraction have hs : 0 < sqrt A := Real.sqrt_pos.2 hA have ht : 0 < sqrt B := Real.sqrt_pos.2 hB constructor · exact div_pos hs (add_pos hs ht) · exact (div_lt_one (add_pos hs ht)).2 (lt_add_of_pos_right (sqrt A) ht)
    Causalean.Experimentation.DesignBased.neymanFraction_mem_Ioo · Causalean/Experimentation/DesignBased/Optimality/Neyman.lean:65
  • neyman_allocation_isMinimizer theorem — The Neyman fraction is a minimizer: its two-arm variance is no larger than the variance at any treatment fraction in (0,1).
    A B :
    hA :
    0 ≤ A
    hB :
    0 ≤ B
    ∀ x
    if
    0 < x
    and
    x < 1
    then
    A / neymanFraction A B + B / (1 - neymanFraction A B) ≤ A / x + B / (1 - x)
    Proof (Lean source)
    theorem neyman_allocation_isMinimizer {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) : ∀ x, 0 < x → x < 1 → A / neymanFraction A B + B / (1 - neymanFraction A B) ≤ A / x + B / (1 - x) := by intro x hx0 hx1 rw [neyman_allocation_eq_at_fraction hA hB] exact neyman_allocation_lower_bound hA hB hx0 hx1
    Causalean.Experimentation.DesignBased.neyman_allocation_isMinimizer · Causalean/Experimentation/DesignBased/Optimality/Neyman.lean:103