Documentation

AddCombi.VCDim.SetFamily.Defs

VC dimension #

This file defines shattering and the VC dimension of set families, and proves Pajor's inequality and the Sauer-Shelah lemma for arbitrary set families.

Main definitions #

Main statements #

References #

def Shatters {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] (๐’œ : Set ฮฑ) (A : ฮฑ) :

A set family ๐’œ shatters a set A if all subsets of A can be obtained as the intersection of A with some element of the set family. We also say that A is traced by ๐’œ.

Equations
  • Shatters ๐’œ A = โˆ€ โฆƒB : ฮฑโฆ„, B โ‰ค A โ†’ โˆƒ C โˆˆ ๐’œ, A โŠ“ C = B
Instances For
    theorem Shatters.mono {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] {๐’œ โ„ฌ : Set ฮฑ} {A : ฮฑ} (h : ๐’œ โІ โ„ฌ) (h๐’œ : Shatters ๐’œ A) :
    Shatters โ„ฌ A
    theorem Shatters.anti {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] {๐’œ : Set ฮฑ} {A B : ฮฑ} (h : A โ‰ค B) (hB : Shatters ๐’œ B) :
    Shatters ๐’œ A
    theorem Shatters.exists_ge {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] {๐’œ : Set ฮฑ} {A : ฮฑ} (h : Shatters ๐’œ A) :
    โˆƒ B โˆˆ ๐’œ, A โ‰ค B
    theorem Shatters.of_forall_le {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] {๐’œ : Set ฮฑ} {A : ฮฑ} (h : โˆ€ B โ‰ค A, B โˆˆ ๐’œ) :
    Shatters ๐’œ A
    theorem Shatters.nonempty {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] {๐’œ : Set ฮฑ} {A : ฮฑ} (h : Shatters ๐’œ A) :
    ๐’œ.Nonempty
    theorem Shatters.le_iff {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] {๐’œ : Set ฮฑ} {A B : ฮฑ} (h : Shatters ๐’œ A) :
    B โ‰ค A โ†” โˆƒ C โˆˆ ๐’œ, A โŠ“ C = B
    theorem shatters_iff_image_inf_eq_Iic {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] {๐’œ : Set ฮฑ} {A : ฮฑ} :
    Shatters ๐’œ A โ†” (fun (x : ฮฑ) => A โŠ“ x) '' ๐’œ = Set.Iic A
    theorem Shatters.univ {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] {A : ฮฑ} :
    @[simp]
    theorem shatters_bot {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] {๐’œ : Set ฮฑ} [OrderBot ฮฑ] :
    Shatters ๐’œ โŠฅ โ†” ๐’œ.Nonempty
    @[simp]
    theorem shatters_top {ฮฑ : Type u_1} [SemilatticeInf ฮฑ] {๐’œ : Set ฮฑ} [OrderTop ฮฑ] :
    Shatters ๐’œ โŠค โ†” ๐’œ = Set.univ
    theorem Shatters.preimage_compl {ฮฑ : Type u_1} [BooleanAlgebra ฮฑ] {๐’œ : Set ฮฑ} {A : ฮฑ} (hA : Shatters ๐’œ A) :
    Shatters ((fun (x : ฮฑ) => xแถœ) โปยน' ๐’œ) A
    @[simp]
    theorem shatters_preimage_compl {ฮฑ : Type u_1} [BooleanAlgebra ฮฑ] {๐’œ : Set ฮฑ} {A : ฮฑ} :
    Shatters ((fun (x : ฮฑ) => xแถœ) โปยน' ๐’œ) A โ†” Shatters ๐’œ A
    @[simp]
    theorem shatters_image_compl {ฮฑ : Type u_1} [BooleanAlgebra ฮฑ] {๐’œ : Set ฮฑ} {A : ฮฑ} :
    Shatters ((fun (x : ฮฑ) => xแถœ) '' ๐’œ) A โ†” Shatters ๐’œ A
    theorem Shatters.image_compl {ฮฑ : Type u_1} [BooleanAlgebra ฮฑ] {๐’œ : Set ฮฑ} {A : ฮฑ} :
    Shatters ๐’œ A โ†’ Shatters ((fun (x : ฮฑ) => xแถœ) '' ๐’œ) A

    Alias of the reverse direction of shatters_image_compl.

    @[instance_reducible]
    instance instDecidablePredFinsetShattersCoe {ฮฑ : Type u_1} [DecidableEq ฮฑ] {๐’œ : Finset (Finset ฮฑ)} :
    DecidablePred (Shatters โ†‘๐’œ)
    Equations
    theorem Shatters.subset {ฮฑ : Type u_1} {๐’œ : Set (Set ฮฑ)} {A B : Set ฮฑ} (h : A โІ B) (hB : Shatters ๐’œ B) :
    Shatters ๐’œ A
    @[simp]
    theorem shatters_singleton {ฮฑ : Type u_1} {๐’œ : Set (Set ฮฑ)} {x : ฮฑ} :
    Shatters ๐’œ {x} โ†” (โˆƒ C โˆˆ ๐’œ, x โˆ‰ C) โˆง โˆƒ C โˆˆ ๐’œ, x โˆˆ C

    ๐’œ shatters the singleton {x} exactly when some member of ๐’œ contains x and some member of ๐’œ misses it.

    theorem shatters_iff_le_ncard_image_inter {ฮฑ : Type u_1} {๐’œ : Set (Set ฮฑ)} {A : Set ฮฑ} (hA : A.Finite) :
    Shatters ๐’œ A โ†” 2 ^ A.ncard โ‰ค ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).ncard
    noncomputable def vcGrowth {ฮฑ : Type u_1} (n : โ„•) (๐’œ : Set (Set ฮฑ)) :

    The growth of a set family is the maximum number of sets it cuts out from any set of size at most n.

    Equations
    Instances For
      theorem vcGrowth_le_iff {ฮฑ : Type u_1} {n : โ„•} {๐’œ : Set (Set ฮฑ)} {d : โ„•} :
      vcGrowth n ๐’œ โ‰ค d โ†” โˆ€ โฆƒA : Set ฮฑโฆ„, A.Finite โ†’ A.ncard โ‰ค n โ†’ ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).ncard โ‰ค d
      theorem vcGrowth_lt_iff {ฮฑ : Type u_1} {n : โ„•} {๐’œ : Set (Set ฮฑ)} {d : โ„•} :
      vcGrowth n ๐’œ < d โ†” โˆ€ โฆƒA : Set ฮฑโฆ„, A.Finite โ†’ A.ncard โ‰ค n โ†’ ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).ncard < d
      theorem ncard_image_inter_le_vcGrowth {ฮฑ : Type u_1} {n : โ„•} {๐’œ : Set (Set ฮฑ)} {A : Set ฮฑ} (hA : A.Finite) (hAn : A.ncard โ‰ค n) :
      ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).ncard โ‰ค vcGrowth n ๐’œ
      theorem vcGrowth_mono {ฮฑ : Type u_1} {m n : โ„•} {๐’œ โ„ฌ : Set (Set ฮฑ)} (h๐’œโ„ฌ : ๐’œ โІ โ„ฌ) (hmn : m โ‰ค n) :
      vcGrowth m ๐’œ โ‰ค vcGrowth n โ„ฌ
      theorem vcGrowth_union_le {ฮฑ : Type u_1} {n : โ„•} {๐’œ โ„ฌ : Set (Set ฮฑ)} :
      vcGrowth n (๐’œ โˆช โ„ฌ) โ‰ค vcGrowth n ๐’œ + vcGrowth n โ„ฌ
      theorem vcGrowth_infs_le {ฮฑ : Type u_1} {n : โ„•} {๐’œ โ„ฌ : Set (Set ฮฑ)} :
      vcGrowth n (๐’œ โŠผ โ„ฌ) โ‰ค vcGrowth n ๐’œ * vcGrowth n โ„ฌ
      @[simp]
      theorem vcGrowth_image_compl {ฮฑ : Type u_1} {n : โ„•} {๐’œ : Set (Set ฮฑ)} :
      vcGrowth n ((fun (x : Set ฮฑ) => xแถœ) '' ๐’œ) = vcGrowth n ๐’œ
      @[simp]
      theorem vcGrowth_preimage_compl {ฮฑ : Type u_1} {n : โ„•} {๐’œ : Set (Set ฮฑ)} :
      vcGrowth n ((fun (x : Set ฮฑ) => xแถœ) โปยน' ๐’œ) = vcGrowth n ๐’œ
      theorem vcGrowth_sups_le {ฮฑ : Type u_1} {n : โ„•} {๐’œ โ„ฌ : Set (Set ฮฑ)} :
      vcGrowth n (๐’œ โŠป โ„ฌ) โ‰ค vcGrowth n ๐’œ * vcGrowth n โ„ฌ
      def HasVCDimLE {ฮฑ : Type u_1} (d : โ„•) (๐’œ : Set (Set ฮฑ)) :

      A set family ๐’œ has VC dimension at most d if all the sets it shatters have size at most d.

      Equations
      Instances For
        theorem HasVCDimLE.anti {ฮฑ : Type u_1} {d : โ„•} {๐’œ โ„ฌ : Set (Set ฮฑ)} (hโ„ฌ๐’œ : โ„ฌ โІ ๐’œ) (hd : HasVCDimLE d ๐’œ) :
        HasVCDimLE d โ„ฌ
        theorem HasVCDimLE.mono {ฮฑ : Type u_1} {dโ‚ dโ‚‚ : โ„•} {๐’œ : Set (Set ฮฑ)} (hd : dโ‚ โ‰ค dโ‚‚) :
        HasVCDimLE dโ‚ ๐’œ โ†’ HasVCDimLE dโ‚‚ ๐’œ
        @[simp]
        theorem hasVCDimLE_image_compl {ฮฑ : Type u_1} {d : โ„•} {๐’œ : Set (Set ฮฑ)} :
        HasVCDimLE d ((fun (x : Set ฮฑ) => xแถœ) '' ๐’œ) โ†” HasVCDimLE d ๐’œ
        @[simp]
        theorem hasVCDimLE_preimage_compl {ฮฑ : Type u_1} {d : โ„•} {๐’œ : Set (Set ฮฑ)} :
        HasVCDimLE d ((fun (x : Set ฮฑ) => xแถœ) โปยน' ๐’œ) โ†” HasVCDimLE d ๐’œ
        theorem HasVCDimLE.of_image_compl {ฮฑ : Type u_1} {d : โ„•} {๐’œ : Set (Set ฮฑ)} :
        HasVCDimLE d ((fun (x : Set ฮฑ) => xแถœ) '' ๐’œ) โ†’ HasVCDimLE d ๐’œ

        Alias of the forward direction of hasVCDimLE_image_compl.

        theorem HasVCDimLE.image_compl {ฮฑ : Type u_1} {d : โ„•} {๐’œ : Set (Set ฮฑ)} :
        HasVCDimLE d ๐’œ โ†’ HasVCDimLE d ((fun (x : Set ฮฑ) => xแถœ) '' ๐’œ)

        Alias of the reverse direction of hasVCDimLE_image_compl.

        theorem HasVCDimLE.preimage_compl {ฮฑ : Type u_1} {d : โ„•} {๐’œ : Set (Set ฮฑ)} :
        HasVCDimLE d ๐’œ โ†’ HasVCDimLE d ((fun (x : Set ฮฑ) => xแถœ) โปยน' ๐’œ)

        Alias of the reverse direction of hasVCDimLE_preimage_compl.

        theorem HasVCDimLE.of_preimage_compl {ฮฑ : Type u_1} {d : โ„•} {๐’œ : Set (Set ฮฑ)} :
        HasVCDimLE d ((fun (x : Set ฮฑ) => xแถœ) โปยน' ๐’œ) โ†’ HasVCDimLE d ๐’œ

        Alias of the forward direction of hasVCDimLE_preimage_compl.

        theorem notMem_of_forall_notMem {ฮฑ : Type u_1} {๐’œ : Set (Set ฮฑ)} {B : Set ฮฑ} {x : ฮฑ} (h๐’œ : โˆ€ C โˆˆ ๐’œ, x โˆ‰ C) (hB : Shatters ๐’œ B) :
        x โˆ‰ B

        A family whose members all avoid x shatters only sets avoiding x.

        theorem notMem_of_forall_mem {ฮฑ : Type u_1} {๐’œ : Set (Set ฮฑ)} {B : Set ฮฑ} {x : ฮฑ} (h๐’œ : โˆ€ C โˆˆ ๐’œ, x โˆˆ C) (hB : Shatters ๐’œ B) :
        x โˆ‰ B

        A family whose members all contain x shatters only sets avoiding x.

        theorem Shatters.insert {ฮฑ : Type u_1} {๐’œ : Set (Set ฮฑ)} {B : Set ฮฑ} {x : ฮฑ} (hโ‚€ : Shatters {C : Set ฮฑ | C โˆˆ ๐’œ โˆง x โˆ‰ C} B) (hโ‚ : Shatters {C : Set ฮฑ | C โˆˆ ๐’œ โˆง x โˆˆ C} B) :
        Shatters ๐’œ (insert x B)

        If B is shattered both by the members of ๐’œ avoiding x and by the members of ๐’œ containing x, then ๐’œ shatters insert x B.

        theorem infinite_ofPred_shatters {ฮฑ : Type u_1} {๐’œ : Set (Set ฮฑ)} {A : Set ฮฑ} (h : ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).Infinite) :
        {B : Set ฮฑ | B โІ A โˆง Shatters ๐’œ B}.Infinite

        A family with infinitely many traces on A shatters infinitely many subsets of A.

        theorem ncard_image_inter_le_two_pow_ncard_shatters_singleton {ฮฑ : Type u_1} {๐’œ : Set (Set ฮฑ)} {A : Set ฮฑ} (h : {x : ฮฑ | x โˆˆ A โˆง Shatters ๐’œ {x}}.Finite) :
        ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).ncard โ‰ค 2 ^ {x : ฮฑ | x โˆˆ A โˆง Shatters ๐’œ {x}}.ncard

        If only finitely many, say k, points of A have their singleton shattered by ๐’œ, then ๐’œ has at most 2 ^ k traces on A.

        theorem encard_image_inter_le_encard_shatters {ฮฑ : Type u_1} {๐’œ : Set (Set ฮฑ)} {A : Set ฮฑ} :
        ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).encard โ‰ค {B : Set ฮฑ | B โІ A โˆง Shatters ๐’œ B}.encard

        Pajor's inequality: the traces of ๐’œ on A are at most as many as the subsets of A shattered by ๐’œ. Since encard counts every infinite set as โŠค, when there are infinitely many traces this says only that ๐’œ shatters infinitely many subsets of A.

        theorem ncard_image_inter_le_ncard_shatters {ฮฑ : Type u_1} {๐’œ : Set (Set ฮฑ)} {A : Set ฮฑ} (hA : A.Finite) :
        ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).ncard โ‰ค {B : Set ฮฑ | B โІ A โˆง Shatters ๐’œ B}.ncard

        Pajor's inequality on a finite set A: the traces of ๐’œ on A are at most as many as the subsets of A that ๐’œ shatters.

        theorem HasVCDimLE.finite_of_shatters {ฮฑ : Type u_1} {d : โ„•} {๐’œ : Set (Set ฮฑ)} {B : Set ฮฑ} (h๐’œ : HasVCDimLE d ๐’œ) (hB : Shatters ๐’œ B) :

        A family of VC dimension at most d shatters no infinite set.

        theorem HasVCDimLE.ncard_le_of_shatters {ฮฑ : Type u_1} {d : โ„•} {๐’œ : Set (Set ฮฑ)} {B : Set ฮฑ} (h๐’œ : HasVCDimLE d ๐’œ) (hB : Shatters ๐’œ B) :

        A family of VC dimension at most d shatters only sets of size at most d.

        theorem HasVCDimLE.ncard_image_inter_le {ฮฑ : Type u_1} {n d : โ„•} {๐’œ : Set (Set ฮฑ)} {A : Set ฮฑ} (h๐’œ : HasVCDimLE d ๐’œ) (hA : A.Finite) (hAn : A.ncard โ‰ค n) :
        ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).ncard โ‰ค โˆ‘ k โ‰ค d, n.choose k

        The Sauer-Shelah inequality: a family of VC dimension at most d traces at most โˆ‘ k โ‰ค d, n.choose k sets on any finite set of size at most n.

        theorem exists_shatters_of_lt_ncard_image_inter {ฮฑ : Type u_1} {n d : โ„•} {๐’œ : Set (Set ฮฑ)} {A : Set ฮฑ} (hA : A.Finite) (hAn : A.ncard โ‰ค n) (h : โˆ‘ k โ‰ค d, n.choose k < ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).ncard) :
        โˆƒ B โІ A, d < B.ncard โˆง Shatters ๐’œ B

        The extraction form of the Sauer-Shelah inequality: a family tracing more than โˆ‘ k โ‰ค d, n.choose k sets on a finite A of size at most n shatters a subset of A of size greater than d.

        theorem HasVCDimLE.vcGrowth_le {ฮฑ : Type u_1} {n d : โ„•} {๐’œ : Set (Set ฮฑ)} (h๐’œ : HasVCDimLE d ๐’œ) :
        vcGrowth n ๐’œ โ‰ค โˆ‘ k โ‰ค d, n.choose k

        The Sauer-Shelah lemma for the growth function: if ๐’œ has VC dimension at most d, then vcGrowth n ๐’œ, the largest number of sets ๐’œ cuts out from a set of size at most n, is at most โˆ‘ k โ‰ค d, n.choose k.

        theorem HasVCDimLE.vcGrowth_le_exp {ฮฑ : Type u_1} {n d : โ„•} {๐’œ : Set (Set ฮฑ)} (h๐’œ : HasVCDimLE d ๐’œ) (hdn : d โ‰ค n) :
        โ†‘(vcGrowth n ๐’œ) โ‰ค (Real.exp 1 / โ†‘d * โ†‘n) ^ d

        The Sauer-Shelah bound: the growth function of a family of VC dimension at most d is at most (exp 1 / d * n) ^ d, for d โ‰ค n.

        theorem HasVCDimLE.infs {ฮฑ : Type u_1} {dโ‚ dโ‚‚ : โ„•} {๐’œ โ„ฌ : Set (Set ฮฑ)} (h๐’œ : HasVCDimLE dโ‚ ๐’œ) (hโ„ฌ : HasVCDimLE dโ‚‚ โ„ฌ) :
        HasVCDimLE (5 * (dโ‚ + dโ‚‚)) (๐’œ โŠผ โ„ฌ)

        If ๐’œ and โ„ฌ have VC dimension at most dโ‚ and dโ‚‚ respectively, then ๐’œ โŠผ โ„ฌ has VC dimension at most 5 * (dโ‚ + dโ‚‚).

        theorem HasVCDimLE.sups {ฮฑ : Type u_1} {dโ‚ dโ‚‚ : โ„•} {๐’œ โ„ฌ : Set (Set ฮฑ)} (h๐’œ : HasVCDimLE dโ‚ ๐’œ) (hโ„ฌ : HasVCDimLE dโ‚‚ โ„ฌ) :
        HasVCDimLE (5 * (dโ‚ + dโ‚‚)) (๐’œ โŠป โ„ฌ)

        If ๐’œ and โ„ฌ have VC dimension at most dโ‚ and dโ‚‚ respectively, then ๐’œ โŠป โ„ฌ has VC dimension at most 5 * (dโ‚ + dโ‚‚).

        theorem vcGrowth_le_iff' {ฮฑ : Type u_1} {n : โ„•} {๐’œ : Set (Set ฮฑ)} [Infinite ฮฑ] {d : โ„•} :
        vcGrowth n ๐’œ โ‰ค d โ†” โˆ€ โฆƒA : Set ฮฑโฆ„, A.Finite โ†’ A.ncard = n โ†’ ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).ncard โ‰ค d
        theorem vcGrowth_lt_iff' {ฮฑ : Type u_1} {n : โ„•} {๐’œ : Set (Set ฮฑ)} [Infinite ฮฑ] {d : โ„•} :
        vcGrowth n ๐’œ < d โ†” โˆ€ โฆƒA : Set ฮฑโฆ„, A.Finite โ†’ A.ncard = n โ†’ ((fun (x : Set ฮฑ) => A โˆฉ x) '' ๐’œ).ncard < d
        theorem hasVCDimLE_iff_vcGrowth {ฮฑ : Type u_1} {d : โ„•} {๐’œ : Set (Set ฮฑ)} [Infinite ฮฑ] :
        HasVCDimLE d ๐’œ โ†” vcGrowth (d + 1) ๐’œ < 2 ^ (d + 1)