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

For a finite assignment space, the design family is a set of candidate randomization designs defined on that common assignment space.

Definition (Lean source)
Ω :
Type*
DesignFamily Ω :
Type _
Causalean.Experimentation.DesignBased.DesignFamily · Causalean/Experimentation/DesignBased/Optimality.lean:41
def Dominates reviewed
Causalean.Experimentation.DesignBased

For a finite assignment space, an ordered risk scale, a risk criterion for randomization designs, and two randomization designs, the assertion that the first design weakly dominates the second means that its risk is no greater than the second design's risk.

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

For a finite assignment space, an ordered risk scale, a family of candidate randomization designs, a risk criterion, and a randomization design, the assertion that the design is optimal in the family means both that it belongs to the family and that its risk is no greater than the risk of every design in the family.

Definition (Lean source)
Ω :
Type u_1
shared
α :
Type*
𝒟 :
R :
FiniteDesign Ω → α
D₀ :
IsOptimalOn 𝒟 R D₀ :
Prop
clause 1
D₀ ∈ 𝒟
clause 2
D ∈ 𝒟 :
R D₀ ≤ R D
Causalean.Experimentation.DesignBased.IsOptimalOn · Causalean/Experimentation/DesignBased/Optimality.lean:62 · 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 u_1
shared
α :
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:76 · uses DesignFamily , FiniteDesign , IsOptimalOn
def mseRisk reviewed
Causalean.Experimentation.DesignBased

For a finite assignment space, an estimator specified separately for each randomization design, and a real-valued target, the mean-squared-error risk function assigns to each design the mean squared error of that design's estimator about the target, evaluated under that design.

Definition (Lean source)
Ω :
Type u_1
shared
est :
FiniteDesign Ω → Ω → ℝ
μ :
mseRisk est μ :
FiniteDesign Ω → ℝ
fun D => D.mse (est D) μ
Causalean.Experimentation.DesignBased.mseRisk · Causalean/Experimentation/DesignBased/Optimality.lean:95 · 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

For a finite set of states of nature that is nonempty, a risk criterion indexed by states and randomization designs, and a randomization design, the worst-case risk is the largest risk incurred by that design as the state ranges over the given set, provided risk values admit pairwise least upper bounds.

Definition (Lean source)
Ω :
Type u_1
shared
Y :
Type u_2
shared
α :
s :
hs :
s.Nonempty
R :
Y → FiniteDesign Ω → α
D :
worstRisk s hs R D :
α
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

For a family of randomization designs, a finite set of states of nature that is nonempty, a risk criterion indexed by states and randomization designs, and a candidate randomization design, the minimax condition holds precisely when the candidate belongs to the family and its worst-case risk over the state set is no greater than that of every design in the family, provided risk values admit pairwise least upper bounds.

Definition (Lean source)
Ω :
Type u_1
shared
Y :
Type u_2
shared
𝒟 :
s :
hs :
s.Nonempty
α :
R :
Y → FiniteDesign Ω → α
D₀ :
IsMinimaxOn 𝒟 s hs R D₀ :
Prop
clause 1
D₀ ∈ 𝒟
clause 2
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
Ω :
Type u_1
shared
Y :
Type u_2
shared
𝒟 :
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

For a family of randomization designs that is finite and nonempty, a risk criterion indexed by states and randomization designs, and a state of nature, the best achievable risk is the least risk at that state among designs in the family, provided risk values are linearly ordered.

Definition (Lean source)
Ω :
Type u_1
shared
Y :
Type u_2
shared
α :
Type*
𝒟 :
hfin :
𝒟.Finite
hne :
𝒟.Nonempty
R :
Y → FiniteDesign Ω → α
y :
Y
bestRisk 𝒟 hfin hne R y :
α
R y (choose (exists_isOptimalOn 𝒟 (R y) hfin hne))
def regret reviewed
Causalean.Experimentation.DesignBased

For a family of randomization designs that is finite and nonempty, a risk criterion indexed by states and randomization designs, a state of nature, and a randomization design, the design's regret is its risk at that state minus the least risk achievable there within the family, provided risk values form a linearly ordered additive group whose order is preserved by right addition.

Definition (Lean source)
Ω :
Type u_1
shared
Y :
Type u_2
shared
𝒟 :
hfin :
𝒟.Finite
hne :
𝒟.Nonempty
α :
R :
Y → FiniteDesign Ω → α
y :
Y
D :
regret 𝒟 hfin hne R y D :
α
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

For a first real-valued input and a second real-valued input, the Neyman allocation fraction is A/(A+B)\sqrt{A}/(\sqrt{A}+\sqrt{B}). When the inputs are nonnegative arm variances, this is the ratio of the treated arm's standard deviation to the sum of the two arms' standard deviations.

Definition (Lean source)
A B :
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

For a first real-valued input and a second real-valued input, the Neyman optimal-value formula is (A+B)2(\sqrt{A}+\sqrt{B})^2. When the inputs are nonnegative arm variances, this is the squared sum of their standard deviations.

Definition (Lean source)
A B :
neymanOptimalValue A B :
(sqrt A + sqrt B) ^ 2
Causalean.Experimentation.DesignBased.neymanOptimalValue · Causalean/Experimentation/DesignBased/Optimality/Neyman.lean:43
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:79 · 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:48
  • neymanFraction_mem_Ioo theorem — The Neyman fraction lies in (0,1).
    A B :
    hA :
    0 < A
    hB :
    0 < B
    conclusion 1
    conclusion 2
    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:68
  • 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 :
    0 < x
    x < 1
    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:106