NLA-lib Explorer

Nyström approximation

Approximate a positive-semidefinite matrix using sampled or sketched columns.

Definition

Definition (Nyström approximation). For a Hermitian positive-semidefinite matrix \mathbf{A} and test matrix \mathbf\Omega, form

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

The symbol \dagger denotes the Moore–Penrose pseudoinverse, allowing a rank-deficient middle matrix. Sampling columns is a special choice of the test matrix.

Lean statement and details
NLAlib.nystrom.{u_1, u_2, u_4} {𝕜 : Type u_1} [RCLike 𝕜] {l : Type u_2} {n : Type u_4} [Fintype l]
  [Fintype n] (A : Matrix n n 𝕜) (Ω : Matrix n l 𝕜) : Matrix n n 𝕜

Full source on GitHub

Copy link

Mathematical guarantees

Theorem (Expected nuclear-norm error). For real positive-semidefinite \mathbf{A}, standard Gaussian \mathbf\Omega\in\mathbb{R}^{n\times\ell}, and k+2\le\ell,

\mathbb{E}\|\mathbf{A}-\mathsf{nystrom}(\mathbf{A},\mathbf\Omega)\|_*\le\left(1+\frac{k}{\ell-k-1}\right)\|\mathbf{A}-[\mathbf{A}]_k\|_*.

The residual is positive semidefinite, so its nuclear norm is also its trace. The bound compares the expected residual trace with the optimal rank-k tail.

Lean statement and details

General form: sizes are index types

Matrix.PosSemidef.integral_nuclearNorm_sub_nystrom_le_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_2} {l : Type u_3} [Fintype n]
  [Fintype l] {H : Matrix n n ℝ} {X : Ω → Matrix n l ℝ} (hH : H.PosSemidef)
  (hX : HasLaw X (gaussianMatrix n l) μ) {k : ℕ} (hk : k + 2 ≤ Fintype.card l) :
  ∫ (ω : Ω), nuclearNorm (H - nystrom H (X ω)) ∂μ ≤
    gaussianProjectionFactor k (Fintype.card l) * nuclearNorm (H - truncatedSVD H k)

Full source on GitHub

Copy link

Further results

Theorem (Nyström helps).

, singular-value form: for positive semidefinite \mathbf{H}, \sigma_k(\mathbf{H} - \mathsf{nystrom}(\mathbf{H}, \mathbf{\Omega})) \le \sigma_k((\mathbf{I} - \mathbf{P}_{\mathbf{\Omega}})\mathbf{H}) at every index k: the Nyström error is at most the error of projecting \mathbf{H} onto the orthogonal complement of the test space. At \mathbf{\Omega} = \mathbf{H}\mathbf{\Omega}_0 this compares Nyström from the sample \mathbf{H}\mathbf{\Omega}_0 with the randomized SVD of \mathbf{H} (NLAlib.sub_rsvd). [TroppWebber2023, Lemma 5.2]; there for unitarily invariant norms and by a block computation, here basis-free through \mathbf{H}/\mathbf{\Omega} \preceq (\mathbf{I} - \mathbf{P}_{\mathbf{\Omega}})\mathbf{H} (\mathbf{I} - \mathbf{P}_{\mathbf{\Omega}})\,.

Lean statement and details
Matrix.PosSemidef.singularValues_sub_nystrom_le.{u_1, u_2, u_3} {𝕜 : Type u_1} [RCLike 𝕜]
  {l : Type u_2} {n : Type u_3} [Fintype l] [Fintype n] [DecidableEq n] {H : Matrix n n 𝕜}
  (hH : H.PosSemidef) (Ω : Matrix n l 𝕜) (k : ℕ) :
  singularValues (H - nystrom H Ω) k ≤ singularValues ((1 - rangeProjector Ω) * H) k

Full source on GitHub

Copy link

Theorem (The structural bound of Nyström approximation).

, in every unitarily invariant norm: for positive semidefinite \mathbf{H}, \mathbf{Z} with orthonormal columns and \mathbf{Z}^{\mathsf{H}}\mathbf{\Omega} of full row rank, with \mathbf{H}_\perp = (\mathbf{I} - \mathbf{Z}\mathbf{Z}^{\mathsf{H}})\mathbf{H} (\mathbf{I} - \mathbf{Z}\mathbf{Z}^{\mathsf{H}}), \|\mathbf{H} - \mathsf{nystrom}(\mathbf{H}, \mathbf{\Omega})\|_{\Phi} \le \|\mathbf{H}_\perp\|_{\Phi} + \bigl\|((\mathbf{Z}^{\mathsf{H}}\mathbf{\Omega})^{+})^{\mathsf{H}}\,\mathbf{\Omega}^{\mathsf{H}} \mathbf{H}_\perp\mathbf{\Omega}\,(\mathbf{Z}^{\mathsf{H}}\mathbf{\Omega})^{+}\bigr\|_{\Phi}\,. No square root appears: kernel and Gram matrices apply it directly. With \mathbf{H}\mathbf{Z}\mathbf{Z}^{\mathsf{H}} = \llbracket \mathbf{H} \rrbracket_k (as NLAlib.exists_hasOrthonormalCols_mul_mul_conjTranspose_eq_truncatedSVD provides), \mathbf{H}_\perp = \mathbf{H} - \llbracket \mathbf{H} \rrbracket_k (Matrix.PosSemidef.one_sub_mul_mul_one_sub_eq_sub_truncatedSVD). Positive semidefiniteness is needed: for \mathbf{H} = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} and \mathbf{\Omega} = \mathbf{Z} = \mathbf{e}_1 the right side vanishes. [MartinssonTropp2020, Proposition 11.1, Theorem 11.4]; [TroppWebber2023, proof of Theorem 8.1 and Corollary 8.2]; [CamanoEpperlyMeyerTropp2025, proof of Corollary 2.5]; there by the same composition for the square root of \mathbf{H} in trace or Schatten norms, here every unitarily invariant norm, stated in \mathbf{H} alone.

Lean statement and details
NLAlib.SymmetricGauge.matrixNorm_sub_nystrom_le_of_hasOrthonormalCols.{u_1, u_3, u_4, u_5}
  {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_3} {l : Type u_4} {r : Type u_5} [Fintype n] [Fintype l]
  [Fintype r] {Ω : Matrix n l 𝕜} {Z : Matrix n r 𝕜} [DecidableEq r] [DecidableEq n]
  (Φ : SymmetricGauge) {H : Matrix n n 𝕜} (hH : H.PosSemidef) (hZ : HasOrthonormalCols Z)
  (hΩ : (Ωᴴ * Z).rank = Z.rank) :
  Φ.matrixNorm (H - nystrom H Ω) ≤
    Φ.matrixNorm ((1 - Z * Zᴴ) * H * (1 - Z * Zᴴ)) +
      Φ.matrixNorm ((pinv (Zᴴ * Ω))ᴴ * (Ωᴴ * ((1 - Z * Zᴴ) * H * (1 - Z * Zᴴ)) * Ω) * pinv (Zᴴ * Ω))

Full source on GitHub

Copy link

Theorem (Nyström for a matrix with two eigenvalues).

(the hard instance): for \mathbf{Y} on (s \oplus t) \times l with a left unitarily invariant law and full column rank almost surely, q = \lvert s\rvert, r = \lvert s\rvert + \lvert t\rvert, q + 2 \le \ell and a, b \ge 0, \mathbb{E}\bigl\|\mathbf{D} - \mathsf{nystrom}(\mathbf{D}, \mathbf{Y})\bigr\|_* \le \frac{r - \ell}{r - q}\Bigl(1 + \frac{q}{\ell - q - 1}\Bigr)\,b\,\lvert t\rvert,\qquad \mathbf{D} = \begin{bmatrix} a\mathbf{I} & \mathbf{0} \\ \mathbf{0} & b\mathbf{I}\end{bmatrix}, that is b(r - \ell)(1 + q/(\ell-q-1)); b\lvert t\rvert is the best rank-q trace error when a \ge b. No hypothesis \ell \le r: the full-rank hypothesis forces it (for r < \ell the statement is vacuous, not false). [EpperlyWebber2026, Lemma 6.2]; there the limit as a \to \infty (an equality) for a > b > 0, here the upper bound at every a, b \ge 0.

General form: sizes are index types

Lean statement and details
NLAlib.integral_nuclearNorm_fromBlocks_sub_nystrom_le_of_isLeftUnitarilyInvariant.{u_1, u_2, u_3,
    u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {l : Type u_2} [Fintype l] {s : Type u_3}
  {t : Type u_4} [Fintype s] [Fintype t] [DecidableEq s] [DecidableEq t]
  {ν' : Measure (Matrix (s ⊕ t) l ℝ)} [IsProbabilityMeasure ν'] [IsLeftUnitarilyInvariant ν']
  {Y : Ω → Matrix (s ⊕ t) l ℝ} (hY : HasLaw Y ν' μ)
  (hYr : ∀ᵐ (ω : Ω) ∂μ, Function.Injective (Y ω).mulVec) (hsl : Fintype.card s + 2 ≤ Fintype.card l)
  {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) :
  ∫ (ω : Ω),
      nuclearNorm
        (fromBlocks (a • 1) 0 0 (b • 1) - nystrom (fromBlocks (a • 1) 0 0 (b • 1)) (Y ω)) ∂μ ≤
    rotationInvariantFactor (Fintype.card s + Fintype.card t) (Fintype.card l) (Fintype.card s) *
      (b * ↑(Fintype.card t))

Full source on GitHub

Copy link

Theorem (Epperly and Webber's Nyström factor is sharp).

for a test matrix \mathbf{X} with a left unitarily invariant law and full column rank almost surely, q + 2 \le \ell \le r \le n and every c below the factor, c < \frac{r - \ell}{r - q}\Bigl(1 + \frac{q}{\ell - q - 1}\Bigr)\,, there is a positive semidefinite \mathbf{H} of rank r with c\,\|\mathbf{H} - \llbracket\mathbf{H}\rrbracket_q\|_* < \mathbb{E}\|\mathbf{H} - \mathsf{nystrom}(\mathbf{H}, \mathbf{X})\|_*\,. The matching upper bound is Matrix.PosSemidef.integral_nuclearNorm_sub_nystrom_le_of_isLeftUnitarilyInvariant_of_rank_le. [EpperlyWebber2026, Theorem 3.6(b)]; there for every full-rank law (with a Haar rotation of the instance), here for left unitarily invariant laws, which need none.

General form: sizes are index types

Lean statement and details
NLAlib.exists_lt_integral_nuclearNorm_sub_nystrom_of_isLeftUnitarilyInvariant.{u_1, u_3, u_4}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_3} {l : Type u_4} [Fintype n]
  [Fintype l] {X : Ω → Matrix n l ℝ} [DecidableEq n] {ν : Measure (Matrix n l ℝ)}
  [IsProbabilityMeasure ν] [IsLeftUnitarilyInvariant ν] (hX : HasLaw X ν μ)
  (hXr : ∀ᵐ (ω : Ω) ∂μ, Function.Injective (X ω).mulVec) {r q : ℕ} (hq : q + 2 ≤ Fintype.card l)
  (hlr : Fintype.card l ≤ r) (hrn : r ≤ Fintype.card n) {c : ℝ}
  (hc : c < rotationInvariantFactor r (Fintype.card l) q) :
  ∃ H,
    H.PosSemidef ∧
      H.rank = r ∧
        c * nuclearNorm (H - truncatedSVD H q) < ∫ (ω : Ω), nuclearNorm (H - nystrom H (X ω)) ∂μ

Full source on GitHub

Copy link

Theorem (PSD Nyström: tail bounds).

for a positive semidefinite \mathbf{H} \in \mathbb{R}^{n \times n}, a test matrix \mathbf{X} \in \mathbb{R}^{n \times \ell} with independent standard Gaussian entries (HasLaw X (gaussianMatrix n l) μ), a target rank k with d = \ell - k + 1 (hd : k + d = Fintype.card l + 1), s \ge 0 and t > 0, \mathbb{P}\Bigl[\|\mathbf{H} - \mathsf{nystrom}(\mathbf{H}, \mathbf{X})\|_* > \|\mathbf{H} - \llbracket\mathbf{H}\rrbracket_k\|_* + \frac{tk}{d}\, \bigl(\|\mathbf{H} - \llbracket\mathbf{H}\rrbracket_k\|_*^{1/2} + s\,\sigma_k(\mathbf{H})^{1/2}\bigr)^2\Bigr] \le e^{-s^2/2} + \frac{2\sqrt{k}\,(d/(2t))^{d/2}}{\Gamma(d/2 + 1)}\,, the second failure term being gaussianPinvFrobTail k d t. The error is positive semidefinite, so this bounds \operatorname{tr}(\mathbf{H} - \mathsf{nystrom}(\mathbf{H}, \mathbf{X})). [TroppWebber2023, Corollary 8.2 (NysSVD1)]; there at p = 1, with the noise term (utk/d)\|\mathbf{H} - \llbracket\mathbf{H}\rrbracket_k\|_* and the failure probability e^{-(u-2)/4} + \sqrt{\pi k}\,(t/e)^{-d/2}, which follow from this bound at s = \sqrt{u} - 1.

General form: sizes are index types

Lean statement and details
Matrix.PosSemidef.measureReal_nuclearNorm_sub_nystrom_gt_le_of_hasLaw_gaussianMatrix.{u_1, u_2, u_3}
  {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {n : Type u_2} {l : Type u_3} [Fintype n]
  [Fintype l] {H : Matrix n n ℝ} {X : Ω → Matrix n l ℝ} (hH : H.PosSemidef)
  (hX : HasLaw X (gaussianMatrix n l) μ) {k d : ℕ} (hd : k + d = Fintype.card l + 1) {s t : ℝ}
  (hs : 0 ≤ s) (ht : 0 < t) :
  μ.real
      {ω |
        nuclearNorm (H - truncatedSVD H k) +
            t * ↑k / ↑d * (√(nuclearNorm (H - truncatedSVD H k)) + s * √(singularValues H k)) ^ 2 <
          nuclearNorm (H - nystrom H (X ω))} ≤
    rexp (-s ^ 2 / 2) + gaussianPinvFrobTail k d t

Full source on GitHub

Copy link

Used by other algorithms

Mathematical background

Appears under these tasks