Stat.Concentration.Covering.RealValuedVCSubgraph
Real-valued VC-subgraph entropy: arbitrary-measure L² covering bounds, reusable algebraic closures, finite-dimensional parameter classes, and empirical-Dudley bridges.
Basic 7 core · 3 supporting This module gives a finite-trace definition of pseudo-dimension, an explicit L²(Q) covering predicate, and the uniform polynomial entropy theorem for a bounded measurable VC-subgraph class. ★ real_vcSubgraph_l2_covering
Real-valued VC-subgraph covering: core definitions
This module gives a finite-trace definition of pseudo-dimension, an explicit
L²(Q) covering predicate, and the uniform polynomial entropy theorem for a
bounded measurable VC-subgraph class. The definitions deliberately quantify
over an arbitrary probability measure; the finite-sample bridge is developed
in Empirical.
Given a real-valued function class on an observation space, a class index, and an observation-threshold pair, the strict subgraph classifier returns true exactly when the threshold is strictly below the selected function's value at the observation.
Given a real-valued function class on an observation space and a nonnegative integer , the pseudo-dimension-at-most- property holds exactly when, for every finite collection of observation-threshold pairs, the VC dimension of the strict-subgraph labelings induced by the class on that collection is at most .
Definition (Lean source)
Given a measure on an observation space and two real-valued functions on that space, their measure-based semidistance is .
Definition (Lean source)
Given a measure on an observation space, a real-valued function class, a radius , and a finite set of class indices, the open cover property holds exactly when every class member lies at strictly less than distance from a member indexed by that finite set.
Definition (Lean source)
Given a measure on an observation space, a real-valued function class, a radius , and a nonnegative integer , the covering-number-at-most- property holds exactly when there is a finite set of at most class indices that forms an open cover at radius .
Definition (Lean source)
Given a nonnegative integer and a real number , the explicit VC-subgraph cover bound is the least integer no smaller than .
Definition (Lean source)
Polynomial L²(Q) covering number from a pseudo-dimension bound. For a family of measurable real-valued functions of pseudo-dimension at most d, uniformly bounded by a positive envelope U, and a relative radius ε with 0 < ε ≤ 1, the L²(Q) covering number at radius ε·U is at most vcSubgraphCoverBound d ε, uniformly over every probability measure Q on the domain.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
hasPseudoDimAtMost_iff_growthFamilytheorem — The pseudo-dimension certificate unfolds to the existing finite Boolean growth-family VC certificate on every thresholded sample.hypotheses𝒳 :sharedType uι :sharedType vF :ι → 𝒳 → ℝd :ℕconclusionProof (Lean source)
theorem hasPseudoDimAtMost_iff_growthFamily (F : ι → 𝒳 → ℝ) (d : ℕ) : HasPseudoDimAtMost F d ↔ ∀ (n : ℕ) (T : Fin n → 𝒳 × ℝ), (growthFamily (subgraphClassifier F) T).vcDim ≤ d := by rfl -
sharp_vc_weightedHamming_packing_card_letheorem — A finite Boolean VC class with nonnegative coordinate weights has a dimension-free-base polynomial packing bound in weighted Hamming distance.hypothesesn :ℕd :ℕw :Fin n → ℝhw :∀ j, 0 ≤ w jr ε :ℝhε :0 < εhεr :ε ≤ rhwsum :∑ j, w j ≤ r ^ 2hsep :∀ a ∈ P, ∀ b ∈ P, a ≠ b → ε ^ 2 ≤ weightedHammingSq w a bconclusionP.card ≤ ceil ((16 * r ^ 2 / ε ^ 2) ^ (2 * (d + 1)))Proof (Lean source)
theorem sharp_vc_weightedHamming_packing_card_le {n : ℕ} (d : ℕ) (w : Fin n → ℝ) (hw : ∀ j, 0 ≤ w j) (r ε : ℝ) (hε : 0 < ε) (hεr : ε ≤ r) (hwsum : ∑ j, w j ≤ r ^ 2) (P : Finset (Fin n → Bool)) (hvc : (P.image (fun a => Finset.univ.filter (fun j => a j = true))).vcDim ≤ d) (hsep : ∀ a ∈ P, ∀ b ∈ P, a ≠ b → ε ^ 2 ≤ weightedHammingSq w a b) : P.card ≤ ceil ((16 * r ^ 2 / ε ^ 2) ^ (2 * (d + 1))) := by classical let B : ℝ := 16 * r ^ 2 / ε ^ 2 have hr : 0 < r := hε.trans_le hεr have hx : 1 ≤ r ^ 2 / ε ^ 2 := by have hdiv : 1 ≤ r / ε := (one_le_div hε).2 hεr rw [← div_pow] nlinarith [sq_nonneg (r / ε)] have hB : 16 ≤ B := by dsimp [B] calc 16 ≤ 16 * (r ^ 2 / ε ^ 2) := by nlinarith _ = 16 * r ^ 2 / ε ^ 2 := by ring have hBpos : 0 < B := lt_of_lt_of_le (by norm_num) hB have hpow_one : 1 ≤ B ^ (2 * (d + 1)) := by exact one_le_pow₀ (by linarith) by_cases hsmall : P.card ≤ 1 · apply (Nat.cast_le (α := ℝ)).mp have hsmall' : (P.card : ℝ) ≤ 1 := by exact_mod_cast hsmall exact hsmall'.trans (hpow_one.trans (Nat.le_ceil _)) have hPcard : 2 ≤ P.card := by omega obtain ⟨m, J, hm, hvcJ, hinj⟩ := exists_separating_subsample d w hw r ε hr hε hwsum P hPcard hvc hsep have hcard_image : (P.image (subsamplePattern J)).card = P.card := Finset.card_image_of_injOn hinj have hcard_sum : P.card ≤ ∑ k ∈ Iic d, m.choose k := by rw [← hcard_image] exact card_growthFamily_le_sum_choose (P.image (subsamplePattern J)) hvcJ by_cases hd0 : d = 0 · have : P.card ≤ 1 := by rw [hd0, show Iic 0 = {0} by ext k; simp] at hcard_sum simpa using hcard_sum omega have hd : 0 < d := Nat.pos_of_ne_zero hd0 have hreal_goal : (P.card : ℝ) ≤ B ^ (2 * (d + 1)) := by by_cases hdm : d ≤ m · have hcard_scaled : (P.card : ℝ) ≤ (4 * (m : ℝ) / (d : ℝ)) ^ d := by have hc : (P.card : ℝ) ≤ ((∑ k ∈ Iic d, m.choose k : ℕ) : ℝ) := by exact_mod_cast hcard_sum exact hc.trans (sum_choose_le_four_mul_div_pow hd hdm) let L : ℝ := log (P.card) have hPpos : 0 < (P.card : ℝ) := by positivity have hmpos : 0 < m := lt_of_lt_of_le hd hdm have hbase_pos : 0 < 4 * (m : ℝ) / (d : ℝ) := by positivity have hlog_card : L ≤ (d : ℝ) * log (4 * (m : ℝ) / (d : ℝ)) := by calc L ≤ log ((4 * (m : ℝ) / (d : ℝ)) ^ d) := Real.log_le_log hPpos hcard_scaled _ = (d : ℝ) * log (4 * (m : ℝ) / (d : ℝ)) := Real.log_pow _ _ have htangent : log (4 * (m : ℝ) / (d : ℝ)) ≤ (4 * (m : ℝ) / (d : ℝ)) / B + log B - 1 := by have hratio : 0 < (4 * (m : ℝ) / (d : ℝ)) / B := by positivity have h := Real.log_le_sub_one_of_pos hratio rw [Real.log_div (ne_of_gt hbase_pos) (ne_of_gt hBpos)] at h linarith have hm' : (m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * L := by simpa [L] using hm have hratio_bound : (4 * (m : ℝ) / (d : ℝ)) / B ≤ 1 / (4 * (d : ℝ)) + L / (2 * (d : ℝ)) := by dsimp [B] have hdreal : 0 < (d : ℝ) := by positivity have hscale : 0 < 4 / ((d : ℝ) * (16 * r ^ 2 / ε ^ 2)) := by positivity have := mul_le_mul_of_nonneg_left hm' hscale.le calc (4 * (m : ℝ) / (d : ℝ)) / (16 * r ^ 2 / ε ^ 2) = (4 / ((d : ℝ) * (16 * r ^ 2 / ε ^ 2))) * (m : ℝ) := by field_simp _ ≤ (4 / ((d : ℝ) * (16 * r ^ 2 / ε ^ 2))) * (1 + (2 * r ^ 2 / ε ^ 2) * L) := this _ = 1 / (4 * (d : ℝ)) * (ε ^ 2 / r ^ 2) + L / (2 * (d : ℝ)) := by field_simp; ring _ ≤ 1 / (4 * (d : ℝ)) + L / (2 * (d : ℝ)) := by have heps : ε ^ 2 / r ^ 2 ≤ 1 := by rw [div_le_one (sq_pos_of_pos hr)] nlinarith [sq_nonneg (r - ε)] have hcoef : 0 ≤ 1 / (4 * (d : ℝ)) := by positivity nlinarith [mul_le_mul_of_nonneg_left heps hcoef] have hL : L ≤ 2 * (d : ℝ) * log B := by have hdreal : 0 < (d : ℝ) := by positivity have hstep := hlog_card.trans (mul_le_mul_of_nonneg_left htangent (by positivity : 0 ≤ (d : ℝ))) have hstep' : L ≤ (d : ℝ) * (1 / (4 * (d : ℝ)) + L / (2 * (d : ℝ)) + log B - 1) := hstep.trans (mul_le_mul_of_nonneg_left (by linarith [hratio_bound]) (by positivity)) have hd_one : (1 : ℝ) ≤ d := by exact_mod_cast Nat.succ_le_iff.mpr hd have hstep'' : L ≤ 1 / 4 + L / 2 + (d : ℝ) * log B - (d : ℝ) := by convert hstep' using 1 <;> field_simp nlinarith have hlog_pow : log (B ^ (2 * (d + 1))) = (2 * (d + 1) : ℕ) * log B := Real.log_pow _ _ have hlog_le : L ≤ log (B ^ (2 * (d + 1))) := by rw [hlog_pow] have hlogB : 0 ≤ log B := Real.log_nonneg (by linarith) exact hL.trans (by norm_num [Nat.cast_mul, Nat.cast_add] nlinarith) change log (P.card : ℝ) ≤ log (B ^ (2 * (d + 1))) at hlog_le rw [← Real.exp_log hPpos, ← Real.exp_log (pow_pos hBpos _)] exact Real.exp_le_exp.mpr hlog_le · have hmd : m < d := Nat.lt_of_not_ge hdm have hcard_univ : (P.image (subsamplePattern J)).card ≤ (Finset.univ : Finset (Finset (Fin m))).card := Finset.card_le_univ _ have hcard_two : P.card ≤ 2 ^ m := by rw [hcard_image] at hcard_univ simpa using hcard_univ have htwoB : (2 : ℝ) ≤ B := by linarith calc (P.card : ℝ) ≤ (2 : ℝ) ^ m := by exact_mod_cast hcard_two _ ≤ B ^ m := pow_le_pow_left₀ (by norm_num) htwoB m _ ≤ B ^ (2 * (d + 1)) := by exact pow_le_pow_right₀ (by linarith) (by omega) apply (Nat.cast_le (α := ℝ)).mp exact hreal_goal.trans (Nat.le_ceil _) -
pseudoDim_gives_finite_subgraph_vctheorem — The real-valued theorem genuinely reuses the existing finite VC combinatorics: its hypothesis gives the exact threshold-trace certificate needed by VCCovering and HausslerPacking.hypothesesconclusionProof (Lean source)
theorem pseudoDim_gives_finite_subgraph_vc {F : ι → 𝒳 → ℝ} {d n : ℕ} (hpdim : HasPseudoDimAtMost F d) (T : Fin n → 𝒳 × ℝ) : (growthFamily (subgraphClassifier F) T).vcDim ≤ d := by exact hpdim n T
Algebra 4 core · 16 supporting This module packages uniform polynomial covering as a reusable certificate and states its finite sum and finite product closures. ★ hasPolynomialL2Cover
Algebraic closure interfaces for polynomial L² entropy
This module packages uniform polynomial covering as a reusable certificate and
states its finite sum and finite product closures. Parametric and indicator
constructions are developed in Parametric.
A class of functions has uniform polynomial L² entropy with envelope U when U is positive, every function in the class is measurable and pointwise bounded in absolute value by U, and the class admits one polynomial covering-number bound, in the relative radius, holding simultaneously for every probability measure and every relative radius in (0,1] .
Definition (Lean source)
Bounded finite-pseudo-dimension classes admit a polynomial L² cover. If a real-valued function class has pseudo-dimension at most d, every member is measurable, and the class is uniformly bounded by a positive envelope U, then the class carries a uniform polynomial L² covering certificate at envelope U.
Formal statement
Proof (Lean source)
A polynomial L² covering certificate with named entropy witnesses. Unlike HasPolynomialL2Cover, this form retains the particular base and integer exponent, so a family of constructions can share witnesses before its observation-specific parameters are introduced.
Definition (Lean source)
Given an observation space, an auxiliary parameter set , an index set depending on the parameter, a parameter-indexed family of real-valued function classes, and a parameter-indexed envelope, the uniform polynomial covering property over holds exactly when there are one real entropy base and one nonnegative-integer exponent such that every parameter's class has the corresponding polynomial covering certificate with its designated envelope.
Definition (Lean source)
16 supporting declarations (lemmas, instances)
-
negtheorem — Negating every member of a polynomial-entropy class preserves its envelope and uniform polynomial L² entropy.hypothesesconclusionHasPolynomialL2Cover (fun i x => -F i x) UProof (Lean source)
theorem HasPolynomialL2Cover.neg {ι : Type v} {F : ι → 𝒳 → ℝ} {U : ℝ} (hF : HasPolynomialL2Cover F U) : HasPolynomialL2Cover (fun i x => -F i x) U := by refine ⟨hF.envelope_pos, fun i => (hF.measurable i).neg, ?_, ?_⟩ · intro i x simpa using hF.envelope i x · obtain ⟨A, p, hA, hent⟩ := hF.entropy refine ⟨A, p, hA, ?_⟩ intro Q hQ ε hε hε1 obtain ⟨C, hCcard, hCcover⟩ := hent Q hQ ε hε hε1 refine ⟨C, hCcard, ?_⟩ intro i obtain ⟨j, hjC, hij⟩ := hCcover i refine ⟨j, hjC, ?_⟩ have heq : measureL2Dist Q (fun x => -F i x) (fun x => -F j x) = measureL2Dist Q (F i) (F j) := by rw [measureL2Dist_eq_lpNorm Q _ _ (hF.measurable i).fun_neg (hF.measurable j).fun_neg, measureL2Dist_eq_lpNorm Q _ _ (hF.measurable i) (hF.measurable j)] have hfun : (fun x => -F i x - -F j x) = -(fun x => F i x - F j x) := by funext x simp only [Pi.neg_apply] ring rw [hfun, lpNorm_neg] rwa [heq] -
addtheorem — Pointwise addition of two independently indexed polynomial-entropy classes has uniform polynomial L² entropy with summed envelope.hypotheses𝒳 :sharedType uι :Type vκ :Type wF :ι → 𝒳 → ℝG :κ → 𝒳 → ℝU V :ℝhF :hG :conclusionHasPolynomialL2Cover (fun p : ι × κ => fun x => F p.1 x + G p.2 x) (U + V)Proof (Lean source)
theorem HasPolynomialL2Cover.add {ι : Type v} {κ : Type w} {F : ι → 𝒳 → ℝ} {G : κ → 𝒳 → ℝ} {U V : ℝ} (hF : HasPolynomialL2Cover F U) (hG : HasPolynomialL2Cover G V) : HasPolynomialL2Cover (fun p : ι × κ => fun x => F p.1 x + G p.2 x) (U + V) := by have hU : 0 < U := hF.envelope_pos have hV : 0 < V := hG.envelope_pos refine ⟨by positivity, fun p => (hF.measurable p.1).add (hG.measurable p.2), ?_, ?_⟩ · intro p x exact (abs_add_le _ _).trans (add_le_add (hF.envelope p.1 x) (hG.envelope p.2 x)) · obtain ⟨A, p, hA, hentF⟩ := hF.entropy obtain ⟨B, q, hB, hentG⟩ := hG.entropy refine ⟨8 * A * B, p + q + 2, by nlinarith [mul_nonneg (sub_nonneg.mpr hA) (sub_nonneg.mpr hB)], ?_⟩ intro Q hQ ε hε hε1 have hhalf : 0 < ε / 2 := by positivity have hhalf1 : ε / 2 ≤ 1 := by linarith obtain ⟨CF, hCFcard, hCFcover⟩ := hentF Q hQ (ε / 2) hhalf hhalf1 obtain ⟨CG, hCGcard, hCGcover⟩ := hentG Q hQ (ε / 2) hhalf hhalf1 rw [show A / (ε / 2) = 2 * A / ε by field_simp] at hCFcard rw [show B / (ε / 2) = 2 * B / ε by field_simp] at hCGcard classical refine ⟨CF ×ˢ CG, ?_, ?_⟩ · rw [Finset.card_product] exact (Nat.mul_le_mul hCFcard hCGcard).trans (ceil_mul_le_ceil_poly hA hB hε hε1) · intro a obtain ⟨i, hiC, hi⟩ := hCFcover a.1 obtain ⟨j, hjC, hj⟩ := hCGcover a.2 refine ⟨(i, j), Finset.mem_product.mpr ⟨hiC, hjC⟩, ?_⟩ haveI : IsProbabilityMeasure Q := hQ calc measureL2Dist Q (fun x => F a.1 x + G a.2 x) (fun x => F i x + G j x) ≤ measureL2Dist Q (F a.1) (F i) + measureL2Dist Q (G a.2) (G j) := measureL2Dist_add_le _ _ _ _ (hF.measurable a.1) (hF.measurable i) (hG.measurable a.2) (hG.measurable j) (hF.envelope a.1) (hF.envelope i) _ < ε * (U + V) := by nlinarith -
multheorem — Pointwise multiplication of two independently indexed bounded polynomial-entropy classes has uniform polynomial L² entropy with product envelope.hypotheses𝒳 :sharedType uι :Type vκ :Type wF :ι → 𝒳 → ℝG :κ → 𝒳 → ℝU V :ℝhF :hG :conclusionHasPolynomialL2Cover (fun p : ι × κ => fun x => F p.1 x * G p.2 x) (U * V)Proof (Lean source)
theorem HasPolynomialL2Cover.mul {ι : Type v} {κ : Type w} {F : ι → 𝒳 → ℝ} {G : κ → 𝒳 → ℝ} {U V : ℝ} (hF : HasPolynomialL2Cover F U) (hG : HasPolynomialL2Cover G V) : HasPolynomialL2Cover (fun p : ι × κ => fun x => F p.1 x * G p.2 x) (U * V) := by have hU : 0 < U := hF.envelope_pos have hV : 0 < V := hG.envelope_pos refine ⟨mul_pos hU hV, fun p => (hF.measurable p.1).mul (hG.measurable p.2), ?_, ?_⟩ · intro p x rw [abs_mul] exact mul_le_mul (hF.envelope p.1 x) (hG.envelope p.2 x) (abs_nonneg _) hU.le · obtain ⟨A, p, hA, hentF⟩ := hF.entropy obtain ⟨B, q, hB, hentG⟩ := hG.entropy refine ⟨8 * A * B, p + q + 2, by nlinarith [mul_nonneg (sub_nonneg.mpr hA) (sub_nonneg.mpr hB)], ?_⟩ intro Q hQ ε hε hε1 have hhalf : 0 < ε / 2 := by positivity have hhalf1 : ε / 2 ≤ 1 := by linarith obtain ⟨CF, hCFcard, hCFcover⟩ := hentF Q hQ (ε / 2) hhalf hhalf1 obtain ⟨CG, hCGcard, hCGcover⟩ := hentG Q hQ (ε / 2) hhalf hhalf1 rw [show A / (ε / 2) = 2 * A / ε by field_simp] at hCFcard rw [show B / (ε / 2) = 2 * B / ε by field_simp] at hCGcard classical refine ⟨CF ×ˢ CG, ?_, ?_⟩ · rw [Finset.card_product] exact (Nat.mul_le_mul hCFcard hCGcard).trans (ceil_mul_le_ceil_poly hA hB hε hε1) · intro z obtain ⟨i, hiC, hi⟩ := hCFcover z.1 obtain ⟨j, hjC, hj⟩ := hCGcover z.2 refine ⟨(i, j), Finset.mem_product.mpr ⟨hiC, hjC⟩, ?_⟩ haveI : IsProbabilityMeasure Q := hQ calc measureL2Dist Q (fun x => F z.1 x * G z.2 x) (fun x => F i x * G j x) ≤ V * measureL2Dist Q (F z.1) (F i) + U * measureL2Dist Q (G z.2) (G j) := measureL2Dist_mul_le _ _ _ _ (hF.measurable z.1) (hF.measurable i) (hG.measurable z.2) (hG.measurable j) hU.le hV.le (hF.envelope z.1) (hF.envelope i) (hG.envelope z.2) (hG.envelope j) _ < ε * (U * V) := by nlinarith -
finSumtheorem — A fixed finite sum of independently indexed polynomial-entropy classes again has uniform polynomial L² entropy, with the sum of the envelopes.hypothesesconclusionHasPolynomialL2Cover (fun θ : (k : K) → ι k => fun x => ∑ k, F k (θ k) x) (∑ k, U k)Proof (Lean source)
theorem HasPolynomialL2Cover.finSum {K : Type w} [Fintype K] [Nonempty K] {ι : K → Type v} {F : (k : K) → ι k → 𝒳 → ℝ} {U : K → ℝ} (hF : ∀ k, HasPolynomialL2Cover (F k) (U k)) : HasPolynomialL2Cover (fun θ : (k : K) → ι k => fun x => ∑ k, F k (θ k) x) (∑ k, U k) := by classical let P : ∀ (K : Type w) [Fintype K], Prop := fun K _ => Nonempty K → ∀ (ι : K → Type v) (F : (k : K) → ι k → 𝒳 → ℝ) (U : K → ℝ), (∀ k, HasPolynomialL2Cover (F k) (U k)) → HasPolynomialL2Cover (fun θ : (k : K) → ι k => fun x => ∑ k, F k (θ k) x) (∑ k, U k) refine Fintype.induction_empty_option (P := P) ?_ ?_ ?_ K (inferInstance : Nonempty K) ι F U hF · intro α β _ e ih hβ ι F U hF letI : Fintype α := Fintype.ofEquiv β e.symm let hα : Nonempty α := ⟨e.symm (choice hβ)⟩ have hc := ih hα (fun a => ι (e a)) (fun a => F (e a)) (fun a => U (e a)) (fun a => hF (e a)) let eθ : ((b : β) → ι b) ≃ ((a : α) → ι (e a)) := (Equiv.piCongrLeft ι e).symm have hclass : (fun θ : (b : β) → ι b => fun x => ∑ b, F b (θ b) x) = (fun θ : (b : β) → ι b => fun x => ∑ a, F (e a) (θ (e a)) x) := by funext θ x exact (e.sum_comp (fun b => F b (θ b) x)).symm have hUeq : (∑ b, U b) = ∑ a, U (e a) := (e.sum_comp U).symm rw [hclass, hUeq] simpa [eθ] using hc.reindex eθ · intro h exact isEmptyElim (choice h) · intro α _ ih _ ι F U hF by_cases hα : Nonempty α · have htail := ih hα (fun a => ι (some a)) (fun a => F (some a)) (fun a => U (some a)) (fun a => hF (some a)) have hadd := (hF none).add htail let split : ((k : Option α) → ι k) ≃ (ι none × ((a : α) → ι (some a))) := { toFun := fun θ => (θ none, fun a => θ (some a)) invFun := fun p k => Option.rec p.1 p.2 k left_inv := fun θ => by funext k; cases k <;> rfl right_inv := fun p => by cases p; rfl } simp only [Fintype.sum_option] exact hadd.reindex split · letI : IsEmpty α := not_nonempty_iff.mp hα let single : ((k : Option α) → ι k) ≃ ι none := { toFun := fun θ => θ none invFun := fun i k => Option.rec i (fun a => isEmptyElim a) k left_inv := fun θ => by funext k; cases k with | none => rfl | some a => exact isEmptyElim a right_inv := fun i => rfl } simp only [Fintype.sum_option, Finset.univ_eq_empty, Finset.sum_empty, add_zero] exact (hF none).reindex single -
finProdtheorem — A fixed finite product of independently indexed polynomial-entropy classes again has uniform polynomial L² entropy, with the product envelope.hypothesesconclusionHasPolynomialL2Cover (fun θ : (k : K) → ι k => fun x => ∏ k, F k (θ k) x) (∏ k, U k)Proof (Lean source)
theorem HasPolynomialL2Cover.finProd {K : Type w} [Fintype K] [Nonempty K] {ι : K → Type v} {F : (k : K) → ι k → 𝒳 → ℝ} {U : K → ℝ} (hF : ∀ k, HasPolynomialL2Cover (F k) (U k)) : HasPolynomialL2Cover (fun θ : (k : K) → ι k => fun x => ∏ k, F k (θ k) x) (∏ k, U k) := by classical let P : ∀ (K : Type w) [Fintype K], Prop := fun K _ => Nonempty K → ∀ (ι : K → Type v) (F : (k : K) → ι k → 𝒳 → ℝ) (U : K → ℝ), (∀ k, HasPolynomialL2Cover (F k) (U k)) → HasPolynomialL2Cover (fun θ : (k : K) → ι k => fun x => ∏ k, F k (θ k) x) (∏ k, U k) refine Fintype.induction_empty_option (P := P) ?_ ?_ ?_ K (inferInstance : Nonempty K) ι F U hF · intro α β _ e ih hβ ι F U hF letI : Fintype α := Fintype.ofEquiv β e.symm let hα : Nonempty α := ⟨e.symm (choice hβ)⟩ have hc := ih hα (fun a => ι (e a)) (fun a => F (e a)) (fun a => U (e a)) (fun a => hF (e a)) let eθ : ((b : β) → ι b) ≃ ((a : α) → ι (e a)) := (Equiv.piCongrLeft ι e).symm have hclass : (fun θ : (b : β) → ι b => fun x => ∏ b, F b (θ b) x) = (fun θ : (b : β) → ι b => fun x => ∏ a, F (e a) (θ (e a)) x) := by funext θ x exact (e.prod_comp (fun b => F b (θ b) x)).symm have hUeq : (∏ b, U b) = ∏ a, U (e a) := (e.prod_comp U).symm rw [hclass, hUeq] simpa [eθ] using hc.reindex eθ · intro h exact isEmptyElim (choice h) · intro α _ ih _ ι F U hF by_cases hα : Nonempty α · have htail := ih hα (fun a => ι (some a)) (fun a => F (some a)) (fun a => U (some a)) (fun a => hF (some a)) have hmul := (hF none).mul htail let split : ((k : Option α) → ι k) ≃ (ι none × ((a : α) → ι (some a))) := { toFun := fun θ => (θ none, fun a => θ (some a)) invFun := fun p k => Option.rec p.1 p.2 k left_inv := fun θ => by funext k; cases k <;> rfl right_inv := fun p => by cases p; rfl } simp only [Fintype.prod_option] exact hmul.reindex split · letI : IsEmpty α := not_nonempty_iff.mp hα let single : ((k : Option α) → ι k) ≃ ι none := { toFun := fun θ => θ none invFun := fun i k => Option.rec i (fun a => isEmptyElim a) k left_inv := fun θ => by funext k; cases k with | none => rfl | some a => exact isEmptyElim a right_inv := fun i => rfl } simp only [Fintype.prod_option, Finset.univ_eq_empty, Finset.prod_empty, mul_one] exact (hF none).reindex single -
forgettheorem — Forgetting the named witnesses gives the ordinary polynomial-cover certificate.hypothesesconclusionProof (Lean source)
theorem HasPolynomialL2CoverWith.forget {ι : Type v} {F : ι → 𝒳 → ℝ} {U A : ℝ} {p : ℕ} (hF : HasPolynomialL2CoverWith F U A p) : HasPolynomialL2Cover F U := hF.toHasPolynomialL2Cover -
enlargeEnvelopetheorem — Enlarging a named envelope preserves its entropy witnesses.hypotheses𝒳 :sharedType uι :Type vι → 𝒳 → ℝU V A :ℝp :ℕhF :HasPolynomialL2CoverWith F U A phUV :U ≤ VconclusionHasPolynomialL2CoverWith F V A pProof (Lean source)
-- @node: HasPolynomialL2CoverWith.enlargeEnvelope theorem HasPolynomialL2CoverWith.enlargeEnvelope {ι : Type v} {F : ι → 𝒳 → ℝ} {U V A : ℝ} {p : ℕ} (hF : HasPolynomialL2CoverWith F U A p) (hUV : U ≤ V) : HasPolynomialL2CoverWith F V A p := by have hV : 0 < V := hF.forget.envelope_pos.trans_le hUV refine ⟨⟨hV, hF.forget.measurable, fun i x => (hF.forget.envelope i x).trans hUV, A, p, hF.one_le_base, ?_⟩, hF.one_le_base, ?_⟩ <;> intro Q hQ ε hε hε1 · obtain ⟨C, hCcard, hCcover⟩ := hF.entropy Q hQ ε hε hε1 refine ⟨C, hCcard, fun i => ?_⟩ obtain ⟨j, hjC, hij⟩ := hCcover i exact ⟨j, hjC, hij.trans_le (mul_le_mul_of_nonneg_left hUV hε.le)⟩ · obtain ⟨C, hCcard, hCcover⟩ := hF.entropy Q hQ ε hε hε1 refine ⟨C, hCcard, fun i => ?_⟩ obtain ⟨j, hjC, hij⟩ := hCcover i exact ⟨j, hjC, hij.trans_le (mul_le_mul_of_nonneg_left hUV hε.le)⟩ -
hasPolynomialL2CoverWiththeorem — A bounded measurable pseudo-dimension class has the canonical named entropy witnesses used by the VC-subgraph covering theorem.hypotheses𝒳 :sharedType uι :Type vNonempty ιι → 𝒳 → ℝd :ℕU :ℝhpdim :hmeas :∀ i, Measurable (F i)hU :0 < Uhenvelope :∀ i x, |F i x| ≤ UconclusionHasPolynomialL2CoverWith F U 16 (8 * (d + 1))Proof (Lean source)
theorem HasPseudoDimAtMost.hasPolynomialL2CoverWith {ι : Type v} [Nonempty ι] {F : ι → 𝒳 → ℝ} {d : ℕ} {U : ℝ} (hpdim : HasPseudoDimAtMost F d) (hmeas : ∀ i, Measurable (F i)) (hU : 0 < U) (henvelope : ∀ i x, |F i x| ≤ U) : HasPolynomialL2CoverWith F U 16 (8 * (d + 1)) := by refine ⟨hpdim.hasPolynomialL2Cover hmeas hU henvelope, by norm_num, ?_⟩ intro Q hQ ε hε hε1 letI : IsProbabilityMeasure Q := hQ simpa only [vcSubgraphCoverBound] using (real_vcSubgraph_l2_covering F d hmeas hpdim hU hε hε1 henvelope Q) -
negtheorem — Negation preserves named polynomial-cover witnesses.hypothesesconclusionHasPolynomialL2CoverWith (fun i x => -F i x) U A pProof (Lean source)
theorem HasPolynomialL2CoverWith.neg {ι : Type v} {F : ι → 𝒳 → ℝ} {U A : ℝ} {p : ℕ} (hF : HasPolynomialL2CoverWith F U A p) : HasPolynomialL2CoverWith (fun i x => -F i x) U A p := by refine ⟨hF.forget.neg, hF.one_le_base, ?_⟩ intro Q hQ ε hε hε1 obtain ⟨C, hCcard, hCcover⟩ := hF.entropy Q hQ ε hε hε1 refine ⟨C, hCcard, ?_⟩ intro i obtain ⟨j, hjC, hij⟩ := hCcover i refine ⟨j, hjC, ?_⟩ have heq : measureL2Dist Q (fun x => -F i x) (fun x => -F j x) = measureL2Dist Q (F i) (F j) := by rw [measureL2Dist_eq_lpNorm Q _ _ (hF.forget.measurable i).fun_neg (hF.forget.measurable j).fun_neg, measureL2Dist_eq_lpNorm Q _ _ (hF.forget.measurable i) (hF.forget.measurable j)] have hfun : (fun x => -F i x - -F j x) = -(fun x => F i x - F j x) := by funext x simp only [Pi.neg_apply] ring rw [hfun, lpNorm_neg] rwa [heq] -
addtheorem — Addition combines named polynomial-cover witnesses by the same explicit formula as the ordinary cover algebra.hypotheses𝒳 :sharedType uι :Type vκ :Type wF :ι → 𝒳 → ℝG :κ → 𝒳 → ℝU V A B :ℝp q :ℕhF :HasPolynomialL2CoverWith F U A phG :HasPolynomialL2CoverWith G V B qconclusionHasPolynomialL2CoverWith (fun z : ι × κ => fun x => F z.1 x + G z.2 x) (U + V) (8 * A * B) (p + q + 2)Proof (Lean source)
theorem HasPolynomialL2CoverWith.add {ι : Type v} {κ : Type w} {F : ι → 𝒳 → ℝ} {G : κ → 𝒳 → ℝ} {U V A B : ℝ} {p q : ℕ} (hF : HasPolynomialL2CoverWith F U A p) (hG : HasPolynomialL2CoverWith G V B q) : HasPolynomialL2CoverWith (fun z : ι × κ => fun x => F z.1 x + G z.2 x) (U + V) (8 * A * B) (p + q + 2) := by have hA := hF.one_le_base have hB := hG.one_le_base have hU := hF.forget.envelope_pos have hV := hG.forget.envelope_pos refine ⟨hF.forget.add hG.forget, by nlinarith [mul_nonneg (sub_nonneg.mpr hA) (sub_nonneg.mpr hB)], ?_⟩ intro Q hQ ε hε hε1 have hhalf : 0 < ε / 2 := by positivity have hhalf1 : ε / 2 ≤ 1 := by linarith obtain ⟨CF, hCFcard, hCFcover⟩ := hF.entropy Q hQ (ε / 2) hhalf hhalf1 obtain ⟨CG, hCGcard, hCGcover⟩ := hG.entropy Q hQ (ε / 2) hhalf hhalf1 rw [show A / (ε / 2) = 2 * A / ε by field_simp] at hCFcard rw [show B / (ε / 2) = 2 * B / ε by field_simp] at hCGcard classical refine ⟨CF ×ˢ CG, ?_, ?_⟩ · rw [Finset.card_product] exact (Nat.mul_le_mul hCFcard hCGcard).trans (ceil_mul_le_ceil_poly hA hB hε hε1) · intro z obtain ⟨i, hiC, hi⟩ := hCFcover z.1 obtain ⟨j, hjC, hj⟩ := hCGcover z.2 refine ⟨(i, j), Finset.mem_product.mpr ⟨hiC, hjC⟩, ?_⟩ haveI : IsProbabilityMeasure Q := hQ calc measureL2Dist Q (fun x => F z.1 x + G z.2 x) (fun x => F i x + G j x) ≤ measureL2Dist Q (F z.1) (F i) + measureL2Dist Q (G z.2) (G j) := measureL2Dist_add_le _ _ _ _ (hF.forget.measurable z.1) (hF.forget.measurable i) (hG.forget.measurable z.2) (hG.forget.measurable j) (hF.forget.envelope z.1) (hF.forget.envelope i) _ < ε * (U + V) := by nlinarith -
multheorem — Multiplication combines named polynomial-cover witnesses by the same explicit formula as the ordinary cover algebra.hypotheses𝒳 :sharedType uι :Type vκ :Type wF :ι → 𝒳 → ℝG :κ → 𝒳 → ℝU V A B :ℝp q :ℕhF :HasPolynomialL2CoverWith F U A phG :HasPolynomialL2CoverWith G V B qconclusionHasPolynomialL2CoverWith (fun z : ι × κ => fun x => F z.1 x * G z.2 x) (U * V) (8 * A * B) (p + q + 2)Proof (Lean source)
theorem HasPolynomialL2CoverWith.mul {ι : Type v} {κ : Type w} {F : ι → 𝒳 → ℝ} {G : κ → 𝒳 → ℝ} {U V A B : ℝ} {p q : ℕ} (hF : HasPolynomialL2CoverWith F U A p) (hG : HasPolynomialL2CoverWith G V B q) : HasPolynomialL2CoverWith (fun z : ι × κ => fun x => F z.1 x * G z.2 x) (U * V) (8 * A * B) (p + q + 2) := by have hA := hF.one_le_base have hB := hG.one_le_base have hU := hF.forget.envelope_pos have hV := hG.forget.envelope_pos refine ⟨hF.forget.mul hG.forget, by nlinarith [mul_nonneg (sub_nonneg.mpr hA) (sub_nonneg.mpr hB)], ?_⟩ intro Q hQ ε hε hε1 have hhalf : 0 < ε / 2 := by positivity have hhalf1 : ε / 2 ≤ 1 := by linarith obtain ⟨CF, hCFcard, hCFcover⟩ := hF.entropy Q hQ (ε / 2) hhalf hhalf1 obtain ⟨CG, hCGcard, hCGcover⟩ := hG.entropy Q hQ (ε / 2) hhalf hhalf1 rw [show A / (ε / 2) = 2 * A / ε by field_simp] at hCFcard rw [show B / (ε / 2) = 2 * B / ε by field_simp] at hCGcard classical refine ⟨CF ×ˢ CG, ?_, ?_⟩ · rw [Finset.card_product] exact (Nat.mul_le_mul hCFcard hCGcard).trans (ceil_mul_le_ceil_poly hA hB hε hε1) · intro z obtain ⟨i, hiC, hi⟩ := hCFcover z.1 obtain ⟨j, hjC, hj⟩ := hCGcover z.2 refine ⟨(i, j), Finset.mem_product.mpr ⟨hiC, hjC⟩, ?_⟩ haveI : IsProbabilityMeasure Q := hQ calc measureL2Dist Q (fun x => F z.1 x * G z.2 x) (fun x => F i x * G j x) ≤ V * measureL2Dist Q (F z.1) (F i) + U * measureL2Dist Q (G z.2) (G j) := measureL2Dist_mul_le _ _ _ _ (hF.forget.measurable z.1) (hF.forget.measurable i) (hG.forget.measurable z.2) (hG.forget.measurable j) hF.forget.envelope_pos.le hG.forget.envelope_pos.le (hF.forget.envelope z.1) (hF.forget.envelope i) (hG.forget.envelope z.2) (hG.forget.envelope j) _ < ε * (U * V) := by nlinarith -
tightenEnvelopeBytheorem — If an assembled class has envelope c * V but a direct pointwise bound by V, shrinking the envelope by the fixed factor c costs the same factor in the named entropy base.hypotheses𝒳 :sharedType uι :Type vι → 𝒳 → ℝV A c :ℝp :ℕhF :HasPolynomialL2CoverWith F (c * V) A phc :1 ≤ chV :0 < Vhbound :∀ i x, |F i x| ≤ VconclusionHasPolynomialL2CoverWith F V (c * A) pProof (Lean source)
theorem HasPolynomialL2CoverWith.tightenEnvelopeBy {ι : Type v} {F : ι → 𝒳 → ℝ} {V A c : ℝ} {p : ℕ} (hF : HasPolynomialL2CoverWith F (c * V) A p) (hc : 1 ≤ c) (hV : 0 < V) (hbound : ∀ i x, |F i x| ≤ V) : HasPolynomialL2CoverWith F V (c * A) p := by have hc0 : 0 < c := lt_of_lt_of_le zero_lt_one hc have hbaseOne : 1 ≤ c * A := by simpa only [one_mul] using (mul_le_mul hc hF.one_le_base (by norm_num : (0 : ℝ) ≤ 1) hc0.le) refine ⟨⟨hV, hF.forget.measurable, hbound, c * A, p, hbaseOne, ?_⟩, hbaseOne, ?_⟩ · intro Q hQ ε hε hε1 have hec : 0 < ε / c := div_pos hε hc0 have hec1 : ε / c ≤ 1 := by apply (div_le_one hc0).2 exact hε1.trans hc have hradius : (ε / c) * (c * V) = ε * V := by field_simp have hbase : A / (ε / c) = (c * A) / ε := by field_simp simpa only [hradius, hbase] using hF.entropy Q hQ (ε / c) hec hec1 · intro Q hQ ε hε hε1 have hec : 0 < ε / c := div_pos hε hc0 have hec1 : ε / c ≤ 1 := by apply (div_le_one hc0).2 exact hε1.trans hc have hradius : (ε / c) * (c * V) = ε * V := by field_simp have hbase : A / (ε / c) = (c * A) / ε := by field_simp simpa only [hradius, hbase] using hF.entropy Q hQ (ε / c) hec hec1 -
negtheorem — Uniform named covers are stable under pointwise negation.hypotheses𝒳 :sharedType uS :Type*S → Type v(s : S) → ι s → 𝒳 → ℝS → ℝhF :conclusionHasUniformPolynomialL2CoverOver S (fun s i x => -F s i x) UProof (Lean source)
theorem HasUniformPolynomialL2CoverOver.neg {S : Type*} {ι : S → Type v} {F : (s : S) → ι s → 𝒳 → ℝ} {U : S → ℝ} (hF : HasUniformPolynomialL2CoverOver S F U) : HasUniformPolynomialL2CoverOver S (fun s i x => -F s i x) U := by obtain ⟨A, p, hF⟩ := hF exact ⟨A, p, fun s => (hF s).neg⟩ -
addtheorem — Uniform named covers are stable under pointwise addition.hypotheses𝒳 :sharedType uS :Type*S → Type vS → Type w(s : S) → ι s → 𝒳 → ℝ(s : S) → κ s → 𝒳 → ℝS → ℝhF :hG :conclusionHasUniformPolynomialL2CoverOver S (fun s (z : ι s × κ s) x => F s z.1 x + G s z.2 x) (fun s => U s + V s)Proof (Lean source)
theorem HasUniformPolynomialL2CoverOver.add {S : Type*} {ι : S → Type v} {κ : S → Type w} {F : (s : S) → ι s → 𝒳 → ℝ} {G : (s : S) → κ s → 𝒳 → ℝ} {U V : S → ℝ} (hF : HasUniformPolynomialL2CoverOver S F U) (hG : HasUniformPolynomialL2CoverOver S G V) : HasUniformPolynomialL2CoverOver S (fun s (z : ι s × κ s) x => F s z.1 x + G s z.2 x) (fun s => U s + V s) := by obtain ⟨A, p, hF⟩ := hF obtain ⟨B, q, hG⟩ := hG exact ⟨8 * A * B, p + q + 2, fun s => (hF s).add (hG s)⟩ -
multheorem — Uniform named covers are stable under pointwise multiplication.hypotheses𝒳 :sharedType uS :Type*S → Type vS → Type w(s : S) → ι s → 𝒳 → ℝ(s : S) → κ s → 𝒳 → ℝS → ℝhF :hG :conclusionHasUniformPolynomialL2CoverOver S (fun s (z : ι s × κ s) x => F s z.1 x * G s z.2 x) (fun s => U s * V s)Proof (Lean source)
theorem HasUniformPolynomialL2CoverOver.mul {S : Type*} {ι : S → Type v} {κ : S → Type w} {F : (s : S) → ι s → 𝒳 → ℝ} {G : (s : S) → κ s → 𝒳 → ℝ} {U V : S → ℝ} (hF : HasUniformPolynomialL2CoverOver S F U) (hG : HasUniformPolynomialL2CoverOver S G V) : HasUniformPolynomialL2CoverOver S (fun s (z : ι s × κ s) x => F s z.1 x * G s z.2 x) (fun s => U s * V s) := by obtain ⟨A, p, hF⟩ := hF obtain ⟨B, q, hG⟩ := hG exact ⟨8 * A * B, p + q + 2, fun s => (hF s).mul (hG s)⟩ -
finSumtheorem — A nonempty finite sum preserves entropy witnesses uniformly over all auxiliary parameters.hypotheses𝒳 :sharedType uS :Type*K :hF :∀ k, HasUniformPolynomialL2CoverOver S (fun s => F s k) (fun s => U s k)conclusionHasUniformPolynomialL2CoverOver S (fun s (θ : (k : K) → ι s k) x => ∑ k, F s k (θ k) x) (fun s => ∑ k, U s k)Proof (Lean source)
theorem HasUniformPolynomialL2CoverOver.finSum {S : Type*} {K : Type w} [Fintype K] [Nonempty K] {ι : (s : S) → K → Type v} {F : (s : S) → (k : K) → ι s k → 𝒳 → ℝ} {U : S → K → ℝ} (hF : ∀ k, HasUniformPolynomialL2CoverOver S (fun s => F s k) (fun s => U s k)) : HasUniformPolynomialL2CoverOver S (fun s (θ : (k : K) → ι s k) x => ∑ k, F s k (θ k) x) (fun s => ∑ k, U s k) := by classical let P : ∀ (K : Type w) [Fintype K], Prop := fun K _ => Nonempty K → ∀ (ι : (s : S) → K → Type v) (F : (s : S) → (k : K) → ι s k → 𝒳 → ℝ) (U : S → K → ℝ), (∀ k, HasUniformPolynomialL2CoverOver S (fun s => F s k) (fun s => U s k)) → HasUniformPolynomialL2CoverOver S (fun s (θ : (k : K) → ι s k) x => ∑ k, F s k (θ k) x) (fun s => ∑ k, U s k) refine Fintype.induction_empty_option (P := P) ?_ ?_ ?_ K (inferInstance : Nonempty K) ι F U hF · intro α β _ e ih hβ ι F U hF letI : Fintype α := Fintype.ofEquiv β e.symm let hα : Nonempty α := ⟨e.symm (choice hβ)⟩ have hc := ih hα (fun s a => ι s (e a)) (fun s a => F s (e a)) (fun s a => U s (e a)) (fun a => hF (e a)) obtain ⟨A, p, hc⟩ := hc refine ⟨A, p, fun s => ?_⟩ let eθ : ((b : β) → ι s b) ≃ ((a : α) → ι s (e a)) := (Equiv.piCongrLeft (ι s) e).symm have hclass : (fun θ : (b : β) → ι s b => fun x => ∑ b, F s b (θ b) x) = (fun θ : (b : β) → ι s b => fun x => ∑ a, F s (e a) (θ (e a)) x) := by funext θ x exact (e.sum_comp (fun b => F s b (θ b) x)).symm have hUeq : (∑ b, U s b) = ∑ a, U s (e a) := (e.sum_comp (U s)).symm change HasPolynomialL2CoverWith (fun θ : (b : β) → ι s b => fun x => ∑ b, F s b (θ b) x) (∑ b, U s b) A p rw [hclass, hUeq] simpa [eθ] using (hc s).reindex eθ · intro h exact isEmptyElim (choice h) · intro α _ ih _ ι F U hF by_cases hα : Nonempty α · have htail := ih hα (fun s a => ι s (some a)) (fun s a => F s (some a)) (fun s a => U s (some a)) (fun a => hF (some a)) have hadd := (hF none).add htail obtain ⟨A, p, hadd⟩ := hadd refine ⟨A, p, fun s => ?_⟩ let split : ((k : Option α) → ι s k) ≃ (ι s none × ((a : α) → ι s (some a))) := { toFun := fun θ => (θ none, fun a => θ (some a)) invFun := fun z k => Option.rec z.1 z.2 k left_inv := fun θ => by funext k; cases k <;> rfl right_inv := fun z => by cases z; rfl } simp only [Fintype.sum_option] exact (hadd s).reindex split · letI : IsEmpty α := not_nonempty_iff.mp hα obtain ⟨A, p, hone⟩ := hF none refine ⟨A, p, fun s => ?_⟩ let single : ((k : Option α) → ι s k) ≃ ι s none := { toFun := fun θ => θ none invFun := fun i k => Option.rec i (fun a => isEmptyElim a) k left_inv := fun θ => by funext k; cases k with | none => rfl | some a => exact isEmptyElim a right_inv := fun i => rfl } simp only [Fintype.sum_option, Finset.univ_eq_empty, Finset.sum_empty, add_zero] exact (hone s).reindex single
Empirical 2 core · 6 supporting This module specializes the arbitrary-probability-measure VC-subgraph theorem to the empirical law of a nonempty finite sample, translates its L² distance to the existing empirical pseudometric, and exposes a fixed total ★ real_vcSubgraph_dudley_example
Empirical-measure and Dudley bridges
This module specializes the arbitrary-probability-measure VC-subgraph theorem
to the empirical law of a nonempty finite sample, translates its L² distance
to the existing empirical pseudometric, and exposes a fixed total-boundedness
witness and covering-number bound consumable by Dudley chaining.
For a sample of observations in a measurable space, the finite-sample measure assigns equal mass to each observation, equivalently forming the normalized sum of point masses at the observations (with the displayed formula also determining the value when ).
Direct application to the fixed-sample Dudley bound. For a measurable class of pseudo-dimension at most d, uniformly bounded by a positive envelope U, and a positive scale δ strictly less than U/2, evaluated on a sample S of positive size n, the class's empirical restriction is totally bounded, its covering number at every relative radius ε in (0,1] obeys the same polynomial bound vcSubgraphCoverBound d ε, and consequently its empirical Rademacher complexity without the outer absolute value is at most the Dudley entropy-integral bound 4δ + (12/√n) ∫_δ^(U/2) √(log(coveringNumber x)) dx.
Formal statement
Proof (Lean source)
6 supporting declarations (lemmas, instances)
-
finiteSampleMeasure_isProbabilityMeasuretheorem — The empirical law of a positive-size finite sample is a probability measure.hypothesesconclusionProof (Lean source)
theorem finiteSampleMeasure_isProbabilityMeasure {n : ℕ} (S : Fin n → 𝒳) (hn : 0 < n) : IsProbabilityMeasure (finiteSampleMeasure S) := by refine ⟨?_⟩ simp only [finiteSampleMeasure, Measure.smul_apply, Measure.finset_sum_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), Finset.sum_const, Finset.card_univ, Fintype.card_fin] rw [ENNReal.ofReal_natCast] simpa [nsmul_eq_mul] using ENNReal.inv_mul_cancel (Nat.cast_ne_zero.mpr (Nat.ne_of_gt hn)) (ENNReal.natCast_ne_top n) -
integral_finiteSampleMeasuretheorem — Integration against the empirical law is the arithmetic average of a measurable real-valued function over the sample.hypothesesconclusion∫ x, f x ∂finiteSampleMeasure S = (1 / (n : ℝ)) * ∑ i : Fin n, f (S i)Proof (Lean source)
theorem integral_finiteSampleMeasure {n : ℕ} (S : Fin n → 𝒳) (hn : 0 < n) {f : 𝒳 → ℝ} (hf : Measurable f) : ∫ x, f x ∂finiteSampleMeasure S = (1 / (n : ℝ)) * ∑ i : Fin n, f (S i) := by rw [finiteSampleMeasure, integral_smul_measure] rw [integral_finset_sum_measure] · simp only [integral_dirac' f _ hf.stronglyMeasurable, ENNReal.toReal_inv, ENNReal.ofReal_natCast, ENNReal.toReal_natCast, smul_eq_mul] rw [one_div] · intro i hi exact integrable_dirac' hf.stronglyMeasurable (by simp) -
measureL2Dist_finiteSampleMeasure_eq_empiricalDisttheorem — L² distance under the empirical law agrees exactly with the empirical root-mean-square distance used by the existing Dudley API.hypothesesconclusionProof (Lean source)
theorem measureL2Dist_finiteSampleMeasure_eq_empiricalDist {n : ℕ} (S : Fin n → 𝒳) (hn : 0 < n) {f g : 𝒳 → ℝ} (hf : Measurable f) (hg : Measurable g) : measureL2Dist (finiteSampleMeasure S) f g = empiricalDist S f g := by rw [measureL2Dist, empiricalDist, empiricalNorm, integral_finiteSampleMeasure S hn ((hf.fun_sub hg).pow_const 2)] simp only [Pi.sub_apply, one_div] -
real_vcSubgraph_empirical_l2_coveringtheorem — The arbitrary-measure VC-subgraph theorem specializes to the empirical law of every positive-size finite sample.hypotheses𝒳 :sharedType uι :sharedType vNonempty ιι → 𝒳 → ℝd n :ℕhmeas :∀ i, Measurable (F i)hpdim :U ε :ℝhU :0 < Uhε :0 < εhε1 :ε ≤ 1henvelope :∀ i x, |F i x| ≤ US :Fin n → 𝒳hn :0 < nconclusionProof (Lean source)
theorem real_vcSubgraph_empirical_l2_covering [Nonempty ι] {F : ι → 𝒳 → ℝ} {d n : ℕ} (hmeas : ∀ i, Measurable (F i)) (hpdim : HasPseudoDimAtMost F d) {U ε : ℝ} (hU : 0 < U) (hε : 0 < ε) (hε1 : ε ≤ 1) (henvelope : ∀ i x, |F i x| ≤ U) (S : Fin n → 𝒳) (hn : 0 < n) : L2CoveringNumberLe (finiteSampleMeasure S) F (ε * U) (vcSubgraphCoverBound d ε) := by letI : IsProbabilityMeasure (finiteSampleMeasure S) := finiteSampleMeasure_isProbabilityMeasure S hn exact real_vcSubgraph_l2_covering F d hmeas hpdim hU hε hε1 henvelope (finiteSampleMeasure S) -
real_vcSubgraph_empirical_totallyBoundedtheorem — A pseudo-dimension certificate makes the existing empirical function space totally bounded on every positive-size finite sample.hypotheses𝒳 :sharedType uι :sharedType vNonempty ιι → 𝒳 → ℝd n :ℕhmeas :∀ i, Measurable (F i)hpdim :U :ℝhU :0 < Uhenvelope :∀ i x, |F i x| ≤ US :Fin n → 𝒳hn :0 < nconclusionProof (Lean source)
theorem real_vcSubgraph_empirical_totallyBounded [Nonempty ι] {F : ι → 𝒳 → ℝ} {d n : ℕ} (hmeas : ∀ i, Measurable (F i)) (hpdim : HasPseudoDimAtMost F d) {U : ℝ} (hU : 0 < U) (henvelope : ∀ i x, |F i x| ≤ U) (S : Fin n → 𝒳) (hn : 0 < n) : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S)) := by classical rw [Metric.totallyBounded_iff] intro r hr let ε : ℝ := min 1 (r / U) have hε : 0 < ε := lt_min (by norm_num) (div_pos hr hU) have hε1 : ε ≤ 1 := min_le_left _ _ obtain ⟨C, hCcard, hCcover⟩ := real_vcSubgraph_empirical_l2_covering hmeas hpdim hU hε hε1 henvelope S hn let T : Finset (EmpiricalFunctionSpace F S) := C.image fun j => ⟨j⟩ refine ⟨(T : Set (EmpiricalFunctionSpace F S)), T.finite_toSet, ?_⟩ intro q hq obtain ⟨j, hjC, hj⟩ := hCcover q.index have hεU : ε * U ≤ r := by calc ε * U ≤ (r / U) * U := mul_le_mul_of_nonneg_right (min_le_right _ _) (le_of_lt hU) _ = r := by field_simp have hj' : empiricalDist S (F q.index) (F j) < r := by rw [← measureL2Dist_finiteSampleMeasure_eq_empiricalDist S hn (hmeas q.index) (hmeas j)] exact lt_of_lt_of_le hj hεU refine Set.mem_iUnion_of_mem (⟨j⟩ : EmpiricalFunctionSpace F S) ?_ refine Set.mem_iUnion_of_mem ?_ ?_ · exact Finset.mem_coe.mpr (Finset.mem_image.mpr ⟨j, hjC, rfl⟩) · exact hj' -
real_vcSubgraph_empirical_coveringNumber_letheorem — The empirical covering number used by Dudley is polynomially bounded at every envelope-relative radius, with the same arbitrary-measure constants.hypotheses𝒳 :sharedType uι :sharedType vNonempty ιι → 𝒳 → ℝd n :ℕhmeas :∀ i, Measurable (F i)hpdim :U ε :ℝhU :0 < Uhε :0 < εhε1 :ε ≤ 1henvelope :∀ i x, |F i x| ≤ US :Fin n → 𝒳hn :0 < nconclusionhtot :real_vcSubgraph_empirical_totallyBounded hmeas hpdim hU henvelope S hncoveringNumber htot (ε * U) ≤ vcSubgraphCoverBound d εProof (Lean source)
theorem real_vcSubgraph_empirical_coveringNumber_le [Nonempty ι] {F : ι → 𝒳 → ℝ} {d n : ℕ} (hmeas : ∀ i, Measurable (F i)) (hpdim : HasPseudoDimAtMost F d) {U ε : ℝ} (hU : 0 < U) (hε : 0 < ε) (hε1 : ε ≤ 1) (henvelope : ∀ i x, |F i x| ≤ U) (S : Fin n → 𝒳) (hn : 0 < n) : let htot := real_vcSubgraph_empirical_totallyBounded hmeas hpdim hU henvelope S hn coveringNumber htot (ε * U) ≤ vcSubgraphCoverBound d ε := by classical dsimp only let htot := real_vcSubgraph_empirical_totallyBounded hmeas hpdim hU henvelope S hn let r := ε * U have hr : 0 < r := mul_pos hε hU obtain ⟨C, hCcard, hCcover⟩ := real_vcSubgraph_empirical_l2_covering hmeas hpdim hU hε hε1 henvelope S hn let T : Finset (EmpiricalFunctionSpace F S) := C.image fun j => ⟨j⟩ have hTcover : (Set.univ : Set (EmpiricalFunctionSpace F S)) ⊆ ⋃ y ∈ T, ball y r := by intro q hq obtain ⟨j, hjC, hj⟩ := hCcover q.index have hj' : empiricalDist S (F q.index) (F j) < r := by rw [← measureL2Dist_finiteSampleMeasure_eq_empiricalDist S hn (hmeas q.index) (hmeas j)] exact hj refine Set.mem_iUnion_of_mem (⟨j⟩ : EmpiricalFunctionSpace F S) ?_ refine Set.mem_iUnion_of_mem ?_ ?_ · exact Finset.mem_coe.mpr (Finset.mem_image.mpr ⟨j, hjC, rfl⟩) · exact hj' rw [coveringNumber_eq htot hr] calc find (coveringNumber_exists htot hr) ≤ T.card := Nat.find_min' (coveringNumber_exists htot hr) ⟨T, rfl, hTcover⟩ _ ≤ C.card := Finset.card_image_le _ ≤ vcSubgraphCoverBound d ε := hCcard
Parametric 4 core · 3 supporting This module supplies the bounded finite-dimensional linear-parameter class and the composition of a polynomial-entropy real class with a measurable finite-VC family of indicators. ★ linearParameterClass_hasPolynomialL2Cover
Parametric and VC-indicator covering interfaces
This module supplies the bounded finite-dimensional linear-parameter class and the composition of a polynomial-entropy real class with a measurable finite-VC family of indicators.
Given an index set of coefficients and a real bound, the coefficient box is the set of real coefficient vectors indexed by that set for which every coordinate has absolute value at most .
Definition (Lean source)
Given a finite index set, a real-valued feature family, a coefficient bound, a coefficient vector in the corresponding box, and an evaluation point, the linear parameter class evaluation is the sum of each coefficient times its corresponding feature value at that point.
Covering certificate for a bounded-coefficient linear class. Given a finite family of measurable real-valued features, each bounded in absolute value by M, where B is a positive coefficient bound and M is positive, the class of linear combinations of the features with each coefficient constrained to [-B,B] carries a uniform polynomial L² covering certificate at envelope |K|·B·M.
Formal statement
Proof (Lean source)
Given a Boolean classifier family and a natural number, the property of having VC dimension at most that number means that, for every finite sample, the VC dimension of the label patterns realized on that sample is at most .
Definition (Lean source)
3 supporting declarations (lemmas, instances)
-
linearParameterClass_hasPseudoDimAtMosttheorem — A finite-dimensional linear class has pseudo-dimension bounded by the number of coordinates (the stated +1 leaves room for the affine threshold).hypothesesconclusionProof (Lean source)
theorem linearParameterClass_hasPseudoDimAtMost {K : Type w} [Fintype K] (φ : K → 𝒳 → ℝ) (B : ℝ) : HasPseudoDimAtMost (linearParameterClass φ B) (card K + 1) := by classical intro n T unfold vcDim refine Finset.sup_le fun s hs => ?_ rw [Finset.mem_shatterer] at hs by_contra hcard have hcard_lt : card K + 1 < s.card := by omega let v : {i // i ∈ s} → Option K → ℝ := fun i q => match q with | none => -(T i.1).2 | some k => φ k (T i.1).1 have hvdep : ¬ LinearIndependent ℝ v := by intro hv have hle := hv.fintype_card_le_finrank rw [Module.finrank_pi, Fintype.card_option, Fintype.card_coe] at hle omega obtain ⟨a, ha0, i0, hi0⟩ := Fintype.not_linearIndependent_iff.mp hvdep let g : {i // i ∈ s} → ℝ := if 0 < a i0 then a else fun i => -a i have hg0 : ∑ i, g i • v i = 0 := by dsimp [g] split_ifs · exact ha0 · calc ∑ i, (-a i) • v i = ∑ i, -(a i • v i) := by apply Finset.sum_congr rfl intro i _ exact neg_smul (a i) (v i) _ = -(∑ i, a i • v i) := by rw [Finset.sum_neg_distrib] _ = 0 := by rw [ha0, neg_zero] have hgi0 : 0 < g i0 := by dsimp [g] split_ifs with h · exact h · dsimp exact neg_pos.mpr (lt_of_le_of_ne (le_of_not_gt h) hi0) let g0 : Fin n → ℝ := fun i => if hi : i ∈ s then g ⟨i, hi⟩ else 0 let t : Finset (Fin n) := s.filter fun i => 0 < g0 i have hts : t ⊆ s := filter_subset _ _ obtain ⟨u, hu_growth, hsu⟩ := hs hts obtain ⟨θ, hθ⟩ := (mem_growthFamily_iff.mp hu_growth) have hlabel (i : {i // i ∈ s}) : subgraphClassifier (linearParameterClass φ B) θ (T i.1) = true ↔ 0 < g i := by rw [← restrictionPattern_mem_iff (p := subgraphClassifier (linearParameterClass φ B) θ) (S := T) (j := i.1), hθ] have hi_mem : i.1 ∈ u ↔ i.1 ∈ t := by constructor · intro hiu have : i.1 ∈ s ∩ u := Finset.mem_inter.mpr ⟨i.2, hiu⟩ rwa [hsu] at this · intro hit have : i.1 ∈ s ∩ u := by rwa [hsu] exact (Finset.mem_inter.mp this).2 rw [hi_mem] simp only [t, mem_filter, i.2, true_and] simp [g0, i.2] let e : {i // i ∈ s} → ℝ := fun i => linearParameterClass φ B θ (T i.1).1 - (T i.1).2 have he_pos (i : {i // i ∈ s}) (hi : 0 < g i) : 0 < e i := by have hlt : (T i.1).2 < linearParameterClass φ B θ (T i.1).1 := by simpa [subgraphClassifier] using (hlabel i).2 hi dsimp [e] linarith have he_nonpos (i : {i // i ∈ s}) (hi : ¬ 0 < g i) : e i ≤ 0 := by have hnot : ¬ (T i.1).2 < linearParameterClass φ B θ (T i.1).1 := by simpa [subgraphClassifier] using (hlabel i).not.mpr hi dsimp [e] linarith have hprod_nonneg (i : {i // i ∈ s}) : 0 ≤ g i * e i := by by_cases hi : 0 < g i · exact (mul_pos hi (he_pos i hi)).le · have hgle : g i ≤ 0 := le_of_not_gt hi exact mul_nonneg_of_nonpos_of_nonpos hgle (he_nonpos i hi) have hprod_pos : 0 < g i0 * e i0 := mul_pos hgi0 (he_pos i0 hgi0) have hsum_pos : 0 < ∑ i, g i * e i := by exact Finset.sum_pos' (fun i _ => hprod_nonneg i) ⟨i0, Finset.mem_univ _, hprod_pos⟩ have hsum_zero : ∑ i, g i * e i = 0 := by have hcoord (q : Option K) : ∑ i, g i * v i q = 0 := by have := congrFun hg0 q simpa [Pi.smul_apply, smul_eq_mul] using this rw [show (∑ i, g i * e i) = ∑ q : Option K, (match q with | none => 1 | some k => θ.1 k) * ∑ i, g i * v i q by simp_rw [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ change g i * ((∑ k, θ.1 k * φ k (T i.1).1) - (T i.1).2) = _ rw [mul_sub, Finset.mul_sum] simp only [Fintype.sum_option, v] ring] simp only [hcoord, mul_zero, Finset.sum_const_zero] linarith -
indicatorClass_hasPseudoDimAtMosttheorem — A Boolean VC class, viewed as a real-valued zero-one indicator class, has the same pseudo-dimension bound.hypothesesconclusionHasPseudoDimAtMost (fun j x => if π j x then 1 else 0) dProof (Lean source)
-- @node: HasVCAtMost.indicatorClass_hasPseudoDimAtMost theorem HasVCAtMost.indicatorClass_hasPseudoDimAtMost {κ : Type w} (π : κ → 𝒳 → Bool) (d : ℕ) (hπvc : HasVCAtMost π d) : HasPseudoDimAtMost (fun j x => if π j x then 1 else 0) d := by classical intro n T unfold vcDim refine Finset.sup_le fun s hs => ?_ rw [Finset.mem_shatterer] at hs obtain ⟨uTop, huTop, hTop⟩ := hs (Finset.Subset.rfl) obtain ⟨jTop, hjTop⟩ := mem_growthFamily_iff.mp huTop obtain ⟨uBot, huBot, hBot⟩ := hs (empty_subset s) obtain ⟨jBot, hjBot⟩ := mem_growthFamily_iff.mp huBot have hupper (i : Fin n) (hi : i ∈ s) : (T i).2 < 1 := by have hiTop : i ∈ uTop := by have : i ∈ s ∩ uTop := by rwa [hTop] exact (Finset.mem_inter.mp this).2 have htrue : subgraphClassifier (fun j x => if π j x then 1 else 0) jTop (T i) = true := by rw [← restrictionPattern_mem_iff (p := subgraphClassifier (fun j x => if π j x then 1 else 0) jTop) (S := T) (j := i), hjTop] exact hiTop have hlt : (T i).2 < if π jTop (T i).1 then 1 else 0 := by simpa [subgraphClassifier] using htrue cases hπi : π jTop (T i).1 <;> simp [hπi] at hlt ⊢ <;> linarith have hlower (i : Fin n) (hi : i ∈ s) : 0 ≤ (T i).2 := by have hiBot : i ∉ uBot := by intro hiu have : i ∈ s ∩ uBot := Finset.mem_inter.mpr ⟨hi, hiu⟩ rw [hBot] at this exact Finset.notMem_empty i this have hfalse : subgraphClassifier (fun j x => if π j x then 1 else 0) jBot (T i) ≠ true := by intro htrue apply hiBot rw [← hjBot, restrictionPattern_mem_iff] exact htrue have hnot : ¬ (T i).2 < if π jBot (T i).1 then 1 else 0 := by simpa [subgraphClassifier] using hfalse cases hπi : π jBot (T i).1 <;> simp [hπi] at hnot ⊢ <;> linarith have hmiddle (j : κ) (i : Fin n) (hi : i ∈ s) : subgraphClassifier (fun j x => if π j x then 1 else 0) j (T i) = true ↔ π j (T i).1 = true := by cases hπi : π j (T i).1 · simp [subgraphClassifier, hπi, hlower i hi] · simp [subgraphClassifier, hπi, hupper i hi] have hshπ : (growthFamily π (fun i => (T i).1)).Shatters s := by intro t ht obtain ⟨u, hu, hsu⟩ := hs ht obtain ⟨j, hj⟩ := mem_growthFamily_iff.mp hu refine ⟨restrictionPattern (π j) (fun i => (T i).1), ?_, ?_⟩ · rw [mem_growthFamily_iff] exact ⟨j, rfl⟩ · ext i by_cases hi : i ∈ s · have hpiu : i ∈ restrictionPattern (π j) (fun i => (T i).1) ↔ i ∈ u := by rw [restrictionPattern_mem_iff, ← hmiddle j i hi, ← restrictionPattern_mem_iff, hj] have hut : i ∈ u ↔ i ∈ t := by constructor · intro hiu have : i ∈ s ∩ u := Finset.mem_inter.mpr ⟨hi, hiu⟩ rwa [hsu] at this · intro hit have : i ∈ s ∩ u := by rwa [hsu] exact (Finset.mem_inter.mp this).2 simp only [mem_inter, hi, true_and] exact hpiu.trans hut · simp only [mem_inter, hi, false_and] exact (iff_false_intro fun hit => hi (ht hit)).symm exact hshπ.card_le_vcDim.trans (hπvc n fun i => (T i).1) -
mulIndicatortheorem — Multiplying a polynomial-entropy real class by a measurable finite-VC family of indicators preserves uniform polynomial L² entropy.hypotheses𝒳 :sharedType uι :Type vκ :Type wF :ι → 𝒳 → ℝπ :κ → 𝒳 → BoolU :ℝd :ℕhF :hπmeas :∀ j, MeasurableSet {x | π j x = true}hπvc :HasVCAtMost π dconclusionHasPolynomialL2Cover (fun p : ι × κ => fun x => F p.1 x * if π p.2 x then 1 else 0) UProof (Lean source)
theorem HasPolynomialL2Cover.mulIndicator {ι : Type v} {κ : Type w} {F : ι → 𝒳 → ℝ} {π : κ → 𝒳 → Bool} {U : ℝ} {d : ℕ} (hF : HasPolynomialL2Cover F U) (hπmeas : ∀ j, MeasurableSet {x | π j x = true}) (hπvc : HasVCAtMost π d) : HasPolynomialL2Cover (fun p : ι × κ => fun x => F p.1 x * if π p.2 x then 1 else 0) U := by rcases isEmpty_or_nonempty κ with hκ | hκ · letI : IsEmpty κ := hκ refine ⟨hF.envelope_pos, ?_, ?_, ?_⟩ · intro p exact isEmptyElim p.2 · intro p exact isEmptyElim p.2 · refine ⟨1, 0, le_rfl, ?_⟩ intro Q hQ ε hε hε1 classical refine ⟨∅, by simp, ?_⟩ intro p exact isEmptyElim p.2 · letI : Nonempty κ := hκ have hindicator : HasPolynomialL2Cover (fun j x => if π j x then 1 else 0) 1 := (HasVCAtMost.indicatorClass_hasPseudoDimAtMost π d hπvc).hasPolynomialL2Cover (fun j => Measurable.ite (hπmeas j) measurable_const measurable_const) (by norm_num) (by intro j x cases π j x <;> simp) simpa using hF.mul hindicator