This came up in a practical problem (physics).


In the following, we work with real numbers only, and consider every vector to be normalized to 1.


To find how "similar" two vectors are (actually, two lines passing through the origin, I don't care about the direction), one can use the scalar product. If the two lines are the same, then the scalar product of the corresponding vectors is 1 or -1. If they are "similar", it's close to 1. If they're perpendicular, it's 0.


I need a generalization of this "similarity measure" to $k$-dimensional subspaces.


For example, for $k=2$ I have the following problem: I have vectors $a\_1 \perp a\_2$ which define a plane in an $n$-dimensional space, and vectors $b\_1 \perp b\_2$. I need a measure that 1. tells me how close these planes are to each other, in terms of $a\_1, a\_2, b\_1, b\_2$. is a generalization of the simple scalar product (i.e. it's the same as the scalar product for $k=1$).



Generalization of scalar product to k-dimensional subspaces (as opposed to 1-dimensional subspaces, i.e. vectors)
Let $V$ be an $n$-dimensional real vector space with an inner product $\langle \cdot,\cdot \rangle$. Then $\Lambda^k (V)$, the $k^{\text{th}}$ exterior product of $V$, inherits an induced inner product defined as follows.


If $\alpha = v\_1 \wedge \cdots \wedge v\_k$ and $\beta = w\_1 \wedge \cdots \wedge w\_k$, then $\langle \alpha , \beta \rangle = \det \langle v\_i , w\_j \rangle$ on decomposable vectors, and then extend by linearity to all of $\Lambda^k(V)$. Now a $k$-dimensional subspace $P$ of $V$ can be represented by a decomposable element $\alpha\_P = v\_1 \wedge \cdots \wedge v\_k$ of $\Lambda^k(V)$, where $v\_1, \ldots, v\_k$ is a basis for $P$. If the basis is taken to be oriented and orthonormal, then the element $\alpha\_P$ is uniquely determined. (Otherwise it is only determined up to a non-zero real scalar, so in general it defines a point in the projectivization $\mathbb P (\Lambda^k(V))$. Since this is a real inner product on a finite-dimensional vector space, it does indeed give you a measure of "how far" two vectors are from being parallel, or in this case, how far two $k$-dimensional subspaces are from being the same.


If $k = 2$ and $a\_1, a\_2$ and $b\_1, b\_2$ are two oriented orthonormal bases for two planes $P\_a$ and $P\_b$ in $V$, then


$$ \langle P\_a, P\_b \rangle = \det{\langle a\_i, b\_j \rangle} = \langle a\_1, b\_1 \rangle \langle a\_2, b\_2 \rangle - \langle a\_1, b\_2 \rangle \langle a\_2, b\_1 \rangle. $$


You can search for "induced inner product on exterior algebra" or look at any book on differential forms for more details.


