Stat.Concentration.Covering

Covering and packing numbers, the empirical pseudo-metric, Dudley's entropy integral, Haussler's packing bound, VC-class covering and its localized regime, Euclidean radial-polynomial VC-subgraph certificates, the result

Real­Valued­VCSubgraph 17 to review 17 core · 28 supporting · 4 submodules Real-valued VC-subgraph entropy: arbitrary-measure L² covering bounds, reusable algebraic closures, finite-dimensional parameter classes, and empirical-Dudley bridges. Euclidean­Radial­Polynomial 27 to review 27 core · 27 supporting · 4 submodules This barrel exports finite-trace pseudo-dimension bounds and uniform polynomial L² covering certificates for compactly supported radial monomials with a moving finite-dimensional Euclidean center.
Empirical­Pseudo­Metric 5 core · 8 supporting Defines the empirical L² pseudometric on function classes used by Dudley entropy bounds. ★ empiricalDist_def

Defines the empirical L² pseudometric on function classes used by Dudley entropy bounds.

The file provides empiricalNorm, empiricalDist, the pseudometric empiricalPMet, and the indexed EmpiricalFunctionSpace wrapper. It also records the coordinate projection bound empiricalDist_proj, which converts an empirical-norm bound into pointwise control on the fixed sample.

UPSTREAM-DELTA: declarations are placed in the Causalean.Stat.Concentration namespace. The proofs are otherwise kept close to upstream, with only Mathlib API-drift adjustments for Lean 4.29.

def empiricalNorm reviewed
Causalean.Stat.Concentration

The empirical norm is the root mean square value of a function on a fixed sample.

Definition (Lean source)
noncomputable def empiricalNorm (S : Fin n → 𝒳) (f : 𝒳 → ℝ) : ℝ := sqrt ((1 / n) * ∑ i : Fin n, (f (S i)^2))
Causalean.Stat.Concentration.empiricalNorm · Causalean/Stat/Concentration/Covering/EmpiricalPseudoMetric.lean:26
def empiricalDist reviewed
Causalean.Stat.Concentration

The empirical distance between two functions is the empirical norm of their difference on the fixed sample.

Definition (Lean source)
noncomputable def empiricalDist (S : Fin n → 𝒳) (f g : 𝒳 → ℝ) : ℝ := empiricalNorm S (f - g)
Causalean.Stat.Concentration.empiricalDist · Causalean/Stat/Concentration/Covering/EmpiricalPseudoMetric.lean:37
lemma empiricalDist_def reviewed
Causalean.Stat.Concentration

For a fixed sample S and functions f and g, the empirical distance between f and g equals the empirical norm of their pointwise difference.

Formal statement
S :
Fin n → 𝒳
f g :
𝒳 → ℝ
empiricalDist S f g = empiricalNorm S (f - g)
Proof (Lean source)
@[simp] lemma empiricalDist_def (S : Fin n → 𝒳) (f g : 𝒳 → ℝ) : empiricalDist S f g = empiricalNorm S (f - g) := rfl
def empiricalPMet reviewed
Causalean.Stat.Concentration

The empirical distance defines a pseudometric on functions evaluated on the fixed sample.

Definition (Lean source)
noncomputable def empiricalPMet (S : Fin n → 𝒳) : PseudoMetricSpace (𝒳 → ℝ) where dist := fun f g => empiricalDist S f g dist_self := by intro x; dsimp[empiricalDist] simp only [sub_self]; dsimp [empiricalNorm]; simp dist_comm := by intro x y dsimp[empiricalDist, empiricalNorm] grind dist_triangle := by intro x y z dsimp[empiricalDist,empiricalNorm] suffices sqrt (∑ i, (x (S i) - z (S i)) ^ 2) ≤ sqrt (∑ i, (x (S i) - y (S i)) ^ 2) + sqrt (∑ i, (y (S i) - z (S i)) ^ 2) from by calc _ = √(1 / ↑n) * √(∑ i, (x (S i) - z (S i)) ^ 2) := by simp _ ≤ √(1 / ↑n) * (√(∑ i, (x (S i) - y (S i)) ^ 2) + √(∑ i, (y (S i) - z (S i)) ^ 2)) := by apply mul_le_mul · simp · exact this · apply Real.sqrt_nonneg simp _ = √(1 / ↑n) * √(∑ i, (x (S i) - y (S i)) ^ 2) + √(1 / ↑n) * √(∑ i, (y (S i) - z (S i)) ^ 2) := by apply LeftDistribClass.left_distrib _ = _ := by simp let xS : EuclideanSpace ℝ (Fin n) := toLp 2 (fun i ↦ x (S i)) let yS : EuclideanSpace ℝ (Fin n) := toLp 2 (fun i ↦ y (S i)) let zS : EuclideanSpace ℝ (Fin n) := toLp 2 (fun i ↦ z (S i)) calc _ = √(∑ i, (xS i - zS i) ^ 2) := by rfl _ = √(∑ i, ‖xS i - zS i‖ ^ 2) := by simp _ = ‖xS - zS‖ := symm (EuclideanSpace.norm_eq (xS - zS)) _ ≤ ‖xS - yS‖ + ‖yS - zS‖ := norm_sub_le_norm_sub_add_norm_sub xS yS zS _ = _ := by apply Mathlib.Tactic.LinearCombination.add_eq_eq · calc _ = √(∑ i, ‖xS i - yS i‖ ^ 2) := EuclideanSpace.norm_eq (xS - yS) _ = √(∑ i, (xS i - yS i) ^ 2) := by simp · calc _ = √(∑ i, ‖yS i - zS i‖ ^ 2) := EuclideanSpace.norm_eq (yS - zS) _ = √(∑ i, (yS i - zS i) ^ 2) := by simp
Causalean.Stat.Concentration.empiricalPMet · Causalean/Stat/Concentration/Covering/EmpiricalPseudoMetric.lean:50
structure EmpiricalFunctionSpace reviewed
Causalean.Stat.Concentration

An element of the empirical function space is an index picking out one function of the class; the structure packages the indexed class of functions equipped with the empirical pseudometric induced by a fixed sample.

Definition (Lean source)
F :
ι → 𝒳 → ℝ
S :
Fin n → 𝒳
The index selecting a function from the class.
index :
ι
Causalean.Stat.Concentration.EmpiricalFunctionSpace · Causalean/Stat/Concentration/Covering/EmpiricalPseudoMetric.lean:135
8 supporting declarations (lemmas, instances)
Covering­Number 3 core · 6 supporting Defines metric covering numbers for totally bounded sets and proves their basic properties. ★ coveringNumber_eq

Defines metric covering numbers for totally bounded sets and proves their basic properties.

This file provides coveringNumber, the chosen minimizing net coveringFinset, and the basic facts used by the Dudley entropy-integral bound: positivity on nonempty sets, antitonicity in the radius, and almost-everywhere measurability of the covering-number function.

UPSTREAM-DELTA: declarations are placed in the Causalean.Stat.Concentration namespace. The proof terms are otherwise kept close to upstream, with only Mathlib API-drift adjustments for Lean 4.29.

def coveringNumber reviewed
Causalean.Stat.Concentration

The covering number is the smallest size of a finite positive-radius net for a totally bounded set, and is zero at nonpositive radii.

Definition (Lean source)
noncomputable def coveringNumber {X : Type*} [PseudoMetricSpace X] {A : Set X} (ha : TotallyBounded A) (ε : ℝ) : ℕ := if h : ε > 0 then find (coveringNumber_exists ha h) else 0
Causalean.Stat.Concentration.coveringNumber · Causalean/Stat/Concentration/Covering/CoveringNumber.lean:39
theorem coveringNumber_eq reviewed
Causalean.Stat.Concentration

Value of the covering number at a positive radius. For a totally bounded subset of a pseudometric space, at any positive covering radius ε, the covering number equals the least cardinality of a finite ε-net witnessing total boundedness, as selected by coveringNumber_exists.

Formal statement
X :
ε :
:
ε > 0
Proof (Lean source)
theorem coveringNumber_eq {X : Type*} [PseudoMetricSpace X] {A : Set X} (ha : TotallyBounded A) {ε : ℝ} (hε : ε > 0) : coveringNumber ha ε = find (coveringNumber_exists ha hε) := dif_pos hε
def coveringFinset reviewed
Causalean.Stat.Concentration

A chosen finite positive-radius net attains the covering number.

Definition (Lean source)
noncomputable def coveringFinset {X : Type*} [PseudoMetricSpace X] {A : Set X} (ha : TotallyBounded A) {ε : ℝ} (hε : ε > 0) : Finset X := choose (Nat.find_spec (coveringNumber_exists (X := X) (A := A) ha hε))
Causalean.Stat.Concentration.coveringFinset · Causalean/Stat/Concentration/Covering/CoveringNumber.lean:96
6 supporting declarations (lemmas, instances)
VCCovering 5 core · 9 supporting For a binary-indexed function class, the empirical covering number is bounded by the Sauer-Shelah growth function of the underlying VC class, avoiding the Haussler packing argument. ★ vc_coveringNumber_le_sum_choose★ log_coveringNumber_le

For a binary-indexed function class, the empirical covering number is bounded by the Sauer-Shelah growth function of the underlying VC class, avoiding the Haussler packing argument.

The sample restriction of a real-valued class F is assumed to factor through a Boolean class π: at sample coordinate j, the real value is a fixed transform φ j of the bit π i (S j). Distinct empirical vectors of F are therefore indexed by distinct Boolean restriction patterns on the sample. One representative per realized pattern covers the empirical pseudometric space at every positive radius, and Sauer-Shelah bounds the number of such patterns. The main exported results are vc_coveringNumber_le_growth, vc_coveringNumber_le_sum_choose, log_coveringNumber_le_of_card_bound, and log_coveringNumber_le.

def restrictionPattern reviewed
Causalean.Stat.Concentration

The subset of sample coordinates at which a Boolean classifier is true.

Definition (Lean source)
noncomputable def restrictionPattern (p : 𝒳 → Bool) (S : Fin n → 𝒳) : Finset (Fin n) := by classical exact Finset.univ.filter fun j => p (S j)
Causalean.Stat.Concentration.restrictionPattern · Causalean/Stat/Concentration/Covering/VCCovering.lean:30
def growthFamily reviewed
Causalean.Stat.Concentration

The finite family of Boolean restriction patterns realized on a sample.

Definition (Lean source)
noncomputable def growthFamily (π : ι → 𝒳 → Bool) (S : Fin n → 𝒳) : Finset (Finset (Fin n)) := by classical exact Finset.univ.filter fun A : Finset (Fin n) => ∃ i : ι, restrictionPattern (π i) S = A
Causalean.Stat.Concentration.growthFamily · Causalean/Stat/Concentration/Covering/VCCovering.lean:36
def patternCover reviewed
Causalean.Stat.Concentration

One empirical-function representative for each realized Boolean pattern.

Definition (Lean source)
noncomputable def patternCover {F : ι → 𝒳 → ℝ} (π : ι → 𝒳 → Bool) (S : Fin n → 𝒳) : Finset (EmpiricalFunctionSpace F S) := by classical exact (growthFamily π S).attach.image fun A => EmpiricalFunctionSpace.mk (F := F) (S := S) (choose ((mem_growthFamily_iff (π := π) (S := S) (A := A.1)).mp A.2))
theorem vc_coveringNumber_le_sum_choose reviewed
Causalean.Stat.Concentration

Sauer-Shelah covering-number bound for a binary-factored class. Suppose the real-valued class factors through a Boolean classifier at each sample coordinate: F i (S j) = φ j (π i (S j)), so that the sample-restricted class is totally bounded in the empirical pseudometric, the covering radius ε is positive, and the induced Boolean growth family on the sample has VC dimension at most d. Then the empirical covering number at radius ε is at most the Sauer-Shelah binomial sum ∑_{k≤d} C(n,k).

Formal statement
F :
ι → 𝒳 → ℝ
S :
Fin n → 𝒳
π :
ι → 𝒳 → Bool
φ :
Fin n → Bool → ℝ
hfactor :
∀ i j, F i (S j) = φ j (π i (S j))
h' :
ε :
:
0 < ε
hvd :
(growthFamily π S).vcDim ≤ d
coveringNumber h' ε ≤ ∑ k ∈ Iic d, n.choose k
Proof (Lean source)
theorem vc_coveringNumber_le_sum_choose {F : ι → 𝒳 → ℝ} {S : Fin n → 𝒳} {π : ι → 𝒳 → Bool} {φ : Fin n → Bool → ℝ} (hfactor : ∀ i j, F i (S j) = φ j (π i (S j))) (h' : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S))) {ε : ℝ} (hε : 0 < ε) (hvd : (growthFamily π S).vcDim ≤ d) : coveringNumber h' ε ≤ ∑ k ∈ Iic d, n.choose k := by exact le_trans (vc_coveringNumber_le_growth hfactor h' hε) (card_growthFamily_le_sum_choose (growthFamily π S) hvd)
theorem log_coveringNumber_le reviewed
Causalean.Stat.Concentration

Logarithmic Sauer-Shelah covering-number bound. Under the binary-factoring hypothesis F i (S j) = φ j (π i (S j)), with the sample-restricted class totally bounded in the empirical pseudometric, a positive covering radius ε, a positive sample size n, and VC dimension at most d for the induced Boolean growth family on the sample, the logarithm of the empirical covering number at radius ε is at most log(d+1) + d·log n.

Formal statement
Nonempty ι
F :
ι → 𝒳 → ℝ
S :
Fin n → 𝒳
π :
ι → 𝒳 → Bool
φ :
Fin n → Bool → ℝ
hfactor :
∀ i j, F i (S j) = φ j (π i (S j))
h' :
ε :
:
0 < ε
hn_pos :
0 < n
hvd :
(growthFamily π S).vcDim ≤ d
log (coveringNumber h' ε) ≤ log ((d + 1 : ℕ) : ℝ) + (d : ℝ) * log n
Proof (Lean source)
theorem log_coveringNumber_le [Nonempty ι] {F : ι → 𝒳 → ℝ} {S : Fin n → 𝒳} {π : ι → 𝒳 → Bool} {φ : Fin n → Bool → ℝ} (hfactor : ∀ i j, F i (S j) = φ j (π i (S j))) (h' : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S))) {ε : ℝ} (hε : 0 < ε) (hn_pos : 0 < n) (hvd : (growthFamily π S).vcDim ≤ d) : log (coveringNumber h' ε) ≤ log ((d + 1 : ℕ) : ℝ) + (d : ℝ) * log n := by classical let s : ℕ := ∑ k ∈ Iic d, n.choose k have hcov_sum : coveringNumber h' ε ≤ s := vc_coveringNumber_le_sum_choose hfactor h' hε hvd have hcov_pos : 0 < coveringNumber h' ε := by have hnonempty : (Set.univ : Set (EmpiricalFunctionSpace F S)).Nonempty := by obtain ⟨i⟩ := (inferInstance : Nonempty ι) exact ⟨⟨i⟩, by simp⟩ exact coveringNumber_nonzero hnonempty h' hε have hcov_bound : ((coveringNumber h' ε : ℕ) : ℝ) ≤ ((d + 1 : ℕ) : ℝ) * (n : ℝ) ^ d := by calc ((coveringNumber h' ε : ℕ) : ℝ) ≤ (s : ℝ) := by exact_mod_cast hcov_sum _ ≤ ((d + 1 : ℕ) : ℝ) * (n : ℝ) ^ d := sum_choose_le_succ_mul_pow (n := n) (d := d) hn_pos calc log (coveringNumber h' ε) ≤ log (((d + 1 : ℕ) : ℝ) * (n : ℝ) ^ d) := by exact Real.log_le_log (Nat.cast_pos.mpr hcov_pos) hcov_bound _ = log ((d + 1 : ℕ) : ℝ) + log ((n : ℝ) ^ d) := by rw [Real.log_mul] · exact_mod_cast Nat.succ_ne_zero d · exact pow_ne_zero d (Nat.cast_ne_zero.mpr (ne_of_gt hn_pos)) _ = log ((d + 1 : ℕ) : ℝ) + (d : ℝ) * log n := by rw [Real.log_pow]
9 supporting declarations (lemmas, instances)
Haussler­Packing 3 core · 12 supporting Haussler-style VC packing bounds for finite Boolean classes. ★ vc_weightedHamming_packing_card_le

Haussler-style VC packing bounds for finite Boolean classes.

This file isolates the probabilistic random-subsample extraction used in the standard Haussler packing argument, then derives the cardinality and logarithmic packing bounds from Sauer-Shelah. The public API includes weightedHammingSq, the separating-subsample extraction exists_separating_subsample, the self-referential logarithmic solver self_log_solve, and the final vc_weightedHamming_packing_card_le / vc_weightedHamming_packing_card_le bounds.

def weightedHammingSq reviewed
Causalean.Stat.Concentration

Weighted Hamming pseudo-distance squared between two Boolean vectors on Fin n, using nonnegative coordinate weights.

Definition (Lean source)
def weightedHammingSq {n : ℕ} (w : Fin n → ℝ) (a b : Fin n → Bool) : ℝ := ∑ j : Fin n, if a j = b j then 0 else w j
Causalean.Stat.Concentration.weightedHammingSq · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:19
def subsamplePattern reviewed
Causalean.Stat.Concentration

The set of sampled coordinates, pulled back along a coordinate map J, on which a Boolean vector is true.

Definition (Lean source)
noncomputable def subsamplePattern {n m : ℕ} (J : Fin m → Fin n) (a : Fin n → Bool) : Finset (Fin m) := by classical exact Finset.univ.filter fun i => a (J i) = true
Causalean.Stat.Concentration.subsamplePattern · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:24
theorem vc_weightedHamming_packing_card_le reviewed
Causalean.Stat.Concentration

Haussler ε-packing bound, logarithmic form. Let w be a nonnegative weight on the n sample coordinates with total weight at most r², where ε is positive and at most r. If the Boolean family P, viewed as the sets of coordinates where each member is true, has VC dimension at most d and every two distinct members of P are separated by weighted Hamming distance at least ε² in that weighting, then the logarithm of the cardinality of P is at most 1 + 2d·log(4d·r²/ε²) — a bound depending only on d and the ratio r²/ε², with no dependence on the ambient coordinate count n.

Formal statement
n :
d :
w :
Fin n → ℝ
hw :
∀ j, 0 ≤ w j
r ε :
:
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
log (P.card) ≤ 1 + 2 * (d : ℝ) * log (4 * (d : ℝ) * r ^ 2 / ε ^ 2)
Proof (Lean source)
theorem 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) : log (P.card) ≤ 1 + 2 * (d : ℝ) * log (4 * (d : ℝ) * r ^ 2 / ε ^ 2) := by classical by_cases hsmall : P.card ≤ 1 · have hlog_nonpos : log (P.card) ≤ 0 := by have hcases : P.card = 0 ∨ P.card = 1 := by omega rcases hcases with hzero | hone · simp [hzero] · simp [hone] exact le_trans hlog_nonpos (haussler_log_rhs_nonneg hε hεr) have hPcard : 2 ≤ P.card := by omega have hr : 0 < r := hε.trans_le hεr 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_nat : P.card ≤ (m + 1) ^ d := by rw [← hcard_image] exact card_subsample_family_le_succ_pow J P hvcJ by_cases hd0 : d = 0 · have : P.card ≤ 1 := by simpa [hd0] using hcard_nat omega have hd : 1 ≤ d := Nat.succ_le_of_lt (Nat.pos_of_ne_zero hd0) let L : ℝ := log (P.card) let a : ℝ := 2 * r ^ 2 / ε ^ 2 have hPcard_pos : 0 < P.card := by omega have hPcard_one : 1 ≤ P.card := by omega have hL_nonneg : 0 ≤ L := by exact Real.log_nonneg (by exact_mod_cast hPcard_one) have ha : 2 ≤ a := by have hx : 1 ≤ r / ε := (one_le_div hε).mpr hεr have hsq : 1 ≤ r ^ 2 / ε ^ 2 := by rw [← div_pow] nlinarith [sq_nonneg (r / ε)] dsimp [a] calc 2 ≤ 2 * (r ^ 2 / ε ^ 2) := by nlinarith _ = 2 * r ^ 2 / ε ^ 2 := by ring have hcard_real : (P.card : ℝ) ≤ (((m + 1) ^ d : ℕ) : ℝ) := by exact_mod_cast hcard_nat have hlog_card_le_pow : L ≤ log ((((m + 1) ^ d : ℕ) : ℝ)) := by dsimp [L] exact Real.log_le_log (by exact_mod_cast hPcard_pos) hcard_real have hlog_pow : log ((((m + 1) ^ d : ℕ) : ℝ)) = (d : ℝ) * log (((m + 1 : ℕ) : ℝ)) := by rw [Nat.cast_pow, Real.log_pow] have hL_le_m : L ≤ (d : ℝ) * log (((m + 1 : ℕ) : ℝ)) := by rwa [hlog_pow] at hlog_card_le_pow have hm_succ : (((m + 1 : ℕ) : ℝ)) ≤ 2 + a * L := by dsimp [a, L] at hm ⊢ norm_num [Nat.cast_add, cast_one] linarith have hm_succ_pos : 0 < (((m + 1 : ℕ) : ℝ)) := by positivity have hlog_m_le : log (((m + 1 : ℕ) : ℝ)) ≤ log (2 + a * L) := Real.log_le_log hm_succ_pos hm_succ have hd_nonneg : 0 ≤ (d : ℝ) := by positivity have hbound : L ≤ (d : ℝ) * log (2 + a * L) := by exact le_trans hL_le_m (mul_le_mul_of_nonneg_left hlog_m_le hd_nonneg) have hsolve := self_log_solve (a := a) (L := L) (d := d) hd ha hL_nonneg hbound dsimp [L, a] at hsolve convert hsolve using 2 ring_nf
Causalean.Stat.Concentration.vc_weightedHamming_packing_card_le · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:616 · uses weightedHammingSq
12 supporting declarations (lemmas, instances)
  • weightedHammingSq_nonneg lemma — Nonnegative coordinate weights make the weighted Hamming pseudo-distance nonnegative.
    n :
    w :
    Fin n → ℝ
    hw :
    ∀ j, 0 ≤ w j
    a b :
    Fin n → Bool
    0 ≤ weightedHammingSq w a b
    Proof (Lean source)
    lemma weightedHammingSq_nonneg {n : ℕ} (w : Fin n → ℝ) (hw : ∀ j, 0 ≤ w j) (a b : Fin n → Bool) : 0 ≤ weightedHammingSq w a b := by classical unfold weightedHammingSq exact sum_nonneg fun j _ => by by_cases h : a j = b j · simp [h] · simp [h, hw j]
    Causalean.Stat.Concentration.weightedHammingSq_nonneg · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:31
  • subsamplePattern_mem_iff lemma — A sampled coordinate belongs to a Boolean pattern exactly when the original Boolean vector is true at the coordinate from which it was sampled.
    n m :
    Fin m → Fin n
    Fin n → Bool
    Fin m
    i ∈ subsamplePattern J a ↔ a (J i) = true
    Proof (Lean source)
    lemma subsamplePattern_mem_iff {n m : ℕ} {J : Fin m → Fin n} {a : Fin n → Bool} {i : Fin m} : i ∈ subsamplePattern J a ↔ a (J i) = true := by classical simp [subsamplePattern]
    Causalean.Stat.Concentration.subsamplePattern_mem_iff · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:43
  • sum_choose_le_succ_pow lemma — A partial sum of binomial coefficients is no larger than a polynomial power, providing the elementary growth bound used in VC estimates.
    n d :
    (∑ k ∈ Iic d, n.choose k) ≤ (n + 1) ^ d
    Proof (Lean source)
    lemma sum_choose_le_succ_pow (n d : ℕ) : (∑ k ∈ Iic d, n.choose k) ≤ (n + 1) ^ d := by calc (∑ k ∈ Iic d, n.choose k) ≤ ∑ k ∈ Iic d, n ^ k := by refine Finset.sum_le_sum ?_ intro k _hk exact Nat.choose_le_pow n k _ ≤ ∑ k ∈ Iic d, d.choose k * n ^ k := by refine Finset.sum_le_sum ?_ intro k hk have hk' : k ≤ d := by simpa using hk have hchoose_pos : 1 ≤ d.choose k := Nat.succ_le_of_lt (Nat.choose_pos hk') simpa [one_mul] using Nat.mul_le_mul_right (n ^ k) hchoose_pos _ = (n + 1) ^ d := by rw [add_pow] simp only [one_pow, mul_one, Nat.cast_id] apply Finset.sum_congr · ext k simp · intro k _hk rw [Nat.mul_comm]
    Causalean.Stat.Concentration.sum_choose_le_succ_pow · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:51
  • subsamplePattern_eq_iff lemma — Equality of sampled Boolean patterns means that the two patterns agree at every coordinate selected by the sample.
    n m :
    Fin m → Fin n
    Fin n → Bool
    subsamplePattern J a = subsamplePattern J b ↔ ∀ t : Fin m, a (J t) = b (J t)
    Proof (Lean source)
    lemma subsamplePattern_eq_iff {n m : ℕ} {J : Fin m → Fin n} {a b : Fin n → Bool} : subsamplePattern J a = subsamplePattern J b ↔ ∀ t : Fin m, a (J t) = b (J t) := by classical constructor · intro h t by_cases ha : a (J t) = true · have ht : t ∈ subsamplePattern J b := by rw [← h, subsamplePattern_mem_iff] exact ha rw [subsamplePattern_mem_iff] at ht rw [ha, ht] · have ha_false : a (J t) = false := by exact Bool.eq_false_of_not_eq_true ha by_cases hb : b (J t) = true · have ht : t ∈ subsamplePattern J a := by rw [h, subsamplePattern_mem_iff] exact hb rw [subsamplePattern_mem_iff] at ht exact elim (ha ht) · have hb_false : b (J t) = false := by exact Bool.eq_false_of_not_eq_true hb rw [ha_false, hb_false] · intro h ext t simp [subsamplePattern_mem_iff, h t]
    Causalean.Stat.Concentration.subsamplePattern_eq_iff · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:80
  • per_pair_collision_sum lemma — The weighted sum over all fixed-length coordinate selections that agree under two Boolean patterns equals the corresponding power of the total weight of their agreeing coordinates.
    n m :
    w :
    Fin n → ℝ
    a b :
    Fin n → Bool
    (∑ J : Fin m → Fin n, (∏ t : Fin m, w (J t)) * (if (∀ t : Fin m, a (J t) = b (J t)) then (1 : ℝ) else 0))
    = (∑ j ∈ Finset.univ.filter (fun j : Fin n => a j = b j), w j) ^ m
    Proof (Lean source)
    lemma per_pair_collision_sum {n m : ℕ} (w : Fin n → ℝ) (a b : Fin n → Bool) : (∑ J : Fin m → Fin n, (∏ t : Fin m, w (J t)) * (if (∀ t : Fin m, a (J t) = b (J t)) then (1 : ℝ) else 0)) = (∑ j ∈ Finset.univ.filter (fun j : Fin n => a j = b j), w j) ^ m := by classical let g : Fin n → ℝ := fun j => w j * (if a j = b j then (1 : ℝ) else 0) have hpoint : ∀ J : Fin m → Fin n, (∏ t : Fin m, w (J t)) * (if (∀ t : Fin m, a (J t) = b (J t)) then (1 : ℝ) else 0) = ∏ t : Fin m, g (J t) := by intro J by_cases h : ∀ t : Fin m, a (J t) = b (J t) · simp [g, h] · have hprod_zero : ∏ t : Fin m, (if a (J t) = b (J t) then (1 : ℝ) else 0) = 0 := by rw [Finset.prod_eq_zero_iff] push_neg at h rcases h with ⟨t, ht⟩ exact ⟨t, Finset.mem_univ t, by simp [ht]⟩ have hgprod_zero : (∏ t : Fin m, g (J t)) = 0 := by rw [Finset.prod_eq_zero_iff] push_neg at h rcases h with ⟨t, ht⟩ exact ⟨t, Finset.mem_univ t, by simp [g, ht]⟩ simp [h, hgprod_zero] calc (∑ J : Fin m → Fin n, (∏ t : Fin m, w (J t)) * (if (∀ t : Fin m, a (J t) = b (J t)) then (1 : ℝ) else 0)) = ∑ J : Fin m → Fin n, ∏ t : Fin m, g (J t) := by exact Finset.sum_congr rfl fun J _ => hpoint J _ = (∑ j : Fin n, g j) ^ m := product_sum_normalization g _ = (∑ j ∈ Finset.univ.filter (fun j : Fin n => a j = b j), w j) ^ m := by congr 1 simp [g, Finset.sum_filter]
    Causalean.Stat.Concentration.per_pair_collision_sum · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:109
  • averaging_exists_zero_count lemma — A nonnegative finite probability weighting with average count below one must assign count zero to at least one index.
    ι :
    Type*
    μ :
    ι → ℝ
    cnt :
    ι → ℕ
    hμsum :
    ∑ i : ι, μ i = 1
    hμnonneg :
    ∀ i, 0 ≤ μ i
    hmean :
    ∑ i : ι, μ i * (cnt i : ℝ) < 1
    ∃ i, cnt i = 0
    Proof (Lean source)
    lemma averaging_exists_zero_count {ι : Type*} [Fintype ι] (μ : ι → ℝ) (cnt : ι → ℕ) (hμsum : ∑ i : ι, μ i = 1) (hμnonneg : ∀ i, 0 ≤ μ i) (hmean : ∑ i : ι, μ i * (cnt i : ℝ) < 1) : ∃ i, cnt i = 0 := by classical by_contra hnone push_neg at hnone have hge : 1 ≤ ∑ i : ι, μ i * (cnt i : ℝ) := by calc 1 = ∑ i : ι, μ i := by rw [hμsum] _ = ∑ i : ι, μ i * (1 : ℝ) := by simp _ ≤ ∑ i : ι, μ i * (cnt i : ℝ) := by refine Finset.sum_le_sum ?_ intro i _hi exact mul_le_mul_of_nonneg_left (by exact_mod_cast Nat.succ_le_of_lt (Nat.pos_of_ne_zero (hnone i))) (hμnonneg i) exact not_lt_of_ge hge hmean
    Causalean.Stat.Concentration.averaging_exists_zero_count · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:149
  • collision_bound lemma — When two Boolean vectors are separated under nonnegative coordinate weights, their probability of agreeing on every coordinate of a repeated weighted sample decays exponentially with the sample length.
    n m :
    w :
    Fin n → ℝ
    hw :
    ∀ j, 0 ≤ w j
    r ε W :
    hr :
    0 < r
    hW :
    W = ∑ j : Fin n, w j
    hWpos :
    0 < W
    hwsum :
    W ≤ r ^ 2
    a b :
    Fin n → Bool
    hsep :
    ε ^ 2 ≤ weightedHammingSq w a b
    (∑ j ∈ Finset.univ.filter (fun j : Fin n => a j = b j), w j / W) ^ m
    exp (-(m : ℝ) * ε ^ 2 / r ^ 2)
    Proof (Lean source)
    lemma collision_bound {n m : ℕ} (w : Fin n → ℝ) (hw : ∀ j, 0 ≤ w j) (r ε W : ℝ) (hr : 0 < r) (hW : W = ∑ j : Fin n, w j) (hWpos : 0 < W) (hwsum : W ≤ r ^ 2) (a b : Fin n → Bool) (hsep : ε ^ 2 ≤ weightedHammingSq w a b) : (∑ j ∈ Finset.univ.filter (fun j : Fin n => a j = b j), w j / W) ^ m ≤ exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by classical -- The agreeing-coordinate weight is the total minus the weighted Hamming gap. have hagree : (∑ j ∈ Finset.univ.filter (fun j : Fin n => a j = b j), w j) = W - weightedHammingSq w a b := by rw [hW] unfold weightedHammingSq rw [← Finset.sum_sub_distrib, Finset.sum_filter] apply Finset.sum_congr rfl intro j _ by_cases h : a j = b j <;> simp [h] have hr2pos : 0 < r ^ 2 := by positivity have hWH_nonneg : 0 ≤ weightedHammingSq w a b := weightedHammingSq_nonneg w hw a b -- Normalize: the collision factor `s = (W - WH)/W` lies in `[0, 1 - ε²/r²]`. rw [← Finset.sum_div, hagree] set s : ℝ := (W - weightedHammingSq w a b) / W with hs_def have hs_nonneg : 0 ≤ s := by rw [hs_def] refine div_nonneg ?_ (le_of_lt hWpos) rw [← hagree] exact sum_nonneg (fun j _ => hw j) have hs_le1 : s ≤ 1 - ε ^ 2 / r ^ 2 := by rw [hs_def, sub_div, div_self (ne_of_gt hWpos)] have hratio : ε ^ 2 / r ^ 2 ≤ weightedHammingSq w a b / W := by rw [div_le_div_iff₀ hr2pos hWpos] nlinarith [hsep, hwsum, hWH_nonneg, sq_nonneg ε] linarith have hexp : 1 - ε ^ 2 / r ^ 2 ≤ exp (-(ε ^ 2 / r ^ 2)) := by have h := Real.add_one_le_exp (-(ε ^ 2 / r ^ 2)) linarith have hs_le_exp : s ≤ exp (-(ε ^ 2 / r ^ 2)) := le_trans hs_le1 hexp calc s ^ m ≤ (exp (-(ε ^ 2 / r ^ 2))) ^ m := pow_le_pow_left₀ hs_nonneg hs_le_exp m _ = exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by rw [← Real.exp_nat_mul] congr 1 ring
    Causalean.Stat.Concentration.collision_bound · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:172
  • card_subsample_family_le_succ_pow lemma — A sampled Boolean trace family with bounded VC dimension has polynomially many realized restricted patterns.
    n m d :
    J :
    Fin m → Fin n
    P :
    Finset (Fin n → Bool)
    hvcJ :
    (P.image (subsamplePattern J)).vcDim ≤ d
    (P.image (subsamplePattern J)).card ≤ (m + 1) ^ d
    Proof (Lean source)
    lemma card_subsample_family_le_succ_pow {n m d : ℕ} (J : Fin m → Fin n) (P : Finset (Fin n → Bool)) (hvcJ : (P.image (subsamplePattern J)).vcDim ≤ d) : (P.image (subsamplePattern J)).card ≤ (m + 1) ^ d := by exact le_trans (card_growthFamily_le_sum_choose (P.image (subsamplePattern J)) hvcJ) (sum_choose_le_succ_pow m d)
    Causalean.Stat.Concentration.card_subsample_family_le_succ_pow · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:220
  • subsample_image_vcDim_le lemma — Restricting a Boolean set family along a coordinate map does not increase VC dimension.
    n m :
    d :
    J :
    Fin m → Fin n
    P :
    Finset (Fin n → Bool)
    hvc :
    (P.image (fun a => Finset.univ.filter (fun j => a j = true))).vcDim ≤ d
    (P.image (subsamplePattern J)).vcDim ≤ d
    Proof (Lean source)
    lemma subsample_image_vcDim_le {n m : ℕ} (d : ℕ) (J : Fin m → Fin n) (P : Finset (Fin n → Bool)) (hvc : (P.image (fun a => Finset.univ.filter (fun j => a j = true))).vcDim ≤ d) : (P.image (subsamplePattern J)).vcDim ≤ d := by classical let A : Finset (Finset (Fin n)) := P.image (fun a => Finset.univ.filter (fun j => a j = true)) let B : Finset (Finset (Fin m)) := P.image (subsamplePattern J) have hB_le_A : B.vcDim ≤ A.vcDim := by unfold vcDim refine Finset.sup_le ?_ intro T hTmem have hT : B.Shatters T := Finset.mem_shatterer.mp hTmem let U : Finset (Fin n) := T.image J have hinj : InjOn J (↑T) := by intro i hi k hk hJ by_contra hik have hsingle : ({i} : Finset (Fin m)) ⊆ T := Finset.singleton_subset_iff.mpr hi obtain ⟨u, huB, hTu⟩ := hT hsingle rcases Finset.mem_image.mp huB with ⟨a, _haP, rfl⟩ have hi_inter : i ∈ T ∩ subsamplePattern J a := by rw [hTu] simp have hi_pat : i ∈ subsamplePattern J a := (Finset.mem_inter.mp hi_inter).2 have hk_pat : k ∈ subsamplePattern J a := by rw [subsamplePattern_mem_iff] at hi_pat ⊢ simpa [hJ] using hi_pat have hk_inter : k ∈ T ∩ subsamplePattern J a := Finset.mem_inter.mpr ⟨hk, hk_pat⟩ have hk_single : k ∈ ({i} : Finset (Fin m)) := by rw [← hTu] exact hk_inter have hki : k = i := by simpa using hk_single exact hik hki.symm have hAshat : A.Shatters U := by intro S hS let S' : Finset (Fin m) := T.filter fun i => J i ∈ S have hS'T : S' ⊆ T := by intro i hi exact (Finset.mem_filter.mp hi).1 obtain ⟨u, huB, hTu⟩ := hT hS'T rcases Finset.mem_image.mp huB with ⟨a, haP, rfl⟩ refine ⟨Finset.univ.filter (fun j => a j = true), ?_, ?_⟩ · exact Finset.mem_image.mpr ⟨a, haP, rfl⟩ · ext x constructor · intro hx rcases Finset.mem_inter.mp hx with ⟨hxU, hxtrue⟩ rcases Finset.mem_image.mp hxU with ⟨i, hiT, rfl⟩ have hi_pat : i ∈ subsamplePattern J a := by rw [subsamplePattern_mem_iff] simpa using (Finset.mem_filter.mp hxtrue).2 have hiS' : i ∈ S' := by rw [← hTu] exact Finset.mem_inter.mpr ⟨hiT, hi_pat⟩ exact (Finset.mem_filter.mp hiS').2 · intro hxS have hxU : x ∈ U := hS hxS rcases Finset.mem_image.mp hxU with ⟨i, hiT, hJi⟩ have hiS' : i ∈ S' := Finset.mem_filter.mpr ⟨hiT, by simpa [hJi] using hxS⟩ have hi_inter : i ∈ T ∩ subsamplePattern J a := by rw [hTu] exact hiS' have hi_pat : i ∈ subsamplePattern J a := (Finset.mem_inter.mp hi_inter).2 refine Finset.mem_inter.mpr ⟨hxU, ?_⟩ rw [mem_filter] constructor · simp · rw [subsamplePattern_mem_iff] at hi_pat simpa [hJi] using hi_pat have hU_le : U.card ≤ A.vcDim := Finset.Shatters.card_le_vcDim hAshat have hcard : U.card = T.card := Finset.card_image_of_injOn hinj exact hcard.ge.trans hU_le exact hB_le_A.trans hvc
    Causalean.Stat.Concentration.subsample_image_vcDim_le · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:230
  • finite_averaging_exists_separating_subsample lemma — Finite averaging core for the weighted random-coordinate extraction.
    n :
    w :
    Fin n → ℝ
    hw :
    ∀ j, 0 ≤ w j
    r ε :
    hr :
    0 < r
    :
    0 < ε
    hwsum :
    ∑ j, w j ≤ r ^ 2
    P :
    Finset (Fin n → Bool)
    hPcard :
    2 ≤ P.card
    hsep :
    ∀ a ∈ P, ∀ b ∈ P, a ≠ b → ε ^ 2 ≤ weightedHammingSq w a b
    ∃ (m : ℕ) (J : Fin m → Fin n),
    (m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * log (P.card) ∧ InjOn (subsamplePattern J) ↑P
    Proof (Lean source)
    lemma finite_averaging_exists_separating_subsample {n : ℕ} (w : Fin n → ℝ) (hw : ∀ j, 0 ≤ w j) (r ε : ℝ) (hr : 0 < r) (hε : 0 < ε) (hwsum : ∑ j, w j ≤ r ^ 2) (P : Finset (Fin n → Bool)) (hPcard : 2 ≤ P.card) (hsep : ∀ a ∈ P, ∀ b ∈ P, a ≠ b → ε ^ 2 ≤ weightedHammingSq w a b) : ∃ (m : ℕ) (J : Fin m → Fin n), (m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * log (P.card) ∧ InjOn (subsamplePattern J) ↑P := by classical let W : ℝ := ∑ j : Fin n, w j have hWdef : W = ∑ j : Fin n, w j := rfl have hWpos : 0 < W := by have htwo : 1 < P.card := by omega rcases Finset.one_lt_card.mp htwo with ⟨a, haP, b, hbP, hab⟩ have hdist_le_W : weightedHammingSq w a b ≤ W := by dsimp [W] unfold weightedHammingSq refine Finset.sum_le_sum ?_ intro j _hj by_cases h : a j = b j · simp [h, hw j] · simp [h] have hdist_pos : 0 < weightedHammingSq w a b := by have hεsq : 0 < ε ^ 2 := sq_pos_of_ne_zero (ne_of_gt hε) exact lt_of_lt_of_le hεsq (hsep a haP b hbP hab) exact lt_of_lt_of_le hdist_pos hdist_le_W have hwsumW : W ≤ r ^ 2 := by simpa [W] using hwsum let L : ℝ := (2 * r ^ 2 / ε ^ 2) * log (P.card) let m : ℕ := ⌊L⌋₊ + 1 have hPpos_nat : 0 < P.card := by omega have hPone_nat : 1 ≤ P.card := by omega have hPpos_real : 0 < (P.card : ℝ) := by exact_mod_cast hPpos_nat have hLnonneg : 0 ≤ L := by have hcoef_nonneg : 0 ≤ 2 * r ^ 2 / ε ^ 2 := by positivity have hlog_nonneg : 0 ≤ log (P.card) := Real.log_nonneg (by exact_mod_cast hPone_nat) exact mul_nonneg hcoef_nonneg hlog_nonneg have hm_bound : (m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * log (P.card) := by have hfloor : ((⌊L⌋₊ : ℕ) : ℝ) ≤ L := Nat.floor_le hLnonneg dsimp [m, L] norm_num [Nat.cast_add, cast_one] linarith let μ : (Fin m → Fin n) → ℝ := fun J => ∏ t : Fin m, (w (J t) / W) let cnt : (Fin m → Fin n) → ℕ := fun J => (P.offDiag.filter fun ab => subsamplePattern J ab.1 = subsamplePattern J ab.2).card have hμsum : ∑ J : Fin m → Fin n, μ J = 1 := by dsimp [μ] rw [product_sum_normalization (n := n) (m := m) (fun j : Fin n => w j / W)] have hsum : (∑ j : Fin n, w j / W) = 1 := by rw [← Finset.sum_div] rw [← hWdef] exact div_self (ne_of_gt hWpos) rw [hsum, one_pow] have hμnonneg : ∀ J : Fin m → Fin n, 0 ≤ μ J := by intro J dsimp [μ] exact Finset.prod_nonneg fun t _ht => div_nonneg (hw (J t)) (le_of_lt hWpos) have hcnt_cast : ∀ J : Fin m → Fin n, (cnt J : ℝ) = ∑ ab ∈ P.offDiag, if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0 := by intro J dsimp [cnt] simp have hinner : ∀ ab ∈ P.offDiag, (∑ J : Fin m → Fin n, μ J * (if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0)) = (∑ j ∈ Finset.univ.filter (fun j : Fin n => ab.1 j = ab.2 j), w j / W) ^ m := by intro ab _hab calc (∑ J : Fin m → Fin n, μ J * (if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0)) = ∑ J : Fin m → Fin n, (∏ t : Fin m, (w (J t) / W)) * (if (∀ t : Fin m, ab.1 (J t) = ab.2 (J t)) then (1 : ℝ) else 0) := by refine Finset.sum_congr rfl ?_ intro J _hJ dsimp [μ] by_cases h : subsamplePattern J ab.1 = subsamplePattern J ab.2 · have hforall : ∀ t : Fin m, ab.1 (J t) = ab.2 (J t) := subsamplePattern_eq_iff.mp h simp [h, hforall] · have hforall : ¬ ∀ t : Fin m, ab.1 (J t) = ab.2 (J t) := by intro hall exact h (subsamplePattern_eq_iff.mpr hall) simp [h, hforall] _ = (∑ j ∈ Finset.univ.filter (fun j : Fin n => ab.1 j = ab.2 j), w j / W) ^ m := by exact per_pair_collision_sum (fun j : Fin n => w j / W) ab.1 ab.2 have hmean_le : (∑ J : Fin m → Fin n, μ J * (cnt J : ℝ)) ≤ (P.offDiag.card : ℝ) * exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by calc (∑ J : Fin m → Fin n, μ J * (cnt J : ℝ)) = ∑ J : Fin m → Fin n, μ J * (∑ ab ∈ P.offDiag, if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0) := by refine Finset.sum_congr rfl ?_ intro J _hJ rw [hcnt_cast J] _ = ∑ J : Fin m → Fin n, ∑ ab ∈ P.offDiag, μ J * (if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0) := by refine Finset.sum_congr rfl ?_ intro J _hJ rw [Finset.mul_sum] _ = ∑ ab ∈ P.offDiag, ∑ J : Fin m → Fin n, μ J * (if subsamplePattern J ab.1 = subsamplePattern J ab.2 then (1 : ℝ) else 0) := by rw [Finset.sum_comm] _ ≤ ∑ ab ∈ P.offDiag, exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by refine Finset.sum_le_sum ?_ intro ab hab rw [hinner ab hab] rcases Finset.mem_offDiag.mp hab with ⟨haP, hbP, habne⟩ exact collision_bound w hw r ε W hr hWdef hWpos hwsumW ab.1 ab.2 (hsep ab.1 haP ab.2 hbP habne) _ = (P.offDiag.card : ℝ) * exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by simp have hmean_lt_one : (∑ J : Fin m → Fin n, μ J * (cnt J : ℝ)) < 1 := by have hm_gt_L : L < (m : ℝ) := by dsimp [m] simpa [Nat.cast_add, cast_one] using (Nat.lt_floor_add_one L) have hscale_pos : 0 < ε ^ 2 / r ^ 2 := by positivity have hscaled : L * (ε ^ 2 / r ^ 2) < (m : ℝ) * (ε ^ 2 / r ^ 2) := mul_lt_mul_of_pos_right hm_gt_L hscale_pos have hLscale : L * (ε ^ 2 / r ^ 2) = 2 * log (P.card) := by dsimp [L] field_simp [ne_of_gt hε, ne_of_gt hr] have hmexp : 2 * log (P.card) < (m : ℝ) * ε ^ 2 / r ^ 2 := by rw [hLscale] at hscaled convert hscaled using 1 ring have hneg : -((m : ℝ) * ε ^ 2 / r ^ 2) < -(2 * log (P.card)) := by linarith have hexp_lt : exp (-((m : ℝ) * ε ^ 2 / r ^ 2)) < exp (-(2 * log (P.card))) := Real.exp_lt_exp.mpr hneg have hoff_card : (P.offDiag.card : ℝ) ≤ (P.card : ℝ) ^ 2 := by have hn : P.offDiag.card ≤ P.card * P.card := by rw [Finset.offDiag_card] omega have hnreal : (P.offDiag.card : ℝ) ≤ (P.card * P.card : ℕ) := by exact_mod_cast hn simpa [sq] using hnreal have hN2pos : 0 < (P.card : ℝ) ^ 2 := sq_pos_of_ne_zero (ne_of_gt hPpos_real) have hprod_lt : (P.card : ℝ) ^ 2 * exp (-((m : ℝ) * ε ^ 2 / r ^ 2)) < (P.card : ℝ) ^ 2 * exp (-(2 * log (P.card))) := mul_lt_mul_of_pos_left hexp_lt hN2pos have hexp_neg_eq : exp (-(2 * log (P.card))) = ((P.card : ℝ) ^ 2)⁻¹ := by rw [Real.exp_neg] have htwice : exp (2 * log (P.card)) = (P.card : ℝ) ^ 2 := by have hrewrite : 2 * log (P.card) = log (P.card) + log (P.card) := by ring rw [hrewrite, Real.exp_add, Real.exp_log hPpos_real] ring rw [htwice] have hprod_eq : (P.card : ℝ) ^ 2 * exp (-(2 * log (P.card))) = 1 := by rw [hexp_neg_eq] exact mul_inv_cancel₀ (ne_of_gt hN2pos) have hcardexp_le : (P.offDiag.card : ℝ) * exp (-(m : ℝ) * ε ^ 2 / r ^ 2) ≤ (P.card : ℝ) ^ 2 * exp (-(m : ℝ) * ε ^ 2 / r ^ 2) := by exact mul_le_mul_of_nonneg_right hoff_card (le_of_lt (Real.exp_pos _)) have hprod_lt_one : (P.card : ℝ) ^ 2 * exp (-(m : ℝ) * ε ^ 2 / r ^ 2) < 1 := by convert (by simpa [hprod_eq] using hprod_lt) using 2 ring_nf exact lt_of_le_of_lt (hmean_le.trans hcardexp_le) hprod_lt_one obtain ⟨J, hcnt_zero⟩ := averaging_exists_zero_count μ cnt hμsum hμnonneg hmean_lt_one refine ⟨m, J, hm_bound, ?_⟩ intro a haP b hbP hpat by_contra hab have hbad_mem : (a, b) ∈ P.offDiag.filter (fun ab => subsamplePattern J ab.1 = subsamplePattern J ab.2) := by rw [mem_filter] exact ⟨Finset.mem_offDiag.mpr ⟨haP, hbP, hab⟩, hpat⟩ have hcnt_pos : 0 < cnt J := by dsimp [cnt] exact Finset.card_pos.mpr ⟨(a, b), hbad_mem⟩ exact (Nat.ne_of_gt hcnt_pos) hcnt_zero
    Causalean.Stat.Concentration.finite_averaging_exists_separating_subsample · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:314
  • exists_separating_subsample lemma — Honest isolated core: the weighted random-coordinate extraction.
    n :
    d :
    w :
    Fin n → ℝ
    hw :
    ∀ j, 0 ≤ w j
    r ε :
    hr :
    0 < r
    :
    0 < ε
    hwsum :
    ∑ j, w j ≤ r ^ 2
    P :
    Finset (Fin n → Bool)
    hPcard :
    2 ≤ P.card
    hvc :
    (P.image (fun a => (Finset.univ.filter (fun j => a j = true)))).vcDim ≤ d
    hsep :
    ∀ a ∈ P, ∀ b ∈ P, a ≠ b → ε ^ 2 ≤ weightedHammingSq w a b
    ∃ (m : ℕ) (J : Fin m → Fin n),
    (m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * log (P.card) ∧
    (P.image (subsamplePattern J)).vcDim ≤ d ∧
    Proof (Lean source)
    lemma exists_separating_subsample {n : ℕ} (d : ℕ) (w : Fin n → ℝ) (hw : ∀ j, 0 ≤ w j) (r ε : ℝ) (hr : 0 < r) (hε : 0 < ε) (hwsum : ∑ j, w j ≤ r ^ 2) (P : Finset (Fin n → Bool)) (hPcard : 2 ≤ P.card) (hvc : (P.image (fun a => (Finset.univ.filter (fun j => a j = true)))).vcDim ≤ d) (hsep : ∀ a ∈ P, ∀ b ∈ P, a ≠ b → ε ^ 2 ≤ weightedHammingSq w a b) : ∃ (m : ℕ) (J : Fin m → Fin n), (m : ℝ) ≤ 1 + (2 * r ^ 2 / ε ^ 2) * log (P.card) ∧ (P.image (subsamplePattern J)).vcDim ≤ d ∧ InjOn (subsamplePattern J) ↑P := by obtain ⟨m, J, hm, hinj⟩ := finite_averaging_exists_separating_subsample w hw r ε hr hε hwsum P hPcard hsep exact ⟨m, J, hm, subsample_image_vcDim_le d J P hvc, hinj⟩
    Causalean.Stat.Concentration.exists_separating_subsample · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:523
  • self_log_solve lemma — A self-referential logarithmic inequality implies an explicit linear-log upper bound.
    a L :
    d :
    hd :
    1 ≤ d
    ha :
    2 ≤ a
    hL :
    0 ≤ L
    hbound :
    L ≤ (d : ℝ) * log (2 + a * L)
    L ≤ 1 + 2 * (d : ℝ) * log (2 * a * (d : ℝ))
    Proof (Lean source)
    lemma self_log_solve {a L : ℝ} {d : ℕ} (hd : 1 ≤ d) (ha : 2 ≤ a) (hL : 0 ≤ L) (hbound : L ≤ (d : ℝ) * log (2 + a * L)) : L ≤ 1 + 2 * (d : ℝ) * log (2 * a * (d : ℝ)) := by have hd_pos_nat : 0 < d := lt_of_lt_of_le Nat.zero_lt_one hd have hd_pos : 0 < (d : ℝ) := by exact_mod_cast hd_pos_nat have hd_nonneg : 0 ≤ (d : ℝ) := le_of_lt hd_pos have ha_pos : 0 < a := by linarith have ha_nonneg : 0 ≤ a := le_of_lt ha_pos have hy_pos : 0 < 2 + a * L := by have hmul_nonneg : 0 ≤ a * L := mul_nonneg ha_nonneg hL linarith have ht_pos : 0 < 2 * a * (d : ℝ) := by positivity have hlog_tangent : log (2 + a * L) ≤ (2 + a * L) / (2 * a * (d : ℝ)) + log (2 * a * (d : ℝ)) - 1 := by have hratio_pos : 0 < (2 + a * L) / (2 * a * (d : ℝ)) := div_pos hy_pos ht_pos have h0 := Real.log_le_sub_one_of_pos hratio_pos have hlog_div : log ((2 + a * L) / (2 * a * (d : ℝ))) = log (2 + a * L) - log (2 * a * (d : ℝ)) := by exact Real.log_div (ne_of_gt hy_pos) (ne_of_gt ht_pos) rw [hlog_div] at h0 linarith have hstep : L ≤ (d : ℝ) * ((2 + a * L) / (2 * a * (d : ℝ)) + log (2 * a * (d : ℝ)) - 1) := by exact le_trans hbound (mul_le_mul_of_nonneg_left hlog_tangent hd_nonneg) have hrewrite : (d : ℝ) * ((2 + a * L) / (2 * a * (d : ℝ)) + log (2 * a * (d : ℝ)) - 1) = 1 / a + L / 2 + (d : ℝ) * log (2 * a * (d : ℝ)) - (d : ℝ) := by field_simp [ne_of_gt ha_pos, ne_of_gt hd_pos] have hstep' : L ≤ 1 / a + L / 2 + (d : ℝ) * log (2 * a * (d : ℝ)) - (d : ℝ) := by rwa [hrewrite] at hstep have hdrop : L ≤ 1 / a + L / 2 + (d : ℝ) * log (2 * a * (d : ℝ)) := by linarith have hhalf' : L ≤ 2 * (1 / a + (d : ℝ) * log (2 * a * (d : ℝ))) := by linarith have hhalf : L ≤ 2 / a + 2 * (d : ℝ) * log (2 * a * (d : ℝ)) := by convert hhalf' using 1 ring have htwo_div_le_one : 2 / a ≤ 1 := (div_le_one ha_pos).2 ha linarith
    Causalean.Stat.Concentration.self_log_solve · Causalean/Stat/Concentration/Covering/HausslerPacking.lean:542
VCLocalized­Regime 11 core · 37 supporting For a binary-indexed function class of VC dimension d, the localized Rademacher complexity admits the linear sub-root envelope psi(r)=C*r*sqrt(d*log n/n), with critical radius of order sqrt(d*log n/n). ★ criticalRadius_vcLocalizedPsi_sq_le_rate

For a binary-indexed function class of VC dimension d, the localized Rademacher complexity admits the linear sub-root envelope psi(r)=C*r*sqrt(d*log n/n), with critical radius of order sqrt(d*log n/n).

This file packages the finite-VC localized regime used by localized_uniform_deviation_sharp. The elementary envelope facts are proved fully: linearity gives SubRoot, the critical radius is bounded by the slope, and the squared critical radius is bounded by the corresponding d * log n / n rate. The empirical-process step is packaged in vc_starHullZeroOut_empirical_rademacher_le_linear and its cardinality-bound variant, which prove sample-path Dudley/VC covering-inflation bounds for the localized star-hull-zeroed class. The file then lifts those sample-path bounds to population Rademacher upper bounds, vcLocalizedEnvelope, and the vcLocalizedRegime bundles consumed by localized uniform-deviation theorems.

structure BinaryFactoredVCClass reviewed
Causalean.Stat.Concentration

A binary factorization of a real-valued function class through a Boolean labeling π, such that on every finite sample each function's values factor through the Boolean labels, and whose realized Boolean patterns have VC dimension at most d on every finite sample.

Definition (Lean source)
F :
ι → 𝒳 → ℝ
d :
The Boolean class through which `F` factors on samples.
π :
ι → 𝒳 → Bool
Samplewise factorization through the Boolean labels.
factor :
∀ {n : ℕ} (S : Fin n → 𝒳), ∃ φ : Fin n → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))
Uniform VC dimension bound for the realized growth family.
vcDim_le :
∀ {n : ℕ} (S : Fin n → 𝒳), (growthFamily π S).vcDim ≤ d
Causalean.Stat.Concentration.BinaryFactoredVCClass · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:40
structure LocalizedVCDudleyHypotheses reviewed
Causalean.Stat.Concentration

The deterministic prerequisites used to run the Dudley entropy-integral step after localization: a samplewise L2L^2 radius bound on the localized star-hull-zeroed class, needed to run Dudley with c=rc = r, and a total-boundedness (covering-number) precondition on that same localized class.

Definition (Lean source)
F :
ι → 𝒳 → ℝ
norm :
(𝒳 → ℝ) → ℝ
empirical_radius :
∀ {n : ℕ} (S : Fin n → 𝒳) {r : ℝ}
if
0 ≤ r
then
∀ p : starHullParam ι, empiricalNorm S (starHullZeroOut F norm r p) ≤ r
totallyBounded :
∀ {n : ℕ} (S : Fin n → 𝒳) {r : ℝ}
if
0 < r
Causalean.Stat.Concentration.LocalizedVCDudleyHypotheses · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:54
def vcLocalizedSlope reviewed
Causalean.Stat.Concentration

The finite-VC localized slope is the sample-size dependent coefficient in the linear localized Rademacher envelope.

Definition (Lean source)
noncomputable def vcLocalizedSlope (K : ℝ) (d n : ℕ) : ℝ := 6 * sqrt ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ))
Causalean.Stat.Concentration.vcLocalizedSlope · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:246
def vcLocalizedPsi reviewed
Causalean.Stat.Concentration

The finite-VC localized envelope maps a radius to the slope times that radius.

Definition (Lean source)
noncomputable def vcLocalizedPsi (K : ℝ) (d n : ℕ) : ℝ → ℝ := fun r => vcLocalizedSlope K d n * r
Causalean.Stat.Concentration.vcLocalizedPsi · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:254
lemma criticalRadius_vcLocalizedPsi_sq_le_rate reviewed
Causalean.Stat.Concentration

Rate bound for the finite-VC critical radius. For a nonnegative localization constant K and a positive sample size n, the squared critical radius of the finite-VC localized envelope vcLocalizedPsi K d n is at most 36·(K·d·log(n+1)+1)/n — the advertised (d·log n)/n-order bound.

Formal statement
K :
d n :
hK :
0 ≤ K
hn :
0 < n
≤ 36 * ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ))
Proof (Lean source)
lemma criticalRadius_vcLocalizedPsi_sq_le_rate {K : ℝ} {d n : ℕ} (hK : 0 ≤ K) (hn : 0 < n) : (criticalRadius (vcLocalizedPsi K d n)) ^ 2 ≤ 36 * ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ)) := by calc (criticalRadius (vcLocalizedPsi K d n)) ^ 2 ≤ (vcLocalizedSlope K d n) ^ 2 := criticalRadius_vcLocalizedPsi_sq_le hK hn _ = 36 * ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ)) := vcLocalizedSlope_sq hK
Causalean.Stat.Concentration.criticalRadius_vcLocalizedPsi_sq_le_rate · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:365 · uses criticalRadius , vcLocalizedPsi
def BinaryTraceEntropyControl reviewed
Causalean.Stat.Concentration

Binary trace entropy evidence used by the shared localized star-hull Dudley residual.

Definition (Lean source)
def BinaryTraceEntropyControl (π : ι → 𝒳 → Bool) (d : ℕ) : Prop := (∀ {m : ℕ} (S : Fin m → 𝒳), (growthFamily π S).vcDim ≤ d) ∨ (∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ d)
Causalean.Stat.Concentration.BinaryTraceEntropyControl · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:388
def growthFamilyRep reviewed
Causalean.Stat.Concentration

A representative classifier index is chosen for each realized Boolean growth-family pattern.

Definition (Lean source)
noncomputable def growthFamilyRep {ι 𝒳 : Type*} {n : ℕ} (π : ι → 𝒳 → Bool) (S : Fin n → 𝒳) (A : {A // A ∈ growthFamily π S}) : ι := choose ((mem_growthFamily_iff (π := π) (S := S) (A := A.1)).mp A.2)
Causalean.Stat.Concentration.growthFamilyRep · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:643 · uses growthFamily
def starHullPatternCoeff reviewed
Causalean.Stat.Concentration

The star-hull pattern coefficient is the largest active scale among functions with the same realized Boolean pattern.

Definition (Lean source)
noncomputable def starHullPatternCoeff {ι 𝒳 : Type*} {n : ℕ} (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (S : Fin n → 𝒳) (r : ℝ) (A : {A // A ∈ growthFamily π S}) : ℝ := ⨆ i : {i : ι // restrictionPattern (π i) S = A.1}, starHullZeroOutScaleCoeff F norm r i.1
Causalean.Stat.Concentration.starHullPatternCoeff · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:657 · uses growthFamily
def starHullPatternClass reviewed
Causalean.Stat.Concentration

The star-hull pattern class assigns each realized Boolean pattern its representative function multiplied by the pattern coefficient.

Definition (Lean source)
noncomputable def starHullPatternClass {ι 𝒳 : Type*} {n : ℕ} (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (S : Fin n → 𝒳) (r : ℝ) : {A // A ∈ growthFamily π S} → 𝒳 → ℝ := fun A x => starHullPatternCoeff F norm π S r A * F (growthFamilyRep π S A) x
Causalean.Stat.Concentration.starHullPatternClass · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:666 · uses growthFamily
def vcLocalizedRegime reviewed
Causalean.Stat.Concentration

Build the LocalizedRegime bundle for the localized-deviation theorems from a bounded finite-VC class and the finite-VC localized envelope.

Definition (Lean source)
noncomputable def vcLocalizedRegime (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (μ : Measure Ω) (X : Ω → 𝒳) [IsProbabilityMeasure μ] (b : ℝ) (hb : 0 ≤ b) (hbound : ∀ i ω, |F i (X ω)| ≤ b) (K : ℝ) (d : ℕ) (hK : (1 : ℝ) ≤ K) (Hvc : BinaryFactoredVCClass F d) (Hloc : LocalizedVCDudleyHypotheses F norm) : LocalizedRegime Ω ι 𝒳 F norm μ X where b := b b_nonneg := hb bound := hbound ψ := fun n => vcLocalizedPsi K d n ψ_subRoot := fun n => vcLocalizedPsi_subRoot K d n ψ_ub := fun n => vcLocalizedRademacherUpperBound F norm μ X K d n hK Hvc Hloc
def vcLocalizedRegime_of_card reviewed
Causalean.Stat.Concentration

Build the LocalizedRegime bundle from a direct growth-cardinality bound on the binary trace family.

Definition (Lean source)
noncomputable def vcLocalizedRegime_of_card (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (μ : Measure Ω) (X : Ω → 𝒳) [IsProbabilityMeasure μ] (b : ℝ) (hb : 0 ≤ b) (hbound : ∀ i ω, |F i (X ω)| ≤ b) (hfactor : ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))) (K : ℝ) (dPi : ℕ) (hK : (1 : ℝ) ≤ K) (hcard : ∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPi) (Hloc : LocalizedVCDudleyHypotheses F norm) : LocalizedRegime Ω ι 𝒳 F norm μ X where b := b b_nonneg := hb bound := hbound ψ := fun n => vcLocalizedPsi K dPi n ψ_subRoot := fun n => vcLocalizedPsi_subRoot K dPi n ψ_ub := fun n => vcLocalizedRademacherUpperBound_of_card F norm π μ X hfactor K dPi n hK hcard Hloc
37 supporting declarations (lemmas, instances)
  • abs_starHullZeroOut_le_of_bound lemma — If every function in a class is pointwise bounded in absolute value by a common constant, then every zeroed localized star-hull function has the same bound at every point.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    B r :
    hbound :
    ∀ i x, |F i x| ≤ B
    p :
    x :
    𝒳
    |starHullZeroOut F norm r p x| ≤ B
    Proof (Lean source)
    lemma abs_starHullZeroOut_le_of_bound {F : ι → 𝒳 → ℝ} {norm : (𝒳 → ℝ) → ℝ} {B r : ℝ} (hbound : ∀ i x, |F i x| ≤ B) (p : starHullParam ι) (x : 𝒳) : |starHullZeroOut F norm r p x| ≤ B := by rcases p with ⟨a, i⟩ by_cases hactive : norm (starHullEval F (a, i)) ≤ r · calc |starHullZeroOut F norm r (a, i) x| = |(a : ℝ) * F i x| := by simp [starHullZeroOut, hactive, starHullEval] _ = (a : ℝ) * |F i x| := by rw [abs_mul, abs_of_nonneg a.property.1] _ ≤ 1 * |F i x| := mul_le_mul_of_nonneg_right a.property.2 (abs_nonneg _) _ ≤ B := by simpa using hbound i x · have hB : 0 ≤ B := (abs_nonneg (F i x)).trans (hbound i x) simpa [starHullZeroOut, hactive] using hB
    Causalean.Stat.Concentration.abs_starHullZeroOut_le_of_bound · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:71
  • empiricalNorm_le_of_forall_abs_le lemma — A function whose absolute value is bounded at every point of a finite sample has empirical root-mean-square norm no larger than that bound.
    n :
    S :
    Fin n → 𝒳
    f :
    𝒳 → ℝ
    η :
    :
    0 ≤ η
    hf :
    ∀ j : Fin n, |f (S j)| ≤ η
    empiricalNorm S f ≤ η
    Proof (Lean source)
    lemma empiricalNorm_le_of_forall_abs_le {n : ℕ} (S : Fin n → 𝒳) {f : 𝒳 → ℝ} {η : ℝ} (hη : 0 ≤ η) (hf : ∀ j : Fin n, |f (S j)| ≤ η) : empiricalNorm S f ≤ η := by classical by_cases hn : n = 0 · simp [empiricalNorm, hn, hη] · have hnpos : 0 < n := Nat.pos_of_ne_zero hn have hnR : 0 < (n : ℝ) := by exact_mod_cast hnpos have hsum : (∑ j : Fin n, (f (S j)) ^ 2) ≤ ∑ _j : Fin n, η ^ 2 := by refine Finset.sum_le_sum ?_ intro j _ calc (f (S j)) ^ 2 = |f (S j)| ^ 2 := by rw [sq_abs] _ ≤ η ^ 2 := sq_le_sq.mpr (by simpa [abs_of_nonneg hη] using hf j) have harg : (1 / (n : ℝ)) * ∑ j : Fin n, (f (S j)) ^ 2 ≤ η ^ 2 := by calc (1 / (n : ℝ)) * ∑ j : Fin n, (f (S j)) ^ 2 ≤ (1 / (n : ℝ)) * ∑ _j : Fin n, η ^ 2 := mul_le_mul_of_nonneg_left hsum (by positivity) _ = (1 / (n : ℝ)) * ((n : ℝ) * η ^ 2) := by simp _ = η ^ 2 := by field_simp [Finset.card_fin, hnR.ne'] calc empiricalNorm S f = sqrt ((1 / (n : ℝ)) * ∑ j : Fin n, (f (S j)) ^ 2) := rfl _ ≤ sqrt (η ^ 2) := Real.sqrt_le_sqrt harg _ = η := by rw [Real.sqrt_sq_eq_abs, abs_of_nonneg hη]
    Causalean.Stat.Concentration.empiricalNorm_le_of_forall_abs_le · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:91
  • empiricalFunctionSpace_dist_le_of_forall_abs_sub_le lemma — If two functions differ by at most a nonnegative amount at every observation in a finite sample, then their empirical distance is at most that amount.
    G :
    starHullParam ι → 𝒳 → ℝ
    n :
    Fin n → 𝒳
    η :
    :
    0 ≤ η
    hcoord :
    ∀ j : Fin n, |G q.index (S j) - G q'.index (S j)| ≤ η
    dist q q' ≤ η
    Proof (Lean source)
    lemma empiricalFunctionSpace_dist_le_of_forall_abs_sub_le {G : starHullParam ι → 𝒳 → ℝ} {n : ℕ} {S : Fin n → 𝒳} (q q' : EmpiricalFunctionSpace G S) {η : ℝ} (hη : 0 ≤ η) (hcoord : ∀ j : Fin n, |G q.index (S j) - G q'.index (S j)| ≤ η) : dist q q' ≤ η := by have hnorm : empiricalNorm S ((q : 𝒳 → ℝ) - (q' : 𝒳 → ℝ)) ≤ η := empiricalNorm_le_of_forall_abs_le S hη (by intro j simpa [Pi.sub_apply] using hcoord j) simpa [instDistEmpiricalFunctionSpace, empiricalDist] using hnorm
    Causalean.Stat.Concentration.empiricalFunctionSpace_dist_le_of_forall_abs_sub_le · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:126
  • starHullZeroOut_totallyBounded_of_bounded lemma — A uniformly bounded function class has a totally bounded empirical image on every finite sample after taking its zeroed star hull.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    B :
    hbound :
    ∀ i x, |F i x| ≤ B
    n :
    S :
    Fin n → 𝒳
    r :
    Proof (Lean source)
    lemma starHullZeroOut_totallyBounded_of_bounded {F : ι → 𝒳 → ℝ} {norm : (𝒳 → ℝ) → ℝ} {B : ℝ} (hbound : ∀ i x, |F i x| ≤ B) {n : ℕ} (S : Fin n → 𝒳) {r : ℝ} : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace (starHullZeroOut F norm r) S)) := by classical let sampleVector : EmpiricalFunctionSpace (starHullZeroOut F norm r) S → Fin n → ℝ := fun q j => starHullZeroOut F norm r q.index (S j) have hcube : TotallyBounded (Icc (fun _ : Fin n => -B) (fun _ : Fin n => B) : Set (Fin n → ℝ)) := isCompact_Icc.totallyBounded refine Metric.totallyBounded_of_finite_discretization (s := (Set.univ : Set (EmpiricalFunctionSpace (starHullZeroOut F norm r) S))) ?_ intro ε hε let δ : ℝ := ε / 4 have hδ : 0 < δ := by positivity rcases Metric.finite_approx_of_totallyBounded hcube δ hδ with ⟨t, ht_subset, ht_finite, ht_cover⟩ have hmem_cube : ∀ q : (Set.univ : Set (EmpiricalFunctionSpace (starHullZeroOut F norm r) S)), sampleVector q.1 ∈ (Icc (fun _ : Fin n => -B) (fun _ : Fin n => B) : Set (Fin n → ℝ)) := by intro q constructor · intro j exact neg_le_of_abs_le (abs_starHullZeroOut_le_of_bound hbound q.1.index (S j)) · intro j exact le_of_abs_le (abs_starHullZeroOut_le_of_bound hbound q.1.index (S j)) have hnear : ∀ q : (Set.univ : Set (EmpiricalFunctionSpace (starHullZeroOut F norm r) S)), ∃ y : (t : Set (Fin n → ℝ)), dist (sampleVector q.1) y.1 < δ := by intro q have hq := ht_cover (hmem_cube q) simp only [Set.mem_iUnion, Metric.mem_ball] at hq rcases hq with ⟨y, hy_t, hy_dist⟩ exact ⟨⟨y, hy_t⟩, hy_dist⟩ let domain : Set (EmpiricalFunctionSpace (starHullZeroOut F norm r) S) := Set.univ let center0 : domain → (t : Set (Fin n → ℝ)) := fun q => choose (hnear q) let center : domain → ULift.{u} (t : Set (Fin n → ℝ)) := fun q => ULift.up (center0 q) haveI : Fintype (t : Set (Fin n → ℝ)) := ht_finite.fintype refine ⟨ULift.{u} (t : Set (Fin n → ℝ)), inferInstance, center, ?_⟩ intro q q' hcenter have hcenter0 : center0 q = center0 q' := by simpa [center] using congrArg ULift.down hcenter have hq_near : dist (sampleVector q.1) (center0 q).1 < δ := Classical.choose_spec (hnear q) have hq'_near : dist (sampleVector q'.1) (center0 q').1 < δ := Classical.choose_spec (hnear q') have hcoord : ∀ j : Fin n, |starHullZeroOut F norm r q.1.index (S j) - starHullZeroOut F norm r q'.1.index (S j)| ≤ ε / 2 := by intro j have hjq : dist (sampleVector q.1 j) ((center0 q).1 j) < δ := (dist_le_pi_dist (sampleVector q.1) (center0 q).1 j).trans_lt hq_near have hjq' : dist ((center0 q).1 j) (sampleVector q'.1 j) < δ := by rw [← hcenter0] at hq'_near simpa [dist_comm] using (dist_le_pi_dist (sampleVector q'.1) (center0 q).1 j).trans_lt hq'_near have hsum : dist (sampleVector q.1 j) (sampleVector q'.1 j) < ε / 2 := by calc dist (sampleVector q.1 j) (sampleVector q'.1 j) ≤ dist (sampleVector q.1 j) ((center0 q).1 j) + dist ((center0 q).1 j) (sampleVector q'.1 j) := dist_triangle _ _ _ _ < δ + δ := add_lt_add hjq hjq' _ = ε / 2 := by ring simpa [Real.dist_eq] using le_of_lt hsum have hdist_le : dist q.1 q'.1 ≤ ε / 2 := empiricalFunctionSpace_dist_le_of_forall_abs_sub_le q.1 q'.1 (by positivity) hcoord exact lt_of_le_of_lt hdist_le (by linarith)
    Causalean.Stat.Concentration.starHullZeroOut_totallyBounded_of_bounded · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:140
  • localizedVCDudleyHypotheses_of_empiricalRadius theorem — Assemble the deterministic localized Dudley hypotheses for a bounded binary-factored VC class once the samplewise empirical-radius bridge is known.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    B :
    hbound :
    ∀ i x, |F i x| ≤ B
    empirical_radius :
    ∀ {n : ℕ} (S : Fin n → 𝒳) {r : ℝ}
    if
    0 ≤ r
    then
    ∀ p : starHullParam ι, empiricalNorm S (starHullZeroOut F norm r p) ≤ r
    LocalizedVCDudleyHypotheses F norm where empirical_radius
    Proof (Lean source)
    theorem localizedVCDudleyHypotheses_of_empiricalRadius {F : ι → 𝒳 → ℝ} {norm : (𝒳 → ℝ) → ℝ} {B : ℝ} (hbound : ∀ i x, |F i x| ≤ B) (empirical_radius : ∀ {n : ℕ} (S : Fin n → 𝒳) {r : ℝ}, 0 ≤ r → ∀ p : starHullParam ι, empiricalNorm S (starHullZeroOut F norm r p) ≤ r) : LocalizedVCDudleyHypotheses F norm where empirical_radius := empirical_radius totallyBounded := fun {_} S {_} _ => starHullZeroOut_totallyBounded_of_bounded hbound S
    Causalean.Stat.Concentration.localizedVCDudleyHypotheses_of_empiricalRadius · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:229
  • vcLocalizedRate_nonneg lemma — The rate inside vcLocalizedSlope is nonnegative when K ≥ 0.
    K :
    d n :
    hK :
    0 ≤ K
    0 ≤ (K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ)
    Proof (Lean source)
    lemma vcLocalizedRate_nonneg {K : ℝ} {d n : ℕ} (hK : 0 ≤ K) : 0 ≤ (K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ) := by by_cases hn : n = 0 · simp [hn] · have hn_pos : 0 < n := Nat.pos_of_ne_zero hn have hnR : 0 < (n : ℝ) := by exact_mod_cast hn_pos have hone_le : (1 : ℝ) ≤ (n : ℝ) + 1 := by linarith [le_of_lt hnR] have hlog : 0 ≤ log ((n : ℝ) + 1) := Real.log_nonneg hone_le have hterm : 0 ≤ K * (d : ℝ) * log ((n : ℝ) + 1) := by exact mul_nonneg (mul_nonneg hK (Nat.cast_nonneg d)) hlog have hnum : 0 ≤ K * (d : ℝ) * log ((n : ℝ) + 1) + 1 := by linarith exact div_nonneg hnum (le_of_lt hnR)
    Causalean.Stat.Concentration.vcLocalizedRate_nonneg · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:263
  • vcLocalizedSlope_nonneg lemma — The finite-VC slope is nonnegative.
    K :
    d n :
    0 ≤ vcLocalizedSlope K d n
    Proof (Lean source)
    lemma vcLocalizedSlope_nonneg (K : ℝ) (d n : ℕ) : 0 ≤ vcLocalizedSlope K d n := by unfold vcLocalizedSlope positivity
    Causalean.Stat.Concentration.vcLocalizedSlope_nonneg · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:279
  • vcLocalizedSlope_pos lemma — If K ≥ 0 and n > 0, the finite-VC slope is strictly positive.
    K :
    d n :
    hK :
    0 ≤ K
    hn :
    0 < n
    Proof (Lean source)
    lemma vcLocalizedSlope_pos {K : ℝ} {d n : ℕ} (hK : 0 ≤ K) (hn : 0 < n) : 0 < vcLocalizedSlope K d n := by unfold vcLocalizedSlope have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hone_le : (1 : ℝ) ≤ (n : ℝ) + 1 := by linarith [le_of_lt hnR] have hlog : 0 ≤ log ((n : ℝ) + 1) := Real.log_nonneg hone_le have hterm : 0 ≤ K * (d : ℝ) * log ((n : ℝ) + 1) := by exact mul_nonneg (mul_nonneg hK (Nat.cast_nonneg d)) hlog have hnum : 0 < K * (d : ℝ) * log ((n : ℝ) + 1) + 1 := by linarith have hfrac : 0 < (K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ) := div_pos hnum hnR have hsqrt : 0 < sqrt ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ)) := Real.sqrt_pos.mpr hfrac nlinarith
    Causalean.Stat.Concentration.vcLocalizedSlope_pos · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:285
  • vcLocalizedSlope_sq lemma — The exact square of the finite-VC slope.
    K :
    d n :
    hK :
    0 ≤ K
    vcLocalizedSlope K d n ^ 2 = 36 * ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ))
    Proof (Lean source)
    lemma vcLocalizedSlope_sq {K : ℝ} {d n : ℕ} (hK : 0 ≤ K) : vcLocalizedSlope K d n ^ 2 = 36 * ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ)) := by unfold vcLocalizedSlope rw [mul_pow, Real.sq_sqrt (vcLocalizedRate_nonneg (K := K) (d := d) (n := n) hK)] ring
    Causalean.Stat.Concentration.vcLocalizedSlope_sq · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:306
  • linear_subRoot lemma — A nonnegative linear function is sub-root.
    C :
    hC :
    0 ≤ C
    SubRoot (fun r : ℝ => C * r)
    Proof (Lean source)
    lemma linear_subRoot {C : ℝ} (hC : 0 ≤ C) : SubRoot (fun r : ℝ => C * r) := by refine ⟨?_, ?_, ?_⟩ · intro r hr exact mul_nonneg hC hr · intro r₁ r₂ _ hr₁₂ exact mul_le_mul_of_nonneg_left hr₁₂ hC · intro r₁ r₂ hr₁ hr₁₂ have hr₂ : 0 < r₂ := lt_of_lt_of_le hr₁ hr₁₂ have h₁ : C * r₁ / r₁ = C := by field_simp [ne_of_gt hr₁] have h₂ : C * r₂ / r₂ = C := by field_simp [ne_of_gt hr₂] rw [h₁, h₂]
    Causalean.Stat.Concentration.linear_subRoot · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:314
  • vcLocalizedPsi_subRoot lemma — The finite-VC localized envelope is sub-root.
    K :
    d n :
    Proof (Lean source)
    lemma vcLocalizedPsi_subRoot (K : ℝ) (d n : ℕ) : SubRoot (vcLocalizedPsi K d n) := by unfold vcLocalizedPsi exact linear_subRoot (vcLocalizedSlope_nonneg K d n)
    Causalean.Stat.Concentration.vcLocalizedPsi_subRoot · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:327
  • criticalRadius_linear_le lemma — The critical radius of a positive-slope linear envelope is at most its slope.
    C :
    hC :
    0 < C
    criticalRadius (fun r : ℝ => C * r) ≤ C
    Proof (Lean source)
    lemma criticalRadius_linear_le {C : ℝ} (hC : 0 < C) : criticalRadius (fun r : ℝ => C * r) ≤ C := by apply criticalRadius_le hC rw [pow_two]
    Causalean.Stat.Concentration.criticalRadius_linear_le · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:333
  • criticalRadius_linear_sq_le lemma — The squared critical radius of a positive-slope linear envelope is at most the squared slope.
    C :
    hC :
    0 < C
    (criticalRadius (fun r : ℝ => C * r)) ^ 2 ≤ C ^ 2
    Proof (Lean source)
    lemma criticalRadius_linear_sq_le {C : ℝ} (hC : 0 < C) : (criticalRadius (fun r : ℝ => C * r)) ^ 2 ≤ C ^ 2 := by have hle : criticalRadius (fun r : ℝ => C * r) ≤ C := criticalRadius_linear_le hC have hnonneg : 0 ≤ criticalRadius (fun r : ℝ => C * r) := criticalRadius_nonneg _ nlinarith
    Causalean.Stat.Concentration.criticalRadius_linear_sq_le · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:340
  • criticalRadius_vcLocalizedPsi_le lemma — The finite-VC critical radius is bounded by the finite-VC slope.
    K :
    d n :
    hK :
    0 ≤ K
    hn :
    0 < n
    Proof (Lean source)
    lemma criticalRadius_vcLocalizedPsi_le {K : ℝ} {d n : ℕ} (hK : 0 ≤ K) (hn : 0 < n) : criticalRadius (vcLocalizedPsi K d n) ≤ vcLocalizedSlope K d n := by unfold vcLocalizedPsi exact criticalRadius_linear_le (vcLocalizedSlope_pos hK hn)
    Causalean.Stat.Concentration.criticalRadius_vcLocalizedPsi_le · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:350
  • criticalRadius_vcLocalizedPsi_sq_le lemma — The finite-VC squared critical radius is bounded by the squared slope.
    K :
    d n :
    hK :
    0 ≤ K
    hn :
    0 < n
    (criticalRadius (vcLocalizedPsi K d n)) ^ 2 ≤ (vcLocalizedSlope K d n) ^ 2
    Proof (Lean source)
    lemma criticalRadius_vcLocalizedPsi_sq_le {K : ℝ} {d n : ℕ} (hK : 0 ≤ K) (hn : 0 < n) : (criticalRadius (vcLocalizedPsi K d n)) ^ 2 ≤ (vcLocalizedSlope K d n) ^ 2 := by unfold vcLocalizedPsi exact criticalRadius_linear_sq_le (vcLocalizedSlope_pos hK hn)
    Causalean.Stat.Concentration.criticalRadius_vcLocalizedPsi_sq_le · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:357
  • growthFamily_card_le_succ_pow_of_trace lemma — A Boolean class whose trace family has bounded VC dimension, or a direct trace-size bound, realizes no more patterns on a finite sample than a polynomial of degree d in one plus the sample size.
    π :
    ι → 𝒳 → Bool
    d n :
    S :
    Fin n → 𝒳
    (growthFamily π S).card ≤ (n + 1) ^ d
    Proof (Lean source)
    lemma growthFamily_card_le_succ_pow_of_trace (π : ι → 𝒳 → Bool) (d n : ℕ) (Htrace : BinaryTraceEntropyControl π d) (S : Fin n → 𝒳) : (growthFamily π S).card ≤ (n + 1) ^ d := by rcases Htrace with hvc | hcard · exact le_trans (card_growthFamily_le_sum_choose (growthFamily π S) (hvc S)) (sum_choose_le_succ_pow n d) · exact hcard n S
    Causalean.Stat.Concentration.growthFamily_card_le_succ_pow_of_trace · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:399
  • log_two_growth_card_le lemma — When a Boolean growth family on a sample has positive cardinality and at most the degree-d polynomial number of patterns in one plus the sample size, twice the logarithm of twice its cardinality is no greater than twice that degree times the logarithm of one plus the sample size, plus two.
    π :
    ι → 𝒳 → Bool
    d n :
    S :
    Fin n → 𝒳
    hcard_pos :
    0 < (growthFamily π S).card
    hcard :
    (growthFamily π S).card ≤ (n + 1) ^ d
    2 * log (2 * ((growthFamily π S).card : ℝ))
    ≤ 2 * (d : ℝ) * log ((n : ℝ) + 1) + 2
    Proof (Lean source)
    lemma log_two_growth_card_le (π : ι → 𝒳 → Bool) (d n : ℕ) (S : Fin n → 𝒳) (hcard_pos : 0 < (growthFamily π S).card) (hcard : (growthFamily π S).card ≤ (n + 1) ^ d) : 2 * log (2 * ((growthFamily π S).card : ℝ)) ≤ 2 * (d : ℝ) * log ((n : ℝ) + 1) + 2 := by let N : ℕ := (growthFamily π S).card let M : ℕ := (n + 1) ^ d have hleR : (2 : ℝ) * N ≤ 2 * M := by exact_mod_cast (Nat.mul_le_mul_left 2 hcard) have hlog_le : log (2 * (N : ℝ)) ≤ log (2 * (M : ℝ)) := by exact Real.log_le_log (by positivity) hleR have hlogM : log (2 * (M : ℝ)) = log 2 + (d : ℝ) * log ((n : ℝ) + 1) := by dsimp [M] norm_num only [Nat.cast_pow, Nat.cast_add, cast_one] rw [Real.log_mul] · rw [Real.log_pow] · norm_num · positivity have hlog2 : log 2 ≤ (1 : ℝ) := by have h := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 2) linarith dsimp [N] at hlog_le nlinarith
    Causalean.Stat.Concentration.log_two_growth_card_le · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:413
  • empiricalRademacher_withAbs_finiteClass_le lemma — The absolute empirical Rademacher complexity of a finite class is bounded by a Massart logarithmic factor times a common radius.
    ι' Z :
    Type*
    m :
    hm :
    0 < m
    H :
    ι' → Z → ℝ
    S' :
    Fin m → Z
    f :
    Finset ι'
    hf :
    f.Nonempty
    ρ :
    hradius :
    ∀ i ∈ f, sqrt (∑ k : Fin m, ((m : ℝ)⁻¹ * |H i (S' k)|) ^ 2) ≤ ρ
    empiricalRademacherComplexity m (F_on H f) S'
    ≤ ρ * sqrt (2 * log (2 * (f.card : ℝ)))
    Proof (Lean source)
    lemma empiricalRademacher_withAbs_finiteClass_le {ι' Z : Type*} {m : ℕ} (hm : 0 < m) (H : ι' → Z → ℝ) (S' : Fin m → Z) (f : Finset ι') (hf : f.Nonempty) (ρ : ℝ) (hradius : ∀ i ∈ f, sqrt (∑ k : Fin m, ((m : ℝ)⁻¹ * |H i (S' k)|) ^ 2) ≤ ρ) : empiricalRademacherComplexity m (F_on H f) S' ≤ ρ * sqrt (2 * log (2 * (f.card : ℝ))) := by classical let Hd : ι' × Bool → Z → ℝ := fun jb z => if jb.2 then H jb.1 z else -H jb.1 z let fd : Finset (ι' × Bool) := f.product (Finset.univ : Finset Bool) have hfd_nonempty : fd.Nonempty := by rcases hf with ⟨i, hi⟩ refine ⟨(i, true), ?_⟩ simp [fd, hi] have hpoint : empiricalRademacherComplexity m (F_on H f) S' ≤ empiricalRademacherComplexity_without_abs m (F_on Hd fd) S' := by haveI : Nonempty {j // j ∈ f} := by rcases hf with ⟨i, hi⟩ exact ⟨⟨i, hi⟩⟩ unfold empiricalRademacherComplexity empiricalRademacherComplexity_without_abs refine mul_le_mul_of_nonneg_left ?_ (by positivity) refine Finset.sum_le_sum ?_ intro σ _ refine ciSup_le ?_ intro j let x : ℝ := (m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * F_on H f j (S' k) have htrue : x = (m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * F_on Hd fd ⟨(j.1, true), by simp [fd, j.2]⟩ (S' k) := by simp [x, Hd, F_on] have hfalse : -x = (m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * F_on Hd fd ⟨(j.1, false), by simp [fd, j.2]⟩ (S' k) := by simp [x, Hd, F_on, Finset.mul_sum] have hle_true : x ≤ ⨆ jb : {jb // jb ∈ fd}, (m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * F_on Hd fd jb (S' k) := by rw [htrue] exact le_ciSup (Finite.bddAbove_range fun jb : {jb // jb ∈ fd} => (m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * F_on Hd fd jb (S' k)) ⟨(j.1, true), by simp [fd, j.2]⟩ have hle_false : -x ≤ ⨆ jb : {jb // jb ∈ fd}, (m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * F_on Hd fd jb (S' k) := by rw [hfalse] exact le_ciSup (Finite.bddAbove_range fun jb : {jb // jb ∈ fd} => (m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * F_on Hd fd jb (S' k)) ⟨(j.1, false), by simp [fd, j.2]⟩ have hlower : -(⨆ jb : {jb // jb ∈ fd}, (m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * F_on Hd fd jb (S' k)) ≤ x := by linarith simpa [x] using abs_le.mpr ⟨hlower, hle_true⟩ have hpointwise : ∀ i ∈ fd, ∀ j : Fin m, |Hd i (S' j)| ≤ (m : ℝ) * ρ := by intro i hi j rcases i with ⟨i, b⟩ have hi_f : i ∈ f := by simpa [fd] using (Finset.mem_product.mp hi).1 have hterm : ((m : ℝ)⁻¹ * |H i (S' j)|) ^ 2 ≤ ∑ k : Fin m, ((m : ℝ)⁻¹ * |H i (S' k)|) ^ 2 := by exact Finset.single_le_sum (s := (Finset.univ : Finset (Fin m))) (f := fun k : Fin m => ((m : ℝ)⁻¹ * |H i (S' k)|) ^ 2) (by intro k _; exact sq_nonneg _) (by simp) have hscaled : (m : ℝ)⁻¹ * |H i (S' j)| ≤ ρ := by have hsqrt := (Real.sqrt_le_sqrt hterm).trans (hradius i hi_f) have hnonneg : 0 ≤ (m : ℝ)⁻¹ * |H i (S' j)| := by exact mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg m)) (abs_nonneg _) simpa [Real.sqrt_sq_eq_abs, abs_of_nonneg hnonneg] using hsqrt have hmR : 0 < (m : ℝ) := by exact_mod_cast hm have hmul := mul_le_mul_of_nonneg_left hscaled (le_of_lt hmR) have hcancel : (m : ℝ) * ((m : ℝ)⁻¹ * |H i (S' j)|) = |H i (S' j)| := by field_simp [ne_of_gt hmR] have hH : |H i (S' j)| ≤ (m : ℝ) * ρ := by simpa [hcancel, mul_assoc] using hmul by_cases hb : b = true · simp [Hd, hb, hH] · have hbfalse : b = false := by cases b <;> simp at hb ⊢ simpa [Hd, hbfalse, abs_neg] using hH have hmass : empiricalRademacherComplexity_without_abs m (F_on Hd fd) S' ≤ (sup' fd hfd_nonempty fun j => sqrt (∑ i : Fin m, ((m : ℝ)⁻¹ * |Hd j (S' i)|) ^ 2)) * sqrt (2 * log fd.card) := by rw [empiricalRademacherComplexity_without_abs_eq_empiricalRademacherComplexity_pmf_without_abs] exact massart_lemma_pmf (F := Hd) (S := S') fd hfd_nonempty have hsup : (sup' fd hfd_nonempty fun j => sqrt (∑ i : Fin m, ((m : ℝ)⁻¹ * |Hd j (S' i)|) ^ 2)) ≤ ρ := by refine Finset.sup'_le _ _ ?_ intro jb hjb rcases jb with ⟨i, b⟩ have hi_f : i ∈ f := by simpa [fd] using (Finset.mem_product.mp hjb).1 by_cases hb : b = true · simpa [Hd, hb] using hradius i hi_f · have hbfalse : b = false := by cases b <;> simp at hb ⊢ simpa [Hd, hbfalse, abs_neg] using hradius i hi_f have hcard : (fd.card : ℝ) = 2 * (f.card : ℝ) := by simp [fd, Nat.cast_mul, mul_comm] calc empiricalRademacherComplexity m (F_on H f) S' ≤ empiricalRademacherComplexity_without_abs m (F_on Hd fd) S' := hpoint _ ≤ (sup' fd hfd_nonempty fun j => sqrt (∑ i : Fin m, ((m : ℝ)⁻¹ * |Hd j (S' i)|) ^ 2)) * sqrt (2 * log fd.card) := hmass _ ≤ ρ * sqrt (2 * log fd.card) := mul_le_mul_of_nonneg_right hsup (Real.sqrt_nonneg _) _ = ρ * sqrt (2 * log (2 * (f.card : ℝ))) := by rw [hcard]
    Causalean.Stat.Concentration.empiricalRademacher_withAbs_finiteClass_le · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:444
  • empiricalRademacherComplexity_F_on_univ_eq lemma — Restricting a finite function family to its full index set leaves its empirical Rademacher complexity unchanged.
    ι' Z :
    Type*
    m :
    H :
    ι' → Z → ℝ
    S' :
    Fin m → Z
    empiricalRademacherComplexity m (F_on H (Finset.univ : Finset ι')) S'
    = empiricalRademacherComplexity m H S'
    Proof (Lean source)
    lemma empiricalRademacherComplexity_F_on_univ_eq {ι' Z : Type*} [Fintype ι'] {m : ℕ} (H : ι' → Z → ℝ) (S' : Fin m → Z) : empiricalRademacherComplexity m (F_on H (Finset.univ : Finset ι')) S' = empiricalRademacherComplexity m H S' := by classical cases isEmpty_or_nonempty ι' with | inl _ => simp [empiricalRademacherComplexity] | inr _ => unfold empiricalRademacherComplexity apply congrArg refine Finset.sum_congr rfl ?_ intro σ _ haveI : Nonempty {j // j ∈ (Finset.univ : Finset ι')} := by rcases (inferInstance : Nonempty ι') with ⟨i⟩ exact ⟨⟨i, by simp⟩⟩ apply le_antisymm · refine ciSup_le ?_ intro i exact le_ciSup (Finite.bddAbove_range fun j : ι' => |(m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * H j (S' k)|) i.1 · refine ciSup_le ?_ intro i have hidx : i ∈ (Finset.univ : Finset ι') := by simp exact le_ciSup (Finite.bddAbove_range fun j : {j // j ∈ (Finset.univ : Finset ι')} => |(m : ℝ)⁻¹ * ∑ k : Fin m, (σ k : ℝ) * F_on H (Finset.univ : Finset ι') j (S' k)|) ⟨i, hidx⟩
    Causalean.Stat.Concentration.empiricalRademacherComplexity_F_on_univ_eq · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:581
  • empiricalNorm_const_mul lemma — Scaling a function by a constant scales its empirical root-mean-square norm by the absolute value of that constant.
    𝒳 :
    Type*
    n :
    S :
    Fin n → 𝒳
    c :
    f :
    𝒳 → ℝ
    empiricalNorm S (fun x => c * f x) = |c| * empiricalNorm S f
    Proof (Lean source)
    lemma empiricalNorm_const_mul {𝒳 : Type*} {n : ℕ} (S : Fin n → 𝒳) (c : ℝ) (f : 𝒳 → ℝ) : empiricalNorm S (fun x => c * f x) = |c| * empiricalNorm S f := by classical unfold empiricalNorm have hsum : (∑ i : Fin n, (c * f (S i)) ^ 2) = c ^ 2 * ∑ i : Fin n, (f (S i)) ^ 2 := by rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro i _ ring_nf have hnonneg : 0 ≤ (1 / (n : ℝ)) * ∑ i : Fin n, (f (S i)) ^ 2 := by exact mul_nonneg (by positivity) (sum_nonneg fun i _ => sq_nonneg _) calc sqrt ((1 / (n : ℝ)) * ∑ i : Fin n, (c * f (S i)) ^ 2) = sqrt (c ^ 2 * ((1 / (n : ℝ)) * ∑ i : Fin n, (f (S i)) ^ 2)) := by rw [hsum] ring_nf _ = sqrt (c ^ 2) * sqrt ((1 / (n : ℝ)) * ∑ i : Fin n, (f (S i)) ^ 2) := by rw [Real.sqrt_mul (sq_nonneg c)] _ = |c| * sqrt ((1 / (n : ℝ)) * ∑ i : Fin n, (f (S i)) ^ 2) := by rw [Real.sqrt_sq_eq_abs]
    Causalean.Stat.Concentration.empiricalNorm_const_mul · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:614
  • growthFamilyRep_spec lemma — The chosen growth-family representative realizes the pattern it represents.
    ι 𝒳 :
    Type*
    n :
    π :
    ι → 𝒳 → Bool
    S :
    Fin n → 𝒳
    A :
    {A // A ∈ growthFamily π S}
    restrictionPattern (π (growthFamilyRep π S A)) S = A.1
    Proof (Lean source)
    lemma growthFamilyRep_spec {ι 𝒳 : Type*} {n : ℕ} (π : ι → 𝒳 → Bool) (S : Fin n → 𝒳) (A : {A // A ∈ growthFamily π S}) : restrictionPattern (π (growthFamilyRep π S A)) S = A.1 := Classical.choose_spec ((mem_growthFamily_iff (π := π) (S := S) (A := A.1)).mp A.2)
    Causalean.Stat.Concentration.growthFamilyRep_spec · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:650
  • starHullZeroOutScaleCoeff_nonneg lemma — The largest active scalar in a zeroed star hull is nonnegative because the zero scalar is always available.
    ι 𝒳 :
    Type*
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    r :
    i :
    ι
    0 ≤ starHullZeroOutScaleCoeff F norm r i
    Proof (Lean source)
    lemma starHullZeroOutScaleCoeff_nonneg {ι 𝒳 : Type*} (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (r : ℝ) (i : ι) : 0 ≤ starHullZeroOutScaleCoeff F norm r i := by classical let c : Icc (0 : ℝ) 1 → ℝ := fun a => if norm (starHullEval F (a, i)) ≤ r then (a : ℝ) else 0 have hc_bdd : BddAbove (range c) := by refine ⟨1, ?_⟩ rintro _ ⟨a, rfl⟩ dsimp [c] split_ifs · exact a.property.2 · norm_num let a0 : Icc (0 : ℝ) 1 := ⟨0, by simp [Set.mem_Icc]⟩ have hval : c a0 = 0 := by simp [c, a0] rw [starHullZeroOutScaleCoeff] change 0 ≤ ⨆ a : Icc (0 : ℝ) 1, c a simpa [hval] using le_ciSup hc_bdd a0
    Causalean.Stat.Concentration.starHullZeroOutScaleCoeff_nonneg · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:675
  • starHullPatternCoeff_nonneg lemma — The coefficient assigned to any observed Boolean pattern by the localized star-hull pattern class is nonnegative.
    ι 𝒳 :
    Type*
    n :
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    π :
    ι → 𝒳 → Bool
    S :
    Fin n → 𝒳
    r :
    A :
    {A // A ∈ growthFamily π S}
    0 ≤ starHullPatternCoeff F norm π S r A
    Proof (Lean source)
    lemma starHullPatternCoeff_nonneg {ι 𝒳 : Type*} {n : ℕ} (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (S : Fin n → 𝒳) (r : ℝ) (A : {A // A ∈ growthFamily π S}) : 0 ≤ starHullPatternCoeff F norm π S r A := by classical let rep : {i : ι // restrictionPattern (π i) S = A.1} := ⟨growthFamilyRep π S A, growthFamilyRep_spec π S A⟩ have hcoeff_le : BddAbove (Set.range fun i : {i : ι // restrictionPattern (π i) S = A.1} => starHullZeroOutScaleCoeff F norm r i.1) := by refine ⟨1, ?_⟩ rintro _ ⟨i, rfl⟩ exact starHullZeroOutScaleCoeff_le_one F norm r i.1 have hrep_le : starHullZeroOutScaleCoeff F norm r rep.1 ≤ starHullPatternCoeff F norm π S r A := by rw [starHullPatternCoeff] exact le_ciSup hcoeff_le rep exact (starHullZeroOutScaleCoeff_nonneg F norm r rep.1).trans hrep_le
    Causalean.Stat.Concentration.starHullPatternCoeff_nonneg · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:715
  • sample_eq_growthFamilyRep_of_pattern lemma — When a function class factorizes samplewise through Boolean labels, any function with a given observed Boolean pattern agrees on the sample with that pattern's chosen representative.
    ι 𝒳 :
    Type*
    n :
    F :
    ι → 𝒳 → ℝ
    π :
    ι → 𝒳 → Bool
    S :
    Fin n → 𝒳
    φ :
    Fin n → Bool → ℝ
    hfactorS :
    ∀ i j, F i (S j) = φ j (π i (S j))
    A :
    {A // A ∈ growthFamily π S}
    i :
    ι
    hiA :
    restrictionPattern (π i) S = A.1
    k :
    Fin n
    F i (S k) = F (growthFamilyRep π S A) (S k)
    Proof (Lean source)
    lemma sample_eq_growthFamilyRep_of_pattern {ι 𝒳 : Type*} {n : ℕ} {F : ι → 𝒳 → ℝ} {π : ι → 𝒳 → Bool} {S : Fin n → 𝒳} {φ : Fin n → Bool → ℝ} (hfactorS : ∀ i j, F i (S j) = φ j (π i (S j))) (A : {A // A ∈ growthFamily π S}) {i : ι} (hiA : restrictionPattern (π i) S = A.1) (k : Fin n) : F i (S k) = F (growthFamilyRep π S A) (S k) := by rw [hfactorS i k, hfactorS (growthFamilyRep π S A) k] apply congrArg (φ k) apply Bool.eq_iff_iff.mpr rw [← restrictionPattern_mem_iff (p := π i) (S := S) (j := k), hiA, ← growthFamilyRep_spec π S A, restrictionPattern_mem_iff (p := π (growthFamilyRep π S A)) (S := S) (j := k)]
    Causalean.Stat.Concentration.sample_eq_growthFamilyRep_of_pattern · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:755
  • starHullZeroOut_empirical_rademacher_le_patternClass lemma — If function values on every finite sample depend only on Boolean labels, then the empirical Rademacher complexity of the zeroed localized star hull is no greater than that of its finite sample-pattern class.
    ι 𝒳 :
    Type*
    Nonempty ι
    n :
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    π :
    ι → 𝒳 → Bool
    hfactor :
    ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))
    S :
    Fin n → 𝒳
    r :
    empiricalRademacherComplexity n (starHullZeroOut F norm r) S
    ≤ empiricalRademacherComplexity n (starHullPatternClass F norm π S r) S
    Proof (Lean source)
    lemma starHullZeroOut_empirical_rademacher_le_patternClass {ι 𝒳 : Type*} [Nonempty ι] {n : ℕ} (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (hfactor : ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))) (S : Fin n → 𝒳) (r : ℝ) : empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ empiricalRademacherComplexity n (starHullPatternClass F norm π S r) S := by classical rcases hfactor S with ⟨φ, hφ⟩ haveI : Nonempty {A // A ∈ growthFamily π S} := by let i0 : ι := Classical.arbitrary ι have hmem : restrictionPattern (π i0) S ∈ growthFamily π S := by rw [mem_growthFamily_iff] exact ⟨i0, rfl⟩ exact ⟨⟨restrictionPattern (π i0) S, hmem⟩⟩ unfold empiricalRademacherComplexity refine mul_le_mul_of_nonneg_left ?_ (by positivity) refine Finset.sum_le_sum ?_ intro σ _ refine ciSup_le ?_ intro p rcases p with ⟨a, i⟩ let A0 : Finset (Fin n) := restrictionPattern (π i) S have hA0 : A0 ∈ growthFamily π S := by rw [mem_growthFamily_iff] exact ⟨i, rfl⟩ let A : {A // A ∈ growthFamily π S} := ⟨A0, hA0⟩ have hiA : restrictionPattern (π i) S = A.1 := rfl let active : ℝ := if norm (starHullEval F (a, i)) ≤ r then (a : ℝ) else 0 let innerI : ℝ := (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F i (S k) let innerRep : ℝ := (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F (growthFamilyRep π S A) (S k) have hstar : |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r (a, i) (S k)| = active * |innerI| := by simpa [active, innerI] using starHullZeroOut_inner_term_eq F norm r S σ a i have hinner : innerI = innerRep := by simp [innerI, innerRep, sample_eq_growthFamilyRep_of_pattern (F := F) (π := π) (S := S) (φ := φ) hφ A hiA] have hactive_nonneg : 0 ≤ active := by dsimp [active] split_ifs · exact a.property.1 · norm_num have hscale_le : active ≤ starHullZeroOutScaleCoeff F norm r i := by simpa [active] using activeCoeff_le_starHullZeroOutScaleCoeff F norm r a i have hcoeff_le : starHullZeroOutScaleCoeff F norm r i ≤ starHullPatternCoeff F norm π S r A := starHullZeroOutScaleCoeff_le_patternCoeff F norm π S r A i hiA have hterm_le : active * |innerI| ≤ starHullPatternCoeff F norm π S r A * |innerRep| := by calc active * |innerI| ≤ starHullZeroOutScaleCoeff F norm r i * |innerI| := mul_le_mul_of_nonneg_right hscale_le (abs_nonneg _) _ ≤ starHullPatternCoeff F norm π S r A * |innerI| := mul_le_mul_of_nonneg_right hcoeff_le (abs_nonneg _) _ = starHullPatternCoeff F norm π S r A * |innerRep| := by rw [hinner] have hpattern : starHullPatternCoeff F norm π S r A * |innerRep| = |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullPatternClass F norm π S r A (S k)| := by have hcoeff_nonneg := starHullPatternCoeff_nonneg F norm π S r A have hlin : (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullPatternClass F norm π S r A (S k) = starHullPatternCoeff F norm π S r A * innerRep := by dsimp [starHullPatternClass, innerRep] calc (n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * (starHullPatternCoeff F norm π S r A * F (growthFamilyRep π S A) (S k)) = (n : ℝ)⁻¹ * (starHullPatternCoeff F norm π S r A * ∑ k : Fin n, (σ k : ℝ) * F (growthFamilyRep π S A) (S k)) := by congr 1 rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro k _ ring _ = starHullPatternCoeff F norm π S r A * ((n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * F (growthFamilyRep π S A) (S k)) := by ring symm calc |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullPatternClass F norm π S r A (S k)| = |starHullPatternCoeff F norm π S r A * innerRep| := by rw [hlin] _ = starHullPatternCoeff F norm π S r A * |innerRep| := by rw [abs_mul, abs_of_nonneg hcoeff_nonneg] calc |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r (a, i) (S k)| = active * |innerI| := hstar _ ≤ starHullPatternCoeff F norm π S r A * |innerRep| := hterm_le _ = |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullPatternClass F norm π S r A (S k)| := hpattern _ ≤ ⨆ A : {A // A ∈ growthFamily π S}, |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullPatternClass F norm π S r A (S k)| := by exact le_ciSup (Finite.bddAbove_range fun A : {A // A ∈ growthFamily π S} => |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullPatternClass F norm π S r A (S k)|) A
    Causalean.Stat.Concentration.starHullZeroOut_empirical_rademacher_le_patternClass · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:771
  • sqrt_sum_inv_abs_sq_eq_empiricalNorm_div_sqrt lemma — For a positive sample size, the square root of the sum of squared sample-normalized absolute function values equals the empirical norm divided by the square root of the sample size.
    𝒳 :
    Type*
    n :
    hn :
    0 < n
    S :
    Fin n → 𝒳
    g :
    𝒳 → ℝ
    sqrt (∑ k : Fin n, ((n : ℝ)⁻¹ * |g (S k)|) ^ 2)
    = empiricalNorm S g / sqrt (n : ℝ)
    Proof (Lean source)
    lemma sqrt_sum_inv_abs_sq_eq_empiricalNorm_div_sqrt {𝒳 : Type*} {n : ℕ} (hn : 0 < n) (S : Fin n → 𝒳) (g : 𝒳 → ℝ) : sqrt (∑ k : Fin n, ((n : ℝ)⁻¹ * |g (S k)|) ^ 2) = empiricalNorm S g / sqrt (n : ℝ) := by classical have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hsum : (∑ k : Fin n, ((n : ℝ)⁻¹ * |g (S k)|) ^ 2) = (n : ℝ)⁻¹ * ((n : ℝ)⁻¹ * ∑ k : Fin n, (g (S k)) ^ 2) := by calc (∑ k : Fin n, ((n : ℝ)⁻¹ * |g (S k)|) ^ 2) = ∑ k : Fin n, ((n : ℝ)⁻¹) ^ 2 * (g (S k)) ^ 2 := by refine Finset.sum_congr rfl ?_ intro k _ rw [mul_pow, sq_abs] _ = ((n : ℝ)⁻¹) ^ 2 * ∑ k : Fin n, (g (S k)) ^ 2 := by rw [Finset.mul_sum] _ = (n : ℝ)⁻¹ * ((n : ℝ)⁻¹ * ∑ k : Fin n, (g (S k)) ^ 2) := by ring calc sqrt (∑ k : Fin n, ((n : ℝ)⁻¹ * |g (S k)|) ^ 2) = sqrt ((n : ℝ)⁻¹ * ((n : ℝ)⁻¹ * ∑ k : Fin n, (g (S k)) ^ 2)) := by rw [hsum] _ = sqrt ((n : ℝ)⁻¹) * sqrt ((n : ℝ)⁻¹ * ∑ k : Fin n, (g (S k)) ^ 2) := by rw [Real.sqrt_mul (inv_nonneg.mpr (le_of_lt hnR))] _ = (sqrt (n : ℝ))⁻¹ * sqrt ((n : ℝ)⁻¹ * ∑ k : Fin n, (g (S k)) ^ 2) := by rw [Real.sqrt_inv] _ = empiricalNorm S g / sqrt (n : ℝ) := by unfold empiricalNorm ring
    Causalean.Stat.Concentration.sqrt_sum_inv_abs_sq_eq_empiricalNorm_div_sqrt · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:896
  • starHullZeroOutScaleCoeff_mul_empiricalNorm_le lemma — Under the localized VC hypotheses, a function's localized scale coefficient times its empirical norm over the sample is at most the localization radius.
    ι 𝒳 :
    Type*
    n :
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    S :
    Fin n → 𝒳
    r :
    hr :
    0 ≤ r
    i :
    ι
    starHullZeroOutScaleCoeff F norm r i * empiricalNorm S (F i) ≤ r
    Proof (Lean source)
    lemma starHullZeroOutScaleCoeff_mul_empiricalNorm_le {ι 𝒳 : Type*} {n : ℕ} (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (Hloc : LocalizedVCDudleyHypotheses F norm) (S : Fin n → 𝒳) {r : ℝ} (hr : 0 ≤ r) (i : ι) : starHullZeroOutScaleCoeff F norm r i * empiricalNorm S (F i) ≤ r := by classical have hnorm_nonneg : 0 ≤ empiricalNorm S (F i) := by unfold empiricalNorm positivity have hmul : (⨆ a : Icc (0 : ℝ) 1, (if norm (starHullEval F (a, i)) ≤ r then (a : ℝ) else 0) * empiricalNorm S (F i)) = starHullZeroOutScaleCoeff F norm r i * empiricalNorm S (F i) := by rw [ciSup_mul_const_of_le_one (fun a : Icc (0 : ℝ) 1 => if norm (starHullEval F (a, i)) ≤ r then (a : ℝ) else 0) (empiricalNorm S (F i)) hnorm_nonneg] rfl rw [← hmul] refine ciSup_le ?_ intro a by_cases hactive : norm (starHullEval F (a, i)) ≤ r · have hnorm := Hloc.empirical_radius S hr (a, i) have heq : empiricalNorm S (starHullZeroOut F norm r (a, i)) = (a : ℝ) * empiricalNorm S (F i) := by calc empiricalNorm S (starHullZeroOut F norm r (a, i)) = empiricalNorm S (fun x => (a : ℝ) * F i x) := by congr funext x simp [starHullZeroOut, hactive, starHullEval] _ = (a : ℝ) * empiricalNorm S (F i) := by simpa [abs_of_nonneg a.property.1] using empiricalNorm_const_mul S (a : ℝ) (F i) simpa [hactive, heq] using hnorm · calc (if norm (starHullEval F (a, i)) ≤ r then (a : ℝ) else 0) * empiricalNorm S (F i) = 0 := by simp [hactive] _ ≤ r := hr
    Causalean.Stat.Concentration.starHullZeroOutScaleCoeff_mul_empiricalNorm_le · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:934
  • starHullZeroOut_empirical_rademacher_le_growthFamily lemma — The empirical Rademacher complexity of a zero-augmented localized star hull is bounded by its radius times a logarithmic factor determined by the number of distinct Boolean patterns in the sample.
    Nonempty ι
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    π :
    ι → 𝒳 → Bool
    hfactor :
    ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))
    n :
    hn :
    0 < n
    S :
    Fin n → 𝒳
    r :
    hr :
    0 ≤ r
    empiricalRademacherComplexity n (starHullZeroOut F norm r) S
    ≤ r * sqrt ((2 * log (2 * ((growthFamily π S).card : ℝ))) / (n : ℝ))
    Proof (Lean source)
    lemma starHullZeroOut_empirical_rademacher_le_growthFamily [Nonempty ι] (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (hfactor : ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))) {n : ℕ} (hn : 0 < n) (Hloc : LocalizedVCDudleyHypotheses F norm) (S : Fin n → 𝒳) (r : ℝ) (hr : 0 ≤ r) : empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ r * sqrt ((2 * log (2 * ((growthFamily π S).card : ℝ))) / (n : ℝ)) := by classical let W : {A // A ∈ growthFamily π S} → 𝒳 → ℝ := starHullPatternClass F norm π S r have hgf_nonempty : (growthFamily π S).Nonempty := by let i0 : ι := Classical.arbitrary ι refine ⟨restrictionPattern (π i0) S, ?_⟩ rw [mem_growthFamily_iff] exact ⟨i0, rfl⟩ haveI : Nonempty {A // A ∈ growthFamily π S} := by rcases hgf_nonempty with ⟨A, hA⟩ exact ⟨⟨A, hA⟩⟩ have hcollapse : empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ empiricalRademacherComplexity n W S := by simpa [W] using starHullZeroOut_empirical_rademacher_le_patternClass F norm π hfactor S r have hfinite_on : empiricalRademacherComplexity n (F_on W (Finset.univ : Finset {A // A ∈ growthFamily π S})) S ≤ (r / sqrt (n : ℝ)) * sqrt (2 * log (2 * (((Finset.univ : Finset {A // A ∈ growthFamily π S}).card : ℝ)))) := by refine empiricalRademacher_withAbs_finiteClass_le (ι' := {A // A ∈ growthFamily π S}) (Z := 𝒳) hn W S (Finset.univ : Finset {A // A ∈ growthFamily π S}) ?_ (r / sqrt (n : ℝ)) ?_ · simpa using (Finset.univ_nonempty : (Finset.univ : Finset {A // A ∈ growthFamily π S}).Nonempty) · intro A _hA simpa [W] using starHullPatternClass_radius_le hn F norm π hfactor Hloc S hr A have hfinite : empiricalRademacherComplexity n W S ≤ (r / sqrt (n : ℝ)) * sqrt (2 * log (2 * ((growthFamily π S).card : ℝ))) := by have hcard : (((Finset.univ : Finset {A // A ∈ growthFamily π S}).card : ℝ)) = ((growthFamily π S).card : ℝ) := by simp have hfinite_univ := hfinite_on rw [empiricalRademacherComplexity_F_on_univ_eq W S] at hfinite_univ simpa [hcard] using hfinite_univ let L : ℝ := 2 * log (2 * ((growthFamily π S).card : ℝ)) have hcard_pos : 0 < (growthFamily π S).card := Finset.card_pos.mpr hgf_nonempty have hlog_nonneg : 0 ≤ log (2 * ((growthFamily π S).card : ℝ)) := by have hcard_one : (1 : ℝ) ≤ ((growthFamily π S).card : ℝ) := by exact_mod_cast (Nat.succ_le_of_lt hcard_pos) have hone_le : (1 : ℝ) ≤ 2 * ((growthFamily π S).card : ℝ) := by nlinarith exact Real.log_nonneg hone_le have hL_nonneg : 0 ≤ L := by dsimp [L] exact mul_nonneg (by norm_num) hlog_nonneg calc empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ empiricalRademacherComplexity n W S := hcollapse _ ≤ (r / sqrt (n : ℝ)) * sqrt L := by simpa [L] using hfinite _ = r * sqrt (L / (n : ℝ)) := by rw [Real.sqrt_div hL_nonneg] ring _ = r * sqrt ((2 * log (2 * ((growthFamily π S).card : ℝ))) / (n : ℝ)) := by rfl
    Causalean.Stat.Concentration.starHullZeroOut_empirical_rademacher_le_growthFamily · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:1059
  • starHullZeroOut_empirical_rademacher_massart_vc lemma — Massart finite-realization bound for the localized star-hull zero-out class under binary trace entropy control.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    π :
    ι → 𝒳 → Bool
    hfactor :
    ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))
    d n :
    ∀ (S : Fin n → 𝒳) (r : ℝ)
    if
    0 ≤ r
    then
    empiricalRademacherComplexity n (starHullZeroOut F norm r) S
    ≤ r * sqrt ((2 * (d : ℝ) * log ((n : ℝ) + 1) + 2) / (n : ℝ))
    Proof (Lean source)
    lemma starHullZeroOut_empirical_rademacher_massart_vc (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (hfactor : ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))) (d n : ℕ) (Htrace : BinaryTraceEntropyControl π d) (Hloc : LocalizedVCDudleyHypotheses F norm) : ∀ (S : Fin n → 𝒳) (r : ℝ), 0 ≤ r → empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ r * sqrt ((2 * (d : ℝ) * log ((n : ℝ) + 1) + 2) / (n : ℝ)) := by intro S r hr by_cases hn0 : n = 0 · subst n simp [empiricalRademacherComplexity] · have hn : 0 < n := Nat.pos_of_ne_zero hn0 by_cases hι : Nonempty ι · haveI : Nonempty ι := hι have hcard_pos : 0 < (growthFamily π S).card := by let i0 : ι := Classical.choice hι have hmem : restrictionPattern (π i0) S ∈ growthFamily π S := by rw [mem_growthFamily_iff] exact ⟨i0, rfl⟩ exact Finset.card_pos.mpr ⟨_, hmem⟩ have hcard : (growthFamily π S).card ≤ (n + 1) ^ d := growthFamily_card_le_succ_pow_of_trace π d n Htrace S have hmass := starHullZeroOut_empirical_rademacher_le_growthFamily F norm π hfactor hn Hloc S r hr have hlog := log_two_growth_card_le π d n S hcard_pos hcard have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hsqrt : sqrt ((2 * log (2 * ((growthFamily π S).card : ℝ))) / (n : ℝ)) ≤ sqrt ((2 * (d : ℝ) * log ((n : ℝ) + 1) + 2) / (n : ℝ)) := by exact Real.sqrt_le_sqrt (div_le_div_of_nonneg_right hlog (le_of_lt hnR)) exact hmass.trans (mul_le_mul_of_nonneg_left hsqrt hr) · letI : IsEmpty ι := ⟨fun i => hι ⟨i⟩⟩ have hzero : empiricalRademacherComplexity n (starHullZeroOut F norm r) S = 0 := by simp [empiricalRademacherComplexity, starHullParam] rw [hzero] exact mul_nonneg hr (Real.sqrt_nonneg _)
    Causalean.Stat.Concentration.starHullZeroOut_empirical_rademacher_massart_vc · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:1144
  • absolute_dudley_vc_starHullZeroOut_linear_residual_shared lemma — Shared absolute-form Dudley/VC bridge for the localized star-hull class.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    π :
    ι → 𝒳 → Bool
    hfactor :
    ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))
    K :
    d n :
    hK :
    (1 : ℝ) ≤ K
    ∀ (S : Fin n → 𝒳) (r : ℝ)
    if
    0 ≤ r
    then
    empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ vcLocalizedPsi K d n r
    Proof (Lean source)
    lemma absolute_dudley_vc_starHullZeroOut_linear_residual_shared (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (hfactor : ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))) (K : ℝ) (d n : ℕ) (hK : (1 : ℝ) ≤ K) (Htrace : BinaryTraceEntropyControl π d) (Hloc : LocalizedVCDudleyHypotheses F norm) : ∀ (S : Fin n → 𝒳) (r : ℝ), 0 ≤ r → empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ vcLocalizedPsi K d n r := by intro S r hr have hmass := starHullZeroOut_empirical_rademacher_massart_vc F norm π hfactor d n Htrace Hloc S r hr by_cases hn0 : n = 0 · simpa [vcLocalizedPsi, vcLocalizedSlope, hn0] using hmass · have hn : 0 < n := Nat.pos_of_ne_zero hn0 have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hK0 : 0 ≤ K := le_trans zero_le_one hK have hlog : 0 ≤ log ((n : ℝ) + 1) := by have hone_le : (1 : ℝ) ≤ (n : ℝ) + 1 := by linarith [le_of_lt hnR] exact Real.log_nonneg hone_le have hD_nonneg : 0 ≤ (d : ℝ) * log ((n : ℝ) + 1) := mul_nonneg (Nat.cast_nonneg d) hlog have hKD : (d : ℝ) * log ((n : ℝ) + 1) ≤ K * (d : ℝ) * log ((n : ℝ) + 1) := by calc (d : ℝ) * log ((n : ℝ) + 1) = 1 * ((d : ℝ) * log ((n : ℝ) + 1)) := by ring _ ≤ K * ((d : ℝ) * log ((n : ℝ) + 1)) := mul_le_mul_of_nonneg_right hK hD_nonneg _ = K * (d : ℝ) * log ((n : ℝ) + 1) := by ring have hnum : 2 * (d : ℝ) * log ((n : ℝ) + 1) + 2 ≤ 36 * (K * (d : ℝ) * log ((n : ℝ) + 1) + 1) := by nlinarith have hfrac : (2 * (d : ℝ) * log ((n : ℝ) + 1) + 2) / (n : ℝ) ≤ 36 * ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ)) := by have hdiv := div_le_div_of_nonneg_right hnum (le_of_lt hnR) simpa [mul_div_assoc, mul_assoc] using hdiv have hsqrt : sqrt ((2 * (d : ℝ) * log ((n : ℝ) + 1) + 2) / (n : ℝ)) ≤ 6 * sqrt ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ)) := by calc sqrt ((2 * (d : ℝ) * log ((n : ℝ) + 1) + 2) / (n : ℝ)) ≤ sqrt (36 * ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ))) := Real.sqrt_le_sqrt hfrac _ = 6 * sqrt ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ)) := by have hsqrt36 : sqrt (36 : ℝ) = 6 := by have hsq : (sqrt (36 : ℝ)) ^ 2 = (6 : ℝ) ^ 2 := by rw [Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 36)] norm_num rcases (sq_eq_sq_iff_eq_or_eq_neg.mp hsq) with h | h · exact h · nlinarith [Real.sqrt_nonneg (36 : ℝ)] rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 36)] rw [hsqrt36] calc empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ r * sqrt ((2 * (d : ℝ) * log ((n : ℝ) + 1) + 2) / (n : ℝ)) := hmass _ ≤ r * (6 * sqrt ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ))) := mul_le_mul_of_nonneg_left hsqrt hr _ = vcLocalizedPsi K d n r := by simp [vcLocalizedPsi, vcLocalizedSlope] ring
    Causalean.Stat.Concentration.absolute_dudley_vc_starHullZeroOut_linear_residual_shared · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:1200
  • vc_starHullZeroOut_empirical_rademacher_le_linear lemma — The generic finite-VC/Dudley sample-path bridge for the localized star-hull class.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    K :
    d n :
    hK :
    (1 : ℝ) ≤ K
    ∀ (S : Fin n → 𝒳) (r : ℝ)
    if
    0 ≤ r
    then
    empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ vcLocalizedPsi K d n r
    Proof (Lean source)
    lemma vc_starHullZeroOut_empirical_rademacher_le_linear (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (K : ℝ) (d n : ℕ) (hK : (1 : ℝ) ≤ K) (Hvc : BinaryFactoredVCClass F d) (Hloc : LocalizedVCDudleyHypotheses F norm) : ∀ (S : Fin n → 𝒳) (r : ℝ), 0 ≤ r → empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ vcLocalizedPsi K d n r := absolute_dudley_vc_starHullZeroOut_linear_residual_shared F norm Hvc.π Hvc.factor K d n hK (inl Hvc.vcDim_le) Hloc
    Causalean.Stat.Concentration.vc_starHullZeroOut_empirical_rademacher_le_linear · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:1289
  • vc_starHullZeroOut_empirical_rademacher_le_linear_of_card lemma — Cardinality-bound sample-path bridge for the localized star-hull class. This is the direct growth-function analogue of vc_starHullZeroOut_empirical_rademacher_le_linear.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    π :
    ι → 𝒳 → Bool
    hfactor :
    ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))
    K :
    dPi n :
    hK :
    (1 : ℝ) ≤ K
    hcard :
    ∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPi
    ∀ (S : Fin n → 𝒳) (r : ℝ)
    if
    0 ≤ r
    then
    empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ vcLocalizedPsi K dPi n r
    Proof (Lean source)
    lemma vc_starHullZeroOut_empirical_rademacher_le_linear_of_card (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (hfactor : ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))) (K : ℝ) (dPi n : ℕ) (hK : (1 : ℝ) ≤ K) (hcard : ∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPi) (Hloc : LocalizedVCDudleyHypotheses F norm) : ∀ (S : Fin n → 𝒳) (r : ℝ), 0 ≤ r → empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ vcLocalizedPsi K dPi n r := absolute_dudley_vc_starHullZeroOut_linear_residual_shared F norm π hfactor K dPi n hK (inr hcard) Hloc
    Causalean.Stat.Concentration.vc_starHullZeroOut_empirical_rademacher_le_linear_of_card · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:1306
  • vc_starHullZeroOut_population_rademacher_le_linear lemma — The generic finite-VC/Dudley population bridge for the localized star-hull class.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    μ :
    X :
    Ω → 𝒳
    K :
    d n :
    hK :
    (1 : ℝ) ≤ K
    ∀ r : ℝ
    if
    0 ≤ r
    then
    rademacherComplexity n (starHullZeroOut F norm r) μ X ≤ vcLocalizedPsi K d n r
    Proof (Lean source)
    lemma vc_starHullZeroOut_population_rademacher_le_linear (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (μ : Measure Ω) (X : Ω → 𝒳) [IsProbabilityMeasure μ] (K : ℝ) (d n : ℕ) (hK : (1 : ℝ) ≤ K) (Hvc : BinaryFactoredVCClass F d) (Hloc : LocalizedVCDudleyHypotheses F norm) : ∀ r : ℝ, 0 ≤ r → rademacherComplexity n (starHullZeroOut F norm r) μ X ≤ vcLocalizedPsi K d n r := by intro r hr let C := vcLocalizedPsi K d n r have hpoint : ∀ S : Fin n → 𝒳, empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ C := by intro S exact vc_starHullZeroOut_empirical_rademacher_le_linear F norm K d n hK Hvc Hloc S r hr have h_abs : ∀ᵐ ω : Fin n → Ω ∂(Measure.pi fun _ : Fin n => μ), |empiricalRademacherComplexity n (starHullZeroOut F norm r) (X ∘ ω)| ≤ C := by exact Filter.Eventually.of_forall fun ω => by have hnonneg : 0 ≤ empiricalRademacherComplexity n (starHullZeroOut F norm r) (X ∘ ω) := by unfold empiricalRademacherComplexity refine mul_nonneg ?_ ?_ · positivity · refine sum_nonneg ?_ intro σ _ refine Real.iSup_nonneg ?_ intro p exact abs_nonneg _ rw [abs_of_nonneg hnonneg] exact hpoint (X ∘ ω) unfold rademacherComplexity change ∫ ω : Fin n → Ω, empiricalRademacherComplexity n (starHullZeroOut F norm r) (X ∘ ω) ∂(Measure.pi fun _ : Fin n => μ) ≤ C exact le_trans (le_abs_self _) (abs_expectation_le_of_abs_le_const h_abs)
    Causalean.Stat.Concentration.vc_starHullZeroOut_population_rademacher_le_linear · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:1325
  • vc_starHullZeroOut_population_rademacher_le_linear_of_card lemma — Cardinality-bound population bridge for the localized star-hull class.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    π :
    ι → 𝒳 → Bool
    μ :
    X :
    Ω → 𝒳
    hfactor :
    ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))
    K :
    dPi n :
    hK :
    (1 : ℝ) ≤ K
    hcard :
    ∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPi
    ∀ r : ℝ
    if
    0 ≤ r
    then
    rademacherComplexity n (starHullZeroOut F norm r) μ X ≤ vcLocalizedPsi K dPi n r
    Proof (Lean source)
    lemma vc_starHullZeroOut_population_rademacher_le_linear_of_card (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (μ : Measure Ω) (X : Ω → 𝒳) [IsProbabilityMeasure μ] (hfactor : ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))) (K : ℝ) (dPi n : ℕ) (hK : (1 : ℝ) ≤ K) (hcard : ∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPi) (Hloc : LocalizedVCDudleyHypotheses F norm) : ∀ r : ℝ, 0 ≤ r → rademacherComplexity n (starHullZeroOut F norm r) μ X ≤ vcLocalizedPsi K dPi n r := by intro r hr let C := vcLocalizedPsi K dPi n r have hpoint : ∀ S : Fin n → 𝒳, empiricalRademacherComplexity n (starHullZeroOut F norm r) S ≤ C := by intro S exact vc_starHullZeroOut_empirical_rademacher_le_linear_of_card F norm π hfactor K dPi n hK hcard Hloc S r hr have h_abs : ∀ᵐ ω : Fin n → Ω ∂(Measure.pi fun _ : Fin n => μ), |empiricalRademacherComplexity n (starHullZeroOut F norm r) (X ∘ ω)| ≤ C := by exact Filter.Eventually.of_forall fun ω => by have hnonneg : 0 ≤ empiricalRademacherComplexity n (starHullZeroOut F norm r) (X ∘ ω) := by unfold empiricalRademacherComplexity refine mul_nonneg ?_ ?_ · positivity · refine sum_nonneg ?_ intro σ _ refine Real.iSup_nonneg ?_ intro p exact abs_nonneg _ rw [abs_of_nonneg hnonneg] exact hpoint (X ∘ ω) unfold rademacherComplexity change ∫ ω : Fin n → Ω, empiricalRademacherComplexity n (starHullZeroOut F norm r) (X ∘ ω) ∂(Measure.pi fun _ : Fin n => μ) ≤ C exact le_trans (le_abs_self _) (abs_expectation_le_of_abs_le_const h_abs)
    Causalean.Stat.Concentration.vc_starHullZeroOut_population_rademacher_le_linear_of_card · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:1369
  • vcLocalizedRademacherUpperBound theorem — The finite-VC localized envelope upper-bounds population localized Rademacher complexity.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    μ :
    X :
    Ω → 𝒳
    K :
    d n :
    hK :
    (1 : ℝ) ≤ K
    RademacherUpperBound F norm μ X n (vcLocalizedPsi K d n)
    Proof (Lean source)
    theorem vcLocalizedRademacherUpperBound (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (μ : Measure Ω) (X : Ω → 𝒳) [IsProbabilityMeasure μ] (K : ℝ) (d n : ℕ) (hK : (1 : ℝ) ≤ K) (Hvc : BinaryFactoredVCClass F d) (Hloc : LocalizedVCDudleyHypotheses F norm) : RademacherUpperBound F norm μ X n (vcLocalizedPsi K d n) := by intro r hr exact vc_starHullZeroOut_population_rademacher_le_linear F norm μ X K d n hK Hvc Hloc r hr
    Causalean.Stat.Concentration.vcLocalizedRademacherUpperBound · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:1416
  • vcLocalizedRademacherUpperBound_of_card theorem — The growth-cardinality localized envelope upper-bounds population localized Rademacher complexity.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    π :
    ι → 𝒳 → Bool
    μ :
    X :
    Ω → 𝒳
    hfactor :
    ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))
    K :
    dPi n :
    hK :
    (1 : ℝ) ≤ K
    hcard :
    ∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPi
    RademacherUpperBound F norm μ X n (vcLocalizedPsi K dPi n)
    Proof (Lean source)
    theorem vcLocalizedRademacherUpperBound_of_card (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (μ : Measure Ω) (X : Ω → 𝒳) [IsProbabilityMeasure μ] (hfactor : ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))) (K : ℝ) (dPi n : ℕ) (hK : (1 : ℝ) ≤ K) (hcard : ∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPi) (Hloc : LocalizedVCDudleyHypotheses F norm) : RademacherUpperBound F norm μ X n (vcLocalizedPsi K dPi n) := by intro r hr exact vc_starHullZeroOut_population_rademacher_le_linear_of_card F norm π μ X hfactor K dPi n hK hcard Hloc r hr
    Causalean.Stat.Concentration.vcLocalizedRademacherUpperBound_of_card · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:1431
  • vcLocalizedEnvelope theorem — Fixed-n finite-VC localized envelope package: sub-root envelope, localized Rademacher upper bound, critical-radius bound by the slope, and squared critical-radius rate.
    F :
    ι → 𝒳 → ℝ
    norm :
    (𝒳 → ℝ) → ℝ
    μ :
    X :
    Ω → 𝒳
    K :
    d n :
    hK :
    (1 : ℝ) ≤ K
    hn :
    0 < n
    RademacherUpperBound F norm μ X n (vcLocalizedPsi K d n) ∧
    ≤ 36 * ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ))
    Proof (Lean source)
    theorem vcLocalizedEnvelope (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (μ : Measure Ω) (X : Ω → 𝒳) [IsProbabilityMeasure μ] (K : ℝ) (d n : ℕ) (hK : (1 : ℝ) ≤ K) (hn : 0 < n) (Hvc : BinaryFactoredVCClass F d) (Hloc : LocalizedVCDudleyHypotheses F norm) : SubRoot (vcLocalizedPsi K d n) ∧ RademacherUpperBound F norm μ X n (vcLocalizedPsi K d n) ∧ criticalRadius (vcLocalizedPsi K d n) ≤ vcLocalizedSlope K d n ∧ (criticalRadius (vcLocalizedPsi K d n)) ^ 2 ≤ 36 * ((K * (d : ℝ) * log ((n : ℝ) + 1) + 1) / (n : ℝ)) := by refine ⟨vcLocalizedPsi_subRoot K d n, ?_, ?_, ?_⟩ · exact vcLocalizedRademacherUpperBound F norm μ X K d n hK Hvc Hloc · exact criticalRadius_vcLocalizedPsi_le (le_trans zero_le_one hK) hn · exact criticalRadius_vcLocalizedPsi_sq_le_rate (le_trans zero_le_one hK) hn
    Causalean.Stat.Concentration.vcLocalizedEnvelope · Causalean/Stat/Concentration/Covering/VCLocalizedRegime.lean:1450
Dudley­Entropy 1 core · 8 supporting The Dudley entropy-integral bound controls empirical Rademacher complexity by covering numbers; it is the chaining step of empirical-process theory. ★ dudley_entropy_integral_bound

The Dudley entropy-integral bound controls empirical Rademacher complexity by covering numbers; it is the chaining step of empirical-process theory.

This file ports the Dudley entropy-integral chaining argument from auto-res/lean-rademacher into the Causalean concentration namespace. It uses the already-ported Causalean Rademacher, empirical pseudometric, Massart, and covering-number modules. The public surface includes the finite chaining boundedness facts, the Riemann-sum comparison lemmas, and the final dudley_entropy_integral_bound theorem for the signed empirical Rademacher average.

theorem dudley_entropy_integral_bound reviewed
Causalean.Stat.Concentration

Dudley entropy-integral bound, without the outer absolute value. Fix a positive scale ε that is strictly less than half the common empirical-norm envelope c, where the sample size m is positive, every member of the class has empirical norm on the sample at most c, and the sample-restricted function class is totally bounded in the empirical pseudometric. Then the empirical Rademacher complexity computed without the outer absolute value is at most 4ε + (12/√m) ∫_ε^(c/2) √(log(coveringNumber x)) dx, the usual Dudley chaining bound in terms of the covering-number entropy integral.

Formal statement
ε :
ε_pos :
0 < ε
h' :
m_pos :
0 < m
cs :
∀ f : ι, empiricalNorm S (F f) ≤ c
ε_le_c_div_2 :
ε < c/2
empiricalRademacherComplexity_without_abs m F S
≤ (4 * ε + (12 / (sqrt m)) * (∫ (x : ℝ) in ε..(c/2),√(log (coveringNumber h' x))))
Proof (Lean source)
theorem dudley_entropy_integral_bound {ε : ℝ} (ε_pos : 0 < ε) (h' : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S))) (m_pos : 0 < m) (cs : ∀ f : ι, empiricalNorm S (F f) ≤ c) (ε_le_c_div_2 : ε < c/2) : empiricalRademacherComplexity_without_abs m F S ≤ (4 * ε + (12 / (sqrt m)) * (∫ (x : ℝ) in ε..(c/2),√(log (coveringNumber h' x)))) := by obtain ⟨n, ⟨nw1, nw2⟩⟩ := choose_dyadic_scale_for_epsilon ε ε_pos ε_le_c_div_2 have ε_c : ε ≤ c := by linarith have c_pos : 0 < c := lt_of_le_of_lt' ε_c ε_pos apply le_trans (entropy_sum_to_integral_bound c_pos h' n m_pos cs) apply add_le_add · linarith · apply mul_le_mul_of_nonneg_left · apply intervalIntegral.integral_mono_interval (le_of_lt nw1) · dsimp [ej] rw [div_le_div_iff_of_pos_left] · have := Nat.one_lt_two_pow' n rw [<- Nat.add_one_le_iff] at this simp only [Nat.reduceAdd] at this norm_cast · exact c_pos · simp · simp · simp · filter_upwards intro a simp · apply AntitoneOn.intervalIntegrable have f0 : Monotone (fun x ↦ √x) := by apply Real.sqrt_le_sqrt apply Monotone.comp_antitoneOn f0 refine antitoneOn_iff_forall_lt.mpr ?_ intro a ha b hb hab dsimp [uIcc] at ha dsimp [Icc] at ha have : min ε (c / 2) = ε := by simp linarith rw [this] at ha dsimp [uIcc] at hb dsimp [Icc] at hb rw [this] at hb apply Real.log_le_log · apply Nat.cast_pos.mpr apply coveringNumber_nonzero · exact e_nonempty linarith · norm_cast apply coveringNumber_antitone · simp linarith · simp linarith · exact le_of_lt hab · refine div_nonneg ?_ ?_ · simp · norm_cast simp
8 supporting declarations (lemmas, instances)
  • term_le_total_sum_of_nonneg theorem — A nonnegative term in a finite sum is bounded by the full sum of nonnegative terms.
    α :
    Type u
    j :
    α
    f :
    α → M
    h0 :
    ∀ j, 0 ≤ f j
    f j ≤ ∑ i : α, f i
    Proof (Lean source)
    theorem term_le_total_sum_of_nonneg {α : Type u} [Fintype α] {M : Type*} [AddCommMonoid M] [Preorder M] [IsOrderedAddMonoid M] (j : α) (f : α → M) (h0 : ∀ j, 0 ≤ f j) : f j ≤ ∑ i : α, f i := by classical have hj : j ∈ (Finset.univ : Finset α) := by simp have hsum : (Finset.univ.erase j).sum (fun i : α => f i) + f j = ∑ i : α, f i := by exact Finset.sum_erase_add _ _ hj have h_nonneg : 0 ≤ (Finset.univ.erase j).sum (fun i : α => f i) := by refine sum_nonneg ?_ intro i hi exact h0 i have h_le : f j ≤ (Finset.univ.erase j).sum (fun i : α => f i) + f j := by simpa [add_comm] using add_le_add_left h_nonneg (f j) exact h_le.trans_eq hsum
    Causalean.Stat.Concentration.term_le_total_sum_of_nonneg · Causalean/Stat/Concentration/Covering/DudleyEntropy.lean:39
  • pointwise_bound_from_empirical_norm lemma — If every function has empirical norm at most a given bound on a positive-size sample, then its absolute value at each sampled observation is at most the sample-size square root times that bound.
    cs :
    ∀ f : ι, empiricalNorm S (F f) ≤ c
    i :
    Fin m
    hm_pos :
    0 < m
    ∀ (f : ι), |F f (S i)| ≤ √↑m * c
    Proof (Lean source)
    lemma pointwise_bound_from_empirical_norm (cs : ∀ f : ι, empiricalNorm S (F f) ≤ c) (i : Fin m) (hm_pos : 0 < m) : ∀ (f : ι), |F f (S i)| ≤ √↑m * c := by intro f dsimp [empiricalNorm] at cs have fcs := cs f -- from a finite-sample ℓ₂ bound to a pointwise bound via the coordinate projection inequality have hm_pos : 0 < (m : ℝ) := by norm_cast have hm_sqrt_pos : 0 < sqrt (m : ℝ) := Real.sqrt_pos.2 hm_pos have hproj := empiricalDist_proj (S := S) (f := F f) (i := i) have hcancel : sqrt (m : ℝ) ≠ 0 := ne_of_gt hm_sqrt_pos have h1 : |F f (S i)| ≤ √↑m * empiricalNorm S (F f) := by have hproj' := mul_le_mul_of_nonneg_left hproj (le_of_lt hm_sqrt_pos) -- simplify the left side using positivity of √m have hleft : √↑m * (|F f (S i)| / √↑m) = |F f (S i)| := by field_simp [hcancel] simpa [hleft] using hproj' calc |F f (S i)| ≤ √↑m * empiricalNorm S (F f) := h1 _ ≤ √↑m * c := by apply mul_le_mul_of_nonneg_left fcs exact le_of_lt hm_sqrt_pos
    Causalean.Stat.Concentration.pointwise_bound_from_empirical_norm · Causalean/Stat/Concentration/Covering/DudleyEntropy.lean:159
  • bddAbove_main_term theorem — The main remainder term in the Dudley chain has a finite upper bound.
    c_pos :
    0 < c
    cs :
    ∀ (f : ι), empiricalNorm S (F f) ≤ c
    h :
    n :
    m_pos :
    ¬m = 0
    i :
    Signs m
    BddAbove (range fun fh ↦ ∑ i_1, ↑↑(i i_1) * (F fh (S i_1) - chainApprox c_pos h fh n (S i_1)))
    Proof (Lean source)
    theorem splitBound.bddAbove_main_term {c_pos : 0 < c} (cs : ∀ (f : ι), empiricalNorm S (F f) ≤ c) (h : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S))) (n : ℕ) (m_pos : ¬m = 0) (i : Signs m) : BddAbove (range fun fh ↦ ∑ i_1, ↑↑(i i_1) * (F fh (S i_1) - chainApprox c_pos h fh n (S i_1))) := by rw [bddAbove_def] classical refine ⟨m * (2 * (sqrt (m : ℝ) * c)), ?_⟩ intro y hy rcases hy with ⟨fh, rfl⟩ have hmpos : 0 < m := Nat.pos_of_ne_zero m_pos calc (∑ i_1, (i i_1 : ℝ) * (F fh (S i_1) - chainApprox c_pos h fh n (S i_1))) ≤ ∑ i_1, |(i i_1 : ℝ) * (F fh (S i_1) - chainApprox c_pos h fh n (S i_1))| := by refine Finset.sum_le_sum ?_ intro _ _ exact le_abs_self _ _ = ∑ i_1, |F fh (S i_1) - chainApprox c_pos h fh n (S i_1)| := by apply Finset.sum_congr rfl intro _ _ simp [abs_mul] _ ≤ ∑ i_1, (|F fh (S i_1)| + |chainApprox c_pos h fh n (S i_1)|) := by refine Finset.sum_le_sum ?_ intro i_1 _ have htri : |F fh (S i_1) - chainApprox c_pos h fh n (S i_1)| ≤ |F fh (S i_1)| + |chainApprox c_pos h fh n (S i_1)| := by exact abs_sub (F fh (S i_1)) (chainApprox c_pos h fh n (S i_1)) exact htri _ ≤ ∑ i_1, (sqrt (m : ℝ) * c + sqrt (m : ℝ) * c) := by refine Finset.sum_le_sum ?_ intro i_1 _ have hF : |F fh (S i_1)| ≤ sqrt (m : ℝ) * c := pointwise_bound_from_empirical_norm cs i_1 hmpos fh have hG : |chainApprox c_pos h fh n (S i_1)| ≤ sqrt (m : ℝ) * c := chainApprox_pointwise_bound c_pos hmpos cs n h i_1 fh have : |F fh (S i_1)| + |chainApprox c_pos h fh n (S i_1)| ≤ sqrt (m : ℝ) * c + sqrt (m : ℝ) * c := by nlinarith exact this _ = m * (2 * (sqrt (m : ℝ) * c)) := by simp grind
    Causalean.Stat.Concentration.splitBound.bddAbove_main_term · Causalean/Stat/Concentration/Covering/DudleyEntropy.lean:217
  • bddAbove_increment_term theorem — The sum of chaining increment terms has a finite upper bound.
    c_pos :
    0 < c
    cs :
    ∀ (f : ι), empiricalNorm S (F f) ≤ c
    h :
    n :
    m_pos :
    ¬m = 0
    i :
    Signs m
    BddAbove (Set.range fun fh ↦ ∑ x_1 : Fin n, ∑ i_1, ↑↑(i i_1) * (chainApprox c_pos h fh (↑x_1 + 1) (S i_1) - chainApprox c_pos h fh (↑x_1) (S i_1)))
    Proof (Lean source)
    theorem splitBound.bddAbove_increment_term {c_pos : 0 < c} (cs : ∀ (f : ι), empiricalNorm S (F f) ≤ c) (h : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S))) (n : ℕ) (m_pos : ¬m = 0) (i : Signs m) : BddAbove (Set.range fun fh ↦ ∑ x_1 : Fin n, ∑ i_1, ↑↑(i i_1) * (chainApprox c_pos h fh (↑x_1 + 1) (S i_1) - chainApprox c_pos h fh (↑x_1) (S i_1))) := by rw [bddAbove_def] classical refine ⟨(n : ℝ) * m * (2 * (sqrt (m : ℝ) * c)), ?_⟩ intro y hy rcases hy with ⟨fh, rfl⟩ have hmpos : 0 < m := Nat.pos_of_ne_zero m_pos calc (∑ x_1 : Fin n, ∑ i_1, (i i_1 : ℝ) * (chainApprox c_pos h fh (↑x_1 + 1) (S i_1) - chainApprox c_pos h fh (↑x_1) (S i_1))) ≤ ∑ x_1 : Fin n, ∑ i_1, |(i i_1 : ℝ) * (chainApprox c_pos h fh (↑x_1 + 1) (S i_1) - chainApprox c_pos h fh (↑x_1) (S i_1))| := by refine Finset.sum_le_sum ?_ intro _ _ refine Finset.sum_le_sum ?_ intro _ _ exact le_abs_self _ _ = ∑ x_1 : Fin n, ∑ i_1, |chainApprox c_pos h fh (↑x_1 + 1) (S i_1) - chainApprox c_pos h fh (↑x_1) (S i_1)| := by apply Finset.sum_congr rfl intro _ _ apply Finset.sum_congr rfl intro i_1 _ obtain ⟨v, hv⟩ := i i_1 simp at hv cases hv with | inl hv => simp [hv]; rw [<- abs_neg]; apply congrArg; linarith | inr hv => simp [hv] _ ≤ ∑ x_1 : Fin n, ∑ i_1, 2 * (sqrt (m : ℝ) * c) := by refine Finset.sum_le_sum ?_ intro x_1 _ refine Finset.sum_le_sum ?_ intro i_1 _ have hdiff : |chainApprox c_pos h fh (↑x_1 + 1) (S i_1) - chainApprox c_pos h fh (↑x_1) (S i_1)| ≤ 2 * (sqrt (m : ℝ) * c) := chainApprox_increment_bound c_pos hmpos cs (↑x_1) h i_1 fh nlinarith _ = (n : ℝ) * m * (2 * (sqrt (m : ℝ) * c)) := by simp [Finset.sum_const, Finset.card_univ, mul_assoc, mul_left_comm, mul_comm]
    Causalean.Stat.Concentration.splitBound.bddAbove_increment_term · Causalean/Stat/Concentration/Covering/DudleyEntropy.lean:266
  • signed_sum_le_empiricalDist lemma — A signed sum of pointwise differences is at most the sample size times the empirical distance between the two functions.
    f g :
    Z → ℝ
    σ :
    Signs m
    ∑ i : Fin m, (σ i : ℝ) * (f (S i) - g (S i)) ≤ m * empiricalDist S f g
    Proof (Lean source)
    lemma signed_sum_le_empiricalDist (f g : Z → ℝ) (σ : Signs m) : ∑ i : Fin m, (σ i : ℝ) * (f (S i) - g (S i)) ≤ m * empiricalDist S f g := by calc _ = @inner ℝ (EuclideanSpace ℝ (Fin m)) _ (toLp 2 fun i ↦ (σ i : ℝ)) (toLp 2 fun i ↦ f (S i) - g (S i)) := by simp [inner] apply Finset.sum_congr rfl intro i hi exact (RCLike.inner_apply' (↑↑(σ i) : ℝ) (f (S i) - g (S i))).symm -- Use Cauchy-Schwarz inequality _ ≤ (@norm (EuclideanSpace ℝ (Fin m)) _ (toLp 2 fun i ↦ (σ i : ℝ))) * (@norm (EuclideanSpace ℝ (Fin m)) _ (toLp 2 fun i ↦ f (S i) - g (S i))) := @real_inner_le_norm (EuclideanSpace ℝ (Fin m)) _ _ (toLp 2 fun i ↦ (σ i : ℝ)) (toLp 2 fun i ↦ f (S i) - g (S i)) _ = m * empiricalDist S f g := by simp [norm, empiricalNorm] have : (∑ i, (σ i : ℝ) ^ 2) = m := by have : (∑ i, (σ i : ℝ) ^ 2) = (∑ i : Fin m, 1) := by congr ext i obtain ⟨σi, hσi⟩ := σ i simp at hσi simp cases hσi with | inl h1 => right; rw [h1]; norm_num | inr h2 => left; rw [h2] rw [this] apply (Finset.sum_const 1).trans simp rw [Real.sqrt_eq_rpow, Real.sqrt_eq_rpow, ←mul_assoc] congr · rw [←Real.rpow_neg (by simp), ←Real.rpow_one_add' (by simp) (by norm_num)] congr norm_num · norm_num
    Causalean.Stat.Concentration.signed_sum_le_empiricalDist · Causalean/Stat/Concentration/Covering/DudleyEntropy.lean:572
  • mem_incrementPairFinset_repr theorem — Every increment-pair representative comes from two adjacent chain approximations for some function in the class.
    c_pos :
    0 < c
    h' :
    n :
    j :
    Fin n
    hk :
    (Z → ℝ) × (Z → ℝ)
    hk0 :
    hk ∈ incrementPairFinset c_pos h' n j
    ∃ fh, (chainApprox c_pos h' fh ((j : ℕ) + 1), chainApprox c_pos h' fh (j : ℕ)) = hk
    Proof (Lean source)
    theorem partB.mem_incrementPairFinset_repr (c_pos : 0 < c) (h' : TotallyBounded (Set.univ : Set (EmpiricalFunctionSpace F S))) (n : ℕ) (j : Fin n) (hk : (Z → ℝ) × (Z → ℝ)) (hk0 : hk ∈ incrementPairFinset c_pos h' n j) : ∃ fh, (chainApprox c_pos h' fh ((j : ℕ) + 1), chainApprox c_pos h' fh (j : ℕ)) = hk := by dsimp [incrementPairFinset] at hk0 simp at hk0 dsimp [incrementPairSet] at hk0 exact hk0
    Causalean.Stat.Concentration.partB.mem_incrementPairFinset_repr · Causalean/Stat/Concentration/Covering/DudleyEntropy.lean:1065
  • leftRiemann_sum_le_integral_antitoneOn theorem — For a monotone grid and an antitone integrand, a left Riemann term is bounded by the corresponding interval integral.
    n :
    f :
    ℕ → ℝ
    g :
    ℝ → ℝ
    hf :
    hg :
    AntitoneOn g (Icc (f 0) (f n))
    j :
    Fin n
    (f (j+1) - f j) * g (f (j+1)) ≤ ∫ (x : ℝ) in (f j)..(f (j+1)), g x
    Proof (Lean source)
    theorem MonotoneOn.leftRiemann_sum_le_integral_antitoneOn (n : ℕ) (f : ℕ → ℝ) (g : ℝ → ℝ) (hf : Monotone f) (hg : AntitoneOn g (Icc (f 0) (f n))) (j : Fin n): (f (j+1) - f j) * g (f (j+1)) ≤ ∫ (x : ℝ) in (f j)..(f (j+1)), g x := by calc _ = ∫ (x : ℝ) in (f j)..(f (j+1)), g (f (j+1)) := by simp _ ≤ _ := by apply intervalIntegral.integral_mono_on · apply hf simp · apply AntitoneOn.intervalIntegrable exact antitoneOn_const · apply AntitoneOn.intervalIntegrable refine antitoneOn_iff_forall_lt.mpr ?_ intro a ha b hb hab apply hg · suffices uIcc (f (j : ℕ)) (f ((j : ℕ) + 1)) ⊆ Icc (f 0) (f n) from by grind refine Set.uIcc_subset_Icc ?_ ?_ · constructor · apply hf simp · apply hf simp · constructor · apply hf simp · apply hf refine Order.add_one_le_of_lt ?_; simp · suffices uIcc (f (j : ℕ)) (f ((j : ℕ) + 1)) ⊆ Icc (f 0) (f n) from by grind refine Set.uIcc_subset_Icc ?_ ?_ · constructor · apply hf simp · apply hf simp · constructor · apply hf simp · apply hf refine Order.add_one_le_of_lt ?_; simp exact le_of_lt hab intro x hx simp at hx apply hg · constructor · have : f 0 ≤ f (j : ℕ) := by apply hf; simp linarith · have : f ((j : ℕ) + 1) ≤ f n := by apply hf; refine Order.add_one_le_of_lt ?_; simp linarith · constructor · apply hf simp · apply hf refine Order.add_one_le_of_lt ?_; simp exact hx.2
    Causalean.Stat.Concentration.MonotoneOn.leftRiemann_sum_le_integral_antitoneOn · Causalean/Stat/Concentration/Covering/DudleyEntropy.lean:1536
  • leftRiemann_sum_le_integral theorem — For an antitone grid and antitone integrand, the full left Riemann sum is bounded by the interval integral.
    n :
    f :
    ℕ → ℝ
    g :
    ℝ → ℝ
    hf :
    hg :
    AntitoneOn g (Icc (f n) (f 0))
    ∑ j : Fin n, (f j - f (j+1)) * g (f j) ≤ ∫ (x : ℝ) in (f n)..(f 0), g x
    Proof (Lean source)
    theorem AntitoneOn.leftRiemann_sum_le_integral (n : ℕ) (f : ℕ → ℝ) (g : ℝ → ℝ) (hf : Antitone f) (hg : AntitoneOn g (Icc (f n) (f 0))): ∑ j : Fin n, (f j - f (j+1)) * g (f j) ≤ ∫ (x : ℝ) in (f n)..(f 0), g x := by by_cases hnpos : 0 < n · let h (p : ℕ) := f (n-p) have s0 : f n = h 0 := by dsimp [h] have s1 : f 0 = h n := by dsimp [h]; simp have hh' : Monotone h := by dsimp [h] change Monotone (f ∘ (fun p ↦ (n - p))) apply Antitone.comp exact hf exact antitone_const_tsub rw [s0, s1] rw [<- intervalIntegral.sum_integral_adjacent_intervals] have t : ∑ j : Fin n, (f (j : ℕ) - f ((j : ℕ) + 1)) * g (f (j : ℕ)) = ∑ j : Fin n, (h ((j : ℕ) + 1) - h (j : ℕ)) * g (h ((j : ℕ) + 1)) := by let φ : Fin n ≃ Fin n := { toFun := fun j => ⟨n - 1 - j, by have hlt : n - 1 < n := Nat.pred_lt (Nat.ne_of_gt hnpos) exact lt_of_le_of_lt (Nat.sub_le _ _) hlt⟩ invFun := fun j => ⟨n - 1 - j, by have hlt : n - 1 < n := Nat.pred_lt (Nat.ne_of_gt hnpos) exact lt_of_le_of_lt (Nat.sub_le _ _) hlt⟩ left_inv := by intro j apply Fin.ext have hjle : (j : ℕ) ≤ n - 1 := Nat.le_pred_of_lt j.is_lt have : n - 1 - (n - 1 - j) = j := by grind simp [this] right_inv := by intro j apply Fin.ext have hjle : (j : ℕ) ≤ n - 1 := Nat.le_pred_of_lt j.is_lt have : n - 1 - (n - 1 - j) = j := by grind simp [this] } have tsum := (Equiv.sum_comp φ (fun j : Fin n => (f j - f (j + 1)) * g (f j))) -- simp the rewritten sum to expose `h` refine tsum.symm.trans ?_ refine Finset.sum_congr rfl ?_ intro j _ -- unpack φ and h change (f (φ j) - f (φ j + 1)) * g (f (φ j)) = (h (j + 1) - h j) * g (h (j + 1)) dsimp [φ, h] -- arithmetic on naturals have hjle : (j : ℕ) ≤ n - 1 := Nat.le_pred_of_lt j.is_lt simp [Nat.sub_sub, Nat.add_comm] left apply congrArg grind rw [t] have u : ∑ k ∈ range n, ∫ (x : ℝ) in h k..h (k + 1), g x = ∑ k : Fin n, ∫ (x : ℝ) in h k..h (k + 1), g x := by exact Finset.sum_range fun i ↦ ∫ (x : ℝ) in h i..h (i + 1), g x rw [u] apply Finset.sum_le_sum intro i yi apply MonotoneOn.leftRiemann_sum_le_integral_antitoneOn · exact hh' · rw [<-s0] rw [<-s1] exact hg intro k kn apply AntitoneOn.intervalIntegrable rw [s0] at hg rw [s1] at hg apply hg.mono refine Set.uIcc_subset_Icc ?_ ?_ constructor · apply hh' simp · apply hh' linarith constructor · apply hh' simp · apply hh' linarith · have n_zero : n = 0 := by linarith rw [n_zero] simp
    Causalean.Stat.Concentration.AntitoneOn.leftRiemann_sum_le_integral · Causalean/Stat/Concentration/Covering/DudleyEntropy.lean:1596
Sqrt­Log­Integral 1 core · 6 supporting Dudley entropy-integral evaluation for a logarithmic square-root kernel. ★ sqrtLog_integral_le

Dudley entropy-integral evaluation for a logarithmic square-root kernel.

This file proves the elementary bound ∫ x in ε..δ, sqrt (log (δ / x)) ≤ δ for 0 < ε ≤ δ. The proof uses the AM-GM inequality sqrt t ≤ (t + 1) / 2 for t ≥ 0 and the explicit antiderivative of log.

lemma sqrtLog_integral_le reviewed
Causalean.Stat.Concentration

Dudley entropy-integral evaluation. For a positive lower limit ε that is at most the upper limit δ, the integral of √(log(δ/x)) over [ε,δ] is at most δ - ε.

Formal statement
δ ε :
:
0 < ε
hεδ :
ε ≤ δ
(∫ x in ε..δ, sqrt (log (δ / x))) ≤ δ - ε
Proof (Lean source)
lemma sqrtLog_integral_le {δ ε : ℝ} (hε : 0 < ε) (hεδ : ε ≤ δ) : (∫ x in ε..δ, sqrt (log (δ / x))) ≤ δ - ε := by have hmono : (∫ x in ε..δ, sqrt (log (δ / x))) ≤ ∫ x in ε..δ, (log (δ / x) + 1) / 2 := by refine intervalIntegral.integral_mono_on hεδ (intervalIntegrable_sqrt_log_div hε hεδ) (intervalIntegrable_log_div_avg hε hεδ) ?_ intro x hx exact sqrt_le_add_one_div_two (log_div_nonneg_of_mem_Icc hε hx) have hlog : (∫ x in ε..δ, log (δ / x)) ≤ δ - ε := integral_log_div_le hε hεδ have havg : (∫ x in ε..δ, (log (δ / x) + 1) / 2) ≤ δ - ε := by have hint : (∫ x in ε..δ, (log (δ / x) + 1) / 2) = ((∫ x in ε..δ, log (δ / x)) + (δ - ε)) / 2 := by rw [intervalIntegral.integral_div] rw [intervalIntegral.integral_add] · rw [intervalIntegral.integral_const] simp [smul_eq_mul] · exact intervalIntegrable_log_div hε hεδ · exact intervalIntegrable_const rw [hint] linarith calc (∫ x in ε..δ, sqrt (log (δ / x))) ≤ ∫ x in ε..δ, (log (δ / x) + 1) / 2 := hmono _ ≤ δ - ε := havg
Causalean.Stat.Concentration.sqrtLog_integral_le · Causalean/Stat/Concentration/Covering/SqrtLogIntegral.lean:127
6 supporting declarations (lemmas, instances)
  • sqrt_le_add_one_div_two lemma — For nonnegative t, the square root is bounded by the arithmetic mean of t and 1.
    t :
    ht :
    0 ≤ t
    sqrt t ≤ (t + 1) / 2
    Proof (Lean source)
    lemma sqrt_le_add_one_div_two {t : ℝ} (ht : 0 ≤ t) : sqrt t ≤ (t + 1) / 2 := by have hsq : 0 ≤ (sqrt t - 1) ^ 2 := sq_nonneg _ have hsqrt_sq : (sqrt t) ^ 2 = t := by rw [Real.sq_sqrt ht] nlinarith [hsq, Real.sqrt_nonneg t, hsqrt_sq]
    Causalean.Stat.Concentration.sqrt_le_add_one_div_two · Causalean/Stat/Concentration/Covering/SqrtLogIntegral.lean:18
  • log_div_nonneg_of_mem_Icc lemma — On the interval [ε, δ], the log-ratio kernel is nonnegative.
    δ ε x :
    :
    0 < ε
    hx :
    x ∈ Icc ε δ
    0 ≤ log (δ / x)
    Proof (Lean source)
    lemma log_div_nonneg_of_mem_Icc {δ ε x : ℝ} (hε : 0 < ε) (hx : x ∈ Icc ε δ) : 0 ≤ log (δ / x) := by have hxpos : 0 < x := lt_of_lt_of_le hε hx.1 have hratio : 1 ≤ δ / x := by rw [le_div_iff₀ hxpos] simpa using hx.2 exact Real.log_nonneg hratio
    Causalean.Stat.Concentration.log_div_nonneg_of_mem_Icc · Causalean/Stat/Concentration/Covering/SqrtLogIntegral.lean:27
  • intervalIntegrable_sqrt_log_div lemma — When ε is positive and no larger than δ, the square-root log-ratio kernel is integrable on the interval from ε to δ with respect to Lebesgue measure.
    δ ε :
    :
    0 < ε
    hεδ :
    ε ≤ δ
    IntervalIntegrable (fun x : ℝ => sqrt (log (δ / x))) volume ε δ
    Proof (Lean source)
    lemma intervalIntegrable_sqrt_log_div {δ ε : ℝ} (hε : 0 < ε) (hεδ : ε ≤ δ) : IntervalIntegrable (fun x : ℝ => sqrt (log (δ / x))) volume ε δ := by have hcont : ContinuousOn (fun x : ℝ => sqrt (log (δ / x))) [[ε, δ]] := by simpa [Set.uIcc_of_le hεδ] using continuousOn_sqrt_log_div_Icc hε hεδ exact hcont.intervalIntegrable
    Causalean.Stat.Concentration.intervalIntegrable_sqrt_log_div · Causalean/Stat/Concentration/Covering/SqrtLogIntegral.lean:48
  • intervalIntegrable_log_div lemma — When ε is positive and no larger than δ, the logarithm of the ratio δ divided by x is interval-integrable from ε to δ with respect to Lebesgue measure.
    δ ε :
    :
    0 < ε
    hεδ :
    ε ≤ δ
    IntervalIntegrable (fun x : ℝ => log (δ / x)) volume ε δ
    Proof (Lean source)
    lemma intervalIntegrable_log_div {δ ε : ℝ} (hε : 0 < ε) (hεδ : ε ≤ δ) : IntervalIntegrable (fun x : ℝ => log (δ / x)) volume ε δ := by have hδ : 0 < δ := lt_of_lt_of_le hε hεδ have hcont : ContinuousOn (fun x : ℝ => log (δ / x)) (Icc ε δ) := by refine ContinuousOn.log ?_ ?_ · exact (continuousOn_const (c := δ)).div continuousOn_id (fun x hx => by linarith [hx.1]) · intro x hx exact div_ne_zero (ne_of_gt hδ) (by linarith [hx.1]) have hcont' : ContinuousOn (fun x : ℝ => log (δ / x)) [[ε, δ]] := by simpa [Set.uIcc_of_le hεδ] using hcont exact hcont'.intervalIntegrable
    Causalean.Stat.Concentration.intervalIntegrable_log_div · Causalean/Stat/Concentration/Covering/SqrtLogIntegral.lean:74
  • integral_log_div_eq lemma — Exact evaluation of the logarithmic ratio integral on [ε, δ].
    δ ε :
    :
    0 < ε
    hεδ :
    ε ≤ δ
    (∫ x in ε..δ, log (δ / x)) = δ - ε - ε * log (δ / ε)
    Proof (Lean source)
    lemma integral_log_div_eq {δ ε : ℝ} (hε : 0 < ε) (hεδ : ε ≤ δ) : (∫ x in ε..δ, log (δ / x)) = δ - ε - ε * log (δ / ε) := by have hδ : 0 < δ := lt_of_lt_of_le hε hεδ calc (∫ x in ε..δ, log (δ / x)) = ∫ x in ε..δ, (log δ - log x) := by refine intervalIntegral.integral_congr ?_ intro x hx have hxIcc : x ∈ Icc ε δ := by simpa [Set.uIcc_of_le hεδ] using hx have hxpos : 0 < x := lt_of_lt_of_le hε hxIcc.1 simpa using Real.log_div (ne_of_gt hδ) (ne_of_gt hxpos) _ = (δ - ε) * log δ - (δ * log δ - ε * log ε - δ + ε) := by rw [intervalIntegral.integral_sub] · rw [intervalIntegral.integral_const] rw [integral_log] simp [smul_eq_mul] · exact intervalIntegrable_const · exact intervalIntegral.intervalIntegrable_log' _ = δ - ε - ε * log (δ / ε) := by rw [Real.log_div (ne_of_gt hδ) (ne_of_gt hε)] ring
    Causalean.Stat.Concentration.integral_log_div_eq · Causalean/Stat/Concentration/Covering/SqrtLogIntegral.lean:90
  • integral_log_div_le lemma — The logarithmic ratio integral over [ε, δ] is at most the interval length.
    δ ε :
    :
    0 < ε
    hεδ :
    ε ≤ δ
    (∫ x in ε..δ, log (δ / x)) ≤ δ - ε
    Proof (Lean source)
    lemma integral_log_div_le {δ ε : ℝ} (hε : 0 < ε) (hεδ : ε ≤ δ) : (∫ x in ε..δ, log (δ / x)) ≤ δ - ε := by have hratio : 1 ≤ δ / ε := by rw [le_div_iff₀ hε] simpa using hεδ have hnonneg : 0 ≤ ε * log (δ / ε) := mul_nonneg (le_of_lt hε) (Real.log_nonneg hratio) rw [integral_log_div_eq hε hεδ] linarith
    Causalean.Stat.Concentration.integral_log_div_le · Causalean/Stat/Concentration/Covering/SqrtLogIntegral.lean:116
VCLocalized­Covering 1 core · 0 supporting Metric bridge between empirical L² distance and weighted Boolean Hamming distance. ★ empiricalDist_sq_eq_weightedHammingSq

Metric bridge between empirical L² distance and weighted Boolean Hamming distance.

This file records the samplewise algebra used by localized finite-VC covering arguments: for binary-factored real classes, empirical L² distance is exactly the weighted Hamming distance of the induced Boolean traces.

theorem empiricalDist_sq_eq_weightedHammingSq reviewed
Causalean.Stat.Concentration

Empirical L² distance as weighted Hamming distance. For a real-valued class that factors through a Boolean classifier at each sample coordinate, F i (S j) = φ j (π i (S j)), the squared empirical L²(Pₙ) distance between two members F i and F i' equals the weighted Hamming distance² of their induced Boolean sample-patterns, with per-coordinate weight (φ j true − φ j false)² / n.

Formal statement
ι 𝒳 :
Type*
n :
F :
ι → 𝒳 → ℝ
S :
Fin n → 𝒳
π :
ι → 𝒳 → Bool
φ :
Fin n → Bool → ℝ
hfactor :
∀ i j, F i (S j) = φ j (π i (S j))
i i' :
ι
(empiricalDist S (F i) (F i')) ^ 2
= weightedHammingSq (fun j => (φ j true - φ j false) ^ 2 / (n : ℝ)) (fun j => π i (S j)) (fun j => π i' (S j))
Proof (Lean source)
theorem empiricalDist_sq_eq_weightedHammingSq {ι 𝒳 : Type*} {n : ℕ} (F : ι → 𝒳 → ℝ) (S : Fin n → 𝒳) (π : ι → 𝒳 → Bool) (φ : Fin n → Bool → ℝ) (hfactor : ∀ i j, F i (S j) = φ j (π i (S j))) (i i' : ι) : (empiricalDist S (F i) (F i')) ^ 2 = weightedHammingSq (fun j => (φ j true - φ j false) ^ 2 / (n : ℝ)) (fun j => π i (S j)) (fun j => π i' (S j)) := by classical unfold empiricalDist empiricalNorm weightedHammingSq rw [Real.sq_sqrt] · rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro j _hj simp only [Pi.sub_apply] rw [hfactor i j, hfactor i' j] cases π i (S j) <;> cases π i' (S j) all_goals simp only [reduceCtorEq, if_true, if_false] ring · positivity
Causalean.Stat.Concentration.empiricalDist_sq_eq_weightedHammingSq · Causalean/Stat/Concentration/Covering/VCLocalizedCovering.lean:16 · uses empiricalDist , weightedHammingSq
VCUniform­Deviation 2 core · 6 supporting Finite-VC localized uniform-deviation bounds derived from the sharp localized empirical-process theorem. ★ vc_localized_deviation_event★ vc_localized_deviation_event_of_card

Finite-VC localized uniform-deviation bounds derived from the sharp localized empirical-process theorem.

For a finite-VC binary-indexed function class, with high probability the localized empirical process deviates from its mean by at most 8ρ * ‖f‖ + 5ρ² uniformly over the class, with critical radius ρ of order sqrt(d * log n / n) -- derived by instantiating localized_uniform_deviation_sharp with the finite-VC localized envelope.

This file is the finite-VC specialization layer for the sharp localized uniform deviation theorem. The empirical-process content is supplied by VCLocalizedRegime.lean; the only application-specific arithmetic left to callers is the peeling/log domination condition. It exports the VC-dimension event vc_localized_deviation_event, the direct growth-cardinality variant vc_localized_deviation_event_of_card, and the measurability/integrability bridges needed to instantiate the sharp theorem.

theorem vc_localized_deviation_event reviewed
Causalean.Stat.Concentration

Finite-VC localized uniform deviation event. For a class of measurable real-valued functions uniformly bounded in absolute value by a nonnegative constant b, with a localization constant K at least 1 and a positive sample size n, suppose the class factors through a binary Boolean family of VC dimension at most d and satisfies the localized Dudley hypotheses relative to the given seminorm. For a failure probability δ in (0,1], writing ρ for the localized slope vcLocalizedSlope K d n, if ρ is at most b and the peeling/log-domination side condition holds at every dyadic scale, then there is a measurable event of probability at least 1 - δ on which every class member i with 0 ≤ norm (F i) ≤ b satisfies the sharp localized deviation bound |n⁻¹ ∑ₖ F i(ωₖ) − 𝔼[F i]| ≤ 8ρ·norm(F i) + 5ρ².

Formal statement
F :
ι → 𝒳 → ℝ
norm :
(𝒳 → ℝ) → ℝ
hF_meas :
∀ i, Measurable (F i)
b :
hb :
0 ≤ b
hbound :
∀ i x, |F i x| ≤ b
K :
d n :
hK :
(1 : ℝ) ≤ K
hn :
0 < n
δ :
:
0 < δ
hδ' :
δ ≤ 1
hρ_le_b :
vcLocalizedSlope K d n ≤ b
hδ_dom :
∀ L : ℕ
if
b ≤ vcLocalizedSlope K d n * (2 : ℝ) ^ L
then
b * sqrt (2 * log (2 * ((L : ℝ) + 1) / δ) / n) ≤ (vcLocalizedSlope K d n) ^ 2
∃ E : Set (Fin n → 𝒳)
if
Measure.pi (fun _ => μ) E ≥ 1 - ofReal δ ∧
∀ ω ∈ E, ∀ i : ι, 0 ≤ norm (F i)
and
norm (F i) ≤ b
then
|(n : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin n => F i (ω k)) - μ[fun x => F i x]|
≤ 8 * vcLocalizedSlope K d n * norm (F i) + 5 * (vcLocalizedSlope K d n) ^ 2
Proof (Lean source)
theorem vc_localized_deviation_event (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (μ : Measure 𝒳) [IsProbabilityMeasure μ] (hF_meas : ∀ i, Measurable (F i)) (b : ℝ) (hb : 0 ≤ b) (hbound : ∀ i x, |F i x| ≤ b) (K : ℝ) (d n : ℕ) (hK : (1 : ℝ) ≤ K) (hn : 0 < n) (Hvc : BinaryFactoredVCClass F d) (Hloc : LocalizedVCDudleyHypotheses F norm) {δ : ℝ} (hδ : 0 < δ) (hδ' : δ ≤ 1) (hρ_le_b : vcLocalizedSlope K d n ≤ b) (hδ_dom : ∀ L : ℕ, b ≤ vcLocalizedSlope K d n * (2 : ℝ) ^ L → b * sqrt (2 * log (2 * ((L : ℝ) + 1) / δ) / n) ≤ (vcLocalizedSlope K d n) ^ 2) : ∃ E : Set (Fin n → 𝒳), MeasurableSet E ∧ Measure.pi (fun _ => μ) E ≥ 1 - ofReal δ ∧ ∀ ω ∈ E, ∀ i : ι, 0 ≤ norm (F i) → norm (F i) ≤ b → |(n : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin n => F i (ω k)) - μ[fun x => F i x]| ≤ 8 * vcLocalizedSlope K d n * norm (F i) + 5 * (vcLocalizedSlope K d n) ^ 2 := by classical have hK0 : 0 ≤ K := le_trans zero_le_one hK let R : LocalizedRegime 𝒳 ι 𝒳 F norm μ id := vcLocalizedRegime F norm μ id b hb (by simpa using hbound) K d hK Hvc Hloc let ρ : ℝ := vcLocalizedSlope K d n have hρ_pos : 0 < ρ := vcLocalizedSlope_pos hK0 hn have hcrit_eq : criticalRadius (R.ψ n) = ρ := by dsimp [R, vcLocalizedRegime, vcLocalizedPsi, ρ] exact criticalRadius_linear_eq hρ_pos have hcrit_le_ρ : criticalRadius (R.ψ n) ≤ ρ := by rw [hcrit_eq] have hcrit_pos : 0 < criticalRadius (R.ψ n) := by rw [hcrit_eq] exact hρ_pos have hcrit_fp : R.ψ n (criticalRadius (R.ψ n)) ≤ (criticalRadius (R.ψ n)) ^ 2 := by dsimp [R, vcLocalizedRegime] exact vcLocalizedPsi_criticalRadius_fp hK0 hn have hrad_bdd : ∀ r : ℝ, ρ ≤ r → ∀ S : Fin n → 𝒳, ∀ σ : Signs n, BddAbove (Set.range fun p : starHullParam ι => |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r p (S k)|) := by intro r _hr exact fun S σ => starHullZeroOut_bddAbove_of_bound F norm hb n r S (fun i k => hbound i _) σ have hrad_int : ∀ r : ℝ, ρ ≤ r → Integrable (fun ω : Fin n → 𝒳 => empiricalRademacherComplexity n (starHullZeroOut F norm r) (id ∘ ω)) (Measure.pi (fun _ => μ)) := by intro r hr exact vc_starHullZeroOut_empirical_rademacher_integrable F norm μ hF_meas b hb hbound K d n hK hn Hvc Hloc r hr rcases localized_uniform_deviation_sharp F norm μ id measurable_id hF_meas R hδ hδ' n hn (ρ := ρ) (Rmax := b) hcrit_le_ρ hρ_pos hcrit_pos hcrit_fp hrad_bdd hrad_int hδ_dom with ⟨E, hE_meas, hE_prob, hE_bound⟩ refine ⟨E, hE_meas, hE_prob, ?_⟩ intro ω hω i hi_nonneg hi_b simpa [R, ρ] using hE_bound ω hω i hi_nonneg hi_b
theorem vc_localized_deviation_event_of_card reviewed
Causalean.Stat.Concentration

Growth-cardinality localized uniform deviation event. For a class of measurable real-valued functions uniformly bounded in absolute value by a nonnegative constant b that factors through a Boolean classifier π at every finite sample, for a coordinate transform φ with F i (S j) = φ j (π i (S j)), with a localization constant K at least 1 and a positive sample size n, suppose the induced Boolean growth family satisfies the direct cardinality bound #growthFamily π S ≤ (m+1)^dPi on every finite sample of size m and the class satisfies the localized Dudley hypotheses relative to the given seminorm. For a failure probability δ in (0,1], writing ρ for the localized slope vcLocalizedSlope K dPi n, if ρ is at most b and the peeling/log-domination side condition holds at every dyadic scale, then there is a measurable event of probability at least 1 - δ on which every class member i with 0 ≤ norm (F i) ≤ b satisfies the sharp localized deviation bound |n⁻¹ ∑ₖ F i(ωₖ) − 𝔼[F i]| ≤ 8ρ·norm(F i) + 5ρ².

Formal statement
F :
ι → 𝒳 → ℝ
norm :
(𝒳 → ℝ) → ℝ
π :
ι → 𝒳 → Bool
hF_meas :
∀ i, Measurable (F i)
b :
hb :
0 ≤ b
hbound :
∀ i x, |F i x| ≤ b
hfactor :
∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))
K :
dPi n :
hK :
(1 : ℝ) ≤ K
hn :
0 < n
hcard :
∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPi
δ :
:
0 < δ
hδ' :
δ ≤ 1
hρ_le_b :
vcLocalizedSlope K dPi n ≤ b
hδ_dom :
∀ L : ℕ
if
b ≤ vcLocalizedSlope K dPi n * (2 : ℝ) ^ L
then
b * sqrt (2 * log (2 * ((L : ℝ) + 1) / δ) / n) ≤ (vcLocalizedSlope K dPi n) ^ 2
∃ E : Set (Fin n → 𝒳)
if
Measure.pi (fun _ => μ) E ≥ 1 - ofReal δ ∧
∀ ω ∈ E, ∀ i : ι, 0 ≤ norm (F i)
and
norm (F i) ≤ b
then
|(n : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin n => F i (ω k)) - μ[fun x => F i x]|
≤ 8 * vcLocalizedSlope K dPi n * norm (F i) + 5 * (vcLocalizedSlope K dPi n) ^ 2
Proof (Lean source)
theorem vc_localized_deviation_event_of_card (F : ι → 𝒳 → ℝ) (norm : (𝒳 → ℝ) → ℝ) (π : ι → 𝒳 → Bool) (μ : Measure 𝒳) [IsProbabilityMeasure μ] (hF_meas : ∀ i, Measurable (F i)) (b : ℝ) (hb : 0 ≤ b) (hbound : ∀ i x, |F i x| ≤ b) (hfactor : ∀ {m : ℕ} (S : Fin m → 𝒳), ∃ φ : Fin m → Bool → ℝ, ∀ i j, F i (S j) = φ j (π i (S j))) (K : ℝ) (dPi n : ℕ) (hK : (1 : ℝ) ≤ K) (hn : 0 < n) (hcard : ∀ (m : ℕ) (S : Fin m → 𝒳), (growthFamily π S).card ≤ (m + 1) ^ dPi) (Hloc : LocalizedVCDudleyHypotheses F norm) {δ : ℝ} (hδ : 0 < δ) (hδ' : δ ≤ 1) (hρ_le_b : vcLocalizedSlope K dPi n ≤ b) (hδ_dom : ∀ L : ℕ, b ≤ vcLocalizedSlope K dPi n * (2 : ℝ) ^ L → b * sqrt (2 * log (2 * ((L : ℝ) + 1) / δ) / n) ≤ (vcLocalizedSlope K dPi n) ^ 2) : ∃ E : Set (Fin n → 𝒳), MeasurableSet E ∧ Measure.pi (fun _ => μ) E ≥ 1 - ofReal δ ∧ ∀ ω ∈ E, ∀ i : ι, 0 ≤ norm (F i) → norm (F i) ≤ b → |(n : ℝ)⁻¹ * (Finset.univ.sum fun k : Fin n => F i (ω k)) - μ[fun x => F i x]| ≤ 8 * vcLocalizedSlope K dPi n * norm (F i) + 5 * (vcLocalizedSlope K dPi n) ^ 2 := by classical have hK0 : 0 ≤ K := le_trans zero_le_one hK let R : LocalizedRegime 𝒳 ι 𝒳 F norm μ id := vcLocalizedRegime_of_card F norm π μ id b hb (by simpa using hbound) hfactor K dPi hK hcard Hloc let ρ : ℝ := vcLocalizedSlope K dPi n have hρ_pos : 0 < ρ := vcLocalizedSlope_pos hK0 hn have hcrit_eq : criticalRadius (R.ψ n) = ρ := by dsimp [R, vcLocalizedRegime_of_card, vcLocalizedPsi, ρ] exact criticalRadius_linear_eq hρ_pos have hcrit_le_ρ : criticalRadius (R.ψ n) ≤ ρ := by rw [hcrit_eq] have hcrit_pos : 0 < criticalRadius (R.ψ n) := by rw [hcrit_eq] exact hρ_pos have hcrit_fp : R.ψ n (criticalRadius (R.ψ n)) ≤ (criticalRadius (R.ψ n)) ^ 2 := by dsimp [R, vcLocalizedRegime_of_card] exact vcLocalizedPsi_criticalRadius_fp hK0 hn have hrad_bdd : ∀ r : ℝ, ρ ≤ r → ∀ S : Fin n → 𝒳, ∀ σ : Signs n, BddAbove (Set.range fun p : starHullParam ι => |(n : ℝ)⁻¹ * ∑ k : Fin n, (σ k : ℝ) * starHullZeroOut F norm r p (S k)|) := by intro r _hr exact fun S σ => starHullZeroOut_bddAbove_of_bound F norm hb n r S (fun i k => hbound i _) σ have hrad_int : ∀ r : ℝ, ρ ≤ r → Integrable (fun ω : Fin n → 𝒳 => empiricalRademacherComplexity n (starHullZeroOut F norm r) (id ∘ ω)) (Measure.pi (fun _ => μ)) := by intro r hr exact vc_starHullZeroOut_empirical_rademacher_integrable_of_card F norm π μ hF_meas b hb hbound hfactor K dPi n hK hn hcard Hloc r hr rcases localized_uniform_deviation_sharp F norm μ id measurable_id hF_meas R hδ hδ' n hn (ρ := ρ) (Rmax := b) hcrit_le_ρ hρ_pos hcrit_pos hcrit_fp hrad_bdd hrad_int hδ_dom with ⟨E, hE_meas, hE_prob, hE_bound⟩ refine ⟨E, hE_meas, hE_prob, ?_⟩ intro ω hω i hi_nonneg hi_b simpa [R, ρ] using hE_bound ω hω i hi_nonneg hi_b
6 supporting declarations (lemmas, instances)