NLA-lib Explorer

NLAlib.CGImplementation.guarded_next_invariants

Library · theorem

The guarded mathematical step preserves legal statuses and SPD recurrence correspondence, including exact zero-residual continuation. It does not refer to a matrix access backend.

NLAlib.CGImplementation.guarded_next_invariants {N j : ℕ} {A : Matrix (Fin N) (Fin N) ℝ}
  {b : Fin N → ℝ} {v : CGState ℝ (Fin N)} {status : ℝ}
  (hstatus : status = 0 ∨ status = 1 ∨ status = -1) (hactive : status = 0 → v.r ≠ 0)
  (hexact : A.PosDef → v = cgState A b 0 j ∧ (status = 1 ↔ v.r = 0) ∧ status ≠ -1) :
  have μ := v.p ⬝ᵥ A *ᵥ v.p;
  have next := if status = 0 then if 0 < μ then cgStep A v else v else v;
  have flag :=
    if status = 0 then if 0 < μ then if next.r ⬝ᵥ next.r = 0 then 1 else 0 else -1 else status;
  (flag = 0 ∨ flag = 1 ∨ flag = -1) ∧
    (flag = 0 → next.r ≠ 0) ∧
      (A.PosDef → next = cgState A b 0 (j + 1) ∧ (flag = 1 ↔ next.r = 0) ∧ flag ≠ -1)

Full source on GitHub

Import NLAlib.Krylov.LinearSystems.CGGuards.