Stat.Concentration.VC

Uniform entropy and maximal inequalities for VC-type classes of real functions.

Rademacher 5 core · 13 supporting · 3 submodules For a countable class of measurable functions bounded by U, with population L² norm at most σ < U and polynomial empirical L² covering numbers (base A ≥ e, exponent v ≥ 1), the Rademacher complexity at sample size n is a
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.

def subgraphClassifier reviewed
Causalean.Stat.Concentration

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.

Definition (Lean source)
𝒳 :
Type u
shared
ι :
Type v
shared
F :
ι → 𝒳 → ℝ
i :
ι
z :
𝒳 × ℝ
subgraphClassifier F i z :
decide (z.2 < F i z.1)
Causalean.Stat.Concentration.subgraphClassifier · Causalean/Stat/Concentration/VC/Basic.lean:26
def HasPseudoDimAtMost reviewed
Causalean.Stat.Concentration

Given a real-valued function class on an observation space and a nonnegative integer dd, the pseudo-dimension-at-most-dd 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 dd.

Definition (Lean source)
𝒳 :
Type u
shared
ι :
Type v
shared
F :
ι → 𝒳 → ℝ
d :
ℕ
n :
ℕ
T :
Fin n → 𝒳 × ℝ
HasPseudoDimAtMost F d :
Prop
Causalean.Stat.Concentration.HasPseudoDimAtMost · Causalean/Stat/Concentration/VC/Basic.lean:32
def measureL2Dist reviewed
Causalean.Stat.Concentration

Given a measure QQ on an observation space and two real-valued functions on that space, their measure-based L2L^2 semidistance is ∫(f−g)2 dQ\sqrt{\int (f-g)^2\,dQ}.

Definition (Lean source)
𝒳 :
Type u
shared
Q :
Measure 𝒳
f g :
𝒳 → ℝ
measureL2Dist Q f g :
ℝ
sqrt (∫ x, (f x - g x) ^ 2 ∂Q)
Causalean.Stat.Concentration.measureL2Dist · Causalean/Stat/Concentration/VC/Basic.lean:48
def IsL2Cover reviewed
Causalean.Stat.Concentration

Given a measure QQ on an observation space, a real-valued function class, a radius rr, and a finite set of class indices, the open L2(Q)L^2(Q) cover property holds exactly when every class member lies at strictly less than distance rr from a member indexed by that finite set.

Definition (Lean source)
𝒳 :
Type u
shared
ι :
Type v
shared
Q :
Measure 𝒳
F :
ι → 𝒳 → ℝ
r :
ℝ
C :
i :
ι
IsL2Cover Q F r C :
Prop
∃ j ∈ C, measureL2Dist Q (F i) (F j) < r
Causalean.Stat.Concentration.IsL2Cover · Causalean/Stat/Concentration/VC/Basic.lean:54
def L2CoveringNumberLe reviewed
Causalean.Stat.Concentration

Given a measure QQ on an observation space, a real-valued function class, a radius rr, and a nonnegative integer NN, the L2(Q)L^2(Q) covering-number-at-most-NN property holds exactly when there is a finite set of at most NN class indices that forms an open L2(Q)L^2(Q) cover at radius rr.

Definition (Lean source)
𝒳 :
Type u
shared
ι :
Type v
shared
Q :
Measure 𝒳
F :
ι → 𝒳 → ℝ
r :
ℝ
N :
ℕ
L2CoveringNumberLe Q F r N :
Prop
∃ C : Finset ι,
clause 1
C.card ≤ N
clause 2
IsL2Cover Q F r C
Causalean.Stat.Concentration.L2CoveringNumberLe · Causalean/Stat/Concentration/VC/Basic.lean:61
def vcSubgraphCoverBound reviewed
Causalean.Stat.Concentration

Given a nonnegative integer dd and a real number ε\varepsilon, the explicit VC-subgraph cover bound is the least integer no smaller than (16/ε)8(d+1)(16/\varepsilon)^{8(d+1)}.

Definition (Lean source)
d :
ℕ
ε :
ℝ
vcSubgraphCoverBound d ε :
ℕ
ceil ((16 / ε) ^ (8 * (d + 1)))
Causalean.Stat.Concentration.vcSubgraphCoverBound · Causalean/Stat/Concentration/VC/Basic.lean:68
theorem real_vcSubgraph_l2_covering reviewed
Causalean.Stat.Concentration

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
𝒳 :
Type u
shared
ι :
Type v
shared
Nonempty ι
F :
ι → 𝒳 → ℝ
d :
ℕ
hmeas :
∀ i, Measurable (F i)
hpdim :
U ε :
ℝ
hU :
0 < U
hε :
0 < ε
hε1 :
ε ≤ 1
henvelope :
∀ i x, |F i x| ≤ U
Proof (Lean source)
theorem real_vcSubgraph_l2_covering [MeasurableSpace 𝒳] [Nonempty ι] (F : ι → 𝒳 → ℝ) (d : ℕ) (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) (Q : Measure 𝒳) [IsProbabilityMeasure Q] : L2CoveringNumberLe Q F (ε * U) (vcSubgraphCoverBound d ε) := by classical let R : ι → ι → Prop := fun i j => ε * U ≤ measureL2Dist Q (F i) (F j) let good : Set (Set ι) := {S | S.Pairwise R} have hdist_symm (i j : ι) : measureL2Dist Q (F i) (F j) = measureL2Dist Q (F j) (F i) := by unfold measureL2Dist; congr 2 with x <;> ring have hchar : Order.IsOfFiniteCharacter good := by intro S; constructor · intro h T hTS hT exact h.mono hTS · intro h a ha b hb hab have hsub : ({a, b} : Set ι) ⊆ S := by intro x hx rcases hx with (rfl | hx) · exact ha · have : x = b := by simpa using hx simpa [this] using hb have hfin : ({a, b} : Set ι).Finite := (Set.finite_singleton b).insert a exact h ({a, b} : Set ι) hsub hfin (by simp) (by simp) hab obtain ⟨M, -, hmax⟩ := hchar.exists_maximal (x := ∅) (by simp [good]) have hMgood : M.Pairwise R := hmax.prop have hMfinite : M.Finite := by by_contra hfin have hMinfinite : M.Infinite := hfin obtain ⟨C, hCM, hCcard⟩ := hMinfinite.exists_subset_card_eq (vcSubgraphCoverBound d ε + 1) have hCsep : ∀ a ∈ C, ∀ b ∈ C, a ≠ b → ε * U ≤ measureL2Dist Q (F a) (F b) := by intro a ha b hb hab; exact hMgood (hCM ha) (hCM hb) hab have hbound := finite_l2_packing_card_le F d hmeas hpdim hU hε hε1 henvelope Q C hCsep omega let C : Finset ι := hMfinite.toFinset refine ⟨C, ?_, ?_⟩ · apply finite_l2_packing_card_le F d hmeas hpdim hU hε hε1 henvelope Q intro a ha b hb hab; exact hMgood (by simpa [C] using ha) (by simpa [C] using hb) hab · intro i by_cases hi : i ∈ M · refine ⟨i, by simpa [C] using hi, ?_⟩ simp [measureL2Dist, mul_pos hε hU] · by_contra hclose push_neg at hclose have hinsert : (insert i M).Pairwise R := by apply hMgood.insert; intro j hj hij have hij' : ε * U ≤ measureL2Dist Q (F i) (F j) := hclose j (by simpa [C] using hj) refine ⟨hij', ?_⟩ change ε * U ≤ measureL2Dist Q (F j) (F i) rw [hdist_symm]; exact hij' have heq : M = insert i M := hmax.eq_of_le hinsert (Set.subset_insert i M) apply hi; rw [heq]; exact Set.mem_insert i M
3 supporting declarations (lemmas, instances)
  • hasPseudoDimAtMost_iff_growthFamily theorem — For a real-valued function class and a dimension bound, having pseudo-dimension at most that bound is equivalent to bounding every finite threshold-trace VC dimension.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    shared
    F :
    ι → 𝒳 → ℝ
    d :
    ℕ
    ↔ ∀ (n : ℕ) (T : Fin n → 𝒳 × ℝ), (growthFamily (subgraphClassifier F) T).vcDim ≤ d
    Proof (Lean source)
    theorem hasPseudoDimAtMost_iff_growthFamily (F : ι → 𝒳 → ℝ) (d : ℕ) : HasPseudoDimAtMost F d ↔ ∀ (n : ℕ) (T : Fin n → 𝒳 × ℝ), (growthFamily (subgraphClassifier F) T).vcDim ≤ d := by rfl
    Causalean.Stat.Concentration.hasPseudoDimAtMost_iff_growthFamily · Causalean/Stat/Concentration/VC/Basic.lean:39
  • coarse_vc_weightedHamming_packing_card_le theorem — Given a VC-dimension bound, nonnegative coordinate weights, a scale and positive separation below that scale, a bound on the total weight, and a finite Boolean class with that VC bound and pairwise weighted-Hamming separation, the class has the stated coarse explicit polynomial packing bound.
    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)))
    Proof (Lean source)
    theorem coarse_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 _)
    Causalean.Stat.Concentration.coarse_vc_weightedHamming_packing_card_le · Causalean/Stat/Concentration/VC/Basic.lean:177
  • pseudoDim_gives_finite_subgraph_vc theorem — A pseudo-dimension bound for a real-valued class implies that the subgraph labels on any chosen finite thresholded sample have VC dimension at most the same bound.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    ι → 𝒳 → ℝ
    shared
    d n :
    ℕ
    hpdim :
    T :
    Fin n → 𝒳 × ℝ
    Proof (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
    Causalean.Stat.Concentration.pseudoDim_gives_finite_subgraph_vc · Causalean/Stat/Concentration/VC/Basic.lean:612
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.

structure HasPolynomialL2Cover reviewed
Causalean.Stat.Concentration

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)
𝒳 :
Type u
shared
ι :
Type v
F :
ι → 𝒳 → ℝ
U :
ℝ
envelope_pos :
0 < U
measurable :
∀ i, Measurable (F i)
envelope :
∀ i x, |F i x| ≤ U
entropy :
∃ (A : ℝ) (p : ℕ)
if
1 ≤ A ∧ ∀ (Q : Measure 𝒳) (_hQ : IsProbabilityMeasure Q) (ε : ℝ), 0 < ε
and
ε ≤ 1
then
L2CoveringNumberLe Q F (ε * U) (ceil ((A / ε) ^ p))
Causalean.Stat.Concentration.HasPolynomialL2Cover · Causalean/Stat/Concentration/VC/Algebra.lean:195
theorem hasPolynomialL2Cover reviewed
Causalean.Stat.Concentration.HasPseudoDimAtMost

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
𝒳 :
Type u
shared
ι :
Type v
Nonempty ι
ι → 𝒳 → ℝ
d :
ℕ
U :
ℝ
hpdim :
hmeas :
∀ i, Measurable (F i)
hU :
0 < U
henvelope :
∀ i x, |F i x| ≤ U
Proof (Lean source)
theorem HasPseudoDimAtMost.hasPolynomialL2Cover {ι : 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) : HasPolynomialL2Cover F U := by refine ⟨hU, hmeas, henvelope, 16, 8 * (d + 1), 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)
Causalean.Stat.Concentration.HasPseudoDimAtMost.hasPolynomialL2Cover · Causalean/Stat/Concentration/VC/Algebra.lean:229 · uses HasPolynomialL2Cover , HasPseudoDimAtMost
structure HasPolynomialL2CoverWith reviewed
Causalean.Stat.Concentration

A polynomial covering certificate records that the class has the ordinary covering property, the named entropy base is at least one, and that base and the named exponent give the covering bound for every probability law and relative radius.

Definition (Lean source)
𝒳 :
Type u
shared
ι :
Type v
F :
ι → 𝒳 → ℝ
U A :
ℝ
p :
ℕ
toHasPolynomialL2Cover :
one_le_base :
1 ≤ A
entropy :
∀ (Q : Measure 𝒳) (_hQ : IsProbabilityMeasure Q) (ε : ℝ)
if
0 < ε
and
ε ≤ 1
then
L2CoveringNumberLe Q F (ε * U) (ceil ((A / ε) ^ p))
Causalean.Stat.Concentration.HasPolynomialL2CoverWith · Causalean/Stat/Concentration/VC/Algebra.lean:478
def HasUniformPolynomialL2CoverOver reviewed
Causalean.Stat.Concentration

Given an observation space, an auxiliary parameter set SS, an index set depending on the parameter, a parameter-indexed family of real-valued function classes, and a parameter-indexed envelope, the uniform polynomial L2L^2 covering property over SS holds exactly when there are one real entropy base and one nonnegative-integer exponent such that every parameter's class has the corresponding polynomial L2L^2 covering certificate with its designated envelope.

Definition (Lean source)
𝒳 :
Type u
shared
S :
Type*
S → Type v
F :
(s : S) → ι s → 𝒳 → ℝ
U :
S → ℝ
HasUniformPolynomialL2CoverOver S F U :
Prop
∃ A : ℝ, ∃ p : ℕ, ∀ s, HasPolynomialL2CoverWith (F s) (U s) A p
Causalean.Stat.Concentration.HasUniformPolynomialL2CoverOver · Causalean/Stat/Concentration/VC/Algebra.lean:703
16 supporting declarations (lemmas, instances)
  • neg theorem — Negating every member of a polynomial-cover class preserves its envelope and uniform polynomial covering certificate, provided that the original class has such a certificate.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    ι → 𝒳 → ℝ
    U :
    ℝ
    HasPolynomialL2Cover (fun i x => -F i x) U
    Proof (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]
    Causalean.Stat.Concentration.HasPolynomialL2Cover.neg · Causalean/Stat/Concentration/VC/Algebra.lean:245
  • add theorem — If each of two independently indexed classes has a polynomial covering certificate, their pointwise sums have a polynomial covering certificate with the sum of the envelopes.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    κ :
    Type w
    F :
    ι → 𝒳 → ℝ
    G :
    κ → 𝒳 → ℝ
    U V :
    ℝ
    HasPolynomialL2Cover (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
    Causalean.Stat.Concentration.HasPolynomialL2Cover.add · Causalean/Stat/Concentration/VC/Algebra.lean:274
  • mul theorem — If each of two independently indexed classes has a polynomial covering certificate, their pointwise products have a polynomial covering certificate with the product of the envelopes.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    κ :
    Type w
    F :
    ι → 𝒳 → ℝ
    G :
    κ → 𝒳 → ℝ
    U V :
    ℝ
    HasPolynomialL2Cover (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
    Causalean.Stat.Concentration.HasPolynomialL2Cover.mul · Causalean/Stat/Concentration/VC/Algebra.lean:316
  • finSum theorem — If every class in a nonempty finite family has a polynomial covering certificate, the class of pointwise sums has a polynomial covering certificate with the sum of the envelopes.
    𝒳 :
    Type u
    shared
    K :
    Type w
    Nonempty K
    K → Type v
    (k : K) → ι k → 𝒳 → ℝ
    K → ℝ
    hF :
    ∀ k, HasPolynomialL2Cover (F k) (U k)
    HasPolynomialL2Cover (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
    Causalean.Stat.Concentration.HasPolynomialL2Cover.finSum · Causalean/Stat/Concentration/VC/Algebra.lean:360
  • finProd theorem — If every class in a nonempty finite family has a polynomial covering certificate, the class of pointwise products has a polynomial covering certificate with the product of the envelopes.
    𝒳 :
    Type u
    shared
    K :
    Type w
    Nonempty K
    K → Type v
    (k : K) → ι k → 𝒳 → ℝ
    K → ℝ
    hF :
    ∀ k, HasPolynomialL2Cover (F k) (U k)
    HasPolynomialL2Cover (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
    Causalean.Stat.Concentration.HasPolynomialL2Cover.finProd · Causalean/Stat/Concentration/VC/Algebra.lean:419
  • forget theorem — A named polynomial-cover certificate implies the corresponding ordinary polynomial-cover certificate.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    ι → 𝒳 → ℝ
    U A :
    ℝ
    p :
    ℕ
    Proof (Lean source)
    theorem HasPolynomialL2CoverWith.forget {ι : Type v} {F : ι → 𝒳 → ℝ} {U A : ℝ} {p : ℕ} (hF : HasPolynomialL2CoverWith F U A p) : HasPolynomialL2Cover F U := hF.toHasPolynomialL2Cover
    Causalean.Stat.Concentration.HasPolynomialL2CoverWith.forget · Causalean/Stat/Concentration/VC/Algebra.lean:494
  • monoEnvelope theorem — Given named polynomial-cover witnesses and an enlarged envelope, the larger envelope preserves those witnesses.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    ι → 𝒳 → ℝ
    U V A :
    ℝ
    p :
    ℕ
    hUV :
    U ≤ V
    Proof (Lean source)
    -- @node: HasPolynomialL2CoverWith.monoEnvelope theorem HasPolynomialL2CoverWith.monoEnvelope {ι : 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)⟩
    Causalean.Stat.Concentration.HasPolynomialL2CoverWith.monoEnvelope · Causalean/Stat/Concentration/VC/Algebra.lean:502
  • hasPolynomialL2CoverWith theorem — If a class has bounded pseudo-dimension, its functions are measurable, and a positive envelope bounds the class pointwise, then the class has explicit named polynomial-cover witnesses.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    Nonempty ι
    ι → 𝒳 → ℝ
    d :
    ℕ
    U :
    ℝ
    hpdim :
    hmeas :
    ∀ i, Measurable (F i)
    hU :
    0 < U
    henvelope :
    ∀ i x, |F i x| ≤ U
    HasPolynomialL2CoverWith 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)
    Causalean.Stat.Concentration.HasPseudoDimAtMost.hasPolynomialL2CoverWith · Causalean/Stat/Concentration/VC/Algebra.lean:524
  • neg theorem — Named polynomial-cover witnesses for a class also witness the same bound for its pointwise negation.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    ι → 𝒳 → ℝ
    U A :
    ℝ
    p :
    ℕ
    HasPolynomialL2CoverWith (fun i x => -F i x) U A p
    Proof (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]
    Causalean.Stat.Concentration.HasPolynomialL2CoverWith.neg · Causalean/Stat/Concentration/VC/Algebra.lean:556
  • add theorem — Named polynomial-cover witnesses for two classes combine into explicit witnesses for their pointwise sums.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    κ :
    Type w
    F :
    ι → 𝒳 → ℝ
    G :
    κ → 𝒳 → ℝ
    U V A B :
    ℝ
    p q :
    ℕ
    HasPolynomialL2CoverWith (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
    Causalean.Stat.Concentration.HasPolynomialL2CoverWith.add · Causalean/Stat/Concentration/VC/Algebra.lean:582
  • mul theorem — Named polynomial-cover witnesses for two classes combine into explicit witnesses for their pointwise products.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    κ :
    Type w
    F :
    ι → 𝒳 → ℝ
    G :
    κ → 𝒳 → ℝ
    U V A B :
    ℝ
    p q :
    ℕ
    HasPolynomialL2CoverWith (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
    Causalean.Stat.Concentration.HasPolynomialL2CoverWith.mul · Causalean/Stat/Concentration/VC/Algebra.lean:625
  • tightenEnvelopeBy theorem — If a class has named witnesses at an inflated envelope, the inflation factor is at least one, and the smaller envelope is positive and directly bounds the class, the envelope can be tightened by charging the inflation factor to the entropy base.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    ι → 𝒳 → ℝ
    V A c :
    ℝ
    p :
    ℕ
    hF :
    hc :
    1 ≤ c
    hV :
    0 < V
    hbound :
    ∀ i x, |F i x| ≤ V
    Proof (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
    Causalean.Stat.Concentration.HasPolynomialL2CoverWith.tightenEnvelopeBy · Causalean/Stat/Concentration/VC/Algebra.lean:671
  • neg theorem — Uniform named polynomial-cover witnesses remain valid after pointwise negation.
    𝒳 :
    Type u
    shared
    S :
    Type*
    S → Type v
    (s : S) → ι s → 𝒳 → ℝ
    S → ℝ
    HasUniformPolynomialL2CoverOver S (fun s i x => -F s i x) U
    Proof (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⟩
    Causalean.Stat.Concentration.HasUniformPolynomialL2CoverOver.neg · Causalean/Stat/Concentration/VC/Algebra.lean:714
  • add theorem — Uniform named polynomial-cover witnesses for two families combine into uniform witnesses for their pointwise sums.
    𝒳 :
    Type u
    shared
    S :
    Type*
    S → Type v
    S → Type w
    (s : S) → ι s → 𝒳 → ℝ
    (s : S) → κ s → 𝒳 → ℝ
    S → ℝ
    HasUniformPolynomialL2CoverOver 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)⟩
    Causalean.Stat.Concentration.HasUniformPolynomialL2CoverOver.add · Causalean/Stat/Concentration/VC/Algebra.lean:725
  • mul theorem — Uniform named polynomial-cover witnesses for two families combine into uniform witnesses for their pointwise products.
    𝒳 :
    Type u
    shared
    S :
    Type*
    S → Type v
    S → Type w
    (s : S) → ι s → 𝒳 → ℝ
    (s : S) → κ s → 𝒳 → ℝ
    S → ℝ
    HasUniformPolynomialL2CoverOver 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)⟩
    Causalean.Stat.Concentration.HasUniformPolynomialL2CoverOver.mul · Causalean/Stat/Concentration/VC/Algebra.lean:740
  • finSum theorem — If every summand family has uniform named polynomial-cover witnesses, their nonempty finite pointwise sum has uniform witnesses with the summed envelopes.
    𝒳 :
    Type u
    shared
    S :
    Type*
    K :
    Type w
    Nonempty K
    (s : S) → K → Type v
    (s : S) → (k : K) → ι s k → 𝒳 → ℝ
    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)
    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
    Causalean.Stat.Concentration.HasUniformPolynomialL2CoverOver.finSum · Causalean/Stat/Concentration/VC/Algebra.lean:755
Basic­Variance­Adaptive­VCExpected­Maximal 5 core · 3 supporting This module defines the empirical-measure polynomial covering hypothesis, the countable empirical supremum, and the normalized logarithmic rate used by the variance-adaptive expected maximal inequality. ★ hasPolynomialEmpiricalL2Cover

Data for variance-adaptive VC-type maximal inequalities

This module defines the empirical-measure polynomial covering hypothesis, the countable empirical supremum, and the normalized logarithmic rate used by the variance-adaptive expected maximal inequality. The covering hypothesis only asks about positive-size finite empirical laws, which is the exact input needed by empirical-metric chaining.

def HasPolynomialEmpiricalL2Cover reviewed
Causalean.Stat.Concentration

Given a real-valued function class on an observation space, an envelope UU, an entropy base AA, and an exponent vv, the polynomial empirical L2L^2 covering property holds exactly when, for every positive sample size and every sample of that size, and for every radius ε\varepsilon with 0<ε≤10<\varepsilon\le 1, there is a finite index set forming an L2L^2 cover under the empirical measure at radius εU\varepsilon U and its cardinality is at most (A/ε)v(A/\varepsilon)^v.

Definition (Lean source)
𝒳 :
Type u
shared
ι :
Type v
shared
F :
ι → 𝒳 → ℝ
U A v :
ℝ
m :
ℕ
S :
Fin m → 𝒳
0 < m
ε :
ℝ
0 < ε
ε ≤ 1
HasPolynomialEmpiricalL2Cover F U A v :
Prop
∃ C : Finset ι,
clause 1
clause 2
(C.card : ℝ) ≤ rpow (A / ε) v
Causalean.Stat.Concentration.HasPolynomialEmpiricalL2Cover · Causalean/Stat/Concentration/VC/BasicVarianceAdaptiveVCExpectedMaximal.lean:26
def vcMaximalLog reviewed
Causalean.Stat.Concentration

Given an entropy base AA, an envelope UU, and a variance scale σ\sigma, the normalized logarithmic complexity is log⁡(max⁡{e,AU/σ})\log(\max\{e,AU/\sigma\}). This normalization makes the logarithm at least one.

Definition (Lean source)
A U σ :
ℝ
vcMaximalLog A U σ :
ℝ
log (max (exp 1) (A * U / σ))
def vcExpectedMaximalRate reviewed
Causalean.Stat.Concentration

Given an envelope UU, a variance scale σ\sigma, an entropy base AA, an exponent vv, and a sample size nn, the variance-adaptive VC-type rate is σvL/n+vUL/n\sigma\sqrt{vL/n}+vUL/n, where L=log⁡(max⁡{e,AU/σ})L=\log(\max\{e,AU/\sigma\}).

Definition (Lean source)
U σ A v :
ℝ
n :
ℕ
vcExpectedMaximalRate U σ A v n :
ℝ
σ * sqrt (v * vcMaximalLog A U σ / (n : ℝ)) + v * U * vcMaximalLog A U σ / (n : ℝ)
Causalean.Stat.Concentration.vcExpectedMaximalRate · Causalean/Stat/Concentration/VC/BasicVarianceAdaptiveVCExpectedMaximal.lean:129
def varianceAdaptiveVCConstant reviewed
Causalean.Stat.Concentration

The fixed numerical constant for the variance-adaptive VC-type expected maximal inequality is 1638416384.

Definition (Lean source)
varianceAdaptiveVCConstant :
ℝ
16384
Causalean.Stat.Concentration.varianceAdaptiveVCConstant · Causalean/Stat/Concentration/VC/BasicVarianceAdaptiveVCExpectedMaximal.lean:138
theorem hasPolynomialEmpiricalL2Cover reviewed
Causalean.Stat.Concentration.HasPolynomialL2Cover

Empirical covering from population covering. If a family F of real-valued functions with envelope U admits a uniform polynomial L2L^2 covering-number bound over every probability measure, then there exist a base A at least Euler's number and an exponent v at least one such that F has polynomial empirical L2L^2 covering numbers with envelope U, base A, and exponent v.

Formal statement
𝒳 :
Type u
shared
ι :
Type v
ι → 𝒳 → ℝ
shared
U :
ℝ
∃ A v : ℝ,
conclusion 1
exp 1 ≤ A
conclusion 2
1 ≤ v
conclusion 3
Proof (Lean source)
theorem HasPolynomialL2Cover.hasPolynomialEmpiricalL2Cover {F : ι → 𝒳 → ℝ} {U : ℝ} (hF : HasPolynomialL2Cover F U) : ∃ A v : ℝ, exp 1 ≤ A ∧ 1 ≤ v ∧ HasPolynomialEmpiricalL2Cover F U A v := by /- Extract `A₀,p` from `hF.entropy` and take `A = max (exp 1) (2 * A₀)` and `v = (p + 1 : ℕ)`. Instantiate the arbitrary-measure certificate at `finiteSampleMeasure S`. For `x = A₀ / ε`, the hypotheses give `1 ≤ x`; hence `ceil (x^p) ≤ x^p + 1 ≤ 2*x^p ≤ (A/ε)^(p+1)`. Rewrite the final natural power as `rpow` with `Real.rpow_natCast`. -/ obtain ⟨A₀, p, hA₀, hentropy⟩ := hF.entropy refine ⟨max (exp 1) (2 * A₀), ((p + 1 : ℕ) : ℝ), le_max_left _ _, ?_, ?_⟩ · exact_mod_cast Nat.succ_le_succ (zero_le p) · intro m S hm ε hε hε1 letI : IsProbabilityMeasure (finiteSampleMeasure S) := finiteSampleMeasure_isProbabilityMeasure S hm obtain ⟨C, hCcard, hCcover⟩ := hentropy (finiteSampleMeasure S) inferInstance ε hε hε1 refine ⟨C, hCcover, ?_⟩ have hx : 1 ≤ A₀ / ε := (one_le_div hε).2 (hε1.trans hA₀) have hceil : (ceil ((A₀ / ε) ^ p) : ℝ) < (A₀ / ε) ^ p + 1 := Nat.ceil_lt_add_one (by positivity) have hxpow : 1 ≤ (A₀ / ε) ^ p := one_le_pow₀ hx have hbase : A₀ / ε ≤ max (exp 1) (2 * A₀) / ε := by apply div_le_div_of_nonneg_right _ hε.le exact (by linarith : A₀ ≤ 2 * A₀) |>.trans (le_max_right _ _) have htwo : 2 ≤ max (exp 1) (2 * A₀) / ε := by apply (le_div_iff₀ hε).2 calc 2 * ε ≤ 2 * 1 := by gcongr _ ≤ 2 * A₀ := by gcongr _ ≤ max (exp 1) (2 * A₀) := le_max_right _ _ calc (C.card : ℝ) ≤ (ceil ((A₀ / ε) ^ p) : ℝ) := by exact_mod_cast hCcard _ ≤ 2 * (A₀ / ε) ^ p := by linarith _ ≤ (max (exp 1) (2 * A₀) / ε) ^ (p + 1) := by have hp := pow_le_pow_left₀ (by positivity : 0 ≤ A₀ / ε) hbase p calc 2 * (A₀ / ε) ^ p ≤ (max (exp 1) (2 * A₀) / ε) * (A₀ / ε) ^ p := mul_le_mul_of_nonneg_right htwo (by positivity) _ ≤ (max (exp 1) (2 * A₀) / ε) * (max (exp 1) (2 * A₀) / ε) ^ p := mul_le_mul_of_nonneg_left hp (by positivity) _ = (max (exp 1) (2 * A₀) / ε) ^ (p + 1) := by rw [pow_succ] ring _ = rpow (max (exp 1) (2 * A₀) / ε) ((p + 1 : ℕ) : ℝ) := by exact (Real.rpow_natCast _ _).symm
Causalean.Stat.Concentration.HasPolynomialL2Cover.hasPolynomialEmpiricalL2Cover · Causalean/Stat/Concentration/VC/BasicVarianceAdaptiveVCExpectedMaximal.lean:144 · uses HasPolynomialEmpiricalL2Cover , HasPolynomialL2Cover
3 supporting declarations (lemmas, instances)
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.

def CoeffBox reviewed
Causalean.Stat.Concentration

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 BB.

Definition (Lean source)
K :
Type w
B :
ℝ
CoeffBox K B :
Type (max 0 w)
{θ : K → ℝ // ∀ k, |θ k| ≤ B}
Causalean.Stat.Concentration.CoeffBox · Causalean/Stat/Concentration/VC/Parametric.lean:25
def linearParameterClass reviewed
Causalean.Stat.Concentration

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.

Definition (Lean source)
𝒳 :
Type u
shared
K :
Type w
φ :
K → 𝒳 → ℝ
B :
ℝ
θ :
x :
𝒳
linearParameterClass φ B θ x :
ℝ
∑ k, θ.1 k * φ k x
Causalean.Stat.Concentration.linearParameterClass · Causalean/Stat/Concentration/VC/Parametric.lean:29 · uses CoeffBox
theorem linearParameterClass_hasPolynomialL2Cover reviewed
Causalean.Stat.Concentration

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
𝒳 :
Type u
shared
K :
Type w
Nonempty K
φ :
K → 𝒳 → ℝ
B M :
ℝ
hB :
0 < B
hM :
0 < M
hmeas :
∀ k, Measurable (φ k)
hφ :
∀ k x, |φ k x| ≤ M
HasPolynomialL2Cover (linearParameterClass φ B) ((Fintype.card K : ℝ) * B * M)
Proof (Lean source)
theorem linearParameterClass_hasPolynomialL2Cover {K : Type w} [Fintype K] [Nonempty K] (φ : K → 𝒳 → ℝ) {B M : ℝ} (hB : 0 < B) (hM : 0 < M) (hmeas : ∀ k, Measurable (φ k)) (hφ : ∀ k x, |φ k x| ≤ M) : HasPolynomialL2Cover (linearParameterClass φ B) ((Fintype.card K : ℝ) * B * M) := by letI : Nonempty (CoeffBox K B) := ⟨⟨fun _ => 0, fun _ => by simpa using hB.le⟩⟩ apply (linearParameterClass_hasPseudoDimAtMost φ B).hasPolynomialL2Cover · intro θ exact Finset.measurable_sum univ fun k _ => measurable_const.mul (hmeas k) · have hcard : (0 : ℝ) < Fintype.card K := by exact_mod_cast Fintype.card_pos positivity · intro θ x calc |linearParameterClass φ B θ x| ≤ ∑ k, |θ.1 k * φ k x| := Finset.abs_sum_le_sum_abs _ _ _ = ∑ k, |θ.1 k| * |φ k x| := by simp only [abs_mul] _ ≤ ∑ _k : K, B * M := by exact Finset.sum_le_sum fun k _ => mul_le_mul (θ.2 k) (hφ k x) (abs_nonneg _) hB.le _ = (Fintype.card K : ℝ) * B * M := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] ring_nf
Causalean.Stat.Concentration.linearParameterClass_hasPolynomialL2Cover · Causalean/Stat/Concentration/VC/Parametric.lean:137 · uses CoeffBox , HasPolynomialL2Cover , linearParameterClass
def HasVCAtMost reviewed
Causalean.Stat.Concentration

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 dd.

Definition (Lean source)
𝒳 :
Type u
shared
κ :
Type w
π :
κ → 𝒳 → Bool
d :
ℕ
n :
ℕ
S :
Fin n → 𝒳
HasVCAtMost π d :
Prop
(growthFamily π S).vcDim ≤ d
Causalean.Stat.Concentration.HasVCAtMost · Causalean/Stat/Concentration/VC/Parametric.lean:171
3 supporting declarations (lemmas, instances)
  • linearParameterClass_hasPseudoDimAtMost theorem — For a finite real-valued feature family and a coefficient bound, the associated bounded-coefficient linear class has pseudo-dimension at most the number of coordinates plus one.
    𝒳 :
    Type u
    shared
    K :
    Type w
    φ :
    K → 𝒳 → ℝ
    B :
    ℝ
    Proof (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
    Causalean.Stat.Concentration.linearParameterClass_hasPseudoDimAtMost · Causalean/Stat/Concentration/VC/Parametric.lean:34
  • indicatorClass_hasPseudoDimAtMost theorem — Given a Boolean classifier family, a dimension bound, and a VC certificate at that bound, the corresponding real-valued zero-one indicator class has the same pseudo-dimension bound.
    𝒳 :
    Type u
    shared
    κ :
    Type w
    π :
    κ → 𝒳 → Bool
    d :
    ℕ
    hπvc :
    HasPseudoDimAtMost (fun j x => if π j x then 1 else 0) d
    Proof (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 [Finset.mem_inter, hi, true_and] exact hpiu.trans hut · simp only [Finset.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)
    Causalean.Stat.Concentration.HasVCAtMost.indicatorClass_hasPseudoDimAtMost · Causalean/Stat/Concentration/VC/Parametric.lean:175
  • mulIndicator theorem — If a real-valued class has a polynomial covering certificate, each set selected by an indicator family is measurable, and the indicator family has bounded VC dimension, the products of the real-valued functions and indicators retain a polynomial cover.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    κ :
    Type w
    F :
    ι → 𝒳 → ℝ
    π :
    κ → 𝒳 → Bool
    U :
    ℝ
    d :
    ℕ
    hπmeas :
    ∀ j, MeasurableSet {x | π j x = true}
    hπvc :
    HasPolynomialL2Cover (fun p : ι × κ => fun x => F p.1 x * if π p.2 x then 1 else 0) U
    Proof (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
    Causalean.Stat.Concentration.HasPolynomialL2Cover.mulIndicator · Causalean/Stat/Concentration/VC/Parametric.lean:252
Geometry 12 core · 4 supporting This module defines compactly supported radial monomials with a moving center and proves finite-trace VC-subgraph bounds. ★ radialMonomialClass_hasPseudoDimAtMost

Euclidean radial monomials and their finite traces

This module defines compactly supported radial monomials with a moving center and proves finite-trace VC-subgraph bounds. The bounds are intentionally non-optimized. Their important features are that they depend only on the Euclidean dimension and the finite degree cutoff, and that they are stated at the trace level, without any assumption on an ambient probability measure.

Odd and even degrees are treated uniformly. On a nonnegative radial ray, every positive integral power is monotone, so a threshold on a radial power is again a distance threshold. Squared Euclidean distance then supplies the finite-dimensional affine lift used by the trace argument.

abbrev EuclideanPoint reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, the Euclidean point space is the real Euclidean space of that dimension.

Definition (Lean source)
d :
ℕ
EuclideanPoint d :
Type
Causalean.Stat.Concentration.EuclideanRadialPolynomial.EuclideanPoint · Causalean/Stat/Concentration/VC/Geometry.lean:28
abbrev RadiusPoint reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, the point-radius space is the set of pairs consisting of a point in the corresponding real Euclidean space and an arbitrary real radius threshold.

Definition (Lean source)
d :
ℕ
RadiusPoint d :
Type
Causalean.Stat.Concentration.EuclideanRadialPolynomial.RadiusPoint · Causalean/Stat/Concentration/VC/Geometry.lean:31
def movingCenterClosedBallClassifier reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, a center point, and a point together with a radius threshold, the moving-center closed-ball classifier returns true exactly when the point lies at distance no greater than the threshold from the center.

Definition (Lean source)
d :
ℕ
zr :
movingCenterClosedBallClassifier d x zr :
decide (dist zr.1 x ≤ zr.2)
Causalean.Stat.Concentration.EuclideanRadialPolynomial.movingCenterClosedBallClassifier · Causalean/Stat/Concentration/VC/Geometry.lean:37 · uses EuclideanPoint , RadiusPoint
def movingCenterBallExteriorClassifier reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, a center point, and a point together with a radius threshold, the moving-center exterior classifier returns true exactly when the point lies at distance strictly greater than the threshold from the center.

Definition (Lean source)
d :
ℕ
zr :
movingCenterBallExteriorClassifier d x zr :
decide (zr.2 < dist zr.1 x)
Causalean.Stat.Concentration.EuclideanRadialPolynomial.movingCenterBallExteriorClassifier · Causalean/Stat/Concentration/VC/Geometry.lean:42 · uses EuclideanPoint , RadiusPoint
abbrev ClosedBallParam reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, the closed-ball parameter space is the set of pairs consisting of a point in that real Euclidean space and a nonnegative real radius.

Definition (Lean source)
d :
ℕ
ClosedBallParam d :
Type
Causalean.Stat.Concentration.EuclideanRadialPolynomial.ClosedBallParam · Causalean/Stat/Concentration/VC/Geometry.lean:208
def euclideanClosedBallClassifier reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, a closed-ball parameter, and a point in the corresponding Euclidean space, the closed-ball classifier returns true exactly when the point lies in the closed ball specified by that parameter.

Definition (Lean source)
d :
ℕ
euclideanClosedBallClassifier d cr z :
decide (dist z cr.1 ≤ (cr.2 : ℝ))
Causalean.Stat.Concentration.EuclideanRadialPolynomial.euclideanClosedBallClassifier · Causalean/Stat/Concentration/VC/Geometry.lean:214 · uses ClosedBallParam , EuclideanPoint
def radialAnnulusMonomial reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, a bandwidth, two relative annulus endpoints, a natural-number degree, a center point, and an evaluation point, the radial annulus monomial equals (dist⁡(z,x)/q)k(\operatorname{dist}(z,x)/q)^k when the distance to the center lies between aqaq and bqbq, and is zero otherwise.

Definition (Lean source)
d :
ℕ
q a b :
ℝ
k :
ℕ
x z :
radialAnnulusMonomial d q a b k x z :
ℝ
if a * q ≤ dist z x ∧ dist z x ≤ b * q then (dist z x / q) ^ k else 0
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialAnnulusMonomial · Causalean/Stat/Concentration/VC/Geometry.lean:279 · uses EuclideanPoint
abbrev RadialMonomialParam reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension and a maximal natural-number degree, the radial-monomial parameter space consists of a center in that Euclidean space paired with a degree from zero through pp.

Definition (Lean source)
d p :
ℕ
RadialMonomialParam d p :
Type
EuclideanPoint d × Fin (p + 1)
Causalean.Stat.Concentration.EuclideanRadialPolynomial.RadialMonomialParam · Causalean/Stat/Concentration/VC/Geometry.lean:290
def radialMonomialClass reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, a maximal degree, a bandwidth and two relative annulus endpoints, a center-and-degree parameter, and a Euclidean evaluation point, the radial-monomial class maps that parameter and point to the corresponding radial annulus monomial.

Definition (Lean source)
d p :
ℕ
q a b :
ℝ
radialMonomialClass d p q a b θ z :
ℝ
radialAnnulusMonomial d q a b θ.2.1 θ.1 z
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialMonomialClass · Causalean/Stat/Concentration/VC/Geometry.lean:297 · uses EuclideanPoint , RadialMonomialParam
def fixedRadialPseudoDimBound reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, the fixed-degree radial pseudo-dimension bound is the explicit Boolean-combination bound 23(d+3)+12^{3(d+3)+1}.

Definition (Lean source)
d :
ℕ
fixedRadialPseudoDimBound d :
ℕ
Causalean.Stat.Concentration.EuclideanRadialPolynomial.fixedRadialPseudoDimBound · Causalean/Stat/Concentration/VC/Geometry.lean:306
def radialPseudoDimBound reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension and a maximal degree, the radial pseudo-dimension bound is the explicit finite-union bound 2(p+1)(23(d+3)+1+1)+12^{(p+1)(2^{3(d+3)+1}+1)+1} obtained by combining p+1p+1 fixed-degree bounds.

Definition (Lean source)
d p :
ℕ
radialPseudoDimBound d p :
ℕ
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialPseudoDimBound · Causalean/Stat/Concentration/VC/Geometry.lean:310
theorem radialMonomialClass_hasPseudoDimAtMost reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Pseudo-dimension bound for the moving-center radial-monomial class. For a positive bandwidth q, allowing both the Euclidean center and the monomial degree — ranging from zero through p — to vary gives the radial-monomial class a pseudo-dimension of at most radialPseudoDimBound d p.

Formal statement
d p :
ℕ
q a b :
ℝ
hq :
0 < q
Proof (Lean source)
theorem radialMonomialClass_hasPseudoDimAtMost (d p : ℕ) {q a b : ℝ} (hq : 0 < q) : HasPseudoDimAtMost (radialMonomialClass d p q a b) (radialPseudoDimBound d p) := by let pi : (j : Fin (p + 1)) → EuclideanPoint d → (EuclideanPoint d × ℝ) → Bool := fun j => subgraphClassifier (fun x : EuclideanPoint d => radialAnnulusMonomial d q a b j.1 x) have hpi : ∀ j, HasVCAtMost (pi j) (fixedRadialPseudoDimBound d) := by intro j exact radialAnnulusMonomial_hasPseudoDimAtMost d j.1 hq have hu := finiteUnion_hasVCAtMost pi hpi have hr := HasVCAtMost.reindex hu (fun theta : RadialMonomialParam d p => (Sigma.mk theta.2 theta.1 : Sigma fun _ : Fin (p + 1) => EuclideanPoint d)) change HasVCAtMost (subgraphClassifier (radialMonomialClass d p q a b)) (radialPseudoDimBound d p) simp only [radialPseudoDimBound, Fintype.card_fin, pi, radialMonomialClass] at hr ⊢ exact hr
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialMonomialClass_hasPseudoDimAtMost · Causalean/Stat/Concentration/VC/Geometry.lean:419 · uses EuclideanPoint , RadialMonomialParam , radialMonomialClass , radialPseudoDimBound , HasPseudoDimAtMost
4 supporting declarations (lemmas, instances)
Empirical­Cover 1 core · 1 supporting This module translates the finite-cover certificate used by the variance-adaptive maximal inequality into total boundedness and a numerical covering-number bound for Causalean's empirical function space. ★ coveringNumber_le

Polynomial empirical covers in Dudley's metric space

This module translates the finite-cover certificate used by the variance-adaptive maximal inequality into total boundedness and a numerical covering-number bound for Causalean's empirical function space. These are the two deterministic inputs expected by the existing Dudley theorem.

theorem coveringNumber_le reviewed
Causalean.Stat.Concentration.HasPolynomialEmpiricalL2Cover

Covering-number bound from an empirical cover. Suppose F has polynomial empirical L2L^2 covering numbers with envelope U, base A, and exponent v, every member of F is measurable, the envelope U is strictly positive, the sample S has positive size n, and the relative scale ε lies in the interval (0,1](0,1] ; then Dudley's empirical covering number of the class at radius ε * U, taken in the totally bounded empirical pseudometric space this cover furnishes, is at most the real power (A / ε) ^ v.

Formal statement
𝒳 :
Type u
shared
ι :
Type v
ι → 𝒳 → ℝ
shared
U A v :
ℝ
hmeas :
∀ i, Measurable (F i)
hU :
0 < U
n :
ℕ
S :
Fin n → 𝒳
hn :
0 < n
ε :
ℝ
hε :
0 < ε
hε1 :
ε ≤ 1
htot :
hcover.totallyBounded hmeas hU S hn
(coveringNumber' htot (ε * U) : ℝ) ≤ rpow (A / ε) v
Proof (Lean source)
theorem HasPolynomialEmpiricalL2Cover.coveringNumber_le {F : ι → 𝒳 → ℝ} {U A v : ℝ} (hcover : HasPolynomialEmpiricalL2Cover F U A v) (hmeas : ∀ i, Measurable (F i)) (hU : 0 < U) {n : ℕ} (S : Fin n → 𝒳) (hn : 0 < n) (ε : ℝ) (hε : 0 < ε) (hε1 : ε ≤ 1) : let htot := hcover.totallyBounded hmeas hU S hn (coveringNumber' htot (ε * U) : ℝ) ≤ rpow (A / ε) v := by /- Follow `real_vcSubgraph_empirical_coveringNumber_le`, using the explicit `hcover S hn ε hε hε1` witness instead of the pseudo-dimension cover. The minimal covering cardinality is at most the image of that witness, whose cardinality is bounded by the supplied real power. -/ classical dsimp only let htot := hcover.totallyBounded hmeas hU S hn let r := ε * U have hr : 0 < r := mul_pos hε hU obtain ⟨C, hCcover, hCcard⟩ := hcover S hn ε hε hε1 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 (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 := by exact_mod_cast Nat.find_min' (coveringNumber_exists htot hr) ⟨T, rfl, hTcover⟩ _ ≤ C.card := by exact_mod_cast Finset.card_image_le _ ≤ rpow (A / ε) v := hCcard
1 supporting declaration (lemmas, instances)
Cover 3 core · 13 supporting This module converts the finite-trace pseudo-dimension certificate into a uniform polynomial L²(Q) covering certificate. ★ radialMonomialOn_hasPolynomialL2Cover

Uniform polynomial covers for radial monomials

This module converts the finite-trace pseudo-dimension certificate into a uniform polynomial L²(Q) covering certificate. The measure Q remains arbitrary throughout, so atoms on moving annulus boundaries are included.

It also supplies two general assembly tools: pullback of a covering class along an arbitrary nonempty parameter map (using internal representatives at twice the preliminary radius), and the covering certificate for any bounded finite class. These tools let later score constructions reuse the existing sum and product closure lemmas.

def radialMonomialEnvelope reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

For an upper relative radius bb and a nonnegative integer pp, the radial-monomial envelope is (max⁡{1,b})p(\max\{1,b\})^p.

Definition (Lean source)
b :
ℝ
p :
ℕ
radialMonomialEnvelope b p :
ℝ
(max 1 b) ^ p
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialMonomialEnvelope · Causalean/Stat/Concentration/VC/Cover.lean:29
def radialMonomialOn reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given an observation space Ω\Omega, a Euclidean dimension dd, a maximum degree pp, a location map from observations to dd-dimensional Euclidean space, a bandwidth qq, annulus radii aa and bb, a radial-monomial parameter θ, and an observation ω\omega, the radial monomial evaluated at that observation is the corresponding radial-monomial class function evaluated at the mapped location.

Definition (Lean source)
Ω :
d p :
ℕ
loc :
q a b :
ℝ
ω :
Ω
radialMonomialOn d p loc q a b θ ω :
ℝ
radialMonomialClass d p q a b θ (loc ω)
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialMonomialOn · Causalean/Stat/Concentration/VC/Cover.lean:379 · uses EuclideanPoint , RadialMonomialParam
theorem radialMonomialOn_hasPolynomialL2Cover reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Covering certificate transported through a location map. For a measurable map from the underlying observation space into d-dimensional Euclidean space, given a positive bandwidth q, composing the moving-center radial-monomial class of degree at most p with the location map still carries a uniform polynomial L² covering certificate at envelope radialMonomialEnvelope b p.

Formal statement
Ω :
d p :
ℕ
loc :
q a b :
ℝ
hloc :
hq :
0 < q
Proof (Lean source)
theorem radialMonomialOn_hasPolynomialL2Cover {Ω : Type u} [MeasurableSpace Ω] (d p : ℕ) (loc : Ω → EuclideanPoint d) {q a b : ℝ} (hloc : Measurable loc) (hq : 0 < q) : HasPolynomialL2Cover (radialMonomialOn d p loc q a b) (radialMonomialEnvelope b p) := by apply (HasPseudoDimAtMost.compDomain (radialMonomialClass_hasPseudoDimAtMost d p hq) loc).hasPolynomialL2Cover · intro θ exact (radialAnnulusMonomial_measurable d θ.2.1 q a b θ.1).comp hloc · unfold radialMonomialEnvelope positivity · intro θ ω apply abs_radialAnnulusMonomial_le d p θ.2.1 hq exact le_of_lt_succ θ.2.2
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialMonomialOn_hasPolynomialL2Cover · Causalean/Stat/Concentration/VC/Cover.lean:391 · uses EuclideanPoint , RadialMonomialParam , radialMonomialEnvelope , radialMonomialOn , HasPolynomialL2Cover
13 supporting declarations (lemmas, instances)
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.

def finiteSampleMeasure reviewed
Causalean.Stat.Concentration

For a sample of nn observations in a measurable space, the finite-sample measure assigns equal mass 1/n1/n to each observation, equivalently forming the normalized sum of point masses at the observations (with the displayed formula also determining the value when n=0n=0).

Definition (Lean source)
𝒳 :
Type u
shared
n :
ℕ
S :
Fin n → 𝒳
finiteSampleMeasure S :
Measure 𝒳
(ofReal (n : ℝ))⁻¹ • ∑ i : Fin n, Measure.dirac (S i)
Causalean.Stat.Concentration.finiteSampleMeasure · Causalean/Stat/Concentration/VC/Empirical.lean:26
theorem real_vcSubgraph_dudley_example reviewed
Causalean.Stat.Concentration

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
𝒳 :
Type u
shared
ι :
Type v
Nonempty ι
ι → 𝒳 → ℝ
shared
d n :
ℕ
hmeas :
∀ i, Measurable (F i)
hpdim :
U δ :
ℝ
hU :
0 < U
hδ :
0 < δ
hδU :
δ < U / 2
henvelope :
∀ i x, |F i x| ≤ U
S :
Fin n → 𝒳
hn :
0 < n
∃ htot : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S)),
conclusion 1
ε :
ℝ
0 < ε
ε ≤ 1
coveringNumber' htot (ε * U) ≤ vcSubgraphCoverBound d ε
conclusion 2
empiricalRademacherComplexity_without_abs n F S
≤ 4 * δ
+ (12 / sqrt n) * (∫ x in δ..(U / 2), sqrt (log (coveringNumber' htot x)))
Proof (Lean source)
theorem real_vcSubgraph_dudley_example [Nonempty ι] {F : ι → 𝒳 → ℝ} {d n : ℕ} (hmeas : ∀ i, Measurable (F i)) (hpdim : HasPseudoDimAtMost F d) {U δ : ℝ} (hU : 0 < U) (hδ : 0 < δ) (hδU : δ < U / 2) (henvelope : ∀ i x, |F i x| ≤ U) (S : Fin n → 𝒳) (hn : 0 < n) : ∃ htot : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S)), (∀ ε : ℝ, 0 < ε → ε ≤ 1 → coveringNumber' htot (ε * U) ≤ vcSubgraphCoverBound d ε) ∧ empiricalRademacherComplexity_without_abs n F S ≤ 4 * δ + (12 / sqrt n) * (∫ x in δ..(U / 2), sqrt (log (coveringNumber' htot x))) := by let htot := real_vcSubgraph_empirical_totallyBounded hmeas hpdim hU henvelope S hn refine ⟨htot, ?_, ?_⟩ · intro ε hε hε1 simpa [htot] using (real_vcSubgraph_empirical_coveringNumber_le hmeas hpdim hU hε hε1 henvelope S hn) · apply dudley_entropy_integral_bound (c := U) hδ htot hn · intro i classical have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hsum : (∑ j : Fin n, (F i (S j)) ^ 2) ≤ ∑ _j : Fin n, U ^ 2 := by refine Finset.sum_le_sum ?_ intro j _ calc (F i (S j)) ^ 2 = |F i (S j)| ^ 2 := by rw [sq_abs] _ ≤ U ^ 2 := sq_le_sq.mpr (by simpa [abs_of_pos hU] using henvelope i (S j)) have harg : (1 / (n : ℝ)) * ∑ j : Fin n, (F i (S j)) ^ 2 ≤ U ^ 2 := by calc (1 / (n : ℝ)) * ∑ j : Fin n, (F i (S j)) ^ 2 ≤ (1 / (n : ℝ)) * ∑ _j : Fin n, U ^ 2 := mul_le_mul_of_nonneg_left hsum (by positivity) _ = (1 / (n : ℝ)) * ((n : ℝ) * U ^ 2) := by simp _ = U ^ 2 := by field_simp [Finset.card_fin, hnR.ne'] calc empiricalNorm S (F i) = sqrt ((1 / (n : ℝ)) * ∑ j : Fin n, (F i (S j)) ^ 2) := rfl _ ≤ sqrt (U ^ 2) := Real.sqrt_le_sqrt harg _ = U := by rw [Real.sqrt_sq_eq_abs, abs_of_pos hU] · exact hδU
6 supporting declarations (lemmas, instances)
Entropy­Chaining 3 core · 1 supporting This file packages the measurable envelope, population-radius, and uniform polynomial-cover hypotheses needed by the variance-adaptive expected maximal inequality, and derives the corresponding countable chaining bound. ★ vcEntropy_chaining_bound

VC entropy chaining for expected empirical maxima

This file packages the measurable envelope, population-radius, and uniform polynomial-cover hypotheses needed by the variance-adaptive expected maximal inequality, and derives the corresponding countable chaining bound.

def HasVCUniformEntropy reviewed
Causalean.Stat.Concentration

For a measure on a measurable sample space, a class of real-valued functions indexed by a set, an envelope bound, a radius, a covering constant, and an entropy exponent, the class has uniform VC-type entropy exactly when (1) the radius is positive, (2) the radius is strictly smaller than the envelope bound, (3) the covering constant is at least ee, (4) the entropy exponent is at least one, (5) every function in the class is measurable, (6) every function is bounded in absolute value by the envelope bound at every sample point, (7) every function has population L2L^2 distance at most the radius from the zero function, and (8) for every sequence of indices, the resulting sequence of functions has the stipulated polynomial empirical L2L^2 covering property.

Definition (Lean source)
Ω ι :
μ :
g :
ι → Ω → ℝ
U σ A v :
ℝ
HasVCUniformEntropy μ g U σ A v :
Prop
clause 1
0 < σ
clause 2
σ < U
clause 3
exp 1 ≤ A
clause 4
1 ≤ v
clause 5
i :
clause 6
i z :
|g i z| ≤ U
clause 7
i :
measureL2Dist μ (g i) (fun _ => 0) ≤ σ
clause 8
g0 :
ℕ → ι
HasPolynomialEmpiricalL2Cover (fun k => g (g0 k)) U A v
Causalean.Stat.Concentration.HasVCUniformEntropy · Causalean/Stat/Concentration/VC/EntropyChaining.lean:26
def countableEmpiricalProcessSup reviewed
Causalean.Stat.Concentration

For a measure on a measurable sample space, a class of real-valued functions, a countable enumeration of that class, and a finite sample, the countable empirical-process supremum is the extended nonnegative real supremum, over the enumerated functions, of the absolute centered empirical average.

Definition (Lean source)
Ω ι :
μ :
g :
ι → Ω → ℝ
g0 :
ℕ → ι
n :
ℕ
w :
Fin n → Ω
countableEmpiricalProcessSup μ g g0 w :
ℝ≥0∞
⨆ k : ℕ, ofReal |centeredEmpiricalAverage μ w (g (g0 k))|
Causalean.Stat.Concentration.countableEmpiricalProcessSup · Causalean/Stat/Concentration/VC/EntropyChaining.lean:37
lemma vcEntropy_chaining_bound reviewed
Causalean.Stat.Concentration

Dudley chaining bound for VC-type entropy. Let μ be a probability measure on Ω, g : ι → Ω → ℝ a family of functions, and g0 : ℕ → ι a sequence of indices (for example an enumeration of a countable dense subfamily). If g has uniform VC-type entropy relative to μ, with envelope U, population L2L^2 radius σ, covering-entropy base A, and exponent v, then there is a constant C > 0, which may depend on U, σ, A and v, such that, for every sample size n ≥ 1, the expectation of the countable empirical-process supremum along the enumeration g0 over the n-fold product of μ is at most C · (σ √(log(U/σ)/n) + U log(U/σ)/n).

Formal statement
Ω ι :
g :
ι → Ω → ℝ
g0 :
ℕ → ι
U σ A v :
ℝ
hent :
HasVCUniformEntropy μ g U σ A v
∃ C : ℝ,
0 < C
conclusion 1
n :
ℕ
1 ≤ n
∫⁻ w, countableEmpiricalProcessSup μ g g0 w ∂Measure.pi (fun _ : Fin n => μ)
≤ ofReal (C * (σ * sqrt (log (U / σ) / n) + U * log (U / σ) / n))
Proof (Lean source)
lemma vcEntropy_chaining_bound {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (g : ι → Ω → ℝ) (g0 : ℕ → ι) (U σ A v : ℝ) (hent : HasVCUniformEntropy μ g U σ A v) : ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, 1 ≤ n → ∫⁻ w, countableEmpiricalProcessSup μ g g0 w ∂Measure.pi (fun _ : Fin n => μ) ≤ ofReal (C * (σ * sqrt (log (U / σ) / n) + U * log (U / σ) / n)) := by rcases hent with ⟨hσ, hσU, hA, hv, hmeas, henv, hL2, hcover⟩ let L0 := log (U / σ) let L := vcMaximalLog A U σ let q := max (sqrt (v * L / L0)) (v * L / L0) let C := varianceAdaptiveVCConstant * q have hU : 0 < U := hσ.trans hσU have hratio : 1 < U / σ := (lt_div_iff₀ hσ).2 (by simpa using hσU) have hL0 : 0 < L0 := Real.log_pos hratio have hA1 : 1 ≤ A := (Real.one_le_exp (by norm_num)).trans hA have hbase : U / σ ≤ max (exp 1) (A * U / σ) := by apply le_trans ?_ (le_max_right _ _) calc U / σ ≤ A * (U / σ) := le_mul_of_one_le_left (div_nonneg hU.le hσ.le) hA1 _ = A * U / σ := by ring have hLle : L0 ≤ L := by dsimp only [L0, L, vcMaximalLog] exact Real.log_le_log (div_pos hU hσ) hbase have hL : 0 < L := hL0.trans_le hLle have hq : 0 < q := by dsimp only [q] exact lt_of_lt_of_le (div_pos (mul_pos (lt_of_lt_of_le zero_lt_one hv) hL) hL0) (le_max_right _ _) refine ⟨C, mul_pos (by norm_num [varianceAdaptiveVCConstant]) hq, ?_⟩ intro n hn have hn0 : 0 < n := Nat.zero_lt_of_lt hn let F : ℕ → Ω → ℝ := fun k => g (g0 k) let μn : Measure (Fin n → Ω) := Measure.pi (fun _ : Fin n => μ) have hFmeas : ∀ k, Measurable (F k) := fun k => hmeas (g0 k) have hFenv : ∀ k x, |F k x| ≤ U := fun k x => henv (g0 k) x have hmain := varianceAdaptiveExpectedMaximal_le μ F hσ hσU hA hv hFmeas hFenv (fun k => hL2 (g0 k)) (hcover g0) n hn0 have hrate := varianceAdaptiveRate_le_logRatio hσ hσU hA hv hn0 have hreal : ∫ w, uniformDeviation n F μ id w ∂μn ≤ C * (σ * sqrt (log (U / σ) / (n : ℝ)) + U * log (U / σ) / (n : ℝ)) := by calc ∫ w, uniformDeviation n F μ id w ∂μn ≤ varianceAdaptiveVCConstant * vcExpectedMaximalRate U σ A v n := hmain _ ≤ varianceAdaptiveVCConstant * (q * (σ * sqrt (log (U / σ) / (n : ℝ)) + U * log (U / σ) / (n : ℝ))) := mul_le_mul_of_nonneg_left hrate (by norm_num [varianceAdaptiveVCConstant]) _ = C * (σ * sqrt (log (U / σ) / (n : ℝ)) + U * log (U / σ) / (n : ℝ)) := by simp only [C]; ring have hdevMeas : Measurable (fun w : Fin n → Ω => uniformDeviation n F μ id w) := by exact uniformDeviation_measurable id hFmeas have hdevBound : ∀ w : Fin n → Ω, uniformDeviation n F μ id w ≤ 2 * U := by intro w exact uniformDeviation_enumeration_le_two_envelope μ g g0 hU hmeas henv hn0 w have hdevNonneg : ∀ w : Fin n → Ω, 0 ≤ uniformDeviation n F μ id w := by intro w exact Real.iSup_nonneg fun k => abs_nonneg _ have hdevInt : Integrable (fun w : Fin n → Ω => uniformDeviation n F μ id w) μn := Integrable.of_bound hdevMeas.aestronglyMeasurable (2 * U) (ae_of_all _ fun w => by rw [Real.norm_eq_abs, abs_of_nonneg (hdevNonneg w)] exact hdevBound w) simp_rw [countableEmpiricalProcessSup_eq_of_envelope μ g g0 hU hmeas henv hn0] rw [← ofReal_integral_eq_lintegral_ofReal hdevInt (ae_of_all _ hdevNonneg)] exact ENNReal.ofReal_le_ofReal hreal
1 supporting declaration (lemmas, instances)
  • countableEmpiricalProcessSup_eq_of_envelope lemma — If the envelope bound is positive, every function in the class is measurable and bounded by that envelope, and the sample size is positive, then the extended-nonnegative-real supremum along an enumeration equals ENNReal.ofReal applied to the shared real-valued uniformDeviation supremum for the measure, class, enumeration, and sample under consideration.
    Ω ι :
    g :
    ι → Ω → ℝ
    g0 :
    ℕ → ι
    U :
    ℝ
    hU :
    0 < U
    hmeas :
    ∀ i, Measurable (g i)
    henv :
    ∀ i x, |g i x| ≤ U
    n :
    ℕ
    hn :
    0 < n
    w :
    Fin n → Ω
    = ofReal (uniformDeviation n (fun k => g (g0 k)) μ id w)
    Proof (Lean source)
    lemma countableEmpiricalProcessSup_eq_of_envelope {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (g : ι → Ω → ℝ) (g0 : ℕ → ι) {U : ℝ} (hU : 0 < U) (hmeas : ∀ i, Measurable (g i)) (henv : ∀ i x, |g i x| ≤ U) {n : ℕ} (hn : 0 < n) (w : Fin n → Ω) : countableEmpiricalProcessSup μ g g0 w = ofReal (uniformDeviation n (fun k => g (g0 k)) μ id w) := by simp only [countableEmpiricalProcessSup, uniformDeviation, centeredEmpiricalAverage, id_eq] refine (Monotone.map_ciSup_of_continuousAt ENNReal.continuous_ofReal.continuousAt ENNReal.ofReal_mono (bdd := ?_)).symm refine ⟨2 * U, ?_⟩ rintro _ ⟨k, rfl⟩ have hint : Integrable (g (g0 k)) μ := Integrable.of_bound (hmeas (g0 k)).aestronglyMeasurable U (ae_of_all _ fun x => by simpa [Real.norm_eq_abs] using henv (g0 k) x) have hmean : |∫ x, g (g0 k) x ∂μ| ≤ U := by calc |∫ x, g (g0 k) x ∂μ| ≤ ∫ x, |g (g0 k) x| ∂μ := abs_integral_le_integral_abs _ ≤ ∫ _x, U ∂μ := integral_mono hint.abs (integrable_const U) (henv (g0 k)) _ = U := by simp have havg : |(n : ℝ)⁻¹ * ∑ i, g (g0 k) (w i)| ≤ U := by calc |(n : ℝ)⁻¹ * ∑ i, g (g0 k) (w i)| = (n : ℝ)⁻¹ * |∑ i, g (g0 k) (w i)| := by rw [abs_mul, abs_of_pos (inv_pos.mpr (Nat.cast_pos.mpr hn))] _ ≤ (n : ℝ)⁻¹ * ∑ i, |g (g0 k) (w i)| := by gcongr exact Finset.abs_sum_le_sum_abs _ _ _ ≤ (n : ℝ)⁻¹ * ∑ _i : Fin n, U := by gcongr with i; exact henv (g0 k) (w i) _ = U := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] field_simp change |(n : ℝ)⁻¹ * ∑ i, g (g0 k) (w i) - ∫ x, g (g0 k) x ∂μ| ≤ 2 * U exact (abs_sub _ _).trans (by linarith)
    Causalean.Stat.Concentration.countableEmpiricalProcessSup_eq_of_envelope · Causalean/Stat/Concentration/VC/EntropyChaining.lean:43
Expected­Maximal 1 core · 1 supporting This module proves the countable-class expected empirical-supremum bound from the variance-adaptive Rademacher chaining estimate and symmetrization. ★ varianceAdaptiveExpectedMaximal_le

Variance-adaptive expected maximal inequality for countable VC-type classes

This module proves the countable-class expected empirical-supremum bound from the variance-adaptive Rademacher chaining estimate and symmetrization. It also provides an adapter for Causalean's existing uniform polynomial L² covering certificate.

theorem varianceAdaptiveExpectedMaximal_le reviewed
Causalean.Stat.Concentration

Variance-adaptive expected maximal inequality. Let P be a probability measure on the sample space and F a countable family of real-valued functions on it. Suppose the population L2L^2 radius σ is strictly positive and strictly less than the envelope U, the covering-entropy base A is at least Euler's number and the exponent v is at least one, every function in F is measurable and bounded in absolute value by U, each function's population L2L^2 distance from the zero function is at most σ, F has polynomial empirical L2L^2 covering numbers with envelope U, base A, and exponent v, and the sample size n is positive. Then the expected empirical supremum of F over an n-point i.i.d. sample drawn from P is at most the universal constant varianceAdaptiveVCConstant times the variance-adaptive rate σ √(v log(AU/σ)/n) + v U log(AU/σ)/n.

Formal statement
𝒳 :
Type u
shared
ι :
Type v
Nonempty ι
Countable ι
shared
F :
ι → 𝒳 → ℝ
U σ A v :
ℝ
hσ :
0 < σ
hσU :
σ < U
hA :
exp 1 ≤ A
hv :
1 ≤ v
hmeas :
∀ i, Measurable (F i)
henvelope :
∀ i x, |F i x| ≤ U
hL2 :
∀ i, measureL2Dist P (F i) (fun _ => 0) ≤ σ
n :
ℕ
hn :
0 < n
∫ S : Fin n → 𝒳, uniformDeviation n F P id S ∂Measure.pi (fun _ : Fin n => P)
Proof (Lean source)
theorem varianceAdaptiveExpectedMaximal_le [Nonempty ι] [Countable ι] (P : Measure 𝒳) [IsProbabilityMeasure P] (F : ι → 𝒳 → ℝ) {U σ A v : ℝ} (hσ : 0 < σ) (hσU : σ < U) (hA : exp 1 ≤ A) (hv : 1 ≤ v) (hmeas : ∀ i, Measurable (F i)) (henvelope : ∀ i x, |F i x| ≤ U) (hL2 : ∀ i, measureL2Dist P (F i) (fun _ => 0) ≤ σ) (hcover : HasPolynomialEmpiricalL2Cover F U A v) (n : ℕ) (hn : 0 < n) : ∫ S : Fin n → 𝒳, uniformDeviation n F P id S ∂Measure.pi (fun _ : Fin n => P) ≤ varianceAdaptiveVCConstant * vcExpectedMaximalRate U σ A v n := by /- Apply countable-class symmetrization with the identity observation map, then substitute `varianceAdaptiveRademacherComplexity_le`. The envelope hypotheses make every indexed function integrable, and countability makes the pointwise supremum measurable; no continuum-supremum measurability premise is needed. -/ have hsymm := uniform_deviation_expectation_le_two_smul_rademacher_complexity (μ := P) (f := F) hn id (fun i => by simpa [Function.comp_def] using hmeas i) (hσ.trans hσU).le henvelope have hrad := varianceAdaptiveRademacherComplexity_le P F hσ hσU hA hv hmeas henvelope hL2 hcover n hn calc ∫ S : Fin n → 𝒳, uniformDeviation n F P id S ∂Measure.pi (fun _ : Fin n => P) ≤ 2 • rademacherComplexity n F P id := by simpa [Function.comp_def] using hsymm _ ≤ 2 • ((varianceAdaptiveVCConstant / 2) * vcExpectedMaximalRate U σ A v n) := by have hmul := mul_le_mul_of_nonneg_left hrad (by norm_num : (0 : ℝ) ≤ 2) simp only [nsmul_eq_mul, Nat.cast_ofNat] exact hmul _ = varianceAdaptiveVCConstant * vcExpectedMaximalRate U σ A v n := by simp only [nsmul_eq_mul] ring
1 supporting declaration (lemmas, instances)
  • varianceAdaptiveExpectedMaximal_le theorem — For a probability law, a countable function class with a polynomial covering certificate, a positive population radius below its envelope, and the corresponding population root-mean-square bound, there are explicit entropy constants for which the variance-adaptive expected maximal inequality holds at every positive sample size.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    Nonempty ι
    Countable ι
    shared
    F :
    ι → 𝒳 → ℝ
    U σ :
    ℝ
    hσ :
    0 < σ
    hσU :
    σ < U
    hL2 :
    ∀ i, measureL2Dist P (F i) (fun _ => 0) ≤ σ
    ∃ A v : ℝ,
    exp 1 ≤ A
    1 ≤ v
    conclusion 1
    n :
    ℕ
    0 < n
    ∫ S : Fin n → 𝒳, uniformDeviation n F P id S ∂Measure.pi (fun _ : Fin n => P)
    Proof (Lean source)
    theorem HasPolynomialL2Cover.varianceAdaptiveExpectedMaximal_le [Nonempty ι] [Countable ι] (P : Measure 𝒳) [IsProbabilityMeasure P] (F : ι → 𝒳 → ℝ) {U σ : ℝ} (hF : HasPolynomialL2Cover F U) (hσ : 0 < σ) (hσU : σ < U) (hL2 : ∀ i, measureL2Dist P (F i) (fun _ => 0) ≤ σ) : ∃ A v : ℝ, exp 1 ≤ A ∧ 1 ≤ v ∧ ∀ n : ℕ, 0 < n → ∫ S : Fin n → 𝒳, uniformDeviation n F P id S ∂Measure.pi (fun _ : Fin n => P) ≤ varianceAdaptiveVCConstant * vcExpectedMaximalRate U σ A v n := by /- Obtain empirical constants from `HasPolynomialL2Cover.hasPolynomialEmpiricalL2Cover` and invoke the main theorem using the measurability and envelope fields of `hF`. -/ obtain ⟨A, v, hA, hv, hcover⟩ := hF.hasPolynomialEmpiricalL2Cover refine ⟨A, v, hA, hv, ?_⟩ intro n hn exact varianceAdaptiveExpectedMaximal_le P F hσ hσU hA hv hF.measurable hF.envelope hL2 hcover n hn
    Causalean.Stat.Concentration.HasPolynomialL2Cover.varianceAdaptiveExpectedMaximal_le · Causalean/Stat/Concentration/VC/ExpectedMaximal.lean:76
Score 8 core · 3 supporting This module assembles the moving-center radial basis into a bounded polynomial and then into the residual score shape used by local-polynomial empirical process arguments. ★ radialResidualScore_hasPolynomialL2Cover

Bounded radial-polynomial score classes

This module assembles the moving-center radial basis into a bounded polynomial and then into the residual score shape used by local-polynomial empirical process arguments. Coefficients range over the existing finite coefficient box, all polynomial terms share one moving center, and a finite signed arm may multiply the score.

The proofs are designed to reuse HasPolynomialL2Cover.add, .mul, .neg, .finSum, the bounded finite-class certificate, and parameter pullback. No measure regularity beyond measurability is imposed, so the result remains uniform for atomic probability measures.

def boundedRadialPolynomial reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, a maximal degree, a bandwidth and two relative annulus endpoints, a coefficient bound, a center, a boxed coefficient vector, and an evaluation point, the bounded radial polynomial is the coefficient-weighted sum of the radial annulus monomials about the shared center.

Definition (Lean source)
d p :
ℕ
q a b B :
ℝ
β :
CoeffBox (Fin (p + 1)) B
boundedRadialPolynomial d p q a b B x β z :
ℝ
∑ k : Fin (p + 1), β.1 k * radialAnnulusMonomial d q a b k.1 x z
Causalean.Stat.Concentration.EuclideanRadialPolynomial.boundedRadialPolynomial · Causalean/Stat/Concentration/VC/Score.lean:28 · uses CoeffBox , EuclideanPoint
abbrev RadialPolynomialParam reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, a maximal degree, and a coefficient bound, the radial-polynomial parameter space consists of a Euclidean center paired with a coefficient vector whose every coordinate has absolute value at most BB.

Definition (Lean source)
d p :
ℕ
B :
ℝ
RadialPolynomialParam d p B :
Type
EuclideanPoint d × CoeffBox (Fin (p + 1)) B
Causalean.Stat.Concentration.EuclideanRadialPolynomial.RadialPolynomialParam · Causalean/Stat/Concentration/VC/Score.lean:41
def boundedRadialPolynomialOn reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given an observation space equipped with a σ-algebra, a natural dimension, a maximal degree, a Euclidean location map, a bandwidth and two relative annulus endpoints, a coefficient bound, a radial-polynomial parameter, and an observation, the observation-indexed bounded radial polynomial is evaluated at the Euclidean location of that observation.

Definition (Lean source)
Ω :
d p :
ℕ
loc :
q a b B :
ℝ
ω :
Ω
boundedRadialPolynomialOn d p loc q a b B θ ω :
ℝ
boundedRadialPolynomial d p q a b B θ.1 θ.2 (loc ω)
Causalean.Stat.Concentration.EuclideanRadialPolynomial.boundedRadialPolynomialOn · Causalean/Stat/Concentration/VC/Score.lean:48 · uses EuclideanPoint , RadialPolynomialParam
def radialPolynomialEnvelope reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given an outer relative radius, a maximal degree, and a coefficient bound, the radial-polynomial envelope is (p+1)B(p+1)B times the radial-monomial envelope at that outer radius and degree.

Definition (Lean source)
b :
ℝ
p :
ℕ
B :
ℝ
radialPolynomialEnvelope b p B :
ℝ
((p + 1 : ℕ) : ℝ) * B * radialMonomialEnvelope b p
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialPolynomialEnvelope · Causalean/Stat/Concentration/VC/Score.lean:61
abbrev RadialResidualScoreParam reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given a natural dimension, a maximal degree, a coefficient bound, and an arm index set, the radial residual-score parameter space consists of a radial-polynomial parameter paired with one arm index.

Definition (Lean source)
d p :
ℕ
B :
ℝ
A :
Type v
RadialResidualScoreParam d p B A :
Type (max 0 v)
Causalean.Stat.Concentration.EuclideanRadialPolynomial.RadialResidualScoreParam · Causalean/Stat/Concentration/VC/Score.lean:171
def radialResidualScore reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given an observation space equipped with a σ-algebra, an arm index set, a natural dimension, a maximal degree, a Euclidean location map, an arm-valued function, a response function, a bandwidth and two relative annulus endpoints, a coefficient bound, a degree index, a residual-score parameter, and an observation, the radial residual score is the arm value times the selected radial monomial times the residual from the shared-center polynomial fit.

Definition (Lean source)
Ω :
A :
Type v
d p :
ℕ
loc :
arm :
A → Ω → ℝ
response :
Ω → ℝ
q a b B :
ℝ
j :
Fin (p + 1)
ω :
Ω
radialResidualScore d p loc arm response q a b B j θ ω :
ℝ
arm θ.2 ω * radialAnnulusMonomial d q a b j.1 θ.1.1 (loc ω) * (response ω - boundedRadialPolynomial d p q a b B θ.1.1 θ.1.2 (loc ω))
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialResidualScore · Causalean/Stat/Concentration/VC/Score.lean:179 · uses EuclideanPoint , RadialResidualScoreParam
def radialResidualScoreEnvelope reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Given an outer relative radius, a maximal degree, a coefficient bound, and a response bound, the radial residual-score envelope is the radial-monomial envelope times the sum of RR and the radial-polynomial envelope.

Definition (Lean source)
b :
ℝ
p :
ℕ
B R :
ℝ
radialResidualScoreEnvelope b p B R :
ℝ
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialResidualScoreEnvelope · Causalean/Stat/Concentration/VC/Score.lean:199
theorem radialResidualScore_hasPolynomialL2Cover reviewed
Causalean.Stat.Concentration.EuclideanRadialPolynomial

Covering certificate for a bounded finite-arm residual score. Given a measurable Euclidean location map, a finite family of arms, each measurable and bounded in absolute value by 1, a measurable response variable that is bounded in absolute value by R, together with a positive bandwidth q, a positive polynomial-coefficient bound B, and a positive response bound R, then the score formed by multiplying a bounded arm function, a radial monomial, and the residual of the response against a boxed radial-polynomial fit carries a positive-envelope uniform polynomial L²(Q) covering certificate — with envelope radialResidualScoreEnvelope b p B R — over every probability measure Q, including atomic ones.

Formal statement
Ω :
A :
Type v
d p :
ℕ
loc :
arm :
A → Ω → ℝ
response :
Ω → ℝ
q a b B R :
ℝ
j :
Fin (p + 1)
hloc :
harmMeas :
∀ s, Measurable (arm s)
harmBound :
∀ s ω, |arm s ω| ≤ 1
hresponseMeas :
Measurable response
hresponseBound :
∀ ω, |response ω| ≤ R
hq :
0 < q
hB :
0 < B
hR :
0 < R
HasPolynomialL2Cover (radialResidualScore d p loc arm response q a b B j) (radialResidualScoreEnvelope b p B R)
Proof (Lean source)
theorem radialResidualScore_hasPolynomialL2Cover {Ω : Type u} [MeasurableSpace Ω] {A : Type v} [Fintype A] (d p : ℕ) (loc : Ω → EuclideanPoint d) (arm : A → Ω → ℝ) (response : Ω → ℝ) {q a b B R : ℝ} (j : Fin (p + 1)) (hloc : Measurable loc) (harmMeas : ∀ s, Measurable (arm s)) (harmBound : ∀ s ω, |arm s ω| ≤ 1) (hresponseMeas : Measurable response) (hresponseBound : ∀ ω, |response ω| ≤ R) (hq : 0 < q) (hB : 0 < B) (hR : 0 < R) : HasPolynomialL2Cover (radialResidualScore d p loc arm response q a b B j) (radialResidualScoreEnvelope b p B R) := by classical let M := radialMonomialEnvelope b p let P := radialPolynomialEnvelope b p B have hM : 0 < M := by dsimp [M, radialMonomialEnvelope] positivity have hP : 0 < P := by dsimp [P, radialPolynomialEnvelope] have hp1 : (0 : ℝ) < (p + 1 : ℕ) := by positivity positivity have hU : 0 < M * (R + P) := by positivity cases isEmpty_or_nonempty A with | inl hA => letI : IsEmpty A := hA refine ⟨?_, ?_, ?_, ?_⟩ · simpa [radialResidualScoreEnvelope, M, P] using hU · intro θ exact isEmptyElim θ.2 · intro θ exact isEmptyElim θ.2 · refine ⟨1, 0, le_rfl, ?_⟩ intro Q hQ ε hε hε1 refine ⟨∅, ?_, ?_⟩ · simp · intro θ exact isEmptyElim θ.2 | inr hA => letI : Nonempty A := hA letI : Nonempty (CoeffBox (Fin (p + 1)) B) := ⟨⟨fun _ => 0, fun _ => by simpa using hB.le⟩⟩ have harm : HasPolynomialL2Cover arm 1 := finiteClass_hasPolynomialL2Cover arm (by norm_num) harmMeas harmBound have hleading : HasPolynomialL2Cover (fun x : EuclideanPoint d => fun ω => radialAnnulusMonomial d q a b j.1 x (loc ω)) M := by have hfull := radialMonomialOn_hasPolynomialL2Cover d p loc hloc (a := a) (b := b) hq have hpull := pullback hfull (fun x : EuclideanPoint d => (x, j)) exact hpull have hpoly := boundedRadialPolynomialOn_hasPolynomialL2Cover d p loc hloc (a := a) (b := b) hq hB have hresponse : HasPolynomialL2Cover (fun _ : Unit => response) R := by exact finiteClass_hasPolynomialL2Cover (fun _ : Unit => response) hR (fun _ => hresponseMeas) (fun _ => hresponseBound) have harmLeading := harm.mul hleading have hresidual := hresponse.add hpoly.neg have hsuper := harmLeading.mul hresidual have hpull := pullback hsuper (fun θ : RadialResidualScoreParam d p B A => ((θ.2, θ.1.1), ((), θ.1))) change HasPolynomialL2Cover (radialResidualScore d p loc arm response q a b B j) (M * (R + P)) simp only [one_mul] at hpull exact hpull
Causalean.Stat.Concentration.EuclideanRadialPolynomial.radialResidualScore_hasPolynomialL2Cover · Causalean/Stat/Concentration/VC/Score.lean:216 · uses EuclideanPoint , RadialResidualScoreParam , radialResidualScore , radialResidualScoreEnvelope , HasPolynomialL2Cover
3 supporting declarations (lemmas, instances)
Separability 3 core · 0 supporting This file gives a paper-neutral criterion reducing an uncountable empirical supremum to a fixed countable, pointwise-dense subfamily under every finite product law. ★ hasCountableEmpiricalSupReduction_of_pointwise_dense

Countable reduction of empirical suprema

This file gives a paper-neutral criterion reducing an uncountable empirical supremum to a fixed countable, pointwise-dense subfamily under every finite product law.

def centeredEmpiricalAverage reviewed
Causalean.Stat.Concentration

Given a measure μ\mu on an observation space, a sample of nn observations, and a real-valued function, the centered empirical average is its sample average minus its integral with respect to μ\mu. For an empty sample the average term is zero by the inverse-of-zero convention, so the value is minus the integral.

Definition (Lean source)
Ω :
μ :
n :
ℕ
w :
Fin n → Ω
g :
Ω → ℝ
centeredEmpiricalAverage μ w g :
ℝ
(n : ℝ)⁻¹ * ∑ i, g (w i) - ∫ z, g z ∂μ
Causalean.Stat.Concentration.centeredEmpiricalAverage · Causalean/Stat/Concentration/VC/Separability.lean:28
def HasCountableEmpiricalSupReduction reviewed
Causalean.Stat.Concentration

Given a measure μ\mu on an observation space and a family of real-valued functions indexed by a set ι\iota, the countable empirical-supremum reduction property holds exactly when every member of the family is measurable and there is a sequence of indices whose associated countable subfamily has, for every sample size, the same supremum of absolute centered empirical averages as the full family almost surely under the corresponding product measure.

Definition (Lean source)
Ω ι :
μ :
g :
ι → Ω → ℝ
HasCountableEmpiricalSupReduction μ g :
Prop
clause 1
i :
clause 2
∃ g0 : ℕ → ι,
∀ n,
(∀ᵐ w ∂Measure.pi (fun _ : Fin n => μ), (⨆ i : ι, ofReal |centeredEmpiricalAverage μ w (g i)|) = ⨆ k : ℕ, ofReal |centeredEmpiricalAverage μ w (g (g0 k))|)
Causalean.Stat.Concentration.HasCountableEmpiricalSupReduction · Causalean/Stat/Concentration/VC/Separability.lean:36
lemma hasCountableEmpiricalSupReduction_of_pointwise_dense reviewed
Causalean.Stat.Concentration

Countable supremum reduction from pointwise density. Let μ be a σ-finite measure on Ω, g : ι → Ω → ℝ a family of functions, and g0 : ℕ → ι a countable subfamily. Suppose S is a μ-conull subset of Ω, on S, every g i is the pointwise limit, along some subsequence, of the countable subfamily g ∘ g0, each g i is measurable, and there is a single μ-integrable envelope G dominating |g i| uniformly in i. Then the countable subfamily indexed by g0 realizes the full continuum empirical-process supremum of g almost surely under every finite product law of μ.

Formal statement
Ω ι :
μ :
g :
ι → Ω → ℝ
g0 :
ℕ → ι
S :
Set Ω
hS :
∀ᵐ z ∂μ, z ∈ S
hdense :
∀ i, ∃ kseq : ℕ → ℕ, ∀ z ∈ S, Tendsto (fun m => g (g0 (kseq m)) z) atTop (nhds (g i z))
hmeas :
∀ i, Measurable (g i)
hdom :
∃ G : Ω → ℝ, Integrable G μ ∧ ∀ i z, |g i z| ≤ G z
Proof (Lean source)
lemma hasCountableEmpiricalSupReduction_of_pointwise_dense {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [SigmaFinite μ] (g : ι → Ω → ℝ) (g0 : ℕ → ι) (S : Set Ω) (hS : ∀ᵐ z ∂μ, z ∈ S) (hdense : ∀ i, ∃ kseq : ℕ → ℕ, ∀ z ∈ S, Tendsto (fun m => g (g0 (kseq m)) z) atTop (nhds (g i z))) (hmeas : ∀ i, Measurable (g i)) (hdom : ∃ G : Ω → ℝ, Integrable G μ ∧ ∀ i z, |g i z| ≤ G z) : HasCountableEmpiricalSupReduction μ g := by rcases hdom with ⟨G, hG, hbound⟩ refine ⟨hmeas, g0, ?_⟩ intro n have hsampleS : ∀ᵐ w ∂Measure.pi (fun _ : Fin n => μ), ∀ j, w j ∈ S := eventually_all.2 fun j => Measure.tendsto_eval_ae_ae (μ := fun _ : Fin n => μ) (i := j) hS filter_upwards [hsampleS] with w hw apply le_antisymm · refine iSup_le fun i => ?_ obtain ⟨kseq, hseq⟩ := hdense i have hint : Tendsto (fun m => ∫ z, g (g0 (kseq m)) z ∂μ) atTop (nhds (∫ z, g i z ∂μ)) := by refine MeasureTheory.tendsto_integral_of_dominated_convergence G (fun m => (hmeas _).aestronglyMeasurable) hG ?_ ?_ · intro m exact Eventually.of_forall fun z => by simpa only [Real.norm_eq_abs] using hbound (g0 (kseq m)) z · exact hS.mono fun z hz => hseq z hz have havg : Tendsto (fun m => centeredEmpiricalAverage μ w (g (g0 (kseq m)))) atTop (nhds (centeredEmpiricalAverage μ w (g i))) := by unfold centeredEmpiricalAverage apply Tendsto.sub · apply Tendsto.const_mul apply tendsto_finset_sum intro j _hj exact hseq (w j) (hw j) · exact hint have hval : Tendsto (fun m => ofReal |centeredEmpiricalAverage μ w (g (g0 (kseq m)))|) atTop (nhds (ofReal |centeredEmpiricalAverage μ w (g i)|)) := ENNReal.continuous_ofReal.continuousAt.tendsto.comp (continuous_abs.continuousAt.tendsto.comp havg) apply le_of_tendsto hval exact Eventually.of_forall fun m => le_iSup (fun k : ℕ => ofReal |centeredEmpiricalAverage μ w (g (g0 k))|) (kseq m) · refine iSup_le fun k => ?_ exact le_iSup (fun i : ι => ofReal |centeredEmpiricalAverage μ w (g i)|) (g0 k)
Causalean.Stat.Concentration.hasCountableEmpiricalSupReduction_of_pointwise_dense · Causalean/Stat/Concentration/VC/Separability.lean:50 · uses HasCountableEmpiricalSupReduction
Trace 4 core · 6 supporting This module provides a homogeneous linear-sign VC bound, deliberately coarse but explicit bounds for finite Boolean combinations and finite unions, and reindexing lemmas for both Boolean VC dimension and pseudo-dimension ★ booleanCombination_hasVCAtMost

Finite-trace tools for VC and pseudo-dimension bounds

This module provides a homogeneous linear-sign VC bound, deliberately coarse but explicit bounds for finite Boolean combinations and finite unions, and reindexing lemmas for both Boolean VC dimension and pseudo-dimension.

The Boolean-combination theorem is trace-level: its combining formula may depend on the sampled point. In particular, it supports applications whose formula changes with the sign of the sampled threshold.

def booleanCombinationVCBound reviewed
Causalean.Stat.Concentration

Given a number of Boolean component classes and a common VC-dimension bound, the Boolean-combination VC bound is the explicit natural number 2m(d+1)+12^{m(d+1)+1}.

Definition (Lean source)
m d :
ℕ
booleanCombinationVCBound m d :
ℕ
2 ^ (m * (d + 1) + 1)
Causalean.Stat.Concentration.booleanCombinationVCBound · Causalean/Stat/Concentration/VC/Trace.lean:26
def finiteUnionVCBound reviewed
Causalean.Stat.Concentration

Given a number of component classes and a common VC-dimension bound, the finite-union VC bound is the explicit natural number 2m(d+1)+12^{m(d+1)+1}.

Definition (Lean source)
m d :
ℕ
finiteUnionVCBound m d :
ℕ
2 ^ (m * (d + 1) + 1)
Causalean.Stat.Concentration.finiteUnionVCBound · Causalean/Stat/Concentration/VC/Trace.lean:32
def linearSignClass reviewed
Causalean.Stat.Concentration

Given a finite feature index set, a real-valued feature family, a real coefficient vector, and an evaluation point, the homogeneous linear-sign classifier returns true exactly when the coefficient-feature inner product is positive.

Definition (Lean source)
𝒳 :
Type u
shared
K :
Type v
φ :
K → 𝒳 → ℝ
θ :
K → ℝ
x :
𝒳
linearSignClass φ θ x :
decide (0 < ∑ k, θ k * φ k x)
Causalean.Stat.Concentration.linearSignClass · Causalean/Stat/Concentration/VC/Trace.lean:87
theorem booleanCombination_hasVCAtMost reviewed
Causalean.Stat.Concentration

Given Boolean classifier families, a common VC-dimension certificate for them, and a point-dependent combining rule, the combined class has VC dimension at most booleanCombinationVCBound m d.

Formal statement
𝒳 :
Type u
shared
m d :
ℕ
Fin m → Type v
π :
(j : Fin m) → ι j → 𝒳 → Bool
hπ :
∀ j, HasVCAtMost (π j) d
combine :
𝒳 → (Fin m → Bool) → Bool
HasVCAtMost (fun θ : (j : Fin m) → ι j => fun x => combine x (fun j => π j (θ j) x)) (booleanCombinationVCBound m d)
Proof (Lean source)
theorem booleanCombination_hasVCAtMost {m d : ℕ} {ι : Fin m → Type v} (π : (j : Fin m) → ι j → 𝒳 → Bool) (hπ : ∀ j, HasVCAtMost (π j) d) (combine : 𝒳 → (Fin m → Bool) → Bool) : HasVCAtMost (fun θ : (j : Fin m) → ι j => fun x => combine x (fun j => π j (θ j) x)) (booleanCombinationVCBound m d) := by simpa only [booleanCombinationVCBound] using hasVCAtMost_of_growth_card_le (fun θ : (j : Fin m) → ι j => fun x => combine x (fun j => π j (θ j) x)) (m * (d + 1)) (fun n S => booleanCombination_growth_card_le (n := n) π hπ combine S)
Causalean.Stat.Concentration.booleanCombination_hasVCAtMost · Causalean/Stat/Concentration/VC/Trace.lean:436 · uses HasVCAtMost , booleanCombinationVCBound
6 supporting declarations (lemmas, instances)
  • reindex theorem — Given a Boolean class with a finite-trace VC bound and a reparameterization map, reparameterizing the class preserves that VC bound.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    κ :
    Type w
    π :
    ι → 𝒳 → Bool
    d :
    ℕ
    hπ :
    e :
    κ → ι
    HasVCAtMost (fun k => π (e k)) d
    Proof (Lean source)
    theorem HasVCAtMost.reindex {ι : Type v} {κ : Type w} {π : ι → 𝒳 → Bool} {d : ℕ} (hπ : HasVCAtMost π d) (e : κ → ι) : HasVCAtMost (fun k => π (e k)) d := by intro n S apply (Finset.vcDim_mono (ℬ := growthFamily π S) ?_).trans (hπ n S) intro A hA rw [mem_growthFamily_iff] at hA ⊢ obtain ⟨k, rfl⟩ := hA exact ⟨e k, rfl⟩
    Causalean.Stat.Concentration.HasVCAtMost.reindex · Causalean/Stat/Concentration/VC/Trace.lean:38
  • compDomain theorem — Given a Boolean class with a finite-trace VC bound and a map into its observation domain, precomposing the observation argument preserves that VC bound.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    𝒴 :
    Type w
    π :
    ι → 𝒳 → Bool
    d :
    ℕ
    hπ :
    g :
    𝒴 → 𝒳
    HasVCAtMost (fun i y => π i (g y)) d
    Proof (Lean source)
    theorem HasVCAtMost.compDomain {ι : Type v} {𝒴 : Type w} {π : ι → 𝒳 → Bool} {d : ℕ} (hπ : HasVCAtMost π d) (g : 𝒴 → 𝒳) : HasVCAtMost (fun i y => π i (g y)) d := by intro n S exact hπ n (fun j => g (S j))
    Causalean.Stat.Concentration.HasVCAtMost.compDomain · Causalean/Stat/Concentration/VC/Trace.lean:52
  • reindex theorem — Given a real-valued class with a pseudo-dimension bound and a reparameterization map, reparameterizing the class preserves that pseudo-dimension bound.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    κ :
    Type w
    F :
    ι → 𝒳 → ℝ
    d :
    ℕ
    e :
    κ → ι
    HasPseudoDimAtMost (fun k => F (e k)) d
    Proof (Lean source)
    theorem HasPseudoDimAtMost.reindex {ι : Type v} {κ : Type w} {F : ι → 𝒳 → ℝ} {d : ℕ} (hF : HasPseudoDimAtMost F d) (e : κ → ι) : HasPseudoDimAtMost (fun k => F (e k)) d := by intro n T apply (Finset.vcDim_mono (ℬ := growthFamily (subgraphClassifier F) T) ?_).trans (hF n T) intro A hA rw [mem_growthFamily_iff] at hA ⊢ obtain ⟨k, rfl⟩ := hA exact ⟨e k, rfl⟩
    Causalean.Stat.Concentration.HasPseudoDimAtMost.reindex · Causalean/Stat/Concentration/VC/Trace.lean:62
  • compDomain theorem — Given a real-valued class with a pseudo-dimension bound and a map into its observation domain, precomposing every function preserves that pseudo-dimension bound.
    𝒳 :
    Type u
    shared
    ι :
    Type v
    𝒴 :
    Type w
    F :
    ι → 𝒳 → ℝ
    d :
    ℕ
    g :
    𝒴 → 𝒳
    HasPseudoDimAtMost (fun i y => F i (g y)) d
    Proof (Lean source)
    theorem HasPseudoDimAtMost.compDomain {ι : Type v} {𝒴 : Type w} {F : ι → 𝒳 → ℝ} {d : ℕ} (hF : HasPseudoDimAtMost F d) (g : 𝒴 → 𝒳) : HasPseudoDimAtMost (fun i y => F i (g y)) d := by intro n T exact hF n (fun j => (g (T j).1, (T j).2))
    Causalean.Stat.Concentration.HasPseudoDimAtMost.compDomain · Causalean/Stat/Concentration/VC/Trace.lean:77
  • linearSignClass_hasVCAtMost theorem — Given a real-valued feature family, the associated homogeneous linear threshold classifiers have VC dimension at most the number of coordinates.
    𝒳 :
    Type u
    shared
    K :
    Type v
    φ :
    K → 𝒳 → ℝ
    Proof (Lean source)
    theorem linearSignClass_hasVCAtMost {K : Type v} [Fintype K] (φ : K → 𝒳 → ℝ) : HasVCAtMost (linearSignClass φ) (card K) := by classical intro n S unfold vcDim refine Finset.sup_le fun s hs => ?_ rw [Finset.mem_shatterer] at hs by_contra hcard have hcard_lt : card K < s.card := by omega let v : {i // i ∈ s} → K → ℝ := fun i k => φ k (S i.1) have hvdep : ¬ LinearIndependent ℝ v := by intro hv have hle := hv.fintype_card_le_finrank rw [Module.finrank_pi, 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 · 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}) : linearSignClass φ θ (S i.1) = true ↔ 0 < g i := by rw [← restrictionPattern_mem_iff (p := linearSignClass φ θ) (S := S) (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 => ∑ k, θ k * φ k (S i.1) have he_pos (i : {i // i ∈ s}) (hi : 0 < g i) : 0 < e i := by simpa [linearSignClass, e] using (hlabel i).2 hi have he_nonpos (i : {i // i ∈ s}) (hi : ¬ 0 < g i) : e i ≤ 0 := by have hfalse : linearSignClass φ θ (S i.1) ≠ true := (hlabel i).not.mpr hi simpa [linearSignClass, e] using hfalse 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 · exact mul_nonneg_of_nonpos_of_nonpos (le_of_not_gt hi) (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 := 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 (k : K) : ∑ i, g i * v i k = 0 := by have := congrFun hg0 k simpa [Pi.smul_apply, smul_eq_mul] using this simp_rw [e, Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_eq_zero intro k _ rw [show (∑ i, g i * (θ k * φ k (S i.1))) = θ k * ∑ i, g i * v i k by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i _ dsimp [v] ring] rw [hcoord, mul_zero] linarith
    Causalean.Stat.Concentration.linearSignClass_hasVCAtMost · Causalean/Stat/Concentration/VC/Trace.lean:95
  • finiteUnion_hasVCAtMost theorem — Given a finite family of Boolean classifier families and a common VC-dimension certificate for them, their dependent union has VC dimension at most finiteUnionVCBound m d.
    𝒳 :
    Type u
    shared
    K :
    Type v
    K → Type w
    d :
    ℕ
    π :
    (k : K) → ι k → 𝒳 → Bool
    hπ :
    ∀ k, HasVCAtMost (π k) d
    HasVCAtMost (fun θ : Sigma ι => π θ.1 θ.2) (finiteUnionVCBound (card K) d)
    Proof (Lean source)
    theorem finiteUnion_hasVCAtMost {K : Type v} [Fintype K] {ι : K → Type w} {d : ℕ} (π : (k : K) → ι k → 𝒳 → Bool) (hπ : ∀ k, HasVCAtMost (π k) d) : HasVCAtMost (fun θ : Sigma ι => π θ.1 θ.2) (finiteUnionVCBound (card K) d) := by simpa only [finiteUnionVCBound] using hasVCAtMost_of_growth_card_le (fun θ : Sigma ι => π θ.1 θ.2) (card K * (d + 1)) (fun n S => finiteUnion_growth_card_le (n := n) π hπ S)
    Causalean.Stat.Concentration.finiteUnion_hasVCAtMost · Causalean/Stat/Concentration/VC/Trace.lean:456