Smallest angle between two subspaces (source code)

= Smallest angle between two subspaces
{title2=$\cos\vartheta=\|PQ\|$}

For two finite-dimensional subspaces with projections $P,Q$, define $\cos\vartheta=\sup_{\|u\|=\|v\|=1}|\langle u,v\rangle|=\|PQ\|$, with vectors drawn from the respective subspaces. The angle is zero when they intersect nontrivially. To measure separation after removing a common intersection, restrict both subspaces to its orthogonal complement. The resulting angle controls sums of <positive operators> in the <Kitaev geometrical lemma>.