NLA-lib Explorer

Approximate matrix multiplication by sampling, domination form

Library · Result group

Theorem (integral_frobNorm_conjTranspose_mul_sub_sq_le_of_hasLaw_samplingSketch). Approximate matrix multiplication by sampling, domination form: if \|\mathbf{A}_i\| \, \|\mathbf{B}_i\| \le L p_i for every row, with k nonempty, \mathbb{E} \|\mathbf{A}^{\mathsf{H}} \mathbf{S}^{\mathsf{H}} \mathbf{S} \mathbf{B} - \mathbf{A}^{\mathsf{H}} \mathbf{B}\|_{\mathsf{F}}^2 \le \frac{L \|\mathbf{A}\|_{\mathsf{F}} \|\mathbf{B}\|_{\mathsf{F}}}{\lvert k \rvert} \,. Zero weights are allowed. At the optimal weights p_i \propto \|\mathbf{A}_i\| \, \|\mathbf{B}_i\|, where L = \sum_i \|\mathbf{A}_i\| \, \|\mathbf{B}_i\|, this is \|\mathbf{A}\|_{\mathsf{F}}^2 \|\mathbf{B}\|_{\mathsf{F}}^2 / \lvert k \rvert by Cauchy–Schwarz, and \beta-approximations of them have L = W/\beta, with W that sum. [MartinssonTropp2020, §7.1]; Drineas, Kannan and Mahoney 2006, Lemma 4 (citation to confirm). There the bound is \|\mathbf{A}\|_{\mathsf{F}}^2 \|\mathbf{B}\|_{\mathsf{F}}^2 / (\beta \lvert k \rvert).

Headline (provisional) General form: sizes are index types

Lean statement and details
NLAlib.integral_frobNorm_conjTranspose_mul_sub_sq_le_of_hasLaw_samplingSketch.{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} {q : Type u_5} {r : Type u_6} [Fintype k] [Fintype n] [Fintype q] [Fintype r]
  [DecidableEq n] {S : Ω → Matrix k n 𝕜} {p : n → ℝ≥0} {A : Matrix n q 𝕜} {B : Matrix n r 𝕜} {L : ℝ}
  [Nonempty k] (hS : HasLaw S (samplingSketch k p) μ) (hp : ∑ i, p i = 1)
  (hdom : ∀ (i : n), ‖WithLp.toLp 2 (A i)‖ * ‖WithLp.toLp 2 (B i)‖ ≤ L * ↑(p i)) :
  ∫ (ω : Ω), frobNorm (Aᴴ * (S ω)ᴴ * S ω * B - Aᴴ * B) ^ 2 ∂μ ≤
    L * frobNorm A * frobNorm B / ↑(Fintype.card k)

Full source on GitHub

Copy link

Other forms

Theorem (integral_frobNorm_conjTranspose_mul_sub_sq_of_hasLaw_samplingSketch). Approximate matrix multiplication by sampling, exact second moment: \mathbb{E} \|\mathbf{A}^{\mathsf{H}} \mathbf{S}^{\mathsf{H}} \mathbf{S} \mathbf{B} - \mathbf{A}^{\mathsf{H}} \mathbf{B}\|_{\mathsf{F}}^2 = \frac{1}{\lvert k \rvert} \Bigl( \sum_i \frac{\|\mathbf{A}_i\|^2 \|\mathbf{B}_i\|^2}{p_i} - \|\mathbf{A}^{\mathsf{H}} \mathbf{B}\|_{\mathsf{F}}^2 \Bigr) for k nonempty, when every zero weight sits on a row where \mathbf{A} or \mathbf{B} vanishes (there the term is 0/0 = 0). [MartinssonTropp2020, §7.1] (the estimator); Drineas, Kannan and Mahoney 2006, Lemma 4 (the identity, citation to confirm).

General form: sizes are index types

Lean statement and details
NLAlib.integral_frobNorm_conjTranspose_mul_sub_sq_of_hasLaw_samplingSketch.{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} {q : Type u_5} {r : Type u_6} [Fintype k] [Fintype n] [Fintype q] [Fintype r]
  [DecidableEq n] {S : Ω → Matrix k n 𝕜} {p : n → ℝ≥0} {A : Matrix n q 𝕜} {B : Matrix n r 𝕜}
  [Nonempty k] (hS : HasLaw S (samplingSketch k p) μ) (hp : ∑ i, p i = 1)
  (hsupport : ∀ (i : n), p i = 0 → A i = 0 ∨ B i = 0) :
  ∫ (ω : Ω), frobNorm (Aᴴ * (S ω)ᴴ * S ω * B - Aᴴ * B) ^ 2 ∂μ =
    (∑ i, ‖WithLp.toLp 2 (A i)‖ ^ 2 * ‖WithLp.toLp 2 (B i)‖ ^ 2 / ↑(p i) - frobNorm (Aᴴ * B) ^ 2) /
      ↑(Fintype.card k)

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.