Documentation

FLT_Proofs.PureMath.BinaryMatrix

Binary Matrix VC Dimension and Sauer-Shelah #

Pure combinatorics: VC dimension on binary matrices, bridged to Mathlib's Finset.Shatters infrastructure. No learning theory types.

@[reducible, inline]
abbrev BinaryMatrix (m n : ) :

An m x n binary matrix, represented as Fin m -> Fin n -> Bool.

Equations
Instances For
    def BinaryMatrix.shatters {m n : } (M : BinaryMatrix m n) (S : Finset (Fin n)) :

    A binary matrix M shatters a column set S if for every subset t ⊆ S, there is a row i whose true columns within S are exactly t.

    Equations
    Instances For

      Transpose of a binary matrix.

      Equations
      Instances For

        Convert a binary matrix to a Finset family: each row becomes the set of columns where that row is true.

        Equations
        Instances For
          noncomputable def BinaryMatrix.vcDim {m n : } (M : BinaryMatrix m n) :

          The VC dimension of a binary matrix, defined via the Mathlib Finset family.

          Equations
          Instances For

            Our shatters coincides with Mathlib's Finset.Shatters on the associated family.

            theorem BinaryMatrix.bool_fun_eq_of_filter_eq {n : } (f g : Fin nBool) (h : {j : Fin n | f j = true} = {j : Fin n | g j = true}) :
            f = g

            Two Bool-valued functions on Fin n that agree on which indices are true (as witnessed by equal univ.filter) are equal.

            Sauer-Shelah lemma for binary matrices: the number of distinct rows in the Finset family is bounded by the sum of binomial coefficients up to the VC dimension.

            Assouad's Dual VC Bound for Matrices #

            If M has VC dimension ≤ d, then M.transpose has VC dimension ≤ 2^(d+1) - 1.

            The proof uses the bitstring coding argument: index 2^(d+1) shattered rows by Fin (d+1) → Bool, extract d+1 columns via coordinate projections, and show these columns are shattered by M.

            theorem BinaryMatrix.transpose_shatters_imp_shatters {m n : } (M : BinaryMatrix m n) {d : } (S : Finset (Fin m)) (hS : M.transpose.shatters S) (hcard : 2 ^ (d + 1) S.card) :
            ∃ (T : Finset (Fin n)), T.card = d + 1 M.shatters T

            Auxiliary: if M.transpose shatters S ⊆ Fin m with |S| ≥ 2^(d+1), then M shatters some set of d+1 columns.

            theorem BinaryMatrix.assouad_transpose_vcDim {m n : } (M : BinaryMatrix m n) {d : } (hd : M.vcDim d) :
            M.transpose.vcDim 2 ^ (d + 1) - 1

            Assouad's dual VC bound (matrix form): if M has VC dimension ≤ d, then M.transpose has VC dimension ≤ 2^(d+1) - 1.

            This is the fundamental bridge between primal and dual shattering. Proved via the bitstring coding argument (Assouad 1983).