NLA-lib Explorer

Sketch-and-precondition with a random embedding, sketch-and-solve start

Library · Result group

Theorem (HasSubspaceEmbedding.measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le). Sketch-and-precondition with a random embedding, sketch-and-solve start: if the random sketch \mathbf{S} is a subspace embedding of \operatorname{range}[\mathbf{A}\ \mathbf{y}] with constants a > 0, \mathbf{b} in squared norms (a\|\mathbf{v}\|^2 \le \|\mathbf{S}\mathbf{v}\|^2 \le \mathbf{b}\|\mathbf{v}\|^2 on that range) except with probability \delta, \mathbf{A} has full column rank and almost surely \mathbf{x}_0 minimizes \|\mathbf{S}(\mathbf{A}\mathbf{x} - \mathbf{y})\|, then \mathbb{P}\Bigl[\Bigl(1 + 4\Bigl(\frac{\mathbf{b}}{a} - 1\Bigr) \Bigl(\frac{\sqrt{\mathbf{b}/a} - 1}{\sqrt{\mathbf{b}/a} + 1}\Bigr)^{2q}\Bigr) \|(\mathbf{I} - \mathbf{P}_{\mathbf{A}})\mathbf{y}\|^2 < \|\mathbf{y} - \mathbf{A}\,\mathsf{sketchAndPrecondition}(\mathbf{A}, \mathbf{S}, \mathbf{y}, \mathbf{x}_0, q)\|^2\Bigr] \le \delta\,. Squared residuals; [MartinssonTropp2020, §10.5] states an unsquared 1 + \varepsilon. No law is assumed: any distribution with the embedding property qualifies.

Headline (provisional)

Lean statement and details
NLAlib.HasSubspaceEmbedding.measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le.{u_1, u_2,
    u_3, u_4, u_6}
  {𝕜 : Type u_1} [RCLike 𝕜] {k : Type u_2} {m : Type u_3} {n : Type u_4} [Fintype k] [Fintype m]
  [Fintype n] [DecidableEq n] {A : Matrix m n 𝕜} {y : m → 𝕜} {a b : ℝ} {Ω : Type u_6}
  {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {δ : ℝ} [DecidableEq m] [IsFiniteMeasure μ]
  {S : Ω → Matrix k m 𝕜} (h : HasSubspaceEmbedding S (A.fromCols (replicateCol Unit y)) a b δ μ)
  (ha : 0 < a) (hA : Function.Injective A.mulVec) {x₀ : Ω → n → 𝕜}
  (hx₀ : ∀ᵐ (ω : Ω) ∂μ, IsLeastSquaresSolution (S ω * A) (S ω *ᵥ y) (x₀ ω)) (q : ℕ) :
  μ.real
      {ω |
        (1 + 4 * (b / a - 1) * ((√(b / a) - 1) / (√(b / a) + 1)) ^ (2 * q)) *
            ‖WithLp.toLp 2 ((1 - rangeProjector A) *ᵥ y)‖ ^ 2 <
          ‖WithLp.toLp 2 (y - A *ᵥ sketchAndPrecondition A (S ω) y (x₀ ω) q)‖ ^ 2} ≤
    δ

Full source on GitHub

Copy link

Other forms

Theorem (IsSubspaceEmbedding.norm_sub_mulVec_sketchAndPrecondition_sq_le). Sketch-and-precondition from the sketch-and-solve start: if \mathbf{S} is a subspace embedding with constants a > 0, \mathbf{b} in squared norms (a\|\mathbf{v}\|^2 \le \|\mathbf{S}\mathbf{v}\|^2 \le \mathbf{b}\|\mathbf{v}\|^2 for \mathbf{v} \in \operatorname{range}\mathbf{U}) of a subspace \operatorname{range}\mathbf{U} containing \operatorname{range}\mathbf{A} and \mathbf{y}, \mathbf{A} has full column rank and \mathbf{x}_0 is any minimizer of \|\mathbf{S}(\mathbf{A}\mathbf{x} - \mathbf{y})\|, then \|\mathbf{y} - \mathbf{A}\,\mathsf{sketchAndPrecondition}(\mathbf{A}, \mathbf{S}, \mathbf{y}, \mathbf{x}_0, q)\|^2 \le \Bigl(1 + 4\Bigl(\frac{\mathbf{b}}{a} - 1\Bigr) \Bigl(\frac{\sqrt{\mathbf{b}/a} - 1}{\sqrt{\mathbf{b}/a} + 1}\Bigr)^{2q}\Bigr) \|(\mathbf{I} - \mathbf{P}_{\mathbf{A}})\mathbf{y}\|^2\,, the last factor being the optimal squared residual. In Epperly's unsquared \eta (a = (1 - \eta)^2, \mathbf{b} = (1 + \eta)^2) the factor is 1 + 16\eta^{2q+1}/(1 - \eta)^2. The bound is squared; [MartinssonTropp2020, §10.5] states an unsquared 1 + \varepsilon after j \sim \log(1/\varepsilon) steps; [Epperly2024, Algorithm 1 and Fact 4], the start and its error.

Lean statement and details
NLAlib.IsSubspaceEmbedding.norm_sub_mulVec_sketchAndPrecondition_sq_le.{u_1, u_2, u_3, u_4, u_5}
  {𝕜 : Type u_1} [RCLike 𝕜] {k : Type u_2} {m : Type u_3} {n : Type u_4} {r : Type u_5} [Fintype k]
  [Fintype m] [Fintype n] [DecidableEq n] {S : Matrix k m 𝕜} {A : Matrix m n 𝕜} {y : m → 𝕜}
  {x₀ : n → 𝕜} {a b : ℝ} [DecidableEq m] [Fintype r] {U : Matrix m r 𝕜}
  (h : IsSubspaceEmbedding S U a b) (ha : 0 < a) (hAU : A.mulVecLin.range ≤ U.mulVecLin.range)
  (hy : y ∈ U.mulVecLin.range) (hA : Function.Injective A.mulVec)
  (hx₀ : IsLeastSquaresSolution (S * A) (S *ᵥ y) x₀) (q : ℕ) :
  ‖WithLp.toLp 2 (y - A *ᵥ sketchAndPrecondition A S y x₀ q)‖ ^ 2 ≤
    (1 + 4 * (b / a - 1) * ((√(b / a) - 1) / (√(b / a) + 1)) ^ (2 * q)) *
      ‖WithLp.toLp 2 ((1 - rangeProjector A) *ᵥ y)‖ ^ 2

Full source on GitHub

Copy link

Theorem (measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_countSketch). CountSketch sketch-and-precondition: for a CountSketch \mathbf{S} with p rows (each column has one nonzero entry, an independent random sign in an independent uniformly random row), \mathbf{A} of full column rank, \mathbf{x}_0 almost surely a minimizer of \|\mathbf{S}(\mathbf{A}\mathbf{x} - \mathbf{y})\|, 0 < \varepsilon \le 1/2, \delta > 0, at least <!-- value countSketchEmbeddingDim {(\lvert n \rvert + 1)} \varepsilon \delta --> ((\lvert n \rvert + 1)^2 + (\lvert n \rvert + 1))/(\delta \varepsilon^2) rows (NLAlib.countSketchEmbeddingDim (card n + 1) ε δ) and 16\varepsilon^{2q+1} \le \tau, \mathbb{P}\Bigl[(1 + \tau)\|(\mathbf{I} - \mathbf{P}_{\mathbf{A}})\mathbf{y}\|^2 < \|\mathbf{y} - \mathbf{A}\,\mathsf{sketchAndPrecondition}(\mathbf{A}, \mathbf{S}, \mathbf{y}, \mathbf{x}_0, q)\|^2\Bigr] \le \delta\,. Over any RCLike field. Squared residuals, and \varepsilon is the squared-norm distortion of the embedding of \operatorname{range}[\mathbf{A}\ \mathbf{y}]. [MartinssonTropp2020, §10.5], there unsquared, after j \sim \log(1/\varepsilon) steps and with no constants. Asymptotic form: NLAlib.exists_forall_measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_countSketch.

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_countSketch.{u_1, u_2,
    u_3, u_4, u_6}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {𝕜 : Type u_2} [RCLike 𝕜] {m : Type u_3}
  {n : Type u_4} {p : Type u_6} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq p]
  {S : Ω → Matrix p m 𝕜} [DecidableEq n] (hS : HasLaw S (countSketch p m) μ) {A : Matrix m n 𝕜}
  (hA : Function.Injective A.mulVec) (y : m → 𝕜) {x₀ : Ω → n → 𝕜}
  (hx₀ : ∀ᵐ (ω : Ω) ∂μ, IsLeastSquaresSolution (S ω * A) (S ω *ᵥ y) (x₀ ω)) {ε δ τ : ℝ} (hε : 0 < ε)
  (hε1 : ε ≤ 1 / 2) (hδ : 0 < δ)
  (hp : countSketchEmbeddingDim (Fintype.card n + 1) ε δ ≤ ↑(Fintype.card p)) {q : ℕ}
  (hq : 16 * ε ^ (2 * q + 1) ≤ τ) :
  μ.real
      {ω |
        (1 + τ) * ‖WithLp.toLp 2 ((1 - rangeProjector A) *ᵥ y)‖ ^ 2 <
          ‖WithLp.toLp 2 (y - A *ᵥ sketchAndPrecondition A (S ω) y (x₀ ω) q)‖ ^ 2} ≤
    δ

Full source on GitHub

Copy link

Theorem (measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_gaussianMatrix). Gaussian sketch-and-precondition: for a standard Gaussian \mathbf{G} \in \mathbb{R}^{p \times m} (independent standard normal entries), the sketch \mathbf{S} = \lvert p\rvert^{-1/2}\mathbf{G}, \mathbf{A} of full column rank, \mathbf{x}_0 almost surely a minimizer of \|\mathbf{S}(\mathbf{A}\mathbf{x} - \mathbf{y})\|, 0 < \varepsilon \le 1/2, \delta > 0, at least <!-- value gaussianEmbeddingDim {\lvert n \rvert + 1} \varepsilon \delta --> 9 (\sqrt{\lvert n \rvert + 1} + \sqrt{2 \log(2/\delta)})^2/\varepsilon^2 rows (gaussianEmbeddingDim (card n + 1) ε δ) and 16\varepsilon^{2q+1} \le \tau, \mathbb{P}\Bigl[(1 + \tau)\|(\mathbf{I} - \mathbf{P}_{\mathbf{A}})\mathbf{y}\|^2 < \|\mathbf{y} - \mathbf{A}\,\mathsf{sketchAndPrecondition}(\mathbf{A}, \mathbf{S}, \mathbf{y}, \mathbf{x}_0, q)\|^2\Bigr] \le \delta\,. Squared residuals, and \varepsilon is the squared-norm distortion of the embedding of \operatorname{range}[\mathbf{A}\ \mathbf{y}], which trades sketch size against iterations. [MartinssonTropp2020, §10.5], there unsquared, after j \sim \log(1/\varepsilon) steps and with no constants. Asymptotic form: NLAlib.exists_forall_measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_gaussianMatrix.

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_gaussianMatrix.{u_1,
    u_2, u_3, u_5}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {p : Type u_5} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] {G : Ω → Matrix p m ℝ}
  [DecidableEq n] (hG : HasLaw G (gaussianMatrix p m) μ) {A : Matrix m n ℝ}
  (hA : Function.Injective A.mulVec) (y : m → ℝ) {x₀ : Ω → n → ℝ}
  (hx₀ :
    ∀ᵐ (ω : Ω) ∂μ,
      IsLeastSquaresSolution ((√↑(Fintype.card p))⁻¹ • G ω * A) ((√↑(Fintype.card p))⁻¹ • G ω *ᵥ y)
        (x₀ ω))
  {ε δ τ : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1 / 2) (hδ : 0 < δ)
  (hp : gaussianEmbeddingDim (Fintype.card n + 1) ε δ ≤ ↑(Fintype.card p)) {q : ℕ}
  (hq : 16 * ε ^ (2 * q + 1) ≤ τ) :
  μ.real
      {ω |
        (1 + τ) * ‖WithLp.toLp 2 ((1 - rangeProjector A) *ᵥ y)‖ ^ 2 <
          ‖WithLp.toLp 2
                (y - A *ᵥ sketchAndPrecondition A ((√↑(Fintype.card p))⁻¹ • G ω) y (x₀ ω) q)‖ ^
            2} ≤
    δ

Full source on GitHub

Copy link

Theorem (measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_haarFrame). Haar sketch-and-precondition: for an m \times k Haar frame \mathbf{Q}, \lvert k\rvert \le \lvert m\rvert, the sketch \mathbf{S} = \sqrt{\lvert m\rvert/\lvert k\rvert}\,\mathbf{Q}^{\mathsf{H}}, \mathbf{A} of full column rank, \mathbf{x}_0 almost surely a minimizer of \|\mathbf{S}(\mathbf{A}\mathbf{x} - \mathbf{y})\|, 0 < \varepsilon \le 1/2, \delta > 0, at least <!-- value jlDim (4\varepsilon/5) (\delta/21^{\lvert n \rvert + 1}) --> \log(2/(\delta/21^{\lvert n \rvert + 1}))/((4\varepsilon/5)^2/4 - (4\varepsilon/5)^3/6) rows (jlDim (4 * ε / 5) (δ / 21 ^ (card n + 1))) and 16\varepsilon^{2q+1} \le \tau, \mathbb{P}\Bigl[(1 + \tau)\|(\mathbf{I} - \mathbf{P}_{\mathbf{A}})\mathbf{y}\|^2 < \|\mathbf{y} - \mathbf{A}\,\mathsf{sketchAndPrecondition}(\mathbf{A}, \mathbf{S}, \mathbf{y}, \mathbf{x}_0, q)\|^2\Bigr] \le \delta\,. Squared residuals; \varepsilon is the squared-norm distortion of the embedding of \operatorname{range}[\mathbf{A}\ \mathbf{y}], of dimension at most \lvert n\rvert + 1. [MartinssonTropp2020, §10.5], there unsquared, after j \sim \log(1/\varepsilon) steps and with no constants. Asymptotic form: exists_forall_measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_haarFrame.

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_haarFrame.{u_1, u_2,
    u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {k : Type u_2} {m : Type u_3}
  {n : Type u_4} [Fintype k] [Fintype m] [Fintype n] [DecidableEq k] [DecidableEq m]
  {Q : Ω → Matrix m k ℝ} [DecidableEq n] (hQ : HasLaw Q (haarFrame m k) μ)
  (hkm : Fintype.card k ≤ Fintype.card m) {A : Matrix m n ℝ} (hA : Function.Injective A.mulVec)
  (y : m → ℝ) {x₀ : Ω → n → ℝ}
  (hx₀ :
    ∀ᵐ (ω : Ω) ∂μ,
      IsLeastSquaresSolution (√(↑(Fintype.card m) / ↑(Fintype.card k)) • (Q ω)ᴴ * A)
        (√(↑(Fintype.card m) / ↑(Fintype.card k)) • (Q ω)ᴴ *ᵥ y) (x₀ ω))
  {ε δ τ : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1 / 2) (hδ : 0 < δ)
  (hk : jlDim (4 * ε / 5) (δ / 21 ^ (Fintype.card n + 1)) ≤ ↑(Fintype.card k)) {q : ℕ}
  (hq : 16 * ε ^ (2 * q + 1) ≤ τ) :
  μ.real
      {ω |
        (1 + τ) * ‖WithLp.toLp 2 ((1 - rangeProjector A) *ᵥ y)‖ ^ 2 <
          ‖WithLp.toLp 2
                (y -
                  A *ᵥ
                    sketchAndPrecondition A (√(↑(Fintype.card m) / ↑(Fintype.card k)) • (Q ω)ᴴ) y
                      (x₀ ω) q)‖ ^
            2} ≤
    δ

Full source on GitHub

Copy link

Theorem (measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_srht). SRHT sketch-and-precondition: for a bounded orthonormal transform \mathbf{F} \in \Bbbk^{m \times m} with coherence \beta, an SRHT \mathbf{S} built from it (independent random signs and an independent uniform choice of \lvert k\rvert distinct rows), \mathbf{A} of full column rank, \mathbf{x}_0 almost surely a minimizer of \|\mathbf{S}(\mathbf{A}\mathbf{x} - \mathbf{y})\|, 0 < \varepsilon \le 1/2, \delta > 0 and at least <!-- value samplingEmbeddingDim {(\lvert n \rvert + 1)} L \varepsilon (\delta/2) --> 3 L \log(2(\lvert n \rvert + 1)/(\delta/2))/\varepsilon^2 rows (NLAlib.samplingEmbeddingDim (card n + 1) L ε (δ / 2)) for the flattened coherence <!-- value srhtRowBound {\lvert m \rvert} {(\lvert n \rvert + 1)} (\delta/2) --> L = \beta\bigl((\lvert n \rvert + 1) + 2\sqrt{(\lvert n \rvert + 1) \log(\lvert m \rvert/(\delta/2))} + 2 \log(\lvert m \rvert/(\delta/2))\bigr), \beta times NLAlib.srhtRowBound (card m) (card n + 1) (δ / 2), and 16\varepsilon^{2q+1} \le \tau, \mathbb{P}\Bigl[(1 + \tau)\|(\mathbf{I} - \mathbf{P}_{\mathbf{A}})\mathbf{y}\|^2 < \|\mathbf{y} - \mathbf{A}\,\mathsf{sketchAndPrecondition}(\mathbf{A}, \mathbf{S}, \mathbf{y}, \mathbf{x}_0, q)\|^2\Bigr] \le \delta\,. Squared residuals, and \varepsilon is the squared-norm distortion of the embedding of \operatorname{range}[\mathbf{A}\ \mathbf{y}]. [MartinssonTropp2020, §10.5], there unsquared, after j \sim \log(1/\varepsilon) steps and with no constants. Asymptotic form: NLAlib.exists_forall_measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_srht.

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_hasLaw_srht.{u_1, u_2, u_3,
    u_4, u_5}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {𝕜 : Type u_2} [RCLike 𝕜] {k : Type u_3}
  {m : Type u_4} {n : Type u_5} [Fintype k] [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n]
  {S : Ω → Matrix k m 𝕜} {F : Matrix m m 𝕜} {β : ℝ} (hF : IsBoundedOrthonormal F β)
  (hS : HasLaw S (srht k F) μ) {A : Matrix m n 𝕜} (hA : Function.Injective A.mulVec) (y : m → 𝕜)
  {x₀ : Ω → n → 𝕜} (hx₀ : ∀ᵐ (ω : Ω) ∂μ, IsLeastSquaresSolution (S ω * A) (S ω *ᵥ y) (x₀ ω))
  {ε δ τ : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1 / 2) (hδ : 0 < δ)
  (hk :
    samplingEmbeddingDim (Fintype.card n + 1)
        (β * srhtRowBound (Fintype.card m) (Fintype.card n + 1) (δ / 2)) ε (δ / 2) ≤
      ↑(Fintype.card k))
  {q : ℕ} (hq : 16 * ε ^ (2 * q + 1) ≤ τ) :
  μ.real
      {ω |
        (1 + τ) * ‖WithLp.toLp 2 ((1 - rangeProjector A) *ᵥ y)‖ ^ 2 <
          ‖WithLp.toLp 2 (y - A *ᵥ sketchAndPrecondition A (S ω) y (x₀ ω) q)‖ ^ 2} ≤
    δ

Full source on GitHub

Copy link

Theorem (measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_isSubgaussianVector). Sub-Gaussian sketch-and-precondition: for a random \mathbf{X} \in \mathbb{R}^{k \times m} with independent rows, each isotropic and sub-Gaussian with proxy c, the sketch \mathbf{S} = \lvert k\rvert^{-1/2}\mathbf{X}, \mathbf{A} of full column rank, \mathbf{x}_0 almost surely a minimizer of \|\mathbf{S}(\mathbf{A}\mathbf{x} - \mathbf{y})\|, 0 < \varepsilon \le 1/2, \varepsilon \le 5c/4, \delta > 0, at least <!-- value subgaussianEmbeddingDim c {(\lvert n \rvert + 1)} \varepsilon \delta --> 25 c^2 ((\lvert n \rvert + 1) \log 21 + \log(2/\delta))/(16C \varepsilon^2) rows (subgaussianEmbeddingDim c (card n + 1) ε δ, with <!-- value subgaussianJLConstant -->C = 1/36 the constant subgaussianJLConstant) and 16\varepsilon^{2q+1} \le \tau, \mathbb{P}\Bigl[(1 + \tau)\|(\mathbf{I} - \mathbf{P}_{\mathbf{A}})\mathbf{y}\|^2 < \|\mathbf{y} - \mathbf{A}\,\mathsf{sketchAndPrecondition}(\mathbf{A}, \mathbf{S}, \mathbf{y}, \mathbf{x}_0, q)\|^2\Bigr] \le \delta\,. Squared residuals, and \varepsilon is the squared-norm distortion of the embedding of \operatorname{range}[\mathbf{A}\ \mathbf{y}]. [MartinssonTropp2020, §10.5], there unsquared, after j \sim \log(1/\varepsilon) steps and with no constants. Asymptotic form: NLAlib.exists_forall_measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_isSubgaussianVector.

General form: sizes are index types

Lean statement and details
NLAlib.measureReal_norm_sub_mulVec_sketchAndPrecondition_sq_gt_le_of_isSubgaussianVector.{u_1, u_2,
    u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {k : Type u_2} {m : Type u_3}
  {n : Type u_4} [Fintype k] [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n]
  {X : Ω → Matrix k m ℝ} {c : ℝ≥0} (hind : iIndepFun (fun i ω ↦ X ω i) μ)
  (hsub : ∀ (i : k), IsSubgaussianVector (fun ω ↦ X ω i) c μ)
  (hiso : ∀ (i : k), IsIsotropic (fun ω ↦ X ω i) μ) {A : Matrix m n ℝ}
  (hA : Function.Injective A.mulVec) (y : m → ℝ) {x₀ : Ω → n → ℝ}
  (hx₀ :
    ∀ᵐ (ω : Ω) ∂μ,
      IsLeastSquaresSolution ((√↑(Fintype.card k))⁻¹ • X ω * A) ((√↑(Fintype.card k))⁻¹ • X ω *ᵥ y)
        (x₀ ω))
  {ε δ τ : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1 / 2) (hεc : ε ≤ 5 / 4 * ↑c) (hδ : 0 < δ)
  (hk : subgaussianEmbeddingDim (↑c) (Fintype.card n + 1) ε δ ≤ ↑(Fintype.card k)) {q : ℕ}
  (hq : 16 * ε ^ (2 * q + 1) ≤ τ) :
  μ.real
      {ω |
        (1 + τ) * ‖WithLp.toLp 2 ((1 - rangeProjector A) *ᵥ y)‖ ^ 2 <
          ‖WithLp.toLp 2
                (y - A *ᵥ sketchAndPrecondition A ((√↑(Fintype.card k))⁻¹ • X ω) y (x₀ ω) q)‖ ^
            2} ≤
    δ

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.