NLA-lib Explorer

The variance of Gaussian Hutch++ for a positive semidefinite matrix

Library · Result group

Theorem (Matrix.PosSemidef.variance_hutchpp_le_trace_sq_of_hasLaw_gaussianMatrix). The variance of Gaussian Hutch++ for a positive semidefinite matrix: if the n \times \lvert s \rvert sketch test matrix \mathbf{S} and the n \times \ell residual test matrix \mathbf{G}, \ell \ge 1, are independent and standard Gaussian, then for every real positive semidefinite \mathbf{A} and every r \ge 1 with 2r + 1 \le \lvert s \rvert, \operatorname{Var}[\mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G})] \le \frac{(\operatorname{tr}\mathbf{A})^2}{\ell\, r}\,, NLAlib.variance_hutchpp_le_nuclearNorm_of_hasLaw_gaussianMatrix with \|\mathbf{A}\|_* = \operatorname{tr}\mathbf{A}. With r = (m - 2)/8, \lvert s \rvert = (m + 2)/4 and \ell = (m - 2)/2 it is 16(\operatorname{tr}\mathbf{A})^2/(m - 2)^2 for m = 2\lvert s \rvert + \ell products. [MeyerMuscoMuscoWoodruff2021, Theorem 10]; there with sign residual probes (see NLAlib.variance_hutchpp_of_hasLaw_rademacherMatrix).

Headline (provisional) General form: sizes are index types

Lean statement and details
Matrix.PosSemidef.variance_hutchpp_le_trace_sq_of_hasLaw_gaussianMatrix.{u_1, u_3, u_4, u_5}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_3} {s : Type u_4}
  {t : Type u_5} [Fintype n] [Fintype s] [Fintype t] [DecidableEq n] [Nonempty t] {A : Matrix n n ℝ}
  (hA : A.PosSemidef) {S : Ω → Matrix n s ℝ} {G : Ω → Matrix n t ℝ}
  (hS : HasLaw S (gaussianMatrix n s) μ) (hG : HasLaw G (gaussianMatrix n t) μ) (hSG : S ⟂ᵢ[μ] G)
  {r : ℕ} (hr0 : 0 < r) (hr : 2 * r + 1 ≤ Fintype.card s) :
  Var[fun ω ↦ hutchpp A (S ω) (G ω); μ] ≤ A.trace ^ 2 / (↑(Fintype.card t) * ↑r)

Full source on GitHub

Copy link

Other forms

Theorem (exists_forall_variance_hutchpp_le_of_hasLaw_gaussianMatrix). O(\eta^{-1/2}) products suffice for Gaussian Hutch++ to reach variance \eta\|\mathbf{A}\|_*^2: there is an absolute constant C > 0 such that if the n \times \lvert s \rvert sketch test matrix \mathbf{S} and the n \times \lvert t \rvert residual test matrix \mathbf{G} are independent and standard Gaussian, 0 < \eta \le 1, \lvert s \rvert \ge C/\sqrt{\eta} and \lvert t \rvert \ge C/\sqrt{\eta}, then for every real square \mathbf{A}, \operatorname{Var}[\mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G})] \le \eta\,\|\mathbf{A}\|_*^2\,, with m = 2\lvert s \rvert + \lvert t \rvert products in all. The asymptotic form of NLAlib.variance_hutchpp_le_nuclearNorm_of_hasLaw_gaussianMatrix, proved from it with C = 4 and r = \lfloor (\lvert s \rvert - 1)/2 \rfloor; the cap \eta \le 1 keeps r \ge 1. [EpperlyTroppWebber2024, (1.10)]; [MeyerMuscoMuscoWoodruff2021, Theorem 10].

General form: sizes are index types

Lean statement and details
NLAlib.exists_forall_variance_hutchpp_le_of_hasLaw_gaussianMatrix :
  ∃ 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] (μ : Measure Ω) (A : Matrix n n ℝ)
        (S : Ω → Matrix n s ℝ) (G : Ω → Matrix n t ℝ) (η : ℝ),
        HasLaw S (gaussianMatrix n s) μ →
          HasLaw G (gaussianMatrix n t) μ →
            S ⟂ᵢ[μ] G →
              0 < η →
                η ≤ 1 →
                  C / √η ≤ ↑(Fintype.card s) →
                    C / √η ≤ ↑(Fintype.card t) →
                      Var[fun ω ↦ hutchpp A (S ω) (G ω); μ] ≤ η * nuclearNorm A ^ 2

Full source on GitHub

Copy link

Theorem (variance_hutchpp_le_nuclearNorm_of_hasLaw_gaussianMatrix). The variance of Gaussian Hutch++, nuclear form: if the n \times \lvert s \rvert sketch test matrix \mathbf{S} and the n \times \ell residual test matrix \mathbf{G}, \ell \ge 1, are independent and standard Gaussian, then for every real square \mathbf{A} and every r \ge 1 with 2r + 1 \le \lvert s \rvert, \operatorname{Var}[\mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G})] \le \frac{\|\mathbf{A}\|_*^2}{\ell\, r}\,. The Halko–Martinsson–Tropp factor is at most 2 when \lvert s \rvert \ge 2r + 1, and \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_r\|_{\mathsf{F}}^2 \le \|\mathbf{A}\|_*^2/(4r) (NLAlib.frobNorm_sub_truncatedSVD_le_nuclearNorm_div). With MMMW's parameters r = (m - 2)/8, \lvert s \rvert = (m + 2)/4 = 2r + 1 and \ell = (m - 2)/2, so that m = 2\lvert s \rvert + \ell, it is their 16\|\mathbf{A}\|_*^2/(m - 2)^2. Asymptotic form: NLAlib.exists_forall_variance_hutchpp_le_of_hasLaw_gaussianMatrix. [MeyerMuscoMuscoWoodruff2021, Theorem 10 and Lemma 14]; [EpperlyTroppWebber2024, Theorem 1.1 (Hutch++ line)]; MMMW for m products with the parameters above, Theorem 10 for positive semidefinite \mathbf{A} with \operatorname{tr}^2\mathbf{A} (here Matrix.PosSemidef.variance_hutchpp_le_trace_sq_of_hasLaw_gaussianMatrix).

General form: sizes are index types

Lean statement and details
NLAlib.variance_hutchpp_le_nuclearNorm_of_hasLaw_gaussianMatrix.{u_1, u_3, u_4, u_5} {Ω : Type u_1}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_3} {s : Type u_4} {t : Type u_5} [Fintype n]
  [Fintype s] [Fintype t] [DecidableEq n] [Nonempty t] (A : Matrix n n ℝ) {S : Ω → Matrix n s ℝ}
  {G : Ω → Matrix n t ℝ} (hS : HasLaw S (gaussianMatrix n s) μ)
  (hG : HasLaw G (gaussianMatrix n t) μ) (hSG : S ⟂ᵢ[μ] G) {r : ℕ} (hr0 : 0 < r)
  (hr : 2 * r + 1 ≤ Fintype.card s) :
  Var[fun ω ↦ hutchpp A (S ω) (G ω); μ] ≤ nuclearNorm A ^ 2 / (↑(Fintype.card t) * ↑r)

Full source on GitHub

Copy link

Theorem (variance_hutchpp_le_of_hasLaw_gaussianMatrix). The variance of Gaussian Hutch++, Halko–Martinsson–Tropp form: if the n \times \lvert s \rvert sketch test matrix \mathbf{S} and the n \times \ell residual test matrix \mathbf{G}, \ell \ge 1, are independent and standard Gaussian, then for every real square \mathbf{A} and every r with r + 2 \le \lvert s \rvert, <!-- value gaussianProjectionFactor r {\lvert s \rvert} --> \operatorname{Var}[\mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G})] \le \frac{2}{\ell} \Bigl(1 + \frac{r}{\lvert s \rvert - r - 1}\Bigr) \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_r\|_{\mathsf{F}}^2\,; the factor is gaussianProjectionFactor r (Fintype.card s). From the exact variance NLAlib.variance_hutchpp_of_hasLaw_gaussianMatrix, the bound \|(\mathbf{I} - \mathbf{P})\mathbf{H}(\mathbf{I} - \mathbf{P})\|_{\mathsf{F}} \le \|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{S})\|_{\mathsf{F}} (no symmetry of \mathbf{A} needed) and NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix. The sharper Epperly–Webber factor is NLAlib.variance_hutchpp_le_of_hasLaw_gaussianMatrix_of_rank_le; the nuclear form is NLAlib.variance_hutchpp_le_nuclearNorm_of_hasLaw_gaussianMatrix. [EpperlyTroppWebber2024, Theorem 1.1 (Hutch++ line) and Proposition 5.2]; [MeyerMuscoMuscoWoodruff2021, proof of Theorem 10 and Lemma 14]; there for symmetric (MMMW: positive semidefinite) \mathbf{A} and, in MMMW, r \ge 2.

General form: sizes are index types

Lean statement and details
NLAlib.variance_hutchpp_le_of_hasLaw_gaussianMatrix.{u_1, u_3, u_4, u_5} {Ω : Type u_1}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_3} {s : Type u_4} {t : Type u_5} [Fintype n]
  [Fintype s] [Fintype t] [DecidableEq n] [Nonempty t] (A : Matrix n n ℝ) {S : Ω → Matrix n s ℝ}
  {G : Ω → Matrix n t ℝ} (hS : HasLaw S (gaussianMatrix n s) μ)
  (hG : HasLaw G (gaussianMatrix n t) μ) (hSG : S ⟂ᵢ[μ] G) {r : ℕ} (hr : r + 2 ≤ Fintype.card s) :
  Var[fun ω ↦ hutchpp A (S ω) (G ω); μ] ≤
    2 / ↑(Fintype.card t) * gaussianProjectionFactor r (Fintype.card s) *
      frobNorm (A - truncatedSVD A r) ^ 2

Full source on GitHub

Copy link

Theorem (variance_hutchpp_le_of_hasLaw_gaussianMatrix_of_rank_le). The variance of Gaussian Hutch++, Epperly–Webber form: if the n \times \lvert s \rvert sketch test matrix \mathbf{S} and the n \times \ell residual test matrix \mathbf{G}, \ell \ge 1, are independent and standard Gaussian, then for every real square \mathbf{A} with \operatorname{rank}\mathbf{A} \le r, \lvert s \rvert \le r and q + 2 \le \lvert s \rvert, <!-- value rotationInvariantFactor r {\lvert s \rvert} q --> \operatorname{Var}[\mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G})] \le \frac{2}{\ell}\, \frac{r - \lvert s \rvert}{r - q}\Bigl(1 + \frac{q}{\lvert s \rvert - q - 1}\Bigr) \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_q\|_{\mathsf{F}}^2\,; the factor is rotationInvariantFactor r (Fintype.card s) q, below the Halko–Martinsson–Tropp factor of NLAlib.variance_hutchpp_le_of_hasLaw_gaussianMatrix and better when the rank r is close to \lvert s \rvert. From the exact variance and NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix_of_rank_le. [EpperlyWebber2026, Theorem 3.2]; there for the randomized SVD alone, with r = \operatorname{rank}\mathbf{A}.

General form: sizes are index types

Lean statement and details
NLAlib.variance_hutchpp_le_of_hasLaw_gaussianMatrix_of_rank_le.{u_1, u_3, u_4, u_5} {Ω : Type u_1}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_3} {s : Type u_4} {t : Type u_5} [Fintype n]
  [Fintype s] [Fintype t] [DecidableEq n] [Nonempty t] (A : Matrix n n ℝ) {S : Ω → Matrix n s ℝ}
  {G : Ω → Matrix n t ℝ} (hS : HasLaw S (gaussianMatrix n s) μ)
  (hG : HasLaw G (gaussianMatrix n t) μ) (hSG : S ⟂ᵢ[μ] G) {r q : ℕ} (hr : A.rank ≤ r)
  (hsr : Fintype.card s ≤ r) (hq : q + 2 ≤ Fintype.card s) :
  Var[fun ω ↦ hutchpp A (S ω) (G ω); μ] ≤
    2 / ↑(Fintype.card t) * rotationInvariantFactor r (Fintype.card s) q *
      frobNorm (A - truncatedSVD A q) ^ 2

Full source on GitHub

Copy link

Theorem (variance_hutchpp_of_hasLaw_gaussianMatrix). The exact variance of Hutch++ with a Gaussian residual test matrix: if the sketch test matrix \mathbf{S} is almost everywhere measurable and the n \times \ell residual test matrix \mathbf{G}, \ell \ge 1, is standard Gaussian and independent of \mathbf{S}, then for every real square \mathbf{A}, with \mathbf{H} = \tfrac12(\mathbf{A} + \mathbf{A}^{\mathsf{T}}) its symmetric part, \operatorname{Var}[\mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G})] = \frac{2}{\ell}\, \mathbb{E}\,\|(\mathbf{I} - \mathbf{P}_{\mathbf{A}\mathbf{S}})\mathbf{H} (\mathbf{I} - \mathbf{P}_{\mathbf{A}\mathbf{S}})\|_{\mathsf{F}}^2\,. Exact for every law of the sketch; Gaussianity of \mathbf{S} enters only the bounds (NLAlib.variance_hutchpp_le_of_hasLaw_gaussianMatrix). With \ell = 0 the right side would be 0 while the output \operatorname{tr}\mathsf{rsvd}(\mathbf{A}, \mathbf{S}) is random, hence \ell \ge 1. The sign-probe identity is NLAlib.variance_hutchpp_of_hasLaw_rademacherMatrix. [MeyerMuscoMuscoWoodruff2021, proof of Theorem 10, Imported Lemma 11]; [EpperlyTroppWebber2024, Proposition 5.2]; there for symmetric (MMMW: positive semidefinite) \mathbf{A} and Gaussian \mathbf{S}, as the first line of a bound. MMMW's Algorithm 3 samples \mathbf{G} with sign entries while applying the Gaussian Lemma 11; their bound survives because the sign variance is at most the Gaussian one.

General form: sizes are index types

Lean statement and details
NLAlib.variance_hutchpp_of_hasLaw_gaussianMatrix.{u_1, u_3, u_4, u_5} {Ω : Type u_1}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_3} {s : Type u_4} {t : Type u_5} [Fintype n]
  [Fintype s] [Fintype t] [DecidableEq n] [Nonempty t] (A : Matrix n n ℝ) {S : Ω → Matrix n s ℝ}
  {G : Ω → Matrix n t ℝ} (hS : AEMeasurable S μ) (hG : HasLaw G (gaussianMatrix n t) μ)
  (hSG : S ⟂ᵢ[μ] G) :
  Var[fun ω ↦ hutchpp A (S ω) (G ω); μ] =
    2 / ↑(Fintype.card t) *
      ∫ (ω : Ω),
        frobNorm
            ((1 - rangeProjector (A * S ω)) * hermitianPart A * (1 - rangeProjector (A * S ω))) ^
          2 ∂μ

Full source on GitHub

Copy link

Theorem (variance_hutchpp_of_hasLaw_rademacherMatrix). The exact variance of Hutch++ with a sign residual test matrix: if the sketch test matrix \mathbf{S} is almost everywhere measurable and the n \times \ell residual test matrix \mathbf{G}, \ell \ge 1, has independent uniformly random signs as entries and is independent of \mathbf{S}, then for every real square \mathbf{A}, with \mathbf{H} = \tfrac12(\mathbf{A} + \mathbf{A}^{\mathsf{T}}) and \mathbf{\Delta}_{\mathbf{H}} = (\mathbf{I} - \mathbf{P}_{\mathbf{A}\mathbf{S}})\mathbf{H} (\mathbf{I} - \mathbf{P}_{\mathbf{A}\mathbf{S}}), \operatorname{Var}[\mathsf{hutchpp}(\mathbf{A}, \mathbf{S}, \mathbf{G})] = \frac{2}{\ell}\, \mathbb{E}\Bigl[\|\mathbf{\Delta}_{\mathbf{H}}\|_{\mathsf{F}}^2 - \sum_i (\mathbf{\Delta}_{\mathbf{H}})_{i,i}^2\Bigr]\,. At most the Gaussian variance NLAlib.variance_hutchpp_of_hasLaw_gaussianMatrix; with a Gaussian \mathbf{S} it is the exact variance of [MeyerMuscoMuscoWoodruff2021, Algorithm 3] as printed. The sign law is stated on the rows of \mathbf{G}^{\mathsf{H}}, the columns of \mathbf{G}. [Epperly2023, Real-Valued Test Vectors]; there for Girard–Hutchinson alone.

General form: sizes are index types

Lean statement and details
NLAlib.variance_hutchpp_of_hasLaw_rademacherMatrix.{u_1, u_3, u_4, u_5} {Ω : Type u_1}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_3} {s : Type u_4} {t : Type u_5} [Fintype n]
  [Fintype s] [Fintype t] [DecidableEq n] [Nonempty t] (A : Matrix n n ℝ) {S : Ω → Matrix n s ℝ}
  {G : Ω → Matrix n t ℝ} (hS : AEMeasurable S μ)
  (hG : HasLaw (fun ω ↦ (G ω)ᴴ) (rademacherMatrix t n) μ) (hSG : S ⟂ᵢ[μ] G) :
  Var[fun ω ↦ hutchpp A (S ω) (G ω); μ] =
    2 / ↑(Fintype.card t) *
      ∫ (ω : Ω),
        frobNorm
              ((1 - rangeProjector (A * S ω)) * hermitianPart A * (1 - rangeProjector (A * S ω))) ^
            2 -
          ∑ i,
            ((1 - rangeProjector (A * S ω)) * hermitianPart A * (1 - rangeProjector (A * S ω))) i
                i ^
              2 ∂μ

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.