NLA-lib Explorer

Rounded shifted QR with the BGS III program: Schur pair

Library · Result group

Theorem (ShiftedQR.roundedShQRSchur_measureReal_not_schur_le). The rounded shifted QR algorithm computes a Schur form ([BanksGarzaVargasSrivastava2022, Theorem 6.3] with the quantifiers of Theorem 1.4, corrected, in Schur form; SmallEig by [BanksGarzaVargasSrivastava2025, Theorem 1.1 and Corollary 1.3]). Let the machine have the standard model at \boldsymbol{u} \le \boldsymbol{u}_0, index literals, exact natural literals up to n + 1, exact toNat and comparisons, a measurable interpretation reading the tape only in its windows whose draws store the tape entry, a stream s_U uniform on [0, 1] with an exact polar disk sampler on it and a stream s_G with the standard real Gaussian law; let the eigenvalue gap and the eigenvector condition of a complex Ginibre perturbation have the tails c_1, c_2 with \mathbf{b}_1, \mathbf{b}_2 > 0. Let \mathbf{H} of order n + 1 be upper Hessenberg, \mathbf{H}\mathbf{V} = \mathbf{V}\operatorname{diag}(\mathbf{d}) with \|\mathbf{V}\|_2\|\mathbf{V}^{-1}\|_2 \le B and eigenvalues separated by \Gamma > 0, \|\mathbf{H}\|_2 \le \Sigma, 0 < \delta \le \Sigma, 0 < \varphi \le 1, B \ge 1 and k the degree of (eqn:setk) at 4B. Then from a memory holding \mathbf{H}, an accumulator \mathbf{U}_0 and the words of NLAlib.ShiftedQR.shqrSchurParams, under a random tape with the stream laws, \mathbb{P}\bigl[\mathsf{roundedShQRSchur}(\mathbf{H}) \text{ fails, or writes outside the matrix, the accumulator and the failure word, or stores no } (\widehat{\mathbf{U}}, \widehat{\mathbf{T}}),\ \widehat{\mathbf{T}} \text{ upper triangular},\ \widehat{\mathbf{T}} = \mathbf{W}^{\mathsf{H}}(\mathbf{H} + \mathbf{E})\mathbf{W},\ \|\mathbf{E}\|_2 \le \delta,\ \|\widehat{\mathbf{U}} - \mathbf{U}_0\mathbf{W}\|_2 \le ((1 + 24\boldsymbol{u})^R - 1)\|\mathbf{U}_0\|_2\bigr] \le \varphi\,, for an exact unitary \mathbf{W}. Here \boldsymbol{u}_0 is NLAlib.ShiftedQR.uShQRSchur and R is NLAlib.ShiftedQR.shqrSmallEigRotations. [BanksGarzaVargasSrivastava2022, Theorem 6.3]; there only the eigenvalues are computed, with an oracle.

Headline Standard rounding Random tape

Notes

The contract form is NLAlib.ShiftedQR.roundedShQRSchur_randomSchurCoreContract; the general form with any small-block Schur solver is NLAlib.ShiftedQR.roundedShQRSchurWith_randomSchurCoreContract.

Lean statement and details
NLAlib.ShiftedQR.roundedShQRSchur_measureReal_not_schur_le {O Q : Type} [Ops.Has Ops.ScalarOp O]
  [Ops.Has Ops.IndexOp O] [Ops.Has ShiftedQR.DiskSampleOp O] [Ops.Has Ops.SampleOp O]
  [Ops.Has Ops.CmpTst Q] [Ops.Has Ops.IdxTst Q] {Mch : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ} {u : ℝ}
  {n : ℕ} (hS : Ops.IsScalar Mch I) (hM : Ops.StdModel u id Mch) (hL : Ops.IsIndexLit Mch I)
  (hNat : Ops.IsExactNatLit id Mch (n + 1)) (hQ : Ops.IsToNat id I) (hC : Ops.IsCmp id I)
  (hI : I.IsMeasurable) {win : O → List ℕ → ℕ} (hloc : ∀ (o : O), I.TapeLocal o (win o))
  (hSmp : Ops.IsSample I) {law : ℕ → Measure ℝ} {sU sG : ℕ}
  (hDisk : ShiftedQR.IsPolarDiskSampler sU I) (hU : law sU = ℙ.restrict (Set.Icc 0 1))
  (hG : law sG = gaussianReal 0 1) {c₁ c₂ : PolyLogTail} (hA : c₁.BoundsGinibreGap)
  (hB : c₂.BoundsGinibreCondition) (hb₁ : 0 < c₁.b) (hb₂ : 0 < c₂.b)
  {H V : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {d : Fin (n + 1) → ℂ} {k : ℕ} {B Γ S δ φ : ℝ}
  (hHess : IsUpperHessenberg H) (hV : IsUnit V) (hHV : H * V = V * diagonal d)
  (hκ : pseudoConditionNumber V ≤ B) (hB1 : 1 ≤ B) (hΓ : 0 < Γ)
  (hgap : ∀ (i j : Fin (n + 1)), i ≠ j → Γ ≤ ‖d i - d j‖) (hHS : specNorm H ≤ S) (hδ : 0 < δ)
  (hδS : δ ≤ S) (hφ : 0 < φ) (hφ1 : φ ≤ 1) (hk : k = ShiftedQR.shqrDegree (4 * B))
  (hu : u ≤ ShiftedQR.uShQRSchur n k B Γ S δ φ c₁ c₂) {a p uo f : ℕ × ℕ} {μ : Ops.Mem ℝ}
  {U₀ : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ}
  (hin : ShiftedQR.ShQRSchurInput k B Γ S δ φ c₁ c₂ a p uo f U₀ H μ) {Ω : Type} [MeasurableSpace Ω]
  {P : Measure Ω} {ξ : Ω → Ops.Tape ℝ} (hξ : Ops.IsTapeLaw law P ξ) :
  P.real
      {ω' |
        ¬Ops.Writes Ops.Mode.total I (ξ ω') (ShiftedQR.roundedShQRSchur sG)
            (Ops.Env.frame
              [n + 1, (ShiftedQR.shqrSchurParams n k B Γ S δ φ c₁ c₂).length, k,
                ShiftedQR.shqrCap n B Γ S δ, ShiftedQR.shqrSmallEigCap n k B Γ S δ φ c₁ c₂]
              [a, p, uo, a, uo, f])
            (ShiftedQR.shqrFp n a uo f)
            (fun μ' ↦
              μ'.store.get f.1 f.2 = some 0 ∧
                ∃ U' Tm,
                  Schur.HoldsSchurPair a uo U' Tm μ'.store ∧
                    Tm.IsUpperTriangular ∧
                      IsTrackedUnitarySimilar
                        ((1 + 24 * u) ^ ShiftedQR.shqrSmallEigRotations n k B Γ S δ φ c₁ c₂ - 1) δ
                        U₀ H U' Tm)
            μ} ≤
    φ

Full source on GitHub

Copy link

Other forms

Theorem (ShiftedQR.roundedShQRSchur_randomSchurCoreContract). The rounded shifted QR algorithm with the small-eigenvalue program is a Schur core ([BanksGarzaVargasSrivastava2022, Theorem 6.3] with [BanksGarzaVargasSrivastava2025, Theorem 1.1], in Schur form). Let the machine have the standard model at \boldsymbol{u}, index literals, exact natural literals up to n + 1, exact toNat and comparisons, a measurable interpretation reading the tape only in its windows whose draws store the tape entry, a stream s_U uniform on [0, 1] with an exact polar disk sampler on it and a stream s_G with the standard real Gaussian law; let the eigenvalue gap and the eigenvector condition of a complex Ginibre perturbation have the tails c_1, c_2 with \mathbf{b}_1, \mathbf{b}_2 > 0. Let B \ge 1, \Gamma > 0, 0 < \delta \le \Sigma, 0 < \varphi \le 1, k the degree of (eqn:setk) at 4B and \boldsymbol{u} \le \boldsymbol{u}_0. Then roundedShQRSchur with the words shqrSchurParams, the iteration cap F and the leaf cap T meets the Schur core contract on the orders at most n + 1, the class (B, \Gamma) and norms at most \Sigma: except with probability \varphi the flag is 0, the stored matrix upper triangular and the pair tracked from the input pair with the backward error \delta and the relative accumulator error (1 + 24\boldsymbol{u})^R - 1. Here \boldsymbol{u}_0 is NLAlib.ShiftedQR.uShQRSchur, F is NLAlib.ShiftedQR.shqrCap, T is NLAlib.ShiftedQR.shqrSmallEigCap and R is NLAlib.ShiftedQR.shqrSmallEigRotations. [BanksGarzaVargasSrivastava2022, Theorem 6.3]; there only the eigenvalues are computed, with an oracle.

Standard rounding

Notes

General form, any small-block Schur solver: NLAlib.ShiftedQR.roundedShQRSchurWith_randomSchurCoreContract, with the leaf contract of NLAlib.SmallEig.smallEigProg_randomSchurLeafContract.

Lean statement and details
NLAlib.ShiftedQR.roundedShQRSchur_randomSchurCoreContract {O Q : Type} [Ops.Has Ops.ScalarOp O]
  [Ops.Has Ops.IndexOp O] [Ops.Has ShiftedQR.DiskSampleOp O] [Ops.Has Ops.SampleOp O]
  [Ops.Has Ops.CmpTst Q] [Ops.Has Ops.IdxTst Q] {Mch : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ} {u : ℝ}
  {n : ℕ} (hS : Ops.IsScalar Mch I) (hM : Ops.StdModel u id Mch) (hL : Ops.IsIndexLit Mch I)
  (hNat : Ops.IsExactNatLit id Mch (n + 1)) (hQ : Ops.IsToNat id I) (hC : Ops.IsCmp id I)
  (hI : I.IsMeasurable) {win : O → List ℕ → ℕ} (hloc : ∀ (o : O), I.TapeLocal o (win o))
  (hSmp : Ops.IsSample I) {law : ℕ → Measure ℝ} {sU sG : ℕ}
  (hDisk : ShiftedQR.IsPolarDiskSampler sU I) (hU : law sU = ℙ.restrict (Set.Icc 0 1))
  (hG : law sG = gaussianReal 0 1) {c₁ c₂ : PolyLogTail} (hA : c₁.BoundsGinibreGap)
  (hB : c₂.BoundsGinibreCondition) (hb₁ : 0 < c₁.b) (hb₂ : 0 < c₂.b) {k : ℕ} {B Γ S δ φ : ℝ}
  (hB1 : 1 ≤ B) (hΓ : 0 < Γ) (hδ : 0 < δ) (hδS : δ ≤ S) (hφ : 0 < φ) (hφ1 : φ ≤ 1)
  (hk : k = ShiftedQR.shqrDegree (4 * B)) (hu : u ≤ ShiftedQR.uShQRSchur n k B Γ S δ φ c₁ c₂) :
  Schur.RandomSchurCoreContract law
    ((1 + 24 * u) ^ ShiftedQR.shqrSmallEigRotations n k B Γ S δ φ c₁ c₂ - 1) δ φ
    (fun {n} H ↦ IsConditionedDiagonalizable B Γ H) k (ShiftedQR.shqrCap n B Γ S δ)
    (ShiftedQR.shqrSmallEigCap n k B Γ S δ φ c₁ c₂) (n + 1) S
    (ShiftedQR.shqrSchurParams n k B Γ S δ φ c₁ c₂) (ShiftedQR.roundedShQRSchur sG) I

Full source on GitHub

Copy link