NLA-lib Explorer

Generalized Nyström (GN)

Use two sketches to construct a low-rank approximation of a general matrix.

Definition

Definition (Generalized Nyström approximation). For a rectangular matrix \mathbf{A} and two test matrices \mathbf\Omega,\mathbf\Psi, define

\widehat{\mathbf{A}}=\mathsf{gn}(\mathbf{A},\mathbf\Omega,\mathbf\Psi)=\mathbf{A}\mathbf\Omega(\mathbf\Psi^{\mathsf{H}}\mathbf{A}\mathbf\Omega)^{\dagger}\mathbf\Psi^{\mathsf{H}}\mathbf{A}.

The two sketches capture column and row information. This is an oblique construction; it is generally different from orthogonally projecting onto the sampled range.

Lean statement and details
NLAlib.generalizedNystrom.{u_1, u_2, u_3, u_4, u_5} {𝕜 : Type u_1} [RCLike 𝕜] {l : Type u_2}
  {m : Type u_3} {n : Type u_4} {p : Type u_5} [Fintype l] [Fintype m] [Fintype n] [Fintype p]
  (A : Matrix m n 𝕜) (Ω : Matrix n l 𝕜) (Ψ : Matrix m p 𝕜) : Matrix m n 𝕜

Full source on GitHub

Copy link

Mathematical guarantees

Theorem (Expected Frobenius error). Let \mathbf{A}\in\mathbb{R}^{m\times n}, with independent standard Gaussian test matrices \mathbf\Omega\in\mathbb{R}^{n\times\ell} and \mathbf\Psi\in\mathbb{R}^{m\times p}. If k+2\le\ell and \ell+2\le p, then

\mathbb{E}\|\mathbf{A}-\mathsf{gn}(\mathbf{A},\mathbf\Omega,\mathbf\Psi)\|_{\mathrm{F}}^2\le\left(1+\frac{\ell}{p-\ell-1}\right)\left(1+\frac{k}{\ell-k-1}\right)\|\mathbf{A}-[\mathbf{A}]_k\|_{\mathrm{F}}^2.

The two factors measure the excess from the range sketch and the second sketch. Here [\mathbf{A}]_k denotes a best rank-at-most-k approximation.

Lean statement and details

General form: sizes are index types

NLAlib.integral_frobNorm_sub_generalizedNystrom_sq_le_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3, u_4,
    u_5}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} {p : Type u_5} [Fintype m] [Fintype n] [Fintype l] [Fintype p]
  {X : Ω → Matrix n l ℝ} {Ψ : Ω → Matrix m p ℝ} (A : Matrix m n ℝ)
  (hX : HasLaw X (gaussianMatrix n l) μ) (hΨ : HasLaw Ψ (gaussianMatrix m p) μ) (hXΨ : X ⟂ᵢ[μ] Ψ)
  {k : ℕ} (hk : k + 2 ≤ Fintype.card l) (hlp : Fintype.card l + 2 ≤ Fintype.card p) :
  ∫ (ω : Ω), frobNorm (A - generalizedNystrom A (X ω) (Ψ ω)) ^ 2 ∂μ ≤
    gaussianProjectionFactor (Fintype.card l) (Fintype.card p) *
        gaussianProjectionFactor k (Fintype.card l) *
      frobNorm (A - truncatedSVD A k) ^ 2

Full source on GitHub

Copy link

Further results

Theorem (Epperly and Webber's generalized Nyström factor is sharp, Gaussian co-range).

for a test matrix \mathbf{X} with a left unitarily invariant law and full column rank almost surely, an independent standard Gaussian \mathbf{\Psi} (m \times p), q + 2 \le \ell \le r, r \le \min(m, n), \ell + 2 \le p and every c below the factor, that is c < \Bigl(1 + \frac{\ell}{p - \ell - 1}\Bigr) \frac{r - \ell}{r - q}\Bigl(1 + \frac{q}{\ell - q - 1}\Bigr)\,, there is \mathbf{A} \in \mathbb{R}^{m \times n} of rank r with c\,\|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_q\|_{\mathsf{F}}^2 < \mathbb{E}\|\mathbf{A} - \mathsf{gn}(\mathbf{A}, \mathbf{X}, \mathbf{\Psi})\|_{\mathsf{F}}^2\,. So with a Gaussian co-range the product of the two factors cannot be lowered. Epperly and Webber's §4.2 turns this into "k' + \ell = \Theta(q/\varepsilon^2) samples"; that arithmetic over \mathbb{R} is not proved here. The matching upper bound is NLAlib.integral_frobNorm_sub_generalizedNystrom_sq_le_of_isLeftUnitarilyInvariant_of_hasLaw_gaussianMatrix_of_rank_le. [EpperlyWebber2026, Theorem 4.2(b)]; there for every full-rank pair of laws and an orthonormal co-range, here for a left unitarily invariant range law and a Gaussian co-range (\gamma = 1).

General form: sizes are index types

Lean statement and details
NLAlib.exists_lt_integral_frobNorm_sub_generalizedNystrom_sq_of_isLeftUnitarilyInvariant_of_hasLaw_gaussianMatrix.{u_1,
    u_2, u_3, u_4, u_5}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_2} {n : Type u_3}
  {l : Type u_4} {p : Type u_5} [Fintype m] [Fintype n] [Fintype l] [Fintype p]
  {X : Ω → Matrix n l ℝ} {Ψ : Ω → Matrix m p ℝ} [DecidableEq n] {ν : Measure (Matrix n l ℝ)}
  [IsProbabilityMeasure ν] [IsLeftUnitarilyInvariant ν] (hX : HasLaw X ν μ)
  (hXr : ∀ᵐ (ω : Ω) ∂μ, Function.Injective (X ω).mulVec) (hΨ : HasLaw Ψ (gaussianMatrix m p) μ)
  (hXΨ : X ⟂ᵢ[μ] Ψ) {r q : ℕ} (hq : q + 2 ≤ Fintype.card l) (hlr : Fintype.card l ≤ r)
  (hrm : r ≤ Fintype.card m) (hrn : r ≤ Fintype.card n) (hlp : Fintype.card l + 2 ≤ Fintype.card p)
  {c : ℝ}
  (hc :
    c <
      gaussianProjectionFactor (Fintype.card l) (Fintype.card p) *
        rotationInvariantFactor r (Fintype.card l) q) :
  ∃ A,
    A.rank = r ∧
      c * frobNorm (A - truncatedSVD A q) ^ 2 <
        ∫ (ω : Ω), frobNorm (A - generalizedNystrom A (X ω) (Ψ ω)) ^ 2 ∂μ

Full source on GitHub

Copy link

Theorem (Generalized Nyström to relative error).

both sides through approximate multiplication. If the real \mathbf{\Omega}^{\mathsf{H}} injects \operatorname{range}\llbracket\mathbf{A}\rrbracket_k^{\mathsf{H}} with constant a > 0 except with probability \delta and has the (\varepsilon, \delta_1, q) JL moment property, and an independent real \mathbf{\Psi}^{\mathsf{H}} is an OSI for dimension d \ge \min(\operatorname{rank}\mathbf{A}, \ell) (constant a' > 0, failure probability \delta') with the (\varepsilon', \delta_2, q') JL moment property, with \varepsilon, \varepsilon' > 0, q, q' \ge 2 and \delta_1, \delta_2 \ge 0, then \|\mathbf{A} - \mathsf{gn}(\mathbf{A}, \mathbf{\Omega}, \mathbf{\Psi})\|_{\mathsf{F}}^2 \le \Bigl(1 + \frac{d\,\varepsilon'^2}{a'^2}\Bigr)\Bigl(1 + \frac{k\varepsilon^2}{a^2}\Bigr) \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_k\|_{\mathsf{F}}^2 except with probability \delta + \delta_1 + \delta' + \delta_2. Its constant-factor neighbour is NLAlib.HasSubspaceInjection.measureReal_frobNorm_sub_generalizedNystrom_sq_gt_le. [Woodruff2014, Theorem 47, first part]; there \mathbf{R} a (1 + O(\varepsilon)) embedding of the row space of \mathbf{S}\mathbf{A} and the multiplication step implicit; here explicit.

General form: sizes are index types

Lean statement and details
NLAlib.HasJLMoment.measureReal_frobNorm_sub_generalizedNystrom_sq_gt_le.{u_1, u_3, u_4, u_5, u_6}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : Type u_3} {n : Type u_4}
  {l : Type u_5} {p : Type u_6} [Fintype m] [Fintype n] [Fintype l] [Fintype p] [DecidableEq m]
  {X : Ω → Matrix n l ℝ} {Ψ : Ω → Matrix m p ℝ} [IsProbabilityMeasure μ] {A : Matrix m n ℝ}
  {k d : ℕ} {a δ ε δ₁ q a' δ' ε' δ₂ q' : ℝ} (hJL : HasJLMoment (fun ω ↦ (X ω)ᴴ) ε δ₁ q μ)
  (h : HasSubspaceInjection (fun ω ↦ (X ω)ᴴ) (truncatedSVD A k)ᴴ a δ μ)
  (hJLΨ : HasJLMoment (fun ω ↦ (Ψ ω)ᴴ) ε' δ₂ q' μ)
  (hΨ : IsObliviousSubspaceInjection (fun ω ↦ (Ψ ω)ᴴ) d a' δ' μ)
  (hd : min A.rank (Fintype.card l) ≤ d) (hind : X ⟂ᵢ[μ] Ψ) (hX : AEMeasurable X μ)
  (hΨm : AEMeasurable Ψ μ) (ha : 0 < a) (hε : 0 < ε) (hq : 2 ≤ q) (hδ₁ : 0 ≤ δ₁) (ha' : 0 < a')
  (hε' : 0 < ε') (hq' : 2 ≤ q') (hδ₂ : 0 ≤ δ₂) :
  μ.real
      {ω |
        (1 + ↑d * ε' ^ 2 / a' ^ 2) * (1 + ↑k * ε ^ 2 / a ^ 2) *
            frobNorm (A - truncatedSVD A k) ^ 2 <
          frobNorm (A - generalizedNystrom A (X ω) (Ψ ω)) ^ 2} ≤
    δ + δ₁ + (δ' + δ₂)

Full source on GitHub

Copy link

Mathematical background

Appears under these tasks

Family