Theorem (isGLB_totalLeastSquaresCosts).Total least squares infimum. For augmented data \mathbf{C}, the infimum of the squared Frobenius norms of feasible corrections is the least eigenvalue of its full domain Gram matrix. This allows nonattainment and repeated minimum eigenvalues. [GolubVanLoan2013, §6.3]. The statement also covers wide and empty-row data.
Headline (provisional)General form: sizes are index types
Lean statement and details
NLAlib.isGLB_totalLeastSquaresCosts.{u_1, u_2, u_3} {𝕜 : Type u_1} [RCLike 𝕜] {m : Type u_2}
{n : Type u_3} [Fintype m] [Fintype n] (C : Matrix m (n ⊕ Unit) 𝕜) :
IsGLB (totalLeastSquaresCosts C) (eigenvalue (Cᴴ * C) (Fintype.card n))
Theorem (isLeast_totalLeastSquaresCosts_of_mulVec_eq).Total least squares correction. A unit least Gram eigenvector with nonzero last coordinate gives an optimal data correction of rank at most one, \mathbf{D}=-(\mathbf{C}\mathbf{v})\mathbf{v}^{\mathsf{H}}. [GolubVanLoan2013, §6.3].
General form: sizes are index types
Lean statement and details
NLAlib.isLeast_totalLeastSquaresCosts_of_mulVec_eq.{u_1, u_2, u_3} {𝕜 : Type u_1} [RCLike 𝕜]
{m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] (C : Matrix m (n ⊕ Unit) 𝕜)
{v : n ⊕ Unit → 𝕜} (hv : ‖WithLp.toLp 2 v‖ = 1) (hl : v (Sum.inr ()) ≠ 0)
(he : (Cᴴ * C) *ᵥ v = eigenvalue (Cᴴ * C) (Fintype.card n) • v) :
IsLeast (totalLeastSquaresCosts C) (frobNorm (-vecMulVec (C *ᵥ v) (star v)) ^ 2)
Theorem (isTotalLeastSquaresSolution_iff_eq_of_lt_singularValues).Generic total least squares solution. Let \mu be the smallest eigenvalue of the Gram matrix of [\mathbf{A}\ \mathbf{b}]. If \mu is strictly smaller than the least eigenvalue of \mathbf{A}^{\mathsf{H}}\mathbf{A}, the unique solution is (\mathbf{A}^{\mathsf{H}}\mathbf{A}- \mu\mathbf{I})^{-1}\mathbf{A}^{\mathsf{H}}\mathbf{b}. [GolubVanLoan2013, §6.3].
General form: sizes are index types
Lean statement and details
NLAlib.isTotalLeastSquaresSolution_iff_eq_of_lt_singularValues.{u_1, u_2, u_3} {𝕜 : Type u_1}
[RCLike 𝕜] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] [DecidableEq n]
(A : Matrix m n 𝕜) (b : m → 𝕜) (x : n → 𝕜) {k : ℕ} (hk : k + 1 = Fintype.card n)
(hgap : singularValues (A.fromCols (replicateCol Unit b)) (Fintype.card n) < singularValues A k) :
IsTotalLeastSquaresSolution A b x ↔
x =
(Aᴴ * A - singularValues (A.fromCols (replicateCol Unit b)) (Fintype.card n) ^ 2 • 1)⁻¹ *ᵥ
Aᴴ *ᵥ b
Theorem (isTotalLeastSquaresSolution_iff_exists).Total least squares solution directions. For an augmented matrix \mathbf{C}, every optimal finite solution is the negative ratio of the leading coordinates to the last coordinate of a unit least Gram eigenvector with nonzero last coordinate: \mathbf{x}_i=-\frac{\mathbf{v}_i}{\mathbf{v}_{\mathrm{last}}}. Every such direction gives an optimal solution. [GolubVanLoan2013, §6.3].
General form: sizes are index types
Lean statement and details
NLAlib.isTotalLeastSquaresSolution_iff_exists.{u_1, u_2, u_3} {𝕜 : Type u_1} [RCLike 𝕜]
{m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] (C : Matrix m (n ⊕ Unit) 𝕜) (x : n → 𝕜) :
IsTotalLeastSquaresSolution C.toCols₁ (C.col (Sum.inr ())) x ↔
∃ v,
‖WithLp.toLp 2 v‖ = 1 ∧
v (Sum.inr ()) ≠ 0 ∧
(Cᴴ * C) *ᵥ v = eigenvalue (Cᴴ * C) (Fintype.card n) • v ∧
x = fun i ↦ -v (Sum.inl i) / v (Sum.inr ())
General form: sizes are index types. A size is carried by a finite index type: |k| is the number of elements of the index type k, and "k nonempty" means k ≥ 1.