Corollary 3.19 — VC-dimension generalization bound (; goal)
DisprovedFoundationsML.RademacherVC.vc_dimension_generalization_bound_v2Statement (Corollary 3.19, p. 42, PDF p. 59). Let be a family of (measurable) functions taking values in with VC-dimension , and a (measurable) target concept. Then, for any , with probability at least over an i.i.d. sample of size , , the following holds for all :
Formalization Note. The retired version allowed , where every sample-dependent term is Lean's and the bound is false. New statement: and (standing conventions); kept as the domain of Corollary 3.18 ("for all ") through which the bound is proved; the book's standing measurability (Definition 2.1, footnote 2, p. 10) of and of every made explicit (Bool carries the discrete σ-algebra, so the error events are measurable). is Set (X → Bool), HasVCDim H d is the chapter's VC-dimension predicate, is Real.exp 1 * m / d. For with the VC term is Lean's ; this is harmless since forces to be a single function and the bound reduces to Hoeffding's.
import Mathlib import Definitions.Def_FoundationsML_RademacherVC_GeneralizationError import Definitions.Def_FoundationsML_RademacherVC_EmpiricalError import Definitions.Def_FoundationsML_RademacherVC_HasVCDim open MeasureTheory
namespace FoundationsML.RademacherVC
/-- Corollary 3.19 (VC-dimension generalization bound; goal; Mohri, Rostamizadeh &
Talwalkar, *Foundations of Machine Learning*, 2nd ed., MIT Press 2018, p. 42, PDF p. 59).
Let `H` be a family of functions taking values in `{−1,+1}` (here: `Bool`) with VC-dimension
`d`. Then, for any `δ > 0`, with probability at least `1 − δ` over an i.i.d. sample of size
`m ≥ 1` (`m ≥ d`), the following holds for all `h ∈ H`:
`R(h) ≤ R̂_S(h) + sqrt(2d log(em/d)/m) + sqrt(log(1/δ)/(2m))`.
**Formalization Note.** Replaces `vc_dimension_generalization_bound`, which allowed
`d = m = 0` (every sample-dependent term is then Lean's `x / 0 = 0`). Now `m ≥ 1` and
`δ ∈ (0,1)` (the book's standing conventions); `d ≤ m` is kept as the domain of Corollary 3.18
(`for all m ≥ d`) through which the bound is proved. The book's standing measurability
assumption (Definition 2.1, footnote 2, p. 10) on the target `c` and on every `h ∈ H` is made
explicit (`Bool` carries the discrete σ-algebra, so the error events are then measurable).
`em/d` is `Real.exp 1 * m / d`. -/
theorem vc_dimension_generalization_bound_v2
{X : Type*} [MeasurableSpace X] (D : Measure X) [IsProbabilityMeasure D]
(H : Set (X → Bool)) (d : ℕ) (hH : HasVCDim H d) (hH_meas : ∀ h ∈ H, Measurable h)
(c : X → Bool) (hc_meas : Measurable c)
(m : ℕ) (hm0 : 0 < m) (hm : d ≤ m) (δ : ℝ) (hδ : 0 < δ) (hδ1 : δ < 1) :
(1 - δ) ≤ (Measure.pi (fun _ : Fin m => D)
{S : Fin m → X | ∀ h ∈ H, GeneralizationError D c h ≤
EmpiricalError S c h +
Real.sqrt (2 * d * Real.log (Real.exp 1 * m / d) / m) +
Real.sqrt (Real.log (1 / δ) / (2 * m))}).toReal := by sorry
end FoundationsML.RademacherVC