Documentation

Learning.SQObjects

Genuine SQ objects: concept class, statistical query (SQ) dimension, oracle #

The statistical-query (SQ) model (Kearns 1998; Blum et al. 1994): the SQ oracle answers a query φ : Input → [−1,1] with an estimate of E_D[φ] within tolerance τ; the statistical dimension is "every τ-separated subfamily of M has size at most d_SQ(M, μ)" — distribution-SPECIFIC; parity has d_SQ = 2^Ω(n); and a query separates a candidate R' from the truth whenever |E_{R'}[φ] − E_R[φ]| > 2τ.

This file makes these objects GENUINE, in place of the real-valued stand-in SQBounds.dSQ, a bare exponential. Candidates are indexed by an abstract type ι (as in the other SQ files, to avoid DecidableEq-on-functions pain), the answer functional ans : Q → ι → ℝ is abstract (covering both the distributional E_{R'}[φ] and the correlational parity form), and the statistical dimension is the genuine max separated-subfamily size.

The headline: parity's d_SQ = 2^Ω(n) becomes a THEOREM (sqDim_parity_ge, via character orthogonality), bridging to the MODELED exponential SQBounds.dSQ (parity_dSQ_ge_exp).

What this DOES establish #

What this does NOT establish (out of scope here; no overclaiming) #

def SQObjects.Separates {ι : Type u_1} {Q : Type u_2} (τ : ℝ) (ans : Q → ι → ℝ) (φ : Q) (i j : ι) :

A query φ separates candidates i, j (at tolerance τ) when their answers differ by more than τ (|E_{R'}[φ] − E_R[φ]| exceeds the threshold).

Equations
Instances For
    def SQObjects.SepFam {ι : Type u_1} {Q : Type u_2} (M : Finset ι) (τ : ℝ) (ans : Q → ι → ℝ) (S : Finset ι) :

    A separated subfamily S ⊆ M: every two distinct members are distinguished by some query (a τ-separated subfamily of M).

    Equations
    Instances For
      noncomputable def SQObjects.sqDim {ι : Type u_1} {Q : Type u_2} (M : Finset ι) (τ : ℝ) (ans : Q → ι → ℝ) :

      The statistical dimension d_SQ(M, μ): the largest size of a τ-separated subfamily of M. Genuine max over the (finite) powerset — no longer a bare exponential stand-in.

      Equations
      Instances For
        theorem SQObjects.sepFam_card_le_sqDim {ι : Type u_1} {Q : Type u_2} (M : Finset ι) (τ : ℝ) (ans : Q → ι → ℝ) {S : Finset ι} (hS : SepFam M τ ans S) :
        S.card ≤ sqDim M τ ans

        The characterization, now definitional: every τ-separated subfamily has size at most sqDim (Finset.le_sup on the filtered powerset).

        theorem SQObjects.survivors_card_le_sqDim {ι : Type u_1} {Q : Type u_2} (M : Finset ι) (τ : ℝ) (ans : Q → ι → ℝ) {V : Finset ι} (hV : V ⊆ M) (hsep : ∀ i ∈ V, ∀ j ∈ V, i ≠ j → ∃ (φ : Q), Separates τ ans φ i j) :
        V.card ≤ sqDim M τ ans

        Survivor pigeonhole (the definitional bound on a version space): a survivor set V ⊆ M that is pairwise τ-separated has V.card ≤ sqDim M τ ans.

        theorem SQObjects.sqDim_le_card {ι : Type u_1} {Q : Type u_2} (M : Finset ι) (τ : ℝ) (ans : Q → ι → ℝ) :
        sqDim M τ ans ≤ M.card

        The statistical dimension never exceeds the family's own size. The sup runs over subfamilies of M, and every one of them is a subset — so a finite rule class of size |M| has d_SQ ≤ |M| unconditionally, which is how a concrete finite class discharges Assumption A.

        theorem SQObjects.sqDim_mono_queries {ι : Type u_1} {Q : Type u_2} {Q' : Type u_3} (M : Finset ι) (τ : ℝ) (ans : Q → ι → ℝ) (ans' : Q' → ι → ℝ) (h : ∀ (i j : ι) (φ : Q), Separates τ ans φ i j → ∃ (ψ : Q'), Separates τ ans' ψ i j) :
        sqDim M τ ans ≤ sqDim M τ ans'

        BQ1 (distribution-specificity of d_SQ(M, μ)): if every separation achievable by ans is also achievable by ans', then sqDim …ans ≤ sqDim …ans'. A distribution-specific answer functional (fewer queries) never has larger statistical dimension than a distribution-free one that can realize all its separations.

        theorem SQObjects.sqDim_antitone_tol {ι : Type u_1} {Q : Type u_2} (M : Finset ι) (ans : Q → ι → ℝ) {τ₁ τ₂ : ℝ} (h : τ₁ ≤ τ₂) :
        sqDim M τ₂ ans ≤ sqDim M τ₁ ans

        The statistical dimension is antitone in the tolerance: a coarser separation threshold admits fewer separated subfamilies. If τ₁ ≤ τ₂ then every τ₂-separated subfamily is already τ₁-separated (from τ₁ ≤ τ₂ < |·|), so the filtered powerset shrinks and its sup of cardinalities can only decrease. No nonnegativity needed; this is what lets a 2τ-net be bounded by sqDim at the working tolerance τ.

        theorem SQObjects.exists_maximal_sepFam {ι : Type u_1} {Q : Type u_2} (M : Finset ι) (τ : ℝ) (ans : Q → ι → ℝ) {V : Finset ι} :
        ∃ N ⊆ V, SepFam M (2 * τ) ans N ∧ ∀ S ⊆ V, SepFam M (2 * τ) ans S → S.card ≤ N.card

        A maximum-cardinality 2τ-separated subfamily (a 2τ-net) of a finite candidate set V exists: the powerset of V filtered by SepFam M (2τ) is finite and nonempty (∅ is separated), so it has a cardinality-maximal element N. The filtering predicate is SepFam M, which already entails N ⊆ M, so sqDim M measures the net at the same threshold (no V ⊆ M hypothesis needed). Its linear sqDim bound and covering by maximality drive the identifiability-free envelope.

        theorem SQObjects.sep_net_covers {ι : Type u_1} {Q : Type u_2} (M : Finset ι) (τ : ℝ) (ans : Q → ι → ℝ) (hτ : 0 ≤ τ) {V N : Finset ι} (hNV : N ⊆ V) (hVM : V ⊆ M) (hNsep : SepFam M (2 * τ) ans N) (hNmax : ∀ S ⊆ V, SepFam M (2 * τ) ans S → S.card ≤ N.card) (v : ι) :
        v ∈ V → ∃ n ∈ N, ∀ (φ : Q), |ans φ v - ans φ n| ≤ 2 * τ

        Maximality ⇒ covering. A cardinality-maximal 2τ-separated subfamily N ⊆ V is a 2τ-net of V: every v ∈ V lies within 2τ of some n ∈ N on every query. Indeed, if v were 2τ-separated from all of N, then insert v N would be a larger 2τ-separated subfamily of V, contradicting maximality — no transitivity is used, only closeness to a representative. The v ∈ N case (take n := v) needs 0 ≤ τ.

        theorem SQObjects.merge_answer_close {ι : Type u_1} {Q : Type u_2} (τ : ℝ) (ans : Q → ι → ℝ) (V : Finset ι) (w : ι → ℝ) (hw : ∀ v ∈ V, 0 ≤ w v) (ρ : ι → ι) (hclose : ∀ v ∈ V, ∀ (φ : Q), |ans φ v - ans φ (ρ v)| ≤ 2 * τ) (φ : Q) :
        |∑ v ∈ V, w v * (ans φ v - ans φ (ρ v))| ≤ 2 * τ * ∑ v ∈ V, w v

        The mass-merge averaging bound, fully abstract (no net object needed). Reassigning each v ∈ V to a representative ρ v that is 2τ-close on every query, and summing the nonnegative masses w v, moves each query answer by a mass-weighted average of 2τ-close values: the merged answer differs from the full answer by at most 2τ · Σ w. Dividing by Σ w > 0 gives the normalized statement |A_full − A_merge| ≤ 2τ; this unnormalized form is the clean core.

        theorem SQObjects.version_space_net_envelope {ι : Type u_1} {Q : Type u_2} (M : Finset ι) (τ : ℝ) (ans : Q → ι → ℝ) (hτ : 0 ≤ τ) {V : Finset ι} (hVM : V ⊆ M) :
        ∃ (N : Finset ι) (ρ : ι → ι), N ⊆ V ∧ N.card ≤ sqDim M τ ans ∧ (∀ v ∈ V, ρ v ∈ N) ∧ ∀ v ∈ V, ∀ (φ : Q), |ans φ v - ans φ (ρ v)| ≤ 2 * τ

        The identifiability-free version-space envelope (the BFJKMR clustering argument). For any version space V ⊆ M and 0 ≤ τ, there is a net N ⊆ V of card ≤ sqDim M τ ans, with a retraction ρ : ι → ι sending every v ∈ V into N within 2τ on every query. Crucially there is no pairwise-separation / identifiability hypothesis on V: N is a maximal 2τ-separated subfamily (exists_maximal_sepFam), bounded by sqDim at threshold 2τ ≥ τ via antitonicity (sepFam_card_le_sqDim + sqDim_antitone_tol), and covering by maximality (sep_net_covers). Composed with merge_answer_close (masses merged onto ρ) this bounds the merged predictor's answer shift by 2τ. This is a learner-side net-and-merge, available under Assumption A alone, in place of 2τ-identifiability.

        def SQObjects.IsSQOracle {Q : Type u_2} (answer truth : Q → ℝ) (τ : ℝ) :

        The SQ oracle as an object: answer estimates the truth's query values within τ.

        Equations
        Instances For
          theorem SQObjects.survivors_polyBounded_of_separated {ι : Type u_1} {Q : Type u_2} (τ : ℝ) (Mfam Vfam : ℝ → Finset ι) (ansfam : ℝ → Q → ι → ℝ) (hV : ∀ (r : ℝ), Vfam r ⊆ Mfam r) (hsep : ∀ (r : ℝ), ∀ i ∈ Vfam r, ∀ j ∈ Vfam r, i ≠ j → ∃ (φ : Q), Separates τ (ansfam r) φ i j) (hpoly : SQBounds.PolyBounded fun (r : ℝ) => ↑(sqDim (Mfam r) τ (ansfam r))) :
          SQBounds.PolyBounded fun (r : ℝ) => ↑(Vfam r).card

          Reusing SQBounds.PolyBounded verbatim: if the GENUINE statistical dimension of a family is polynomially bounded (Assumption A) and each survivor set is pairwise τ-separated, then the survivor count is poly. This is SQBounds.candidates_polyBounded instantiated with the A = m = 1 envelope supplied by survivors_card_le_sqDim.

          def SQObjects.χ {n : ℕ} (S : Finset (Fin n)) (x : Fin n → ZMod 2) :

          The parity character χ_S(x) = (−1)^{⟨S, x⟩}, valued in {±1} ⊆ ℝ, for S ⊆ Fin n and x : Fin n → ZMod 2.

          Equations
          Instances For
            theorem SQObjects.chi_add_single {n : ℕ} (S : Finset (Fin n)) (i : Fin n) (x : Fin n → ZMod 2) :
            χ S (x + Pi.single i 1) = if i ∈ S then -χ S x else χ S x

            Flipping coordinate i (adding Pi.single i 1) negates χ_S when i ∈ S, and fixes it otherwise: the single-coordinate translation law that drives orthogonality.

            theorem SQObjects.sum_chi_eq_zero {n : ℕ} (S : Finset (Fin n)) (hS : S ≠ ∅) :
            ∑ x : Fin n → ZMod 2, χ S x = 0

            ∑_x χ_S(x) = 0 for S ≠ ∅: pick i ∈ S; the coordinate-i translation negates χ_S but preserves the sum over the whole cube, so ∑ = −∑.

            noncomputable def SQObjects.ansPar {n : ℕ} (φ S : Finset (Fin n)) :

            Correlational answer functional on the parity class: ansPar φ S is the normalized correlation ⟨χ_φ, χ_S⟩ of two characters (queries = characters too).

            Equations
            Instances For
              theorem SQObjects.ansPar_eq {n : ℕ} (φ S : Finset (Fin n)) :
              ansPar φ S = if S = φ then 1 else 0

              Exact orthogonality: ansPar φ S = 1 iff S = φ, else 0. Diagonal from χ_φ² = 1 summed to 2^n; off-diagonal from sum_chi_mul_eq_zero.

              theorem SQObjects.sqDim_parity_ge {n : ℕ} {τ : ℝ} (hτ : τ < 1) :

              Headline: parity's statistical dimension is ≥ 2^n for any τ < 1 — the whole 2^n-element class Finset.univ is τ-separated (query φ = S gives |ansPar S S − ansPar S T| = 1). Turns the MODELED d_SQ = 2^Ω(n) premise into a theorem.

              theorem SQObjects.parity_dSQ_ge_exp {n : ℕ} {τ : ℝ} (hτ : τ < 1) :

              Bridge: the GENUINE parity dimension dominates the modeled exponential stand-in (dSQ (log 2) n = exp(n·log 2) = 2^n).