NLA-lib Explorer

NLAlib.CGS2.exact_column

Library · theorem

Exact arithmetic

Column c of the exact scheme. For the decoded basis \mathbf{Q}, block \mathbf{W}, new block \mathbf{Q}' and coefficients \mathbf{C} of the exact rounds, and the two passes \mathbf{W}_1 = \mathbf{W} - \mathbf{Q}\mathbf{Q}^{\mathsf{H}}\mathbf{W} - \mathbf{Q}'\operatorname{su}(\mathbf{Q}'^{\mathsf{H}}\mathbf{W}), \mathbf{W}_2 = \mathbf{W}_1 - \mathbf{Q}\mathbf{Q}^{\mathsf{H}}\mathbf{W}_1 - \mathbf{Q}'\operatorname{su}(\mathbf{Q}'^{\mathsf{H}}\mathbf{W}_1): column c of \mathbf{Q}' is the normalized column c of \mathbf{W}_2, the upper coefficients are those of \mathbf{Q}^{\mathsf{H}}\mathbf{W} + \mathbf{Q}^{\mathsf{H}}\mathbf{W}_1, and the lower coefficients are those of the two strictly upper triangular parts plus the diagonal of the norms of the columns of \mathbf{W}_2.

NLAlib.CGS2.exact_column {K : Type} [Inhabited K] {M : Ops.Machine K} {dec : K → ℝ} {n k b : ℕ}
  {qs ws qn wd cs : List K} (hM : Ops.ExactModel dec M) (hqs : qs.length = k * n)
  (hdone :
    CGS2.ColsDone M dec 0 0 (fun x v ↦ dec v = √(∑ i ∈ Finset.range n, dec (x i) ^ 2))
      (fun a x z ↦ dec a ≠ 0 → ∀ i < n, dec (z i) = dec (x i) / dec a) 0 n k b qs ws b qn wd cs)
  {Q : Matrix (Fin n) (Fin k) ℝ} {W Q' W₁ W₂ : Matrix (Fin n) (Fin b) ℝ}
  {C : Matrix (Fin (k + b)) (Fin b) ℝ} (hQ : Q = Ops.decodeMatrix dec n k qs)
  (hW : W = Ops.decodeMatrix dec n b ws) (hQ' : Q' = Ops.decodeMatrix dec n b qn)
  (hC : C = Ops.decodeMatrix dec (k + b) b cs)
  (hW₁ : W₁ = W - Q * (Qᴴ * W) - Q' * strictUpper (Q'ᴴ * W))
  (hW₂ : W₂ = W₁ - Q * (Qᴴ * W₁) - Q' * strictUpper (Q'ᴴ * W₁)) (c : Fin b) :
  Q'.col c = ‖WithLp.toLp 2 (W₂.col c)‖⁻¹ • W₂.col c ∧
    (∀ (i : Fin k), Ops.coefTop C i c = (Qᴴ * W) i c + (Qᴴ * W₁) i c) ∧
      ∀ (c' : Fin b),
        Ops.coefBot C c' c =
          strictUpper (Q'ᴴ * W) c' c + strictUpper (Q'ᴴ * W₁) c' c +
            diagonal (fun c ↦ ‖WithLp.toLp 2 (W₂.col c)‖) c' c

Full source on GitHub

Import NLAlib.Krylov.Orthogonalization.CGS2.ExtendExact.