Stat.Minimax

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

Mixture 115 core · 155 supporting · 6 submodules This file defines finite mixtures of measures with nonnegative extended-real weights. Van­Trees 23 core · 31 supporting · 1 submodule The van Trees inequality and observation-dependent extensions. Multinomial 46 core · 19 supporting · 1 submodule Estimating the L1 distance ‖R − S‖₁ between two probability vectors on k symbols from two independent i.i.d. Side­Information 40 core · 46 supporting · 1 submodule Minimax lower bounds when an estimator has additional side information. Squared­Loss 24 core · 39 supporting · 1 submodule Minimax theory for squared-error estimation, including finite-model results.
Total­Variation 5 core · 15 supporting This file defines the statistical total variation distance between two probability measures on a common measurable space. ★ one_sub_tvDist_le_test★ tvDist_bind_le★ tvDist_compProd_eq★ tvDist_le_half_tsum_singleton_abs

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

The statistical total variation distance between two measures on a sample space equipped with a σ-algebra is the largest absolute difference between their real-valued masses over all measurable events.

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:109 · uses tvDist
theorem tvDist_bind_le reviewed
Causalean.Stat

Given two probability laws and a common Markov reconstruction channel, applying that channel to both laws cannot increase their total variation distance.

Formal statement
tvDist (K ∘ₘ mu) (K ∘ₘ nu) ≤ tvDist mu nu
Proof (Lean source)
theorem tvDist_bind_le {A B : Type*} [MeasurableSpace A] [MeasurableSpace B] (mu nu : Measure A) [IsProbabilityMeasure mu] [IsProbabilityMeasure nu] (K : Kernel A B) [IsMarkovKernel K] : tvDist (K ∘ₘ mu) (K ∘ₘ nu) ≤ tvDist mu nu := by let _ : IsProbabilityMeasure (K ∘ₘ mu) := by infer_instance let _ : IsProbabilityMeasure (K ∘ₘ nu) := by infer_instance unfold tvDist apply ciSup_le rintro ⟨S, hS⟩ have hreal (rho : Measure A) [IsProbabilityMeasure rho] : (K ∘ₘ rho).real S = ∫ x, (K x S).toReal ∂rho := by rw [measureReal_def, Measure.bind_apply hS (Kernel.aemeasurable K), ← integral_toReal (K.measurable_coe hS).aemeasurable] filter_upwards with x exact measure_lt_top (K x) S rw [hreal mu, hreal nu] have hrange : ∀ x, (K x S).toReal ∈ Icc (0 : ℝ) 1 := by intro x constructor · exact ENNReal.toReal_nonneg · have hle := ENNReal.toReal_mono (measure_ne_top (K x) _) (measure_mono (Set.subset_univ S)) simpa using hle simpa only [zero_add, mul_one, tvDist] using tvDist_integral_range mu nu (fun x => (K x S).toReal) (K.measurable_coe hS).ennreal_toReal 0 1 (by norm_num) (by simpa using hrange)
Causalean.Stat.tvDist_bind_le · Causalean/Stat/Minimax/TotalVariation.lean:259 · uses tvDist
theorem tvDist_compProd_eq reviewed
Causalean.Stat

For two probability laws and a common Markov kernel, the joint input-output laws obtained from that kernel have exactly the same total variation distance as the input laws.

Formal statement
tvDist (mu ⊗ₘ K) (nu ⊗ₘ K) = tvDist mu nu
Proof (Lean source)
theorem tvDist_compProd_eq {A B : Type*} [MeasurableSpace A] [MeasurableSpace B] (mu nu : Measure A) [IsProbabilityMeasure mu] [IsProbabilityMeasure nu] (K : Kernel A B) [IsMarkovKernel K] : tvDist (mu ⊗ₘ K) (nu ⊗ₘ K) = tvDist mu nu := by have hjoint_le : tvDist (mu ⊗ₘ K) (nu ⊗ₘ K) ≤ tvDist mu nu := by unfold tvDist apply ciSup_le rintro ⟨T, hT⟩ have hreal (rho : Measure A) [IsProbabilityMeasure rho] : (rho ⊗ₘ K).real T = ∫ x, (K x).real (Prod.mk x ⁻¹' T) ∂rho := by rw [measureReal_def, Measure.compProd_apply hT, ← integral_toReal] · rfl · exact (Kernel.measurable_kernel_prodMk_left hT).aemeasurable · filter_upwards with x exact measure_lt_top (K x) _ rw [hreal mu, hreal nu] have hf : Measurable (fun x => (K x).real (Prod.mk x ⁻¹' T)) := (Kernel.measurable_kernel_prodMk_left hT).ennreal_toReal have hrange : ∀ x, (K x).real (Prod.mk x ⁻¹' T) ∈ Icc (0 : ℝ) (0 + 1) := by intro x exact ⟨measureReal_nonneg, by simpa using (measureReal_le_one (μ := K x) (s := Prod.mk x ⁻¹' T))⟩ simpa only [mul_one, tvDist] using tvDist_integral_range mu nu _ hf 0 1 (by norm_num) hrange have hjoint_ge : tvDist mu nu ≤ tvDist (mu ⊗ₘ K) (nu ⊗ₘ K) := by unfold tvDist apply ciSup_le rintro ⟨S, hS⟩ have hreal (rho : Measure A) [IsProbabilityMeasure rho] : (rho ⊗ₘ K).real (S ×ˢ (Set.univ : Set B)) = rho.real S := by simp [measureReal_def, Measure.compProd_apply_prod hS MeasurableSet.univ] rw [← hreal mu, ← hreal nu] exact abs_measureReal_sub_le_tvDist (hS.prod MeasurableSet.univ) exact le_antisymm hjoint_le hjoint_ge
Causalean.Stat.tvDist_compProd_eq · Causalean/Stat/Minimax/TotalVariation.lean:291 · uses tvDist
lemma tvDist_le_half_tsum_singleton_abs reviewed
Causalean.Stat

For two probability measures on a countable measurable space with measurable singletons, total variation is at most one half of the ℓ¹ distance between their real singleton masses. The result is the half-ℓ¹ upper bound on total variation.

Formal statement
tvDist μ ν ≤ (1 / 2 : ℝ) * ∑' x : α, |μ.real {x} - ν.real {x}|
Proof (Lean source)
lemma tvDist_le_half_tsum_singleton_abs {α : Type*} [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ ν : Measure α) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] : tvDist μ ν ≤ (1 / 2 : ℝ) * ∑' x : α, |μ.real {x} - ν.real {x}| := by let m : α → ℝ := fun x => μ.real {x} let v : α → ℝ := fun x => ν.real {x} let delta : α → ℝ := fun x => m x - v x have hm : Summable m := by apply ENNReal.summable_toReal have h := MeasureTheory.Measure.tsum_indicator_apply_singleton μ (Set.univ : Set α) MeasurableSet.univ simpa [m] using h.trans_ne (measure_ne_top μ Set.univ) have hv : Summable v := by apply ENNReal.summable_toReal have h := MeasureTheory.Measure.tsum_indicator_apply_singleton ν (Set.univ : Set α) MeasurableSet.univ simpa [v] using h.trans_ne (measure_ne_top ν Set.univ) have hdelta : Summable delta := by exact (hm.sub hv).congr fun x => by rfl have habs : Summable (fun x => |delta x|) := by simpa [Real.norm_eq_abs] using hdelta.norm unfold tvDist apply ciSup_le rintro ⟨s, hs⟩ have hmS := hm.indicator s have hvS := hv.indicator s have hmC := hm.indicator sᶜ have hvC := hv.indicator sᶜ have hdS : Summable (s.indicator delta) := hdelta.indicator s have hdC : Summable (sᶜ.indicator delta) := hdelta.indicator sᶜ have haS : Summable (s.indicator fun x => |delta x|) := habs.indicator s have haC : Summable (sᶜ.indicator fun x => |delta x|) := habs.indicator sᶜ have hgapS : μ.real s - ν.real s = ∑' x, s.indicator delta x := by rw [probability_measureReal_eq_tsum_singletons μ s hs, probability_measureReal_eq_tsum_singletons ν s hs, ← hmS.tsum_sub hvS] apply tsum_congr intro x by_cases hx : x ∈ s <;> simp [m, v, delta, indicator, hx] have hgapC : μ.real sᶜ - ν.real sᶜ = ∑' x, sᶜ.indicator delta x := by rw [probability_measureReal_eq_tsum_singletons μ sᶜ hs.compl, probability_measureReal_eq_tsum_singletons ν sᶜ hs.compl, ← hmC.tsum_sub hvC] apply tsum_congr intro x by_cases hx : x ∈ sᶜ <;> simp [m, v, delta, indicator, hx] have hcomp : μ.real sᶜ - ν.real sᶜ = -(μ.real s - ν.real s) := by rw [measureReal_compl hs, measureReal_compl hs, probReal_univ, probReal_univ] ring have hboundS : |μ.real s - ν.real s| ≤ ∑' x, s.indicator (fun x => |delta x|) x := by rw [hgapS, ← Real.norm_eq_abs] have hnormS : Summable fun x => ‖s.indicator delta x‖ := by apply haS.congr intro x by_cases hx : x ∈ s <;> simp [indicator, hx, Real.norm_eq_abs] calc ‖∑' x, s.indicator delta x‖ ≤ ∑' x, ‖s.indicator delta x‖ := norm_tsum_le_tsum_norm hnormS _ = ∑' x, s.indicator (fun x => |delta x|) x := by apply tsum_congr intro x by_cases hx : x ∈ s <;> simp [indicator, hx, Real.norm_eq_abs] have hboundC : |μ.real s - ν.real s| ≤ ∑' x, sᶜ.indicator (fun x => |delta x|) x := by rw [← abs_neg (μ.real s - ν.real s), ← hcomp, hgapC, ← Real.norm_eq_abs] have hnormC : Summable fun x => ‖sᶜ.indicator delta x‖ := by apply haC.congr intro x by_cases hx : x ∈ sᶜ <;> simp [indicator, hx, Real.norm_eq_abs] calc ‖∑' x, sᶜ.indicator delta x‖ ≤ ∑' x, ‖sᶜ.indicator delta x‖ := norm_tsum_le_tsum_norm hnormC _ = ∑' x, sᶜ.indicator (fun x => |delta x|) x := by apply tsum_congr intro x by_cases hx : x ∈ sᶜ <;> simp [indicator, hx, Real.norm_eq_abs] have hsplit : (∑' x, s.indicator (fun x => |delta x|) x) + (∑' x, sᶜ.indicator (fun x => |delta x|) x) = ∑' x, |delta x| := by rw [← haS.tsum_add haC] apply tsum_congr intro x by_cases hx : x ∈ s <;> simp [indicator, hx] rw [show (1 / 2 : ℝ) * ∑' x, |μ.real {x} - ν.real {x}| = (1 / 2 : ℝ) * ∑' x, |delta x| by rfl] calc |μ.real s - ν.real s| ≤ (1 / 2 : ℝ) * ((∑' x, s.indicator (fun x => |delta x|) x) + ∑' x, sᶜ.indicator (fun x => |delta x|) x) := by linarith _ = (1 / 2 : ℝ) * ∑' x, |delta x| := by rw [hsplit]
Causalean.Stat.tvDist_le_half_tsum_singleton_abs · Causalean/Stat/Minimax/TotalVariation.lean:406 · uses tvDist
15 supporting declarations (lemmas, instances)
Chi­Squared 4 core · 11 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. ★ one_add_chiSqDiv_pi_iid★ 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 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 (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:250 · 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:567 · 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:625 · uses chiSqDiv
11 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:68
  • tvDist_le_half_sqrt_chiSqDiv theorem — 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 μ ν.
    Ω :
    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:72
  • 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:124
  • 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:164
  • 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:227
  • 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:241
  • 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 := 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:280
  • one_add_chiSqDiv_pi_iid_general theorem — 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.
    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 (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:367
  • iid_tv_le_one_fifth_of_chiSqDiv lemma — On a measurable sample space, for two probability measures, if the first is absolutely continuous with respect to the second, the squared density deviation is integrable, and the sample size times the one-sample chi-squared divergence is at most one percent, then the total variation distance between their IID product laws is at most one fifth.
    X :
    hac :
    mu ≪ nu
    hint :
    Integrable (fun x => ((mu.rnDeriv nu x).toReal - 1)^2) nu
    n :
    ℕ
    hbudget :
    (n : ℝ) * chiSqDiv mu nu ≤ 1 / 100
    tvDist (Measure.pi (fun _ : Fin n => mu)) (Measure.pi (fun _ : Fin n => nu)) ≤ (1 / 5 : ℝ)
    Proof (Lean source)
    lemma iid_tv_le_one_fifth_of_chiSqDiv {X : Type*} [MeasurableSpace X] (mu nu : Measure X) [IsProbabilityMeasure mu] [IsProbabilityMeasure nu] (hac : mu ≪ nu) (hint : Integrable (fun x => ((mu.rnDeriv nu x).toReal - 1)^2) nu) (n : ℕ) (hbudget : (n : ℝ) * chiSqDiv mu nu ≤ 1 / 100) : tvDist (Measure.pi (fun _ : Fin n => mu)) (Measure.pi (fun _ : Fin n => nu)) ≤ (1 / 5 : ℝ) := by have hchi0 : 0 ≤ chiSqDiv mu nu := Causalean.Stat.chiSqDiv_nonneg have hpowexp : (1 + chiSqDiv mu nu)^n ≤ exp ((n : ℝ) * chiSqDiv mu nu) := by calc _ ≤ (exp (chiSqDiv mu nu))^n := pow_le_pow_left₀ (by linarith) (by simpa [add_comm] using Real.add_one_le_exp (chiSqDiv mu nu)) n _ = _ := by rw [← Real.exp_nat_mul] have hexp : exp ((n : ℝ) * chiSqDiv mu nu) ≤ 100 / 99 := by calc _ ≤ exp (1 / 100 : ℝ) := Real.exp_le_exp.mpr hbudget _ ≤ 1 / (1 - (1 / 100 : ℝ)) := Real.exp_bound_div_one_sub_of_interval (by norm_num) (by norm_num) _ = 100 / 99 := by norm_num have htensor := Causalean.Stat.one_add_chiSqDiv_pi_iid_general mu nu hac hint n have hprodchi : chiSqDiv (Measure.pi (fun _ : Fin n => mu)) (Measure.pi (fun _ : Fin n => nu)) ≤ 4 / 25 := by rw [← htensor] at hpowexp linarith [hpowexp.trans hexp] have htv := tvDist_le_half_sqrt_chiSqDiv (Measure.pi (fun _ : Fin n => mu)) (Measure.pi (fun _ : Fin n => nu)) (pi_iid_absolutelyContinuous mu nu hac n) (pi_iid_integrable_sq_dev mu nu hac hint n) calc _ ≤ (1 / 2 : ℝ) * sqrt (chiSqDiv (Measure.pi (fun _ : Fin n => mu)) (Measure.pi (fun _ : Fin n => nu))) := htv _ ≤ (1 / 2 : ℝ) * sqrt (4 / 25 : ℝ) := mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hprodchi) (by norm_num) _ = 1 / 5 := by rw [show (4 / 25 : ℝ) = (2 / 5 : ℝ)^2 by norm_num, Real.sqrt_sq_eq_abs] norm_num
    Causalean.Stat.iid_tv_le_one_fifth_of_chiSqDiv · Causalean/Stat/Minimax/ChiSquared.lean:400
  • 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:450
  • 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:471
Minimax­Value 10 core · 40 supporting This module provides two sibling families for inf over estimators of sup over the model class of the risk. ★ le_minimaxValueENNReal_of_two_point★ minimaxValueENNReal_mono_class★ le_minimaxValue_of_two_point★ minimaxValue_mono_class_of_nonneg

The minimax value of a statistical decision problem

This module provides two sibling families for `inf over estimators of sup over the model class of the risk. Use minimaxValueENNReal for an ℝ≥0∞` risk when empty or unbounded problems must retain complete-lattice values, and use minimaxValueReal when rates and bounds are stated in ℝ. The conversion minimaxValueENNRealOfReal lets a real-valued pointwise risk use the ℝ≥0∞ family, while its toReal lemmas recover the real family under nonnegativity and finiteness assumptions.

An empty model class has worst-case risk zero, while an empty estimator class has minimax value infinity. These are exactly the bottom and top conventions of the complete lattice ℝ≥0∞.

def worstCaseRiskENNReal reviewed
Causalean.Stat

Given an estimator class, a model class, a nonnegative extended risk for each estimator-model pair, and an estimator, the worst-case risk is the supremum of that estimator's risks over the model class.

Definition (Lean source)
E :
Sort u_1
shared
Θ :
Sort u_3
shared
risk :
E → Θ → ℝ≥0∞
e :
E
worstCaseRiskENNReal risk e :
ℝ≥0∞
⨆ θ : Θ, risk e θ
Causalean.Stat.worstCaseRiskENNReal · Causalean/Stat/Minimax/MinimaxValue.lean:37
def minimaxValueENNReal reviewed
Causalean.Stat

Use the extended-nonnegative minimax value for an estimator class, a model class, and an extended risk when empty or unbounded problems must retain their complete-lattice values.

Definition (Lean source)
E :
Sort u_1
shared
Θ :
Sort u_3
shared
risk :
E → Θ → ℝ≥0∞
minimaxValueENNReal risk :
ℝ≥0∞
⨅ e : E, worstCaseRiskENNReal risk e
Causalean.Stat.minimaxValueENNReal · Causalean/Stat/Minimax/MinimaxValue.lean:43
def worstCaseRiskOfReal reviewed
Causalean.Stat

Given a real-valued risk and an estimator, the lifted worst-case risk first sends every pointwise risk to its nonnegative extended value and then takes the supremum over the model class.

Definition (Lean source)
E :
Sort u_1
shared
Θ :
Sort u_3
shared
risk :
E → Θ → ℝ
e :
E
worstCaseRiskOfReal risk e :
ℝ≥0∞
worstCaseRiskENNReal (fun e θ => ofReal (risk e θ)) e
Causalean.Stat.worstCaseRiskOfReal · Causalean/Stat/Minimax/MinimaxValue.lean:49
def minimaxValueENNRealOfReal reviewed
Causalean.Stat

Use the extended-nonnegative minimax value converted from a real risk for an estimator class, a model class, and a real risk when the pointwise risk is real but complete-lattice minimax semantics are wanted.

Definition (Lean source)
E :
Sort u_1
shared
Θ :
Sort u_3
shared
risk :
E → Θ → ℝ
minimaxValueENNRealOfReal risk :
ℝ≥0∞
minimaxValueENNReal (fun e θ => ofReal (risk e θ))
Causalean.Stat.minimaxValueENNRealOfReal · Causalean/Stat/Minimax/MinimaxValue.lean:55
theorem le_minimaxValueENNReal_of_two_point reviewed
Causalean.Stat

Two-point reduction to the minimax value. For a risk, a candidate lower bound, and two models, if every estimator has at least that much risk at one of the two models, then the minimax value is at least the candidate bound.

Formal statement
E :
Sort u_1
shared
Θ :
Sort u_3
E → Θ → ℝ≥0∞
shared
c :
ℝ≥0∞
θ₀ θ₁ :
Θ
htwo :
∀ e, c ≤ max (risk e θ₀) (risk e θ₁)
Proof (Lean source)
theorem le_minimaxValueENNReal_of_two_point {risk : E → Θ → ℝ≥0∞} {c : ℝ≥0∞} (θ₀ θ₁ : Θ) (htwo : ∀ e, c ≤ max (risk e θ₀) (risk e θ₁)) : c ≤ minimaxValueENNReal risk := by apply le_minimaxValueENNReal intro e exact (htwo e).trans (max_le (le_worstCaseRiskENNReal e θ₀) (le_worstCaseRiskENNReal e θ₁))
Causalean.Stat.le_minimaxValueENNReal_of_two_point · Causalean/Stat/Minimax/MinimaxValue.lean:111 · uses minimaxValueENNReal
theorem minimaxValueENNReal_mono_class reviewed
Causalean.Stat

Restricting the model class cannot raise minimax risk. If a map between model classes makes the first risk no larger than the second risk under pointwise domination, then the first minimax value is no larger.

Formal statement
E :
Sort u_1
shared
Θ :
Sort u_3
shared
Θ' :
Sort u_4
shared
risk :
E → Θ → ℝ≥0∞
risk' :
E → Θ' → ℝ≥0∞
φ :
Θ → Θ'
hle :
∀ e θ, risk e θ ≤ risk' e (φ θ)
Proof (Lean source)
theorem minimaxValueENNReal_mono_class {risk : E → Θ → ℝ≥0∞} {risk' : E → Θ' → ℝ≥0∞} (φ : Θ → Θ') (hle : ∀ e θ, risk e θ ≤ risk' e (φ θ)) : minimaxValueENNReal risk ≤ minimaxValueENNReal risk' := minimaxValueENNReal_le_minimaxValue fun e => ⟨e, worstCaseRiskENNReal_mono_class φ (hle e)⟩
Causalean.Stat.minimaxValueENNReal_mono_class · Causalean/Stat/Minimax/MinimaxValue.lean:147 · uses minimaxValueENNReal
def worstCaseRiskReal 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
worstCaseRiskReal risk e :
ℝ
⨆ θ : Θ, risk e θ
Causalean.Stat.worstCaseRiskReal · Causalean/Stat/Minimax/MinimaxValue.lean:242
def minimaxValueReal reviewed
Causalean.Stat

Use the real minimax value for an estimator class, a model class, and a real-valued risk when rates are stated in ℝ and the required boundedness and nonemptiness side conditions are available.

Definition (Lean source)
E :
Sort u_1
shared
Θ :
Sort u_3
shared
risk :
E → Θ → ℝ
minimaxValueReal risk :
ℝ
⨅ e : E, worstCaseRiskReal risk e
Causalean.Stat.minimaxValueReal · Causalean/Stat/Minimax/MinimaxValue.lean:251
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 ≤ minimaxValueReal 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 ≤ minimaxValueReal 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:400 · uses minimaxValueReal
theorem minimaxValue_mono_class_of_nonneg reviewed
Causalean.Stat

For a map φ from the parameter class of the first problem to 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 (φ θ)
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 (φ θ)) : minimaxValueReal risk ≤ minimaxValueReal 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:470 · uses minimaxValueReal
40 supporting declarations (lemmas, instances)
Minimax­Risk 5 core · 8 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★ 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:58 · 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:84 · 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:100 · 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 Bochner integral of the estimator's squared error. Beware that Lean's Bochner integral silently assigns value zero to a non-integrable loss; use sqRiskLIntegral when risk should be extended-valued and non-integrable loss should read as infinity.

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:188
8 supporting declarations (lemmas, instances)
  • two_point_lower_bound_of_tvDist_le theorem — 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.
    Ω :
    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:71
  • 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:118
  • 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:139
  • 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:197
  • 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:208
  • 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:220
  • 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:246
  • 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:273
Assouad 8 core · 8 supporting This file develops Assouad's lower bound for statistical experiments indexed by a Boolean hypercube. ★ assouad_average★ assouad_exists★ assouad_parameter_risk★ assouad_parameter_risk_of_measurable

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:44
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:52
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}
β :
ℝ
hβ :
∀ 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 neighbours — some 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}
β :
ℝ
hβ :
∀ 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]
def parameterRiskLIntegral reviewed
Causalean.Stat

Given a family of experiment laws, parameter vertices, a parameter-valued estimator, and a true cube vertex, the extended expected metric risk is the lintegral of the estimator's distance from the true parameter.

Definition (Lean source)
Ω :
Type u_1
shared
d :
ℕ
shared
Θ :
P :
(Fin d → Bool) → Measure Ω
θ :
(Fin d → Bool) → Θ
θhat :
Ω → Θ
τ :
Fin d → Bool
parameterRiskLIntegral P θ θhat τ :
∫⁻ ω, ofReal (dist (θhat ω) (θ τ)) ∂(P τ)
Causalean.Stat.parameterRiskLIntegral · Causalean/Stat/Minimax/Assouad.lean:211
theorem assouad_parameter_risk reviewed
Causalean.Stat

Assouad's lemma in parameter-risk form. For hypercube laws, parameter vertices, a nonnegative separation scale, an estimator, and a measurable nearest-vertex decoder, if vertices are separated by twice the scale times Hamming distance and neighboring laws have total variation at most β, then some vertex has expected metric loss at least (d*s/2)(1-β).

Formal statement
Ω :
Type u_1
shared
d :
ℕ
shared
P :
(Fin d → Bool) → Measure Ω
∀ τ, IsProbabilityMeasure (P τ)
θ :
(Fin d → Bool) → Θ
s β :
ℝ
hs :
0 ≤ s
θhat :
Ω → Θ
decode :
Ω → Fin d → Bool
hdecode :
∀ j (b : Bool), MeasurableSet {ω | decode ω j = b}
hnearest :
∀ ω τ, dist (θhat ω) (θ (decode ω)) ≤ dist (θhat ω) (θ τ)
hsep :
∀ τ σ, 2 * s * (∑ j, if τ j ≠ σ j then (1 : ℝ) else 0) ≤ dist (θ τ) (θ σ)
hβ :
∀ j τ, tvDist (P τ) (P (flipBit j τ)) ≤ β
∃ τ, ofReal ((d * s / 2 : ℝ) * (1 - β)) ≤ parameterRiskLIntegral P θ θhat τ
Proof (Lean source)
theorem assouad_parameter_risk {Θ : Type*} [PseudoMetricSpace Θ] [MeasurableSpace Θ] [BorelSpace Θ] (P : (Fin d → Bool) → Measure Ω) [∀ τ, IsProbabilityMeasure (P τ)] (θ : (Fin d → Bool) → Θ) {s β : ℝ} (hs : 0 ≤ s) (θhat : Ω → Θ) (decode : Ω → Fin d → Bool) (hdecode : ∀ j (b : Bool), MeasurableSet {ω | decode ω j = b}) (hnearest : ∀ ω τ, dist (θhat ω) (θ (decode ω)) ≤ dist (θhat ω) (θ τ)) (hsep : ∀ τ σ, 2 * s * (∑ j, if τ j ≠ σ j then (1 : ℝ) else 0) ≤ dist (θ τ) (θ σ)) (hβ : ∀ j τ, tvDist (P τ) (P (flipBit j τ)) ≤ β) : ∃ τ, ofReal ((d * s / 2 : ℝ) * (1 - β)) ≤ parameterRiskLIntegral P θ θhat τ := by classical obtain ⟨τ, hτ⟩ := assouad_exists P decode hdecode hβ refine ⟨τ, ?_⟩ let count : Ω → ℝ := fun ω => ∑ j, if decode ω j ≠ τ j then 1 else 0 have hcount_nonneg : ∀ ω, 0 ≤ count ω := by intro ω apply Finset.sum_nonneg intro j hj split_ifs <;> norm_num have hgeom : ∀ ω, s * count ω ≤ dist (θhat ω) (θ τ) := by intro ω have htriangle : dist (θ (decode ω)) (θ τ) ≤ dist (θhat ω) (θ (decode ω)) + dist (θhat ω) (θ τ) := by calc dist (θ (decode ω)) (θ τ) ≤ dist (θ (decode ω)) (θhat ω) + dist (θhat ω) (θ τ) := dist_triangle _ _ _ _ = dist (θhat ω) (θ (decode ω)) + dist (θhat ω) (θ τ) := by rw [dist_comm (θ (decode ω)) (θhat ω)] have htwo : 2 * s * count ω ≤ 2 * dist (θhat ω) (θ τ) := by calc 2 * s * count ω ≤ dist (θ (decode ω)) (θ τ) := by simpa [count] using hsep (decode ω) τ _ ≤ 2 * dist (θhat ω) (θ τ) := by linarith [htriangle, hnearest ω τ] linarith have hRiskCount : ofReal (hammingRisk P decode τ) = ∫⁻ ω, ofReal (count ω) ∂(P τ) := by rw [hammingRisk, ENNReal.ofReal_sum_of_nonneg] · calc ∑ j, ofReal ((P τ).real { ω | decode ω j ≠ τ j }) = ∑ j, ∫⁻ ω, if decode ω j ≠ τ j then (1 : ENNReal) else 0 ∂(P τ) := by apply Finset.sum_congr rfl intro j hj rw [MeasureTheory.Measure.real_def, ENNReal.ofReal_toReal (measure_ne_top (P τ) _)] have hset := measurableSet_decode_ne decode hdecode j (τ j) rw [← lintegral_indicator_one hset] apply lintegral_congr intro ω simp [indicator, apply_ite] _ = ∫⁻ ω, ∑ j, if decode ω j ≠ τ j then (1 : ENNReal) else 0 ∂(P τ) := by rw [lintegral_finset_sum] intro j hj exact Measurable.ite (measurableSet_decode_ne decode hdecode j (τ j)) measurable_const measurable_const _ = ∫⁻ ω, ofReal (count ω) ∂(P τ) := by apply lintegral_congr intro ω change (∑ j, if decode ω j ≠ τ j then (1 : ENNReal) else 0) = ofReal (∑ j, if decode ω j ≠ τ j then (1 : ℝ) else 0) rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro j hj split_ifs <;> simp · intro j hj split_ifs <;> norm_num · intro j hj exact measureReal_nonneg calc ofReal ((d * s / 2 : ℝ) * (1 - β)) = ofReal (s * ((d / 2 : ℝ) * (1 - β))) := by ring_nf _ ≤ ofReal (s * hammingRisk P decode τ) := ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_left hτ hs) _ = ofReal s * ∫⁻ ω, ofReal (count ω) ∂(P τ) := by rw [ENNReal.ofReal_mul hs, hRiskCount] _ = ∫⁻ ω, ofReal (s * count ω) ∂(P τ) := by have hcount_meas : Measurable (fun ω => ofReal (count ω)) := by apply Measurable.ennreal_ofReal change Measurable (fun ω => ∑ j, if decode ω j ≠ τ j then 1 else 0) exact Finset.measurable_sum univ fun j hj => Measurable.ite (measurableSet_decode_ne decode hdecode j (τ j)) measurable_const measurable_const rw [← lintegral_const_mul _ hcount_meas] apply lintegral_congr intro ω rw [ENNReal.ofReal_mul hs] _ ≤ parameterRiskLIntegral P θ θhat τ := by unfold parameterRiskLIntegral apply lintegral_mono intro ω exact ENNReal.ofReal_le_ofReal (hgeom ω)
theorem assouad_parameter_risk_of_measurable reviewed
Causalean.Stat

Assouad parameter-risk bound with the decoder constructed automatically. For hypercube laws, parameter vertices, a nonnegative separation scale, and a measurable parameter estimator, if vertices are separated by twice the scale times Hamming distance and neighboring laws have total variation at most β, then some vertex has expected metric loss at least (d*s/2)(1-β).

Formal statement
Ω :
Type u_1
shared
d :
ℕ
shared
P :
(Fin d → Bool) → Measure Ω
∀ τ, IsProbabilityMeasure (P τ)
θ :
(Fin d → Bool) → Θ
s β :
ℝ
hs :
0 ≤ s
θhat :
Ω → Θ
hθhat :
hsep :
∀ τ σ, 2 * s * (∑ j, if τ j ≠ σ j then (1 : ℝ) else 0) ≤ dist (θ τ) (θ σ)
hβ :
∀ j τ, tvDist (P τ) (P (flipBit j τ)) ≤ β
∃ τ, ofReal ((d * s / 2 : ℝ) * (1 - β)) ≤ parameterRiskLIntegral P θ θhat τ
Proof (Lean source)
theorem assouad_parameter_risk_of_measurable {Θ : Type*} [PseudoMetricSpace Θ] [MeasurableSpace Θ] [BorelSpace Θ] (P : (Fin d → Bool) → Measure Ω) [∀ τ, IsProbabilityMeasure (P τ)] (θ : (Fin d → Bool) → Θ) {s β : ℝ} (hs : 0 ≤ s) (θhat : Ω → Θ) (hθhat : Measurable θhat) (hsep : ∀ τ σ, 2 * s * (∑ j, if τ j ≠ σ j then (1 : ℝ) else 0) ≤ dist (θ τ) (θ σ)) (hβ : ∀ j τ, tvDist (P τ) (P (flipBit j τ)) ≤ β) : ∃ τ, ofReal ((d * s / 2 : ℝ) * (1 - β)) ≤ parameterRiskLIntegral P θ θhat τ := by obtain ⟨decode, hdecode, hnearest⟩ := exists_measurable_nearestVertex θ θhat hθhat apply assouad_parameter_risk P θ hs θhat decode · intro j b exact measurableSet_eq_fun ((measurable_pi_apply j).comp hdecode) measurable_const · exact hnearest · exact hsep · exact hβ
Causalean.Stat.assouad_parameter_risk_of_measurable · Causalean/Stat/Minimax/Assouad.lean:324 · uses flipBit , parameterRiskLIntegral , tvDist
8 supporting declarations (lemmas, instances)
  • flipBit_self theorem — Flipping a coordinate changes that coordinate to the opposite Boolean value.
    d :
    ℕ
    shared
    j :
    Fin d
    τ :
    Fin d → Bool
    flipBit j τ j = !τ j
    Proof (Lean source)
    @[simp] theorem flipBit_self (j : Fin d) (τ : Fin d → Bool) : flipBit j τ j = !τ j := Function.update_self _ _ _
    Causalean.Stat.flipBit_self · Causalean/Stat/Minimax/Assouad.lean:32
  • flipBit_involutive theorem — Flipping the same coordinate twice is the identity.
    d :
    ℕ
    shared
    j :
    Fin d
    Proof (Lean source)
    theorem flipBit_involutive (j : Fin d) : Involutive (flipBit j) := by intro τ funext k by_cases h : k = j · subst h; simp [flipBit] · simp [flipBit, Function.update_of_ne h]
    Causalean.Stat.flipBit_involutive · Causalean/Stat/Minimax/Assouad.lean:36
  • flipPerm_apply theorem — The coordinate-flip permutation acts by flipping that coordinate.
    d :
    ℕ
    shared
    j :
    Fin d
    τ :
    Fin d → Bool
    flipPerm j τ = flipBit j τ
    Proof (Lean source)
    @[simp] theorem flipPerm_apply (j : Fin d) (τ : Fin d → Bool) : flipPerm j τ = flipBit j τ := rfl
    Causalean.Stat.flipPerm_apply · Causalean/Stat/Minimax/Assouad.lean:48
  • measurableSet_decode_ne theorem — Coordinate-decoding error sets are measurable, being complements of the measurable level sets {ω | est ω j = b}.
    Ω :
    Type u_1
    shared
    d :
    ℕ
    shared
    est :
    Ω → Fin d → Bool
    shared
    hmeas :
    ∀ j (b : Bool), MeasurableSet {ω | est ω j = b}
    j :
    Fin d
    b :
    MeasurableSet {ω | est ω j ≠ b}
    Proof (Lean source)
    theorem measurableSet_decode_ne (hmeas : ∀ j (b : Bool), MeasurableSet {ω | est ω j = b}) (j : Fin d) (b : Bool) : MeasurableSet {ω | est ω j ≠ b} := by have h : {ω | est ω j ≠ b} = {ω | est ω j = b}ᶜ := by ext ω; simp rw [h]; exact (hmeas j b).compl
    Causalean.Stat.measurableSet_decode_ne · Causalean/Stat/Minimax/Assouad.lean:60
  • decode_ne_flip_compl theorem — The j-th decoding-error set at the flipped vertex is the complement of the one at τ: the estimator's j-th bit either matches τ j or its flip, never both.
    Ω :
    Type u_1
    shared
    d :
    ℕ
    shared
    est :
    Ω → Fin d → Bool
    shared
    j :
    Fin d
    τ :
    Fin d → Bool
    {ω | est ω j ≠ (flipBit j τ) j} = {ω | est ω j ≠ τ j}ᶜ
    Proof (Lean source)
    theorem decode_ne_flip_compl (j : Fin d) (τ : Fin d → Bool) : {ω | est ω j ≠ (flipBit j τ) j} = {ω | est ω j ≠ τ j}ᶜ := by have boollem : ∀ a b : Bool, (a ≠ !b) ↔ (a = b) := by decide ext ω simp only [Set.mem_compl_iff, Set.mem_setOf_eq, flipBit_self, not_not] exact boollem (est ω j) (τ j)
    Causalean.Stat.decode_ne_flip_compl · Causalean/Stat/Minimax/Assouad.lean:67
  • hammingRisk_pair_ge theorem — Per-coordinate pair bound. For each vertex τ, the coordinate-j error mass at τ plus the one at its j-flip is at least 1 − tvDist (P τ) (P (flip j τ)). This is the two-point testing bound applied to the j-th decoded bit.
    Ω :
    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 :
    Fin d
    τ :
    Fin d → Bool
    1 - tvDist (P τ) (P (flipBit j τ))
    ≤ (P τ).real {ω | est ω j ≠ τ j} + (P (flipBit j τ)).real {ω | est ω j ≠ (flipBit j τ) j}
    Proof (Lean source)
    theorem hammingRisk_pair_ge (hmeas : ∀ j (b : Bool), MeasurableSet {ω | est ω j = b}) (j : Fin d) (τ : Fin d → Bool) : 1 - tvDist (P τ) (P (flipBit j τ)) ≤ (P τ).real {ω | est ω j ≠ τ j} + (P (flipBit j τ)).real {ω | est ω j ≠ (flipBit j τ) j} := by have hS : MeasurableSet {ω | est ω j ≠ τ j} := measurableSet_decode_ne est hmeas j (τ j) rw [decode_ne_flip_compl est j τ] exact one_sub_tvDist_le_test (μ := P τ) (ν := P (flipBit j τ)) hS
    Causalean.Stat.hammingRisk_pair_ge · Causalean/Stat/Minimax/Assouad.lean:76
  • sum_decode_ge theorem — Per-coordinate lower bound. Summed over the cube, the coordinate-j error mass is at least half the cube-sum of 1 − tvDist (P τ) (P (flip j τ)), via pairing each vertex with its j-flip (an involution that preserves the sum).
    Ω :
    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 :
    Fin d
    ∑ τ, (1 - tvDist (P τ) (P (flipBit j τ))) ≤ 2 * ∑ τ, (P τ).real {ω | est ω j ≠ τ j}
    Proof (Lean source)
    theorem sum_decode_ge (hmeas : ∀ j (b : Bool), MeasurableSet {ω | est ω j = b}) (j : Fin d) : ∑ τ, (1 - tvDist (P τ) (P (flipBit j τ))) ≤ 2 * ∑ τ, (P τ).real {ω | est ω j ≠ τ j} := by -- Reindexing by the `j`-flip permutation leaves the cube-sum invariant. have hreindex : ∑ τ, (P (flipBit j τ)).real {ω | est ω j ≠ (flipBit j τ) j} = ∑ τ, (P τ).real {ω | est ω j ≠ τ j} := Equiv.sum_comp (flipPerm j) (fun σ => (P σ).real {ω | est ω j ≠ σ j}) calc ∑ τ, (1 - tvDist (P τ) (P (flipBit j τ))) ≤ ∑ τ, ((P τ).real {ω | est ω j ≠ τ j} + (P (flipBit j τ)).real {ω | est ω j ≠ (flipBit j τ) j}) := Finset.sum_le_sum (fun τ _ => hammingRisk_pair_ge P est hmeas j τ) _ = (∑ τ, (P τ).real {ω | est ω j ≠ τ j}) + ∑ τ, (P (flipBit j τ)).real {ω | est ω j ≠ (flipBit j τ) j} := Finset.sum_add_distrib _ = 2 * ∑ τ, (P τ).real {ω | est ω j ≠ τ j} := by rw [hreindex]; ring
    Causalean.Stat.sum_decode_ge · Causalean/Stat/Minimax/Assouad.lean:88
  • exists_measurable_nearestVertex theorem — Given a finite family of parameter vertices, a measurable parameter-valued estimator, there exists a measurable, deterministically tie-broken nearest-vertex decoder: at every observation its chosen vertex is no farther from the estimator than any competing vertex.
    Ω :
    Type u_1
    shared
    d :
    ℕ
    shared
    θ :
    (Fin d → Bool) → Θ
    θhat :
    Ω → Θ
    hθhat :
    ∃ decode : Ω → Fin d → Bool,
    Measurable decode
    conclusion 1
    ω τ :
    dist (θhat ω) (θ (decode ω)) ≤ dist (θhat ω) (θ τ)
    Proof (Lean source)
    theorem exists_measurable_nearestVertex {Θ : Type*} [PseudoMetricSpace Θ] [MeasurableSpace Θ] [BorelSpace Θ] (θ : (Fin d → Bool) → Θ) (θhat : Ω → Θ) (hθhat : Measurable θhat) : ∃ decode : Ω → Fin d → Bool, Measurable decode ∧ ∀ ω τ, dist (θhat ω) (θ (decode ω)) ≤ dist (θhat ω) (θ τ) := by classical let Cube := Fin d → Bool have hcard : 1 ≤ card Cube := Fintype.card_pos_iff.mpr ⟨fun _ => false⟩ let n : ℕ := card Cube - 1 have hcard_eq : card Cube = n + 1 := by dsimp [n] omega let e : Cube ≃ Fin (n + 1) := (Fintype.equivFin Cube).trans (finCongr hcard_eq) let scores : Ω → Fin (n + 1) → ℝ := fun ω i => dist (θhat ω) (θ (e.symm i)) let selected : Ω → Fin (n + 1) := fun ω => leastScoreIndex (scores ω) let decode : Ω → Cube := fun ω => e.symm (selected ω) have hscores : Measurable scores := by apply measurable_pi_lambda intro i exact (continuous_id.dist continuous_const).measurable.comp hθhat have hselected : Measurable selected := measurable_leastScoreIndex.comp hscores have heinv : Measurable e.symm := measurable_of_finite _ refine ⟨decode, heinv.comp hselected, ?_⟩ intro ω τ simpa [decode, selected, scores] using leastScoreIndex_minimal (scores ω) (e τ)
    Causalean.Stat.exists_measurable_nearestVertex · Causalean/Stat/Minimax/Assouad.lean:178
Fano 5 core · 15 supporting This file connects finite-alphabet entropy Fano to general measurable statistical experiments. ★ fano_average_error★ fano_exists_error

Fano lower bounds for general measurable experiments

This file connects finite-alphabet entropy Fano to general measurable statistical experiments. The main bounds use the uniform-prior mutual information card(ι)⁻¹ ∑ᵢ KL(Pᵢ ‖ P̄), where P̄ is the uniform mixture, and therefore retain the logarithmic packing-size gain used in minimax lower bounds.

The earlier total-variation union bound remains available under the explicit tv_multiple_testing_* names; it is not an entropy Fano inequality.

References: Tsybakov (2009), Theorem 2.5 and Corollary 2.6; Yu (1997), Lemma 3; Wainwright (2019), Proposition 15.12.

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:35
def uniformMixture reviewed
Causalean.Stat

For a nonempty finite family of experiment laws, the uniform mixture law assigns weight 1 / card ι to every member of the family.

Definition (Lean source)
Ω :
Type u_1
shared
ι :
Type u_3
shared
P :
ι → Measure Ω
shared
Nonempty ι
uniformMixture P :
mixture (fun _ : ι => (Fintype.card ι : ℝ≥0∞)⁻¹) P
Causalean.Stat.uniformMixture · Causalean/Stat/Minimax/Fano.lean:83
def uniformMutualInformation reviewed
Causalean.Stat

For a nonempty finite family of experiment laws, the uniform-prior mutual information is the average Kullback--Leibler divergence from each law to their uniform mixture.

Definition (Lean source)
Ω :
Type u_1
shared
ι :
Type u_3
shared
P :
ι → Measure Ω
shared
Nonempty ι
uniformMutualInformation P :
ℝ
(Fintype.card ι : ℝ)⁻¹ * ∑ i, (_root_.InformationTheory.klDiv (P i) (uniformMixture P)).toReal
Causalean.Stat.uniformMutualInformation · Causalean/Stat/Minimax/Fano.lean:121
theorem fano_average_error reviewed
Causalean.Stat

Fano's average-error lower bound. For a measurable estimator, a finite experiment, and parameter values that are pairwise separated by at least 2s, assuming the hypothesis count is at least two, the average probability of estimation error at radius s is at least 1 - (I(V;X) + log 2) / log(card ι).

Formal statement
Ω :
Type u_1
shared
Θ :
Type u_2
shared
ι :
Type u_3
shared
P :
ι → Measure Ω
shared
Nonempty ι
est :
Ω → Θ
hest :
θ :
ι → Θ
s :
ℝ
hsep :
∀ i k
if
i ≠ k
then
2 * s ≤ dist (θ i) (θ k)
hcard :
2 ≤ Fintype.card ι
1 - (uniformMutualInformation P + log 2) / log (Fintype.card ι)
≤ (Fintype.card ι : ℝ)⁻¹ * ∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)}
Proof (Lean source)
theorem fano_average_error [Nonempty ι] {est : Ω → Θ} (hest : Measurable est) {θ : ι → Θ} {s : ℝ} (hsep : ∀ i k, i ≠ k → 2 * s ≤ dist (θ i) (θ k)) (hcard : 2 ≤ Fintype.card ι) : 1 - (uniformMutualInformation P + log 2) / log (Fintype.card ι) ≤ (Fintype.card ι : ℝ)⁻¹ * ∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)} := by letI : MeasurableSpace ι := ⊤ have hmeas : ∀ i, MeasurableSet (acceptanceRegion est (θ i) s) := fun i => measurableSet_acceptanceRegion hest (θ i) s obtain ⟨decode, hdecode, hagree⟩ := exists_measurable_piecewise (fun i => acceptanceRegion est (θ i) s) hmeas (fun i _ω => i) (fun _i => measurable_const) (by intro i k hik ω hω exact (Set.disjoint_left.mp (acceptanceRegion_disjoint (est := est) (hsep i k hik)) hω.1 hω.2).elim) have hdecoder := fano_decoder_average_error P hcard decode hdecode refine le_trans hdecoder ?_ apply mul_le_mul_of_nonneg_left _ (by positivity) apply Finset.sum_le_sum intro i _hi refine measureReal_mono ?_ (measure_ne_top _ _) intro ω hω by_contra hgood have hacc : ω ∈ acceptanceRegion est (θ i) s := by simpa [acceptanceRegion, not_le] using hgood exact hω (hagree i hacc)
Causalean.Stat.fano_average_error · Causalean/Stat/Minimax/Fano.lean:521 · uses uniformMutualInformation
theorem fano_exists_error reviewed
Causalean.Stat

Fano's worst-hypothesis lower bound. Under measurability of the estimator, pairwise 2s separation, and at least two hypotheses, some experiment law assigns error probability at least 1 - (I(V;X) + log 2) / log(card ι).

Formal statement
Ω :
Type u_1
shared
Θ :
Type u_2
shared
ι :
Type u_3
shared
P :
ι → Measure Ω
shared
Nonempty ι
est :
Ω → Θ
hest :
θ :
ι → Θ
s :
ℝ
hsep :
∀ i k
if
i ≠ k
then
2 * s ≤ dist (θ i) (θ k)
hcard :
2 ≤ card ι
∃ i,
≤ (P i).real {ω | s ≤ dist (est ω) (θ i)}
Proof (Lean source)
theorem fano_exists_error [Nonempty ι] {est : Ω → Θ} (hest : Measurable est) {θ : ι → Θ} {s : ℝ} (hsep : ∀ i k, i ≠ k → 2 * s ≤ dist (θ i) (θ k)) (hcard : 2 ≤ Fintype.card ι) : ∃ i, 1 - (uniformMutualInformation P + log 2) / log (Fintype.card ι) ≤ (P i).real {ω | s ≤ dist (est ω) (θ i)} := by let B := 1 - (uniformMutualInformation P + log 2) / log (Fintype.card ι) have havg := fano_average_error P hest hsep hcard by_contra hcon push Not at hcon have hcardpos : 0 < (Fintype.card ι : ℝ) := by positivity have hstrict : ∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)} < (Fintype.card ι : ℝ) * B := by calc ∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)} < ∑ _i : ι, B := Finset.sum_lt_sum_of_nonempty univ_nonempty (fun i _hi => hcon i) _ = (Fintype.card ι : ℝ) * B := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] dsimp [B] at hstrict ⊢ have hmul := mul_le_mul_of_nonneg_left havg hcardpos.le have hcardne : (Fintype.card ι : ℝ) ≠ 0 := ne_of_gt hcardpos have hcancel : (Fintype.card ι : ℝ) * ((Fintype.card ι : ℝ)⁻¹ * ∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)}) = ∑ i, (P i).real {ω | s ≤ dist (est ω) (θ i)} := by field_simp [hcardne] rw [hcancel] at hmul exact (not_lt_of_ge hmul) hstrict
Causalean.Stat.fano_exists_error · Causalean/Stat/Minimax/Fano.lean:560 · uses uniformMutualInformation
15 supporting declarations (lemmas, instances)
  • measurableSet_acceptanceRegion theorem — A measurable estimator has a measurable acceptance region around any target.
    Ω :
    Type u_1
    shared
    Θ :
    Type u_2
    Ω → Θ
    shared
    hest :
    θ :
    Θ
    s :
    ℝ
    Proof (Lean source)
    theorem measurableSet_acceptanceRegion {est : Ω → Θ} (hest : Measurable est) (θ : Θ) (s : ℝ) : MeasurableSet (acceptanceRegion est θ s) := by have h : acceptanceRegion est θ s = {ω | s ≤ dist (est ω) θ}ᶜ := by ext ω; simp [acceptanceRegion, not_le] rw [h] exact (measurableSet_error hest θ s).compl
    Causalean.Stat.measurableSet_acceptanceRegion · Causalean/Stat/Minimax/Fano.lean:43
  • acceptanceRegion_compl theorem — The acceptance region is the complement of the error region.
    Ω :
    Type u_1
    shared
    Θ :
    Type u_2
    shared
    est :
    Ω → Θ
    θ :
    Θ
    s :
    ℝ
    (acceptanceRegion est θ s)ᶜ = {ω | s ≤ dist (est ω) θ}
    Proof (Lean source)
    theorem acceptanceRegion_compl (est : Ω → Θ) (θ : Θ) (s : ℝ) : (acceptanceRegion est θ s)ᶜ = {ω | s ≤ dist (est ω) θ} := by ext ω; simp [acceptanceRegion, not_lt]
    Causalean.Stat.acceptanceRegion_compl · Causalean/Stat/Minimax/Fano.lean:52
  • acceptanceRegion_disjoint theorem — Disjointness of acceptance regions. If two target values are 2s-separated, their acceptance regions are disjoint: a point within s of both would force the targets within 2s of each other.
    Ω :
    Type u_1
    shared
    Θ :
    Type u_2
    Ω → Θ
    Θ
    shared
    s :
    ℝ
    hsep :
    2 * s ≤ dist θ₀ θ₁
    Disjoint (acceptanceRegion est θ₀ s) (acceptanceRegion est θ₁ s)
    Proof (Lean source)
    theorem acceptanceRegion_disjoint {est : Ω → Θ} {θ₀ θ₁ : Θ} {s : ℝ} (hsep : 2 * s ≤ dist θ₀ θ₁) : Disjoint (acceptanceRegion est θ₀ s) (acceptanceRegion est θ₁ s) := by rw [Set.disjoint_left] intro ω h0 h1 have h0' : dist (est ω) θ₀ < s := h0 have h1' : dist (est ω) θ₁ < s := h1 have htri : dist θ₀ θ₁ ≤ dist (est ω) θ₀ + dist (est ω) θ₁ := by simpa [dist_comm] using dist_triangle θ₀ (est ω) θ₁ linarith
    Causalean.Stat.acceptanceRegion_disjoint · Causalean/Stat/Minimax/Fano.lean:58
  • acceptanceRegion_pairwiseDisjoint theorem — Pairwise disjointness of the acceptance regions of a 2s-separated family.
    Ω :
    Type u_1
    shared
    Θ :
    Type u_2
    shared
    ι :
    Type u_3
    shared
    est :
    Ω → Θ
    θ :
    ι → Θ
    s :
    ℝ
    hsep :
    ∀ i k
    if
    i ≠ k
    then
    2 * s ≤ dist (θ i) (θ k)
    Pairwise (onFun Disjoint (fun i => acceptanceRegion est (θ i) s))
    Proof (Lean source)
    theorem acceptanceRegion_pairwiseDisjoint {est : Ω → Θ} {θ : ι → Θ} {s : ℝ} (hsep : ∀ i k, i ≠ k → 2 * s ≤ dist (θ i) (θ k)) : Pairwise (onFun Disjoint (fun i => acceptanceRegion est (θ i) s)) := fun i k hik => acceptanceRegion_disjoint (hsep i k hik)
    Causalean.Stat.acceptanceRegion_pairwiseDisjoint · Causalean/Stat/Minimax/Fano.lean:75
  • uniformMixture_isProbabilityMeasure theorem — The uniform mixture of probability laws is itself a probability law.
    Ω :
    Type u_1
    shared
    ι :
    Type u_3
    shared
    P :
    ι → Measure Ω
    shared
    Nonempty ι
    IsProbabilityMeasure (uniformMixture P)
    Proof (Lean source)
    theorem uniformMixture_isProbabilityMeasure [Nonempty ι] : IsProbabilityMeasure (uniformMixture P) := by exact mixture_isProbabilityMeasure _ uniformWeight_sum P
    Causalean.Stat.uniformMixture_isProbabilityMeasure · Causalean/Stat/Minimax/Fano.lean:94
  • absolutelyContinuous_uniformMixture lemma — Every member P i of a nonempty finite experiment is absolutely continuous with respect to the uniform mixture.
    Ω :
    Type u_1
    shared
    ι :
    Type u_3
    shared
    P :
    ι → Measure Ω
    shared
    Nonempty ι
    i :
    ι
    P i ≪ uniformMixture P
    Proof (Lean source)
    lemma absolutelyContinuous_uniformMixture [Nonempty ι] (i : ι) : P i ≪ uniformMixture P := by apply Measure.AbsolutelyContinuous.mk intro A hA hzero have hsumzero : ∑ j, (Fintype.card ι : ℝ≥0∞)⁻¹ * P j A = 0 := by simpa [uniformMixture, mixture_apply] using hzero have htermle : (Fintype.card ι : ℝ≥0∞)⁻¹ * P i A ≤ ∑ j, (Fintype.card ι : ℝ≥0∞)⁻¹ * P j A := Finset.single_le_sum (f := fun j => (Fintype.card ι : ℝ≥0∞)⁻¹ * P j A) (fun _j _ => zero_le) (Finset.mem_univ i) have htermzero : (Fintype.card ι : ℝ≥0∞)⁻¹ * P i A = 0 := by apply le_antisymm · exact hsumzero ▸ htermle · exact zero_le exact (mul_eq_zero.mp htermzero).resolve_left (by simp)
    Causalean.Stat.absolutelyContinuous_uniformMixture · Causalean/Stat/Minimax/Fano.lean:100
  • uniformComponent_le_card_smul_mixture lemma — For a nonempty finite family of measures and an index, the indexed measure is bounded by the cardinality times the uniform mixture.
    Ω :
    Type u_1
    shared
    ι :
    Type u_3
    shared
    P :
    ι → Measure Ω
    shared
    Nonempty ι
    i :
    ι
    P i ≤ (Fintype.card ι : NNReal) • uniformMixture P
    Proof (Lean source)
    lemma uniformComponent_le_card_smul_mixture [Nonempty ι] (i : ι) : P i ≤ (Fintype.card ι : NNReal) • uniformMixture P := by apply Measure.le_iff.2 intro A _hA change P i A ≤ (Fintype.card ι : ENNReal) * uniformMixture P A rw [uniformMixture, mixture_apply (fun _ : ι => (Fintype.card ι : ENNReal)⁻¹) P A] have hterm : (Fintype.card ι : ENNReal)⁻¹ * P i A ≤ ∑ j, (Fintype.card ι : ENNReal)⁻¹ * P j A := Finset.single_le_sum (f := fun j => (Fintype.card ι : ENNReal)⁻¹ * P j A) (fun _j _ => zero_le) (Finset.mem_univ i) calc P i A = (Fintype.card ι : ENNReal) * ((Fintype.card ι : ENNReal)⁻¹ * P i A) := by rw [← mul_assoc, ENNReal.mul_inv_cancel (by simp [Fintype.card_ne_zero]) (by simp), one_mul] _ ≤ (Fintype.card ι : ENNReal) * ∑ j, (Fintype.card ι : ENNReal)⁻¹ * P j A := by gcongr
    Causalean.Stat.uniformComponent_le_card_smul_mixture · Causalean/Stat/Minimax/Fano.lean:132
  • rnDeriv_uniformMixture_toReal_le_card lemma — For a nonempty finite family of measures and an index, the Radon--Nikodym density of that component with respect to the uniform mixture is at most the family cardinality almost everywhere.
    Ω :
    Type u_1
    shared
    ι :
    Type u_3
    shared
    P :
    ι → Measure Ω
    shared
    Nonempty ι
    i :
    ι
    (fun x => ((P i).rnDeriv (uniformMixture P) x).toReal)
    ≤ᵐ[uniformMixture P] fun _ => (Fintype.card ι : ℝ)
    Proof (Lean source)
    lemma rnDeriv_uniformMixture_toReal_le_card [Nonempty ι] (i : ι) : (fun x => ((P i).rnDeriv (uniformMixture P) x).toReal) ≤ᵐ[uniformMixture P] fun _ => (Fintype.card ι : ℝ) := by letI : IsProbabilityMeasure (uniformMixture P) := uniformMixture_isProbabilityMeasure P let N : NNReal := Fintype.card ι have hN : N ≠ 0 := by simp [N, Fintype.card_ne_zero] have hle : P i ≤ N • uniformMixture P := by simpa [N] using uniformComponent_le_card_smul_mixture P i have hs := Measure.rnDeriv_le_one_of_le hle have hscaledAc : uniformMixture P ≪ N • uniformMixture P := Measure.absolutelyContinuous_smul (by exact_mod_cast hN) have hs' := hscaledAc.ae_le hs have heq := Measure.rnDeriv_smul_right (P i) (uniformMixture P) hN filter_upwards [hs', heq] with x hx heqx simp only [Pi.one_apply] at hx rw [heqx] at hx simp only [Pi.smul_apply, ENNReal.smul_def] at hx have hmul : (P i).rnDeriv (uniformMixture P) x ≤ (N : ENNReal) := by calc (P i).rnDeriv (uniformMixture P) x = (N : ENNReal) * ((N : ENNReal)⁻¹ * (P i).rnDeriv (uniformMixture P) x) := by rw [← mul_assoc, ENNReal.mul_inv_cancel (by exact_mod_cast hN) (by simp), one_mul] _ ≤ (N : ENNReal) * 1 := by gcongr simpa [ENNReal.coe_inv, hN] using hx _ = N := mul_one _ simpa [N] using (ENNReal.toReal_le_coe_of_le_coe hmul)
    Causalean.Stat.rnDeriv_uniformMixture_toReal_le_card · Causalean/Stat/Minimax/Fano.lean:155
  • klDiv_uniformMixture_ne_top theorem — For a nonempty finite family of probability laws and an index, the KL divergence from that component to the uniform mixture is finite.
    Ω :
    Type u_1
    shared
    ι :
    Type u_3
    shared
    P :
    ι → Measure Ω
    shared
    Nonempty ι
    i :
    ι
    _root_.InformationTheory.klDiv (P i) (uniformMixture P) ≠ ⊤
    Proof (Lean source)
    theorem klDiv_uniformMixture_ne_top [Nonempty ι] (i : ι) : _root_.InformationTheory.klDiv (P i) (uniformMixture P) ≠ ⊤ := by letI : IsProbabilityMeasure (uniformMixture P) := uniformMixture_isProbabilityMeasure P have hac := absolutelyContinuous_uniformMixture P i have hN1 : (1 : ℝ) ≤ Fintype.card ι := by exact_mod_cast (Fintype.card_pos_iff.mpr inferInstance : 0 < Fintype.card ι) have hlogN : 0 ≤ log (Fintype.card ι) := Real.log_nonneg hN1 let C : ℝ := (Fintype.card ι : ℝ) * log (Fintype.card ι) + 1 have hC : 0 ≤ C := by dsimp [C]; positivity have hmulInt : Integrable (fun x => ((P i).rnDeriv (uniformMixture P) x).toReal * log ((P i).rnDeriv (uniformMixture P) x).toReal) (uniformMixture P) := by apply (integrable_const C).mono' · fun_prop · filter_upwards [rnDeriv_uniformMixture_toReal_le_card P i] with x hx let r := ((P i).rnDeriv (uniformMixture P) x).toReal have hr0 : 0 ≤ r := ENNReal.toReal_nonneg change |r * log r| ≤ C by_cases hr1 : r ≤ 1 · rw [abs_of_nonpos (Real.mul_log_nonpos hr0 hr1)] have hneg := Real.negMulLog_le_one_sub_self hr0 dsimp [negMulLog] at hneg dsimp [C] nlinarith · have h1r : 1 ≤ r := le_of_not_ge hr1 rw [abs_of_nonneg (Real.mul_log_nonneg h1r)] have hlog : log r ≤ log (Fintype.card ι) := Real.log_le_log (by positivity) hx dsimp [C] nlinarith have hllr : Integrable (llr (P i) (uniformMixture P)) (P i) := (integrable_rnDeriv_mul_log_iff hac).mp hmulInt exact _root_.InformationTheory.klDiv_ne_top hac hllr
    Causalean.Stat.klDiv_uniformMixture_ne_top · Causalean/Stat/Minimax/Fano.lean:187
  • klDiv_uniformMixture_toReal_le_log_card theorem — For a nonempty finite family of probability laws and an index, the KL divergence from that component to the uniform mixture is at most the logarithm of the family cardinality.
    Ω :
    Type u_1
    shared
    ι :
    Type u_3
    shared
    P :
    ι → Measure Ω
    shared
    Nonempty ι
    i :
    ι
    (_root_.InformationTheory.klDiv (P i) (uniformMixture P)).toReal
    ≤ log (card ι)
    Proof (Lean source)
    theorem klDiv_uniformMixture_toReal_le_log_card [Nonempty ι] (i : ι) : (_root_.InformationTheory.klDiv (P i) (uniformMixture P)).toReal ≤ log (card ι) := by letI : IsProbabilityMeasure (uniformMixture P) := uniformMixture_isProbabilityMeasure P have hfin := klDiv_uniformMixture_ne_top P i have hac := (_root_.InformationTheory.klDiv_ne_top_iff.mp hfin).1 have hllr := (_root_.InformationTheory.klDiv_ne_top_iff.mp hfin).2 have hllrBound : llr (P i) (uniformMixture P) ≤ᵐ[P i] fun _ => log (card ι) := by filter_upwards [hac.ae_le (rnDeriv_uniformMixture_toReal_le_card P i), Measure.rnDeriv_pos hac, hac.ae_le (Measure.rnDeriv_ne_top (P i) (uniformMixture P))] with x hx hpos htop exact Real.log_le_log (ENNReal.toReal_pos hpos.ne' htop) hx rw [_root_.InformationTheory.toReal_klDiv_of_measure_eq hac (by simp)] simpa using integral_mono_ae hllr (integrable_const _) hllrBound
    Causalean.Stat.klDiv_uniformMixture_toReal_le_log_card · Causalean/Stat/Minimax/Fano.lean:224
  • iid_experiment_kl_eq_nat_mul theorem — For a sample size and two laws in the experiment, if the first law is absolutely continuous with respect to the second and their one-observation log-likelihood ratio is integrable, then the KL divergence between the corresponding i.i.d. product laws equals n times the one-observation KL divergence.
    Ω :
    Type u_1
    shared
    ι :
    Type u_3
    shared
    P :
    ι → Measure Ω
    shared
    n :
    ℕ
    j k :
    ι
    hac :
    P j ≪ P k
    hint :
    Integrable (llr (P j) (P k)) (P j)
    (_root_.InformationTheory.klDiv (Measure.pi (fun _ : Fin n => P j)) (Measure.pi (fun _ : Fin n => P k))).toReal
    = (n : ℝ) * (_root_.InformationTheory.klDiv (P j) (P k)).toReal
    Proof (Lean source)
    theorem iid_experiment_kl_eq_nat_mul (n : ℕ) (j k : ι) (hac : P j ≪ P k) (hint : Integrable (llr (P j) (P k)) (P j)) : (_root_.InformationTheory.klDiv (Measure.pi (fun _ : Fin n => P j)) (Measure.pi (fun _ : Fin n => P k))).toReal = (n : ℝ) * (_root_.InformationTheory.klDiv (P j) (P k)).toReal := productKL_tensorization_of_finite n (P j) (P k) hac hint
    Causalean.Stat.iid_experiment_kl_eq_nat_mul · Causalean/Stat/Minimax/Fano.lean:244
  • sum_refReal_acceptance_le theorem — A reference hypothesis assigns total mass ≤ 1 across the disjoint acceptance regions, since their union has measure ≤ 1.
    Ω :
    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, (P i₀).real (acceptanceRegion est (θ i) s) ≤ 1
    Proof (Lean source)
    theorem sum_refReal_acceptance_le {est : Ω → Θ} (hest : Measurable est) {θ : ι → Θ} {s : ℝ} (hsep : ∀ i k, i ≠ k → 2 * s ≤ dist (θ i) (θ k)) (i₀ : ι) : ∑ i, (P i₀).real (acceptanceRegion est (θ i) s) ≤ 1 := by have hmeas : ∀ i, MeasurableSet (acceptanceRegion est (θ i) s) := fun i => measurableSet_acceptanceRegion hest (θ i) s have hdisj : Pairwise (onFun Disjoint (fun i => acceptanceRegion est (θ i) s)) := acceptanceRegion_pairwiseDisjoint (est := est) (θ := θ) (s := s) hsep have hunion : (P i₀) (⋃ i, acceptanceRegion est (θ i) s) = ∑ i, (P i₀) (acceptanceRegion est (θ i) s) := by rw [measure_iUnion hdisj hmeas, tsum_fintype] have hle : (P i₀) (⋃ i, acceptanceRegion est (θ i) s) ≤ 1 := by calc (P i₀) (⋃ i, acceptanceRegion est (θ i) s) ≤ (P i₀) univ := measure_mono (Set.subset_univ _) _ = 1 := measure_univ have hfin : ∀ i, (P i₀) (acceptanceRegion est (θ i) s) ≠ ⊤ := fun i => measure_ne_top _ _ have hsumeq : ∑ i, (P i₀).real (acceptanceRegion est (θ i) s) = ((P i₀) (⋃ i, acceptanceRegion est (θ i) s)).toReal := by rw [hunion, ENNReal.toReal_sum (fun i _ => hfin i)]; rfl rw [hsumeq] calc ((P i₀) (⋃ i, acceptanceRegion est (θ i) s)).toReal ≤ (1 : ENNReal).toReal := ENNReal.toReal_mono ENNReal.one_ne_top hle _ = 1 := ENNReal.toReal_one
    Causalean.Stat.sum_refReal_acceptance_le · Causalean/Stat/Minimax/Fano.lean:259
  • sum_correct_le theorem — Heart of Fano. The total probability of correct recovery, summed over the family, is at most 1 + ∑ᵢ tvDist (P i₀) (P i): comparing each Pᵢ(A i) to the reference P i₀(A i) costs one tvDist, and the reference masses sum to ≤ 1.
    Ω :
    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, (P i).real (acceptanceRegion est (θ i) s) ≤ 1 + ∑ i, tvDist (P i₀) (P i)
    Proof (Lean source)
    theorem sum_correct_le {est : Ω → Θ} (hest : Measurable est) {θ : ι → Θ} {s : ℝ} (hsep : ∀ i k, i ≠ k → 2 * s ≤ dist (θ i) (θ k)) (i₀ : ι) : ∑ i, (P i).real (acceptanceRegion est (θ i) s) ≤ 1 + ∑ i, tvDist (P i₀) (P i) := by have hterm : ∀ i, (P i).real (acceptanceRegion est (θ i) s) ≤ (P i₀).real (acceptanceRegion est (θ i) s) + tvDist (P i₀) (P i) := by intro i have hmeas : MeasurableSet (acceptanceRegion est (θ i) s) := measurableSet_acceptanceRegion hest (θ i) s have h := measureReal_sub_le_tvDist (μ := P i₀) (ν := P i) hmeas linarith calc ∑ i, (P i).real (acceptanceRegion est (θ i) s) ≤ ∑ i, ((P i₀).real (acceptanceRegion est (θ i) s) + tvDist (P i₀) (P i)) := Finset.sum_le_sum (fun i _ => hterm i) _ = (∑ i, (P i₀).real (acceptanceRegion est (θ i) s)) + ∑ i, tvDist (P i₀) (P i) := by rw [Finset.sum_add_distrib] _ ≤ 1 + ∑ i, tvDist (P i₀) (P i) := by have := sum_refReal_acceptance_le P hest hsep i₀ linarith
    Causalean.Stat.sum_correct_le · Causalean/Stat/Minimax/Fano.lean:286
  • tv_multiple_testing_average_lower theorem — Total-variation multiple-testing average 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.
    Ω :
    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 tv_multiple_testing_average_lower {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.tv_multiple_testing_average_lower · Causalean/Stat/Minimax/Fano.lean:309
  • tv_multiple_testing_lower theorem — Total-variation multiple-testing 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.
    Ω :
    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₀ :
    ι
    β :
    ℝ
    hβ :
    ∀ i, tvDist (P i₀) (P i) ≤ β
    ∃ i, 1 - 1 / (card ι) - β ≤ (P i).real {ω | s ≤ dist (est ω) (θ i)}
    Proof (Lean source)
    theorem tv_multiple_testing_lower {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 := tv_multiple_testing_average_lower 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 Not 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.tv_multiple_testing_lower · Causalean/Stat/Minimax/Fano.lean:340
Finite­Kernel­Bayes 7 core · 31 supporting This module supplies a real-valued Bayes-to-minimax bridge for a finite state space. ★ realBayesRisk_le_minimaxValueENNReal

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:53
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:105
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_minimaxValueENNReal reviewed
Causalean.Stat

With at least one action and nonnegative loss, the nonnegative extension of the Bayes risk is at most the standard 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
Proof (Lean source)
theorem realBayesRisk_le_minimaxValueENNReal [Nonempty A] (π : Measure Θ) [IsProbabilityMeasure π] (K : Kernel Θ S) [IsMarkovKernel K] (loss : A → S → ℝ) (hloss : ∀ a s, 0 ≤ loss a s) : ofReal (realBayesRisk π K loss) ≤ minimaxValueENNRealOfReal loss := by apply le_minimaxValueENNReal intro a refine (ENNReal.ofReal_le_ofReal ?_).trans (mixedKernelLoss_le_worstCaseRiskENNReal π K loss hloss a) apply ciInf_le refine ⟨0, ?_⟩ rintro _ ⟨a', rfl⟩ exact mixedKernelLoss_nonneg π K loss hloss a'
Causalean.Stat.realBayesRisk_le_minimaxValueENNReal · Causalean/Stat/Minimax/FiniteKernelBayes.lean:199 · uses minimaxValueENNRealOfReal , 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:256
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:338 · 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:376 · uses FiniteDesign
31 supporting declarations (lemmas, instances)
Hellinger­Affinity 4 core · 3 supporting 1 to review 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★ hellingerSqDensity_pi_le_sum

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:57
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:68
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:128 · uses densityAffinity , tvDist
lemma hellingerSqDensity_pi_le_sum unreviewed
Causalean.Stat

Given a finite coordinate type, measurable coordinate spaces, sigma-finite coordinate measures, two coordinatewise families of densities, integrability of both families, pointwise nonnegativity of both families, and unit integral of every density in both families, the squared Hellinger discrepancy between the two product densities is at most the sum of the coordinate discrepancies.

Formal statement
ι :
Type*
ι → Type*
∀ i, MeasurableSpace (E i)
μ :
∀ i, Measure (E i)
∀ i, SigmaFinite (μ i)
f g :
∀ i
if
E i
then
ℝ
hf :
∀ i, Integrable (f i) (μ i)
hg :
∀ i, Integrable (g i) (μ i)
hf0 :
∀ i x, 0 ≤ f i x
hg0 :
∀ i x, 0 ≤ g i x
hf1 :
∀ i, ∫ x, f i x ∂μ i = 1
hg1 :
∀ i, ∫ x, g i x ∂μ i = 1
hellingerSqDensity (Measure.pi μ) (fun x : ∀ i, E i => ∏ i, f i (x i)) (fun x => ∏ i, g i (x i))
≤ ∑ i, hellingerSqDensity (μ i) (f i) (g i)
Proof (Lean source)
lemma hellingerSqDensity_pi_le_sum {ι : Type*} [Fintype ι] {E : ι → Type*} [∀ i, MeasurableSpace (E i)] (μ : ∀ i, Measure (E i)) [∀ i, SigmaFinite (μ i)] (f g : ∀ i, E i → ℝ) (hf : ∀ i, Integrable (f i) (μ i)) (hg : ∀ i, Integrable (g i) (μ i)) (hf0 : ∀ i x, 0 ≤ f i x) (hg0 : ∀ i x, 0 ≤ g i x) (hf1 : ∀ i, ∫ x, f i x ∂μ i = 1) (hg1 : ∀ i, ∫ x, g i x ∂μ i = 1) : hellingerSqDensity (Measure.pi μ) (fun x : ∀ i, E i => ∏ i, f i (x i)) (fun x => ∏ i, g i (x i)) ≤ ∑ i, hellingerSqDensity (μ i) (f i) (g i) := by have hFp : Integrable (fun x : ∀ i, E i => ∏ i, f i (x i)) (Measure.pi μ) := Integrable.fintype_prod_dep hf have hGp : Integrable (fun x : ∀ i, E i => ∏ i, g i (x i)) (Measure.pi μ) := Integrable.fintype_prod_dep hg have hF0 : ∀ x : ∀ i, E i, 0 ≤ ∏ i, f i (x i) := fun x => Finset.prod_nonneg (fun i _ => hf0 i (x i)) have hG0 : ∀ x : ∀ i, E i, 0 ≤ ∏ i, g i (x i) := fun x => Finset.prod_nonneg (fun i _ => hg0 i (x i)) have hF1 : (∫ x : ∀ i, E i, ∏ i, f i (x i) ∂Measure.pi μ) = 1 := by rw [integral_fintype_prod_eq_prod] simp [hf1] have hG1 : (∫ x : ∀ i, E i, ∏ i, g i (x i) ∂Measure.pi μ) = 1 := by rw [integral_fintype_prod_eq_prod] simp [hg1] have hE (i : ι) : hellingerSqDensity (μ i) (f i) (g i) = 2 * (1 - densityAffinity (μ i) (f i) (g i)) := hellingerSqDensity_eq_two_mul_one_sub_affinity (μ i) (f i) (g i) (hf i) (hg i) (hf0 i) (hg0 i) (hf1 i) (hg1 i) have ha0 (i : ι) : 0 ≤ densityAffinity (μ i) (f i) (g i) := integral_nonneg (fun _ => Real.sqrt_nonneg _) have ha1 (i : ι) : densityAffinity (μ i) (f i) (g i) ≤ 1 := by have hn : 0 ≤ hellingerSqDensity (μ i) (f i) (g i) := integral_nonneg (fun _ => sq_nonneg _) rw [hE i] at hn linarith rw [hellingerSqDensity_eq_two_mul_one_sub_affinity (Measure.pi μ) _ _ hFp hGp hF0 hG0 hF1 hG1] rw [densityAffinity_pi μ f g hf0 hg0] simp_rw [hE] rw [← Finset.mul_sum] exact mul_le_mul_of_nonneg_left (one_sub_prod_le_sum _ ha0 ha1) (by norm_num)
Causalean.Stat.hellingerSqDensity_pi_le_sum · Causalean/Stat/Minimax/HellingerAffinity.lean:357 · uses hellingerSqDensity
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:78
  • 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 Finset.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:301
  • 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:330
Sharp­Hellinger 2 core · 13 supporting This module develops the sharp total-variation/Hellinger comparison for probability laws, beginning with Radon–Nikodym densities against their sum and ending with binary-testing inequalities in real and extended-nonnegat ★ measure_event_gap_le_sharp_hellinger

Sharp Hellinger comparisons

This module develops the sharp total-variation/Hellinger comparison for probability laws, beginning with Radon–Nikodym densities against their sum and ending with binary-testing inequalities in real and extended-nonnegative forms.

def hellingerSqMeasure reviewed
Causalean.Stat.Minimax

The unhalved squared Hellinger distance of two laws: the integral, against their sum, of the squared difference of the square roots of their Radon–Nikodym densities relative to that sum.

Definition (Lean source)
X :
Type u_1
shared
B C :
hellingerSqMeasure B C :
ℝ
hellingerSqDensity (B + C) (fun x => (B.rnDeriv (B + C) x).toReal) (fun x => (C.rnDeriv (B + C) x).toReal)
Causalean.Stat.Minimax.hellingerSqMeasure · Causalean/Stat/Minimax/SharpHellinger.lean:21
theorem measure_event_gap_le_sharp_hellinger reviewed
Causalean.Stat.Minimax

Two probability laws assign a measurable event probabilities whose absolute difference is at most √(H² (1 − H²/4)), where H² is the unhalved squared Hellinger distance of the two laws.

Formal statement
X :
Type u_1
shared
E :
Set X
hE :
|B.real E - C.real E|
≤ sqrt (hellingerSqMeasure B C * (1 - hellingerSqMeasure B C / 4))
Proof (Lean source)
theorem measure_event_gap_le_sharp_hellinger (B C : Measure X) [IsProbabilityMeasure B] [IsProbabilityMeasure C] {E : Set X} (hE : MeasurableSet E) : |B.real E - C.real E| ≤ sqrt (hellingerSqMeasure B C * (1 - hellingerSqMeasure B C / 4)) := by obtain ⟨hf, hf0, hf1, hfE⟩ := sum_reference_density B C obtain ⟨hg, hg0, hg1, hgE⟩ := sum_reference_density C B simp only [add_comm C B] at hg hg0 hg1 hgE let f : X → ℝ := fun x => (B.rnDeriv (B + C) x).toReal let g : X → ℝ := fun x => (C.rnDeriv (B + C) x).toReal have hzero : ∫ x, (f x - g x) ∂(B + C) = 0 := by rw [integral_sub hf hg, hf1, hg1] norm_num have hgap : |B.real E - C.real E| ≤ (1 / 2 : ℝ) * ∫ x, |f x - g x| ∂(B + C) := by rw [← hfE E, ← hgE E, ← integral_sub hf.integrableOn hg.integrableOn] exact abs_setIntegral_le_half_integral_abs_of_integral_eq_zero (hf.sub hg) hzero hE have hl1 := integral_abs_sub_le_sqrt_hellinger_energy (B + C) f g hf hg hf0 hg0 hf1 hg1 calc |B.real E - C.real E| ≤ (1 / 2 : ℝ) * sqrt (hellingerSqMeasure B C * (4 - hellingerSqMeasure B C)) := hgap.trans (mul_le_mul_of_nonneg_left hl1 (by norm_num)) _ = sqrt (hellingerSqMeasure B C * (1 - hellingerSqMeasure B C / 4)) := by rw [show hellingerSqMeasure B C * (1 - hellingerSqMeasure B C / 4) = (1 / 2 : ℝ) ^ 2 * (hellingerSqMeasure B C * (4 - hellingerSqMeasure B C)) by ring, Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq_eq_abs] norm_num
Causalean.Stat.Minimax.measure_event_gap_le_sharp_hellinger · Causalean/Stat/Minimax/SharpHellinger.lean:182 · uses hellingerSqMeasure
13 supporting declarations (lemmas, instances)
Absolute­Fuzzy­Testing 3 core · 16 supporting This module gives a common-prior fuzzy-testing lower bound for absolute loss, with the constant inherited from the sharp Hellinger bound on total variation. ★ absolute_fuzzy_testing_lower_bound_iid

Absolute-loss fuzzy testing

This module gives a common-prior fuzzy-testing lower bound for absolute loss, with the constant inherited from the sharp Hellinger bound on total variation. It supplies finite iid experiment kernels, threshold tests that do not require target measurability, and the corresponding model-supremum lower bound.

def iidExperimentKernel reviewed
Causalean.Stat.Minimax

The iid observation experiment for a sample size and a kernel applies its independent product to the constant vector of latent indices.

Definition (Lean source)
Z :
Type u_1
shared
X :
Type u_2
shared
v :
ℕ
K :
Kernel Z X
iidExperimentKernel v K :
Kernel Z (Fin v → X)
(finProductKernel v K).comap (fun z _ => z) (measurable_pi_lambda _ fun _ => measurable_id)
Causalean.Stat.Minimax.iidExperimentKernel · Causalean/Stat/Minimax/AbsoluteFuzzyTesting.lean:23
def worstAbsoluteRisk reviewed
Causalean.Stat.Minimax

The worst absolute risk for a model, observation laws, a real target and an estimator is the extended-nonnegative supremum of the lower integrals of absolute error over all model members.

Definition (Lean source)
Θ :
Type u_3
shared
X :
Type u_5
shared
M :
Set Θ
Q :
Θ → Measure X
Ψ :
Θ → ℝ
t :
X → ℝ
worstAbsoluteRisk M Q Ψ t :
ℝ≥0∞
⨆ θ : M, ∫⁻ x, ofReal |t x - Ψ θ.val| ∂Q θ.val
Causalean.Stat.Minimax.worstAbsoluteRisk · Causalean/Stat/Minimax/AbsoluteFuzzyTesting.lean:202
theorem absolute_fuzzy_testing_lower_bound_iid reviewed
Causalean.Stat.Minimax

Take a sample size, a probability prior on latent indices, two Markov families of observation laws indexed by the latent index, a model which contains every law of both families, and a real functional whose value at any law of the first family exceeds its value at any law of the second family by at least a positive gap. If the squared Hellinger distance between the two prior mixtures of the iid product laws is at most a budget that is nonnegative and strictly below two, then for any measurable estimator based on the iid sample, the supremum over the model of the expected absolute error under iid sampling is at least one quarter of the gap times one minus the square root of the budget times one minus a quarter of the budget.

Formal statement
Z :
Type u_4
shared
Ω :
Type u_6
shared
v :
ℕ
M :
Ψ :
Measure Ω → ℝ
hB :
∀ z, B z ∈ M
hC :
∀ z, C z ∈ M
s u :
ℝ
hs :
0 < s
hu0 :
0 ≤ u
hu2 :
u < 2
hsep :
∀ z z', s ≤ Ψ (B z) - Ψ (C z')
hH :
hellingerSqMeasure (ω.bind (fun z => Measure.pi (fun _ : Fin v => B z))) (ω.bind (fun z => Measure.pi (fun _ : Fin v => C z)))
≤ u
t :
(Fin v → Ω) → ℝ
ht :
ofReal ((s / 4) * (1 - sqrt (u * (1 - u / 4))))
≤ ⨆ P : M, ∫⁻ sample, ofReal |t sample
- Ψ P.val| ∂Measure.pi (fun _ : Fin v => P.val)
Proof (Lean source)
theorem absolute_fuzzy_testing_lower_bound_iid (v : ℕ) (ω : Measure Z) [IsProbabilityMeasure ω] (B C : Kernel Z Ω) [IsMarkovKernel B] [IsMarkovKernel C] (M : Set (Measure Ω)) (Ψ : Measure Ω → ℝ) (hB : ∀ z, B z ∈ M) (hC : ∀ z, C z ∈ M) {s u : ℝ} (hs : 0 < s) (hu0 : 0 ≤ u) (hu2 : u < 2) (hsep : ∀ z z', s ≤ Ψ (B z) - Ψ (C z')) (hH : hellingerSqMeasure (ω.bind (fun z => Measure.pi (fun _ : Fin v => B z))) (ω.bind (fun z => Measure.pi (fun _ : Fin v => C z))) ≤ u) {t : (Fin v → Ω) → ℝ} (ht : Measurable t) : ofReal ((s / 4) * (1 - sqrt (u * (1 - u / 4)))) ≤ ⨆ P : M, ∫⁻ sample, ofReal |t sample - Ψ P.val| ∂Measure.pi (fun _ : Fin v => P.val) := by have hbudget : hellingerSqMeasure (ω.bind (iidExperimentKernel v B)) (ω.bind (iidExperimentKernel v C)) ≤ u := by simpa only [bind_iidExperimentKernel] using hH exact absolute_fuzzy_testing_lower_bound ω (iidExperimentKernel v B) (iidExperimentKernel v C) M (fun P => Measure.pi (fun _ : Fin v => P)) Ψ (fun z => B z) (fun z => C z) hB hC (iidExperimentKernel_apply v B) (iidExperimentKernel_apply v C) hs hu0 hu2 hsep hbudget ht
Causalean.Stat.Minimax.absolute_fuzzy_testing_lower_bound_iid · Causalean/Stat/Minimax/AbsoluteFuzzyTesting.lean:288 · uses hellingerSqMeasure
16 supporting declarations (lemmas, instances)
Bretagnolle­Huber 1 core · 6 supporting This module builds the Bhattacharyya/Hellinger affinity layer used to prove the exponential testing-affinity bound often called Tsybakov's version of the Bretagnolle-Huber inequality. ★ bretagnolle_huber_affinity

Exponential KL lower bound for testing affinity

This module builds the Bhattacharyya/Hellinger affinity layer used to prove the exponential testing-affinity bound often called Tsybakov's version of 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. This is weaker than the square-root Bretagnolle-Huber bound, but it is the form used by the module's Le Cam lower bounds.

theorem bretagnolle_huber_affinity reviewed
Causalean.Stat

Exponential Bretagnolle-Huber/Tsybakov testing bound. 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:331 · 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:45
  • 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:59
  • 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:74
  • 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:90
  • 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:128
  • 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).toReal • exp (-(1 / 2) * llr μ ν x) ∂ν = ∫ x, exp (-(1 / 2) * llr μ ν x) ∂μ := MeasureTheory.integral_rnDeriv_smul hac have hcov_lhs : ∫ x, (μ.rnDeriv ν x).toReal • exp (-(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).toReal • exp (-(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:272
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:54 · 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:38
  • 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:84
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:45 · 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:93 · 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:25
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:26
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:46
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:70
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:93
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:110
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, Bool → Measure (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 InformationTheory.klDiv_map_le μ ν hcompress
    Causalean.Stat.compressedCoordinateLaw_klDiv_le · Causalean/Stat/Minimax/CoordinatewiseOverlap.lean:35
  • 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:126
  • 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:157
  • 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 overlap-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:199
  • 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:264
  • 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:286
  • 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:305
  • 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:320
  • 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:337
  • 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, Bool → Measure (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:352
  • 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:394
  • 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 :
    ℕ → ℕ
    κ :
    ℝ
    hκ :
    κ < 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:752
Fano­Information­Radius 3 core · 2 supporting This module makes the mutual-information form of Fano directly usable from reference-law and pairwise Kullback--Leibler bounds. ★ uniform_kl_compensation_identity★ uniformMutualInformation_le_maxPairwiseKL

Information-radius interfaces for Fano's method

This module makes the mutual-information form of Fano directly usable from reference-law and pairwise Kullback--Leibler bounds. Its main result is the general compensation identity: average divergence to a reference law equals mutual information plus the divergence of the uniform mixture to that reference law.

theorem uniform_kl_compensation_identity reviewed
Causalean.Stat

KL compensation identity. Given a finite experiment, a reference probability law, and finite KL divergence from every experiment law to the reference, the average KL divergence to the reference minus the uniform-prior mutual information equals the KL divergence from the uniform mixture to the reference.

Formal statement
Ω :
Type u_1
shared
ι :
Type u_2
shared
mΩ :
shared
P :
ι → Measure Ω
shared
hfin :
∀ i, _root_.InformationTheory.klDiv (P i) Q ≠ ⊤
(Fintype.card ι : ℝ)⁻¹ * ∑ i, (_root_.InformationTheory.klDiv (P i) Q).toReal
= (_root_.InformationTheory.klDiv (uniformMixture P) Q).toReal
Proof (Lean source)
theorem uniform_kl_compensation_identity (Q : Measure Ω) [IsProbabilityMeasure Q] (hfin : ∀ i, _root_.InformationTheory.klDiv (P i) Q ≠ ⊤) : (Fintype.card ι : ℝ)⁻¹ * ∑ i, (_root_.InformationTheory.klDiv (P i) Q).toReal - uniformMutualInformation P = (_root_.InformationTheory.klDiv (uniformMixture P) Q).toReal := by letI : IsProbabilityMeasure (uniformMixture P) := uniformMixture_isProbabilityMeasure P have hPiQac : ∀ i, P i ≪ Q := fun i => (_root_.InformationTheory.klDiv_ne_top_iff.mp (hfin i)).1 have hPiQint : ∀ i, Integrable (llr (P i) Q) (P i) := fun i => (_root_.InformationTheory.klDiv_ne_top_iff.mp (hfin i)).2 have hPiBarint : ∀ i, Integrable (llr (P i) (uniformMixture P)) (P i) := fun i => (_root_.InformationTheory.klDiv_ne_top_iff.mp (klDiv_uniformMixture_ne_top P i)).2 have hBarQac : uniformMixture P ≪ Q := by apply Measure.AbsolutelyContinuous.mk intro A _hA hQA rw [uniformMixture, mixture_apply (fun _ : ι => (Fintype.card ι : ENNReal)⁻¹) P A] apply Finset.sum_eq_zero intro j _hj rw [hPiQac j hQA, mul_zero] have hchain : ∀ i, llr (P i) Q =ᵐ[P i] llr (P i) (uniformMixture P) + llr (uniformMixture P) Q := llr_eq_llr_uniformMixture_add P Q hfin have hBarQint_i : ∀ i, Integrable (llr (uniformMixture P) Q) (P i) := by intro i apply ((hPiQint i).sub (hPiBarint i)).congr filter_upwards [hchain i] with x hx simp only [Pi.add_apply] at hx change llr (P i) Q x - llr (P i) (uniformMixture P) x = llr (uniformMixture P) Q x linarith have hBarQint : Integrable (llr (uniformMixture P) Q) (uniformMixture P) := by rw [uniformMixture, mixture] apply integrable_finsetSum_measure.2 intro i _hi exact (hBarQint_i i).smul_measure (by simp) have hkl_i : ∀ i, (_root_.InformationTheory.klDiv (P i) Q).toReal = (_root_.InformationTheory.klDiv (P i) (uniformMixture P)).toReal + ∫ x, llr (uniformMixture P) Q x ∂P i := by intro i rw [_root_.InformationTheory.toReal_klDiv_of_measure_eq (hPiQac i) (by simp), _root_.InformationTheory.toReal_klDiv_of_measure_eq (absolutelyContinuous_uniformMixture P i) (by simp)] calc ∫ x, llr (P i) Q x ∂P i = ∫ x, (llr (P i) (uniformMixture P) + llr (uniformMixture P) Q) x ∂P i := integral_congr_ae (hchain i) _ = ∫ x, llr (P i) (uniformMixture P) x ∂P i + ∫ x, llr (uniformMixture P) Q x ∂P i := integral_add (hPiBarint i) (hBarQint_i i) have hmixIntegral : ∫ x, llr (uniformMixture P) Q x ∂uniformMixture P = (Fintype.card ι : ℝ)⁻¹ * ∑ i, ∫ x, llr (uniformMixture P) Q x ∂P i := by rw [uniformMixture, mixture, integral_finsetSum_measure] · simp_rw [integral_smul_measure] rw [Finset.mul_sum] simp [ENNReal.toReal_inv, ENNReal.toReal_natCast] · intro i _hi exact (hBarQint_i i).smul_measure (by simp) rw [_root_.InformationTheory.toReal_klDiv_of_measure_eq hBarQac (by simp)] simp_rw [hkl_i] rw [Finset.sum_add_distrib, uniformMutualInformation, mul_add, hmixIntegral] ring
def maxPairwiseKL reviewed
Causalean.Stat

Given a nonempty finite family of probability laws, the maximum pairwise KL divergence is the largest real-valued divergence between two members.

Definition (Lean source)
Ω :
Type u_1
shared
ι :
Type u_2
shared
mΩ :
shared
P :
ι → Measure Ω
shared
maxPairwiseKL P :
ℝ
(Finset.univ : Finset (ι × ι)).sup' univ_nonempty fun ij
=> (_root_.InformationTheory.klDiv (P ij.1) (P ij.2)).toReal
theorem uniformMutualInformation_le_maxPairwiseKL reviewed
Causalean.Stat

Given a finite experiment whose pairwise KL divergences are finite, uniform-prior mutual information is at most the maximum pairwise KL divergence.

Formal statement
Ω :
Type u_1
shared
ι :
Type u_2
shared
mΩ :
shared
P :
ι → Measure Ω
shared
hfin :
∀ i j, _root_.InformationTheory.klDiv (P i) (P j) ≠ ⊤
Proof (Lean source)
theorem uniformMutualInformation_le_maxPairwiseKL (hfin : ∀ i j, _root_.InformationTheory.klDiv (P i) (P j) ≠ ⊤) : uniformMutualInformation P ≤ maxPairwiseKL P := by classical let j₀ : ι := choice inferInstance have href := uniformMutualInformation_le_average_kl P (P j₀) (fun i => hfin i j₀) have hterm : ∀ i, (_root_.InformationTheory.klDiv (P i) (P j₀)).toReal ≤ maxPairwiseKL P := by intro i change (_root_.InformationTheory.klDiv (P i) (P j₀)).toReal ≤ (Finset.univ : Finset (ι × ι)).sup' _ (fun ij => (_root_.InformationTheory.klDiv (P ij.1) (P ij.2)).toReal) exact Finset.le_sup' (s := (Finset.univ : Finset (ι × ι))) (fun ij : ι × ι => (_root_.InformationTheory.klDiv (P ij.1) (P ij.2)).toReal) (Finset.mem_univ (i, j₀)) calc uniformMutualInformation P ≤ (Fintype.card ι : ℝ)⁻¹ * ∑ i, (_root_.InformationTheory.klDiv (P i) (P j₀)).toReal := href _ ≤ (Fintype.card ι : ℝ)⁻¹ * ∑ _i : ι, maxPairwiseKL P := by gcongr exact hterm i _ = maxPairwiseKL P := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] field_simp [show (Fintype.card ι : ℝ) ≠ 0 by positivity]
Causalean.Stat.uniformMutualInformation_le_maxPairwiseKL · Causalean/Stat/Minimax/FanoInformationRadius.lean:156 · uses maxPairwiseKL , uniformMutualInformation
2 supporting declarations (lemmas, instances)
  • llr_eq_llr_uniformMixture_add lemma — Given a finite experiment, a reference probability law, and finite KL divergence from every experiment law to the reference, each component log-likelihood ratio to the reference decomposes almost everywhere into its ratio to the uniform mixture plus the mixture's ratio to the reference.
    Ω :
    Type u_1
    shared
    ι :
    Type u_2
    shared
    mΩ :
    shared
    P :
    ι → Measure Ω
    shared
    hfin :
    ∀ j, _root_.InformationTheory.klDiv (P j) Q ≠ ⊤
    i :
    ι
    llr (P i) Q =ᵐ[P i] llr (P i) (uniformMixture P) + llr (uniformMixture P) Q
    Proof (Lean source)
    lemma llr_eq_llr_uniformMixture_add (Q : Measure Ω) [IsProbabilityMeasure Q] (hfin : ∀ j, _root_.InformationTheory.klDiv (P j) Q ≠ ⊤) (i : ι) : llr (P i) Q =ᵐ[P i] llr (P i) (uniformMixture P) + llr (uniformMixture P) Q := by letI : IsProbabilityMeasure (uniformMixture P) := uniformMixture_isProbabilityMeasure P have hPiQ := (_root_.InformationTheory.klDiv_ne_top_iff.mp (hfin i)).1 have hPiBar := absolutelyContinuous_uniformMixture P i have hBarQ : uniformMixture P ≪ Q := by apply Measure.AbsolutelyContinuous.mk intro A _hA hQA rw [uniformMixture, mixture_apply (fun _ : ι => (Fintype.card ι : ENNReal)⁻¹) P A] apply Finset.sum_eq_zero intro j _hj rw [(_root_.InformationTheory.klDiv_ne_top_iff.mp (hfin j)).1 hQA, mul_zero] have hchainQ := Measure.rnDeriv_mul_rnDeriv (μ := P i) (ν := uniformMixture P) (κ := Q) hPiBar have hchain := hPiQ.ae_le hchainQ filter_upwards [hchain, Measure.rnDeriv_pos hPiQ, hPiQ.ae_le (Measure.rnDeriv_ne_top (P i) Q), Measure.rnDeriv_pos hPiBar, hPiBar.ae_le (Measure.rnDeriv_ne_top (P i) (uniformMixture P)), hPiBar.ae_le (Measure.rnDeriv_pos hBarQ), hPiQ.ae_le (Measure.rnDeriv_ne_top (uniformMixture P) Q)] with x hprod hPiQpos hPiQtop hPiBarpos hPiBartop hBarQpos hBarQtop simp only [Pi.mul_apply, Pi.add_apply] at hprod ⊢ rw [llr_def, llr_def, llr_def, ← Real.log_mul (ENNReal.toReal_pos hPiBarpos.ne' hPiBartop).ne' (ENNReal.toReal_pos hBarQpos.ne' hBarQtop).ne'] apply congrArg log rw [← ENNReal.toReal_mul, hprod]
    Causalean.Stat.llr_eq_llr_uniformMixture_add · Causalean/Stat/Minimax/FanoInformationRadius.lean:25
  • uniformMutualInformation_le_average_kl theorem — Given a finite experiment, a reference probability law, and finite KL divergence from every experiment law to the reference, uniform-prior mutual information is at most the average KL divergence to that reference.
    Ω :
    Type u_1
    shared
    ι :
    Type u_2
    shared
    mΩ :
    shared
    P :
    ι → Measure Ω
    shared
    hfin :
    ∀ i, _root_.InformationTheory.klDiv (P i) Q ≠ ⊤
    ≤ (Fintype.card ι : ℝ)⁻¹ * ∑ i, (_root_.InformationTheory.klDiv (P i) Q).toReal
    Proof (Lean source)
    theorem uniformMutualInformation_le_average_kl (Q : Measure Ω) [IsProbabilityMeasure Q] (hfin : ∀ i, _root_.InformationTheory.klDiv (P i) Q ≠ ⊤) : uniformMutualInformation P ≤ (Fintype.card ι : ℝ)⁻¹ * ∑ i, (_root_.InformationTheory.klDiv (P i) Q).toReal := by have hid := uniform_kl_compensation_identity P Q hfin have hnonneg : 0 ≤ (_root_.InformationTheory.klDiv (uniformMixture P) Q).toReal := ENNReal.toReal_nonneg linarith
    Causalean.Stat.uniformMutualInformation_le_average_kl · Causalean/Stat/Minimax/FanoInformationRadius.lean:136
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:313
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:24
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:31
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:38
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:45
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:269 · 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 center separation, a concentration radius smaller than half the separation, the stated separation of the centers, prior-tail bounds, and a 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 :
    ℝ
    hrhalf :
    r < Delta / 2
    hsep :
    Delta ≤ center1 - center0
    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 : ℝ) (hrhalf : r < Delta / 2) (hsep : Delta ≤ center1 - center0) (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:51
  • 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:226
  • 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) (by linarith) hsep 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:238
Honest­Confidence­Set 8 core · 17 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:36
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 ω}).toReal ≤ tvDist (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:106 · 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:235
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
def gridPoint reviewed
Causalean.Stat

The grid point indexed by j is obtained from the origin and spacing by taking that many equally spaced steps.

Definition (Lean source)
M :
ℕ
t δ :
ℝ
j :
Fin (M + 1)
gridPoint t δ j :
ℝ
t + (j.val : ℝ) * δ
def gridCount reviewed
Causalean.Stat

The covered grid count is the number of points in the grid with M gaps, origin t, and spacing δ that lie in the closed interval with endpoints l and u.

Definition (Lean source)
M :
ℕ
t δ l u :
ℝ
gridCount M t δ l u :
ℕ
by classical exact (Finset.univ.filter (fun j : Fin (M + 1) => gridPoint t δ j ∈ Icc l u)).card
def coverageEvent reviewed
Causalean.Stat

The coverage event for a target value is the collection of sample outcomes where the closed interval with random lower and upper endpoints contains that target.

Definition (Lean source)
Ω :
Type*
L U :
Ω → ℝ
θ :
ℝ
coverageEvent L U θ :
Set Ω
{x | θ ∈ Icc (L x) (U x)}
def intervalLength reviewed
Causalean.Stat

The nonnegative interval length associated with a lower endpoint and an upper endpoint is the upper endpoint minus the lower endpoint when that difference is nonnegative, and zero when the endpoints are reversed.

Definition (Lean source)
l u :
ℝ
intervalLength l u :
ℝ
max 0 (u - l)
17 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:43
  • 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:181
  • 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:229
  • 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:247
  • 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:315
  • 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:322
  • measurableSet_coverageEvent theorem — Measurable random lower and upper endpoints make each fixed-target coverage event measurable.
    Ω :
    Type*
    Ω → ℝ
    θ :
    ℝ
    hL :
    hU :
    Proof (Lean source)
    theorem measurableSet_coverageEvent {Ω : Type*} [MeasurableSpace Ω] {L U : Ω → ℝ} {θ : ℝ} (hL : Measurable L) (hU : Measurable U) : MeasurableSet (coverageEvent L U θ) := by exact (measurableSet_le hL measurable_const).inter (measurableSet_le measurable_const hU)
    Causalean.Stat.measurableSet_coverageEvent · Causalean/Stat/Minimax/HonestConfidenceSet.lean:351
  • measurable_intervalLength theorem — Measurable random lower and upper endpoints give a measurable nonnegative interval length.
    Ω :
    Type*
    Ω → ℝ
    hL :
    hU :
    Measurable (fun x => intervalLength (L x) (U x))
    Proof (Lean source)
    @[fun_prop] theorem measurable_intervalLength {Ω : Type*} [MeasurableSpace Ω] {L U : Ω → ℝ} (hL : Measurable L) (hU : Measurable U) : Measurable (fun x => intervalLength (L x) (U x)) := by exact measurable_const.max (hU.sub hL)
    Causalean.Stat.measurable_intervalLength · Causalean/Stat/Minimax/HonestConfidenceSet.lean:358
  • gridCount_eq_sum_indicator theorem — The covered grid count is the finite sum of the corresponding coverage-event indicators, viewed as a real-valued statistic.
    Ω :
    Type*
    M :
    ℕ
    t δ :
    ℝ
    L U :
    Ω → ℝ
    (fun x => (gridCount M t δ (L x) (U x) : ℝ))
    = fun x => ∑ j : Fin (M + 1), (coverageEvent L U (gridPoint t δ j)).indicator (fun _ => (1 : ℝ)) x
    Proof (Lean source)
    theorem gridCount_eq_sum_indicator {Ω : Type*} (M : ℕ) (t δ : ℝ) (L U : Ω → ℝ) : (fun x => (gridCount M t δ (L x) (U x) : ℝ)) = fun x => ∑ j : Fin (M + 1), (coverageEvent L U (gridPoint t δ j)).indicator (fun _ => (1 : ℝ)) x := by classical funext x simp only [gridCount, Set.indicator_apply, coverageEvent, Set.mem_ofPred_eq] exact (Finset.sum_boole _ _).symm
    Causalean.Stat.gridCount_eq_sum_indicator · Causalean/Stat/Minimax/HonestConfidenceSet.lean:364
  • integrable_gridCount theorem — Under a finite sample law, measurable random endpoints make the covered grid count an integrable statistic.
    Ω :
    M :
    ℕ
    t δ :
    ℝ
    L U :
    Ω → ℝ
    hL :
    hU :
    Integrable (fun x => (gridCount M t δ (L x) (U x) : ℝ)) μ
    Proof (Lean source)
    @[fun_prop] theorem integrable_gridCount {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] (M : ℕ) (t δ : ℝ) {L U : Ω → ℝ} (hL : Measurable L) (hU : Measurable U) : Integrable (fun x => (gridCount M t δ (L x) (U x) : ℝ)) μ := by classical rw [gridCount_eq_sum_indicator] exact integrable_finsetSum _ (fun j _ => (integrable_const (1 : ℝ)).indicator (measurableSet_coverageEvent hL hU))
    Causalean.Stat.integrable_gridCount · Causalean/Stat/Minimax/HonestConfidenceSet.lean:375
  • integral_gridCount theorem — Under a finite sample law, a grid with M gaps, origin t, and spacing δ, and measurable random endpoints, the expected covered grid count equals the sum of its coverage probabilities.
    Ω :
    M :
    ℕ
    t δ :
    ℝ
    L U :
    Ω → ℝ
    hL :
    hU :
    (∫ x, (gridCount M t δ (L x) (U x) : ℝ) ∂μ)
    = ∑ j : Fin (M + 1), μ.real (coverageEvent L U (gridPoint t δ j))
    Proof (Lean source)
    theorem integral_gridCount {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] (M : ℕ) (t δ : ℝ) {L U : Ω → ℝ} (hL : Measurable L) (hU : Measurable U) : (∫ x, (gridCount M t δ (L x) (U x) : ℝ) ∂μ) = ∑ j : Fin (M + 1), μ.real (coverageEvent L U (gridPoint t δ j)) := by classical rw [gridCount_eq_sum_indicator, integral_finsetSum] · exact Finset.sum_congr rfl (fun j _ => integral_indicator_one (measurableSet_coverageEvent hL hU)) · intro j _ exact (integrable_const (1 : ℝ)).indicator (measurableSet_coverageEvent hL hU)
    Causalean.Stat.integral_gridCount · Causalean/Stat/Minimax/HonestConfidenceSet.lean:385
  • ofReal_integral_le_lintegral_ofReal_of_le theorem — If an integrable real-valued statistic is pointwise no larger than a second statistic, then the positive part of its expectation is no larger than the nonnegative integral of the second statistic.
    Ω :
    Type*
    Ω → ℝ
    hf :
    hle :
    ∀ x, f x ≤ g x
    ofReal (∫ x, f x ∂μ) ≤ ∫⁻ x, ofReal (g x) ∂μ
    Proof (Lean source)
    theorem ofReal_integral_le_lintegral_ofReal_of_le {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} {f g : Ω → ℝ} (hf : Integrable f μ) (hle : ∀ x, f x ≤ g x) : ofReal (∫ x, f x ∂μ) ≤ ∫⁻ x, ofReal (g x) ∂μ := by calc ofReal (∫ x, f x ∂μ) ≤ ofReal (∫ x, max (f x) 0 ∂μ) := ENNReal.ofReal_le_ofReal (integral_mono hf hf.pos_part (fun x => le_max_left _ _)) _ = ∫⁻ x, ofReal (max (f x) 0) ∂μ := ofReal_integral_eq_lintegral_ofReal hf.pos_part (Filter.Eventually.of_forall (fun x => le_max_right _ _)) _ ≤ ∫⁻ x, ofReal (g x) ∂μ := by apply lintegral_mono intro x simpa only [ENNReal.ofReal_max, ENNReal.ofReal_zero, max_eq_left (zero_le : (0 : ℝ≥0∞) ≤ _)] using ENNReal.ofReal_le_ofReal (hle x)
    Causalean.Stat.ofReal_integral_le_lintegral_ofReal_of_le · Causalean/Stat/Minimax/HonestConfidenceSet.lean:398
  • intervalLength_ge_gridCount theorem — For a grid with M gaps, origin t, and strictly positive spacing δ, the nonnegative length of any closed interval with endpoints l and u is at least δ times one less than its number of covered grid points.
    M :
    ℕ
    t δ l u :
    ℝ
    hδ :
    0 < δ
    δ * ((gridCount M t δ l u : ℝ) - 1) ≤ intervalLength l u
    Proof (Lean source)
    theorem intervalLength_ge_gridCount (M : ℕ) (t δ l u : ℝ) (hδ : 0 < δ) : δ * ((gridCount M t δ l u : ℝ) - 1) ≤ intervalLength l u := by classical let S := Finset.univ.filter (fun j : Fin (M + 1) => gridPoint t δ j ∈ Icc l u) change δ * ((S.card : ℝ) - 1) ≤ max 0 (u - l) by_cases hS : S.Nonempty · let a := S.min' hS let b := S.max' hS have ha : gridPoint t δ a ∈ Icc l u := (Finset.mem_filter.mp (S.min'_mem hS)).2 have hb : gridPoint t δ b ∈ Icc l u := (Finset.mem_filter.mp (S.max'_mem hS)).2 have hab : a.val ≤ b.val := S.min'_le_max' hS have hcard : S.card ≤ b.val + 1 - a.val := by calc S.card = (S.image val).card := (Finset.card_image_of_injective S Fin.val_injective).symm _ ≤ (Icc a.val b.val).card := by apply Finset.card_le_card intro k hk obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hk exact Finset.mem_Icc.mpr ⟨S.min'_le j hj, S.le_max' j hj⟩ _ = b.val + 1 - a.val := Nat.card_Icc _ _ have hcast : (S.card : ℝ) ≤ (b.val : ℝ) + 1 - (a.val : ℝ) := by have hsub : a.val ≤ b.val + 1 := hab.trans (le_succ _) have := (Nat.cast_le (α := ℝ)).mpr hcard simpa only [Nat.cast_sub hsub, Nat.cast_add, Nat.cast_one] using this have hspan : δ * ((S.card : ℝ) - 1) ≤ δ * ((b.val : ℝ) - (a.val : ℝ)) := mul_le_mul_of_nonneg_left (by linarith) hδ.le have hlo : l ≤ t + (a.val : ℝ) * δ := ha.1 have hhi : t + (b.val : ℝ) * δ ≤ u := hb.2 nlinarith [le_max_right (0 : ℝ) (u - l)] · have hempty : S = ∅ := Finset.not_nonempty_iff_eq_empty.mp hS rw [hempty] simp only [Finset.card_empty, Nat.cast_zero, zero_sub, mul_neg, mul_one] exact (neg_nonpos.mpr hδ.le).trans (le_max_left _ _)
    Causalean.Stat.intervalLength_ge_gridCount · Causalean/Stat/Minimax/HonestConfidenceSet.lean:415
  • expected_interval_length_lower_of_grid theorem — Under a reference probability law, a grid with M gaps, origin t, and positive spacing δ, a coverage floor p at every grid target, and measurable random interval endpoints, the expected nonnegative interval length is at least δ times ((M + 1) times p minus one).
    Ω :
    μ₀ :
    M :
    ℕ
    t δ p :
    ℝ
    L U :
    Ω → ℝ
    hL :
    hU :
    hδ :
    0 < δ
    hcoverage :
    ∀ j : Fin (M + 1), p ≤ μ₀.real (coverageEvent L U (gridPoint t δ j))
    ofReal (δ * (((M + 1 : ℕ) : ℝ) * p - 1))
    ≤ ∫⁻ x, ofReal (intervalLength (L x) (U x)) ∂μ₀
    Proof (Lean source)
    theorem expected_interval_length_lower_of_grid {Ω : Type*} [MeasurableSpace Ω] (μ₀ : Measure Ω) [IsProbabilityMeasure μ₀] (M : ℕ) (t δ p : ℝ) {L U : Ω → ℝ} (hL : Measurable L) (hU : Measurable U) (hδ : 0 < δ) (hcoverage : ∀ j : Fin (M + 1), p ≤ μ₀.real (coverageEvent L U (gridPoint t δ j))) : ofReal (δ * (((M + 1 : ℕ) : ℝ) * p - 1)) ≤ ∫⁻ x, ofReal (intervalLength (L x) (U x)) ∂μ₀ := by have hc := integrable_gridCount μ₀ M t δ hL hU have hsum : ((M + 1 : ℕ) : ℝ) * p ≤ ∫ x, (gridCount M t δ (L x) (U x) : ℝ) ∂μ₀ := by rw [integral_gridCount μ₀ M t δ hL hU] simpa using (Finset.sum_le_sum (s := univ) (fun j _ => hcoverage j)) have hf : Integrable (fun x => δ * ((gridCount M t δ (L x) (U x) : ℝ) - 1)) μ₀ := (hc.sub (integrable_const 1)).const_mul δ have heq : (∫ x, δ * ((gridCount M t δ (L x) (U x) : ℝ) - 1) ∂μ₀) = δ * ((∫ x, (gridCount M t δ (L x) (U x) : ℝ) ∂μ₀) - 1) := by rw [integral_const_mul, integral_sub hc (integrable_const 1)] simp calc ofReal (δ * (((M + 1 : ℕ) : ℝ) * p - 1)) ≤ ofReal (∫ x, δ * ((gridCount M t δ (L x) (U x) : ℝ) - 1) ∂μ₀) := by apply ENNReal.ofReal_le_ofReal rw [heq] exact mul_le_mul_of_nonneg_left (sub_le_sub_right hsum 1) hδ.le _ ≤ _ := ofReal_integral_le_lintegral_ofReal_of_le hf (fun x => intervalLength_ge_gridCount M t δ (L x) (U x) hδ)
    Causalean.Stat.expected_interval_length_lower_of_grid · Causalean/Stat/Minimax/HonestConfidenceSet.lean:453
  • honest_interval_length_lower_of_grid_eventwise theorem — Honest coverage under each experiment law, an event-wise gap of at most η from each experiment law to the reference law, a grid with M gaps, origin t, and positive spacing δ, and measurable random endpoints give the finite-grid expected-length lower bound with transferred coverage 1 minus α minus η.
    Ω :
    μ₀ :
    M :
    ℕ
    μ :
    Fin (M + 1) → Measure Ω
    ∀ j, IsProbabilityMeasure (μ j)
    t δ α η :
    ℝ
    L U :
    Ω → ℝ
    hL :
    hU :
    hδ :
    0 < δ
    hhonest :
    ∀ j, 1 - α ≤ (μ j).real (coverageEvent L U (gridPoint t δ j))
    hclose :
    ∀ j,
    (μ j).real (coverageEvent L U (gridPoint t δ j))
    - μ₀.real (coverageEvent L U (gridPoint t δ j))
    ≤ η
    ofReal (δ * (((M + 1 : ℕ) : ℝ) * (1 - α - η) - 1))
    ≤ ∫⁻ x, ofReal (intervalLength (L x) (U x)) ∂μ₀
    Proof (Lean source)
    theorem honest_interval_length_lower_of_grid_eventwise {Ω : Type*} [MeasurableSpace Ω] (μ₀ : Measure Ω) [IsProbabilityMeasure μ₀] (M : ℕ) (μ : Fin (M + 1) → Measure Ω) [∀ j, IsProbabilityMeasure (μ j)] (t δ α η : ℝ) {L U : Ω → ℝ} (hL : Measurable L) (hU : Measurable U) (hδ : 0 < δ) (hhonest : ∀ j, 1 - α ≤ (μ j).real (coverageEvent L U (gridPoint t δ j))) (hclose : ∀ j, (μ j).real (coverageEvent L U (gridPoint t δ j)) - μ₀.real (coverageEvent L U (gridPoint t δ j)) ≤ η) : ofReal (δ * (((M + 1 : ℕ) : ℝ) * (1 - α - η) - 1)) ≤ ∫⁻ x, ofReal (intervalLength (L x) (U x)) ∂μ₀ := by apply expected_interval_length_lower_of_grid μ₀ M t δ (1 - α - η) hL hU hδ intro j linarith [hhonest j, hclose j]
    Causalean.Stat.honest_interval_length_lower_of_grid_eventwise · Causalean/Stat/Minimax/HonestConfidenceSet.lean:481
  • honest_interval_length_lower_of_grid_tv theorem — Honest coverage under each experiment law, total variation at most η from each experiment law to a reference law, a grid with M gaps, origin t, and positive spacing δ, and measurable random endpoints imply the finite-grid expected-length lower bound with transferred coverage 1 minus α minus η.
    Ω :
    μ₀ :
    M :
    ℕ
    μ :
    Fin (M + 1) → Measure Ω
    ∀ j, IsProbabilityMeasure (μ j)
    t δ α η :
    ℝ
    L U :
    Ω → ℝ
    hL :
    hU :
    hδ :
    0 < δ
    hhonest :
    ∀ j, 1 - α ≤ (μ j).real (coverageEvent L U (gridPoint t δ j))
    htv :
    ∀ j, tvDist μ₀ (μ j) ≤ η
    ofReal (δ * (((M + 1 : ℕ) : ℝ) * (1 - α - η) - 1))
    ≤ ∫⁻ x, ofReal (intervalLength (L x) (U x)) ∂μ₀
    Proof (Lean source)
    theorem honest_interval_length_lower_of_grid_tv {Ω : Type*} [MeasurableSpace Ω] (μ₀ : Measure Ω) [IsProbabilityMeasure μ₀] (M : ℕ) (μ : Fin (M + 1) → Measure Ω) [∀ j, IsProbabilityMeasure (μ j)] (t δ α η : ℝ) {L U : Ω → ℝ} (hL : Measurable L) (hU : Measurable U) (hδ : 0 < δ) (hhonest : ∀ j, 1 - α ≤ (μ j).real (coverageEvent L U (gridPoint t δ j))) (htv : ∀ j, tvDist μ₀ (μ j) ≤ η) : ofReal (δ * (((M + 1 : ℕ) : ℝ) * (1 - α - η) - 1)) ≤ ∫⁻ x, ofReal (intervalLength (L x) (U x)) ∂μ₀ := by apply honest_interval_length_lower_of_grid_eventwise μ₀ M μ t δ α η hL hU hδ hhonest intro j exact (measureReal_sub_le_tvDist (μ := μ₀) (ν := μ j) (measurableSet_coverageEvent hL hU)).trans (htv j)
    Causalean.Stat.honest_interval_length_lower_of_grid_tv · Causalean/Stat/Minimax/HonestConfidenceSet.lean:496
  • honest_interval_length_lower_of_grid_tv_positive theorem — For a reference law and experiment laws, a miscoverage level strictly between zero and one, a grid with at least 8 divided by one minus α gaps and positive spacing δ, a TV error at most one eighth of one minus α, honest coverage under each experiment law, and measurable random endpoints, the expected length is at least three quarters of one minus α times the grid width and is strictly positive.
    Ω :
    μ₀ :
    M :
    ℕ
    μ :
    Fin (M + 1) → Measure Ω
    ∀ j, IsProbabilityMeasure (μ j)
    t δ α η :
    ℝ
    L U :
    Ω → ℝ
    hL :
    hU :
    hδ :
    0 < δ
    hα0 :
    0 < α
    hα1 :
    α < 1
    hM :
    8 / (1 - α) ≤ (M : ℝ)
    hη :
    η ≤ (1 - α) / 8
    hhonest :
    ∀ j, 1 - α ≤ (μ j).real (coverageEvent L U (gridPoint t δ j))
    htv :
    ∀ j, tvDist μ₀ (μ j) ≤ η
    conclusion 1
    0 < 3 * (1 - α) / 4
    conclusion 2
    ofReal ((3 * (1 - α) / 4) * ((M : ℝ) * δ))
    ≤ (∫⁻ x, ofReal (intervalLength (L x) (U x)) ∂μ₀)
    conclusion 3
    0 < (∫⁻ x, ofReal (intervalLength (L x) (U x)) ∂μ₀)
    Proof (Lean source)
    theorem honest_interval_length_lower_of_grid_tv_positive {Ω : Type*} [MeasurableSpace Ω] (μ₀ : Measure Ω) [IsProbabilityMeasure μ₀] (M : ℕ) (μ : Fin (M + 1) → Measure Ω) [∀ j, IsProbabilityMeasure (μ j)] (t δ α η : ℝ) {L U : Ω → ℝ} (hL : Measurable L) (hU : Measurable U) (hδ : 0 < δ) (hα0 : 0 < α) (hα1 : α < 1) (hM : 8 / (1 - α) ≤ (M : ℝ)) (hη : η ≤ (1 - α) / 8) (hhonest : ∀ j, 1 - α ≤ (μ j).real (coverageEvent L U (gridPoint t δ j))) (htv : ∀ j, tvDist μ₀ (μ j) ≤ η) : 0 < 3 * (1 - α) / 4 ∧ ofReal ((3 * (1 - α) / 4) * ((M : ℝ) * δ)) ≤ (∫⁻ x, ofReal (intervalLength (L x) (U x)) ∂μ₀) ∧ 0 < (∫⁻ x, ofReal (intervalLength (L x) (U x)) ∂μ₀) := by have hu : 0 < 1 - α := by linarith have hMu : 8 ≤ (M : ℝ) * (1 - α) := (div_le_iff₀ hu).mp hM have hMpos : 0 < (M : ℝ) := by nlinarith have hcoeff : 0 < 3 * (1 - α) / 4 := by positivity have hbase := honest_interval_length_lower_of_grid_tv μ₀ M μ t δ α η hL hU hδ hhonest htv have harith : (3 * (1 - α) / 4) * ((M : ℝ) * δ) ≤ δ * (((M + 1 : ℕ) : ℝ) * (1 - α - η) - 1) := by have hinner : (3 * (1 - α) / 4) * (M : ℝ) ≤ ((M + 1 : ℕ) : ℝ) * (1 - α - η) - 1 := by push_cast nlinarith [mul_nonneg (show 0 ≤ (M : ℝ) + 1 by positivity) (show 0 ≤ (1 - α) / 8 - η by linarith)] nlinarith [mul_nonneg hδ.le (sub_nonneg.mpr hinner)] have hbound := (ENNReal.ofReal_le_ofReal harith).trans hbase refine ⟨hcoeff, hbound, ?_⟩ exact lt_of_lt_of_le (ENNReal.ofReal_pos.mpr (mul_pos hcoeff (mul_pos hMpos hδ))) hbound
    Causalean.Stat.honest_interval_length_lower_of_grid_tv_positive · Causalean/Stat/Minimax/HonestConfidenceSet.lean:511
KLTail 2 core · 1 supporting This file develops the likelihood-ratio truncation estimates used in the Tsybakov form of Fano's method. ★ llr_tail_le_kl_add_sqrt★ measureReal_le_exp_mul_add_llr_tail

Kullback--Leibler likelihood-ratio tails

This file develops the likelihood-ratio truncation estimates used in the Tsybakov form of Fano's method. The positive log-likelihood tail is bounded by KL plus its Pinsker correction, and measurable event probabilities are compared across absolutely continuous laws below a likelihood threshold.

theorem llr_tail_le_kl_add_sqrt reviewed
Causalean.Stat

For two probability laws, absolute continuity, an integrable log-likelihood ratio, and a positive threshold, the probability under the first law that the log-likelihood ratio exceeds the threshold is at most (KL + sqrt(KL/2)) / t.

Formal statement
Ω :
hac :
μ ≪ ν
hint :
Integrable (llr μ ν) μ
t :
ℝ
ht :
0 < t
μ.real {x | t < llr μ ν x}
≤ ((klDiv μ ν).toReal + sqrt ((klDiv μ ν).toReal / 2)) / t
Proof (Lean source)
theorem llr_tail_le_kl_add_sqrt {Ω : Type*} [MeasurableSpace Ω] (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (llr μ ν) μ) {t : ℝ} (ht : 0 < t) : μ.real {x | t < llr μ ν x} ≤ ((klDiv μ ν).toReal + sqrt ((klDiv μ ν).toReal / 2)) / t := by let f : Ω → ℝ := llr μ ν have hf : Integrable f μ := hint have hpos : Integrable (fun x => (f x)⁺) μ := by simp only [posPart] exact hf.sup (integrable_const 0) have hneg : Integrable (fun x => (-f x)⁺) μ := by simp only [posPart] exact hf.neg.sup (integrable_const 0) have hsplit : ∫ x, (f x)⁺ ∂μ = ∫ x, f x ∂μ + ∫ x, (-f x)⁺ ∂μ := by rw [← integral_add hf hneg] apply integral_congr_ae filter_upwards [] with x rcases le_total 0 (f x) with hx | hx · simp [hx] · simp [hx] have hkl : (klDiv μ ν).toReal = ∫ x, f x ∂μ := by exact InformationTheory.toReal_klDiv_of_measure_eq hac (by simp [measure_univ]) have hfin : klDiv μ ν ≠ ⊤ := InformationTheory.klDiv_ne_top_iff.mpr ⟨hac, hint⟩ have hpinsker := pinskerBound_of_ac_of_ne_top μ ν hac hfin have hnegLe : ∫ x, (-f x)⁺ ∂μ ≤ tvDist μ ν := by exact llr_negPart_integral_le_tvDist μ ν hac hint have hposLe : ∫ x, (f x)⁺ ∂μ ≤ (klDiv μ ν).toReal + sqrt ((klDiv μ ν).toReal / 2) := by rw [hsplit, ← hkl] exact add_le_add le_rfl (hnegLe.trans hpinsker) have hmarkov := mul_meas_ge_le_integral_of_nonneg (μ := μ) (f := fun x => (f x)⁺) (Filter.Eventually.of_forall fun x => posPart_nonneg (f x)) hpos t have hsubset : {x | t < f x} ⊆ {x | t ≤ (f x)⁺} := by intro x hx exact hx.le.trans (le_posPart (f x)) have hmono : μ.real {x | t < f x} ≤ μ.real {x | t ≤ (f x)⁺} := measureReal_mono hsubset (measure_ne_top _ _) have hmul : t * μ.real {x | t < f x} ≤ ∫ x, (f x)⁺ ∂μ := (mul_le_mul_of_nonneg_left hmono ht.le).trans hmarkov change μ.real {x | t < f x} ≤ _ rw [le_div_iff₀ ht] simpa [mul_comm] using hmul.trans hposLe
Causalean.Stat.llr_tail_le_kl_add_sqrt · Causalean/Stat/Minimax/KLTail.lean:92
theorem measureReal_le_exp_mul_add_llr_tail reviewed
Causalean.Stat

For two probability laws, absolute continuity, a measurable event, and a log-likelihood threshold, the first law's event probability is at most exp(t) times the second law's event probability plus the first law's above-threshold probability.

Formal statement
Ω :
hac :
μ ≪ ν
A :
Set Ω
hA :
t :
ℝ
μ.real A ≤ exp t * ν.real A + μ.real {x | t < llr μ ν x}
Proof (Lean source)
theorem measureReal_le_exp_mul_add_llr_tail {Ω : Type*} [MeasurableSpace Ω] (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) {A : Set Ω} (hA : MeasurableSet A) (t : ℝ) : μ.real A ≤ exp t * ν.real A + μ.real {x | t < llr μ ν x} := by let B : Set Ω := {x | llr μ ν x ≤ t} let T : Set Ω := {x | t < llr μ ν x} let p : Ω → ℝ := fun x => (μ.rnDeriv ν x).toReal have hB : MeasurableSet B := measurableSet_le (measurable_llr μ ν) measurable_const have hT : MeasurableSet T := measurableSet_lt measurable_const (measurable_llr μ ν) have hcover : A ⊆ (A ∩ B) ∪ T := by intro x hx by_cases hxt : t < llr μ ν x · exact inr hxt · exact inl ⟨hx, le_of_not_gt hxt⟩ have hp : Integrable p ν := Measure.integrable_toReal_rnDeriv have hp_bound : μ.real (A ∩ B) ≤ exp t * ν.real A := by rw [← Measure.setIntegral_toReal_rnDeriv hac (A ∩ B)] calc ∫ x in A ∩ B, p x ∂ν ≤ ∫ _x in A ∩ B, exp t ∂ν := by apply setIntegral_mono_on hp.integrableOn (integrable_const _) (hA.inter hB) intro x hx dsimp [p] by_cases hpx : (μ.rnDeriv ν x).toReal = 0 · rw [hpx] exact (Real.exp_pos t).le · rw [← Real.exp_log (lt_of_le_of_ne ENNReal.toReal_nonneg (Ne.symm hpx))] exact Real.exp_le_exp.mpr hx.2 _ = exp t * ν.real (A ∩ B) := by rw [setIntegral_const] simp [mul_comm] _ ≤ exp t * ν.real A := by exact mul_le_mul_of_nonneg_left (measureReal_mono Set.inter_subset_left (measure_ne_top _ _)) (Real.exp_pos t).le calc μ.real A ≤ μ.real ((A ∩ B) ∪ T) := measureReal_mono hcover (measure_ne_top _ _) _ ≤ μ.real (A ∩ B) + μ.real T := measureReal_union_le _ _ _ ≤ exp t * ν.real A + μ.real T := add_le_add hp_bound le_rfl _ = exp t * ν.real A + μ.real {x | t < llr μ ν x} := rfl
Causalean.Stat.measureReal_le_exp_mul_add_llr_tail · Causalean/Stat/Minimax/KLTail.lean:148
1 supporting declaration (lemmas, instances)
  • llr_negPart_integral_le_tvDist theorem — For two probability laws, if the first is absolutely continuous with respect to the second and their log-likelihood ratio is integrable, then the expected negative part of that log-likelihood ratio is at most their total-variation distance.
    Ω :
    hac :
    μ ≪ ν
    hint :
    Integrable (llr μ ν) μ
    ∫ x, (-llr μ ν x)⁺ ∂μ ≤ tvDist μ ν
    Proof (Lean source)
    theorem llr_negPart_integral_le_tvDist {Ω : Type*} [MeasurableSpace Ω] (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (llr μ ν) μ) : ∫ x, (-llr μ ν x)⁺ ∂μ ≤ tvDist μ ν := by let p : Ω → ℝ := fun x => (μ.rnDeriv ν x).toReal let d : Ω → ℝ := fun x => p x - 1 have hp : Integrable p ν := Measure.integrable_toReal_rnDeriv have hd : Integrable d ν := hp.sub (integrable_const 1) have hd0 : ∫ x, d x ∂ν = 0 := by rw [show d = fun x => p x - 1 from rfl, integral_sub hp (integrable_const 1)] rw [show p = fun x => (μ.rnDeriv ν x).toReal from rfl, Measure.integral_toReal_rnDeriv hac] simp [probReal_univ] have hneg : Integrable (fun x => (-llr μ ν x)⁺) μ := by simp only [posPart] exact hint.neg.sup (integrable_const 0) rw [← integral_toReal_rnDeriv_mul hac] have hpoint : ∀ x, p x * (-llr μ ν x)⁺ ≤ (d x)⁻ := by intro x simpa [p, d, llr] using density_mul_negPart_log_le_negPart_sub_one (ENNReal.toReal_nonneg : 0 ≤ (μ.rnDeriv ν x).toReal) have hle : ∫ x, p x * (-llr μ ν x)⁺ ∂ν ≤ ∫ x, (d x)⁻ ∂ν := by apply integral_mono · exact (integrable_toReal_rnDeriv_mul_iff hac).2 hneg · simp only [NegPart.negPart] exact hd.neg.sup (integrable_const 0) · exact hpoint refine hle.trans ?_ have habs := integral_abs_eq_two_mul_integral_negPart_add_integral hd rw [hd0, add_zero] at habs have htv := tvDist_eq_half_integral_abs_rnDeriv_sub μ ν ν hac (by rfl) have hrnself : (fun x => |(μ.rnDeriv ν x).toReal - (ν.rnDeriv ν x).toReal|) =ᵐ[ν] fun x => |d x| := by filter_upwards [Measure.rnDeriv_self ν] with x hx simp [d, p, hx] rw [integral_congr_ae hrnself] at htv rw [htv, habs] ring_nf exact le_rfl
    Causalean.Stat.llr_negPart_integral_le_tvDist · Causalean/Stat/Minimax/KLTail.lean:43
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:50 · 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:76 · uses tvDist
1 supporting declaration (lemmas, instances)
  • measurableSet_error theorem — The error region {ω | s ≤ dist (est ω) θ} of an estimator is measurable.
    Ω :
    Type u_1
    shared
    Θ :
    Type u_2
    Ω → Θ
    shared
    hest :
    θ :
    Θ
    s :
    ℝ
    MeasurableSet {ω | s ≤ dist (est ω) θ}
    Proof (Lean source)
    theorem measurableSet_error {est : Ω → Θ} (hest : Measurable est) (θ : Θ) (s : ℝ) : MeasurableSet {ω | s ≤ dist (est ω) θ} := by have hclosed : IsClosed {x : Θ | s ≤ dist x θ} := isClosed_le continuous_const (continuous_id.dist continuous_const) exact hest hclosed.measurableSet
    Causalean.Stat.measurableSet_error · Causalean/Stat/Minimax/LeCam.lean:43
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| and an n-sample KL budget 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(-max K 0) / 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 L¹ risk. Fix a KL budget C at most 1/2. Then for every sample size and every pair of single-observation laws such that the first is absolutely continuous with respect to the second, their log-likelihood ratio is integrable, and their scaled KL divergence is bounded by C, every pair of separated real targets, and every measurable estimator with integrable absolute loss under both n-fold product laws, the worst-case Bochner L¹ risk is at least 1/8 times the target separation.

Formal statement
Ω :
C :
ℝ
hC_small :
C ≤ 1 / 2
n :
ℕ
θP θQ δ :
ℝ
P ≪ Q
Integrable (llr P Q) P
(n : ℝ) * (_root_.InformationTheory.klDiv P Q).toReal ≤ C
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))
(1 / 8 : ℝ) * δ
≤ 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_small : C ≤ 1 / 2) : ∀ (n : ℕ), ∀ (P Q : Measure Ω) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] (θP θQ δ : ℝ), P ≪ Q → Integrable (llr P Q) P → (n : ℝ) * (_root_.InformationTheory.klDiv P Q).toReal ≤ C → 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)) → (1 / 8 : ℝ) * δ ≤ max (∫ ω, |T ω - θP| ∂Measure.pi (fun _ : Fin n => P)) (∫ ω, |T ω - θQ| ∂Measure.pi (fun _ : Fin n => Q)) := by intro n P Q _ _ θP θQ δ hPQ hllr hKLbound hδnonneg hδsep T hT hIntp hIntq have hKLprod := (productKL_tensorization n P Q hPQ hllr).apply have hPinsker := Causalean.Stat.pinskerBound_pi_iid P Q hPQ hllr n 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:70
theorem 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(−max K 0)/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)
theorem 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
LIntegral­Risk 5 core · 4 supporting This module provides the standard extended-expectation formulation of squared risk. ★ leCam_two_point_L1_lintegral_lower★ le_cam_two_point_mse_lintegral★ le_cam_two_point_mse_lintegral_pi_iid

Extended-valued squared risk and Le Cam lower bounds

This module provides the standard extended-expectation formulation of squared risk. Because the risk is an ℝ≥0∞ lintegral, nonintegrable estimators have infinite risk rather than the zero value assigned by the Bochner integral. It gives a no-integrability Le Cam two-point MSE bound and deterministic affine-transport lemmas for ordinary and finite-product experiments.

def sqRiskLIntegral reviewed
Causalean.Stat

Given a measure on an observation space, a real-valued estimator, and a real target, the extended squared risk is the ℝ≥0∞ expectation of the estimator's squared error. Nonintegrable loss therefore has infinite, rather than zero, risk.

Definition (Lean source)
X :
Type uX
shared
law :
est :
X → ℝ
theta :
ℝ
sqRiskLIntegral law est theta :
∫⁻ z, ofReal ((est z - theta) ^ 2) ∂law
Causalean.Stat.sqRiskLIntegral · Causalean/Stat/Minimax/LIntegralRisk.lean:32
def l1RiskLIntegral reviewed
Causalean.Stat

Given a measure on an observation space, a real-valued estimator, and a real target, the extended absolute-error risk is the ℝ≥0∞ expectation of the estimator's absolute error.

Definition (Lean source)
X :
Type uX
shared
law :
est :
X → ℝ
theta :
ℝ
l1RiskLIntegral law est theta :
∫⁻ z, ofReal |est z - theta| ∂law
Causalean.Stat.l1RiskLIntegral · Causalean/Stat/Minimax/LIntegralRisk.lean:39
theorem leCam_two_point_L1_lintegral_lower reviewed
Causalean.Stat.Minimax

Le Cam two-point lower bound on extended L¹ risk. Fix a KL budget that is positive and at most 1/2, and a positive sample size. For two one-observation probability laws with absolute continuity, integrable log-likelihood ratio, and scaled product KL at most the budget, three nonnegative-separated target values satisfying nonnegativity and separation, and a measurable estimator, the maximum ℝ≥0∞ absolute-error risk under the two product laws is at least 1/8 times the separation, without a loss-integrability assumption.

Formal statement
S :
C :
ℝ
_hC_pos :
0 < C
hC_small :
C ≤ 1 / 2
n :
ℕ
_hn :
1 ≤ n
thetaP thetaQ delta :
ℝ
hPQ :
P ≪ Q
hllr :
Integrable (llr P Q) P
hKLbound :
(n : ℝ) * (klDiv P Q).toReal ≤ C
hδnonneg :
0 ≤ delta
hδsep :
delta ≤ |thetaP - thetaQ|
T :
(Fin n → S) → ℝ
hT :
ofReal (1 / 8 : ℝ) * ofReal delta
≤ max (l1RiskLIntegral (Measure.pi (fun _ : Fin n => P)) T thetaP) (l1RiskLIntegral (Measure.pi (fun _ : Fin n => Q)) T thetaQ)
Proof (Lean source)
theorem leCam_two_point_L1_lintegral_lower {S : Type*} [MeasurableSpace S] (C : ℝ) (_hC_pos : 0 < C) (hC_small : C ≤ 1 / 2) (n : ℕ) (_hn : 1 ≤ n) (P Q : Measure S) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] (thetaP thetaQ delta : ℝ) (hPQ : P ≪ Q) (hllr : Integrable (llr P Q) P) (hKLbound : (n : ℝ) * (klDiv P Q).toReal ≤ C) (hδnonneg : 0 ≤ delta) (hδsep : delta ≤ |thetaP - thetaQ|) (T : (Fin n → S) → ℝ) (hT : Measurable T) : ofReal (1 / 8 : ℝ) * ofReal delta ≤ max (l1RiskLIntegral (Measure.pi (fun _ : Fin n => P)) T thetaP) (l1RiskLIntegral (Measure.pi (fun _ : Fin n => Q)) T thetaQ) := by let PP := Measure.pi (fun _ : Fin n => P) let QQ := Measure.pi (fun _ : Fin n => Q) have hKLprod := (productKL_tensorization n P Q hPQ hllr).apply have hPinsker := Causalean.Stat.pinskerBound_pi_iid P Q hPQ hllr n have hsep : 2 * (delta / 2) ≤ dist thetaP thetaQ := by rw [Real.dist_eq] linarith have hprob := klForm_two_point_lower_bound_of_pinsker (P₀ := PP) (P₁ := QQ) (Θ := ℝ) hPinsker hT hsep have hklprodC : (klDiv PP QQ).toReal ≤ C := hKLprod.trans hKLbound have hprobLower : (1 / 4 : ℝ) ≤ max (PP.real {ω | delta / 2 ≤ dist (T ω) thetaP}) (QQ.real {ω | delta / 2 ≤ dist (T ω) thetaQ}) := by have hkl_nonneg : 0 ≤ (klDiv PP QQ).toReal := ENNReal.toReal_nonneg have hdiv_le : (klDiv PP QQ).toReal / 2 ≤ (1 / 4 : ℝ) := by nlinarith have hsqrt_le : sqrt ((klDiv PP QQ).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, Real.sqrt_sq (by norm_num : 0 ≤ (1 / 2 : ℝ))] exact (show (1 / 4 : ℝ) ≤ (1 - sqrt ((klDiv PP QQ).toReal / 2)) / 2 by nlinarith).trans hprob have hprobLower_en : ofReal (1 / 4 : ℝ) ≤ max (PP {ω | delta / 2 ≤ |T ω - thetaP|}) (QQ {ω | delta / 2 ≤ |T ω - thetaQ|}) := by have h := ENNReal.ofReal_le_ofReal hprobLower simpa [PP, QQ, ENNReal.ofReal_max, Measure.real, Real.dist_eq] using h have hevent (R : Measure (Fin n → S)) [IsProbabilityMeasure R] (theta : ℝ) : ofReal (delta / 2) * R {ω | delta / 2 ≤ |T ω - theta|} ≤ l1RiskLIntegral R T theta := by have hset : MeasurableSet {ω : Fin n → S | delta / 2 ≤ |T ω - theta|} := by simpa [Real.norm_eq_abs] using measurableSet_le measurable_const (hT.sub measurable_const).norm unfold l1RiskLIntegral calc ofReal (delta / 2) * R {ω | delta / 2 ≤ |T ω - theta|} = ∫⁻ _ω in {ω | delta / 2 ≤ |T ω - theta|}, ofReal (delta / 2) ∂R := (setLIntegral_const _ _).symm _ = ∫⁻ ω, {ω | delta / 2 ≤ |T ω - theta|}.indicator (fun _ => ofReal (delta / 2)) ω ∂R := (lintegral_indicator hset _).symm _ ≤ ∫⁻ ω, ofReal |T ω - theta| ∂R := by apply lintegral_mono intro ω by_cases hω : delta / 2 ≤ |T ω - theta| · rw [Set.indicator_of_mem (show ω ∈ {ω | delta / 2 ≤ |T ω - theta|} from hω)] exact ENNReal.ofReal_le_ofReal hω · rw [Set.indicator_of_notMem (show ω ∉ {ω | delta / 2 ≤ |T ω - theta|} from hω)] exact bot_le have hmax : ofReal (delta / 2) * max (PP {ω | delta / 2 ≤ |T ω - thetaP|}) (QQ {ω | delta / 2 ≤ |T ω - thetaQ|}) ≤ max (l1RiskLIntegral PP T thetaP) (l1RiskLIntegral QQ T thetaQ) := by rw [mul_max] exact max_le_max (hevent PP thetaP) (hevent QQ thetaQ) calc ofReal (1 / 8 : ℝ) * ofReal delta = ofReal (delta / 2) * ofReal (1 / 4 : ℝ) := by rw [← ENNReal.ofReal_mul (by norm_num : 0 ≤ (1 / 8 : ℝ)), ← ENNReal.ofReal_mul (by linarith : 0 ≤ delta / 2)] congr 1 ring _ ≤ ofReal (delta / 2) * max (PP {ω | delta / 2 ≤ |T ω - thetaP|}) (QQ {ω | delta / 2 ≤ |T ω - thetaQ|}) := by gcongr _ ≤ max (l1RiskLIntegral PP T thetaP) (l1RiskLIntegral QQ T thetaQ) := hmax
Causalean.Stat.Minimax.leCam_two_point_L1_lintegral_lower · Causalean/Stat/Minimax/LIntegralRisk.lean:145 · uses l1RiskLIntegral
theorem le_cam_two_point_mse_lintegral reviewed
Causalean.Stat.Minimax

Le Cam two-point lower bound for extended mean-squared risk. For a finite KL budget that is nonnegative, two candidate laws, their target values, and a measurable estimator, if the first law's KL divergence from the second is at most the budget, the maximum ℝ≥0∞ squared risk is at least exp(-K)/32 times the squared parameter separation, without a loss-integrability assumption.

Formal statement
K :
ℝ
hK :
0 ≤ K
S :
theta0 theta1 :
ℝ
klDiv Q0 Q1 ≤ ofReal K
T :
S → ℝ
ofReal (exp (-K) / 32) * ofReal ((theta1 - theta0) ^ 2)
≤ max (sqRiskLIntegral Q0 T theta0) (sqRiskLIntegral Q1 T theta1)
Proof (Lean source)
theorem le_cam_two_point_mse_lintegral (K : ℝ) (hK : 0 ≤ K) : ∀ {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 → ENNReal.ofReal (exp (-K) / 32) * ENNReal.ofReal ((theta1 - theta0) ^ 2) ≤ max (sqRiskLIntegral Q0 T theta0) (sqRiskLIntegral Q1 T theta1) := by intro S _ Q0 Q1 _ _ theta0 theta1 hKL T hT let r : ℝ := |theta1 - theta0| / 2 have hr_nonneg : 0 ≤ r := by dsimp [r]; positivity have hsep_dist : 2 * r ≤ dist theta0 theta1 := by rw [Real.dist_eq, abs_sub_comm] dsimp [r] linarith [abs_nonneg (theta1 - theta0)] have hprob := half_one_sub_tvDist_le_max_error (P₀ := Q0) (P₁ := Q1) (Θ := ℝ) hT hsep_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 (-K) ≤ exp (-(InformationTheory.klDiv Q0 Q1).toReal) := Real.exp_le_exp.mpr (by rw [ENNReal.toReal_ofReal hK] at hkl_toReal_le; linarith) 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 (-K) / 4 ≤ max (Q0.real {s | r ≤ |T s - theta0|}) (Q1.real {s | r ≤ |T s - theta1|}) := by calc exp (-K) / 4 ≤ ((1 / 2 : ℝ) * exp (-(InformationTheory.klDiv Q0 Q1).toReal)) / 2 := by nlinarith [hexp_budget, Real.exp_pos (-K), 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|}) := by simpa only [Real.dist_eq] using hprob have hprob_floor_en : ENNReal.ofReal (exp (-K) / 4) ≤ max (Q0 {s | r ≤ |T s - theta0|}) (Q1 {s | r ≤ |T s - theta1|}) := by have h := ENNReal.ofReal_le_ofReal hprob_floor simpa [ENNReal.ofReal_max, Measure.real] using h have hset0 : MeasurableSet {s : S | r ^ 2 ≤ (T s - theta0) ^ 2} := measurableSet_le measurable_const ((hT.sub measurable_const).pow_const 2) have hset1 : MeasurableSet {s : S | r ^ 2 ≤ (T s - theta1) ^ 2} := measurableSet_le measurable_const ((hT.sub measurable_const).pow_const 2) have hevent0 : {s : S | r ≤ |T s - theta0|} = {s : S | r ^ 2 ≤ (T s - theta0) ^ 2} := by ext s simpa [sq_abs] using (sq_le_sq₀ hr_nonneg (abs_nonneg (T s - theta0))).symm have hevent1 : {s : S | r ≤ |T s - theta1|} = {s : S | r ^ 2 ≤ (T s - theta1) ^ 2} := by ext s simpa [sq_abs] using (sq_le_sq₀ hr_nonneg (abs_nonneg (T s - theta1))).symm have hmse0 : ENNReal.ofReal (r ^ 2) * Q0 {s | r ≤ |T s - theta0|} ≤ sqRiskLIntegral Q0 T theta0 := by rw [hevent0] unfold sqRiskLIntegral calc ENNReal.ofReal (r ^ 2) * Q0 {s | r ^ 2 ≤ (T s - theta0) ^ 2} = ∫⁻ _s in {s | r ^ 2 ≤ (T s - theta0) ^ 2}, ENNReal.ofReal (r ^ 2) ∂Q0 := (setLIntegral_const _ _).symm _ = ∫⁻ s, {s | r ^ 2 ≤ (T s - theta0) ^ 2}.indicator (fun _ => ENNReal.ofReal (r ^ 2)) s ∂Q0 := (lintegral_indicator hset0 _).symm _ ≤ ∫⁻ s, ENNReal.ofReal ((T s - theta0) ^ 2) ∂Q0 := by apply lintegral_mono intro s by_cases hs : r ^ 2 ≤ (T s - theta0) ^ 2 · rw [Set.indicator_of_mem (show s ∈ {s | r ^ 2 ≤ (T s - theta0) ^ 2} from hs)] exact ENNReal.ofReal_le_ofReal hs · rw [Set.indicator_of_notMem (show s ∉ {s | r ^ 2 ≤ (T s - theta0) ^ 2} from hs)] exact bot_le have hmse1 : ENNReal.ofReal (r ^ 2) * Q1 {s | r ≤ |T s - theta1|} ≤ sqRiskLIntegral Q1 T theta1 := by rw [hevent1] unfold sqRiskLIntegral calc ENNReal.ofReal (r ^ 2) * Q1 {s | r ^ 2 ≤ (T s - theta1) ^ 2} = ∫⁻ _s in {s | r ^ 2 ≤ (T s - theta1) ^ 2}, ENNReal.ofReal (r ^ 2) ∂Q1 := (setLIntegral_const _ _).symm _ = ∫⁻ s, {s | r ^ 2 ≤ (T s - theta1) ^ 2}.indicator (fun _ => ENNReal.ofReal (r ^ 2)) s ∂Q1 := (lintegral_indicator hset1 _).symm _ ≤ ∫⁻ s, ENNReal.ofReal ((T s - theta1) ^ 2) ∂Q1 := by apply lintegral_mono intro s by_cases hs : r ^ 2 ≤ (T s - theta1) ^ 2 · rw [Set.indicator_of_mem (show s ∈ {s | r ^ 2 ≤ (T s - theta1) ^ 2} from hs)] exact ENNReal.ofReal_le_ofReal hs · rw [Set.indicator_of_notMem (show s ∉ {s | r ^ 2 ≤ (T s - theta1) ^ 2} from hs)] exact bot_le have hmse_max : ENNReal.ofReal (r ^ 2) * max (Q0 {s | r ≤ |T s - theta0|}) (Q1 {s | r ≤ |T s - theta1|}) ≤ max (sqRiskLIntegral Q0 T theta0) (sqRiskLIntegral Q1 T theta1) := by rw [mul_max] exact max_le_max hmse0 hmse1 have hrate : ENNReal.ofReal (r ^ 2) * ENNReal.ofReal (exp (-K) / 4) ≤ max (sqRiskLIntegral Q0 T theta0) (sqRiskLIntegral Q1 T theta1) := by apply le_trans _ hmse_max gcongr have hcoef : ENNReal.ofReal (exp (-K) / 32) * ENNReal.ofReal ((theta1 - theta0) ^ 2) ≤ ENNReal.ofReal (r ^ 2) * ENNReal.ofReal (exp (-K) / 4) := by rw [← ENNReal.ofReal_mul (by positivity), ← ENNReal.ofReal_mul (sq_nonneg r)] apply ENNReal.ofReal_le_ofReal dsimp [r] nlinarith [sq_abs (theta1 - theta0), Real.exp_pos (-K)] exact hcoef.trans hrate
Causalean.Stat.Minimax.le_cam_two_point_mse_lintegral · Causalean/Stat/Minimax/LIntegralRisk.lean:240 · uses sqRiskLIntegral
theorem le_cam_two_point_mse_lintegral_pi_iid reviewed
Causalean.Stat.Minimax

I.i.d.-product Le Cam lower bound for extended mean-squared risk. For probability laws P,Q with absolute continuity, integrable log-likelihood ratio, a one-observation KL budget that is nonnegative and bounds KL, a sample size, two target values, and a measurable estimator, the maximum extended squared risk is at least exp(-n*k)/32 times the squared target separation. The theorem performs KL tensorization and the ℝ≥0∞/real conversion internally.

Formal statement
S :
hPQ :
P ≪ Q
hllr :
Integrable (llr P Q) P
k :
ℝ
hk :
0 ≤ k
hKL :
klDiv P Q ≤ ofReal k
n :
ℕ
thetaP thetaQ :
ℝ
T :
(Fin n → S) → ℝ
hT :
ofReal (exp (-(n : ℝ) * k) / 32) * ofReal ((thetaQ - thetaP) ^ 2)
≤ max (sqRiskLIntegral (Measure.pi (fun _ : Fin n => P)) T thetaP) (sqRiskLIntegral (Measure.pi (fun _ : Fin n => Q)) T thetaQ)
Proof (Lean source)
theorem le_cam_two_point_mse_lintegral_pi_iid {S : Type*} [MeasurableSpace S] (P Q : Measure S) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] (hPQ : P ≪ Q) (hllr : Integrable (llr P Q) P) (k : ℝ) (hk : 0 ≤ k) (hKL : klDiv P Q ≤ ofReal k) (n : ℕ) (thetaP thetaQ : ℝ) (T : (Fin n → S) → ℝ) (hT : Measurable T) : ofReal (exp (-(n : ℝ) * k) / 32) * ofReal ((thetaQ - thetaP) ^ 2) ≤ max (sqRiskLIntegral (Measure.pi (fun _ : Fin n => P)) T thetaP) (sqRiskLIntegral (Measure.pi (fun _ : Fin n => Q)) T thetaQ) := by have htensor := Causalean.Mathlib.InformationTheory.productKL_tensorization n P Q hPQ hllr have hprodKL : klDiv (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q)) ≤ ofReal ((n : ℝ) * k) := by apply (ENNReal.toReal_le_toReal htensor.product_ne_top ENNReal.ofReal_ne_top).mp rw [productKL_tensorization_of_finite n P Q hPQ hllr, ENNReal.toReal_ofReal (mul_nonneg (Nat.cast_nonneg n) hk)] have hsingle := ENNReal.toReal_mono ENNReal.ofReal_ne_top hKL rw [ENNReal.toReal_ofReal hk] at hsingle exact mul_le_mul_of_nonneg_left hsingle (Nat.cast_nonneg n) simpa [neg_mul] using le_cam_two_point_mse_lintegral ((n : ℝ) * k) (mul_nonneg (Nat.cast_nonneg n) hk) (Measure.pi (fun _ : Fin n => P)) (Measure.pi (fun _ : Fin n => Q)) thetaP thetaQ hprodKL T hT
Causalean.Stat.Minimax.le_cam_two_point_mse_lintegral_pi_iid · Causalean/Stat/Minimax/LIntegralRisk.lean:365 · uses sqRiskLIntegral
4 supporting declarations (lemmas, instances)
Markov­Kernel­Transport 9 core · 22 supporting This module packages squared-risk transport through Markov kernels and its capped-Poisson specialization. ★ forall_estimator_exists_sqRisk_ge_of_kernel_affine_transport_pi★ sqRisk_raoBlackwellStatistic_le

Squared-risk transport through Markov kernels

This module packages squared-risk transport through Markov kernels and its capped-Poisson specialization. Among uniformly bounded measurable estimators, randomizing an experiment cannot improve the best attainable squared-error risk: the file constructs a Rao--Blackwell pullback, proves its affine-target risk comparison, and transports minimax lower bounds within that class for one or finitely many independent observations. It then uses the same machinery to compare a finite-Poisson experiment with a fixed-size experiment by capping the auxiliary Poisson count, including explicit control of overflow risk.

Main results

* forall_estimator_exists_sqRisk_ge_of_kernel_affine_transport transfers a quantified squared-risk lower bound for uniformly bounded measurable estimators 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 for uniformly bounded measurable estimators. * sqRisk_raoBlackwellStatistic_le bounds the fixed-size Rao--Blackwell risk by the nonoverflow finite-Poisson risk plus an overflow penalty. * sqRisk_raoBlackwellStatistic_unitInterval_le specializes that bound to unit-interval statistics.

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:98
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 := piFinSuccAbove (fun _ : Fin (n + 1) => X) 0 let eY := 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:388 · 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:454
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:498 · 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)
Overlap­Coupling 5 core · 14 supporting This file develops the common-submeasure and overlap-coupling construction used by the coordinatewise direct-product argument. ★ overlapCoupling_eq_mass_ge

Overlap couplings through a measurable compression

This file develops the common-submeasure and overlap-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/OverlapCoupling.lean:25
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 overlapCoupling reviewed
Causalean.Stat

Given a measurable sample space and two probability measures on it, the overlap 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)
overlapCoupling 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.overlapCoupling · Causalean/Stat/Minimax/OverlapCoupling.lean:222
lemma overlapCoupling_eq_mass_ge reviewed
Causalean.Stat

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

Formal statement
ofReal (1 - tvDist mu nu) ≤ overlapCoupling mu nu {p | p.1 = p.2}
Proof (Lean source)
lemma overlapCoupling_eq_mass_ge {X : Type*} [MeasurableSpace X] [MeasurableEq X] (mu nu : Measure X) [IsProbabilityMeasure mu] [IsProbabilityMeasure nu] : ofReal (1 - tvDist mu nu) ≤ overlapCoupling 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) ≤ overlapCoupling mu nu D by_cases hzero : tvDist mu nu = 0 · rw [overlapCoupling, 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 [overlapCoupling, 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.overlapCoupling_eq_mass_ge · Causalean/Stat/Minimax/OverlapCoupling.lean:369 · uses overlapCoupling , 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 applying the overlap-coupling construction to 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 := overlapCoupling (Q0.map compress) (Q1.map compress) exact ((K0.comap fst measurable_fst) ×ₖ (K1.comap snd measurable_snd)) ∘ₘ gamma
Causalean.Stat.compressionCoupling · Causalean/Stat/Minimax/OverlapCoupling.lean:408
14 supporting declarations (lemmas, instances)
Pinsker 4 core · 3 supporting Proves Pinsker's inequality and its KL-form Le Cam minimax lower-bound corollaries. ★ pinskerBound_of_ac_of_ne_top★ 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:246
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:291 · 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:468 · 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:494
3 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:212
  • 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:232
  • pinskerBound_pi_iid theorem — 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.
    α :
    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:445
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:112 · 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:53
  • 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:97
Sequential­Cumulative­Risk 1 core · 4 supporting This module proves a deterministic sequence lemma: a reciprocal lower bound on each new term, whose denominator depends on time and the preceding cumulative total, forces that total to grow at least logarithmically. ★ cumulative_risk_engine

Sequential-experiment cumulative-risk engine

This module proves a deterministic sequence lemma: a reciprocal lower bound on each new term, whose denominator depends on time and the preceding cumulative total, forces that total to grow at least logarithmically. A second theorem transfers the rate through two assumed comparison inequalities. Statistical arguments that might establish those assumptions are outside this file.

The core theorem assumes the recursion

bₜ ≥ (d²/4) / (Iq + (5J/4)·t + L·√(t·B_{t-1}))

for every positive round and proves that, beyond some threshold, B_T ≥ (d²/(32 J))·log T. The proof combines a self-bounding argument with a harmonic-tail estimate.

The main engine is cumulative_risk_engine. The theorem sequential_cumulative_risk_regret_of_recursion combines it with the assumed comparisons R^B_T ≥ 2 S² B_T and Rsup T ≥ R^B_T. The standalone harmonic-tail bound harmonic_sum_ge_log_sub_log is also independently reusable.

theorem cumulative_risk_engine reviewed
Causalean.Stat

Cumulative lower bound from a reciprocal recursion. When positive scale and nonzero numerator coefficients, nonnegative feedback and offset coefficients, and a sequence with specified running totals satisfy the reciprocal lower bound at every positive index, the running total is eventually at least d²/(32J) times the logarithm of the index.

Formal statement
J d L Iq :
ℝ
hJ :
0 < J
hd :
d ≠ 0
hL :
0 ≤ L
hIq :
0 ≤ Iq
b :
ℕ → ℝ
B :
ℕ → ℝ
hB :
∀ n, B n = ∑ t ∈ Icc 1 n, b t
hrec :
∀ t : ℕ
if
1 ≤ t
then
(d ^ 2 / 4) / (Iq + (5 * J / 4) * (t : ℝ) + L * sqrt ((t : ℝ) * B (t - 1))) ≤ b t
∃ T₀ : ℕ, ∀ T : ℕ, T₀ ≤ T → (d ^ 2 / (32 * J)) * log (T : ℝ) ≤ B T
Proof (Lean source)
theorem cumulative_risk_engine (J d L Iq : ℝ) (hJ : 0 < J) (hd : d ≠ 0) (hL : 0 ≤ L) (hIq : 0 ≤ Iq) (b : ℕ → ℝ) (B : ℕ → ℝ) (hB : ∀ n, B n = ∑ t ∈ Icc 1 n, b t) (hrec : ∀ t : ℕ, 1 ≤ t → (d ^ 2 / 4) / (Iq + (5 * J / 4) * (t : ℝ) + L * sqrt ((t : ℝ) * B (t - 1))) ≤ b t) : ∃ T₀ : ℕ, ∀ T : ℕ, T₀ ≤ T → (d ^ 2 / (32 * J)) * log (T : ℝ) ≤ B T := by classical have hd2 : 0 < d ^ 2 := sq_pos_of_ne_zero hd have hJ_ne : J ≠ 0 := ne_of_gt hJ have hden_pos : ∀ t : ℕ, 1 ≤ t → 0 < Iq + (5 * J / 4) * (t : ℝ) + L * sqrt ((t : ℝ) * B (t - 1)) := by intro t ht have htpos : 0 < (t : ℝ) := by exact_mod_cast ht have hmain : 0 < (5 * J / 4) * (t : ℝ) := by positivity have hsqrt_nonneg : 0 ≤ L * sqrt ((t : ℝ) * B (t - 1)) := by positivity nlinarith have hb_nonneg : ∀ t : ℕ, 1 ≤ t → 0 ≤ b t := by intro t ht have hnum_pos : 0 < d ^ 2 / 4 := by positivity have hfrac_pos : 0 < (d ^ 2 / 4) / (Iq + (5 * J / 4) * (t : ℝ) + L * sqrt ((t : ℝ) * B (t - 1))) := by positivity exact (hfrac_pos.le.trans (hrec t ht)) have hB_nonneg : ∀ n : ℕ, 0 ≤ B n := by intro n rw [hB n] exact Finset.sum_nonneg fun t ht => hb_nonneg t ((Finset.mem_Icc.mp ht).1) have hB_mono : Monotone B := by intro n n' hnn' rw [hB n, hB n'] exact Finset.sum_le_sum_of_subset_of_nonneg (by intro t ht exact Finset.mem_Icc.mpr ⟨(Finset.mem_Icc.mp ht).1, (Finset.mem_Icc.mp ht).2.trans hnn'⟩) (by intro t ht' ht exact hb_nonneg t ((Finset.mem_Icc.mp ht').1)) let C₁ : ℝ := L ^ 2 * d ^ 2 / (8 * J ^ 3) + 1 have hC₁_pos : 0 < C₁ := by have hden : 0 < 8 * J ^ 3 := by positivity have hfrac_nonneg : 0 ≤ L ^ 2 * d ^ 2 / (8 * J ^ 3) := by positivity dsimp [C₁] nlinarith obtain ⟨Nlog, hNlog⟩ := log_lin_log_le_half_log hC₁_pos have htend : Tendsto (fun T : ℕ => log (T : ℝ)) atTop atTop := by simpa [Function.comp_def] using Real.tendsto_log_atTop.comp (tendsto_natCast_atTop_atTop (R := ℝ)) obtain ⟨NIq, hNIq⟩ := Filter.eventually_atTop.mp (htend.eventually_ge_atTop (4 * Iq / (J * C₁))) refine ⟨Nlog ⊔ NIq ⊔ 3, ?_⟩ intro T hT have hTlog : Nlog ≤ T := le_trans (le_trans (Nat.le_max_left _ _) (Nat.le_max_left _ _)) hT have hTIq : NIq ≤ T := le_trans (le_trans (Nat.le_max_right _ _) (Nat.le_max_left _ _)) hT have hT3 : 3 ≤ T := le_trans (Nat.le_max_right _ _) hT let LT : ℝ := log (T : ℝ) have hTpos_nat : 0 < T := by omega have hTpos : 0 < (T : ℝ) := by exact_mod_cast hTpos_nat have hTone : 1 ≤ (T : ℝ) := by exact_mod_cast (by omega : 1 ≤ T) have hLT_nonneg : 0 ≤ LT := by simpa [LT] using Real.log_nonneg hTone have hLT_pos : 0 < LT := by have hTgt1 : (1 : ℝ) < T := by exact_mod_cast (by omega : 1 < T) simpa [LT] using Real.log_pos hTgt1 have hlog_bound : log (C₁ * LT + 1) ≤ (1 / 2) * LT := by simpa [LT] using hNlog T hTlog have hIq_log : 4 * Iq / (J * C₁) ≤ LT := by simpa [LT] using hNIq T hTIq by_contra hgoal have hBTlt : B T < (d ^ 2 / (32 * J)) * LT := by exact not_le.mp hgoal let M : ℝ := (d ^ 2 / (32 * J)) * LT let tstar : ℕ := ceil (C₁ * LT) have hcut_pos : 0 < C₁ * LT := mul_pos hC₁_pos hLT_pos have hcut_nonneg : 0 ≤ C₁ * LT := hcut_pos.le have htstar_one : 1 ≤ tstar := by simpa [tstar] using (Nat.one_le_ceil_iff.mpr hcut_pos) have htstar_lower : C₁ * LT ≤ (tstar : ℝ) := by simpa [tstar] using (Nat.le_ceil (C₁ * LT)) have harg_pos : 0 < C₁ * LT + 1 := by positivity have harg_le_T : C₁ * LT + 1 ≤ (T : ℝ) := by have harg_le_exp : C₁ * LT + 1 ≤ exp ((1 / 2) * LT) := by exact (Real.log_le_iff_le_exp harg_pos).mp hlog_bound have hexp_le_T : exp ((1 / 2) * LT) ≤ (T : ℝ) := by calc exp ((1 / 2) * LT) ≤ exp LT := Real.exp_le_exp.mpr (by nlinarith) _ = (T : ℝ) := by simpa [LT] using Real.exp_log hTpos exact harg_le_exp.trans hexp_le_T have htstar_upper : (tstar : ℝ) ≤ C₁ * LT + 1 := by simpa [tstar] using (Nat.ceil_lt_add_one hcut_nonneg).le have htstar_le_T : tstar ≤ T := by rw [Nat.ceil_le] exact (le_add_of_nonneg_right zero_le_one).trans harg_le_T have hclaim : ∀ t : ℕ, tstar ≤ t → t ≤ T → d ^ 2 / (8 * J) * ((1 : ℝ) / (t : ℝ)) ≤ b t := by intro t htt htT have ht1 : 1 ≤ t := le_trans htstar_one htt have htpos : 0 < (t : ℝ) := by exact_mod_cast ht1 have ht_nonneg : 0 ≤ (t : ℝ) := htpos.le have ht_lower : C₁ * LT ≤ (t : ℝ) := by exact htstar_lower.trans (by exact_mod_cast htt) have hBt_le : B (t - 1) ≤ B T := hB_mono (by omega) have hBt_lt : B (t - 1) < M := by exact hBt_le.trans_lt (by simpa [M] using hBTlt) have hM_nonneg : 0 ≤ M := by dsimp [M] positivity have hBtM : B (t - 1) ≤ M := hBt_lt.le have hfeedback : L * sqrt ((t : ℝ) * B (t - 1)) ≤ (J / 2) * (t : ℝ) := by by_cases hL0 : L = 0 · rw [hL0] simp only [zero_mul] exact mul_nonneg (div_nonneg hJ.le (by norm_num)) ht_nonneg · have hLpos : 0 < L := lt_of_le_of_ne hL (Ne.symm hL0) have hM_le : M ≤ (J ^ 2 / (4 * L ^ 2)) * (t : ℝ) := by have hpart : (L ^ 2 * d ^ 2 / (8 * J ^ 3)) * LT ≤ (t : ℝ) := by dsimp [C₁] at ht_lower nlinarith [ht_lower, hLT_nonneg] calc M = (J ^ 2 / (4 * L ^ 2)) * ((L ^ 2 * d ^ 2 / (8 * J ^ 3)) * LT) := by dsimp [M] field_simp [ne_of_gt hJ, ne_of_gt hLpos] ring _ ≤ (J ^ 2 / (4 * L ^ 2)) * (t : ℝ) := mul_le_mul_of_nonneg_left hpart (by positivity) have hprod_le : (t : ℝ) * B (t - 1) ≤ ((J / (2 * L)) * (t : ℝ)) ^ 2 := by calc (t : ℝ) * B (t - 1) ≤ (t : ℝ) * M := mul_le_mul_of_nonneg_left hBtM ht_nonneg _ ≤ (t : ℝ) * ((J ^ 2 / (4 * L ^ 2)) * (t : ℝ)) := mul_le_mul_of_nonneg_left hM_le ht_nonneg _ = ((J / (2 * L)) * (t : ℝ)) ^ 2 := by field_simp [ne_of_gt hLpos] ring have hy_nonneg : 0 ≤ (J / (2 * L)) * (t : ℝ) := by positivity have hsqrt_le : sqrt ((t : ℝ) * B (t - 1)) ≤ (J / (2 * L)) * (t : ℝ) := by exact (Real.sqrt_le_iff).mpr ⟨hy_nonneg, hprod_le⟩ calc L * sqrt ((t : ℝ) * B (t - 1)) ≤ L * ((J / (2 * L)) * (t : ℝ)) := mul_le_mul_of_nonneg_left hsqrt_le hL _ = (J / 2) * (t : ℝ) := by field_simp [ne_of_gt hLpos] have hIq_le : Iq ≤ (J / 4) * (t : ℝ) := by have haux : Iq ≤ J / 4 * (C₁ * LT) := by field_simp [ne_of_gt hJ, ne_of_gt hC₁_pos] at hIq_log ⊢ nlinarith have hcoef : 0 ≤ J / 4 := by positivity exact haux.trans (mul_le_mul_of_nonneg_left ht_lower hcoef) let D : ℝ := Iq + (5 * J / 4) * (t : ℝ) + L * sqrt ((t : ℝ) * B (t - 1)) have hD_pos : 0 < D := by simpa [D] using hden_pos t ht1 have hD_le : D ≤ 2 * J * (t : ℝ) := by dsimp [D] nlinarith [hIq_le, hfeedback] have hright_pos : 0 < 2 * J * (t : ℝ) := by positivity have hnum_nonneg : 0 ≤ d ^ 2 / 4 := by positivity have hfrac : d ^ 2 / (8 * J) * ((1 : ℝ) / (t : ℝ)) ≤ (d ^ 2 / 4) / D := by calc d ^ 2 / (8 * J) * ((1 : ℝ) / (t : ℝ)) = (d ^ 2 / 4) / (2 * J * (t : ℝ)) := by field_simp [hJ_ne, ne_of_gt htpos] ring _ ≤ (d ^ 2 / 4) / D := div_le_div_of_nonneg_left hnum_nonneg hD_pos hD_le exact hfrac.trans (by simpa [D] using hrec t ht1) have htail_subset : Icc tstar T ⊆ Icc 1 T := by intro t ht exact Finset.mem_Icc.mpr ⟨le_trans htstar_one (Finset.mem_Icc.mp ht).1, (Finset.mem_Icc.mp ht).2⟩ have htail_le_B : ∑ t ∈ Icc tstar T, b t ≤ B T := by rw [hB T] exact Finset.sum_le_sum_of_subset_of_nonneg htail_subset (by intro t htBig htSmall exact hb_nonneg t ((Finset.mem_Icc.mp htBig).1)) have hscaled_tail : (d ^ 2 / (8 * J)) * (∑ t ∈ Icc tstar T, (1 : ℝ) / (t : ℝ)) ≤ ∑ t ∈ Icc tstar T, b t := by rw [Finset.mul_sum] exact Finset.sum_le_sum fun t ht => hclaim t (Finset.mem_Icc.mp ht).1 (Finset.mem_Icc.mp ht).2 have hharm := harmonic_sum_ge_log_sub_log tstar T htstar_one have hcoef_nonneg : 0 ≤ d ^ 2 / (8 * J) := by positivity have hlog_tail : (d ^ 2 / (8 * J)) * (log ((T : ℝ) + 1) - log (tstar : ℝ)) ≤ (d ^ 2 / (8 * J)) * (∑ t ∈ Icc tstar T, (1 : ℝ) / (t : ℝ)) := mul_le_mul_of_nonneg_left hharm hcoef_nonneg have hLT_le_log_succ : LT ≤ log ((T : ℝ) + 1) := by exact Real.log_le_log hTpos (by nlinarith) have htstar_pos_real : 0 < (tstar : ℝ) := by exact_mod_cast htstar_one have hlog_tstar_le : log (tstar : ℝ) ≤ log (C₁ * LT + 1) := by exact Real.log_le_log htstar_pos_real htstar_upper have hlog_tstar_half : log (tstar : ℝ) ≤ (1 / 2) * LT := hlog_tstar_le.trans hlog_bound have htail_lower : (d ^ 2 / (8 * J)) * ((1 / 2) * LT) ≤ B T := by have hdiff : (1 / 2) * LT ≤ log ((T : ℝ) + 1) - log (tstar : ℝ) := by nlinarith exact (mul_le_mul_of_nonneg_left hdiff hcoef_nonneg).trans (hlog_tail.trans (hscaled_tail.trans htail_le_B)) have hstrong : (d ^ 2 / (16 * J)) * LT ≤ B T := by convert htail_lower using 1 field_simp [hJ_ne] ring have hcontr : (d ^ 2 / (32 * J)) * LT < (d ^ 2 / (16 * J)) * LT := by have hposcoef : 0 < d ^ 2 / (32 * J) := by positivity have htwice : d ^ 2 / (16 * J) = 2 * (d ^ 2 / (32 * J)) := by field_simp [hJ_ne] ring calc (d ^ 2 / (32 * J)) * LT < 2 * ((d ^ 2 / (32 * J)) * LT) := by nlinarith [mul_pos hposcoef hLT_pos] _ = (d ^ 2 / (16 * J)) * LT := by rw [htwice] ring exact (lt_irrefl _ (hstrong.trans_lt (hBTlt.trans hcontr))).elim
Causalean.Stat.cumulative_risk_engine · Causalean/Stat/Minimax/SequentialCumulativeRisk.lean:143
4 supporting declarations (lemmas, instances)
  • log_add_one_sub_log_le_inv lemma — Elementary per-term bound log(x+1) - log x ≤ 1/x for x > 0, i.e. log(1 + 1/x) ≤ 1/x. This is the pointwise ingredient of the harmonic-tail lower bound.
    x :
    ℝ
    hx :
    0 < x
    log (x + 1) - log x ≤ 1 / x
    Proof (Lean source)
    lemma log_add_one_sub_log_le_inv {x : ℝ} (hx : 0 < x) : log (x + 1) - log x ≤ 1 / x := by have hx_ne : x ≠ 0 := ne_of_gt hx have hx1_pos : 0 < x + 1 := by linarith calc log (x + 1) - log x = log ((x + 1) / x) := by rw [Real.log_div hx1_pos.ne' hx_ne] _ ≤ (x + 1) / x - 1 := Real.log_le_sub_one_of_pos (div_pos hx1_pos hx) _ = 1 / x := by field_simp [hx_ne] ring
    Causalean.Stat.log_add_one_sub_log_le_inv · Causalean/Stat/Minimax/SequentialCumulativeRisk.lean:44
  • harmonic_sum_ge_log_sub_log lemma — Harmonic-tail lower bound: for natural numbers with 1 ≤ m, ∑_{t=m}^{n} 1/t ≥ log(n+1) - log m. Proof by telescoping the pointwise bound 1/t ≥ log(t+1) - log t.
    m n :
    ℕ
    hm :
    1 ≤ m
    log ((n : ℝ) + 1) - log (m : ℝ) ≤ ∑ t ∈ Icc m n, (1 : ℝ) / (t : ℝ)
    Proof (Lean source)
    lemma harmonic_sum_ge_log_sub_log (m n : ℕ) (hm : 1 ≤ m) : log ((n : ℝ) + 1) - log (m : ℝ) ≤ ∑ t ∈ Icc m n, (1 : ℝ) / (t : ℝ) := by by_cases hmn : m ≤ n · induction n with | zero => have : m = 0 := Nat.eq_zero_of_le_zero hmn omega | succ n ih => by_cases hmn' : m ≤ n · have hstep : log (((n : ℝ) + 1) + 1) - log ((n : ℝ) + 1) ≤ (1 : ℝ) / ((n : ℝ) + 1) := by exact log_add_one_sub_log_le_inv (by positivity) have htel : log (((n + 1 : ℕ) : ℝ) + 1) - log (m : ℝ) = (log ((n : ℝ) + 1) - log (m : ℝ)) + (log (((n : ℝ) + 1) + 1) - log ((n : ℝ) + 1)) := by norm_num rw [Finset.sum_Icc_succ_top hmn] rw [htel] simpa [Nat.cast_add, Nat.cast_one, add_assoc] using add_le_add (ih hmn') hstep · have hm_eq : m = n + 1 := by omega subst hm_eq simp only [Finset.Icc_self, Finset.sum_singleton] exact log_add_one_sub_log_le_inv (by positivity : 0 < ((n + 1 : ℕ) : ℝ)) · have hlt : n < m := lt_of_not_ge hmn have hle : (n : ℝ) + 1 ≤ (m : ℝ) := by exact_mod_cast Nat.succ_le_of_lt hlt have hlog : log ((n : ℝ) + 1) ≤ log (m : ℝ) := by exact Real.log_le_log (by positivity) hle rw [Finset.Icc_eq_empty hmn, Finset.sum_empty] linarith
    Causalean.Stat.harmonic_sum_ge_log_sub_log · Causalean/Stat/Minimax/SequentialCumulativeRisk.lean:59
  • log_lin_log_le_half_log lemma — Sub-logarithmic growth of log (c·log T + 1): for any c > 0 there is a threshold N beyond which log (c · log T + 1) ≤ (1/2) · log T. This is the log log T = o(log T) book-keeping that lets the harmonic tail dominate the t_* = Θ(log T) cutoff. (Route: c·log T + 1 ≤ (log T)²/16 ≤ exp((log T)/2) for large T, then take log.)
    c :
    ℝ
    hc :
    0 < c
    ∃ N : ℕ, ∀ T : ℕ, N ≤ T → log (c * log (T : ℝ) + 1) ≤ (1 / 2) * log (T : ℝ)
    Proof (Lean source)
    lemma log_lin_log_le_half_log {c : ℝ} (hc : 0 < c) : ∃ N : ℕ, ∀ T : ℕ, N ≤ T → log (c * log (T : ℝ) + 1) ≤ (1 / 2) * log (T : ℝ) := by have htend : Tendsto (fun T : ℕ => log (T : ℝ)) atTop atTop := by simpa [Function.comp_def] using Real.tendsto_log_atTop.comp (tendsto_natCast_atTop_atTop (R := ℝ)) obtain ⟨N, hN⟩ := Filter.eventually_atTop.mp (htend.eventually_ge_atTop (16 * c + 16)) exact ⟨N, fun T hT => log_lin_log_le_half_log_of_log_ge hc (hN T hT)⟩
    Causalean.Stat.log_lin_log_le_half_log · Causalean/Stat/Minimax/SequentialCumulativeRisk.lean:126
  • sequential_cumulative_risk_regret_of_recursion theorem — Cumulative logarithmic lower bound through two comparisons. When a sequence and its running totals satisfy the reciprocal recursion with positive scale, nonzero numerator coefficient, and nonnegative feedback and offset coefficients, and a scaled running total is bounded successively by two comparison sequences, the upper comparison sequence eventually exceeds (S²d²/(16J)) log T.
    S J d L Iq :
    ℝ
    hJ :
    0 < J
    hd :
    d ≠ 0
    hL :
    0 ≤ L
    hIq :
    0 ≤ Iq
    b B RB Rsup :
    ℕ → ℝ
    hB :
    ∀ n, B n = ∑ t ∈ Icc 1 n, b t
    hrec :
    ∀ t : ℕ
    if
    1 ≤ t
    then
    (d ^ 2 / 4) / (Iq + (5 * J / 4) * (t : ℝ) + L * sqrt ((t : ℝ) * B (t - 1))) ≤ b t
    hconv :
    ∀ T : ℕ, 2 * S ^ 2 * B T ≤ RB T
    hsup :
    ∀ T : ℕ, RB T ≤ Rsup T
    ∃ T₀ : ℕ, ∀ T : ℕ, T₀ ≤ T → (S ^ 2 * d ^ 2 / (16 * J)) * log (T : ℝ) ≤ Rsup T
    Proof (Lean source)
    theorem sequential_cumulative_risk_regret_of_recursion (S J d L Iq : ℝ) (hJ : 0 < J) (hd : d ≠ 0) (hL : 0 ≤ L) (hIq : 0 ≤ Iq) (b B RB Rsup : ℕ → ℝ) (hB : ∀ n, B n = ∑ t ∈ Icc 1 n, b t) (hrec : ∀ t : ℕ, 1 ≤ t → (d ^ 2 / 4) / (Iq + (5 * J / 4) * (t : ℝ) + L * sqrt ((t : ℝ) * B (t - 1))) ≤ b t) (hconv : ∀ T : ℕ, 2 * S ^ 2 * B T ≤ RB T) (hsup : ∀ T : ℕ, RB T ≤ Rsup T) : ∃ T₀ : ℕ, ∀ T : ℕ, T₀ ≤ T → (S ^ 2 * d ^ 2 / (16 * J)) * log (T : ℝ) ≤ Rsup T := by rcases cumulative_risk_engine J d L Iq hJ hd hL hIq b B hB hrec with ⟨T₀, hBT⟩ refine ⟨T₀, ?_⟩ intro T hT have hbase := hBT T hT have hscale_nonneg : 0 ≤ 2 * S ^ 2 := by positivity have hscaled : 2 * S ^ 2 * ((d ^ 2 / (32 * J)) * log (T : ℝ)) ≤ 2 * S ^ 2 * B T := mul_le_mul_of_nonneg_left hbase hscale_nonneg have hchain : 2 * S ^ 2 * ((d ^ 2 / (32 * J)) * log (T : ℝ)) ≤ Rsup T := hscaled.trans ((hconv T).trans (hsup T)) convert hchain using 1 field_simp [ne_of_gt hJ] ring
    Causalean.Stat.sequential_cumulative_risk_regret_of_recursion · Causalean/Stat/Minimax/SequentialCumulativeRisk.lean:388
Sequential­Score 6 core · 8 supporting This module packages a dominated adaptive finite-horizon experiment with supplied stage scores. ★ fisher_eq_sum_increment★ fisher_le_horizon_mul_bound

Finite-horizon sequential likelihood scores

This module packages a dominated adaptive finite-horizon experiment with supplied stage scores. It derives score centering, orthogonality, Fisher-information additivity, and a uniform per-stage information bound for arbitrary measurable stage spaces, using the finite sequential-kernel law API.

def law reviewed
Causalean.Stat.Minimax.SequentialScore

A parameter-indexed family of sequential kernels and a parameter value determine the finite transcript law, given by the sequential law with the unit input at every stage.

Definition (Lean source)
n :
ℕ
Fin n → Type u_1
shared
Q :
ℝ → KernelFamily Unit Z
u :
ℝ
law Q u :
transcriptLaw (Q u) (fun _ => ())
def increment reviewed
Causalean.Stat.Minimax.SequentialScore

Stage-score functions indexed by the stage and parameter, a stage, a parameter value, and a complete transcript determine that stage's score increment, given by evaluating the score on the transcript through that stage.

Definition (Lean source)
n :
ℕ
Fin n → Type u_1
shared
D :
(i : Fin n) → ℝ → History Z (i.val + 1) (succ_le_of_lt i.isLt) → ℝ
i :
Fin n
u :
ℝ
z :
increment D i u z :
ℝ
D i u (take (succ_le_of_lt i.isLt) z)
Causalean.Stat.Minimax.SequentialScore.increment · Causalean/Stat/Minimax/SequentialScore.lean:34 · uses History , Transcript
structure Model reviewed
Causalean.Stat.Minimax.SequentialScore

A finite horizon and measurable stage-output spaces determine the assumption bundle for a finite-horizon sequential score model: an open parameter domain; a parameter-indexed family of stage kernels that are Markov on the domain; a finite reference measure on transcripts together with a jointly measurable, strictly positive transcript density of the transcript law and its pointwise parameter derivative; and supplied measurable stage scores that are conditionally integrable, have square-integrable increments under the transcript law, give the parameter derivative of every stage-kernel event probability, and, as an assumption rather than a derived fact, satisfy the score bridge: the density derivative equals the density times the sum of the stage score increments, almost everywhere under the reference measure.

Definition (Lean source)
n :
ℕ
Z :
Fin n → Type*
∀ i, MeasurableSpace (Z i)
domain :
Set ℝ
domain_open :
IsOpen domain
Q :
ℝ → KernelFamily Unit Z
markov :
∀ u ∈ domain, ∀ i, IsMarkovKernel (Q u i)
reference :
reference_finite :
IsFiniteMeasure reference
q :
ℝ → Transcript Z → ℝ
qdot :
ℝ → Transcript Z → ℝ
q_joint_measurable :
Measurable (fun p : ℝ × Transcript Z => q p.1 p.2)
qdot_joint_measurable :
Measurable (fun p : ℝ × Transcript Z => qdot p.1 p.2)
q_positive :
∀ u ∈ domain, ∀ z, 0 < q u z
law_eq_density :
∀ u ∈ domain, law Q u = reference.withDensity (fun z => ofReal (q u z))
q_hasDerivAt :
∀ u ∈ domain, ∀ z, HasDerivAt (fun t => q t z) (qdot u z) u
D :
(i : Fin n) → ℝ → History Z (i.val + 1) (succ_le_of_lt i.isLt) → ℝ
D_measurable :
∀ u ∈ domain, ∀ i, Measurable (D i u)
D_stage_integrable :
∀ u ∈ domain,
∀ i h, Integrable (fun z => D i u (snoc (succ_le_of_lt i.isLt) h z)) (Q u i ((), h))
D_sq_integrable :
∀ u ∈ domain, ∀ i, Integrable (fun z => (increment D i u z) ^ 2) (law Q u)
kernel_event_hasDerivAt :
∀ u ∈ domain,
∀ i h (A : Set (Z i)),
MeasurableSet A → HasDerivAt (fun t => (Q t i ((), h) A).toReal) (∫ z in A, D i u (snoc (succ_le_of_lt i.isLt) h z) ∂Q u i ((), h)) u
score_bridge :
∀ u ∈ domain, ∀ᵐ z ∂reference, qdot u z = q u z * ∑ i : Fin n, increment D i u z
Causalean.Stat.Minimax.SequentialScore.Model · Causalean/Stat/Minimax/SequentialScore.lean:42
def fisherInformation reviewed
Causalean.Stat.Minimax.SequentialScore.Model

A sequential score model and a parameter value determine the scalar Fisher information of its transcript, given by the integral, against the model's common reference measure, of the transcript density times the squared guarded likelihood score (the density derivative divided by the density where the density is positive, zero otherwise).

Definition (Lean source)
n :
ℕ
Fin n → Type u_1
shared
M :
Model n Z
u :
ℝ
fisherInformation M u :
ℝ
fisherInformation M.reference M.q M.qdot u
Causalean.Stat.Minimax.SequentialScore.Model.fisherInformation · Causalean/Stat/Minimax/SequentialScore.lean:361 · uses Model
theorem fisher_eq_sum_increment reviewed
Causalean.Stat.Minimax.SequentialScore.Model

A sequential score model at a parameter in its domain has transcript Fisher information equal to the sum over stages of the second moment of the stage score increment under the transcript law.

Formal statement
n :
ℕ
Fin n → Type u_1
shared
M :
Model n Z
u :
ℝ
hu :
u ∈ M.domain
M.fisherInformation u = ∑ i : Fin n, ∫ z, (increment M.D i u z) ^ 2 ∂law M.Q u
Proof (Lean source)
theorem Model.fisher_eq_sum_increment (M : Model n Z) {u : ℝ} (hu : u ∈ M.domain) : M.fisherInformation u = ∑ i : Fin n, ∫ z, (increment M.D i u z) ^ 2 ∂law M.Q u := by let μ := law M.Q u let f : Fin n → Transcript Z → ℝ := fun i z => increment M.D i u z have hmeas (i : Fin n) : Measurable (f i) := by exact (M.D_measurable u hu i).comp (by apply measurable_pi_iff.mpr intro j exact measurable_pi_apply (castLE (succ_le_of_lt i.isLt) j)) have hLp (i : Fin n) : MemLp (f i) 2 μ := (memLp_two_iff_integrable_sq (hmeas i).aestronglyMeasurable).2 (M.D_sq_integrable u hu i) have hprod (i j : Fin n) : Integrable (fun z => f i z * f j z) μ := (hLp i).integrable_mul (hLp j) have hcross (i j : Fin n) (hij : i ≠ j) : (∫ z, f i z * f j z ∂μ) = 0 := by rcases lt_trichotomy i j with hlt | heq | hgt · exact M.increment_orthogonal hu i j hlt · exact (hij heq).elim · have h := M.increment_orthogonal hu j i hgt convert h using 1 congr 1 funext z exact mul_comm _ _ have hscore : (fun z => M.qdot u z / M.q u z) =ᵐ[μ] (fun z => ∑ i : Fin n, f i z) := by rw [show μ = M.reference.withDensity (fun z => ofReal (M.q u z)) from M.law_eq_density u hu] exact (withDensity_absolutelyContinuous M.reference _).ae_le (M.score_ae_eq_sum hu) rw [M.fisher_eq_law_score_sq hu] calc (∫ z, (M.qdot u z / M.q u z) ^ 2 ∂μ) = ∫ z, (∑ i : Fin n, f i z) ^ 2 ∂μ := integral_congr_ae (hscore.fun_comp (fun x => x ^ 2)) _ = ∫ z, ∑ i : Fin n, ∑ j : Fin n, f i z * f j z ∂μ := by congr 1 funext z simp only [pow_two, Finset.sum_mul_sum] _ = ∑ i : Fin n, ∑ j : Fin n, ∫ z, f i z * f j z ∂μ := by rw [integral_finsetSum] · congr 1 funext i rw [integral_finsetSum] exact fun j _ => hprod i j · intro i _ exact integrable_finsetSum _ (fun j _ => hprod i j) _ = ∑ i : Fin n, ∫ z, (increment M.D i u z) ^ 2 ∂μ := by apply Finset.sum_congr rfl intro i _ rw [Finset.sum_eq_single i] · congr 1 funext z simp [f, pow_two] · intro j _ hji exact hcross i j (Ne.symm hji) · simp
theorem fisher_le_horizon_mul_bound reviewed
Causalean.Stat.Minimax.SequentialScore.Model

A sequential score model, a parameter in its domain, and a bound, uniform over stages and preceding histories, on the conditional second moment of the next stage score have transcript Fisher information at most the horizon times that bound.

Formal statement
n :
ℕ
Fin n → Type u_1
shared
M :
Model n Z
u :
ℝ
hu :
u ∈ M.domain
B :
ℝ
hB :
∀ (i : Fin n) (h : History Z i.val (le_of_lt i.isLt)),
(∫ z, (M.D i u (snoc (succ_le_of_lt i.isLt) h z)) ^ 2 ∂M.Q u i ((), h)) ≤ B
M.fisherInformation u ≤ (n : ℝ) * B
Proof (Lean source)
theorem Model.fisher_le_horizon_mul_bound (M : Model n Z) {u : ℝ} (hu : u ∈ M.domain) (B : ℝ) (hB : ∀ (i : Fin n) (h : History Z i.val (le_of_lt i.isLt)), (∫ z, (M.D i u (snoc (succ_le_of_lt i.isLt) h z)) ^ 2 ∂M.Q u i ((), h)) ≤ B) : M.fisherInformation u ≤ (n : ℝ) * B := by rw [M.fisher_eq_sum_increment hu] have hstage (i : Fin n) : (∫ z, (increment M.D i u z) ^ 2 ∂law M.Q u) ≤ B := by rw [M.increment_second_moment_eq_prefix hu i] haveI : IsProbabilityMeasure (prefixLaw (M.Q u) (fun _ => ()) i.val (le_of_lt i.isLt)) := isProbabilityMeasure_prefixLaw (M.Q u) (M.markov u hu) (fun _ => ()) i.val (le_of_lt i.isLt) have hnonneg : 0 ≤ᵐ[prefixLaw (M.Q u) (fun _ => ()) i.val (le_of_lt i.isLt)] (fun h => ∫ z, (M.D i u (snoc (succ_le_of_lt i.isLt) h z)) ^ 2 ∂M.Q u i ((), h)) := by filter_upwards [] with h exact integral_nonneg (fun z => sq_nonneg _) have hle : (fun h => ∫ z, (M.D i u (snoc (succ_le_of_lt i.isLt) h z)) ^ 2 ∂M.Q u i ((), h)) ≤ᵐ[prefixLaw (M.Q u) (fun _ => ()) i.val (le_of_lt i.isLt)] (fun _ => B) := Filter.Eventually.of_forall (hB i) simpa using integral_mono_of_nonneg hnonneg (integrable_const B) hle calc _ ≤ ∑ _i : Fin n, B := Finset.sum_le_sum (fun i _ => hstage i) _ = (n : ℝ) * B := by simp
Causalean.Stat.Minimax.SequentialScore.Model.fisher_le_horizon_mul_bound · Causalean/Stat/Minimax/SequentialScore.lean:450 · uses History , historyMeasurableSpace , snoc , Model , fisherInformation
8 supporting declarations (lemmas, instances)
  • law_probability theorem — A sequential score model at a parameter in its domain has a transcript law that is a probability measure.
    n :
    ℕ
    Fin n → Type u_1
    shared
    M :
    Model n Z
    u :
    ℝ
    hu :
    u ∈ M.domain
    Proof (Lean source)
    theorem Model.law_probability (M : Model n Z) {u : ℝ} (hu : u ∈ M.domain) : IsProbabilityMeasure (law M.Q u) := by exact isProbabilityMeasure_transcriptLaw (M.Q u) (M.markov u hu) (fun _ => ())
    Causalean.Stat.Minimax.SequentialScore.Model.law_probability · Causalean/Stat/Minimax/SequentialScore.lean:84
  • q_normalized theorem — A sequential score model at a parameter in its domain has a positive transcript density that integrates to one against its common reference measure.
    n :
    ℕ
    Fin n → Type u_1
    shared
    M :
    Model n Z
    u :
    ℝ
    hu :
    u ∈ M.domain
    (∫ z, M.q u z ∂M.reference) = 1
    Proof (Lean source)
    theorem Model.q_normalized (M : Model n Z) {u : ℝ} (hu : u ∈ M.domain) : (∫ z, M.q u z ∂M.reference) = 1 := by have hmeas : Measurable (fun z => ofReal (M.q u z)) := ((M.q_joint_measurable.comp (measurable_const.prodMk measurable_id)).ennreal_ofReal) have hmass : (∫ z, (1 : ℝ) ∂law M.Q u) = 1 := by letI := M.law_probability hu simp calc (∫ z, M.q u z ∂M.reference) = ∫ z, (1 : ℝ) ∂M.reference.withDensity (fun z => ofReal (M.q u z)) := by rw [integral_withDensity_eq_integral_toReal_smul hmeas (by simp)] congr 1 funext z simp [ENNReal.toReal_ofReal (le_of_lt (M.q_positive u hu z))] _ = ∫ z, (1 : ℝ) ∂law M.Q u := by rw [M.law_eq_density u hu] _ = 1 := hmass
    Causalean.Stat.Minimax.SequentialScore.Model.q_normalized · Causalean/Stat/Minimax/SequentialScore.lean:90
  • stage_score_centered theorem — A sequential score model, a parameter in its domain, a stage, and a preceding transcript history have a next-output score with conditional mean zero.
    n :
    ℕ
    Fin n → Type u_1
    shared
    M :
    Model n Z
    u :
    ℝ
    hu :
    u ∈ M.domain
    i :
    Fin n
    h :
    History Z i.val (le_of_lt i.isLt)
    (∫ z, M.D i u (snoc (succ_le_of_lt i.isLt) h z) ∂M.Q u i ((), h)) = 0
    Proof (Lean source)
    theorem Model.stage_score_centered (M : Model n Z) {u : ℝ} (hu : u ∈ M.domain) (i : Fin n) (h : History Z i.val (le_of_lt i.isLt)) : (∫ z, M.D i u (snoc (succ_le_of_lt i.isLt) h z) ∂M.Q u i ((), h)) = 0 := by have hderiv := M.kernel_event_hasDerivAt u hu i h Set.univ MeasurableSet.univ have hevent : (fun t => (M.Q t i ((), h) Set.univ).toReal) =ᶠ[nhds u] fun _ => (1 : ℝ) := by filter_upwards [M.domain_open.mem_nhds hu] with t ht haveI := (M.markov t ht i).isProbabilityMeasure ((), h) simp have hzero : HasDerivAt (fun t => (M.Q t i ((), h) Set.univ).toReal) 0 u := (hasDerivAt_const u (1 : ℝ)).congr_of_eventuallyEq hevent simpa using hderiv.unique hzero
    Causalean.Stat.Minimax.SequentialScore.Model.stage_score_centered · Causalean/Stat/Minimax/SequentialScore.lean:111
  • score_ae_eq_sum theorem — A sequential score model at a parameter in its domain has a transcript score, the density derivative divided by the density, equal almost everywhere under the reference measure to the sum of its stage score increments. This is the model's assumed score bridge divided by the positive density.
    n :
    ℕ
    Fin n → Type u_1
    shared
    M :
    Model n Z
    u :
    ℝ
    hu :
    u ∈ M.domain
    (fun z => M.qdot u z / M.q u z)
    =ᵐ[M.reference] (fun z => ∑ i : Fin n, increment M.D i u z)
    Proof (Lean source)
    theorem Model.score_ae_eq_sum (M : Model n Z) {u : ℝ} (hu : u ∈ M.domain) : (fun z => M.qdot u z / M.q u z) =ᵐ[M.reference] (fun z => ∑ i : Fin n, increment M.D i u z) := by filter_upwards [M.score_bridge u hu] with z hz rw [hz] exact mul_div_cancel_left₀ _ (ne_of_gt (M.q_positive u hu z))
    Causalean.Stat.Minimax.SequentialScore.Model.score_ae_eq_sum · Causalean/Stat/Minimax/SequentialScore.lean:130
  • increment_prefix_centered theorem — A sequential score model, a parameter in its domain, a stage, and a measurable event of the preceding history have a stage increment whose integral over that event is zero.
    n :
    ℕ
    Fin n → Type u_1
    shared
    M :
    Model n Z
    u :
    ℝ
    hu :
    u ∈ M.domain
    i :
    Fin n
    A :
    Set (History Z i.val (le_of_lt i.isLt))
    hA :
    (∫ z in (take (le_of_lt i.isLt)) ⁻¹' A, increment M.D i u z ∂law M.Q u) = 0
    Proof (Lean source)
    theorem Model.increment_prefix_centered (M : Model n Z) {u : ℝ} (hu : u ∈ M.domain) (i : Fin n) (A : Set (History Z i.val (le_of_lt i.isLt))) (hA : MeasurableSet A) : (∫ z in (take (le_of_lt i.isLt)) ⁻¹' A, increment M.D i u z ∂law M.Q u) = 0 := by rcases i with ⟨k, hk⟩ let hk' : k + 1 ≤ n := Nat.succ_le_of_lt hk let f : History Z k (le_of_succ_le hk') × Z (nextIndex hk') → ℝ := fun p => (fst ⁻¹' A).indicator (fun p => M.D ⟨k, hk⟩ u (snoc hk' p.1 p.2)) p have hf : Measurable f := by exact ((M.D_measurable u hu ⟨k, hk⟩).comp (measurable_snoc hk')).indicator (hA.preimage measurable_fst) have hDmeas : Measurable (increment M.D ⟨k, hk⟩ u) := (M.D_measurable u hu ⟨k, hk⟩).comp (measurable_take_local (Nat.succ_le_of_lt hk)) letI : IsProbabilityMeasure (law M.Q u) := M.law_probability hu have hDint : Integrable (increment M.D ⟨k, hk⟩ u) (law M.Q u) := ((memLp_two_iff_integrable_sq hDmeas.aestronglyMeasurable).2 (M.D_sq_integrable u hu ⟨k, hk⟩)).integrable (by norm_num) have hfi : Integrable (fun t : Transcript Z => f (take (le_of_succ_le hk') t, t (nextIndex hk'))) (law M.Q u) := by have heq : (fun t : Transcript Z => f (take (le_of_succ_le hk') t, t (nextIndex hk'))) = ((take (le_of_succ_le hk')) ⁻¹' A).indicator (increment M.D ⟨k, hk⟩ u) := by funext t have ht := take_succ_eq_snoc_local ⟨k, hk⟩ t simp only [f, indicator, Set.mem_preimage, increment] rw [← ht] rfl rw [heq] exact hDint.indicator (hA.preimage (measurable_take_local _)) have hdis := integral_next_local M hu k hk' f hf hfi have hzero (h : History Z k (le_of_succ_le hk')) : (∫ z, f (h, z) ∂M.Q u (nextIndex hk') ((), h)) = 0 := by by_cases hh : h ∈ A · have heq : (fun z => f (h, z)) = (fun z => M.D ⟨k, hk⟩ u (snoc hk' h z)) := by funext z simp [f, hh] rw [heq] exact M.stage_score_centered hu ⟨k, hk⟩ h · have heq : (fun z => f (h, z)) = (fun _ => (0 : ℝ)) := by funext z simp [f, hh] simp [heq] calc _ = ∫ t, f (take (le_of_succ_le hk') t, t (nextIndex hk')) ∂law M.Q u := by rw [← integral_indicator (hA.preimage (measurable_take_local _))] congr 1 funext t have ht := take_succ_eq_snoc_local ⟨k, hk⟩ t simp only [f, indicator, Set.mem_preimage, increment] rw [← ht] rfl _ = ∫ h, ∫ z, f (h, z) ∂M.Q u (nextIndex hk') ((), h) ∂prefixLaw (M.Q u) (fun _ => ()) k (le_of_succ_le hk') := by exact hdis _ = 0 := by simp [hzero]
    Causalean.Stat.Minimax.SequentialScore.Model.increment_prefix_centered · Causalean/Stat/Minimax/SequentialScore.lean:193
  • increment_orthogonal theorem — A sequential score model, a parameter in its domain, two stages, and the first stage preceding the second have orthogonal score increments under the transcript law.
    n :
    ℕ
    Fin n → Type u_1
    shared
    M :
    Model n Z
    u :
    ℝ
    hu :
    u ∈ M.domain
    i j :
    Fin n
    hij :
    i < j
    (∫ z, increment M.D i u z * increment M.D j u z ∂law M.Q u) = 0
    Proof (Lean source)
    theorem Model.increment_orthogonal (M : Model n Z) {u : ℝ} (hu : u ∈ M.domain) (i j : Fin n) (hij : i < j) : (∫ z, increment M.D i u z * increment M.D j u z ∂law M.Q u) = 0 := by rcases j with ⟨k, hk⟩ let hk' : k + 1 ≤ n := Nat.succ_le_of_lt hk have hik : i.val + 1 ≤ k := hij let g : History Z k (le_of_succ_le hk') → ℝ := fun h => M.D i u (restrictHistory (Nat.succ_le_of_lt i.isLt) (le_of_succ_le hk') hik h) have hg : Measurable g := (M.D_measurable u hu i).comp (measurable_restrictHistory (Nat.succ_le_of_lt i.isLt) (le_of_succ_le hk') hik) let f : History Z k (le_of_succ_le hk') × Z (nextIndex hk') → ℝ := fun p => g p.1 * M.D (nextIndex hk') u (snoc hk' p.1 p.2) have hf : Measurable f := (hg.comp measurable_fst).mul ((M.D_measurable u hu (nextIndex hk')).comp (measurable_snoc hk')) have himeas : Measurable (increment M.D i u) := (M.D_measurable u hu i).comp (measurable_take_local (Nat.succ_le_of_lt i.isLt)) have hjmeas : Measurable (increment M.D ⟨k, hk⟩ u) := (M.D_measurable u hu ⟨k, hk⟩).comp (measurable_take_local (Nat.succ_le_of_lt hk)) have hli : MemLp (increment M.D i u) 2 (law M.Q u) := (memLp_two_iff_integrable_sq himeas.aestronglyMeasurable).2 (M.D_sq_integrable u hu i) have hlj : MemLp (increment M.D ⟨k, hk⟩ u) 2 (law M.Q u) := (memLp_two_iff_integrable_sq hjmeas.aestronglyMeasurable).2 (M.D_sq_integrable u hu ⟨k, hk⟩) have hprod : Integrable (fun t => increment M.D i u t * increment M.D ⟨k, hk⟩ u t) (law M.Q u) := hli.integrable_mul hlj have hpre (t : Transcript Z) : restrictHistory (Nat.succ_le_of_lt i.isLt) (le_of_succ_le hk') hik (take (le_of_succ_le hk') t) = take (Nat.succ_le_of_lt i.isLt) t := by funext a rfl have heq (t : Transcript Z) : f (take (le_of_succ_le hk') t, t (nextIndex hk')) = increment M.D i u t * increment M.D ⟨k, hk⟩ u t := by dsimp [f, g, increment] rw [hpre t, take_succ_eq_snoc_local ⟨k, hk⟩ t] dsimp [hk', nextIndex] have hfi : Integrable (fun t : Transcript Z => f (take (le_of_succ_le hk') t, t (nextIndex hk'))) (law M.Q u) := by convert hprod using 1 funext t exact heq t have hdis := integral_next_local M hu k hk' f hf hfi have hzero (h : History Z k (le_of_succ_le hk')) : (∫ z, f (h, z) ∂M.Q u (nextIndex hk') ((), h)) = 0 := by have heq' : (fun z => f (h, z)) = (fun z => g h * M.D (nextIndex hk') u (snoc hk' h z)) := rfl rw [heq', integral_const_mul] have hc : (∫ z, M.D (nextIndex hk') u (snoc hk' h z) ∂M.Q u (nextIndex hk') ((), h)) = 0 := by convert M.stage_score_centered hu (nextIndex hk') h using 1 congr 1 rw [hc, mul_zero] calc _ = ∫ t, f (take (le_of_succ_le hk') t, t (nextIndex hk')) ∂law M.Q u := by congr 1 funext t exact (heq t).symm _ = ∫ h, ∫ z, f (h, z) ∂M.Q u (nextIndex hk') ((), h) ∂prefixLaw (M.Q u) (fun _ => ()) k (le_of_succ_le hk') := hdis _ = 0 := by simp [hzero]
    Causalean.Stat.Minimax.SequentialScore.Model.increment_orthogonal · Causalean/Stat/Minimax/SequentialScore.lean:258
  • increment_second_moment_eq_prefix theorem — A sequential score model, a parameter in its domain, and a stage have a score-increment second moment equal to the prefix average of its conditional next-output second moment.
    n :
    ℕ
    Fin n → Type u_1
    shared
    M :
    Model n Z
    u :
    ℝ
    hu :
    u ∈ M.domain
    i :
    Fin n
    (∫ z, (increment M.D i u z) ^ 2 ∂law M.Q u)
    = ∫ h, (∫ z, (M.D i u (snoc (succ_le_of_lt i.isLt) h z)) ^ 2 ∂M.Q u i ((), h)) ∂prefixLaw (M.Q u) (fun _ => ()) i.val (le_of_lt i.isLt)
    Proof (Lean source)
    theorem Model.increment_second_moment_eq_prefix (M : Model n Z) {u : ℝ} (hu : u ∈ M.domain) (i : Fin n) : (∫ z, (increment M.D i u z) ^ 2 ∂law M.Q u) = ∫ h, (∫ z, (M.D i u (snoc (Nat.succ_le_of_lt i.isLt) h z)) ^ 2 ∂M.Q u i ((), h)) ∂prefixLaw (M.Q u) (fun _ => ()) i.val (le_of_lt i.isLt) := by rcases i with ⟨k, hk⟩ let hk' : k + 1 ≤ n := Nat.succ_le_of_lt hk have hf : Measurable (fun p : History Z k (le_of_succ_le hk') × Z (nextIndex hk') => (M.D ⟨k, hk⟩ u (snoc hk' p.1 p.2)) ^ 2) := by exact ((M.D_measurable u hu ⟨k, hk⟩).comp (measurable_snoc hk')).pow_const 2 have hfi : Integrable (fun t : Transcript Z => (M.D ⟨k, hk⟩ u (snoc hk' (take (le_of_succ_le hk') t) (t (nextIndex hk')))) ^ 2) (law M.Q u) := by convert (M.D_sq_integrable u hu ⟨k, hk⟩) using 1 funext t rw [increment, take_succ_eq_snoc_local] convert (integral_next_local M hu k hk' (fun p => (M.D ⟨k, hk⟩ u (snoc hk' p.1 p.2)) ^ 2) hf hfi) using 1 · congr 1 funext t rw [increment, take_succ_eq_snoc_local] · rfl
    Causalean.Stat.Minimax.SequentialScore.Model.increment_second_moment_eq_prefix · Causalean/Stat/Minimax/SequentialScore.lean:332
  • fisher_eq_law_score_sq theorem — A sequential score model at a parameter in its domain has Fisher information equal to the transcript-law second moment of its unguarded score.
    n :
    ℕ
    Fin n → Type u_1
    shared
    M :
    Model n Z
    u :
    ℝ
    hu :
    u ∈ M.domain
    M.fisherInformation u = ∫ z, (M.qdot u z / M.q u z) ^ 2 ∂law M.Q u
    Proof (Lean source)
    theorem Model.fisher_eq_law_score_sq (M : Model n Z) {u : ℝ} (hu : u ∈ M.domain) : M.fisherInformation u = ∫ z, (M.qdot u z / M.q u z) ^ 2 ∂law M.Q u := by have hmeas : Measurable (fun z => ofReal (M.q u z)) := ((M.q_joint_measurable.comp (measurable_const.prodMk measurable_id)).ennreal_ofReal) rw [Model.fisherInformation, fisherInformation, M.law_eq_density u hu, integral_withDensity_eq_integral_toReal_smul hmeas (by simp)] congr 1 funext z simp [likelihoodScore, M.q_positive u hu z, ENNReal.toReal_ofReal (le_of_lt (M.q_positive u hu z))]
    Causalean.Stat.Minimax.SequentialScore.Model.fisher_eq_law_score_sq · Causalean/Stat/Minimax/SequentialScore.lean:370
Tsybakov­Fano 1 core · 0 supporting This file proves the sharp likelihood-ratio truncation form of Fano's method used in minimax lower bounds. ★ tsybakov_fano_exists_error

Tsybakov's reference-law form of Fano's method

This file proves the sharp likelihood-ratio truncation form of Fano's method used in minimax lower bounds. It treats one reference law and M alternatives, retaining the square-root prefactor and correction in Tsybakov's theorem.

theorem tsybakov_fano_exists_error reviewed
Causalean.Stat

For a measurable observation space and parameter space, a number M of alternatives with M ≥ 2, probability laws, parameter values, a radius and KL fraction with α > 0, pairwise 2s separation, finite KL divergence to the reference law, an average KL budget α log M, and a measurable estimator, some law has radius-s error at least sqrt(M)/(1+sqrt(M)) * (1-2α-sqrt(2α/log M)).

Formal statement
M :
ℕ
hM :
2 ≤ M
P :
Fin (M + 1) → Measure Ω
θ :
Fin (M + 1) → Θ
s α :
ℝ
hα :
0 < α
hsep :
∀ i k
if
i ≠ k
then
2 * s ≤ dist (θ i) (θ k)
hfin :
∀ j : Fin M, klDiv (P j.succ) (P 0) ≠ ⊤
havg :
(M : ℝ)⁻¹ * ∑ j : Fin M, (klDiv (P j.succ) (P 0)).toReal
≤ α * log M
est :
Ω → Θ
hest :
∃ i,
sqrt M / (1 + sqrt M) * (1 - 2 * α - sqrt (2 * α / log M))
≤ (P i).real {ω | s ≤ dist (est ω) (θ i)}
Proof (Lean source)
theorem tsybakov_fano_exists_error {Ω Θ : Type*} [MeasurableSpace Ω] [PseudoMetricSpace Θ] [MeasurableSpace Θ] [OpensMeasurableSpace Θ] (M : ℕ) (hM : 2 ≤ M) (P : Fin (M + 1) → Measure Ω) [∀ i, IsProbabilityMeasure (P i)] (θ : Fin (M + 1) → Θ) {s α : ℝ} (hα : 0 < α) (hsep : ∀ i k, i ≠ k → 2 * s ≤ dist (θ i) (θ k)) (hfin : ∀ j : Fin M, klDiv (P j.succ) (P 0) ≠ ⊤) (havg : (M : ℝ)⁻¹ * ∑ j : Fin M, (klDiv (P j.succ) (P 0)).toReal ≤ α * Real.log M) {est : Ω → Θ} (hest : Measurable est) : ∃ i, Real.sqrt M / (1 + Real.sqrt M) * (1 - 2 * α - Real.sqrt (2 * α / Real.log M)) ≤ (P i).real {ω | s ≤ dist (est ω) (θ i)} := by let m : ℝ := M let L : ℝ := Real.log M let q : ℝ := Real.sqrt m let δ : ℝ := 2 * α + Real.sqrt (2 * α / L) let B : ℝ := q / (1 + q) * (1 - δ) let A : Fin (M + 1) → Set Ω := fun i => acceptanceRegion est (θ i) s let K : Fin M → ℝ := fun j => (klDiv (P j.succ) (P 0)).toReal let T : Fin M → Set Ω := fun j => {ω | L / 2 < llr (P j.succ) (P 0) ω} have hac : ∀ j : Fin M, P j.succ ≪ P 0 := fun j => (InformationTheory.klDiv_ne_top_iff.mp (hfin j)).1 have hint : ∀ j : Fin M, Integrable (llr (P j.succ) (P 0)) (P j.succ) := fun j => (InformationTheory.klDiv_ne_top_iff.mp (hfin j)).2 have hm : 0 < m := by dsimp [m] exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) hM) have hM1 : 1 < (M : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by omega : 1 < 2) hM) have hL : 0 < L := by simpa [L] using Real.log_pos hM1 have hq : 0 < q := by dsimp [q] exact Real.sqrt_pos.2 hm have hq2 : q ^ 2 = m := by dsimp [q] exact Real.sq_sqrt hm.le have hexp : exp (L / 2) = q := by calc exp (L / 2) = exp (Real.log m * (1 / 2)) := by congr 1 dsimp [L, m] ring _ = m ^ (1 / 2 : ℝ) := (Real.rpow_def_of_pos hm _).symm _ = q := by simpa [q] using (Real.sqrt_eq_rpow m).symm have hK0 : ∀ j, 0 ≤ K j := fun _j => ENNReal.toReal_nonneg have havg' : m⁻¹ * ∑ j, K j ≤ α * L := havg have htail : ∀ j, (P j.succ).real (T j) ≤ (K j + Real.sqrt (K j / 2)) / (L / 2) := by intro j exact llr_tail_le_kl_add_sqrt (P j.succ) (P 0) (hac j) (hint j) (by linarith) have htailAvg : m⁻¹ * ∑ j, (P j.succ).real (T j) ≤ δ := by calc m⁻¹ * ∑ j, (P j.succ).real (T j) ≤ m⁻¹ * ∑ j, (K j + Real.sqrt (K j / 2)) / (L / 2) := by apply mul_le_mul_of_nonneg_left · exact Finset.sum_le_sum fun j _ => htail j · exact inv_nonneg.mpr hm.le _ ≤ δ := average_kl_tail_numeric hM hα.le K hK0 havg' have htailSum : ∑ j, (P j.succ).real (T j) ≤ m * δ := by have hmul := mul_le_mul_of_nonneg_left htailAvg hm.le have hm0 : m ≠ 0 := hm.ne' simpa [hm0] using hmul have hAmeas : ∀ i, MeasurableSet (A i) := fun i => by exact measurableSet_acceptanceRegion hest (θ i) s have hAdisj : Pairwise (onFun Disjoint A) := by exact acceptanceRegion_pairwiseDisjoint (est := est) (θ := θ) (s := s) hsep have hAltDisj : Pairwise (onFun Disjoint (fun j : Fin M => A j.succ)) := by intro j k hjk exact hAdisj ((Fin.succ_injective M).ne hjk) have hAltMeas : ∀ j : Fin M, MeasurableSet (A j.succ) := fun j => hAmeas j.succ have hsumRef : ∑ j : Fin M, (P 0).real (A j.succ) = (P 0).real (⋃ j : Fin M, A j.succ) := by exact (measureReal_iUnion_fintype hAltDisj hAltMeas).symm have hUnionSubset : (⋃ j : Fin M, A j.succ) ⊆ (A 0)ᶜ := by intro ω hω simp only [Set.mem_iUnion] at hω obtain ⟨j, hj⟩ := hω intro h0 exact Set.disjoint_left.mp (hAdisj (Fin.succ_ne_zero j)) hj h0 have hchange : ∀ j : Fin M, (P j.succ).real (A j.succ) ≤ q * (P 0).real (A j.succ) + (P j.succ).real (T j) := by intro j have hc := measureReal_le_exp_mul_add_llr_tail (P j.succ) (P 0) (hac j) (hAmeas j.succ) (L / 2) simpa [T, K, hexp] using hc have hsumChange : ∑ j : Fin M, (P j.succ).real (A j.succ) ≤ q * ∑ j : Fin M, (P 0).real (A j.succ) + ∑ j : Fin M, (P j.succ).real (T j) := by calc ∑ j : Fin M, (P j.succ).real (A j.succ) ≤ ∑ j : Fin M, (q * (P 0).real (A j.succ) + (P j.succ).real (T j)) := Finset.sum_le_sum fun j _ => hchange j _ = q * ∑ j : Fin M, (P 0).real (A j.succ) + ∑ j : Fin M, (P j.succ).real (T j) := by rw [Finset.sum_add_distrib, Finset.mul_sum] have hBform : B = Real.sqrt M / (1 + Real.sqrt M) * (1 - 2 * α - Real.sqrt (2 * α / Real.log M)) := by dsimp [B, q, m, δ, L] ring by_contra hcon push Not at hcon rw [← hBform] at hcon have herr : ∀ i, (P i).real (A i)ᶜ < B := by intro i have hi := hcon i have hevent : {ω | s ≤ dist (est ω) (θ i)} = (A i)ᶜ := by ext ω simp [A, acceptanceRegion, not_lt] simpa [hevent] using hi have hRefLt : ∑ j : Fin M, (P 0).real (A j.succ) < B := by rw [hsumRef] exact lt_of_le_of_lt (measureReal_mono hUnionSubset (measure_ne_top _ _)) (herr 0) have hcorrect : ∀ j : Fin M, 1 - B < (P j.succ).real (A j.succ) := by intro j have herrj := herr j.succ rw [measureReal_compl (hAmeas j.succ), probReal_univ] at herrj linarith have : Nonempty (Fin M) := Fin.pos_iff_nonempty.mp (lt_of_lt_of_le (by omega : 0 < 2) hM) have hcorrectSum : m * (1 - B) < ∑ j : Fin M, (P j.succ).real (A j.succ) := by calc m * (1 - B) = ∑ _j : Fin M, (1 - B) := by simp [m, nsmul_eq_mul] ring _ < ∑ j : Fin M, (P j.succ).real (A j.succ) := Finset.sum_lt_sum_of_nonempty univ_nonempty (fun j _ => hcorrect j) have hUpper : ∑ j : Fin M, (P j.succ).real (A j.succ) < q * B + m * δ := by refine lt_of_le_of_lt hsumChange ?_ nlinarith [htailSum, mul_lt_mul_of_pos_left hRefLt hq] have hstrict : m * (1 - B) < q * B + m * δ := hcorrectSum.trans hUpper have hidentity : m * (1 - B) = q * B + m * δ := by dsimp [B] rw [← hq2] field_simp [show 1 + q ≠ 0 by positivity] ring rw [hidentity] at hstrict exact (lt_irrefl _ hstrict)
Causalean.Stat.tsybakov_fano_exists_error · Causalean/Stat/Minimax/TsybakovFano.lean:106
Van­Trees­Inequality 1 core · 0 supporting This file states and proves the classical single-parameter van Trees inequality van_trees_inequality: a Bayesian analogue of the Cramer-Rao lower bound for the mean-squared error of estimating a smooth functional of a ra ★ van_trees_inequality

The van Trees inequality (Bayesian Cramer-Rao bound)

This file states and proves the classical single-parameter van Trees inequality van_trees_inequality: a Bayesian analogue of the Cramer-Rao lower bound for the mean-squared error of estimating a smooth functional of a random parameter.

Setup (an econometrician's reading). A scalar parameter h is drawn from a prior with a continuously differentiable density q supported on [a, b] that vanishes at both endpoints (q a = q b = 0); its prior Fisher information is I_q = ∫ q'(h)² / q(h) dh. Given h, data Z are drawn from a law P h with score function S h (mean zero under P h) and Fisher information I(h) = E_h[S h ²]. For any estimator δ(Z) of a differentiable scalar target ψ(h), the average (Bayes) mean-squared error is bounded below by

(∫ ψ'(h) q(h) dh)² / (I_q + ∫ I(h) q(h) dh).

The denominator adds the prior information I_q to the average experimental information ∫ I(h) q(h) dh; the numerator is the squared average sensitivity of the target. Because the prior information appears additively, the bound stays finite even where the frequentist Cramer-Rao bound degenerates, which is why the van Trees inequality is the standard device for proving minimax lower bounds.

The canonical theorem derives the estimator-specific differentiation identity from model-level likelihood regularity through the observation-dependent van Trees engine.

theorem van_trees_inequality reviewed
Causalean.Stat.Minimax

Classical parameter-only van Trees inequality. For a dominating observation measure, parameter endpoints, a prior and its derivative, a likelihood and its derivative, a parameter-only target and its derivative, and an estimator, a nondegenerate interval and the stated prior, model, target, boundary, measurability, integrability, and positive-information conditions, the squared prior-average derivative divided by prior plus average likelihood information is at most the prior-average mean-squared error.

Formal statement
X :
μ :
ell u :
ℝ
hellu :
ell < u
w dw :
ℝ → ℝ
p dp :
ℝ → X → ℝ
ψ dψ :
ℝ → ℝ
T :
X → ℝ
hwC1 :
ContDiff ℝ 1 w
hwderiv :
∀ θ, HasDerivAt w (dw θ) θ
hwnonneg :
∀ θ, 0 ≤ w θ
hpnonneg :
∀ θ x, 0 ≤ p θ x
hpnorm :
∀ θ ∈ Icc ell u, ∫ x, p θ x ∂μ = 1
hdiffUnder :
∀ θ ∈ Ioo ell u, HasDerivAt (fun t => ∫ x, p t x ∂μ) (∫ x, dp θ x ∂μ) θ
hpAC :
∀ᵐ x ∂μ, AbsolutelyContinuousOnInterval (fun θ => p θ x) ell u
hdp :
∀ᵐ z ∂((ObservationDependentVanTrees.parameterMeasure ell u).prod μ), HasDerivAt (fun t => p t z.2) (dp z.1 z.2) z.1
hψderiv :
∀ θ, HasDerivAt ψ (dψ θ) θ
hboundary :
∀ᵐ x ∂μ, w u * p u x * (T x - ψ u) = 0 ∧ w ell * p ell x * (T x - ψ ell) = 0
hbalanceInt :
Integrable (ObservationDependentVanTrees.derivativeBalanceField w dw p dp (fun θ _ => ψ θ) (fun θ _ => dψ θ) T) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
herrorScoreSm :
AEStronglyMeasurable (ObservationDependentVanTrees.errorScoreField w dw p dp (fun θ _ => ψ θ) T) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
herrorScoreInt :
Integrable (ObservationDependentVanTrees.errorScoreField w dw p dp (fun θ _ => ψ θ) T) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
hsensitivityInt :
Integrable (ObservationDependentVanTrees.sensitivityField w p (fun θ _ => dψ θ)) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
herrorSqSm :
AEStronglyMeasurable (ObservationDependentVanTrees.errorSqField w p (fun θ _ => ψ θ) T) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
herrorSqInt :
Integrable (ObservationDependentVanTrees.errorSqField w p (fun θ _ => ψ θ) T) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
hscoreSqSm :
AEStronglyMeasurable (ObservationDependentVanTrees.scoreSqField w dw p dp) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
hscoreSqInt :
Integrable (ObservationDependentVanTrees.scoreSqField w dw p dp) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
hpriorJointSqInt :
Integrable (fun z : ℝ × X => w z.1 * p z.1 z.2 * (ObservationDependentVanTrees.priorScore w dw z.1) ^ 2) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
hfisherSqInt :
Integrable (fun z : ℝ × X => w z.1 * p z.1 z.2 * (ObservationDependentVanTrees.likelihoodScore p dp z.1 z.2) ^ 2) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
hcrossInt :
Integrable (fun z : ℝ × X => w z.1 * p z.1 z.2 * (ObservationDependentVanTrees.priorScore w dw z.1 * ObservationDependentVanTrees.likelihoodScore p dp z.1 z.2)) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)
hinfoPos :
0 < ObservationDependentVanTrees.priorInformation ell u w dw
+ ∫ θ, w θ * ObservationDependentVanTrees.fisherInformation μ p dp θ ∂ObservationDependentVanTrees.parameterMeasure ell u
(∫ θ, dψ θ * w θ ∂ObservationDependentVanTrees.parameterMeasure ell u) ^ 2 / (ObservationDependentVanTrees.priorInformation ell u w dw + ∫ θ, w θ * ObservationDependentVanTrees.fisherInformation μ p dp θ ∂ObservationDependentVanTrees.parameterMeasure ell u)
≤ ∫ θ, (∫ x, (T x - ψ θ) ^ 2 * p θ x ∂μ) * w θ ∂ObservationDependentVanTrees.parameterMeasure ell u
Proof (Lean source)
theorem van_trees_inequality {X : Type*} [MeasurableSpace X] (μ : Measure X) [SigmaFinite μ] {ell u : ℝ} (hellu : ell < u) (w dw : ℝ → ℝ) (p dp : ℝ → X → ℝ) (ψ dψ : ℝ → ℝ) (T : X → ℝ) (hwC1 : ContDiff ℝ 1 w) (hwderiv : ∀ θ, HasDerivAt w (dw θ) θ) (hwnonneg : ∀ θ, 0 ≤ w θ) (hpnonneg : ∀ θ x, 0 ≤ p θ x) (hpnorm : ∀ θ ∈ Icc ell u, ∫ x, p θ x ∂μ = 1) (hdiffUnder : ∀ θ ∈ Ioo ell u, HasDerivAt (fun t => ∫ x, p t x ∂μ) (∫ x, dp θ x ∂μ) θ) (hpAC : ∀ᵐ x ∂μ, AbsolutelyContinuousOnInterval (fun θ => p θ x) ell u) (hψAC : AbsolutelyContinuousOnInterval ψ ell u) (hdp : ∀ᵐ z ∂((ObservationDependentVanTrees.parameterMeasure ell u).prod μ), HasDerivAt (fun t => p t z.2) (dp z.1 z.2) z.1) (hψderiv : ∀ θ, HasDerivAt ψ (dψ θ) θ) (hboundary : ∀ᵐ x ∂μ, w u * p u x * (T x - ψ u) = 0 ∧ w ell * p ell x * (T x - ψ ell) = 0) (hbalanceInt : Integrable (ObservationDependentVanTrees.derivativeBalanceField w dw p dp (fun θ _ => ψ θ) (fun θ _ => dψ θ) T) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (herrorScoreSm : AEStronglyMeasurable (ObservationDependentVanTrees.errorScoreField w dw p dp (fun θ _ => ψ θ) T) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (herrorScoreInt : Integrable (ObservationDependentVanTrees.errorScoreField w dw p dp (fun θ _ => ψ θ) T) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (hsensitivityInt : Integrable (ObservationDependentVanTrees.sensitivityField w p (fun θ _ => dψ θ)) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (herrorSqSm : AEStronglyMeasurable (ObservationDependentVanTrees.errorSqField w p (fun θ _ => ψ θ) T) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (herrorSqInt : Integrable (ObservationDependentVanTrees.errorSqField w p (fun θ _ => ψ θ) T) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (hscoreSqSm : AEStronglyMeasurable (ObservationDependentVanTrees.scoreSqField w dw p dp) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (hscoreSqInt : Integrable (ObservationDependentVanTrees.scoreSqField w dw p dp) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (hpriorJointSqInt : Integrable (fun z : ℝ × X => w z.1 * p z.1 z.2 * (ObservationDependentVanTrees.priorScore w dw z.1) ^ 2) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (hfisherSqInt : Integrable (fun z : ℝ × X => w z.1 * p z.1 z.2 * (ObservationDependentVanTrees.likelihoodScore p dp z.1 z.2) ^ 2) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (hcrossInt : Integrable (fun z : ℝ × X => w z.1 * p z.1 z.2 * (ObservationDependentVanTrees.priorScore w dw z.1 * ObservationDependentVanTrees.likelihoodScore p dp z.1 z.2)) ((ObservationDependentVanTrees.parameterMeasure ell u).prod μ)) (hinfoPos : 0 < ObservationDependentVanTrees.priorInformation ell u w dw + ∫ θ, w θ * ObservationDependentVanTrees.fisherInformation μ p dp θ ∂ObservationDependentVanTrees.parameterMeasure ell u) : (∫ θ, dψ θ * w θ ∂ObservationDependentVanTrees.parameterMeasure ell u) ^ 2 / (ObservationDependentVanTrees.priorInformation ell u w dw + ∫ θ, w θ * ObservationDependentVanTrees.fisherInformation μ p dp θ ∂ObservationDependentVanTrees.parameterMeasure ell u) ≤ ∫ θ, (∫ x, (T x - ψ θ) ^ 2 * p θ x ∂μ) * w θ ∂ObservationDependentVanTrees.parameterMeasure ell u := by letI : IsFiniteMeasure (ObservationDependentVanTrees.parameterMeasure ell u) := by unfold ObservationDependentVanTrees.parameterMeasure infer_instance let g : ℝ → X → ℝ := fun θ _ => ψ θ let dg : ℝ → X → ℝ := fun θ _ => dψ θ have hraw := ObservationDependentVanTrees.observation_dependent_van_trees μ hellu w dw p dp g dg T hwC1 hwderiv hwnonneg hpnonneg hpnorm hdiffUnder hpAC (Filter.Eventually.of_forall fun _ => hψAC) hdp (Filter.Eventually.of_forall fun z => hψderiv z.1) hboundary hbalanceInt herrorScoreSm herrorScoreInt hsensitivityInt herrorSqSm herrorSqInt hscoreSqSm hscoreSqInt hpriorJointSqInt hfisherSqInt hcrossInt hinfoPos have hsensitivity : ∫ z, ObservationDependentVanTrees.sensitivityField w p dg z ∂((ObservationDependentVanTrees.parameterMeasure ell u).prod μ) = ∫ θ, dψ θ * w θ ∂ObservationDependentVanTrees.parameterMeasure ell u := by rw [integral_prod _ hsensitivityInt] apply MeasureTheory.integral_congr_ae filter_upwards [ae_restrict_mem measurableSet_Icc] with θ hθ change (∫ x, dψ θ * (w θ * p θ x) ∂μ) = dψ θ * w θ rw [show (fun x => dψ θ * (w θ * p θ x)) = fun x => (dψ θ * w θ) * p θ x by funext x; ring, MeasureTheory.integral_const_mul, hpnorm θ hθ, mul_one] have hrisk : ∫ z, ObservationDependentVanTrees.errorSqField w p g T z ∂((ObservationDependentVanTrees.parameterMeasure ell u).prod μ) = ∫ θ, (∫ x, (T x - ψ θ) ^ 2 * p θ x ∂μ) * w θ ∂ObservationDependentVanTrees.parameterMeasure ell u := by rw [integral_prod _ herrorSqInt] apply MeasureTheory.integral_congr_ae filter_upwards with θ change (∫ x, (T x - ψ θ) ^ 2 * (w θ * p θ x) ∂μ) = (∫ x, (T x - ψ θ) ^ 2 * p θ x ∂μ) * w θ rw [show (fun x => (T x - ψ θ) ^ 2 * (w θ * p θ x)) = fun x => ((T x - ψ θ) ^ 2 * p θ x) * w θ by funext x; ring, MeasureTheory.integral_mul_const] simpa [g, dg, hsensitivity, hrisk] using hraw
Van­Trees­Smooth­Model 2 core · 0 supporting This file packages the smooth dominated-model assumptions for the classical parameter-only van Trees inequality. ★ van_trees_inequality_of_smooth_model

A model-level entry point for the van Trees inequality

This file packages the smooth dominated-model assumptions for the classical parameter-only van Trees inequality. Weighted L² hypotheses on the estimation error and the three relevant scores automatically discharge the product, square, cross, and strong-measurability obligations of the underlying proof.

structure VanTreesSmoothModelRegularity reviewed
Causalean.Stat.Minimax

Smooth van Trees regularity consists of a C¹ compactly supported, nonnegative, normalized prior with the stated derivative, a nonnegative normalized dominated likelihood with integrable derivative and valid differentiation under the integral, absolutely continuous likelihood and target sections with the stated joint derivative representatives, vanishing boundary errors, weighted L² joint-density root, target derivative, estimation error, joint score, prior score, and likelihood score, finite prior information, and positive total information.

Definition (Lean source)
X :
μ :
ell u :
ℝ
w dw :
ℝ → ℝ
p dp :
ℝ → X → ℝ
ψ dψ :
ℝ → ℝ
T :
X → ℝ
hwC1 :
ContDiff ℝ 1 w
hwsupport :
support w ⊆ Icc ell u
hwderiv :
∀ θ, HasDerivAt w (dw θ) θ
hwnonneg :
∀ θ, 0 ≤ w θ
hwnorm :
∫ θ, w θ ∂parameterMeasure ell u = 1
hpnonneg :
∀ θ x, 0 ≤ p θ x
hpnorm :
∀ θ ∈ Icc ell u, ∫ x, p θ x ∂μ = 1
hpint :
∀ θ ∈ Icc ell u, Integrable (fun x => p θ x) μ
hdpint :
∀ θ ∈ Icc ell u, Integrable (fun x => dp θ x) μ
hdiffUnder :
∀ θ ∈ Ioo ell u, HasDerivAt (fun t => ∫ x, p t x ∂μ) (∫ x, dp θ x ∂μ) θ
hpAC :
∀ᵐ x ∂μ, AbsolutelyContinuousOnInterval (fun θ => p θ x) ell u
hdp :
∀ᵐ z ∂((parameterMeasure ell u).prod μ), HasDerivAt (fun t => p t z.2) (dp z.1 z.2) z.1
hψderiv :
∀ θ, HasDerivAt ψ (dψ θ) θ
hboundary :
∀ᵐ x ∂μ, w u * p u x * (T x - ψ u) = 0 ∧ w ell * p ell x * (T x - ψ ell) = 0
hjointSqrtL2 :
MemLp (fun z : ℝ × X => sqrt (jointDensity w p z)) 2 ((parameterMeasure ell u).prod μ)
htargetDerivativeL2 :
MemLp (fun z : ℝ × X => sqrt (jointDensity w p z) * dψ z.1) 2 ((parameterMeasure ell u).prod μ)
herrorL2 :
MemLp (fun z : ℝ × X => sqrt (jointDensity w p z) * (T z.2 - ψ z.1)) 2 ((parameterMeasure ell u).prod μ)
hjointScoreL2 :
MemLp (fun z : ℝ × X => sqrt (jointDensity w p z) * jointScore w dw p dp z) 2 ((parameterMeasure ell u).prod μ)
hpriorJointScoreL2 :
MemLp (fun z : ℝ × X => sqrt (jointDensity w p z) * priorScore w dw z.1) 2 ((parameterMeasure ell u).prod μ)
hlikelihoodScoreL2 :
MemLp (fun z : ℝ × X => sqrt (jointDensity w p z) * likelihoodScore p dp z.1 z.2) 2 ((parameterMeasure ell u).prod μ)
hpriorSqInt :
Integrable (fun θ => w θ * (priorScore w dw θ) ^ 2) (parameterMeasure ell u)
hinfoPos :
0 < priorInformation ell u w dw
+ ∫ θ, w θ * fisherInformation μ p dp θ ∂parameterMeasure ell u
Causalean.Stat.Minimax.VanTreesSmoothModelRegularity · Causalean/Stat/Minimax/VanTreesSmoothModel.lean:26
theorem van_trees_inequality_of_smooth_model reviewed
Causalean.Stat.Minimax

Given a sigma-finite dominating measure and nondegenerate parameter interval, a prior, likelihood, scalar target, estimator, and their derivative representatives, and smooth-model regularity with finite weighted L² error and information, the squared prior-average target derivative divided by prior plus average likelihood information is at most the prior-average mean-squared error.

Formal statement
X :
μ :
ell u :
ℝ
hellu :
ell < u
w dw :
ℝ → ℝ
p dp :
ℝ → X → ℝ
ψ dψ :
ℝ → ℝ
T :
X → ℝ
M :
VanTreesSmoothModelRegularity X μ ell u w dw p dp ψ dψ T
(∫ θ, dψ θ * w θ ∂parameterMeasure ell u) ^ 2 / (priorInformation ell u w dw + ∫ θ, w θ * fisherInformation μ p dp θ ∂parameterMeasure ell u)
≤ ∫ θ, (∫ x, (T x - ψ θ) ^ 2 * p θ x ∂μ) * w θ ∂parameterMeasure ell u
Proof (Lean source)
theorem van_trees_inequality_of_smooth_model {X : Type*} [MeasurableSpace X] (μ : Measure X) [SigmaFinite μ] {ell u : ℝ} (hellu : ell < u) (w dw : ℝ → ℝ) (p dp : ℝ → X → ℝ) (ψ dψ : ℝ → ℝ) (T : X → ℝ) (M : VanTreesSmoothModelRegularity X μ ell u w dw p dp ψ dψ T) : (∫ θ, dψ θ * w θ ∂parameterMeasure ell u) ^ 2 / (priorInformation ell u w dw + ∫ θ, w θ * fisherInformation μ p dp θ ∂parameterMeasure ell u) ≤ ∫ θ, (∫ x, (T x - ψ θ) ^ 2 * p θ x ∂μ) * w θ ∂parameterMeasure ell u := by let ν := (parameterMeasure ell u).prod μ let e : ℝ × X → ℝ := fun z => sqrt (jointDensity w p z) * (T z.2 - ψ z.1) let s : ℝ × X → ℝ := fun z => sqrt (jointDensity w p z) * jointScore w dw p dp z let sp : ℝ × X → ℝ := fun z => sqrt (jointDensity w p z) * priorScore w dw z.1 let sl : ℝ × X → ℝ := fun z => sqrt (jointDensity w p z) * likelihoodScore p dp z.1 z.2 have he_sq : Integrable (fun z => e z ^ 2) ν := (memLp_two_iff_integrable_sq M.herrorL2.aestronglyMeasurable).1 M.herrorL2 have hs_sq : Integrable (fun z => s z ^ 2) ν := (memLp_two_iff_integrable_sq M.hjointScoreL2.aestronglyMeasurable).1 M.hjointScoreL2 have hsp_sq : Integrable (fun z => sp z ^ 2) ν := (memLp_two_iff_integrable_sq M.hpriorJointScoreL2.aestronglyMeasurable).1 M.hpriorJointScoreL2 have hsl_sq : Integrable (fun z => sl z ^ 2) ν := (memLp_two_iff_integrable_sq M.hlikelihoodScoreL2.aestronglyMeasurable).1 M.hlikelihoodScoreL2 have herrorSqInt : Integrable (errorSqField w p (fun θ _ => ψ θ) T) ν := by refine he_sq.congr (ae_of_all _ fun z => ?_) exact weighted_sq_eq M.hwnonneg M.hpnonneg (fun z => T z.2 - ψ z.1) z have hscoreSqInt : Integrable (scoreSqField w dw p dp) ν := by refine hs_sq.congr (ae_of_all _ fun z => ?_) exact weighted_sq_eq M.hwnonneg M.hpnonneg (jointScore w dw p dp) z have hpriorJointSqInt : Integrable (fun z : ℝ × X => w z.1 * p z.1 z.2 * (priorScore w dw z.1) ^ 2) ν := by refine hsp_sq.congr (ae_of_all _ fun z => ?_) dsimp [sp] rw [weighted_sq_eq M.hwnonneg M.hpnonneg (fun z => priorScore w dw z.1) z] simp only [jointDensity] ring have hfisherSqInt : Integrable (fun z : ℝ × X => w z.1 * p z.1 z.2 * (likelihoodScore p dp z.1 z.2) ^ 2) ν := by refine hsl_sq.congr (ae_of_all _ fun z => ?_) dsimp [sl] rw [weighted_sq_eq M.hwnonneg M.hpnonneg (fun z => likelihoodScore p dp z.1 z.2) z] simp only [jointDensity] ring have herrorScoreInt : Integrable (errorScoreField w dw p dp (fun θ _ => ψ θ) T) ν := by have hmul : Integrable (e * s) ν := M.herrorL2.integrable_mul M.hjointScoreL2 refine hmul.congr (ae_of_all _ fun z => ?_) change e z * s z = errorScoreField w dw p dp (fun θ _ => ψ θ) T z rw [show e z * s z = (T z.2 - ψ z.1) * jointScore w dw p dp z * jointDensity w p z by dsimp [e, s] have hq : 0 ≤ jointDensity w p z := mul_nonneg (M.hwnonneg z.1) (M.hpnonneg z.1 z.2) rw [show sqrt (jointDensity w p z) * (T z.2 - ψ z.1) * (sqrt (jointDensity w p z) * jointScore w dw p dp z) = (sqrt (jointDensity w p z)) ^ 2 * ((T z.2 - ψ z.1) * jointScore w dw p dp z) by ring, Real.sq_sqrt hq] ring] rfl have hsensitivityInt : Integrable (sensitivityField w p (fun θ _ => dψ θ)) ν := by have hmul : Integrable ((fun z : ℝ × X => sqrt (jointDensity w p z) * dψ z.1) * fun z : ℝ × X => sqrt (jointDensity w p z)) ν := M.htargetDerivativeL2.integrable_mul M.hjointSqrtL2 refine hmul.congr (ae_of_all _ fun z => ?_) change (sqrt (jointDensity w p z) * dψ z.1) * sqrt (jointDensity w p z) = sensitivityField w p (fun θ _ => dψ θ) z have hq : 0 ≤ jointDensity w p z := mul_nonneg (M.hwnonneg z.1) (M.hpnonneg z.1 z.2) rw [show sqrt (jointDensity w p z) * dψ z.1 * sqrt (jointDensity w p z) = dψ z.1 * (sqrt (jointDensity w p z)) ^ 2 by ring, Real.sq_sqrt hq] rfl have hbalanceInt : Integrable (derivativeBalanceField w dw p dp (fun θ _ => ψ θ) (fun θ _ => dψ θ) T) ν := by have hdiff := herrorScoreInt.sub hsensitivityInt refine hdiff.congr ?_ filter_upwards [M.hdp] with z hdpz have hwzero : w z.1 = 0 → dw z.1 = 0 := derivative_eq_zero_of_nonnegative_of_eq_zero M.hwnonneg (M.hwderiv z.1) have hpzero : p z.1 z.2 = 0 → dp z.1 z.2 = 0 := derivative_eq_zero_of_nonnegative_of_eq_zero (fun t => M.hpnonneg t z.2) hdpz change errorScoreField w dw p dp (fun θ _ => ψ θ) T z - sensitivityField w p (fun θ _ => dψ θ) z = _ rw [errorScoreField_eq_numerator (M.hwnonneg z.1) (M.hpnonneg z.1 z.2) hwzero hpzero] simp only [derivativeBalanceField, sensitivityField, jointDensity] ring have hcrossInt : Integrable (fun z : ℝ × X => w z.1 * p z.1 z.2 * (priorScore w dw z.1 * likelihoodScore p dp z.1 z.2)) ν := by have hmul : Integrable (sp * sl) ν := M.hpriorJointScoreL2.integrable_mul M.hlikelihoodScoreL2 refine hmul.congr (ae_of_all _ fun z => ?_) change sp z * sl z = _ dsimp [sp, sl] have hq : 0 ≤ jointDensity w p z := mul_nonneg (M.hwnonneg z.1) (M.hpnonneg z.1 z.2) rw [show sqrt (jointDensity w p z) * priorScore w dw z.1 * (sqrt (jointDensity w p z) * likelihoodScore p dp z.1 z.2) = (sqrt (jointDensity w p z)) ^ 2 * (priorScore w dw z.1 * likelihoodScore p dp z.1 z.2) by ring, Real.sq_sqrt hq] simp only [jointDensity] exact van_trees_inequality μ hellu w dw p dp ψ dψ T M.hwC1 M.hwderiv M.hwnonneg M.hpnonneg M.hpnorm M.hdiffUnder M.hpAC M.hψAC M.hdp M.hψderiv M.hboundary hbalanceInt herrorScoreInt.aestronglyMeasurable herrorScoreInt hsensitivityInt herrorSqInt.aestronglyMeasurable herrorSqInt hscoreSqInt.aestronglyMeasurable hscoreSqInt hpriorJointSqInt hfisherSqInt hcrossInt M.hinfoPos