Cslib.MachineLearning.PACLearning.vcDim
defimported Lean
The *Vapnik-Chervonenkis dimension* of a binary concept class C is the supremum of the cardinalities of finite sets shattered by C. Returns 0 when no finite set is shattered (i.e. the defining set is empty). Caveat: because sSup on ℕ returns 0 for unbounded sets, this definition is only meaningful when the VC dimension is finite — see HasFiniteVCDim.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Set in variable {α : Type*} in noncomputable def Cslib.MachineLearning.PACLearning.vcDim (C : ConceptClass α Bool) : ℕ
- Defined in
- CSLib, `Cslib.MachineLearning.PACLearning.vcDim`
- Lean proof
- By Samuel Schlesinger, from github.com/leanprover/cslib at
3951377e5a3f(Copyright (c) 2026 Samuel Schlesinger. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.Cslib.MachineLearning.PACLearning.vcDim← Cslib.MachineLearning.PACLearning.vcDim (Cslib/MachineLearning/PACLearning/VCDimension.lean:111): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Built on 2
- Cslib.MachineLearning.PACLearning.ConceptClassA *concept class* over domain
αwith label typeβis a set of functionsα → β. For binary classification (β = Bool), this is… - Cslib.MachineLearning.PACLearning.SetShattersA binary concept class
C*shatters* a setWif for every subsetW' ⊆ W, there exists a conceptc ∈ Cwhose positive set…
- Cslib.MachineLearning.PACLearning.ConceptClassA *concept class* over domain
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Set in variable {α : Type*} in /-- The *Vapnik-Chervonenkis dimension* of a binary concept class `C` is the supremum of the cardinalities of finite sets shattered by `C`. Returns `0` when no finite set is shattered (i.e. the defining set is empty). **Caveat**: because `sSup` on `ℕ` returns `0` for unbounded sets, this definition is only meaningful when the VC dimension is finite — see `HasFiniteVCDim`. -/ noncomputable def Cslib.MachineLearning.PACLearning.vcDim (C : ConceptClass α Bool) : ℕ := sSup {n : ℕ | ∃ W : Finset α, W.card = n ∧ SetShatters C (↑W)}