NLA-lib Explorer

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

Library · Result group

Theorem (exists_forall_hasProjectionCostPreserving_of_hasLaw_countSketch). CountSketch rows suffice for a rank-d projection-cost-preserving sketch: O((d+1)^2/(\varepsilon^2\delta)) rows give one, with constants 1 \mp \varepsilon and failure probability \delta, over any field, for \varepsilon below an absolute constant; the constants come before every dimension. Proved from NLAlib.hasProjectionCostPreserving_of_hasLaw_countSketch_of_le_card with C = 768 and \varepsilon_0 = 1. [CohenElderMuscoMuscoPersu2015, Theorem 12, Lemma 11 family 2].

Headline (provisional) General form: sizes are index types

Lean statement and details
NLAlib.exists_forall_hasProjectionCostPreserving_of_hasLaw_countSketch :
  ∃ C ε₀,
    0 < C ∧
      0 < ε₀ ∧
        ∀ {Ω 𝕜 k m n : Type} [inst : MeasurableSpace Ω] [inst_1 : RCLike 𝕜] [inst_2 : Fintype k]
          [inst_3 : Fintype m] [inst_4 : Fintype n] [inst_5 : DecidableEq k] (μ : Measure Ω)
          (S : Ω → Matrix k n 𝕜) (A : Matrix m n 𝕜) (d : ℕ) (ε δ : ℝ),
          HasLaw S (countSketch k n) μ →
            0 < ε →
              ε ≤ ε₀ →
                0 < δ →
                  C * ((↑d + 1) ^ 2 / (ε ^ 2 * δ)) ≤ ↑(Fintype.card k) →
                    HasProjectionCostPreserving S A d (1 - ε) (1 + ε) δ μ

Full source on GitHub

Copy link

Other forms

Theorem (hasProjectionCostPreserving_of_hasLaw_countSketch_of_le_card). A CountSketch is a projection-cost-preserving sketch, size form, over any field: for \varepsilon, \delta > 0, at least <!-- value countSketchEmbeddingDim d (\varepsilon/2) (\delta/2) --> (d^2 + d)/((\delta/2) (\varepsilon/2)^2) rows (countSketchEmbeddingDim 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{A}\mathbf{S}^{\mathsf{H}} is 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 CountSketch's own approximate-multiplication tail and its JL moment at \varepsilon/(8\sqrt{d+1}), through NLAlib.HasSubspaceEmbedding.hasProjectionCostPreserving_of_hasOrthonormalCols. [CohenElderMuscoMuscoPersu2015, Theorem 12, Lemma 11 family 2], O(k^2/(\varepsilon^2\delta)) there as here; here any field, explicit. Asymptotic form: NLAlib.exists_forall_hasProjectionCostPreserving_of_hasLaw_countSketch.

General form: sizes are index types

Lean statement and details
NLAlib.hasProjectionCostPreserving_of_hasLaw_countSketch_of_le_card.{u_1, u_2, u_3, u_4, u_7}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {𝕜 : Type u_2} [RCLike 𝕜] {k : Type u_3}
  {n : Type u_4} [Fintype k] [Fintype n] [DecidableEq k] {S : Ω → Matrix k n 𝕜} {ε δ : ℝ}
  {m : Type u_7} [Fintype m] (hS : HasLaw S (countSketch k n) μ) (A : Matrix m n 𝕜) (d : ℕ)
  (hε : 0 < ε) (hδ : 0 < δ) (hk₁ : countSketchEmbeddingDim d (ε / 2) (δ / 2) ≤ ↑(Fintype.card k))
  (hk₂ : projectionCostTailDim 2 d ε δ ≤ ↑(Fintype.card k)) :
  HasProjectionCostPreserving S 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.