Stat.Concentration

Concentration inequalities: Hoeffding/Bernstein-type bounds, bounded differences, symmetrization, empirical-process separability, entropy chaining, and empirical-Bernstein refinements.

Matrix 5 core · 7 supporting · 5 submodules Concentration for random matrices and design (Gram) inverses: the resolvent, inverse-perturbation bounds, the inverse union bound, the design-inverse concentration result, and i.i.d. Uniform­Deviation 22 core · 12 supporting · 5 submodules Localized uniform-deviation bounds and their consequences: the localized envelope expectation, the ERM oracle inequality, the critical-radius fixed point, finite-sample confidence intervals, and the bounded-difference dr Rademacher 11 core · 27 supporting · 4 submodules Rademacher and local Rademacher complexity and the tools that bound them: symmetrization, the Ledoux–Talagrand contraction principle, and star-hull localization. Tail­Bounds 23 core · 35 supporting · 7 submodules Scalar/bounded-difference tail inequalities: Hoeffding, Bernstein and its empirical (variance-adaptive) form, McDiarmid's bounded-difference inequality, the sub-exponential moment-generating-function machinery, finite ma Covering 44 to review 76 core · 147 supporting · 11 submodules 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 Variance­Adaptive­VCExpected­Maximal 15 to review 15 core · 6 supporting · 6 submodules Umbrella import for the countable-class variance-adaptive VC-type expected maximal inequality and its polynomial-cover adapter.
Chebyshev 1 core · 0 supporting This module provides a real-valued Chebyshev probability bound for one square-integrable statistic whose mean is known and whose variance has a supplied upper bound. ★ probability_abs_sub_mean_gt_le

Chebyshev bounds with a supplied variance envelope

This module provides a real-valued Chebyshev probability bound for one square-integrable statistic whose mean is known and whose variance has a supplied upper bound. This differs from iid_sum_chebyshev, which specializes to an i.i.d. sum with its exact variance and states the result as an ENNReal measure bound.

lemma probability_abs_sub_mean_gt_le reviewed
Causalean.Stat.Concentration

For a finite measure Q and a statistic F on the underlying space, if F is square-integrable under Q, the deviation threshold a is positive, F has mean equal to mean under Q, and the variance of F under Q is at most the envelope v, then the probability that F deviates from mean by more than a in absolute value is at most v/a².

Formal statement
Ω :
F :
Ω → ℝ
mean v a :
hF :
MemLp F 2 Q
ha :
0 < a
hmean :
(∫ x, F x ∂Q) = mean
hvar :
variance F Q ≤ v
(Q {x | a < |F x - mean|}).toReal ≤ v / a ^ 2
Proof (Lean source)
lemma probability_abs_sub_mean_gt_le {Ω : Type*} [MeasurableSpace Ω] (Q : Measure Ω) [IsFiniteMeasure Q] (F : Ω → ℝ) (mean v a : ℝ) (hF : MemLp F 2 Q) (ha : 0 < a) (hmean : (∫ x, F x ∂Q) = mean) (hvar : variance F Q ≤ v) : (Q {x | a < |F x - mean|}).toReal ≤ v / a ^ 2 := by have hcheb := meas_ge_le_variance_div_sq hF ha have hsub : {x | a < |F x - mean|} ⊆ {x | a ≤ |F x - ∫ y, F y ∂Q|} := by intro x hx simp only [Set.mem_setOf_eq] at hx ⊢ rw [hmean] exact hx.le calc (Q {x | a < |F x - mean|}).toReal ≤ (Q {x | a ≤ |F x - ∫ y, F y ∂Q|}).toReal := measureReal_mono hsub _ ≤ (ofReal (variance F Q / a ^ 2)).toReal := ENNReal.toReal_mono ENNReal.ofReal_ne_top hcheb _ = variance F Q / a ^ 2 := by rw [ENNReal.toReal_ofReal] exact div_nonneg (variance_nonneg _ _) (sq_nonneg _) _ ≤ v / a ^ 2 := by exact div_le_div_of_nonneg_right hvar (sq_nonneg _)
Causalean.Stat.Concentration.probability_abs_sub_mean_gt_le · Causalean/Stat/Concentration/Chebyshev.lean:23
Conditional­Kernel 1 core · 3 supporting This module collects measure-theoretic bridges used before applying ordinary probability inequalities on almost every fiber of a regular conditional distribution. ★ hasSubgaussianMGF_linearCombination_of_iIndep

Fiberwise facts for regular conditional distributions

This module collects measure-theoretic bridges used before applying ordinary probability inequalities on almost every fiber of a regular conditional distribution. In particular, ambient almost-sure facts remain almost sure on almost every conditional fiber, and a real random variable measurable with respect to the conditioning σ-algebra is constant on almost every fiber.

theorem hasSubgaussianMGF_linearCombination_of_iIndep reviewed
Causalean.Stat.Concentration

For a finite family of real random variables eps and real coefficients v, if each eps i is a.e. measurable, each eps i is a.s. bounded by 1 in absolute value, each eps i has mean zero, and the family eps is independent, then the linear combination iviepsi\sum_i v_i \cdot \mathrm{eps}_i is sub-Gaussian with variance proxy ivi2\sum_i v_i^2.

Formal statement
Ω ι :
eps :
ι → Ω → ℝ
v :
ι → ℝ
hmeas :
∀ i, AEMeasurable (eps i) P
hbound :
∀ i, ∀ᵐ ω ∂P, |eps i ω| ≤ 1
hcenter :
∀ i, ∫ ω, eps i ω ∂P = 0
hindep :
iIndepFun eps P
HasSubgaussianMGF (fun ω ↦ ∑ i, v i * eps i ω) ⟨∑ i, (v i) ^ 2, by positivity⟩ P
Proof (Lean source)
theorem hasSubgaussianMGF_linearCombination_of_iIndep {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] {P : Measure Ω} [IsProbabilityMeasure P] (eps : ι → Ω → ℝ) (v : ι → ℝ) (hmeas : ∀ i, AEMeasurable (eps i) P) (hbound : ∀ i, ∀ᵐ ω ∂P, |eps i ω| ≤ 1) (hcenter : ∀ i, ∫ ω, eps i ω ∂P = 0) (hindep : iIndepFun eps P) : HasSubgaussianMGF (fun ω ↦ ∑ i, v i * eps i ω) ⟨∑ i, (v i) ^ 2, by positivity⟩ P := by let Y : ι → Ω → ℝ := fun i ω ↦ v i * eps i ω let c : ι → ℝ≥0 := fun i ↦ ⟨(v i) ^ 2, sq_nonneg (v i)⟩ have hYindep : iIndepFun Y P := hindep.comp (fun i x ↦ v i * x) (fun i ↦ measurable_const_mul (v i)) have hYsub : ∀ i, HasSubgaussianMGF (Y i) (c i) P := by intro i have hYbound : ∀ᵐ ω ∂P, Y i ω ∈ Icc (-|v i|) |v i| := by filter_upwards [hbound i] with ω hω have habs : |Y i ω| ≤ |v i| := by change |v i * eps i ω| ≤ |v i| rw [abs_mul] nlinarith [abs_nonneg (v i)] exact (abs_le.mp habs) have hYcenter : ∫ ω, Y i ω ∂P = 0 := by simp only [Y, integral_const_mul, hcenter, mul_zero] have hsub := hasSubgaussianMGF_of_mem_Icc_of_integral_eq_zero ((hmeas i).const_mul (v i)) hYbound hYcenter have hc : ((‖|v i| - -|v i|‖₊ / 2) ^ 2) = c i := by apply NNReal.eq simp only [c, NNReal.coe_pow, NNReal.coe_div, NNReal.coe_ofNat, NNReal.coe_mk, coe_nnnorm] rw [Real.norm_eq_abs, abs_of_nonneg (by linarith [abs_nonneg (v i)] : 0 ≤ |v i| - -|v i|)] ring_nf exact sq_abs (v i) rw [hc] at hsub simpa only [Y] using hsub have hsum := HasSubgaussianMGF.sum_of_iIndepFun hYindep (s := univ) (fun i _ ↦ hYsub i) have hc_sum : (∑ i, c i) = ⟨∑ i, (v i) ^ 2, by positivity⟩ := by apply NNReal.eq rw [NNReal.coe_sum] rfl rw [hc_sum] at hsum simpa only [Y] using hsum
Causalean.Stat.Concentration.hasSubgaussianMGF_linearCombination_of_iIndep · Causalean/Stat/Concentration/ConditionalKernel.lean:97
3 supporting declarations (lemmas, instances)
  • ae_iIndepFun_real theorem — Kernel independence of a finite family of measurable real random variables specializes to ordinary independence on almost every probability fiber. The countable rational half-line generator is what permits one common outer null set for all measurable events.
    α Ω ι :
    Type*
    Kernel α Ω
    Finite ι
    ι → Ω → ℝ
    hX :
    ∀ i, Measurable (X i)
    h :
    iIndepFun X κ ν
    ∀ᵐ a ∂ν, iIndepFun X (κ a)
    Proof (Lean source)
    theorem ProbabilityTheory.Kernel.iIndepFun.ae_iIndepFun_real {α Ω ι : Type*} [MeasurableSpace α] [MeasurableSpace Ω] {κ : Kernel α Ω} {ν : Measure α} [Finite ι] {X : ι → Ω → ℝ} (hX : ∀ i, Measurable (X i)) (h : iIndepFun X κ ν) : ∀ᵐ a ∂ν, iIndepFun X (κ a) := by classical let cuts : Set (Set ℝ) := ⋃ q : ℚ, {Iic (q : ℝ)} have hident : ∀ᵐ a ∂ν, ∀ (S : Finset ι) (q : ι → ℚ), κ a (⋂ i ∈ S, X i ⁻¹' Iic (q i : ℝ)) = ∏ i ∈ S, κ a (X i ⁻¹' Iic (q i : ℝ)) := by rw [ae_all_iff] intro S rw [ae_all_iff] intro q exact (ProbabilityTheory.Kernel.iIndepFun_iff_measure_inter_preimage_eq_mul (fun _ : ι ↦ borel ℝ) X).mp h S (fun i _ ↦ measurableSet_Iic) filter_upwards [h.ae_isProbabilityMeasure, hident] with a hprob ha let π : ι → Set (Set Ω) := fun i ↦ (fun s : Set ℝ ↦ X i ⁻¹' s) '' cuts have hπ_pi : ∀ i, IsPiSystem (π i) := by intro i convert Real.isPiSystem_Iic_rat.comap (X i) using 1 rfl have hπ_gen : ∀ i, comap (X i) (borel ℝ) = MeasurableSpace.generateFrom (π i) := by intro i rw [Real.borel_eq_generateFrom_Iic_rat, MeasurableSpace.comap_generateFrom] have hπ_ind : ProbabilityTheory.iIndepSets π (κ a) := by rw [ProbabilityTheory.iIndepSets_iff] intro S sets hsets have hrat (i : ι) (hi : i ∈ S) : ∃ q : ℚ, X i ⁻¹' Iic (q : ℝ) = sets i := by rcases hsets i hi with ⟨t, ht, htset⟩ simp only [cuts, Set.mem_iUnion, Set.mem_singleton_iff] at ht obtain ⟨q, hq⟩ := ht subst t exact ⟨q, htset⟩ let q : ι → ℚ := fun i ↦ if hi : i ∈ S then choose (hrat i hi) else 0 have hset (i : ι) (hi : i ∈ S) : sets i = X i ⁻¹' Iic (q i : ℝ) := by simp only [q, dif_pos hi] exact (Classical.choose_spec (hrat i hi)).symm have hinter : (⋂ i ∈ S, sets i) = ⋂ i ∈ S, X i ⁻¹' Iic (q i : ℝ) := by apply Set.iInter_congr intro i apply Set.iInter_congr intro hi exact hset i hi have hprod : (∏ i ∈ S, κ a (sets i)) = ∏ i ∈ S, κ a (X i ⁻¹' Iic (q i : ℝ)) := by apply Finset.prod_congr rfl intro i hi rw [hset i hi] rw [hinter, hprod] exact ha S q haveI : IsProbabilityMeasure (κ a) := hprob have hspaces : ProbabilityTheory.iIndep (fun i ↦ comap (X i) (borel ℝ)) (κ a) := ProbabilityTheory.iIndepSets.iIndep (fun i ↦ comap_le (hX i)) π hπ_pi hπ_gen hπ_ind exact hspaces
    Causalean.Stat.Concentration.ProbabilityTheory.Kernel.iIndepFun.ae_iIndepFun_real · Causalean/Stat/Concentration/ConditionalKernel.lean:28
  • ae_ae_condExpKernel_of_ae theorem — An ambient almost-sure proposition holds on almost every fiber of the regular conditional distribution.
    hm :
    m ≤ mΩ
    p :
    Ω → Prop
    hp :
    ∀ᵐ ω ∂μ, p ω
    ∀ᵐ ω ∂μ.trim hm, ∀ᵐ ω' ∂ProbabilityTheory.condExpKernel (mΩ := mΩ) μ m ω, p ω'
    Proof (Lean source)
    theorem ae_ae_condExpKernel_of_ae {Ω : Type*} [mΩ : MeasurableSpace Ω] [StandardBorelSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] {m : MeasurableSpace Ω} (hm : m ≤ mΩ) {p : Ω → Prop} (hp : ∀ᵐ ω ∂μ, p ω) : ∀ᵐ ω ∂μ.trim hm, ∀ᵐ ω' ∂ProbabilityTheory.condExpKernel (mΩ := mΩ) μ m ω, p ω' := by apply Measure.ae_ae_of_ae_comp rwa [ProbabilityTheory.condExpKernel_comp_trim (mΩ := mΩ) hm]
    Causalean.Stat.Concentration.ae_ae_condExpKernel_of_ae · Causalean/Stat/Concentration/ConditionalKernel.lean:149
  • ae_eq_const_condExpKernel_of_measurable theorem — A random variable measurable with respect to the conditioning σ-algebra equals its observed value on almost every conditional fiber.
    hm :
    m ≤ mΩ
    β :
    Type*
    Ω → β
    hf :
    ∀ᵐ ω ∂μ.trim hm, ∀ᵐ ω' ∂ProbabilityTheory.condExpKernel (mΩ := mΩ) μ m ω, f ω' = f ω
    Proof (Lean source)
    theorem ae_eq_const_condExpKernel_of_measurable {Ω : Type*} [mΩ : MeasurableSpace Ω] [StandardBorelSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] {m : MeasurableSpace Ω} (hm : m ≤ mΩ) {β : Type*} [MeasurableSpace β] [MeasurableEq β] {f : Ω → β} (hf : Measurable[m] f) : ∀ᵐ ω ∂μ.trim hm, ∀ᵐ ω' ∂ProbabilityTheory.condExpKernel (mΩ := mΩ) μ m ω, f ω' = f ω := by refine @Measure.ae_ae_of_ae_compProd Ω Ω m mΩ (μ.trim hm) (condExpKernel (mΩ := mΩ) μ m) _ _ (fun pair ↦ f pair.2 = f pair.1) ?_ rw [ProbabilityTheory.compProd_trim_condExpKernel (mΩ := mΩ) hm] rw [ae_map_iff] · exact Filter.Eventually.of_forall fun ω ↦ rfl · have hfirst : @Measurable Ω Ω mΩ m id := measurable_id'' hm have hsecond : @Measurable Ω Ω mΩ mΩ id := measurable_id have hdiag : @Measurable Ω (Ω × Ω) mΩ (m.prod mΩ) (fun ω ↦ (id ω, id ω)) := by refine Measurable.of_comap_le ?_ rw [prod, MeasurableSpace.comap_sup, MeasurableSpace.comap_comp] apply sup_le · change m.comap (Prod.fst ∘ fun ω ↦ (ω, ω)) ≤ mΩ rw [show (Prod.fst ∘ fun ω : Ω ↦ (ω, ω)) = id by rfl, MeasurableSpace.comap_id] exact hm · rw [MeasurableSpace.comap_comp] rw [show (Prod.snd ∘ fun ω : Ω ↦ (id ω, id ω)) = id by rfl, MeasurableSpace.comap_id] exact @aemeasurable Ω (Ω × Ω) mΩ (m.prod mΩ) (fun ω ↦ (id ω, id ω)) μ hdiag · have hfst : @Measurable (Ω × Ω) Ω (m.prod mΩ) m Prod.fst := measurable_fst have hsnd : @Measurable (Ω × Ω) Ω (m.prod mΩ) mΩ Prod.snd := measurable_snd have hf' : @Measurable Ω β mΩ _ f := hf.mono hm le_rfl exact measurableSet_eq_fun (hf'.comp hsnd) (hf.comp hfst)
    Causalean.Stat.Concentration.ae_eq_const_condExpKernel_of_measurable · Causalean/Stat/Concentration/ConditionalKernel.lean:161
Conditional­Projection­Tail 1 core · 0 supporting This module lifts the rank-sensitive projection tail bound to regular conditional distributions. ★ ae_condExpKernel_projection_energy_gt_le

Conditional concentration of projected bounded noise

This module lifts the rank-sensitive projection tail bound to regular conditional distributions. A projector measurable with respect to the conditioning sigma-algebra is frozen on almost every conditional fiber before the unconditional result is applied.

theorem ae_condExpKernel_projection_energy_gt_le reviewed
Causalean.Stat.Concentration

Fix a sub-σ-algebra m of the ambient σ-algebra and a finite family eps of real random variables on Ω that is measurable and almost surely bounded by 1 in absolute value under μ; suppose further that, on almost every m-conditioning fiber, each eps i has conditional mean zero under the regular conditional kernel given m, and that the family eps is conditionally independent given m. Let Pi be a matrix-valued map that is m-measurable entrywise and, on almost every m-conditioning fiber, symmetric, idempotent (Pi·Pi = Pi), and of rank at most r, and fix a positive tolerance zeta. Then, on almost every m-conditioning fiber, the conditional probability — under the regular conditional kernel given m — that the projected noise's squared energy i(jPiijepsj)2\sum_i(\sum_j \mathrm{Pi}_{ij}\,\mathrm{eps}_j)^2 exceeds the threshold 8(rlog5+log(2/ζ))8(r\log 5+\log(2/\zeta)) is at most zeta.

Formal statement
hm :
m ≤ mΩ
n r :
eps :
Fin n → Ω → ℝ
Pi :
Ω → Matrix (Fin n) (Fin n) ℝ
hmeas :
∀ i, @Measurable Ω ℝ mΩ _ (eps i)
hbound :
∀ i, ∀ᵐ ω ∂μ, |eps i ω| ≤ 1
hcenter :
∀ i,
∀ᵐ ω ∂μ.trim hm, ∫ ω', eps i ω' ∂(@condExpKernel Ω mΩ _ μ _ m) ω = 0
hindep :
@iCondIndepFun Ω (Fin n) m mΩ _ hm (fun _ ↦ ℝ) (fun _ ↦ inferInstance) eps μ _
hPi :
∀ i j, Measurable[m] (fun ω ↦ Pi ω i j)
hsymm :
∀ᵐ ω ∂μ.trim hm, (Pi ω).transpose = Pi ω
hidem :
∀ᵐ ω ∂μ.trim hm, Pi ω * Pi ω = Pi ω
hrank :
∀ᵐ ω ∂μ.trim hm, rank (Pi ω) ≤ r
zeta :
hzeta :
0 < zeta
∀ᵐ ω ∂μ.trim hm,
((@condExpKernel Ω mΩ _ μ _ m) ω).real {ω' | 8 * ((r : ℝ) * log 5 + log (2 / zeta)) < ∑ i, (∑ j, Pi ω' i j * eps j ω') ^ 2}
≤ zeta
Proof (Lean source)
theorem ae_condExpKernel_projection_energy_gt_le {Ω : Type*} [mΩ : MeasurableSpace Ω] [StandardBorelSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {m : MeasurableSpace Ω} (hm : m ≤ mΩ) {n r : ℕ} (eps : Fin n → Ω → ℝ) (Pi : Ω → Matrix (Fin n) (Fin n) ℝ) (hmeas : ∀ i, @Measurable Ω ℝ mΩ _ (eps i)) (hbound : ∀ i, ∀ᵐ ω ∂μ, |eps i ω| ≤ 1) (hcenter : ∀ i, ∀ᵐ ω ∂μ.trim hm, ∫ ω', eps i ω' ∂(@ProbabilityTheory.condExpKernel Ω mΩ _ μ _ m) ω = 0) (hindep : @iCondIndepFun Ω (Fin n) m mΩ _ hm (fun _ ↦ ℝ) (fun _ ↦ inferInstance) eps μ _) (hPi : ∀ i j, Measurable[m] (fun ω ↦ Pi ω i j)) (hsymm : ∀ᵐ ω ∂μ.trim hm, (Pi ω).transpose = Pi ω) (hidem : ∀ᵐ ω ∂μ.trim hm, Pi ω * Pi ω = Pi ω) (hrank : ∀ᵐ ω ∂μ.trim hm, rank (Pi ω) ≤ r) {zeta : ℝ} (hzeta : 0 < zeta) : ∀ᵐ ω ∂μ.trim hm, ((@ProbabilityTheory.condExpKernel Ω mΩ _ μ _ m) ω).real {ω' | 8 * ((r : ℝ) * log 5 + log (2 / zeta)) < ∑ i, (∑ j, Pi ω' i j * eps j ω') ^ 2} ≤ zeta := by classical let κ : @Kernel Ω Ω m mΩ := @ProbabilityTheory.condExpKernel Ω mΩ _ μ _ m have hbound_fiber : ∀ᵐ ω ∂μ.trim hm, ∀ i, ∀ᵐ ω' ∂κ ω, |eps i ω'| ≤ 1 := by rw [ae_all_iff] intro i exact @ae_ae_condExpKernel_of_ae Ω mΩ _ μ _ m hm (fun ω ↦ |eps i ω| ≤ 1) (hbound i) have hindep_fiber : ∀ᵐ ω ∂μ.trim hm, @iIndepFun Ω (Fin n) mΩ (fun _ ↦ ℝ) (fun _ ↦ inferInstance) eps (κ ω) := @ProbabilityTheory.Kernel.iIndepFun.ae_iIndepFun_real Ω Ω (Fin n) m mΩ κ (μ.trim hm) _ eps hmeas (show iIndepFun eps κ (μ.trim hm) from hindep) have hcenter_fiber : ∀ᵐ ω ∂μ.trim hm, ∀ i, ∫ ω', eps i ω' ∂κ ω = 0 := by rw [ae_all_iff] exact hcenter have hPi_fiber : ∀ᵐ ω ∂μ.trim hm, ∀ i j, ∀ᵐ ω' ∂κ ω, Pi ω' i j = Pi ω i j := by rw [ae_all_iff] intro i rw [ae_all_iff] intro j exact @ae_eq_const_condExpKernel_of_measurable Ω mΩ _ μ _ m hm ℝ _ _ (fun ω ↦ Pi ω i j) (hPi i j) filter_upwards [hbound_fiber, hindep_fiber, hindep.ae_isProbabilityMeasure, hcenter_fiber, hPi_fiber, hsymm, hidem, hrank] with ω hb hi hprob hc hfreeze hs hy hr letI : IsProbabilityMeasure (κ ω) := hprob by_cases hzeta_one : 1 ≤ zeta · exact (measureReal_le_one.trans hzeta_one) · have hzeta_lt_one : zeta < 1 := lt_of_not_ge hzeta_one let L : ℝ := (r : ℝ) * log 5 + log (2 / zeta) let t : ℝ := sqrt (2 * L) have hlog5 : 0 ≤ log 5 := Real.log_nonneg (by norm_num) have hratio : 1 < 2 / zeta := by rw [lt_div_iff₀ hzeta] linarith have hL : 0 < L := by dsimp [L] have hlogratio : 0 < log (2 / zeta) := Real.log_pos hratio positivity have ht : 0 ≤ t := Real.sqrt_nonneg _ have ht_sq : t ^ 2 = 2 * L := by dsimp [t] rw [Real.sq_sqrt] linarith have hstatic := @measure_projection_energy_gt_le Ω mΩ n r (κ ω) _ eps (Pi ω) (fun i => (hmeas i).aemeasurable) hb hc hi hs hy hr t ht have hevent : (κ ω).real {ω' | 8 * L < ∑ i, (∑ j, Pi ω' i j * eps j ω') ^ 2} = (κ ω).real {ω' | 4 * t ^ 2 < ∑ i, (∑ j, Pi ω i j * eps j ω') ^ 2} := by apply congrArg ENNReal.toReal apply measure_congr have hfreeze_all : ∀ᵐ ω' ∂κ ω, ∀ i j, Pi ω' i j = Pi ω i j := by rw [ae_all_iff] intro i rw [ae_all_iff] intro j exact hfreeze i j filter_upwards [hfreeze_all] with ω' hω' have hPi_eq : Pi ω' = Pi ω := by ext i j exact hω' i j change (8 * L < ∑ i, (∑ j, Pi ω' i j * eps j ω') ^ 2) = (4 * t ^ 2 < ∑ i, (∑ j, Pi ω i j * eps j ω') ^ 2) rw [hPi_eq, ht_sq] ring_nf rw [show (r : ℝ) * log 5 + log (2 / zeta) = L by rfl] rw [hevent] refine hstatic.trans ?_ have hpow : (5 ^ r : ℝ) = exp ((r : ℝ) * log 5) := by symm rw [Real.exp_nat_mul, Real.exp_log (by norm_num : (0 : ℝ) < 5)] rw [ht_sq, hpow] have hratio_pos : 0 < 2 / zeta := div_pos (by norm_num) hzeta rw [show -(2 * L) / 2 = -L by ring] rw [← Real.exp_add] change exp ((r : ℝ) * log 5 - ((r : ℝ) * log 5 + log (2 / zeta))) ≤ zeta rw [show (r : ℝ) * log 5 - ((r : ℝ) * log 5 + log (2 / zeta)) = -log (2 / zeta) by ring] rw [Real.exp_neg, Real.exp_log hratio_pos] rw [inv_div] linarith
Causalean.Stat.Concentration.ae_condExpKernel_projection_energy_gt_le · Causalean/Stat/Concentration/ConditionalProjectionTail.lean:27
Finite­Dimensional­Net 1 core · 2 supporting This file provides dimension-explicit finite nets for bounded subsets of a finite-dimensional real normed space. ★ exists_half_net_card_le_five_pow_finrank

Finite nets in finite-dimensional normed spaces

This file provides dimension-explicit finite nets for bounded subsets of a finite-dimensional real normed space. The general statement exists_internal_net_card_le covers an arbitrary subset of the closed unit ball at an arbitrary scale v, with net points drawn from the set itself and cardinality at most (1 + 2 / v) ^ finrank ℝ E; exists_unit_ball_net_card_le and exists_half_net_card_le_five_pow_finrank are the unit-ball and unit-sphere-at-scale-1/2 specializations.

lemma exists_half_net_card_le_five_pow_finrank reviewed
Causalean

For a finite-dimensional real normed space E, there exists a finite set of unit vectors, of size at most 5 raised to the dimension of E, that forms a half-net of the unit sphere: every unit vector lies within distance 1/2 of some point in the set.

Formal statement
∃ N : Finset E,
(∀ v ∈ N, ‖v‖ = 1) ∧
(∀ x, ‖x‖ = 1 → ∃ v ∈ N, ‖x - v‖ ≤ (1 : ℝ) / 2) ∧
N.card ≤ 5 ^ finrank ℝ E
Proof (Lean source)
lemma exists_half_net_card_le_five_pow_finrank (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] : ∃ N : Finset E, (∀ v ∈ N, ‖v‖ = 1) ∧ (∀ x, ‖x‖ = 1 → ∃ v ∈ N, ‖x - v‖ ≤ (1 : ℝ) / 2) ∧ N.card ≤ 5 ^ finrank ℝ E := by obtain ⟨N, hNsub, hNcover, hNcard⟩ := exists_internal_net_card_le E {x : E | ‖x‖ = 1} (fun x hx ↦ le_of_eq hx) (by norm_num : (0 : ℝ) < 1 / 2) refine ⟨N, hNsub, hNcover, ?_⟩ have h5 : (1 : ℝ) + 2 / (1 / 2) = 5 := by rw [show (2 : ℝ) / (1 / 2) = 4 by norm_num] norm_num rw [h5] at hNcard exact_mod_cast hNcard
Causalean.exists_half_net_card_le_five_pow_finrank · Causalean/Stat/Concentration/FiniteDimensionalNet.lean:160
2 supporting declarations (lemmas, instances)
  • exists_internal_net_card_le lemma — Every subset of the closed unit ball of a finite-dimensional real normed space admits an internal net at any prescribed accuracy v: finitely many points, all taken from the set itself, such that every point of the set is within distance v of one of them, and the number of net points is at most (1 + 2 / v) raised to the dimension of the space.
    A :
    Set E
    hA :
    ∀ x ∈ A, ‖x‖ ≤ 1
    v :
    hv :
    0 < v
    ∃ N : Finset E,
    (∀ y ∈ N, y ∈ A) ∧
    (∀ x ∈ A, ∃ y ∈ N, ‖x - y‖ ≤ v) ∧
    (N.card : ℝ) ≤ (1 + 2 / v) ^ finrank ℝ E
    Proof (Lean source)
    lemma exists_internal_net_card_le (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] (A : Set E) (hA : ∀ x ∈ A, ‖x‖ ≤ 1) {v : ℝ} (hv : 0 < v) : ∃ N : Finset E, (∀ y ∈ N, y ∈ A) ∧ (∀ x ∈ A, ∃ y ∈ N, ‖x - y‖ ≤ v) ∧ (N.card : ℝ) ≤ (1 + 2 / v) ^ finrank ℝ E := by classical let ε : ℝ≥0 := ⟨v, hv.le⟩ have hε : (ε : ℝ≥0∞) = ofReal v := by exact ENNReal.coe_nnreal_eq ε have hAball : A ⊆ closedBall (0 : E) 1 := fun x hx ↦ by simpa [mem_closedBall, dist_zero_right] using hA x hx obtain ⟨M, hM⟩ : ∃ M : Set E, Maximal (fun N ↦ N ⊆ A ∧ Metric.IsSeparated ε N) M := by apply zorn_subset intro c hc hchain refine ⟨⋃₀ c, ?_, fun s hs ↦ subset_sUnion_of_mem hs⟩ constructor · exact sUnion_subset fun s hs ↦ (hc hs).1 · rw [Metric.IsSeparated, hchain.pairwise_sUnion] exact fun s hs ↦ (hc hs).2 have hMsub : M ⊆ A := hM.prop.1 have hMsep : Metric.IsSeparated ε M := hM.prop.2 have hMcover : Metric.IsCover ε A M := Metric.IsCover.of_maximal_isSeparated hM obtain ⟨t, _htB, htfinite, htcover⟩ := finite_cover_balls_of_compact (isCompact_closedBall (0 : E) 1) (half_pos hv) have hsmall : ∀ c : E, (M ∩ ball c (v / 2)).Subsingleton := by intro c x hx y hy by_contra hxy have hsep := hMsep hx.1 hy.1 hxy have hdist : dist x y < v := by calc dist x y ≤ dist x c + dist y c := dist_triangle_right x y c _ < v / 2 + v / 2 := add_lt_add (mem_ball.mp hx.2) (mem_ball.mp hy.2) _ = v := by ring have hdist' : edist x y < (ε : ℝ≥0∞) := by rw [edist_dist, hε, ENNReal.ofReal_lt_ofReal_iff hv] exact hdist exact (not_lt_of_ge hsep.le) hdist' have hMfinite : M.Finite := by have hUfinite : (⋃ c ∈ t, M ∩ ball c (v / 2)).Finite := htfinite.biUnion fun c _ ↦ (hsmall c).finite apply hUfinite.subset intro x hx obtain ⟨c, hct, hxc⟩ := mem_iUnion₂.mp (htcover (hAball (hMsub hx))) exact mem_iUnion₂.mpr ⟨c, hct, hx, hxc⟩ let N : Finset E := hMfinite.toFinset have hNsub : ∀ y ∈ N, y ∈ A := fun y hy ↦ hMsub (by simpa [N] using hy) have hNmem : ∀ y ∈ N, ‖y‖ ≤ 1 := fun y hy ↦ hA y (hNsub y hy) have hNcover : ∀ x ∈ A, ∃ y ∈ N, ‖x - y‖ ≤ v := by intro x hx obtain ⟨y, hyM, hxy⟩ := hMcover hx refine ⟨y, by simpa [N] using hyM, ?_⟩ change edist x y ≤ (ε : ℝ≥0∞) at hxy rw [edist_dist, hε, ENNReal.ofReal_le_ofReal_iff hv.le] at hxy simpa [dist_eq_norm] using hxy refine ⟨N, hNsub, hNcover, ?_⟩ borelize E let μ : Measure E := Measure.addHaar let δ : ℝ := v / 2 let ρ : ℝ := 1 + v / 2 have hδ : 0 < δ := div_pos hv (by norm_num) have hρ : 0 < ρ := by positivity set U := ⋃ c ∈ N, ball (c : E) δ with hU have hdisj : Pairwise (N : Set E) (Disjoint on fun c ↦ ball (c : E) δ) := by rintro c hc d hd hcd apply ball_disjoint_ball have hsep := hMsep (by simpa [N] using hc) (by simpa [N] using hd) hcd have hdist : v < dist c d := by change (ε : ℝ≥0∞) < edist c d at hsep rw [edist_dist, hε, ENNReal.ofReal_lt_ofReal_iff_of_nonneg hv.le] at hsep exact hsep simpa [δ] using hdist.le have hUsub : U ⊆ ball (0 : E) ρ := by refine iUnion₂_subset fun x hx ↦ ?_ apply ball_subset_ball' calc δ + dist x 0 ≤ δ + 1 := by rw [dist_zero_right] exact add_le_add le_rfl (hNmem x hx) _ = ρ := by simp [δ, ρ, add_comm] have hvol : (N.card : ℝ≥0∞) * ofReal (δ ^ finrank ℝ E) * μ (ball 0 1) ≤ ofReal (ρ ^ finrank ℝ E) * μ (ball 0 1) := calc (N.card : ℝ≥0∞) * ofReal (δ ^ finrank ℝ E) * μ (ball 0 1) = μ U := by rw [hU, measure_biUnion_finset hdisj fun c _ ↦ measurableSet_ball] simp only [μ.addHaar_ball_of_pos _ hδ, Finset.sum_const, nsmul_eq_mul, mul_assoc] _ ≤ μ (ball (0 : E) ρ) := measure_mono hUsub _ = ofReal (ρ ^ finrank ℝ E) * μ (ball 0 1) := by simp only [μ.addHaar_ball_of_pos _ hρ] have hcancel : (N.card : ℝ≥0∞) * ofReal (δ ^ finrank ℝ E) ≤ ofReal (ρ ^ finrank ℝ E) := (ENNReal.mul_le_mul_iff_left (measure_ball_pos μ (0 : E) zero_lt_one).ne' measure_ball_lt_top.ne).1 hvol have hreal : (N.card : ℝ) * δ ^ finrank ℝ E ≤ ρ ^ finrank ℝ E := by have h := (ENNReal.toReal_le_toReal (ENNReal.mul_ne_top (by simp) (by simp)) (by simp : ofReal (ρ ^ finrank ℝ E) ≠ ∞)).2 hcancel simpa [ENNReal.toReal_ofReal (pow_nonneg hδ.le _), ENNReal.toReal_ofReal (pow_nonneg hρ.le _)] using h have hδpow : 0 < δ ^ finrank ℝ E := pow_pos hδ _ calc (N.card : ℝ) ≤ ρ ^ finrank ℝ E / δ ^ finrank ℝ E := (le_div_iff₀ hδpow).2 hreal _ = (1 + 2 / v) ^ finrank ℝ E := by rw [← div_pow] congr 1 field_simp [δ, ρ, hv.ne'] ring
    Causalean.exists_internal_net_card_le · Causalean/Stat/Concentration/FiniteDimensionalNet.lean:29
  • exists_unit_ball_net_card_le lemma — The closed unit ball of a finite-dimensional real normed space has, at every accuracy v, a finite net of at most (1 + 2 / v) raised to the dimension of the space many points.
    v :
    hv :
    0 < v
    ∃ N : Finset E,
    (∀ x : E, ‖x‖ ≤ 1 → ∃ y ∈ N, ‖x - y‖ ≤ v) ∧ (N.card : ℝ) ≤ (1 + 2 / v) ^ finrank ℝ E
    Proof (Lean source)
    lemma exists_unit_ball_net_card_le (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {v : ℝ} (hv : 0 < v) : ∃ N : Finset E, (∀ x : E, ‖x‖ ≤ 1 → ∃ y ∈ N, ‖x - y‖ ≤ v) ∧ (N.card : ℝ) ≤ (1 + 2 / v) ^ finrank ℝ E := by obtain ⟨N, _hNsub, hNcover, hNcard⟩ := exists_internal_net_card_le E {x : E | ‖x‖ ≤ 1} (by simp) hv exact ⟨N, by simpa using hNcover, hNcard⟩
    Causalean.exists_unit_ball_net_card_le · Causalean/Stat/Concentration/FiniteDimensionalNet.lean:148
Projection­Matrix­Tail 1 core · 1 supporting This module gives a dimension-sensitive tail bound for the squared Euclidean energy of independent, centered, unit-bounded noise after an orthogonal matrix projection. ★ measure_projection_energy_gt_le

Concentration of projected bounded noise

This module gives a dimension-sensitive tail bound for the squared Euclidean energy of independent, centered, unit-bounded noise after an orthogonal matrix projection. The ambient dimension is replaced by an a priori bound on the matrix rank.

theorem measure_projection_energy_gt_le reviewed
Causalean.Stat.Concentration

Projected bounded-noise tail bound. Let eps : Fin n → Ω → ℝ be coordinate noise terms such that each eps i is measurable, each is bounded by 1 in absolute value almost surely, each has mean zero, and the coordinates are mutually independent. If the n × n matrix Pi is symmetric and idempotent — so it is an orthogonal projection — and has rank at most r, then for any nonnegative t, the squared Euclidean norm of the projected vector Pi · eps exceeds 4 * t ^ 2 with probability at most 5 ^ r * exp (-t ^ 2 / 2).

Formal statement
Ω :
n r :
eps :
Fin n → Ω → ℝ
Pi :
Matrix (Fin n) (Fin n) ℝ
hmeas :
∀ i, AEMeasurable (eps i) P
hbound :
∀ i, ∀ᵐ ω ∂P, |eps i ω| ≤ 1
hcenter :
∀ i, ∫ ω, eps i ω ∂P = 0
hindep :
iIndepFun eps P
hsymm :
Pi.transpose = Pi
hidem :
Pi * Pi = Pi
hrank :
rank Pi ≤ r
t :
ht :
0 ≤ t
P.real {ω | 4 * t ^ 2 < ∑ i, (∑ j, Pi i j * eps j ω) ^ 2}
≤ (5 ^ r : ℝ) * exp (-t ^ 2 / 2)
Proof (Lean source)
theorem measure_projection_energy_gt_le {Ω : Type*} [MeasurableSpace Ω] {n r : ℕ} (P : Measure Ω) [IsProbabilityMeasure P] (eps : Fin n → Ω → ℝ) (Pi : Matrix (Fin n) (Fin n) ℝ) (hmeas : ∀ i, AEMeasurable (eps i) P) (hbound : ∀ i, ∀ᵐ ω ∂P, |eps i ω| ≤ 1) (hcenter : ∀ i, ∫ ω, eps i ω ∂P = 0) (hindep : iIndepFun eps P) (hsymm : Pi.transpose = Pi) (hidem : Pi * Pi = Pi) (hrank : rank Pi ≤ r) {t : ℝ} (ht : 0 ≤ t) : P.real {ω | 4 * t ^ 2 < ∑ i, (∑ j, Pi i j * eps j ω) ^ 2} ≤ (5 ^ r : ℝ) * exp (-t ^ 2 / 2) := by classical let L : EuclideanSpace ℝ (Fin n) →ₗ[ℝ] EuclideanSpace ℝ (Fin n) := Matrix.toEuclideanLin Pi let V : Submodule ℝ (EuclideanSpace ℝ (Fin n)) := LinearMap.range L let Z : Ω → EuclideanSpace ℝ (Fin n) := fun ω ↦ toLp 2 (Pi.mulVec fun j ↦ eps j ω) have hZV : ∀ᵐ ω ∂P, Z ω ∈ V := by filter_upwards [] with ω exact ⟨WithLp.toLp 2 (fun j ↦ eps j ω), rfl⟩ have hfix (v : EuclideanSpace ℝ (Fin n)) (hv : v ∈ V) : Pi.mulVec (ofLp v) = ofLp v := by rcases hv with ⟨u, rfl⟩ change Pi.mulVec (Pi.mulVec (ofLp u)) = Pi.mulVec (ofLp u) rw [Matrix.mulVec_mulVec, hidem] have hinner (v : EuclideanSpace ℝ (Fin n)) (hv : v ∈ V) (ω : Ω) : inner ℝ v (Z ω) = ∑ j, v j * eps j ω := by change dotProduct (Pi.mulVec fun j ↦ eps j ω) (ofLp v) = dotProduct (ofLp v) (fun j ↦ eps j ω) rw [dotProduct_comm, Matrix.dotProduct_mulVec] have hvec : vecMul (ofLp v) Pi = Pi.mulVec (ofLp v) := by rw [← Matrix.mulVec_transpose, hsymm] rw [hvec, hfix v hv] have hsubg (v : EuclideanSpace ℝ (Fin n)) (hv : v ∈ V) (hvnorm : ‖v‖ = 1) : HasSubgaussianMGF (fun ω ↦ inner ℝ v (Z ω)) 1 P := by have hsumsq : ∑ i, (v i) ^ 2 = 1 := by have hsq := EuclideanSpace.norm_sq_eq v rw [hvnorm] at hsq simpa only [one_pow, Real.norm_eq_abs, sq_abs] using hsq.symm have hlin := hasSubgaussianMGF_linearCombination_of_iIndep eps (fun i ↦ v i) hmeas hbound hcenter hindep have hlin_one : HasSubgaussianMGF (fun ω ↦ ∑ i, v i * eps i ω) 1 P := by have hnn : (⟨∑ i, (v i) ^ 2, by positivity⟩ : NNReal) = 1 := NNReal.coe_injective hsumsq rwa [hnn] at hlin convert hlin_one using 1 funext ω exact hinner v hv ω have hnet := Causalean.measure_norm_gt_le_five_pow_finrank P Z V hZV hsubg ht have hrank_eq : Module.finrank ℝ V = rank Pi := by rw [Matrix.rank_eq_finrank_range_toLin Pi (EuclideanSpace.basisFun (Fin n) ℝ).toBasis (EuclideanSpace.basisFun (Fin n) ℝ).toBasis] rfl have hfinrank : Module.finrank ℝ V ≤ r := by rwa [hrank_eq] have hpowers : ((5 ^ Module.finrank ℝ V : ℕ) : ℝ) ≤ (5 ^ r : ℝ) := by exact_mod_cast Nat.pow_le_pow_right (by norm_num) hfinrank have hevent : {ω | 4 * t ^ 2 < ∑ i, (∑ j, Pi i j * eps j ω) ^ 2} = {ω | 2 * t < ‖Z ω‖} := by ext ω change 4 * t ^ 2 < ∑ i, (Z ω i) ^ 2 ↔ 2 * t < ‖Z ω‖ have hsq : ∑ i, (Z ω i) ^ 2 = ‖Z ω‖ ^ 2 := by simpa only [Real.norm_eq_abs, sq_abs] using (EuclideanSpace.norm_sq_eq (Z ω)).symm rw [hsq] constructor <;> intro h · nlinarith [norm_nonneg (Z ω)] · nlinarith [norm_nonneg (Z ω)] rw [hevent] refine hnet.trans ?_ exact mul_le_mul_of_nonneg_right hpowers (Real.exp_nonneg _)
Causalean.Stat.Concentration.measure_projection_energy_gt_le · Causalean/Stat/Concentration/ProjectionMatrixTail.lean:45
1 supporting declaration (lemmas, instances)
  • matrix_rank_le_of_gram_factor theorem — A matrix admitting a Gram factorization through r vectors has rank at most r.
    R ι :
    r :
    Pi :
    Matrix ι ι R
    vectors :
    Fin r → ι → R
    hfactor :
    ∀ i j, Pi i j = ∑ k, vectors k i * vectors k j
    rank Pi ≤ r
    Proof (Lean source)
    theorem matrix_rank_le_of_gram_factor {R ι : Type*} [Nontrivial R] [CommRing R] [Fintype ι] {r : ℕ} (Pi : Matrix ι ι R) (vectors : Fin r → ι → R) (hfactor : ∀ i j, Pi i j = ∑ k, vectors k i * vectors k j) : rank Pi ≤ r := by let B : Matrix ι (Fin r) R := fun i k ↦ vectors k i have hPi : Pi = B * B.transpose := by ext i j simp only [Matrix.mul_apply, Matrix.transpose_apply, B] exact hfactor i j rw [hPi] exact (Matrix.rank_mul_le_left B B.transpose).trans <| by simpa using Matrix.rank_le_card_width B
    Causalean.Stat.Concentration.matrix_rank_le_of_gram_factor · Causalean/Stat/Concentration/ProjectionMatrixTail.lean:29
Sub­Gaussian­Norm 1 core · 2 supporting This file turns scalar sub-Gaussian bounds on a finite half-net into a tail bound for the norm of a finite-dimensional random vector. ★ measure_norm_gt_le_five_pow_finrank

Norm tails from finite directional nets

This file turns scalar sub-Gaussian bounds on a finite half-net into a tail bound for the norm of a finite-dimensional random vector. It also supplies a dimension-only version by constructing a half-net in the supporting subspace.

theorem measure_norm_gt_le_five_pow_finrank reviewed
Causalean

Dimension-only sub-Gaussian norm tail. Let V be a finite-dimensional subspace of E. If Z lies in V almost surely under P and every unit vector v in V has the scalar projection ⟪v, Z⟫ sub-Gaussian with parameter 1 under P, then for any nonnegative t, the probability that ‖Z‖ exceeds 2 * t is at most 5 raised to the dimension of V, times exp (-t ^ 2 / 2).

Formal statement
Z :
Ω → E
V :
hZV :
∀ᵐ ω ∂P, Z ω ∈ V
hsubg :
∀ v ∈ V
if
‖v‖ = 1
then
HasSubgaussianMGF (fun ω ↦ ⟪(v : E), Z ω⟫) 1 P
t :
ht :
0 ≤ t
P.real {ω | 2 * t < ‖Z ω‖} ≤ ((5 ^ finrank ℝ V : ℕ) : ℝ) * exp (-t ^ 2 / 2)
Proof (Lean source)
theorem measure_norm_gt_le_five_pow_finrank {Ω E : Type*} [MeasurableSpace Ω] [NormedAddCommGroup E] [InnerProductSpace ℝ E] (P : Measure Ω) [IsFiniteMeasure P] (Z : Ω → E) (V : Submodule ℝ E) [FiniteDimensional ℝ V] (hZV : ∀ᵐ ω ∂P, Z ω ∈ V) (hsubg : ∀ v ∈ V, ‖v‖ = 1 → HasSubgaussianMGF (fun ω ↦ ⟪(v : E), Z ω⟫) 1 P) {t : ℝ} (ht : 0 ≤ t) : P.real {ω | 2 * t < ‖Z ω‖} ≤ ((5 ^ finrank ℝ V : ℕ) : ℝ) * exp (-t ^ 2 / 2) := by obtain ⟨M, hMunit, hMnet, hMcard⟩ := exists_half_net_card_le_five_pow_finrank V let e : V ↪ E := ⟨fun v ↦ (v : E), Subtype.coe_injective⟩ let N : Finset E := M.map e have hNnet : ∀ x ∈ V, ‖x‖ = 1 → ∃ v ∈ N, ‖x - v‖ ≤ (1 : ℝ) / 2 := by intro x hxV hxnorm obtain ⟨v, hvM, hv⟩ := hMnet ⟨x, hxV⟩ (by simpa using hxnorm) refine ⟨v, Finset.mem_map.mpr ⟨v, hvM, rfl⟩, ?_⟩ simpa using hv have hNsubg : ∀ v ∈ N, HasSubgaussianMGF (fun ω ↦ ⟪v, Z ω⟫) 1 P := by intro v hvN obtain ⟨w, hwM, rfl⟩ := Finset.mem_map.mp hvN exact hsubg (w : E) w.property (by simpa using hMunit w hwM) refine (measure_norm_gt_le_of_half_net P Z V N hNnet hZV hNsubg ht).trans ?_ gcongr have hNcard : N.card ≤ 5 ^ finrank ℝ V := by simpa [N] using hMcard exact_mod_cast hNcard
Causalean.measure_norm_gt_le_five_pow_finrank · Causalean/Stat/Concentration/SubGaussianNorm.lean:87
2 supporting declarations (lemmas, instances)
  • half_norm_lt_inner_of_mem_net lemma — Every nonzero vector in a subspace has a point in a finite half-net whose inner product with that vector is at least half of its norm.
    V :
    Submodule ℝ E
    hnet :
    ∀ x ∈ V
    if
    ‖x‖ = 1
    then
    ∃ v ∈ N, ‖x - v‖ ≤ (1 : ℝ) / 2
    hzV :
    z ∈ V
    hz :
    z ≠ 0
    ∃ v ∈ N, ‖z‖ / 2 ≤ ⟪v, z⟫
    Proof (Lean source)
    lemma half_norm_lt_inner_of_mem_net {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {N : Finset E} {z : E} (V : Submodule ℝ E) (hnet : ∀ x ∈ V, ‖x‖ = 1 → ∃ v ∈ N, ‖x - v‖ ≤ (1 : ℝ) / 2) (hzV : z ∈ V) (hz : z ≠ 0) : ∃ v ∈ N, ‖z‖ / 2 ≤ ⟪v, z⟫ := by let x : E := ‖z‖⁻¹ • z have hxnorm : ‖x‖ = 1 := by simp [x, norm_smul, hz] obtain ⟨v, hvN, hv⟩ := hnet x (V.smul_mem _ hzV) hxnorm refine ⟨v, hvN, ?_⟩ have hinner : ⟪x - v, x⟫ ≤ (1 : ℝ) / 2 := by calc ⟪x - v, x⟫ ≤ |⟪x - v, x⟫| := le_abs_self _ _ ≤ ‖x - v‖ * ‖x‖ := abs_real_inner_le_norm _ _ _ ≤ ((1 : ℝ) / 2) * 1 := mul_le_mul hv hxnorm.le (norm_nonneg _) (by norm_num) _ = (1 : ℝ) / 2 := by norm_num have hvx : (1 : ℝ) / 2 ≤ ⟪v, x⟫ := by have hid : ⟪x - v, x⟫ = 1 - ⟪v, x⟫ := by rw [inner_sub_left, real_inner_self_eq_norm_sq, hxnorm] ring linarith have hzrepr : z = ‖z‖ • x := by simp [x, smul_smul, hz] rw [hzrepr, inner_smul_right, norm_smul, hxnorm] simp only [mul_one, Real.norm_eq_abs, abs_of_nonneg (norm_nonneg z)] have hmul := mul_le_mul_of_nonneg_left hvx (norm_nonneg z) simpa [div_eq_mul_inv, mul_comm] using hmul
    Causalean.half_norm_lt_inner_of_mem_net · Causalean/Stat/Concentration/SubGaussianNorm.lean:23
  • measure_norm_gt_le_of_half_net theorem — If a finite half-net controls every scalar projection with unit sub-Gaussian parameter, then the norm has a Gaussian upper tail. The support condition is only required almost everywhere.
    Z :
    Ω → E
    V :
    Submodule ℝ E
    N :
    hnet :
    ∀ x ∈ V
    if
    ‖x‖ = 1
    then
    ∃ v ∈ N, ‖x - v‖ ≤ (1 : ℝ) / 2
    hZV :
    ∀ᵐ ω ∂P, Z ω ∈ V
    hsubg :
    ∀ v ∈ N, HasSubgaussianMGF (fun ω ↦ ⟪v, Z ω⟫) 1 P
    t :
    ht :
    0 ≤ t
    P.real {ω | 2 * t < ‖Z ω‖} ≤ (N.card : ℝ) * exp (-t ^ 2 / 2)
    Proof (Lean source)
    theorem measure_norm_gt_le_of_half_net {Ω E : Type*} [MeasurableSpace Ω] [NormedAddCommGroup E] [InnerProductSpace ℝ E] (P : Measure Ω) [IsFiniteMeasure P] (Z : Ω → E) (V : Submodule ℝ E) (N : Finset E) (hnet : ∀ x ∈ V, ‖x‖ = 1 → ∃ v ∈ N, ‖x - v‖ ≤ (1 : ℝ) / 2) (hZV : ∀ᵐ ω ∂P, Z ω ∈ V) (hsubg : ∀ v ∈ N, HasSubgaussianMGF (fun ω ↦ ⟪v, Z ω⟫) 1 P) {t : ℝ} (ht : 0 ≤ t) : P.real {ω | 2 * t < ‖Z ω‖} ≤ (N.card : ℝ) * exp (-t ^ 2 / 2) := by let U : Set Ω := ⋃ v ∈ N, {ω | t ≤ ⟪v, Z ω⟫} have hAU : {ω | 2 * t < ‖Z ω‖} ≤ᵐ[P] U := by filter_upwards [hZV] with ω hω htail change 2 * t < ‖Z ω‖ at htail have hz : Z ω ≠ 0 := by intro hz simp [hz] at htail linarith obtain ⟨v, hvN, hv⟩ := half_norm_lt_inner_of_mem_net V hnet hω hz refine mem_iUnion₂.mpr ⟨v, hvN, ?_⟩ change t ≤ ⟪v, Z ω⟫ nlinarith calc P.real {ω | 2 * t < ‖Z ω‖} ≤ P.real U := by exact ENNReal.toReal_mono (measure_ne_top P U) (measure_mono_ae hAU) _ ≤ ∑ v ∈ N, P.real {ω | t ≤ ⟪v, Z ω⟫} := measureReal_biUnion_finset_le N _ _ ≤ ∑ _v ∈ N, exp (-t ^ 2 / 2) := by apply Finset.sum_le_sum intro v hv simpa using (hsubg v hv).measure_ge_le ht _ = (N.card : ℝ) * exp (-t ^ 2 / 2) := by rw [Finset.sum_const, nsmul_eq_mul]
    Causalean.measure_norm_gt_le_of_half_net · Causalean/Stat/Concentration/SubGaussianNorm.lean:52