Documentation

FLT_Proofs.Complexity.Rademacher

Rademacher Complexity #

Measure-theoretic complexity measure. Upper bounds generalization error. Upper bounded by VC dimension. Bridges to lean-rademacher library (K₂).

Main results #

noncomputable def boolToSign (b : Bool) :

Convert Bool labels to ±1 reals. true ↦ 1, false ↦ -1.

Equations
Instances For
    theorem boolToSign_sq (b : Bool) :
    boolToSign b ^ 2 = 1
    @[reducible, inline]
    abbrev SignVector (m : ) :
    Equations
    Instances For
      noncomputable def rademacherCorrelation {X : Type u} {m : } (h : Concept X Bool) (σ : SignVector m) (xs : Fin mX) :
      Equations
      Instances For
        theorem rademacherCorrelation_abs_le_one {X : Type u} {m : } (hm : 0 < m) (h : Concept X Bool) (σ : SignVector m) (xs : Fin mX) :
        noncomputable def EmpiricalRademacherComplexity (X : Type u) (C : ConceptClass X Bool) {m : } (xs : Fin mX) :
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem empiricalRademacherComplexity_le_one (X : Type u) (C : ConceptClass X Bool) {m : } (hm : 0 < m) (xs : Fin mX) :
          noncomputable def RademacherComplexity (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) (D : MeasureTheory.Measure X) (m : ) :
          Equations
          Instances For
            theorem rademacher_gen_bound (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) (D : MeasureTheory.Measure X) [MeasureTheory.IsProbabilityMeasure D] (m : ) (hm : 0 < m) (c : Concept X Bool) (_hcC : c C) (ε : ) ( : 0 < ε) :
            ∃ (bound : ), bound = 2 * RademacherComplexity X C D m + ε bound 0

            Helpers for VCDim → Rademacher bound (Massart + Sauer-Shelah) #

            theorem exp_mul_sup'_le_sum {ι : Type u_1} [DecidableEq ι] (s : Finset ι) (hs : s.Nonempty) (f : ι) (t : ) (_ht : 0 t) :
            Real.exp (t * s.sup' hs f) is, Real.exp (t * f i)

            Soft-max bound: exp(t · Finset.sup') ≤ Σ exp(t · f_i).

            theorem cosh_le_exp_sq_half (x : ) :

            cosh(x) ≤ exp(x²/2). Standard sub-Gaussian bound.

            theorem rademacher_mgf_bound {m : } (hm : 0 < m) (a : Fin m) (c : ) (_hc : 0 c) (ha : ∀ (i : Fin m), |a i| c) (t : ) (_ht : 0 t) :
            1 / (Fintype.card (SignVector m)) * σ : SignVector m, Real.exp (t * (1 / m * i : Fin m, a i * boolToSign (σ i))) Real.exp (t ^ 2 * c ^ 2 / (2 * m))

            Rademacher MGF bound.

            theorem finite_massart_lemma {m : } (_hm : 0 < m) {N : } (hN : 0 < N) (Z : Fin NSignVector m) (σ_param : ) ( : 0 < σ_param) (h_mgf : ∀ (j : Fin N) (t : ), 0 t1 / (Fintype.card (SignVector m)) * sv : SignVector m, Real.exp (t * Z j sv) Real.exp (t ^ 2 * σ_param ^ 2 / 2)) :
            (1 / (Fintype.card (SignVector m)) * sv : SignVector m, Finset.univ.sup' fun (j : Fin N) => Z j sv) σ_param * (2 * Real.log N)

            Massart finite lemma: E_σ[max_{j ≤ N} Z_j] ≤ σ√(2 log N).

            Helper lemmas for Sauer-Shelah exponential bound #

            theorem sum_choose_le_exp_pow (d m : ) (hd : 0 < d) (hdm : d m) :
            iFinset.range (d + 1), (m.choose i) (Real.exp 1 * m / d) ^ d

            Pure combinatorial inequality: ∑_{i=0}^d C(m,i) ≤ (em/d)^d for d ≤ m, d ≥ 1.

            theorem sauer_shelah_exp_bound {X : Type u} (C : ConceptClass X Bool) (d m : ) (hd : 0 < d) (hdm : d m) (hvc : VCDim X C = d) :
            (GrowthFunction X C m) (Real.exp 1 * m / d) ^ d

            Sauer-Shelah exponential bound: GrowthFunction(C,m) ≤ (em/d)^d.

            VCDim → Rademacher bound #

            theorem vcdim_bounds_rademacher_quantitative (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) (D : MeasureTheory.Measure X) (m : ) (hm : 0 < m) (d : ) (hd : VCDim X C = d) (hd_pos : 0 < d) (hdm : d m) [MeasureTheory.IsProbabilityMeasure (MeasureTheory.Measure.pi fun (x : Fin m) => D)] :
            RademacherComplexity X C D m (2 * d * Real.log (Real.exp 1 * m / d) / m)

            VC dimension upper bounds Rademacher complexity: Rad ≤ √(2d·log(em/d)/m).

            The proof decomposes into: (1) Pointwise: EmpRad(xs) ≤ B for all xs [Massart + Sauer-Shelah] (2) Integral: Rad = ∫ EmpRad ≤ ∫ B = B [probability measure]

            Step (2) is proved. Step (1) for B ≥ 1 follows from EmpRad ≤ 1. Step (1) for B < 1 requires Massart finite lemma + Sauer-Shelah growth bound.

            Rademacher ↔ PAC #

            theorem rademacher_lower_bound_on_shattered (X : Type u) [MeasurableSpace X] [MeasurableSingletonClass X] (C : ConceptClass X Bool) (T : Finset X) (hT : Shatters X C T) (m : ) (hm : 0 < m) (hT_large : 4 * m ^ 2 + 1 T.card) :

            Adversarial Rademacher lower bound on shattered sets. For |T| >= 4m^2 + 1, exists D with Rad_m(C,D) >= 1/2.

            Proof: D = uniform on T. Product measure = uniform on T^m. On injective samples from T (shattered): EmpRad = 1 (by empRad_eq_one_of_injective_in_shattered). EmpRad ≥ 0 everywhere (by empRad_nonneg). Birthday bound: P[injective m draws from n ≥ 4m²+1 points] ≥ 1 - m(m-1)/(2n) ≥ 7/8 ≥ 1/2. So ∫ EmpRad ≥ P[injective] · 1 + P[¬injective] · 0 ≥ 1/2.

            theorem vcdim_finite_imp_rademacher_vanishing (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) (hvcdim : VCDim X C < ) (ε : ) :
            ε > 0∃ (m₀ : ), ∀ (D : MeasureTheory.Measure X), MeasureTheory.IsProbabilityMeasure Dmm₀, RademacherComplexity X C D m < ε

            VCDim finite → Rademacher vanishes uniformly. The bound m₀ depends only on d and ε, NOT on D.