Stat.Minimax

Minimax lower-bound machinery: risk definitions, maximal couplings, coordinatewise overlap, Le Cam two-point methods, Pinsker/KL bridges, and rate statements for estimation problems.

Finite­Side­Information 37 core · 43 supporting · 11 submodules This umbrella module exports finite-simplex coordinates, finite squared-risk regularity, exact-versus-empirical comparison, concentration, compact-fiber approximation, the convergence theorem, and its closed-simplex spec Finite­Squared­Loss 24 core · 35 supporting · 4 submodules Finite bounded decision problems: randomized designs, dependent finite observations, conditional mixing under squared loss, and an attaining minimax procedure with a least-favorable finite prior. Moment­Matched­Mixture 10 to review 41 core · 61 supporting · 5 submodules This umbrella module exports a model-agnostic path from exponential likelihood inner products and matched bounded-prior moments, through one-coordinate and finite-product total variation, to explicit squared-error lower
Total­Variation 2 core · 10 supporting This file defines the statistical total variation distance between two probability measures on a common measurable space. ★ one_sub_tvDist_le_test

Total Variation Distance

This file defines the statistical total variation distance between two probability measures on a common measurable space. It develops elementary bounds and the testing inequality that underlies Le Cam's two-point minimax method.

def tvDist reviewed
Causalean.Stat

For a sample space equipped with a σ-algebra and two measures on that space, the statistical total variation distance is the supremum, over all measurable events AA, of the absolute difference between the two measures' real-valued masses of AA.

Definition (Lean source)
Ω :
Type u_1
shared
μ ν :
tvDist μ ν :
⨆ A : {A : Set Ω // MeasurableSet A}, |μ.real A.1 - ν.real A.1|
theorem one_sub_tvDist_le_test reviewed
Causalean.Stat

Le Cam testing bound. For probability measures μ and ν on the same space, any measurable rejection region A yields a total testing error — the probability of A under μ plus the probability of the complement of A under ν — that is at least 1 − tvDist(μ,ν).

Formal statement
Ω :
shared
hA :
1 - tvDist μ ν ≤ μ.real A + ν.real Aᶜ
Proof (Lean source)
theorem one_sub_tvDist_le_test {A : Set Ω} (hA : MeasurableSet A) : 1 - tvDist μ ν ≤ μ.real A + ν.real Aᶜ := by have hcompl : ν.real Aᶜ = 1 - ν.real A := by rw [measureReal_compl hA, probReal_univ] rw [hcompl] have h := measureReal_sub_le_tvDist (μ := μ) (ν := ν) hA linarith
Causalean.Stat.one_sub_tvDist_le_test · Causalean/Stat/Minimax/TotalVariation.lean:102 · uses tvDist
10 supporting declarations (lemmas, instances)
  • abs_measureReal_sub_le_one theorem — Every term of the supremum defining tvDist is bounded by 1.
    Ω :
    shared
    A :
    Set Ω
    |μ.real A - ν.real A| ≤ 1
    Proof (Lean source)
    theorem abs_measureReal_sub_le_one (A : Set Ω) : |μ.real A - ν.real A| ≤ 1 := by have hμ : μ.real A ∈ Icc (0 : ℝ) 1 := ⟨measureReal_nonneg, by have := measureReal_mono (μ := μ) (Set.subset_univ A) (measure_ne_top μ _) simpa [probReal_univ] using this⟩ have hν : ν.real A ∈ Icc (0 : ℝ) 1 := ⟨measureReal_nonneg, by have := measureReal_mono (μ := ν) (Set.subset_univ A) (measure_ne_top ν _) simpa [probReal_univ] using this⟩ rw [abs_le] constructor <;> [nlinarith [hμ.1, hμ.2, hν.1, hν.2]; nlinarith [hμ.1, hμ.2, hν.1, hν.2]]
    Causalean.Stat.abs_measureReal_sub_le_one · Causalean/Stat/Minimax/TotalVariation.lean:55
  • bddAbove_tvDist_range theorem — The family defining tvDist is bounded above (by 1).
    Ω :
    shared
    BddAbove (Set.range fun A : {A : Set Ω // MeasurableSet A} => |μ.real A.1 - ν.real A.1|)
    Proof (Lean source)
    theorem bddAbove_tvDist_range : BddAbove (Set.range fun A : {A : Set Ω // MeasurableSet A} => |μ.real A.1 - ν.real A.1|) := by refine ⟨1, ?_⟩ rintro _ ⟨A, rfl⟩ exact abs_measureReal_sub_le_one A.1
    Causalean.Stat.bddAbove_tvDist_range · Causalean/Stat/Minimax/TotalVariation.lean:68
  • abs_measureReal_sub_le_tvDist theorem — For a measurable set A, the gap |μ.real A − ν.real A| is at most tvDist μ ν.
    Ω :
    shared
    hA :
    |μ.real A - ν.real A| ≤ tvDist μ ν
    Proof (Lean source)
    theorem abs_measureReal_sub_le_tvDist {A : Set Ω} (hA : MeasurableSet A) : |μ.real A - ν.real A| ≤ tvDist μ ν := le_ciSup bddAbove_tvDist_range (⟨A, hA⟩ : {A : Set Ω // MeasurableSet A})
    Causalean.Stat.abs_measureReal_sub_le_tvDist · Causalean/Stat/Minimax/TotalVariation.lean:75
  • measureReal_sub_le_tvDist theorem — The signed gap ν.real A − μ.real A is at most tvDist μ ν.
    Ω :
    shared
    hA :
    ν.real A - μ.real A ≤ tvDist μ ν
    Proof (Lean source)
    theorem measureReal_sub_le_tvDist {A : Set Ω} (hA : MeasurableSet A) : ν.real A - μ.real A ≤ tvDist μ ν := (le_abs_self _).trans <| by rw [abs_sub_comm]; exact abs_measureReal_sub_le_tvDist hA
    Causalean.Stat.measureReal_sub_le_tvDist · Causalean/Stat/Minimax/TotalVariation.lean:80
  • tvDist_nonneg theorem — Total variation distance between probability measures is nonnegative.
    Ω :
    shared
    0 ≤ tvDist μ ν
    Proof (Lean source)
    theorem tvDist_nonneg : 0 ≤ tvDist μ ν := by have := abs_measureReal_sub_le_tvDist (μ := μ) (ν := ν) MeasurableSet.empty simpa using (abs_nonneg _).trans this
    Causalean.Stat.tvDist_nonneg · Causalean/Stat/Minimax/TotalVariation.lean:86
  • tvDist_le_one theorem — Total variation distance between probability measures is at most one.
    Ω :
    shared
    tvDist μ ν ≤ 1
    Proof (Lean source)
    theorem tvDist_le_one : tvDist μ ν ≤ 1 := ciSup_le fun A => abs_measureReal_sub_le_one A.1
    Causalean.Stat.tvDist_le_one · Causalean/Stat/Minimax/TotalVariation.lean:91
  • tvDist_symm theorem — tvDist is symmetric.
    Ω :
    Type u_1
    shared
    μ ν :
    tvDist μ ν = tvDist ν μ
    Proof (Lean source)
    theorem tvDist_symm (μ ν : Measure Ω) : tvDist μ ν = tvDist ν μ := by unfold tvDist congr 1 ext A rw [abs_sub_comm]
  • tvDist_integral_range theorem — The expectation gap of a measurable statistic confined to an interval of width c is at most that width times the total-variation distance between the two probability laws.
    Ω :
    Type u_1
    shared
    f :
    Ω → ℝ
    hf :
    a c :
    hc :
    0 ≤ c
    hrange :
    ∀ x, f x ∈ Icc a (a + c)
    |(∫ x, f x ∂μ) - ∫ x, f x ∂ν| ≤ tvDist μ ν * c
    Proof (Lean source)
    theorem tvDist_integral_range (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (f : Ω → ℝ) (hf : Measurable f) (a c : ℝ) (hc : 0 ≤ c) (hrange : ∀ x, f x ∈ Icc a (a + c)) : |(∫ x, f x ∂μ) - ∫ x, f x ∂ν| ≤ tvDist μ ν * c := by let g : Ω → ℝ := fun x => f x - a have hg : Measurable g := hf.sub_const a have hg0 : ∀ x, 0 ≤ g x := fun x => by dsimp [g] linarith [(hrange x).1] have hgc : ∀ x, g x ≤ c := fun x => by dsimp [g] linarith [(hrange x).2] have hgint (ρ : Measure Ω) [IsProbabilityMeasure ρ] : Integrable g ρ := Integrable.of_bound hg.aestronglyMeasurable c (Filter.Eventually.of_forall fun x => by rw [Real.norm_eq_abs, abs_of_nonneg (hg0 x)] exact hgc x) have htail_meas (ρ : Measure Ω) : Measurable (fun t : ℝ => ρ.real {x | t ≤ g x}) := by change Measurable fun t : ℝ => (ρ {x | t ≤ g x}).toReal exact Measurable.ennreal_toReal (Antitone.measurable (fun _ _ hst => measure_mono (fun _ hx => hst.trans hx))) have htail_int (ρ : Measure Ω) [IsProbabilityMeasure ρ] : IntegrableOn (fun t : ℝ => ρ.real {x | t ≤ g x}) (Ioc 0 c) := by exact Integrable.of_bound ((htail_meas ρ).aestronglyMeasurable.mono_measure Measure.restrict_le_self) 1 (Filter.Eventually.of_forall fun t => by rw [Real.norm_eq_abs, abs_of_nonneg measureReal_nonneg] exact measureReal_le_one) have hlayer (ρ : Measure Ω) [IsProbabilityMeasure ρ] : ∫ x, g x ∂ρ = ∫ t in Ioc 0 c, ρ.real {x | t ≤ g x} := by exact (hgint ρ).integral_eq_integral_Ioc_meas_le (Filter.Eventually.of_forall hg0) (Filter.Eventually.of_forall hgc) have hfint (ρ : Measure Ω) [IsProbabilityMeasure ρ] : Integrable f ρ := Integrable.of_bound hf.aestronglyMeasurable (|a| + c) (Filter.Eventually.of_forall fun x => by rw [Real.norm_eq_abs] calc |f x| = |a + g x| := by simp [g] _ ≤ |a| + |g x| := abs_add_le _ _ _ ≤ |a| + c := by gcongr rw [abs_of_nonneg (hg0 x)] exact hgc x) have hshift (ρ : Measure Ω) [IsProbabilityMeasure ρ] : ∫ x, g x ∂ρ = (∫ x, f x ∂ρ) - a := by rw [show g = fun x => f x - a from rfl, integral_sub (hfint ρ) (integrable_const a)] simp have heq : (∫ x, f x ∂μ) - ∫ x, f x ∂ν = (∫ x, g x ∂μ) - ∫ x, g x ∂ν := by rw [hshift μ, hshift ν] ring rw [heq, hlayer μ, hlayer ν, ← integral_sub (htail_int μ) (htail_int ν)] have hbound : ∀ᵐ t ∂volume.restrict (Ioc 0 c), ‖μ.real {x | t ≤ g x} - ν.real {x | t ≤ g x}‖ ≤ tvDist μ ν := by exact Filter.Eventually.of_forall fun t => by rw [Real.norm_eq_abs] exact abs_measureReal_sub_le_tvDist (hg measurableSet_Ici) calc |∫ t in Ioc 0 c, (μ.real {x | t ≤ g x} - ν.real {x | t ≤ g x})| = ‖∫ t in Ioc 0 c, (μ.real {x | t ≤ g x} - ν.real {x | t ≤ g x})‖ := by rw [Real.norm_eq_abs] _ ≤ tvDist μ ν * volume.real (Ioc 0 c) := norm_setIntegral_le_of_norm_le_const_ae (by simp) hbound _ = tvDist μ ν * c := by rw [measureReal_def, Real.volume_Ioc, ENNReal.toReal_ofReal (by linarith : 0 ≤ c - 0)] ring
    Causalean.Stat.tvDist_integral_range · Causalean/Stat/Minimax/TotalVariation.lean:116
  • tvDist_integral_le_of_range_ae theorem — A measurable statistic that lies almost surely in an interval of width c under both laws has an expectation gap no larger than c times their total-variation distance.
    Ω :
    Type u_1
    shared
    f :
    Ω → ℝ
    hf :
    a c :
    hc :
    0 ≤ c
    :
    ∀ᵐ x ∂μ, f x ∈ Icc a (a + c)
    :
    ∀ᵐ x ∂ν, f x ∈ Icc a (a + c)
    |(∫ x, f x ∂μ) - ∫ x, f x ∂ν| ≤ tvDist μ ν * c
    Proof (Lean source)
    theorem tvDist_integral_le_of_range_ae (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (f : Ω → ℝ) (hf : Measurable f) (a c : ℝ) (hc : 0 ≤ c) (hμ : ∀ᵐ x ∂μ, f x ∈ Icc a (a + c)) (hν : ∀ᵐ x ∂ν, f x ∈ Icc a (a + c)) : |(∫ x, f x ∂μ) - ∫ x, f x ∂ν| ≤ tvDist μ ν * c := by let f' : Ω → ℝ := fun x => max a (min (a + c) (f x)) have hf' : Measurable f' := measurable_const.max (measurable_const.min hf) have hac : a ≤ a + c := by linarith have hrange : ∀ x, f' x ∈ Icc a (a + c) := fun x => by constructor · exact le_max_left _ _ · exact max_le hac (min_le_left _ _) have hμ_eq : f' =ᵐ[μ] f := by filter_upwards [hμ] with x hx simp only [f', min_eq_right hx.2, max_eq_right hx.1] have hν_eq : f' =ᵐ[ν] f := by filter_upwards [hν] with x hx simp only [f', min_eq_right hx.2, max_eq_right hx.1] rw [← integral_congr_ae hμ_eq, ← integral_congr_ae hν_eq] exact tvDist_integral_range μ ν f' hf' a c hc hrange
    Causalean.Stat.tvDist_integral_le_of_range_ae · Causalean/Stat/Minimax/TotalVariation.lean:194
  • tvDist_integral_le_of_abs_le_ae theorem — A measurable statistic bounded in absolute value by M almost surely under both laws has an expectation gap no larger than 2M times their total-variation distance.
    Ω :
    Type u_1
    shared
    f :
    Ω → ℝ
    hf :
    M :
    hM :
    0 ≤ M
    :
    ∀ᵐ x ∂μ, |f x| ≤ M
    :
    ∀ᵐ x ∂ν, |f x| ≤ M
    |(∫ x, f x ∂μ) - ∫ x, f x ∂ν| ≤ 2 * M * tvDist μ ν
    Proof (Lean source)
    theorem tvDist_integral_le_of_abs_le_ae (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (f : Ω → ℝ) (hf : Measurable f) (M : ℝ) (hM : 0 ≤ M) (hμ : ∀ᵐ x ∂μ, |f x| ≤ M) (hν : ∀ᵐ x ∂ν, |f x| ≤ M) : |(∫ x, f x ∂μ) - ∫ x, f x ∂ν| ≤ 2 * M * tvDist μ ν := by have hμ_range : ∀ᵐ x ∂μ, f x ∈ Icc (-M) (-M + 2 * M) := by filter_upwards [hμ] with x hx have hx' := abs_le.mp hx constructor <;> linarith have hν_range : ∀ᵐ x ∂ν, f x ∈ Icc (-M) (-M + 2 * M) := by filter_upwards [hν] with x hx have hx' := abs_le.mp hx constructor <;> linarith calc |(∫ x, f x ∂μ) - ∫ x, f x ∂ν| ≤ tvDist μ ν * (2 * M) := tvDist_integral_le_of_range_ae μ ν f hf (-M) (2 * M) (by positivity) hμ_range hν_range _ = 2 * M * tvDist μ ν := by ring
    Causalean.Stat.tvDist_integral_le_of_abs_le_ae · Causalean/Stat/Minimax/TotalVariation.lean:221
Chi­Squared 6 core · 10 supporting This module defines the real chi-squared divergence chiSqDiv from the squared deviation of the Radon-Nikodym density and proves its main minimax testing interfaces. ★ tvDist_le_half_sqrt_chiSqDiv★ one_add_chiSqDiv_pi_iid★ one_add_chiSqDiv_pi_iid_general★ testing_error_lower_of_chi★ le_cam_two_point_chisq

Chi-squared divergence

This module defines the real chi-squared divergence chiSqDiv from the squared deviation of the Radon-Nikodym density and proves its main minimax testing interfaces. The base results include chiSqDiv_nonneg, tvDist_le_half_sqrt_chiSqDiv, and chiSqDiv_eq; the tensorization layer gives chiSqDiv_prod, one_add_chiSqDiv_pi_iid, one_add_chiSqDiv_pi_iid_general, and chiSqDiv_prod_ancillary; and the testing layer culminates in testing_error_lower_of_chi and le_cam_two_point_chisq.

def chiSqDiv reviewed
Causalean.Stat

For two measures on the same measurable space, the finite real chi-squared divergence of the first relative to the second is the integral, under the second measure, of the square of one less the Radon--Nikodym density of the first measure with respect to the second, with infinite density values represented by zero in the real-valued integrand.

Definition (Lean source)
Ω :
Type u_1
shared
μ ν :
chiSqDiv μ ν :
∫ x, ((μ.rnDeriv ν x).toReal - 1) ^ 2 ∂ν
theorem tvDist_le_half_sqrt_chiSqDiv reviewed
Causalean.Stat

Cauchy–Schwarz on Scheffé. For probability measures μ, ν with μ absolutely continuous with respect to ν and whose squared Radon–Nikodym density deviation (dμ/dν − 1)² is ν-integrable, the total variation distance tvDist μ ν is bounded by half the square root of the χ²-divergence chiSqDiv μ ν.

Formal statement
Ω :
Type u_1
shared
hac :
μ ≪ ν
hint :
Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν
tvDist μ ν ≤ (1/2) * sqrt (chiSqDiv μ ν)
Proof (Lean source)
theorem tvDist_le_half_sqrt_chiSqDiv (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν) : tvDist μ ν ≤ (1/2) * sqrt (chiSqDiv μ ν) := by -- Density deviation `f = p − 1`. set f : Ω → ℝ := fun x => (μ.rnDeriv ν x).toReal - 1 with hf_def have hmeas : AEStronglyMeasurable f ν := by fun_prop -- `f ∈ L²(ν)` since `f²` is integrable. have hfL2 : MemLp f 2 ν := (memLp_two_iff_integrable_sq hmeas).2 hint -- `|f| ∈ L²(ν)` (same norm) and `1 ∈ L²(ν)` (`ν` probability). have habsL2 : MemLp (fun x => |f x|) (ofReal 2) ν := by have h := hfL2.norm simp only [Real.norm_eq_abs] at h simpa using h have honeL2 : MemLp (fun _ : Ω => (1:ℝ)) (ofReal 2) ν := by simpa using (memLp_const (1:ℝ) : MemLp (fun _ : Ω => (1:ℝ)) 2 ν) -- Hölder with `p = q = 2`: `∫ |f|·1 ≤ (∫ |f|²)^½ · (∫ 1²)^½`. have hholder : ∫ x, |f x| * (1:ℝ) ∂ν ≤ (∫ x, |f x| ^ (2:ℝ) ∂ν) ^ (1 / (2:ℝ)) * (∫ x, (1:ℝ) ^ (2:ℝ) ∂ν) ^ (1 / (2:ℝ)) := integral_mul_le_Lp_mul_Lq_of_nonneg Real.HolderConjugate.two_two (Filter.Eventually.of_forall fun x => abs_nonneg _) (Filter.Eventually.of_forall fun _ => zero_le_one) habsL2 honeL2 -- Simplify the right-hand factors. have hone : (∫ x, (1:ℝ) ^ (2:ℝ) ∂ν) ^ (1 / (2:ℝ)) = 1 := by simp have hLHS : ∫ x, |f x| * (1:ℝ) ∂ν = ∫ x, |f x| ∂ν := by simp -- `∫ |f|² = chiSqDiv μ ν` (rewrite real power 2 to `^2`). have hsq : ∫ x, |f x| ^ (2:ℝ) ∂ν = chiSqDiv μ ν := by rw [chiSqDiv] apply integral_congr_ae refine Filter.Eventually.of_forall fun x => ?_ change |f x| ^ (2:ℝ) = (f x) ^ 2 rw [Real.rpow_two, sq_abs] -- `∫ |f| ≤ √(chiSqDiv μ ν)`. have hint_abs : ∫ x, |f x| ∂ν ≤ sqrt (chiSqDiv μ ν) := by rw [hLHS, hsq, hone, mul_one] at hholder have hrw : (chiSqDiv μ ν) ^ (1 / (2:ℝ)) = sqrt (chiSqDiv μ ν) := (Real.sqrt_eq_rpow (chiSqDiv μ ν)).symm rwa [hrw] at hholder -- Combine with Scheffé. have hscheffe := tvDist_le_half_integral_abs_rnDeriv μ ν hac calc tvDist μ ν ≤ (1/2) * ∫ x, |f x| ∂ν := hscheffe _ ≤ (1/2) * sqrt (chiSqDiv μ ν) := by apply mul_le_mul_of_nonneg_left hint_abs (by norm_num)
Causalean.Stat.tvDist_le_half_sqrt_chiSqDiv · Causalean/Stat/Minimax/ChiSquared.lean:66 · uses chiSqDiv , tvDist
theorem one_add_chiSqDiv_pi_iid reviewed
Causalean.Stat

n-fold i.i.d. tensorization of the χ²-divergence on a finite sample space. For probability measures μ, ν on a finite space Ω with μ absolutely continuous with respect to ν, the χ²-divergence of the n-fold i.i.d. product laws satisfies 1 + χ²(μ^⊗n ‖ ν^⊗n) = (1 + χ²(μ‖ν))^n.

Formal statement
hac :
μ ≪ ν
n :
1 + chiSqDiv (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν))
= (1 + chiSqDiv μ ν) ^ n
Proof (Lean source)
theorem one_add_chiSqDiv_pi_iid {Ω : Type*} [MeasurableSpace Ω] [Fintype Ω] [MeasurableSingletonClass Ω] (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (n : ℕ) : 1 + chiSqDiv (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) = (1 + chiSqDiv μ ν) ^ n := by induction n with | zero => rw [Measure.pi_of_empty (fun _ : Fin 0 => μ), Measure.pi_of_empty (fun _ : Fin 0 => ν), chiSqDiv_self] simp | succ n ih => have hμ := (measurePreserving_piFinSuccAbove (fun _ : Fin (n + 1) => μ) 0).map_eq have hν := (measurePreserving_piFinSuccAbove (fun _ : Fin (n + 1) => ν) 0).map_eq rw [← chiSqDiv_map_measurableEquiv (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) => Ω) 0), hμ, hν] have hac_pi : Measure.pi (fun _ : Fin n => μ) ≪ Measure.pi (fun _ : Fin n => ν) := pi_iid_absolutelyContinuous μ ν hac n rw [chiSqDiv_prod μ ν (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) hac hac_pi (Integrable.of_finite) (Integrable.of_finite), ih, pow_succ] ring
Causalean.Stat.one_add_chiSqDiv_pi_iid · Causalean/Stat/Minimax/ChiSquared.lean:294 · uses chiSqDiv
theorem one_add_chiSqDiv_pi_iid_general reviewed
Causalean.Stat

n-fold i.i.d. tensorization of the χ²-divergence on a GENERAL measurable space. For probability measures μ, ν on any measurable space S such that μ is absolutely continuous with respect to ν and the single-sample squared density deviation (dμ/dν − 1)² is ν-integrable, the χ²-divergence of the n-fold i.i.d. product tensorizes multiplicatively: 1 + χ²(μ^⊗n ‖ ν^⊗n) = (1 + χ²(μ‖ν))^n.

Formal statement
S :
hac :
μ ≪ ν
hint :
Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν
n :
1 + chiSqDiv (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν))
= (1 + chiSqDiv μ ν) ^ n
Proof (Lean source)
theorem one_add_chiSqDiv_pi_iid_general {S : Type*} [MeasurableSpace S] (μ ν : Measure S) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν) (n : ℕ) : 1 + chiSqDiv (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) = (1 + chiSqDiv μ ν) ^ n := by induction n with | zero => rw [Measure.pi_of_empty (fun _ : Fin 0 => μ), Measure.pi_of_empty (fun _ : Fin 0 => ν), chiSqDiv_self] simp | succ n ih => have hμ := (measurePreserving_piFinSuccAbove (fun _ : Fin (n + 1) => μ) 0).map_eq have hν := (measurePreserving_piFinSuccAbove (fun _ : Fin (n + 1) => ν) 0).map_eq rw [← chiSqDiv_map_measurableEquiv (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) => S) 0), hμ, hν] have hac_pi : Measure.pi (fun _ : Fin n => μ) ≪ Measure.pi (fun _ : Fin n => ν) := pi_iid_absolutelyContinuous μ ν hac n rw [chiSqDiv_prod μ ν (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) hac hac_pi hint (pi_iid_integrable_sq_dev μ ν hac hint n), ih, pow_succ] ring
Causalean.Stat.one_add_chiSqDiv_pi_iid_general · Causalean/Stat/Minimax/ChiSquared.lean:411 · uses chiSqDiv
lemma testing_error_lower_of_chi reviewed
Causalean.Stat

Two-point testing-error floor from a finite χ²-budget. For probability measures P, Q such that P is absolutely continuous with respect to Q and the squared density deviation (dP/dQ − 1)² is Q-integrable, if C is nonnegative and the χ²-divergence chiSqDiv P Q is at most C, then for every measurable test region A, the combined testing error is at least 1/(4(C + 1)): P(Aᶜ) + Q(A) ≥ 1/(4(C + 1)). This is the positive two-point testing floor that powers χ²-budget minimax lower bounds — no test can separate P from Q better than this when their χ²-divergence is bounded.

Formal statement
Ω :
hac :
P ≪ Q
hint :
Integrable (fun x => ((P.rnDeriv Q x).toReal - 1) ^ 2) Q
C :
hC :
0 ≤ C
hchi :
chiSqDiv P Q ≤ C
A :
Set Ω
hA :
P.real Aᶜ + Q.real A ≥ 1 / (4 * (C + 1))
Proof (Lean source)
lemma testing_error_lower_of_chi {Ω : Type*} [MeasurableSpace Ω] (P Q : Measure Ω) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] (hac : P ≪ Q) (hint : Integrable (fun x => ((P.rnDeriv Q x).toReal - 1) ^ 2) Q) {C : ℝ} (hC : 0 ≤ C) (hchi : chiSqDiv P Q ≤ C) {A : Set Ω} (hA : MeasurableSet A) : P.real Aᶜ + Q.real A ≥ 1 / (4 * (C + 1)) := by let e : ℝ := P.real Aᶜ + Q.real A let K : ℝ := C + 1 have hKpos : 0 < K := by dsimp [K] linarith have hKge1 : 1 ≤ K := by dsimp [K] linarith have hQ_nonneg : 0 ≤ Q.real A := measureReal_nonneg have hPcomp_nonneg : 0 ≤ P.real Aᶜ := measureReal_nonneg have hcs : P.real A ≤ sqrt (K * Q.real A) := by simpa [K] using rnDeriv_setIntegral_le_sqrt_chi P Q hac hint hchi hA have hcomp : P.real Aᶜ = 1 - P.real A := by rw [measureReal_compl hA, probReal_univ] have hgap : 1 - e ≤ sqrt (K * Q.real A) := by dsimp [e] rw [hcomp] linarith [hcs, hQ_nonneg] by_contra hnot have hlt : e < 1 / (4 * K) := by exact lt_of_not_ge (by simpa [e, K] using hnot) have hQ_le_e : Q.real A ≤ e := by dsimp [e] linarith have hQ_lt : Q.real A < 1 / (4 * K) := lt_of_le_of_lt hQ_le_e hlt have hKQ_lt : K * Q.real A < 1 / 4 := by calc K * Q.real A < K * (1 / (4 * K)) := mul_lt_mul_of_pos_left hQ_lt hKpos _ = 1 / 4 := by field_simp [hKpos.ne'] have hsqrt_lt : sqrt (K * Q.real A) < 1 / 2 := by rw [Real.sqrt_lt' (by norm_num : (0 : ℝ) < 1 / 2)] norm_num exact hKQ_lt have hc_le_quarter : 1 / (4 * K) ≤ 1 / 4 := by have hden : 0 < 4 * K := mul_pos (by norm_num) hKpos rw [one_div_le_one_div hden (by norm_num : (0 : ℝ) < 4)] nlinarith have he_lt_quarter : e < 1 / 4 := lt_of_lt_of_le hlt hc_le_quarter have hleft_gt : 1 / 2 < 1 - e := by linarith have hleft_lt : 1 - e < 1 / 2 := lt_of_le_of_lt hgap hsqrt_lt linarith
Causalean.Stat.testing_error_lower_of_chi · Causalean/Stat/Minimax/ChiSquared.lean:561 · uses chiSqDiv
lemma le_cam_two_point_chisq reviewed
Causalean.Stat

Le Cam two-point testing floor under a χ²-budget (uniform-constant form). Two statements share this structure: for every χ²-budget C ≥ 0 there is a single floor constant c > 0, fixed before the laws are chosen, such that every pair of probability laws with Q-integrable squared density deviation and χ²-divergence at most C has combined testing error P(Aᶜ) + Q(A) at least c on every measurable test region A; and for every per-observation χ²-budget c0 ≥ 0 there is a single floor c' > 0 such that whenever the single-observation χ²-divergence is at most c0/m, the m-fold i.i.d. product experiment retains that same constant testing floor c', by the product χ²-identity 1 + χ²(P^{⊗m}‖Q^{⊗m}) = (1 + χ²)^m ≤ exp(c0).

Formal statement
conclusion 1
Cchi :
0 ≤ Cchi
∃ c : ℝ,
0 < c
Ω :
Type
Pp Pm :
Pp ≪ Pm
Integrable (fun x => ((Pp.rnDeriv Pm x).toReal - 1) ^ 2) Pm
chiSqDiv Pp Pm ≤ Cchi
A :
Set Ω
Pp.real Aᶜ + Pm.real A ≥ c
conclusion 2
c0 :
0 ≤ c0
∃ c' : ℝ,
0 < c'
Ω :
Type
Pp Pm :
Pp ≪ Pm
Integrable (fun x => ((Pp.rnDeriv Pm x).toReal - 1) ^ 2) Pm
m :
0 < m
chiSqDiv Pp Pm ≤ c0 / (m : ℝ)
A :
Set (Fin m → Ω)
(Measure.pi (fun _ : Fin m => Pp)).real Aᶜ + (Measure.pi (fun _ : Fin m => Pm)).real A
≥ c'
Proof (Lean source)
lemma le_cam_two_point_chisq : (∀ Cchi : ℝ, 0 ≤ Cchi → ∃ c : ℝ, 0 < c ∧ ∀ {Ω : Type} [MeasurableSpace Ω] (Pp Pm : Measure Ω) [IsProbabilityMeasure Pp] [IsProbabilityMeasure Pm], Pp ≪ Pm → Integrable (fun x => ((Pp.rnDeriv Pm x).toReal - 1) ^ 2) Pm → chiSqDiv Pp Pm ≤ Cchi → ∀ A : Set Ω, MeasurableSet A → Pp.real Aᶜ + Pm.real A ≥ c) ∧ (∀ c0 : ℝ, 0 ≤ c0 → ∃ c' : ℝ, 0 < c' ∧ ∀ {Ω : Type} [MeasurableSpace Ω] (Pp Pm : Measure Ω) [IsProbabilityMeasure Pp] [IsProbabilityMeasure Pm], Pp ≪ Pm → Integrable (fun x => ((Pp.rnDeriv Pm x).toReal - 1) ^ 2) Pm → ∀ (m : ℕ), 0 < m → chiSqDiv Pp Pm ≤ c0 / (m : ℝ) → ∀ A : Set (Fin m → Ω), MeasurableSet A → (Measure.pi (fun _ : Fin m => Pp)).real Aᶜ + (Measure.pi (fun _ : Fin m => Pm)).real A ≥ c') := by constructor · intro Cchi hCchi refine ⟨1 / (4 * (Cchi + 1)), by positivity, ?_⟩ intro Ω _ Pp Pm _ _ hac hint hchi A hA exact testing_error_lower_of_chi Pp Pm hac hint hCchi hchi hA · intro c0 hc0 refine ⟨1 / (4 * exp c0), by positivity, ?_⟩ intro Ω _ Pp Pm _ _ hac hint m hm hchi A hA let Pprod : Measure (Fin m → Ω) := Measure.pi (fun _ : Fin m => Pp) let Qprod : Measure (Fin m → Ω) := Measure.pi (fun _ : Fin m => Pm) have hac_prod : Pprod ≪ Qprod := by dsimp [Pprod, Qprod] exact pi_iid_absolutelyContinuous Pp Pm hac m have hint_prod : Integrable (fun x => ((Pprod.rnDeriv Qprod x).toReal - 1) ^ 2) Qprod := by dsimp [Pprod, Qprod] exact pi_iid_integrable_sq_dev Pp Pm hac hint m have hchi_non : 0 ≤ chiSqDiv Pp Pm := chiSqDiv_nonneg have hmR : 0 < (m : ℝ) := by exact_mod_cast hm have hmul : (m : ℝ) * chiSqDiv Pp Pm ≤ c0 := by have := mul_le_mul_of_nonneg_left hchi (le_of_lt hmR) field_simp [hmR.ne'] at this exact this have hpow : (1 + chiSqDiv Pp Pm) ^ m ≤ exp ((m : ℝ) * chiSqDiv Pp Pm) := by calc (1 + chiSqDiv Pp Pm) ^ m ≤ (exp (chiSqDiv Pp Pm)) ^ m := by exact pow_le_pow_left₀ (by linarith) (by linarith [Real.add_one_le_exp (chiSqDiv Pp Pm)]) m _ = exp ((m : ℝ) * chiSqDiv Pp Pm) := by rw [← Real.exp_nat_mul] have hexp_le : exp ((m : ℝ) * chiSqDiv Pp Pm) ≤ exp c0 := by exact Real.exp_le_exp.mpr hmul have hprod_eq : 1 + chiSqDiv Pprod Qprod = (1 + chiSqDiv Pp Pm) ^ m := by dsimp [Pprod, Qprod] exact one_add_chiSqDiv_pi_iid_general Pp Pm hac hint m have hchi_prod : chiSqDiv Pprod Qprod ≤ exp c0 - 1 := by have hone : 1 + chiSqDiv Pprod Qprod ≤ exp c0 := by rw [hprod_eq] exact hpow.trans hexp_le linarith have hCprod_nonneg : 0 ≤ exp c0 - 1 := by have h1 : 1 ≤ exp c0 := by have := Real.add_one_le_exp c0 linarith linarith have htest := testing_error_lower_of_chi Pprod Qprod hac_prod hint_prod hCprod_nonneg hchi_prod hA have hconst : 1 / (4 * ((exp c0 - 1) + 1)) = 1 / (4 * exp c0) := by ring_nf simpa [Pprod, Qprod, hconst] using htest
Causalean.Stat.le_cam_two_point_chisq · Causalean/Stat/Minimax/ChiSquared.lean:619 · uses chiSqDiv
10 supporting declarations (lemmas, instances)
  • chiSqDiv_nonneg theorem — The χ²-divergence is nonnegative: its integrand is a square.
    Ω :
    shared
    0 ≤ chiSqDiv μ ν
    Proof (Lean source)
    theorem chiSqDiv_nonneg : 0 ≤ chiSqDiv μ ν := integral_nonneg fun _ => sq_nonneg _
    Causalean.Stat.chiSqDiv_nonneg · Causalean/Stat/Minimax/ChiSquared.lean:62
  • chiSqDiv_eq theorem — Expansion of the χ²-divergence: χ²(μ‖ν) = ∫ (dμ/dν)² ∂ν − 1 when μ ≪ ν.
    Ω :
    shared
    hac :
    μ ≪ ν
    hint :
    Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν
    chiSqDiv μ ν = (∫ x, ((μ.rnDeriv ν x).toReal) ^ 2 ∂ν) - 1
    Proof (Lean source)
    theorem chiSqDiv_eq [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν) : chiSqDiv μ ν = (∫ x, ((μ.rnDeriv ν x).toReal) ^ 2 ∂ν) - 1 := by set p : Ω → ℝ := fun x => (μ.rnDeriv ν x).toReal with hp_def have hmeas : AEStronglyMeasurable p ν := by fun_prop have hp_int : Integrable p ν := Measure.integrable_toReal_rnDeriv -- `p²` integrable, since `(p − 1)²` is and `p² = (p−1)² + 2p − 1`. have hp_sq : Integrable (fun x => p x ^ 2) ν := by have hexp : (fun x => p x ^ 2) = fun x => (p x - 1) ^ 2 + (2 * p x - 1) := by funext x; ring rw [hexp] exact hint.add ((hp_int.const_mul 2).sub (integrable_const 1)) -- Expand `(p − 1)² = p² − 2p + 1` under the integral. have h2p : Integrable (fun x => 2 * p x) ν := hp_int.const_mul 2 have hsub : ∫ x, (p x ^ 2 - 2 * p x) ∂ν = (∫ x, p x ^ 2 ∂ν) - 2 * (∫ x, p x ∂ν) := by integral_linearity have hadd : ∫ x, ((p x ^ 2 - 2 * p x) + 1) ∂ν = (∫ x, (p x ^ 2 - 2 * p x) ∂ν) + (∫ _ : Ω, (1:ℝ) ∂ν) := by integral_linearity have hexp : chiSqDiv μ ν = (∫ x, p x ^ 2 ∂ν) - 2 * (∫ x, p x ∂ν) + (∫ _ : Ω, (1:ℝ) ∂ν) := by have hcongr : ∀ x, ((μ.rnDeriv ν x).toReal - 1) ^ 2 = (p x ^ 2 - 2 * p x) + 1 := by intro x; rw [hp_def]; ring rw [chiSqDiv, integral_congr_ae (Filter.Eventually.of_forall hcongr), hadd, hsub] -- `∫ p ∂ν = 1` and `∫ 1 ∂ν = 1`. have hp1 : ∫ x, p x ∂ν = 1 := by rw [hp_def, Measure.integral_toReal_rnDeriv hac] rw [measureReal_def, measure_univ]; simp have hone : (∫ _ : Ω, (1:ℝ) ∂ν) = 1 := by simp rw [hexp, hp1, hone]; ring
    Causalean.Stat.chiSqDiv_eq · Causalean/Stat/Minimax/ChiSquared.lean:118
  • rnDeriv_prod_eq theorem — Product density factorization. For μ₁ ≪ ν₁ and μ₂ ≪ ν₂, the Radon–Nikodym density of the product is (a.e.) the product of the marginal densities.
    α :
    Type u_2
    shared
    β :
    Type u_3
    shared
    μ₁ ν₁ :
    μ₂ ν₂ :
    SFinite ν₂
    μ₁.HaveLebesgueDecomposition ν₁
    μ₂.HaveLebesgueDecomposition ν₂
    h₁ :
    μ₁ ≪ ν₁
    h₂ :
    μ₂ ≪ ν₂
    (μ₁.prod μ₂).rnDeriv (ν₁.prod ν₂)
    =ᵐ[ν₁.prod ν₂] fun z => μ₁.rnDeriv ν₁ z.1 * μ₂.rnDeriv ν₂ z.2
    Proof (Lean source)
    theorem rnDeriv_prod_eq (μ₁ ν₁ : Measure α) (μ₂ ν₂ : Measure β) [SigmaFinite ν₁] [SigmaFinite ν₂] [SFinite ν₂] [μ₁.HaveLebesgueDecomposition ν₁] [μ₂.HaveLebesgueDecomposition ν₂] (h₁ : μ₁ ≪ ν₁) (h₂ : μ₂ ≪ ν₂) : (μ₁.prod μ₂).rnDeriv (ν₁.prod ν₂) =ᵐ[ν₁.prod ν₂] fun z => μ₁.rnDeriv ν₁ z.1 * μ₂.rnDeriv ν₂ z.2 := by -- Rewrite `μᵢ = νᵢ.withDensity (rnDeriv μᵢ νᵢ)` and use `prod_withDensity₀`. have hfac : μ₁.prod μ₂ = (ν₁.prod ν₂).withDensity (fun z => μ₁.rnDeriv ν₁ z.1 * μ₂.rnDeriv ν₂ z.2) := by conv_lhs => rw [← Measure.withDensity_rnDeriv_eq _ _ h₁, ← Measure.withDensity_rnDeriv_eq _ _ h₂] exact prod_withDensity₀ (Measure.measurable_rnDeriv _ _).aemeasurable (Measure.measurable_rnDeriv _ _).aemeasurable calc (μ₁.prod μ₂).rnDeriv (ν₁.prod ν₂) =ᵐ[ν₁.prod ν₂] ((ν₁.prod ν₂).withDensity (fun z => μ₁.rnDeriv ν₁ z.1 * μ₂.rnDeriv ν₂ z.2)).rnDeriv (ν₁.prod ν₂) := by rw [hfac] _ =ᵐ[ν₁.prod ν₂] fun z => μ₁.rnDeriv ν₁ z.1 * μ₂.rnDeriv ν₂ z.2 := Measure.rnDeriv_withDensity₀ _ (((Measure.measurable_rnDeriv _ _).comp measurable_fst).mul ((Measure.measurable_rnDeriv _ _).comp measurable_snd)).aemeasurable
    Causalean.Stat.rnDeriv_prod_eq · Causalean/Stat/Minimax/ChiSquared.lean:158
  • chiSqDiv_prod theorem — Binary tensorization of the χ²-divergence. For probability measures with μ₁ ≪ ν₁ and μ₂ ≪ ν₂ and integrable squared density deviations, the χ²-divergence tensorizes multiplicatively: 1 + χ²(μ₁⊗μ₂ ‖ ν₁⊗ν₂) = (1 + χ²(μ₁‖ν₁))·(1 + χ²(μ₂‖ν₂)).
    α :
    Type u_2
    shared
    β :
    Type u_3
    shared
    μ₁ ν₁ :
    μ₂ ν₂ :
    h₁ :
    μ₁ ≪ ν₁
    h₂ :
    μ₂ ≪ ν₂
    hint₁ :
    Integrable (fun x => ((μ₁.rnDeriv ν₁ x).toReal - 1) ^ 2) ν₁
    hint₂ :
    Integrable (fun y => ((μ₂.rnDeriv ν₂ y).toReal - 1) ^ 2) ν₂
    1 + chiSqDiv (μ₁.prod μ₂) (ν₁.prod ν₂) = (1 + chiSqDiv μ₁ ν₁) * (1 + chiSqDiv μ₂ ν₂)
    Proof (Lean source)
    theorem chiSqDiv_prod (μ₁ ν₁ : Measure α) (μ₂ ν₂ : Measure β) [IsProbabilityMeasure μ₁] [IsProbabilityMeasure ν₁] [IsProbabilityMeasure μ₂] [IsProbabilityMeasure ν₂] (h₁ : μ₁ ≪ ν₁) (h₂ : μ₂ ≪ ν₂) (hint₁ : Integrable (fun x => ((μ₁.rnDeriv ν₁ x).toReal - 1) ^ 2) ν₁) (hint₂ : Integrable (fun y => ((μ₂.rnDeriv ν₂ y).toReal - 1) ^ 2) ν₂) : 1 + chiSqDiv (μ₁.prod μ₂) (ν₁.prod ν₂) = (1 + chiSqDiv μ₁ ν₁) * (1 + chiSqDiv μ₂ ν₂) := by -- Marginal densities (as ℝ) and their squares. set p₁ : α → ℝ := fun x => (μ₁.rnDeriv ν₁ x).toReal with hp₁_def set p₂ : β → ℝ := fun y => (μ₂.rnDeriv ν₂ y).toReal with hp₂_def -- `pᵢ` integrable; `pᵢ²` integrable (from `(pᵢ−1)²` integrable). have hp₁_int : Integrable p₁ ν₁ := Measure.integrable_toReal_rnDeriv have hp₂_int : Integrable p₂ ν₂ := Measure.integrable_toReal_rnDeriv have hp₁_sq : Integrable (fun x => p₁ x ^ 2) ν₁ := by have hexp : (fun x => p₁ x ^ 2) = fun x => (p₁ x - 1) ^ 2 + (2 * p₁ x - 1) := by funext x; ring rw [hexp]; exact hint₁.add ((hp₁_int.const_mul 2).sub (integrable_const 1)) have hp₂_sq : Integrable (fun y => p₂ y ^ 2) ν₂ := by have hexp : (fun y => p₂ y ^ 2) = fun y => (p₂ y - 1) ^ 2 + (2 * p₂ y - 1) := by funext y; ring rw [hexp]; exact hint₂.add ((hp₂_int.const_mul 2).sub (integrable_const 1)) -- Product squared density (as ℝ), a.e. equal to `p₁(z.1)²·p₂(z.2)²`. set P : α × β → ℝ := fun z => ((μ₁.prod μ₂).rnDeriv (ν₁.prod ν₂) z).toReal with hP_def have hdens : (μ₁.prod μ₂).rnDeriv (ν₁.prod ν₂) =ᵐ[ν₁.prod ν₂] fun z => μ₁.rnDeriv ν₁ z.1 * μ₂.rnDeriv ν₂ z.2 := rnDeriv_prod_eq μ₁ ν₁ μ₂ ν₂ h₁ h₂ have hPeq : (fun z => P z ^ 2) =ᵐ[ν₁.prod ν₂] fun z => (p₁ z.1 ^ 2) * (p₂ z.2 ^ 2) := by filter_upwards [hdens] with z hz rw [hP_def] simp only [hz, ENNReal.toReal_mul, hp₁_def, hp₂_def] ring -- Product of squared densities is integrable over the product measure. have hPint : Integrable (fun z => (p₁ z.1 ^ 2) * (p₂ z.2 ^ 2)) (ν₁.prod ν₂) := Integrable.mul_prod hp₁_sq hp₂_sq have hPint' : Integrable (fun z => P z ^ 2) (ν₁.prod ν₂) := hPint.congr hPeq.symm -- `(P−1)²` integrable over the product (needed for `chiSqDiv_eq`). have hP_int : Integrable P (ν₁.prod ν₂) := Measure.integrable_toReal_rnDeriv have hPdev : Integrable (fun z => (P z - 1) ^ 2) (ν₁.prod ν₂) := by have hexp : (fun z => (P z - 1) ^ 2) = fun z => P z ^ 2 + (-(2 * P z) + 1) := by funext z; ring rw [hexp]; exact hPint'.add (((hP_int.const_mul 2).neg).add (integrable_const 1)) -- Apply the expansion `χ² = ∫ p² − 1` to all three. have hprod_ac : μ₁.prod μ₂ ≪ ν₁.prod ν₂ := h₁.prod h₂ have e0 : chiSqDiv (μ₁.prod μ₂) (ν₁.prod ν₂) = (∫ z, P z ^ 2 ∂(ν₁.prod ν₂)) - 1 := chiSqDiv_eq hprod_ac hPdev have e1 : chiSqDiv μ₁ ν₁ = (∫ x, p₁ x ^ 2 ∂ν₁) - 1 := chiSqDiv_eq h₁ hint₁ have e2 : chiSqDiv μ₂ ν₂ = (∫ y, p₂ y ^ 2 ∂ν₂) - 1 := chiSqDiv_eq h₂ hint₂ -- Fubini: `∫ P² = (∫ p₁²)·(∫ p₂²)`. have hfubini : (∫ z, P z ^ 2 ∂(ν₁.prod ν₂)) = (∫ x, p₁ x ^ 2 ∂ν₁) * (∫ y, p₂ y ^ 2 ∂ν₂) := by rw [integral_congr_ae hPeq] exact integral_prod_mul (fun x => p₁ x ^ 2) (fun y => p₂ y ^ 2) rw [e0, e1, e2, hfubini]; ring
    Causalean.Stat.chiSqDiv_prod · Causalean/Stat/Minimax/ChiSquared.lean:184
  • chiSqDiv_map_measurableEquiv theorem — χ²-divergence is invariant under a measurable equivalence. Pushing both measures forward through e : Ω ≃ᵐ Ω' leaves the χ²-divergence unchanged.
    Ω Ω' :
    e :
    Ω ≃ᵐ Ω'
    chiSqDiv (μ.map e) (ν.map e) = chiSqDiv μ ν
    Proof (Lean source)
    theorem chiSqDiv_map_measurableEquiv {Ω Ω' : Type*} [MeasurableSpace Ω] [MeasurableSpace Ω'] (e : Ω ≃ᵐ Ω') (μ ν : Measure Ω) [SigmaFinite μ] [SigmaFinite ν] : chiSqDiv (μ.map e) (ν.map e) = chiSqDiv μ ν := by rw [chiSqDiv, chiSqDiv] rw [integral_map_equiv e (fun y => (((μ.map e).rnDeriv (ν.map e) y).toReal - 1) ^ 2)] apply integral_congr_ae have hrn := e.measurableEmbedding.rnDeriv_map μ ν filter_upwards [hrn] with x hx simp only [hx]
    Causalean.Stat.chiSqDiv_map_measurableEquiv · Causalean/Stat/Minimax/ChiSquared.lean:247
  • chiSqDiv_self theorem — The χ²-divergence of a (sigma-finite) measure against itself is zero.
    Ω :
    ρ :
    chiSqDiv ρ ρ = 0
    Proof (Lean source)
    theorem chiSqDiv_self {Ω : Type*} [MeasurableSpace Ω] (ρ : Measure Ω) [SigmaFinite ρ] : chiSqDiv ρ ρ = 0 := by rw [chiSqDiv] rw [integral_eq_zero_of_ae] filter_upwards [ρ.rnDeriv_self] with x hx simp [hx]
    Causalean.Stat.chiSqDiv_self · Causalean/Stat/Minimax/ChiSquared.lean:261
  • pi_iid_absolutelyContinuous theorem — The n-fold product of μ is absolutely continuous w.r.t. that of ν whenever μ ≪ ν (for sigma-finite factors). Proved by induction via the piFinSuccAbove equivalence and the binary AbsolutelyContinuous.prod.
    Ω :
    hac :
    μ ≪ ν
    n :
    Measure.pi (fun _ : Fin n => μ) ≪ Measure.pi (fun _ : Fin n => ν)
    Proof (Lean source)
    theorem pi_iid_absolutelyContinuous {Ω : Type*} [MeasurableSpace Ω] (μ ν : Measure Ω) [SigmaFinite μ] [SigmaFinite ν] (hac : μ ≪ ν) (n : ℕ) : Measure.pi (fun _ : Fin n => μ) ≪ Measure.pi (fun _ : Fin n => ν) := by induction n with | zero => rw [Measure.pi_of_empty (fun _ : Fin 0 => μ), Measure.pi_of_empty (fun _ : Fin 0 => ν)] | succ n ih => set e := MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) => Ω) 0 with he have hμ := (measurePreserving_piFinSuccAbove (fun _ : Fin (n + 1) => μ) 0).map_eq have hν := (measurePreserving_piFinSuccAbove (fun _ : Fin (n + 1) => ν) 0).map_eq have hprod : μ.prod (Measure.pi (fun _ : Fin n => μ)) ≪ ν.prod (Measure.pi (fun _ : Fin n => ν)) := hac.prod ih have hmap : (Measure.pi (fun _ : Fin (n + 1) => μ)).map e ≪ (Measure.pi (fun _ : Fin (n + 1) => ν)).map e := by rw [hμ, hν]; exact hprod have hmapped := hmap.map (f := e.symm) e.symm.measurable rwa [Measure.map_map e.symm.measurable e.measurable, MeasurableEquiv.symm_comp_self, Measure.map_id, Measure.map_map e.symm.measurable e.measurable, MeasurableEquiv.symm_comp_self, Measure.map_id] at hmapped
    Causalean.Stat.pi_iid_absolutelyContinuous · Causalean/Stat/Minimax/ChiSquared.lean:269
  • pi_iid_integrable_sq_dev theorem — Integrability of the squared density deviation (dμ/dν − 1)² propagates from one sample to the n-fold i.i.d. product (d(μ^⊗n)/d(ν^⊗n) − 1)². On a general (possibly continuous) measurable space this is the side-condition that makes chiSqDiv_prod applicable inside the tensorization induction — it is free on a finite space (Integrable.of_finite) but must be derived here, by L²(ν)-tensorization of the single-sample density dμ/dν.
    S :
    hac :
    μ ≪ ν
    hint :
    Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν
    n :
    Integrable (fun x => (((Measure.pi (fun _ : Fin n => μ)).rnDeriv (Measure.pi (fun _ : Fin n => ν)) x).toReal - 1) ^ 2) (Measure.pi (fun _ : Fin n => ν))
    Proof (Lean source)
    theorem pi_iid_integrable_sq_dev {S : Type*} [MeasurableSpace S] (μ ν : Measure S) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν) (n : ℕ) : Integrable (fun x => (((Measure.pi (fun _ : Fin n => μ)).rnDeriv (Measure.pi (fun _ : Fin n => ν)) x).toReal - 1) ^ 2) (Measure.pi (fun _ : Fin n => ν)) := by induction n with | zero => rw [Measure.pi_of_empty (fun _ : Fin 0 => μ), Measure.pi_of_empty (fun _ : Fin 0 => ν)] exact Integrable.of_finite | succ n ih => set μπ : Measure (Fin n → S) := Measure.pi (fun _ : Fin n => μ) with hμπ_def set νπ : Measure (Fin n → S) := Measure.pi (fun _ : Fin n => ν) with hνπ_def set e := MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) => S) 0 with he set p : S → ℝ := fun x => (μ.rnDeriv ν x).toReal with hp_def set pn : (Fin n → S) → ℝ := fun y => (μπ.rnDeriv νπ y).toReal with hpn_def have hp_int : Integrable p ν := by simpa [hp_def] using (Measure.integrable_toReal_rnDeriv : Integrable (fun x => (μ.rnDeriv ν x).toReal) ν) have hpn_int : Integrable pn νπ := by simpa [hpn_def] using (Measure.integrable_toReal_rnDeriv : Integrable (fun y => (μπ.rnDeriv νπ y).toReal) νπ) have hp_sq : Integrable (fun x => p x ^ 2) ν := by have hdev : Integrable (fun x => (p x - 1) ^ 2) ν := by simpa [hp_def] using hint have hexp : (fun x => p x ^ 2) = fun x => (p x - 1) ^ 2 + (2 * p x - 1) := by funext x; ring rw [hexp]; exact hdev.add ((hp_int.const_mul 2).sub (integrable_const 1)) have hpn_sq : Integrable (fun y => pn y ^ 2) νπ := by have hdev : Integrable (fun y => (pn y - 1) ^ 2) νπ := by simpa [hμπ_def, hνπ_def, hpn_def] using ih have hexp : (fun y => pn y ^ 2) = fun y => (pn y - 1) ^ 2 + (2 * pn y - 1) := by funext y; ring rw [hexp]; exact hdev.add ((hpn_int.const_mul 2).sub (integrable_const 1)) have hac_pi : μπ ≪ νπ := by rw [hμπ_def, hνπ_def] exact pi_iid_absolutelyContinuous μ ν hac n set P : S × (Fin n → S) → ℝ := fun z => ((μ.prod μπ).rnDeriv (ν.prod νπ) z).toReal with hP_def have hdens : (μ.prod μπ).rnDeriv (ν.prod νπ) =ᵐ[ν.prod νπ] fun z => μ.rnDeriv ν z.1 * μπ.rnDeriv νπ z.2 := rnDeriv_prod_eq μ ν μπ νπ hac hac_pi have hPeq : (fun z => P z ^ 2) =ᵐ[ν.prod νπ] fun z => (p z.1 ^ 2) * (pn z.2 ^ 2) := by filter_upwards [hdens] with z hz rw [hP_def] simp only [hz, ENNReal.toReal_mul, hp_def, hpn_def] ring have hPint : Integrable (fun z => (p z.1 ^ 2) * (pn z.2 ^ 2)) (ν.prod νπ) := Integrable.mul_prod hp_sq hpn_sq have hPint' : Integrable (fun z => P z ^ 2) (ν.prod νπ) := hPint.congr hPeq.symm have hP_int : Integrable P (ν.prod νπ) := by simpa [hP_def] using (Measure.integrable_toReal_rnDeriv : Integrable (fun z => ((μ.prod μπ).rnDeriv (ν.prod νπ) z).toReal) (ν.prod νπ)) have hprod_int : Integrable (fun z => (P z - 1) ^ 2) (ν.prod νπ) := by have hexp : (fun z => (P z - 1) ^ 2) = fun z => P z ^ 2 + (-(2 * P z) + 1) := by funext z; ring rw [hexp]; exact hPint'.add (((hP_int.const_mul 2).neg).add (integrable_const 1)) have hμ_map := (measurePreserving_piFinSuccAbove (fun _ : Fin (n + 1) => μ) 0).map_eq have hν_map := (measurePreserving_piFinSuccAbove (fun _ : Fin (n + 1) => ν) 0).map_eq have hprod_map : Integrable (fun z => (P z - 1) ^ 2) (Measure.map e (Measure.pi (fun _ : Fin (n + 1) => ν))) := by rw [hν_map] simpa [hνπ_def] using hprod_int have hcomp : Integrable ((fun z => (P z - 1) ^ 2) ∘ e) (Measure.pi (fun _ : Fin (n + 1) => ν)) := (integrable_map_equiv e (fun z => (P z - 1) ^ 2)).1 hprod_map refine hcomp.congr ?_ have hrn := e.measurableEmbedding.rnDeriv_map (Measure.pi (fun _ : Fin (n + 1) => μ)) (Measure.pi (fun _ : Fin (n + 1) => ν)) filter_upwards [hrn] with x hx change (P (e x) - 1) ^ 2 = ((((Measure.pi (fun _ : Fin (n + 1) => μ)).rnDeriv (Measure.pi (fun _ : Fin (n + 1) => ν)) x).toReal - 1) ^ 2) rw [hP_def, ← hμ_map, ← hν_map, ← he] simp only [hx]
    Causalean.Stat.pi_iid_integrable_sq_dev · Causalean/Stat/Minimax/ChiSquared.lean:324
  • chiSqDiv_prod_ancillary theorem — Ancillary product factor leaves the χ²-divergence unchanged. Tensoring both measures with a *common* probability measure ρ (an ancillary coordinate, whose law is the same under μ and ν) does not change the χ²-divergence: χ²(μ⊗ρ ‖ ν⊗ρ) = χ²(μ‖ν). This is the formal content of "an ancillary observation carries no information": its contribution is 1 + χ²(ρ‖ρ) = 1. It is the bridge from the finite-cell lower bound to the continuous-covariate one (the within-cell position is ancillary).
    α β :
    μ ν :
    ρ :
    hac :
    μ ≪ ν
    hint :
    Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν
    chiSqDiv (μ.prod ρ) (ν.prod ρ) = chiSqDiv μ ν
    Proof (Lean source)
    theorem chiSqDiv_prod_ancillary {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] (μ ν : Measure α) (ρ : Measure β) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] [IsProbabilityMeasure ρ] (hac : μ ≪ ν) (hint : Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν) : chiSqDiv (μ.prod ρ) (ν.prod ρ) = chiSqDiv μ ν := by have hint₂ : Integrable (fun y => ((ρ.rnDeriv ρ y).toReal - 1) ^ 2) ρ := by refine (integrable_zero β ℝ ρ).congr ?_ filter_upwards [ρ.rnDeriv_self] with y hy simp [hy] have h := chiSqDiv_prod μ ν ρ ρ hac (Measure.AbsolutelyContinuous.refl ρ) hint hint₂ rw [chiSqDiv_self] at h simp only [add_zero, mul_one] at h linarith
    Causalean.Stat.chiSqDiv_prod_ancillary · Causalean/Stat/Minimax/ChiSquared.lean:444
  • rnDeriv_setIntegral_le_sqrt_chi lemma — Cauchy–Schwarz mass transfer under a χ²-budget. For probability measures P ≪ Q whose squared density deviation (dP/dQ − 1)² is Q-integrable, and whose χ²-divergence is at most C, the P-mass of any measurable set A is controlled by its Q-mass through P(A) ≤ √((C + 1)·Q(A)). This is the Cauchy–Schwarz step underlying the two-point testing floor: a set that is small under the reference measure Q cannot be large under P when the χ²-budget is finite.
    Ω :
    hac :
    P ≪ Q
    hint :
    Integrable (fun x => ((P.rnDeriv Q x).toReal - 1) ^ 2) Q
    C :
    hchi :
    chiSqDiv P Q ≤ C
    A :
    Set Ω
    hA :
    P.real A ≤ sqrt ((C + 1) * Q.real A)
    Proof (Lean source)
    lemma rnDeriv_setIntegral_le_sqrt_chi {Ω : Type*} [MeasurableSpace Ω] (P Q : Measure Ω) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] (hac : P ≪ Q) (hint : Integrable (fun x => ((P.rnDeriv Q x).toReal - 1) ^ 2) Q) {C : ℝ} (hchi : chiSqDiv P Q ≤ C) {A : Set Ω} (hA : MeasurableSet A) : P.real A ≤ sqrt ((C + 1) * Q.real A) := by set p : Ω → ℝ := fun x => (P.rnDeriv Q x).toReal with hp_def have hp_meas : AEStronglyMeasurable p Q := (Measure.measurable_rnDeriv P Q).ennreal_toReal.aestronglyMeasurable have hp_int : Integrable p Q := by simpa [hp_def] using (Measure.integrable_toReal_rnDeriv : Integrable (fun x => (P.rnDeriv Q x).toReal) Q) have hdev : Integrable (fun x => (p x - 1) ^ 2) Q := by simpa [hp_def] using hint have hp_sq_int : Integrable (fun x => p x ^ 2) Q := by have hexp : (fun x => p x ^ 2) = fun x => (p x - 1) ^ 2 + (2 * p x - 1) := by funext x ring rw [hexp] exact hdev.add ((hp_int.const_mul 2).sub (integrable_const 1)) have hp_sq_eq : ∫ x, p x ^ 2 ∂Q = chiSqDiv P Q + 1 := by have h := chiSqDiv_eq (μ := P) (ν := Q) hac hint linarith have hp_sq_le : ∫ x, p x ^ 2 ∂Q ≤ C + 1 := by linarith let ind : Ω → ℝ := A.indicator (fun _ => (1 : ℝ)) have hind_meas : AEStronglyMeasurable ind Q := (measurable_const.indicator hA).aestronglyMeasurable have hind_sq_meas : AEStronglyMeasurable (fun x => ind x ^ 2) Q := hind_meas.pow 2 have hind_int_sq : Integrable (fun x => ind x ^ 2) Q := by refine Integrable.of_bound hind_sq_meas 1 ?_ filter_upwards with x by_cases hx : x ∈ A <;> simp [ind, hx] have hind_L2 : MemLp ind (ofReal 2) Q := by simpa using (memLp_two_iff_integrable_sq hind_meas).2 hind_int_sq have hp_L2 : MemLp p (ofReal 2) Q := by simpa using (memLp_two_iff_integrable_sq hp_meas).2 hp_sq_int have hind_nonneg : ∀ᵐ x ∂Q, 0 ≤ ind x := by filter_upwards with x by_cases hx : x ∈ A <;> simp [ind, hx] have hp_nonneg : ∀ᵐ x ∂Q, 0 ≤ p x := by filter_upwards with x rw [hp_def] exact ENNReal.toReal_nonneg have hholder : ∫ x, ind x * p x ∂Q ≤ (∫ x, ind x ^ (2 : ℝ) ∂Q) ^ (1 / (2 : ℝ)) * (∫ x, p x ^ (2 : ℝ) ∂Q) ^ (1 / (2 : ℝ)) := by exact integral_mul_le_Lp_mul_Lq_of_nonneg Real.HolderConjugate.two_two hind_nonneg hp_nonneg hind_L2 hp_L2 have hind_sq_eq : ∫ x, ind x ^ (2 : ℝ) ∂Q = Q.real A := by calc ∫ x, ind x ^ (2 : ℝ) ∂Q = ∫ x, ind x ∂Q := by apply integral_congr_ae filter_upwards with x by_cases hx : x ∈ A <;> simp [ind, hx] _ = Q.real A := by exact integral_indicator_one (μ := Q) hA have hp_sq_eq_rpow : ∫ x, p x ^ (2 : ℝ) ∂Q = ∫ x, p x ^ 2 ∂Q := by apply integral_congr_ae filter_upwards with x rw [Real.rpow_two] have hPA : P.real A = ∫ x, ind x * p x ∂Q := by rw [← Measure.setIntegral_toReal_rnDeriv hac A] rw [← integral_indicator hA] apply integral_congr_ae filter_upwards with x by_cases hx : x ∈ A <;> simp [ind, hx, hp_def] have hnonK : 0 ≤ C + 1 := by have hchi_non : 0 ≤ chiSqDiv P Q := chiSqDiv_nonneg linarith rw [hPA] calc ∫ x, ind x * p x ∂Q ≤ (∫ x, ind x ^ (2 : ℝ) ∂Q) ^ (1 / (2 : ℝ)) * (∫ x, p x ^ (2 : ℝ) ∂Q) ^ (1 / (2 : ℝ)) := hholder _ = sqrt (Q.real A) * sqrt (∫ x, p x ^ 2 ∂Q) := by rw [hind_sq_eq, hp_sq_eq_rpow] rw [Real.sqrt_eq_rpow, Real.sqrt_eq_rpow] _ ≤ sqrt (Q.real A) * sqrt (C + 1) := by exact mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hp_sq_le) (Real.sqrt_nonneg _) _ = sqrt ((C + 1) * Q.real A) := by rw [Real.sqrt_mul hnonK] ring
    Causalean.Stat.rnDeriv_setIntegral_le_sqrt_chi · Causalean/Stat/Minimax/ChiSquared.lean:465
Minimax­Value 4 core · 20 supporting This module packages the object inf over estimators of sup over the model class of the risk and its elementary order API. ★ le_minimaxValue_of_two_point★ minimaxValue_mono_class_of_nonneg

The minimax value of a statistical decision problem

This module packages the object inf over estimators of sup over the model class of the risk and its elementary order API. The estimator family and the model class enter as bare index types, so a run instantiates them at whatever subtype carries its admissibility and membership conditions.

Provided here: worstCaseRisk (the supremum of one estimator's risk over the class), minimaxValue (the infimum of that over the estimators), the four facts every minimax argument needs about them — nonnegativity, "any admissible estimator is an upper bound", "a bound uniform over admissible estimators is a lower bound", "shrinking the class cannot raise the value" — a two-point reduction stated directly against the minimax value, and bridges to the equivalent set-comprehension spelling sInf {r | ∃ e, ...}.

Conventions for degenerate problems. Real suprema and infima are only conditionally complete, so an empty index or an unbounded range evaluates to the junk value zero. This module keeps that convention rather than hiding it, because zero is the conservative value here: it makes an empty estimator family or an empty model class yield minimax value zero, which can never certify a positive lower bound. (Contrast coverageInfOrOne in Causalean/Stat/Minimax/HonestConfidenceSet.lean, where the guarantee runs the other way and the safe vacuous value is one.) Accordingly the lemmas below carry explicit Nonempty / BddAbove / BddBelow hypotheses, and each comes with a _of_nonneg companion that discharges those hypotheses from nonnegativity of the risk, which is what squared-error, absolute-error and regret losses supply for free.

Everything is stated over . A problem whose loss lives in ℝ≥0∞ needs none of this packaging: that order is a complete lattice, so iInf_le, le_iInf, le_iSup and iSup_le apply with no side conditions at all.

def worstCaseRisk reviewed
Causalean.Stat

Given an estimator class, a model class, a real-valued risk for each estimator-model pair, and an estimator, the worst-case risk is the supremum, over all models in the class, of that estimator's risk.

Definition (Lean source)
E :
Sort u_1
shared
Θ :
Sort u_3
shared
risk :
E → Θ → ℝ
e :
E
worstCaseRisk risk e :
⨆ θ : Θ, risk e θ
Causalean.Stat.worstCaseRisk · Causalean/Stat/Minimax/MinimaxValue.lean:45
def minimaxValue reviewed
Causalean.Stat

Given an estimator class, a model class, and a real-valued risk for each estimator-model pair, the minimax value is the infimum, over all estimators in the class, of their worst-case risks over the model class.

Definition (Lean source)
E :
Sort u_1
shared
Θ :
Sort u_3
shared
risk :
E → Θ → ℝ
minimaxValue risk :
⨅ e : E, worstCaseRisk risk e
Causalean.Stat.minimaxValue · Causalean/Stat/Minimax/MinimaxValue.lean:54
theorem le_minimaxValue_of_two_point reviewed
Causalean.Stat

Two-point reduction to the minimax value. Fix two models θ₀ and θ₁ from the parameter class. If every estimator's risk is bounded above across the parameter class and for each estimator, the larger of its risks at the two fixed models is at least c, then the minimax value of the problem is at least c.

Formal statement
E :
Sort u_1
shared
Θ :
Sort u_3
shared
Nonempty E
risk :
E → Θ → ℝ
c :
θ₀ θ₁ :
Θ
hbdd :
∀ e, BddAbove (range (risk e))
htwo :
∀ e, c ≤ max (risk e θ₀) (risk e θ₁)
c ≤ minimaxValue risk
Proof (Lean source)
theorem le_minimaxValue_of_two_point [Nonempty E] {risk : E → Θ → ℝ} {c : ℝ} (θ₀ θ₁ : Θ) (hbdd : ∀ e, BddAbove (range (risk e))) (htwo : ∀ e, c ≤ max (risk e θ₀) (risk e θ₁)) : c ≤ minimaxValue risk := le_minimaxValue fun e => (htwo e).trans (max_le (le_worstCaseRisk (hbdd e) θ₀) (le_worstCaseRisk (hbdd e) θ₁))
Causalean.Stat.le_minimaxValue_of_two_point · Causalean/Stat/Minimax/MinimaxValue.lean:153 · uses minimaxValue
theorem minimaxValue_mono_class_of_nonneg reviewed
Causalean.Stat

For a map φ embedding the parameter class of the first problem into that of the second, if the first problem's risk is nonnegative, the second problem's risk is nonnegative, each estimator's risk is bounded above across the second parameter class, and the first risk at any model is dominated by the second risk at that model's image under φ, then the minimax value of the first problem is at most that of the second.

Formal statement
E :
Sort u_1
shared
Θ :
Sort u_3
shared
Θ' :
Sort u_4
shared
Nonempty E
risk :
E → Θ → ℝ
risk' :
E → Θ' → ℝ
φ :
Θ → Θ'
hr :
∀ e θ, 0 ≤ risk e θ
hr' :
∀ e θ', 0 ≤ risk' e θ'
hbdd :
∀ e, BddAbove (range (risk' e))
hle :
∀ e θ, risk e θ ≤ risk' e (φ θ)
minimaxValue risk ≤ minimaxValue risk'
Proof (Lean source)
theorem minimaxValue_mono_class_of_nonneg [Nonempty E] {risk : E → Θ → ℝ} {risk' : E → Θ' → ℝ} (φ : Θ → Θ') (hr : ∀ e θ, 0 ≤ risk e θ) (hr' : ∀ e θ', 0 ≤ risk' e θ') (hbdd : ∀ e, BddAbove (range (risk' e))) (hle : ∀ e θ, risk e θ ≤ risk' e (φ θ)) : minimaxValue risk ≤ minimaxValue risk' := minimaxValue_le_minimaxValue (bddBelow_range_worstCaseRisk hr) fun e => ⟨e, worstCaseRisk_mono_class_of_nonneg φ (hbdd e) (hr' e) (hle e)⟩
Causalean.Stat.minimaxValue_mono_class_of_nonneg · Causalean/Stat/Minimax/MinimaxValue.lean:223 · uses minimaxValue
20 supporting declarations (lemmas, instances)
  • worstCaseRisk_of_isEmpty_class theorem — Over an empty model class the worst-case risk of every estimator is zero.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    shared
    risk :
    E → Θ → ℝ
    e :
    E
    worstCaseRisk risk e = 0
    Proof (Lean source)
    @[simp] theorem worstCaseRisk_of_isEmpty_class [IsEmpty Θ] (risk : E → Θ → ℝ) (e : E) : worstCaseRisk risk e = 0 := Real.iSup_of_isEmpty _
    Causalean.Stat.worstCaseRisk_of_isEmpty_class · Causalean/Stat/Minimax/MinimaxValue.lean:67
  • minimaxValue_of_isEmpty_estimators theorem — When no estimator is admissible the minimax value is zero, so no positive lower bound on the minimax value can hold vacuously.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    shared
    risk :
    E → Θ → ℝ
    minimaxValue risk = 0
    Proof (Lean source)
    @[simp] theorem minimaxValue_of_isEmpty_estimators [IsEmpty E] (risk : E → Θ → ℝ) : minimaxValue risk = 0 := Real.iInf_of_isEmpty _
    Causalean.Stat.minimaxValue_of_isEmpty_estimators · Causalean/Stat/Minimax/MinimaxValue.lean:73
  • worstCaseRisk_of_unique theorem — When the model class consists of a single law, the worst-case risk is just the risk at that law. This covers decision problems that minimise a functional of the estimator alone, with no adversarial choice of model.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    shared
    risk :
    E → Θ → ℝ
    e :
    E
    worstCaseRisk risk e = risk e default
    Proof (Lean source)
    theorem worstCaseRisk_of_unique [Unique Θ] (risk : E → Θ → ℝ) (e : E) : worstCaseRisk risk e = risk e default := ciSup_unique
    Causalean.Stat.worstCaseRisk_of_unique · Causalean/Stat/Minimax/MinimaxValue.lean:80
  • worstCaseRisk_nonneg theorem — A worst-case risk is nonnegative as soon as the risk is, with no boundedness or nonemptiness caveat: an empty class or an unbounded risk both give the value zero.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    E → Θ → ℝ
    shared
    e :
    E
    hr :
    ∀ θ, 0 ≤ risk e θ
    Proof (Lean source)
    theorem worstCaseRisk_nonneg {risk : E → Θ → ℝ} {e : E} (hr : ∀ θ, 0 ≤ risk e θ) : 0 ≤ worstCaseRisk risk e := Real.iSup_nonneg hr
    Causalean.Stat.worstCaseRisk_nonneg · Causalean/Stat/Minimax/MinimaxValue.lean:91
  • minimaxValue_nonneg theorem — The minimax value of a nonnegative-risk problem is nonnegative, with no boundedness or nonemptiness caveat. Squared-error, absolute-error and regret losses all qualify.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    E → Θ → ℝ
    shared
    hr :
    ∀ e θ, 0 ≤ risk e θ
    Proof (Lean source)
    theorem minimaxValue_nonneg {risk : E → Θ → ℝ} (hr : ∀ e θ, 0 ≤ risk e θ) : 0 ≤ minimaxValue risk := Real.iInf_nonneg fun e => worstCaseRisk_nonneg (hr e)
    Causalean.Stat.minimaxValue_nonneg · Causalean/Stat/Minimax/MinimaxValue.lean:97
  • bddBelow_range_worstCaseRisk theorem — For a nonnegative risk the worst-case risks are bounded below by zero, which is the side condition the infimum over estimators needs.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    E → Θ → ℝ
    shared
    hr :
    ∀ e θ, 0 ≤ risk e θ
    Proof (Lean source)
    theorem bddBelow_range_worstCaseRisk {risk : E → Θ → ℝ} (hr : ∀ e θ, 0 ≤ risk e θ) : BddBelow (range (worstCaseRisk risk)) := by refine ⟨0, ?_⟩ rintro _ ⟨e, rfl⟩ exact worstCaseRisk_nonneg (hr e)
    Causalean.Stat.bddBelow_range_worstCaseRisk · Causalean/Stat/Minimax/MinimaxValue.lean:103
  • le_worstCaseRisk theorem — The risk at any single model in the class is at most the estimator's worst-case risk, provided that estimator's risk is bounded over the class.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    E → Θ → ℝ
    shared
    e :
    E
    hbdd :
    θ :
    Θ
    Proof (Lean source)
    theorem le_worstCaseRisk {risk : E → Θ → ℝ} {e : E} (hbdd : BddAbove (range (risk e))) (θ : Θ) : risk e θ ≤ worstCaseRisk risk e := le_ciSup hbdd θ
    Causalean.Stat.le_worstCaseRisk · Causalean/Stat/Minimax/MinimaxValue.lean:115
  • worstCaseRisk_le theorem — A bound holding at every model in a nonempty class bounds the worst-case risk.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    Nonempty Θ
    E → Θ → ℝ
    shared
    e :
    E
    c :
    h :
    ∀ θ, risk e θ ≤ c
    Proof (Lean source)
    theorem worstCaseRisk_le [Nonempty Θ] {risk : E → Θ → ℝ} {e : E} {c : ℝ} (h : ∀ θ, risk e θ ≤ c) : worstCaseRisk risk e ≤ c := ciSup_le h
    Causalean.Stat.worstCaseRisk_le · Causalean/Stat/Minimax/MinimaxValue.lean:122
  • minimaxValue_le_worstCaseRisk theorem — Any admissible estimator is an upper bound. Exhibiting one estimator and bounding its worst-case risk bounds the minimax value, which is how achievability half of a minimax rate is certified. The hypothesis rules out a worst-case risk that decreases without bound across the estimator family.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    E → Θ → ℝ
    shared
    e :
    E
    Proof (Lean source)
    theorem minimaxValue_le_worstCaseRisk {risk : E → Θ → ℝ} (hbdd : BddBelow (range (worstCaseRisk risk))) (e : E) : minimaxValue risk ≤ worstCaseRisk risk e := ciInf_le hbdd e
    Causalean.Stat.minimaxValue_le_worstCaseRisk · Causalean/Stat/Minimax/MinimaxValue.lean:128
  • minimaxValue_le_worstCaseRisk_of_nonneg theorem — For a nonnegative risk, any admissible estimator is an upper bound on the minimax value with no further side condition, since zero already bounds the worst-case risks below.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    E → Θ → ℝ
    shared
    hr :
    ∀ e θ, 0 ≤ risk e θ
    e :
    E
    Proof (Lean source)
    theorem minimaxValue_le_worstCaseRisk_of_nonneg {risk : E → Θ → ℝ} (hr : ∀ e θ, 0 ≤ risk e θ) (e : E) : minimaxValue risk ≤ worstCaseRisk risk e := minimaxValue_le_worstCaseRisk (bddBelow_range_worstCaseRisk hr) e
    Causalean.Stat.minimaxValue_le_worstCaseRisk_of_nonneg · Causalean/Stat/Minimax/MinimaxValue.lean:137
  • le_minimaxValue theorem — A bound uniform over admissible estimators is a lower bound. If every admissible estimator has worst-case risk at least c, the minimax value is at least c. This is the converse half of a minimax rate; it needs at least one admissible estimator to exist, since otherwise the minimax value is zero by convention.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    shared
    Nonempty E
    risk :
    E → Θ → ℝ
    c :
    h :
    ∀ e, c ≤ worstCaseRisk risk e
    c ≤ minimaxValue risk
    Proof (Lean source)
    theorem le_minimaxValue [Nonempty E] {risk : E → Θ → ℝ} {c : ℝ} (h : ∀ e, c ≤ worstCaseRisk risk e) : c ≤ minimaxValue risk := le_ciInf h
    Causalean.Stat.le_minimaxValue · Causalean/Stat/Minimax/MinimaxValue.lean:144
  • worstCaseRisk_mono_class theorem — Comparing two model classes at a fixed estimator: if every model of the first class is matched, through the map, by a model of the second class whose risk is at least as large, the worst-case risk over the first class is at most that over the second. The second class must bound the estimator's risk, and the first must be nonempty; see worstCaseRisk_mono_class_of_nonneg for the version that drops the nonemptiness.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    shared
    Θ' :
    Sort u_4
    shared
    Nonempty Θ
    risk :
    E → Θ → ℝ
    risk' :
    E → Θ' → ℝ
    e :
    E
    φ :
    Θ → Θ'
    hbdd :
    BddAbove (range (risk' e))
    hle :
    ∀ θ, risk e θ ≤ risk' e (φ θ)
    worstCaseRisk risk e ≤ worstCaseRisk risk' e
    Proof (Lean source)
    theorem worstCaseRisk_mono_class [Nonempty Θ] {risk : E → Θ → ℝ} {risk' : E → Θ' → ℝ} {e : E} (φ : Θ → Θ') (hbdd : BddAbove (range (risk' e))) (hle : ∀ θ, risk e θ ≤ risk' e (φ θ)) : worstCaseRisk risk e ≤ worstCaseRisk risk' e := worstCaseRisk_le fun θ => (hle θ).trans (le_worstCaseRisk hbdd (φ θ))
    Causalean.Stat.worstCaseRisk_mono_class · Causalean/Stat/Minimax/MinimaxValue.lean:172
  • worstCaseRisk_mono_class_of_nonneg theorem — Version of worstCaseRisk_mono_class for a nonnegative larger risk: no nonemptiness assumption on the smaller class is needed, because an empty class contributes worst-case risk zero, which the larger nonnegative worst-case risk already dominates.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    shared
    Θ' :
    Sort u_4
    shared
    risk :
    E → Θ → ℝ
    risk' :
    E → Θ' → ℝ
    e :
    E
    φ :
    Θ → Θ'
    hbdd :
    BddAbove (range (risk' e))
    hr' :
    ∀ θ', 0 ≤ risk' e θ'
    hle :
    ∀ θ, risk e θ ≤ risk' e (φ θ)
    worstCaseRisk risk e ≤ worstCaseRisk risk' e
    Proof (Lean source)
    theorem worstCaseRisk_mono_class_of_nonneg {risk : E → Θ → ℝ} {risk' : E → Θ' → ℝ} {e : E} (φ : Θ → Θ') (hbdd : BddAbove (range (risk' e))) (hr' : ∀ θ', 0 ≤ risk' e θ') (hle : ∀ θ, risk e θ ≤ risk' e (φ θ)) : worstCaseRisk risk e ≤ worstCaseRisk risk' e := by cases isEmpty_or_nonempty Θ with | inl _ => simpa using worstCaseRisk_nonneg hr' | inr _ => exact worstCaseRisk_mono_class φ hbdd hle
    Causalean.Stat.worstCaseRisk_mono_class_of_nonneg · Causalean/Stat/Minimax/MinimaxValue.lean:184
  • minimaxValue_le_minimaxValue theorem — Comparison of two minimax problems. If every admissible estimator of the second problem is matched by an estimator of the first whose worst-case risk is no larger, the first minimax value is at most the second. Both restricting the model class and enlarging the estimator family are instances; the boundedness hypothesis is on the first problem's worst-case risks, and the second problem must have at least one estimator.
    E :
    Sort u_1
    shared
    E' :
    Sort u_2
    shared
    Θ :
    Sort u_3
    shared
    Θ' :
    Sort u_4
    shared
    Nonempty E'
    risk :
    E → Θ → ℝ
    risk' :
    E' → Θ' → ℝ
    hbdd :
    h :
    ∀ e' : E', ∃ e : E, worstCaseRisk risk e ≤ worstCaseRisk risk' e'
    minimaxValue risk ≤ minimaxValue risk'
    Proof (Lean source)
    theorem minimaxValue_le_minimaxValue [Nonempty E'] {risk : E → Θ → ℝ} {risk' : E' → Θ' → ℝ} (hbdd : BddBelow (range (worstCaseRisk risk))) (h : ∀ e' : E', ∃ e : E, worstCaseRisk risk e ≤ worstCaseRisk risk' e') : minimaxValue risk ≤ minimaxValue risk' := by refine le_minimaxValue fun e' => ?_ obtain ⟨e, he⟩ := h e' exact (minimaxValue_le_worstCaseRisk hbdd e).trans he
    Causalean.Stat.minimaxValue_le_minimaxValue · Causalean/Stat/Minimax/MinimaxValue.lean:196
  • minimaxValue_mono_class theorem — Restricting the model class cannot raise the minimax value. If each model of the smaller class sits, through the map, inside the larger class with no larger risk, then the minimax value over the smaller class is at most the minimax value over the larger one — the same estimators face a weaker adversary. This is the standard step that transfers a published converse proved on a convenient subclass to the full class.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    shared
    Θ' :
    Sort u_4
    shared
    Nonempty E
    Nonempty Θ
    risk :
    E → Θ → ℝ
    risk' :
    E → Θ' → ℝ
    φ :
    Θ → Θ'
    hbddBelow :
    hbdd :
    ∀ e, BddAbove (range (risk' e))
    hle :
    ∀ e θ, risk e θ ≤ risk' e (φ θ)
    minimaxValue risk ≤ minimaxValue risk'
    Proof (Lean source)
    theorem minimaxValue_mono_class [Nonempty E] [Nonempty Θ] {risk : E → Θ → ℝ} {risk' : E → Θ' → ℝ} (φ : Θ → Θ') (hbddBelow : BddBelow (range (worstCaseRisk risk))) (hbdd : ∀ e, BddAbove (range (risk' e))) (hle : ∀ e θ, risk e θ ≤ risk' e (φ θ)) : minimaxValue risk ≤ minimaxValue risk' := minimaxValue_le_minimaxValue hbddBelow fun e => ⟨e, worstCaseRisk_mono_class φ (hbdd e) (hle e)⟩
    Causalean.Stat.minimaxValue_mono_class · Causalean/Stat/Minimax/MinimaxValue.lean:209
  • worstCaseRisk_eq_sSup_range theorem — The worst-case risk is the supremum of the set of risks the estimator attains across the class. Rewriting handle for arguments phrased on the set of attained risks.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    shared
    risk :
    E → Θ → ℝ
    e :
    E
    worstCaseRisk risk e = sSup (range (risk e))
    Proof (Lean source)
    theorem worstCaseRisk_eq_sSup_range (risk : E → Θ → ℝ) (e : E) : worstCaseRisk risk e = sSup (range (risk e)) := rfl
    Causalean.Stat.worstCaseRisk_eq_sSup_range · Causalean/Stat/Minimax/MinimaxValue.lean:248
  • minimaxValue_eq_sInf_range theorem — The minimax value is the infimum of the set of worst-case risks the admissible estimators attain. Rewriting handle for arguments phrased on that set.
    E :
    Sort u_1
    shared
    Θ :
    Sort u_3
    shared
    risk :
    E → Θ → ℝ
    Proof (Lean source)
    theorem minimaxValue_eq_sInf_range (risk : E → Θ → ℝ) : minimaxValue risk = sInf (range (worstCaseRisk risk)) := rfl
    Causalean.Stat.minimaxValue_eq_sInf_range · Causalean/Stat/Minimax/MinimaxValue.lean:254
  • minimaxValue_subtype_eq_sInf_worstCaseRisk theorem — The minimax value over the estimators satisfying an admissibility condition, written as the infimum of the set of worst-case risks the admissible estimators attain. This is the bridge for developments that state admissibility by a predicate rather than by a subtype while leaving the inner supremum as it stands.
    Θ :
    Sort u_3
    shared
    A :
    Type u_5
    A → Prop
    shared
    risk :
    A → Θ → ℝ
    minimaxValue (fun (e : Subtype Adm) => risk e.1)
    = sInf {r : ℝ | ∃ e, Adm e ∧ r = worstCaseRisk risk e}
    Proof (Lean source)
    theorem minimaxValue_subtype_eq_sInf_worstCaseRisk {Adm : A → Prop} (risk : A → Θ → ℝ) : minimaxValue (fun (e : Subtype Adm) => risk e.1) = sInf {r : ℝ | ∃ e, Adm e ∧ r = worstCaseRisk risk e} := by rw [minimaxValue_eq_sInf_range] congr 1 ext r simp only [Set.mem_range, Set.mem_setOf_eq, Subtype.exists] constructor · rintro ⟨e, he, rfl⟩ exact ⟨e, he, rfl⟩ · rintro ⟨e, he, rfl⟩ exact ⟨e, he, rfl⟩
    Causalean.Stat.minimaxValue_subtype_eq_sInf_worstCaseRisk · Causalean/Stat/Minimax/MinimaxValue.lean:262
  • worstCaseRisk_subtype_eq_sSup_setOf theorem — The worst-case risk over a class carved out by a membership condition, written as the supremum of the set of risks attained on the class. This is the bridge to the spelling that states the class by a predicate rather than by a subtype.
    A :
    Type u_5
    shared
    B :
    Type u_6
    B → Prop
    shared
    risk :
    A → B → ℝ
    e :
    A
    worstCaseRisk (fun (a : A) (θ : Subtype Cls) => risk a θ.1) e
    = sSup {q : ℝ | ∃ θ, Cls θ ∧ q = risk e θ}
    Proof (Lean source)
    theorem worstCaseRisk_subtype_eq_sSup_setOf {Cls : B → Prop} (risk : A → B → ℝ) (e : A) : worstCaseRisk (fun (a : A) (θ : Subtype Cls) => risk a θ.1) e = sSup {q : ℝ | ∃ θ, Cls θ ∧ q = risk e θ} := by rw [worstCaseRisk, iSup] congr 1 ext q simp only [Set.mem_range, Set.mem_setOf_eq, Subtype.exists, exists_prop] constructor · rintro ⟨θ, hθ, rfl⟩ exact ⟨θ, hθ, rfl⟩ · rintro ⟨θ, hθ, rfl⟩ exact ⟨θ, hθ, rfl⟩
    Causalean.Stat.worstCaseRisk_subtype_eq_sSup_setOf · Causalean/Stat/Minimax/MinimaxValue.lean:279
  • minimaxValue_subtype_eq_sInf_setOf theorem — The minimax value over an admissible-estimator condition and a model-class condition, written with set comprehensions instead of subtypes: the infimum of the set of worst-case risks attained by admissible estimators, each of which is the supremum of the set of risks attained on the class. Runs that spell their minimax risk this way rewrite with this lemma and then use the rest of this file.
    A :
    Type u_5
    shared
    B :
    Type u_6
    shared
    Adm :
    A → Prop
    Cls :
    B → Prop
    risk :
    A → B → ℝ
    minimaxValue (fun (e : Subtype Adm) (θ : Subtype Cls) => risk e.1 θ.1)
    = sInf {r : ℝ | ∃ e, Adm e ∧ r = sSup {q : ℝ | ∃ θ, Cls θ ∧ q = risk e θ}}
    Proof (Lean source)
    theorem minimaxValue_subtype_eq_sInf_setOf (Adm : A → Prop) (Cls : B → Prop) (risk : A → B → ℝ) : minimaxValue (fun (e : Subtype Adm) (θ : Subtype Cls) => risk e.1 θ.1) = sInf {r : ℝ | ∃ e, Adm e ∧ r = sSup {q : ℝ | ∃ θ, Cls θ ∧ q = risk e θ}} := by rw [minimaxValue_subtype_eq_sInf_worstCaseRisk (risk := fun (a : A) (θ : Subtype Cls) => risk a θ.1)] congr 1 ext r simp only [Set.mem_setOf_eq, worstCaseRisk_subtype_eq_sSup_setOf]
    Causalean.Stat.minimaxValue_subtype_eq_sInf_setOf · Causalean/Stat/Minimax/MinimaxValue.lean:295
Mixture 3 core · 7 supporting This file defines finite mixtures of measures with nonnegative extended-real weights. ★ mixtureReal_le

Finite Mixtures of Measures

This file defines finite mixtures of measures with nonnegative extended-real weights. It proves evaluation, probability-measure, and domination facts used to transfer componentwise bounds to mixtures in minimax arguments.

def mixture reviewed
Causalean.Stat

Given a sample space equipped with a σ-algebra, a finite index set, nonnegative extended-real weights indexed by that set, and a measure for each index, the finite mixture measure is the sum of the component measures, each scaled by its corresponding weight.

Definition (Lean source)
Ω :
Type u_1
shared
ι :
Type u_2
shared
w :
ι → ℝ≥0∞
P :
ι → Measure Ω
mixture w P :
∑ i, w i • P i
theorem mixtureReal_le reviewed
Causalean.Stat

Domination. If the mixture weights w sum to 1, each component measure P i is a probability measure, and every component assigns .real-mass at most B to the set A, then the mixture measure also assigns .real-mass at most B to A.

Formal statement
Ω :
Type u_1
shared
ι :
Type u_2
shared
w :
ι → ℝ≥0∞
hw :
∑ i, w i = 1
P :
ι → Measure Ω
A :
Set Ω
B :
hB :
∀ i, (P i).real A ≤ B
(mixture w P).real A ≤ B
Proof (Lean source)
theorem mixtureReal_le (w : ι → ℝ≥0∞) (hw : ∑ i, w i = 1) (P : ι → Measure Ω) [∀ i, IsProbabilityMeasure (P i)] (A : Set Ω) (B : ℝ) (hB : ∀ i, (P i).real A ≤ B) : (mixture w P).real A ≤ B := by have hwfin : ∀ i, w i ≠ ⊤ := by intro i have hle : w i ≤ 1 := le_of_le_of_eq (Finset.single_le_sum (f := w) (fun j _ => zero_le) (Finset.mem_univ i)) hw exact ne_top_of_le_ne_top ENNReal.one_ne_top hle have hterm : ∀ i, w i * P i A ≠ ⊤ := by intro i exact ENNReal.mul_ne_top (hwfin i) (measure_ne_top _ _) rw [Measure.real, mixture_apply, ENNReal.toReal_sum (fun i _ => hterm i)] have hsum : (∑ i, (w i * P i A).toReal) ≤ ∑ i, (w i).toReal * B := by refine Finset.sum_le_sum (fun i _ => ?_) rw [ENNReal.toReal_mul] refine mul_le_mul_of_nonneg_left ?_ ENNReal.toReal_nonneg have : (P i).real A = (P i A).toReal := rfl rw [← this] exact hB i refine hsum.trans ?_ rw [← Finset.sum_mul] have hwsum : (∑ i, (w i).toReal) = 1 := by rw [← ENNReal.toReal_sum (fun i _ => hwfin i), hw, ENNReal.toReal_one] rw [hwsum, one_mul]
Causalean.Stat.mixtureReal_le · Causalean/Stat/Minimax/Mixture.lean:57 · uses mixture
def priorPredictive reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given a prior measure and a measurable experiment kernel, the prior-predictive law first draws a parameter from the prior and then draws an observation from the experiment at that parameter.

Definition (Lean source)
Θ :
Type u_1
shared
X :
Type u_2
shared
π :
K :
Kernel Θ X
priorPredictive π K :
π.bind fun θ => K θ
Causalean.Stat.Minimax.MomentMatchedMixture.priorPredictive · Causalean/Stat/Minimax/Mixture.lean:114
7 supporting declarations (lemmas, instances)
Assouad 5 core · 7 supporting This file develops Assouad's lower bound for statistical experiments indexed by a Boolean hypercube. ★ assouad_average★ assouad_exists

Assouad hypercube minimax bound

This file develops Assouad's lower bound for statistical experiments indexed by a Boolean hypercube. It introduces coordinate flips and Hamming risk, then uses coordinatewise total-variation bounds between neighboring experiments to derive average and worst-case minimax lower bounds.

def flipBit reviewed
Causalean.Stat

Given a hypercube dimension, a coordinate of that hypercube, and a Boolean hypercube vertex, the coordinate-flipped vertex agrees with the given vertex at every coordinate except the specified one, where it takes the opposite Boolean value.

Definition (Lean source)
d :
shared
j :
Fin d
τ :
Fin d → Bool
flipBit j τ :
Fin d → Bool
update τ j (!τ j)
def flipPerm reviewed
Causalean.Stat

Given a hypercube dimension and a coordinate of that hypercube, the coordinate-flip permutation is the bijection of Boolean hypercube vertices that flips precisely the specified coordinate.

Definition (Lean source)
d :
shared
j :
Fin d
flipPerm j :
Perm (Fin d → Bool)
Causalean.Stat.flipPerm · Causalean/Stat/Minimax/Assouad.lean:79
def hammingRisk reviewed
Causalean.Stat

Given a measurable sample space, a hypercube dimension, a measure for every Boolean hypercube vertex, an estimator returning a Boolean vertex from each sample outcome, and a true vertex, the Hamming risk is the sum, over coordinates, of the measure of the outcomes at which the estimator differs from that true vertex under its associated measure.

Definition (Lean source)
Ω :
Type u_1
shared
d :
shared
P :
(Fin d → Bool) → Measure Ω
est :
Ω → Fin d → Bool
τ :
Fin d → Bool
hammingRisk P est τ :
∑ j, (P τ).real {ω | est ω j ≠ τ j}
Causalean.Stat.hammingRisk · Causalean/Stat/Minimax/Assouad.lean:87
theorem assouad_average reviewed
Causalean.Stat

Assouad's lemma (average form). Assume each coordinate's decoded-bit event is measurable. If every hypercube vertex's law is within total variation β of each of its d neighbouring vertices' laws, then the average Hamming risk over the cube is at least (d / 2)(1 − β). Choosing the dimension d large and the per-coordinate divergence β small forces a large number of mis-decoded coordinates.

Formal statement
Ω :
Type u_1
shared
d :
shared
P :
(Fin d → Bool) → Measure Ω
shared
est :
Ω → Fin d → Bool
shared
hmeas :
∀ j (b : Bool), MeasurableSet {ω | est ω j = b}
β :
:
∀ j τ, tvDist (P τ) (P (flipBit j τ)) ≤ β
(d / 2 : ℝ) * (1 - β) ≤ (∑ τ, hammingRisk P est τ) / (card (Fin d → Bool))
Proof (Lean source)
theorem assouad_average (hmeas : ∀ j (b : Bool), MeasurableSet {ω | est ω j = b}) {β : ℝ} (hβ : ∀ j τ, tvDist (P τ) (P (flipBit j τ)) ≤ β) : (d / 2 : ℝ) * (1 - β) ≤ (∑ τ, hammingRisk P est τ) / (card (Fin d → Bool)) := by set C : ℝ := (card (Fin d → Bool) : ℝ) with hC have hCnat : 0 < card (Fin d → Bool) := Fintype.card_pos_iff.mpr ⟨fun _ => false⟩ have hCpos : (0 : ℝ) < C := by rw [hC]; exact_mod_cast hCnat -- Per coordinate: `C·(1−β)/2 ≤ ∑_τ (coordinate-j error mass)`. have hG : ∀ j, C * (1 - β) / 2 ≤ ∑ τ, (P τ).real {ω | est ω j ≠ τ j} := by intro j have hcoord := sum_decode_ge P est hmeas j have hβsum : C * (1 - β) ≤ ∑ τ, (1 - tvDist (P τ) (P (flipBit j τ))) := by have h1 : ∑ _τ : Fin d → Bool, (1 - β) ≤ ∑ τ, (1 - tvDist (P τ) (P (flipBit j τ))) := Finset.sum_le_sum (fun τ _ => by linarith [hβ j τ]) have h2 : ∑ _τ : Fin d → Bool, (1 - β) = C * (1 - β) := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, hC] linarith [h1, h2] linarith [hβsum, hcoord] -- Sum the coordinate bounds, then divide by the cube size. have hswap : ∑ τ, hammingRisk P est τ = ∑ j, ∑ τ, (P τ).real {ω | est ω j ≠ τ j} := by simp_rw [hammingRisk]; rw [Finset.sum_comm] have hfinal : (d : ℝ) * (C * (1 - β) / 2) ≤ ∑ τ, hammingRisk P est τ := by rw [hswap] have h2 : (d : ℝ) * (C * (1 - β) / 2) = ∑ _j : Fin d, (C * (1 - β) / 2) := by rw [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] rw [h2] exact Finset.sum_le_sum (fun j _ => hG j) rw [le_div_iff₀ hCpos] have hrw : (d / 2 : ℝ) * (1 - β) * C = (d : ℝ) * (C * (1 - β) / 2) := by ring rw [hrw]; exact hfinal
theorem assouad_exists reviewed
Causalean.Stat

Assouad's lemma (existence form). Under the same hypotheses — each coordinate's decoded-bit event is measurable and every vertex's law is within total variation β of each of its d neighbourssome vertex τ forces Hamming risk at least (d / 2)(1 − β): no cube estimator can decode every vertex's coordinates reliably when neighbouring laws are statistically close.

Formal statement
Ω :
Type u_1
shared
d :
shared
P :
(Fin d → Bool) → Measure Ω
shared
est :
Ω → Fin d → Bool
shared
hmeas :
∀ j (b : Bool), MeasurableSet {ω | est ω j = b}
β :
:
∀ j τ, tvDist (P τ) (P (flipBit j τ)) ≤ β
∃ τ, (d / 2 : ℝ) * (1 - β) ≤ hammingRisk P est τ
Proof (Lean source)
theorem assouad_exists (hmeas : ∀ j (b : Bool), MeasurableSet {ω | est ω j = b}) {β : ℝ} (hβ : ∀ j τ, tvDist (P τ) (P (flipBit j τ)) ≤ β) : ∃ τ, (d / 2 : ℝ) * (1 - β) ≤ hammingRisk P est τ := by set C : ℝ := (card (Fin d → Bool) : ℝ) with hC have hCnat : 0 < card (Fin d → Bool) := Fintype.card_pos_iff.mpr ⟨fun _ => false⟩ have hCpos : (0 : ℝ) < C := by rw [hC]; exact_mod_cast hCnat have havg := assouad_average P est hmeas hβ rw [← hC] at havg by_contra hcon push_neg at hcon have hstrict : ∑ τ, hammingRisk P est τ < C * ((d / 2 : ℝ) * (1 - β)) := by calc ∑ τ, hammingRisk P est τ < ∑ _τ : Fin d → Bool, ((d / 2 : ℝ) * (1 - β)) := Finset.sum_lt_sum_of_nonempty ⟨fun _ => false, Finset.mem_univ _⟩ (fun τ _ => hcon τ) _ = C * ((d / 2 : ℝ) * (1 - β)) := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, hC] rw [le_div_iff₀ hCpos] at havg nlinarith [havg, hstrict]
7 supporting declarations (lemmas, instances)
Finite­Kernel­Bayes 7 core · 25 supporting This module supplies a real-valued Bayes-to-minimax bridge for a finite state space. ★ realBayesRisk_le_minimaxValue

Finite-state Bayes risks through probability kernels

This module supplies a real-valued Bayes-to-minimax bridge for a finite state space. A possibly continuous prior is mixed through a Markov kernel, and the resulting average loss is bounded by the finite worst-case loss. It also gives deterministic-map and FiniteDesign specializations, including the finite-sum and measure-integral representations of the mixed risk.

def kernelAverageLoss reviewed
Causalean.Stat

Given a measurable parameter space, a finite measurable state space, an action space, a probability kernel from parameters to states, a real-valued loss for each action and state, an action, and a parameter value, the kernel-average loss is the expected loss of that action under the state distribution selected by the kernel at that parameter value.

Definition (Lean source)
Θ :
Type u_1
shared
S :
Type u_2
shared
A :
Type u_3
shared
K :
Kernel Θ S
loss :
A → S → ℝ
a :
A
θ :
Θ
kernelAverageLoss K loss a θ :
∫ s, loss a s ∂K θ
Causalean.Stat.kernelAverageLoss · Causalean/Stat/Minimax/FiniteKernelBayes.lean:50
def mixedKernelLoss reviewed
Causalean.Stat

Given a measurable parameter space, a finite measurable state space, an action space, a prior measure on the parameter space, a probability kernel from parameters to states, a real-valued loss for each action and state, and an action, the mixed kernel loss is that action's kernel-average loss integrated with respect to the prior.

Definition (Lean source)
Θ :
Type u_1
shared
S :
Type u_2
shared
A :
Type u_3
shared
π :
K :
Kernel Θ S
loss :
A → S → ℝ
a :
A
mixedKernelLoss π K loss a :
∫ θ, kernelAverageLoss K loss a θ ∂π
Causalean.Stat.mixedKernelLoss · Causalean/Stat/Minimax/FiniteKernelBayes.lean:102
def realBayesRisk reviewed
Causalean.Stat

Given a measurable parameter space, a finite measurable state space, an action space, a prior measure on the parameter space, a probability kernel from parameters to states, and a real-valued loss for each action and state, the real Bayes risk is the infimum, over all actions, of their mixed kernel losses.

Definition (Lean source)
Θ :
Type u_1
shared
S :
Type u_2
shared
A :
Type u_3
shared
π :
K :
Kernel Θ S
loss :
A → S → ℝ
realBayesRisk π K loss :
⨅ a, mixedKernelLoss π K loss a
theorem realBayesRisk_le_minimaxValue reviewed
Causalean.Stat

With at least one available action and nonnegative statewise loss, the real Bayes risk under a continuous prior and finite-state Markov kernel is at most the finite-state minimax value.

Formal statement
Θ :
Type u_1
shared
S :
Type u_2
shared
A :
Type u_3
Nonempty A
shared
loss :
A → S → ℝ
hloss :
∀ a s, 0 ≤ loss a s
realBayesRisk π K loss ≤ minimaxValue loss
Proof (Lean source)
theorem realBayesRisk_le_minimaxValue [Nonempty A] (π : Measure Θ) [IsProbabilityMeasure π] (K : Kernel Θ S) [IsMarkovKernel K] (loss : A → S → ℝ) (hloss : ∀ a s, 0 ≤ loss a s) : realBayesRisk π K loss ≤ minimaxValue loss := by apply le_minimaxValue intro a refine (ciInf_le ?_ a).trans (mixedKernelLoss_le_worstCaseRisk π K loss hloss a) refine ⟨0, ?_⟩ rintro _ ⟨a', rfl⟩ exact mixedKernelLoss_nonneg π K loss hloss a'
Causalean.Stat.realBayesRisk_le_minimaxValue · Causalean/Stat/Minimax/FiniteKernelBayes.lean:170 · uses minimaxValue , realBayesRisk
def deterministicBayesRisk reviewed
Causalean.Stat

Given a measurable parameter space, a finite measurable state space, an action space, a prior measure on the parameter space, a map assigning each parameter a state, and a real-valued loss for each action and state, the deterministic Bayes risk is the infimum, over all actions, of the prior-integrated loss evaluated at the state assigned to each parameter.

Definition (Lean source)
Θ :
Type u_1
shared
S :
Type u_2
shared
A :
Type u_3
shared
π :
f :
Θ → S
loss :
A → S → ℝ
deterministicBayesRisk π f loss :
⨅ a, ∫ θ, loss a (f θ) ∂π
Causalean.Stat.deterministicBayesRisk · Causalean/Stat/Minimax/FiniteKernelBayes.lean:217
def finiteDesignBayesRisk reviewed
Causalean.Stat

Given a finite state space, an action space, a finite randomization design on the state space, and a real-valued loss for each action and state, the finite-design Bayes risk is the infimum, over all actions, of their expected losses under that design.

Definition (Lean source)
S :
Type u_2
shared
A :
Type u_3
shared
D :
loss :
A → S → ℝ
finiteDesignBayesRisk D loss :
⨅ a, D.E (loss a)
Causalean.Stat.finiteDesignBayesRisk · Causalean/Stat/Minimax/FiniteKernelBayes.lean:276 · uses FiniteDesign
def inducedFiniteDesign reviewed
Causalean.Stat

Given a measurable parameter space, a nonempty finite measurable state space with measurable singletons, a probability prior on the parameter space, and a Markov kernel from parameters to states, the induced finite design is the design whose probability assigned to each state is the prior average of the kernel's probability of that state, these probabilities are nonnegative, and their sum over all states is one.

Definition (Lean source)
Θ :
Type u_1
shared
S :
Type u_2
shared
inducedFiniteDesign π K :
clause 1
p s := ∫ θ, (K θ).real {s} ∂π
clause 2
p_nonneg := by intro s exact integral_nonneg fun θ ↦ measureReal_nonneg
clause 3
p_sum := by rw [← integral_finsetSum] · simp_rw [sum_measureReal_singleton] simp · intro s _ exact integrable_kernel_singletonReal π K s
Causalean.Stat.inducedFiniteDesign · Causalean/Stat/Minimax/FiniteKernelBayes.lean:298 · uses FiniteDesign
25 supporting declarations (lemmas, instances)
Minimax­Risk 6 core · 7 supporting This file specializes Le Cam's two-point method to real-valued statistical functionals and to estimators based on independent repeated samples. ★ real_two_point_lower_bound★ two_point_lower_bound_of_tvDist_le★ iid_two_point_lower_bound★ two_point_lower_bound_of_chiSqDiv_le

Minimax Risk Lower Bounds

This file specializes Le Cam's two-point method to real-valued statistical functionals and to estimators based on independent repeated samples. It records the total-variation, chi-squared-divergence, and bounded-estimator integrability forms used to certify concrete minimax rates.

theorem real_two_point_lower_bound reviewed
Causalean.Stat

Le Cam two-point bound for a real-valued parameter. If two candidate values θ₀, θ₁ : ℝ are 2s-separated, then for any measurable estimator est : Ω → ℝ, the worst-case probability of missing the truth by ≥ s is at least ½(1 − tvDist P₀ P₁). Specialization of half_one_sub_tvDist_le_max_error to Θ = ℝ with dist a b = |a − b|.

Formal statement
Ω :
Type u_1
Ω → ℝ
shared
hest :
θ₀ θ₁ s :
hsep :
2 * s ≤ |θ₀ - θ₁|
(1 - tvDist P₀ P₁) / 2
max (P₀.real {ω | s ≤ |est ω - θ₀|}) (P₁.real {ω | s ≤ |est ω - θ₁|})
Proof (Lean source)
theorem real_two_point_lower_bound {est : Ω → ℝ} (hest : Measurable est) {θ₀ θ₁ s : ℝ} (hsep : 2 * s ≤ |θ₀ - θ₁|) : (1 - tvDist P₀ P₁) / 2 ≤ max (P₀.real {ω | s ≤ |est ω - θ₀|}) (P₁.real {ω | s ≤ |est ω - θ₁|}) := by have hsep' : 2 * s ≤ dist θ₀ θ₁ := by rwa [Real.dist_eq] have h := half_one_sub_tvDist_le_max_error (P₀ := P₀) (P₁ := P₁) (Θ := ℝ) hest hsep' simpa only [Real.dist_eq] using h
Causalean.Stat.real_two_point_lower_bound · Causalean/Stat/Minimax/MinimaxRisk.lean:56 · uses tvDist
theorem two_point_lower_bound_of_tvDist_le reviewed
Causalean.Stat

Le Cam two-point bound with an explicit total-variation bound. If two candidate values θ₀, θ₁ : ℝ are 2s-separated, est : Ω → ℝ is a measurable estimator, and the total variation distance tvDist P₀ P₁ is at most c, then the worst-case probability of missing the truth by ≥ s is at least (1 − c)/2. Variant of real_two_point_lower_bound with an explicit total-variation upper bound.

Formal statement
Ω :
Type u_1
Ω → ℝ
shared
hest :
θ₀ θ₁ s c :
hsep :
2 * s ≤ |θ₀ - θ₁|
hc :
tvDist P₀ P₁ ≤ c
(1 - c) / 2 ≤ max (P₀.real {ω | s ≤ |est ω - θ₀|}) (P₁.real {ω | s ≤ |est ω - θ₁|})
Proof (Lean source)
theorem two_point_lower_bound_of_tvDist_le {est : Ω → ℝ} (hest : Measurable est) {θ₀ θ₁ s c : ℝ} (hsep : 2 * s ≤ |θ₀ - θ₁|) (hc : tvDist P₀ P₁ ≤ c) : (1 - c) / 2 ≤ max (P₀.real {ω | s ≤ |est ω - θ₀|}) (P₁.real {ω | s ≤ |est ω - θ₁|}) := by have h := real_two_point_lower_bound (P₀ := P₀) (P₁ := P₁) hest hsep have : (1 - c) / 2 ≤ (1 - tvDist P₀ P₁) / 2 := by linarith exact this.trans h
Causalean.Stat.two_point_lower_bound_of_tvDist_le · Causalean/Stat/Minimax/MinimaxRisk.lean:69 · uses tvDist
theorem iid_two_point_lower_bound reviewed
Causalean.Stat

n-sample structure-agnostic two-point bound. Given two single-observation laws P₀, P₁ and a real functional τ such that the functional values τ P₀, τ P₁ are 2s-separated, then for any measurable estimator est built from n i.i.d. samples (data law Measure.pi (fun _ ↦ Pⱼ)), the worst-case miss probability, using τ P₀ and τ P₁ as the two parameters, is at least ½(1 − tvDist) between the two n-fold product laws.

Formal statement
S :
τ :
Measure S → ℝ
n :
s :
hsep :
2 * s ≤ |τ P₀ - τ P₁|
est :
(Fin n → S) → ℝ
hest :
(1 - tvDist (Measure.pi fun _ : Fin n => P₀) (Measure.pi fun _ : Fin n => P₁)) / 2
max ((Measure.pi fun _ : Fin n => P₀).real {x | s ≤ |est x - τ P₀|}) ((Measure.pi fun _ : Fin n => P₁).real {x | s ≤ |est x - τ P₁|})
Proof (Lean source)
theorem iid_two_point_lower_bound {S : Type*} [MeasurableSpace S] (P₀ P₁ : Measure S) [IsProbabilityMeasure P₀] [IsProbabilityMeasure P₁] (τ : Measure S → ℝ) (n : ℕ) {s : ℝ} (hsep : 2 * s ≤ |τ P₀ - τ P₁|) {est : (Fin n → S) → ℝ} (hest : Measurable est) : (1 - tvDist (Measure.pi fun _ : Fin n => P₀) (Measure.pi fun _ : Fin n => P₁)) / 2 ≤ max ((Measure.pi fun _ : Fin n => P₀).real {x | s ≤ |est x - τ P₀|}) ((Measure.pi fun _ : Fin n => P₁).real {x | s ≤ |est x - τ P₁|}) := real_two_point_lower_bound (P₀ := Measure.pi fun _ : Fin n => P₀) (P₁ := Measure.pi fun _ : Fin n => P₁) hest hsep
Causalean.Stat.iid_two_point_lower_bound · Causalean/Stat/Minimax/MinimaxRisk.lean:82 · uses tvDist
theorem two_point_lower_bound_of_chiSqDiv_le reviewed
Causalean.Stat

χ²-form two-point lower bound. For a measurable estimator est, if two candidate values θ₀, θ₁ are 2s-separated, P₀ is absolutely continuous with respect to P₁, the squared density deviation (dP₀/dP₁ − 1)² is P₁-integrable, and the χ²-divergence chiSqDiv P₀ P₁ is at most c, then the worst-case miss probability is at least (1 − ½√c)/2, via tvDist ≤ ½√χ². Since chiSqDiv tensorizes over i.i.d. samples (chiSqDiv_prod) and is computable for explicit families, this is the form used to certify minimax rates.

Formal statement
Ω :
Type u_1
Ω → ℝ
shared
hest :
θ₀ θ₁ s :
hsep :
2 * s ≤ |θ₀ - θ₁|
hac :
P₀ ≪ P₁
hint :
Integrable (fun x => ((P₀.rnDeriv P₁ x).toReal - 1) ^ 2) P₁
c :
hc :
chiSqDiv P₀ P₁ ≤ c
(1 - (1 / 2) * sqrt c) / 2
max (P₀.real {ω | s ≤ |est ω - θ₀|}) (P₁.real {ω | s ≤ |est ω - θ₁|})
Proof (Lean source)
theorem two_point_lower_bound_of_chiSqDiv_le {est : Ω → ℝ} (hest : Measurable est) {θ₀ θ₁ s : ℝ} (hsep : 2 * s ≤ |θ₀ - θ₁|) (hac : P₀ ≪ P₁) (hint : Integrable (fun x => ((P₀.rnDeriv P₁ x).toReal - 1) ^ 2) P₁) {c : ℝ} (hc : chiSqDiv P₀ P₁ ≤ c) : (1 - (1 / 2) * sqrt c) / 2 ≤ max (P₀.real {ω | s ≤ |est ω - θ₀|}) (P₁.real {ω | s ≤ |est ω - θ₁|}) := by have htv : tvDist P₀ P₁ ≤ (1 / 2) * sqrt c := by refine (tvDist_le_half_sqrt_chiSqDiv P₀ P₁ hac hint).trans ?_ gcongr exact two_point_lower_bound_of_tvDist_le hest hsep htv
Causalean.Stat.two_point_lower_bound_of_chiSqDiv_le · Causalean/Stat/Minimax/MinimaxRisk.lean:98 · uses chiSqDiv
def sqRisk reviewed
Causalean.Stat

Given a measurable observation space, a measure on that space, a real-valued estimator, and a real target value, the squared risk is the expected value, under that measure, of the estimator's squared error from the target.

Definition (Lean source)
X :
Type uX
shared
law :
est :
X → ℝ
theta :
sqRisk law est theta :
∫ z, (est z - theta) ^ 2 ∂law
def affinePullbackEstimator reviewed
Causalean.Stat

Given a source observation space, a target observation space, a deterministic observation rule from the source to the target, real affine slope and offset parameters, and a real-valued target-space estimator, the affine pullback estimator maps each source observation to the target estimator evaluated at its observed target value, minus the offset and divided by the slope.

Definition (Lean source)
X :
Type uX
shared
Y :
Type uY
shared
phi :
X → Y
a b :
targetEst :
Y → ℝ
affinePullbackEstimator phi a b targetEst :
X → ℝ
fun z => (targetEst (phi z) - b) / a
Causalean.Stat.affinePullbackEstimator · Causalean/Stat/Minimax/MinimaxRisk.lean:185
7 supporting declarations (lemmas, instances)
  • mse_integrable_of_estimator_bound lemma — Squared-loss integrability for a truncated estimator. If a measurable estimator T takes values in the bounded interval [-M, M] (with M ≥ 0), then under any finite measure Q its squared loss (T − θ)² against an arbitrary target θ is integrable, because it is bounded by the constant (M + |θ|)². This is the routine integrability bookkeeping needed before the worst-case squared risk of a truncated estimator can be compared in a two-point lower bound.
    S :
    T :
    S → ℝ
    hT :
    M theta :
    hM :
    0 ≤ M
    hbound :
    ∀ s, T s ∈ Icc (-M) M
    Integrable (fun s => (T s - theta) ^ 2) Q
    Proof (Lean source)
    lemma mse_integrable_of_estimator_bound {S : Type*} [MeasurableSpace S] (Q : Measure S) [IsFiniteMeasure Q] (T : S → ℝ) (hT : Measurable T) {M theta : ℝ} (hM : 0 ≤ M) (hbound : ∀ s, T s ∈ Icc (-M) M) : Integrable (fun s => (T s - theta) ^ 2) Q := by refine Integrable.of_bound ((hT.sub measurable_const).pow_const (2 : ℕ)).aestronglyMeasurable ((M + |theta|) ^ 2) ?_ filter_upwards with s have hTabs : |T s| ≤ M := abs_le.mpr (hbound s) have hsub : |T s - theta| ≤ M + |theta| := (abs_sub (T s) theta).trans (add_le_add hTabs le_rfl) have hC : 0 ≤ M + |theta| := add_nonneg hM (abs_nonneg theta) have hsq : (T s - theta) ^ 2 ≤ (M + |theta|) ^ 2 := by nlinarith [hsub, abs_nonneg (T s - theta), hC, sq_abs (T s - theta)] simpa [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg (T s - theta))] using hsq
    Causalean.Stat.mse_integrable_of_estimator_bound · Causalean/Stat/Minimax/MinimaxRisk.lean:116
  • integral_le_sSup_range_of_isProbabilityMeasure lemma — Bayes risk never exceeds worst-case risk. Averaging an integrable risk function over the parameter space against any prior *probability* distribution gives at most the supremum of that risk over the parameter space (assuming the risk is bounded above). This is the step that lets a minimax lower bound be certified by exhibiting a single prior and bounding its average risk from below.
    Θ :
    risk :
    Θ → ℝ
    hrisk :
    Integrable risk π
    hbounded :
    ∫ θ, risk θ ∂π ≤ sSup (range risk)
    Proof (Lean source)
    lemma integral_le_sSup_range_of_isProbabilityMeasure {Θ : Type*} [MeasurableSpace Θ] (π : Measure Θ) [IsProbabilityMeasure π] (risk : Θ → ℝ) (hrisk : Integrable risk π) (hbounded : BddAbove (range risk)) : ∫ θ, risk θ ∂π ≤ sSup (range risk) := by have hpoint : ∀ θ, risk θ ≤ sSup (range risk) := fun θ => le_csSup hbounded (Set.mem_range_self θ) have hconst : Integrable (fun _ : Θ => sSup (range risk)) π := integrable_const _ have hmono : (∫ θ, risk θ ∂π) ≤ ∫ _ : Θ, sSup (range risk) ∂π := integral_mono hrisk hconst hpoint simpa using hmono
    Causalean.Stat.integral_le_sSup_range_of_isProbabilityMeasure · Causalean/Stat/Minimax/MinimaxRisk.lean:137
  • measurable_affinePullbackEstimator theorem — If the observation rule is measurable and the target estimator is measurable, then undoing an affine change after pulling the estimator back through the observation rule is measurable.
    X :
    Type uX
    shared
    Y :
    Type uY
    X → Y
    shared
    a b :
    targetEst :
    Y → ℝ
    hphi :
    htarget :
    Measurable targetEst
    Proof (Lean source)
    @[fun_prop] theorem measurable_affinePullbackEstimator {phi : X → Y} {a b : ℝ} {targetEst : Y → ℝ} (hphi : Measurable phi) (htarget : Measurable targetEst) : Measurable (affinePullbackEstimator phi a b targetEst) := by exact ((htarget.comp hphi).sub measurable_const).div measurable_const
    Causalean.Stat.measurable_affinePullbackEstimator · Causalean/Stat/Minimax/MinimaxRisk.lean:194
  • affine_sqLoss_pullback_identity theorem — If the affine slope is nonzero, then the squared error of a target estimator after deterministic observation equals the squared error of its affine pullback multiplied by the squared slope, point by point.
    X :
    Type uX
    shared
    Y :
    Type uY
    X → Y
    shared
    a b theta :
    targetEst :
    Y → ℝ
    ha :
    a ≠ 0
    z :
    X
    a ^ 2 * (affinePullbackEstimator phi a b targetEst z - theta) ^ 2
    = (targetEst (phi z) - (a * theta + b)) ^ 2
    Proof (Lean source)
    theorem affine_sqLoss_pullback_identity {phi : X → Y} {a b theta : ℝ} {targetEst : Y → ℝ} (ha : a ≠ 0) (z : X) : a ^ 2 * (affinePullbackEstimator phi a b targetEst z - theta) ^ 2 = (targetEst (phi z) - (a * theta + b)) ^ 2 := by unfold affinePullbackEstimator field_simp ring
    Causalean.Stat.affine_sqLoss_pullback_identity · Causalean/Stat/Minimax/MinimaxRisk.lean:205
  • sqRisk_map_affinePullback theorem — If the affine slope is nonzero, the deterministic observation rule is measurable, and the target estimator is measurable, then its squared risk under the pushed-forward law equals the pullback estimator's squared risk multiplied by the squared slope.
    X :
    Type uX
    shared
    Y :
    Type uY
    shared
    law :
    phi :
    X → Y
    a b theta :
    targetEst :
    Y → ℝ
    ha :
    a ≠ 0
    hphi :
    htarget :
    Measurable targetEst
    a ^ 2 * sqRisk law (affinePullbackEstimator phi a b targetEst) theta
    = sqRisk (law.map phi) targetEst (a * theta + b)
    Proof (Lean source)
    theorem sqRisk_map_affinePullback {law : Measure X} {phi : X → Y} {a b theta : ℝ} {targetEst : Y → ℝ} (ha : a ≠ 0) (hphi : Measurable phi) (htarget : Measurable targetEst) : a ^ 2 * sqRisk law (affinePullbackEstimator phi a b targetEst) theta = sqRisk (law.map phi) targetEst (a * theta + b) := by have hloss : Measurable (fun y => (targetEst y - (a * theta + b)) ^ 2) := (htarget.sub measurable_const).pow_const 2 unfold sqRisk calc a ^ 2 * (∫ z, (affinePullbackEstimator phi a b targetEst z - theta) ^ 2 ∂law) = ∫ z, a ^ 2 * (affinePullbackEstimator phi a b targetEst z - theta) ^ 2 ∂law := (integral_const_mul (a ^ 2) _).symm _ = ∫ z, (targetEst (phi z) - (a * theta + b)) ^ 2 ∂law := by exact integral_congr_ae (Filter.Eventually.of_forall fun z => affine_sqLoss_pullback_identity ha z) _ = ∫ y, (targetEst y - (a * theta + b)) ^ 2 ∂law.map phi := (integral_map hphi.aemeasurable hloss.aestronglyMeasurable).symm
    Causalean.Stat.sqRisk_map_affinePullback · Causalean/Stat/Minimax/MinimaxRisk.lean:217
  • forall_estimator_exists_sqRisk_ge_of_deterministic_affine_transport theorem — Suppose the affine slope is nonzero, the observation rule is measurable, and each target-experiment law is the pushforward of its corresponding source law. If every measurable source estimator has squared risk at least a fixed level for some parameter, then every measurable target estimator has squared risk at least that level multiplied by the squared affine slope for some parameter, where the target parameter is transformed by the same affine map.
    X :
    Type uX
    shared
    Y :
    Type uY
    shared
    Iota :
    Type uI
    shared
    P :
    Iota → Measure X
    Q :
    Iota → Measure Y
    theta :
    Iota → ℝ
    phi :
    X → Y
    a b L :
    ha :
    a ≠ 0
    hphi :
    hQ :
    ∀ j, Q j = (P j).map phi
    hsource :
    ∀ sourceEst : X → ℝ
    if
    Measurable sourceEst
    then
    ∃ j, L ≤ sqRisk (P j) sourceEst (theta j)
    targetEst :
    Y → ℝ
    Measurable targetEst
    ∃ j, a ^ 2 * L ≤ sqRisk (Q j) targetEst (a * theta j + b)
    Proof (Lean source)
    theorem forall_estimator_exists_sqRisk_ge_of_deterministic_affine_transport (P : Iota → Measure X) (Q : Iota → Measure Y) (theta : Iota → ℝ) (phi : X → Y) (a b L : ℝ) (ha : a ≠ 0) (hphi : Measurable phi) (hQ : ∀ j, Q j = (P j).map phi) (hsource : ∀ sourceEst : X → ℝ, Measurable sourceEst → ∃ j, L ≤ sqRisk (P j) sourceEst (theta j)) : ∀ targetEst : Y → ℝ, Measurable targetEst → ∃ j, a ^ 2 * L ≤ sqRisk (Q j) targetEst (a * theta j + b) := by intro targetEst htarget obtain ⟨j, hj⟩ := hsource (affinePullbackEstimator phi a b targetEst) (measurable_affinePullbackEstimator hphi htarget) refine ⟨j, ?_⟩ calc a ^ 2 * L ≤ a ^ 2 * sqRisk (P j) (affinePullbackEstimator phi a b targetEst) (theta j) := mul_le_mul_of_nonneg_left hj (sq_nonneg a) _ = sqRisk ((P j).map phi) targetEst (a * theta j + b) := sqRisk_map_affinePullback ha hphi htarget _ = sqRisk (Q j) targetEst (a * theta j + b) := by rw [hQ j]
    Causalean.Stat.forall_estimator_exists_sqRisk_ge_of_deterministic_affine_transport · Causalean/Stat/Minimax/MinimaxRisk.lean:243
  • forall_estimator_exists_sqRisk_ge_of_deterministic_affine_transport_pi theorem — Suppose every source law is a probability law, the affine slope is nonzero, the observation rule is measurable, and each target marginal law is the pushforward of its corresponding source marginal. If every measurable estimator based on the finite source product experiment has squared risk at least a fixed level for some parameter, then every measurable estimator based on the corresponding target product experiment has squared risk at least that level multiplied by the squared affine slope for some parameter, including when the sample has no coordinates.
    X :
    Type uX
    shared
    Y :
    Type uY
    shared
    Iota :
    Type uI
    shared
    n :
    P :
    Iota → Measure X
    Q :
    Iota → Measure Y
    theta :
    Iota → ℝ
    phi :
    X → Y
    a b L :
    ha :
    a ≠ 0
    hphi :
    hQ :
    ∀ j, Q j = (P j).map phi
    hsource :
    ∀ sourceEst : (Fin n → X) → ℝ
    if
    Measurable sourceEst
    then
    ∃ j, L ≤ sqRisk (Measure.pi (fun _ : Fin n => P j)) sourceEst (theta j)
    targetEst :
    (Fin n → Y) → ℝ
    Measurable targetEst
    ∃ j, a ^ 2 * L ≤ sqRisk (Measure.pi (fun _ : Fin n => Q j)) targetEst (a * theta j + b)
    Proof (Lean source)
    theorem forall_estimator_exists_sqRisk_ge_of_deterministic_affine_transport_pi (n : ℕ) (P : Iota → Measure X) (Q : Iota → Measure Y) [∀ j, IsProbabilityMeasure (P j)] (theta : Iota → ℝ) (phi : X → Y) (a b L : ℝ) (ha : a ≠ 0) (hphi : Measurable phi) (hQ : ∀ j, Q j = (P j).map phi) (hsource : ∀ sourceEst : (Fin n → X) → ℝ, Measurable sourceEst → ∃ j, L ≤ sqRisk (Measure.pi (fun _ : Fin n => P j)) sourceEst (theta j)) : ∀ targetEst : (Fin n → Y) → ℝ, Measurable targetEst → ∃ j, a ^ 2 * L ≤ sqRisk (Measure.pi (fun _ : Fin n => Q j)) targetEst (a * theta j + b) := by apply forall_estimator_exists_sqRisk_ge_of_deterministic_affine_transport (P := fun j => Measure.pi (fun _ : Fin n => P j)) (Q := fun j => Measure.pi (fun _ : Fin n => Q j)) (theta := theta) (phi := fun z i => phi (z i)) (a := a) (b := b) (L := L) ha (measurable_finCoordinatewise n hphi) ?_ hsource intro j calc Measure.pi (fun _ : Fin n => Q j) = Measure.pi (fun _ : Fin n => (P j).map phi) := by congr 1 funext i exact hQ j _ = (Measure.pi (fun _ : Fin n => P j)).map (fun z : Fin n → X => fun i => phi (z i)) := (map_pi_finCoordinatewise n (P j) hphi).symm
    Causalean.Stat.forall_estimator_exists_sqRisk_ge_of_deterministic_affine_transport_pi · Causalean/Stat/Minimax/MinimaxRisk.lean:270
Pinsker 5 core · 2 supporting Proves Pinsker's inequality and its KL-form Le Cam minimax lower-bound corollaries. ★ pinskerBound_of_ac_of_ne_top★ pinskerBound_pi_iid★ klForm_two_point_lower_bound_of_pinsker★ klForm_two_point_lower_bound

Proves Pinsker's inequality and its KL-form Le Cam minimax lower-bound corollaries.

The file first proves the scalar inequality klFun_lower_bound, then packages total-variation control as PinskerBound. The main bridge pinskerBound_of_ac_of_ne_top derives that package for probability measures μ ≪ ν with finite KL divergence. The product theorem pinskerBound_pi_iid lifts the bridge to i.i.d. finite products, and the klForm_two_point_lower_bound theorems turn the bridge into Le Cam lower bounds whose right-hand divergence term is Kullback-Leibler rather than total variation.

def PinskerBound reviewed
Causalean.Stat

For a measurable sample space and two measures on that space, the Pinsker bound is the proposition that their total-variation distance is at most the square root of one half of the real-valued Kullback--Leibler divergence from the first measure to the second.

Definition (Lean source)
Ω :
Type u_1
shared
μ ν :
PinskerBound μ ν :
Prop
tvDist μ ν ≤ sqrt ((klDiv μ ν).toReal / 2)
Causalean.Stat.PinskerBound · Causalean/Stat/Minimax/Pinsker.lean:243
theorem pinskerBound_of_ac_of_ne_top reviewed
Causalean.Stat

Pinsker's inequality (unconditional). For probability measures μ and ν on the same space, if μ is absolutely continuous with respect to ν and their Kullback–Leibler divergence is finite, then the total variation distance between μ and ν is at most the square root of half their Kullback–Leibler divergence: tvDist μ ν ≤ √(klDiv(μ,ν)/2).

Formal statement
Ω :
Type u_1
shared
hac :
μ ≪ ν
hfin :
klDiv μ ν ≠ ⊤
Proof (Lean source)
theorem pinskerBound_of_ac_of_ne_top (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hfin : klDiv μ ν ≠ ⊤) : PinskerBound μ ν := by set p : Ω → ℝ := fun x => (μ.rnDeriv ν x).toReal with hp_def set K : ℝ := (klDiv μ ν).toReal with hK_def set g : Ω → ℝ := fun x => (p x - 1) ^ 2 / (p x + 2) with hg_def set f₁ : Ω → ℝ := fun x => |p x - 1| / sqrt (p x + 2) with hf₁_def set f₂ : Ω → ℝ := fun x => sqrt (p x + 2) with hf₂_def have hp_nonneg : ∀ x, 0 ≤ p x := by intro x rw [hp_def] exact ENNReal.toReal_nonneg have hK_nonneg : 0 ≤ K := by rw [hK_def] exact ENNReal.toReal_nonneg have hp_int : Integrable p ν := by rw [hp_def] exact Measure.integrable_toReal_rnDeriv have hp_meas : AEStronglyMeasurable p ν := by rw [hp_def] exact (Measure.measurable_rnDeriv μ ν).ennreal_toReal.aestronglyMeasurable have hp_integral_one : ∫ x, p x ∂ν = 1 := by rw [hp_def, Measure.integral_toReal_rnDeriv hac] rw [measureReal_def, measure_univ] simp have hllr_int : Integrable (llr μ ν) μ := (InformationTheory.klDiv_ne_top_iff.mp hfin).2 have hkl_int : Integrable (fun x => klFun (p x)) ν := by rw [hp_def] exact (InformationTheory.integrable_klFun_rnDeriv_iff hac).2 hllr_int have hK_eq_integral : K = ∫ x, klFun (p x) ∂ν := by rw [hK_def, hp_def] exact InformationTheory.toReal_klDiv_eq_integral_klFun hac have hg_nonneg : ∀ x, 0 ≤ g x := by intro x rw [hg_def] exact pinsker_weight_nonneg (hp_nonneg x) have hg_le : ∀ x, g x ≤ (2 / 3) * klFun (p x) := by intro x rw [hg_def] exact pinsker_weight_le_klFun (hp_nonneg x) have hg_meas : AEStronglyMeasurable g ν := by rw [hg_def] exact (by fun_prop : AEMeasurable (fun x => (p x - 1) ^ 2 / (p x + 2)) ν) |>.aestronglyMeasurable have hf₂_meas : AEStronglyMeasurable f₂ ν := by rw [hf₂_def] fun_prop have hf₁_meas : AEStronglyMeasurable f₁ ν := by rw [hf₁_def] exact (by fun_prop : AEMeasurable (fun x => |p x - 1| / sqrt (p x + 2)) ν) |>.aestronglyMeasurable have hg_int : Integrable g ν := by refine Integrable.mono' (hkl_int.const_mul (2 / 3)) hg_meas ?_ exact Filter.Eventually.of_forall fun x => by rw [Real.norm_eq_abs, abs_of_nonneg (hg_nonneg x)] exact hg_le x have hg_integral_le : ∫ x, g x ∂ν ≤ (2 / 3) * K := by have hdom_int : Integrable (fun x => (2 / 3) * klFun (p x)) ν := hkl_int.const_mul (2 / 3) have hle_int : ∫ x, g x ∂ν ≤ ∫ x, (2 / 3) * klFun (p x) ∂ν := integral_mono_ae hg_int hdom_int (Filter.Eventually.of_forall hg_le) calc ∫ x, g x ∂ν ≤ ∫ x, (2 / 3) * klFun (p x) ∂ν := hle_int _ = (2 / 3) * K := by rw [integral_const_mul, ← hK_eq_integral] have hf₁_sq_int : Integrable (fun x => f₁ x ^ 2) ν := by refine hg_int.congr (Filter.Eventually.of_forall fun x => ?_) rw [hf₁_def, hg_def] exact (pinsker_abs_div_sqrt_sq (hp_nonneg x)).symm have hf₂_sq_int : Integrable (fun x => f₂ x ^ 2) ν := by refine (hp_int.add (integrable_const 2)).congr (Filter.Eventually.of_forall fun x => ?_) rw [hf₂_def] exact (Real.sq_sqrt (by linarith [hp_nonneg x] : 0 ≤ p x + 2)).symm have hf₁L2 : MemLp f₁ (ofReal 2) ν := by simpa using (memLp_two_iff_integrable_sq hf₁_meas).2 hf₁_sq_int have hf₂L2 : MemLp f₂ (ofReal 2) ν := by simpa using (memLp_two_iff_integrable_sq hf₂_meas).2 hf₂_sq_int have hf₁_nonneg : 0 ≤ᵐ[ν] f₁ := Filter.Eventually.of_forall fun x => by rw [hf₁_def] exact div_nonneg (abs_nonneg _) (Real.sqrt_nonneg _) have hf₂_nonneg : 0 ≤ᵐ[ν] f₂ := Filter.Eventually.of_forall fun x => by rw [hf₂_def] exact Real.sqrt_nonneg _ have hholder : ∫ x, f₁ x * f₂ x ∂ν ≤ (∫ x, f₁ x ^ (2 : ℝ) ∂ν) ^ (1 / (2 : ℝ)) * (∫ x, f₂ x ^ (2 : ℝ) ∂ν) ^ (1 / (2 : ℝ)) := integral_mul_le_Lp_mul_Lq_of_nonneg Real.HolderConjugate.two_two hf₁_nonneg hf₂_nonneg hf₁L2 hf₂L2 have hLHS : ∫ x, f₁ x * f₂ x ∂ν = ∫ x, |p x - 1| ∂ν := by apply integral_congr_ae exact Filter.Eventually.of_forall fun x => by rw [hf₁_def, hf₂_def] exact pinsker_abs_div_sqrt_mul_sqrt (hp_nonneg x) have hf₁_rpow : ∫ x, f₁ x ^ (2 : ℝ) ∂ν = ∫ x, g x ∂ν := by apply integral_congr_ae exact Filter.Eventually.of_forall fun x => by rw [hf₁_def, hg_def] change (|p x - 1| / √(p x + 2)) ^ (2 : ℝ) = (p x - 1) ^ 2 / (p x + 2) rw [Real.rpow_two] exact pinsker_abs_div_sqrt_sq (hp_nonneg x) have hf₂_rpow : ∫ x, f₂ x ^ (2 : ℝ) ∂ν = 3 := by have hsqrt_sq : ∫ x, f₂ x ^ (2 : ℝ) ∂ν = ∫ x, p x + 2 ∂ν := by apply integral_congr_ae exact Filter.Eventually.of_forall fun x => by rw [hf₂_def] change √(p x + 2) ^ (2 : ℝ) = p x + 2 rw [Real.rpow_two] exact Real.sq_sqrt (by linarith [hp_nonneg x] : 0 ≤ p x + 2) rw [hsqrt_sq] calc ∫ x, p x + 2 ∂ν = (∫ x, p x ∂ν) + ∫ _ : Ω, (2 : ℝ) ∂ν := integral_add hp_int (integrable_const 2) _ = 3 := by rw [hp_integral_one]; norm_num have h_int_abs : ∫ x, |p x - 1| ∂ν ≤ sqrt (2 * K) := by rw [hLHS, hf₁_rpow, hf₂_rpow] at hholder have hrpow_g : (∫ x, g x ∂ν) ^ (1 / (2 : ℝ)) = sqrt (∫ x, g x ∂ν) := (Real.sqrt_eq_rpow (∫ x, g x ∂ν)).symm have hrpow_three : (3 : ℝ) ^ (1 / (2 : ℝ)) = sqrt 3 := (Real.sqrt_eq_rpow 3).symm rw [hrpow_g, hrpow_three] at hholder have hg_int_nonneg : 0 ≤ ∫ x, g x ∂ν := integral_nonneg fun x => hg_nonneg x have hsqrt_g_le : sqrt (∫ x, g x ∂ν) ≤ sqrt ((2 / 3) * K) := Real.sqrt_le_sqrt hg_integral_le have hprod_le : sqrt (∫ x, g x ∂ν) * sqrt 3 ≤ sqrt ((2 / 3) * K) * sqrt 3 := by exact mul_le_mul_of_nonneg_right hsqrt_g_le (Real.sqrt_nonneg 3) calc ∫ x, |p x - 1| ∂ν ≤ sqrt (∫ x, g x ∂ν) * sqrt 3 := hholder _ ≤ sqrt ((2 / 3) * K) * sqrt 3 := hprod_le _ = sqrt (2 * K) := by rw [← Real.sqrt_mul (by positivity : 0 ≤ (2 / 3) * K) (3 : ℝ)] congr 1 ring have hscheffe := tvDist_le_half_integral_abs_rnDeriv μ ν hac unfold PinskerBound have hscheffe_p : tvDist μ ν ≤ (1 / 2) * ∫ x, |p x - 1| ∂ν := by simpa [hp_def] using hscheffe calc tvDist μ ν ≤ (1 / 2) * ∫ x, |p x - 1| ∂ν := hscheffe_p _ ≤ (1 / 2) * sqrt (2 * K) := by exact mul_le_mul_of_nonneg_left h_int_abs (by norm_num) _ = sqrt (K / 2) := pinsker_half_sqrt_two_mul K hK_nonneg _ = sqrt ((klDiv μ ν).toReal / 2) := by rw [hK_def]
Causalean.Stat.pinskerBound_of_ac_of_ne_top · Causalean/Stat/Minimax/Pinsker.lean:288 · uses PinskerBound
theorem pinskerBound_pi_iid reviewed
Causalean.Stat

Pinsker's inequality for i.i.d. finite products (unconditional). For one-sample probability measures μ and ν, if μ is absolutely continuous with respect to ν and the log-likelihood ratio of μ against ν is integrable under μ, then the n-fold product measures μ^{⊗n} and ν^{⊗n} satisfy Pinsker's inequality: their total variation distance is at most the square root of half their Kullback–Leibler divergence.

Formal statement
α :
hac :
μ ≪ ν
hint :
Integrable (llr μ ν) μ
n :
PinskerBound (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν))
Proof (Lean source)
theorem pinskerBound_pi_iid {α : Type*} [MeasurableSpace α] (μ ν : Measure α) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (llr μ ν) μ) (n : ℕ) : PinskerBound (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) := by have hac_pi := pi_iid_absolutelyContinuous μ ν hac n have hint_pi := pi_iid_llr_integrable μ ν hac hint n exact pinskerBound_of_ac_of_ne_top _ _ hac_pi (InformationTheory.klDiv_ne_top hac_pi hint_pi)
Causalean.Stat.pinskerBound_pi_iid · Causalean/Stat/Minimax/Pinsker.lean:442 · uses PinskerBound
theorem klForm_two_point_lower_bound_of_pinsker reviewed
Causalean.Stat

KL-form Le Cam two-point lower bound. Given a Pinsker-type bound h controlling the total variation distance between P₀ and P₁ by their Kullback–Leibler divergence, if est is a measurable estimator of the parameter and the parameter values θ₀ and θ₁ are separated by at least 2s, then the worse of the two error probabilities — that est misses θ₀ by at least s under P₀, or misses θ₁ by at least s under P₁ — is at least (1 - √(klDiv(P₀,P₁)/2))/2.

Formal statement
Ω :
shared
Θ :
Type u_2
shared
h :
PinskerBound P₀ P₁
est :
Ω → Θ
hest :
θ₀ θ₁ :
Θ
s :
hsep :
2 * s ≤ dist θ₀ θ₁
(1 - sqrt ((klDiv P₀ P₁).toReal / 2)) / 2
max (P₀.real {ω | s ≤ dist (est ω) θ₀}) (P₁.real {ω | s ≤ dist (est ω) θ₁})
Proof (Lean source)
theorem klForm_two_point_lower_bound_of_pinsker (h : PinskerBound P₀ P₁) {est : Ω → Θ} (hest : Measurable est) {θ₀ θ₁ : Θ} {s : ℝ} (hsep : 2 * s ≤ dist θ₀ θ₁) : (1 - sqrt ((klDiv P₀ P₁).toReal / 2)) / 2 ≤ max (P₀.real {ω | s ≤ dist (est ω) θ₀}) (P₁.real {ω | s ≤ dist (est ω) θ₁}) := by have hmax := half_one_sub_tvDist_le_max_error (P₀ := P₀) (P₁ := P₁) hest hsep have htv : (1 - sqrt ((klDiv P₀ P₁).toReal / 2)) / 2 ≤ (1 - tvDist P₀ P₁) / 2 := by have := h unfold PinskerBound at this linarith exact htv.trans hmax
Causalean.Stat.klForm_two_point_lower_bound_of_pinsker · Causalean/Stat/Minimax/Pinsker.lean:465 · uses PinskerBound
theorem klForm_two_point_lower_bound reviewed
Causalean.Stat

KL-form Le Cam two-point lower bound (unconditional). For probability measures P₀ and P₁ and two points θ₀, θ₁ in a pseudometric parameter space, if P₀ is absolutely continuous with respect to P₁ and their Kullback–Leibler divergence is finite, while est is a measurable estimator of the parameter and θ₀ and θ₁ are separated by at least 2s, then the worse of the two error probabilities — that est misses θ₀ by at least s under P₀, or misses θ₁ by at least s under P₁ — is at least (1 - √(klDiv(P₀,P₁)/2))/2.

Formal statement
Ω :
shared
Θ :
Type u_2
shared
hac :
P₀ ≪ P₁
hfin :
klDiv P₀ P₁ ≠ ⊤
est :
Ω → Θ
hest :
θ₀ θ₁ :
Θ
s :
hsep :
2 * s ≤ dist θ₀ θ₁
(1 - sqrt ((klDiv P₀ P₁).toReal / 2)) / 2
max (P₀.real {ω | s ≤ dist (est ω) θ₀}) (P₁.real {ω | s ≤ dist (est ω) θ₁})
Proof (Lean source)
theorem klForm_two_point_lower_bound (hac : P₀ ≪ P₁) (hfin : klDiv P₀ P₁ ≠ ⊤) {est : Ω → Θ} (hest : Measurable est) {θ₀ θ₁ : Θ} {s : ℝ} (hsep : 2 * s ≤ dist θ₀ θ₁) : (1 - sqrt ((klDiv P₀ P₁).toReal / 2)) / 2 ≤ max (P₀.real {ω | s ≤ dist (est ω) θ₀}) (P₁.real {ω | s ≤ dist (est ω) θ₁}) := klForm_two_point_lower_bound_of_pinsker (pinskerBound_of_ac_of_ne_top P₀ P₁ hac hfin) hest hsep
Causalean.Stat.klForm_two_point_lower_bound · Causalean/Stat/Minimax/Pinsker.lean:491
2 supporting declarations (lemmas, instances)
  • klFun_mul_lower_aux theorem — Auxiliary: pinskerPhi x ≥ 0 for x ≥ 0, i.e. (x + 2) * klFun x - (3/2) * (x - 1)^2 ≥ 0.
    x :
    hx :
    0 ≤ x
    0 ≤ (x + 2) * klFun x - (3 / 2) * (x - 1) ^ 2
    Proof (Lean source)
    theorem klFun_mul_lower_aux {x : ℝ} (hx : 0 ≤ x) : 0 ≤ (x + 2) * klFun x - (3 / 2) * (x - 1) ^ 2 := by suffices h : 0 ≤ pinskerPhi x by simpa [pinskerPhi] using h rcases eq_or_lt_of_le hx with h0 | h0 · -- x = 0 rw [← h0]; norm_num [pinskerPhi, klFun] rcases le_total x 1 with hle | hge · -- 0 < x ≤ 1: φ antitone, so φ x ≥ φ 1 = 0 have := pinskerPhi_antitone_Ioc (Set.mem_Ioc.mpr ⟨h0, hle⟩) (Set.mem_Ioc.mpr ⟨one_pos, le_refl 1⟩) hle rw [pinskerPhi_one] at this exact this · -- 1 ≤ x: φ monotone, so φ x ≥ φ 1 = 0 have := pinskerPhi_monotone_Ici (Set.mem_Ici.mpr (le_refl 1)) (Set.mem_Ici.mpr hge) hge rw [pinskerPhi_one] at this exact this
    Causalean.Stat.klFun_mul_lower_aux · Causalean/Stat/Minimax/Pinsker.lean:209
  • klFun_lower_bound theorem — Pinsker scalar inequality. For x ≥ 0, (3/2) * (x - 1)^2 / (x + 2) ≤ klFun x. This is the elementary bound that powers Pinsker's inequality through Cauchy–Schwarz.
    x :
    hx :
    0 ≤ x
    (3 / 2) * (x - 1) ^ 2 / (x + 2) ≤ klFun x
    Proof (Lean source)
    theorem klFun_lower_bound {x : ℝ} (hx : 0 ≤ x) : (3 / 2) * (x - 1) ^ 2 / (x + 2) ≤ klFun x := by have hpos : (0 : ℝ) < x + 2 := by linarith rw [div_le_iff₀ hpos] have h := klFun_mul_lower_aux hx nlinarith [h]
    Causalean.Stat.klFun_lower_bound · Causalean/Stat/Minimax/Pinsker.lean:229
Bretagnolle­Huber 1 core · 6 supporting This module builds the Bhattacharyya/Hellinger affinity layer used to prove the Bretagnolle-Huber inequality. ★ bretagnolle_huber_affinity

Bretagnolle-Huber inequality

This module builds the Bhattacharyya/Hellinger affinity layer used to prove the Bretagnolle-Huber inequality. The auxiliary results integral_min_le_one_sub_tvDist, sq_bhattacharyya_le_two_mul_integral_min, and exp_neg_half_klDiv_le_bhattacharyya combine Scheffe, Cauchy-Schwarz, and Jensen steps; the headline theorem bretagnolle_huber_affinity gives the two-point testing floor 1 - tvDist μ ν >= (1/2) * exp(-KL(μ,ν)) for absolutely continuous probability measures with finite KL divergence.

theorem bretagnolle_huber_affinity reviewed
Causalean.Stat

Bretagnolle–Huber inequality. For probability measures μ, ν such that μ is absolutely continuous with respect to ν and their Kullback–Leibler divergence is finite, the two-point testing affinity 1 − tvDist μ ν is at least ½·exp(-KL(μ‖ν)):

Formal statement
Ω :
Type u_1
shared
hac :
μ ≪ ν
hfin :
klDiv μ ν ≠ ⊤
(1 / 2 : ℝ) * exp (-(klDiv μ ν).toReal) ≤ 1 - tvDist μ ν
Proof (Lean source)
theorem bretagnolle_huber_affinity (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hfin : klDiv μ ν ≠ ⊤) : (1 / 2 : ℝ) * exp (-(klDiv μ ν).toReal) ≤ 1 - tvDist μ ν := by set K : ℝ := (klDiv μ ν).toReal with hK_def set ρ : ℝ := ∫ x, sqrt ((μ.rnDeriv ν x).toReal) ∂ν with hρ_def have hint : Integrable (llr μ ν) μ := (klDiv_ne_top_iff.mp hfin).2 have hρ_nonneg : 0 ≤ ρ := by rw [hρ_def]; exact integral_nonneg fun x => Real.sqrt_nonneg _ have hL3 : exp (-(1 / 2) * K) ≤ ρ := exp_neg_half_klDiv_le_bhattacharyya μ ν hac hint -- square it: exp(-K) ≤ ρ² have hexp_sq : exp (-K) = exp (-(1 / 2) * K) ^ 2 := by have hsum : -K = -(1 / 2) * K + -(1 / 2) * K := by ring rw [sq, ← Real.exp_add, ← hsum] have hsq : exp (-K) ≤ ρ ^ 2 := by rw [hexp_sq] nlinarith [hL3, Real.exp_nonneg (-(1 / 2) * K), hρ_nonneg] -- Cauchy–Schwarz + affinity have hL2 : ρ ^ 2 ≤ 2 * ∫ x, min ((μ.rnDeriv ν x).toReal) 1 ∂ν := by rw [hρ_def]; exact sq_bhattacharyya_le_two_mul_integral_min μ ν hac have hL1 : ∫ x, min ((μ.rnDeriv ν x).toReal) 1 ∂ν ≤ 1 - tvDist μ ν := integral_min_le_one_sub_tvDist μ ν hac rw [hK_def] linarith [hsq, hL2, hL1]
Causalean.Stat.bretagnolle_huber_affinity · Causalean/Stat/Minimax/BretagnolleHuber.lean:363 · uses tvDist
6 supporting declarations (lemmas, instances)
  • mul_exp_neg_half_log theorem — For y ≥ 0, y * exp(-(1/2)·log y) = √y.
    y :
    hy :
    0 ≤ y
    y * exp (-(1 / 2) * log y) = sqrt y
    Proof (Lean source)
    theorem mul_exp_neg_half_log {y : ℝ} (hy : 0 ≤ y) : y * exp (-(1 / 2) * log y) = sqrt y := by rcases eq_or_lt_of_le hy with h0 | h0 · simp [← h0] · -- y > 0 have hsqrt : sqrt y = exp ((1 / 2) * log y) := by rw [Real.sqrt_eq_rpow, Real.rpow_def_of_pos h0] ring_nf rw [hsqrt] nth_rewrite 1 [← Real.exp_log h0] rw [← Real.exp_add] ring_nf
    Causalean.Stat.mul_exp_neg_half_log · Causalean/Stat/Minimax/BretagnolleHuber.lean:77
  • sqrt_le_half_add_one theorem — √y ≤ (y + 1)/2 for y ≥ 0 (AM–GM); used to dominate √p by an integrable function.
    y :
    hy :
    0 ≤ y
    sqrt y ≤ (y + 1) / 2
    Proof (Lean source)
    theorem sqrt_le_half_add_one {y : ℝ} (hy : 0 ≤ y) : sqrt y ≤ (y + 1) / 2 := by have hs : 0 ≤ sqrt y := Real.sqrt_nonneg y have hsq : sqrt y ^ 2 = y := Real.sq_sqrt hy nlinarith [sq_nonneg (sqrt y - 1), hsq]
    Causalean.Stat.sqrt_le_half_add_one · Causalean/Stat/Minimax/BretagnolleHuber.lean:91
  • integrable_sqrt_rnDeriv theorem — √p is ν-integrable (dominated by (p+1)/2).
    Ω :
    Type u_1
    shared
    μ :
    shared
    ν :
    shared
    Integrable (fun x => sqrt ((μ.rnDeriv ν x).toReal)) ν
    Proof (Lean source)
    @[fun_prop] theorem integrable_sqrt_rnDeriv : Integrable (fun x => sqrt ((μ.rnDeriv ν x).toReal)) ν := by have hp : Integrable (fun x => (μ.rnDeriv ν x).toReal) ν := Measure.integrable_toReal_rnDeriv have hmeas : AEStronglyMeasurable (fun x => sqrt ((μ.rnDeriv ν x).toReal)) ν := by apply Measurable.aestronglyMeasurable exact (Measure.measurable_rnDeriv μ ν).ennreal_toReal.sqrt refine Integrable.mono' (g := fun x => ((μ.rnDeriv ν x).toReal + 1) / 2) ((hp.add (integrable_const 1)).div_const 2) hmeas ?_ refine Filter.Eventually.of_forall fun x => ?_ rw [Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg _)] exact sqrt_le_half_add_one ENNReal.toReal_nonneg
    Causalean.Stat.integrable_sqrt_rnDeriv · Causalean/Stat/Minimax/BretagnolleHuber.lean:106
  • integral_min_le_one_sub_tvDist theorem — Affinity lower bound. ∫ min(p,1) ∂ν ≤ 1 - tvDist μ ν. Derived from Scheffé's ≤ inequality together with ∫ min(p,1) ∂ν = 1 - ½∫|p-1|∂ν.
    Ω :
    Type u_1
    shared
    μ :
    shared
    ν :
    shared
    hac :
    μ ≪ ν
    ∫ x, min ((μ.rnDeriv ν x).toReal) 1 ∂ν ≤ 1 - tvDist μ ν
    Proof (Lean source)
    theorem integral_min_le_one_sub_tvDist (hac : μ ≪ ν) : ∫ x, min ((μ.rnDeriv ν x).toReal) 1 ∂ν ≤ 1 - tvDist μ ν := by set q : Ω → ℝ := fun x => (μ.rnDeriv ν x).toReal with hq_def have hp_int : Integrable q ν := Measure.integrable_toReal_rnDeriv have hp_one : ∫ x, q x ∂ν = 1 := by rw [hq_def, Measure.integral_toReal_rnDeriv hac, measureReal_def, measure_univ] simp have habs_int : Integrable (fun x => |q x - 1|) ν := (hp_int.sub (integrable_const 1)).abs -- min(q,1) = (q + 1 - |q - 1|)/2 pointwise have hmin_eq : ∀ x, min (q x) 1 = (q x + 1 - |q x - 1|) / 2 := by intro x; rcases le_total (q x) 1 with h | h · rw [min_eq_left h, abs_of_nonpos (by linarith)]; ring · rw [min_eq_right h, abs_of_nonneg (by linarith)]; ring have hmin_int : Integrable (fun x => min (q x) 1) ν := by refine (((hp_int.add (integrable_const 1)).sub habs_int).div_const 2).congr ?_ exact Filter.Eventually.of_forall fun x => (hmin_eq x).symm have hone : ∫ _ : Ω, (1 : ℝ) ∂ν = 1 := by rw [integral_const, measureReal_def, measure_univ]; simp have hint_min : ∫ x, min (q x) 1 ∂ν = 1 - (1/2) * ∫ x, |q x - 1| ∂ν := by have heq : (fun x => min (q x) 1) = fun x => (q x + 1) / 2 - |q x - 1| / 2 := by funext x; rw [hmin_eq x]; ring calc ∫ x, min (q x) 1 ∂ν = ∫ x, ((q x + 1) / 2 - |q x - 1| / 2) ∂ν := by rw [heq] _ = (∫ x, (q x + 1) / 2 ∂ν) - ∫ x, |q x - 1| / 2 ∂ν := integral_sub ((hp_int.add (integrable_const 1)).div_const 2) (habs_int.div_const 2) _ = ((∫ x, (q x + 1) ∂ν) / 2) - (∫ x, |q x - 1| ∂ν) / 2 := by rw [integral_div, integral_div] _ = 1 - (1/2) * ∫ x, |q x - 1| ∂ν := by rw [integral_add hp_int (integrable_const 1), hp_one, hone]; ring have hscheffe := tvDist_le_half_integral_abs_rnDeriv μ ν hac rw [hint_min] linarith [hscheffe]
    Causalean.Stat.integral_min_le_one_sub_tvDist · Causalean/Stat/Minimax/BretagnolleHuber.lean:122
  • sq_bhattacharyya_le_two_mul_integral_min theorem — Cauchy–Schwarz / Bhattacharyya step. (∫ √p ∂ν)² ≤ 2·∫ min(p,1) ∂ν.
    Ω :
    Type u_1
    shared
    μ :
    shared
    ν :
    shared
    hac :
    μ ≪ ν
    (∫ x, sqrt ((μ.rnDeriv ν x).toReal) ∂ν) ^ 2
    ≤ 2 * ∫ x, min ((μ.rnDeriv ν x).toReal) 1 ∂ν
    Proof (Lean source)
    theorem sq_bhattacharyya_le_two_mul_integral_min (hac : μ ≪ ν) : (∫ x, sqrt ((μ.rnDeriv ν x).toReal) ∂ν) ^ 2 ≤ 2 * ∫ x, min ((μ.rnDeriv ν x).toReal) 1 ∂ν := by set q : Ω → ℝ := fun x => (μ.rnDeriv ν x).toReal with hq_def set f₁ : Ω → ℝ := fun x => sqrt (min (q x) 1) with hf₁_def set f₂ : Ω → ℝ := fun x => sqrt (max (q x) 1) with hf₂_def have hq_nonneg : ∀ x, 0 ≤ q x := by intro x rw [hq_def] exact ENNReal.toReal_nonneg have hmin_nonneg : ∀ x, 0 ≤ min (q x) 1 := fun x => le_min (hq_nonneg x) zero_le_one have hmax_nonneg : ∀ x, 0 ≤ max (q x) 1 := fun x => le_trans zero_le_one (le_max_right (q x) 1) have hp_int : Integrable q ν := by rw [hq_def] exact Measure.integrable_toReal_rnDeriv have hp_integral_one : ∫ x, q x ∂ν = 1 := by rw [hq_def, Measure.integral_toReal_rnDeriv hac, measureReal_def, measure_univ] simp have hmin_meas : AEStronglyMeasurable (fun x => min (q x) 1) ν := by rw [hq_def] exact ((Measure.measurable_rnDeriv μ ν).ennreal_toReal.min measurable_const) |>.aestronglyMeasurable have hmax_meas : AEStronglyMeasurable (fun x => max (q x) 1) ν := by rw [hq_def] exact ((Measure.measurable_rnDeriv μ ν).ennreal_toReal.max measurable_const) |>.aestronglyMeasurable have hmin_int : Integrable (fun x => min (q x) 1) ν := by refine Integrable.mono' hp_int hmin_meas ?_ exact Filter.Eventually.of_forall fun x => by have h : min (q x) 1 ≤ q x := min_le_left (q x) 1 simp [Real.norm_eq_abs, abs_of_nonneg (hmin_nonneg x), h] have hmax_int : Integrable (fun x => max (q x) 1) ν := by refine Integrable.mono' (hp_int.add (integrable_const 1)) hmax_meas ?_ exact Filter.Eventually.of_forall fun x => by have h : max (q x) 1 ≤ q x + 1 := max_le (by linarith [hq_nonneg x]) (by linarith [hq_nonneg x]) simpa [Real.norm_eq_abs, abs_of_nonneg (hmax_nonneg x), Pi.add_apply] using h have hf₁_meas : AEStronglyMeasurable f₁ ν := by rw [hf₁_def, hq_def] exact ((Measure.measurable_rnDeriv μ ν).ennreal_toReal.min measurable_const) |>.sqrt.aestronglyMeasurable have hf₂_meas : AEStronglyMeasurable f₂ ν := by rw [hf₂_def, hq_def] exact ((Measure.measurable_rnDeriv μ ν).ennreal_toReal.max measurable_const) |>.sqrt.aestronglyMeasurable have hf₁_sq_int : Integrable (fun x => f₁ x ^ 2) ν := by refine hmin_int.congr (Filter.Eventually.of_forall fun x => ?_) rw [hf₁_def] exact (Real.sq_sqrt (hmin_nonneg x)).symm have hf₂_sq_int : Integrable (fun x => f₂ x ^ 2) ν := by refine hmax_int.congr (Filter.Eventually.of_forall fun x => ?_) rw [hf₂_def] exact (Real.sq_sqrt (hmax_nonneg x)).symm have hf₁L2 : MemLp f₁ (ofReal 2) ν := by simpa using (memLp_two_iff_integrable_sq hf₁_meas).2 hf₁_sq_int have hf₂L2 : MemLp f₂ (ofReal 2) ν := by simpa using (memLp_two_iff_integrable_sq hf₂_meas).2 hf₂_sq_int have hf₁_nonneg : 0 ≤ᵐ[ν] f₁ := Filter.Eventually.of_forall fun x => by rw [hf₁_def] exact Real.sqrt_nonneg _ have hf₂_nonneg : 0 ≤ᵐ[ν] f₂ := Filter.Eventually.of_forall fun x => by rw [hf₂_def] exact Real.sqrt_nonneg _ have hholder : ∫ x, f₁ x * f₂ x ∂ν ≤ (∫ x, f₁ x ^ (2 : ℝ) ∂ν) ^ (1 / (2 : ℝ)) * (∫ x, f₂ x ^ (2 : ℝ) ∂ν) ^ (1 / (2 : ℝ)) := integral_mul_le_Lp_mul_Lq_of_nonneg Real.HolderConjugate.two_two hf₁_nonneg hf₂_nonneg hf₁L2 hf₂L2 have hprod : ∀ x, f₁ x * f₂ x = sqrt (q x) := by intro x rw [hf₁_def, hf₂_def, ← Real.sqrt_mul (hmin_nonneg x) (max (q x) 1)] have hminmax : min (q x) 1 * max (q x) 1 = q x := by rcases le_total (q x) 1 with h | h · rw [min_eq_left h, max_eq_right h, mul_one] · rw [min_eq_right h, max_eq_left h, one_mul] rw [hminmax] have hLHS : ∫ x, f₁ x * f₂ x ∂ν = ∫ x, sqrt (q x) ∂ν := by apply integral_congr_ae exact Filter.Eventually.of_forall hprod set A : ℝ := ∫ x, min (q x) 1 ∂ν with hA_def set B : ℝ := ∫ x, max (q x) 1 ∂ν with hB_def have hf₁_rpow : ∫ x, f₁ x ^ (2 : ℝ) ∂ν = A := by rw [hA_def] apply integral_congr_ae exact Filter.Eventually.of_forall fun x => by rw [hf₁_def] change sqrt (min (q x) 1) ^ (2 : ℝ) = min (q x) 1 rw [Real.rpow_two] exact Real.sq_sqrt (hmin_nonneg x) have hf₂_rpow : ∫ x, f₂ x ^ (2 : ℝ) ∂ν = B := by rw [hB_def] apply integral_congr_ae exact Filter.Eventually.of_forall fun x => by rw [hf₂_def] change sqrt (max (q x) 1) ^ (2 : ℝ) = max (q x) 1 rw [Real.rpow_two] exact Real.sq_sqrt (hmax_nonneg x) have hA_nonneg : 0 ≤ A := by rw [hA_def] exact integral_nonneg hmin_nonneg have hB_nonneg : 0 ≤ B := by rw [hB_def] exact integral_nonneg hmax_nonneg have hsqrt_bound : ∫ x, sqrt (q x) ∂ν ≤ sqrt A * sqrt B := by rw [hLHS, hf₁_rpow, hf₂_rpow] at hholder have hrpow_A : A ^ (1 / (2 : ℝ)) = sqrt A := (Real.sqrt_eq_rpow A).symm have hrpow_B : B ^ (1 / (2 : ℝ)) = sqrt B := (Real.sqrt_eq_rpow B).symm rw [hrpow_A, hrpow_B] at hholder exact hholder have hB_le_two : B ≤ 2 := by have hdom_int : Integrable (fun x => q x + 1) ν := hp_int.add (integrable_const 1) have hle_int : ∫ x, max (q x) 1 ∂ν ≤ ∫ x, q x + 1 ∂ν := integral_mono_ae hmax_int hdom_int (Filter.Eventually.of_forall fun x => by change max (q x) 1 ≤ q x + 1 exact max_le (by linarith [hq_nonneg x]) (by linarith [hq_nonneg x])) calc B = ∫ x, max (q x) 1 ∂ν := by rw [hB_def] _ ≤ ∫ x, q x + 1 ∂ν := hle_int _ = 2 := by rw [integral_add hp_int (integrable_const 1), hp_integral_one] norm_num have hsqrt_int_nonneg : 0 ≤ ∫ x, sqrt (q x) ∂ν := integral_nonneg fun x => Real.sqrt_nonneg _ have hsq_le : (∫ x, sqrt (q x) ∂ν) ^ 2 ≤ (sqrt A * sqrt B) ^ 2 := by nlinarith [hsqrt_bound, hsqrt_int_nonneg, Real.sqrt_nonneg A, Real.sqrt_nonneg B] have hsqrt_prod_sq : (sqrt A * sqrt B) ^ 2 = A * B := by rw [mul_pow, Real.sq_sqrt hA_nonneg, Real.sq_sqrt hB_nonneg] have hAB_le : A * B ≤ 2 * A := by nlinarith [hA_nonneg, hB_le_two] calc (∫ x, sqrt ((μ.rnDeriv ν x).toReal) ∂ν) ^ 2 = (∫ x, sqrt (q x) ∂ν) ^ 2 := by rw [hq_def] _ ≤ (sqrt A * sqrt B) ^ 2 := hsq_le _ = A * B := hsqrt_prod_sq _ ≤ 2 * A := hAB_le _ = 2 * ∫ x, min ((μ.rnDeriv ν x).toReal) 1 ∂ν := by rw [hA_def, hq_def]
    Causalean.Stat.sq_bhattacharyya_le_two_mul_integral_min · Causalean/Stat/Minimax/BretagnolleHuber.lean:160
  • exp_neg_half_klDiv_le_bhattacharyya theorem — Jensen / Bhattacharyya step. exp(-½·KL) ≤ ∫ √p ∂ν.
    Ω :
    Type u_1
    shared
    μ :
    shared
    ν :
    shared
    hac :
    μ ≪ ν
    hint :
    Integrable (llr μ ν) μ
    exp (-(1 / 2) * (klDiv μ ν).toReal) ≤ ∫ x, sqrt ((μ.rnDeriv ν x).toReal) ∂ν
    Proof (Lean source)
    theorem exp_neg_half_klDiv_le_bhattacharyya (hac : μ ≪ ν) (hint : Integrable (llr μ ν) μ) : exp (-(1 / 2) * (klDiv μ ν).toReal) ≤ ∫ x, sqrt ((μ.rnDeriv ν x).toReal) ∂ν := by have hK : (klDiv μ ν).toReal = ∫ a, llr μ ν a ∂μ := InformationTheory.toReal_klDiv_of_measure_eq hac (by simp [measure_univ]) have hCOV : ∫ x, sqrt ((μ.rnDeriv ν x).toReal) ∂ν = ∫ x, exp (-(1 / 2) * llr μ ν x) ∂μ := by have hcov0 : ∫ x, (μ.rnDeriv ν x).toRealexp (-(1 / 2) * llr μ ν x) ∂ν = ∫ x, exp (-(1 / 2) * llr μ ν x) ∂μ := MeasureTheory.integral_rnDeriv_smul hac have hcov_lhs : ∫ x, (μ.rnDeriv ν x).toRealexp (-(1 / 2) * llr μ ν x) ∂ν = ∫ x, sqrt ((μ.rnDeriv ν x).toReal) ∂ν := by apply integral_congr_ae exact Filter.Eventually.of_forall fun x => by change (μ.rnDeriv ν x).toReal * exp (-(1 / 2) * log (μ.rnDeriv ν x).toReal) = sqrt ((μ.rnDeriv ν x).toReal) exact mul_exp_neg_half_log ENNReal.toReal_nonneg calc ∫ x, sqrt ((μ.rnDeriv ν x).toReal) ∂ν = ∫ x, (μ.rnDeriv ν x).toRealexp (-(1 / 2) * llr μ ν x) ∂ν := hcov_lhs.symm _ = ∫ x, exp (-(1 / 2) * llr μ ν x) ∂μ := hcov0 have hfi : Integrable (fun x => (-(1 / 2 : ℝ)) * llr μ ν x) μ := hint.const_mul (-(1 / 2 : ℝ)) have hgi : Integrable (fun x => exp (-(1 / 2) * llr μ ν x)) μ := by refine (integrable_rnDeriv_smul_iff hac).mp ?_ refine (integrable_sqrt_rnDeriv μ ν).congr (Filter.Eventually.of_forall fun x => ?_) change sqrt ((μ.rnDeriv ν x).toReal) = (μ.rnDeriv ν x).toReal * exp (-(1 / 2) * log (μ.rnDeriv ν x).toReal) exact (mul_exp_neg_half_log ENNReal.toReal_nonneg).symm have hfs : ∀ᵐ x ∂μ, (-(1 / 2 : ℝ)) * llr μ ν x ∈ (Set.univ : Set ℝ) := Filter.Eventually.of_forall fun x => Set.mem_univ _ have hJensen : exp (∫ x, (-(1 / 2 : ℝ)) * llr μ ν x ∂μ) ≤ ∫ x, exp (-(1 / 2) * llr μ ν x) ∂μ := by simpa only [Function.comp_apply] using (convexOn_exp.map_integral_le (μ := μ) (f := fun x => (-(1 / 2 : ℝ)) * llr μ ν x) Real.continuous_exp.continuousOn isClosed_univ hfs hfi (by simpa only [Function.comp_def] using hgi)) have harg : ∫ x, (-(1 / 2 : ℝ)) * llr μ ν x ∂μ = -(1 / 2) * (klDiv μ ν).toReal := by rw [integral_const_mul, ← hK] calc exp (-(1 / 2) * (klDiv μ ν).toReal) = exp (∫ x, (-(1 / 2 : ℝ)) * llr μ ν x ∂μ) := by rw [harg] _ ≤ ∫ x, exp (-(1 / 2) * llr μ ν x) ∂μ := hJensen _ = ∫ x, sqrt ((μ.rnDeriv ν x).toReal) ∂ν := hCOV.symm
    Causalean.Stat.exp_neg_half_klDiv_le_bhattacharyya · Causalean/Stat/Minimax/BretagnolleHuber.lean:304
Chi­Squared­Finite 1 core · 2 supporting This file proves discrete and product-measure identities for chi-squared divergence on finite sample spaces. ★ finite_one_add_chiSqDiv

Finite Chi-Squared Identities

This file proves discrete and product-measure identities for chi-squared divergence on finite sample spaces. These identities turn Radon-Nikodym formulas into point-mass sums and product point masses for finite minimax constructions.

theorem finite_one_add_chiSqDiv reviewed
Causalean.Stat

Finite χ²-divergence formula. On a finite sample space, for probability measures μ, ν with μ absolutely continuous with respect to ν, the (shifted) χ²-divergence is the explicit sum of squared point-mass ratios: 1 + χ²(μ‖ν) = ∑ₓ (μ{x})² / (ν{x}). Combines chiSqDiv_eq, the finite integral formula integral_fintype, and the discrete RN bridge above.

Formal statement
1 + chiSqDiv μ ν = ∑ x, (μ.real {x}) ^ 2 / (ν.real {x})
Proof (Lean source)
theorem finite_one_add_chiSqDiv {Ω : Type*} [MeasurableSpace Ω] [Fintype Ω] [MeasurableSingletonClass Ω] (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) : 1 + chiSqDiv μ ν = ∑ x, (μ.real {x}) ^ 2 / (ν.real {x}) := by have hexp : 1 + chiSqDiv μ ν = ∫ x, ((μ.rnDeriv ν x).toReal) ^ 2 ∂ν := by rw [chiSqDiv_eq hac (Integrable.of_finite)]; ring rw [hexp, integral_fintype (Integrable.of_finite)] apply Finset.sum_congr rfl intro x _ by_cases h : ν {x} = 0 · -- `ν {x} = 0` forces `μ {x} = 0` (absolute continuity); both sides vanish. have hνr : ν.real {x} = 0 := by rw [measureReal_def, h, ENNReal.toReal_zero] have hμr : μ.real {x} = 0 := by rw [measureReal_def, hac h, ENNReal.toReal_zero] rw [hνr, hμr]; simp · have hνtop : ν {x} ≠ ⊤ := measure_ne_top ν {x} have hνr0 : ν.real {x} ≠ 0 := by rw [measureReal_def]; exact ENNReal.toReal_ne_zero.2 ⟨h, hνtop⟩ -- Invert the density on the atom `{x}` via the discrete RN bridge. have hrn : (μ.rnDeriv ν x).toReal = μ.real {x} / ν.real {x} := by have hc := congrArg toReal (rnDeriv_mul_measure_singleton μ ν hac x) rw [ENNReal.toReal_mul, ← measureReal_def, ← measureReal_def] at hc rw [eq_div_iff hνr0, mul_comm, hc] rw [hrn, smul_eq_mul] field_simp
Causalean.Stat.finite_one_add_chiSqDiv · Causalean/Stat/Minimax/ChiSquaredFinite.lean:51 · uses chiSqDiv
2 supporting declarations (lemmas, instances)
  • rnDeriv_mul_measure_singleton theorem — Discrete Radon–Nikodym bridge. On a measurable singleton {x}, the Radon–Nikodym density scaled by the base mass recovers the numerator mass: ν {x} · (dμ/dν)(x) = μ {x}, for μ ≪ ν. Proved by integrating the density over {x} (via setLIntegral_rnDeriv) and collapsing the singleton integral with restrict_singleton/lintegral_dirac'.
    μ ν :
    μ.HaveLebesgueDecomposition ν
    hac :
    μ ≪ ν
    x :
    Ω
    ν {x} * μ.rnDeriv ν x = μ {x}
    Proof (Lean source)
    theorem rnDeriv_mul_measure_singleton {Ω : Type*} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] (μ ν : Measure Ω) [SFinite ν] [μ.HaveLebesgueDecomposition ν] (hac : μ ≪ ν) (x : Ω) : ν {x} * μ.rnDeriv ν x = μ {x} := by have h1 : μ {x} = ∫⁻ y in {x}, μ.rnDeriv ν y ∂ν := (Measure.setLIntegral_rnDeriv hac {x}).symm have h2 : ∫⁻ y in {x}, μ.rnDeriv ν y ∂ν = ν {x} * μ.rnDeriv ν x := by rw [Measure.restrict_singleton, lintegral_smul_measure, lintegral_dirac' x (Measure.measurable_rnDeriv μ ν), smul_eq_mul] rw [h1, h2]
    Causalean.Stat.rnDeriv_mul_measure_singleton · Causalean/Stat/Minimax/ChiSquaredFinite.lean:35
  • pi_real_singleton theorem — Real-valued product point mass. Under the product measure Measure.pi μ of a family of probability measures, the mass of a single point factorizes as the product of the marginal point masses: (Measure.pi μ).real {ω} = ∏ᵢ (μ i).real {ωᵢ}. Rewrites the singleton as Set.univ.pi (fun i => {ωᵢ}), applies Measure.pi_pi, then distributes toReal over the finite product.
    ι :
    Type*
    ι → Type*
    ∀ i, MeasurableSpace (Ω i)
    μ :
    ∀ i, Measure (Ω i)
    ∀ i, IsProbabilityMeasure (μ i)
    ω :
    ∀ i, Ω i
    (Measure.pi μ).real {ω} = ∏ i, (μ i).real {ω i}
    Proof (Lean source)
    theorem pi_real_singleton {ι : Type*} [Fintype ι] {Ω : ι → Type*} [∀ i, MeasurableSpace (Ω i)] [∀ i, MeasurableSingletonClass (Ω i)] (μ : ∀ i, Measure (Ω i)) [∀ i, IsProbabilityMeasure (μ i)] (ω : ∀ i, Ω i) : (Measure.pi μ).real {ω} = ∏ i, (μ i).real {ω i} := by have hset : ({ω} : Set (∀ i, Ω i)) = Set.univ.pi (fun i => {ω i}) := by ext f simp [Set.mem_pi, funext_iff] rw [measureReal_def, hset, Measure.pi_pi, ENNReal.toReal_prod] simp only [measureReal_def]
    Causalean.Stat.pi_real_singleton · Causalean/Stat/Minimax/ChiSquaredFinite.lean:81
Chi­Squared­Kernel 2 core · 1 supporting This module constructs a marked law that retains its base coordinate and samples its mark from a probability kernel. ★ one_add_chiSqDiv_attachKernel

Chi-squared divergence for retained-design kernel laws

This module constructs a marked law that retains its base coordinate and samples its mark from a probability kernel. It states the chi-squared disintegration formula for two such laws with the same base marginal.

def attachKernel reviewed
Causalean.Stat

Given a measurable design space, a measurable mark space, a measure on the design space, and a probability kernel from design points to mark laws, the attached marked-observation law draws a design point from the measure and then a mark from the corresponding kernel, retaining both coordinates.

Definition (Lean source)
m :
kappa :
Kernel D M
attachKernel m kappa :
Measure (D × M)
m ⊗ₘ kappa
theorem one_add_chiSqDiv_attachKernel reviewed
Causalean.Stat

For a probability design law, two measurable probability marking kernels, pointwise absolute continuity of the first mark law with respect to the second, and integrability of their jointly measurable squared density deviation, one plus the χ²-divergence of the resulting marked laws equals the design-average of one plus the conditional χ²-divergences.

Formal statement
kappa eta :
hac :
forall x, kappa x ≪ eta x
hint :
Integrable (fun p : D × M => ((kappa.rnDeriv eta p.1 p.2).toReal - 1) ^ 2) (attachKernel m eta)
1 + chiSqDiv (attachKernel m kappa) (attachKernel m eta)
= ∫ x, (1 + chiSqDiv (kappa x) (eta x)) ∂m
Proof (Lean source)
theorem one_add_chiSqDiv_attachKernel {D M : Type*} [MeasurableSpace D] [MeasurableSpace M] [CountableOrCountablyGenerated D M] (m : Measure D) [IsProbabilityMeasure m] (kappa eta : Kernel D M) [IsMarkovKernel kappa] [IsMarkovKernel eta] (hac : forall x, kappa x ≪ eta x) (hint : Integrable (fun p : D × M => ((kappa.rnDeriv eta p.1 p.2).toReal - 1) ^ 2) (attachKernel m eta)) : 1 + chiSqDiv (attachKernel m kappa) (attachKernel m eta) = ∫ x, (1 + chiSqDiv (kappa x) (eta x)) ∂m := by let f : D × M → ℝ := fun p => ((kappa.rnDeriv eta p.1 p.2).toReal - 1) ^ 2 have hmeas : Measurable (fun p : D × M => kappa.rnDeriv eta p.1 p.2) := by fun_prop have hattach : attachKernel m kappa = (attachKernel m eta).withDensity (fun p => kappa.rnDeriv eta p.1 p.2) := by unfold attachKernel calc m ⊗ₘ kappa = m ⊗ₘ eta.withDensity (kappa.rnDeriv eta) := Measure.compProd_congr <| Filter.Eventually.of_forall fun x => (Kernel.withDensity_rnDeriv_eq (hac x)).symm _ = (m ⊗ₘ eta).withDensity (fun p => kappa.rnDeriv eta p.1 p.2) := Measure.compProd_withDensity hmeas have hrn : (attachKernel m kappa).rnDeriv (attachKernel m eta) =ᵐ[attachKernel m eta] fun p => kappa.rnDeriv eta p.1 p.2 := by rw [hattach] exact Measure.rnDeriv_withDensity _ hmeas have hchiJoint : chiSqDiv (attachKernel m kappa) (attachKernel m eta) = ∫ p, f p ∂(attachKernel m eta) := by rw [chiSqDiv] exact integral_congr_ae (hrn.mono fun p hp => by simp only [f, hp]) have hfiber (x : D) : chiSqDiv (kappa x) (eta x) = ∫ y, f (x, y) ∂(eta x) := by rw [chiSqDiv] exact integral_congr_ae ((Kernel.rnDeriv_eq_rnDeriv_measure (κ := kappa) (η := eta) (a := x)).mono fun y hy => by simp only [f, hy]) |>.symm have hintf : Integrable f (m ⊗ₘ eta) := by simpa only [f, attachKernel] using hint have hinner : Integrable (fun x => ∫ y, f (x, y) ∂(eta x)) m := by have hnorm := (Measure.integrable_compProd_iff hintf.aestronglyMeasurable).mp hintf |>.2 simpa [f, Real.norm_eq_abs, abs_of_nonneg] using hnorm calc 1 + chiSqDiv (attachKernel m kappa) (attachKernel m eta) = 1 + ∫ p, f p ∂(attachKernel m eta) := by rw [hchiJoint] _ = 1 + ∫ x, ∫ y, f (x, y) ∂(eta x) ∂m := by exact congrArg (fun z => 1 + z) (Measure.integral_compProd hintf) _ = ∫ x, (1 + ∫ y, f (x, y) ∂(eta x)) ∂m := by rw [integral_add (integrable_const 1) hinner] simp _ = ∫ x, (1 + chiSqDiv (kappa x) (eta x)) ∂m := by exact integral_congr_ae <| Filter.Eventually.of_forall fun x => by dsimp rw [← hfiber x]
Causalean.Stat.one_add_chiSqDiv_attachKernel · Causalean/Stat/Minimax/ChiSquaredKernel.lean:40 · uses attachKernel , chiSqDiv
1 supporting declaration (lemmas, instances)
Chi­Squared­Two­Point 1 core · 1 supporting This module evaluates chi-squared divergence for the Bernoulli perturbation around one half and for its equivalent signed two-point representation. ★ chiSqDiv_twoPointMean_centerHalf

Explicit chi-squared divergence for centered two-point laws

This module evaluates chi-squared divergence for the Bernoulli perturbation around one half and for its equivalent signed two-point representation.

theorem chiSqDiv_twoPointMean_centerHalf reviewed
Causalean.Stat

For a mean perturbation whose magnitude is strictly below one half, the χ²-divergence of the symmetric two-point law with that mean, relative to the centered symmetric two-point law, is four times the squared perturbation.

Formal statement
u :
hu :
abs u < 1 / 2
chiSqDiv (twoPointMean (1 / 2) u) (twoPointMean (1 / 2) 0) = 4 * u ^ 2
Proof (Lean source)
theorem chiSqDiv_twoPointMean_centerHalf {u : Real} (hu : abs u < 1 / 2) : chiSqDiv (twoPointMean (1 / 2) u) (twoPointMean (1 / 2) 0) = 4 * u ^ 2 := by let e : ℝ ≃ᵐ ℝ := (affineHomeomorph (2 * (1 / 2 : ℝ)) (-(1 / 2 : ℝ)) (by norm_num)).toMeasurableEquiv have hub := abs_lt.mp hu haveI : IsProbabilityMeasure (bernoulliLaw (1 / 2 + u)) := bernoulliLaw_isProbabilityMeasure (by linarith [hub.1]) (by linarith [hub.2]) haveI : IsProbabilityMeasure (bernoulliLaw (1 / 2)) := bernoulliLaw_isProbabilityMeasure (by norm_num) (by norm_num) rw [twoPointMean_eq_map_bernoulli (1 / 2) u (by norm_num), twoPointMean_eq_map_bernoulli (1 / 2) 0 (by norm_num)] have hp : (1 + u / (1 / 2)) / 2 = (1 / 2 + u : ℝ) := by ring have hq : (1 + 0 / (1 / 2)) / 2 = (1 / 2 : ℝ) := by ring rw [hp, hq] change chiSqDiv (Measure.map e (bernoulliLaw (1 / 2 + u))) (Measure.map e (bernoulliLaw (1 / 2))) = 4 * u ^ 2 rw [chiSqDiv_map_measurableEquiv] exact chiSqDiv_bernoulliLaw_centerHalf hu
Causalean.Stat.chiSqDiv_twoPointMean_centerHalf · Causalean/Stat/Minimax/ChiSquaredTwoPoint.lean:89 · uses twoPointMean , chiSqDiv
1 supporting declaration (lemmas, instances)
  • chiSqDiv_bernoulliLaw_centerHalf theorem — For a perturbation whose magnitude is strictly below one half, the χ²-divergence of the Bernoulli law with success probability one half plus that perturbation, relative to the centered Bernoulli law, is four times the squared perturbation.
    u :
    hu :
    abs u < 1 / 2
    chiSqDiv (bernoulliLaw (1 / 2 + u)) (bernoulliLaw (1 / 2)) = 4 * u ^ 2
    Proof (Lean source)
    theorem chiSqDiv_bernoulliLaw_centerHalf {u : Real} (hu : abs u < 1 / 2) : chiSqDiv (bernoulliLaw (1 / 2 + u)) (bernoulliLaw (1 / 2)) = 4 * u ^ 2 := by classical let p : ℝ := 1 / 2 + u let q : ℝ := 1 / 2 have hub := abs_lt.mp hu have hp0 : 0 ≤ p := by dsimp [p]; linarith have hp1 : p ≤ 1 := by dsimp [p]; linarith have hq0 : 0 < q := by norm_num [q] have hq1 : q < 1 := by norm_num [q] haveI : IsProbabilityMeasure (bernoulliLaw q) := bernoulliLaw_isProbabilityMeasure hq0.le hq1.le let g : ℝ → ENNReal := fun x => if x = 1 then ofReal (p / q) else ofReal ((1 - p) / (1 - q)) have hg : Measurable g := by dsimp [g] exact Measurable.ite (measurableSet_singleton (1 : ℝ)) measurable_const measurable_const have hq_ne0 : ofReal q ≠ 0 := by intro h have hle := ENNReal.ofReal_eq_zero.mp h linarith have h1q_ne0 : ofReal (1 - q) ≠ 0 := by intro h have hle := ENNReal.ofReal_eq_zero.mp h linarith have hwd : bernoulliLaw p = (bernoulliLaw q).withDensity g := by ext s hs rw [withDensity_apply _ hs, ← lintegral_indicator hs g] unfold bernoulliLaw dsimp [g] rw [lintegral_add_measure, lintegral_smul_measure, lintegral_smul_measure] simp only [lintegral_dirac] by_cases h1 : (1 : ℝ) ∈ s · by_cases h0 : (0 : ℝ) ∈ s · simp [h1, h0, ENNReal.ofReal_div_of_pos hq0, ENNReal.ofReal_div_of_pos (sub_pos.mpr hq1), ENNReal.mul_div_cancel hq_ne0 ENNReal.ofReal_ne_top, ENNReal.mul_div_cancel h1q_ne0 ENNReal.ofReal_ne_top] · simp [h1, h0, ENNReal.ofReal_div_of_pos hq0, ENNReal.mul_div_cancel hq_ne0 ENNReal.ofReal_ne_top] · by_cases h0 : (0 : ℝ) ∈ s · simp [h1, h0, ENNReal.ofReal_div_of_pos (sub_pos.mpr hq1), ENNReal.mul_div_cancel h1q_ne0 ENNReal.ofReal_ne_top] · simp [h1, h0] have hrn : (bernoulliLaw p).rnDeriv (bernoulliLaw q) =ᵐ[bernoulliLaw q] g := by rw [hwd] exact Measure.rnDeriv_withDensity _ hg change chiSqDiv (bernoulliLaw p) (bernoulliLaw q) = 4 * u ^ 2 rw [chiSqDiv] trans ∫ x, ((g x).toReal - 1) ^ 2 ∂(bernoulliLaw q) · exact integral_congr_ae <| hrn.mono fun x hx => by dsimp rw [hx] rw [bernoulliLaw_integral hq0.le hq1.le] dsimp [g] have hpq_nonneg : 0 ≤ p / q := div_nonneg hp0 hq0.le have hcp_nonneg : 0 ≤ (1 - p) / (1 - q) := div_nonneg (sub_nonneg.mpr hp1) (sub_nonneg.mpr hq1.le) simp only [if_pos, if_neg zero_ne_one] rw [ENNReal.toReal_ofReal hpq_nonneg, ENNReal.toReal_ofReal hcp_nonneg] dsimp [p, q] ring
    Causalean.Stat.chiSqDiv_bernoulliLaw_centerHalf · Causalean/Stat/Minimax/ChiSquaredTwoPoint.lean:21
Coordinatewise­Overlap 7 core · 12 supporting This file states a world-independent decentralized testing bound. ★ coordinatewise_overlap_direct_product

Coordinatewise overlap direct-product bound

This file states a world-independent decentralized testing bound. Each decoder may inspect its compressed local coordinate, all other coordinates, and a common ancillary variable.

def compressedCoordinateLaw reviewed
Causalean.Stat

For a compression from a measurable observation space to a measurable summary space and a measure on the observation space, the compressed-coordinate law is the image measure of the summary obtained by applying the compression to an observation governed by that measure.

Definition (Lean source)
compress :
Z → S
Q :
compressedCoordinateLaw compress Q :
Measure.map compress Q
Causalean.Stat.compressedCoordinateLaw · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:23
def coordinatewiseSuccessProbability reviewed
Causalean.Stat

For a nonnegative number of coordinates, measurable raw-observation and summary spaces at every coordinate, a measurable ancillary space, two probability laws for each coordinate, indexed by its binary state, a probability law for a common ancillary variable, one compression for each coordinate, and a decoder for each coordinate that uses its compressed observation, the full raw observation vector, and the ancillary variable, the coordinatewise success probability is the average, over all binary state vectors, of the probability that every decoder recovers its corresponding state under the associated independent product experiment.

Definition (Lean source)
M :
Fin M → Type*
A :
Type*
∀ j, MeasurableSpace (Z j)
∀ j, MeasurableSpace (S j)
Q :
∀ j
then
Measure (Z j)
R :
∀ j b, IsProbabilityMeasure (Q j b)
compress :
∀ j
if
Z j
then
S j
decoder :
∀ j
if
S j
and
((k : Fin M) → Z k)
and
A
then
coordinatewiseSuccessProbability Q R compress decoder :
ℝ≥0∞
(∑ omega : Fin M → Bool, (R.prod (Measure.pi (fun j => Q j (omega j)))) {data | ∀ j, decoder j (compress j (data.2 j)) data.2 data.1 = omega j}) / ((2 : ℝ≥0∞) ^ M)
Causalean.Stat.coordinatewiseSuccessProbability · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:43
def coordinateOverlap reviewed
Causalean.Stat

For two probability laws at each coordinate, indexed by its binary state, a compression at each coordinate, and one coordinate, the common-part overlap at that coordinate is one minus the total-variation distance between the two compressed laws of that coordinate.

Definition (Lean source)
M :
Fin M → Type*
∀ j, MeasurableSpace (Z j)
∀ j, MeasurableSpace (S j)
Q :
∀ j
then
Measure (Z j)
compress :
∀ j
if
Z j
then
S j
j :
Fin M
coordinateOverlap Q compress j :
1
- tvDist (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true))
Causalean.Stat.coordinateOverlap · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:67
def selectCoupledRaw reviewed
Causalean.Stat

For a binary hypercube vertex and a pair of raw observations at every coordinate, the selected raw observation vector takes the first member of each pair when the corresponding vertex bit is false and the second member when it is true.

Definition (Lean source)
M :
Fin M → Type*
omega :
Fin M → Bool
z :
(j : Fin M) → Z j × Z j
j :
Fin M
selectCoupledRaw omega z j :
Z j
fun j => if omega j then (z j).2 else (z j).1
def coupledDecoderGood reviewed
Causalean.Stat

For a nonnegative number of coordinates, one compression for each coordinate, one decoder for each coordinate, a binary hypercube vertex, a pair of raw observations at every coordinate, and an ancillary-variable value, the coupled decoder-good condition holds exactly when every decoder, applied to its compressed selected observation together with the full selected raw vector and the ancillary value, returns its corresponding vertex bit.

Definition (Lean source)
M :
Fin M → Type*
A :
Type*
compress :
∀ j
if
Z j
then
S j
decoder :
∀ j
if
S j
and
((k : Fin M) → Z k)
and
A
then
omega :
Fin M → Bool
z :
(j : Fin M) → Z j × Z j
a :
A
j :
coupledDecoderGood compress decoder omega z a :
Prop
decoder j (compress j (selectCoupledRaw omega z j)) (selectCoupledRaw omega z) a = omega j
Causalean.Stat.coupledDecoderGood · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:90
def coupledGoodIndicator reviewed
Causalean.Stat

For a nonnegative number of coordinates, one compression for each coordinate, one decoder for each coordinate, a binary hypercube vertex, a pair of raw observations at every coordinate, and an ancillary-variable value, the coupled decoder-good condition holds exactly when every decoder, applied to its compressed selected observation together with the full selected raw vector and the ancillary value, returns its corresponding vertex bit.

Definition (Lean source)
M :
Fin M → Type*
A :
Type*
compress :
∀ j
if
Z j
then
S j
decoder :
∀ j
if
S j
and
((k : Fin M) → Z k)
and
A
then
omega :
Fin M → Bool
z :
(j : Fin M) → Z j × Z j
a :
A
coupledGoodIndicator compress decoder omega z a :
ℝ≥0∞
by classical exact if coupledDecoderGood compress decoder omega z a then 1 else 0
Causalean.Stat.coupledGoodIndicator · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:107
lemma coordinatewise_overlap_direct_product reviewed
Causalean.Stat

Coordinatewise-overlap direct-product bound. In a conditionally independent hypercube experiment with at least one coordinate, per-coordinate candidate laws Q j, indexed by a bit, a per-coordinate compression map compress that is measurable at every coordinate, and per-coordinate decoders decoder built from the compressed local summary, the other coordinates' raw data, and shared randomness that are jointly measurable and depend on the raw sample at coordinate j only through its compressed summary, not directly on the raw value at j, then decentralized coordinate decoders cannot on average be correct more often than the common-part product bound built from the per-coordinate total-variation overlaps; and if every compressed adjacent KL divergence is at most κ log M, the displayed finite-M simultaneous-error certificate follows.

Formal statement
M :
hM :
1 ≤ M
Z S :
Fin M → Type*
A :
Type*
∀ j, MeasurableSpace (Z j)
∀ j, StandardBorelSpace (Z j)
∀ j, MeasurableSpace (S j)
∀ j, StandardBorelSpace (S j)
Q :
∀ j
then
Measure (Z j)
R :
∀ j b, IsProbabilityMeasure (Q j b)
compress :
∀ j
if
Z j
then
S j
hcompress :
∀ j, Measurable (compress j)
decoder :
∀ j
if
S j
and
((k : Fin M) → Z k)
and
A
then
hdecoder :
∀ j, Measurable (fun p : S j × ((k : Fin M) → Z k) × A => decoder j p.1 p.2.1 p.2.2)
hlocal :
∀ j s z z' a
if
(∀ k, k ≠ j → z k = z' k)
then
decoder j s z a = decoder j s z' a
conclusion 1
ofReal ((1 / 2 : ℝ) * (1 + ∏ j, (1 - coordinateOverlap Q compress j)))
conclusion 2
κ :
κ < 1
(∀ j, klDiv (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true)) ≤ ofReal (κ * log M))
ofReal ((1 / 2 : ℝ) * (1 - exp (-((M : ℝ) ^ (1 - κ)) / 2)))
≤ 1 - coordinatewiseSuccessProbability Q R compress decoder
Proof (Lean source)
lemma coordinatewise_overlap_direct_product {M : ℕ} (hM : 1 ≤ M) {Z S : Fin M → Type*} {A : Type*} [∀ j, MeasurableSpace (Z j)] [∀ j, StandardBorelSpace (Z j)] [∀ j, MeasurableSpace (S j)] [∀ j, StandardBorelSpace (S j)] [MeasurableSpace A] [StandardBorelSpace A] (Q : ∀ j, BoolMeasure (Z j)) (R : Measure A) [∀ j b, IsProbabilityMeasure (Q j b)] [IsProbabilityMeasure R] (compress : ∀ j, Z j → S j) (hcompress : ∀ j, Measurable (compress j)) (decoder : ∀ j, S j → ((k : Fin M) → Z k) → A → Bool) (hdecoder : ∀ j, Measurable (fun p : S j × ((k : Fin M) → Z k) × A => decoder j p.1 p.2.1 p.2.2)) (hlocal : ∀ j s z z' a, (∀ k, k ≠ j → z k = z' k) → decoder j s z a = decoder j s z' a) : coordinatewiseSuccessProbability Q R compress decoder ≤ ofReal ((1 / 2 : ℝ) * (1 + ∏ j, (1 - coordinateOverlap Q compress j))) ∧ ∀ κ : ℝ, κ < 1 → (∀ j, klDiv (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true)) ≤ ofReal (κ * log M)) → ofReal ((1 / 2 : ℝ) * (1 - exp (-((M : ℝ) ^ (1 - κ)) / 2))) ≤ 1 - coordinatewiseSuccessProbability Q R compress decoder := by letI mapProb (j : Fin M) (b : Bool) : IsProbabilityMeasure (compressedCoordinateLaw (compress j) (Q j b)) := Measure.isProbabilityMeasure_map (hcompress j).aemeasurable have hmain : coordinatewiseSuccessProbability Q R compress decoder ≤ ofReal ((1 / 2 : ℝ) * (1 + ∏ j, (1 - coordinateOverlap Q compress j))) := by classical let gamma : ∀ j, Measure (Z j × Z j) := fun j => compressionCoupling (Q j false) (Q j true) (compress j) (hcompress j) let Gamma : Measure ((j : Fin M) → Z j × Z j) := Measure.pi gamma let selected (omega : Fin M → Bool) : ((j : Fin M) → Z j × Z j) → ((j : Fin M) → Z j) := fun z => selectCoupledRaw omega z have hcoord (omega : Fin M → Bool) (j : Fin M) : MeasurePreserving (fun p : Z j × Z j => if omega j then p.2 else p.1) (gamma j) (Q j (omega j)) := by cases hbit : omega j · constructor · simpa [hbit] using (measurable_fst : Measurable (Prod.fst : Z j × Z j → Z j)) · simpa [gamma, hbit] using compressionCoupling_map_fst (Q j false) (Q j true) (compress j) (hcompress j) · constructor · simpa [hbit] using (measurable_snd : Measurable (Prod.snd : Z j × Z j → Z j)) · simpa [gamma, hbit] using compressionCoupling_map_snd (Q j false) (Q j true) (compress j) (hcompress j) have hselected (omega : Fin M → Bool) : MeasurePreserving (selected omega) Gamma (Measure.pi fun j => Q j (omega j)) := by exact measurePreserving_pi gamma (fun j => Q j (omega j)) (hcoord omega) have htargetMeas (omega : Fin M → Bool) : MeasurableSet {data : A × ((j : Fin M) → Z j) | ∀ j, decoder j (compress j (data.2 j)) data.2 data.1 = omega j} := by rw [show {data : A × ((j : Fin M) → Z j) | ∀ j, decoder j (compress j (data.2 j)) data.2 data.1 = omega j} = ⋂ j, {data | decoder j (compress j (data.2 j)) data.2 data.1 = omega j} by ext data; simp] apply MeasurableSet.iInter intro j apply measurableSet_eq_fun _ measurable_const have hm := (hdecoder j).comp (((hcompress j).comp ((measurable_pi_apply j).comp measurable_snd)).prodMk (measurable_snd.prodMk measurable_fst)) simpa only [Function.comp_def] using hm have hmeasure (omega : Fin M → Bool) : (R.prod (Measure.pi fun j => Q j (omega j))) {data | ∀ j, decoder j (compress j (data.2 j)) data.2 data.1 = omega j} = (R.prod Gamma) {data | coupledDecoderGood compress decoder omega data.2 data.1} := by let mp := (MeasurePreserving.id R).prod (hselected omega) have happ := Measure.map_apply (μ := R.prod Gamma) mp.measurable (htargetMeas omega) rw [mp.map_eq] at happ rw [happ] congr 1 have hsourceMeas (omega : Fin M → Bool) : MeasurableSet {data : A × ((j : Fin M) → Z j × Z j) | coupledDecoderGood compress decoder omega data.2 data.1} := by exact (htargetMeas omega).preimage (measurable_id.prodMap (hselected omega).measurable) have hindMeas (omega : Fin M → Bool) : Measurable (fun data : A × ((j : Fin M) → Z j × Z j) => coupledGoodIndicator compress decoder omega data.2 data.1) := by let E : Set (A × ((j : Fin M) → Z j × Z j)) := {data | coupledDecoderGood compress decoder omega data.2 data.1} rw [show (fun data : A × ((j : Fin M) → Z j × Z j) => coupledGoodIndicator compress decoder omega data.2 data.1) = E.indicator (fun _ => (1 : ℝ≥0∞)) by funext data by_cases hgood : coupledDecoderGood compress decoder omega data.2 data.1 <;> simp [coupledGoodIndicator, E, hgood]] exact measurable_const.indicator (hsourceMeas omega) have hindicator (omega : Fin M → Bool) : ∫⁻ data, coupledGoodIndicator compress decoder omega data.2 data.1 ∂(R.prod Gamma) = (R.prod Gamma) {data | coupledDecoderGood compress decoder omega data.2 data.1} := by let E : Set (A × ((j : Fin M) → Z j × Z j)) := {data | coupledDecoderGood compress decoder omega data.2 data.1} have hE : MeasurableSet E := hsourceMeas omega rw [← setLIntegral_one E] rw [← lintegral_indicator hE] apply lintegral_congr intro data by_cases hgood : coupledDecoderGood compress decoder omega data.2 data.1 <;> simp [coupledGoodIndicator, E, hgood] let N : Set ((j : Fin M) → Z j × Z j) := {z | ∀ j, compress j (z j).1 ≠ compress j (z j).2} have hNj (j : Fin M) : MeasurableSet {p : Z j × Z j | compress j p.1 ≠ compress j p.2} := by letI : MeasurableEq (S j) := measurableEqOfStandardBorel (S j) exact (measurableSet_eq_fun ((hcompress j).comp measurable_fst) ((hcompress j).comp measurable_snd)).compl have hN : MeasurableSet N := by rw [show N = Set.univ.pi fun j => {p : Z j × Z j | compress j p.1 ≠ compress j p.2} by ext z; simp [N]] exact MeasurableSet.univ_pi hNj have hgammaN (j : Fin M) : gamma j {p : Z j × Z j | compress j p.1 ≠ compress j p.2} ≤ ofReal (tvDist (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true))) := by have heq := compressionCoupling_equal_compression_mass_ge (Q j false) (Q j true) (compress j) (hcompress j) have hEqMeas : MeasurableSet {p : Z j × Z j | compress j p.1 = compress j p.2} := by letI : MeasurableEq (S j) := measurableEqOfStandardBorel (S j) exact measurableSet_eq_fun ((hcompress j).comp measurable_fst) ((hcompress j).comp measurable_snd) have hcompl := tsub_le_tsub_left heq 1 rw [show {p : Z j × Z j | compress j p.1 ≠ compress j p.2} = {p : Z j × Z j | compress j p.1 = compress j p.2}ᶜ by ext; simp, measure_compl hEqMeas (measure_ne_top (gamma j) _), measure_univ] calc 1 - gamma j {p : Z j × Z j | compress j p.1 = compress j p.2} ≤ 1 - ofReal (1 - tvDist (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true))) := by simpa [gamma, compressedCoordinateLaw] using hcompl _ = ofReal (tvDist (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true))) := by rw [← ENNReal.ofReal_one, ← ENNReal.ofReal_sub (1 : ℝ) (by exact sub_nonneg.mpr tvDist_le_one)] congr 1 ring have hGammaN : Gamma N ≤ ofReal (∏ j, tvDist (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true))) := by change (Measure.pi gamma) N ≤ _ rw [show N = Set.univ.pi fun j => {p : Z j × Z j | compress j p.1 ≠ compress j p.2} by ext z; simp [N], Measure.pi_pi] calc (∏ j, gamma j {p : Z j × Z j | compress j p.1 ≠ compress j p.2}) ≤ ∏ j, ofReal (tvDist (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true))) := Finset.prod_le_prod (fun _ _ => bot_le) (fun j _ => hgammaN j) _ = _ := by rw [ENNReal.ofReal_prod_of_nonneg] exact fun j _ => tvDist_nonneg have hpoint (data : A × ((j : Fin M) → Z j × Z j)) : (∑ omega : Fin M → Bool, coupledGoodIndicator compress decoder omega data.2 data.1) ≤ (2 : ℝ≥0∞) ^ M / 2 * (1 + N.indicator (fun _ => (1 : ℝ≥0∞)) data.2) := by by_cases hz : data.2 ∈ N · have htriv : (∑ omega : Fin M → Bool, coupledGoodIndicator compress decoder omega data.2 data.1) ≤ (2 : ℝ≥0∞) ^ M := by calc _ ≤ ∑ _omega : Fin M → Bool, (1 : ℝ≥0∞) := Finset.sum_le_sum fun omega _ => by by_cases hg : coupledDecoderGood compress decoder omega data.2 data.1 <;> simp [coupledGoodIndicator, hg] _ = _ := by simp have hcancel : (2 : ℝ≥0∞) ^ M / 2 * (1 + 1) = (2 : ℝ≥0∞) ^ M := by rw [one_add_one_eq_two, ENNReal.div_mul_cancel (by norm_num) (by norm_num)] simpa [Set.indicator_of_mem hz, hcancel] using htriv · have hz' : ¬ ∀ j, compress j (data.2 j).1 ≠ compress j (data.2 j).2 := by simpa [N] using hz push_neg at hz' obtain ⟨j, hj⟩ := hz' have hhalf := coupledDecoderGood_count_le_half compress decoder hlocal data.2 data.1 j hj simpa [indicator, hz] using hhalf have hsumMeasure : (∑ omega : Fin M → Bool, (R.prod (Measure.pi fun j => Q j (omega j))) {data | ∀ j, decoder j (compress j (data.2 j)) data.2 data.1 = omega j}) ≤ (2 : ℝ≥0∞) ^ M / 2 * (1 + Gamma N) := by have hIndIntegral : (∫⁻ data : A × ((j : Fin M) → Z j × Z j), N.indicator (fun _ => (1 : ℝ≥0∞)) data.2 ∂(R.prod Gamma)) = Gamma N := by rw [show (fun data : A × ((j : Fin M) → Z j × Z j) => N.indicator (fun _ => (1 : ℝ≥0∞)) data.2) = (univ ×ˢ N).indicator (fun _ => (1 : ℝ≥0∞)) by funext data by_cases hz : data.2 ∈ N <;> simp [indicator, hz]] rw [lintegral_indicator_const (MeasurableSet.univ.prod hN)] rw [Measure.prod_apply (MeasurableSet.univ.prod hN)] simp simp_rw [hmeasure, ← hindicator] rw [← lintegral_finset_sum univ (fun omega _ => hindMeas omega)] calc _ ≤ ∫⁻ data, (2 : ℝ≥0∞) ^ M / 2 * (1 + N.indicator (fun _ => (1 : ℝ≥0∞)) data.2) ∂(R.prod Gamma) := lintegral_mono hpoint _ = (2 : ℝ≥0∞) ^ M / 2 * (1 + Gamma N) := by rw [lintegral_const_mul] · rw [lintegral_add_left measurable_const] rw [lintegral_const, measure_univ, hIndIntegral] simp · exact measurable_const.fun_add ((measurable_const.indicator hN).comp measurable_snd) unfold coordinatewiseSuccessProbability have hprodReal : 0 ≤ ∏ j, tvDist (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true)) := Finset.prod_nonneg fun j _ => tvDist_nonneg calc _ ≤ ((2 : ℝ≥0∞) ^ M / 2 * (1 + Gamma N)) / (2 : ℝ≥0∞) ^ M := ENNReal.div_le_div_right hsumMeasure _ -- … truncated; follow the source link for the rest …
12 supporting declarations (lemmas, instances)
  • compressedCoordinateLaw_klDiv_le lemma — Measurable finite-coordinate compression cannot increase KL divergence.
    compress :
    Z → S
    hcompress :
    Measurable compress
    klDiv μ ν
    Proof (Lean source)
    -- @node: compressedCoordinateLaw_klDiv_le lemma compressedCoordinateLaw_klDiv_le {Z S : Type*} [MeasurableSpace Z] [MeasurableSpace S] (compress : Z → S) (hcompress : Measurable compress) (μ ν : Measure Z) [IsFiniteMeasure μ] [IsFiniteMeasure ν] : klDiv (compressedCoordinateLaw compress μ) (compressedCoordinateLaw compress ν) ≤ klDiv μ ν := by exact klDiv_map_le hcompress
    Causalean.Stat.compressedCoordinateLaw_klDiv_le · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:32
  • coupledDecoderGood_flip_exclusive lemma — If the two compressed versions agree at coordinate j, simultaneous correctness is impossible at both endpoints of the corresponding cube edge.
    M :
    Fin M → Type*
    A :
    Type*
    compress :
    ∀ j
    if
    Z j
    then
    S j
    decoder :
    ∀ j
    if
    S j
    and
    ((k : Fin M) → Z k)
    and
    A
    then
    hlocal :
    ∀ j s z z' a
    if
    (∀ k, k ≠ j → z k = z' k)
    then
    decoder j s z a = decoder j s z' a
    omega :
    Fin M → Bool
    z :
    (j : Fin M) → Z j × Z j
    a :
    A
    j :
    Fin M
    heq :
    compress j (z j).1 = compress j (z j).2
    ¬ (coupledDecoderGood compress decoder omega z a ∧ coupledDecoderGood compress decoder (flipBit j omega) z a)
    Proof (Lean source)
    lemma coupledDecoderGood_flip_exclusive {M : ℕ} {Z S : Fin M → Type*} {A : Type*} (compress : ∀ j, Z j → S j) (decoder : ∀ j, S j → ((k : Fin M) → Z k) → A → Bool) (hlocal : ∀ j s z z' a, (∀ k, k ≠ j → z k = z' k) → decoder j s z a = decoder j s z' a) (omega : Fin M → Bool) (z : (j : Fin M) → Z j × Z j) (a : A) (j : Fin M) (heq : compress j (z j).1 = compress j (z j).2) : ¬ (coupledDecoderGood compress decoder omega z a ∧ coupledDecoderGood compress decoder (flipBit j omega) z a) := by rintro ⟨hgood, hflip⟩ have hother : ∀ k, k ≠ j → selectCoupledRaw omega z k = selectCoupledRaw (flipBit j omega) z k := by intro k hkj simp [selectCoupledRaw, flipBit, hkj] have hs : compress j (selectCoupledRaw omega z j) = compress j (selectCoupledRaw (flipBit j omega) z j) := by cases hbit : omega j <;> simp [selectCoupledRaw, flipBit, hbit, heq] have hout := hlocal j (compress j (selectCoupledRaw omega z j)) (selectCoupledRaw omega z) (selectCoupledRaw (flipBit j omega) z) a hother have h1 := hgood j have h2 := hflip j rw [← hs] at h2 rw [hout, h2, flipBit_self] at h1 cases hbit : omega j <;> simp [hbit] at h1
    Causalean.Stat.coupledDecoderGood_flip_exclusive · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:123
  • coupledDecoderGood_count_le_half lemma — Once one coupled coordinate has equal compressions, at most half of the hypercube vertices can be simultaneously decoded correctly.
    M :
    Fin M → Type*
    A :
    Type*
    compress :
    ∀ j
    if
    Z j
    then
    S j
    decoder :
    ∀ j
    if
    S j
    and
    ((k : Fin M) → Z k)
    and
    A
    then
    hlocal :
    ∀ j s z z' a
    if
    (∀ k, k ≠ j → z k = z' k)
    then
    decoder j s z a = decoder j s z' a
    z :
    (j : Fin M) → Z j × Z j
    a :
    A
    j :
    Fin M
    heq :
    compress j (z j).1 = compress j (z j).2
    (∑ omega : Fin M → Bool, coupledGoodIndicator compress decoder omega z a)
    ≤ (2 : ℝ≥0∞) ^ M / 2
    Proof (Lean source)
    lemma coupledDecoderGood_count_le_half {M : ℕ} {Z S : Fin M → Type*} {A : Type*} (compress : ∀ j, Z j → S j) (decoder : ∀ j, S j → ((k : Fin M) → Z k) → A → Bool) (hlocal : ∀ j s z z' a, (∀ k, k ≠ j → z k = z' k) → decoder j s z a = decoder j s z' a) (z : (j : Fin M) → Z j × Z j) (a : A) (j : Fin M) (heq : compress j (z j).1 = compress j (z j).2) : (∑ omega : Fin M → Bool, coupledGoodIndicator compress decoder omega z a) ≤ (2 : ℝ≥0∞) ^ M / 2 := by classical let I : (Fin M → Bool) → ℝ≥0∞ := fun omega => coupledGoodIndicator compress decoder omega z a have hpair : ∀ omega, I omega + I (flipBit j omega) ≤ 1 := by intro omega by_cases h1 : coupledDecoderGood compress decoder omega z a · have h2 : ¬ coupledDecoderGood compress decoder (flipBit j omega) z a := fun h => coupledDecoderGood_flip_exclusive compress decoder hlocal omega z a j heq ⟨h1, h⟩ simp [I, coupledGoodIndicator, h1, h2] · by_cases h2 : coupledDecoderGood compress decoder (flipBit j omega) z a <;> simp [I, coupledGoodIndicator, h1, h2] have hreindex : ∑ omega, I (flipBit j omega) = ∑ omega, I omega := Equiv.sum_comp (flipPerm j) I have hsum : 2 * ∑ omega, I omega ≤ ∑ _omega : Fin M → Bool, (1 : ℝ≥0∞) := by calc 2 * ∑ omega, I omega = (∑ omega, I omega) + ∑ omega, I (flipBit j omega) := by rw [hreindex]; ring _ = ∑ omega, (I omega + I (flipBit j omega)) := by rw [Finset.sum_add_distrib] _ ≤ ∑ _omega : Fin M → Bool, (1 : ℝ≥0∞) := Finset.sum_le_sum fun omega _ => hpair omega rw [show (∑ _omega : Fin M → Bool, (1 : ℝ≥0∞)) = (2 : ℝ≥0∞) ^ M by simp] at hsum rw [ENNReal.le_div_iff_mul_le (inr (by norm_num)) (inr (by norm_num))] simpa [mul_comm] using hsum
    Causalean.Stat.coupledDecoderGood_count_le_half · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:154
  • half_integral_abs_rnDeriv_sub_le_tvDist lemma — For two probability measures dominated by a common finite measure, half the L¹ distance between their Radon--Nikodym densities is bounded by total variation. This is the reverse Scheffé inequality needed to construct the common submeasure in the maximal-coupling argument.
    Ω :
    hμξ :
    μ ≪ ξ
    hνξ :
    ν ≪ ξ
    (1 / 2 : ℝ) * ∫ x, |(μ.rnDeriv ξ x).toReal - (ν.rnDeriv ξ x).toReal| ∂ξ
    tvDist μ ν
    Proof (Lean source)
    lemma half_integral_abs_rnDeriv_sub_le_tvDist {Ω : Type*} [MeasurableSpace Ω] (μ ν ξ : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] [IsFiniteMeasure ξ] (hμξ : μ ≪ ξ) (hνξ : ν ≪ ξ) : (1 / 2 : ℝ) * ∫ x, |(μ.rnDeriv ξ x).toReal - (ν.rnDeriv ξ x).toReal| ∂ξ ≤ tvDist μ ν := by let p : Ω → ℝ := fun x => (μ.rnDeriv ξ x).toReal let q : Ω → ℝ := fun x => (ν.rnDeriv ξ x).toReal let d : Ω → ℝ := fun x => p x - q x let A : Set Ω := {x | 0 ≤ d x} have hp : Integrable p ξ := Measure.integrable_toReal_rnDeriv have hq : Integrable q ξ := Measure.integrable_toReal_rnDeriv have hd : Integrable d ξ := hp.sub hq have hA : MeasurableSet A := by dsimp [A, d, p, q] exact measurableSet_le measurable_const ((Measure.measurable_rnDeriv μ ξ).ennreal_toReal.sub (Measure.measurable_rnDeriv ν ξ).ennreal_toReal) have hd0 : ∫ x, d x ∂ξ = 0 := by rw [show d = fun x => p x - q x from rfl, integral_sub hp hq] rw [show p = fun x => (μ.rnDeriv ξ x).toReal from rfl, show q = fun x => (ν.rnDeriv ξ x).toReal from rfl, Measure.integral_toReal_rnDeriv hμξ, Measure.integral_toReal_rnDeriv hνξ] simp only [probReal_univ, sub_self] have hsplit : ∫ x in A, d x ∂ξ + ∫ x in Aᶜ, d x ∂ξ = 0 := by rw [MeasureTheory.integral_add_compl hA hd, hd0] have hpos : 0 ≤ ∫ x in A, d x ∂ξ := by apply integral_nonneg_of_ae filter_upwards [ae_restrict_mem hA] with x hx exact hx have habsA : ∫ x in A, |d x| ∂ξ = ∫ x in A, d x ∂ξ := by apply integral_congr_ae filter_upwards [ae_restrict_mem hA] with x hx rw [abs_of_nonneg] exact hx have habsAc : ∫ x in Aᶜ, |d x| ∂ξ = -(∫ x in Aᶜ, d x ∂ξ) := by rw [← integral_neg] apply integral_congr_ae filter_upwards [ae_restrict_mem hA.compl] with x hx change ¬ 0 ≤ d x at hx rw [not_le] at hx rw [abs_of_neg hx] have habs : ∫ x, |d x| ∂ξ = 2 * ∫ x in A, d x ∂ξ := by rw [← MeasureTheory.integral_add_compl hA hd.abs, habsA, habsAc] linarith have hgap : μ.real A - ν.real A = ∫ x in A, d x ∂ξ := by rw [show d = fun x => p x - q x from rfl, integral_sub hp.integrableOn hq.integrableOn, show p = fun x => (μ.rnDeriv ξ x).toReal from rfl, show q = fun x => (ν.rnDeriv ξ x).toReal from rfl, Measure.setIntegral_toReal_rnDeriv hμξ, Measure.setIntegral_toReal_rnDeriv hνξ] have htv := abs_measureReal_sub_le_tvDist (μ := μ) (ν := ν) hA rw [hgap, abs_of_nonneg hpos] at htv change (1 / 2 : ℝ) * ∫ x, |d x| ∂ξ ≤ _ rw [habs] linarith
    Causalean.Stat.half_integral_abs_rnDeriv_sub_le_tvDist · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:196
  • overlap_ge_exp_neg_klBudget lemma — A nonnegative finite KL budget yields the corresponding Bretagnolle--Huber lower bound on testing overlap.
    Ω :
    B :
    hB :
    0 ≤ B
    hKL :
    klDiv μ ν ≤ ofReal B
    (1 / 2 : ℝ) * exp (-B) ≤ 1 - tvDist μ ν
    Proof (Lean source)
    lemma overlap_ge_exp_neg_klBudget {Ω : Type*} [MeasurableSpace Ω] (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] {B : ℝ} (hB : 0 ≤ B) (hKL : klDiv μ ν ≤ ofReal B) : (1 / 2 : ℝ) * exp (-B) ≤ 1 - tvDist μ ν := by have hfin : klDiv μ ν ≠ ⊤ := ne_top_of_le_ne_top (ENNReal.ofReal_ne_top : ofReal B ≠ ⊤) hKL have hKLreal : (klDiv μ ν).toReal ≤ B := by rw [← ENNReal.toReal_ofReal hB] exact ENNReal.toReal_le_toReal hfin ENNReal.ofReal_ne_top |>.2 hKL calc (1 / 2 : ℝ) * exp (-B) ≤ (1 / 2 : ℝ) * exp (-(klDiv μ ν).toReal) := by gcongr _ ≤ 1 - tvDist μ ν := bretagnolle_huber_affinity μ ν (InformationTheory.klDiv_ne_top_iff.mp hfin).1 hfin
    Causalean.Stat.overlap_ge_exp_neg_klBudget · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:261
  • prod_one_sub_le_exp_neg_sum lemma — A product of complementary overlap probabilities is bounded by the exponential of minus their sum.
    M :
    ρ :
    Fin M → ℝ
    hρ1 :
    ∀ j, ρ j ≤ 1
    (∏ j, (1 - ρ j)) ≤ exp (-∑ j, ρ j)
    Proof (Lean source)
    lemma prod_one_sub_le_exp_neg_sum {M : ℕ} (ρ : Fin M → ℝ) (hρ1 : ∀ j, ρ j ≤ 1) : (∏ j, (1 - ρ j)) ≤ exp (-∑ j, ρ j) := by calc (∏ j, (1 - ρ j)) ≤ ∏ j, exp (-ρ j) := by apply Finset.prod_le_prod · intro j _ linarith [hρ1 j] · intro j _ linarith [Real.add_one_le_exp (-ρ j)] _ = exp (-∑ j, ρ j) := by rw [← Real.exp_sum] congr 1 simp
    Causalean.Stat.prod_one_sub_le_exp_neg_sum · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:283
  • prod_one_sub_le_exp_neg_card_mul lemma — A common coordinatewise overlap floor c bounds the complementary product by exp (-M * c).
    M :
    ρ :
    Fin M → ℝ
    c :
    hρ1 :
    ∀ j, ρ j ≤ 1
    hc :
    ∀ j, c ≤ ρ j
    (∏ j, (1 - ρ j)) ≤ exp (-(M : ℝ) * c)
    Proof (Lean source)
    lemma prod_one_sub_le_exp_neg_card_mul {M : ℕ} (ρ : Fin M → ℝ) (c : ℝ) (hρ1 : ∀ j, ρ j ≤ 1) (hc : ∀ j, c ≤ ρ j) : (∏ j, (1 - ρ j)) ≤ exp (-(M : ℝ) * c) := by refine (prod_one_sub_le_exp_neg_sum ρ hρ1).trans ?_ rw [Real.exp_le_exp] have hsum : (M : ℝ) * c ≤ ∑ j, ρ j := by calc (M : ℝ) * c = ∑ _j : Fin M, c := by simp _ ≤ ∑ j, ρ j := Finset.sum_le_sum (fun j _ => hc j) linarith
    Causalean.Stat.prod_one_sub_le_exp_neg_card_mul · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:302
  • tvDist_eq_zero_of_klBudget_nonpos lemma — A nonpositive real KL budget forces two probability measures to coincide, and hence forces their total variation distance to vanish.
    Ω :
    B :
    hB :
    B ≤ 0
    hKL :
    klDiv μ ν ≤ ofReal B
    tvDist μ ν = 0
    Proof (Lean source)
    lemma tvDist_eq_zero_of_klBudget_nonpos {Ω : Type*} [MeasurableSpace Ω] (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] {B : ℝ} (hB : B ≤ 0) (hKL : klDiv μ ν ≤ ofReal B) : tvDist μ ν = 0 := by have hKL0 : klDiv μ ν = 0 := by apply le_antisymm · simpa [ENNReal.ofReal_eq_zero.mpr hB] using hKL · exact bot_le have hmeasure : μ = ν := InformationTheory.klDiv_eq_zero_iff.mp hKL0 subst ν simp [tvDist]
    Causalean.Stat.tvDist_eq_zero_of_klBudget_nonpos · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:317
  • card_mul_exp_neg_log_eq_rpow lemma — The exponential KL-overlap floor has the expected power-law scaling after multiplication by the number of coordinates.
    M :
    hM :
    1 ≤ M
    κ :
    (M : ℝ) * ((1 / 2 : ℝ) * exp (-(κ * log M))) = (M : ℝ) ^ (1 - κ) / 2
    Proof (Lean source)
    lemma card_mul_exp_neg_log_eq_rpow {M : ℕ} (hM : 1 ≤ M) (κ : ℝ) : (M : ℝ) * ((1 / 2 : ℝ) * exp (-(κ * log M))) = (M : ℝ) ^ (1 - κ) / 2 := by have hMr : (0 : ℝ) < M := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hM) rw [Real.rpow_def_of_pos hMr] rw [show log (M : ℝ) * (1 - κ) = log (M : ℝ) + -(κ * log (M : ℝ)) by ring, Real.exp_add, Real.exp_log hMr] ring
    Causalean.Stat.card_mul_exp_neg_log_eq_rpow · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:334
  • coordinateOverlap_product_le_of_nonnegative_kl lemma — Under a nonnegative logarithmic KL budget, the product of coordinatewise total-variation factors has the finite-M exponential bound.
    M :
    hM :
    1 ≤ M
    Z S :
    Fin M → Type*
    ∀ j, MeasurableSpace (Z j)
    ∀ j, MeasurableSpace (S j)
    Q :
    ∀ j
    then
    Measure (Z j)
    ∀ j b, IsProbabilityMeasure (Q j b)
    compress :
    ∀ j
    if
    Z j
    then
    S j
    hcompress :
    ∀ j, Measurable (compress j)
    κ :
    hκ0 :
    0 ≤ κ
    hKL :
    ∀ j,
    klDiv (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true))
    ofReal (κ * log M)
    (∏ j, (1 - coordinateOverlap Q compress j)) ≤ exp (-((M : ℝ) ^ (1 - κ)) / 2)
    Proof (Lean source)
    lemma coordinateOverlap_product_le_of_nonnegative_kl {M : ℕ} (hM : 1 ≤ M) {Z S : Fin M → Type*} [∀ j, MeasurableSpace (Z j)] [∀ j, MeasurableSpace (S j)] (Q : ∀ j, BoolMeasure (Z j)) [∀ j b, IsProbabilityMeasure (Q j b)] (compress : ∀ j, Z j → S j) (hcompress : ∀ j, Measurable (compress j)) {κ : ℝ} (hκ0 : 0 ≤ κ) (hKL : ∀ j, klDiv (compressedCoordinateLaw (compress j) (Q j false)) (compressedCoordinateLaw (compress j) (Q j true)) ≤ ofReal (κ * log M)) : (∏ j, (1 - coordinateOverlap Q compress j)) ≤ exp (-((M : ℝ) ^ (1 - κ)) / 2) := by letI mapProb (j : Fin M) (b : Bool) : IsProbabilityMeasure (compressedCoordinateLaw (compress j) (Q j b)) := Measure.isProbabilityMeasure_map (hcompress j).aemeasurable have hlog : 0 ≤ log (M : ℝ) := Real.log_nonneg (by exact_mod_cast hM) have hover_le_one : ∀ j, coordinateOverlap Q compress j ≤ 1 := by intro j unfold coordinateOverlap linarith [tvDist_nonneg (μ := compressedCoordinateLaw (compress j) (Q j false)) (ν := compressedCoordinateLaw (compress j) (Q j true))] have hover_floor : ∀ j, (1 / 2 : ℝ) * exp (-(κ * log M)) ≤ coordinateOverlap Q compress j := by intro j exact overlap_ge_exp_neg_klBudget _ _ (mul_nonneg hκ0 hlog) (hKL j) have hprod := prod_one_sub_le_exp_neg_card_mul (fun j => coordinateOverlap Q compress j) ((1 / 2 : ℝ) * exp (-(κ * log M))) hover_le_one hover_floor rw [show -(M : ℝ) * ((1 / 2 : ℝ) * exp (-(κ * log M))) = -((M : ℝ) * ((1 / 2 : ℝ) * exp (-(κ * log M)))) by ring, card_mul_exp_neg_log_eq_rpow hM κ] at hprod simpa only [neg_div] using hprod
    Causalean.Stat.coordinateOverlap_product_le_of_nonnegative_kl · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:349
  • ennreal_error_lower_bound_of_success_upper_bound lemma — A real-valued product bound below one converts an ENNReal simultaneous success upper bound into the complementary error lower bound.
    s :
    ℝ≥0∞
    p e :
    hp0 :
    0 ≤ p
    he1 :
    e ≤ 1
    hpe :
    p ≤ e
    hs :
    s ≤ ofReal ((1 / 2 : ℝ) * (1 + p))
    ofReal ((1 / 2 : ℝ) * (1 - e)) ≤ 1 - s
    Proof (Lean source)
    lemma ennreal_error_lower_bound_of_success_upper_bound {s : ℝ≥0∞} {p e : ℝ} (hp0 : 0 ≤ p) (he1 : e ≤ 1) (hpe : p ≤ e) (hs : s ≤ ofReal ((1 / 2 : ℝ) * (1 + p))) : ofReal ((1 / 2 : ℝ) * (1 - e)) ≤ 1 - s := by have ht : 0 ≤ (1 / 2 : ℝ) * (1 - e) := mul_nonneg (by norm_num) (sub_nonneg.mpr he1) have hu : 0 ≤ (1 / 2 : ℝ) * (1 + p) := mul_nonneg (by norm_num) (by linarith) apply ENNReal.le_sub_of_add_le_right (ne_top_of_le_ne_top ENNReal.ofReal_ne_top hs) calc ofReal ((1 / 2 : ℝ) * (1 - e)) + s ≤ ofReal ((1 / 2 : ℝ) * (1 - e)) + ofReal ((1 / 2 : ℝ) * (1 + p)) := add_le_add_right hs _ _ = ofReal ((1 / 2 : ℝ) * (1 - e) + (1 / 2 : ℝ) * (1 + p)) := (ENNReal.ofReal_add ht hu).symm _ ≤ ofReal 1 := ENNReal.ofReal_le_ofReal (by linarith) _ = 1 := ENNReal.ofReal_one
    Causalean.Stat.ennreal_error_lower_bound_of_success_upper_bound · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:391
  • coordinatewise_overlap_direct_product_asymptotic lemma — Along any sequence M_n → ∞ and for fixed κ < 1, the finite direct-product certificate tends to one half.
    Mseq :
    ℕ → ℕ
    κ :
    :
    κ < 1
    hMseq :
    Tendsto (fun n => (1 / 2 : ℝ) * (1 - exp (-(((Mseq n : ℕ) : ℝ) ^ (1 - κ)) / 2))) atTop (nhds (1 / 2 : ℝ))
    Proof (Lean source)
    lemma coordinatewise_overlap_direct_product_asymptotic (Mseq : ℕ → ℕ) (κ : ℝ) (hκ : κ < 1) (hMseq : Tendsto Mseq atTop atTop) : Tendsto (fun n => (1 / 2 : ℝ) * (1 - exp (-(((Mseq n : ℕ) : ℝ) ^ (1 - κ)) / 2))) atTop (nhds (1 / 2 : ℝ)) := by have hpow : Tendsto (fun n => ((Mseq n : ℝ) ^ (1 - κ))) atTop atTop := (tendsto_rpow_atTop (sub_pos.mpr hκ)).comp (tendsto_natCast_atTop_atTop.comp hMseq) have hneg : Tendsto (fun n => -((Mseq n : ℝ) ^ (1 - κ)) / 2) atTop atBot := by exact (tendsto_neg_atTop_atBot.comp hpow).atBot_div_const (by norm_num) have hexp : Tendsto (fun n => exp (-((Mseq n : ℝ) ^ (1 - κ)) / 2)) atTop (nhds 0) := Real.tendsto_exp_atBot.comp hneg convert (tendsto_const_nhds.mul (tendsto_const_nhds.sub hexp)) using 1 all_goals norm_num
    Causalean.Stat.coordinatewise_overlap_direct_product_asymptotic · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:749
Fano 3 core · 6 supporting This file proves a total-variation form of the multiple-hypothesis minimax lower bound. ★ fano_average_error★ fano_exists_error

Fano-Type Multiple-Hypothesis Bound

This file proves a total-variation form of the multiple-hypothesis minimax lower bound. It converts pairwise-separated parameter values and a common reference measure into an average error lower bound for any estimator.

def acceptanceRegion reviewed
Causalean.Stat

For a sample space, a pseudo-metric parameter space, an estimator from the sample space to the parameter space, a parameter value, and a real radius, the acceptance region is the set of sample points at which the estimator lies at distance strictly less than that radius from the parameter value.

Definition (Lean source)
Ω :
Type u_1
shared
Θ :
Type u_2
shared
est :
Ω → Θ
θ :
Θ
s :
acceptanceRegion est θ s :
Set Ω
{ω | dist (est ω) θ < s}
Causalean.Stat.acceptanceRegion · Causalean/Stat/Minimax/Fano.lean:61
theorem fano_average_error reviewed
Causalean.Stat

Fano average-error lower bound. For a measurable estimator est and a family of parameter values that are pairwise 2s-separated, the average probability of error over the N = card ι hypotheses is at least 1 − (1 + ∑ᵢ tvDist (P i₀) (P i)) / N.

Formal statement
Ω :
Type u_1
shared
Θ :
Type u_2
shared
ι :
Type u_3
shared
P :
ι → Measure Ω
shared
est :
Ω → Θ
hest :
θ :
ι → Θ
s :
hsep :
∀ i k
if
i ≠ k
then
2 * s ≤ dist (θ i) (θ k)
i₀ :
ι
1 - (1 + ∑ i, tvDist (P i₀) (P i)) / (card ι)
≤ (∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)}) / (card ι)
Proof (Lean source)
theorem fano_average_error {est : Ω → Θ} (hest : Measurable est) {θ : ι → Θ} {s : ℝ} (hsep : ∀ i k, i ≠ k → 2 * s ≤ dist (θ i) (θ k)) (i₀ : ι) : 1 - (1 + ∑ i, tvDist (P i₀) (P i)) / (Fintype.card ι) ≤ (∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)}) / (Fintype.card ι) := by set N : ℝ := (Fintype.card ι : ℝ) with hN have hNpos : 0 < N := by rw [hN, Nat.cast_pos] exact Fintype.card_pos_iff.mpr ⟨i₀⟩ have hNne : N ≠ 0 := ne_of_gt hNpos have herr : ∀ i, (P i).real {ω | s ≤ dist (est ω) (θ i)} = 1 - (P i).real (acceptanceRegion est (θ i) s) := by intro i rw [← acceptanceRegion_compl est (θ i) s, measureReal_compl (measurableSet_acceptanceRegion hest (θ i) s)] simp [probReal_univ] have hsumerr : ∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)} = N - ∑ i, (P i).real (acceptanceRegion est (θ i) s) := by simp_rw [herr] rw [Finset.sum_sub_distrib] congr 1 rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one, hN] have hcorrect := sum_correct_le P hest hsep i₀ rw [hsumerr, le_div_iff₀ hNpos, sub_mul, div_mul_cancel₀ _ hNne, one_mul] linarith [hcorrect]
Causalean.Stat.fano_average_error · Causalean/Stat/Minimax/Fano.lean:159 · uses tvDist
theorem fano_exists_error reviewed
Causalean.Stat

Fano existence-of-bad-hypothesis bound (uniform β). For a measurable estimator est and a family of parameter values that are pairwise 2s-separated, if every hypothesis's law is within total variation β of the reference P i₀, then some hypothesis has error probability at least 1 − 1/N − β. This is the directly usable minimax statement: choosing the number of hypotheses N large and the divergence β small forces error.

Formal statement
Ω :
Type u_1
shared
Θ :
Type u_2
shared
ι :
Type u_3
shared
P :
ι → Measure Ω
shared
est :
Ω → Θ
hest :
θ :
ι → Θ
s :
hsep :
∀ i k
if
i ≠ k
then
2 * s ≤ dist (θ i) (θ k)
i₀ :
ι
β :
:
∀ i, tvDist (P i₀) (P i) ≤ β
∃ i, 1 - 1 / (card ι) - β ≤ (P i).real {ω | s ≤ dist (est ω) (θ i)}
Proof (Lean source)
theorem fano_exists_error {est : Ω → Θ} (hest : Measurable est) {θ : ι → Θ} {s : ℝ} (hsep : ∀ i k, i ≠ k → 2 * s ≤ dist (θ i) (θ k)) (i₀ : ι) {β : ℝ} (hβ : ∀ i, tvDist (P i₀) (P i) ≤ β) : ∃ i, 1 - 1 / (Fintype.card ι) - β ≤ (P i).real {ω | s ≤ dist (est ω) (θ i)} := by set N : ℝ := (Fintype.card ι : ℝ) with hN have hNpos : 0 < N := by rw [hN, Nat.cast_pos]; exact Fintype.card_pos_iff.mpr ⟨i₀⟩ have havg := fano_average_error P hest hsep i₀ rw [← hN] at havg have hsumtv : ∑ i, tvDist (P i₀) (P i) ≤ N * β := by calc ∑ i, tvDist (P i₀) (P i) ≤ ∑ _i : ι, β := Finset.sum_le_sum (fun i _ => hβ i) _ = N * β := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, hN] have hstep : (1 + ∑ i, tvDist (P i₀) (P i)) / N ≤ 1 / N + β := by rw [add_div] have hle : (∑ i, tvDist (P i₀) (P i)) / N ≤ β := by rw [div_le_iff₀ hNpos]; linarith [hsumtv] linarith have hbound : 1 - 1 / N - β ≤ (∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)}) / N := by refine le_trans ?_ havg linarith [hstep] by_contra hcon push_neg at hcon have hstrict : ∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)} < N * (1 - 1 / N - β) := by calc ∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)} < ∑ _i : ι, (1 - 1 / N - β) := Finset.sum_lt_sum_of_nonempty (Finset.univ_nonempty_iff.mpr ⟨i₀⟩) (fun i _ => hcon i) _ = N * (1 - 1 / N - β) := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, hN] rw [le_div_iff₀ hNpos] at hbound nlinarith [hbound, hstrict]
Causalean.Stat.fano_exists_error · Causalean/Stat/Minimax/Fano.lean:188 · uses tvDist
6 supporting declarations (lemmas, instances)
Finite­Posterior­Bayes­Risk 11 core · 24 supporting This module conditions a finite prior through an arbitrary finite Markov observation kernel. ★ squaredRisk_eq_posteriorResidual_add★ finiteDesignBayesRisk_statewiseSquaredLoss★ realBayesRisk_statewiseSquaredLoss_eq_posteriorResidual

Finite posterior means and continuous-mixture Bayes risk

This module conditions a finite prior through an arbitrary finite Markov observation kernel. It provides zero-guarded posterior weights, exact finite disintegration and squared-loss completion, and identifies the resulting real-valued Bayes-risk infimum.

It also transports the construction through a continuous prior mixed into the finite latent space, reusing the induced finite design to transfer estimator-wise integral lower bounds to finite and continuous-mixture Bayes risks.

def kernelMass reviewed
Causalean.Stat

Given a measurable latent-state space, a measurable observation space, a Markov observation kernel from latent states to observations, a latent state, and an observation, the real-valued singleton observation mass is the kernel's mass at that observation conditional on that latent state.

Definition (Lean source)
S :
Type u_1
shared
X :
Type u_2
shared
L :
Kernel S X
s :
S
x :
X
kernelMass L s x :
(L s).real {x}
def jointMass reviewed
Causalean.Stat

Given a finite measurable latent-state space, a measurable observation space, a finite probability design on the latent states, a Markov observation kernel from latent states to observations, a latent state, and an observation, the joint mass of that state and observation is the prior mass of the state times the conditional singleton mass of the observation.

Definition (Lean source)
S :
Type u_1
shared
X :
Type u_2
shared
ν :
L :
Kernel S X
s :
S
x :
X
jointMass ν L s x :
ν.p s * kernelMass L s x
def observationMass reviewed
Causalean.Stat

Given a finite measurable latent-state space, a measurable observation space, a finite probability design on the latent states, a Markov observation kernel from latent states to observations, and an observation, the observation marginal mass is the sum, over all latent states, of their joint masses with that observation.

Definition (Lean source)
S :
Type u_1
shared
X :
Type u_2
shared
ν :
L :
Kernel S X
x :
X
observationMass ν L x :
∑ s, jointMass ν L s x
def posteriorWeight reviewed
Causalean.Stat

Given a finite measurable latent-state space, a measurable observation space, a finite probability design on the latent states, a Markov observation kernel from latent states to observations, an observation, and a latent state, the guarded posterior weight is zero when the observation has zero marginal mass and is otherwise the joint mass of the state and observation divided by that marginal mass.

Definition (Lean source)
S :
Type u_1
shared
X :
Type u_2
shared
ν :
L :
Kernel S X
x :
X
s :
S
posteriorWeight ν L x s :
if observationMass ν L x = 0 then 0 else jointMass ν L s x / observationMass ν L x
def posteriorMean reviewed
Causalean.Stat

Given a finite measurable latent-state space, a measurable observation space, a finite probability design on the latent states, a Markov observation kernel from latent states to observations, an observation-dependent real target, and an observation, the guarded posterior mean is the sum over latent states of the guarded posterior weight times that target at the state and observation.

Definition (Lean source)
S :
Type u_1
shared
X :
Type u_2
shared
ν :
L :
Kernel S X
t :
S → X → ℝ
x :
X
posteriorMean ν L t x :
∑ s, posteriorWeight ν L x s * t s x
def squaredRisk reviewed
Causalean.Stat

Given a finite measurable latent-state space, a finite measurable observation space, a finite probability design on the latent states, a Markov observation kernel from latent states to observations, an observation-dependent real target, and a real-valued estimator based on the observation, the squared risk is the sum over all latent states and observations of their joint mass times the estimator's squared error relative to the target.

Definition (Lean source)
S :
Type u_1
shared
X :
Type u_2
shared
ν :
L :
Kernel S X
t :
S → X → ℝ
T :
X → ℝ
squaredRisk ν L t T :
∑ s, ∑ x, jointMass ν L s x * (T x - t s x) ^ 2
def posteriorResidual reviewed
Causalean.Stat

Given a finite measurable latent-state space, a finite measurable observation space, a finite probability design on the latent states, a Markov observation kernel from latent states to observations, and an observation-dependent real target, the posterior residual risk is the sum over observations of their marginal mass times the posterior-weighted squared deviation of the target from its guarded posterior mean.

Definition (Lean source)
S :
Type u_1
shared
X :
Type u_2
shared
ν :
L :
Kernel S X
t :
S → X → ℝ
posteriorResidual ν L t :
∑ x, observationMass ν L x * (∑ s, posteriorWeight ν L x s * (t s x - posteriorMean ν L t x) ^ 2)
theorem squaredRisk_eq_posteriorResidual_add reviewed
Causalean.Stat

Every estimator's squared risk equals posterior residual risk plus its marginally weighted squared distance from the posterior mean.

Formal statement
S :
Type u_1
shared
X :
Type u_2
shared
ν :
L :
Kernel S X
t :
S → X → ℝ
T :
X → ℝ
squaredRisk ν L t T
= posteriorResidual ν L t + ∑ x, observationMass ν L x * (T x - posteriorMean ν L t x) ^ 2
Proof (Lean source)
theorem squaredRisk_eq_posteriorResidual_add (ν : FiniteDesign S) (L : Kernel S X) (t : S → X → ℝ) (T : X → ℝ) : squaredRisk ν L t T = posteriorResidual ν L t + ∑ x, observationMass ν L x * (T x - posteriorMean ν L t x) ^ 2 := by -- Disintegrate the risk. On positive fibers, expand the square around the posterior mean and -- kill the cross term with `posterior_centered_sum_of_pos`; null fibers vanish by their mass. classical rw [squaredRisk, disintegrate_sum ν L] unfold posteriorResidual rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro x _ by_cases hx0 : observationMass ν L x = 0 · simp [hx0] · have hx : 0 < observationMass ν L x := lt_of_le_of_ne (observationMass_nonneg ν L x) (Ne.symm hx0) rw [← mul_add] congr 1 calc (∑ s, posteriorWeight ν L x s * (T x - t s x) ^ 2) = ∑ s, (posteriorWeight ν L x s * (t s x - posteriorMean ν L t x) ^ 2 + posteriorWeight ν L x s * (T x - posteriorMean ν L t x) ^ 2 - (2 * (T x - posteriorMean ν L t x)) * (posteriorWeight ν L x s * (t s x - posteriorMean ν L t x))) := by apply Finset.sum_congr rfl intro s _ ring _ = (∑ s, posteriorWeight ν L x s * (t s x - posteriorMean ν L t x) ^ 2) + (∑ s, posteriorWeight ν L x s) * (T x - posteriorMean ν L t x) ^ 2 - (2 * (T x - posteriorMean ν L t x)) * (∑ s, posteriorWeight ν L x s * (t s x - posteriorMean ν L t x)) := by rw [Finset.sum_sub_distrib, Finset.sum_add_distrib, Finset.sum_mul, ← Finset.mul_sum] _ = (∑ s, posteriorWeight ν L x s * (t s x - posteriorMean ν L t x) ^ 2) + (T x - posteriorMean ν L t x) ^ 2 := by rw [posteriorWeight_sum_of_pos ν L hx, posterior_centered_sum_of_pos ν L t hx] ring
def statewiseSquaredLoss reviewed
Causalean.Stat

Given a measurable latent-state space, a finite measurable observation space, a Markov observation kernel from latent states to observations, an observation-dependent real target, a real-valued estimator based on the observation, and a latent state, the statewise squared loss is the sum over observations of their conditional singleton masses times the estimator's squared error relative to the target.

Definition (Lean source)
S :
Type u_1
shared
X :
Type u_2
shared
L :
Kernel S X
t :
S → X → ℝ
T :
X → ℝ
s :
S
statewiseSquaredLoss L t T s :
∑ x, kernelMass L s x * (T x - t s x) ^ 2
Causalean.Stat.statewiseSquaredLoss · Causalean/Stat/Minimax/FinitePosteriorBayesRisk.lean:310
theorem finiteDesignBayesRisk_statewiseSquaredLoss reviewed
Causalean.Stat

The real-valued finite-design Bayes-risk infimum for observation-dependent squared loss is exactly the posterior residual risk.

Formal statement
S :
Type u_1
shared
X :
Type u_2
shared
ν :
L :
Kernel S X
t :
S → X → ℝ
= posteriorResidual ν L t
Proof (Lean source)
theorem finiteDesignBayesRisk_statewiseSquaredLoss (ν : FiniteDesign S) (L : Kernel S X) (t : S → X → ℝ) : finiteDesignBayesRisk ν (statewiseSquaredLoss L t) = posteriorResidual ν L t := by -- Unfold the generic Bayes risk, rewrite each design expectation as `squaredRisk`, and apply -- `iInf_squaredRisk_eq_posteriorResidual`. simp only [finiteDesignBayesRisk, finiteDesign_expectedLoss_statewiseSquaredLoss] exact iInf_squaredRisk_eq_posteriorResidual ν L t
theorem realBayesRisk_statewiseSquaredLoss_eq_posteriorResidual reviewed
Causalean.Stat

The real Bayes risk of continuously mixed finite-state squared loss equals the posterior residual risk computed from the induced finite design.

Formal statement
Θ :
Type u_3
shared
S :
Type u_4
shared
X :
Type u_5
shared
L :
Kernel S X
t :
S → X → ℝ
= posteriorResidual (inducedFiniteDesign π K) L t
Proof (Lean source)
24 supporting declarations (lemmas, instances)
Fuzzy­Hypotheses 5 core · 3 supporting This module converts target concentration under two priors and total-variation closeness of their predictive mixtures into estimator-wise, worst-case, and minimax squared-risk bounds. ★ twoFuzzyHypotheses_minimax_lower_standard

Squared-loss lower bounds from two fuzzy hypotheses

This module converts target concentration under two priors and total-variation closeness of their predictive mixtures into estimator-wise, worst-case, and minimax squared-risk bounds. Risks use ℝ≥0∞ lower integrals, so arbitrary measurable estimators require no artificial integrability or boundedness assumptions.

def squaredRisk reviewed
Causalean.Stat.Minimax.FuzzyHypotheses

Given an experiment kernel, a real-valued target, an estimator, and a parameter value, the squared risk is the expected squared estimation error under the experiment law at that parameter, represented as a nonnegative lower integral.

Definition (Lean source)
Θ :
Type u_1
shared
X :
Type u_2
shared
K :
Kernel Θ X
target :
Θ → ℝ
estimator :
X → ℝ
θ :
Θ
squaredRisk K target estimator θ :
ℝ≥0∞
∫⁻ x, ofReal ((estimator x - target θ) ^ 2) ∂K θ
Causalean.Stat.Minimax.FuzzyHypotheses.squaredRisk · Causalean/Stat/Minimax/FuzzyHypotheses.lean:21
def bayesSquaredRisk reviewed
Causalean.Stat.Minimax.FuzzyHypotheses

Given a prior, an experiment kernel, a real-valued target, and an estimator, the Bayes squared risk averages parameterwise squared risk against the prior.

Definition (Lean source)
Θ :
Type u_1
shared
X :
Type u_2
shared
π :
K :
Kernel Θ X
target :
Θ → ℝ
estimator :
X → ℝ
bayesSquaredRisk π K target estimator :
ℝ≥0∞
∫⁻ θ, squaredRisk K target estimator θ ∂π
Causalean.Stat.Minimax.FuzzyHypotheses.bayesSquaredRisk · Causalean/Stat/Minimax/FuzzyHypotheses.lean:28
def worstCaseSquaredRisk reviewed
Causalean.Stat.Minimax.FuzzyHypotheses

Given an experiment kernel, a real-valued target, and an estimator, the worst-case squared risk is the supremum of parameterwise risk over the model's parameter class.

Definition (Lean source)
Θ :
Type u_1
shared
X :
Type u_2
shared
K :
Kernel Θ X
target :
Θ → ℝ
estimator :
X → ℝ
worstCaseSquaredRisk K target estimator :
ℝ≥0∞
⨆ θ, squaredRisk K target estimator θ
Causalean.Stat.Minimax.FuzzyHypotheses.worstCaseSquaredRisk · Causalean/Stat/Minimax/FuzzyHypotheses.lean:35
def minimaxSquaredRisk reviewed
Causalean.Stat.Minimax.FuzzyHypotheses

Given an experiment kernel and a real-valued target, the measurable-estimator minimax squared risk is the infimum of worst-case risk over all measurable real-valued estimators.

Definition (Lean source)
Θ :
Type u_1
shared
X :
Type u_2
shared
K :
Kernel Θ X
target :
Θ → ℝ
minimaxSquaredRisk K target :
ℝ≥0∞
⨅ estimator : {f : X → ℝ // Measurable f}, worstCaseSquaredRisk K target estimator.1
Causalean.Stat.Minimax.FuzzyHypotheses.minimaxSquaredRisk · Causalean/Stat/Minimax/FuzzyHypotheses.lean:42
theorem twoFuzzyHypotheses_minimax_lower_standard reviewed
Causalean.Stat.Minimax.FuzzyHypotheses

Given two probability priors, a probability experiment kernel, a measurable real-valued target, two target centers, and a positive center separation, if the centers have at least that separation, each prior puts at most one eighth of its mass beyond one quarter of the separation from its center, and the predictive mixtures are within one sixteenth in total variation, then the minimax squared risk over all measurable estimators is at least eleven times the squared separation divided by 512.

Formal statement
Θ :
Type u_1
shared
X :
Type u_2
shared
π0 π1 :
K :
Kernel Θ X
target :
Θ → ℝ
hK :
∀ θ, IsProbabilityMeasure (K θ)
htarget :
Measurable target
center0 center1 Delta :
hDelta :
0 < Delta
hsep :
Delta ≤ center1 - center0
hmass0 :
π0.real {θ | Delta / 4 < |target θ - center0|} ≤ 1 / 8
hmass1 :
π1.real {θ | Delta / 4 < |target θ - center1|} ≤ 1 / 8
htv :
≤ 1 / 16
ofReal (11 * Delta ^ 2 / 512) ≤ minimaxSquaredRisk K target
Proof (Lean source)
theorem twoFuzzyHypotheses_minimax_lower_standard (π0 π1 : Measure Θ) (K : Kernel Θ X) (target : Θ → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (htarget : Measurable target) (center0 center1 Delta : ℝ) (hDelta : 0 < Delta) (hsep : Delta ≤ center1 - center0) (hmass0 : π0.real {θ | Delta / 4 < |target θ - center0|} ≤ 1 / 8) (hmass1 : π1.real {θ | Delta / 4 < |target θ - center1|} ≤ 1 / 8) (htv : tvDist (priorPredictive π0 K) (priorPredictive π1 K) ≤ 1 / 16) : ofReal (11 * Delta ^ 2 / 512) ≤ minimaxSquaredRisk K target := by unfold minimaxSquaredRisk apply le_iInf intro estimator exact twoFuzzyHypotheses_worstCase_lower_standard π0 π1 K target hK estimator.1 estimator.2 htarget center0 center1 Delta hDelta hsep hmass0 hmass1 htv
Causalean.Stat.Minimax.FuzzyHypotheses.twoFuzzyHypotheses_minimax_lower_standard · Causalean/Stat/Minimax/FuzzyHypotheses.lean:267 · uses minimaxSquaredRisk , priorPredictive , tvDist
3 supporting declarations (lemmas, instances)
  • twoFuzzyHypotheses_bayesRisk_lower theorem — Given two probability priors, a probability experiment kernel, a measurable real-valued target, a measurable estimator, two target centers, a nonnegative center separation, a nonnegative concentration radius smaller than half the separation, the stated separation of the centers, nonnegative prior-tail bounds, and a nonnegative predictive-distance bound, if the first prior concentrates around its center, the second prior concentrates around its center, and the predictive mixtures satisfy the distance bound, then the larger Bayes squared risk is at least half the squared residual separation times one minus the three error terms.
    Θ :
    Type u_1
    shared
    X :
    Type u_2
    shared
    π0 π1 :
    K :
    Kernel Θ X
    target :
    Θ → ℝ
    hK :
    ∀ θ, IsProbabilityMeasure (K θ)
    estimator :
    X → ℝ
    hestimator :
    Measurable estimator
    htarget :
    Measurable target
    center0 center1 Delta r alpha0 alpha1 beta :
    hDelta :
    0 ≤ Delta
    hr :
    0 ≤ r
    hrhalf :
    r < Delta / 2
    hsep :
    Delta ≤ center1 - center0
    halpha0 :
    0 ≤ alpha0
    halpha1 :
    0 ≤ alpha1
    hbeta :
    0 ≤ beta
    hmass0 :
    π0.real {θ | r < |target θ - center0|} ≤ alpha0
    hmass1 :
    π1.real {θ | r < |target θ - center1|} ≤ alpha1
    htv :
    ≤ beta
    ofReal (((Delta / 2 - r) ^ 2 * (1 - beta - alpha0 - alpha1)) / 2)
    max (bayesSquaredRisk π0 K target estimator) (bayesSquaredRisk π1 K target estimator)
    Proof (Lean source)
    theorem twoFuzzyHypotheses_bayesRisk_lower (π0 π1 : Measure Θ) (K : Kernel Θ X) (target : Θ → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (estimator : X → ℝ) (hestimator : Measurable estimator) (htarget : Measurable target) (center0 center1 Delta r alpha0 alpha1 beta : ℝ) (hDelta : 0 ≤ Delta) (hr : 0 ≤ r) (hrhalf : r < Delta / 2) (hsep : Delta ≤ center1 - center0) (halpha0 : 0 ≤ alpha0) (halpha1 : 0 ≤ alpha1) (hbeta : 0 ≤ beta) (hmass0 : π0.real {θ | r < |target θ - center0|} ≤ alpha0) (hmass1 : π1.real {θ | r < |target θ - center1|} ≤ alpha1) (htv : tvDist (priorPredictive π0 K) (priorPredictive π1 K) ≤ beta) : ofReal (((Delta / 2 - r) ^ 2 * (1 - beta - alpha0 - alpha1)) / 2) ≤ max (bayesSquaredRisk π0 K target estimator) (bayesSquaredRisk π1 K target estimator) := by let midpoint := (center0 + center1) / 2 let A : Set X := {x | midpoint ≤ estimator x} let B0 : Set Θ := {θ | r < |target θ - center0|} let B1 : Set Θ := {θ | r < |target θ - center1|} let c : ℝ≥0∞ := ofReal ((Delta / 2 - r) ^ 2) let R0 := bayesSquaredRisk π0 K target estimator let R1 := bayesSquaredRisk π1 K target estimator have hA : MeasurableSet A := by dsimp [A, midpoint] exact measurableSet_le measurable_const hestimator have hB0 : MeasurableSet B0 := by dsimp [B0] exact measurableSet_lt measurable_const (continuous_abs.measurable.comp (htarget.sub measurable_const)) have hB1 : MeasurableSet B1 := by dsimp [B1] exact measurableSet_lt measurable_const (continuous_abs.measurable.comp (htarget.sub measurable_const)) letI : IsProbabilityMeasure (priorPredictive π0 K) := Causalean.Stat.Minimax.MomentMatchedMixture.priorPredictive_isProbability π0 K hK letI : IsProbabilityMeasure (priorPredictive π1 K) := Causalean.Stat.Minimax.MomentMatchedMixture.priorPredictive_isProbability π1 K hK have hpoint0 (θ : Θ) : c * K θ A ≤ squaredRisk K target estimator θ + B0.indicator (fun _ => c) θ := by by_cases hθ : θ ∈ B0 · rw [Set.indicator_of_mem hθ] letI : IsProbabilityMeasure (K θ) := hK θ have hKA : K θ A ≤ 1 := by calc K θ A ≤ K θ univ := measure_mono (Set.subset_univ A) _ = 1 := measure_univ calc c * K θ A ≤ c := by simpa only [mul_one] using (mul_le_mul (le_refl c) hKA bot_le bot_le) _ ≤ squaredRisk K target estimator θ + c := by simp · have hgood : |target θ - center0| ≤ r := by simpa [B0, not_lt] using hθ have hdom : ∀ x ∈ A, (Delta / 2 - r) ^ 2 ≤ (estimator x - target θ) ^ 2 := by intro x hx have hx' : midpoint ≤ estimator x := hx have ht : target θ ≤ center0 + r := by linarith [(abs_le.mp hgood).2] have hd : 0 < Delta / 2 - r := sub_pos.mpr hrhalf dsimp [midpoint] at hx' nlinarith have hnot : θ ∉ B0 := hθ simp only [Set.indicator_of_notMem hnot, add_zero] unfold squaredRisk calc c * K θ A = ∫⁻ x, A.indicator (fun _ => c) x ∂K θ := by simp [hA] _ ≤ ∫⁻ x, ofReal ((estimator x - target θ) ^ 2) ∂K θ := by apply lintegral_mono intro x by_cases hx : x ∈ A · simp only [Set.indicator_of_mem hx] exact ENNReal.ofReal_le_ofReal (hdom x hx) · simp [Set.indicator_of_notMem hx] have hpoint1 (θ : Θ) : c * K θ Aᶜ ≤ squaredRisk K target estimator θ + B1.indicator (fun _ => c) θ := by by_cases hθ : θ ∈ B1 · rw [Set.indicator_of_mem hθ] letI : IsProbabilityMeasure (K θ) := hK θ have hKA : K θ Aᶜ ≤ 1 := by calc K θ Aᶜ ≤ K θ univ := measure_mono (Set.subset_univ Aᶜ) _ = 1 := measure_univ calc c * K θ Aᶜ ≤ c := by simpa only [mul_one] using (mul_le_mul (le_refl c) hKA bot_le bot_le) _ ≤ squaredRisk K target estimator θ + c := by simp · have hgood : |target θ - center1| ≤ r := by simpa [B1, not_lt] using hθ have hdom : ∀ x ∈ Aᶜ, (Delta / 2 - r) ^ 2 ≤ (estimator x - target θ) ^ 2 := by intro x hx have hx' : estimator x < midpoint := by simpa [A] using hx have ht : center1 - r ≤ target θ := by have := (abs_le.mp hgood).1 linarith have hd : 0 < Delta / 2 - r := sub_pos.mpr hrhalf dsimp [midpoint] at hx' nlinarith have hnot : θ ∉ B1 := hθ simp only [Set.indicator_of_notMem hnot, add_zero] unfold squaredRisk calc c * K θ Aᶜ = ∫⁻ x, Aᶜ.indicator (fun _ => c) x ∂K θ := by simp [hA.compl] _ ≤ ∫⁻ x, ofReal ((estimator x - target θ) ^ 2) ∂K θ := by apply lintegral_mono intro x by_cases hx : x ∈ Aᶜ · simp only [Set.indicator_of_mem hx] exact ENNReal.ofReal_le_ofReal (hdom x hx) · simp [Set.indicator_of_notMem hx] have hmaster0 : c * priorPredictive π0 K A ≤ R0 + c * π0 B0 := by calc c * priorPredictive π0 K A = ∫⁻ θ, c * K θ A ∂π0 := by rw [lintegral_const_mul'' c ((Kernel.measurable_coe K hA).aemeasurable)] rw [← priorPredictive_apply π0 K hA] _ ≤ ∫⁻ θ, (squaredRisk K target estimator θ + B0.indicator (fun _ => c) θ) ∂π0 := lintegral_mono hpoint0 _ = R0 + c * π0 B0 := by rw [lintegral_add_right _ (measurable_const.indicator hB0)] simp [R0, bayesSquaredRisk, hB0] have hmaster1 : c * priorPredictive π1 K Aᶜ ≤ R1 + c * π1 B1 := by calc c * priorPredictive π1 K Aᶜ = ∫⁻ θ, c * K θ Aᶜ ∂π1 := by rw [lintegral_const_mul'' c ((Kernel.measurable_coe K hA.compl).aemeasurable)] rw [← priorPredictive_apply π1 K hA.compl] _ ≤ ∫⁻ θ, (squaredRisk K target estimator θ + B1.indicator (fun _ => c) θ) ∂π1 := lintegral_mono hpoint1 _ = R1 + c * π1 B1 := by rw [lintegral_add_right _ (measurable_const.indicator hB1)] simp [R1, bayesSquaredRisk, hB1] have htest := one_sub_tvDist_le_test (μ := priorPredictive π0 K) (ν := priorPredictive π1 K) hA have herr : 1 - beta ≤ (priorPredictive π0 K).real A + (priorPredictive π1 K).real Aᶜ := by linarith by_cases hR : max R0 R1 = ∞ · simp [R0, R1, hR] have hR0 : R0 ≠ ∞ := fun h => hR (by simp [h]) have hR1 : R1 ≠ ∞ := fun h => hR (by simp [h]) have hc : c ≠ ∞ := by simp [c] have hcbad0 : c * π0 B0 ≠ ∞ := ENNReal.mul_ne_top hc (measure_ne_top π0 B0) have hcbad1 : c * π1 B1 ≠ ∞ := ENNReal.mul_ne_top hc (measure_ne_top π1 B1) have hmaster0Real := ENNReal.toReal_mono (ENNReal.add_ne_top.mpr ⟨hR0, hcbad0⟩) hmaster0 have hmaster1Real := ENNReal.toReal_mono (ENNReal.add_ne_top.mpr ⟨hR1, hcbad1⟩) hmaster1 rw [ENNReal.toReal_mul, ENNReal.toReal_add hR0 hcbad0, ENNReal.toReal_mul, ← measureReal_def, ← measureReal_def] at hmaster0Real rw [ENNReal.toReal_mul, ENNReal.toReal_add hR1 hcbad1, ENNReal.toReal_mul, ← measureReal_def, ← measureReal_def] at hmaster1Real have hcReal : c.toReal = (Delta / 2 - r) ^ 2 := by simp [c, ENNReal.toReal_ofReal (sq_nonneg _)] have hR0max : R0.toReal ≤ (max R0 R1).toReal := ENNReal.toReal_mono hR (le_max_left _ _) have hR1max : R1.toReal ≤ (max R0 R1).toReal := ENNReal.toReal_mono hR (le_max_right _ _) rw [ENNReal.ofReal_le_iff_le_toReal hR] rw [hcReal] at hmaster0Real hmaster1Real nlinarith [sq_nonneg (Delta / 2 - r)]
    Causalean.Stat.Minimax.FuzzyHypotheses.twoFuzzyHypotheses_bayesRisk_lower · Causalean/Stat/Minimax/FuzzyHypotheses.lean:48
  • bayesSquaredRisk_le_worstCase theorem — Given a probability prior, an experiment kernel, a real-valued target, and an estimator, Bayes squared risk is at most worst-case squared risk over the parameter class.
    Θ :
    Type u_1
    shared
    X :
    Type u_2
    shared
    π :
    K :
    Kernel Θ X
    target :
    Θ → ℝ
    estimator :
    X → ℝ
    bayesSquaredRisk π K target estimator ≤ worstCaseSquaredRisk K target estimator
    Proof (Lean source)
    theorem bayesSquaredRisk_le_worstCase (π : Measure Θ) (K : Kernel Θ X) (target : Θ → ℝ) (estimator : X → ℝ) [IsProbabilityMeasure π] : bayesSquaredRisk π K target estimator ≤ worstCaseSquaredRisk K target estimator := by unfold bayesSquaredRisk worstCaseSquaredRisk apply lintegral_le_const filter_upwards with θ exact le_iSup (fun θ => squaredRisk K target estimator θ) θ
    Causalean.Stat.Minimax.FuzzyHypotheses.bayesSquaredRisk_le_worstCase · Causalean/Stat/Minimax/FuzzyHypotheses.lean:224
  • twoFuzzyHypotheses_worstCase_lower_standard theorem — Given two probability priors, a probability experiment kernel, a measurable real-valued target, a measurable estimator, two target centers, and a positive center separation, if the centers have at least that separation, each prior puts at most one eighth of its mass beyond one quarter of the separation from its center, and the predictive mixtures are within one sixteenth in total variation, then the estimator's worst-case squared risk is at least eleven times the squared separation divided by 512.
    Θ :
    Type u_1
    shared
    X :
    Type u_2
    shared
    π0 π1 :
    K :
    Kernel Θ X
    target :
    Θ → ℝ
    hK :
    ∀ θ, IsProbabilityMeasure (K θ)
    estimator :
    X → ℝ
    hestimator :
    Measurable estimator
    htarget :
    Measurable target
    center0 center1 Delta :
    hDelta :
    0 < Delta
    hsep :
    Delta ≤ center1 - center0
    hmass0 :
    π0.real {θ | Delta / 4 < |target θ - center0|} ≤ 1 / 8
    hmass1 :
    π1.real {θ | Delta / 4 < |target θ - center1|} ≤ 1 / 8
    htv :
    ≤ 1 / 16
    ofReal (11 * Delta ^ 2 / 512) ≤ worstCaseSquaredRisk K target estimator
    Proof (Lean source)
    theorem twoFuzzyHypotheses_worstCase_lower_standard (π0 π1 : Measure Θ) (K : Kernel Θ X) (target : Θ → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (estimator : X → ℝ) (hestimator : Measurable estimator) (htarget : Measurable target) (center0 center1 Delta : ℝ) (hDelta : 0 < Delta) (hsep : Delta ≤ center1 - center0) (hmass0 : π0.real {θ | Delta / 4 < |target θ - center0|} ≤ 1 / 8) (hmass1 : π1.real {θ | Delta / 4 < |target θ - center1|} ≤ 1 / 8) (htv : tvDist (priorPredictive π0 K) (priorPredictive π1 K) ≤ 1 / 16) : ofReal (11 * Delta ^ 2 / 512) ≤ worstCaseSquaredRisk K target estimator := by have hbayes := twoFuzzyHypotheses_bayesRisk_lower π0 π1 K target hK estimator hestimator htarget center0 center1 Delta (Delta / 4) (1 / 8) (1 / 8) (1 / 16) (le_of_lt hDelta) (by positivity) (by linarith) hsep (by norm_num) (by norm_num) (by norm_num) hmass0 hmass1 htv have hconstant : (((Delta / 2 - Delta / 4) ^ 2 * (1 - (1 / 16 : ℝ) - 1 / 8 - 1 / 8)) / 2) = 11 * Delta ^ 2 / 512 := by ring rw [hconstant] at hbayes exact hbayes.trans (max_le (bayesSquaredRisk_le_worstCase π0 K target estimator) (bayesSquaredRisk_le_worstCase π1 K target estimator))
    Causalean.Stat.Minimax.FuzzyHypotheses.twoFuzzyHypotheses_worstCase_lower_standard · Causalean/Stat/Minimax/FuzzyHypotheses.lean:236
Hellinger­Affinity 3 core · 3 supporting This file develops the Hellinger/Bhattacharyya affinity of two nonnegative densities taken against a single dominating measure, its identity with the squared Hellinger distance, the Cauchy–Schwarz bound of total variatio ★ tvDist_le_sqrt_two_mul_one_sub_affinity

Hellinger Affinity for Common-Measure Densities

This file develops the Hellinger/Bhattacharyya affinity of two nonnegative densities taken against a single dominating measure, its identity with the squared Hellinger distance, the Cauchy–Schwarz bound of total variation by the affinity defect, and the tensorization of affinity over finite products. These are the ingredients of a product-construction Le Cam two-point (or multi-point) lower bound.

def densityAffinity reviewed
Causalean.Stat

Given a measurable sample space, a measure on that space, and two real-valued functions on it, the Hellinger--Bhattacharyya affinity of the functions relative to the measure is the integral of the square root of their pointwise product.

Definition (Lean source)
α :
μ :
f g :
α → ℝ
densityAffinity μ f g :
∫ x, sqrt (f x * g x) ∂μ
Causalean.Stat.densityAffinity · Causalean/Stat/Minimax/HellingerAffinity.lean:54
def hellingerSqDensity reviewed
Causalean.Stat

Given a measurable sample space, a measure on that space, and two real-valued functions on it, the unhalved squared Hellinger discrepancy relative to the measure is the integral of the squared difference between their pointwise square roots.

Definition (Lean source)
α :
μ :
f g :
α → ℝ
hellingerSqDensity μ f g :
∫ x, (sqrt (f x) - sqrt (g x)) ^ 2 ∂μ
Causalean.Stat.hellingerSqDensity · Causalean/Stat/Minimax/HellingerAffinity.lean:65
lemma tvDist_le_sqrt_two_mul_one_sub_affinity reviewed
Causalean.Stat

Cauchy–Schwarz on the Hellinger affinity. For a dominating measure μ and functions f, g such that f is μ-integrable, g is μ-integrable, f is pointwise nonnegative, g is pointwise nonnegative, f integrates to 1 against μ, and g integrates to 1 against μ — so that f dμ and g dμ are probability densities — the total variation distance between the two weighted laws is at most the square root of twice the affinity defect, √(2(1 − densityAffinity μ f g)). This is the Cauchy–Schwarz half of the standard total-variation–Hellinger comparison, and it is what converts an affinity computation into a Le Cam two-point bound.

Formal statement
α :
μ :
f g :
α → ℝ
hf :
hg :
hf0 :
0 ≤ f
hg0 :
0 ≤ g
hf1 :
∫ x, f x ∂μ = 1
hg1 :
∫ x, g x ∂μ = 1
tvDist (μ.withDensity (fun x => ofReal (f x))) (μ.withDensity (fun x => ofReal (g x)))
sqrt (2 * (1 - densityAffinity μ f g))
Proof (Lean source)
lemma tvDist_le_sqrt_two_mul_one_sub_affinity {α : Type*} [MeasurableSpace α] (μ : Measure α) (f g : α → ℝ) (hf : Integrable f μ) (hg : Integrable g μ) (hf0 : 0 ≤ f) (hg0 : 0 ≤ g) (hf1 : ∫ x, f x ∂μ = 1) (hg1 : ∫ x, g x ∂μ = 1) : tvDist (μ.withDensity (fun x => ofReal (f x))) (μ.withDensity (fun x => ofReal (g x))) ≤ sqrt (2 * (1 - densityAffinity μ f g)) := by let P := μ.withDensity (fun x => ofReal (f x)) let Q := μ.withDensity (fun x => ofReal (g x)) have hreal_f {A : Set α} (hA : MeasurableSet A) : P.real A = ∫ x in A, f x ∂μ := by rw [measureReal_def, withDensity_apply _ hA] rw [← MeasureTheory.ofReal_integral_eq_lintegral_ofReal hf.integrableOn] · rw [ENNReal.toReal_ofReal] exact integral_nonneg_of_ae (Filter.Eventually.of_forall fun x => hf0 x) · exact Filter.Eventually.of_forall fun x => hf0 x have hreal_g {A : Set α} (hA : MeasurableSet A) : Q.real A = ∫ x in A, g x ∂μ := by rw [measureReal_def, withDensity_apply _ hA] rw [← MeasureTheory.ofReal_integral_eq_lintegral_ofReal hg.integrableOn] · rw [ENNReal.toReal_ofReal] exact integral_nonneg_of_ae (Filter.Eventually.of_forall fun x => hg0 x) · exact Filter.Eventually.of_forall fun x => hg0 x have hfg : Integrable (fun x => f x - g x) μ := hf.sub hg have hfg0 : ∫ x, (f x - g x) ∂μ = 0 := by integral_linearity rw [hf1, hg1] ring have htv : tvDist P Q ≤ (1 / 2 : ℝ) * ∫ x, |f x - g x| ∂μ := by unfold tvDist refine ciSup_le fun A => ?_ rw [hreal_f A.2, hreal_g A.2, ← integral_sub hf.integrableOn hg.integrableOn] exact abs_setIntegral_le_half_integral_abs_of_integral_eq_zero hfg hfg0 A.2 have hsf_asm : AEStronglyMeasurable (fun x => sqrt (f x)) μ := (Real.continuous_sqrt.measurable.comp_aemeasurable hf.aestronglyMeasurable.aemeasurable).aestronglyMeasurable have hsg_asm : AEStronglyMeasurable (fun x => sqrt (g x)) μ := (Real.continuous_sqrt.measurable.comp_aemeasurable hg.aestronglyMeasurable.aemeasurable).aestronglyMeasurable have hsf : MemLp (fun x => sqrt (f x)) 2 μ := by rw [memLp_two_iff_integrable_sq hsf_asm] convert hf using 1 funext x exact Real.sq_sqrt (hf0 x) have hsg : MemLp (fun x => sqrt (g x)) 2 μ := by rw [memLp_two_iff_integrable_sq hsg_asm] convert hg using 1 funext x exact Real.sq_sqrt (hg0 x) let u : α → ℝ := fun x => sqrt (f x) - sqrt (g x) let v : α → ℝ := fun x => sqrt (f x) + sqrt (g x) have hu : MemLp u 2 μ := hsf.sub hsg have hv : MemLp v 2 μ := hsf.add hsg have hfact : ∀ x, |f x - g x| = |u x| * |v x| := by intro x rw [← abs_mul] dsimp [u, v] rw [show (sqrt (f x) - sqrt (g x)) * (sqrt (f x) + sqrt (g x)) = sqrt (f x) ^ 2 - sqrt (g x) ^ 2 by ring] simp only [Real.sq_sqrt (hf0 x), Real.sq_sqrt (hg0 x)] have hholder : ∫ x, |u x| * |v x| ∂μ ≤ (∫ x, |u x| ^ (2 : ℝ) ∂μ) ^ (1 / (2 : ℝ)) * (∫ x, |v x| ^ (2 : ℝ) ∂μ) ^ (1 / (2 : ℝ)) := by apply integral_mul_le_Lp_mul_Lq_of_nonneg (p := (2 : ℝ)) (q := (2 : ℝ)) · exact Real.HolderConjugate.two_two · exact Filter.Eventually.of_forall fun x => abs_nonneg _ · exact Filter.Eventually.of_forall fun x => abs_nonneg _ · rw [show (ofReal 2 : ℝ≥0∞) = 2 from by norm_num] exact hu.abs · rw [show (ofReal 2 : ℝ≥0∞) = 2 from by norm_num] exact hv.abs have hsfg : Integrable (fun x => sqrt (f x) * sqrt (g x)) μ := hsf.integrable_mul hsg have hu_sq : ∫ x, |u x| ^ (2 : ℝ) ∂μ = 2 * (1 - densityAffinity μ f g) := by simp_rw [Real.rpow_two, sq_abs] have hpoint : (fun x => u x ^ 2) = (fun x => f x + g x - 2 * sqrt (f x * g x)) := by funext x dsimp [u] rw [show sqrt (f x * g x) = sqrt (f x) * sqrt (g x) by rw [Real.sqrt_mul (hf0 x)]] nlinarith [Real.sq_sqrt (hf0 x), Real.sq_sqrt (hg0 x)] rw [hpoint] have hsqrtfg : Integrable (fun x => sqrt (f x * g x)) μ := by convert hsfg using 1 funext x rw [Real.sqrt_mul (hf0 x)] change ∫ x, (f + g) x - (2 * (fun x => sqrt (f x * g x)) x) ∂μ = 2 * (1 - densityAffinity μ f g) rw [integral_sub (hf.add hg) (hsqrtfg.const_mul 2)] change (∫ x, f x + g x ∂μ) - ∫ x, 2 * sqrt (f x * g x) ∂μ = 2 * (1 - densityAffinity μ f g) rw [integral_add hf hg, integral_const_mul, hf1, hg1] simp [densityAffinity] ring have hv_sq_plain : ∫ x, v x ^ 2 ∂μ ≤ 4 := by calc ∫ x, v x ^ 2 ∂μ ≤ ∫ x, (2 * f x + 2 * g x) ∂μ := by apply integral_mono_ae hv.integrable_sq ((hf.const_mul 2).add (hg.const_mul 2)) exact Filter.Eventually.of_forall fun x => by dsimp [v] have hsf0 := Real.sqrt_nonneg (f x) have hsg0 := Real.sqrt_nonneg (g x) nlinarith [Real.sq_sqrt (hf0 x), Real.sq_sqrt (hg0 x), sq_nonneg (sqrt (f x) - sqrt (g x))] _ = 4 := by rw [integral_add (hf.const_mul 2) (hg.const_mul 2), integral_const_mul, integral_const_mul, hf1, hg1] ring have hv_sq : ∫ x, |v x| ^ (2 : ℝ) ∂μ ≤ 4 := by simpa [Real.rpow_two, sq_abs] using hv_sq_plain have hu_sq_nonneg : 0 ≤ 2 * (1 - densityAffinity μ f g) := by rw [← hu_sq] exact integral_nonneg_of_ae (Filter.Eventually.of_forall fun x => by positivity) exact htv.trans (by rw [show (fun x => |f x - g x|) = (fun x => |u x| * |v x|) by funext x; exact hfact x] calc (1 / 2 : ℝ) * ∫ x, |u x| * |v x| ∂μ ≤ (1 / 2 : ℝ) * ((∫ x, |u x| ^ (2 : ℝ) ∂μ) ^ (1 / (2 : ℝ)) * (∫ x, |v x| ^ (2 : ℝ) ∂μ) ^ (1 / (2 : ℝ))) := by gcongr _ ≤ sqrt (2 * (1 - densityAffinity μ f g)) := by rw [hu_sq, ← Real.sqrt_eq_rpow] have hv_sq_nonneg : 0 ≤ ∫ x, |v x| ^ (2 : ℝ) ∂μ := integral_nonneg_of_ae (Filter.Eventually.of_forall fun x => by positivity) rw [← Real.sqrt_eq_rpow] have hsqrtv : sqrt (∫ x, |v x| ^ (2 : ℝ) ∂μ) ≤ 2 := by rw [Real.sqrt_le_iff] norm_num simpa [Real.rpow_two, sq_abs] using hv_sq nlinarith [Real.sqrt_nonneg (2 * (1 - densityAffinity μ f g))])
Causalean.Stat.tvDist_le_sqrt_two_mul_one_sub_affinity · Causalean/Stat/Minimax/HellingerAffinity.lean:125 · uses densityAffinity , tvDist
3 supporting declarations (lemmas, instances)
  • hellingerSqDensity_eq_two_mul_one_sub_affinity lemma — For two integrable nonnegative densities that each integrate to one, the unhalved squared Hellinger distance is exactly twice the affinity defect, i.e. twice one minus the affinity. This is the algebraic identity that lets an affinity computation be read as a Hellinger distance and back.
    α :
    μ :
    f g :
    α → ℝ
    hf :
    hg :
    hf0 :
    0 ≤ f
    hg0 :
    0 ≤ g
    hf1 :
    ∫ x, f x ∂μ = 1
    hg1 :
    ∫ x, g x ∂μ = 1
    hellingerSqDensity μ f g = 2 * (1 - densityAffinity μ f g)
    Proof (Lean source)
    lemma hellingerSqDensity_eq_two_mul_one_sub_affinity {α : Type*} [MeasurableSpace α] (μ : Measure α) (f g : α → ℝ) (hf : Integrable f μ) (hg : Integrable g μ) (hf0 : 0 ≤ f) (hg0 : 0 ≤ g) (hf1 : ∫ x, f x ∂μ = 1) (hg1 : ∫ x, g x ∂μ = 1) : hellingerSqDensity μ f g = 2 * (1 - densityAffinity μ f g) := by have hsf_asm : AEStronglyMeasurable (fun x => sqrt (f x)) μ := (Real.continuous_sqrt.measurable.comp_aemeasurable hf.aestronglyMeasurable.aemeasurable).aestronglyMeasurable have hsg_asm : AEStronglyMeasurable (fun x => sqrt (g x)) μ := (Real.continuous_sqrt.measurable.comp_aemeasurable hg.aestronglyMeasurable.aemeasurable).aestronglyMeasurable have hsf : MemLp (fun x => sqrt (f x)) 2 μ := by rw [memLp_two_iff_integrable_sq hsf_asm] convert hf using 1 funext x exact Real.sq_sqrt (hf0 x) have hsg : MemLp (fun x => sqrt (g x)) 2 μ := by rw [memLp_two_iff_integrable_sq hsg_asm] convert hg using 1 funext x exact Real.sq_sqrt (hg0 x) have hcross : Integrable (fun x => sqrt (f x * g x)) μ := by convert hsf.integrable_mul hsg using 1 funext x simp only [Pi.mul_apply] rw [Real.sqrt_mul (hf0 x)] unfold hellingerSqDensity densityAffinity rw [show (fun x => (sqrt (f x) - sqrt (g x)) ^ 2) = (fun x => f x + g x - 2 * sqrt (f x * g x)) by funext x rw [Real.sqrt_mul (hf0 x)] nlinarith [Real.sq_sqrt (hf0 x), Real.sq_sqrt (hg0 x)]] change ∫ x, (f + g) x - 2 * sqrt (f x * g x) ∂μ = 2 * (1 - ∫ x, sqrt (f x * g x) ∂μ) rw [integral_sub (hf.add hg) (hcross.const_mul 2), show (∫ x, (f + g) x ∂μ) = ∫ x, f x + g x ∂μ by rfl, integral_add hf hg, integral_const_mul, hf1, hg1] ring
    Causalean.Stat.hellingerSqDensity_eq_two_mul_one_sub_affinity · Causalean/Stat/Minimax/HellingerAffinity.lean:75
  • one_sub_prod_le_sum lemma — For finitely many numbers in the unit interval, the amount by which their product falls short of one is at most the total shortfall of the individual factors. Applied to coordinate affinities this is the union-bound step that turns a tensorized affinity into a sum of coordinate defects.
    ι :
    Type*
    a :
    ι → ℝ
    ha0 :
    ∀ i, 0 ≤ a i
    ha1 :
    ∀ i, a i ≤ 1
    1 - ∏ i, a i ≤ ∑ i, (1 - a i)
    Proof (Lean source)
    lemma one_sub_prod_le_sum {ι : Type*} [Fintype ι] (a : ι → ℝ) (ha0 : ∀ i, 0 ≤ a i) (ha1 : ∀ i, a i ≤ 1) : 1 - ∏ i, a i ≤ ∑ i, (1 - a i) := by classical have hbounds (s : Finset ι) : 0 ≤ ∏ i ∈ s, a i ∧ ∏ i ∈ s, a i ≤ 1 := by induction s using Finset.induction_on with | empty => simp | @insert i s hi ih => rw [Finset.prod_insert hi] constructor <;> nlinarith [ha0 i, ha1 i, ih.1, ih.2] have hprod (s : Finset ι) : 1 - ∏ i ∈ s, a i ≤ ∑ i ∈ s, (1 - a i) := by induction s using Finset.induction_on with | empty => simp | @insert i s hi ih => rw [Finset.prod_insert hi, Finset.sum_insert hi] have hP0 : 0 ≤ ∏ j ∈ s, a j := (hbounds s).1 have hP1 : ∏ j ∈ s, a j ≤ 1 := (hbounds s).2 have hsum0 : 0 ≤ ∑ j ∈ s, (1 - a j) := by exact sum_nonneg fun j _ => sub_nonneg.mpr (ha1 j) nlinarith [ha0 i, ha1 i] simpa using hprod univ
    Causalean.Stat.one_sub_prod_le_sum · Causalean/Stat/Minimax/HellingerAffinity.lean:298
  • densityAffinity_pi lemma — Affinity tensorizes. On a finite product of σ-finite measure spaces, the affinity of two densities that each factor coordinatewise is the product of the coordinate affinities. This is what makes an n-fold product construction tractable: a single coordinate defect computation is enough.
    ι :
    Type*
    ι → Type*
    ∀ i, MeasurableSpace (E i)
    μ :
    ∀ i, Measure (E i)
    ∀ i, SigmaFinite (μ i)
    f g :
    ∀ i
    if
    E i
    then
    hf0 :
    ∀ i u, 0 ≤ f i u
    hg0 :
    ∀ i u, 0 ≤ g i u
    densityAffinity (Measure.pi μ) (fun x => ∏ i, f i (x i)) (fun x => ∏ i, g i (x i))
    = ∏ i, ∫ u, sqrt (f i u * g i u) ∂(μ i)
    Proof (Lean source)
    lemma densityAffinity_pi {ι : Type*} [Fintype ι] {E : ι → Type*} [∀ i, MeasurableSpace (E i)] (μ : ∀ i, Measure (E i)) [∀ i, SigmaFinite (μ i)] (f g : ∀ i, E i → ℝ) (hf0 : ∀ i u, 0 ≤ f i u) (hg0 : ∀ i u, 0 ≤ g i u) : densityAffinity (Measure.pi μ) (fun x => ∏ i, f i (x i)) (fun x => ∏ i, g i (x i)) = ∏ i, ∫ u, sqrt (f i u * g i u) ∂(μ i) := by classical unfold densityAffinity rw [show (fun x : ∀ i, E i => sqrt ((∏ i, f i (x i)) * ∏ i, g i (x i))) = (fun x => ∏ i, sqrt (f i (x i) * g i (x i))) by funext x rw [← Finset.prod_mul_distrib] rw [Real.sqrt_prod] intro i hi exact mul_nonneg (hf0 i (x i)) (hg0 i (x i))] exact MeasureTheory.integral_fintype_prod_eq_prod (fun i u => sqrt (f i u * g i u))
    Causalean.Stat.densityAffinity_pi · Causalean/Stat/Minimax/HellingerAffinity.lean:327
Honest­Confidence­Set 4 core · 6 supporting This module provides model-free measure and order lemmas for honest random confidence sets. ★ coverage_tv_expectedRestrictedVolume_lower

Honest confidence sets and frontier risk

This module provides model-free measure and order lemmas for honest random confidence sets. It relates expected restricted volume to pointwise inclusion probabilities, transfers coverage through total variation, and packages uniform asymptotic coverage and frontier-risk bounds over arbitrary model classes. It also fixes the worst-case coverage convention for empty model classes.

def restrictedSetVolume reviewed
Causalean.Stat

For a parameter region on the real line and a set on the real line, the restricted set volume is the real-valued Lebesgue volume of their intersection, with infinite volume represented by zero.

Definition (Lean source)
region set :
Set
restrictedSetVolume region set :
(volume (set ∩ region)).toReal
Causalean.Stat.restrictedSetVolume · Causalean/Stat/Minimax/HonestConfidenceSet.lean:27
theorem coverage_tv_expectedRestrictedVolume_lower reviewed
Causalean.Stat

Coverage-to-expected-restricted-volume bound. For a family of laws Q u indexed by u : ℝ, a random set C, a subset I of a parameter region region, and a reference point reference, suppose every Q u is a probability measure, C covers u with probability at least coverage, for every u in I, Q u is within total variation tv of the reference law Q reference, for every u in I, the graph {(ω, u) | u ∈ C ω} is measurable, region is measurable, region has finite Lebesgue volume, I is measurable, and I is contained in region. Then the expected restricted volume of C under the reference law Q reference is at least (volume I) · (coverage − tv).

Formal statement
Ω :
Q :
ℝ → Measure Ω
C :
Ω → Set
region I :
Set
reference coverage tv :
hQ :
hcover :
∀ u ∈ I, coverage ≤ (Q u {ω | u ∈ C ω}).toReal
htv :
∀ u ∈ I, tvDist (Q u) (Q reference) ≤ tv
hgraph :
MeasurableSet {p : Ω × ℝ | p.2 ∈ C p.1}
hregion :
hregionFinite :
volume region ≠ ⊤
hI :
hI_sub :
I ⊆ region
(volume I).toReal * (coverage - tv) ≤ ∫ ω, restrictedSetVolume region (C ω) ∂Q reference
Proof (Lean source)
theorem coverage_tv_expectedRestrictedVolume_lower {Ω : Type*} [MeasurableSpace Ω] (Q : ℝ → Measure Ω) (C : Ω → Set ℝ) (region I : Set ℝ) (reference coverage tv : ℝ) (hQ : ∀ u, IsProbabilityMeasure (Q u)) (hcover : ∀ u ∈ I, coverage ≤ (Q u {ω | u ∈ C ω}).toReal) (htv : ∀ u ∈ I, tvDist (Q u) (Q reference) ≤ tv) (hgraph : MeasurableSet {p : Ω × ℝ | p.2 ∈ C p.1}) (hregion : MeasurableSet region) (hregionFinite : volume region ≠ ⊤) (hI : MeasurableSet I) (hI_sub : I ⊆ region) : (volume I).toReal * (coverage - tv) ≤ ∫ ω, restrictedSetVolume region (C ω) ∂Q reference := by letI : IsProbabilityMeasure (Q reference) := hQ reference have hpoint : ∀ u ∈ I, coverage - tv ≤ (Q reference {ω | u ∈ C ω}).toReal := by intro u hu letI : IsProbabilityMeasure (Q u) := hQ u have hE : MeasurableSet {ω | u ∈ C ω} := hgraph.preimage (measurable_id.prodMk measurable_const) have hgap := measureReal_sub_le_tvDist (μ := Q reference) (ν := Q u) hE change (Q u {ω | u ∈ C ω}).toReal - (Q reference {ω | u ∈ C ω}).toRealtvDist (Q reference) (Q u) at hgap rw [tvDist_symm] at hgap linarith [hcover u hu, htv u hu] rw [expected_restrictedSetVolume_eq_integral_inclusion (Q := Q reference) C region hgraph hregion hregionFinite] have hmeas : Measurable fun u => (Q reference {ω | u ∈ C ω}).toReal := Measurable.ennreal_toReal (measurable_measure_prodMk_right hgraph) have hIfinite : volume I ≠ ⊤ := ne_top_of_le_ne_top hregionFinite (measure_mono hI_sub) have hrhsint : IntegrableOn (fun u => (Q reference {ω | u ∈ C ω}).toReal) I := by letI : IsFiniteMeasure (volume.restrict I) := isFiniteMeasure_restrict.mpr hIfinite exact Integrable.of_bound hmeas.aestronglyMeasurable.restrict 1 (Filter.Eventually.of_forall fun u => by rw [Real.norm_eq_abs, abs_of_nonneg ENNReal.toReal_nonneg] simpa only [← measureReal_def] using (measureReal_le_one (μ := Q reference) (s := {ω | u ∈ C ω}))) have hrhsRegion : IntegrableOn (fun u => (Q reference {ω | u ∈ C ω}).toReal) region := by letI : IsFiniteMeasure (volume.restrict region) := isFiniteMeasure_restrict.mpr hregionFinite exact Integrable.of_bound hmeas.aestronglyMeasurable.restrict 1 (Filter.Eventually.of_forall fun u => by rw [Real.norm_eq_abs, abs_of_nonneg ENNReal.toReal_nonneg] simpa only [← measureReal_def] using (measureReal_le_one (μ := Q reference) (s := {ω | u ∈ C ω}))) calc (volume I).toReal * (coverage - tv) = ∫ _u in I, coverage - tv := by rw [setIntegral_const] simp [measureReal_def] _ ≤ ∫ u in I, (Q reference {ω | u ∈ C ω}).toReal := setIntegral_mono_on (integrableOn_const hIfinite) hrhsint hI hpoint _ ≤ ∫ u in region, (Q reference {ω | u ∈ C ω}).toReal := setIntegral_mono_set hrhsRegion (Filter.Eventually.of_forall fun _ => ENNReal.toReal_nonneg) (Filter.Eventually.of_forall hI_sub)
Causalean.Stat.coverage_tv_expectedRestrictedVolume_lower · Causalean/Stat/Minimax/HonestConfidenceSet.lean:97 · uses restrictedSetVolume , tvDist
def classFrontierRisk reviewed
Causalean.Stat

For a sequence of model classes, a real-valued strength and a real-valued expected-length criterion for each sample size and model, and a real strength threshold, the class frontier risk is the limit superior, across sample sizes, of the supremum expected length over the models in that class whose strength is at least the threshold.

Definition (Lean source)
Model :
Type*
cls :
ℕ → Model → Prop
strength expectedLength :
ℕ → Model → ℝ
t0 :
classFrontierRisk cls strength expectedLength t0 :
limsup (fun n => ⨆ P : {P : Model // cls n P ∧ t0 ≤ strength n P}, expectedLength n P) atTop
Causalean.Stat.classFrontierRisk · Causalean/Stat/Minimax/HonestConfidenceSet.lean:226
def coverageInfOrOne reviewed
Causalean.Stat

For a real-valued criterion indexed by an arbitrary collection, the worst-case criterion with the empty-collection convention is its infimum when the collection is nonempty and is one when it is empty.

Definition (Lean source)
ι :
Sort*
f :
ι → ℝ
coverageInfOrOne f :
by classical exact if Nonempty ι then ⨅ i, f i else 1
6 supporting declarations (lemmas, instances)
  • expected_restrictedSetVolume_eq_integral_inclusion theorem — The expected restricted volume of a jointly measurable random set equals the integral, over the parameter region, of its pointwise inclusion probabilities.
    Ω :
    C :
    Ω → Set
    region :
    Set
    hgraph :
    MeasurableSet {p : Ω × ℝ | p.2 ∈ C p.1}
    hregion :
    hregionFinite :
    volume region ≠ ⊤
    (∫ ω, restrictedSetVolume region (C ω) ∂Q) = ∫ u in region, (Q {ω | u ∈ C ω}).toReal
    Proof (Lean source)
    theorem expected_restrictedSetVolume_eq_integral_inclusion {Ω : Type*} [MeasurableSpace Ω] (Q : Measure Ω) [IsFiniteMeasure Q] (C : Ω → Set ℝ) (region : Set ℝ) (hgraph : MeasurableSet {p : Ω × ℝ | p.2 ∈ C p.1}) (hregion : MeasurableSet region) (hregionFinite : volume region ≠ ⊤) : (∫ ω, restrictedSetVolume region (C ω) ∂Q) = ∫ u in region, (Q {ω | u ∈ C ω}).toReal := by let S : Set (Ω × ℝ) := {p | p.2 ∈ C p.1 ∧ p.2 ∈ region} let f : Ω × ℝ → ℝ := S.indicator (fun _ => 1) have hS : MeasurableSet S := hgraph.inter (hregion.preimage measurable_snd) have hSsub : S ⊆ univ ×ˢ region := by intro p hp exact ⟨Set.mem_univ _, hp.2⟩ have hSfinite : (Q.prod volume) S ≠ ⊤ := by apply ne_of_lt calc (Q.prod volume) S ≤ (Q.prod volume) (univ ×ˢ region) := measure_mono hSsub _ = Q univ * volume region := by rw [Measure.prod_prod] _ < ⊤ := ENNReal.mul_lt_top (measure_lt_top Q univ) (lt_top_iff_ne_top.mpr hregionFinite) have hfint : Integrable f (Q.prod volume) := by rw [show f = S.indicator (fun _ => (1 : ℝ)) from rfl] exact (integrableOn_const hSfinite).integrable_indicator hS calc (∫ ω, restrictedSetVolume region (C ω) ∂Q) = ∫ ω, (∫ u, f (ω, u) ∂volume) ∂Q := by apply integral_congr_ae filter_upwards with ω rw [show restrictedSetVolume region (C ω) = (volume (C ω ∩ region)).toReal from rfl] rw [show (fun u => f (ω, u)) = (C ω ∩ region).indicator (fun _ => (1 : ℝ)) by funext u simp only [f, S, indicator] split_ifs <;> simp_all] exact (integral_indicator_one (hgraph.preimage (measurable_const.prodMk measurable_id) |>.inter hregion)).symm _ = ∫ u, (∫ ω, f (ω, u) ∂Q) ∂volume := by calc _ = ∫ z, f z ∂Q.prod volume := (integral_prod (μ := Q) (ν := volume) f hfint).symm _ = _ := integral_prod_symm (μ := Q) (ν := volume) f hfint _ = ∫ u in region, (Q {ω | u ∈ C ω}).toReal := by rw [← MeasureTheory.integral_indicator hregion] apply integral_congr_ae filter_upwards with u by_cases hu : u ∈ region · rw [show (fun ω => f (ω, u)) = {ω | u ∈ C ω}.indicator (fun _ => (1 : ℝ)) by funext ω simp only [f, S, indicator] split_ifs <;> simp_all] rw [Set.indicator_of_mem hu] exact integral_indicator_one (μ := Q) (hgraph.preimage (measurable_id.prodMk measurable_const)) · simp [f, S, hu]
    Causalean.Stat.expected_restrictedSetVolume_eq_integral_inclusion · Causalean/Stat/Minimax/HonestConfidenceSet.lean:34
  • classCoverage_liminf theorem — Pointwise coverage rows with a vanishing uniform error imply asymptotic uniform coverage over any eventually inhabited sequence of model classes.
    Model :
    Type*
    cls :
    ℕ → Model → Prop
    coverage :
    ℕ → Model → ℝ
    alpha :
    delta :
    ℕ → ℝ
    hdelta :
    Tendsto delta atTop (𝓝 0)
    hInhab :
    ∀ᶠ n in atTop, ∃ P, cls n P
    hcoverage :
    ∀ n P
    if
    cls n P
    then
    0 ≤ coverage n P ∧ coverage n P ≤ 1
    hrow :
    ∀ n P
    if
    cls n P
    then
    1 - alpha - delta n ≤ coverage n P
    1 - alpha ≤ liminf (fun n => ⨅ P : {P : Model // cls n P}, coverage n P) atTop
    Proof (Lean source)
    theorem classCoverage_liminf {Model : Type*} (cls : ℕ → Model → Prop) (coverage : ℕ → Model → ℝ) (alpha : ℝ) (delta : ℕ → ℝ) (hdelta : Tendsto delta atTop (𝓝 0)) (hInhab : ∀ᶠ n in atTop, ∃ P, cls n P) (hcoverage : ∀ n P, cls n P → 0 ≤ coverage n P ∧ coverage n P ≤ 1) (hrow : ∀ n P, cls n P → 1 - alpha - delta n ≤ coverage n P) : 1 - alpha ≤ liminf (fun n => ⨅ P : {P : Model // cls n P}, coverage n P) atTop := by let row : ℕ → ℝ := fun n => ⨅ P : {P : Model // cls n P}, coverage n P have hrows : ∀ᶠ n in atTop, 1 - alpha - delta n ≤ row n := by filter_upwards [hInhab] with n hn letI : Nonempty {P : Model // cls n P} := ⟨⟨Classical.choose hn, Classical.choose_spec hn⟩⟩ apply le_ciInf intro P exact hrow n P P.2 have hrowUpper : ∀ᶠ n in atTop, row n ≤ 1 := by filter_upwards [hInhab] with n hn obtain ⟨P₀, hP₀⟩ := hn have hbdd : BddBelow (Set.range fun P : {P : Model // cls n P} => coverage n P) := by refine ⟨0, ?_⟩ rintro y ⟨P, rfl⟩ exact (hcoverage n P P.2).1 exact (ciInf_le hbdd ⟨P₀, hP₀⟩).trans (hcoverage n P₀ hP₀).2 have hlowerBounded : IsBoundedUnder (· ≥ ·) atTop (fun n => 1 - alpha - delta n) := by change ∃ b, ∀ᶠ n in atTop, b ≤ 1 - alpha - delta n have hdeltalt : ∀ᶠ n in atTop, delta n < 1 := (tendsto_order.1 hdelta).2 1 zero_lt_one exact ⟨-alpha, hdeltalt.mono fun _ hn => by linarith⟩ have hrowCobounded : IsCoboundedUnder (· ≥ ·) atTop row := by change ∃ b, ∀ a, (∀ᶠ n in atTop, a ≤ row n) → a ≤ b refine ⟨1, fun a ha => ?_⟩ obtain ⟨n, han, hn1⟩ := (ha.and hrowUpper).exists exact han.trans hn1 have hlowerTendsto : Tendsto (fun n => 1 - alpha - delta n) atTop (𝓝 (1 - alpha)) := by simpa using ((tendsto_const_nhds.sub tendsto_const_nhds).sub hdelta) change 1 - alpha ≤ liminf row atTop rw [← hlowerTendsto.liminf_eq] exact Filter.liminf_le_liminf hrows hlowerBounded hrowCobounded
    Causalean.Stat.classCoverage_liminf · Causalean/Stat/Minimax/HonestConfidenceSet.lean:172
  • inverseSqrtCap_anti theorem — The capped inverse-square-root rate is antitone on positive strengths.
    t0 t :
    ht0 :
    0 < t0
    htt :
    t0 ≤ t
    min 1 (t ^ (-1 / 2 : ℝ)) ≤ min 1 (t0 ^ (-1 / 2 : ℝ))
    Proof (Lean source)
    theorem inverseSqrtCap_anti {t0 t : ℝ} (ht0 : 0 < t0) (htt : t0 ≤ t) : min 1 (t ^ (-1 / 2 : ℝ)) ≤ min 1 (t0 ^ (-1 / 2 : ℝ)) := by apply min_le_min_left exact Real.rpow_le_rpow_of_nonpos ht0 htt (by norm_num)
    Causalean.Stat.inverseSqrtCap_anti · Causalean/Stat/Minimax/HonestConfidenceSet.lean:220
  • classFrontierRisk_le theorem — A pointwise capped inverse-square-root expected-length bound passes through both the class supremum and asymptotic limsup at the threshold value.
    Model :
    Type*
    cls :
    ℕ → Model → Prop
    strength expectedLength :
    ℕ → Model → ℝ
    C0 t0 :
    hC0 :
    0 ≤ C0
    ht0 :
    0 < t0
    hLengthNonneg :
    ∀ n P
    if
    cls n P
    then
    0 ≤ expectedLength n P
    hpoint :
    ∀ n P
    if
    cls n P
    then
    expectedLength n P ≤ C0 * min 1 (strength n P ^ (-1 / 2 : ℝ))
    classFrontierRisk cls strength expectedLength t0 ≤ C0 * min 1 (t0 ^ (-1 / 2 : ℝ))
    Proof (Lean source)
    theorem classFrontierRisk_le {Model : Type*} (cls : ℕ → Model → Prop) (strength expectedLength : ℕ → Model → ℝ) (C0 t0 : ℝ) (hC0 : 0 ≤ C0) (ht0 : 0 < t0) (hLengthNonneg : ∀ n P, cls n P → 0 ≤ expectedLength n P) (hpoint : ∀ n P, cls n P → expectedLength n P ≤ C0 * min 1 (strength n P ^ (-1 / 2 : ℝ))) : classFrontierRisk cls strength expectedLength t0 ≤ C0 * min 1 (t0 ^ (-1 / 2 : ℝ)) := by let bound : ℝ := C0 * min 1 (t0 ^ (-1 / 2 : ℝ)) have hmin0 : 0 ≤ min 1 (t0 ^ (-1 / 2 : ℝ)) := le_min (by norm_num) (Real.rpow_nonneg ht0.le _) have hbound0 : 0 ≤ bound := mul_nonneg hC0 hmin0 let row : ℕ → ℝ := fun n => ⨆ P : {P : Model // cls n P ∧ t0 ≤ strength n P}, expectedLength n P have hrowUpper : ∀ n, row n ≤ bound := by intro n let I := {P : Model // cls n P ∧ t0 ≤ strength n P} cases isEmpty_or_nonempty I with | inl hEmpty => letI : IsEmpty I := hEmpty change (⨆ P : I, expectedLength n P) ≤ bound simpa using hbound0 | inr hNonempty => letI : Nonempty I := hNonempty apply ciSup_le intro P exact (hpoint n P P.2.1).trans (mul_le_mul_of_nonneg_left (inverseSqrtCap_anti ht0 P.2.2) hC0) have hrowLower : ∀ n, 0 ≤ row n := by intro n let I := {P : Model // cls n P ∧ t0 ≤ strength n P} cases isEmpty_or_nonempty I with | inl hEmpty => letI : IsEmpty I := hEmpty change 0 ≤ ⨆ P : I, expectedLength n P simp | inr hNonempty => letI : Nonempty I := hNonempty obtain ⟨P⟩ := hNonempty have hbdd : BddAbove (Set.range fun Q : I => expectedLength n Q) := by refine ⟨bound, ?_⟩ rintro y ⟨Q, rfl⟩ exact (hpoint n Q Q.2.1).trans (mul_le_mul_of_nonneg_left (inverseSqrtCap_anti ht0 Q.2.2) hC0) exact (hLengthNonneg n P P.2.1).trans (le_ciSup hbdd P) have hcob : IsCoboundedUnder (· ≤ ·) atTop row := Filter.isCoboundedUnder_le_of_le atTop hrowLower change limsup row atTop ≤ bound exact Filter.limsup_le_of_le hcob (Filter.Eventually.of_forall hrowUpper)
    Causalean.Stat.classFrontierRisk_le · Causalean/Stat/Minimax/HonestConfidenceSet.lean:238
  • coverageInfOrOne_of_nonempty theorem — On a nonempty model class, worst-case coverage with the empty-class convention is the ordinary infimum of coverage across the class.
    ι :
    Sort*
    Nonempty ι
    f :
    ι → ℝ
    coverageInfOrOne f = ⨅ i, f i
    Proof (Lean source)
    theorem coverageInfOrOne_of_nonempty {ι : Sort*} [Nonempty ι] (f : ι → ℝ) : coverageInfOrOne f = ⨅ i, f i := by have hne : Nonempty ι := inferInstance simp [coverageInfOrOne, hne]
    Causalean.Stat.coverageInfOrOne_of_nonempty · Causalean/Stat/Minimax/HonestConfidenceSet.lean:306
  • coverageInfOrOne_of_isEmpty theorem — On an empty model class, worst-case coverage with the empty-class convention is one, expressing that the coverage requirement is vacuously satisfied.
    ι :
    Sort*
    f :
    ι → ℝ
    Proof (Lean source)
    theorem coverageInfOrOne_of_isEmpty {ι : Sort*} [IsEmpty ι] (f : ι → ℝ) : coverageInfOrOne f = 1 := by simp [coverageInfOrOne, not_nonempty_iff.mpr inferInstance]
    Causalean.Stat.coverageInfOrOne_of_isEmpty · Causalean/Stat/Minimax/HonestConfidenceSet.lean:313
Le­Cam 2 core · 1 supporting This file proves the two-point minimax lower bound that reduces estimation risk to binary testing. ★ one_sub_tvDist_le_error_sum★ half_one_sub_tvDist_le_max_error

Le Cam Two-Point Method

This file proves the two-point minimax lower bound that reduces estimation risk to binary testing. It supplies the real-error and worst-case probability inequalities used by later minimax-risk modules.

theorem one_sub_tvDist_le_error_sum reviewed
Causalean.Stat

Le Cam two-point bound (summed form). For a measurable estimator est, if the parameter values θ₀, θ₁ are 2s-separated, then the two error probabilities sum to at least 1 − tvDist P₀ P₁.

Formal statement
Ω :
shared
Θ :
Type u_2
Ω → Θ
shared
hest :
θ₀ θ₁ :
Θ
s :
hsep :
2 * s ≤ dist θ₀ θ₁
1 - tvDist P₀ P₁ ≤ P₀.real {ω | s ≤ dist (est ω) θ₀} + P₁.real {ω | s ≤ dist (est ω) θ₁}
Proof (Lean source)
theorem one_sub_tvDist_le_error_sum {est : Ω → Θ} (hest : Measurable est) {θ₀ θ₁ : Θ} {s : ℝ} (hsep : 2 * s ≤ dist θ₀ θ₁) : 1 - tvDist P₀ P₁ ≤ P₀.real {ω | s ≤ dist (est ω) θ₀} + P₁.real {ω | s ≤ dist (est ω) θ₁} := by set A := {ω | s ≤ dist (est ω) θ₀} with hA set B := {ω | s ≤ dist (est ω) θ₁} with hB have hAmeas : MeasurableSet A := measurableSet_error hest θ₀ s have hBmeas : MeasurableSet B := measurableSet_error hest θ₁ s -- Outside the first error region, the second error region is forced. have hsub : Aᶜ ⊆ B := by intro ω hω have hlt : dist (est ω) θ₀ < s := by simpa [hA, Set.mem_compl_iff, not_le] using hω have htri : dist θ₀ θ₁ ≤ dist (est ω) θ₀ + dist (est ω) θ₁ := by simpa [dist_comm] using dist_triangle θ₀ (est ω) θ₁ have : s ≤ dist (est ω) θ₁ := by nlinarith [htri, hsep, hlt] simpa [hB] using this -- Monotonicity transports the testing bound from `Aᶜ` to `B`. have hmono : P₁.real Aᶜ ≤ P₁.real B := measureReal_mono hsub (measure_ne_top P₁ _) have htest := one_sub_tvDist_le_test (μ := P₀) (ν := P₁) hAmeas linarith [htest, hmono]
Causalean.Stat.one_sub_tvDist_le_error_sum · Causalean/Stat/Minimax/LeCam.lean:47 · uses tvDist
theorem half_one_sub_tvDist_le_max_error reviewed
Causalean.Stat

Le Cam two-point bound (max form). For a measurable estimator est, under 2s-separation of θ₀, θ₁, the worst-case error probability is at least ½ (1 − tvDist P₀ P₁).

Formal statement
Ω :
shared
Θ :
Type u_2
Ω → Θ
shared
hest :
θ₀ θ₁ :
Θ
s :
hsep :
2 * s ≤ dist θ₀ θ₁
(1 - tvDist P₀ P₁) / 2
max (P₀.real {ω | s ≤ dist (est ω) θ₀}) (P₁.real {ω | s ≤ dist (est ω) θ₁})
Proof (Lean source)
theorem half_one_sub_tvDist_le_max_error {est : Ω → Θ} (hest : Measurable est) {θ₀ θ₁ : Θ} {s : ℝ} (hsep : 2 * s ≤ dist θ₀ θ₁) : (1 - tvDist P₀ P₁) / 2 ≤ max (P₀.real {ω | s ≤ dist (est ω) θ₀}) (P₁.real {ω | s ≤ dist (est ω) θ₁}) := by have hsum := one_sub_tvDist_le_error_sum (P₀ := P₀) (P₁ := P₁) hest hsep have h0 : P₀.real {ω | s ≤ dist (est ω) θ₀} ≤ max (P₀.real {ω | s ≤ dist (est ω) θ₀}) (P₁.real {ω | s ≤ dist (est ω) θ₁}) := le_max_left _ _ have h1 : P₁.real {ω | s ≤ dist (est ω) θ₁} ≤ max (P₀.real {ω | s ≤ dist (est ω) θ₀}) (P₁.real {ω | s ≤ dist (est ω) θ₁}) := le_max_right _ _ linarith [hsum, h0, h1]
Causalean.Stat.half_one_sub_tvDist_le_max_error · Causalean/Stat/Minimax/LeCam.lean:73 · uses tvDist
1 supporting declaration (lemmas, instances)
Le­Cam­Two­Point 2 core · 0 supporting This file packages two reusable finite-sample Le Cam risk lower bounds for estimating a real-valued functional from independent product observations. ★ leCam_two_point_L1_lower★ le_cam_two_point_mse

Le Cam two-point lower bound for finite L¹ risk

This file packages two reusable finite-sample Le Cam risk lower bounds for estimating a real-valued functional from independent product observations.

The L¹ theorem leCam_two_point_L1_lower converts a two-point separation δ ≤ |θP - θQ|, an n-sample KL budget, a supplied product-KL comparison, and a supplied product Pinsker bridge into a positive lower bound on the worst-case Bochner L¹ risk of any measurable estimator. The MSE theorem le_cam_two_point_mse uses the Bretagnolle-Huber testing floor instead of Pinsker, so every finite KL budget K yields a positive constant exp(-K) / 32 for the corresponding worst-case squared-error risk.

The private helper event_mul_measureReal_le_integral is the Markov-type event-to-integral step used by the L¹ theorem; the MSE theorem uses the project-wide squared-loss event bound.

theorem leCam_two_point_L1_lower reviewed
Causalean.Stat.Minimax

Le Cam two-point lower bound on finite Bochner risk. Fix a strictly positive KL budget C with C at most 1/2. Then there is a universal positive constant c₀ such that, for every sample size, every pair of single-observation laws whose scaled KL divergence is bounded by C and whose n-fold product KL divergence is controlled by a supplied product-KL comparison and a supplied product-form Pinsker bound, every pair of separated real targets, and every measurable estimator with integrable absolute loss under both n-fold product laws, the worst-case Bochner risk is at least c₀ times the target separation.

Formal statement
Ω :
C :
_hC_pos :
0 < C
hC_small :
C ≤ 1 / 2
∃ c₀ : ℝ,
0 < c₀
conclusion 1
n :
1 ≤ n
P Q :
θP θQ δ :
(n : ℝ) * (_root_.InformationTheory.klDiv P Q).toReal ≤ C
(_root_.InformationTheory.klDiv (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q))).toReal
≤ (n : ℝ) * (_root_.InformationTheory.klDiv P Q).toReal
PinskerBound (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q))
0 ≤ δ
δ ≤ |θP - θQ|
T :
(Fin n → Ω) → ℝ
Integrable (fun ω : Fin n → Ω => |T ω - θP|) (Measure.pi (fun _ : Fin n => P))
Integrable (fun ω : Fin n → Ω => |T ω - θQ|) (Measure.pi (fun _ : Fin n => Q))
c₀ * δ
max (∫ ω, |T ω - θP| ∂Measure.pi (fun _ : Fin n => P)) (∫ ω, |T ω - θQ| ∂Measure.pi (fun _ : Fin n => Q))
Proof (Lean source)
theorem leCam_two_point_L1_lower {Ω : Type*} [MeasurableSpace Ω] (C : ℝ) (_hC_pos : 0 < C) (hC_small : C ≤ 1 / 2) : ∃ c₀ : ℝ, 0 < c₀ ∧ ∀ (n : ℕ), 1 ≤ n → ∀ (P Q : Measure Ω) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] (θP θQ δ : ℝ), (n : ℝ) * (_root_.InformationTheory.klDiv P Q).toReal ≤ C → (_root_.InformationTheory.klDiv (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q))).toReal ≤ (n : ℝ) * (_root_.InformationTheory.klDiv P Q).toRealPinskerBound (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q)) → 0 ≤ δ → δ ≤ |θP - θQ| → ∀ (T : (Fin n → Ω) → ℝ), Measurable T → Integrable (fun ω : Fin n → Ω => |T ω - θP|) (Measure.pi (fun _ : Fin n => P)) → Integrable (fun ω : Fin n → Ω => |T ω - θQ|) (Measure.pi (fun _ : Fin n => Q)) → c₀ * δ ≤ max (∫ ω, |T ω - θP| ∂Measure.pi (fun _ : Fin n => P)) (∫ ω, |T ω - θQ| ∂Measure.pi (fun _ : Fin n => Q)) := by refine ⟨(1 / 8 : ℝ), by norm_num, ?_⟩ intro n _hn P Q _ _ θP θQ δ hKLbound hKLprod hPinsker hδnonneg hδsep T hT hIntp hIntq have hsep : 2 * (δ / 2) ≤ dist θP θQ := by rw [Real.dist_eq] linarith have hprob := klForm_two_point_lower_bound_of_pinsker (P₀ := Measure.pi (fun _ : Fin n => P)) (P₁ := Measure.pi (fun _ : Fin n => Q)) (Θ := ℝ) hPinsker hT hsep have hklprodC : (_root_.InformationTheory.klDiv (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q))).toReal ≤ C := hKLprod.trans hKLbound have hprobLower : (1 / 4 : ℝ) ≤ max ((Measure.pi (fun _ : Fin n => P)).real {ω | δ / 2 ≤ dist (T ω) θP}) ((Measure.pi (fun _ : Fin n => Q)).real {ω | δ / 2 ≤ dist (T ω) θQ}) := by have hkl_nonneg : 0 ≤ (_root_.InformationTheory.klDiv (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q))).toReal := ENNReal.toReal_nonneg have hpre : (1 / 4 : ℝ) ≤ (1 - sqrt (((_root_.InformationTheory.klDiv (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q))).toReal) / 2)) / 2 := by have hdiv_le : ((_root_.InformationTheory.klDiv (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q))).toReal) / 2 ≤ (1 / 4 : ℝ) := by nlinarith have hsqrt_le : sqrt (((_root_.InformationTheory.klDiv (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q))).toReal) / 2) ≤ (1 / 2 : ℝ) := by have h := Real.sqrt_le_sqrt hdiv_le convert h using 1 rw [show (1 / 4 : ℝ) = (1 / 2 : ℝ) ^ 2 by norm_num] rw [Real.sqrt_sq (by norm_num : 0 ≤ (1 / 2 : ℝ))] nlinarith exact hpre.trans hprob have hmeas_p : Measurable (fun ω : Fin n → Ω => |T ω - θP|) := by fun_prop have hmeas_q : Measurable (fun ω : Fin n → Ω => |T ω - θQ|) := by fun_prop have hp_event := event_mul_measureReal_le_integral (μ := Measure.pi (fun _ : Fin n => P)) (f := fun ω : Fin n → Ω => |T ω - θP|) hIntp hmeas_p (s := δ / 2) (Filter.Eventually.of_forall fun _ => abs_nonneg _) have hq_event := event_mul_measureReal_le_integral (μ := Measure.pi (fun _ : Fin n => Q)) (f := fun ω : Fin n → Ω => |T ω - θQ|) hIntq hmeas_q (s := δ / 2) (Filter.Eventually.of_forall fun _ => abs_nonneg _) have hp_event' : (δ / 2) * (Measure.pi (fun _ : Fin n => P)).real {ω | δ / 2 ≤ dist (T ω) θP} ≤ ∫ ω, |T ω - θP| ∂Measure.pi (fun _ : Fin n => P) := by simpa [Real.dist_eq] using hp_event have hq_event' : (δ / 2) * (Measure.pi (fun _ : Fin n => Q)).real {ω | δ / 2 ≤ dist (T ω) θQ} ≤ ∫ ω, |T ω - θQ| ∂Measure.pi (fun _ : Fin n => Q) := by simpa [Real.dist_eq] using hq_event have hmax_event : (δ / 2) * max ((Measure.pi (fun _ : Fin n => P)).real {ω | δ / 2 ≤ dist (T ω) θP}) ((Measure.pi (fun _ : Fin n => Q)).real {ω | δ / 2 ≤ dist (T ω) θQ}) ≤ max (∫ ω, |T ω - θP| ∂Measure.pi (fun _ : Fin n => P)) (∫ ω, |T ω - θQ| ∂Measure.pi (fun _ : Fin n => Q)) := by by_cases hpq : (Measure.pi (fun _ : Fin n => P)).real {ω | δ / 2 ≤ dist (T ω) θP} ≤ (Measure.pi (fun _ : Fin n => Q)).real {ω | δ / 2 ≤ dist (T ω) θQ} · rw [max_eq_right hpq] exact hq_event'.trans (le_max_right _ _) · have hqp : (Measure.pi (fun _ : Fin n => Q)).real {ω | δ / 2 ≤ dist (T ω) θQ} ≤ (Measure.pi (fun _ : Fin n => P)).real {ω | δ / 2 ≤ dist (T ω) θP} := le_of_not_ge hpq rw [max_eq_left hqp] exact hp_event'.trans (le_max_left _ _) have hleft : (1 / 8 : ℝ) * δ ≤ (δ / 2) * (1 / 4 : ℝ) := by ring_nf rfl have hmid : (δ / 2) * (1 / 4 : ℝ) ≤ (δ / 2) * max ((Measure.pi (fun _ : Fin n => P)).real {ω | δ / 2 ≤ dist (T ω) θP}) ((Measure.pi (fun _ : Fin n => Q)).real {ω | δ / 2 ≤ dist (T ω) θQ}) := mul_le_mul_of_nonneg_left hprobLower (by linarith) exact hleft.trans (hmid.trans hmax_event)
Causalean.Stat.Minimax.leCam_two_point_L1_lower · Causalean/Stat/Minimax/LeCamTwoPoint.lean:67 · uses PinskerBound
lemma le_cam_two_point_mse reviewed
Causalean.Stat.Minimax

Le Cam two-point reduction in mean-squared-error form, uniform over a finite KL budget. For every Kullback–Leibler budget K, there is a single positive constant c_K (here exp(−K)/32), chosen before the laws, such that for every pair of probability laws Q₀, Q₁ whose divergence obeys KL(Q₀, Q₁) ≤ K, any measurable estimator with integrable squared loss under both laws has worst-case mean-squared error at least c_K times the squared separation of the two candidate parameter values. The finite-budget hypothesis is encoded as the ℝ≥0∞ inequality klDiv Q₀ Q₁ ≤ ENNReal.ofReal K, which forces a finite divergence (so it cannot be met vacuously by an infinite divergence collapsing under .toReal) and pins c_K to K alone.

Formal statement
K :
∃ cK : ℝ,
0 < cK
conclusion 1
S :
Type*
Q0 Q1 :
theta0 theta1 :
klDiv Q0 Q1 ≤ ofReal K
T :
S → ℝ
Integrable (fun s => (T s - theta0) ^ 2) Q0
Integrable (fun s => (T s - theta1) ^ 2) Q1
cK * (theta1 - theta0) ^ 2
max (∫ s, (T s - theta0) ^ 2 ∂Q0) (∫ s, (T s - theta1) ^ 2 ∂Q1)
Proof (Lean source)
lemma le_cam_two_point_mse (K : ℝ) : ∃ cK : ℝ, 0 < cK ∧ ∀ {S : Type*} [MeasurableSpace S] (Q0 Q1 : Measure S) [IsProbabilityMeasure Q0] [IsProbabilityMeasure Q1] (theta0 theta1 : ℝ), InformationTheory.klDiv Q0 Q1 ≤ ENNReal.ofReal K → ∀ T : S → ℝ, Measurable T → Integrable (fun s => (T s - theta0) ^ 2) Q0 → Integrable (fun s => (T s - theta1) ^ 2) Q1 → cK * (theta1 - theta0) ^ 2 ≤ max (∫ s, (T s - theta0) ^ 2 ∂Q0) (∫ s, (T s - theta1) ^ 2 ∂Q1) := by refine ⟨Real.exp (-(ENNReal.ofReal K).toReal) / 32, ?_, ?_⟩ · positivity intro S _ Q0 Q1 _ _ theta0 theta1 hKL T hT hInt0 hInt1 let r : ℝ := |theta1 - theta0| / 2 have hr_nonneg : 0 ≤ r := by dsimp [r] positivity have hsep : 2 * r ≤ |theta0 - theta1| := by dsimp [r] rw [abs_sub_comm] linarith [abs_nonneg (theta1 - theta0)] have hsep_dist : 2 * r ≤ dist theta0 theta1 := by rwa [Real.dist_eq] have hprob_dist := half_one_sub_tvDist_le_max_error (P₀ := Q0) (P₁ := Q1) (Θ := ℝ) hT hsep_dist have hprob : (1 - tvDist Q0 Q1) / 2 ≤ max (Q0.real {s | r ≤ |T s - theta0|}) (Q1.real {s | r ≤ |T s - theta1|}) := by simpa only [Real.dist_eq] using hprob_dist have hkl_toReal_le : (InformationTheory.klDiv Q0 Q1).toReal ≤ (ENNReal.ofReal K).toReal := ENNReal.toReal_mono ENNReal.ofReal_ne_top hKL have hexp_budget : exp (-(ENNReal.ofReal K).toReal) ≤ exp (-(InformationTheory.klDiv Q0 Q1).toReal) := by exact Real.exp_le_exp.mpr (by linarith) -- The finite-budget hypothesis pins down both BH side-conditions. have hfin : InformationTheory.klDiv Q0 Q1 ≠ ⊤ := ne_top_of_le_ne_top ENNReal.ofReal_ne_top hKL have hac : Q0 ≪ Q1 := (InformationTheory.klDiv_ne_top_iff.mp hfin).1 have hBH := Causalean.Stat.bretagnolle_huber_affinity Q0 Q1 hac hfin have hprob_floor : exp (-(ENNReal.ofReal K).toReal) / 4 ≤ max (Q0.real {s | r ≤ |T s - theta0|}) (Q1.real {s | r ≤ |T s - theta1|}) := by calc exp (-(ENNReal.ofReal K).toReal) / 4 ≤ ((1 / 2 : ℝ) * exp (-(InformationTheory.klDiv Q0 Q1).toReal)) / 2 := by nlinarith [hexp_budget, Real.exp_pos (-(ENNReal.ofReal K).toReal), Real.exp_pos (-(InformationTheory.klDiv Q0 Q1).toReal)] _ ≤ (1 - tvDist Q0 Q1) / 2 := by nlinarith [hBH] _ ≤ max (Q0.real {s | r ≤ |T s - theta0|}) (Q1.real {s | r ≤ |T s - theta1|}) := hprob have hset0 : {s : S | r ≤ |T s - theta0|} = {s : S | r ^ 2 ≤ (T s - theta0) ^ 2} := by ext s simp only [Set.mem_setOf_eq] constructor <;> intro hs <;> nlinarith [hr_nonneg, abs_nonneg (T s - theta0), sq_abs (T s - theta0), sq_nonneg (T s - theta0)] have hset1 : {s : S | r ≤ |T s - theta1|} = {s : S | r ^ 2 ≤ (T s - theta1) ^ 2} := by ext s simp only [Set.mem_setOf_eq] constructor <;> intro hs <;> nlinarith [hr_nonneg, abs_nonneg (T s - theta1), sq_abs (T s - theta1), sq_nonneg (T s - theta1)] have hmse0 : r ^ 2 * Q0.real {s | r ≤ |T s - theta0|} ≤ ∫ s, (T s - theta0) ^ 2 ∂Q0 := by rw [hset0] exact mul_meas_ge_le_integral_of_nonneg (μ := Q0) (f := fun s => (T s - theta0) ^ 2) (Filter.Eventually.of_forall fun s => sq_nonneg (T s - theta0)) hInt0 (r ^ 2) have hmse1 : r ^ 2 * Q1.real {s | r ≤ |T s - theta1|} ≤ ∫ s, (T s - theta1) ^ 2 ∂Q1 := by rw [hset1] exact mul_meas_ge_le_integral_of_nonneg (μ := Q1) (f := fun s => (T s - theta1) ^ 2) (Filter.Eventually.of_forall fun s => sq_nonneg (T s - theta1)) hInt1 (r ^ 2) have hmse_max : r ^ 2 * max (Q0.real {s | r ≤ |T s - theta0|}) (Q1.real {s | r ≤ |T s - theta1|}) ≤ max (∫ s, (T s - theta0) ^ 2 ∂Q0) (∫ s, (T s - theta1) ^ 2 ∂Q1) := by by_cases h01 : Q0.real {s | r ≤ |T s - theta0|} ≤ Q1.real {s | r ≤ |T s - theta1|} · rw [max_eq_right h01] exact hmse1.trans (le_max_right _ _) · have h10 : Q1.real {s | r ≤ |T s - theta1|} ≤ Q0.real {s | r ≤ |T s - theta0|} := le_of_not_ge h01 rw [max_eq_left h10] exact hmse0.trans (le_max_left _ _) have hrate : r ^ 2 * (exp (-(ENNReal.ofReal K).toReal) / 4) ≤ max (∫ s, (T s - theta0) ^ 2 ∂Q0) (∫ s, (T s - theta1) ^ 2 ∂Q1) := by calc r ^ 2 * (exp (-(ENNReal.ofReal K).toReal) / 4) ≤ r ^ 2 * max (Q0.real {s | r ≤ |T s - theta0|}) (Q1.real {s | r ≤ |T s - theta1|}) := mul_le_mul_of_nonneg_left hprob_floor (sq_nonneg r) _ ≤ max (∫ s, (T s - theta0) ^ 2 ∂Q0) (∫ s, (T s - theta1) ^ 2 ∂Q1) := hmse_max have hcoef : (exp (-(ENNReal.ofReal K).toReal) / 32) * (theta1 - theta0) ^ 2 ≤ r ^ 2 * (exp (-(ENNReal.ofReal K).toReal) / 4) := by dsimp [r] nlinarith [Real.exp_pos (-(ENNReal.ofReal K).toReal), sq_abs (theta1 - theta0), sq_nonneg (theta1 - theta0)] exact hcoef.trans hrate
Causalean.Stat.Minimax.le_cam_two_point_mse · Causalean/Stat/Minimax/LeCamTwoPoint.lean:213
Markov­Kernel­Transport 9 core · 22 supporting This module packages the Blackwell comparison for squared loss: randomizing an experiment through a Markov kernel cannot improve the best attainable squared-error risk. ★ forall_estimator_exists_sqRisk_ge_of_kernel_affine_transport_pi★ sqRisk_raoBlackwellStatistic_le

Squared-risk transport through Markov kernels

This module packages the Blackwell comparison for squared loss: randomizing an experiment through a Markov kernel cannot improve the best attainable squared-error risk. It constructs the Rao--Blackwell pullback of a bounded estimator, proves its risk comparison under an affine change of target, and exports the resulting minimax-hardness transport for both one observation and finite independent samples, including the empty sample.

Main results

* forall_estimator_exists_sqRisk_ge_of_kernel_affine_transport transfers a quantified squared-risk lower bound through a randomized experiment and an affine target change. * finProductKernel_comp_pi identifies the image of an independent product experiment under the coordinatewise product kernel. * forall_estimator_exists_sqRisk_ge_of_kernel_affine_transport_pi gives the finite-product form of the randomized transport theorem.

def UniformlyBounded reviewed
Causalean.Stat

For an arbitrary domain and a real-valued function on that domain, the uniform boundedness property holds exactly when there exists a nonnegative real constant that bounds the function's absolute value at every input.

Definition (Lean source)
A :
Type*
f :
A → ℝ
UniformlyBounded f :
Prop
∃ M : ℝ,
0 ≤ M
clause 1
x :
|f x| ≤ M
def kernelMean reviewed
Causalean.Stat

For an input measurable space, an output measurable space, and a Markov kernel from the input space to the output space and a real-valued function on the output space, the kernel mean assigns to each input the expectation of that function under the output distribution selected by the kernel.

Definition (Lean source)
X :
Type uX
shared
Y :
Type uY
shared
K :
Kernel X Y
T :
Y → ℝ
kernelMean K T :
X → ℝ
fun x => ∫ y, T y ∂K x
def kernelAffinePullback reviewed
Causalean.Stat

For an input measurable space, an output measurable space, and a Markov kernel from the input space to the output space, a real slope, a real offset, and a real-valued estimator on the output space, the affine kernel pullback assigns to each input the kernel mean of the estimator, minus the offset, divided by the slope.

Definition (Lean source)
X :
Type uX
shared
Y :
Type uY
shared
K :
Kernel X Y
a b :
targetEst :
Y → ℝ
kernelAffinePullback K a b targetEst :
X → ℝ
fun x => (kernelMean K targetEst x - b) / a
Causalean.Stat.kernelAffinePullback · Causalean/Stat/Minimax/MarkovKernelTransport.lean:90
def finProductKernel reviewed
Causalean.Stat

For an input measurable space, an output measurable space, a nonnegative integer number of coordinates, and a Markov kernel from the input space to the output space, the finite product kernel maps an input vector to the unique point-mass kernel at zero coordinates, and otherwise to independent kernel outputs coordinate by coordinate.

Definition (Lean source)
X :
Type uX
shared
Y :
Type uY
shared
n :
K :
Kernel X Y
finProductKernel n K :
Kernel (Fin n → X) (Fin n → Y)
match n with | 0
=> Kernel.deterministic (fun _ => fun i => elim0 i) measurable_const | n
+ 1
=> let eX := MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) => X) 0 let eY := MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) => Y) 0 ((K ∥ₖ finProductKernel n K).comap eX eX.measurable).map eY.symm
theorem forall_estimator_exists_sqRisk_ge_of_kernel_affine_transport_pi reviewed
Causalean.Stat

Suppose the affine slope is nonzero, each one-coordinate target law is obtained by applying the common Markov kernel to its source law, and every measurable uniformly bounded estimator on the finite source product incurs squared risk at least a fixed level for some parameter index. Then every measurable uniformly bounded estimator on the target product incurs at least the source level multiplied by the squared slope for some parameter index, including when the sample has no coordinates.

Formal statement
X :
Type uX
shared
Y :
Type uY
shared
Iota :
Type uI
shared
n :
P :
Iota → Measure X
Q :
Iota → Measure Y
theta :
Iota → ℝ
a b L :
ha :
a ≠ 0
hQ :
∀ j, Q j = K ∘ₘ P j
hsource :
∀ sourceEst : (Fin n → X) → ℝ
if
Measurable sourceEst
and
then
∃ j, L ≤ sqRisk (Measure.pi (fun _ : Fin n => P j)) sourceEst (theta j)
targetEst :
(Fin n → Y) → ℝ
Measurable targetEst
∃ j, a ^ 2 * L ≤ sqRisk (Measure.pi (fun _ : Fin n => Q j)) targetEst (a * theta j + b)
Proof (Lean source)
theorem forall_estimator_exists_sqRisk_ge_of_kernel_affine_transport_pi (n : ℕ) (P : Iota → Measure X) (Q : Iota → Measure Y) [∀ j, IsProbabilityMeasure (P j)] (K : Kernel X Y) [IsMarkovKernel K] (theta : Iota → ℝ) (a b L : ℝ) (ha : a ≠ 0) (hQ : ∀ j, Q j = K ∘ₘ P j) (hsource : ∀ sourceEst : (Fin n → X) → ℝ, Measurable sourceEst → UniformlyBounded sourceEst → ∃ j, L ≤ sqRisk (Measure.pi (fun _ : Fin n => P j)) sourceEst (theta j)) : ∀ targetEst : (Fin n → Y) → ℝ, Measurable targetEst → UniformlyBounded targetEst → ∃ j, a ^ 2 * L ≤ sqRisk (Measure.pi (fun _ : Fin n => Q j)) targetEst (a * theta j + b) := by apply forall_estimator_exists_sqRisk_ge_of_kernel_affine_transport (P := fun j => Measure.pi (fun _ : Fin n => P j)) (Q := fun j => Measure.pi (fun _ : Fin n => Q j)) (K := finProductKernel n K) theta a b L ha · intro j rw [finProductKernel_comp_pi, hQ j] · exact hsource
Causalean.Stat.forall_estimator_exists_sqRisk_ge_of_kernel_affine_transport_pi · Causalean/Stat/Minimax/MarkovKernelTransport.lean:380 · uses UniformlyBounded , sqRisk
def cappedStatistic reviewed
Causalean.Stat

Given a statistic on finite samples, an overflow value, a fixed array, and an auxiliary count, the randomized capped statistic evaluates T on the requested prefix off overflow and equals the specified value on overflow.

Definition (Lean source)
X :
Type u_1
shared
n :
T :
FiniteSample X → ℝ
zOver :
x :
Fin n → X
m :
cappedStatistic T zOver x m :
if h : m ≤ n then T (prefixOfLE x m h) else zOver
def auxPoissonCountKernel reviewed
Causalean.Stat

Given a Poisson mean, the auxiliary-count Markov kernel sends each fixed array to that same array paired with an independent Poisson count.

Definition (Lean source)
X :
Type u_1
shared
n :
lambda :
ℝ≥0
auxPoissonCountKernel lambda :
Kernel (Fin n → X) ((Fin n → X) × ℕ)
mechanismKernel (poissonMeasure lambda) (fun z : (Fin n → X) × ℕ ↦ z)
Causalean.Stat.auxPoissonCountKernel · Causalean/Stat/Minimax/MarkovKernelTransport.lean:446
def raoBlackwellStatistic reviewed
Causalean.Stat

Given a Poisson mean, a statistic, and an overflow value, the fixed-sample Rao--Blackwell statistic is the mean of the capped statistic under the auxiliary-count kernel.

Definition (Lean source)
X :
Type u_1
shared
n :
lambda :
ℝ≥0
T :
FiniteSample X → ℝ
zOver :
raoBlackwellStatistic lambda T zOver :
(Fin n → X) → ℝ
kernelMean (auxPoissonCountKernel lambda) (fun z ↦ cappedStatistic T zOver z.1 z.2)
Causalean.Stat.raoBlackwellStatistic · Causalean/Stat/Minimax/MarkovKernelTransport.lean:490 · uses FiniteSample
theorem sqRisk_raoBlackwellStatistic_le reviewed
Causalean.Stat

For an observation probability law, a Poisson mean, and a fixed sample size, if the statistic is measurable, the interval is ordered, the statistic stays in the interval, the target is in the interval, and the overflow value is in the interval, then the fixed-iid squared risk of the Rao--Blackwell statistic is at most the uncapped finite-Poisson risk plus the squared interval diameter times the Poisson overflow probability.

Formal statement
X :
Type u_1
shared
lambda :
ℝ≥0
n :
T :
FiniteSample X → ℝ
hT :
a b theta zOver :
hab :
a ≤ b
hTmem :
∀ s, T s ∈ Icc a b
htheta :
theta ∈ Icc a b
hzOver :
zOver ∈ Icc a b
sqRisk (Measure.pi (fun _ : Fin n ↦ P)) (raoBlackwellStatistic lambda T zOver) theta
sqRisk (finitePoissonSampleLaw P lambda) T theta
+ (b - a) ^ 2 * (poissonMeasure lambda).real (Ioi n)
Proof (Lean source)
theorem sqRisk_raoBlackwellStatistic_le (P : Measure X) [IsProbabilityMeasure P] (lambda : ℝ≥0) (n : ℕ) {T : FiniteSample X → ℝ} (hT : Measurable T) {a b theta zOver : ℝ} (hab : a ≤ b) (hTmem : ∀ s, T s ∈ Icc a b) (htheta : theta ∈ Icc a b) (hzOver : zOver ∈ Icc a b) : sqRisk (Measure.pi (fun _ : Fin n ↦ P)) (raoBlackwellStatistic lambda T zOver) theta ≤ sqRisk (finitePoissonSampleLaw P lambda) T theta + (b - a) ^ 2 * (poissonMeasure lambda).real (Ioi n) := by -- Apply `sqRisk_kernelMean_le_comp` to the bounded capped statistic, rewrite -- the composed law with `auxPoissonCountKernel_comp_pi`, and split its risk -- integral over `m ≤ n` and `m > n`. Rewrite the first restriction with -- `map_totalizedPrefix_restrict_nonoverflow`; bound the overflow loss by -- the squared interval diameter before integrating its indicator. have hTb : UniformlyBounded T := by refine ⟨max |a| |b|, ?_, ?_⟩ · exact (abs_nonneg a).trans (le_max_left _ _) · intro s exact abs_le_max_abs_abs (hTmem s).1 (hTmem s).2 have hCappedBound : UniformlyBounded (fun z : (Fin n → X) × ℕ ↦ cappedStatistic T zOver z.1 z.2) := by refine ⟨max |a| |b|, ?_, ?_⟩ · exact (abs_nonneg a).trans (le_max_left _ _) · intro z by_cases h : z.2 ≤ n · simp only [cappedStatistic, h, ↓reduceDIte] exact abs_le_max_abs_abs (hTmem _).1 (hTmem _).2 · simp only [cappedStatistic, h, ↓reduceDIte] exact abs_le_max_abs_abs hzOver.1 hzOver.2 let μ : Measure ((Fin n → X) × ℕ) := (Measure.pi (fun _ : Fin n ↦ P)).prod (poissonMeasure lambda) let s : Set ((Fin n → X) × ℕ) := Prod.snd ⁻¹' Set.Iic n have hs : MeasurableSet s := measurable_snd measurableSet_Iic obtain ⟨M, hM, hCappedBoundM⟩ := hCappedBound have hlossInt : Integrable (fun z : (Fin n → X) × ℕ => (cappedStatistic T zOver z.1 z.2 - theta) ^ 2) μ := by refine (integrable_const ((M + |theta|) ^ 2)).mono' (((measurable_cappedStatistic hT zOver).sub measurable_const).pow_const 2 ).aestronglyMeasurable ?_ filter_upwards [] with z rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _), sq_le_sq, abs_of_nonneg (add_nonneg hM (abs_nonneg theta))] exact (abs_sub _ _).trans (add_le_add (hCappedBoundM z) le_rfl) have hsplit : sqRisk μ (fun z : (Fin n → X) × ℕ ↦ cappedStatistic T zOver z.1 z.2) theta = sqRisk (μ.restrict s) (fun z : (Fin n → X) × ℕ ↦ cappedStatistic T zOver z.1 z.2) theta + sqRisk (μ.restrict sᶜ) (fun z : (Fin n → X) × ℕ ↦ cappedStatistic T zOver z.1 z.2) theta := by unfold sqRisk conv_lhs => rw [← Measure.restrict_add_restrict_compl (μ := μ) hs, integral_add_measure hlossInt.restrict hlossInt.restrict] have hsc : sᶜ = Prod.snd ⁻¹' Ioi n := by rw [← Set.preimage_compl, Set.compl_Iic] have hoverflowSq : (zOver - theta) ^ 2 ≤ (b - a) ^ 2 := by have hdist : |zOver - theta| ≤ b - a := by simpa [Real.dist_eq] using Real.dist_le_of_mem_Icc hzOver htheta rw [← sq_abs (zOver - theta)] exact (sq_le_sq₀ (abs_nonneg _) (sub_nonneg.mpr hab)).2 hdist have hoverflowProb : 0 ≤ (poissonMeasure lambda).real (Ioi n) := by positivity calc sqRisk (Measure.pi (fun _ : Fin n ↦ P)) (raoBlackwellStatistic lambda T zOver) theta ≤ sqRisk (auxPoissonCountKernel lambda ∘ₘ Measure.pi (fun _ : Fin n ↦ P)) (fun z : (Fin n → X) × ℕ ↦ cappedStatistic T zOver z.1 z.2) theta := by exact sqRisk_kernelMean_le_comp (Measure.pi (fun _ : Fin n ↦ P)) (auxPoissonCountKernel lambda) (measurable_cappedStatistic hT zOver) ⟨M, hM, hCappedBoundM⟩ theta _ = sqRisk μ (fun z : (Fin n → X) × ℕ ↦ cappedStatistic T zOver z.1 z.2) theta := by rw [auxPoissonCountKernel_comp_pi] _ = sqRisk (μ.restrict s) (fun z : (Fin n → X) × ℕ ↦ cappedStatistic T zOver z.1 z.2) theta + sqRisk (μ.restrict sᶜ) (fun z : (Fin n → X) × ℕ ↦ cappedStatistic T zOver z.1 z.2) theta := hsplit _ = sqRisk ((finitePoissonSampleLaw P lambda).restrict (FiniteSample.count ⁻¹' Set.Iic n)) T theta + (zOver - theta) ^ 2 * (poissonMeasure lambda).real (Ioi n) := by rw [show μ.restrict s = ((Measure.pi (fun _ : Fin n ↦ P)).prod (poissonMeasure lambda)).restrict (Prod.snd ⁻¹' Set.Iic n) from rfl, sqRisk_cappedStatistic_restrict_nonoverflow_eq P lambda n hT zOver theta, hsc] exact congrArg (fun r => sqRisk ((finitePoissonSampleLaw P lambda).restrict (FiniteSample.count ⁻¹' Set.Iic n)) T theta + r) (sqRisk_cappedStatistic_restrict_overflow_eq P lambda n T zOver theta) _ ≤ sqRisk (finitePoissonSampleLaw P lambda) T theta + (b - a) ^ 2 * (poissonMeasure lambda).real (Ioi n) := add_le_add (sqRisk_finitePoisson_restrict_nonoverflow_le P lambda n hT hTb theta) (mul_le_mul_of_nonneg_right hoverflowSq hoverflowProb)
22 supporting declarations (lemmas, instances)
Maximal­Coupling 5 core · 13 supporting This file develops the common-submeasure and coupling construction used by the coordinatewise direct-product argument. ★ maximalCoupling_eq_mass_ge

Maximal couplings through a measurable compression

This file develops the common-submeasure and coupling construction used by the coordinatewise direct-product argument.

def measurableEqOfStandardBorel reviewed
Causalean.Stat

For a standard Borel measurable space, the measurability of its equality relation is defined.

Definition (Lean source)
measurableEqOfStandardBorel X :
by let e : X → ℝ := MeasureTheory.embeddingReal X have he : MeasurableEmbedding e := MeasureTheory.measurableEmbedding_embeddingReal X constructor rw [show Set.diagonal X = (map e e) ⁻¹' Set.diagonal ℝ by ext p simp only [Set.mem_diagonal_iff, Set.mem_preimage, Prod.map_apply] exact he.injective.eq_iff.symm] exact measurableSet_diagonal.preimage (he.measurable.prodMap he.measurable)
Causalean.Stat.measurableEqOfStandardBorel · Causalean/Stat/Minimax/MaximalCoupling.lean:21
def rnCommonPart reviewed
Causalean.Stat

Given a measurable sample space and three measures on it, consisting of two target measures and a reference measure, the common Radon--Nikodym submeasure is the reference measure weighted by the pointwise minimum of the two target measures' Radon--Nikodym densities relative to that reference measure.

Definition (Lean source)
X :
mu nu xi :
rnCommonPart mu nu xi :
xi.withDensity fun x => min (mu.rnDeriv xi x) (nu.rnDeriv xi x)
def maximalCoupling reviewed
Causalean.Stat

Given a measurable sample space and two probability measures on it, the maximal coupling is the measure on pairs whose first branch is the diagonal coupling when their total-variation distance is zero, and whose second branch otherwise combines their common part on the diagonal with the normalized product of their residual measures.

Definition (Lean source)
maximalCoupling mu nu :
Measure (X × X)
if hzero : tvDist mu nu
= 0 then mu.map fun x => (x, x) else let xi := mu
+ nu let c := rnCommonPart mu nu xi let rmu := mu
- c let rnu := nu
- c c.map (fun x => (x, x))
+ (ofReal (tvDist mu nu))⁻¹ • (rmu.prod rnu)
Causalean.Stat.maximalCoupling · Causalean/Stat/Minimax/MaximalCoupling.lean:218
lemma maximalCoupling_eq_mass_ge reviewed
Causalean.Stat

For two probability measures mu and nu on a standard Borel space X, the two coordinates of their maximal coupling agree with probability at least one minus their total variation distance.

Formal statement
ofReal (1 - tvDist mu nu) ≤ maximalCoupling mu nu {p | p.1 = p.2}
Proof (Lean source)
lemma maximalCoupling_eq_mass_ge {X : Type*} [MeasurableSpace X] [MeasurableEq X] (mu nu : Measure X) [IsProbabilityMeasure mu] [IsProbabilityMeasure nu] : ofReal (1 - tvDist mu nu) ≤ maximalCoupling mu nu {p | p.1 = p.2} := by let D : Set (X × X) := {p | p.1 = p.2} have hD : MeasurableSet D := measurableSet_eq_fun measurable_fst measurable_snd change ofReal (1 - tvDist mu nu) ≤ maximalCoupling mu nu D by_cases hzero : tvDist mu nu = 0 · rw [maximalCoupling, dif_pos hzero, Measure.map_apply (μ := mu) (f := fun x : X => (x, x)) (measurable_id.prodMk measurable_id) hD] simp [D, hzero] · let xi := mu + nu let c := rnCommonPart mu nu xi have hmu : mu ≪ xi := Measure.AbsolutelyContinuous.rfl.add_right _ have hnu : nu ≪ xi := Measure.AbsolutelyContinuous.rfl.add_right' _ have hcmass : c univ = ofReal (1 - tvDist mu nu) := rnCommonPart_mass_eq_one_sub_tvDist mu nu xi hmu hnu rw [maximalCoupling, dif_neg hzero] dsimp only rw [Measure.add_apply] calc ofReal (1 - tvDist mu nu) = c univ := hcmass.symm _ = c.map (fun x => (x, x)) D := by rw [Measure.map_apply (μ := c) (f := fun x : X => (x, x)) (measurable_id.prodMk measurable_id) hD] congr 1 ext x simp [D] _ ≤ c.map (fun x => (x, x)) D + ((ofReal (tvDist mu nu))⁻¹ • ((mu - c).prod (nu - c))) D := le_add_right le_rfl
Causalean.Stat.maximalCoupling_eq_mass_ge · Causalean/Stat/Minimax/MaximalCoupling.lean:362 · uses maximalCoupling , tvDist
def compressionCoupling reviewed
Causalean.Stat

Given two standard Borel measurable spaces, an observation space and a compressed-state space, two probability measures on the observation space, and a measurable compression map from observations to compressed states, the compression coupling is the joint law obtained by maximally coupling the two compressed laws and then, conditional on each coupled compressed state, drawing each observation from its corresponding regular conditional distribution.

Definition (Lean source)
compressionCoupling Q0 Q1 compress hcompress :
Measure (Z × Z)
by letI : Nonempty Z := nonempty_of_isProbabilityMeasure Q0 letI mapProb0 : IsProbabilityMeasure (Q0.map compress) := Measure.isProbabilityMeasure_map hcompress.aemeasurable letI mapProb1 : IsProbabilityMeasure (Q1.map compress) := Measure.isProbabilityMeasure_map hcompress.aemeasurable let K0 := condDistrib id compress Q0 let K1 := condDistrib id compress Q1 let gamma := maximalCoupling (Q0.map compress) (Q1.map compress) exact ((K0.comap fst measurable_fst) ×ₖ (K1.comap snd measurable_snd)) ∘ₘ gamma
Causalean.Stat.compressionCoupling · Causalean/Stat/Minimax/MaximalCoupling.lean:401
13 supporting declarations (lemmas, instances)
Scheffe 1 core · 2 supporting This file proves the one-sided Scheffe inequality relating total variation distance to the integral absolute deviation of a Radon-Nikodym density from one. ★ tvDist_le_half_integral_abs_rnDeriv

Scheffe Bound for Total Variation

This file proves the one-sided Scheffe inequality relating total variation distance to the integral absolute deviation of a Radon-Nikodym density from one. It supplies the analytic bridge used to convert density-based divergence bounds into minimax testing bounds.

theorem tvDist_le_half_integral_abs_rnDeriv reviewed
Causalean.Stat

Scheffé's inequality (≤ direction). For probability measures μ and ν on the same space with μ absolutely continuous with respect to ν, the total variation distance between μ and ν is at most half the L¹(ν)-distance of the Radon–Nikodym density dμ/dν to the constant 1.

Formal statement
Ω :
Type u_1
shared
hac :
μ ≪ ν
tvDist μ ν ≤ (1/2) * ∫ x, |(μ.rnDeriv ν x).toReal - 1| ∂ν
Proof (Lean source)
theorem tvDist_le_half_integral_abs_rnDeriv (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) : tvDist μ ν ≤ (1/2) * ∫ x, |(μ.rnDeriv ν x).toReal - 1| ∂ν := by set f : Ω → ℝ := fun x => (μ.rnDeriv ν x).toReal - 1 with hf_def have hint_p : Integrable (fun x => (μ.rnDeriv ν x).toReal) ν := Measure.integrable_toReal_rnDeriv have hf : Integrable f ν := hint_p.sub (integrable_const 1) -- `∫ f = μ.real univ − ν.real univ = 0` have hf0 : ∫ x, f x ∂ν = 0 := by rw [hf_def] rw [integral_sub hint_p (integrable_const 1)] rw [Measure.integral_toReal_rnDeriv hac] simp only [integral_const, smul_eq_mul, mul_one] rw [measureReal_def] simp [measure_univ] -- supremum is over measurable sets; bound each term refine ciSup_le fun A => ?_ obtain ⟨A, hA⟩ := A have hgap : μ.real A - ν.real A = ∫ x in A, f x ∂ν := measureReal_sub_eq_setIntegral_rnDeriv_sub_one hac hA rw [hgap] exact abs_setIntegral_le_half_integral_abs_of_integral_eq_zero hf hf0 hA
Causalean.Stat.tvDist_le_half_integral_abs_rnDeriv · Causalean/Stat/Minimax/Scheffe.lean:109 · uses tvDist
2 supporting declarations (lemmas, instances)
  • abs_setIntegral_le_half_integral_abs_of_integral_eq_zero theorem — For an integrable function f whose integral vanishes, the integral over any measurable set is bounded in absolute value by half the L¹ norm of f.
    Ω :
    Type u_1
    Ω → ℝ
    shared
    hf :
    hf0 :
    ∫ x, f x ∂ν = 0
    A :
    Set Ω
    hA :
    |∫ x in A, f x ∂ν| ≤ (1/2) * ∫ x, |f x| ∂ν
    Proof (Lean source)
    theorem abs_setIntegral_le_half_integral_abs_of_integral_eq_zero {f : Ω → ℝ} (hf : Integrable f ν) (hf0 : ∫ x, f x ∂ν = 0) {A : Set Ω} (hA : MeasurableSet A) : |∫ x in A, f x ∂ν| ≤ (1/2) * ∫ x, |f x| ∂ν := by have hfA : IntegrableOn f A ν := hf.integrableOn have hfAc : IntegrableOn f Aᶜ ν := hf.integrableOn -- `∫_A f + ∫_{Aᶜ} f = 0` have hsplit : ∫ x in A, f x ∂ν + ∫ x in Aᶜ, f x ∂ν = 0 := by rw [MeasureTheory.integral_add_compl hA hf, hf0] have hcompl : ∫ x in Aᶜ, f x ∂ν = -(∫ x in A, f x ∂ν) := by linarith -- `∫|f| = ∫_A |f| + ∫_{Aᶜ} |f|` have habs : Integrable (fun x => |f x|) ν := hf.abs have hsplitabs : ∫ x, |f x| ∂ν = (∫ x in A, |f x| ∂ν) + ∫ x in Aᶜ, |f x| ∂ν := (MeasureTheory.integral_add_compl hA habs).symm -- bound each piece of `f` by `|f|` have hbA : ∫ x in A, f x ∂ν ≤ ∫ x in A, |f x| ∂ν := integral_mono_ae hfA habs.integrableOn (Filter.Eventually.of_forall fun x => le_abs_self _) have hbAc : ∫ x in Aᶜ, f x ∂ν ≤ ∫ x in Aᶜ, |f x| ∂ν := integral_mono_ae hfAc habs.integrableOn (Filter.Eventually.of_forall fun x => le_abs_self _) have hbAneg : -(∫ x in A, f x ∂ν) ≤ ∫ x in A, |f x| ∂ν := by have : ∫ x in A, (-f x) ∂ν ≤ ∫ x in A, |f x| ∂ν := integral_mono_ae hfA.neg habs.integrableOn (Filter.Eventually.of_forall fun x => (neg_le_abs _)) rwa [integral_neg] at this have hbAcneg : -(∫ x in Aᶜ, f x ∂ν) ≤ ∫ x in Aᶜ, |f x| ∂ν := by have : ∫ x in Aᶜ, (-f x) ∂ν ≤ ∫ x in Aᶜ, |f x| ∂ν := integral_mono_ae hfAc.neg habs.integrableOn (Filter.Eventually.of_forall fun x => (neg_le_abs _)) rwa [integral_neg] at this rw [abs_le, hsplitabs] constructor · -- `-(½(∫_A|f| + ∫_{Aᶜ}|f|)) ≤ ∫_A f` nlinarith [hbAneg, hbAc, hcompl] · -- `∫_A f ≤ ½(∫_A|f| + ∫_{Aᶜ}|f|)` nlinarith [hbA, hbAcneg, hcompl]
    Causalean.Stat.abs_setIntegral_le_half_integral_abs_of_integral_eq_zero · Causalean/Stat/Minimax/Scheffe.lean:50
  • measureReal_sub_eq_setIntegral_rnDeriv_sub_one theorem — With density p = dμ/dν and μ ≪ ν, the signed gap μ.real A − ν.real A equals ∫ x in A, (p x − 1) ∂ν.
    Ω :
    shared
    hac :
    μ ≪ ν
    A :
    Set Ω
    _hA :
    μ.real A - ν.real A = ∫ x in A, ((μ.rnDeriv ν x).toReal - 1) ∂ν
    Proof (Lean source)
    theorem measureReal_sub_eq_setIntegral_rnDeriv_sub_one (hac : μ ≪ ν) {A : Set Ω} (_hA : MeasurableSet A) : μ.real A - ν.real A = ∫ x in A, ((μ.rnDeriv ν x).toReal - 1) ∂ν := by have hp : ∫ x in A, (μ.rnDeriv ν x).toReal ∂ν = μ.real A := Measure.setIntegral_toReal_rnDeriv hac A have hint : IntegrableOn (fun x => (μ.rnDeriv ν x).toReal) A ν := (Measure.integrable_toReal_rnDeriv).integrableOn have hc : IntegrableOn (fun _ : Ω => (1:ℝ)) A ν := (integrable_const 1).integrableOn have h1 : ∫ _ in A, (1:ℝ) ∂ν = ν.real A := by rw [setIntegral_const, smul_eq_mul, mul_one, measureReal_def] rw [integral_sub hint hc, hp, h1]
    Causalean.Stat.measureReal_sub_eq_setIntegral_rnDeriv_sub_one · Causalean/Stat/Minimax/Scheffe.lean:94