Cosine-sine decomposition (source code)

= Cosine-sine decomposition
{title2=$A_1=U_1CV^T,\quad A_2=U_2SV^T,\quad C^2+S^2=I$}

If a <matrix> with <orthonormal> columns is divided into two row blocks, each having at least as many rows as there are columns, it admits simultaneous thin factorizations $A_1=U_1CV^T$, $A_2=U_2SV^T$, with <orthonormal> $U_1,U_2$, an <orthogonal matrix> $V$, and nonnegative <diagonal matrices> $C,S$ satisfying $C^2+S^2=I$. To prove this, apply the <spectral theorem> to $A_1^TA_1$; the same <orthonormal eigenbasis> diagonalizes $A_2^TA_2=I-A_1^TA_1$. Normalize the nonzero columns of $A_iV$ and complete the zero columns to <orthonormal sets>. The entries of $C,S$ can be written as cosines and sines of angles in $[0,\pi/2]$.