Stat.Concentration.Covering
Covering-number, packing, and entropy-integral tools for function classes, including empirical pseudometrics and the finite-VC localized covering and uniform-deviation specializations housed under Covering/.
EmpiricalPseudoMetric 5 core · 8 supporting Defines the empirical L² pseudometric on function classes used by Dudley entropy bounds. ★ empiricalDist_def
Defines the empirical L² pseudometric on function classes used by Dudley entropy bounds.
The file provides empiricalNorm, empiricalDist, the pseudometric
empiricalPMet, and the indexed EmpiricalFunctionSpace wrapper. It also
records the coordinate projection bound empiricalDist_proj, which converts an
empirical-norm bound into pointwise control on the fixed sample.
UPSTREAM-DELTA: declarations are placed in the
Causalean.Stat.Concentration namespace. The proofs are otherwise kept close
to upstream, with only Mathlib API-drift adjustments for Lean 4.29.
For a sample of observations and a real-valued function on its observation space, the empirical norm of the function on that sample is the square root of the average of its squared values at the sample observations.
For a sample of observations and two real-valued functions on its observation space, the empirical distance between the functions is the empirical norm of their pointwise difference on that sample.
Definition (Lean source)
For a fixed sample S and functions f and g, the empirical distance between f and g equals the empirical norm of their pointwise difference.
Formal statement
Proof (Lean source)
For a sample of observations, the empirical pseudometric on real-valued functions on the observation space is the pseudometric whose distance between two functions is their empirical distance on that sample.
Definition (Lean source)
An element of the empirical function space is an index picking out one function of the class; the structure packages the indexed class of functions equipped with the empirical pseudometric induced by a fixed sample.
Definition (Lean source)
8 supporting declarations (lemmas, instances)
-
empiricalNorm_deflemma — The empirical norm unfolds to the square root of the average squared sample values.hypothesesconclusionProof (Lean source)
@[causal_defs_simps] lemma empiricalNorm_def (S : Fin n → 𝒳) (f : 𝒳 → ℝ) : empiricalNorm S f = sqrt ((1 / n) * ∑ i : Fin n, (f (S i))^2) := rfl -
empiricalDist_commlemma — The empirical distance is symmetric.hypothesesconclusionempiricalDist S f g = empiricalDist S g fProof (Lean source)
@[simp] lemma empiricalDist_comm (S : Fin n → 𝒳) (f g : 𝒳 → ℝ) : empiricalDist S f g = empiricalDist S g f := by dsimp [empiricalDist, empiricalNorm] grind -
empiricalDist_projlemma — A single sample coordinate is bounded by the empirical norm up to the sample-size scaling.hypothesesconclusion|f (S i)|/√n ≤ empiricalNorm S fProof (Lean source)
lemma empiricalDist_proj (S : Fin n → 𝒳) (f : 𝒳 → ℝ) (i : Fin n) : |f (S i)|/√n ≤ empiricalNorm S f := by calc _ = √(f (S i)^2)/√n := by have : √(f (S i)^2) = |f (S i)| := by exact Real.sqrt_sq_eq_abs (f (S i)) rw [this] _ = √((f (S i)^2)/n) := by simp _ ≤ _ := by dsimp [empiricalNorm] apply Real.sqrt_le_sqrt rw [one_div_mul_eq_div] refine div_le_div_of_nonneg_right ?_ ?_ · have hnonneg : ∀ j ∈ univ, 0 ≤ (f (S j))^2 := by intro j hj; exact sq_nonneg _ have hi : i ∈ univ := by simp simpa using (Finset.single_le_sum (s := univ) (f := fun j => (f (S j))^2) hnonneg hi) · simp -
instCoeFunEmpiricalFunctionSpaceForallRealinstance — For every observation space, sample size, index set, real-valued function class on that space, and sample of that size, the function-evaluation coercion identifies each empirical-function-space element with the function selected by its index; its evaluation rule returns that selected function.parametersinstancegiven bycoe f := F f.index -
coe_applylemma — Coercing an empirical function-space element gives the indexed function it stores.hypotheses𝒳 :sharedType vn :sharedℕι :sharedType uι → 𝒳 → ℝq :conclusion(q : 𝒳 → ℝ) = F q.indexProof (Lean source)
@[simp] lemma EmpiricalFunctionSpace.coe_apply (q : EmpiricalFunctionSpace F S) : (q : 𝒳 → ℝ) = F q.index := rfl -
instDistEmpiricalFunctionSpaceinstance — For every observation space, sample size, index set, real-valued function class on that space, and sample of that size, the distance structure on the empirical function space assigns to two selected functions their empirical distance on the sample; its distance rule is that empirical distance. -
dist_deftheorem∀ {𝒳 : Type v} {n : ℕ} {ι : Type u} {F : ι → 𝒳 → ℝ} {S : Fin n → 𝒳} (f g : EmpiricalFunctionSpace F S), dist f g = empiricalNorm S (F f.index - F g.index)Proof (Lean source)
@[simps!] -
instPseudoMetricSpaceEmpiricalFunctionSpaceinstance — For every observation space, sample size, index set, real-valued function class on that space, and sample of that size, the pseudometric-space structure on the empirical function space is the one induced by the empirical pseudometric of the selected functions on that sample.
CoveringNumber 4 core · 9 supporting Defines extended metric covering numbers for arbitrary sets and proves their basic properties. ★ coveringNumber_eq
Defines extended metric covering numbers for arbitrary sets and proves their basic properties.
This file provides the extended-natural coveringNumber, the natural-valued
compatibility function coveringNumber', the chosen minimizing net
coveringFinset, and the basic facts used by the Dudley entropy-integral
bound: positivity on nonempty sets, antitonicity in the radius, and
almost-everywhere measurability of the covering-number function.
UPSTREAM-DELTA: unlike the vendored original, coveringNumber is defined for
every set and takes value ∞ when no finite cover exists. This intentional
departure permits entropy bounds to be stated before total boundedness is
established. The natural-valued API is retained under the primed name to keep
the downstream Dudley development close to upstream.
For any subset of a pseudometric space and any real radius , the extended covering number is the infimum of the extended-natural cardinalities of finite families of open -balls that cover ; it is infinite when there is no such finite cover.
Definition (Lean source)
For a totally bounded set and a radius, the natural-valued compatibility covering number is the finite part of its extended covering number.
Definition (Lean source)
For a totally bounded subset of a pseudometric space and a positive covering radius, the extended covering number is the natural minimum cardinality selected by coveringNumber_exists.
Formal statement
Proof (Lean source)
For a totally bounded subset of a pseudometric space and a strictly positive real radius , the chosen finite -net for is a finite set whose cardinality attains the covering number.
Definition (Lean source)
9 supporting declarations (lemmas, instances)
-
coveringNumber_existslemma — A totally bounded set has a finite positive-radius net, with the net size recorded as a natural number.hypothesesProof (Lean source)
lemma coveringNumber_exists {X : Type*} {A : Set X} [PseudoMetricSpace X] (ha : TotallyBounded A) {ε : ℝ} (εpos : ε > 0) : ∃ n : Nat, ∃ t : Finset X, t.card = n ∧ A ⊆ ⋃ y ∈ t, ball y ε := by have hball := Metric.finite_approx_of_totallyBounded ha ε εpos have ⟨t, ⟨_ht, tfin, tball⟩⟩ := hball have : Fintype t := tfin.fintype let n : Nat := this.card exists n exists t.toFinset constructor · exact Set.toFinset_card t · convert tball simp only [Set.mem_toFinset] -
coveringNumber_lt_top_of_totallyBoundedtheorem — A totally bounded set at a positive radius has finite extended covering number.hypothesesconclusioncoveringNumber A ε < ⊤Proof (Lean source)
theorem coveringNumber_lt_top_of_totallyBounded {X : Type*} [PseudoMetricSpace X] {A : Set X} (ha : TotallyBounded A) {ε : ℝ} (hε : ε > 0) : coveringNumber A ε < ⊤ := by rw [coveringNumber_eq ha hε] exact ENat.natCast_lt_top _ -
coveringNumber'_eqtheorem — For a totally bounded subset and a positive radius, the natural-valued compatibility covering number equals the selected minimum finite-net cardinality.hypothesesconclusionProof (Lean source)
theorem coveringNumber'_eq {X : Type*} [PseudoMetricSpace X] {A : Set X} (ha : TotallyBounded A) {ε : ℝ} (hε : ε > 0) : coveringNumber' ha ε = find (coveringNumber_exists ha hε) := by simp [coveringNumber', coveringNumber_eq ha hε] -
coveringNumber'_antitonetheorem — For a totally bounded set, its natural-valued covering number weakly decreases as the positive covering radius grows.hypothesesX :ha :conclusionProof (Lean source)
theorem coveringNumber'_antitone {X : Type*} [PseudoMetricSpace X] {A : Set X} (ha : TotallyBounded A) : AntitoneOn (coveringNumber' ha) (Ioi 0) := by intro ε₁ hε₁ ε₂ hε₂ hε₁ε₂ rw [coveringNumber'_eq ha hε₁, coveringNumber'_eq ha hε₂] apply Nat.find_mono intro n ⟨t, ht₁, ht₂⟩ exists t, ht₁ apply ht₂.trans apply Set.iUnion_mono intro _ apply Set.iUnion_mono intro _ exact Metric.ball_subset_ball hε₁ε₂ -
coveringNumber'_nonzerotheorem — For a nonempty set, total boundedness, and a positive radius, the natural-valued covering number is positive.hypothesesconclusion0 < coveringNumber' ha εProof (Lean source)
theorem coveringNumber'_nonzero {X : Type*} [PseudoMetricSpace X] {A : Set X} (hs : A.Nonempty) (ha : TotallyBounded A) {ε : ℝ} (hε : ε > 0) : 0 < coveringNumber' ha ε := by rw [coveringNumber'_eq ha hε] rw [Nat.find_pos] simpa using Set.nonempty_iff_ne_empty.mp hs -
coveringNumber'_eq_zero_of_nonpostheorem — For a totally bounded subset at a nonpositive radius, the natural-valued compatibility covering number is zero, matching the legacy convention.hypothesesconclusioncoveringNumber' ha ε = 0Proof (Lean source)
theorem coveringNumber'_eq_zero_of_nonpos {X : Type*} [PseudoMetricSpace X] {A : Set X} (ha : TotallyBounded A) {ε : ℝ} (hε : ε ≤ 0) : coveringNumber' ha ε = 0 := by rw [coveringNumber', ENat.toNat_eq_zero] by_cases hA : A.Nonempty · right rw [coveringNumber] rw [show {n : ℕ∞ | ∃ t : Finset X, (t.card : ℕ∞) = n ∧ A ⊆ ⋃ y ∈ t, ball y ε} = ∅ by apply Set.eq_empty_iff_forall_notMem.mpr intro n hn obtain ⟨t, _htcard, htcover⟩ := hn obtain ⟨x, hx⟩ := hA have hxcover := htcover hx simp only [Set.mem_iUnion] at hxcover obtain ⟨y, _hy, hxy⟩ := hxcover have hdist : ε ≤ dist x y := hε.trans dist_nonneg exact (not_lt_of_ge hdist) (Metric.mem_ball.mp hxy)] exact sInf_empty · left rw [coveringNumber, ENat.sInf_eq_zero] refine ⟨∅, ?_, ?_⟩ · simp · simpa [Set.not_nonempty_iff_eq_empty.mp hA] -
coveringNumber'_aemeasurabletheorem — For a totally bounded set and a measure on the radius line, the natural-valued covering-number function is almost-everywhere measurable.hypothesesconclusionAEMeasurable (coveringNumber' ha) μProof (Lean source)
@[fun_prop] theorem coveringNumber'_aemeasurable {X : Type*} [PseudoMetricSpace X] {A : Set X} (ha : TotallyBounded A) (μ : Measure ℝ) : AEMeasurable (coveringNumber' ha) μ := by have h₀ : AEMeasurable (coveringNumber' ha) (μ.restrict (Ioi 0)) := aemeasurable_restrict_of_antitoneOn measurableSet_Ioi (coveringNumber'_antitone ha) convert (aemeasurable_indicator_iff measurableSet_Ioi).mpr h₀ ext ε if h : ε ∈ Ioi 0 then rw [Set.indicator_of_mem h] else rw [Set.indicator_of_notMem h] exact coveringNumber'_eq_zero_of_nonpos ha (le_of_not_gt h) -
coveringFinset_coverlemma — For a totally bounded set and a positive radius, the chosen covering finset covers the target set by balls of that radius.hypothesesconclusionA ⊆ ⋃ y ∈ coveringFinset ha hε, ball y εProof (Lean source)
lemma coveringFinset_cover {X : Type*} [PseudoMetricSpace X] {A : Set X} (ha : TotallyBounded A) {ε : ℝ} (hε : ε > 0) : A ⊆ ⋃ y ∈ coveringFinset ha hε, ball y ε := by simpa [coveringFinset, coveringNumber_exists] using (Classical.choose_spec (Nat.find_spec (coveringNumber_exists (X := X) (A := A) ha hε))).2 -
coveringFinset_cardlemma — For a totally bounded set and a positive radius, the chosen covering finset has cardinality equal to the natural-valued covering number.hypothesesconclusion(coveringFinset ha hε).card = coveringNumber' ha εProof (Lean source)
lemma coveringFinset_card {X : Type*} [PseudoMetricSpace X] {A : Set X} (ha : TotallyBounded A) {ε : ℝ} (hε : ε > 0) : (coveringFinset ha hε).card = coveringNumber' ha ε := by have h := (Classical.choose_spec (Nat.find_spec (coveringNumber_exists (X := X) (A := A) ha hε))).1 simpa [coveringFinset, coveringNumber'_eq (X := X) (A := A) ha hε, coveringNumber_exists] using h
VCCovering 5 core · 9 supporting For a binary-indexed function class, the empirical covering number is bounded by the Sauer-Shelah growth function of the underlying VC class, avoiding the Haussler packing argument. ★ vc_coveringNumber_le_sum_choose★ log_coveringNumber_le
For a binary-indexed function class, the empirical covering number is bounded by the Sauer-Shelah growth function of the underlying VC class, avoiding the Haussler packing argument.
The sample restriction of a real-valued class F is assumed to factor through a
Boolean class π: at sample coordinate j, the real value is a fixed transform
φ j of the bit π i (S j). Distinct empirical vectors of F are therefore
indexed by distinct Boolean restriction patterns on the sample. One
representative per realized pattern covers the empirical pseudometric space at
every positive radius, and Sauer-Shelah bounds the number of such patterns.
The main exported results are vc_coveringNumber_le_growth,
vc_coveringNumber_le_sum_choose, log_coveringNumber_le_of_card_bound, and
log_coveringNumber_le.
For a Boolean-valued classifier and a sample of observations, the restriction pattern of the classifier on the sample is the finite set of sample coordinates at which the classifier is true.
For a family of Boolean-valued classifiers and a sample of observations, the growth family of the classifier family on the sample is the finite collection of all restriction patterns realized by at least one classifier in the family.
For a family of real-valued functions, a family of Boolean-valued classifiers, and a sample of observations, the pattern cover contains one empirical-function representative for each Boolean restriction pattern realized by the classifier family on that sample.
Definition (Lean source)
Sauer-Shelah covering-number bound for a binary-factored class. Suppose the real-valued class factors through a Boolean classifier at each sample coordinate: F i (S j) = φ j (π i (S j)), so that the sample-restricted class is totally bounded in the empirical pseudometric, the covering radius ε is positive, and the induced Boolean growth family on the sample has VC dimension at most d. Then the empirical covering number at radius ε is at most the Sauer-Shelah binomial sum ∑_{k≤d} C(n,k).
Formal statement
Proof (Lean source)
Logarithmic Sauer-Shelah covering-number bound. Under the binary-factoring hypothesis F i (S j) = φ j (π i (S j)), with the sample-restricted class totally bounded in the empirical pseudometric, a positive covering radius ε, a positive sample size n, and VC dimension at most d for the induced Boolean growth family on the sample, the logarithm of the empirical covering number at radius ε is at most log(d+1) + d·log n.
Formal statement
Proof (Lean source)
9 supporting declarations (lemmas, instances)
-
mem_growthFamily_ifflemma — Membership in the growth family means that some classifier realizes that restriction pattern on the sample.hypothesesconclusionA ∈ growthFamily π S ↔ ∃ i : ι, restrictionPattern (π i) S = AProof (Lean source)
lemma mem_growthFamily_iff {π : ι → 𝒳 → Bool} {S : Fin n → 𝒳} {A : Finset (Fin n)} : A ∈ growthFamily π S ↔ ∃ i : ι, restrictionPattern (π i) S = A := by classical simp [growthFamily] -
restrictionPattern_mem_ifflemma — Membership in a restriction pattern means the classifier is true at that sample coordinate.hypothesesconclusionj ∈ restrictionPattern p S ↔ p (S j) = trueProof (Lean source)
lemma restrictionPattern_mem_iff {p : 𝒳 → Bool} {S : Fin n → 𝒳} {j : Fin n} : j ∈ restrictionPattern p S ↔ p (S j) = true := by classical simp [restrictionPattern] -
card_growthFamily_le_sum_choosetheorem — A finite set family with bounded VC dimension has cardinality controlled by the Sauer-Shelah binomial sum on the sample.hypothesesconclusion𝒜.card ≤ ∑ k ∈ Iic d, n.choose kProof (Lean source)
theorem card_growthFamily_le_sum_choose (𝒜 : Finset (Finset (Fin n))) (hvd : 𝒜.vcDim ≤ d) : 𝒜.card ≤ ∑ k ∈ Iic d, n.choose k := by classical calc 𝒜.card ≤ 𝒜.shatterer.card := Finset.card_le_card_shatterer 𝒜 _ ≤ ∑ k ∈ Iic 𝒜.vcDim, (card (Fin n)).choose k := Finset.card_shatterer_le_sum_vcDim _ = ∑ k ∈ Iic 𝒜.vcDim, n.choose k := by simp _ ≤ ∑ k ∈ Iic d, n.choose k := by refine Finset.sum_le_sum_of_subset_of_nonneg ?_ ?_ · simpa [Finset.Iic_subset_Iic] using hvd · intro _ _ _ exact zero_le _ -
empirical_dist_eq_zero_of_factor_patternlemma — If two functions induce the same Boolean pattern at every observation in a finite sample, then their empirical distance is zero whenever their values factor through those patterns.hypotheses𝒳 :sharedType vι :sharedType un :sharedℕF :ι → 𝒳 → ℝS :Fin n → 𝒳π :ι → 𝒳 → Boolhfactor :∀ i j, F i (S j) = φ j (π i (S j))i i' :ιhpat :restrictionPattern (π i') S = restrictionPattern (π i) Sconclusiondist (EmpiricalFunctionSpace.mk (F := F) (S := S) i) (EmpiricalFunctionSpace.mk (F := F) (S := S) i')= 0Proof (Lean source)
lemma empirical_dist_eq_zero_of_factor_pattern {F : ι → 𝒳 → ℝ} {S : Fin n → 𝒳} {π : ι → 𝒳 → Bool} {φ : Fin n → Bool → ℝ} (hfactor : ∀ i j, F i (S j) = φ j (π i (S j))) {i i' : ι} (hpat : restrictionPattern (π i') S = restrictionPattern (π i) S) : dist (EmpiricalFunctionSpace.mk (F := F) (S := S) i) (EmpiricalFunctionSpace.mk (F := F) (S := S) i') = 0 := by have hpoint : ∀ j : Fin n, F i (S j) = F i' (S j) := by intro j rw [hfactor i j, hfactor i' j] apply congrArg (φ j) apply Bool.eq_iff_iff.mpr rw [← restrictionPattern_mem_iff (p := π i') (S := S) (j := j), hpat, restrictionPattern_mem_iff (p := π i) (S := S) (j := j)] simp [empiricalNorm, hpoint] -
patternCover_card_lelemma — The pattern representative cover has no more elements than the realized Boolean growth family.hypothesesconclusion(patternCover (F := F) π S).card ≤ (growthFamily π S).cardProof (Lean source)
lemma patternCover_card_le {F : ι → 𝒳 → ℝ} (π : ι → 𝒳 → Bool) (S : Fin n → 𝒳) : (patternCover (F := F) π S).card ≤ (growthFamily π S).card := by classical let f : (growthFamily π S) → EmpiricalFunctionSpace F S := fun A => EmpiricalFunctionSpace.mk (F := F) (S := S) (choose ((mem_growthFamily_iff (π := π) (S := S) (A := A.1)).mp A.2)) calc (patternCover (F := F) π S).card = ((growthFamily π S).attach.image f).card := by rfl _ ≤ (growthFamily π S).attach.card := Finset.card_image_le _ = (growthFamily π S).card := Finset.card_attach -
patternCover_coverslemma — The pattern representative cover covers every empirical function at every positive radius when the real class factors through the Boolean pattern.hypotheses𝒳 :sharedType vι :sharedType un :sharedℕF :ι → 𝒳 → ℝS :Fin n → 𝒳π :ι → 𝒳 → Boolhfactor :∀ i j, F i (S j) = φ j (π i (S j))ε :ℝhε :0 < εconclusionProof (Lean source)
lemma patternCover_covers {F : ι → 𝒳 → ℝ} {S : Fin n → 𝒳} {π : ι → 𝒳 → Bool} {φ : Fin n → Bool → ℝ} (hfactor : ∀ i j, F i (S j) = φ j (π i (S j))) {ε : ℝ} (hε : 0 < ε) : (Set.univ : Set (EmpiricalFunctionSpace F S)) ⊆ ⋃ y ∈ patternCover (F := F) π S, ball y ε := by classical intro q _ let A : Finset (Fin n) := restrictionPattern (π q.index) S have hA : A ∈ growthFamily π S := by rw [mem_growthFamily_iff] exact ⟨q.index, rfl⟩ let a : (growthFamily π S) := ⟨A, hA⟩ let repIndex : ι := choose ((mem_growthFamily_iff (π := π) (S := S) (A := a.1)).mp a.2) let rep : EmpiricalFunctionSpace F S := ⟨repIndex⟩ have hrep_mem : rep ∈ patternCover (F := F) π S := by rw [patternCover] exact Finset.mem_image.mpr ⟨a, Finset.mem_attach _ _, rfl⟩ refine Set.mem_iUnion.mpr ⟨rep, Set.mem_iUnion.mpr ⟨hrep_mem, ?_⟩⟩ rw [Metric.mem_ball] have hrep_pattern : restrictionPattern (π rep.index) S = restrictionPattern (π q.index) S := by dsimp [rep, repIndex] exact Classical.choose_spec ((mem_growthFamily_iff (π := π) (S := S) (A := a.1)).mp a.2) calc dist q rep = 0 := by cases q exact empirical_dist_eq_zero_of_factor_pattern (F := F) (S := S) (π := π) (φ := φ) hfactor hrep_pattern _ < ε := hε -
vc_coveringNumber_le_growththeorem — The empirical covering number of a binary-factored class is bounded by the number of realized Boolean restriction patterns.hypotheses𝒳 :sharedType vι :sharedType un :sharedℕF :ι → 𝒳 → ℝS :Fin n → 𝒳π :ι → 𝒳 → Boolhfactor :∀ i j, F i (S j) = φ j (π i (S j))h' :ε :ℝhε :0 < εconclusioncoveringNumber' h' ε ≤ (growthFamily π S).cardProof (Lean source)
theorem vc_coveringNumber_le_growth {F : ι → 𝒳 → ℝ} {S : Fin n → 𝒳} {π : ι → 𝒳 → Bool} {φ : Fin n → Bool → ℝ} (hfactor : ∀ i j, F i (S j) = φ j (π i (S j))) (h' : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S))) {ε : ℝ} (hε : 0 < ε) : coveringNumber' h' ε ≤ (growthFamily π S).card := by classical rw [coveringNumber'_eq h' hε] let t : Finset (EmpiricalFunctionSpace F S) := patternCover (F := F) π S have hfind : find (coveringNumber_exists h' hε) ≤ t.card := Nat.find_min' (coveringNumber_exists h' hε) (m := t.card) ⟨t, rfl, patternCover_covers hfactor hε⟩ exact le_trans hfind (patternCover_card_le (F := F) π S) -
log_coveringNumber_le_of_card_boundtheorem — A direct cardinality bound on the Boolean growth family gives the same logarithmic bound on the empirical covering number.hypotheses𝒳 :sharedType vι :sharedType un :sharedℕNonempty ιF :ι → 𝒳 → ℝS :Fin n → 𝒳π :ι → 𝒳 → Boolhfactor :∀ i j, F i (S j) = φ j (π i (S j))h' :ε :ℝhε :0 < εN :ℕhcard :(growthFamily π S).card ≤ NconclusionProof (Lean source)
theorem log_coveringNumber_le_of_card_bound [Nonempty ι] {F : ι → 𝒳 → ℝ} {S : Fin n → 𝒳} {π : ι → 𝒳 → Bool} {φ : Fin n → Bool → ℝ} (hfactor : ∀ i j, F i (S j) = φ j (π i (S j))) (h' : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S))) {ε : ℝ} (hε : 0 < ε) {N : ℕ} (hcard : (growthFamily π S).card ≤ N) : log (coveringNumber' h' ε) ≤ log N := by classical have hcov_card : coveringNumber' h' ε ≤ (growthFamily π S).card := vc_coveringNumber_le_growth hfactor h' hε have hcov_N : coveringNumber' h' ε ≤ N := le_trans hcov_card hcard have hcov_pos : 0 < coveringNumber' h' ε := by have hnonempty : (Set.univ : Set (EmpiricalFunctionSpace F S)).Nonempty := by obtain ⟨i⟩ := (inferInstance : Nonempty ι) exact ⟨⟨i⟩, by simp⟩ exact coveringNumber'_nonzero hnonempty h' hε have hcovN_real : ((coveringNumber' h' ε : ℕ) : ℝ) ≤ (N : ℝ) := by exact_mod_cast hcov_N exact Real.log_le_log (Nat.cast_pos.mpr hcov_pos) hcovN_real -
sum_choose_le_succ_mul_powlemma — The Sauer-Shelah binomial sum is bounded by the usual polynomial upper bound in sample size and VC dimension.hypothesesn :sharedℕd :sharedℕhn_pos :0 < nconclusion((∑ k ∈ Iic d, n.choose k : ℕ) : ℝ) ≤ ((d + 1 : ℕ) : ℝ) * (n : ℝ) ^ dProof (Lean source)
lemma sum_choose_le_succ_mul_pow (hn_pos : 0 < n) : ((∑ k ∈ Iic d, n.choose k : ℕ) : ℝ) ≤ ((d + 1 : ℕ) : ℝ) * (n : ℝ) ^ d := by have hsum_nat : (∑ k ∈ Iic d, n.choose k) ≤ (d + 1) * n ^ d := by calc (∑ k ∈ Iic d, n.choose k) ≤ ∑ k ∈ Iic d, n ^ d := by refine Finset.sum_le_sum ?_ intro k hk have hk_le : k ≤ d := by simpa using hk exact le_trans (Nat.choose_le_pow n k) (Nat.pow_le_pow_right hn_pos hk_le) _ = (d + 1) * n ^ d := by simp [Nat.card_Iic, Finset.sum_const] exact_mod_cast hsum_nat
HausslerPacking 3 core · 12 supporting Elementary VC packing estimates for finite Boolean classes. ★ vc_weightedHamming_packing_log_card_le
Elementary VC packing estimates for finite Boolean classes.
This file isolates the probabilistic random-subsample extraction used in the
classical packing argument, then derives a self-logarithmic estimate from
Sauer-Shelah. The public API includes
weightedHammingSq, the separating-subsample extraction
exists_separating_subsample, the self-referential logarithmic solver
self_log_solve, and the final logarithmic estimate
vc_weightedHamming_packing_log_card_le.
Given a finite collection of real coordinate weights and two Boolean-valued vectors on the same finite coordinate set, the weighted squared Hamming pseudo-distance is the sum of the weights at exactly those coordinates where the vectors differ.
Given a map from a finite sample-coordinate set into a finite original-coordinate set and a Boolean-valued vector on the original-coordinate set, the subsample pattern is the finite set of sample coordinates whose mapped original coordinates have Boolean value true.
Elementary VC ε-packing estimate, logarithmic form. Let w be a nonnegative weight on the n sample coordinates with total weight at most r², where ε is positive and at most r. If the Boolean family P, viewed as the sets of coordinates where each member is true, has VC dimension at most d and every two distinct members of P are separated by weighted Hamming distance at least ε² in that weighting, then the logarithm of the cardinality of P is at most 1 + 2d·log(4d·r²/ε²) — a bound depending only on d and the ratio r²/ε², with no dependence on the ambient coordinate count n.
Formal statement
Proof (Lean source)
12 supporting declarations (lemmas, instances)
-
weightedHammingSq_nonneglemma — Nonnegative coordinate weights make the weighted Hamming pseudo-distance nonnegative.hypothesesconclusion0 ≤ weightedHammingSq w a bProof (Lean source)
lemma weightedHammingSq_nonneg {n : ℕ} (w : Fin n → ℝ) (hw : ∀ j, 0 ≤ w j) (a b : Fin n → Bool) : 0 ≤ weightedHammingSq w a b := by classical unfold weightedHammingSq exact Finset.sum_nonneg fun j _ => by by_cases h : a j = b j · simp [h] · simp [h, hw j] -
subsamplePattern_mem_ifflemma — A sampled coordinate belongs to a Boolean pattern exactly when the original Boolean vector is true at the coordinate from which it was sampled.hypothesesconclusioni ∈ subsamplePattern J a ↔ a (J i) = trueProof (Lean source)
lemma subsamplePattern_mem_iff {n m : ℕ} {J : Fin m → Fin n} {a : Fin n → Bool} {i : Fin m} : i ∈ subsamplePattern J a ↔ a (J i) = true := by classical simp [subsamplePattern] -
sum_choose_le_succ_powlemma — A partial sum of binomial coefficients is no larger than a polynomial power, providing the elementary growth bound used in VC estimates.Proof (Lean source)
lemma sum_choose_le_succ_pow (n d : ℕ) : (∑ k ∈ Iic d, n.choose k) ≤ (n + 1) ^ d := by calc (∑ k ∈ Iic d, n.choose k) ≤ ∑ k ∈ Iic d, n ^ k := by refine Finset.sum_le_sum ?_ intro k _hk exact Nat.choose_le_pow n k _ ≤ ∑ k ∈ Iic d, d.choose k * n ^ k := by refine Finset.sum_le_sum ?_ intro k hk have hk' : k ≤ d := by simpa using hk have hchoose_pos : 1 ≤ d.choose k := succ_le_of_lt (Nat.choose_pos hk') simpa [one_mul] using Nat.mul_le_mul_right (n ^ k) hchoose_pos _ = (n + 1) ^ d := by rw [add_pow] simp only [one_pow, mul_one, Nat.cast_id] apply Finset.sum_congr · ext k simp · intro k _hk rw [Nat.mul_comm] -
subsamplePattern_eq_ifflemma — Equality of sampled Boolean patterns means that the two patterns agree at every coordinate selected by the sample.hypothesesconclusionsubsamplePattern J a = subsamplePattern J b ↔ ∀ t : Fin m, a (J t) = b (J t)Proof (Lean source)
lemma subsamplePattern_eq_iff {n m : ℕ} {J : Fin m → Fin n} {a b : Fin n → Bool} : subsamplePattern J a = subsamplePattern J b ↔ ∀ t : Fin m, a (J t) = b (J t) := by classical constructor · intro h t by_cases ha : a (J t) = true · have ht : t ∈ subsamplePattern J b := by rw [← h, subsamplePattern_mem_iff] exact ha rw [subsamplePattern_mem_iff] at ht rw [ha, ht] · have ha_false : a (J t) = false := by exact Bool.eq_false_of_not_eq_true ha by_cases hb : b (J t) = true · have ht : t ∈ subsamplePattern J a := by rw [h, subsamplePattern_mem_iff] exact hb rw [subsamplePattern_mem_iff] at ht exact False.elim (ha ht) · have hb_false : b (J t) = false := by exact Bool.eq_false_of_not_eq_true hb rw [ha_false, hb_false] · intro h ext t simp [subsamplePattern_mem_iff, h t] -
per_pair_collision_sumlemma — The weighted sum over all fixed-length coordinate selections that agree under two Boolean patterns equals the corresponding power of the total weight of their agreeing coordinates.hypothesesProof (Lean source)
lemma per_pair_collision_sum {n m : ℕ} (w : Fin n → ℝ) (a b : Fin n → Bool) : (∑ J : Fin m → Fin n, (∏ t : Fin m, w (J t)) * (if (∀ t : Fin m, a (J t) = b (J t)) then (1 : ℝ) else 0)) = (∑ j ∈ Finset.univ.filter (fun j : Fin n => a j = b j), w j) ^ m := by classical let g : Fin n → ℝ := fun j => w j * (if a j = b j then (1 : ℝ) else 0) have hpoint : ∀ J : Fin m → Fin n, (∏ t : Fin m, w (J t)) * (if (∀ t : Fin m, a (J t) = b (J t)) then (1 : ℝ) else 0) = ∏ t : Fin m, g (J t) := by intro J by_cases h : ∀ t : Fin m, a (J t) = b (J t) · simp [g, h] · have hprod_zero : ∏ t : Fin m, (if a (J t) = b (J t) then (1 : ℝ) else 0) = 0 := by rw [Finset.prod_eq_zero_iff] push_neg at h rcases h with ⟨t, ht⟩ exact ⟨t, Finset.mem_univ t, by simp [ht]⟩ have hgprod_zero : (∏ t : Fin m, g (J t)) = 0 := by rw [Finset.prod_eq_zero_iff] push_neg at h rcases h with ⟨t, ht⟩ exact ⟨t, Finset.mem_univ t, by simp [g, ht]⟩ simp [h, hgprod_zero] calc (∑ J : Fin m → Fin n, (∏ t : Fin m, w (J t)) * (if (∀ t : Fin m, a (J t) = b (J t)) then (1 : ℝ) else 0)) = ∑ J : Fin m → Fin n, ∏ t : Fin m, g (J t) := by exact Finset.sum_congr rfl fun J _ => hpoint J _ = (∑ j : Fin n, g j) ^ m := product_sum_normalization g _ = (∑ j ∈ Finset.univ.filter (fun j : Fin n => a j = b j), w j) ^ m := by congr 1 simp [g, Finset.sum_filter] -
averaging_exists_zero_countlemma — A nonnegative finite probability weighting with average count below one must assign count zero to at least one index.hypothesesι :Type*Fintype ιμ :ι → ℝcnt :ι → ℕhμsum :∑ i : ι, μ i = 1hμnonneg :∀ i, 0 ≤ μ ihmean :∑ i : ι, μ i * (cnt i : ℝ) < 1conclusion∃ i, cnt i = 0Proof (Lean source)
lemma averaging_exists_zero_count {ι : Type*} [Fintype ι] (μ : ι → ℝ) (cnt : ι → ℕ) (hμsum : ∑ i : ι, μ i = 1) (hμnonneg : ∀ i, 0 ≤ μ i) (hmean : ∑ i : ι, μ i * (cnt i : ℝ) < 1) : ∃ i, cnt i = 0 := by classical by_contra hnone push_neg at hnone have hge : 1 ≤ ∑ i : ι, μ i * (cnt i : ℝ) := by calc 1 = ∑ i : ι, μ i := by rw [hμsum] _ = ∑ i : ι, μ i * (1 : ℝ) := by simp _ ≤ ∑ i : ι, μ i * (cnt i : ℝ) := by refine Finset.sum_le_sum ?_ intro i _hi exact mul_le_mul_of_nonneg_left (by exact_mod_cast succ_le_of_lt (Nat.pos_of_ne_zero (hnone i))) (hμnonneg i) exact not_lt_of_ge hge hmean -
collision_boundlemma — When two Boolean vectors are separated under nonnegative coordinate weights, their probability of agreeing on every coordinate of a repeated weighted sample decays exponentially with the sample length.hypothesesn m :ℕw :Fin n → ℝhw :∀ j, 0 ≤ w jr ε W :ℝhr :0 < rhW :W = ∑ j : Fin n, w jhWpos :0 < Whwsum :W ≤ r ^ 2hsep :ε ^ 2 ≤ weightedHammingSq w a bProof (Lean source)
lemma collision_bound {n m : ℕ} (w : Fin n → ℝ) (hw : ∀ j, 0 ≤ w j) (r ε W : ℝ) (hr : 0 < r) (hW : W = ∑ j : Fin n, w j) (hWpos : 0 < W) (hwsum : W ≤ r ^ 2) (a b : Fin n → Bool) (hsep : ε ^ 2 ≤ weightedHammingSq w a b) : (∑ j ∈ Finset.univ.filter (fun j : Fin n => a j = b j), w j / W) ^ m ≤ exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by classical -- The agreeing-coordinate weight is the total minus the weighted Hamming gap. have hagree : (∑ j ∈ Finset.univ.filter (fun j : Fin n => a j = b j), w j) = W - weightedHammingSq w a b := by rw [hW] unfold weightedHammingSq rw [← Finset.sum_sub_distrib, Finset.sum_filter] apply Finset.sum_congr rfl intro j _ by_cases h : a j = b j <;> simp [h] have hr2pos : 0 < r ^ 2 := by positivity have hWH_nonneg : 0 ≤ weightedHammingSq w a b := weightedHammingSq_nonneg w hw a b -- Normalize: the collision factor `s = (W - WH)/W` lies in `[0, 1 - ε²/r²]`. rw [← Finset.sum_div, hagree] set s : ℝ := (W - weightedHammingSq w a b) / W with hs_def have hs_nonneg : 0 ≤ s := by rw [hs_def] refine div_nonneg ?_ (le_of_lt hWpos) rw [← hagree] exact Finset.sum_nonneg (fun j _ => hw j) have hs_le1 : s ≤ 1 - ε ^ 2 / r ^ 2 := by rw [hs_def, sub_div, div_self (ne_of_gt hWpos)] have hratio : ε ^ 2 / r ^ 2 ≤ weightedHammingSq w a b / W := by rw [div_le_div_iff₀ hr2pos hWpos] nlinarith [hsep, hwsum, hWH_nonneg, sq_nonneg ε] linarith have hexp : 1 - ε ^ 2 / r ^ 2 ≤ exp (-(ε ^ 2 / r ^ 2)) := by have h := Real.add_one_le_exp (-(ε ^ 2 / r ^ 2)) linarith have hs_le_exp : s ≤ exp (-(ε ^ 2 / r ^ 2)) := le_trans hs_le1 hexp calc s ^ m ≤ (exp (-(ε ^ 2 / r ^ 2))) ^ m := pow_le_pow_left₀ hs_nonneg hs_le_exp m _ = exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by rw [← Real.exp_nat_mul] congr 1 ring -
card_subsample_family_le_succ_powlemma — A sampled Boolean trace family with bounded VC dimension has polynomially many realized restricted patterns.hypothesesn m d :ℕhvcJ :(P.image (subsamplePattern J)).vcDim ≤ dconclusion(P.image (subsamplePattern J)).card ≤ (m + 1) ^ dProof (Lean source)
lemma card_subsample_family_le_succ_pow {n m d : ℕ} (J : Fin m → Fin n) (P : Finset (Fin n → Bool)) (hvcJ : (P.image (subsamplePattern J)).vcDim ≤ d) : (P.image (subsamplePattern J)).card ≤ (m + 1) ^ d := by exact le_trans (card_growthFamily_le_sum_choose (P.image (subsamplePattern J)) hvcJ) (sum_choose_le_succ_pow m d) -
subsample_image_vcDim_lelemma — Restricting a Boolean set family along a coordinate map does not increase VC dimension.Proof (Lean source)
lemma subsample_image_vcDim_le {n m : ℕ} (d : ℕ) (J : Fin m → Fin n) (P : Finset (Fin n → Bool)) (hvc : (P.image (fun a => Finset.univ.filter (fun j => a j = true))).vcDim ≤ d) : (P.image (subsamplePattern J)).vcDim ≤ d := by classical let A : Finset (Finset (Fin n)) := P.image (fun a => Finset.univ.filter (fun j => a j = true)) let B : Finset (Finset (Fin m)) := P.image (subsamplePattern J) have hB_le_A : B.vcDim ≤ A.vcDim := by unfold vcDim refine Finset.sup_le ?_ intro T hTmem have hT : B.Shatters T := Finset.mem_shatterer.mp hTmem let U : Finset (Fin n) := T.image J have hinj : InjOn J (↑T) := by intro i hi k hk hJ by_contra hik have hsingle : ({i} : Finset (Fin m)) ⊆ T := Finset.singleton_subset_iff.mpr hi obtain ⟨u, huB, hTu⟩ := hT hsingle rcases Finset.mem_image.mp huB with ⟨a, _haP, rfl⟩ have hi_inter : i ∈ T ∩ subsamplePattern J a := by rw [hTu] simp have hi_pat : i ∈ subsamplePattern J a := (Finset.mem_inter.mp hi_inter).2 have hk_pat : k ∈ subsamplePattern J a := by rw [subsamplePattern_mem_iff] at hi_pat ⊢ simpa [hJ] using hi_pat have hk_inter : k ∈ T ∩ subsamplePattern J a := Finset.mem_inter.mpr ⟨hk, hk_pat⟩ have hk_single : k ∈ ({i} : Finset (Fin m)) := by rw [← hTu] exact hk_inter have hki : k = i := by simpa using hk_single exact hik hki.symm have hAshat : A.Shatters U := by intro S hS let S' : Finset (Fin m) := T.filter fun i => J i ∈ S have hS'T : S' ⊆ T := by intro i hi exact (Finset.mem_filter.mp hi).1 obtain ⟨u, huB, hTu⟩ := hT hS'T rcases Finset.mem_image.mp huB with ⟨a, haP, rfl⟩ refine ⟨Finset.univ.filter (fun j => a j = true), ?_, ?_⟩ · exact Finset.mem_image.mpr ⟨a, haP, rfl⟩ · ext x constructor · intro hx rcases Finset.mem_inter.mp hx with ⟨hxU, hxtrue⟩ rcases Finset.mem_image.mp hxU with ⟨i, hiT, rfl⟩ have hi_pat : i ∈ subsamplePattern J a := by rw [subsamplePattern_mem_iff] simpa using (Finset.mem_filter.mp hxtrue).2 have hiS' : i ∈ S' := by rw [← hTu] exact Finset.mem_inter.mpr ⟨hiT, hi_pat⟩ exact (Finset.mem_filter.mp hiS').2 · intro hxS have hxU : x ∈ U := hS hxS rcases Finset.mem_image.mp hxU with ⟨i, hiT, hJi⟩ have hiS' : i ∈ S' := Finset.mem_filter.mpr ⟨hiT, by simpa [hJi] using hxS⟩ have hi_inter : i ∈ T ∩ subsamplePattern J a := by rw [hTu] exact hiS' have hi_pat : i ∈ subsamplePattern J a := (Finset.mem_inter.mp hi_inter).2 refine Finset.mem_inter.mpr ⟨hxU, ?_⟩ rw [mem_filter] constructor · simp · rw [subsamplePattern_mem_iff] at hi_pat simpa [hJi] using hi_pat have hU_le : U.card ≤ A.vcDim := Finset.Shatters.card_le_vcDim hAshat have hcard : U.card = T.card := Finset.card_image_of_injOn hinj exact hcard.ge.trans hU_le exact hB_le_A.trans hvc -
finite_averaging_exists_separating_subsamplelemma — Finite averaging core for the weighted random-coordinate extraction.hypothesesn :ℕw :Fin n → ℝhw :∀ j, 0 ≤ w jr ε :ℝhr :0 < rhε :0 < εhwsum :∑ j, w j ≤ r ^ 2hPcard :2 ≤ P.cardhsep :∀ a ∈ P, ∀ b ∈ P, a ≠ b → ε ^ 2 ≤ weightedHammingSq w a bconclusionconclusion 1(m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * log (P.card)conclusion 2InjOn (subsamplePattern J) ↑PProof (Lean source)
lemma finite_averaging_exists_separating_subsample {n : ℕ} (w : Fin n → ℝ) (hw : ∀ j, 0 ≤ w j) (r ε : ℝ) (hr : 0 < r) (hε : 0 < ε) (hwsum : ∑ j, w j ≤ r ^ 2) (P : Finset (Fin n → Bool)) (hPcard : 2 ≤ P.card) (hsep : ∀ a ∈ P, ∀ b ∈ P, a ≠ b → ε ^ 2 ≤ weightedHammingSq w a b) : ∃ (m : ℕ) (J : Fin m → Fin n), (m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * log (P.card) ∧ InjOn (subsamplePattern J) ↑P := by classical let W : ℝ := ∑ j : Fin n, w j have hWdef : W = ∑ j : Fin n, w j := rfl have hWpos : 0 < W := by have htwo : 1 < P.card := by omega rcases Finset.one_lt_card.mp htwo with ⟨a, haP, b, hbP, hab⟩ have hdist_le_W : weightedHammingSq w a b ≤ W := by dsimp [W] unfold weightedHammingSq refine Finset.sum_le_sum ?_ intro j _hj by_cases h : a j = b j · simp [h, hw j] · simp [h] have hdist_pos : 0 < weightedHammingSq w a b := by have hεsq : 0 < ε ^ 2 := sq_pos_of_ne_zero (ne_of_gt hε) exact lt_of_lt_of_le hεsq (hsep a haP b hbP hab) exact lt_of_lt_of_le hdist_pos hdist_le_W have hwsumW : W ≤ r ^ 2 := by simpa [W] using hwsum let L : ℝ := (2 * r ^ 2 / ε ^ 2) * log (P.card) let m : ℕ := ⌊L⌋₊ + 1 have hPpos_nat : 0 < P.card := by omega have hPone_nat : 1 ≤ P.card := by omega have hPpos_real : 0 < (P.card : ℝ) := by exact_mod_cast hPpos_nat have hLnonneg : 0 ≤ L := by have hcoef_nonneg : 0 ≤ 2 * r ^ 2 / ε ^ 2 := by positivity have hlog_nonneg : 0 ≤ log (P.card) := Real.log_nonneg (by exact_mod_cast hPone_nat) exact mul_nonneg hcoef_nonneg hlog_nonneg have hm_bound : (m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * log (P.card) := by have hfloor : ((⌊L⌋₊ : ℕ) : ℝ) ≤ L := Nat.floor_le hLnonneg dsimp [m, L] norm_num [Nat.cast_add, Nat.cast_one] linarith let μ : (Fin m → Fin n) → ℝ := fun J => ∏ t : Fin m, (w (J t) / W) let cnt : (Fin m → Fin n) → ℕ := fun J => (P.offDiag.filter fun ab => subsamplePattern J ab.1 = subsamplePattern J ab.2).card have hμsum : ∑ J : Fin m → Fin n, μ J = 1 := by dsimp [μ] rw [product_sum_normalization (n := n) (m := m) (fun j : Fin n => w j / W)] have hsum : (∑ j : Fin n, w j / W) = 1 := by rw [← Finset.sum_div] rw [← hWdef] exact div_self (ne_of_gt hWpos) rw [hsum, one_pow] have hμnonneg : ∀ J : Fin m → Fin n, 0 ≤ μ J := by intro J dsimp [μ] exact Finset.prod_nonneg fun t _ht => div_nonneg (hw (J t)) (le_of_lt hWpos) have hcnt_cast : ∀ J : Fin m → Fin n, (cnt J : ℝ) = ∑ ab ∈ P.offDiag, if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0 := by intro J dsimp [cnt] simp have hinner : ∀ ab ∈ P.offDiag, (∑ J : Fin m → Fin n, μ J * (if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0)) = (∑ j ∈ Finset.univ.filter (fun j : Fin n => ab.1 j = ab.2 j), w j / W) ^ m := by intro ab _hab calc (∑ J : Fin m → Fin n, μ J * (if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0)) = ∑ J : Fin m → Fin n, (∏ t : Fin m, (w (J t) / W)) * (if (∀ t : Fin m, ab.1 (J t) = ab.2 (J t)) then (1 : ℝ) else 0) := by refine Finset.sum_congr rfl ?_ intro J _hJ dsimp [μ] by_cases h : subsamplePattern J ab.1 = subsamplePattern J ab.2 · have hforall : ∀ t : Fin m, ab.1 (J t) = ab.2 (J t) := subsamplePattern_eq_iff.mp h simp [h, hforall] · have hforall : ¬ ∀ t : Fin m, ab.1 (J t) = ab.2 (J t) := by intro hall exact h (subsamplePattern_eq_iff.mpr hall) simp [h, hforall] _ = (∑ j ∈ Finset.univ.filter (fun j : Fin n => ab.1 j = ab.2 j), w j / W) ^ m := by exact per_pair_collision_sum (fun j : Fin n => w j / W) ab.1 ab.2 have hmean_le : (∑ J : Fin m → Fin n, μ J * (cnt J : ℝ)) ≤ (P.offDiag.card : ℝ) * exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by calc (∑ J : Fin m → Fin n, μ J * (cnt J : ℝ)) = ∑ J : Fin m → Fin n, μ J * (∑ ab ∈ P.offDiag, if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0) := by refine Finset.sum_congr rfl ?_ intro J _hJ rw [hcnt_cast J] _ = ∑ J : Fin m → Fin n, ∑ ab ∈ P.offDiag, μ J * (if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0) := by refine Finset.sum_congr rfl ?_ intro J _hJ rw [Finset.mul_sum] _ = ∑ ab ∈ P.offDiag, ∑ J : Fin m → Fin n, μ J * (if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0) := by rw [Finset.sum_comm] _ ≤ ∑ ab ∈ P.offDiag, exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by refine Finset.sum_le_sum ?_ intro ab hab rw [hinner ab hab] rcases Finset.mem_offDiag.mp hab with ⟨haP, hbP, habne⟩ exact collision_bound w hw r ε W hr hWdef hWpos hwsumW ab.1 ab.2 (hsep ab.1 haP ab.2 hbP habne) _ = (P.offDiag.card : ℝ) * exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by simp have hmean_lt_one : (∑ J : Fin m → Fin n, μ J * (cnt J : ℝ)) < 1 := by have hm_gt_L : L < (m : ℝ) := by dsimp [m] simpa [Nat.cast_add, Nat.cast_one] using (Nat.lt_floor_add_one L) have hscale_pos : 0 < ε ^ 2 / r ^ 2 := by positivity have hscaled : L * (ε ^ 2 / r ^ 2) < (m : ℝ) * (ε ^ 2 / r ^ 2) := mul_lt_mul_of_pos_right hm_gt_L hscale_pos have hLscale : L * (ε ^ 2 / r ^ 2) = 2 * log (P.card) := by dsimp [L] field_simp [ne_of_gt hε, ne_of_gt hr] have hmexp : 2 * log (P.card) < (m : ℝ) * ε ^ 2 / r ^ 2 := by rw [hLscale] at hscaled convert hscaled using 1 ring have hneg : -((m : ℝ) * ε ^ 2 / r ^ 2) < -(2 * log (P.card)) := by linarith have hexp_lt : exp (-((m : ℝ) * ε ^ 2 / r ^ 2)) < exp (-(2 * log (P.card))) := Real.exp_lt_exp.mpr hneg have hoff_card : (P.offDiag.card : ℝ) ≤ (P.card : ℝ) ^ 2 := by have hn : P.offDiag.card ≤ P.card * P.card := by rw [Finset.offDiag_card] omega have hnreal : (P.offDiag.card : ℝ) ≤ (P.card * P.card : ℕ) := by exact_mod_cast hn simpa [sq] using hnreal have hN2pos : 0 < (P.card : ℝ) ^ 2 := sq_pos_of_ne_zero (ne_of_gt hPpos_real) have hprod_lt : (P.card : ℝ) ^ 2 * exp (-((m : ℝ) * ε ^ 2 / r ^ 2)) < (P.card : ℝ) ^ 2 * exp (-(2 * log (P.card))) := mul_lt_mul_of_pos_left hexp_lt hN2pos have hexp_neg_eq : exp (-(2 * log (P.card))) = ((P.card : ℝ) ^ 2)⁻¹ := by rw [Real.exp_neg] have htwice : exp (2 * log (P.card)) = (P.card : ℝ) ^ 2 := by have hrewrite : 2 * log (P.card) = log (P.card) + log (P.card) := by ring rw [hrewrite, Real.exp_add, Real.exp_log hPpos_real] ring rw [htwice] have hprod_eq : (P.card : ℝ) ^ 2 * exp (-(2 * log (P.card))) = 1 := by rw [hexp_neg_eq] exact mul_inv_cancel₀ (ne_of_gt hN2pos) have hcardexp_le : (P.offDiag.card : ℝ) * exp (-(m : ℝ) * ε ^ 2 / r ^ 2) ≤ (P.card : ℝ) ^ 2 * exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by exact mul_le_mul_of_nonneg_right hoff_card (le_of_lt (Real.exp_pos _)) have hprod_lt_one : (P.card : ℝ) ^ 2 * exp (-(m : ℝ) * ε ^ 2 / r ^ 2) < 1 := by convert (by simpa [hprod_eq] using hprod_lt) using 2 ring_nf exact lt_of_le_of_lt (hmean_le.trans hcardexp_le) hprod_lt_one obtain ⟨J, hcnt_zero⟩ := averaging_exists_zero_count μ cnt hμsum hμnonneg hmean_lt_one refine ⟨m, J, hm_bound, ?_⟩ intro a haP b hbP hpat by_contra hab have hbad_mem : (a, b) ∈ P.offDiag.filter (fun ab => subsamplePattern J ab.1 = subsamplePattern J ab.2) := by rw [mem_filter] exact ⟨Finset.mem_offDiag.mpr ⟨haP, hbP, hab⟩, hpat⟩ have hcnt_pos : 0 < cnt J := by dsimp [cnt] exact Finset.card_pos.mpr ⟨(a, b), hbad_mem⟩ exact (Nat.ne_of_gt hcnt_pos) hcnt_zero -
exists_separating_subsamplelemma — Honest isolated core: the weighted random-coordinate extraction.hypothesesn :ℕd :ℕw :Fin n → ℝhw :∀ j, 0 ≤ w jr ε :ℝhr :0 < rhε :0 < εhwsum :∑ j, w j ≤ r ^ 2hPcard :2 ≤ P.cardhsep :∀ a ∈ P, ∀ b ∈ P, a ≠ b → ε ^ 2 ≤ weightedHammingSq w a bconclusionconclusion 1(m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * log (P.card)conclusion 2(P.image (subsamplePattern J)).vcDim ≤ dconclusion 3InjOn (subsamplePattern J) ↑PProof (Lean source)
lemma exists_separating_subsample {n : ℕ} (d : ℕ) (w : Fin n → ℝ) (hw : ∀ j, 0 ≤ w j) (r ε : ℝ) (hr : 0 < r) (hε : 0 < ε) (hwsum : ∑ j, w j ≤ r ^ 2) (P : Finset (Fin n → Bool)) (hPcard : 2 ≤ P.card) (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) : ∃ (m : ℕ) (J : Fin m → Fin n), (m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * log (P.card) ∧ (P.image (subsamplePattern J)).vcDim ≤ d ∧ InjOn (subsamplePattern J) ↑P := by obtain ⟨m, J, hm, hinj⟩ := finite_averaging_exists_separating_subsample w hw r ε hr hε hwsum P hPcard hsep exact ⟨m, J, hm, subsample_image_vcDim_le d J P hvc, hinj⟩ -
self_log_solvelemma — A self-referential logarithmic inequality implies an explicit linear-log upper bound.hypothesesconclusionL ≤ 1 + 2 * (d : ℝ) * log (2 * a * (d : ℝ))Proof (Lean source)
lemma self_log_solve {a L : ℝ} {d : ℕ} (hd : 1 ≤ d) (ha : 2 ≤ a) (hL : 0 ≤ L) (hbound : L ≤ (d : ℝ) * log (2 + a * L)) : L ≤ 1 + 2 * (d : ℝ) * log (2 * a * (d : ℝ)) := by have hd_pos_nat : 0 < d := lt_of_lt_of_le Nat.zero_lt_one hd have hd_pos : 0 < (d : ℝ) := by exact_mod_cast hd_pos_nat have hd_nonneg : 0 ≤ (d : ℝ) := le_of_lt hd_pos have ha_pos : 0 < a := by linarith have ha_nonneg : 0 ≤ a := le_of_lt ha_pos have hy_pos : 0 < 2 + a * L := by have hmul_nonneg : 0 ≤ a * L := mul_nonneg ha_nonneg hL linarith have ht_pos : 0 < 2 * a * (d : ℝ) := by positivity have hlog_tangent : log (2 + a * L) ≤ (2 + a * L) / (2 * a * (d : ℝ)) + log (2 * a * (d : ℝ)) - 1 := by have hratio_pos : 0 < (2 + a * L) / (2 * a * (d : ℝ)) := div_pos hy_pos ht_pos have h0 := Real.log_le_sub_one_of_pos hratio_pos have hlog_div : log ((2 + a * L) / (2 * a * (d : ℝ))) = log (2 + a * L) - log (2 * a * (d : ℝ)) := by exact Real.log_div (ne_of_gt hy_pos) (ne_of_gt ht_pos) rw [hlog_div] at h0 linarith have hstep : L ≤ (d : ℝ) * ((2 + a * L) / (2 * a * (d : ℝ)) + log (2 * a * (d : ℝ)) - 1) := by exact le_trans hbound (mul_le_mul_of_nonneg_left hlog_tangent hd_nonneg) have hrewrite : (d : ℝ) * ((2 + a * L) / (2 * a * (d : ℝ)) + log (2 * a * (d : ℝ)) - 1) = 1 / a + L / 2 + (d : ℝ) * log (2 * a * (d : ℝ)) - (d : ℝ) := by field_simp [ne_of_gt ha_pos, ne_of_gt hd_pos] have hstep' : L ≤ 1 / a + L / 2 + (d : ℝ) * log (2 * a * (d : ℝ)) - (d : ℝ) := by rwa [hrewrite] at hstep have hdrop : L ≤ 1 / a + L / 2 + (d : ℝ) * log (2 * a * (d : ℝ)) := by linarith have hhalf' : L ≤ 2 * (1 / a + (d : ℝ) * log (2 * a * (d : ℝ))) := by linarith have hhalf : L ≤ 2 / a + 2 * (d : ℝ) * log (2 * a * (d : ℝ)) := by convert hhalf' using 1 ring have htwo_div_le_one : 2 / a ≤ 1 := (div_le_one ha_pos).2 ha linarith
SqrtLogIntegral 1 core · 6 supporting Dudley entropy-integral evaluation for a logarithmic square-root kernel. ★ sqrtLog_integral_le
Dudley entropy-integral evaluation for a logarithmic square-root kernel.
This file proves the elementary bound
∫ x in ε..δ, sqrt (log (δ / x)) ≤ δ - ε for 0 < ε ≤ δ. The proof uses
the AM-GM inequality sqrt t ≤ (t + 1) / 2 for t ≥ 0 and the explicit
antiderivative of log.
Dudley entropy-integral evaluation. For a positive lower limit ε that is at most the upper limit δ, the integral of √(log(δ/x)) over [ε,δ] is at most δ - ε.
Formal statement
Proof (Lean source)
6 supporting declarations (lemmas, instances)
-
sqrt_le_add_one_div_twolemma — For nonnegative t, the square root is bounded by the arithmetic mean of t and 1.Proof (Lean source)
lemma sqrt_le_add_one_div_two {t : ℝ} (ht : 0 ≤ t) : sqrt t ≤ (t + 1) / 2 := by have hsq : 0 ≤ (sqrt t - 1) ^ 2 := sq_nonneg _ have hsqrt_sq : (sqrt t) ^ 2 = t := by rw [Real.sq_sqrt ht] nlinarith [hsq, Real.sqrt_nonneg t, hsqrt_sq] -
log_div_nonneg_of_mem_Icclemma — On the interval [ε, δ], the log-ratio kernel is nonnegative.Proof (Lean source)
lemma log_div_nonneg_of_mem_Icc {δ ε x : ℝ} (hε : 0 < ε) (hx : x ∈ Icc ε δ) : 0 ≤ log (δ / x) := by have hxpos : 0 < x := lt_of_lt_of_le hε hx.1 have hratio : 1 ≤ δ / x := by rw [le_div_iff₀ hxpos] simpa using hx.2 exact Real.log_nonneg hratio -
intervalIntegrable_sqrt_log_divlemma — When ε is positive and no larger than δ, the square-root log-ratio kernel is integrable on the interval from ε to δ with respect to Lebesgue measure.hypothesesδ ε :ℝhε :0 < εhεδ :ε ≤ δconclusionProof (Lean source)
lemma intervalIntegrable_sqrt_log_div {δ ε : ℝ} (hε : 0 < ε) (hεδ : ε ≤ δ) : IntervalIntegrable (fun x : ℝ => sqrt (log (δ / x))) volume ε δ := by have hcont : ContinuousOn (fun x : ℝ => sqrt (log (δ / x))) [[ε, δ]] := by simpa [Set.uIcc_of_le hεδ] using continuousOn_sqrt_log_div_Icc hε hεδ exact hcont.intervalIntegrable -
intervalIntegrable_log_divlemma — When ε is positive and no larger than δ, the logarithm of the ratio δ divided by x is interval-integrable from ε to δ with respect to Lebesgue measure.hypothesesδ ε :ℝhε :0 < εhεδ :ε ≤ δconclusionProof (Lean source)
lemma intervalIntegrable_log_div {δ ε : ℝ} (hε : 0 < ε) (hεδ : ε ≤ δ) : IntervalIntegrable (fun x : ℝ => log (δ / x)) volume ε δ := by have hδ : 0 < δ := lt_of_lt_of_le hε hεδ have hcont : ContinuousOn (fun x : ℝ => log (δ / x)) (Icc ε δ) := by refine ContinuousOn.log ?_ ?_ · exact (continuousOn_const (c := δ)).div continuousOn_id (fun x hx => by linarith [hx.1]) · intro x hx exact div_ne_zero (ne_of_gt hδ) (by linarith [hx.1]) have hcont' : ContinuousOn (fun x : ℝ => log (δ / x)) [[ε, δ]] := by simpa [Set.uIcc_of_le hεδ] using hcont exact hcont'.intervalIntegrable -
integral_log_div_eqlemma — Exact evaluation of the logarithmic ratio integral on [ε, δ].hypothesesδ ε :ℝhε :0 < εhεδ :ε ≤ δProof (Lean source)
lemma integral_log_div_eq {δ ε : ℝ} (hε : 0 < ε) (hεδ : ε ≤ δ) : (∫ x in ε..δ, log (δ / x)) = δ - ε - ε * log (δ / ε) := by have hδ : 0 < δ := lt_of_lt_of_le hε hεδ calc (∫ x in ε..δ, log (δ / x)) = ∫ x in ε..δ, (log δ - log x) := by refine intervalIntegral.integral_congr ?_ intro x hx have hxIcc : x ∈ Icc ε δ := by simpa [Set.uIcc_of_le hεδ] using hx have hxpos : 0 < x := lt_of_lt_of_le hε hxIcc.1 simpa using Real.log_div (ne_of_gt hδ) (ne_of_gt hxpos) _ = (δ - ε) * log δ - (δ * log δ - ε * log ε - δ + ε) := by rw [intervalIntegral.integral_sub] · rw [intervalIntegral.integral_const] rw [integral_log] simp [smul_eq_mul] · exact intervalIntegrable_const · exact intervalIntegral.intervalIntegrable_log' _ = δ - ε - ε * log (δ / ε) := by rw [Real.log_div (ne_of_gt hδ) (ne_of_gt hε)] ring -
integral_log_div_lelemma — The logarithmic ratio integral over [ε, δ] is at most the interval length.Proof (Lean source)
lemma integral_log_div_le {δ ε : ℝ} (hε : 0 < ε) (hεδ : ε ≤ δ) : (∫ x in ε..δ, log (δ / x)) ≤ δ - ε := by have hratio : 1 ≤ δ / ε := by rw [le_div_iff₀ hε] simpa using hεδ have hnonneg : 0 ≤ ε * log (δ / ε) := mul_nonneg (le_of_lt hε) (Real.log_nonneg hratio) rw [integral_log_div_eq hε hεδ] linarith
VCLocalizedCovering 1 core · 0 supporting A standalone metric identity for binary-factored function classes. ★ empiricalDist_sq_eq_weightedHammingSq
A standalone metric identity for binary-factored function classes.
The result identifies empirical L² distance with weighted Boolean Hamming distance on a fixed sample. It is available as an algebraic bridge but is not used by the finite-pattern localized Rademacher pipeline.
Empirical L² distance as weighted Hamming distance. For a real-valued class that factors through a Boolean classifier at each sample coordinate, F i (S j) = φ j (π i (S j)), the squared empirical L²(Pₙ) distance between two members F i and F i' equals the weighted Hamming distance² of their induced Boolean sample-patterns, with per-coordinate weight (φ j true − φ j false)² / n.
Formal statement
Proof (Lean source)
VCUniformDeviation 2 core · 7 supporting Finite-VC localized uniform-deviation bounds under a universal samplewise empirical-radius assumption, derived from the peeled localized empirical-process theorem. ★ vc_localized_deviation_event★ vc_localized_deviation_event_of_card
Finite-VC localized uniform-deviation bounds under a universal samplewise empirical-radius assumption, derived from the peeled localized empirical-process theorem.
For a finite-VC binary-indexed function class, with high probability the localized empirical
process deviates from its mean by at most 10ρ * ‖f‖ + 5ρ² uniformly over members satisfying
0 ≤ norm f ≤ b, with critical radius ρ of order sqrt(d * log n / n) -- derived, under that
stronger samplewise assumption, by instantiating
localized_uniform_deviation_peeled with the finite-VC localized envelope.
This file is the samplewise-radius finite-VC specialization layer for the peeled
localized uniform-deviation theorem. The empirical-process content is supplied
by finite-pattern Massart bounds; the only rate arithmetic is supplied by
vcLocalizedSlope_peelingCondition_eventually.
It exports the VC-dimension event vc_localized_deviation_event, the direct
growth-cardinality variant vc_localized_deviation_event_of_card, and the
measurability/integrability bridges needed to instantiate the peeled theorem.
Finite-VC localized uniform deviation event. For a class of measurable real-valued functions uniformly bounded in absolute value by a nonnegative constant b, with a nonnegative localization norm, variance controlled by its square, a localization constant K at least 1 and a positive sample size n, suppose the class factors through a binary Boolean family of VC dimension at most d and has the samplewise localization certificate. For a failure probability δ in (0,1], writing ρ for the localized slope vcLocalizedSlope K d n, if ρ is at most b and the peeling/log-domination side condition holds at one dyadic depth covering the class, then there is a measurable event of probability at least 1 - δ on which every class member i with 0 ≤ norm (F i) ≤ b satisfies the peeled localized deviation bound |n⁻¹ ∑ₖ F i(ωₖ) − 𝔼[F i]| ≤ 10ρ·norm(F i) + 5ρ².
Formal statement
Proof (Lean source)
Growth-cardinality localized uniform deviation event. For a class of measurable real-valued functions uniformly bounded in absolute value by a nonnegative constant b, with a nonnegative localization norm and variance controlled by its square, that factors through a Boolean classifier π at every finite sample, for a coordinate transform φ with F i (S j) = φ j (π i (S j)), with a localization constant K at least 1 and a positive sample size n, suppose the induced Boolean growth family satisfies the direct cardinality bound #growthFamily π S ≤ (m+1)^dPi on every finite sample of size m and the class has the samplewise localization certificate. For a failure probability δ in (0,1], writing ρ for the localized slope vcLocalizedSlope K dPi n, if ρ is at most b and the peeling/log-domination side condition holds at one dyadic depth covering the class, then there is a measurable event of probability at least 1 - δ on which every class member i with 0 ≤ norm (F i) ≤ b satisfies the peeled localized deviation bound |n⁻¹ ∑ₖ F i(ωₖ) − 𝔼[F i]| ≤ 10ρ·norm(F i) + 5ρ².
Formal statement
Proof (Lean source)
7 supporting declarations (lemmas, instances)
-
criticalRadius_linear_eqlemma — The critical radius of a positive-slope linear envelope equals its slope, giving the exact fixed-point scale for a localized empirical-process bound.Proof (Lean source)
lemma criticalRadius_linear_eq {C : ℝ} (hC : 0 < C) : criticalRadius (fun r : ℝ => C * r) = C := by apply le_antisymm · exact criticalRadius_linear_le hC · rw [criticalRadius] apply le_csInf · exact ⟨C, hC, by rw [pow_two]⟩ · rintro δ ⟨hδ_pos, hδ⟩ have hδ' : C * δ ≤ δ * δ := by simpa [pow_two] using hδ nlinarith [hδ', hδ_pos] -
vcLocalizedPsi_criticalRadius_fplemma — For the finite-VC localized envelope, its value at the critical radius is no larger than the square of that radius.hypothesesK :ℝd n :ℕhK :0 ≤ Khn :0 < nconclusion≤ (criticalRadius (vcLocalizedPsi K d n)) ^ 2Proof (Lean source)
lemma vcLocalizedPsi_criticalRadius_fp {K : ℝ} {d n : ℕ} (hK : 0 ≤ K) (hn : 0 < n) : vcLocalizedPsi K d n (criticalRadius (vcLocalizedPsi K d n)) ≤ (criticalRadius (vcLocalizedPsi K d n)) ^ 2 := by let ρ := vcLocalizedSlope K d n have hρ_pos : 0 < ρ := vcLocalizedSlope_pos hK hn have hcrit_eq : criticalRadius (vcLocalizedPsi K d n) = ρ := by unfold vcLocalizedPsi exact criticalRadius_linear_eq hρ_pos rw [hcrit_eq] unfold vcLocalizedPsi ρ rw [pow_two] -
ciSup_prod_eq_of_bddAbovelemma — The bounded supremum of a real-valued quantity indexed by two choices is unchanged when the two choices are optimized one after the other.hypothesesconclusion(⨆ p : A × B, f p.1 p.2) = ⨆ b : B, ⨆ a : A, f a bProof (Lean source)
lemma ciSup_prod_eq_of_bddAbove {A B : Type*} [Nonempty A] [Nonempty B] (f : A → B → ℝ) (hb : BddAbove (Set.range fun p : A × B => f p.1 p.2)) : (⨆ p : A × B, f p.1 p.2) = ⨆ b : B, ⨆ a : A, f a b := by classical have hinner_bdd : ∀ b : B, BddAbove (Set.range fun a : A => f a b) := by intro b rcases hb with ⟨M, hM⟩ refine ⟨M, ?_⟩ rintro _ ⟨a, rfl⟩ exact hM ⟨(a, b), rfl⟩ have houter_bdd : BddAbove (Set.range fun b : B => ⨆ a : A, f a b) := by rcases hb with ⟨M, hM⟩ refine ⟨M, ?_⟩ rintro _ ⟨b, rfl⟩ exact ciSup_le fun a => hM ⟨(a, b), rfl⟩ apply le_antisymm · refine ciSup_le ?_ intro p exact le_trans (le_ciSup (hinner_bdd p.2) p.1) (le_ciSup houter_bdd p.2) · refine ciSup_le ?_ intro b refine ciSup_le ?_ intro a exact le_ciSup hb (a, b) -
vc_starHullZeroOut_empirical_rademacher_aemeasurablelemma — Measurability bridge for the empirical Rademacher process of the finite-VC localized star hull.hypothesesι :sharedType uNonempty ιCountable ιF :ι → 𝒳 → ℝnorm :(𝒳 → ℝ) → ℝhF_meas :∀ i, Measurable (F i)μ :Measure 𝒳b r :ℝhb :0 ≤ bhbound :∀ i x, |F i x| ≤ bn :ℕconclusionAEMeasurable (fun ω : Fin n → 𝒳 => empiricalRademacherComplexity n (starHullZeroOut F norm r) (id ∘ ω)) (Measure.pi (fun _ => μ))Proof (Lean source)
lemma vc_starHullZeroOut_empirical_rademacher_aemeasurable [MeasurableSpace 𝒳] [Nonempty ι] [Countable ι] (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (hF_meas : ∀ i, Measurable (F i)) (μ : Measure 𝒳) (b r : ℝ) (hb : 0 ≤ b) (hbound : ∀ i x, |F i x| ≤ b) (n : ℕ) : AEMeasurable (fun ω : Fin n → 𝒳 => empiricalRademacherComplexity n (starHullZeroOut F norm r) (id ∘ ω)) (Measure.pi (fun _ => μ)) := by classical apply Measurable.aemeasurable unfold empiricalRademacherComplexity apply measurable_const.mul apply Finset.univ.measurable_sum intro σ _ have hsup_eq : (fun ω : Fin n → 𝒳 => ⨆ p : starHullParam ι, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r p ((id ∘ ω) k)|) = fun ω : Fin n → 𝒳 => ⨆ i : ι, starHullZeroOutScaleCoeff F norm r i * |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (ω k)| := by funext ω have hbdd : BddAbove (Set.range fun p : starHullParam ι => |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r p ((id ∘ ω) k)|) := by simpa using starHullZeroOut_bddAbove_of_bound F norm hb n r (id ∘ ω) (fun i k => hbound i _) σ calc (⨆ p : starHullParam ι, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r p ((id ∘ ω) k)|) = ⨆ i : ι, ⨆ a : Icc (0 : ℝ) 1, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r (a, i) (ω k)| := by unfold starHullParam simpa [Function.comp_def] using ciSup_prod_eq_of_bddAbove (fun a : Icc (0 : ℝ) 1 => fun i : ι => |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r (a, i) (ω k)|) hbdd _ = ⨆ i : ι, starHullZeroOutScaleCoeff F norm r i * |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (ω k)| := by congr ext i exact starHullZeroOut_inner_sup_eq F norm r ω σ i rw [hsup_eq] apply Measurable.iSup intro i apply measurable_const.mul apply Measurable.abs apply measurable_const.mul apply Finset.univ.measurable_sum intro k _ apply measurable_const.mul exact (hF_meas i).comp (measurable_pi_apply k) -
vc_starHullZeroOut_empirical_rademacher_integrablelemma — Integrability of the finite-VC localized star-hull empirical Rademacher process follows from the deterministic linear envelope once the residual measurability bridge above is available.hypothesesι :sharedType uNonempty ιCountable ιF :ι → 𝒳 → ℝnorm :(𝒳 → ℝ) → ℝμ :hF_meas :∀ i, Measurable (F i)b :ℝhb :0 ≤ bhbound :∀ i x, |F i x| ≤ bK :ℝd n :ℕhK :(1 : ℝ) ≤ Khn :0 < nHvc :Hloc :r :ℝvcLocalizedSlope K d n ≤ rconclusionIntegrable (fun ω : Fin n → 𝒳 => empiricalRademacherComplexity n (starHullZeroOut F norm r) (id ∘ ω)) (Measure.pi (fun _ => μ))Proof (Lean source)
lemma vc_starHullZeroOut_empirical_rademacher_integrable [MeasurableSpace 𝒳] [Nonempty ι] [Countable ι] (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (μ : Measure 𝒳) [IsProbabilityMeasure μ] (hF_meas : ∀ i, Measurable (F i)) (b : ℝ) (hb : 0 ≤ b) (hbound : ∀ i x, |F i x| ≤ b) (K : ℝ) (d n : ℕ) (hK : (1 : ℝ) ≤ K) (hn : 0 < n) (Hvc : BinaryFactoredVCClass F d) (Hloc : SamplewiseLocalizedVCDudleyHypotheses F norm) : ∀ r : ℝ, vcLocalizedSlope K d n ≤ r → Integrable (fun ω : Fin n → 𝒳 => empiricalRademacherComplexity n (starHullZeroOut F norm r) (id ∘ ω)) (Measure.pi (fun _ => μ)) := by intro r hr let g : (Fin n → 𝒳) → ℝ := fun ω => empiricalRademacherComplexity n (starHullZeroOut F norm r) (id ∘ ω) have hr_nonneg : 0 ≤ r := le_trans (vcLocalizedSlope_nonneg K d n) hr have hg_meas : AEMeasurable g (Measure.pi (fun _ : Fin n => μ)) := by simpa [g] using vc_starHullZeroOut_empirical_rademacher_aemeasurable F norm hF_meas μ b r hb hbound n have hg_nonneg : ∀ᵐ ω : Fin n → 𝒳 ∂(Measure.pi (fun _ : Fin n => μ)), 0 ≤ g ω := by exact Filter.Eventually.of_forall fun ω => by dsimp [g] unfold empiricalRademacherComplexity refine mul_nonneg ?_ ?_ · positivity · refine Finset.sum_nonneg ?_ intro σ _ refine Real.iSup_nonneg ?_ intro p exact abs_nonneg _ have hg_upper : ∀ᵐ ω : Fin n → 𝒳 ∂(Measure.pi (fun _ : Fin n => μ)), g ω ≤ vcLocalizedPsi K d n r := by exact Filter.Eventually.of_forall fun ω => by dsimp [g] simpa using vc_starHullZeroOut_empirical_rademacher_le_linear F norm K d n hK Hvc Hloc (id ∘ ω) r hr_nonneg have hg_Icc : ∀ᵐ ω : Fin n → 𝒳 ∂(Measure.pi (fun _ : Fin n => μ)), g ω ∈ Icc 0 (vcLocalizedPsi K d n r) := by filter_upwards [hg_nonneg, hg_upper] with ω h0 h1 exact ⟨h0, h1⟩ exact integrable_bounded 0 (vcLocalizedPsi K d n r) hg_meas hg_Icc -
vc_starHullZeroOut_empirical_rademacher_integrable_of_cardlemma — Cardinality-bound variant of the integrability bridge for the localized star-hull empirical Rademacher process.hypothesesι :sharedType uNonempty ιCountable ιF :ι → 𝒳 → ℝnorm :(𝒳 → ℝ) → ℝπ :ι → 𝒳 → Boolμ :hF_meas :∀ i, Measurable (F i)b :ℝhb :0 ≤ bhbound :∀ i x, |F i x| ≤ bK :ℝdPi n :ℕhK :(1 : ℝ) ≤ Khn :0 < nhcard :∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPiHloc :r :ℝvcLocalizedSlope K dPi n ≤ rconclusionIntegrable (fun ω : Fin n → 𝒳 => empiricalRademacherComplexity n (starHullZeroOut F norm r) (id ∘ ω)) (Measure.pi (fun _ => μ))Proof (Lean source)
lemma vc_starHullZeroOut_empirical_rademacher_integrable_of_card [MeasurableSpace 𝒳] [Nonempty ι] [Countable ι] (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (μ : Measure 𝒳) [IsProbabilityMeasure μ] (hF_meas : ∀ i, Measurable (F i)) (b : ℝ) (hb : 0 ≤ b) (hbound : ∀ i x, |F i x| ≤ b) (hfactor : ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))) (K : ℝ) (dPi n : ℕ) (hK : (1 : ℝ) ≤ K) (hn : 0 < n) (hcard : ∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPi) (Hloc : SamplewiseLocalizedVCDudleyHypotheses F norm) : ∀ r : ℝ, vcLocalizedSlope K dPi n ≤ r → Integrable (fun ω : Fin n → 𝒳 => empiricalRademacherComplexity n (starHullZeroOut F norm r) (id ∘ ω)) (Measure.pi (fun _ => μ)) := by intro r hr let g : (Fin n → 𝒳) → ℝ := fun ω => empiricalRademacherComplexity n (starHullZeroOut F norm r) (id ∘ ω) have hr_nonneg : 0 ≤ r := le_trans (vcLocalizedSlope_nonneg K dPi n) hr have hg_meas : AEMeasurable g (Measure.pi (fun _ : Fin n => μ)) := by simpa [g] using vc_starHullZeroOut_empirical_rademacher_aemeasurable F norm hF_meas μ b r hb hbound n have hg_nonneg : ∀ᵐ ω : Fin n → 𝒳 ∂(Measure.pi (fun _ : Fin n => μ)), 0 ≤ g ω := by exact Filter.Eventually.of_forall fun ω => by dsimp [g] unfold empiricalRademacherComplexity refine mul_nonneg ?_ ?_ · positivity · refine Finset.sum_nonneg ?_ intro σ _ refine Real.iSup_nonneg ?_ intro p exact abs_nonneg _ have hg_upper : ∀ᵐ ω : Fin n → 𝒳 ∂(Measure.pi (fun _ : Fin n => μ)), g ω ≤ vcLocalizedPsi K dPi n r := by exact Filter.Eventually.of_forall fun ω => by dsimp [g] simpa using vc_starHullZeroOut_empirical_rademacher_le_linear_of_card F norm π hfactor K dPi n hK hcard Hloc (id ∘ ω) r hr_nonneg have hg_Icc : ∀ᵐ ω : Fin n → 𝒳 ∂(Measure.pi (fun _ : Fin n => μ)), g ω ∈ Icc 0 (vcLocalizedPsi K dPi n r) := by filter_upwards [hg_nonneg, hg_upper] with ω h0 h1 exact ⟨h0, h1⟩ exact integrable_bounded 0 (vcLocalizedPsi K dPi n r) hg_meas hg_Icc -
vc_localized_deviation_event_eventuallytheorem — For a measurable finite-VC function class, a nonnegative localization norm, a probability law, a nonnegative envelope and its uniform bound, the variance control, a VC tuning constant, a positive VC dimension, the samplewise localization certificate, and a confidence level in (0,1], eventually every logarithmic peeling depth covering the envelope yields the finite-VC localized deviation event without a separate peeling-arithmetic hypothesis.hypothesesι :sharedType u𝒳 :sharedType vF :ι → 𝒳 → ℝnorm :(𝒳 → ℝ) → ℝμ :hF_meas :∀ i, Measurable (F i)b :ℝhb :0 ≤ bhbound :∀ i x, |F i x| ≤ bhnorm_nonneg :∀ i, 0 ≤ norm (F i)hvariance :∀ i, variance (F i) μ ≤ norm (F i) ^ 2K :ℝd :ℕhK :(1 : ℝ) ≤ Khd :0 < dHvc :Hloc :δ :ℝhδ :0 < δhδ' :δ ≤ 1conclusion∃ n₀ : ℕ,∀ n ≥ n₀,∀ L : ℕ,(L : ℝ)≤ log ((n : ℝ) + 1) → b ≤ vcLocalizedSlope K d n * (2 : ℝ) ^ L → vcLocalizedSlope K d n ≤ b → ∃ E : Set (Fin n → 𝒳), MeasurableSet E ∧ Measure.pi (fun _ => μ) E ≥ 1- ofReal δ ∧∀ ω ∈ E,∀ i : ι,0≤ norm (F i) → norm (F i) ≤ b → |(n : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin n => F i (ω k))- μ[fun x => F i x]| ≤ 10 * vcLocalizedSlope K d n * norm (F i)+ 5 * (vcLocalizedSlope K d n) ^ 2Proof (Lean source)
theorem vc_localized_deviation_event_eventually (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (μ : Measure 𝒳) [IsProbabilityMeasure μ] (hF_meas : ∀ i, Measurable (F i)) (b : ℝ) (hb : 0 ≤ b) (hbound : ∀ i x, |F i x| ≤ b) (hnorm_nonneg : ∀ i, 0 ≤ norm (F i)) (hvariance : ∀ i, variance (F i) μ ≤ norm (F i) ^ 2) (K : ℝ) (d : ℕ) (hK : (1 : ℝ) ≤ K) (hd : 0 < d) (Hvc : BinaryFactoredVCClass F d) (Hloc : SamplewiseLocalizedVCDudleyHypotheses F norm) {δ : ℝ} (hδ : 0 < δ) (hδ' : δ ≤ 1) : ∃ n₀ : ℕ, ∀ n ≥ n₀, ∀ L : ℕ, (L : ℝ) ≤ log ((n : ℝ) + 1) → b ≤ vcLocalizedSlope K d n * (2 : ℝ) ^ L → vcLocalizedSlope K d n ≤ b → ∃ E : Set (Fin n → 𝒳), MeasurableSet E ∧ Measure.pi (fun _ => μ) E ≥ 1 - ofReal δ ∧ ∀ ω ∈ E, ∀ i : ι, 0 ≤ norm (F i) → norm (F i) ≤ b → |(n : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin n => F i (ω k)) - μ[fun x => F i x]| ≤ 10 * vcLocalizedSlope K d n * norm (F i) + 5 * (vcLocalizedSlope K d n) ^ 2 := by obtain ⟨n₀, hn₀⟩ := vcLocalizedSlope_peelingCondition_eventually hb hδ hδ' hK hd refine ⟨max n₀ 1, ?_⟩ intro n hn L hL hcover hρ_le_b have hn₀n : n₀ ≤ n := (Nat.le_max_left n₀ 1).trans hn have hnpos : 0 < n := Nat.zero_lt_one.trans_le ((Nat.le_max_right n₀ 1).trans hn) exact vc_localized_deviation_event F norm μ hF_meas b hb hbound hnorm_nonneg hvariance K d n hK hnpos Hvc Hloc hδ hδ' hρ_le_b (hn₀ n hn₀n L hL hcover)