NLA-lib Explorer

Gaussian subspace embedding

Library · Result group

Theorem (HasOrthonormalCols.hasSubspaceEmbedding_of_hasLaw_gaussianMatrix). Gaussian subspace embedding: for \mathbf{U} with orthonormal columns, \mathbf{S} = \lvert k \rvert^{-1/2} \, \mathbf{G} is a subspace embedding for \operatorname{range} \mathbf{U} with constants \Bigl(1 \mp \frac{\sqrt{\lvert p \rvert} + t}{\sqrt{\lvert k \rvert}}\Bigr)^2 outside probability 2 e^{-t^2/2}, for 0 \le t \le \sqrt{\lvert k \rvert} - \sqrt{\lvert p \rvert}; Gordon's Gram sandwich for the k \times p Gaussian \mathbf{G}\mathbf{U}. [Woodruff2014, Theorem 6] (\lvert k \rvert = \Theta((\lvert p \rvert + \log(1/\delta))/\varepsilon^2), no constant); [MartinssonTropp2020, §8.7.2], there 1 \mp (1 + \sqrt{\lvert p \rvert})/\sqrt{\lvert k \rvert} \mp t/\sqrt{\lvert k \rvert} for our t.

Headline (provisional) General form: sizes are index types

Lean statement and details
NLAlib.HasOrthonormalCols.hasSubspaceEmbedding_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {k : Type u_2} {n : Type u_3}
  {p : Type u_4} [Fintype k] [Fintype n] [Fintype p] {G : Ω → Matrix k n ℝ} {U : Matrix n p ℝ}
  {t : ℝ} [DecidableEq p] (hU : HasOrthonormalCols U) (hG : HasLaw G (gaussianMatrix k n) μ)
  (ht : 0 ≤ t) (htk : t ≤ √↑(Fintype.card k) - √↑(Fintype.card p)) :
  HasSubspaceEmbedding (fun ω ↦ (√↑(Fintype.card k))⁻¹ • G ω) U
    ((1 - (√↑(Fintype.card p) + t) / √↑(Fintype.card k)) ^ 2)
    ((1 + (√↑(Fintype.card p) + t) / √↑(Fintype.card k)) ^ 2) (2 * rexp (-t ^ 2 / 2)) μ

Full source on GitHub

Copy link

Other forms

Theorem (isObliviousSubspaceEmbedding_of_hasLaw_gaussianMatrix). The Gaussian OSE: \mathbf{S} = \lvert k \rvert^{-1/2} \, \mathbf{G} is an oblivious subspace embedding for dimension d with constants \Bigl(1 \mp \frac{\sqrt{d} + t}{\sqrt{\lvert k \rvert}}\Bigr)^2 and failure probability 2 e^{-t^2/2}, for 0 \le t \le \sqrt{\lvert k \rvert} - \sqrt{d}. [Woodruff2014, Theorem 6]; [MartinssonTropp2020, §8.7.2].

General form: sizes are index types

Lean statement and details
NLAlib.isObliviousSubspaceEmbedding_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3} {Ω : Type u_1}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {k : Type u_2} {n : Type u_3} [Fintype k] [Fintype n]
  {G : Ω → Matrix k n ℝ} {t : ℝ} (hG : HasLaw G (gaussianMatrix k n) μ) (d : ℕ) (ht : 0 ≤ t)
  (htd : t ≤ √↑(Fintype.card k) - √↑d) :
  IsObliviousSubspaceEmbedding (fun ω ↦ (√↑(Fintype.card k))⁻¹ • G ω) d
    ((1 - (√↑d + t) / √↑(Fintype.card k)) ^ 2) ((1 + (√↑d + t) / √↑(Fintype.card k)) ^ 2)
    (2 * rexp (-t ^ 2 / 2)) μ

Full source on GitHub

Copy link

Theorem (isObliviousSubspaceEmbedding_of_hasLaw_gaussianMatrix_of_gaussianEmbeddingDim_le). Gaussian OSE, sample-size form: at least <!-- value gaussianEmbeddingDim d \varepsilon \delta --> 9 (\sqrt{d} + \sqrt{2 \log(2/\delta)})^2/\varepsilon^2 rows (gaussianEmbeddingDim d ε δ) give an oblivious subspace embedding for dimension d with constants 1 \mp \varepsilon and failure probability \delta, for 0 < \varepsilon \le 1 and \delta > 0 (for \delta \ge 2 it is trivial). [Woodruff2014, Theorem 6]. Asymptotic form: NLAlib.exists_forall_isObliviousSubspaceEmbedding_of_hasLaw_gaussianMatrix.

General form: sizes are index types

Lean statement and details
NLAlib.isObliviousSubspaceEmbedding_of_hasLaw_gaussianMatrix_of_gaussianEmbeddingDim_le.{u_1, u_2,
    u_3}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {k : Type u_2} {n : Type u_3} [Fintype k]
  [Fintype n] {G : Ω → Matrix k n ℝ} {d : ℕ} {ε δ : ℝ} (hG : HasLaw G (gaussianMatrix k n) μ)
  (hε : 0 < ε) (hε1 : ε ≤ 1) (hδ : 0 < δ) (hk : gaussianEmbeddingDim d ε δ ≤ ↑(Fintype.card k)) :
  IsObliviousSubspaceEmbedding (fun ω ↦ (√↑(Fintype.card k))⁻¹ • G ω) d (1 - ε) (1 + ε) δ μ

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.