NLA-lib Explorer

Randomized SVD: expected error

Library · Result group

Theorem (integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix). The expected error of the randomized SVD, Frobenius norm (HMT Theorem 10.5, squared): for a standard Gaussian n \times \ell test matrix \mathbf{X} and k + 2 \le \ell, <!-- value gaussianProjectionFactor k \ell --> \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_{\mathsf{F}}^2 \le \Bigl(1 + \frac{k}{\ell - k - 1}\Bigr)\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k \|_{\mathsf{F}}^2\,. The Frobenius instance of the Gram-form bound above; Epperly and Webber's sharper factor, with a rank parameter, is NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix_of_rank_le. Asymptotic form: NLAlib.exists_forall_integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix. [HalkoMartinssonTropp2011, Theorem 10.5]; [TroppWebber2023, Theorem 8.7]; HMT assume k \ge 2 and k + p \le \min\{m, n\}, neither needed here. [HalkoMartinssonTropp2011, Theorem 10.5] prints the first-moment form <!-- value gaussianProjectionFactor k \ell --> \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_{\mathsf{F}} \le \Bigl(1 + \frac{k}{\ell - k - 1}\Bigr)^{1/2}\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k \|_{\mathsf{F}}\,, which follows from this bound by Jensen's inequality (ProbabilityTheory.integral_le_sqrt_integral_sq).

Headline General form: sizes are index types

Lean statement and details
NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3, u_4} {Ω : Type u_1}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3} {l : Type u_4} [Fintype m]
  [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} (A : Matrix m n ℝ)
  (hX : HasLaw X (gaussianMatrix n l) μ) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), frobNorm (A - rsvd A (X ω)) ^ 2 ∂μ ≤
    gaussianProjectionFactor k (Fintype.card l) * frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Other forms

Theorem (SymmetricGauge.integral_matrixNorm_conjTranspose_mul_self_sub_rsvd_le_of_hasLaw_gaussianMatrix). The expected error of the randomized SVD, Gram form: for a standard Gaussian n \times \ell test matrix \mathbf{X}, k + 2 \le \ell and every unitarily invariant norm, \mathbb{E}\bigl\|(\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X}))^{\mathsf{H}} (\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X}))\bigr\|_{\Phi} \le \|\mathbf{E}^{\mathsf{H}}\mathbf{E}\|_{\Phi} + \Phi(\mathbf{e}_0)\,\frac{k}{\ell - k - 1}\, \|\mathbf{E}\|_{\mathsf{F}}^2\,,\qquad \mathbf{E} = \mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\,, with \mathbf{e}_0 the first unit coordinate sequence (\Phi(\mathbf{e}_0) = 1 for every Schatten gauge, NLAlib.lpGauge_apply_single_zero). This covers every quadratic unitarily invariant norm: squared Schatten p-norms for p \ge 2, the squared Frobenius norm at the nuclear gauge, the squared spectral norm. No hypothesis on the shape of \mathbf{A}. [TroppWebber2023, Theorem 8.1 (RSVD2)]; [HalkoMartinssonTropp2011, Theorem 10.5 (proof)]; [MartinssonTropp2020, Theorem 11.4 and remark]; there for Schatten p \ge 2 (TW), here every quadratic unitarily invariant norm, with the factor \Phi(\mathbf{e}_0).

General form: sizes are index types

Lean statement and details
NLAlib.SymmetricGauge.integral_matrixNorm_conjTranspose_mul_self_sub_rsvd_le_of_hasLaw_gaussianMatrix.{u_1,
    u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} (Φ : SymmetricGauge)
  (A : Matrix m n ℝ) (hX : HasLaw X (gaussianMatrix n l) μ) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), Φ.matrixNorm ((A - rsvd A (X ω))ᴴ * (A - rsvd A (X ω))) ∂μ ≤
    Φ.matrixNorm ((A - truncatedSVD A k)ᴴ * (A - truncatedSVD A k)) +
      Φ (Finsupp.single 0 1) * (↑k / (↑(Fintype.card l) - ↑k - 1)) *
        frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (SymmetricGauge.integral_matrixNorm_conjTranspose_mul_self_sub_rsvd_le_of_isLeftUnitarilyInvariant). The expected error of the randomized SVD, Gram form, rotation-invariant test matrices: for a test matrix \mathbf{X} with a left unitarily invariant law and full column rank almost surely (Gaussian, Haar, ...), k + 2 \le \ell and every unitarily invariant norm, \mathbb{E}\bigl\|(\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X}))^{\mathsf{H}} (\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X}))\bigr\|_{\Phi} \le \|\mathbf{E}^{\mathsf{H}}\mathbf{E}\|_{\Phi} + \Phi(\mathbf{e}_0)\,\frac{k}{\ell - k - 1}\, \|\mathbf{E}\|_{\mathsf{F}}^2\,,\qquad \mathbf{E} = \mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\,, the bound of the Gaussian test matrix (in this namespace, integral_matrixNorm_conjTranspose_mul_self_sub_rsvd_le_of_hasLaw_gaussianMatrix). [TroppWebber2023, Theorem 8.1 (RSVD2)]; [EpperlyWebber2026, Theorem 3.1]; there for Gaussian test matrices and Schatten p \ge 2 (TW), or rotation-invariant ones and the Frobenius norm (EW).

General form: sizes are index types

Lean statement and details
NLAlib.SymmetricGauge.integral_matrixNorm_conjTranspose_mul_self_sub_rsvd_le_of_isLeftUnitarilyInvariant.{u_1,
    u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} [DecidableEq n]
  {ν : Measure (Matrix n l ℝ)} [IsProbabilityMeasure ν] [IsLeftUnitarilyInvariant ν]
  (Φ : SymmetricGauge) (A : Matrix m n ℝ) (hX : HasLaw X ν μ)
  (hXr : ∀ᵐ (ω : Ω) ∂μ, Function.Injective (X ω).mulVec) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), Φ.matrixNorm ((A - rsvd A (X ω))ᴴ * (A - rsvd A (X ω))) ∂μ ≤
    Φ.matrixNorm ((A - truncatedSVD A k)ᴴ * (A - truncatedSVD A k)) +
      Φ (Finsupp.single 0 1) * (↑k / (↑(Fintype.card l) - ↑k - 1)) *
        frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (exists_forall_integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix). O(k/\varepsilon) samples suffice for the randomized SVD, Frobenius norm: there are absolute constants C, \varepsilon_0 > 0 such that for a standard Gaussian n \times \ell test matrix \mathbf{X}, k \ge 1, 0 < \varepsilon \le \varepsilon_0 and \ell \ge Ck/\varepsilon, \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_{\mathsf{F}}^2 \le (1 + \varepsilon)\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}^2\,. The asymptotic form of NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix (HMT Theorem 10.5); the proof takes C = 3 and \varepsilon_0 = 1. [EpperlyWebber2026, §4.2]; there as the count 2\ell \ge (2/\varepsilon + 2)k of products.

General form: sizes are index types

Lean statement and details
NLAlib.exists_forall_integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix :
  ∃ C ε₀,
    0 < C ∧
      0 < ε₀ ∧
        ∀ {Ω m n l : Type} [inst : MeasurableSpace Ω] [inst_1 : Fintype m] [inst_2 : Fintype n]
          [inst_3 : Fintype l] (μ : Measure Ω) (A : Matrix m n ℝ) (X : Ω → Matrix n l ℝ) (k : ℕ)
          (ε : ℝ),
          HasLaw X (gaussianMatrix n l) μ →
            0 < k →
              0 < ε →
                ε ≤ ε₀ →
                  C * (↑k / ε) ≤ ↑(Fintype.card l) →
                    ∫ (ω : Ω), frobNorm (A - rsvd A (X ω)) ^ 2 ∂μ ≤
                      (1 + ε) * frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (exists_forall_integral_frobNorm_sub_rsvd_sq_le_of_isLeftUnitarilyInvariant). O(k/\varepsilon) samples suffice for the randomized SVD, rotation-invariant test matrices, Frobenius norm: there are absolute constants C, \varepsilon_0 > 0 such that for a test matrix \mathbf{X} with a left unitarily invariant law and full column rank almost surely, k \ge 1, 0 < \varepsilon \le \varepsilon_0 and \ell \ge Ck/\varepsilon, \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_{\mathsf{F}}^2 \le (1 + \varepsilon)\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}^2\,. The asymptotic form of NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_isLeftUnitarilyInvariant; the proof takes C = 3 and \varepsilon_0 = 1. [EpperlyWebber2026, §4.2]; there as the count 2\ell \ge (2/\varepsilon + 2)k of products.

General form: sizes are index types

Lean statement and details
NLAlib.exists_forall_integral_frobNorm_sub_rsvd_sq_le_of_isLeftUnitarilyInvariant :
  ∃ C ε₀,
    0 < C ∧
      0 < ε₀ ∧
        ∀ {Ω m n l : Type} [inst : MeasurableSpace Ω] [inst_1 : Fintype m] [inst_2 : Fintype n]
          [inst_3 : Fintype l] [inst_4 : DecidableEq n] (μ : Measure Ω) (ν : Measure (Matrix n l ℝ))
          [IsProbabilityMeasure ν] [IsLeftUnitarilyInvariant ν] (A : Matrix m n ℝ)
          (X : Ω → Matrix n l ℝ) (k : ℕ) (ε : ℝ),
          HasLaw X ν μ →
            (∀ᵐ (ω : Ω) ∂μ, Function.Injective (X ω).mulVec) →
              0 < k →
                0 < ε →
                  ε ≤ ε₀ →
                    C * (↑k / ε) ≤ ↑(Fintype.card l) →
                      ∫ (ω : Ω), frobNorm (A - rsvd A (X ω)) ^ 2 ∂μ ≤
                        (1 + ε) * frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (exists_forall_integral_frobNorm_sub_truncatedSVD_rsvd_sq_le_of_hasLaw_gaussianMatrix). O(k/\varepsilon) samples suffice for the truncated randomized SVD, Frobenius norm: there are absolute constants C, \varepsilon_0 > 0 such that for a standard Gaussian n \times \ell test matrix \mathbf{X}, 0 < \varepsilon \le \varepsilon_0 and \ell \ge Ck/\varepsilon, \mathbb{E}\|\mathbf{A} - \llbracket\mathsf{rsvd}(\mathbf{A}, \mathbf{X})\rrbracket_k \|_{\mathsf{F}}^2 \le (1 + \varepsilon)\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k \|_{\mathsf{F}}^2\,. The asymptotic form of NLAlib.integral_frobNorm_sub_truncatedSVD_rsvd_sq_le_of_hasLaw_gaussianMatrix; the proof takes C = 3 and \varepsilon_0 = 1. [Woodruff2014, Lemma 45 and Remark 46]; there with constant probability, here in expectation.

General form: sizes are index types

Lean statement and details
NLAlib.exists_forall_integral_frobNorm_sub_truncatedSVD_rsvd_sq_le_of_hasLaw_gaussianMatrix :
  ∃ C ε₀,
    0 < C ∧
      0 < ε₀ ∧
        ∀ {Ω m n l : Type} [inst : MeasurableSpace Ω] [inst_1 : Fintype m] [inst_2 : Fintype n]
          [inst_3 : Fintype l] (μ : Measure Ω) (A : Matrix m n ℝ) (X : Ω → Matrix n l ℝ) (k : ℕ)
          (ε : ℝ),
          HasLaw X (gaussianMatrix n l) μ →
            0 < ε →
              ε ≤ ε₀ →
                C * (↑k / ε) ≤ ↑(Fintype.card l) →
                  ∫ (ω : Ω), frobNorm (A - truncatedSVD (rsvd A (X ω)) k) ^ 2 ∂μ ≤
                    (1 + ε) * frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix_of_rank_le). The sharp expected error of the randomized SVD, Gaussian test matrices: for \mathbf{A} of rank at most r, a standard Gaussian n \times \ell test matrix \mathbf{X}, \ell \le r and q + 2 \le \ell, <!-- value rotationInvariantFactor r \ell q --> \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_{\mathsf{F}}^2 \le \frac{r - \ell}{r - q}\Bigl(1 + \frac{q}{\ell - q - 1}\Bigr) \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_q\|_{\mathsf{F}}^2\,, for every \ell. The sharper form of NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix (HMT's factor); the Nyström bound at \mathbf{H} = \mathbf{A}^{\mathsf{H}}\mathbf{A} by the Gram correspondence. [EpperlyWebber2026, Theorem 3.2]; [HalkoMartinssonTropp2011, Theorem 10.5]; there (EW) with r = \operatorname{rank}\mathbf{A} \ge \ell and a minimum over q, (HMT) with HMT's factor.

General form: sizes are index types

Lean statement and details
NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix_of_rank_le.{u_1, u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} (A : Matrix m n ℝ)
  (hX : HasLaw X (gaussianMatrix n l) μ) {r q : ℕ} (hr : A.rank ≤ r) (hlr : Fintype.card l ≤ r)
  (hq : q + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), frobNorm (A - rsvd A (X ω)) ^ 2 ∂μ ≤
    rotationInvariantFactor r (Fintype.card l) q * frobNorm (A - truncatedSVD A q) ^ 2

Full source on GitHub

Copy link

Theorem (integral_frobNorm_sub_rsvd_sq_le_of_isLeftUnitarilyInvariant). The expected error of the randomized SVD, Frobenius norm, rotation-invariant test matrices: for a test matrix \mathbf{X} with a left unitarily invariant law and full column rank almost surely and k + 2 \le \ell, <!-- value gaussianProjectionFactor k \ell --> \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_{\mathsf{F}}^2 \le \Bigl(1 + \frac{k}{\ell - k - 1}\Bigr)\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k \|_{\mathsf{F}}^2\,, with HMT's factor. The instance r = n of NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_isLeftUnitarilyInvariant_of_rank_le, with Epperly and Webber's factor bounded by HMT's; kept for the form consumers cite. Asymptotic form: NLAlib.exists_forall_integral_frobNorm_sub_rsvd_sq_le_of_isLeftUnitarilyInvariant. [EpperlyWebber2026, Theorem 3.1]; [HalkoMartinssonTropp2011, Theorem 10.5]; there (EW) over \mathbb{R} and \mathbb{C} with a minimum over the number q of directions, here over \mathbb{R} at q = k. [EpperlyWebber2026, Theorem 3.1] and [HalkoMartinssonTropp2011, Theorem 10.5] print the first-moment form <!-- value gaussianProjectionFactor k \ell --> \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_{\mathsf{F}} \le \Bigl(1 + \frac{k}{\ell - k - 1}\Bigr)^{1/2}\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k \|_{\mathsf{F}}\,, which follows from this bound by Jensen's inequality (ProbabilityTheory.integral_le_sqrt_integral_sq).

General form: sizes are index types

Lean statement and details
NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_isLeftUnitarilyInvariant.{u_1, u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} [DecidableEq n]
  {ν : Measure (Matrix n l ℝ)} [IsProbabilityMeasure ν] [IsLeftUnitarilyInvariant ν]
  (A : Matrix m n ℝ) (hX : HasLaw X ν μ) (hXr : ∀ᵐ (ω : Ω) ∂μ, Function.Injective (X ω).mulVec)
  {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), frobNorm (A - rsvd A (X ω)) ^ 2 ∂μ ≤
    gaussianProjectionFactor k (Fintype.card l) * frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (integral_frobNorm_sub_rsvd_sq_le_of_isLeftUnitarilyInvariant_of_rank_le). The sharp expected error of the randomized SVD, rotation-invariant test matrices: for \mathbf{A} of rank at most r, a test matrix \mathbf{X} with a left unitarily invariant law and full column rank almost surely, \ell \le r and q + 2 \le \ell, <!-- value rotationInvariantFactor r \ell q --> \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_{\mathsf{F}}^2 \le \frac{r - \ell}{r - q}\Bigl(1 + \frac{q}{\ell - q - 1}\Bigr) \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_q\|_{\mathsf{F}}^2\,; the factor is at most HMT's, so this sharpens NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_isLeftUnitarilyInvariant, its instance r = n. The Nyström bound at \mathbf{H} = \mathbf{A}^{\mathsf{H}}\mathbf{A}, by the Gram correspondence (NLAlib.nuclearNorm_conjTranspose_mul_self_sub_nystrom). [EpperlyWebber2026, Theorem 3.2]; there with r = \operatorname{rank}\mathbf{A} \ge \ell and a minimum over q, over \mathbb{R} and \mathbb{C}.

General form: sizes are index types

Lean statement and details
NLAlib.integral_frobNorm_sub_rsvd_sq_le_of_isLeftUnitarilyInvariant_of_rank_le.{u_1, u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} [DecidableEq n]
  {ν : Measure (Matrix n l ℝ)} [IsProbabilityMeasure ν] [IsLeftUnitarilyInvariant ν]
  (A : Matrix m n ℝ) (hX : HasLaw X ν μ) (hXr : ∀ᵐ (ω : Ω) ∂μ, Function.Injective (X ω).mulVec)
  {r q : ℕ} (hr : A.rank ≤ r) (hlr : Fintype.card l ≤ r) (hq : q + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), frobNorm (A - rsvd A (X ω)) ^ 2 ∂μ ≤
    rotationInvariantFactor r (Fintype.card l) q * frobNorm (A - truncatedSVD A q) ^ 2

Full source on GitHub

Copy link

Theorem (integral_frobNorm_sub_truncatedSVD_rsvd_sq_le_of_hasLaw_gaussianMatrix). The expected error of the truncated randomized SVD, Frobenius norm: the late truncation keeps HMT's constant, \mathbb{E}\|\mathbf{A} - \llbracket\mathsf{rsvd}(\mathbf{A}, \mathbf{X})\rrbracket_k \|_{\mathsf{F}}^2 \le \Bigl(1 + \frac{k}{\ell - k - 1}\Bigr)\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}^2\,, for a standard Gaussian n \times \ell test matrix \mathbf{X}, k + 2 \le \ell and every choice of the truncation (the squared Frobenius error does not depend on it, NLAlib.frobNorm_sub_truncatedSVD_rsvd_sq). Asymptotic form: NLAlib.exists_forall_integral_frobNorm_sub_truncatedSVD_rsvd_sq_le_of_hasLaw_gaussianMatrix. [HalkoMartinssonTropp2011, Theorem 10.5]; [Woodruff2014, Lemma 48]; [CamanoEpperlyMeyerTropp2025, remark after Theorem 2.2]; there the untruncated bound with the truncation for free of Woodruff, or the truncation through the spectral HMT Theorem 9.3 (CEMT).

General form: sizes are index types

Lean statement and details
NLAlib.integral_frobNorm_sub_truncatedSVD_rsvd_sq_le_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} (A : Matrix m n ℝ)
  (hX : HasLaw X (gaussianMatrix n l) μ) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), frobNorm (A - truncatedSVD (rsvd A (X ω)) k) ^ 2 ∂μ ≤
    gaussianProjectionFactor k (Fintype.card l) * frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (integral_frobNorm_sub_truncatedSVD_rsvd_sq_le_of_isLeftUnitarilyInvariant). The expected error of the truncated randomized SVD, Frobenius norm, rotation-invariant test matrices: for a test matrix \mathbf{X} with a left unitarily invariant law and full column rank almost surely and k + 2 \le \ell, \mathbb{E}\|\mathbf{A} - \llbracket\mathsf{rsvd}(\mathbf{A}, \mathbf{X})\rrbracket_k \|_{\mathsf{F}}^2 \le \Bigl(1 + \frac{k}{\ell - k - 1}\Bigr)\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}^2\,, for every choice of the truncation. The error is transferred to the Gaussian through its choice-free form, the squared error of the untruncated output plus the tail sum of squared singular values of \mathsf{rsvd}(\mathbf{A}, \mathbf{X}). [HalkoMartinssonTropp2011, Theorem 10.5]; [Woodruff2014, Lemma 48]; there for Gaussian test matrices and the untruncated output, with Woodruff's truncation for free.

General form: sizes are index types

Lean statement and details
NLAlib.integral_frobNorm_sub_truncatedSVD_rsvd_sq_le_of_isLeftUnitarilyInvariant.{u_1, u_2, u_3,
    u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} [DecidableEq n]
  {ν : Measure (Matrix n l ℝ)} [IsProbabilityMeasure ν] [IsLeftUnitarilyInvariant ν]
  (A : Matrix m n ℝ) (hX : HasLaw X ν μ) (hXr : ∀ᵐ (ω : Ω) ∂μ, Function.Injective (X ω).mulVec)
  {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), frobNorm (A - truncatedSVD (rsvd A (X ω)) k) ^ 2 ∂μ ≤
    gaussianProjectionFactor k (Fintype.card l) * frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (integral_schattenNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix). The expected error of the randomized SVD, Schatten norms (TW Theorem 8.1 (RSVD2)): for a standard Gaussian n \times \ell test matrix \mathbf{X}, k + 2 \le \ell and 2 \le p \le \infty, \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_{S_p}^2 \le \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{S_p}^2 + \frac{k}{\ell - k - 1} \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}^2\,. The Gram form at the Schatten gauge of order p/2. [TroppWebber2023, Theorem 8.1 (RSVD2)]; [HalkoMartinssonTropp2011, Theorem 10.5 (proof)].

General form: sizes are index types

Lean statement and details
NLAlib.integral_schattenNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} (A : Matrix m n ℝ)
  (hX : HasLaw X (gaussianMatrix n l) μ) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) {p : ℝ≥0∞}
  (hp : 2 ≤ p) :
  ∫ (ω : Ω), schattenNorm p (A - rsvd A (X ω)) ^ 2 ∂μ ≤
    schattenNorm p (A - truncatedSVD A k) ^ 2 +
      ↑k / (↑(Fintype.card l) - ↑k - 1) * frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (integral_specNorm_sub_rsvd_le_of_hasLaw_gaussianMatrix). The average spectral error of the randomized SVD (HMT Theorem 10.6): for a standard Gaussian n \times \ell test matrix \mathbf{X} and k + 2 \le \ell, <!-- value gaussianPinvSpecNormBound k \ell --> \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_2 \le \Bigl(1 + \sqrt{\tfrac{k}{\ell - k - 1}}\Bigr)\sigma_k(\mathbf{A}) + \frac{e}{\ell - k}\sqrt{(\ell + k - 1)/2}\, \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}\,, whose constant is at most HMT's e\sqrt{\ell}/(\ell - k) (NLAlib.gaussianPinvSpecNormBound_le). Incomparable with the squared form NLAlib.integral_specNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix: this one is better for large k. [HalkoMartinssonTropp2011, Theorem 10.6]; [MartinssonTropp2020, Theorem 11.5]; there with the constant e\sqrt{k + p}/p, p = \ell - k, and k \ge 2, here any k with k + 2 \le \ell.

General form: sizes are index types

Lean statement and details
NLAlib.integral_specNorm_sub_rsvd_le_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3, u_4} {Ω : Type u_1}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3} {l : Type u_4} [Fintype m]
  [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} (A : Matrix m n ℝ)
  (hX : HasLaw X (gaussianMatrix n l) μ) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), specNorm (A - rsvd A (X ω)) ∂μ ≤
    (1 + √(↑k / (↑(Fintype.card l) - ↑k - 1))) * singularValues A k +
      gaussianPinvSpecNormBound k (Fintype.card l) * frobNorm (A - truncatedSVD A k)

Full source on GitHub

Copy link

Theorem (integral_specNorm_sub_rsvd_le_of_isLeftUnitarilyInvariant). The average spectral error of the randomized SVD, rotation-invariant test matrices: for a test matrix \mathbf{X} with a left unitarily invariant law and full column rank almost surely and k + 2 \le \ell, <!-- value gaussianPinvSpecNormBound k \ell --> \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_2 \le \Bigl(1 + \sqrt{\tfrac{k}{\ell - k - 1}}\Bigr)\sigma_k(\mathbf{A}) + \frac{e}{\ell - k}\sqrt{(\ell + k - 1)/2}\, \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}\,, the bound of the Gaussian test matrix (NLAlib.integral_specNorm_sub_rsvd_le_of_hasLaw_gaussianMatrix). [HalkoMartinssonTropp2011, Theorem 10.6]; [MartinssonTropp2020, Theorem 11.5]; there for Gaussian test matrices, with the constant e\sqrt{k + p}/p, p = \ell - k.

General form: sizes are index types

Lean statement and details
NLAlib.integral_specNorm_sub_rsvd_le_of_isLeftUnitarilyInvariant.{u_1, u_2, u_3, u_4} {Ω : Type u_1}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3} {l : Type u_4} [Fintype m]
  [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} [DecidableEq n] {ν : Measure (Matrix n l ℝ)}
  [IsProbabilityMeasure ν] [IsLeftUnitarilyInvariant ν] (A : Matrix m n ℝ) (hX : HasLaw X ν μ)
  (hXr : ∀ᵐ (ω : Ω) ∂μ, Function.Injective (X ω).mulVec) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), specNorm (A - rsvd A (X ω)) ∂μ ≤
    (1 + √(↑k / (↑(Fintype.card l) - ↑k - 1))) * singularValues A k +
      gaussianPinvSpecNormBound k (Fintype.card l) * frobNorm (A - truncatedSVD A k)

Full source on GitHub

Copy link

Theorem (integral_specNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix). The expected error of the randomized SVD, squared spectral norm (TW Theorem 8.1 (RSVD2) at p = \infty): for a standard Gaussian n \times \ell test matrix \mathbf{X} and k + 2 \le \ell, \mathbb{E}\|\mathbf{A} - \mathsf{rsvd}(\mathbf{A}, \mathbf{X})\|_2^2 \le \sigma_k(\mathbf{A})^2 + \frac{k}{\ell - k - 1} \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}^2\,. Incomparable with NLAlib.integral_specNorm_sub_rsvd_le_of_hasLaw_gaussianMatrix (the first moment, HMT Theorem 10.6): this one is better for small k and is the form with a Nyström twin. [TroppWebber2023, Theorem 8.1 (RSVD2)]; [MartinssonTropp2020, Theorem 11.4 and remark].

General form: sizes are index types

Lean statement and details
NLAlib.integral_specNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3, u_4} {Ω : Type u_1}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3} {l : Type u_4} [Fintype m]
  [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} (A : Matrix m n ℝ)
  (hX : HasLaw X (gaussianMatrix n l) μ) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), specNorm (A - rsvd A (X ω)) ^ 2 ∂μ ≤
    singularValues A k ^ 2 + ↑k / (↑(Fintype.card l) - ↑k - 1) * frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (integral_specNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix_pinvSpecNormBound). The expected squared spectral error of the randomized SVD, HMT 10.6 form: for a standard Gaussian n \times \ell test matrix and k + 2 \le \ell, <!-- value gaussianPinvSpecNormBound k \ell --> \mathbb{E}\|\mathbf{A}-\mathsf{rsvd}(\mathbf{A}, \mathbf{\Omega})\|_2^2 \le \sigma_k^2 + \Bigl(\sigma_k\sqrt{\tfrac{k}{\ell-k-1}} + \frac{e}{\ell - k}\sqrt{(\ell + k - 1)/2}\, \|\mathbf{A}-\llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}\Bigr)^2 + \sigma_k^2\Bigl(\frac{e}{\ell - k}\sqrt{(\ell + k - 1)/2}\Bigr)^2\,, singular values of \mathbf{A} from 0; the bound is written in HMT's pseudoinverse constant, whence the name's suffix. The last factor being O(1/\ell), the Frobenius tail enters with weight O(1/\ell), against k/(\ell-k-1) in NLAlib.integral_specNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix; the two are incomparable (this one is better when the tail is heavy and \ell \gg k). Applied at a comparison rank near \ell/2 with the tail flattening NLAlib.natCast_mul_singularValues_add_sq_le_frobNorm_sub_truncatedSVD_sq, it bounds the spectral error by O(1/\ell) times the Frobenius tail at any k \le \ell/4. [HalkoMartinssonTropp2011, Theorem 10.6]; there the first moment; proved without a literature source in this second-moment form.

General form: sizes are index types

Lean statement and details
NLAlib.integral_specNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix_pinvSpecNormBound.{u_1, u_2, u_3,
    u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} (A : Matrix m n ℝ)
  (hX : HasLaw X (gaussianMatrix n l) μ) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), specNorm (A - rsvd A (X ω)) ^ 2 ∂μ ≤
    singularValues A k ^ 2 +
        (singularValues A k * √(↑k / (↑(Fintype.card l) - ↑k - 1)) +
            gaussianPinvSpecNormBound k (Fintype.card l) * frobNorm (A - truncatedSVD A k)) ^
          2 +
      (singularValues A k * gaussianPinvSpecNormBound k (Fintype.card l)) ^ 2

Full source on GitHub

Copy link

Theorem (integral_specNorm_sub_sq_le_of_isBestRankApprox_of_hasLaw_gaussianMatrix). The expected spectral error of the truncated randomized SVD, for a measurable choice \mathbf{Y} of best rank-k approximations of \mathsf{rsvd}(\mathbf{A}, \mathbf{X}): for a standard Gaussian n \times \ell test matrix \mathbf{X} and k + 2 \le \ell, \mathbb{E}\|\mathbf{A} - \mathbf{Y}\|_2^2 \le \sigma_k(\mathbf{A})^2 + \frac{k}{\ell - k - 1} \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}^2\,, the bound of the untruncated output (NLAlib.integral_specNorm_sub_rsvd_sq_le_of_hasLaw_gaussianMatrix). Direct form at truncatedSVD: NLAlib.integral_specNorm_sub_truncatedSVD_rsvd_sq_le_of_hasLaw_gaussianMatrix. [Gu2015, Theorem 3.4]; [TroppYurtseverUdellCevher2017a, Proposition A.8]; [TroppWebber2023, p. 42]; there a remark on truncated outputs, here explicit, under a selector.

General form: sizes are index types

Lean statement and details
NLAlib.integral_specNorm_sub_sq_le_of_isBestRankApprox_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} (A : Matrix m n ℝ)
  (hX : HasLaw X (gaussianMatrix n l) μ) {k : ℕ} (hk : k + 2 ≤ Fintype.card l)
  {Y : Ω → Matrix m n ℝ} (hY : ∀ (ω : Ω), IsBestRankApprox (rsvd A (X ω)) k (Y ω))
  (hYm : AEStronglyMeasurable Y μ) :
  ∫ (ω : Ω), specNorm (A - Y ω) ^ 2 ∂μ ≤
    singularValues A k ^ 2 + ↑k / (↑(Fintype.card l) - ↑k - 1) * frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Theorem (integral_specNorm_sub_truncatedSVD_rsvd_sq_le_of_hasLaw_gaussianMatrix). The expected spectral error of the truncated randomized SVD: for a standard Gaussian n \times \ell test matrix \mathbf{X} and k + 2 \le \ell, \mathbb{E}\|\mathbf{A} - \llbracket\mathsf{rsvd}(\mathbf{A}, \mathbf{X})\rrbracket_k\|_2^2 \le \sigma_k(\mathbf{A})^2 + \frac{k}{\ell - k - 1}\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k \|_{\mathsf{F}}^2\,, the bound of the untruncated output. The direct form of NLAlib.integral_specNorm_sub_sq_le_of_isBestRankApprox_of_hasLaw_gaussianMatrix, which covers any other measurable choice of the truncation. [Gu2015, Theorem 3.4]; [TroppYurtseverUdellCevher2017a, Proposition A.8]; [TroppWebber2023, p. 42]; there a remark on truncated outputs, here explicit.

General form: sizes are index types

Lean statement and details
NLAlib.integral_specNorm_sub_truncatedSVD_rsvd_sq_le_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} [Fintype m] [Fintype n] [Fintype l] {X : Ω → Matrix n l ℝ} (A : Matrix m n ℝ)
  (hX : HasLaw X (gaussianMatrix n l) μ) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), specNorm (A - truncatedSVD (rsvd A (X ω)) k) ^ 2 ∂μ ≤
    singularValues A k ^ 2 + ↑k / (↑(Fintype.card l) - ↑k - 1) * frobNorm (A - truncatedSVD A k) ^ 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.