Documentation

FLT_Proofs.Complexity.Compression

Moran-Yehudayoff Compression Theorem #

Finite VC dimension ↔ compression scheme with finite side information.

Architecture #

The forward direction (VCDim < ⊤ → compression) uses the Moran-Yehudayoff construction:

  1. A proper finite-support learner (from VC + Sauer-Shelah + probabilistic method)
  2. A hypothesis envelope (finite image of the learner on bounded subsamples)
  3. An approximate minimax strategy on the agreement game
  4. Sparse approximation via VC ε-approximation on agreement tests
  5. Majority vote reconstruction with incidence side information

The reverse direction (compression → VCDim < ⊤) is by pigeonhole on the bounded set of (kernel, info) pairs.

No Measure Theory #

The forward theorem is pure and combinatorial. It uses FinitePMF, Finset, and finite games — no MeasureTheory.Measure, IsProbabilityMeasure, Measure.dirac, or MeasurableSpace hypotheses.

Helper definitions #

noncomputable def pointSupport {X : Type u} {m : } (S : Fin mX × Bool) :

Extract the domain points from a labeled sample.

Equations
Instances For
    noncomputable def labeledSampleOfFinset {X : Type u} (c : XBool) (Z : Finset X) :
    Fin Z.cardX × Bool

    Build a labeled sample from a Finset of points and a concept.

    Equations
    Instances For
      def supportError {X : Type u} (Y : Finset X) (q : FinitePMF Y) (h c : XBool) :

      Weighted error of hypothesis h vs concept c over a FinitePMF on Y.

      Equations
      Instances For
        theorem supportAgreement_eq_one_sub_supportError {X : Type u} (Y : Finset X) (q : FinitePMF Y) (h c : XBool) :
        (∑ y : Y, q.prob y * if h y = c y then 1 else 0) = 1 - supportError Y q h c

        Weighted agreement = 1 - supportError.

        theorem supportError_nonneg {X : Type u} (Y : Finset X) (q : FinitePMF Y) (h c : XBool) :
        0 supportError Y q h c

        supportError is nonneg.

        theorem supportError_le_one {X : Type u} (Y : Finset X) (q : FinitePMF Y) (h c : XBool) :
        supportError Y q h c 1

        supportError is at most 1.

        Structure: Proper Finite-Support Learner #

        A proper finite-support learner for a concept class C. This structure captures the existence of a bounded-support ERM with error at most 1/3 for any C-realizable finite distribution. CORRECTED: good_on_support returns Finset X (not Fin k → X).

        Instances For

          Finite VC dimension implies existence of a proper finite-support learner. The construction uses ERM + finite_support_vc_approx on the disagreement family.

          Hypothesis Envelope #

          def boundedSubsamples {X : Type u} (Y : Finset X) (s : ) :

          Bounded subsamples: all subsets of Y with cardinality ≤ s.

          Equations
          Instances For
            noncomputable def hypothesisEnvelope {X : Type u} {C : ConceptClass X Bool} (L : ProperFiniteSupportLearner X C) (c : XBool) (Y : Finset X) :
            Finset (XBool)

            The hypothesis envelope: the finite set of all possible learner outputs on bounded subsamples of Y, labeled by concept c.

            Equations
            Instances For
              theorem hypothesisEnvelope_sub {X : Type u} {C : ConceptClass X Bool} (L : ProperFiniteSupportLearner X C) (c : XBool) (Y : Finset X) (h : XBool) (hh : h hypothesisEnvelope L c Y) :
              h C

              Every hypothesis in the envelope is in C.

              Agreement Tests #

              def agreeTest {X : Type u} (c : XBool) (x : X) (HY : Finset (XBool)) :
              HYBool

              Per-point agreement test: for a fixed point x ∈ Y and concept c, maps hypothesis h to whether h(x) = c(x).

              Equations
              Instances For
                def agreeTests {X : Type u} (c : XBool) (Y : Finset X) (HY : Finset (XBool)) :
                Finset (HYBool)

                The family of agreement tests over all points in Y.

                Equations
                Instances For

                  Roundtrip helpers for the compression proof #

                  noncomputable def encodeWitnessInfo {X : Type u} [DecidableEq X] (kernel : Finset (X × Bool)) (c : XBool) (K : ) (W : Finset X) :

                  Encode a witness set W as the set of kernel positions of the pairs (x, c x). The bound kernel.card ≤ K is fed into the encoding through the if branch, so the result has the same shape as the current compressCore code.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def decodeWitnessXCoords {X : Type u} (Z : Finset (X × Bool)) {K : } (idxs : Finset (Fin K)) :

                    Decode the X-coordinates of a block from kernel positions. This matches the current blockHyp shape.

                    Equations
                    Instances For
                      def decodeWitnessLabel {X : Type u} [DecidableEq X] (Z : Finset (X × Bool)) :
                      XBool

                      Decode labels from the kernel. This is exactly the current MY reconstruction convention in your file.

                      Equations
                      Instances For
                        theorem decodeWitnessXCoords_encode_eq {X : Type u} [DecidableEq X] (kernel : Finset (X × Bool)) (c : XBool) {K : } (W : Finset X) (hK : kernel.card K) (hWker : xW, (x, c x) kernel) :
                        decodeWitnessXCoords kernel (encodeWitnessInfo kernel c K W) = W

                        If every (x, c x) with x ∈ W lies in kernel, and kernel.card ≤ K, then decoding the encoded witness positions gives back exactly W.

                        theorem decodeWitnessLabel_eq_on_encoded {X : Type u} [DecidableEq X] (kernel : Finset (X × Bool)) (c : XBool) (W : Finset X) (hWker : xW, (x, c x) kernel) (hlabels : pkernel, p.2 = c p.1) (x : X) :
                        x WdecodeWitnessLabel kernel x = c x

                        On the encoded witness support, the decoded label function agrees with the true label function c, provided every pair in the kernel has the correct second coordinate.

                        theorem labeledSampleOfFinset_eq_of_eq_on_support {X : Type u} [DecidableEq X] {ℓ₁ ℓ₂ : XBool} {Z : Finset X} (hℓ : xZ, ℓ₁ x = ℓ₂ x) :

                        If two label functions agree on all points of Z, then the labeled samples they induce on Z.equivFin are equal.

                        theorem roundtrip_blockHyp_eq_rep {X : Type u} [DecidableEq X] (learn : {m : } → (Fin mX × Bool)XBool) (kernel : Finset (X × Bool)) (c : XBool) (K : ) (W : Finset X) (h : XBool) (hK : kernel.card K) (hWker : xW, (x, c x) kernel) (hlabels : pkernel, p.2 = c p.1) (hrep : learn (labeledSampleOfFinset c W) = h) (x : X) :
                        have info := encodeWitnessInfo kernel c K W; have blockXCoords := decodeWitnessXCoords kernel info; have blockLabel := decodeWitnessLabel kernel; learn (labeledSampleOfFinset blockLabel blockXCoords) x = h x

                        Generic roundtrip theorem for the hround sorry.

                        If:

                        then the decoded block hypothesis is exactly the representative hypothesis.

                        Moran-Yehudayoff forward construction — universe-fixed closure helpers #

                        @[reducible, inline]
                        abbrev CompressionSchemeWithInfo0 (X : Type u) (Y : Type) (C : ConceptClass X Y) :
                        Type (max (max u 1) 0)

                        Fix the hidden Info universe parameter of CompressionSchemeWithInfo to 0. This resolves the universe elaboration obstruction: Fin T → Finset (Fin K) is Type 0, while CompressionSchemeWithInfo X Bool C with X : Type u infers Info : Type u. Pinning to .{u, 0, 0} allows Type 0 Info directly.

                        Equations
                        Instances For
                          @[reducible, inline]
                          abbrev IncidenceInfo (T K : ) :

                          Concrete side information for the MY construction: each of the T recovered blocks is represented by the set of kernel positions it uses.

                          Equations
                          Instances For
                            @[implicit_reducible]
                            Equations

                            Forward direction: VCDim < ⊤ → compression with info #

                            The forward direction of the Moran-Yehudayoff theorem: finite VC dimension implies existence of a compression scheme with finite side information.

                            The construction:

                            1. Build a proper finite-support learner L from VC + Sauer-Shelah
                            2. For sample S: extract c, Y = pointSupport S, HY = hypothesis envelope
                            3. Apply approximate minimax on the agreement game → distribution p on HY
                            4. Apply VC ε-approximation on agreement tests → T representative hypotheses
                            5. Kernel = union of witness subsets for T hypotheses
                            6. Side info = incidence: which hypothesis's witness contains each kernel point
                            7. Reconstruct by majority vote over T hypotheses

                            Reverse direction: compression with info → VCDim < ⊤ #

                            theorem compress_with_info_injective_on_labelings {X : Type u} {n : } {C : ConceptClass X Bool} (cs : CompressionSchemeWithInfo X Bool C) (pts : Fin nX) (_hpts : Function.Injective pts) (f g : Fin nBool) (hf_real : cC, ∀ (i : Fin n), c (pts i) = f i) (hg_real : cC, ∀ (i : Fin n), c (pts i) = g i) (hfg : (cs.compress fun (i : Fin n) => (pts i, f i)) = cs.compress fun (i : Fin n) => (pts i, g i)) :
                            f = g

                            Pigeonhole core: if two C-realizable samples over the same points with different labelings produce the same (kernel, info) pair, correctness forces the labelings to agree.

                            theorem compression_with_info_imp_vcdim_finite (X : Type u) (C : ConceptClass X Bool) (hcomp : ∃ (k : ) (cs : CompressionSchemeWithInfo X Bool C), cs.size = k) :
                            VCDim X C <

                            Compression with side info implies finite VC dimension. Proof by pigeonhole: compress is injective on C-realizable labelings (by correctness), but compressed outputs form a bounded set.

                            Biconditional #