NLA-lib Explorer

Gaussian rows suffice for a rank-d projection-cost-preserving sketch

Library · Result group

Theorem (exists_forall_hasProjectionCostPreserving_of_hasLaw_gaussianMatrix). Gaussian rows suffice for a rank-d projection-cost-preserving sketch: O((d+1)\log(1/\delta)/\varepsilon^2) rows give one, with constants 1 \mp \varepsilon and failure probability \delta, for \varepsilon and \delta below absolute constants; the constants come before every dimension. Proved from NLAlib.hasProjectionCostPreserving_of_hasLaw_gaussianMatrix_of_jlMomentDim_le with \varepsilon_0 = 1 and \delta \le 1/2; the OSE size O((d + \log(1/\delta))/\varepsilon^2) is dominated by the tail size there. The literature's additive (d + \log(1/\delta))/\varepsilon^2 needs stable-rank spectral approximate multiplication. [CohenElderMuscoMuscoPersu2015, Theorem 12].

Headline (provisional) General form: sizes are index types

Lean statement and details
NLAlib.exists_forall_hasProjectionCostPreserving_of_hasLaw_gaussianMatrix :
  ∃ C ε₀,
    0 < C ∧
      0 < ε₀ ∧
        ∀ {Ω k m n : Type} [inst : MeasurableSpace Ω] [inst_1 : Fintype k] [inst_2 : Fintype m]
          [inst_3 : Fintype n] (μ : Measure Ω) (G : Ω → Matrix k n ℝ) (A : Matrix m n ℝ) (d : ℕ)
          (ε δ : ℝ),
          HasLaw G (gaussianMatrix k n) μ →
            0 < ε →
              ε ≤ ε₀ →
                0 < δ →
                  δ ≤ 1 / 2 →
                    C * ((↑d + 1) * Real.log (1 / δ) / ε ^ 2) ≤ ↑(Fintype.card k) →
                      HasProjectionCostPreserving (fun ω ↦ (√↑(Fintype.card k))⁻¹ • G ω) A d (1 - ε)
                        (1 + ε) δ μ

Full source on GitHub

Copy link

Other forms

Theorem (hasProjectionCostPreserving_of_hasLaw_gaussianMatrix_of_jlMomentDim_le). A Gaussian sketch is a projection-cost-preserving sketch, \log(1/\delta) size form: for 0 < \varepsilon \le 2, \delta > 0, at least <!-- value gaussianEmbeddingDim d (\varepsilon/2) (\delta/2) --> 9 (\sqrt{d} + \sqrt{2 \log(2/(\delta/2))})^2/(\varepsilon/2)^2 rows (gaussianEmbeddingDim d (ε / 2) (δ / 2)) and at least <!-- value jlMomentDim (\varepsilon/(8\sqrt{d+1})) (\delta/6) --> 128\max(2, \log(1/(\delta/6)))/(\varepsilon/(8\sqrt{d+1}))^2 rows (jlMomentDim (ε / (8 * √(d + 1))) (δ / 6)), \mathbf{S} = \lvert k \rvert^{-1/2}\mathbf{G} with \mathbf{G} standard Gaussian makes \mathbf{A}\mathbf{S}^{\mathsf{H}} a rank-d projection-cost-preserving sketch of \mathbf{A} with constants 1 \mp \varepsilon, for every \mathbf{A}, except with probability \delta. The head is the OSE size form at (\varepsilon/2, \delta/2), the tail the JL moment NLAlib.hasJLMoment_of_hasLaw_gaussianMatrix_of_jlMomentDim_le at \varepsilon/(8\sqrt{d+1}) with failure \delta/6, at exponent \max(2, \log(6/\delta)). Incomparable with NLAlib.hasProjectionCostPreserving_of_hasLaw_gaussianMatrix_of_le_card (rule 4): the second size is O((d+1)\log(1/\delta)/\varepsilon^2) in place of O((d+1)/(\varepsilon^2\delta)). [CohenElderMuscoMuscoPersu2015, Theorem 12, Lemma 11 family 1]; there sign matrices and O((k + \log(1/\delta))/\varepsilon^2) rows through stable-rank spectral approximate multiplication; here the product form that JL moments give. Asymptotic form: NLAlib.exists_forall_hasProjectionCostPreserving_of_hasLaw_gaussianMatrix.

General form: sizes are index types

Lean statement and details
NLAlib.hasProjectionCostPreserving_of_hasLaw_gaussianMatrix_of_jlMomentDim_le.{u_1, u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {k : Type u_2} {n : Type u_3} [Fintype k]
  [Fintype n] {ε δ : ℝ} {G : Ω → Matrix k n ℝ} (hG : HasLaw G (gaussianMatrix k n) μ) {m : Type u_4}
  [Fintype m] (A : Matrix m n ℝ) (d : ℕ) (hε : 0 < ε) (hε2 : ε ≤ 2) (hδ : 0 < δ)
  (hk₁ : gaussianEmbeddingDim d (ε / 2) (δ / 2) ≤ ↑(Fintype.card k))
  (hk₂ : jlMomentDim (ε / (8 * √(↑d + 1))) (δ / 6) ≤ ↑(Fintype.card k)) :
  HasProjectionCostPreserving (fun ω ↦ (√↑(Fintype.card k))⁻¹ • G ω) A d (1 - ε) (1 + ε) δ μ

Full source on GitHub

Copy link

Theorem (hasProjectionCostPreserving_of_hasLaw_gaussianMatrix_of_le_card). A Gaussian sketch is a projection-cost-preserving sketch, size form: for 0 < \varepsilon \le 2, \delta > 0, at least <!-- value gaussianEmbeddingDim d (\varepsilon/2) (\delta/2) --> 9 (\sqrt{d} + \sqrt{2 \log(2/(\delta/2))})^2/(\varepsilon/2)^2 rows (gaussianEmbeddingDim d (ε / 2) (δ / 2)) and at least <!-- value projectionCostTailDim 2 d \varepsilon \delta --> 384 \cdot 2 (d + 1)/(\varepsilon^2 \delta) rows (projectionCostTailDim 2 d ε δ), \mathbf{S} = \lvert k \rvert^{-1/2}\mathbf{G} makes \mathbf{A}\mathbf{S}^{\mathsf{H}} a rank-d projection-cost-preserving sketch of \mathbf{A} with constants 1 \mp \varepsilon, for every \mathbf{A}, except with probability \delta. The head is the OSE size form at (\varepsilon/2, \delta/2), the tail the JL moment at \varepsilon/(8\sqrt{d+1}), through NLAlib.IsObliviousSubspaceEmbedding.hasProjectionCostPreserving_of_hasJLMoment. [CohenElderMuscoMuscoPersu2015, Theorem 12, Lemma 11 family 1]; there sign matrices and O((k + \log(1/\delta))/\varepsilon^2) rows through stable-rank spectral approximate multiplication, error O(\varepsilon); here the Gaussian, explicit constants, and 1/\delta from second moments. Incomparable with its \log(1/\delta) twin NLAlib.hasProjectionCostPreserving_of_hasLaw_gaussianMatrix_of_jlMomentDim_le (rule 4): this one needs fewer rows at constant \delta, the twin for small \delta; the asymptotic form NLAlib.exists_forall_hasProjectionCostPreserving_of_hasLaw_gaussianMatrix is proved from the twin.

General form: sizes are index types

Lean statement and details
NLAlib.hasProjectionCostPreserving_of_hasLaw_gaussianMatrix_of_le_card.{u_1, u_2, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {k : Type u_2} {n : Type u_3} [Fintype k]
  [Fintype n] {ε δ : ℝ} {G : Ω → Matrix k n ℝ} (hG : HasLaw G (gaussianMatrix k n) μ) {m : Type u_4}
  [Fintype m] (A : Matrix m n ℝ) (d : ℕ) (hε : 0 < ε) (hε2 : ε ≤ 2) (hδ : 0 < δ)
  (hk₁ : gaussianEmbeddingDim d (ε / 2) (δ / 2) ≤ ↑(Fintype.card k))
  (hk₂ : projectionCostTailDim 2 d ε δ ≤ ↑(Fintype.card k)) :
  HasProjectionCostPreserving (fun ω ↦ (√↑(Fintype.card k))⁻¹ • G ω) A 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.