NLA-lib Explorer

CountSketch as a subspace embedding

Library · Source module

CountSketch as a subspace embedding

The embedding guarantees of the CountSketch NLAlib.countSketch of NLAlib/Sketching/Sparse/CountSketch.lean, from the exact second moment of approximate matrix multiplication proved there: the exact mean of the squared Gram error of an orthonormal \mathbf{U}, the trace moment at q = 1 with bound (d^2 + d)/\lvert k \rvert, the oblivious subspace embedding and injection with failure probability (d^2 + d)/(\lvert k \rvert \varepsilon^2), the JL moment at p = 2, the sizes, and the projection-cost-preserving sketch. Every bound is the same over \mathbb{R} and \mathbb{C}.

Degenerate cases are those of the law (NLAlib/Sketching/Sparse/CountSketch.lean): for empty k, HasLaw forces \mu = 0 and every tail holds, hence [Nonempty k] on the OSI only; dimension d = 0 makes every bound 0, and for d > \lvert n \rvert the OSE at d is the one at \lvert n \rvert. Split from NLAlib/Sketching/Sparse/CountSketch.lean (2026-10-16), the Haar.lean and HaarEmbedding.lean precedent.

Main definitions

* NLAlib.countSketchEmbeddingDim: the number of rows; for dimension d the OSE needs <!-- value countSketchEmbeddingDim d \varepsilon \delta --> \lvert k \rvert \ge (d^2 + d)/(\delta \varepsilon^2).

Main results

* HasOrthonormalCols.integral_frobNorm_conjTranspose_mul_self_sub_one_sq_of_hasLaw_countSketch (in NLAlib), NLAlib.hasGramTraceMoment_of_hasLaw_countSketch: the Gram error and the trace moment. * NLAlib.isObliviousSubspaceEmbedding_of_hasLaw_countSketch, NLAlib.isObliviousSubspaceInjection_of_hasLaw_countSketch: the CountSketch OSE and OSI. * NLAlib.hasJLMoment_of_hasLaw_countSketch: the JL moment at p = 2. * NLAlib.isObliviousSubspaceEmbedding_of_hasLaw_countSketch_of_countSketchEmbeddingDim_le, NLAlib.isObliviousSubspaceInjection_of_hasLaw_countSketch_of_countSketchEmbeddingDim_le, NLAlib.hasJLMoment_of_hasLaw_countSketch_of_le_card: sizes. * NLAlib.exists_forall_isObliviousSubspaceEmbedding_of_hasLaw_countSketch: the asymptotic form, O(d^2/(\delta \varepsilon^2)) rows. * NLAlib.hasProjectionCostPreserving_of_hasLaw_countSketch_of_le_card, NLAlib.exists_forall_hasProjectionCostPreserving_of_hasLaw_countSketch: a CountSketch is a projection-cost-preserving sketch, O((d + 1)^2/(\varepsilon^2\delta)) rows.

Declarations