NLA-lib Explorer

Approximate matrix multiplication in the spectral norm by the SRHT

Library · Result group

Theorem (measureReal_specNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_srht). Approximate matrix multiplication in the spectral norm by the SRHT: for a bounded orthonormal \mathbf{F} with constant \beta, the SRHT \mathbf{S} built from it (independent random signs and an independent uniform choice of \lvert k\rvert distinct rows), r nonempty, \mathbf{A} \in \Bbbk^{n \times q}, \mathbf{B} \in \Bbbk^{n \times r} and s, t \ge 0, \mathbb{P}\bigl[t \le \|\mathbf{A}^{\mathsf{H}}\mathbf{S}^{\mathsf{H}}\mathbf{S}\mathbf{B} - \mathbf{A}^{\mathsf{H}}\mathbf{B}\|_2\bigr] \le (\lvert q\rvert + \lvert r\rvert) \exp\Bigl(-\frac{\lvert k\rvert t^2/2}{\max(\beta R_{\mathbf{B}}\|\mathbf{A}\|_2^2, \beta R_{\mathbf{A}}\|\mathbf{B}\|_2^2) + 2\beta\sqrt{R_{\mathbf{A}}R_{\mathbf{B}}}\,t/3}\Bigr) + 2\lvert n\rvert e^{-s}\,, with the flattened row-norm bounds <!-- value srhtRowNormBound \mathbf{A} s --> R_{\mathbf{A}} = \|\mathbf{A}\|_{\mathsf{F}}^2 + 2\|\mathbf{A}\|_{\mathsf{F}}\|\mathbf{A}\|_2\sqrt{s} + 2\|\mathbf{A}\|_2^2 s (NLAlib.srhtRowNormBound A s) and R_{\mathbf{B}} likewise (<!-- mention srhtRowNormBound -->srhtRowNormBound B s): condition on the signs, flatten both factors, then sample without replacement (measureReal_specNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_samplingSketchWithoutReplacement). For \mathbf{A} = \mathbf{B} with \|\mathbf{A}\|_2 = 1 and stable rank r_s this is \lvert k\rvert = O(\beta(r_s + \log(n/\delta))\log((q + r)/\delta)/\varepsilon^2). [Tropp2011a, Lemma 3.3] for flattening; the bound is this proof's (no printed source in hand). Any field.

Headline (provisional) General form: sizes are index types

Lean statement and details
NLAlib.measureReal_specNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_srht.{u_1, u_2, u_3, u_4, u_5,
    u_6}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {𝕜 : Type u_2} [RCLike 𝕜] {k : Type u_3}
  {n : Type u_4} [Fintype k] [Fintype n] [DecidableEq n] {β : ℝ} {q : Type u_5} {r : Type u_6}
  [Fintype q] [Fintype r] {S : Ω → Matrix k n 𝕜} {F : Matrix n n 𝕜} [Nonempty r]
  (hF : IsBoundedOrthonormal F β) (hS : HasLaw S (srht k F) μ) (A : Matrix n q 𝕜) (B : Matrix n r 𝕜)
  {s t : ℝ} (hs : 0 ≤ s) (ht : 0 ≤ t) :
  μ.real {ω | t ≤ specNorm (Aᴴ * (S ω)ᴴ * S ω * B - Aᴴ * B)} ≤
    (↑(Fintype.card q) + ↑(Fintype.card r)) *
        rexp
          (-(↑(Fintype.card k) * t ^ 2 / 2) /
            (max (β * srhtRowNormBound B s * specNorm A ^ 2)
                (β * srhtRowNormBound A s * specNorm B ^ 2) +
              2 * β * √(srhtRowNormBound A s * srhtRowNormBound B s) * t / 3)) +
      2 * ↑(Fintype.card n) * rexp (-s)

Full source on GitHub

Copy link

Other forms

Theorem (measureReal_specNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_srhtWithReplacement). Approximate matrix multiplication in the spectral norm by the SRHT with replacement: for a bounded orthonormal \mathbf{F} with constant \beta, the SRHT \mathbf{S} built from it with \lvert k\rvert i.i.d. uniform row indices, k and r nonempty, \mathbf{A} \in \Bbbk^{n \times q}, \mathbf{B} \in \Bbbk^{n \times r} and s, t \ge 0, \mathbb{P}\bigl[t \le \|\mathbf{A}^{\mathsf{H}}\mathbf{S}^{\mathsf{H}}\mathbf{S}\mathbf{B} - \mathbf{A}^{\mathsf{H}}\mathbf{B}\|_2\bigr] \le (\lvert q\rvert + \lvert r\rvert) \exp\Bigl(-\frac{\lvert k\rvert t^2/2}{\max(\beta R_{\mathbf{B}}\|\mathbf{A}\|_2^2, \beta R_{\mathbf{A}}\|\mathbf{B}\|_2^2) + 2\beta\sqrt{R_{\mathbf{A}}R_{\mathbf{B}}}\,t/3}\Bigr) + 2\lvert n\rvert e^{-s}\,, with the flattened row-norm bounds <!-- value srhtRowNormBound \mathbf{A} s --> R_{\mathbf{A}} = \|\mathbf{A}\|_{\mathsf{F}}^2 + 2\|\mathbf{A}\|_{\mathsf{F}}\|\mathbf{A}\|_2\sqrt{s} + 2\|\mathbf{A}\|_2^2 s (NLAlib.srhtRowNormBound A s) and R_{\mathbf{B}} likewise: flatten, then sample with replacement (NLAlib.measureReal_specNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_samplingSketch at uniform weights). [Tropp2011a, Lemma 3.3] for flattening; the bound is this proof's. Any field.

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_specNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_srhtWithReplacement.{u_1, u_2,
    u_3, u_4, u_5, u_6}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {𝕜 : Type u_2} [RCLike 𝕜] {k : Type u_3}
  {n : Type u_4} [Fintype k] [Fintype n] [DecidableEq n] {β : ℝ} {q : Type u_5} {r : Type u_6}
  [Fintype q] [Fintype r] {S : Ω → Matrix k n 𝕜} {F : Matrix n n 𝕜} [Nonempty k] [Nonempty r]
  (hF : IsBoundedOrthonormal F β) (hS : HasLaw S (srhtWithReplacement k F) μ) (A : Matrix n q 𝕜)
  (B : Matrix n r 𝕜) {s t : ℝ} (hs : 0 ≤ s) (ht : 0 ≤ t) :
  μ.real {ω | t ≤ specNorm (Aᴴ * (S ω)ᴴ * S ω * B - Aᴴ * B)} ≤
    (↑(Fintype.card q) + ↑(Fintype.card r)) *
        rexp
          (-(↑(Fintype.card k) * t ^ 2 / 2) /
            (max (β * srhtRowNormBound B s * specNorm A ^ 2)
                (β * srhtRowNormBound A s * specNorm B ^ 2) +
              2 * β * √(srhtRowNormBound A s * srhtRowNormBound B s) * t / 3)) +
      2 * ↑(Fintype.card n) * rexp (-s)

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.