MooreāPenrose pseudoinverses, least-squares solutions, and range conditions. The introductory exposition is incomplete; available library statements are listed below.
The block matrix \begin{bmatrix} \mathbf{A} & \mathbf{B} \\ \mathbf{B}^{\mathsf{H}} & \mathbf{C} \end{bmatrix} is positive semidefinite exactly when \mathbf{A} is, the equation \mathbf{A}\mathbf{X} = \mathbf{B} has a solution, and \mathbf{C} - \mathbf{X}^{\mathsf{H}}\mathbf{A}\mathbf{X} is positive semidefinite for one such solution (equivalently for all, Matrix.IsHermitian.conjTranspose_mul_mul_eq_of_mul_eq). [HornJohnson2013, Theorem 7.7.9]; stated there with the pseudoinverse solution \mathbf{X} = \mathbf{A}^{+}\mathbf{B} and the range condition \mathbf{A}\mathbf{A}^{+}\mathbf{B} = \mathbf{B}, here with any solution, so that no pseudoinverse is needed.
Lean statement and details
NLAlib.posSemidef_fromBlocks_iff_exists.{u_1, u_2, u_3} {š : Type u_1} [RCLike š] {m : Type u_2}
{n : Type u_3} [Fintype m] [Finite n] {A : Matrix m m š} {B : Matrix m n š} {C : Matrix n n š} :
(fromBlocks A B Bį““ C).PosSemidef ā A.PosSemidef ā§ ā X, A * X = B ā§ (C - Xį““ * A * X).PosSemidef
Theorem (Singularity and the spectral condition number).
A real or complex square matrix has infinite spectral condition number exactly when it is singular. [GolubVanLoan2013, §2.6.2].
Lean statement and details
NLAlib.spectralConditionNumber_eq_top_iff.{u_1, u_4} {š : Type u_1} [RCLike š] {n : Type u_4}
[Fintype n] [DecidableEq n] (A : Matrix n n š) : spectralConditionNumber A = ā ā ¬IsUnit A
Theorem (Reciprocal condition number and distance to singularity).
For every nonzero square matrix \mathbf{A}, \min_{\mathbf{A}+\mathbf{E}\ \mathrm{singular}} \frac{\|\mathbf{E}\|_2}{\|\mathbf{A}\|_2} = \kappa_2(\mathbf{A})^{-1}. For singular \mathbf{A} the zero perturbation attains the minimum, with 1/\infty=0. [GolubVanLoan2013, §2.6.2].
Lean statement and details
NLAlib.isLeast_specNorm_div_not_isUnit_add_of_ne_zero.{u_1, u_4} {š : Type u_1} [RCLike š]
{n : Type u_4} [Fintype n] [DecidableEq n] {A : Matrix n n š} (hA : A ā 0) :
IsLeast ((fun E ⦠specNorm E / specNorm A) '' {E | ¬IsUnit (A + E)})
(spectralConditionNumber A)ā»Ā¹.toReal
For normalized GSVD coordinates and trivial common kernel, every best data fit on the penalty kernel is the infinite-parameter endpoint. Neither matrix individually needs full column rank; empty dimensions are included. Derived here using strict convexity of the Euclidean norm; no printed source for this formulation.
Lean statement and details
NLAlib.IsGSVD.eq_gsvdPenaltyKernelSolution_of_isMinOn.{u_1, u_2, u_3, u_4} {š : Type u_1} [RCLike š]
{m : Type u_2} {n : Type u_3} {p : Type u_4} [Fintype m] [Fintype n] [Fintype p] [DecidableEq n]
{A : Matrix m n š} {L : Matrix p n š} {X : Matrix n n š} {c s : n ā ā} (h : IsGSVD A L X c s)
(hker : A.mulVecLin.ker ā L.mulVecLin.ker = ā„) (b : m ā š) {x : n ā š} (hx : L *ᵄ x = 0)
(hmin : IsMinOn (fun y ⦠āWithLp.toLp 2 (b - A *ᵄ y)ā) (āL.mulVecLin.ker) x) :
x = gsvdPenaltyKernelSolution A X c s b
\mathbf{A}^{+}\mathbf{b} is a least-squares solution. [GolubVanLoan2013, §5.5.2].
Lean statement and details
NLAlib.isLeastSquaresSolution_pinv_mulVec.{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 ā š) :
IsLeastSquaresSolution A b (pinv A *ᵄ b)
Theorem (The pseudoinverse solution has the smallest norm).
among least-squares solutions: \|\mathbf{A}^{+}\mathbf{b}\| \le \|\mathbf{x}\| for every least-squares solution \mathbf{x}. [GolubVanLoan2013, §5.5.2].
Lean statement and details
NLAlib.IsLeastSquaresSolution.norm_pinv_mulVec_le.{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) : āWithLp.toLp 2 (pinv A *ᵄ b)ā ⤠āWithLp.toLp 2 xā
Every matrix \mathbf{A}, of any shape and rank, has a MooreāPenrose pseudoinverse: some \mathbf{B} satisfies the four Penrose identities \mathbf{A}\mathbf{B}\mathbf{A} = \mathbf{A}, \quad \mathbf{B}\mathbf{A}\mathbf{B} = \mathbf{B}, \quad (\mathbf{A}\mathbf{B})^{\mathsf{H}} = \mathbf{A}\mathbf{B}, \quad (\mathbf{B}\mathbf{A})^{\mathsf{H}} = \mathbf{B}\mathbf{A}\,. [GolubVanLoan2013, §5.5.2].
Lean statement and details
NLAlib.exists_isPinv.{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, IsPinv A B
A matrix has at most one MooreāPenrose pseudoinverse: if \mathbf{B} and \mathbf{C} both satisfy the four Penrose identities for \mathbf{A}, then \mathbf{B} = \mathbf{C}. [HornJohnson2013, Problem 7.3.P7].
Lean statement and details
NLAlib.IsPinv.unique.{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 C : Matrix n m š} (hB : IsPinv A B)
(hC : IsPinv A C) : B = C
\mathbf{x} is a least-squares solution exactly when \mathbf{A}^{\mathsf{H}}\mathbf{A}\mathbf{x} = \mathbf{A}^{\mathsf{H}}\mathbf{b}. [GolubVanLoan2013, §5.3.1].
Lean statement and details
NLAlib.isLeastSquaresSolution_iff_normal_equations.{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 ā š} :
IsLeastSquaresSolution A b x ā Aį““ *ᵄ A *ᵄ x = Aį““ *ᵄ b
Theorem (The generalized Schur complement as a partial minimum).
In a positive semidefinite block matrix \begin{bmatrix} \mathbf{A} & \mathbf{B} \\ \mathbf{B}^{\mathsf{H}} & \mathbf{C} \end{bmatrix}, the real part of the quadratic form of \mathbf{C} - \mathbf{B}^{\mathsf{H}}\mathbf{A}^{+}\mathbf{B} at \mathbf{x} is the least value, over \mathbf{y}, of the real part of the quadratic form of the block matrix at the stacked vector \begin{bmatrix} \mathbf{y} \\ \mathbf{x} \end{bmatrix}. [HornJohnson2013, §7.7].
Lean statement and details
Matrix.PosSemidef.isLeast_re_quadForm_fromBlocks.{u_1, u_2, u_3} {š : Type u_1} [RCLike š]
{m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A : Matrix m m š} {B : Matrix m n š}
{C : Matrix n n š} (h : (fromBlocks A B Bį““ C).PosSemidef) (x : n ā š) :
IsLeast (Set.range fun y ⦠RCLike.re (quadForm (fromBlocks A B Bį““ C) (y āᵄ x)))
(RCLike.re (quadForm (C - Bį““ * pinv A * B) x))
for \mathbf{Q} with orthonormal columns and \operatorname{rank}(\mathbf{S}\mathbf{Q}) = \operatorname{rank}\mathbf{Q} (full column rank of \mathbf{S}\mathbf{Q}), the sketched core is the exact core plus noise, \mathsf{sketchAndSolve}(\mathbf{Q}, \mathbf{S}, \mathbf{B}) = \mathbf{Q}^{\mathsf{H}}\mathbf{B} + \mathsf{sketchAndSolve}(\mathbf{Q}, \mathbf{S}, (\mathbf{I}-\mathbf{Q}\mathbf{Q}^{\mathsf{H}})\mathbf{B})\,. [TroppYurtseverUdellCevher2017, Lemma A.4]; [CamanoEpperlyMeyerTropp2025, Lemma 2.6]; there with a complement frame.
Lean statement and details
NLAlib.HasOrthonormalCols.sketchAndSolve_eq_add.{u_1, u_3, u_5, u_6, u_7} {š : Type u_1} [RCLike š]
{m : Type u_3} [Fintype m] {k : Type u_5} {p : Type u_6} {q : Type u_7} [Fintype k]
{S : Matrix k m š} [Fintype q] [DecidableEq m] [DecidableEq q] {Q : Matrix m q š}
(hQ : HasOrthonormalCols Q) (h : (S * Q).rank = Q.rank) (B : Matrix m p š) :
sketchAndSolve Q S B = Qį““ * B + sketchAndSolve Q S ((1 - Q * Qį““) * B)
For any SVD \mathbf{A} = \mathbf{U}\operatorname{diag}(\boldsymbol{\sigma})\mathbf{V}^{\mathsf{H}} over \Bbbk and \beta > 0, the standard regularized inverse is \mathbf{V}\operatorname{diag}\!\left(\frac{\sigma_i}{\sigma_i^2 + \beta}\right) \mathbf{U}^{\mathsf{H}}. Zero singular values and arbitrary rectangular dimensions are included. [FesslerNadakuditi2024, §5.6.5, equations (5.44)ā(5.48)].
Lean statement and details
NLAlib.IsSVD.tikhonovInverse_one_eq.{u_1, u_2, u_3, u_4} {š : Type u_1} [RCLike š] {m : Type u_2}
{n : Type u_3} [Fintype m] [Fintype n] [DecidableEq n] {r : Type u_4} [Fintype r] [DecidableEq r]
{A : Matrix m n š} {U : Matrix m r š} {V : Matrix n r š} {Ļ : r ā ā} (h : IsSVD A U Ļ V) {β : ā}
(hβ : 0 < β) : tikhonovInverse A 1 β = (V * diagonal fun i ⦠ā(Ļ i / (Ļ i ^ 2 + β))) * Uį““
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.
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))
For a fixed split SVD whose retained singular values are positive, every residual minimizer in the retained right singular space equals the retained pseudoinverse solution. Empty retained spaces are included. [FesslerNadakuditi2024, §§5.6.1ā5.6.4].
Lean statement and details
NLAlib.IsSVD.eq_pinv_mulVec_of_isMinOn.{u_1, u_2, u_3, u_4, u_5} {š : Type u_1} [RCLike š]
{m : Type u_2} {n : Type u_3} {r : Type u_4} {s : Type u_5} [Fintype m] [Fintype n] [Fintype r]
[Fintype s] [DecidableEq r] [DecidableEq s] {A : Matrix m n š} {Uā : Matrix m r š}
{Uā : Matrix m s š} {Vā : Matrix n r š} {Vā : Matrix n s š} {Ļā : r ā ā} {Ļā : s ā ā}
(h : IsSVD A (Uā.fromCols Uā) (Ļā āᵄ Ļā) (Vā.fromCols Vā)) (hĻ : ā (i : r), 0 < Ļā i) (b : m ā š)
{x : n ā š} (hx : x ā Vā.mulVecLin.range)
(hmin : IsMinOn (fun y ⦠āWithLp.toLp 2 (b - A *ᵄ y)ā) (āVā.mulVecLin.range) x) :
x = pinv ((Uā * diagonal fun i ⦠ā(Ļā i)) * Vāį““) *ᵄ b