AFTD Auto-Formalizing Theoretical Domains

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.
Verified
08 Oct 2026
Axioms
none listed
Built on 2

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)}
See it in the graphDiscuss this resultChallenge it