NLA-lib Explorer

Randomized subspace extraction (deflation)

The deflation component used by spectral bisection extracts a basis from a sampled matrix image. It is distinct from locking already converged eigenvectors in an iterative eigensolver.

Implementation guides

Definition

Definition (Randomized subspace extraction). For a square input \mathbf{P}, draw a complex sample matrix \mathbf{G}, form \mathbf{Y}=\mathbf{P}\mathbf{G}, compute a full QR factorization, and retain the requested number of columns of its orthonormal factor. Accuracy as a subspace basis requires assumptions on the matrix, sampling, and arithmetic.

Copy link

Results

Theorem (Randomized deflation).

(Theorem 3.3): under the arithmetic contract NLAlib.FloatMachine.IsArithAccurate u \tau \Omega with product constant \mu_{\mathrm{MM}}, with the QR routine meeting NLAlib.IsQRErr with constant \mu_{\mathrm{QR}} and the normal sampler meeting NLAlib.IsNormalSampler with constant c_{\mathrm N} (at u, \tau, \Omega, through the decoding), let r \le n, \mathbf{U}, \mathbf{V} \in \mathbb{C}^{n \times r} have orthonormal columns, \mathbf{S} be invertible, \mathbf{A} = \mathbf{U}\mathbf{S}\mathbf{V}^{\mathsf{H}} and the stored \widetilde{\mathbf{A}} decode within \beta \le 1 of \mathbf{A}, and let \mathbf{G} be a standard complex Gaussian n \times n matrix. For t \ge 0 and x > 0 put \bar m = (\|\mathbf{S}\|_2 + 2)\|\mathbf{S}^{-1}\|_2\,\frac{\sqrt2\,(2\sqrt n + t)}{x} \,. If \bar m\beta \le 1/5, (4\mu_{\mathrm{QR}}(n) + 4\sqrt n\,c_{\mathrm N} + 2\mu_{\mathrm{MM}}(n))u \le \beta, \tau \le \|\mathbf{S}\|_2 x, \sqrt n\,\tau \le x and 2(\|\mathbf{S}\|_2 + 1)\sqrt2(2\sqrt n + t) \le \Omega, then \mathbb{P}\bigl[\text{no unitary } \mathbf{W} \text{ has } \|\mathbf{U}\mathbf{W} - \mathsf{deflate}(\widetilde{\mathbf{A}}, r)\|_2 \le 6\bar m\beta\bigr] \le 2e^{-t^2/2} + r^2x^2 \,, \mathsf{deflate} the algorithm NLAlib.deflate with sample \mathbf{G}. [Shah2024, Theorem 3.3], there with (2\sqrt2 + t)\sqrt n, failure 2e^{-nt^2} + (r/2)x^2 and the requirement on \beta written out; the constants differ through Lemmas 3.1 and 3.2.

Lean statement and details
NLAlib.FloatMachine.IsArithAccurate.measureReal_not_exists_specNorm_mul_sub_deflate_le_le_of_hasLaw_complexGaussianMatrix.{u_1,
    u_2}
  {F : Type u_1} {M : FloatMachine F ℝ ℂ} {dec : F → ℝ} {u τ Ω cN β t x : ℝ} {μM μQ : ℕ → ℝ}
  (hM : M.IsArithAccurate dec u τ Ω μM)
  (hqr : IsQRErr (decodeComplex dec) u τ Ω μQ fun {m n} ↦ M.qr)
  (hnormal : IsNormalSampler (decodeComplex dec) u cN τ Ω M.normal) {n r : ℕ} (hr : r ≤ n)
  {U V : Matrix (Fin n) (Fin r) ℂ} (hU : HasOrthonormalCols U) (hV : HasOrthonormalCols V)
  {S : Matrix (Fin r) (Fin r) ℂ} (hS : IsUnit S) {A : Matrix (Fin n) (Fin n) ℂ}
  {A' : Matrix (Fin n) (Fin n) (F × F)} (hA : A = U * S * Vᴴ)
  (hβ : specNorm (A - decodeMatrix dec A') ≤ β) (hβ₁ : β ≤ 1) (ht : 0 ≤ t) (hx : 0 < x)
  (hmβ : (specNorm S + 2) * specNorm S⁻¹ * (√2 * (2 * √↑n + t)) / x * β ≤ 1 / 5)
  (hu : (4 * μQ n + 4 * √↑n * cN + 2 * μM n) * u ≤ β) (hτ : τ ≤ specNorm S * x) (hτN : τ * √↑n ≤ x)
  (hΩ : 2 * (specNorm S + 1) * (√2 * (2 * √↑n + t)) ≤ Ω) {Ω' : Type u_2} {mΩ' : MeasurableSpace Ω'}
  {μ : Measure Ω'} {G : Ω' → Matrix (Fin n) (Fin n) ℂ}
  (hG : HasLaw G (complexGaussianMatrix (Fin n) (Fin n)) μ) :
  μ.real
      {ω |
        ¬∃ W,
            HasOrthonormalCols W ∧
              specNorm (U * W - decodeMatrix dec (deflate M r A' (G ω))) ≤
                6 * ((specNorm S + 2) * specNorm S⁻¹ * (√2 * (2 * √↑n + t)) / x) * β} ≤
    2 * rexp (-t ^ 2 / 2) + ↑r ^ 2 * x ^ 2

Full source on GitHub

Copy link

Theorem (Deterministic accuracy of randomized deflation).

(Theorem 3.3, deterministic half): under the arithmetic contract NLAlib.FloatMachine.IsArithAccurate u \tau \Omega with product constant \mu_{\mathrm{MM}}, with the QR routine meeting NLAlib.IsQRErr with constant \mu_{\mathrm{QR}} and the normal sampler meeting NLAlib.IsNormalSampler with constant c_{\mathrm N} (at u, \tau, \Omega, through the decoding), let \mu_{\mathrm{MM}}(n) \ge 0, u \ge 0, r \le n, \mathbf{U}, \mathbf{V} \in \mathbb{C}^{n \times r} have orthonormal columns, \mathbf{S} \in \mathbb{C}^{r \times r} be invertible, \mathbf{A} = \mathbf{U}\mathbf{S}\mathbf{V}^{\mathsf{H}}, \widetilde{\mathbf{A}} stored with \|\mathbf{A} - \bar{\widetilde{\mathbf{A}}}\|_2 \le \beta, and \mathbf{G} have \mathbf{V}^{\mathsf{H}}\mathbf{G}_1 invertible, \mathbf{G}_1 its first r columns. With m = (\|\mathbf{S}\|_2 + \beta + 1)\|\mathbf{S}^{-1}\|_2\|\mathbf{G}\|_2 \|(\mathbf{V}^{\mathsf{H}}\mathbf{G}_1)^{-1}\|_2, if m\beta \le 1/5, (4\mu_{\mathrm{QR}}(n) + 4\sqrt n\,c_{\mathrm N} + 2\mu_{\mathrm{MM}}(n))u \le \beta, \tau \le \|\mathbf{S}\|_2\|\mathbf{G}\|_2, \sqrt n\,\tau \le \|\mathbf{G}\|_2 (the floor of the normal sampler, absorbed into a factor 2) and 2(\|\mathbf{S}\|_2 + \beta)\|\mathbf{G}\|_2 \le \Omega, \|\mathbf{G}\|_2 \le \Omega (so the normal sampler's contract covers every entry), then there is a unitary \mathbf{W} with \|\mathbf{U}\mathbf{W} - \mathsf{deflate}(\widetilde{\mathbf{A}}, r)\|_2 \le 6m\beta \,, \mathsf{deflate} the decoded output of NLAlib.deflate with ideal sample \mathbf{G}. [Shah2024, Theorem 3.3], there for \mathbf{S} the diagonal of singular values and with the probability folded in.

Lean statement and details
NLAlib.FloatMachine.IsArithAccurate.exists_hasOrthonormalCols_specNorm_mul_sub_deflate_le.{u_4}
  {F : Type u_4} {M : FloatMachine F ℝ ℂ} {dec : F → ℝ} {u τ Ω cN β mval : ℝ} {μM μQ : ℕ → ℝ}
  (hM : M.IsArithAccurate dec u τ Ω μM)
  (hqr : IsQRErr (decodeComplex dec) u τ Ω μQ fun {m n} ↦ M.qr)
  (hnormal : IsNormalSampler (decodeComplex dec) u cN τ Ω M.normal) {n r : ℕ} (hμM : 0 ≤ μM n)
  (hu₀ : 0 ≤ u) (hr : r ≤ n) {U V : Matrix (Fin n) (Fin r) ℂ} (hU : HasOrthonormalCols U)
  (hV : HasOrthonormalCols V) {S : Matrix (Fin r) (Fin r) ℂ} (hS : IsUnit S)
  {A G : Matrix (Fin n) (Fin n) ℂ} {A' : Matrix (Fin n) (Fin n) (F × F)} (hA : A = U * S * Vᴴ)
  (hβ : specNorm (A - decodeMatrix dec A') ≤ β) (hG : IsUnit (Vᴴ * G.submatrix id (Fin.castLE hr)))
  (hm :
    mval =
      (specNorm S + β + 1) * specNorm S⁻¹ * specNorm G *
        specNorm (Vᴴ * G.submatrix id (Fin.castLE hr))⁻¹)
  (hmβ : mval * β ≤ 1 / 5) (hu : (4 * μQ n + 4 * √↑n * cN + 2 * μM n) * u ≤ β)
  (hτ : τ ≤ specNorm S * specNorm G) (hτN : τ * √↑n ≤ specNorm G)
  (hΩ : 2 * (specNorm S + β) * specNorm G ≤ Ω) (hΩG : specNorm G ≤ Ω) :
  ∃ W, HasOrthonormalCols W ∧ specNorm (U * W - decodeMatrix dec (deflate M r A' G)) ≤ 6 * mval * β

Full source on GitHub

Copy link

Components

Used by other algorithms

Mathematical background

Appears under these tasks