Stat.Concentration.Rademacher.Contraction

The contraction principle: composing every function of a class with an L-Lipschitz map φ multiplies its empirical Rademacher complexity by at most L in the signed form (no absolute value inside the supremum), and by at m

Signed 3 core · 4 supporting This file proves the finite-index Ledoux--Talagrand contraction principle for signed empirical Rademacher averages. ★ rademacher_contraction

Signed Rademacher contraction

This file proves the finite-index Ledoux--Talagrand contraction principle for signed empirical Rademacher averages. It defines LipschitzAt0, develops the hybrid sign-swap argument, and exports rademacher_contraction together with the signed scaling law. Absolute-value and arbitrary-index consequences are provided by Contraction/Absolute.lean.

def LipschitzAt0 reviewed
Causalean.Stat.Concentration

For a real-valued transformation and a real constant, the transformation is Lipschitz at zero with constant LL exactly when (1) it maps zero to zero and (2) for every two real numbers xx and yy, its increment has absolute value at most L∣x−y∣L|x-y|.

Definition (Lean source)
φ :
ℝ → ℝ
L :
ℝ
LipschitzAt0 φ L :
Prop
clause 1
φ 0 = 0
clause 2
x y :
|φ x - φ y| ≤ L * |x - y|
abbrev SignAtom reviewed
Causalean.Stat.Concentration

The sign atom is the two-element type containing the signs minus one and one. It provides the individual Rademacher signs used in the signed contraction argument.

Definition (Lean source)
SignAtom :
Finset ℤ
({-1, 1} : Finset ℤ)
theorem rademacher_contraction reviewed
Causalean.Stat.Concentration

If the proposed Lipschitz constant is nonnegative and the scalar transform is Lipschitz with that constant, then the empirical Rademacher complexity without absolute values of the transformed class is at most that constant times the original complexity.

Formal statement
ι :
Type u_1
shared
𝒳 :
Type u_2
shared
Nonempty ι
Finite ι
φ :
ℝ → ℝ
L :
ℝ
hL :
0 ≤ L
hφ :
∀ x y, |φ x - φ y| ≤ L * |x - y|
F :
ι → 𝒳 → ℝ
n :
ℕ
S :
Fin n → 𝒳
empiricalRademacherComplexity_without_abs n (fun i x => φ (F i x)) S
≤ L * empiricalRademacherComplexity_without_abs n F S
Proof (Lean source)
theorem rademacher_contraction [Nonempty ι] [Finite ι] (φ : ℝ → ℝ) {L : ℝ} (hL : 0 ≤ L) (hφ : ∀ x y, |φ x - φ y| ≤ L * |x - y|) (F : ι → 𝒳 → ℝ) (n : ℕ) (S : Fin n → 𝒳) : empiricalRademacherComplexity_without_abs n (fun i x => φ (F i x)) S ≤ L * empiricalRademacherComplexity_without_abs n F S := by calc empiricalRademacherComplexity_without_abs n (fun i x => φ (F i x)) S = hybridAverage φ L F n S 0 := by rw [hybridAverage_zero_eq] _ ≤ hybridAverage φ L F n S n := hybridAverage_zero_le_full φ hφ F n S _ = empiricalRademacherComplexity_without_abs n (fun i x => L * F i x) S := by rw [hybridAverage_full_eq_linear] _ = L * empiricalRademacherComplexity_without_abs n F S := empiricalRademacherComplexity_without_abs_smul_class F L hL n S
Causalean.Stat.Concentration.rademacher_contraction · Causalean/Stat/Concentration/Rademacher/Contraction/Signed.lean:469
4 supporting declarations (lemmas, instances)
  • finite_iSup_eq_value lemma — A real-valued function on a nonempty finite population attains a largest value, and its supremum is that value.
    α :
    Type*
    Nonempty α
    Finite α
    f :
    α → ℝ
    ∃ a : α,
    (⨆ x, f x) = f a
    conclusion 1
    x :
    f x ≤ f a
    Proof (Lean source)
    lemma finite_iSup_eq_value {α : Type*} [Nonempty α] [Finite α] (f : α → ℝ) : ∃ a : α, (⨆ x, f x) = f a ∧ ∀ x, f x ≤ f a := by classical rcases Finite.exists_max f with ⟨a, ha⟩ refine ⟨a, ?_, ha⟩ exact le_antisymm (ciSup_le ha) (le_ciSup (Finite.bddAbove_range f) a)
    Causalean.Stat.Concentration.finite_iSup_eq_value · Causalean/Stat/Concentration/Rademacher/Contraction/Signed.lean:89
  • sup_pair_lipschitz_scaled lemma — For a finite nonempty collection, the sum of the largest values obtained by adding and subtracting a nonnegative multiple of a transformation with a given Lipschitz constant is no greater than the corresponding sum using that linear bound.
    ι :
    Type*
    Nonempty ι
    Finite ι
    φ :
    ℝ → ℝ
    L c :
    ℝ
    hc :
    0 ≤ c
    hφ :
    ∀ x y, |φ x - φ y| ≤ L * |x - y|
    a :
    ι → ℝ
    b :
    ι → ℝ
    (⨆ i, a i + c * φ (b i)) + (⨆ i, a i - c * φ (b i))
    ≤ (⨆ i, a i + c * (L * b i)) + (⨆ i, a i - c * (L * b i))
    Proof (Lean source)
    lemma sup_pair_lipschitz_scaled {ι : Type*} [Nonempty ι] [Finite ι] (φ : ℝ → ℝ) {L c : ℝ} (hc : 0 ≤ c) (hφ : ∀ x y, |φ x - φ y| ≤ L * |x - y|) (a : ι → ℝ) (b : ι → ℝ) : (⨆ i, a i + c * φ (b i)) + (⨆ i, a i - c * φ (b i)) ≤ (⨆ i, a i + c * (L * b i)) + (⨆ i, a i - c * (L * b i)) := by classical rcases finite_iSup_eq_value (fun i : ι => a i + c * φ (b i)) with ⟨i₁, hi₁eq, _hi₁max⟩ rcases finite_iSup_eq_value (fun i : ι => a i - c * φ (b i)) with ⟨i₂, hi₂eq, _hi₂max⟩ rw [hi₁eq, hi₂eq] have hdiff : φ (b i₁) - φ (b i₂) ≤ L * |b i₁ - b i₂| := by exact (le_abs_self _).trans (hφ (b i₁) (b i₂)) have hcdiff : c * (φ (b i₁) - φ (b i₂)) ≤ c * (L * |b i₁ - b i₂|) := by exact mul_le_mul_of_nonneg_left hdiff hc by_cases hcase : b i₂ ≤ b i₁ · have habs : |b i₁ - b i₂| = b i₁ - b i₂ := abs_of_nonneg (sub_nonneg.mpr hcase) have hmain : a i₁ + c * φ (b i₁) + (a i₂ - c * φ (b i₂)) ≤ (a i₁ + c * (L * b i₁)) + (a i₂ - c * (L * b i₂)) := by rw [habs] at hcdiff linarith refine hmain.trans ?_ exact add_le_add (le_ciSup (Finite.bddAbove_range (fun i : ι => a i + c * (L * b i))) i₁) (le_ciSup (Finite.bddAbove_range (fun i : ι => a i - c * (L * b i))) i₂) · have hcase' : b i₁ ≤ b i₂ := le_of_not_ge hcase have habs : |b i₁ - b i₂| = b i₂ - b i₁ := by rw [abs_sub_comm] exact abs_of_nonneg (sub_nonneg.mpr hcase') have hmain : a i₁ + c * φ (b i₁) + (a i₂ - c * φ (b i₂)) ≤ (a i₂ + c * (L * b i₂)) + (a i₁ - c * (L * b i₁)) := by rw [habs] at hcdiff linarith refine hmain.trans ?_ have hp := le_ciSup (Finite.bddAbove_range (fun i : ι => a i + c * (L * b i))) i₂ have hm := le_ciSup (Finite.bddAbove_range (fun i : ι => a i - c * (L * b i))) i₁ linarith
    Causalean.Stat.Concentration.sup_pair_lipschitz_scaled · Causalean/Stat/Concentration/Rademacher/Contraction/Signed.lean:98
  • signAtom_coe_real_eq_neg_one_or_one lemma — Every sign atom, viewed as a real number, is either minus one or one.
    s :
    (s : ℝ) = -1 ∨ (s : ℝ) = 1
    Proof (Lean source)
    lemma signAtom_coe_real_eq_neg_one_or_one (s : SignAtom) : (s : ℝ) = -1 ∨ (s : ℝ) = 1 := by rcases s with ⟨z, hz⟩ simp only [Finset.mem_insert, Int.reduceNeg, Finset.mem_singleton, Int.cast_eq_one] at hz ⊢ rcases hz with rfl | rfl · left norm_num · right norm_num
    Causalean.Stat.Concentration.signAtom_coe_real_eq_neg_one_or_one · Causalean/Stat/Concentration/Rademacher/Contraction/Signed.lean:279
  • empiricalRademacherComplexity_without_abs_smul_class theorem — Without-abs analogue of empiricalRademacherComplexity_smul_class: the signed scaling carries c, not |c|.
    ι :
    Type u_1
    shared
    𝒳 :
    Type u_2
    shared
    F :
    ι → 𝒳 → ℝ
    c :
    ℝ
    hc :
    0 ≤ c
    n :
    ℕ
    S :
    Fin n → 𝒳
    empiricalRademacherComplexity_without_abs n (fun i x => c * F i x) S
    = c * empiricalRademacherComplexity_without_abs n F S
    Proof (Lean source)
    theorem empiricalRademacherComplexity_without_abs_smul_class (F : ι → 𝒳 → ℝ) (c : ℝ) (hc : 0 ≤ c) (n : ℕ) (S : Fin n → 𝒳) : empiricalRademacherComplexity_without_abs n (fun i x => c * F i x) S = c * empiricalRademacherComplexity_without_abs n F S := by unfold empiricalRademacherComplexity_without_abs have hsum : (∑ σ : Signs n, ⨆ i, (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (c * F i (S k))) = c * ∑ σ : Signs n, ⨆ i, (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k) := by rw [Finset.mul_sum] refine Finset.sum_congr rfl fun σ _ => ?_ calc (⨆ i, (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (c * F i (S k))) = ⨆ i, c * ((n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)) := by refine iSup_congr fun i => ?_ calc (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (c * F i (S k)) = (n : ℝ)⁻¹ * (c * ∑ k : Fin n, (σ k : ℝ) * F i (S k)) := by congr 1 rw [Finset.mul_sum] refine Finset.sum_congr rfl fun k _ => by ring _ = c * ((n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)) := by ring _ = c * ⨆ i, (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k) := by exact (Real.mul_iSup_of_nonneg hc (fun i => (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k))).symm rw [hsum] ring
    Causalean.Stat.Concentration.empiricalRademacherComplexity_without_abs_smul_class · Causalean/Stat/Concentration/Rademacher/Contraction/Signed.lean:425
Absolute 1 core · 8 supporting Starting from the signed finite-index contraction theorem, this file derives the standard factor-two absolute-value contraction bound. ★ rademacher_contraction_abs

Absolute Rademacher contraction

Starting from the signed finite-index contraction theorem, this file derives the standard factor-two absolute-value contraction bound. It also supplies scaling and subtraction rules for empirical Rademacher complexity and the arbitrary-index contraction theorem under boundedness of the relevant suprema.

theorem rademacher_contraction_abs reviewed
Causalean.Stat.Concentration

Contraction principle, absolute-value form. If φ fixes 0 and is L-Lipschitz, i.e. φ 0 = 0 and |φ x - φ y| ≤ L * |x - y| for all x, y, then composing each function of the family F with φ multiplies the (absolute-value) empirical Rademacher complexity on the sample S by at most 2 * L.

Formal statement
ι :
Type u_1
shared
𝒳 :
Type u_2
shared
Nonempty ι
Finite ι
φ :
ℝ → ℝ
L :
ℝ
hφ :
F :
ι → 𝒳 → ℝ
n :
ℕ
S :
Fin n → 𝒳
empiricalRademacherComplexity n (fun i x => φ (F i x)) S
≤ 2 * L * empiricalRademacherComplexity n F S
Proof (Lean source)
theorem rademacher_contraction_abs [Nonempty ι] [Finite ι] (φ : ℝ → ℝ) {L : ℝ} (hφ : LipschitzAt0 φ L) (F : ι → 𝒳 → ℝ) (n : ℕ) (S : Fin n → 𝒳) : empiricalRademacherComplexity n (fun i x => φ (F i x)) S ≤ 2 * L * empiricalRademacherComplexity n F S := by classical letI := Fintype.ofFinite ι have hL : 0 ≤ L := by have h := hφ.2 0 1 norm_num [hφ.1] at h exact (abs_nonneg _).trans h let F0 : Option ι → 𝒳 → ℝ := withZero F let G0 : Option ι → 𝒳 → ℝ := fun i x => φ (F0 i x) have hG0_zero : ∀ x, G0 none x = 0 := by intro x simp [G0, F0, withZero, hφ.1] have hG0_eq : G0 = withZero (fun i x => φ (F i x)) := by funext o x cases o with | none => simp [G0, F0, withZero, hφ.1] | some i => simp [G0, F0, withZero] have h_abs_split : empiricalRademacherComplexity n G0 S ≤ empiricalRademacherComplexity_without_abs n G0 S + empiricalRademacherComplexity_without_abs n (fun i x => -G0 i x) S := empirical_abs_withZero_le_no_abs_plus_neg G0 hG0_zero n S have h_contraction_pos : empiricalRademacherComplexity_without_abs n G0 S ≤ L * empiricalRademacherComplexity_without_abs n F0 S := by simpa [G0] using rademacher_contraction φ hL hφ.2 F0 n S have h_contraction_neg : empiricalRademacherComplexity_without_abs n (fun i x => -G0 i x) S ≤ L * empiricalRademacherComplexity_without_abs n F0 S := by simpa [G0] using rademacher_contraction (fun x => -φ x) hL (lipschitzAt0_neg φ hφ).2 F0 n S have hF0_le : empiricalRademacherComplexity_without_abs n F0 S ≤ empiricalRademacherComplexity n F S := by simpa [F0] using empirical_without_abs_withZero_le_abs F n S calc empiricalRademacherComplexity n (fun i x => φ (F i x)) S = empiricalRademacherComplexity n (withZero (fun i x => φ (F i x))) S := by exact (empirical_abs_withZero_eq (fun i x => φ (F i x)) n S).symm _ = empiricalRademacherComplexity n G0 S := by rw [hG0_eq] _ ≤ empiricalRademacherComplexity_without_abs n G0 S + empiricalRademacherComplexity_without_abs n (fun i x => -G0 i x) S := h_abs_split _ ≤ L * empiricalRademacherComplexity_without_abs n F0 S + L * empiricalRademacherComplexity_without_abs n F0 S := add_le_add h_contraction_pos h_contraction_neg _ = 2 * L * empiricalRademacherComplexity_without_abs n F0 S := by ring _ ≤ 2 * L * empiricalRademacherComplexity n F S := by exact mul_le_mul_of_nonneg_left hF0_le (by nlinarith)
Causalean.Stat.Concentration.rademacher_contraction_abs · Causalean/Stat/Concentration/Rademacher/Contraction/Absolute.lean:192 · uses LipschitzAt0
8 supporting declarations (lemmas, instances)
  • lipschitzAt0_neg lemma — Negating a function that fixes zero preserves the same Lipschitz constant.
    φ :
    ℝ → ℝ
    L :
    ℝ
    hφ :
    LipschitzAt0 (fun x => -φ x) L
    Proof (Lean source)
    lemma lipschitzAt0_neg (φ : ℝ → ℝ) {L : ℝ} (hφ : LipschitzAt0 φ L) : LipschitzAt0 (fun x => -φ x) L := by refine ⟨by simp [hφ.1], ?_⟩ intro x y rw [show -φ x - -φ y = -(φ x - φ y) from by ring, abs_neg] exact hφ.2 x y
    Causalean.Stat.Concentration.lipschitzAt0_neg · Causalean/Stat/Concentration/Rademacher/Contraction/Absolute.lean:50
  • iSup_abs_le_iSup_add_iSup_neg_of_exists_zero lemma — If a finite collection of real numbers includes zero, its largest absolute value is at most the sum of its largest value and the largest value after negation.
    α :
    Type*
    Finite α
    x :
    α → ℝ
    h0 :
    ∃ a : α, x a = 0
    (⨆ a, |x a|) ≤ (⨆ a, x a) + (⨆ a, -x a)
    Proof (Lean source)
    lemma iSup_abs_le_iSup_add_iSup_neg_of_exists_zero {α : Type*} [Finite α] (x : α → ℝ) (h0 : ∃ a : α, x a = 0) : (⨆ a, |x a|) ≤ (⨆ a, x a) + (⨆ a, -x a) := by classical letI := ofFinite α rcases h0 with ⟨a0, ha0⟩ letI : Nonempty α := ⟨a0⟩ have hsup_nonneg : 0 ≤ ⨆ a, x a := by rw [← ha0] exact le_ciSup (Finite.bddAbove_range x) a0 have hsup_neg_nonneg : 0 ≤ ⨆ a, -x a := by rw [← show -x a0 = 0 by rw [ha0]; simp] exact le_ciSup (Finite.bddAbove_range fun a => -x a) a0 refine ciSup_le ?_ intro a by_cases hx : 0 ≤ x a · rw [abs_of_nonneg hx] have hxle : x a ≤ ⨆ a, x a := le_ciSup (Finite.bddAbove_range x) a linarith · have hxle : -x a ≤ ⨆ a, -x a := le_ciSup (Finite.bddAbove_range fun a => -x a) a rw [abs_of_neg (lt_of_not_ge hx)] linarith
    Causalean.Stat.Concentration.iSup_abs_le_iSup_add_iSup_neg_of_exists_zero · Causalean/Stat/Concentration/Rademacher/Contraction/Absolute.lean:59
  • empirical_abs_withZero_le_no_abs_plus_neg lemma — If a function class contains the zero function, its empirical Rademacher complexity with absolute values is bounded by the sum of the corresponding unsigned complexities for the class and its negation.
    ι :
    Type u_1
    shared
    𝒳 :
    Type u_2
    shared
    Finite ι
    F :
    Option ι → 𝒳 → ℝ
    hzero :
    ∀ x, F none x = 0
    n :
    ℕ
    S :
    Fin n → 𝒳
    empiricalRademacherComplexity n F S
    ≤ empiricalRademacherComplexity_without_abs n F S
    + empiricalRademacherComplexity_without_abs n (fun i x => -F i x) S
    Proof (Lean source)
    lemma empirical_abs_withZero_le_no_abs_plus_neg [Finite ι] (F : Option ι → 𝒳 → ℝ) (hzero : ∀ x, F none x = 0) (n : ℕ) (S : Fin n → 𝒳) : empiricalRademacherComplexity n F S ≤ empiricalRademacherComplexity_without_abs n F S + empiricalRademacherComplexity_without_abs n (fun i x => -F i x) S := by classical letI := ofFinite ι unfold empiricalRademacherComplexity empiricalRademacherComplexity_without_abs rw [← mul_add] refine mul_le_mul_of_nonneg_left ?_ (by positivity) rw [← Finset.sum_add_distrib] refine Finset.sum_le_sum ?_ intro σ _ have hzero_inner : (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F none (S k) = 0 := by simp [hzero] have hpoint := iSup_abs_le_iSup_add_iSup_neg_of_exists_zero (fun i : Option ι => (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)) ⟨none, hzero_inner⟩ have hneg : (⨆ i : Option ι, -((n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k))) = (⨆ i : Option ι, (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (-F i (S k))) := by refine iSup_congr fun i => ?_ calc -((n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)) = (n : ℝ)⁻¹ * (-(∑ k : Fin n, (σ k : ℝ) * F i (S k))) := by ring _ = (n : ℝ)⁻¹ * (∑ k : Fin n, -((σ k : ℝ) * F i (S k))) := by rw [Finset.sum_neg_distrib] _ = (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (-F i (S k)) := by congr 1 refine Finset.sum_congr rfl fun k _ => by ring simpa [hneg] using hpoint
    Causalean.Stat.Concentration.empirical_abs_withZero_le_no_abs_plus_neg · Causalean/Stat/Concentration/Rademacher/Contraction/Absolute.lean:145
  • empiricalRademacherComplexity_smul_class theorem — Scalar-multiplication law for empirical Rademacher complexity. Scaling each element of a function class by c scales the absolute-value empirical Rademacher complexity by |c|.
    ι :
    Type u_1
    shared
    𝒳 :
    Type u_2
    shared
    F :
    ι → 𝒳 → ℝ
    c :
    ℝ
    n :
    ℕ
    S :
    Fin n → 𝒳
    empiricalRademacherComplexity n (fun i x => c * F i x) S
    = |c| * empiricalRademacherComplexity n F S
    Proof (Lean source)
    theorem empiricalRademacherComplexity_smul_class (F : ι → 𝒳 → ℝ) (c : ℝ) (n : ℕ) (S : Fin n → 𝒳) : empiricalRademacherComplexity n (fun i x => c * F i x) S = |c| * empiricalRademacherComplexity n F S := by unfold empiricalRademacherComplexity have hsum : (∑ σ : Signs n, ⨆ i, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (c * F i (S k))|) = |c| * ∑ σ : Signs n, ⨆ i, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)| := by rw [Finset.mul_sum] refine Finset.sum_congr rfl fun σ _ => ?_ calc (⨆ i, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (c * F i (S k))|) = ⨆ i, |c| * |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)| := by refine iSup_congr fun i => ?_ have hlin : (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (c * F i (S k)) = c * ((n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)) := by calc (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (c * F i (S k)) = (n : ℝ)⁻¹ * (c * ∑ k : Fin n, (σ k : ℝ) * F i (S k)) := by congr 1 rw [Finset.mul_sum] refine Finset.sum_congr rfl fun k _ => by ring _ = c * ((n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)) := by ring rw [hlin, abs_mul] _ = |c| * ⨆ i, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)| := by exact (Real.mul_iSup_of_nonneg (abs_nonneg c) (fun i => |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)|)).symm rw [hsum] ring
    Causalean.Stat.Concentration.empiricalRademacherComplexity_smul_class · Causalean/Stat/Concentration/Rademacher/Contraction/Absolute.lean:257
  • absInner_le_of_bound lemma — A signed empirical average of a uniformly bounded function has absolute value no larger than the same uniform bound.
    ι :
    Type u_1
    shared
    𝒳 :
    Type u_2
    shared
    H :
    ι → 𝒳 → ℝ
    M :
    ℝ
    hM0 :
    0 ≤ M
    hH :
    ∀ i x, |H i x| ≤ M
    n :
    ℕ
    S :
    Fin n → 𝒳
    σ :
    Signs n
    i :
    ι
    |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * H i (S k)| ≤ M
    Proof (Lean source)
    lemma absInner_le_of_bound (H : ι → 𝒳 → ℝ) {M : ℝ} (hM0 : 0 ≤ M) (hH : ∀ i x, |H i x| ≤ M) (n : ℕ) (S : Fin n → 𝒳) (σ : Signs n) (i : ι) : |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * H i (S k)| ≤ M := by by_cases hn : n = 0 · subst hn; simpa using hM0 · have hn_pos : 0 < (n : ℝ) := by positivity rw [abs_mul, abs_of_nonneg (by positivity : (0:ℝ) ≤ (n:ℝ)⁻¹)] calc (n : ℝ)⁻¹ * |∑ k : Fin n, (σ k : ℝ) * H i (S k)| ≤ (n : ℝ)⁻¹ * ∑ k : Fin n, M := by refine mul_le_mul_of_nonneg_left ?_ (by positivity) refine (Finset.abs_sum_le_sum_abs _ _).trans (Finset.sum_le_sum ?_) intro k _ rw [abs_mul] rcases signAtom_coe_real_eq_neg_one_or_one (σ k) with h | h · rw [h]; simpa using hH i (S k) · rw [h]; simpa using hH i (S k) _ = M := by rw [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] field_simp
    Causalean.Stat.Concentration.absInner_le_of_bound · Causalean/Stat/Concentration/Rademacher/Contraction/Absolute.lean:307
  • absInner_bddAbove lemma — Signed empirical averages of a uniformly bounded function class are bounded above by the common absolute bound.
    ι :
    Type u_1
    shared
    𝒳 :
    Type u_2
    shared
    H :
    ι → 𝒳 → ℝ
    M :
    ℝ
    hM0 :
    0 ≤ M
    hH :
    ∀ i x, |H i x| ≤ M
    n :
    ℕ
    S :
    Fin n → 𝒳
    σ :
    Signs n
    BddAbove (range (fun i => |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * H i (S k)|))
    Proof (Lean source)
    lemma absInner_bddAbove (H : ι → 𝒳 → ℝ) {M : ℝ} (hM0 : 0 ≤ M) (hH : ∀ i x, |H i x| ≤ M) (n : ℕ) (S : Fin n → 𝒳) (σ : Signs n) : BddAbove (range (fun i => |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * H i (S k)|)) := by refine ⟨M, ?_⟩ rintro _ ⟨i, rfl⟩ exact absInner_le_of_bound H hM0 hH n S σ i
    Causalean.Stat.Concentration.absInner_bddAbove · Causalean/Stat/Concentration/Rademacher/Contraction/Absolute.lean:331
  • empiricalRademacherComplexity_sub_le theorem — Empirical Rademacher complexity is sub-additive over differences of classes. For classes F, G sharing the index ι, each with a uniform bound, the complexity of fun i x => F i x - G i x is at most the sum of the individual complexities.
    ι :
    Type u_1
    shared
    𝒳 :
    Type u_2
    shared
    Nonempty ι
    F G :
    ι → 𝒳 → ℝ
    MF MG :
    ℝ
    hMF0 :
    0 ≤ MF
    hMG0 :
    0 ≤ MG
    hF :
    ∀ i x, |F i x| ≤ MF
    hG :
    ∀ i x, |G i x| ≤ MG
    n :
    ℕ
    S :
    Fin n → 𝒳
    empiricalRademacherComplexity n (fun i x => F i x - G i x) S
    ≤ empiricalRademacherComplexity n F S + empiricalRademacherComplexity n G S
    Proof (Lean source)
    theorem empiricalRademacherComplexity_sub_le [Nonempty ι] (F G : ι → 𝒳 → ℝ) {MF MG : ℝ} (hMF0 : 0 ≤ MF) (hMG0 : 0 ≤ MG) (hF : ∀ i x, |F i x| ≤ MF) (hG : ∀ i x, |G i x| ≤ MG) (n : ℕ) (S : Fin n → 𝒳) : empiricalRademacherComplexity n (fun i x => F i x - G i x) S ≤ empiricalRademacherComplexity n F S + empiricalRademacherComplexity n G S := by classical unfold empiricalRademacherComplexity rw [← mul_add, ← Finset.sum_add_distrib] refine mul_le_mul_of_nonneg_left (Finset.sum_le_sum ?_) (by positivity) intro σ _ have hbddF := absInner_bddAbove F hMF0 hF n S σ have hbddG := absInner_bddAbove G hMG0 hG n S σ refine ciSup_le (fun i => ?_) have hsplit : (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (F i (S k) - G i (S k)) = ((n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k)) - ((n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * G i (S k)) := by rw [← mul_sub, ← Finset.sum_sub_distrib] refine congrArg _ (Finset.sum_congr rfl fun k _ => by ring) rw [hsplit] refine (abs_sub _ _).trans ?_ exact add_le_add (le_ciSup hbddF i) (le_ciSup hbddG i)
    Causalean.Stat.Concentration.empiricalRademacherComplexity_sub_le · Causalean/Stat/Concentration/Rademacher/Contraction/Absolute.lean:342
  • empiricalRademacherComplexity_contraction_abs_of_bddAbove theorem — Ledoux–Talagrand contraction over an arbitrary (possibly infinite) index. For an L-Lipschitz φ with φ 0 = 0 and a class F with a uniform bound M, R̂_n(φ ∘ F) ≤ 2L · R̂_n(F) for *any* nonempty index ι. The infinite-index case is reduced to the finite-index rademacher_contraction_abs by choosing, for each of the finitely many sign vectors, an ε-approximate maximizer; their finite collection is a finite subindex on which the Fintype contraction applies.
    ι :
    Type u_1
    shared
    𝒳 :
    Type u_2
    shared
    Nonempty ι
    φ :
    ℝ → ℝ
    L :
    ℝ
    hφ :
    F :
    ι → 𝒳 → ℝ
    M :
    ℝ
    hM0 :
    0 ≤ M
    hM :
    ∀ i x, |F i x| ≤ M
    n :
    ℕ
    S :
    Fin n → 𝒳
    empiricalRademacherComplexity n (fun i x => φ (F i x)) S
    ≤ 2 * L * empiricalRademacherComplexity n F S
    Proof (Lean source)
    theorem empiricalRademacherComplexity_contraction_abs_of_bddAbove [Nonempty ι] (φ : ℝ → ℝ) {L : ℝ} (hφ : LipschitzAt0 φ L) (F : ι → 𝒳 → ℝ) {M : ℝ} (hM0 : 0 ≤ M) (hM : ∀ i x, |F i x| ≤ M) (n : ℕ) (S : Fin n → 𝒳) : empiricalRademacherComplexity n (fun i x => φ (F i x)) S ≤ 2 * L * empiricalRademacherComplexity n F S := by classical have hL : 0 ≤ L := by have h := hφ.2 0 1 norm_num [hφ.1] at h exact (abs_nonneg _).trans h haveI hSigns : Nonempty (Signs n) := ⟨fun _ => ⟨1, by decide⟩⟩ -- uniform bound for the composed class `φ ∘ F` have hLM0 : 0 ≤ L * M := mul_nonneg hL hM0 have hφM : ∀ i x, |φ (F i x)| ≤ L * M := by intro i x have h := hφ.2 (F i x) 0 rw [hφ.1, sub_zero, sub_zero] at h exact h.trans (mul_le_mul_of_nonneg_left (hM i x) hL) have hcard : (0 : ℝ) < (card (Signs n) : ℝ) := by exact_mod_cast Fintype.card_pos (α := Signs n) refine le_of_forall_pos_le_add (fun ε hε => ?_) -- per-sign ε-approximate maximizers (explicit supremand form) have hex : ∀ σ : Signs n, ∃ i, (⨆ j, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ (F j (S k))|) - ε < |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ (F i (S k))| := by intro σ exact exists_lt_of_lt_ciSup (sub_lt_self _ hε) choose iσ hiσ using hex -- the finite subindex collecting all per-sign maximizers set T : Finset ι := Finset.image iσ Finset.univ with hT haveI : Nonempty {x // x ∈ T} := ⟨⟨iσ (Classical.arbitrary (Signs n)), Finset.mem_image.mpr ⟨_, Finset.mem_univ _, rfl⟩⟩⟩ -- Fintype contraction on the subindex `↥T` have hcontr := rademacher_contraction_abs (ι := {x // x ∈ T}) φ hφ (fun j => F j.val) n S -- (b) restricting the index only lowers the (with-abs) complexity have hb : empiricalRademacherComplexity n (fun j : {x // x ∈ T} => F j.val) S ≤ empiricalRademacherComplexity n F S := by unfold empiricalRademacherComplexity refine mul_le_mul_of_nonneg_left (Finset.sum_le_sum ?_) (by positivity) intro σ _ exact ciSup_le (fun j => le_ciSup (absInner_bddAbove F hM0 hM n S σ) j.val) -- (a) the ε-maximizers recover the full supremum up to ε have ha : empiricalRademacherComplexity n (fun i x => φ (F i x)) S ≤ empiricalRademacherComplexity n (fun (j : {x // x ∈ T}) x => φ (F j.val x)) S + ε := by unfold empiricalRademacherComplexity have hpt : ∀ σ : Signs n, (⨆ i, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ (F i (S k))|) ≤ (⨆ j : {x // x ∈ T}, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ (F j.val (S k))|) + ε := by intro σ have hmem : iσ σ ∈ T := Finset.mem_image.mpr ⟨σ, Finset.mem_univ _, rfl⟩ have hbddT : BddAbove (range (fun j : {x // x ∈ T} => |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ (F j.val (S k))|)) := Finite.bddAbove_range _ have hle := le_ciSup hbddT (⟨iσ σ, hmem⟩ : {x // x ∈ T}) have := hiσ σ linarith calc (card (Signs n) : ℝ)⁻¹ * ∑ σ : Signs n, ⨆ i, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ (F i (S k))| ≤ (card (Signs n) : ℝ)⁻¹ * ∑ σ : Signs n, ((⨆ j : {x // x ∈ T}, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ (F j.val (S k))|) + ε) := by refine mul_le_mul_of_nonneg_left (Finset.sum_le_sum fun σ _ => hpt σ) (by positivity) _ = (card (Signs n) : ℝ)⁻¹ * ∑ σ : Signs n, (⨆ j : {x // x ∈ T}, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ (F j.val (S k))|) + (card (Signs n) : ℝ)⁻¹ * (card (Signs n) : ℝ) * ε := by rw [Finset.sum_add_distrib, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] ring _ = (card (Signs n) : ℝ)⁻¹ * ∑ σ : Signs n, (⨆ j : {x // x ∈ T}, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ (F j.val (S k))|) + ε := by rw [inv_mul_cancel₀ (ne_of_gt hcard)]; ring calc empiricalRademacherComplexity n (fun i x => φ (F i x)) S ≤ empiricalRademacherComplexity n (fun (j : {x // x ∈ T}) x => φ (F j.val x)) S + ε := ha _ ≤ 2 * L * empiricalRademacherComplexity n (fun j : {x // x ∈ T} => F j.val) S + ε := by linarith [hcontr] _ ≤ 2 * L * empiricalRademacherComplexity n F S + ε := by nlinarith [mul_le_mul_of_nonneg_left hb (by linarith : (0:ℝ) ≤ 2 * L)]
    Causalean.Stat.Concentration.empiricalRademacherComplexity_contraction_abs_of_bddAbove · Causalean/Stat/Concentration/Rademacher/Contraction/Absolute.lean:370
Coordinatewise 4 core · 0 supporting This module gives the Ledoux--Talagrand contraction principle when the scalar contraction may depend on the sample coordinate. ★ rademacher_contraction_coordinatewise★ rademacher_contraction_abs_coordinatewise

Coordinatewise Rademacher contraction

This module gives the Ledoux--Talagrand contraction principle when the scalar contraction may depend on the sample coordinate. Thus the transformed signed sum contains σ k * φ k (F i (S k)), with a common Lipschitz constant but a different map φ k at every coordinate. The signed theorem has constant L; the absolute-value form has constant 2L.

def coordinateRademacherAverageWithoutAbs reviewed
Causalean.Stat.Concentration

Given a sample size, coordinatewise scalar maps, a function class, and a realized sample, the coordinatewise transformed signed Rademacher average averages the supremum of the signed transformed sums over all sign vectors.

Definition (Lean source)
ι :
Type u_1
shared
𝒳 :
Type u_2
shared
n :
ℕ
φ :
Fin n → ℝ → ℝ
F :
ι → 𝒳 → ℝ
S :
Fin n → 𝒳
coordinateRademacherAverageWithoutAbs n φ F S :
ℝ
(card (Signs n) : ℝ)⁻¹ * ∑ σ : Signs n, ⨆ i, (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ k (F i (S k))
Causalean.Stat.Concentration.coordinateRademacherAverageWithoutAbs · Causalean/Stat/Concentration/Rademacher/Contraction/Coordinatewise.lean:25
def coordinateRademacherAverage reviewed
Causalean.Stat.Concentration

Given a sample size, coordinatewise scalar maps, a function class, and a realized sample, the coordinatewise transformed absolute Rademacher average averages the supremum of the absolute signed transformed sums.

Definition (Lean source)
ι :
Type u_1
shared
𝒳 :
Type u_2
shared
n :
ℕ
φ :
Fin n → ℝ → ℝ
F :
ι → 𝒳 → ℝ
S :
Fin n → 𝒳
coordinateRademacherAverage n φ F S :
ℝ
(card (Signs n) : ℝ)⁻¹ * ∑ σ : Signs n, ⨆ i, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * φ k (F i (S k))|
Causalean.Stat.Concentration.coordinateRademacherAverage · Causalean/Stat/Concentration/Rademacher/Contraction/Coordinatewise.lean:34
theorem rademacher_contraction_coordinatewise reviewed
Causalean.Stat.Concentration

Coordinatewise Ledoux--Talagrand contraction, signed form. If the common constant is nonnegative and every coordinate map φ k is L-Lipschitz, then the coordinatewise transformed signed Rademacher average of the class F on S is at most L times its ordinary signed empirical Rademacher complexity.

Formal statement
ι :
Type u_1
shared
𝒳 :
Type u_2
shared
Nonempty ι
Finite ι
n :
ℕ
φ :
Fin n → ℝ → ℝ
L :
ℝ
hL :
0 ≤ L
hφ :
∀ k x y, |φ k x - φ k y| ≤ L * |x - y|
F :
ι → 𝒳 → ℝ
S :
Fin n → 𝒳
≤ L * empiricalRademacherComplexity_without_abs n F S
Proof (Lean source)
theorem rademacher_contraction_coordinatewise [Nonempty ι] [Finite ι] {n : ℕ} (φ : Fin n → ℝ → ℝ) {L : ℝ} (hL : 0 ≤ L) (hφ : ∀ k x y, |φ k x - φ k y| ≤ L * |x - y|) (F : ι → 𝒳 → ℝ) (S : Fin n → 𝒳) : coordinateRademacherAverageWithoutAbs n φ F S ≤ L * empiricalRademacherComplexity_without_abs n F S := by classical letI := ofFinite ι calc coordinateRademacherAverageWithoutAbs n φ F S = coordHybridAverage φ L F S 0 := (coordHybrid_zero φ L F S).symm _ ≤ coordHybridAverage φ L F S n := coordHybrid_zero_le_full φ hφ F S _ = empiricalRademacherComplexity_without_abs n (fun i x => L * F i x) S := coordHybrid_full φ L F S _ = L * empiricalRademacherComplexity_without_abs n F S := empiricalRademacherComplexity_without_abs_smul_class F L hL n S
theorem rademacher_contraction_abs_coordinatewise reviewed
Causalean.Stat.Concentration

Coordinatewise Ledoux--Talagrand contraction, absolute-value form. If every coordinate map fixes zero and is L-Lipschitz, then the coordinatewise transformed absolute Rademacher average of F on S is at most 2L times the ordinary absolute empirical Rademacher complexity.

Formal statement
ι :
Type u_1
shared
𝒳 :
Type u_2
shared
Nonempty ι
Finite ι
n :
ℕ
φ :
Fin n → ℝ → ℝ
L :
ℝ
hφ :
∀ k, LipschitzAt0 (φ k) L
F :
ι → 𝒳 → ℝ
S :
Fin n → 𝒳
coordinateRademacherAverage n φ F S ≤ 2 * L * empiricalRademacherComplexity n F S
Proof (Lean source)
theorem rademacher_contraction_abs_coordinatewise [Nonempty ι] [Finite ι] {n : ℕ} (φ : Fin n → ℝ → ℝ) {L : ℝ} (hφ : ∀ k, LipschitzAt0 (φ k) L) (F : ι → 𝒳 → ℝ) (S : Fin n → 𝒳) : coordinateRademacherAverage n φ F S ≤ 2 * L * empiricalRademacherComplexity n F S := by classical letI := ofFinite ι rcases Nat.eq_zero_or_pos n with rfl | hn · simp [coordinateRademacherAverage, empiricalRademacherComplexity] · have hL : 0 ≤ L := by have h := (hφ (⟨0, hn⟩ : Fin n)).2 0 1 rw [(hφ _).1] at h norm_num at h exact (abs_nonneg _).trans h let F₀ : Option ι → 𝒳 → ℝ := coordWithZero F have hsplit := coordinate_abs_le_signed_add_neg F₀ n φ S (fun k => by simp [F₀, coordWithZero, (hφ k).1]) have hpos : coordinateRademacherAverageWithoutAbs n φ F₀ S ≤ L * empiricalRademacherComplexity_without_abs n F₀ S := rademacher_contraction_coordinatewise φ hL (fun k => (hφ k).2) F₀ S have hneg : coordinateRademacherAverageWithoutAbs n (fun k x => -φ k x) F₀ S ≤ L * empiricalRademacherComplexity_without_abs n F₀ S := by apply rademacher_contraction_coordinatewise (fun k x => -φ k x) hL · intro k exact (lipschitzAt0_neg (φ k) (hφ k)).2 have hbase := signed_withZero_le_abs F n S calc coordinateRademacherAverage n φ F S = coordinateRademacherAverage n φ F₀ S := (coordinate_abs_withZero_eq F n φ (fun k => (hφ k).1) S).symm _ ≤ coordinateRademacherAverageWithoutAbs n φ F₀ S + coordinateRademacherAverageWithoutAbs n (fun k x => -φ k x) F₀ S := hsplit _ ≤ L * empiricalRademacherComplexity_without_abs n F₀ S + L * empiricalRademacherComplexity_without_abs n F₀ S := add_le_add hpos hneg _ = 2 * L * empiricalRademacherComplexity_without_abs n F₀ S := by ring _ ≤ 2 * L * empiricalRademacherComplexity n F S := mul_le_mul_of_nonneg_left hbase (by nlinarith)
Causalean.Stat.Concentration.rademacher_contraction_abs_coordinatewise · Causalean/Stat/Concentration/Rademacher/Contraction/Coordinatewise.lean:382 · uses LipschitzAt0 , coordinateRademacherAverage