NLA-lib Explorer

NLAlib.cos_principalAngle

Library ยท theorem

The cosines of the principal angles are the singular values of the product of the two projectors: \cos \theta_k(\mathbf{X}, \mathbf{Y}) = \sigma_k(\mathbf{P}_{\mathbf{X}}\mathbf{P}_{\mathbf{Y}}).

NLAlib.cos_principalAngle.{u_1, u_2, u_3, u_4} {๐•œ : Type u_1} [RCLike ๐•œ] {n : Type u_2}
  {p : Type u_3} {q : Type u_4} [Fintype n] [Fintype p] [Fintype q] (X : Matrix n p ๐•œ)
  (Y : Matrix n q ๐•œ) (k : โ„•) :
  Real.cos (principalAngle X Y k) = singularValues (rangeProjector X * rangeProjector Y) k

Full source on GitHub

Import NLAlib.Matrix.Subspaces.PrincipalAngles.