NLA-lib Explorer

Hutch++ does not overestimate a positive semidefinite trace by a factor 1 + \varepsilon

Library · Result group

Theorem (Matrix.PosSemidef.measureReal_hutchpp_gt_one_add_mul_trace_le_of_isSubgaussianVector). Hutch++ does not overestimate a positive semidefinite trace by a factor 1 + \varepsilon. With the hypotheses of NLAlib.measureReal_abs_trace_sub_hutchpp_gt_mul_nuclearNorm_le_of_isSubgaussianVector: the sketch \mathbf{S}^{\mathsf{H}}, \lvert s \rvert \ge 1, has independent, isotropic, sub-Gaussian rows with proxy c; the n \times \ell residual test matrix \mathbf{G} is independent of \mathbf{S} with independent entries, sub-Gaussian with variance proxy c' and of second moment 1; r \ge 1, \varepsilon > 0, \delta > 0, <!-- value subgaussianEmbeddingDim c r (1/2) (\delta/4) --> \lvert s \rvert \ge 25 c^2 (r \log 21 + \log(2/(\delta/4)))/(16C (1/2)^2), with <!-- value subgaussianJLConstant -->C = 1/36, and <!-- value subgaussianRangeFinderFactor c --> <!-- value hansonWrightConstant --> \log\frac{4}{\delta} \le \frac{1}{196}\cdot\frac{4\ell r\varepsilon^2}{c'^2(1 + 5c/2)}\,,\qquad \log\frac{4}{\delta} \le \frac{1}{196}\cdot\frac{2\ell\sqrt{r}\,\varepsilon}{c'\sqrt{1 + 5c/2}}\,. Then for every real positive semidefinite \mathbf{A} \mathbb{P}\bigl[\mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G}) > (1 + \varepsilon)\operatorname{tr}\mathbf{A}\bigr] \le \delta\,; the size is subgaussianEmbeddingDim c r (1 / 2) (δ / 4), C is subgaussianJLConstant, the factor is subgaussianRangeFinderFactor c and 1/196 is hansonWrightConstant. The lower half is Matrix.PosSemidef.measureReal_hutchpp_lt_one_sub_mul_trace_le_of_isSubgaussianVector. [MeyerMuscoMuscoWoodruff2021, Theorem 1]; there both halves together, with sign test matrices and unspecified constants.

Headline (provisional) General form: sizes are index types

Lean statement and details
Matrix.PosSemidef.measureReal_hutchpp_gt_one_add_mul_trace_le_of_isSubgaussianVector.{u_1, u_2, u_3,
    u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_2} {s : Type u_3}
  {t : Type u_4} [Fintype n] [Fintype s] [Fintype t] [DecidableEq n] [Nonempty s] {A : Matrix n n ℝ}
  (hA : A.PosSemidef) {S : Ω → Matrix n s ℝ} {G : Ω → Matrix n t ℝ} {c c' : ℝ≥0}
  (hSind : iIndepFun (fun i ω ↦ (S ω)ᴴ i) μ)
  (hSsub : ∀ (i : s), IsSubgaussianVector (fun ω ↦ (S ω)ᴴ i) c μ)
  (hSiso : ∀ (i : s), IsIsotropic (fun ω ↦ (S ω)ᴴ i) μ)
  (hGind : iIndepFun (fun p ω ↦ G ω p.1 p.2) μ)
  (hGsub : ∀ (i : n) (j : t), HasSubgaussianMGF (fun ω ↦ G ω i j) c' μ)
  (hGvar : ∀ (i : n) (j : t), ∫ (ω : Ω), G ω i j ^ 2 ∂μ = 1) (hSG : S ⟂ᵢ[μ] G) {r : ℕ} (hr : 0 < r)
  {ε δ : ℝ} (hε : 0 < ε) (hδ : 0 < δ)
  (hs : subgaussianEmbeddingDim (↑c) r (1 / 2) (δ / 4) ≤ ↑(Fintype.card s))
  (ht₁ :
    Real.log (4 / δ) ≤
      hansonWrightConstant *
        (4 * ↑(Fintype.card t) * ↑r * ε ^ 2 / (↑c' ^ 2 * subgaussianRangeFinderFactor ↑c)))
  (ht₂ :
    Real.log (4 / δ) ≤
      hansonWrightConstant *
        (2 * ↑(Fintype.card t) * √↑r * ε / (↑c' * √(subgaussianRangeFinderFactor ↑c)))) :
  μ.real {ω | (1 + ε) * A.trace < hutchpp A (S ω) (G ω)} ≤ δ

Full source on GitHub

Copy link

Other forms

Theorem (Matrix.PosSemidef.measureReal_hutchpp_lt_one_sub_mul_trace_le_of_isSubgaussianVector). Hutch++ does not underestimate a positive semidefinite trace by a factor 1 - \varepsilon. With the hypotheses of NLAlib.measureReal_abs_trace_sub_hutchpp_gt_mul_nuclearNorm_le_of_isSubgaussianVector: the sketch \mathbf{S}^{\mathsf{H}}, \lvert s \rvert \ge 1, has independent, isotropic, sub-Gaussian rows with proxy c; the n \times \ell residual test matrix \mathbf{G} is independent of \mathbf{S} with independent entries, sub-Gaussian with variance proxy c' and of second moment 1; r \ge 1, \varepsilon > 0, \delta > 0, <!-- value subgaussianEmbeddingDim c r (1/2) (\delta/4) --> \lvert s \rvert \ge 25 c^2 (r \log 21 + \log(2/(\delta/4)))/(16C (1/2)^2), with <!-- value subgaussianJLConstant -->C = 1/36, and <!-- value subgaussianRangeFinderFactor c --> <!-- value hansonWrightConstant --> \log\frac{4}{\delta} \le \frac{1}{196}\cdot\frac{4\ell r\varepsilon^2}{c'^2(1 + 5c/2)}\,,\qquad \log\frac{4}{\delta} \le \frac{1}{196}\cdot\frac{2\ell\sqrt{r}\,\varepsilon}{c'\sqrt{1 + 5c/2}}\,. Then for every real positive semidefinite \mathbf{A} \mathbb{P}\bigl[\mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G}) < (1 - \varepsilon)\operatorname{tr}\mathbf{A}\bigr] \le \delta\,, since \|\mathbf{A}\|_* = \operatorname{tr}\mathbf{A}; the size is subgaussianEmbeddingDim c r (1 / 2) (δ / 4), C is subgaussianJLConstant, the factor is subgaussianRangeFinderFactor c and 1/196 is hansonWrightConstant. The upper half is Matrix.PosSemidef.measureReal_hutchpp_gt_one_add_mul_trace_le_of_isSubgaussianVector. [MeyerMuscoMuscoWoodruff2021, Theorem 1]; there both halves together, with sign test matrices and unspecified constants.

General form: sizes are index types

Lean statement and details
Matrix.PosSemidef.measureReal_hutchpp_lt_one_sub_mul_trace_le_of_isSubgaussianVector.{u_1, u_2, u_3,
    u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_2} {s : Type u_3}
  {t : Type u_4} [Fintype n] [Fintype s] [Fintype t] [DecidableEq n] [Nonempty s] {A : Matrix n n ℝ}
  (hA : A.PosSemidef) {S : Ω → Matrix n s ℝ} {G : Ω → Matrix n t ℝ} {c c' : ℝ≥0}
  (hSind : iIndepFun (fun i ω ↦ (S ω)ᴴ i) μ)
  (hSsub : ∀ (i : s), IsSubgaussianVector (fun ω ↦ (S ω)ᴴ i) c μ)
  (hSiso : ∀ (i : s), IsIsotropic (fun ω ↦ (S ω)ᴴ i) μ)
  (hGind : iIndepFun (fun p ω ↦ G ω p.1 p.2) μ)
  (hGsub : ∀ (i : n) (j : t), HasSubgaussianMGF (fun ω ↦ G ω i j) c' μ)
  (hGvar : ∀ (i : n) (j : t), ∫ (ω : Ω), G ω i j ^ 2 ∂μ = 1) (hSG : S ⟂ᵢ[μ] G) {r : ℕ} (hr : 0 < r)
  {ε δ : ℝ} (hε : 0 < ε) (hδ : 0 < δ)
  (hs : subgaussianEmbeddingDim (↑c) r (1 / 2) (δ / 4) ≤ ↑(Fintype.card s))
  (ht₁ :
    Real.log (4 / δ) ≤
      hansonWrightConstant *
        (4 * ↑(Fintype.card t) * ↑r * ε ^ 2 / (↑c' ^ 2 * subgaussianRangeFinderFactor ↑c)))
  (ht₂ :
    Real.log (4 / δ) ≤
      hansonWrightConstant *
        (2 * ↑(Fintype.card t) * √↑r * ε / (↑c' * √(subgaussianRangeFinderFactor ↑c)))) :
  μ.real {ω | hutchpp A (S ω) (G ω) < (1 - ε) * A.trace} ≤ δ

Full source on GitHub

Copy link

Theorem (exists_forall_measureReal_abs_trace_sub_hutchpp_gt_mul_nuclearNorm_le_of_isSubgaussianVector). O(c^4(\sqrt{\log(1/\delta)}/\varepsilon + \log(1/\delta))) products suffice for Hutch++ to relative error \varepsilon in the nuclear norm: there is an absolute constant C > 0 (the proof takes C = 20000) such that if the sketch \mathbf{S}^{\mathsf{H}} of the n \times \lvert s \rvert sketch test matrix \mathbf{S}, \lvert s \rvert \ge 1, has independent, isotropic, sub-Gaussian rows with proxy c, the n \times \lvert t \rvert residual test matrix \mathbf{G} is independent of \mathbf{S} with independent entries that each satisfy the sub-Gaussian moment generating function bound with variance proxy c and have second moment 1, \varepsilon > 0, 0 < \delta \le 1/2 and both \lvert s \rvert and \lvert t \rvert are at least Cc^4(\sqrt{\log(1/\delta)}/\varepsilon + \log(1/\delta)), then for every real square \mathbf{A} \mathbb{P}\bigl[\lvert \operatorname{tr}\mathbf{A} - \mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G}) \rvert > \varepsilon\|\mathbf{A}\|_*\bigr] \le \delta\,, with m = 2\lvert s \rvert + \lvert t \rvert products in all. The asymptotic form of NLAlib.measureReal_abs_trace_sub_hutchpp_gt_mul_nuclearNorm_le_of_isSubgaussianVector, at r = \lfloor \lvert s \rvert/(4608c^2) \rfloor; the proxy stays in the threshold, and isotropy forces c \ge 1. No cap on \varepsilon is needed: with L = \log(1/\delta), the residual size gives \ell\varepsilon \ge Cc^4\sqrt{L} and the sketch size r\varepsilon \gtrsim c^2\sqrt{L} and r \gtrsim c^2 L, which cover both Hanson–Wright conditions. [MeyerMuscoMuscoWoodruff2021, Theorem 5 and Theorem 1]; there with sign test matrices (c = 1).

General form: sizes are index types

Lean statement and details
NLAlib.exists_forall_measureReal_abs_trace_sub_hutchpp_gt_mul_nuclearNorm_le_of_isSubgaussianVector :
  ∃ C,
    0 < C ∧
      ∀ {Ω n s t : Type} [inst : MeasurableSpace Ω] [inst_1 : Fintype n] [inst_2 : Fintype s]
        [inst_3 : Fintype t] [inst_4 : DecidableEq n] [Nonempty s] (μ : Measure Ω)
        (A : Matrix n n ℝ) (S : Ω → Matrix n s ℝ) (G : Ω → Matrix n t ℝ) (c : ℝ≥0) (ε δ : ℝ),
        iIndepFun (fun i ω ↦ (S ω)ᴴ i) μ →
          (∀ (i : s), IsSubgaussianVector (fun ω ↦ (S ω)ᴴ i) c μ) →
            (∀ (i : s), IsIsotropic (fun ω ↦ (S ω)ᴴ i) μ) →
              iIndepFun (fun p ω ↦ G ω p.1 p.2) μ →
                (∀ (i : n) (j : t), HasSubgaussianMGF (fun ω ↦ G ω i j) c μ) →
                  (∀ (i : n) (j : t), ∫ (ω : Ω), G ω i j ^ 2 ∂μ = 1) →
                    S ⟂ᵢ[μ] G →
                      0 < ε →
                        0 < δ →
                          δ ≤ 1 / 2 →
                            C * (↑c ^ 4 * (√(Real.log (1 / δ)) / ε + Real.log (1 / δ))) ≤
                                ↑(Fintype.card s) →
                              C * (↑c ^ 4 * (√(Real.log (1 / δ)) / ε + Real.log (1 / δ))) ≤
                                  ↑(Fintype.card t) →
                                μ.real {ω | ε * nuclearNorm A < |A.trace - hutchpp A (S ω) (G ω)|} ≤
                                  δ

Full source on GitHub

Copy link

Theorem (measureReal_abs_trace_sub_hutchpp_gt_mul_nuclearNorm_le_of_isSubgaussianVector). Hutch++ to relative error in the nuclear norm. Let the sketch \mathbf{S}^{\mathsf{H}} of the n \times \lvert s \rvert sketch test matrix \mathbf{S}, \lvert s \rvert \ge 1, have independent, isotropic, sub-Gaussian rows with proxy c, and let the n \times \ell residual test matrix \mathbf{G} be independent of \mathbf{S}, with independent entries that each satisfy the sub-Gaussian moment generating function bound with variance proxy c' and have second moment 1. If r \ge 1, \varepsilon > 0, \delta > 0, <!-- value subgaussianEmbeddingDim c r (1/2) (\delta/4) --> \lvert s \rvert \ge 25 c^2 (r \log 21 + \log(2/(\delta/4)))/(16C (1/2)^2), with <!-- value subgaussianJLConstant -->C = 1/36, and <!-- value subgaussianRangeFinderFactor c --> <!-- value hansonWrightConstant --> \log\frac{4}{\delta} \le \frac{1}{196}\cdot\frac{4\ell r\varepsilon^2}{c'^2(1 + 5c/2)}\,,\qquad \log\frac{4}{\delta} \le \frac{1}{196}\cdot\frac{2\ell\sqrt{r}\,\varepsilon}{c'\sqrt{1 + 5c/2}}\,, then for every real square \mathbf{A} \mathbb{P}\bigl[\lvert \operatorname{tr}\mathbf{A} - \mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G}) \rvert > \varepsilon\|\mathbf{A}\|_*\bigr] \le \delta\,; the size is subgaussianEmbeddingDim c r (1 / 2) (δ / 4), C is subgaussianJLConstant, the factor is subgaussianRangeFinderFactor c and 1/196 is hansonWrightConstant. From NLAlib.measureReal_abs_trace_sub_hutchpp_ge_le_of_isSubgaussianVector at \delta/2 and \tau = \varepsilon\|\mathbf{A}\|_*, with \|\mathbf{E}_r\|_{\mathsf{F}} \le \|\mathbf{A}\|_*/(2\sqrt{r}) (NLAlib.frobNorm_sub_truncatedSVD_le_nuclearNorm_div); when \|\mathbf{E}_r\|_{\mathsf{F}} = 0 that tail says nothing, and instead the randomized SVD recovers \mathbf{A} outside probability \delta/2, where Hutch++ is exact. Asymptotic form: exists_forall_measureReal_abs_trace_sub_hutchpp_gt_mul_nuclearNorm_le_of_isSubgaussianVector. The positive semidefinite forms are Matrix.PosSemidef.measureReal_hutchpp_lt_one_sub_mul_trace_le_of_isSubgaussianVector and Matrix.PosSemidef.measureReal_hutchpp_gt_one_add_mul_trace_le_of_isSubgaussianVector. [MeyerMuscoMuscoWoodruff2021, Theorem 5]; there with sign test matrices and m = O(\sqrt{\log(1/\delta)}/\varepsilon + \log(1/\delta)), constants unspecified.

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_abs_trace_sub_hutchpp_gt_mul_nuclearNorm_le_of_isSubgaussianVector.{u_1, u_2,
    u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_2} {s : Type u_3}
  {t : Type u_4} [Fintype n] [Fintype s] [Fintype t] [DecidableEq n] [Nonempty s] (A : Matrix n n ℝ)
  {S : Ω → Matrix n s ℝ} {G : Ω → Matrix n t ℝ} {c c' : ℝ≥0}
  (hSind : iIndepFun (fun i ω ↦ (S ω)ᴴ i) μ)
  (hSsub : ∀ (i : s), IsSubgaussianVector (fun ω ↦ (S ω)ᴴ i) c μ)
  (hSiso : ∀ (i : s), IsIsotropic (fun ω ↦ (S ω)ᴴ i) μ)
  (hGind : iIndepFun (fun p ω ↦ G ω p.1 p.2) μ)
  (hGsub : ∀ (i : n) (j : t), HasSubgaussianMGF (fun ω ↦ G ω i j) c' μ)
  (hGvar : ∀ (i : n) (j : t), ∫ (ω : Ω), G ω i j ^ 2 ∂μ = 1) (hSG : S ⟂ᵢ[μ] G) {r : ℕ} (hr : 0 < r)
  {ε δ : ℝ} (hε : 0 < ε) (hδ : 0 < δ)
  (hs : subgaussianEmbeddingDim (↑c) r (1 / 2) (δ / 4) ≤ ↑(Fintype.card s))
  (ht₁ :
    Real.log (4 / δ) ≤
      hansonWrightConstant *
        (4 * ↑(Fintype.card t) * ↑r * ε ^ 2 / (↑c' ^ 2 * subgaussianRangeFinderFactor ↑c)))
  (ht₂ :
    Real.log (4 / δ) ≤
      hansonWrightConstant *
        (2 * ↑(Fintype.card t) * √↑r * ε / (↑c' * √(subgaussianRangeFinderFactor ↑c)))) :
  μ.real {ω | ε * nuclearNorm A < |A.trace - hutchpp A (S ω) (G ω)|} ≤ δ

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.