NLA-lib Explorer

O(c^2\log(\lvert n\rvert/\delta)/(\lvert n\rvert\tau^2)) probes suffice for SLQ to approximate the spectral density, uniformly in Lipschitz test functions

Library · Result group

Theorem (exists_forall_measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le). O(c^2\log(\lvert n\rvert/\delta)/(\lvert n\rvert\tau^2)) probes suffice for SLQ to approximate the spectral density, uniformly in Lipschitz test functions: there is an absolute constant C > 0 such that the following holds. Let the entries of the real n \times m test matrix \mathbf{\Omega} be independent, each satisfying the sub-Gaussian moment generating function bound with variance proxy c > 0 and having second moment 1; let \mathbf{A} be real symmetric with spectrum in [a, \mathbf{b}], a < \mathbf{b}; let L \ge 0, q \in \mathbb{N}, 0 < \tau \le 1 and 0 < \delta \le 1. If m \ge C c^2\log(2\lvert n\rvert/\delta)/(\lvert n\rvert\tau^2), then except with probability at most \delta every f that is L-Lipschitz on [a, \mathbf{b}] satisfies <!-- value jacksonApproximationConstant --> \Bigl\lvert\int f\,d\nu_{\mathbf{A}} - \int f\,d\,\mathsf{slqMeasure}(\mathbf{A}, \mathbf{\Omega}, q + 1)\Bigr\rvert \le (\lvert f(\mathbf{b})\rvert + L(\mathbf{b} - a))\tau + \frac{\pi L(\mathbf{b} - a)}{2q + 3}(1 + \tau)\,, \nu_{\mathbf{A}} the empirical spectral measure; the constant of the Gauss term is jacksonApproximationConstant. The constant C comes before every dimension, matrix and parameter. With \lvert n\rvert in the denominator, for large n a single probe suffices. Proved from NLAlib.measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le with C = 196. [ChenTrogdonUbaru2021, the Wasserstein bound for SLQ] (theorem number to check); there for probes uniform on the sphere.

Headline (provisional) General form: sizes are index types

Lean statement and details
NLAlib.exists_forall_measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le :
  ∃ C,
    0 < C ∧
      ∀ {Ω n m : Type} [inst : MeasurableSpace Ω] [inst_1 : Fintype n] [inst_2 : DecidableEq n]
        [inst_3 : Fintype m] (μ : Measure Ω) (X : Ω → Matrix n m ℝ) (c : ℝ≥0) (A : Matrix n n ℝ)
        (a b : ℝ) (L : ℝ≥0) (q : ℕ) (τ δ : ℝ),
        0 < c →
          iIndepFun (fun p ω ↦ X ω p.1 p.2) μ →
            (∀ (i : n) (j : m), HasSubgaussianMGF (fun ω ↦ X ω i j) c μ) →
              (∀ (i : n) (j : m), ∫ (ω : Ω), X ω i j ^ 2 ∂μ = 1) →
                A.IsHermitian →
                  a < b →
                    spectrum ℝ A ⊆ Set.Icc a b →
                      0 < τ →
                        τ ≤ 1 →
                          0 < δ →
                            δ ≤ 1 →
                              C * ↑c ^ 2 * Real.log (2 * ↑(Fintype.card n) / δ) /
                                    (↑(Fintype.card n) * τ ^ 2) ≤
                                  ↑(Fintype.card m) →
                                μ.real
                                    {ω |
                                      ∃ f,
                                        LipschitzOnWith L f (Set.Icc a b) ∧
                                          (|f b| + ↑L * (b - a)) * τ +
                                              jacksonApproximationConstant * ↑L * (b - a) /
                                                  (2 * ↑q + 3) *
                                                (1 + τ) <
                                            |∫ (x : ℝ), f x ∂empiricalSpectralMeasure A -
                                                ∫ (x : ℝ), f x ∂slqMeasure A (X ω) (q + 1)|} ≤
                                  δ

Full source on GitHub

Copy link

Other forms

Theorem (exists_forall_measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le_of_hasLaw_uniformSphereVector). O(\log(\lvert n\rvert/\delta)/(\lvert n\rvert\tau^2)) sphere probes suffice for SLQ to approximate the spectral density, uniformly in Lipschitz test functions: there is an absolute constant C > 0 such that the following holds. Let the columns \mathbf{u}_1, \dots, \mathbf{u}_m of the random real n \times m matrix \mathbf{U} be independent, each uniform on the unit sphere of \mathbb{R}^n (law uniformSphereVector n); let \mathbf{A} be real symmetric with spectrum in [a, \mathbf{b}], a < \mathbf{b}; let L \ge 0, q \in \mathbb{N}, \tau > 0 and \delta > 0. If m \ge C\log(2\lvert n\rvert/\delta)/(\lvert n\rvert\tau^2), then except with probability at most \delta every f that is L-Lipschitz on [a, \mathbf{b}] satisfies <!-- value jacksonApproximationConstant --> \Bigl\lvert\int f\,d\nu_{\mathbf{A}} - \int f\,d\,\mathsf{slqMeasure}(\mathbf{A}, \sqrt{\lvert n\rvert}\,\mathbf{U}, q + 1)\Bigr\rvert \le L(\mathbf{b} - a)\tau + \frac{\pi L(\mathbf{b} - a)}{2q + 3}\,, \nu_{\mathbf{A}} the empirical spectral measure; the constant of the Gauss term is jacksonApproximationConstant. The constant C comes before every dimension, matrix and parameter; C = 1 works. Proved from NLAlib.measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le_of_hasLaw_uniformSphereVector through its sample-size form NLAlib.measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le_of_hasLaw_uniformSphereVector_of_log_div_le. [ChenTrogdonUbaru2021, the Wasserstein bound for SLQ] (theorem number to check).

General form: sizes are index types

Lean statement and details
NLAlib.exists_forall_measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le_of_hasLaw_uniformSphereVector :
  ∃ C,
    0 < C ∧
      ∀ {Ω n m : Type} [inst : MeasurableSpace Ω] [inst_1 : Fintype n] [inst_2 : DecidableEq n]
        [inst_3 : Fintype m] (μ : Measure Ω) (U : Ω → Matrix n m ℝ) (A : Matrix n n ℝ) (a b : ℝ)
        (L : ℝ≥0) (q : ℕ) (τ δ : ℝ),
        iIndepFun (fun j ω i ↦ U ω i j) μ →
          (∀ (j : m), HasLaw (fun ω i ↦ U ω i j) (uniformSphereVector n) μ) →
            A.IsHermitian →
              a < b →
                spectrum ℝ A ⊆ Set.Icc a b →
                  0 < τ →
                    0 < δ →
                      C * Real.log (2 * ↑(Fintype.card n) / δ) / (↑(Fintype.card n) * τ ^ 2) ≤
                          ↑(Fintype.card m) →
                        μ.real
                            {ω |
                              ∃ f,
                                LipschitzOnWith L f (Set.Icc a b) ∧
                                  ↑L * (b - a) * τ +
                                      jacksonApproximationConstant * ↑L * (b - a) / (2 * ↑q + 3) <
                                    |∫ (x : ℝ), f x ∂empiricalSpectralMeasure A -
                                        ∫ (x : ℝ),
                                          f x ∂slqMeasure A (√↑(Fintype.card n) • U ω) (q + 1)|} ≤
                          δ

Full source on GitHub

Copy link

Theorem (measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_probeSpectralMeasure_gt_le). The probe spectral measure approximates the spectral density, uniformly in Lipschitz test functions. Let the entries of the real n \times m test matrix \mathbf{\Omega} be independent, each satisfying the sub-Gaussian moment generating function bound with variance proxy c and having second moment 1; let \mathbf{A} be real symmetric with spectrum in [a, \mathbf{b}], a \le \mathbf{b}, and let L \ge 0 and \tau \ge 0. Then, except with probability at most <!-- value hansonWrightConstant --> 2\lvert n\rvert\exp\Bigl(-\frac{1}{196}\,m\lvert n\rvert\min\Bigl(\frac{\tau^2}{c^2}, \frac{\tau}{c}\Bigr)\Bigr)\,, every f that is L-Lipschitz on [a, \mathbf{b}] satisfies \Bigl\lvert\int f\,d\nu_{\mathbf{A}} - \int f\,d\,\mathsf{probeSpectralMeasure}(\mathbf{A}, \mathbf{\Omega})\Bigr\rvert \le (\lvert f(\mathbf{b})\rvert + L(\mathbf{b} - a))\tau\,, \nu_{\mathbf{A}} the empirical spectral measure; the constant is hansonWrightConstant. This is SLQ with exact quadrature. [ChenTrogdonUbaru2021, §3] (locator to check); there for probes uniform on the sphere.

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_probeSpectralMeasure_gt_le.{u_2,
    u_3, u_4}
  {n : Type u_2} {m : Type u_3} [Fintype n] [DecidableEq n] [Fintype m] {Ω : Type u_4}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {X : Ω → Matrix n m ℝ} {c : ℝ≥0}
  (hind : iIndepFun (fun p ω ↦ X ω p.1 p.2) μ)
  (hsub : ∀ (i : n) (j : m), HasSubgaussianMGF (fun ω ↦ X ω i j) c μ)
  (hvar : ∀ (i : n) (j : m), ∫ (ω : Ω), X ω i j ^ 2 ∂μ = 1) {A : Matrix n n ℝ} (hA : A.IsHermitian)
  {a b : ℝ} (hab : a ≤ b) (hs : spectrum ℝ A ⊆ Set.Icc a b) (L : ℝ≥0) {τ : ℝ} (hτ : 0 ≤ τ) :
  μ.real
      {ω |
        ∃ f,
          LipschitzOnWith L f (Set.Icc a b) ∧
            (|f b| + ↑L * (b - a)) * τ <
              |∫ (x : ℝ), f x ∂empiricalSpectralMeasure A -
                  ∫ (x : ℝ), f x ∂probeSpectralMeasure A (X ω)|} ≤
    2 * ↑(Fintype.card n) *
      rexp
        (-(hansonWrightConstant *
            (↑(Fintype.card m) * ↑(Fintype.card n) * min (τ ^ 2 / ↑c ^ 2) (τ / ↑c))))

Full source on GitHub

Copy link

Theorem (measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le). Stochastic Lanczos quadrature approximates the spectral density, uniformly in Lipschitz test functions. Let the entries of the real n \times m test matrix \mathbf{\Omega} be independent, each satisfying the sub-Gaussian moment generating function bound with variance proxy c and having second moment 1; let \mathbf{A} be real symmetric with spectrum in [a, \mathbf{b}], a < \mathbf{b}; let L \ge 0, q \in \mathbb{N} and \tau \ge 0. Then, except with probability at most <!-- value hansonWrightConstant --> 2\lvert n\rvert\exp\Bigl(-\frac{1}{196}\,m\lvert n\rvert\min\Bigl(\frac{\tau^2}{c^2}, \frac{\tau}{c}\Bigr)\Bigr)\,, every f that is L-Lipschitz on [a, \mathbf{b}] satisfies <!-- value jacksonApproximationConstant --> \Bigl\lvert\int f\,d\nu_{\mathbf{A}} - \int f\,d\,\mathsf{slqMeasure}(\mathbf{A}, \mathbf{\Omega}, q + 1)\Bigr\rvert \le (\lvert f(\mathbf{b})\rvert + L(\mathbf{b} - a))\tau + \frac{\pi L(\mathbf{b} - a)}{2q + 3}(1 + \tau)\,, \nu_{\mathbf{A}} the empirical spectral measure; the constants are hansonWrightConstant and jacksonApproximationConstant. For test functions with f(\mathbf{b}) = 0 and equal masses this is a Wasserstein-1 bound. The factor 1 + \tau bounds the random mass \|\mathbf{\Omega}\|_{\mathsf{F}}^2/(\lvert n\rvert m) on the same event. Gaussian and sign test matrices are the case c = 1. Asymptotic form: NLAlib.exists_forall_measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le. [ChenTrogdonUbaru2021, the Wasserstein bound for SLQ] (theorem number to check); there for probes uniform on the sphere, with the sharper sub-Gaussian constant of Beta laws and the bound in the Wasserstein distance; the Jackson step is [ChenTrogdonUbaru2022, Appendix C, Theorem 38].

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le.{u_2,
    u_3, u_4}
  {n : Type u_2} {m : Type u_3} [Fintype n] [DecidableEq n] [Fintype m] {Ω : Type u_4}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {X : Ω → Matrix n m ℝ} {c : ℝ≥0}
  (hind : iIndepFun (fun p ω ↦ X ω p.1 p.2) μ)
  (hsub : ∀ (i : n) (j : m), HasSubgaussianMGF (fun ω ↦ X ω i j) c μ)
  (hvar : ∀ (i : n) (j : m), ∫ (ω : Ω), X ω i j ^ 2 ∂μ = 1) {A : Matrix n n ℝ} (hA : A.IsHermitian)
  {a b : ℝ} (hab : a < b) (hs : spectrum ℝ A ⊆ Set.Icc a b) (L : ℝ≥0) (q : ℕ) {τ : ℝ} (hτ : 0 ≤ τ) :
  μ.real
      {ω |
        ∃ f,
          LipschitzOnWith L f (Set.Icc a b) ∧
            (|f b| + ↑L * (b - a)) * τ +
                jacksonApproximationConstant * ↑L * (b - a) / (2 * ↑q + 3) * (1 + τ) <
              |∫ (x : ℝ), f x ∂empiricalSpectralMeasure A -
                  ∫ (x : ℝ), f x ∂slqMeasure A (X ω) (q + 1)|} ≤
    2 * ↑(Fintype.card n) *
      rexp
        (-(hansonWrightConstant *
            (↑(Fintype.card m) * ↑(Fintype.card n) * min (τ ^ 2 / ↑c ^ 2) (τ / ↑c))))

Full source on GitHub

Copy link

Theorem (measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le_of_hasLaw_uniformSphereVector). SLQ with sphere probes, uniformly in Lipschitz test functions. Let the columns \mathbf{u}_1, \dots, \mathbf{u}_m of the random real n \times m matrix \mathbf{U} be independent, each uniform on the unit sphere of \mathbb{R}^n (law uniformSphereVector n); let \mathbf{A} be real symmetric with spectrum in [a, \mathbf{b}], a < \mathbf{b}; let L \ge 0, q \in \mathbb{N} and \tau \ge 0. Then, except with probability at most 2\lvert n\rvert\exp(-m(\lvert n\rvert + 2)\tau^2), every f that is L-Lipschitz on [a, \mathbf{b}] satisfies <!-- value jacksonApproximationConstant --> \Bigl\lvert\int f\,d\nu_{\mathbf{A}} - \int f\,d\,\mathsf{slqMeasure}(\mathbf{A}, \sqrt{\lvert n\rvert}\,\mathbf{U}, q + 1)\Bigr\rvert \le L(\mathbf{b} - a)\tau + \frac{\pi L(\mathbf{b} - a)}{2q + 3}\,, \nu_{\mathbf{A}} the empirical spectral measure; the constant of the Gauss term is jacksonApproximationConstant. With sphere probes the probe and SLQ measures have mass exactly 1, so there is no term in \lvert f(\mathbf{b})\rvert and no factor 1 + \tau: this is a Wasserstein-1 bound. Asymptotic form: NLAlib.exists_forall_measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le_of_hasLaw_uniformSphereVector. [ChenTrogdonUbaru2021, the Wasserstein bound for SLQ] (theorem number to check); the Jackson step is [ChenTrogdonUbaru2022, Appendix C, Theorem 38].

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_slqMeasure_gt_le_of_hasLaw_uniformSphereVector.{u_2,
    u_3, u_4}
  {n : Type u_2} {m : Type u_3} [Fintype n] [DecidableEq n] [Fintype m] {Ω : Type u_4}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {U : Ω → Matrix n m ℝ}
  (hind : iIndepFun (fun j ω i ↦ U ω i j) μ)
  (hU : ∀ (j : m), HasLaw (fun ω i ↦ U ω i j) (uniformSphereVector n) μ) {A : Matrix n n ℝ}
  (hA : A.IsHermitian) {a b : ℝ} (hab : a < b) (hs : spectrum ℝ A ⊆ Set.Icc a b) (L : ℝ≥0) (q : ℕ)
  {τ : ℝ} (hτ : 0 ≤ τ) :
  μ.real
      {ω |
        ∃ f,
          LipschitzOnWith L f (Set.Icc a b) ∧
            ↑L * (b - a) * τ + jacksonApproximationConstant * ↑L * (b - a) / (2 * ↑q + 3) <
              |∫ (x : ℝ), f x ∂empiricalSpectralMeasure A -
                  ∫ (x : ℝ), f x ∂slqMeasure A (√↑(Fintype.card n) • U ω) (q + 1)|} ≤
    2 * ↑(Fintype.card n) * rexp (-(↑(Fintype.card m) * (↑(Fintype.card n) + 2) * τ ^ 2))

Full source on GitHub

Copy link

Theorem (measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_smul_slqMeasure_gt_le). The mass-normalised SLQ measure approximates the spectral density, uniformly in Lipschitz test functions. Let the entries of the real n \times m test matrix \mathbf{\Omega} be independent, each satisfying the sub-Gaussian moment generating function bound with variance proxy c and having second moment 1; let \mathbf{A} be real symmetric with spectrum in [a, \mathbf{b}], a < \mathbf{b}; let L \ge 0, q \in \mathbb{N} and 0 \le \tau < 1. Then, except with probability at most <!-- value hansonWrightConstant --> 2\lvert n\rvert\exp\Bigl(-\frac{1}{196}\,m\lvert n\rvert\min\Bigl(\frac{\tau^2}{c^2}, \frac{\tau}{c}\Bigr)\Bigr)\,, the SLQ measure divided by its mass satisfies, for every f that is L-Lipschitz on [a, \mathbf{b}], <!-- value jacksonApproximationConstant --> \Bigl\lvert\int f\,d\nu_{\mathbf{A}} - \int f\,d\,\frac{\mathsf{slqMeasure}(\mathbf{A}, \mathbf{\Omega},q+1)}{\mathsf{slqMeasure}(\mathbf{A},\mathbf{\Omega},q+1)(\mathbb{R})}\Bigr\rvert \le 2L(\mathbf{b} - a)\tau + \frac{\pi L(\mathbf{b} - a)}{2q + 3}\,, \nu_{\mathbf{A}} the empirical spectral measure; the constants are hansonWrightConstant and jacksonApproximationConstant. Both measures are probability measures, so there is no term in \lvert f(\mathbf{b})\rvert; \tau < 1 keeps the mass positive. Junk: for empty n the normalisation is \infty \cdot 0 = 0 and the event is empty. [ChenTrogdonUbaru2021, the Wasserstein bound for SLQ] (theorem number to check); there for probes uniform on the sphere, whose SLQ measure has mass 1.

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_exists_abs_integral_empiricalSpectralMeasure_sub_integral_smul_slqMeasure_gt_le.{u_2,
    u_3, u_4}
  {n : Type u_2} {m : Type u_3} [Fintype n] [DecidableEq n] [Fintype m] {Ω : Type u_4}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {X : Ω → Matrix n m ℝ} {c : ℝ≥0}
  (hind : iIndepFun (fun p ω ↦ X ω p.1 p.2) μ)
  (hsub : ∀ (i : n) (j : m), HasSubgaussianMGF (fun ω ↦ X ω i j) c μ)
  (hvar : ∀ (i : n) (j : m), ∫ (ω : Ω), X ω i j ^ 2 ∂μ = 1) {A : Matrix n n ℝ} (hA : A.IsHermitian)
  {a b : ℝ} (hab : a < b) (hs : spectrum ℝ A ⊆ Set.Icc a b) (L : ℝ≥0) (q : ℕ) {τ : ℝ} (hτ : 0 ≤ τ)
  (hτ1 : τ < 1) :
  μ.real
      {ω |
        ∃ f,
          LipschitzOnWith L f (Set.Icc a b) ∧
            ↑L * (b - a) * (2 * τ) + jacksonApproximationConstant * ↑L * (b - a) / (2 * ↑q + 3) <
              |∫ (x : ℝ), f x ∂empiricalSpectralMeasure A -
                  ∫ (x : ℝ),
                    f x ∂((slqMeasure A (X ω) (q + 1)) Set.univ)⁻¹ • slqMeasure A (X ω) (q + 1)|} ≤
    2 * ↑(Fintype.card n) *
      rexp
        (-(hansonWrightConstant *
            (↑(Fintype.card m) * ↑(Fintype.card n) * min (τ ^ 2 / ↑c ^ 2) (τ / ↑c))))

Full source on GitHub

Copy link

General form: sizes are index types. A size is carried by a finite index type: |k| is the number of elements of the index type k, and "k nonempty" means k ≥ 1.