NLA-lib Explorer

NLAlib.MGS.normalize_residual

Library · theorem

Guarded normalization returns the desired column even when its diagonal coefficient vanishes. In the nonzero branch the divisor is explicitly nonzero.

NLAlib.MGS.normalize_residual {𝕜 : Type} [RCLike 𝕜] {n : ℕ} (q : Fin n → 𝕜) (ρ : 𝕜) (hρ : 0 ≤ ρ)
  (hz : ρ = 0 → q = 0) (hu : ρ ≠ 0 → star q ⬝ᵥ q = 1) :
  (if RCLike.re (star (ρ • q) ⬝ᵥ ρ • q) = 0 then ρ • q
    else fun i ↦ (ρ • q) i / ↑√(RCLike.re (star (ρ • q) ⬝ᵥ ρ • q))) =
    q

Full source on GitHub

Import NLAlib.Matrix.Factorizations.MGS.Math.