Theorem 29.3(1), upper bound: uniform convergence with examples
ProvedUnderstandingML.multiclass_uc_upper_boundThis is the upper half of item 1 of the Multiclass Fundamental Theorem.
Let be a domain with a -algebra containing all singletons, let be a finite label set with (also with measurable singletons), and let be a class of measurable hypotheses with Natarajan dimension (Definition 29.2). The loss is the multiclass – loss . Assume moreover that is nonempty, has the countable-approximation property (Remark 3.1), and that .
There is an absolute constant (independent of , , and ) such that has the uniform convergence property (Definition 4.3) with sample complexity
That is, for all , every probability distribution over and every at least this number, a sample is -representative for (Definition 4.1) with probability at least .
Together with Corollary 4.4 this gives the agnostic upper bound of item 2 for every ERM learner.
Formalization Note The failure probability is an outer measure under the product law. The restriction is necessary: for the bound reaches as , and one example is not -representative.
import Definitions.Def_UnderstandingML_MulticlassLearnability open MeasureTheory open scoped InnerProductSpace
universe u v
namespace UnderstandingML
/-- **Theorem 29.3, part 1 (upper bound)** (p. 403). There is an absolute constant `C₂ > 0` such
that every nonempty measurable class `H` of functions from `X` to a finite label set `Y` with the
countable-approximation property and Natarajan dimension `d ≥ 1` has the uniform convergence
property (for the multiclass 0–1 loss) with sample complexity
`m^{UC}_H(ε, δ) ≤ ⌈C₂ (d log |Y| + log(1/δ))/ε²⌉`. -/
theorem multiclass_uc_upper_bound :
∃ C₂ : ℝ, 0 < C₂ ∧
∀ {X : Type u} {Y : Type v} [MeasurableSpace X] [MeasurableSingletonClass X]
[MeasurableSpace Y] [MeasurableSingletonClass Y] [Fintype Y]
(H : Set (X → Y)) (d : ℕ), H.Nonempty → (∀ h ∈ H, Measurable h) →
NPointwiseSeparable H → ndim H = d → 1 ≤ d →
HasUniformConvergenceWith lossMulti H (fun ε δ ↦
⌈C₂ * (d * Real.log (Fintype.card Y) + Real.log (1 / δ)) / ε ^ 2⌉₊) := by sorry
end UnderstandingML