Stat.Concentration.UniformDeviation
Localized uniform-deviation bounds and their consequences: the localized envelope expectation, the ERM oracle inequality, the critical-radius fixed point, finite-sample confidence intervals, and the bounded-difference dr
CriticalRadius 9 core · 9 supporting This file defines deterministic critical radii for sub-root envelopes of local Rademacher complexity. ★ subRoot_homogeneity★ criticalRadius_fp_of_subRoot★ criticalRadius_pos_of_subRoot
Critical radius
This file defines deterministic critical radii for sub-root envelopes of local
Rademacher complexity. It provides star-hull localization helpers
(starHullBall, starHullZeroOut, starHullZeroOutScaleCoeff), the envelope
predicate RademacherUpperBound, the critical-radius definition
criticalRadius, the sub-root predicate SubRoot, fixed-point and positivity
lemmas for the critical radius, and the boundedness helper
starHullZeroOut_bddAbove_of_bound.
For an index set, an observation domain, a class of real-valued functions, a real-valued functional on such functions, and a real radius, the star-hull ball is the set of all star-hull functions whose functional value is at most the radius.
For an index set, an observation domain, a class of real-valued functions, a real-valued functional on such functions, and a real radius, the zero-out localized star-hull family assigns to each base function and each scalar between zero and one their scalar product when its functional value is at most the radius, and assigns the zero function otherwise.
Definition (Lean source)
For an index set, an observation domain, a class of real-valued functions, a real-valued functional on such functions, a real radius, and a base-function index, the zero-out scale coefficient is the supremum over scalars in of that scalar when the corresponding scaled function has functional value at most the radius, and zero otherwise.
Definition (Lean source)
For a measurable sample space, an index set, an observation domain, a class of real-valued functions, a real-valued functional on such functions, a measure on the sample space, a random observation map from that sample space, a sample size, and a real-valued radius envelope, the radius envelope is a deterministic upper bound for localized Rademacher complexity exactly when, for every nonnegative real radius, the population Rademacher complexity of the zero-out localized star-hull family at that radius is at most the envelope evaluated at that radius.
Definition (Lean source)
For a real-valued radius envelope, the critical radius is the infimum of the positive real radii for which .
Definition (Lean source)
For a real-valued radius envelope, the sub-root condition holds exactly when (1) the envelope is nonnegative at every nonnegative radius, (2) for every two nonnegative radii with the first no larger than the second, the envelope at the first is no larger than the envelope at the second, and (3) for every two positive radii with the first no larger than the second, the envelope divided by the radius is no smaller at the first than at the second.
Definition (Lean source)
Sub-root inequality. If ψ is sub-root and δ* is a positive radius with ψ δ* ≤ δ* ^ 2, then for every radius r at least δ*, ψ r is at most r · δ*.
Formal statement
Proof (Lean source)
Fixed-point property at the critical radius. If ψ is sub-root and its critical radius criticalRadius ψ is positive, then the critical radius is itself a solution of its own defining inequality: ψ (criticalRadius ψ) ≤ (criticalRadius ψ) ^ 2.
Formal statement
Proof (Lean source)
Positivity of the critical radius. If ψ is sub-root, r₀ is a positive radius with ψ r₀ ≤ r₀ ^ 2, and ψ grows strictly faster than the square near the origin, i.e. there is some ε with 0 < ε < r₀ and ε ^ 2 < ψ ε, then the critical radius of ψ is strictly positive.
Formal statement
Proof (Lean source)
9 supporting declarations (lemmas, instances)
-
ciSup_mul_const_of_le_onelemma — A supremum commutes with multiplication by a nonnegative constant.hypothesesA :Type*c :A → ℝb :ℝhb :0 ≤ bconclusion(⨆ a : A, c a * b) = (⨆ a : A, c a) * bProof (Lean source)
lemma ciSup_mul_const_of_le_one {A : Type*} (c : A → ℝ) (b : ℝ) (hb : 0 ≤ b) : (⨆ a : A, c a * b) = (⨆ a : A, c a) * b := by exact (Real.iSup_mul_of_nonneg hb c).symm -
starHullZeroOutScaleCoeff_le_onelemma — The star-hull zero-out scale coefficient is at most one.hypothesesι :sharedType u_2𝒳 :sharedType u_3F :ι → 𝒳 → ℝnorm :(𝒳 → ℝ) → ℝr :ℝi :ιconclusionstarHullZeroOutScaleCoeff F norm r i ≤ 1Proof (Lean source)
lemma starHullZeroOutScaleCoeff_le_one (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (r : ℝ) (i : ι) : starHullZeroOutScaleCoeff F norm r i ≤ 1 := by classical let c : Icc (0 : ℝ) 1 → ℝ := fun a => if norm (starHullEval F (a, i)) ≤ r then (a : ℝ) else 0 change (⨆ a : Icc (0 : ℝ) 1, c a) ≤ 1 refine ciSup_le ?_ intro a dsimp [c] split_ifs · exact a.property.2 · norm_num -
starHullZeroOut_inner_term_eqlemma — The inner Rademacher term for a fixed star-hull scalar factors into that scalar, or zero when the radius test fails.hypothesesι :sharedType u_2𝒳 :sharedType u_3F :ι → 𝒳 → ℝnorm :(𝒳 → ℝ) → ℝr :ℝn :ℕω :Fin n → 𝒳σ :Signs na :Icc (0 : ℝ) 1i :ιconclusion|(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r (a, i) (ω k)|= (if norm (starHullEval F (a, i)) ≤ r then (a : ℝ) else 0) * |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (ω k)|Proof (Lean source)
lemma starHullZeroOut_inner_term_eq (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (r : ℝ) {n : ℕ} (ω : Fin n → 𝒳) (σ : Signs n) (a : Icc (0 : ℝ) 1) (i : ι) : |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r (a, i) (ω k)| = (if norm (starHullEval F (a, i)) ≤ r then (a : ℝ) else 0) * |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (ω k)| := by by_cases h : norm (starHullEval F (a, i)) ≤ r · have ha_nonneg : 0 ≤ (a : ℝ) := a.property.1 have hsum : (∑ k : Fin n, (σ k : ℝ) * ((a : ℝ) * F i (ω k))) = (a : ℝ) * ∑ k : Fin n, (σ k : ℝ) * F i (ω k) := by rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro k _ ring simp only [starHullZeroOut, h, if_true, starHullEval] rw [hsum] have hrearr : (n : ℝ)⁻¹ * ((a : ℝ) * ∑ k : Fin n, (σ k : ℝ) * F i (ω k)) = (a : ℝ) * ((n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (ω k)) := by ring rw [hrearr, abs_mul, abs_of_nonneg ha_nonneg] · simp [starHullZeroOut, h] -
starHullZeroOut_inner_sup_eqlemma — Supremizing over the star-hull scalar collapses to the largest active coefficient times the base-class inner Rademacher term.hypothesesι :sharedType u_2𝒳 :sharedType u_3F :ι → 𝒳 → ℝnorm :(𝒳 → ℝ) → ℝr :ℝn :ℕω :Fin n → 𝒳σ :Signs ni :ιconclusion= starHullZeroOutScaleCoeff F norm r i * |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (ω k)|Proof (Lean source)
lemma starHullZeroOut_inner_sup_eq (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (r : ℝ) {n : ℕ} (ω : Fin n → 𝒳) (σ : Signs n) (i : ι) : (⨆ a : Icc (0 : ℝ) 1, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r (a, i) (ω k)|) = starHullZeroOutScaleCoeff F norm r i * |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (ω k)| := by classical simp_rw [starHullZeroOut_inner_term_eq F norm r ω σ] exact ciSup_mul_const_of_le_one (fun a : Icc (0 : ℝ) 1 => if norm (starHullEval F (a, i)) ≤ r then (a : ℝ) else 0) _ (abs_nonneg _) -
criticalRadius_nonneglemma — The critical radius is non-negative.Proof (Lean source)
lemma criticalRadius_nonneg (ψ : ℝ → ℝ) : 0 ≤ criticalRadius ψ := by rw [criticalRadius] by_cases hS : ({δ : ℝ | 0 < δ ∧ ψ δ ≤ δ ^ 2} : Set ℝ).Nonempty · refine le_csInf hS ?_ rintro δ ⟨hδ, _⟩ exact le_of_lt hδ · have hEmpty : ({δ : ℝ | 0 < δ ∧ ψ δ ≤ δ ^ 2} : Set ℝ) = ∅ := Set.not_nonempty_iff_eq_empty.mp hS rw [hEmpty] simp -
criticalRadius_lelemma — Any δ > 0 with ψ δ ≤ δ² upper-bounds the critical radius.Proof (Lean source)
lemma criticalRadius_le {ψ : ℝ → ℝ} {δ : ℝ} (h₀ : 0 < δ) (h₁ : ψ δ ≤ δ ^ 2) : criticalRadius ψ ≤ δ := by rw [criticalRadius] apply csInf_le · refine ⟨0, ?_⟩ rintro η ⟨hη, _⟩ exact le_of_lt hη · exact ⟨h₀, h₁⟩ -
subRoot_continuousOn_Ioilemma — Sub-root continuity. If ψ is sub-root, then ψ is continuous on the open ray (0, ∞). The non-increasing ratio condition ψ(r)/r ↘ supplies the linear squeeze bounds, while monotonicity of ψ supplies the opposite side of the squeeze.Proof (Lean source)
lemma subRoot_continuousOn_Ioi {ψ : ℝ → ℝ} (h : SubRoot ψ) : ContinuousOn ψ (Ioi (0 : ℝ)) := by obtain ⟨_, hMono, hRatio⟩ := h rw [(isOpen_Ioi).continuousOn_iff] intro r₀ hr₀ have hr₀pos : 0 < r₀ := hr₀ rw [continuousAt_iff_continuous_left_right] constructor · refine Filter.Tendsto.squeeze' (f := ψ) (g := fun r : ℝ => r * (ψ r₀ / r₀)) (h := fun _ : ℝ => ψ r₀) ?_ ?_ ?_ ?_ · simpa [ContinuousWithinAt, Pi.mul_apply, mul_div_cancel₀ _ (ne_of_gt hr₀pos)] using ((continuous_id.fun_mul continuous_const).continuousWithinAt : ContinuousWithinAt (fun r : ℝ => r * (ψ r₀ / r₀)) (Iic r₀) r₀) · exact (tendsto_const_nhds : Tendsto (fun _ : ℝ => ψ r₀) (nhdsWithin r₀ (Iic r₀)) (nhds (ψ r₀))) · have hpos_eventually : ∀ᶠ r in nhdsWithin r₀ (Iic r₀), 0 < r := Filter.Eventually.filter_mono inf_le_left (isOpen_Ioi.mem_nhds hr₀) filter_upwards [self_mem_nhdsWithin, hpos_eventually] with r hrle hrpos have hratio : ψ r₀ / r₀ ≤ ψ r / r := hRatio r r₀ hrpos hrle rw [le_div_iff₀ hrpos] at hratio simpa [mul_comm] using hratio · have hpos_eventually : ∀ᶠ r in nhdsWithin r₀ (Iic r₀), 0 < r := Filter.Eventually.filter_mono inf_le_left (isOpen_Ioi.mem_nhds hr₀) filter_upwards [self_mem_nhdsWithin, hpos_eventually] with r hrle hrpos exact hMono r r₀ (le_of_lt hrpos) hrle · refine Filter.Tendsto.squeeze' (f := ψ) (g := fun _ : ℝ => ψ r₀) (h := fun r : ℝ => r * (ψ r₀ / r₀)) ?_ ?_ ?_ ?_ · exact (tendsto_const_nhds : Tendsto (fun _ : ℝ => ψ r₀) (nhdsWithin r₀ (Ici r₀)) (nhds (ψ r₀))) · simpa [ContinuousWithinAt, Pi.mul_apply, mul_div_cancel₀ _ (ne_of_gt hr₀pos)] using ((continuous_id.fun_mul continuous_const).continuousWithinAt : ContinuousWithinAt (fun r : ℝ => r * (ψ r₀ / r₀)) (Ici r₀) r₀) · filter_upwards [self_mem_nhdsWithin] with r hle exact hMono r₀ r (le_of_lt hr₀pos) hle · filter_upwards [self_mem_nhdsWithin] with r hle have hrpos : 0 < r := lt_of_lt_of_le hr₀pos hle have hratio : ψ r / r ≤ ψ r₀ / r₀ := hRatio r₀ r hr₀pos hle rw [div_le_iff₀ hrpos] at hratio simpa [mul_comm] using hratio -
abs_starHullZeroOut_le_boundlemma — A zeroed-out star-hull value inherits a bound on its corresponding base-family value.hypotheses𝒳 ι :Type*F :ι → 𝒳 → ℝnorm :(𝒳 → ℝ) → ℝb r :ℝhb :0 ≤ bp :x :𝒳hbound :|F p.2 x| ≤ bconclusion|starHullZeroOut F norm r p x| ≤ bProof (Lean source)
lemma abs_starHullZeroOut_le_bound {𝒳 ι : Type*} (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) {b r : ℝ} (hb : 0 ≤ b) {p : starHullParam ι} {x : 𝒳} (hbound : |F p.2 x| ≤ b) : |starHullZeroOut F norm r p x| ≤ b := by by_cases hp : norm (starHullEval F p) ≤ r · have ha_nonneg : 0 ≤ (p.1 : ℝ) := p.1.property.1 have ha_le : (p.1 : ℝ) ≤ 1 := p.1.property.2 calc |starHullZeroOut F norm r p x| = |(p.1 : ℝ) * F p.2 x| := by simp [starHullZeroOut, hp, starHullEval] _ = |(p.1 : ℝ)| * |F p.2 x| := abs_mul _ _ _ = (p.1 : ℝ) * |F p.2 x| := by rw [abs_of_nonneg ha_nonneg] _ ≤ (p.1 : ℝ) * b := mul_le_mul_of_nonneg_left hbound ha_nonneg _ ≤ 1 * b := mul_le_mul_of_nonneg_right ha_le hb _ = b := one_mul b · simp [starHullZeroOut, hp, hb] -
starHullZeroOut_bddAbove_of_boundlemma — The signed empirical average over the zero-out star hull is bounded above by the uniform bound on the base family at the sampled points: if |F i (S_fin k)| ≤ b for every index and sample coordinate, then for any sign vector the family of signed averages indexed by star-hull parameters has b as an upper bound.hypotheses𝒳 ι :Type*F :ι → 𝒳 → ℝnorm :(𝒳 → ℝ) → ℝb :ℝhb :0 ≤ bm :ℕr :ℝS_fin :Fin m → 𝒳hbound :∀ i k, |F i (S_fin k)| ≤ bσ :Signs mconclusionBddAbove (Set.range fun p : starHullParam ι => |(m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * starHullZeroOut F norm r p (S_fin k)|)Proof (Lean source)
lemma starHullZeroOut_bddAbove_of_bound {𝒳 ι : Type*} (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) {b : ℝ} (hb : 0 ≤ b) (m : ℕ) (r : ℝ) (S_fin : Fin m → 𝒳) (hbound : ∀ i k, |F i (S_fin k)| ≤ b) (σ : Signs m) : BddAbove (Set.range fun p : starHullParam ι => |(m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * starHullZeroOut F norm r p (S_fin k)|) := by classical refine ⟨b, ?_⟩ rintro _ ⟨p, rfl⟩ by_cases hm0 : m = 0 · subst m simp [hb] · have hm_pos_nat : 0 < m := Nat.pos_of_ne_zero hm0 have hm_pos : 0 < (m : ℝ) := Nat.cast_pos.mpr hm_pos_nat calc |(m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * starHullZeroOut F norm r p (S_fin k)| = (m : ℝ)⁻¹ * |∑ k : Fin m, (σ k : ℝ) * starHullZeroOut F norm r p (S_fin k)| := by rw [abs_mul, abs_of_nonneg] exact inv_nonneg.mpr (Nat.cast_nonneg _) _ ≤ (m : ℝ)⁻¹ * ∑ _k : Fin m, b := by apply mul_le_mul_of_nonneg_left · calc |∑ k : Fin m, (σ k : ℝ) * starHullZeroOut F norm r p (S_fin k)| ≤ ∑ k : Fin m, |(σ k : ℝ) * starHullZeroOut F norm r p (S_fin k)| := Finset.abs_sum_le_sum_abs _ _ _ = ∑ k : Fin m, |starHullZeroOut F norm r p (S_fin k)| := by apply Finset.sum_congr rfl intro k _hk rw [abs_mul, Signs.apply_abs'] simp _ ≤ ∑ _k : Fin m, b := Finset.sum_le_sum fun k _hk => abs_starHullZeroOut_le_bound F norm hb (hbound p.2 k) · exact inv_nonneg.mpr (Nat.cast_nonneg _) _ = b := by simp field_simp [ne_of_gt hm_pos]
UniformDeviationLocalized 3 core · 0 supporting This file develops high-probability, localized empirical-process deviation bounds for bounded classes of loss functions. ★ localized_uniform_deviation★ localized_uniform_deviation_sharp
Localized Uniform Deviation
This file develops high-probability, localized empirical-process deviation bounds for bounded classes of loss functions. It packages the boundedness and sub-root complexity assumptions, proves a critical-radius bound at a fixed radius, and then obtains a uniform sharp bound by peeling. These results provide the concentration component used by the library's statistical estimation theory.
The localized regime packages the assumptions needed for a critical-radius uniform-deviation bound over a bounded loss class: a non-negative uniform bound b such that every loss in the class is bounded in absolute value by b on the sample, together with a sub-root function ψ that upper-bounds the localized Rademacher complexity of the class at every sample size.
Definition (Lean source)
Localized uniform deviation. Fix a localized regime R built from measurable losses F i composed with a measurable map X, a confidence level δ in (0,1], and a sample size n at least 1. If the radius r restricting the class to {i : norm (F i) ≤ r} is at least the population critical radius criticalRadius (R.ψ n), itself positive, the envelope satisfies the sub-root fixed-point bound R.ψ n (criticalRadius (R.ψ n)) ≤ criticalRadius (R.ψ n) ^ 2, and the star-hull Rademacher process at radius r is almost-surely bounded and its empirical complexity integrable, then there is a measurable event of probability at least 1 − δ on which, simultaneously for every i with norm (F i) ≤ r, the empirical mean of F i deviates from its population mean by at most 4 · r · criticalRadius (R.ψ n) + R.b · √(2 · log(1/δ) / n).
Formal statement
Proof (Lean source)
Sharp localized uniform deviation. Fix a localized regime R built from measurable losses F i composed with a measurable map X, a confidence level δ in (0,1], and a sample size n at least 1. Let ρ be a positive upper bound on the positive population critical radius criticalRadius (R.ψ n), satisfying the sub-root fixed-point bound R.ψ n (criticalRadius (R.ψ n)) ≤ criticalRadius (R.ψ n) ^ 2, and suppose the star-hull Rademacher process is almost-surely bounded and its empirical complexity integrable at every radius r ≥ ρ. If, further, for every peeling level K covering the diameter cap Rmax ≤ ρ · 2^K, the McDiarmid slack R.b · √(2 · log(2(K+1)/δ) / n) at confidence 1 − δ is itself dominated by ρ², then there is a measurable event of probability at least 1 − δ on which, simultaneously for every i with 0 ≤ norm (F i) ≤ Rmax, the empirical mean of F i deviates from its population mean by at most 8 · ρ · norm (F i) + 5 · ρ².
Formal statement
Proof (Lean source)
ConfidenceInterval 6 core · 2 supporting This file inverts the two-sided Hoeffding and Bernstein sample-mean tail bounds into explicit finite-sample confidence intervals. ★ hoeffding_ci_miss★ bernstein_ci_miss★ hoeffding_ci_cover★ bernstein_ci_cover
Concentration confidence intervals
This file inverts the two-sided Hoeffding and Bernstein sample-mean tail
bounds into explicit finite-sample confidence intervals. It defines
hoeffdingCIHalfWidth and bernsteinCIHalfWidth, proves miss-probability
forms hoeffding_ci_miss and bernstein_ci_miss, and proves the corresponding
coverage forms hoeffding_ci_cover and bernstein_ci_cover.
Given real endpoints and , a natural-number sample size , and a real confidence level , the two-sided Hoeffding confidence-interval half-width is .
Given a real range-bound constant , a real standard-deviation proxy , a natural-number sample size , and a real confidence level , the two-sided Bernstein confidence-interval half-width is .
Finite-sample Hoeffding confidence interval (miss-probability form). Let S be an i.i.d. sample drawn from P, and write m = ∫ f dP for the population mean. If f is measurable, if f is almost-everywhere valued in the interval [a, b] with a < b, if the sample size n is positive, and if the confidence level δ lies in (0, 1], then with probability at most δ the sample mean X̄ₙ of f over S's first n draws satisfies w ≤ |X̄ₙ − m|, where w = hoeffdingCIHalfWidth a b n δ.
Formal statement
Proof (Lean source)
Finite-sample Bernstein confidence interval (miss-probability form). Let S be an i.i.d. sample drawn from P, and write m = ∫ f dP for the population mean. If f is measurable and P-integrable, if f is almost-everywhere within c of m, for some nonnegative c, if the variance of f is bounded by σ², for some positive σ, if the sample size n is positive, and if the confidence level δ lies in (0, 1], then with probability at most δ the sample mean X̄ₙ of f over S's first n draws satisfies w ≤ |X̄ₙ − m|, where w = bernsteinCIHalfWidth c σ n δ.
Formal statement
Proof (Lean source)
Finite-sample Hoeffding confidence interval (coverage form). Let S be an i.i.d. sample drawn from P, and write m = ∫ f dP for the population mean. If f is measurable, if f is almost-everywhere valued in the interval [a, b] with a < b, if the sample size n is positive, and if the confidence level δ lies in (0, 1], then with probability at least 1 − δ the sample mean X̄ₙ of f over S's first n draws satisfies |X̄ₙ − m| < w, where w = hoeffdingCIHalfWidth a b n δ.
Formal statement
Proof (Lean source)
Finite-sample Bernstein confidence interval (coverage form). Let S be an i.i.d. sample drawn from P, and write m = ∫ f dP for the population mean. If f is measurable and P-integrable, if f is almost-everywhere within c of m, for some nonnegative c, if the variance of f is bounded by σ², for some positive σ, if the sample size n is positive, and if the confidence level δ lies in (0, 1], then with probability at least 1 − δ the sample mean X̄ₙ of f over S's first n draws satisfies |X̄ₙ − m| < w, where w = bernsteinCIHalfWidth c σ n δ.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
log_two_div_nonneglemma — For a confidence level between zero and one, the logarithm of twice its inverse is nonnegative.Proof (Lean source)
lemma log_two_div_nonneg {δ : ℝ} (hδ0 : 0 < δ) (hδ1 : δ ≤ 1) : 0 ≤ log (2 / δ) := by apply Real.log_nonneg rw [le_div_iff₀ hδ0]; linarith -
exp_neg_log_two_divlemma — For a positive confidence level, exponentiating the negative logarithm of twice its inverse returns half that confidence level.Proof (Lean source)
lemma exp_neg_log_two_div {δ : ℝ} (hδ0 : 0 < δ) : exp (-(log (2 / δ))) = δ / 2 := by rw [Real.exp_neg, Real.exp_log (by positivity)] field_simp
ERMOracle 2 core · 1 supporting The method-agnostic learning-theory rate: for empirical risk minimization over a (countable) hypothesis class with a bounded loss, the excess population risk of the empirical minimizer is controlled by the Rademacher com ★ erm_oracle_inequality★ erm_oracle_inequality_separable
Generic ERM oracle inequality via Rademacher complexity
The method-agnostic learning-theory rate: for empirical risk minimization over a (countable) hypothesis class with a bounded loss, the excess population risk of the empirical minimizer is controlled by the Rademacher complexity of the loss class plus a McDiarmid tail term. This is the engine that turns a complexity bound for a specific method's loss class into a concrete excess-risk rate.
* erm_excess_le_two_uniformDeviation — deterministic ERM basic inequality:
R(ĥ) − R(h⋆) ≤ 2·uniformDeviation.
* erm_oracle_inequality — high-probability oracle inequality: chains the basic
inequality with FoML's symmetrization + McDiarmid tail
(uniform_deviation_tail_bound_countable), giving
μⁿ{ 4·𝔯ₙ + 2ε < R(ĥ) − R(h⋆) } ≤ exp(−ε² t n).
Built on the FoML Rademacher/uniformDeviation machinery (re-exported under
Causalean.Stat.Concentration).
Generic ERM oracle inequality (Rademacher). Consider a countable hypothesis class indexed by ι, evaluated through measurable loss functions f i composed with a measurable data map X, where every loss value is bounded in absolute value by a nonnegative constant b. Let ihat assign to each sample of size n an index that attains empirical risk no larger than that of a fixed comparator istar. Then, provided the McDiarmid tail parameter t satisfies t·b² ≤ 1/2 and ε is nonnegative, the probability, over the n-fold product sample, that the excess population risk of ihat over istar exceeds 4·𝔯ₙ + 2ε — where 𝔯ₙ is the Rademacher complexity of the loss class — is at most exp(−ε²·t·n).
Formal statement
Proof (Lean source)
Generic ERM oracle inequality (separable class). As in erm_oracle_inequality, but the hypothesis index ι need only be a separable, first-countable topological space rather than countable — the form that covers the (uncountable but separable) L²/L¹-ball linear classes. Given measurable loss functions f i composed with a measurable data map X, with every loss value bounded in absolute value by a nonnegative constant b and each loss value f i x depending continuously on the index i, let ihat assign to each sample of size n an index that attains empirical risk no larger than that of a fixed comparator istar. Then, provided the McDiarmid tail parameter t satisfies t·b² ≤ 1/2 and ε is nonnegative, the probability, over the n-fold product sample, that the excess population risk of ihat over istar exceeds 4·𝔯ₙ + 2ε — where 𝔯ₙ is the Rademacher complexity of the loss class — is at most exp(−ε²·t·n).
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
erm_excess_le_two_uniformDeviationtheorem — ERM basic inequality (deterministic). If ihat beats the comparator istar in empirical risk on the sample X ∘ ω (Rₙ(ihat) ≤ Rₙ(istar)), then its excess population risk is at most twice the uniform deviation of the loss class on that sample.hypothesesn :sharedℕΩ :sharedType u_1ι :sharedType u_2𝒳 :sharedType u_3f :sharedι → 𝒳 → ℝX :Ω → 𝒳hf :∀ i, AEMeasurable (f i ∘ X) μω :Fin n → Ωb :ℝhb :0 ≤ bhf' :∀ i x, |f i x| ≤ bihat istar :ιhERM :(n : ℝ)⁻¹ * ∑ k, f ihat (X (ω k)) ≤ (n : ℝ)⁻¹ * ∑ k, f istar (X (ω k))conclusionμ[fun ω' => f ihat (X ω')] - μ[fun ω' => f istar (X ω')]≤ 2 * uniformDeviation n f μ X (X ∘ ω)Proof (Lean source)
theorem erm_excess_le_two_uniformDeviation [IsProbabilityMeasure μ] (X : Ω → 𝒳) (hf : ∀ i, AEMeasurable (f i ∘ X) μ) (ω : Fin n → Ω) {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ i x, |f i x| ≤ b) (ihat istar : ι) (hERM : (n : ℝ)⁻¹ * ∑ k, f ihat (X (ω k)) ≤ (n : ℝ)⁻¹ * ∑ k, f istar (X (ω k))) : μ[fun ω' => f ihat (X ω')] - μ[fun ω' => f istar (X ω')] ≤ 2 * uniformDeviation n f μ X (X ∘ ω) := by classical letI : Nonempty ι := ⟨istar⟩ let R : ι → ℝ := fun i => μ[fun ω' => f i (X ω')] let Rn : ι → ℝ := fun i => (n : ℝ)⁻¹ * ∑ k : Fin n, f i (X (ω k)) have hRn_bound : ∀ i, |Rn i| ≤ b := by intro i by_cases hn0 : n = 0 · simp [Rn, hn0, hb] · have hn_pos_nat : 0 < n := Nat.pos_of_ne_zero hn0 have hn_pos : 0 < (n : ℝ) := Nat.cast_pos.mpr hn_pos_nat calc |Rn i| = (n : ℝ)⁻¹ * |∑ k : Fin n, f i (X (ω k))| := by dsimp [Rn] rw [abs_mul, abs_of_nonneg] exact inv_nonneg.mpr (Nat.cast_nonneg _) _ ≤ (n : ℝ)⁻¹ * (∑ _k : Fin n, b) := by apply mul_le_mul_of_nonneg_left · exact (Finset.abs_sum_le_sum_abs (s := univ) (f := fun k : Fin n => f i (X (ω k)))).trans (Finset.sum_le_sum fun k _ => hf' i (X (ω k))) · positivity _ = b := by simp field_simp [hn_pos.ne'] have hR_bound : ∀ i, |R i| ≤ b := by intro i calc |R i| ≤ ∫ ω', |f i (X ω')| ∂μ := by simpa [R] using (MeasureTheory.abs_integral_le_integral_abs (μ := μ) (f := fun ω' => f i (X ω'))) _ ≤ ∫ _ω', b ∂μ := by apply integral_mono · exact Integrable.of_bound ((hf i).abs.aestronglyMeasurable) b (by filter_upwards with ω' simpa [Real.norm_eq_abs] using hf' i (X ω')) · exact integrable_const b · intro ω' exact hf' i (X ω') _ = b := by simp have hbdd : BddAbove (Set.range fun i : ι => |Rn i - R i|) := by rw [bddAbove_def] refine ⟨2 * b, ?_⟩ intro y hy rcases hy with ⟨i, rfl⟩ calc |Rn i - R i| ≤ |Rn i| + |R i| := abs_sub _ _ _ ≤ 2 * b := by linarith [hRn_bound i, hR_bound i] have hdev_le : ∀ i, |Rn i - R i| ≤ uniformDeviation n f μ X (X ∘ ω) := by intro i dsimp [uniformDeviation] simpa [Rn, R, Function.comp_def] using (le_ciSup (f := fun j : ι => |Rn j - R j|) hbdd i) have hmid : Rn ihat - Rn istar ≤ 0 := by dsimp [Rn] linarith have hleft : R ihat - Rn ihat ≤ |Rn ihat - R ihat| := by have h := neg_le_abs (Rn ihat - R ihat) linarith have hright : Rn istar - R istar ≤ |Rn istar - R istar| := le_abs_self _ calc μ[fun ω' => f ihat (X ω')] - μ[fun ω' => f istar (X ω')] = (R ihat - Rn ihat) + (Rn ihat - Rn istar) + (Rn istar - R istar) := by simp [R] _ ≤ |Rn ihat - R ihat| + 0 + |Rn istar - R istar| := by linarith _ ≤ uniformDeviation n f μ X (X ∘ ω) + 0 + uniformDeviation n f μ X (X ∘ ω) := by linarith [hdev_le ihat, hdev_le istar] _ = 2 * uniformDeviation n f μ X (X ∘ ω) := by ring
LocalizedEnvelopeExpectation 2 core · 0 supporting This file isolates the expectation-level pieces of localized uniform-deviation arguments before the bounded-difference tail step. ★ localized_uniform_deviation_expectation★ localized_offset_expectation
Localized uniform deviation, in expectation
This file isolates the expectation-level pieces of localized uniform-deviation
arguments before the bounded-difference tail step. The theorem
localized_uniform_deviation_expectation bounds the expected fixed-radius
empirical supremum by the critical-radius envelope, while
localized_offset_expectation gives the self-localizing positive-part offset
bound used in downstream margin-coupled empirical-process rates.
Localized uniform deviation, in expectation. Fix a localized regime R built from measurable losses F i composed with a measurable data map X, and a sample size n at least 1. If the radius r restricting the class to {i : norm (F i) ≤ r} is at least the population critical radius criticalRadius (R.ψ n), itself positive, the envelope R.ψ n satisfies the sub-root self-bounding condition R.ψ n (criticalRadius (R.ψ n)) ≤ criticalRadius (R.ψ n) ^ 2 at that radius, and the empirical Rademacher complexity of the radius-r star-hull is integrable, then the expectation, over the n-fold sample, of the uniform deviation of the radius-r-restricted class is at most 2·r·criticalRadius (R.ψ n).
Formal statement
Proof (Lean source)
Localized offset expectation. Fix a localized regime R built from measurable losses F i composed with a measurable map X, a confidence level δ in (0,1], a sample size n at least 1, and a positive upper bound ρ on the positive critical radius criticalRadius (R.ψ n), satisfying the sub-root fixed-point bound R.ψ n (criticalRadius (R.ψ n)) ≤ criticalRadius (R.ψ n) ^ 2, with the star-hull Rademacher process almost-surely bounded and integrable at every radius r ≥ ρ and a slack-domination condition bounding the McDiarmid tail by ρ² across the diameter shells up to Rmax. Suppose further that every norm (F i) lies in [0, Rmax], so the sharp deviation bound applies uniformly over the class, that the exponent κ lies strictly between 0 and 1, that the coupling constant A is nonnegative, that the regret radius Δ i is nonnegative for every i, and that the localization radius is dominated by the regret via the margin coupling norm (F i) ≤ A · (Δ i) ^ κ. Then the expectation over the n-fold sample of the supremum over i of the positive part of 2 · |(Pₙ−P)F i| − Δ i / 4 is at most offsetPeelingConstantC (1/8) κ · (16·ρ·A)^{1/(1−κ)} + 10·ρ² + 4·R.b·δ.