NLAlib.IsLeastSquaresSolution.norm_sub_mulVec_sq_eq_add
Library · theorem
Pythagoras for least squares. For a least-squares solution \mathbf{x} and any \mathbf{y}, \|\mathbf{b} - \mathbf{A}\mathbf{y}\|^2 = \|\mathbf{b} - \mathbf{A}\mathbf{x}\|^2 + \|\mathbf{A}(\mathbf{x} - \mathbf{y})\|^2\,. [GolubVanLoan2013, §5.3] (locator to check).
NLAlib.IsLeastSquaresSolution.norm_sub_mulVec_sq_eq_add.{u_1, u_3, u_4} {𝕜 : Type u_1} [RCLike 𝕜]
{m : Type u_3} {n : Type u_4} [Fintype m] [Fintype n] {A : Matrix m n 𝕜} {b : m → 𝕜} {x : n → 𝕜}
(h : IsLeastSquaresSolution A b x) (y : n → 𝕜) :
‖WithLp.toLp 2 (b - A *ᵥ y)‖ ^ 2 =
‖WithLp.toLp 2 (b - A *ᵥ x)‖ ^ 2 + ‖WithLp.toLp 2 (A *ᵥ (x - y))‖ ^ 2Import NLAlib.Matrix.Pseudoinverse.LeastSquares.