Theorem (frobNorm_sub_sq_eq_sum_singularValues_sub_sq_iff).Equality in Mirsky's inequality. For real or complex rectangular matrices \mathbf{A},\mathbf{B} of the same shape, the squared Frobenius distance equals the squared distance of their descending singular value lists exactly when \operatorname{Re}\operatorname{tr}(\mathbf{A}\mathbf{B}^{\mathsf{H}}) = \sum_i \sigma_i(\mathbf{A})\sigma_i(\mathbf{B})\,. Both sums extend to the smaller matrix dimension, including zero. [HornJohnson2013, §7.4.1], the Frobenius equality case of the singular-value inequalities. This extends the real statement in the original NLAlib formal library, NLAlib.Matrix.Factorizations.ProcrustesRotations, commit 77514ce42a0e437d837797a063ac161f41022730, to RCLike matrices.
Headline (provisional)General form: sizes are index types
Lean statement and details
NLAlib.frobNorm_sub_sq_eq_sum_singularValues_sub_sq_iff.{u_1, u_2, u_3} {𝕜 : Type u_1} [RCLike 𝕜]
{m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] (A B : Matrix m n 𝕜) :
frobNorm (A - B) ^ 2 =
∑ i ∈ Finset.range (min (Fintype.card m) (Fintype.card n)),
(singularValues A i - singularValues B i) ^ 2 ↔
frobInner A B =
∑ i ∈ Finset.range (min (Fintype.card m) (Fintype.card n)),
singularValues A i * singularValues B i
Theorem (posSemidef_mul_conjTranspose_of_frobNorm_sub_sq_eq).Positive semidefinite cross-product at equality in Mirsky's inequality. For real or complex rectangular matrices \mathbf{A},\mathbf{B} of the same shape, if \|\mathbf{A}-\mathbf{B}\|_{\mathsf{F}}^2 = \sum_i (\sigma_i(\mathbf{A})-\sigma_i(\mathbf{B}))^2\,, then \mathbf{A}\mathbf{B}^{\mathsf{H}} is positive semidefinite. Applying this result to \mathbf{A}^{\mathsf{H}},\mathbf{B}^{\mathsf{H}} and taking the adjoint gives the same conclusion for \mathbf{B}^{\mathsf{H}}\mathbf{A}. The singular values are in descending order and the sum extends to the smaller dimension. [HornJohnson2013, Corollary 7.4.1.5]. This extends the real cross-product result in the original NLAlib formal library, NLAlib.Matrix.Factorizations.ProcrustesRotations, commit 77514ce42a0e437d837797a063ac161f41022730, to RCLike matrices.
General form: sizes are index types
Lean statement and details
NLAlib.posSemidef_mul_conjTranspose_of_frobNorm_sub_sq_eq.{u_1, u_2, u_3} {𝕜 : Type u_1} [RCLike 𝕜]
{m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A B : Matrix m n 𝕜}
(h :
frobNorm (A - B) ^ 2 =
∑ i ∈ Finset.range (min (Fintype.card m) (Fintype.card n)),
(singularValues A i - singularValues B i) ^ 2) :
(A * Bᴴ).PosSemidef
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.