Least-squares solutions #
IsLeastSquares A b x says x minimises ‖A y − b‖ over the domain of a
linear map A into a real inner product space. Mathlib provides the
subspace side (Submodule.starProjection and its minimality); this file
packages the pulled-back problem: the first-order characterisation,
existence, uniqueness of fitted values, and the solution coset.
[UPSTREAM] candidate — mathlib has the ingredients but not the packaging;
generalises from ℝ to RCLike 𝕜.
Main declarations #
IsLeastSquares A b x:xminimises‖A y − b‖.isLeastSquares_iff_inner_eq_zero: the first-order characterisation — the residual is orthogonal to the range ofA(the normal equations).exists_isLeastSquares: solutions exist whenever the range ofAadmits an orthogonal projection (in particular in finite dimension).IsLeastSquares.map_eq: fitted values are unique.IsLeastSquares.iff_map_eq: the solutions are exactly the preimages of the fitted value.
x is a least-squares solution of A y ≈ b if it minimises the
residual norm ‖A y − b‖.
Equations
- Core.IsLeastSquares A b x = ∀ (y : E), ‖A x - b‖ ≤ ‖A y - b‖
Instances For
The first-order characterisation of least squares: x is a solution iff
the residual b − A x is orthogonal to everything A can produce —
the normal equations, with no rank hypothesis.
Least-squares solutions exist whenever the range of A admits an
orthogonal projection — in particular whenever it is finite-dimensional.
Fitted values are unique: any two least-squares solutions produce the same point of the range.
The least-squares solutions are exactly the preimages of the fitted value: given one solution, another point solves iff it maps to the same place.
Under an injective design map the least-squares solution is unique.