Stat.Concentration.Matrix

Matrix concentration for random design moment matrices and localized empirical Grams: iid entrywise deviation bounds, deterministic perturbation, variance-sensitive local-mass concentration, and high-probability coercivity or inverse control.

Localized­Gram­Basic 5 core · 9 supporting This module supplies the deterministic entrywise-to-quadratic argument and the order-p moment estimates for bounded localized Gram coordinates. ★ localizedGram_good_of_entrywise

Localized empirical-Gram deterministic and moment tools

This module supplies the deterministic entrywise-to-quadratic argument and the order-p moment estimates for bounded localized Gram coordinates. Together they are the non-probabilistic and one-observation ingredients of the localized Bernstein coercivity result.

def localCount reviewed
Causalean.Stat.Concentration

For a real-valued observation-weight function and a finite sample, the unnormalised local count is the sum of the weights assigned to all observations in the sample.

Definition (Lean source)
N :
X :
Type*
q :
X → ℝ
omega :
Fin N → X
localCount q omega :
∑ i, q (omega i)
def localGramEntry reviewed
Causalean.Stat.Concentration

For a real-valued observation-weight function, a finite indexed family of real-valued features, a finite sample, and two feature indices, the corresponding entry of the unnormalised weighted empirical Gram matrix is the sum, over observations, of the weight times the two selected feature values.

Definition (Lean source)
N :
κ X :
Type*
q :
X → ℝ
phi :
κ → X → ℝ
omega :
Fin N → X
j k :
κ
localGramEntry q phi omega j k :
∑ i, q (omega i) * phi j (omega i) * phi k (omega i)
Causalean.Stat.Concentration.localGramEntry · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:215
def localGramQuadratic reviewed
Causalean.Stat.Concentration

For a real-valued observation-weight function, a finite indexed family of real-valued features, a finite sample, and a real coefficient vector indexed by the features, the quadratic form of the unnormalised weighted empirical Gram matrix is the double sum of the product of two coefficients and their weighted empirical Gram-matrix entry.

Definition (Lean source)
N :
κ X :
Type*
q :
X → ℝ
phi :
κ → X → ℝ
omega :
Fin N → X
v :
κ → ℝ
localGramQuadratic q phi omega v :
∑ j, ∑ k, v j * v k * localGramEntry q phi omega j k
Causalean.Stat.Concentration.localGramQuadratic · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:220
def LocalizedGramGood reviewed
Causalean.Stat.Concentration

For a real lower-eigenvalue threshold, a real-valued observation-weight function, a finite indexed family of real-valued features, and a finite sample, the localized empirical Gram matrix is good exactly when (1) the local count is positive and (2) for every real coefficient vector indexed by the features, its quadratic form is at least one half of the threshold times the local count times the squared Euclidean norm of that vector.

Definition (Lean source)
N :
κ X :
Type*
lambda :
q :
X → ℝ
phi :
κ → X → ℝ
omega :
Fin N → X
LocalizedGramGood lambda q phi omega :
Prop
clause 1
0 < localCount q omega
clause 2
v :
κ → ℝ
(lambda / 2) * localCount q omega * (∑ j, (v j) ^ 2) ≤ localGramQuadratic q phi omega v
Causalean.Stat.Concentration.LocalizedGramGood · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:226
theorem localizedGram_good_of_entrywise reviewed
Causalean.Stat.Concentration

Given positive sample size, mass, and coercivity, population coercivity, a small count error, and small entrywise Gram errors, the realised local count is positive and the empirical Gram is coercive relative to it.

Formal statement
N :
κ X :
Type*
Nonempty κ
q :
X → ℝ
phi :
κ → X → ℝ
M :
κ → κ → ℝ
p lambda :
hN :
0 < N
hp :
0 < p
hlambda :
0 < lambda
hcoercive :
∀ v : κ → ℝ, lambda * p * (∑ j, (v j) ^ 2) ≤ ∑ j, ∑ k, v j * v k * M j k
omega :
Fin N → X
hcount :
|localCount q omega - (N : ℝ) * p| < (N : ℝ) * p / 2
hentry :
∀ j k,
|localGramEntry q phi omega j k
- (N : ℝ) * M j k| < lambda * (N : ℝ) * p / (4 * (Fintype.card κ : ℝ))
LocalizedGramGood lambda q phi omega
Proof (Lean source)
-- Proof route: the count window gives `0 < Q ≤ 3Np/2`; entrywise perturbation gives -- `v'Gv ≥ λNp‖v‖² - λNp‖v‖²/4 = 3λNp‖v‖²/4`. theorem localizedGram_good_of_entrywise {N : ℕ} {κ X : Type*} [Fintype κ] [Nonempty κ] (q : X → ℝ) (phi : κ → X → ℝ) (M : κ → κ → ℝ) {p lambda : ℝ} (hN : 0 < N) (hp : 0 < p) (hlambda : 0 < lambda) (hcoercive : ∀ v : κ → ℝ, lambda * p * (∑ j, (v j) ^ 2) ≤ ∑ j, ∑ k, v j * v k * M j k) (omega : Fin N → X) (hcount : |localCount q omega - (N : ℝ) * p| < (N : ℝ) * p / 2) (hentry : ∀ j k, |localGramEntry q phi omega j k - (N : ℝ) * M j k| < lambda * (N : ℝ) * p / (4 * (Fintype.card κ : ℝ))) : LocalizedGramGood lambda q phi omega := by have hNreal : (0 : ℝ) < (N : ℝ) := by exact_mod_cast hN have hNp : 0 < (N : ℝ) * p := mul_pos hNreal hp have hcount_bounds := (abs_lt.mp hcount) have hQpos : 0 < localCount q omega := by linarith [hcount_bounds.1] have hQupper : localCount q omega ≤ 3 * ((N : ℝ) * p) / 2 := by linarith [hcount_bounds.2] refine ⟨hQpos, ?_⟩ intro v let S : ℝ := ∑ j, (v j) ^ 2 have hS : 0 ≤ S := by dsimp [S] positivity have hcard : (0 : ℝ) < (Fintype.card κ : ℝ) := by exact_mod_cast Fintype.card_pos let epsilon : ℝ := lambda * (N : ℝ) * p / (4 * (Fintype.card κ : ℝ)) have hepsilon : 0 ≤ epsilon := by dsimp [epsilon] positivity have hentry_le : ∀ j k, |localGramEntry q phi omega j k - (N : ℝ) * M j k| ≤ epsilon := by intro j k exact le_of_lt (hentry j k) have hpert := entrywise_gram_lower_bound (fun j k => localGramEntry q phi omega j k) M v (scale := (N : ℝ)) (epsilon := epsilon) hepsilon hentry_le change (N : ℝ) * (∑ j, ∑ k, v j * v k * M j k) - (Fintype.card κ : ℝ) * epsilon * S ≤ ∑ j, ∑ k, v j * v k * localGramEntry q phi omega j k at hpert have hpop := hcoercive v change lambda * p * S ≤ ∑ j, ∑ k, v j * v k * M j k at hpop have hscaled : (N : ℝ) * (lambda * p * S) ≤ (N : ℝ) * (∑ j, ∑ k, v j * v k * M j k) := mul_le_mul_of_nonneg_left hpop (le_of_lt hNreal) have herr : (Fintype.card κ : ℝ) * epsilon * S = (lambda * (N : ℝ) * p / 4) * S := by dsimp [epsilon] field_simp have hlower : (3 * (lambda * (N : ℝ) * p) / 4) * S ≤ localGramQuadratic q phi omega v := by rw [localGramQuadratic] rw [herr] at hpert linarith have htarget : (lambda / 2) * localCount q omega * S ≤ (3 * (lambda * (N : ℝ) * p) / 4) * S := by have hmul := mul_le_mul_of_nonneg_right hQupper (mul_nonneg (le_of_lt hlambda) hS) nlinarith dsimp [S] at htarget hlower ⊢ exact htarget.trans hlower
9 supporting declarations (lemmas, instances)
  • localWeight_integrable theorem — A measurable local weight between zero and one almost everywhere is integrable under the probability law.
    X :
    q :
    X → ℝ
    hqmeas :
    hq :
    ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1
    Proof (Lean source)
    theorem localWeight_integrable {X : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (q : X → ℝ) (hqmeas : Measurable q) (hq : ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1) : Integrable q P := by refine (integrable_const (μ := P) (1 : ℝ)).mono' hqmeas.aestronglyMeasurable ?_ filter_upwards [hq] with x hx simpa [Real.norm_eq_abs, abs_of_nonneg hx.1] using hx.2
    Causalean.Stat.Concentration.localWeight_integrable · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:26
  • localWeight_centered_envelope theorem — A local weight between zero and one almost everywhere, with the stated population mean, differs from that mean by at most one almost everywhere.
    X :
    q :
    X → ℝ
    hq :
    ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1
    p :
    hp :
    ∫ x, q x ∂P = p
    ∀ᵐ x ∂P, |q x - p| ≤ 1
    Proof (Lean source)
    theorem localWeight_centered_envelope {X : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (q : X → ℝ) (hq : ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1) {p : ℝ} (hp : ∫ x, q x ∂P = p) : ∀ᵐ x ∂P, |q x - p| ≤ 1 := by have hp_bounds : 0 ≤ p ∧ p ≤ 1 := by rw [← hp] constructor · exact integral_nonneg_of_ae (hq.mono fun x hx ↦ hx.1) · by_cases hqint : Integrable q P · calc ∫ x, q x ∂P ≤ ∫ _ : X, (1 : ℝ) ∂P := integral_mono_ae hqint (integrable_const (μ := P) (1 : ℝ)) (hq.mono fun x hx ↦ hx.2) _ = 1 := by simp · rw [integral_undef hqint] norm_num filter_upwards [hq] with x hx rw [abs_le] constructor <;> linarith [hx.1, hx.2, hp_bounds.1, hp_bounds.2]
    Causalean.Stat.Concentration.localWeight_centered_envelope · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:35
  • localWeight_centered_secondMoment_le theorem — A measurable local weight between zero and one almost everywhere, with the stated population mean, has centered second moment at most that local mass.
    X :
    q :
    X → ℝ
    hqmeas :
    hq :
    ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1
    p :
    hp :
    ∫ x, q x ∂P = p
    ∫ x, (q x - ∫ y, q y ∂P) ^ 2 ∂P ≤ p
    Proof (Lean source)
    -- Proof route: use `E[(q-Eq)^2] = E[q^2]-(Eq)^2 ≤ E[q^2]` and `q^2 ≤ q`. theorem localWeight_centered_secondMoment_le {X : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (q : X → ℝ) (hqmeas : Measurable q) (hq : ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1) {p : ℝ} (hp : ∫ x, q x ∂P = p) : ∫ x, (q x - ∫ y, q y ∂P) ^ 2 ∂P ≤ p := by have hqint : Integrable q P := localWeight_integrable P q hqmeas hq have hqLp : MemLp q 2 P := memLp_of_bounded hq hqmeas.aestronglyMeasurable 2 have hq_sq_le : ∀ᵐ x ∂P, q x ^ 2 ≤ q x := by filter_upwards [hq] with x hx nlinarith [mul_nonneg hx.1 (sub_nonneg.mpr hx.2)] calc ∫ x, (q x - ∫ y, q y ∂P) ^ 2 ∂P = variance q P := (variance_eq_integral hqmeas.aemeasurable).symm _ = ∫ x, q x ^ 2 ∂P - (∫ x, q x ∂P) ^ 2 := by simpa only [Pi.pow_apply] using variance_eq_sub hqLp _ ≤ ∫ x, q x ^ 2 ∂P := by nlinarith [sq_nonneg (∫ x, q x ∂P)] _ ≤ ∫ x, q x ∂P := integral_mono_ae hqLp.integrable_sq hqint hq_sq_le _ = p := hp
    Causalean.Stat.Concentration.localWeight_centered_secondMoment_le · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:57
  • localGram_centered_envelope theorem — A localized Gram coordinate with a local weight between zero and one and features bounded by a nonnegative envelope differs from its population mean by at most twice the squared envelope almost everywhere.
    X κ :
    q :
    X → ℝ
    phi :
    κ → X → ℝ
    hq :
    ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1
    B :
    hB :
    0 ≤ B
    hphi :
    ∀ j, ∀ᵐ x ∂P, |phi j x| ≤ B
    j k :
    κ
    ∀ᵐ x ∂P, |q x * phi j x * phi k x - ∫ y, q y * phi j y * phi k y ∂P| ≤ 2 * B ^ 2
    Proof (Lean source)
    theorem localGram_centered_envelope {X κ : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (q : X → ℝ) (phi : κ → X → ℝ) (hq : ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1) {B : ℝ} (hB : 0 ≤ B) (hphi : ∀ j, ∀ᵐ x ∂P, |phi j x| ≤ B) (j k : κ) : ∀ᵐ x ∂P, |q x * phi j x * phi k x - ∫ y, q y * phi j y * phi k y ∂P| ≤ 2 * B ^ 2 := by have hcoord_bound : ∀ᵐ x ∂P, |q x * phi j x * phi k x| ≤ B ^ 2 := by filter_upwards [hq, hphi j, hphi k] with x hx hphi_j hphi_k have hprod : |phi j x| * |phi k x| ≤ B * B := mul_le_mul hphi_j hphi_k (abs_nonneg _) hB calc |q x * phi j x * phi k x| = q x * (|phi j x| * |phi k x|) := by rw [abs_mul, abs_mul, abs_of_nonneg hx.1] ring _ ≤ 1 * (B * B) := mul_le_mul hx.2 hprod (mul_nonneg (abs_nonneg _) (abs_nonneg _)) (by norm_num) _ = B ^ 2 := by ring have hmean_bound : |∫ y, q y * phi j y * phi k y ∂P| ≤ B ^ 2 := by by_cases hcoord_int : Integrable (fun y ↦ q y * phi j y * phi k y) P · calc |∫ y, q y * phi j y * phi k y ∂P| ≤ ∫ y, |q y * phi j y * phi k y| ∂P := abs_integral_le_integral_abs _ ≤ ∫ _ : X, B ^ 2 ∂P := integral_mono_ae hcoord_int.abs (integrable_const (μ := P) (B ^ 2)) hcoord_bound _ = B ^ 2 := by simp · rw [integral_undef hcoord_int, abs_zero] positivity filter_upwards [hcoord_bound] with x hx calc |q x * phi j x * phi k x - ∫ y, q y * phi j y * phi k y ∂P| ≤ |q x * phi j x * phi k x| + |∫ y, q y * phi j y * phi k y ∂P| := abs_sub _ _ _ ≤ B ^ 2 + B ^ 2 := add_le_add hx hmean_bound _ = 2 * B ^ 2 := by ring
    Causalean.Stat.Concentration.localGram_centered_envelope · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:82
  • localGram_centered_secondMoment_le theorem — A localized Gram coordinate from measurable functions, a unit-interval local weight, bounded features, and the stated local mass has centered second moment bounded by envelope-to-the-fourth times local mass.
    X κ :
    q :
    X → ℝ
    phi :
    κ → X → ℝ
    hqmeas :
    hphimeas :
    ∀ j, Measurable (phi j)
    hq :
    ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1
    B p :
    hB :
    0 ≤ B
    hphi :
    ∀ j, ∀ᵐ x ∂P, |phi j x| ≤ B
    hp :
    ∫ x, q x ∂P = p
    j k :
    κ
    ∫ x, (q x * phi j x * phi k x - ∫ y, q y * phi j y * phi k y ∂P) ^ 2 ∂P ≤ B ^ 4 * p
    Proof (Lean source)
    -- Proof route: discard the nonnegative squared mean from the variance identity, then use -- `(q φ_j φ_k)^2 ≤ B^4 q`, which follows from `q^2 ≤ q`. theorem localGram_centered_secondMoment_le {X κ : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (q : X → ℝ) (phi : κ → X → ℝ) (hqmeas : Measurable q) (hphimeas : ∀ j, Measurable (phi j)) (hq : ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1) {B p : ℝ} (hB : 0 ≤ B) (hphi : ∀ j, ∀ᵐ x ∂P, |phi j x| ≤ B) (hp : ∫ x, q x ∂P = p) (j k : κ) : ∫ x, (q x * phi j x * phi k x - ∫ y, q y * phi j y * phi k y ∂P) ^ 2 ∂P ≤ B ^ 4 * p := by let coord : X → ℝ := fun x ↦ q x * phi j x * phi k x have hcoord_meas : Measurable coord := (hqmeas.mul (hphimeas j)).mul (hphimeas k) have hcoord_bound : ∀ᵐ x ∂P, |coord x| ≤ B ^ 2 := by filter_upwards [hq, hphi j, hphi k] with x hx hphi_j hphi_k have hprod : |phi j x| * |phi k x| ≤ B * B := mul_le_mul hphi_j hphi_k (abs_nonneg _) hB calc |coord x| = q x * (|phi j x| * |phi k x|) := by simp only [coord, abs_mul, abs_of_nonneg hx.1] ring _ ≤ 1 * (B * B) := mul_le_mul hx.2 hprod (mul_nonneg (abs_nonneg _) (abs_nonneg _)) (by norm_num) _ = B ^ 2 := by ring have hcoordLp : MemLp coord 2 P := memLp_of_bounded (hcoord_bound.mono fun _ hx ↦ (abs_le.mp hx)) hcoord_meas.aestronglyMeasurable 2 have hqint : Integrable q P := localWeight_integrable P q hqmeas hq have hsquare_bound : ∀ᵐ x ∂P, coord x ^ 2 ≤ B ^ 4 * q x := by filter_upwards [hq, hphi j, hphi k] with x hx hphi_j hphi_k have hq_sq : q x ^ 2 ≤ q x := by nlinarith [mul_nonneg hx.1 (sub_nonneg.mpr hx.2)] have hj_sq : (phi j x) ^ 2 ≤ B ^ 2 := by rw [sq_le_sq] simpa [abs_of_nonneg hB] using hphi_j have hk_sq : (phi k x) ^ 2 ≤ B ^ 2 := by rw [sq_le_sq] simpa [abs_of_nonneg hB] using hphi_k have hprod_sq : (phi j x) ^ 2 * (phi k x) ^ 2 ≤ B ^ 2 * B ^ 2 := mul_le_mul hj_sq hk_sq (sq_nonneg _) (sq_nonneg _) calc coord x ^ 2 = q x ^ 2 * ((phi j x) ^ 2 * (phi k x) ^ 2) := by simp only [coord] ring _ ≤ q x * (B ^ 2 * B ^ 2) := mul_le_mul hq_sq hprod_sq (mul_nonneg (sq_nonneg _) (sq_nonneg _)) hx.1 _ = B ^ 4 * q x := by ring have hmajorant_int : Integrable (fun x ↦ B ^ 4 * q x) P := by simpa only [smul_eq_mul] using hqint.const_mul (B ^ 4) change ∫ x, (coord x - ∫ y, coord y ∂P) ^ 2 ∂P ≤ B ^ 4 * p calc ∫ x, (coord x - ∫ y, coord y ∂P) ^ 2 ∂P = variance coord P := (variance_eq_integral hcoord_meas.aemeasurable).symm _ = ∫ x, coord x ^ 2 ∂P - (∫ x, coord x ∂P) ^ 2 := by simpa only [Pi.pow_apply] using variance_eq_sub hcoordLp _ ≤ ∫ x, coord x ^ 2 ∂P := by nlinarith [sq_nonneg (∫ x, coord x ∂P)] _ ≤ ∫ x, B ^ 4 * q x ∂P := integral_mono_ae hcoordLp.integrable_sq hmajorant_int hsquare_bound _ = B ^ 4 * ∫ x, q x ∂P := by rw [integral_const_mul] _ = B ^ 4 * p := by rw [hp]
    Causalean.Stat.Concentration.localGram_centered_secondMoment_le · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:119
  • localGram_integrable theorem — A localized Gram coordinate from measurable functions, a unit-interval local weight, and bounded features is integrable under the population law.
    X κ :
    q :
    X → ℝ
    phi :
    κ → X → ℝ
    hqmeas :
    hphimeas :
    ∀ j, Measurable (phi j)
    hq :
    ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1
    B :
    hB :
    0 ≤ B
    hphi :
    ∀ j, ∀ᵐ x ∂P, |phi j x| ≤ B
    j k :
    κ
    Integrable (fun x ↦ q x * phi j x * phi k x) P
    Proof (Lean source)
    theorem localGram_integrable {X κ : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (q : X → ℝ) (phi : κ → X → ℝ) (hqmeas : Measurable q) (hphimeas : ∀ j, Measurable (phi j)) (hq : ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1) {B : ℝ} (hB : 0 ≤ B) (hphi : ∀ j, ∀ᵐ x ∂P, |phi j x| ≤ B) (j k : κ) : Integrable (fun x ↦ q x * phi j x * phi k x) P := by refine (integrable_const (μ := P) (B ^ 2)).mono' ((hqmeas.mul (hphimeas j)).mul (hphimeas k)).aestronglyMeasurable ?_ filter_upwards [hq, hphi j, hphi k] with x hx hphi_j hphi_k have hprod : |phi j x| * |phi k x| ≤ B * B := mul_le_mul hphi_j hphi_k (abs_nonneg _) hB calc ‖q x * phi j x * phi k x‖ = q x * (|phi j x| * |phi k x|) := by rw [Real.norm_eq_abs, abs_mul, abs_mul, abs_of_nonneg hx.1] ring _ ≤ 1 * (B * B) := mul_le_mul hx.2 hprod (mul_nonneg (abs_nonneg _) (abs_nonneg _)) (by norm_num) _ = B ^ 2 := by ring
    Causalean.Stat.Concentration.localGram_integrable · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:187
  • entrywise_to_quadratic theorem — If finite-matrix entries are bounded by a nonnegative tolerance, the absolute quadratic-form error is at most dimension times tolerance times squared vector norm.
    κ :
    Type*
    E :
    κ → κ → ℝ
    v :
    κ → ℝ
    epsilon :
    hepsilon :
    0 ≤ epsilon
    hE :
    ∀ j k, |E j k| ≤ epsilon
    |∑ j, ∑ k, v j * v k * E j k| ≤ (Fintype.card κ : ℝ) * epsilon * ∑ j, (v j) ^ 2
    Proof (Lean source)
    -- Proof route: triangle inequality, the entrywise bound, then -- `(∑ |v j|)^2 ≤ card κ * ∑ (v j)^2` by finite Cauchy--Schwarz. theorem entrywise_to_quadratic {κ : Type*} [Fintype κ] (E : κ → κ → ℝ) (v : κ → ℝ) {epsilon : ℝ} (hepsilon : 0 ≤ epsilon) (hE : ∀ j k, |E j k| ≤ epsilon) : |∑ j, ∑ k, v j * v k * E j k| ≤ (Fintype.card κ : ℝ) * epsilon * ∑ j, (v j) ^ 2 := by have hinner (j : κ) : (∑ k, |v j| * |v k| * epsilon) = |v j| * ((∑ k, |v k|) * epsilon) := by rw [Finset.sum_mul, Finset.mul_sum] apply Finset.sum_congr rfl intro k hk ring calc |∑ j, ∑ k, v j * v k * E j k| ≤ ∑ j, |∑ k, v j * v k * E j k| := by exact Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j, ∑ k, |v j * v k * E j k| := by gcongr with j exact Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j, ∑ k, |v j| * |v k| * epsilon := by gcongr with j k rw [abs_mul, abs_mul] exact mul_le_mul_of_nonneg_left (hE j k) (mul_nonneg (abs_nonneg _) (abs_nonneg _)) _ = epsilon * (∑ j, |v j|) ^ 2 := by simp_rw [hinner] rw [← Finset.sum_mul] ring _ ≤ epsilon * ((Fintype.card κ : ℝ) * ∑ j, |v j| ^ 2) := by gcongr simpa using (sq_sum_le_card_mul_sum_sq (s := univ) (f := fun j : κ => |v j|)) _ = (Fintype.card κ : ℝ) * epsilon * ∑ j, (v j) ^ 2 := by simp only [sq_abs] ring
    Causalean.Stat.Concentration.entrywise_to_quadratic · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:234
  • entrywise_gram_lower_bound theorem — If an empirical matrix is entrywise close to a scaled population matrix with nonnegative tolerance, each empirical quadratic form is bounded below by the population form minus the dimension-scaled error.
    κ :
    Type*
    G M :
    κ → κ → ℝ
    v :
    κ → ℝ
    scale epsilon :
    hepsilon :
    0 ≤ epsilon
    hentry :
    ∀ j k, |G j k - scale * M j k| ≤ epsilon
    scale * (∑ j, ∑ k, v j * v k * M j k) - (Fintype.card κ : ℝ) * epsilon * ∑ j, (v j) ^ 2
    ≤ ∑ j, ∑ k, v j * v k * G j k
    Proof (Lean source)
    theorem entrywise_gram_lower_bound {κ : Type*} [Fintype κ] (G M : κ → κ → ℝ) (v : κ → ℝ) {scale epsilon : ℝ} (hepsilon : 0 ≤ epsilon) (hentry : ∀ j k, |G j k - scale * M j k| ≤ epsilon) : scale * (∑ j, ∑ k, v j * v k * M j k) - (Fintype.card κ : ℝ) * epsilon * ∑ j, (v j) ^ 2 ≤ ∑ j, ∑ k, v j * v k * G j k := by let C : ℝ := (Fintype.card κ : ℝ) * epsilon * ∑ j, (v j) ^ 2 have habs : |∑ j, ∑ k, v j * v k * (G j k - scale * M j k)| ≤ C := by exact entrywise_to_quadratic (fun j k => G j k - scale * M j k) v hepsilon hentry have hscale : (∑ j, ∑ k, v j * v k * (scale * M j k)) = scale * (∑ j, ∑ k, v j * v k * M j k) := by calc (∑ j, ∑ k, v j * v k * (scale * M j k)) = ∑ j, ∑ k, scale * (v j * v k * M j k) := by apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro k hk ring _ = scale * (∑ j, ∑ k, v j * v k * M j k) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj rw [Finset.mul_sum] have hdiff : (∑ j, ∑ k, v j * v k * (G j k - scale * M j k)) = (∑ j, ∑ k, v j * v k * G j k) - scale * (∑ j, ∑ k, v j * v k * M j k) := by simp_rw [mul_sub, Finset.sum_sub_distrib] rw [hscale] have hneg := neg_le_of_abs_le habs rw [hdiff] at hneg dsimp [C] at hneg ⊢ linarith
    Causalean.Stat.Concentration.entrywise_gram_lower_bound · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:275
  • localizedGram_failure_subset_deviations theorem — Under positive sample size, mass, and coercivity and population coercivity, failure of empirical local-Gram coercivity implies either a large count error or a large entrywise Gram error.
    N :
    κ X :
    Type*
    Nonempty κ
    q :
    X → ℝ
    phi :
    κ → X → ℝ
    M :
    κ → κ → ℝ
    p lambda :
    hN :
    0 < N
    hp :
    0 < p
    hlambda :
    0 < lambda
    hcoercive :
    ∀ v : κ → ℝ, lambda * p * (∑ j, (v j) ^ 2) ≤ ∑ j, ∑ k, v j * v k * M j k
    {omega : Fin N → X | ¬ LocalizedGramGood lambda q phi omega} ⊆ {omega : Fin N → X | (N : ℝ) * p / 2 ≤ |localCount q omega - (N : ℝ) * p| ∨ ∃ j k, lambda * (N : ℝ) * p / (4 * (Fintype.card κ : ℝ)) ≤ |localGramEntry q phi omega j k - (N : ℝ) * M j k|}
    Proof (Lean source)
    theorem localizedGram_failure_subset_deviations {N : ℕ} {κ X : Type*} [Fintype κ] [Nonempty κ] (q : X → ℝ) (phi : κ → X → ℝ) (M : κ → κ → ℝ) {p lambda : ℝ} (hN : 0 < N) (hp : 0 < p) (hlambda : 0 < lambda) (hcoercive : ∀ v : κ → ℝ, lambda * p * (∑ j, (v j) ^ 2) ≤ ∑ j, ∑ k, v j * v k * M j k) : {omega : Fin N → X | ¬ LocalizedGramGood lambda q phi omega} ⊆ {omega : Fin N → X | (N : ℝ) * p / 2 ≤ |localCount q omega - (N : ℝ) * p| ∨ ∃ j k, lambda * (N : ℝ) * p / (4 * (Fintype.card κ : ℝ)) ≤ |localGramEntry q phi omega j k - (N : ℝ) * M j k|} := by intro omega hfailure change ¬ LocalizedGramGood lambda q phi omega at hfailure change (N : ℝ) * p / 2 ≤ |localCount q omega - (N : ℝ) * p| ∨ ∃ j k, lambda * (N : ℝ) * p / (4 * (Fintype.card κ : ℝ)) ≤ |localGramEntry q phi omega j k - (N : ℝ) * M j k| by_contra hdeviations have hcount : |localCount q omega - (N : ℝ) * p| < (N : ℝ) * p / 2 := by exact lt_of_not_ge (fun hge => hdeviations (inl hge)) have hentry : ∀ j k, |localGramEntry q phi omega j k - (N : ℝ) * M j k| < lambda * (N : ℝ) * p / (4 * (Fintype.card κ : ℝ)) := by intro j k exact lt_of_not_ge (fun hge => hdeviations (inr ⟨j, k, hge⟩)) exact hfailure (localizedGram_good_of_entrywise q phi M hN hp hlambda hcoercive omega hcount hentry)
    Causalean.Stat.Concentration.localizedGram_failure_subset_deviations · Causalean/Stat/Concentration/Matrix/LocalizedGramBasic.lean:391
Design­Inverse 1 core · 0 supporting Assembles deterministic inverse perturbation and iid union bounds into concentration for random design moment-matrix inverses. ★ designMatrix_inv_concentration

Matrix-inverse concentration for the random design moment matrix

Assembles deterministic inverse perturbation and iid union bounds into concentration for random design moment-matrix inverses.

This module assembles the two halves of the interior local-polynomial leverage rate (M⁻¹)₀₀ = O(1/(Nh)) for the random design:

* Perturbation.designInv00_perturb — the deterministic transport: if the empirical moment matrix M is entrywise within η of an invertible population matrix S whose inverse has row sums bounded by c, with c·(p+1)·η ≤ 1/2, then M is invertible and |(M⁻¹)₀₀ − (S⁻¹)₀₀| ≤ 2 c² (p+1) η. * UnionBound.iid_sum_union_bound — the probabilistic half: each entry M_{jk}(ω) = ∑ᵢ g_{jk}(ωᵢ) is an iid sum, so a union bound over the (p+1)² entries makes the entrywise-η good event have probability ≥ 1 − ∑ Var/η².

The capstone designMatrix_inv_concentration combines them: the analytic failure event (M singular, or (M⁻¹)₀₀ far from (S⁻¹)₀₀) has probability at most the union-bound tail. Here the population matrix S = 𝔼[M] is supplied with its invertibility (IsUnit S.det, e.g. from designMatrix_posDef) and an inverse-row-sum bound c; turning those into the explicit Θ(Nh) density constants is the remaining kernel-change-of-variables step.

theorem designMatrix_inv_concentration reviewed
Causalean.Stat.Concentration

Matrix-inverse concentration of the random design moment matrix. Let g j k : Ω → ℝ be the per-entry design statistics, each square-integrable under μ, so the empirical moment matrix is M(ω) = fun j k => ∑ᵢ g j k (ωᵢ) and, given that the population matrix S equals N times its entrywise expectation, S j k = N·𝔼[g j k], suppose S is invertible with inverse row sums bounded by c ≥ 0, η is positive, and the scale satisfies c·(p+1)·η ≤ 1/2. Then the event on which M fails to be invertible or its leverage (M⁻¹)₀₀ is farther than 2 c² (p+1) η from (S⁻¹)₀₀ has probability at most the union-bound tail ∑_{j,k} N·Var[g j k]/η². This is the high-probability statement that the random design is non-degenerate with O(1/(Nh)) leverage on the good event.

Formal statement
N p :
Ω :
g :
Fin (p + 1) → Fin (p + 1) → Ω → ℝ
hg :
∀ j k, MemLp (g j k) 2 μ
S :
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
hSpop :
∀ j k, S j k = N * ∫ x, g j k x ∂μ
hS :
IsUnit S.det
η c :
:
0 < η
hSrow :
∀ i, (∑ j, |S⁻¹ i j|) ≤ c
hsmall :
c * ((p + 1 : ℕ) * η) ≤ 1 / 2
(Measure.pi (fun _ : Fin N => μ)) {ω : Fin N → Ω | ¬ (IsUnit (of (fun j k => ∑ i, g j k (ω i))).det ∧ |(of (fun j k => ∑ i, g j k (ω i)))⁻¹ 0 0 - S⁻¹ 0 0| ≤ 2 * c ^ 2 * ((p + 1 : ℕ) * η))}
≤ ∑ a : Fin (p + 1) × Fin (p + 1), ofReal (N * Var[g a.1 a.2; μ] / η ^ 2)
Proof (Lean source)
theorem designMatrix_inv_concentration {N p : ℕ} {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (g : Fin (p + 1) → Fin (p + 1) → Ω → ℝ) (hg : ∀ j k, MemLp (g j k) 2 μ) (S : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ) (hSpop : ∀ j k, S j k = N * ∫ x, g j k x ∂μ) (hS : IsUnit S.det) {η c : ℝ} (hη : 0 < η) (hSrow : ∀ i, (∑ j, |S⁻¹ i j|) ≤ c) (hsmall : c * ((p + 1 : ℕ) * η) ≤ 1 / 2) : (Measure.pi (fun _ : Fin N => μ)) {ω : Fin N → Ω | ¬ (IsUnit (of (fun j k => ∑ i, g j k (ω i))).det ∧ |(of (fun j k => ∑ i, g j k (ω i)))⁻¹ 0 0 - S⁻¹ 0 0| ≤ 2 * c ^ 2 * ((p + 1 : ℕ) * η))} ≤ ∑ a : Fin (p + 1) × Fin (p + 1), ofReal (N * Var[g a.1 a.2; μ] / η ^ 2) := by let Dev : Set (Fin N → Ω) := {ω : Fin N → Ω | ∃ a : Fin (p + 1) × Fin (p + 1), η ≤ |(∑ i, g a.1 a.2 (ω i)) - N * ∫ x, g a.1 a.2 x ∂μ|} have hbad_le_dev : (Measure.pi (fun _ : Fin N => μ)) {ω : Fin N → Ω | ¬ (IsUnit (of (fun j k => ∑ i, g j k (ω i))).det ∧ |(of (fun j k => ∑ i, g j k (ω i)))⁻¹ 0 0 - S⁻¹ 0 0| ≤ 2 * c ^ 2 * ((p + 1 : ℕ) * η))} ≤ (Measure.pi (fun _ : Fin N => μ)) Dev := by apply measure_mono intro ω hω by_contra hωDev have hωDev' : ∀ a : Fin (p + 1) × Fin (p + 1), |(∑ i, g a.1 a.2 (ω i)) - N * ∫ x, g a.1 a.2 x ∂μ| < η := by simpa [Dev, not_exists, not_le] using hωDev have hclose : ∀ j k, |(of (fun j k => ∑ i, g j k (ω i))) j k - S j k| ≤ η := by intro j k rw [Matrix.of_apply, hSpop j k] exact le_of_lt (hωDev' (j, k)) have hgood := designInv00_perturb S (of (fun j k => ∑ i, g j k (ω i))) hS hSrow hclose hsmall exact hω hgood refine le_trans hbad_le_dev ?_ simpa [Dev] using iid_sum_union_bound μ (fun a : Fin (p + 1) × Fin (p + 1) => g a.1 a.2) (fun a => hg a.1 a.2) hη
Causalean.Stat.Concentration.designMatrix_inv_concentration · Causalean/Stat/Concentration/Matrix/DesignInverse.lean:38
Iid­Sums 1 core · 2 supporting The interior nonparametric rates ((Nh)^{−1/2} variance, leverage O(1)) come from the behaviour of the random design moment sums ∑ᵢ K((Aᵢ−t)/h) (Aᵢ−t)ᵐ under an iid sample. ★ iid_sum_chebyshev

Concentration building blocks for the random design

The interior nonparametric rates ((Nh)^{−1/2} variance, leverage O(1)) come from the behaviour of the random design moment sums ∑ᵢ K((Aᵢ−t)/h) (Aᵢ−t)ᵐ under an iid sample. This file develops the elementary expectation/variance facts for such sums under the product (iid) law Measure.pi, starting with linearity of expectation across the iid coordinates:

𝔼[∑ᵢ g(Xᵢ)] = N · 𝔼[g].

These are the building blocks that turn the algebraic reductions (bias ≤ √(M₀₀(M⁻¹)₀₀), variance ≤ σ² W (M⁻¹)₀₀) into rate statements via the design density.

theorem iid_sum_chebyshev reviewed
Causalean.Stat.Concentration

Chebyshev concentration of an iid sum. Combining the iid expectation and variance laws with Chebyshev's inequality: for a fixed square-integrable statistic g and any positive threshold ε, the sum ∑ᵢ g(Xᵢ) over an iid sample of size N deviates from its mean N·𝔼[g] by at least ε with probability at most N·Var[g]/ε². For the design weight g = K((·−t)/h) this is the concentration of the total kernel weight M₀₀ around N·𝔼[K((A−t)/h)] = Θ(Nh).

Formal statement
N :
Ω :
g :
Ω → ℝ
hg :
MemLp g 2 μ
ε :
:
0 < ε
(Measure.pi (fun _ : Fin N => μ)) {ω : Fin N → Ω | ε ≤ |(∑ i, g (ω i)) - N * ∫ x, g x ∂μ|}
ofReal (N * Var[g; μ] / ε ^ 2)
Proof (Lean source)
theorem iid_sum_chebyshev {N : ℕ} {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (g : Ω → ℝ) (hg : MemLp g 2 μ) {ε : ℝ} (hε : 0 < ε) : (Measure.pi (fun _ : Fin N => μ)) {ω : Fin N → Ω | ε ≤ |(∑ i, g (ω i)) - N * ∫ x, g x ∂μ|} ≤ ofReal (N * Var[g; μ] / ε ^ 2) := by let π : Measure (Fin N → Ω) := Measure.pi (fun _ : Fin N => μ) let S : (Fin N → Ω) → ℝ := fun ω => ∑ i : Fin N, g (ω i) have hS : MemLp S 2 π := by change MemLp (fun ω : Fin N → Ω => ∑ i : Fin N, g (ω i)) 2 π rw [show (fun ω : Fin N → Ω => ∑ i : Fin N, g (ω i)) = (∑ i : Fin N, fun ω : Fin N → Ω => g (ω i)) by ext ω simp [Finset.sum_apply]] refine MeasureTheory.memLp_finset_sum' (s := univ) (f := fun i : Fin N => fun ω : Fin N → Ω => g (ω i)) ?_ intro i _hi simpa [Function.comp_def, π] using hg.comp_measurePreserving (measurePreserving_eval (fun _ : Fin N => μ) i) have hcheb := ProbabilityTheory.meas_ge_le_variance_div_sq (μ := π) hS hε have hmean : ∫ ω, S ω ∂π = N * ∫ x, g x ∂μ := by simpa [S, π] using integral_sum_pi_eq (N := N) μ g (hg.integrable (by norm_num)) have hvar : Var[S; π] = N * Var[g; μ] := by simpa [S, π] using variance_sum_pi_eq (N := N) μ g hg simpa [S, π, hmean, hvar] using hcheb
Causalean.Stat.Concentration.iid_sum_chebyshev · Causalean/Stat/Concentration/Matrix/IidSums.lean:78
2 supporting declarations (lemmas, instances)
  • integral_sum_pi_eq theorem — Expectation of an iid sum. For an iid sample of size N drawn from a probability measure μ (modelled by the product measure Measure.pi), the expectation of the sum ∑ᵢ g(Xᵢ) of a fixed integrable statistic g equals N · 𝔼[g].
    N :
    Ω :
    g :
    Ω → ℝ
    hg :
    ∫ ω, (∑ i : Fin N, g (ω i)) ∂(Measure.pi (fun _ : Fin N => μ)) = N * ∫ ω, g ω ∂μ
    Proof (Lean source)
    theorem integral_sum_pi_eq {N : ℕ} {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (g : Ω → ℝ) (hg : Integrable g μ) : ∫ ω, (∑ i : Fin N, g (ω i)) ∂(Measure.pi (fun _ : Fin N => μ)) = N * ∫ ω, g ω ∂μ := by let π : Measure (Fin N → Ω) := Measure.pi (fun _ : Fin N => μ) have hπ : ∀ i : Fin N, MeasurePreserving (Function.eval i) π μ := by intro i simpa [π] using measurePreserving_eval (fun _ : Fin N => μ) i change ∫ ω, (∑ i : Fin N, g (ω i)) ∂π = N * ∫ ω, g ω ∂μ calc ∫ ω, (∑ i : Fin N, g (ω i)) ∂π = ∑ i : Fin N, ∫ ω, g (ω i) ∂π := by rw [integral_finset_sum] intro i _ simpa [Function.comp_def] using (hπ i).integrable_comp_of_integrable hg _ = ∑ _i : Fin N, ∫ ω, g ω ∂μ := by apply Finset.sum_congr rfl intro i _ calc ∫ ω, g (ω i) ∂π = ∫ ω, g ω ∂Measure.map (Function.eval i) π := by refine (integral_map (hπ i).measurable.aemeasurable ?_).symm simpa [(hπ i).map_eq] using hg.aestronglyMeasurable _ = ∫ ω, g ω ∂μ := by rw [(hπ i).map_eq] _ = N * ∫ ω, g ω ∂μ := by simp [Finset.sum_const, nsmul_eq_mul]
    Causalean.Stat.Concentration.integral_sum_pi_eq · Causalean/Stat/Concentration/Matrix/IidSums.lean:31
  • variance_sum_pi_eq theorem — Variance of an iid sum. For an iid sample of size N from μ (the product measure Measure.pi), the variance of the sum ∑ᵢ g(Xᵢ) of a fixed L² statistic g equals N · Var[g] — the coordinate copies are independent, so cross-covariances vanish.
    N :
    Ω :
    g :
    Ω → ℝ
    hg :
    MemLp g 2 μ
    Var[fun ω => ∑ i : Fin N, g (ω i); Measure.pi (fun _ : Fin N => μ)] = N * Var[g; μ]
    Proof (Lean source)
    theorem variance_sum_pi_eq {N : ℕ} {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (g : Ω → ℝ) (hg : MemLp g 2 μ) : Var[fun ω => ∑ i : Fin N, g (ω i); Measure.pi (fun _ : Fin N => μ)] = N * Var[g; μ] := by rw [show (fun ω : Fin N → Ω => ∑ i : Fin N, g (ω i)) = (∑ i : Fin N, fun ω : Fin N → Ω => g (ω i)) by ext ω simp [Finset.sum_apply]] simpa [Finset.sum_const, nsmul_eq_mul] using (ProbabilityTheory.variance_sum_pi (μ := fun _ : Fin N => μ) (X := fun _ : Fin N => g) (fun _ : Fin N => hg))
    Causalean.Stat.Concentration.variance_sum_pi_eq · Causalean/Stat/Concentration/Matrix/IidSums.lean:61
Inverse­Perturbation 1 core · 5 supporting Deterministic inverse-perturbation bounds that transport entrywise matrix deviations into control of a design inverse. ★ designInv00_perturb

Entrywise perturbation of the inverse design moment matrix

Deterministic inverse-perturbation bounds that transport entrywise matrix deviations into control of a design inverse.

The interior local-polynomial variance rate (M⁻¹)₀₀ = O(1/(Nh)) is obtained by transporting an entrywise concentration bound on the random design moment matrix M (each entry close to the corresponding entry of a fixed, invertible population matrix S) through the matrix inverse. This file develops the deterministic perturbation step:

if every entry of M is within η of the corresponding entry of an invertible matrix S, and the rows of S⁻¹ have absolute sums bounded by c, with c·(p+1)·η ≤ 1/2, then M is invertible and

|(M⁻¹)₀₀ − (S⁻¹)₀₀| ≤ 2 c² (p+1) η.

The argument is the operator (ℓ∞-operator, i.e. max-row-sum) norm Neumann/resolvent bound: M = S(1 − u) with u = S⁻¹(S − M), ‖u‖ ≤ ‖S⁻¹‖·‖S − M‖ ≤ 1/2, so 1 − u is a unit (Units.oneSub) with ‖(1−u)⁻¹‖ ≤ (1−‖u‖)⁻¹ ≤ 2 (geometric series), hence M is a unit with ‖M⁻¹‖ ≤ 2‖S⁻¹‖, and the resolvent identity M⁻¹ − S⁻¹ = M⁻¹(S − M)S⁻¹ (norm_unitInv_sub_unitInv_le) gives ‖M⁻¹ − S⁻¹‖ ≤ 2‖S⁻¹‖²‖S − M‖. The entry bound follows since each entry is dominated by the operator norm. The public statement carries only entrywise hypotheses, so it composes with the iid Chebyshev union bound (for M close to 𝔼 M = S) and the population positive-definiteness (designMatrix_posDef) without exposing the matrix norm.

theorem designInv00_perturb reviewed
Causalean.Stat.Concentration

The (0,0) specialization of the entrywise inverse perturbation bound. If S is invertible, every row of S⁻¹ has its absolute entries summing to at most c, every entry of M differs from the corresponding entry of S by at most η, and the product c · ((p+1) · η) is at most 1/2, then M is also invertible and its (0,0) inverse entry differs from S's by at most 2 · c² · ((p+1) · η).

Formal statement
p :
shared
S M :
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
hS :
IsUnit S.det
η c :
hSrow :
∀ i, (∑ j, |S⁻¹ i j|) ≤ c
hclose :
∀ j k, |M j k - S j k| ≤ η
hsmall :
c * ((p + 1 : ℕ) * η) ≤ 1 / 2
conclusion 1
IsUnit M.det
conclusion 2
|M⁻¹ 0 0 - S⁻¹ 0 0| ≤ 2 * c ^ 2 * ((p + 1 : ℕ) * η)
Proof (Lean source)
theorem designInv00_perturb (S M : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ) (hS : IsUnit S.det) {η c : ℝ} (hSrow : ∀ i, (∑ j, |S⁻¹ i j|) ≤ c) (hclose : ∀ j k, |M j k - S j k| ≤ η) (hsmall : c * ((p + 1 : ℕ) * η) ≤ 1 / 2) : IsUnit M.det ∧ |M⁻¹ 0 0 - S⁻¹ 0 0| ≤ 2 * c ^ 2 * ((p + 1 : ℕ) * η) := designInv_perturb S M hS hSrow hclose hsmall
Causalean.Stat.Concentration.designInv00_perturb · Causalean/Stat/Concentration/Matrix/InversePerturbation.lean:233
5 supporting declarations (lemmas, instances)
  • completeSpace_matrix_linftyOp theorem — Completeness of finite matrices under the ℓ∞-operator norm follows from the coordinatewise function-space uniformity. Needed to invoke the Neumann/geometric-series unit API.
    Proof (Lean source)
    theorem completeSpace_matrix_linftyOp {α β R : Type*} [Fintype α] [Fintype β] [NormedAddCommGroup R] [CompleteSpace R] : CompleteSpace (Matrix α β R) := inferInstanceAs (CompleteSpace (α → β → R))
    Causalean.Stat.Concentration.completeSpace_matrix_linftyOp · Causalean/Stat/Concentration/Matrix/InversePerturbation.lean:49
  • linftyOp_abs_entry_le theorem — Each coefficient norm is dominated by the ℓ∞-operator (max-row-sum) norm.
    α β R :
    A :
    Matrix α β R
    i :
    α
    j :
    β
    ‖A i j‖ ≤ ‖A‖
    Proof (Lean source)
    theorem linftyOp_abs_entry_le {α β R : Type*} [Fintype α] [Fintype β] [NormedAddCommGroup R] (A : Matrix α β R) (i : α) (j : β) : ‖A i j‖ ≤ ‖A‖ := by rw [Matrix.linfty_opNorm_def] have hrow : ‖A i j‖₊ ≤ ∑ k, ‖A i k‖₊ := Finset.single_le_sum (s := univ) (f := fun k => ‖A i k‖₊) (fun _ _ => zero_le) (Finset.mem_univ j) have hsup : (∑ k, ‖A i k‖₊) ≤ Finset.univ.sup (fun i => ∑ k, ‖A i k‖₊) := Finset.le_sup (s := univ) (f := fun i => ∑ k, ‖A i k‖₊) (Finset.mem_univ i) exact_mod_cast le_trans hrow hsup
    Causalean.Stat.Concentration.linftyOp_abs_entry_le · Causalean/Stat/Concentration/Matrix/InversePerturbation.lean:56
  • linftyOp_norm_le_of_rowsum theorem — A row-sum upper bound for the ℓ∞-operator norm: if every row's coefficient-norm sum is ≤ c, then ‖A‖ ≤ c.
    α β R :
    c :
    hc :
    0 ≤ c
    h :
    ∀ i, (∑ j, ‖A i j‖) ≤ c
    ‖A‖ ≤ c
    Proof (Lean source)
    theorem linftyOp_norm_le_of_rowsum {α β R : Type*} [Fintype α] [Fintype β] [NormedAddCommGroup R] {A : Matrix α β R} {c : ℝ} (hc : 0 ≤ c) (h : ∀ i, (∑ j, ‖A i j‖) ≤ c) : ‖A‖ ≤ c := by rw [Matrix.linfty_opNorm_def] have hsup : Finset.univ.sup (fun i => ∑ j, ‖A i j‖₊) ≤ c.toNNReal := by refine Finset.sup_le ?_ intro i _ exact NNReal.coe_le_coe.mp (by rw [NNReal.coe_sum, Real.coe_toNNReal c hc] simpa using h i) calc ↑(Finset.univ.sup fun i => ∑ j, ‖A i j‖₊) ≤ (c.toNNReal : ℝ) := NNReal.coe_le_coe.mpr hsup _ = c := Real.coe_toNNReal c hc
    Causalean.Stat.Concentration.linftyOp_norm_le_of_rowsum · Causalean/Stat/Concentration/Matrix/InversePerturbation.lean:70
  • linftyOp_norm_le_of_entry theorem — The ℓ∞-operator norm of an entrywise-η-bounded rectangular matrix is at most its number of columns times η.
    p :
    shared
    q :
    Matrix (Fin (p + 1)) (Fin (q + 1)) ℝ
    η :
    h :
    ∀ i j, |A i j| ≤ η
    ‖A‖ ≤ (q + 1 : ℕ) * η
    Proof (Lean source)
    theorem linftyOp_norm_le_of_entry {q : ℕ} {A : Matrix (Fin (p + 1)) (Fin (q + 1)) ℝ} {η : ℝ} (h : ∀ i j, |A i j| ≤ η) : ‖A‖ ≤ (q + 1 : ℕ) * η := by have hη : 0 ≤ η := le_trans (abs_nonneg (A 0 0)) (h 0 0) apply linftyOp_norm_le_of_rowsum (mul_nonneg (by positivity) hη) intro i calc ∑ j, |A i j| ≤ ∑ _j : Fin (q + 1), η := Finset.sum_le_sum (fun j _ => h i j) _ = (q + 1 : ℕ) * η := by simp [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]
    Causalean.Stat.Concentration.linftyOp_norm_le_of_entry · Causalean/Stat/Concentration/Matrix/InversePerturbation.lean:88
  • designInv_perturb theorem — Entrywise perturbation of an inverse entry. Let S be an invertible (p+1)×(p+1) real matrix whose inverse has rows with absolute sums bounded by c, and let M be a matrix all of whose entries are within η of S (|Mⱼₖ − Sⱼₖ| ≤ η). If c·(p+1)·η ≤ 1/2, then M is invertible and every selected pair of inverse entries satisfies
    p :
    shared
    S M :
    Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
    hS :
    IsUnit S.det
    η c :
    hSrow :
    ∀ i, (∑ j, |S⁻¹ i j|) ≤ c
    hclose :
    ∀ j k, |M j k - S j k| ≤ η
    hsmall :
    c * ((p + 1 : ℕ) * η) ≤ 1 / 2
    i j :
    Fin (p + 1)
    conclusion 1
    IsUnit M.det
    conclusion 2
    |M⁻¹ i j - S⁻¹ i j| ≤ 2 * c ^ 2 * ((p + 1 : ℕ) * η)
    Proof (Lean source)
    theorem designInv_perturb (S M : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ) (hS : IsUnit S.det) {η c : ℝ} (hSrow : ∀ i, (∑ j, |S⁻¹ i j|) ≤ c) (hclose : ∀ j k, |M j k - S j k| ≤ η) (hsmall : c * ((p + 1 : ℕ) * η) ≤ 1 / 2) {i j : Fin (p + 1)} : IsUnit M.det ∧ |M⁻¹ i j - S⁻¹ i j| ≤ 2 * c ^ 2 * ((p + 1 : ℕ) * η) := by haveI : CompleteSpace (Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ) := completeSpace_matrix_linftyOp let R := Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ have hSu : IsUnit S := (Matrix.isUnit_iff_isUnit_det S).mpr hS set Su : Rˣ := hSu.unit with hSu_def have hval : (↑Su : R) = S := by rw [hSu_def] exact hSu.unit_spec have hinv : (↑Su⁻¹ : R) = S⁻¹ := by rw [Matrix.coe_units_inv, hval] have hc : 0 ≤ c := le_trans (sum_nonneg fun _ _ => abs_nonneg _) (hSrow 0) have hSinv_norm : ‖(↑Su⁻¹ : R)‖ ≤ c := by rw [hinv] exact linftyOp_norm_le_of_rowsum hc hSrow have hMS_norm : ‖M - S‖ ≤ (p + 1 : ℕ) * η := linftyOp_norm_le_of_entry (by intro i j simpa [Matrix.sub_apply] using hclose i j) have hη : 0 ≤ η := le_trans (abs_nonneg (M 0 0 - S 0 0)) (hclose 0 0) have hdimη : 0 ≤ (p + 1 : ℕ) * η := mul_nonneg (by positivity) hη set u : R := (↑Su⁻¹ : R) * (S - M) with hu_def have hu_le : ‖u‖ ≤ c * ((p + 1 : ℕ) * η) := by calc ‖u‖ = ‖(↑Su⁻¹ : R) * (S - M)‖ := by rw [hu_def] _ ≤ ‖(↑Su⁻¹ : R)‖ * ‖S - M‖ := norm_mul_le _ _ _ = ‖(↑Su⁻¹ : R)‖ * ‖M - S‖ := by rw [norm_sub_rev S M] _ ≤ c * ((p + 1 : ℕ) * η) := by simpa [mul_comm] using mul_le_mul hMS_norm hSinv_norm (norm_nonneg _) hdimη have huhalf : ‖u‖ ≤ 1 / 2 := le_trans hu_le hsmall have hu1 : ‖u‖ < 1 := by have hunonneg : 0 ≤ ‖u‖ := norm_nonneg u nlinarith set v : Rˣ := Units.oneSub u hu1 with hv_def have hinvS : (↑Su⁻¹ : R) * S = 1 := by rw [← hval] exact_mod_cast Su.inv_mul have hSmulinv : S * (↑Su⁻¹ : R) = 1 := by rw [← hval] exact Su.mul_inv have hvval : (↑v : R) = (↑Su⁻¹ : R) * M := by rw [hv_def] change (1 : R) - u = (↑Su⁻¹ : R) * M rw [hu_def] calc (1 : R) - (↑Su⁻¹ : R) * (S - M) = (↑Su⁻¹ : R) * S - (↑Su⁻¹ : R) * (S - M) := by rw [hinvS] _ = (↑Su⁻¹ : R) * (S - (S - M)) := by rw [← mul_sub] _ = (↑Su⁻¹ : R) * M := by simp set Munit : Rˣ := Su * v with hM_def have hMval : (↑Munit : R) = M := by rw [hM_def] change ((↑Su : R) * (↑v : R)) = M rw [hval, hvval, ← mul_assoc, hSmulinv, one_mul] have hMunit : IsUnit M := hMval ▸ Munit.isUnit have hMdet : IsUnit M.det := (Matrix.isUnit_iff_isUnit_det M).mp hMunit have hMinv_eq : (↑Munit⁻¹ : R) = M⁻¹ := by rw [Matrix.coe_units_inv, hMval] have hvinv_norm : ‖(↑v⁻¹ : R)‖ ≤ (1 - ‖u‖)⁻¹ := by rw [hv_def] change ‖∑' n : ℕ, u ^ n‖ ≤ (1 - ‖u‖)⁻¹ have hgeo := tsum_geometric_le_of_norm_lt_one u hu1 rw [norm_one, sub_self, zero_add] at hgeo exact hgeo have hvinv2 : ‖(↑v⁻¹ : R)‖ ≤ 2 := by have hhalf_le : (1 / 2 : ℝ) ≤ 1 - ‖u‖ := by linarith have hhalf_pos : 0 < (1 / 2 : ℝ) := by norm_num have hinv_le : (1 - ‖u‖)⁻¹ ≤ 2 := by have hden_pos : 0 < 1 - ‖u‖ := by linarith calc (1 - ‖u‖)⁻¹ ≤ ((1 / 2 : ℝ)⁻¹) := (inv_le_inv₀ hden_pos hhalf_pos).mpr hhalf_le _ = 2 := by norm_num exact le_trans hvinv_norm hinv_le have hMunitinv_norm : ‖(↑Munit⁻¹ : R)‖ ≤ 2 * c := by calc ‖(↑Munit⁻¹ : R)‖ = ‖(↑v⁻¹ : R) * (↑Su⁻¹ : R)‖ := by rw [hM_def] rw [_root_.mul_inv_rev] rfl _ ≤ ‖(↑v⁻¹ : R)‖ * ‖(↑Su⁻¹ : R)‖ := norm_mul_le _ _ _ ≤ 2 * c := by exact mul_le_mul hvinv2 hSinv_norm (norm_nonneg _) (by norm_num) have hdiff_norm : ‖(↑Munit⁻¹ : R) - ↑Su⁻¹‖ ≤ 2 * c ^ 2 * ((p + 1 : ℕ) * η) := by have hres := norm_unitInv_sub_unitInv_le Munit Su calc ‖(↑Munit⁻¹ : R) - ↑Su⁻¹‖ ≤ ‖(↑Munit⁻¹ : R)‖ * ‖(↑Su⁻¹ : R)‖ * ‖(↑Munit : R) - ↑Su‖ := hres _ ≤ (2 * c) * c * ((p + 1 : ℕ) * η) := by have hdiff_mat : ‖(↑Munit : R) - ↑Su‖ ≤ (p + 1 : ℕ) * η := by simpa [hMval, hval] using hMS_norm have hAB : ‖(↑Munit⁻¹ : R)‖ * ‖(↑Su⁻¹ : R)‖ ≤ (2 * c) * c := mul_le_mul hMunitinv_norm hSinv_norm (norm_nonneg _) (by positivity) have hD_nonneg : 0 ≤ ‖(↑Munit : R) - ↑Su‖ := norm_nonneg _ have hC_nonneg : 0 ≤ (2 * c) * c := by positivity exact le_trans (mul_le_mul_of_nonneg_right hAB hD_nonneg) (mul_le_mul_of_nonneg_left hdiff_mat hC_nonneg) _ = 2 * c ^ 2 * ((p + 1 : ℕ) * η) := by ring refine ⟨hMdet, ?_⟩ calc |M⁻¹ i j - S⁻¹ i j| = |(((↑Munit⁻¹ : R) - ↑Su⁻¹) i j)| := by rw [← hMinv_eq, ← hinv, Matrix.sub_apply] _ ≤ ‖(↑Munit⁻¹ : R) - ↑Su⁻¹‖ := linftyOp_abs_entry_le ((↑Munit⁻¹ : R) - ↑Su⁻¹) i j _ ≤ 2 * c ^ 2 * ((p + 1 : ℕ) * η) := hdiff_norm
    Causalean.Stat.Concentration.designInv_perturb · Causalean/Stat/Concentration/Matrix/InversePerturbation.lean:102
Inverse­Union­Bound 1 core · 0 supporting The random design moment matrix has entries M_{jk}(ω) = ∑ᵢ h_{jk}(ωᵢ) with h_{jk}(a) = K((a−t)/h)·(a−t)^{j+k} — each entry is an iid sum, so it concentrates around its mean N·𝔼[h_{jk}] by iid_sum_chebyshev. ★ iid_sum_union_bound

Union bound for entrywise design-matrix concentration

The random design moment matrix has entries M_{jk}(ω) = ∑ᵢ h_{jk}(ωᵢ) with h_{jk}(a) = K((a−t)/h)·(a−t)^{j+k} — each entry is an iid sum, so it concentrates around its mean N·𝔼[h_{jk}] by iid_sum_chebyshev. To control the whole (p+1)²-entry matrix at once (the "good event" on which the inverse perturbation bound applies) we union-bound over the finite index set: the probability that some coordinate sum deviates from its mean by at least η is at most the sum of the per-coordinate Chebyshev bounds.

This is the probabilistic half of the matrix-inverse concentration: combined with the deterministic entrywise perturbation bound (designInv00_perturb), it shows that on an event of probability ≥ 1 − ∑ Var/η² the empirical moment matrix is invertible with controlled leverage.

theorem iid_sum_union_bound reviewed
Causalean.Stat.Concentration

Union bound for iid coordinate sums. For a finite family g : ι → Ω → ℝ such that each g a is square-integrable under μ, evaluated on an iid sample of size N drawn from the product law Measure.pi, and for any positive deviation threshold η, the probability that some index a has its sample sum ∑ᵢ g a (ωᵢ) deviate from its mean N·𝔼[g a] by at least η is bounded by the sum of the per-index Chebyshev bounds N·Var[g a]/η².

Formal statement
N :
ι :
Type*
Ω :
g :
ι → Ω → ℝ
hg :
∀ a, MemLp (g a) 2 μ
η :
:
0 < η
(Measure.pi (fun _ : Fin N => μ)) {ω : Fin N → Ω | ∃ a, η ≤ |(∑ i, g a (ω i)) - N * ∫ x, g a x ∂μ|}
≤ ∑ a, ofReal (N * Var[g a; μ] / η ^ 2)
Proof (Lean source)
theorem iid_sum_union_bound {N : ℕ} {ι : Type*} [Fintype ι] {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (g : ι → Ω → ℝ) (hg : ∀ a, MemLp (g a) 2 μ) {η : ℝ} (hη : 0 < η) : (Measure.pi (fun _ : Fin N => μ)) {ω : Fin N → Ω | ∃ a, η ≤ |(∑ i, g a (ω i)) - N * ∫ x, g a x ∂μ|} ≤ ∑ a, ofReal (N * Var[g a; μ] / η ^ 2) := by rw [Set.setOf_exists] refine le_trans (measure_iUnion_le (fun a : ι => {ω : Fin N → Ω | η ≤ |(∑ i, g a (ω i)) - N * ∫ x, g a x ∂μ|})) ?_ rw [tsum_fintype] refine Finset.sum_le_sum ?_ intro a _ exact iid_sum_chebyshev μ (g a) (hg a) hη
Causalean.Stat.Concentration.iid_sum_union_bound · Causalean/Stat/Concentration/Matrix/InverseUnionBound.lean:28
Localized­Gram 2 core · 1 supporting This module combines variance-sensitive coordinate concentration with the deterministic entrywise perturbation argument. ★ localized_empiricalGram_coercive

Bernstein coercivity for localized empirical Gram matrices

This module combines variance-sensitive coordinate concentration with the deterministic entrywise perturbation argument. The result applies to any finite feature index type and any bounded measurable local weight, independently of threshold, density, or local-polynomial constructions.

def localizedGramRate reviewed
Causalean.Stat.Concentration

For a finite feature index set, a real coercivity level, and a real envelope bound, the localized Gram-matrix exponential rate is the smaller of 1/201/20 and λ2/[16d(4dB4+B2λ)]\lambda^2/[16d(4dB^4+B^2\lambda)], where dd is the number of feature indices.

Definition (Lean source)
κ :
Type*
lambda B :
localizedGramRate κ lambda B :
min (1 / 20 : ℝ) (lambda ^ 2 / (16 * (Fintype.card κ : ℝ) * (4 * (Fintype.card κ : ℝ) * B ^ 4 + B ^ 2 * lambda)))
Causalean.Stat.Concentration.localizedGramRate · Causalean/Stat/Concentration/Matrix/LocalizedGram.lean:23
theorem localized_empiricalGram_coercive reviewed
Causalean.Stat.Concentration

Given measurable local weights and features, positive sample size, nonnegative local mass, and positive population coercivity, a nonnegative feature envelope, a unit-interval local weight, features bounded by that envelope, the stated local mass, and population Gram coercivity, failure of positive local count or realised-count-relative empirical Gram coercivity has an explicit Bernstein bound with exponent proportional to sample size times local mass.

Formal statement
N :
κ X :
Type*
Nonempty κ
q :
X → ℝ
phi :
κ → X → ℝ
hqmeas :
hphimeas :
∀ j, Measurable (phi j)
p lambda B :
hN :
0 < N
hp :
0 ≤ p
hlambda :
0 < lambda
hB :
0 ≤ B
hq :
∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1
hphi :
∀ j, ∀ᵐ x ∂P, |phi j x| ≤ B
hmass :
∫ x, q x ∂P = p
hcoercive :
∀ v : κ → ℝ,
lambda * p * (∑ j, (v j) ^ 2) ≤ ∑ j, ∑ k, v j * v k * ∫ x, q x * phi j x * phi k x ∂P
(Measure.pi (fun _ : Fin N ↦ P)).real {omega : Fin N → X | ¬ LocalizedGramGood lambda q phi omega}
≤ 2 * (1 + (Fintype.card κ : ℝ) * (Fintype.card κ : ℝ)) * exp (-(N : ℝ) * p * localizedGramRate κ lambda B)
Proof (Lean source)
theorem localized_empiricalGram_coercive {N : ℕ} {κ X : Type*} [Fintype κ] [Nonempty κ] [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (q : X → ℝ) (phi : κ → X → ℝ) (hqmeas : Measurable q) (hphimeas : ∀ j, Measurable (phi j)) {p lambda B : ℝ} (hN : 0 < N) (hp : 0 ≤ p) (hlambda : 0 < lambda) (hB : 0 ≤ B) (hq : ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1) (hphi : ∀ j, ∀ᵐ x ∂P, |phi j x| ≤ B) (hmass : ∫ x, q x ∂P = p) (hcoercive : ∀ v : κ → ℝ, lambda * p * (∑ j, (v j) ^ 2) ≤ ∑ j, ∑ k, v j * v k * ∫ x, q x * phi j x * phi k x ∂P) : (Measure.pi (fun _ : Fin N ↦ P)).real {omega : Fin N → X | ¬ LocalizedGramGood lambda q phi omega} ≤ 2 * (1 + (Fintype.card κ : ℝ) * (Fintype.card κ : ℝ)) * exp (-(N : ℝ) * p * localizedGramRate κ lambda B) := by rcases hp.eq_or_lt with rfl | hp · have hprob : (Measure.pi (fun _ : Fin N ↦ P)).real {omega : Fin N → X | ¬ LocalizedGramGood lambda q phi omega} ≤ 1 := measureReal_le_one have hcard : (1 : ℝ) ≤ Fintype.card κ := by exact_mod_cast Fintype.card_pos calc (Measure.pi (fun _ : Fin N ↦ P)).real {omega : Fin N → X | ¬ LocalizedGramGood lambda q phi omega} ≤ 1 := hprob _ ≤ 2 * (1 + (Fintype.card κ : ℝ) * (Fintype.card κ : ℝ)) := by nlinarith _ = 2 * (1 + (Fintype.card κ : ℝ) * (Fintype.card κ : ℝ)) * exp (-(N : ℝ) * 0 * localizedGramRate κ lambda B) := by simp · exact localized_empiricalGram_coercive_of_pos P q phi hqmeas hphimeas hN hp hlambda hB hq hphi hmass hcoercive
Causalean.Stat.Concentration.localized_empiricalGram_coercive · Causalean/Stat/Concentration/Matrix/LocalizedGram.lean:235 · uses LocalizedGramGood , localizedGramRate
1 supporting declaration (lemmas, instances)
  • localized_empiricalGram_coercive_of_pos theorem — Given measurable local weights and features, positive sample size, local mass, and population coercivity, a nonnegative feature envelope, a unit-interval local weight, features bounded by that envelope, the stated local mass, and population Gram coercivity, failure of positive local count or realised-count-relative empirical Gram coercivity has an explicit Bernstein bound with exponent proportional to sample size times local mass.
    N :
    κ X :
    Type*
    Nonempty κ
    q :
    X → ℝ
    phi :
    κ → X → ℝ
    hqmeas :
    hphimeas :
    ∀ j, Measurable (phi j)
    p lambda B :
    hN :
    0 < N
    hp :
    0 < p
    hlambda :
    0 < lambda
    hB :
    0 ≤ B
    hq :
    ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1
    hphi :
    ∀ j, ∀ᵐ x ∂P, |phi j x| ≤ B
    hmass :
    ∫ x, q x ∂P = p
    hcoercive :
    ∀ v : κ → ℝ,
    lambda * p * (∑ j, (v j) ^ 2) ≤ ∑ j, ∑ k, v j * v k * ∫ x, q x * phi j x * phi k x ∂P
    (Measure.pi (fun _ : Fin N ↦ P)).real {omega : Fin N → X | ¬ LocalizedGramGood lambda q phi omega}
    ≤ 2 * (1 + (Fintype.card κ : ℝ) * (Fintype.card κ : ℝ)) * exp (-(N : ℝ) * p * localizedGramRate κ lambda B)
    Proof (Lean source)
    theorem localized_empiricalGram_coercive_of_pos {N : ℕ} {κ X : Type*} [Fintype κ] [Nonempty κ] [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (q : X → ℝ) (phi : κ → X → ℝ) (hqmeas : Measurable q) (hphimeas : ∀ j, Measurable (phi j)) {p lambda B : ℝ} (hN : 0 < N) (hp : 0 < p) (hlambda : 0 < lambda) (hB : 0 ≤ B) (hq : ∀ᵐ x ∂P, 0 ≤ q x ∧ q x ≤ 1) (hphi : ∀ j, ∀ᵐ x ∂P, |phi j x| ≤ B) (hmass : ∫ x, q x ∂P = p) (hcoercive : ∀ v : κ → ℝ, lambda * p * (∑ j, (v j) ^ 2) ≤ ∑ j, ∑ k, v j * v k * ∫ x, q x * phi j x * phi k x ∂P) : (Measure.pi (fun _ : Fin N ↦ P)).real {omega : Fin N → X | ¬ LocalizedGramGood lambda q phi omega} ≤ 2 * (1 + (Fintype.card κ : ℝ) * (Fintype.card κ : ℝ)) * exp (-(N : ℝ) * p * localizedGramRate κ lambda B) := by let M : κ → κ → ℝ := fun j k ↦ ∫ x, q x * phi j x * phi k x ∂P let ι := Option (κ × κ) let g : ι → X → ℝ := fun a x ↦ match a with | none => q x | some jk => q x * phi jk.1 x * phi jk.2 x let b : ι → ℝ := fun a ↦ match a with | none => 1 | some _ => 2 * B ^ 2 let sigma2 : ι → ℝ := fun a ↦ match a with | none => p | some _ => B ^ 4 * p let eta : ι → ℝ := fun a ↦ match a with | none => (N : ℝ) * p / 2 | some _ => lambda * (N : ℝ) * p / (4 * (Fintype.card κ : ℝ)) have hNreal : (0 : ℝ) < (N : ℝ) := by exact_mod_cast hN have hNp : 0 < (N : ℝ) * p := mul_pos hNreal hp have hd : (0 : ℝ) < (Fintype.card κ : ℝ) := by exact_mod_cast Fintype.card_pos have hgmeas : ∀ a, Measurable (g a) := by intro a cases a with | none => simpa [g] using hqmeas | some jk => change Measurable (fun x ↦ q x * phi jk.1 x * phi jk.2 x) exact (hqmeas.mul (hphimeas jk.1)).mul (hphimeas jk.2) have hgint : ∀ a, Integrable (g a) P := by intro a cases a with | none => simpa [g] using localWeight_integrable P q hqmeas hq | some jk => simpa [g] using localGram_integrable P q phi hqmeas hphimeas hq hB hphi jk.1 jk.2 have hb : ∀ a, 0 ≤ b a := by intro a cases a <;> simp [b, sq_nonneg] have hsigma2 : ∀ a, 0 ≤ sigma2 a := by intro a cases a · simpa [sigma2] using le_of_lt hp · dsimp [sigma2] positivity have heta : ∀ a, 0 < eta a := by intro a cases a · simpa [eta] using div_pos hNp (by norm_num : (0 : ℝ) < 2) · dsimp [eta] positivity have henvelope : ∀ a, ∀ᵐ x ∂P, |g a x - ∫ y, g a y ∂P| ≤ b a := by intro a cases a with | none => simpa [g, b, hmass] using localWeight_centered_envelope P q hq hmass | some jk => simpa [g, b] using localGram_centered_envelope P q phi hq hB hphi jk.1 jk.2 have hvariance : ∀ a, ∫ x, (g a x - ∫ y, g a y ∂P) ^ 2 ∂P ≤ sigma2 a := by intro a cases a with | none => simpa [g, sigma2] using localWeight_centered_secondMoment_le P q hqmeas hq hmass | some jk => simpa [g, sigma2] using localGram_centered_secondMoment_le P q phi hqmeas hphimeas hq hB hphi hmass jk.1 jk.2 have hbern := iid_sum_bernstein_union_bound P g hgmeas hgint b sigma2 eta hb hsigma2 heta hN henvelope hvariance have hsubset : {omega : Fin N → X | ¬ LocalizedGramGood lambda q phi omega} ⊆ {omega : Fin N → X | ∃ a, eta a ≤ |(∑ i, g a (omega i)) - (N : ℝ) * ∫ x, g a x ∂P|} := by intro omega hfail have hdev := localizedGram_failure_subset_deviations q phi M hN hp hlambda hcoercive hfail rcases hdev with hcount | ⟨j, k, hentry⟩ · refine ⟨none, ?_⟩ simpa [eta, g, localCount, hmass] using hcount · refine ⟨some (j, k), ?_⟩ simpa [eta, g, M, localGramEntry] using hentry calc (Measure.pi (fun _ : Fin N ↦ P)).real {omega : Fin N → X | ¬ LocalizedGramGood lambda q phi omega} ≤ (Measure.pi (fun _ : Fin N ↦ P)).real {omega : Fin N → X | ∃ a, eta a ≤ |(∑ i, g a (omega i)) - (N : ℝ) * ∫ x, g a x ∂P|} := measureReal_mono hsubset _ ≤ ∑ a, 2 * exp (-(eta a) ^ 2 / (2 * (2 * (N : ℝ) * sigma2 a + b a * eta a))) := hbern _ ≤ 2 * (1 + (Fintype.card κ : ℝ) * (Fintype.card κ : ℝ)) * exp (-(N : ℝ) * p * localizedGramRate κ lambda B) := by by_cases hB0 : B = 0 · have hrate0 : localizedGramRate κ lambda B = 0 := by simp [localizedGramRate, hB0] calc ∑ a, 2 * exp (-(eta a) ^ 2 / (2 * (2 * (N : ℝ) * sigma2 a + b a * eta a))) ≤ ∑ _a : ι, 2 * 1 := by apply Finset.sum_le_sum intro a ha gcongr rw [Real.exp_le_one_iff] have hden : 0 ≤ 2 * (2 * (N : ℝ) * sigma2 a + b a * eta a) := by exact mul_nonneg (by norm_num) (add_nonneg (mul_nonneg (mul_nonneg (by norm_num) (le_of_lt hNreal)) (hsigma2 a)) (mul_nonneg (hb a) (le_of_lt (heta a)))) exact div_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (sq_nonneg _)) hden _ = 2 * (1 + (Fintype.card κ : ℝ) * (Fintype.card κ : ℝ)) := by simp [ι, Fintype.card_option, Fintype.card_prod] ring _ = 2 * (1 + (Fintype.card κ : ℝ) * (Fintype.card κ : ℝ)) * exp (-(N : ℝ) * p * localizedGramRate κ lambda B) := by rw [hrate0] simp · have hBpos : 0 < B := lt_of_le_of_ne hB (Ne.symm hB0) have hrate_count : localizedGramRate κ lambda B ≤ (1 / 20 : ℝ) := min_le_left _ _ have hrate_entry : localizedGramRate κ lambda B ≤ lambda ^ 2 / (16 * (Fintype.card κ : ℝ) * (4 * (Fintype.card κ : ℝ) * B ^ 4 + B ^ 2 * lambda)) := min_le_right _ _ have hcoord : ∀ a, (N : ℝ) * p * localizedGramRate κ lambda B ≤ (eta a) ^ 2 / (2 * (2 * (N : ℝ) * sigma2 a + b a * eta a)) := by intro a cases a with | none => have hmul := mul_le_mul_of_nonneg_left hrate_count (le_of_lt hNp) dsimp [eta, sigma2, b] have hid : (((N : ℝ) * p / 2) ^ 2 / (2 * (2 * (N : ℝ) * p + 1 * ((N : ℝ) * p / 2)))) = (N : ℝ) * p * (1 / 20 : ℝ) := by field_simp [ne_of_gt hNreal, ne_of_gt hp] ring rw [hid] exact hmul | some jk => have hmul := mul_le_mul_of_nonneg_left hrate_entry (le_of_lt hNp) dsimp [eta, sigma2, b] have hid : ((lambda * (N : ℝ) * p / (4 * (Fintype.card κ : ℝ))) ^ 2 / (2 * (2 * (N : ℝ) * (B ^ 4 * p) + 2 * B ^ 2 * (lambda * (N : ℝ) * p / (4 * (Fintype.card κ : ℝ)))))) = (N : ℝ) * p * (lambda ^ 2 / (16 * (Fintype.card κ : ℝ) * (4 * (Fintype.card κ : ℝ) * B ^ 4 + B ^ 2 * lambda))) := by field_simp [ne_of_gt hNreal, ne_of_gt hp, ne_of_gt hd, ne_of_gt hBpos, ne_of_gt hlambda] ring rw [hid] exact hmul calc ∑ a, 2 * exp (-(eta a) ^ 2 / (2 * (2 * (N : ℝ) * sigma2 a + b a * eta a))) ≤ ∑ _a : ι, 2 * exp (-(N : ℝ) * p * localizedGramRate κ lambda B) := by apply Finset.sum_le_sum intro a ha gcongr calc -(eta a) ^ 2 / (2 * (2 * (N : ℝ) * sigma2 a + b a * eta a)) ≤ -((N : ℝ) * p * localizedGramRate κ lambda B) := by simpa only [neg_div] using neg_le_neg (hcoord a) _ = -(N : ℝ) * p * localizedGramRate κ lambda B := by ring _ = 2 * (1 + (Fintype.card κ : ℝ) * (Fintype.card κ : ℝ)) * exp (-(N : ℝ) * p * localizedGramRate κ lambda B) := by simp [ι, Fintype.card_option, Fintype.card_prod] ring
    Causalean.Stat.Concentration.localized_empiricalGram_coercive_of_pos · Causalean/Stat/Concentration/Matrix/LocalizedGram.lean:32
Resolvent 1 core · 0 supporting The interior local-polynomial variance rate (M⁻¹)₀₀ = O(1/(Nh)) is obtained by concentrating the random design moment matrix M (entrywise, via the iid Chebyshev bound) around a fixed positive-definite population matrix a ★ norm_unitInv_sub_unitInv_le

Quantitative inverse perturbation bound

The interior local-polynomial variance rate (M⁻¹)₀₀ = O(1/(Nh)) is obtained by concentrating the random design moment matrix M (entrywise, via the iid Chebyshev bound) around a fixed positive-definite population matrix and transporting the bound through the matrix inverse. The quantitative tool for that transport is the resolvent (first-resolvent) inequality

‖a⁻¹ − b⁻¹‖ ≤ ‖a⁻¹‖ · ‖b⁻¹‖ · ‖a − b‖,

valid for any two units a, b of a normed ring (a⁻¹ − b⁻¹ = a⁻¹ (b − a) b⁻¹ and submultiplicativity of the norm). This is the explicit-constant companion to Mathlib's asymptotic inverse_continuousAt / inverse_add_norm_diff_first_order.

theorem norm_unitInv_sub_unitInv_le reviewed
Causalean.Stat.Concentration

Resolvent inequality. For a seminormed ring R and units a and b of R, the norm of the difference of their inverses is bounded above by the product of the norms of the two inverses and the norm of their difference.

Formal statement
R :
a b :
‖(↑a⁻¹ : R) - ↑b⁻¹‖ ≤ ‖(↑a⁻¹ : R)‖ * ‖(↑b⁻¹ : R)‖ * ‖(↑a : R) - ↑b‖
Proof (Lean source)
theorem norm_unitInv_sub_unitInv_le {R : Type*} [SeminormedRing R] (a b : Rˣ) : ‖(↑a⁻¹ : R) - ↑b⁻¹‖ ≤ ‖(↑a⁻¹ : R)‖ * ‖(↑b⁻¹ : R)‖ * ‖(↑a : R) - ↑b‖ := by have hid : (↑a⁻¹ : R) - ↑b⁻¹ = ↑a⁻¹ * (↑b - ↑a) * ↑b⁻¹ := by have h1 : (↑a⁻¹ : R) * ↑a = 1 := by exact_mod_cast a.inv_mul have h2 : (↑b : R) * ↑b⁻¹ = 1 := by exact_mod_cast b.mul_inv calc (↑a⁻¹ : R) - ↑b⁻¹ = (↑a⁻¹ : R) * ((↑b : R) * ↑b⁻¹) - ((↑a⁻¹ : R) * ↑a) * ↑b⁻¹ := by simp [h1, h2] _ = ↑a⁻¹ * (↑b - ↑a) * ↑b⁻¹ := by noncomm_ring calc ‖(↑a⁻¹ : R) - ↑b⁻¹‖ = ‖(↑a⁻¹ : R) * (↑b - ↑a) * ↑b⁻¹‖ := by rw [hid] _ ≤ ‖(↑a⁻¹ : R) * (↑b - ↑a)‖ * ‖(↑b⁻¹ : R)‖ := norm_mul_le _ _ _ ≤ ‖(↑a⁻¹ : R)‖ * ‖(↑b : R) - ↑a‖ * ‖(↑b⁻¹ : R)‖ := by gcongr; exact norm_mul_le _ _ _ = ‖(↑a⁻¹ : R)‖ * ‖(↑b⁻¹ : R)‖ * ‖(↑a : R) - ↑b‖ := by rw [norm_sub_rev (↑b : R) (↑a : R)]; ring
Causalean.Stat.Concentration.norm_unitInv_sub_unitInv_le · Causalean/Stat/Concentration/Matrix/Resolvent.lean:27