Catalog/VC/ShatterFunction/Contract.lean
1import Mathlib.Combinatorics.SetFamily.Shatter
2
3namespace Catalog.VC.ShatterFunction
4
5variable {ฮฑ : Type*} [DecidableEq ฮฑ]
6
7/-- The trace (restriction) of a set family `๐’œ` on a subset `Y`:
8 the family `{ S โˆฉ Y | S โˆˆ ๐’œ }` of distinct intersections. -/
9def trace (๐’œ : Finset (Finset ฮฑ)) (Y : Finset ฮฑ) : Finset (Finset ฮฑ) :=
10 ๐’œ.image (ยท โˆฉ Y)
11
12/-- The primal shatter function `ฯ€_๐’œ(m)`: the maximum number of distinct
13 traces of `๐’œ` on any `m`-element subset of the ground set. (Def 5.1) -/
14def shatterFun [Fintype ฮฑ] (๐’œ : Finset (Finset ฮฑ)) (m : โ„•) : โ„• :=
15 (Finset.univ.filter (fun Y : Finset ฮฑ => Y.card = m)).sup
16 (fun Y => (trace ๐’œ Y).card)
17
18end Catalog.VC.ShatterFunction
19