NLA-lib Explorer

NLAlib.isLeastSquaresSolution_iff_exists

Library ยท theorem

All least-squares solutions: they are the pseudoinverse solution plus an element of the kernel of \mathbf{A}: \mathbf{x} is a least-squares solution exactly when \mathbf{x} = \mathbf{A}^{+}\mathbf{b} + (\mathbf{I} - \mathbf{A}^{+}\mathbf{A})\mathbf{z} for some \mathbf{z}.

NLAlib.isLeastSquaresSolution_iff_exists.{u_1, u_3, u_4} {๐•œ : Type u_1} [RCLike ๐•œ] {m : Type u_3}
  {n : Type u_4} [Fintype m] [Fintype n] [DecidableEq n] {A : Matrix m n ๐•œ} {b : m โ†’ ๐•œ}
  {x : n โ†’ ๐•œ} : IsLeastSquaresSolution A b x โ†” โˆƒ z, x = pinv A *แตฅ b + (1 - pinv A * A) *แตฅ z

Full source on GitHub

Import NLAlib.Matrix.Pseudoinverse.LeastSquares.