---
abstract: 'We resolve a basic problem on subspace distances that often arises in applications: How can the usual Grassmann distance between equidimensional subspaces be extended to subspaces of different dimensions? We show that a natural solution is given by the distance of a point to a Schubert variety within the Grassmannian. This distance reduces to the Grassmann distance when the subspaces are equidimensional and does not depend on any embedding into a larger ambient space. Furthermore, it has a concrete expression involving principal angles, and is efficiently computable in numerically stable ways. Our results are largely independent of the Grassmann distance — if desired, it may be substituted by any other common distances between subspaces. Our approach depends on a concrete algebraic geometric view of the Grassmannian that parallels the differential geometric perspective that is well-established in applied and computational mathematics.'
address:
- 'Department of Mathematics, University of Chicago, Chicago, IL 60637.'
- 'Computational and Applied Mathematics Initiative, Department of Statistics, University of Chicago, Chicago, IL 60637.'
author:
- Ke Ye
- 'Lek-Heng Lim'
title: Schubert varieties and distances between subspaces of different dimensions
---

Introduction {#sec:motivation}
============

Biological data (e.g. gene expression levels, metabolomic profile), image data (e.g.  <span style="font-variant:small-caps;">mri</span> tractographs, movie clips), text data (e.g. blogs, tweets), etc., often come in the form of a set of feature vectors $a_1,\dots,a_m \in \mathbb{R}^d$ and can be conveniently represented by a matrix $A \in \mathbb{R}^{m \times d}$ (e.g. gene-microarray matrices of gene expression levels, frame-pixel matrices of grey scale values, term-document matrices of term frequencies-inverse document frequencies). In modern applications, it is often the case that one will encounter an exceedingly large sample size $m$ (massive) or an exceedingly large number of variables $d$ (high-dimensional) or both.

The raw data $A$ is usually less interesting and informative than the spaces it defines, e.g. its row and column spaces or its principal subspaces. Moreoever, it often happens that $A$ can be well-approximated by a subspace $\mathbf{A} \in \operatorname{Gr}(k,n)$ where $k \ll m$ and $n \ll d$. The process of getting from $A$ to $\mathbf{A}$ is well-studied, e.g. randomly sample a subset of representative landmarks or compute principal components.

Subspace-valued data appears in a wide range of applications: computer vision [@MYDF; @VidMaSas2005], bioinformatics [@HH], machine learning [@HRS; @LZ], communication [@LHS; @ZT], coding theory [@AC; @BN; @CHS; @DHST], statistical classification [@HamLee2008], and system identification [@MYDF]. In computational mathematics, subspaces arise in the form of Krylov subspaces [@LS] and their variants [@C], as subspaces of structured matrices (e.g. Toeplitz, Hankel, banded), and in recent developments such as compressive sensing (e.g. Grassmannian dictionaries [@SH], online matrix completion [@BNR]).

One of the most basic problems with subspaces is to define a notion of separation between them. The solution is well-known for subspaces of the same dimension $k$ in $\mathbb{R}^n$. These are points on the Grassmannian $\operatorname{Gr}(k,n)$, a Riemannian manifold, and the geodesic distance between them gives us an intrinsic distance. The *Grassmann distance* is independent of the choice of coordinates and can be readily related to principal angles and thus computed via the singular value decomposition (<span style="font-variant:small-caps;">svd</span>): For subspaces $\mathbf{A}, \mathbf{B} \in \operatorname{Gr}(k,n)$, form matrices $A, B \in \mathbb{R}^{n \times k}$ whose columns are their respective orthonormal bases, then $$\label{eq:grassdist}
d(\mathbf{A},\mathbf{B}) = \Bigl(\sum\nolimits_{i=1}^k \theta_i^2\Bigr)^{1/2},$$ where $\theta_i = \cos^{-1} \bigl(\sigma_i(A^\mathsf{T} B)\bigr)$ is the $i$th principal angle between $\mathbf{A}$ and $\mathbf{B}$. This is the geodesic distance on the Grassmannian viewed as a Riemannian manifold. There are many other common distances defined on Grassmannians — Asimov, Binet–Cauchy, chordal, Fubini–Study, Martin, Procrustes, projection, spectral (see Table \[tab:distances\]).

What if the subspaces are of different dimensions? In fact, if one examines the aforementioned applications, one invariably finds that the most general settings for each of them would fall under this situation. The restriction to equidimensional subspaces thus somewhat limits the utility of these applications. For example, the principal subspaces of two matrices $A$ and $B$ for a given noise level would typically be of different dimensions, since there is no reason to expect the number of singular values of $A$ above a given threshold to be the same as that of $B$.

As such one may also find many applications that involve distances between subspaces of different dimensions: numerical linear algebra [@BES; @SS], information retrieval [@ref2a; @text], facial recognition [@ref2b; @face], image classification [@ref2a; @ref2b], motion segmentation [@motion; @ref2c; @ref2d], <span style="font-variant:small-caps;">eeg</span> signal analysis [@eeg], mechanical engineering [@mech], economics [@econ], network analysis [@network], blog spam detection [@blog], and decoding colored barcodes [@bar].

These applications are all based on two existing proposals for a distance between subspaces of different dimensions: The *containment gap* [@Kato pp. 197–199] and the *symmetric directional distance* [@SWF; @WWF]. They are however somewhat ad hoc and bear little relation to the natural geometry of subspaces. Also, it is not clear what they are suppose to measure and neither restricts to the Grassmann distance when the subspaces are of the same dimension. Our main objective is to show that there is an alternative definition that does generalize the Grassmann distance but our work will also shed light on these two distances.

Main Contributions
------------------

Our main result (see Theorem \[thm1\]) can be stated in simple linear algebraic terms: Given any two subspaces in $\mathbb{R}^n$, $\mathbf{A}$ of dimension $k$ and $\mathbf{B}$ of dimension $l$, assuming $k< l$ without loss of generality, the distance from $\mathbf{A}$ to the nearest $k$-dimensional subspace contained in $\mathbf{B}$ *equals* the distance from $\mathbf{B}$ to the nearest $l$-dimensional subspace that contains $\mathbf{A}$. Their common value gives the distance between $\mathbf{A}$ and $\mathbf{B}$. Taking an algebraic geometric point-of-view:

1.  \[quote\] *The distance between subspaces of different dimensions is the distance between a point and a certain Schubert variety within the Grassmannian.*

This distance has the following properties, established in Section \[sec:main\]:

1.  readily computable via <span style="font-variant:small-caps;">svd</span>;

2.  restricts to the usual Grassmann distance for subspaces of the same dimension;

3.  independent of the choice of local coordinates;

4.  independent of the dimension of the ambient space (i.e., $n$);

5.  \[other\] may be defined in conjunction with other common distances in Table \[tab:distances\].

We will see in Section \[sec:existing\] that the two existing notions of distance between subspaces of different dimensions are special cases of .

Evidently, the word ‘distance’ in ($\ast$) is used in the sense of a distance of a point to a set. For example, if a subspace is contained in another, then the distance between them is zero, even if they are distinct subspaces. Thus the distance in ($\ast$) is not a metric[^1]. In Section \[sec:metric\], we define a metric on the set of subspaces of all dimensions using an analogue of our main result: Given any two subspaces in $\mathbb{R}^n$, $\mathbf{A}$ of dimension $k$ and $\mathbf{B}$ of dimension $l$ with $k< l$, the distance from $\mathbf{A}$ to the furthest $k$-dimensional subspace contained in $\mathbf{B}$ *equals* the distance from $\mathbf{B}$ to the furthest $l$-dimensional subspace that contains $\mathbf{A}$. Their common value gives a metric between $\mathbf{A}$ and $\mathbf{B}$. The most interesting metrics for subspaces of different dimensions can be found in Table \[tab:metrics\].

In Section \[sec:volume\], we obtain a volumetric analogue of our main result: Given two arbitrary subspaces in $\mathbb{R}^n$, $\mathbf{A}$ of dimension $k$ and $\mathbf{B}$ of dimension $l$ with $k < l$, we show that the probability a random $l$-dimensional subspace contains $\mathbf{A}$ *equals* the probability a random $k$-dimensional subspace is contained in $\mathbf{B}$.

The far-reaching work [@EAS] popularized the basic *differential geometry* of Stiefel and Grassmannian manifolds by casting the discussions concretely in terms of matrices. Subsequent works, notably [@AMSbook; @AMS; @AMSV], have further enriched this concrete matrix-based approach. A secondary objective of our article is to do the same for the basic *algebraic geometry* of Grassmannians. In particular, we introduce some of the objects in Table \[tab:objects\] to an applied and computational mathematics readership. The proofs of our main results essentially use only the <span style="font-variant:small-caps;">svd</span>. Everything else is explained within the article and accessible to anyone willing to accept a small handful of unfamiliar terminologies and facts on faith.

  -------------------------------- --------------------------------------------- ------------------------------------------------------------------------------------------------------------- -------------------
  *Grassmannian*                   $\operatorname{Gr}(k,n)$                      models $k$-dimensional subspaces in $\mathbb{R}^n$                                                            §\[sec:Grass\]
  *Infinite Grassmannian*          $\operatorname{Gr}(k,\infty)$                 models $k$-dimensional subspaces regardless of ambient space                                                  §\[sec:infty\]
  *Doubly-infinite Grassmannian*   $\operatorname{Gr}(\infty,\infty)$            models subspaces of all dimensions regardless of ambient space                                                §\[sec:dinfty\]
  *Flag variety*                   $\operatorname{Flag}(k_1,\dots,k_m,n)$        models nested sequences of subspaces in $\mathbb{R}^n$; $\operatorname{Flag}(k,n) = \operatorname{Gr}(k,n)$   §\[sec:schubert\]
  *Schubert variety*               $\Omega(\mathbf{X}_1,\dots,\mathbf{X}_m,n)$   ‘linearly constrained’ subset of $\operatorname{Gr}(k,n)$                                                     §\[sec:schubert\]
  -------------------------------- --------------------------------------------- ------------------------------------------------------------------------------------------------------------- -------------------

Grassmannian of linear subspaces {#sec:Grass}
================================

We will selectively review some basic properties of the Grassmannian. The differential geometric perspectives are drawn from [@Husemoller; @MS], the more concrete matrix-theoretic view from [@AMS; @EAS; @Wong], and the computational aspects from [@GVL].

We fix the ambient space $\mathbb{R}^n$. A *$k$-plane* is a $k$-dimensional subspace of $\mathbb{R}^n$. A *$k$-frame* is an ordered orthonormal basis of a $k$-plane, regarded as an $n \times k$ matrix whose columns $a_1,\dots, a_k$ are the orthonormal basis vectors. A *flag* is a strictly increasing sequence of nested subspaces, $\mathbf{X}_0\subset \mathbf{X}_1\subset \cdots \subset \mathbf{X}_m\subset  \mathbb{R}^n$; it is *complete* if $m=n$.

We write $\operatorname{Gr}(k,n)$ for the *Grassmannian* of $k$-planes in $\mathbb{R}^n$, $\operatorname{V}(k,n)$ for the *Stiefel manifold* of orthonormal $k$-frames, and $\operatorname{O}(n) \coloneqq \operatorname{V}(n,n)$ for the *orthogonal group* of $n \times n$ orthogonal matrices. $\operatorname{V}(k,n)$ may be regarded as a homogeneous space, $$\operatorname{V}(k,n) \cong \operatorname{O}(n)/\operatorname{O}(n-k),$$ or more concretely as the set of $n \times k$ matrices with orthonormal columns.

There is a *right action* of $\operatorname{O}(k)$ on $\operatorname{V}(k,n)$: For $Q\in \operatorname{O}(k)$ and $A \in \operatorname{V}(k,n)$, the action yields $AQ \in \operatorname{V}(k,n)$ and the resulting homogeneous space is $\operatorname{Gr}(k,n)$, i.e., $$\label{eq:homo}
\operatorname{Gr}(k,n) \cong \operatorname{V}(k,n)/\operatorname{O}(k) \cong \operatorname{O}(n)/\bigl(\operatorname{O}(n-k) \times \operatorname{O}(k)\bigr).$$ In this picture, a subspace $\mathbf{A} \in \operatorname{Gr}(k,n)$ is identified with an equivalence class comprising all its $k$-frames $\{ AQ \in \operatorname{V}(k,n): Q \in \operatorname{O}(k)\}$. Note that $\operatorname{span}(AQ) = \operatorname{span}(A)$ for all $Q \in \operatorname{O}(k)$.

There is a *left action* of $\operatorname{O}(n)$ on $\operatorname{Gr}(k,n)$: For any $Q \in \operatorname{O}(n)$ and $\mathbf{A} = \operatorname{span}(A) \in \operatorname{Gr}(k,n)$ where $A$ is a $k$-frame of $\mathbf{A}$, the action yields $$\label{eq:action}
Q \cdot \mathbf{A}\coloneqq \operatorname{span}(QA) \in \operatorname{Gr}(k,n).$$ This action is transitive as any $k$-plane can be rotated onto any other $k$-plane by some $Q \in \operatorname{O}(n)$. A $k$-plane $\mathbf{A} \in \operatorname{Gr}(k,n)$ will be denoted in boldface; the corresponding italized letter $A =[a_1,\dots,a_k] \in \operatorname{V}(k,n)$ will denote a $k$-frame of $\mathbf{A}$.

$\operatorname{Gr}(k,n)$ and $\operatorname{V}(k,n)$ are smooth manifolds of dimensions $k(n-k)$ and $nk-k(k+1)/2$ respectively. As a set of $n\times k$ matrices, $\operatorname{V}(k,n)$ is a submanifold of $\mathbb{R}^{n\times k}$ and inherits a Riemannian metric from the Euclidean metric on $\mathbb{R}^{n\times k}$, i.e., given $A=[a_1,\dots, a_k]$ and $B=[b_1,\dots, b_k]$ in $T_X \operatorname{V}(k,n)$, the tangent space at $X \in \operatorname{V}(k,n)$, the Riemannian metric $g$ is defined by $g_X(A,B)=\sum_{i=1}^k a_i^\mathsf{T} b_i= \operatorname{tr}(A^\mathsf{T}B)$. As $g$ is invariant under the action of $\operatorname{O}(k)$, it descends to a Riemannian metric on $\operatorname{Gr}(k,n)$ and in turn induces a geodesic distance on $\operatorname{Gr}(k,n)$ which we define below.

Let $\mathbf{A} \in \operatorname{Gr}(k,n)$ and $\mathbf{B} \in \operatorname{Gr}(l,n)$ respectively. Let $r \coloneqq \min (k,l)$. The $i$th *principal vectors* $(p_{i},q_{i})$, $i=1,\dots,r$, are defined recursively as solutions to the optimization problem$$\begin{tabular}
[c]{rcl}maximize &  & $p^{\mathsf{T}}q$\\
subject to 
&  & $p\in \mathbf{A},\; p^{\mathsf{T}}p_{1}=\dots=p^{\mathsf{T}}p_{i-1}=0,\;\lVert p\rVert=1,$\\
&  & $q\in \mathbf{B}, \; q^{\mathsf{T}}q_{1}=\dots=q^{\mathsf{T}}q_{i-1}=0,\;\lVert q\rVert=1,$\end{tabular}$$ for $i=1,\dots,r$. The *principal angles* are then defined by$$\cos\theta_{i}=p_{i}^\mathsf{T}q_{i}, \quad i = 1,\dots,r.$$ Clearly $0\le \theta_{1}\leq\dots\leq\theta_r \le \pi/2$. We will let $\theta_i(\mathbf{A},\mathbf{B})$ denote the $i$th principal angle between $\mathbf{A} \in \operatorname{Gr}(k,n)$ and $\mathbf{B} \in \operatorname{Gr}(l,n)$.

Principal vectors and principal angles may be readily computed using <span style="font-variant:small-caps;">qr</span> and <span style="font-variant:small-caps;">svd</span> [@BG; @GVL]. Let $A = [a_1,\dots,a_k]$ and $B =[ b_1,\dots, b_l]$ be orthonormal bases and let $$\label{eq:svd}
A^\mathsf{T} B = U\Sigma V^\mathsf{T}$$ be the full <span style="font-variant:small-caps;">svd</span> of $A^\mathsf{T} B$, i.e., $U \in \operatorname{O}(k)$, $V \in \operatorname{O}(l)$, $\Sigma = \left[\begin{smallmatrix}\Sigma_1 & 0 \\ 0 & 0 \end{smallmatrix}\right]\in \mathbb{R}^{k \times l}$ with $\Sigma_1 = \operatorname{diag}(\sigma_1,\dots,\sigma_r) \in \mathbb{R}^{r \times r}$ where $\sigma_1 \ge \dots \ge \sigma_{r} \ge 0$.

The principal angles $\theta_{1}\leq\dots\leq\theta_{r}$ are given by $$\label{eq:angles}
\theta_i = \cos^{-1} \sigma_i, \quad i = 1,\dots,r.$$ It is customary to write $A^\mathsf{T} B = U (\cos\Theta) V^\mathsf{T}$, where $\Theta = \operatorname{diag}(\theta_1,\dots,\theta_{r},1,\dots,1) \in \mathbb{R}^{k \times l}$ and $\Theta_1 = \operatorname{diag}(\theta_1,\dots,\theta_{r}) \in \mathbb{R}^{r \times r}$. Consider the column vectors, $$AU = [p_1,\dots,p_k], \quad BV = [q_1,\dots,q_l].$$ The principal vectors are given by $(p_1,q_1),\dots,(p_r, q_r)$. Strictly speaking, principal vectors come in pairs but we will also call the vectors $p_{r+1},\dots,p_k$ (if $r = l < k$) or $q_{r+1},\dots,q_l$ (if $r = k < l$) principal vectors for lack of a better term.

We will use the following fact from [@GVL Theorem 6.4.2].

\[prop:angles\] Let $r = \min (k,l)$ and $\theta_1,\dots,\theta_{r}$ and $(p_1,q_1),\dots,(p_{r}, q_{r})$ be the principal angles and principal vectors between $\mathbf{A} \in \operatorname{Gr}(k,n)$ and $\mathbf{B} \in \operatorname{Gr}(l,n)$ respectively. If $m < r$ is such that $1 = \cos \theta_1 = \dots = \cos \theta_m > \cos \theta_{m+1}$, then $$\mathbf{A} \cap \mathbf{B} = \operatorname{span} \{p_1,\dots, p_m \} =  \operatorname{span} \{q_1,\dots, q_m \}.$$

If $k = l$, the geodesic distance between $\mathbf{A}$ and $\mathbf{B}$ in $\operatorname{Gr}(k,n)$ is called the *Grassmann distance* and is given by $$\label{eq:grassdist1}
d_{\operatorname{Gr}(k,n)}(\mathbf{A},\mathbf{B})=\Bigl(\sum\nolimits_{i=1}^k \theta_i^2\Bigr)^{1/2} = \lVert\cos^{-1}\Sigma\rVert_{F}.$$ An explicit expression for the geodesic [@AMS] connecting $\mathbf{A}$ to $\mathbf{B}$ on $\operatorname{Gr}(k,n)$ that minimizes the Grassmann distance is given by $\gamma : [0,1] \to \operatorname{Gr}(k,n)$, $$\label{eq:geodesic}
\gamma(t) = \operatorname{span}( AU\cos t\Theta+ Q\sin t \Theta )$$ where $M= Q(\tan\Theta) U^{\mathsf{T}}$ is a condensed <span style="font-variant:small-caps;">svd</span> of the matrix $$M \coloneqq (I - AA^\mathsf{T})B(A^\mathsf{T} B)^{-1} \in \mathbb{R}^{n \times k}$$ and where $U \in \operatorname{O}(k)$ and $\Theta=\operatorname{diag}(\theta_1,\dots,\theta_k)\in \mathbb{R}^{k\times k}$ are as in and . Note that if $\cos\Theta=\Sigma$, then $\tan\Theta=(\Sigma^{-2}-I)^{1/2}$. Also, $\gamma(0) =\mathbf{A}$ and $\gamma(1) = \mathbf{B}$.

Aside from the Grassmann distance, there are many well-known distances between subspaces [@BN; @DD; @DHST; @EAS; @HamLee2008]. We present some of these in Table \[tab:distances\].

  -------------- --------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------
                 *Principal angles*                                                                                                                *Orthonormal bases*
  Asimov         $d^{\alpha}_{\operatorname{Gr}(k,n)}(\mathbf{A}, \mathbf{B}) =  \theta_k$                                                         $\cos^{-1} \lVert A^\mathsf{T} B \rVert_2$
  Binet–Cauchy   $d^{\beta}_{\operatorname{Gr}(k,n)}(\mathbf{A}, \mathbf{B}) = \left(1 - \prod\nolimits_{i=1}^k\cos^2\theta_i\right)^{1/2}$        $(1 - (\det A^\mathsf{T} B)^2)^{1/2}$
  Chordal        $d^{\kappa}_{\operatorname{Gr}(k,n)}(\mathbf{A}, \mathbf{B}) = \left(\sum\nolimits_{i=1}^k\sin^2\theta_i\right)^{1/2}$            $\frac{1}{\sqrt{2}} \lVert AA^\mathsf{T} - BB^\mathsf{T} \rVert_F$
  Fubini–Study   $d^{\phi}_{\operatorname{Gr}(k,n)}(\mathbf{A}, \mathbf{B}) = \cos^{-1} \left(\prod\nolimits_{i=1}^k\cos \theta_i\right)$          $\cos^{-1} \lvert \det A^\mathsf{T} B \rvert$
  Martin         $d^{\mu}_{\operatorname{Gr}(k,n)}(\mathbf{A}, \mathbf{B}) = \left( \log \prod\nolimits_{i=1}^k 1/\cos^2 \theta_i \right)^{1/2}$   $(-2 \log \det A^\mathsf{T} B)^{1/2}$
  Procrustes     $d^{\rho}_{\operatorname{Gr}(k,n)}(\mathbf{A}, \mathbf{B}) = 2\left(\sum\nolimits_{i=1}^k\sin^2(\theta_i/2)\right)^{1/2}$         $\lVert AU - BV \rVert_F$
  Projection     $d^{\pi}_{\operatorname{Gr}(k,n)}(\mathbf{A}, \mathbf{B}) = \sin \theta_k$                                                        $\lVert AA^\mathsf{T} - BB^\mathsf{T} \rVert_2$
  Spectral       $d^{\sigma}_{\operatorname{Gr}(k,n)}(\mathbf{A}, \mathbf{B}) = 2\sin (\theta_k/2)$                                                $\lVert AU - BV \rVert_2$
  -------------- --------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------

The value $\sin \theta_1$ is sometimes called the *max correlation distance* [@HamLee2008] or spectral distance [@DHST] but it is not a distance in the sense of a metric (can be zero for a pair of distinct subspaces) and thus not listed. The spectral distance $d^{\sigma}_{\operatorname{Gr}(k,n)}$ is also called chordal $2$-norm distance [@BN]. For each distance in Table \[tab:distances\] defined for equidimensional $\mathbf{A}$ and $\mathbf{B}$, Theorem \[thm:othermetrics\] provides a corresponding version for when $\dim \mathbf{A} \ne \dim \mathbf{B}$.

The fact that all these distances in Table \[tab:distances\] depend on the principal angles is not a coincidence — the result [@Wong Theorem 3] implies the following.

\[thm:wong\] Any notion of distance between $k$-dimensional subspaces in $\mathbb{R}^n$ that depends only on the relative positions of the subspaces, i.e., invariant under any rotation in $\operatorname{O}(n)$, must be a function of their principal angles. To be more specific, if a distance $d : \operatorname{Gr}(k,n) \times \operatorname{Gr}(k,n) \to [0, \infty)$ satisfies $$d(Q \cdot \mathbf{A}, Q \cdot \mathbf{B}) =d(\mathbf{A}, \mathbf{B}),$$ for all $\mathbf{A}, \mathbf{B} \in \operatorname{Gr}(k,n)$ and all $Q \in \operatorname{O}(n)$, where the action is as defined in , then $d$ must be a function of $\theta_i(\mathbf{A},\mathbf{B})$, $i=1,\dots,k$.

We will next introduce the *infinite Grassmannian* $\operatorname{Gr}(k,\infty)$ to show that these distances between subspaces are independent of the dimension of their ambient space.

The Infinite Grassmannian {#sec:infty}
=========================

One way of defining a distance between $\mathbf{A} \in \operatorname{Gr}(k,n)$ and $\mathbf{B}\in \operatorname{Gr}(l,n)$ where $k \ne l$ is to first isometrically embed $\operatorname{Gr}(k,n)$ and $\operatorname{Gr}(l,n)$ into an ambient Riemannian manifold and then define the distance between $\mathbf{A}$ and $\mathbf{B}$ as their distance in the ambient space. This approach is taken in [@CHS; @SLLM], via an isometric embedding of $\operatorname{Gr}(0,n), \operatorname{Gr}(1,n), \dots, \operatorname{Gr}(n,n )$ into a sphere of dimension $(n-1)(n+2)/2$. Such a distance suffers from two shortcomings: It is not intrinsic to the Grassmannian and it depends on both the embedding and the ambient space.

The distance that we propose in Section \[sec:main\] will depend only on the intrinsic distance of the Grassmannian and is independent of $n$, i.e., a $k$-plane $\mathbf{A}$ and an $l$-plane $\mathbf{B}$ in $\mathbb{R}^n$ will have the same distance if we regard them as subspaces in $\mathbb{R}^m$ for any $m \ge \min(k,l)$. We will first establish this for the special case $k = l$.

Consider the inclusion map $\iota_n:\mathbb{R}^n\to \mathbb{R}^{n+1}$, $\iota_n(x_1,\dots, x_n)=(x_1,\dots, x_n,0)$. It is easy to see that $\iota_n$ induces a natural inclusion of $\operatorname{Gr}(k,n)$ into $\operatorname{Gr}(k,n+1)$ which we will also denote by $\iota_n$. For any $m > n$, composition of successive natural inclusions gives the inclusion $\iota_{nm} : \operatorname{Gr}(k,n) \to \operatorname{Gr}(k,m)$, where $\iota_{nm} \coloneqq \iota_n \circ \iota_{n+1} \circ \dots \circ \iota_{m-1}$. To be more concrete, if $A \in \mathbb{R}^{n \times k}$ has orthonormal columns, then $$\label{eq:iota}
\iota_{nm} : \operatorname{Gr}(k,n) \to \operatorname{Gr}(k,m), \qquad
\operatorname{span} (A) \mapsto \operatorname{span} \left( \begin{bmatrix}A \\ 0 \end{bmatrix}  \right),$$ where the zero block matrix is $(m-n) \times k$ so that $\left[ \begin{smallmatrix}A \\ 0 \end{smallmatrix} \right] \in \mathbb{R}^{m \times k}$.

For a fixed $k$, the family of Grassmannians $\{ \operatorname{Gr}(k,n): n\in \mathbb{N}, \; n \ge k \}$ together with the inclusion maps $\iota_{nm}:\operatorname{Gr}(k,n)\to \operatorname{Gr}(k,m)$ for $m > n$ form a direct system. The *infinite Grassmannian* of $k$-planes is defined to be the direct limit of this system in the category of topological spaces and denoted by $$\operatorname{Gr}(k,\infty)\coloneqq \varinjlim\operatorname{Gr}(k,n).$$ Those unfamiliar with the notion of direct limits may simply take $$\operatorname{Gr}(k, \infty) = \bigcup\nolimits_{n=k}^\infty \operatorname{Gr}(k,n),$$ where we regard $\operatorname{Gr}(k,n) \subset \operatorname{Gr}(k,n+1)$ by identifying $\operatorname{Gr}(k,n)$ with $\iota_n\bigl(\operatorname{Gr}(k,n)\bigr)$. With this identification, we no longer need to distinguish between $\mathbf{A} \in \operatorname{Gr}(k,n)$ and its image $\iota_{n}(\mathbf{A})\in \operatorname{Gr}(k,n+1)$ and may regard $\mathbf{A} \in \operatorname{Gr}(k,m)$ for all $m > n$.

We now define a distance $d_{\operatorname{Gr}(k, \infty)}$ on $\operatorname{Gr}(k,\infty)$ that is consistent with the Grassmann distance on $\operatorname{Gr}(k,n)$ for all $n$ sufficiently large.

\[lem:infty\] The natural inclusion $\iota_n:\operatorname{Gr}(k,n)\to \operatorname{Gr}(k,n+1)$ is isometric, i.e., $$\label{eq:iso}
d_{\operatorname{Gr}(k,n)}(\mathbf{A},\mathbf{B})=d_{\operatorname{Gr}(k,n+1)}\bigl(\iota_n(\mathbf{A}),\iota_n(\mathbf{B})\bigr).$$ Repeated applications of yields $$\label{eq:iso1}
d_{\operatorname{Gr}(k,n)}(\mathbf{A},\mathbf{B})=d_{\operatorname{Gr}(k,m)}\bigl(\iota_{nm}(\mathbf{A}),\iota_{nm}(\mathbf{B})\bigr)$$ for all $m > n$ and if we identify $\operatorname{Gr}(k,n)$ with $\iota_n\bigl(\operatorname{Gr}(k,n)\bigr)$, we may rewrite as $$d_{\operatorname{Gr}(k,n)}(\mathbf{A},\mathbf{B})=d_{\operatorname{Gr}(k,m)}(\mathbf{A},\mathbf{B})$$ for all $m > n$.

If $a\in \mathbb{R}^n$, we write $\hat{a} = \left[\begin{smallmatrix}
a \\
0
\end{smallmatrix}  \right]\in \mathbb{R}^{n+1}$. Let $A = [a_1,\dots, a_k]$ and $B = [b_1,\dots,b_k]$ be any orthonormal bases of $\mathbf{A}$ and $\mathbf{B}$ respectively. By the definition of $\iota_n$, $\iota_n(\mathbf{A})$ is the subspace in $\mathbb{R}^{n+1}$ spanned by an orthonormal basis that we will denote by $\iota_n(A) \coloneqq [\hat{a}_1,\dots, \hat{a}_k] \in \mathbb{R}^{(n+1) \times k}$. Hence we have $$\iota_n(A)^\mathsf{T} \iota_n(B)
=
\begin{bmatrix}
A^\mathsf{T} B \\
0
\end{bmatrix}.$$ By the expression for Grassmann distance in , we see that must hold.

Since the inclusion of $\operatorname{Gr}(k,n)$ in $\operatorname{Gr}(k,n+1)$ is isometric, a geodesic in $\operatorname{Gr}(k,n)$ remains a geodesic in $\operatorname{Gr}(k,n+1)$. Given $\mathbf{A},\mathbf{B} \in \operatorname{Gr}(k, \infty)$, there must exist some $n$ sufficiently large so that both $\mathbf{A},\mathbf{B} \in \operatorname{Gr}(k, n)$ and in which case we define the distance between $\mathbf{A}$ and $\mathbf{B}$ in $ \operatorname{Gr}(k, \infty)$ to be $$d_{\operatorname{Gr}(k, \infty)}(\mathbf{A},\mathbf{B}) \coloneqq d_{\operatorname{Gr}(k, n)}(\mathbf{A},\mathbf{B}).$$ By Lemma \[lem:infty\], this value is independent of our choice of $n$ and is the same for all $m \ge n$. In particular, $d_{\operatorname{Gr}(k, \infty)}$ is well-defined and yields a distance on $\operatorname{Gr}(k,\infty)$. We summarize these observations below.

\[cor:infty\] The Grassmann distance between two $k$-planes in $\operatorname{Gr}(k,n)$ is the geodesic distance in $\operatorname{Gr}(k,\infty)$ and is therefore independent of $n$. Also, the expression for a distance minimizing geodesic in $\operatorname{Gr}(k,n)$ extends to $\operatorname{Gr}(k,\infty)$.

Lemma \[lem:infty\] also holds for other distances on $\operatorname{Gr}(k,n)$ in Table \[tab:distances\], allowing us to define them on $\operatorname{Gr}(k, \infty)$.

\[lem:inclusion\] For all $m > n$, the inclusion $\iota_{nm}:\operatorname{Gr}(k,n)\to \operatorname{Gr}(k,m)$ is isometric when $\operatorname{Gr}(k,n)$ and $\operatorname{Gr}(k,m)$ are both equipped with the same distance in Table \[tab:distances\], i.e., $$d^*_{\operatorname{Gr}(k,n)}(\mathbf{A},\mathbf{B})=d^*_{\operatorname{Gr}(k,m)}(\iota_{nm}(\mathbf{A}),\iota_{nm}\bigl(\mathbf{B})\bigr),$$ $* = \alpha, \beta, \kappa, \phi, \mu, \rho, \pi, \sigma$. Consequently $d^{\ast}_{\operatorname{Gr}(k,\infty)}$ is well-defined.

$d^{\ast}_{\operatorname{Gr}(k,n)}(\mathbf{A},\mathbf{B})$ and $d^{\ast}_{\operatorname{Gr}(k,n+1)}\bigl(\iota_n(\mathbf{A}),\iota_n\bigl(\mathbf{B})\bigr)$ depend only on the principal angles between $\mathbf{A}$ and $\mathbf{B}$, so the distance remains unchanged under $\iota_n$. Repeated applications to $\iota_n \circ \iota_{n+1} \circ \dots \circ \iota_{m-1} = \iota_{nm}$ yield the required isometry.

Distances between subspaces of different dimensions {#sec:main}
===================================================

We now address our main problem. The proposed notion of distance will be that of a point $x \in X$ to a set $S \subset X$ in a metric space $(X,d)$. Recall that this is defined by $d(x, S) \coloneqq \inf\{d(x,y) : y  \in S \}$. For us, $X$ is a Grassmannian, therefore compact, and so $d(x,S)$ is finite. Also, $S$ will be a closed subset and so we write $\min$ instead of $\inf$. We will introduce two possible candidates for $S$.

\[def:Omega\] Let $k,l, n \in \mathbb{N}$ be such that $k\le l \le n$. For any $\mathbf{A}\in \operatorname{Gr}(k,n)$ and $\mathbf{B}\in \operatorname{Gr}(l,n)$, we define the subsets $$\Omega_{+}(\mathbf{A})\coloneqq\bigl\{\mathbf{X}\in \operatorname{Gr}(l,n) : \mathbf{A}\subseteq \mathbf{X}\bigr\},\quad
\Omega_{-}(\mathbf{B})\coloneqq\bigl\{\mathbf{Y}\in \operatorname{Gr}(k,n) : \mathbf{Y} \subseteq \mathbf{B}\bigr\}.$$ We will call $\Omega_{+}(\mathbf{A})$ the *Schubert variety of $l$-planes containing $\mathbf{A}$* and $\Omega_{-}(\mathbf{B})$ the *Schubert variety of $k$-planes contained in $\mathbf{B}$*.

As we will see in Section \[sec:schubert\], $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$ are indeed Schubert varieties and therefore closed subsets of $\operatorname{Gr}(l,n)$ and $\operatorname{Gr}(k,n)$ respectively. Furthermore, $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$ are uniquely determined by $\mathbf{A}$ and $\mathbf{B}$ (see Proposition \[prop:Omega1\]) and may be regarded as ‘sub-Grassmannians’ of $\operatorname{Gr}(l,n)$ and $\operatorname{Gr}(k,n)$ respectively (see Proposition \[prop:OmegaGrass\]).

How could one define the distance between a subspace $\mathbf{A}$ of dimension $k$ and a subspace $\mathbf{B}$ of dimension $l$ in $\mathbb{R}^n$ when $k \ne l$? We may assume $k < l\le n$ without loss of generality. In which case a very natural solution is to define the required distance $\delta(\mathbf{A}, \mathbf{B}) $ as that between the $k$-plane $\mathbf{A}$ and the closest $k$-plane $\mathbf{Y}$ contained in $\mathbf{B}$, measured within $\operatorname{Gr}(k,n)$. In other words, we want the Grassmann distance from $\mathbf{A}$ to the closed subset $\Omega_{-}(\mathbf{B})$, $$\label{eq:minus}
\delta(\mathbf{A}, \mathbf{B}) \coloneqq d_{\operatorname{Gr}(k,n)}\bigl(\mathbf{A}, \Omega_{-}\bigl(\mathbf{B})\bigr) = \min\bigl\{ d_{\operatorname{Gr}(k,n)}(\mathbf{A},\mathbf{Y}) :  \mathbf{Y}\in \Omega_{-}(\mathbf{B})\bigr\}.$$ This has the advantage of being intrinsic — the distance $\delta(\mathbf{A}, \mathbf{B}) $ is measured in $d_{\operatorname{Gr}(k,n)}$ and is defined wholly within $\operatorname{Gr}(k,n)$ without any embedding of $\operatorname{Gr}(k,n)$ into an arbitrary ambient space. Furthermore, by the property of $d_{\operatorname{Gr}(k,n)}$ in Corollary \[cor:infty\], $\delta(\mathbf{A}, \mathbf{B}) $ does not depend on $n$ and takes the same value for any $m \ge n$. We illustrate this in Figure \[fig:sphere\]: The sphere is intended to be a depiction of $\operatorname{Gr}(1,3)$ though to be accurate antipodal points on the sphere should be identified.

(-4,0) circle\[radius=0.05\]; at (-4.08,0) [$\mathbf{A}$]{}; (0,4) arc (90:270:2cm and 4cm); (0,4) arc (90:-90:2cm and 4cm); (0,0) circle (4cm); (0,0) circle (4cm); at (3,-3) [$\operatorname{Gr}(1,3)$]{}; at (0,2.5) [$\Omega_{-}(\mathbf{B})$]{}; at (-3,-1.25) [$\gamma$]{}; (-4,0) arc (180:243:4cm and 2cm); (-1.8,-1.8) circle\[radius=0.05\]; at (-2,-1.9) [$\mathbf{X}$]{};

However, it is equally natural to define $\delta(\mathbf{A}, \mathbf{B}) $ as the distance between the $l$-plane $\mathbf{B}$ and the closest $l$-plane $\mathbf{Y}$ containing $\mathbf{A}$, measured within $\operatorname{Gr}(l,n)$. In other words, we could have instead defined it as the Grassmann distance from $\mathbf{B}$ to the closed subset $\Omega_{+}(\mathbf{A})$, $$\label{eq:plus}
\delta(\mathbf{A}, \mathbf{B}) \coloneqq d_{\operatorname{Gr}(l,n)}\bigl(\mathbf{B}, \Omega_{+}\bigl(\mathbf{A})\bigr) 
= \min\bigl\{ d_{\operatorname{Gr}(l,n)}(\mathbf{B},\mathbf{X}) :  \mathbf{X}\in \Omega_{+}(\mathbf{A})\bigr\}.$$ It will have the same desirable features as the one in except that the distance is now measured in $d_{\operatorname{Gr}(l,n)}$ and within $\operatorname{Gr}(l,n)$.

It turns out that the two values in and are equal, allowing us to define $\delta(\mathbf{A}, \mathbf{B})$ as their common value. We will establish this equality and the properties of $\delta(\mathbf{A}, \mathbf{B})$ in the remainder of this section. The results are summarized in Theorem \[thm1\]. Our proof is constructive: In addition to showing the equality of and , it shows how one may explicitly find the closest points on Schubert varieties $\mathbf{X} \in \Omega_{-}(\mathbf{B})$ and $\mathbf{Y} \in \Omega_{+}(\mathbf{A})$ to any given point in the respective Grassmannians.

\[thm1\] Let $\mathbf{A}$ be a subspace of dimension $k$ and $\mathbf{B}$ be a subspace of dimension $l$ in $\mathbb{R}^n$. Suppose $k \le l \le n$. Then $$\label{eq:equal}
 d_{\operatorname{Gr}(k,n)}\bigl(\mathbf{A}, \Omega_{-}\bigl(\mathbf{B})\bigr) =  d_{\operatorname{Gr}(l,n)}\bigl(\mathbf{B}, \Omega_{+}\bigl(\mathbf{A})\bigr).$$ Their common value defines a distance $\delta(\mathbf{A}, \mathbf{B}) $ between the two subspaces with the following properties:

1.  \[indp\] $\delta(\mathbf{A}, \mathbf{B}) $ is independent of the dimension of the ambient space $n$ and is the same for all $n \ge l+1$;

2.  \[reduce\] $\delta(\mathbf{A}, \mathbf{B}) $ reduces to the Grassmann distance between $\mathbf{A}$ and $\mathbf{B}$ when $k = l$;

3.  \[explicit\] $\delta(\mathbf{A}, \mathbf{B}) $ may be computed explicitly as $$\label{eq:grassdist2}
    \delta(\mathbf{A},\mathbf{B})=\Bigl(\sum\nolimits_{i=1}^{\min \{k,l\}}\theta_i(\mathbf{A},\mathbf{B})^2 \Bigr)^{1/2}$$ where $\theta_i(\mathbf{A},\mathbf{B})$ is the $i$th principal angle between $\mathbf{A}$ and $\mathbf{B}$, $i =1,\dots,\min(k,l)$.

Rewriting as $$\min_{\mathbf{X}\in \Omega_{+}(\mathbf{A})}d_{\operatorname{Gr}(l,n)}(\mathbf{X},\mathbf{B}) = \min_{\mathbf{Y} \in \Omega_{-}(\mathbf{B})} d_{\operatorname{Gr}(k,n)}(\mathbf{Y},\mathbf{A}),$$ the equation says that the distance from $\mathbf{B}$ to the nearest $l$-dimensional subspace that contains $\mathbf{A}$ equals the distance from $\mathbf{A}$ to the nearest $k$-dimensional subspace contained in $\mathbf{B}$. This relation has several parallels. We will see that:

1.  the Grassmann distance may be replaced by any of the distances in Table \[tab:distances\] (see Theorem \[thm:othermetrics\]);

2.  ‘nearest’ may be replaced by ‘furthest’ and ‘min’ above replaced by ‘max’ when $n$ is sufficiently large (see Proposition \[prop:prob4\]);

3.  ‘distance’ may be replaced by ‘volume’ with respect to the intrinsic uniform probability density on the Grassmannian (see Section \[sec:volume\]).

We will prove Theorem \[thm1\] by way of the next two lemmas.

\[lem:ineq1\] Let $k \le l \le n$ be positive integers. Let $\delta :\operatorname{Gr}(k,n)\times \operatorname{Gr}(l,n)\to [0,\infty)$ be the function defined by $$\delta(\mathbf{A},\mathbf{B})=\Bigl(\sum\nolimits_{i=1}^k\theta_i^2\Bigr)^{1/2}$$ where $\theta_i \coloneqq \theta_i(\mathbf{A},\mathbf{B})$, $i=1,\dots,k$. Then $$\delta(\mathbf{A},\mathbf{B})\ge d_{\operatorname{Gr}(l,n)}\bigl(\mathbf{B},\Omega_{+}(\mathbf{A})\bigr).$$

It suffices to find an $\mathbf{X}\in \Omega_{+}(\mathbf{A})$ such that $\delta(\mathbf{A},\mathbf{B})=d_{\operatorname{Gr}(l,n)}(\mathbf{X},\mathbf{B})$. Let $(p_1,q_1),\dots, (p_k,q_k)$ be the principal vectors between $\mathbf{A}$ and $\mathbf{B}$. We will extend $q_1,\dots,q_k$ into an orthonormal basis of $\mathbf{B}$ by appending appropriate orthonormal vectors $q_{k+1},\dots,q_l$. The principal angles are given by $\theta_i=\cos^{-1} p_i^\mathsf{T} q_i$, $\lVert p_i \rVert =\lVert q_i \rVert=1$. If we take $\mathbf{X} \in \operatorname{Gr}(l,n)$ to be the subspace spanned by $p_1,\dots,p_k,q_{k+1},\dots, q_l$, then $$\begin{aligned}
\label{eq:ineq1}
d_{\operatorname{Gr}(l,n)}(\mathbf{X},\mathbf{B})
&= [(\cos^{-1} p_1^\mathsf{T} q_1)^2 + \dots +  (\cos^{-1} p_k^\mathsf{T} q_k)^2 \nonumber \\
&\qquad  +  (\cos^{-1}  q_{k+1}^\mathsf{T} q_{k+1})^2 + \dots + (\cos^{-1}  q_l^\mathsf{T} q_l)^2 ]^{1/2}\\
&= [ \theta_1^2 + \dots +  \theta_k^2 + 0^2 + \dots + 0^2]^{1/2} = \delta(\mathbf{A},\mathbf{B}). \nonumber \end{aligned}$$

We state the following well-known fact [@Horn Corollary 3.1.3] for easy reference and deduce a corollary that will be useful for Lemma \[lem:ineq2\].

\[prop:compare\] Let $k\le l\le n$ be positive integers. Suppose $B \in \mathbb{R}^{n\times l}$ and $B_k \in \mathbb{R}^{n\times k}$ is a submatrix obtained by removing any $l-k$ columns from $B$. Then the $i$th singular values satisfy $\sigma_i(B_k)\le \sigma_i(B)$ for $i=1,\dots, k$.

\[cor:compare\] Let $B$ and $B_k$ be as in Proposition \[prop:compare\] and $\mathbf{B}$ and $\mathbf{B}_k$ be subspaces of $\mathbb{R}^n$ spanned by the column vectors of $B$ and $B_k$ respectively. Then for any subspace $\mathbf{A}$ of $\mathbb{R}^n$, the principal angles between the respective subspaces satisfy $$\theta_i(\mathbf{A},\mathbf{B})\le \theta_i(\mathbf{A},\mathbf{B}_k)$$ for $i = 1,\dots,\min(\dim \mathbf{A}, \dim \mathbf{B}_k)$.

By appropriate orthogonalization if necessary, we may assume that $B$ and its submatrix $B_k$ are orthonormal bases of $\mathbf{B}$ and $\mathbf{B}_k$. Let $A$ be an orthonormal basis of $\mathbf{A}$. Then $\sigma_i(A^\mathsf{T}B)$ and $\sigma_i(A^\mathsf{T}B_k)$ take values in $[0,1]$. Since $\theta_i(\mathbf{A},\mathbf{B})= \cos^{-1}(\sigma_i\bigl(A^\mathsf{T}B)\bigr)$ and $\cos^{-1}$ is monotone decreasing in $[0,1]$, the result follows from $\sigma_i(A^\mathsf{T}B)\ge \sigma_i(A^\mathsf{T}B_k)$, by Proposition \[prop:compare\] applied to the submatrix $A^\mathsf{T}B_k$ of $A^\mathsf{T}B$.

\[lem:ineq2\] Let $\mathbf{A}$, $\mathbf{B}$ be as in Lemma \[lem:ineq1\]. Then $\delta(\mathbf{A}, \mathbf{B})\le d_{\operatorname{Gr}(k,n)}\bigl(\mathbf{A},\Omega_{-}(\mathbf{B})\bigr)$.

Let $\mathbf{Y} \in \Omega_{-}(\mathbf{B})$. Then $\mathbf{Y}$ is a $k$-dimensional subspace contained in $\mathbf{B}$ and in the notation of Corollary \[cor:compare\], we may write $\mathbf{Y} = \mathbf{B}_{k}$. By the same corollary we get $\theta_i(\mathbf{A},\mathbf{B})\le \theta_i(\mathbf{A},\mathbf{Y})$ for $i = 1, \dots, k$. Hence $$\label{eq:ineq2}
\delta(\mathbf{A},\mathbf{B})=\Bigl(\sum\nolimits_{i=1}^{k}\theta_i(\mathbf{A},\mathbf{B})^2\Bigr)^{1/2} 
\le \Bigl(\sum\nolimits_{i=1}^{k}\theta_i(\mathbf{A},\mathbf{Y})^2\Bigr)^{1/2}=d_{\operatorname{Gr}(k,n)}(\mathbf{A},\mathbf{Y}).$$ The desired inequality follows since this holds for arbitrary $\mathbf{Y} \in \Omega_{-}(\mathbf{B})$.

Recall that Grassmannians satisfy an isomorphism $$\operatorname{Gr}(k,n)\cong \operatorname{Gr}(n-k,n)$$ that takes a $k$-plane $\mathbf{Y}$ to the $(n-k)$-plane $\mathbf{Y}^{\perp}$ of linear forms vanishing on $\mathbf{Y}$. It is easy to see that this isomorphism is an isometry. Using this isometric isomorphism, together with Lemma \[lem:ineq1\] and Lemma \[lem:ineq2\], we can immediately deduce that $$\delta(\mathbf{A}, \mathbf{B}) \le d_{\operatorname{Gr}(k,n)}\bigl(\mathbf{A},\Omega_{-}\bigl(\mathbf{B})\bigr)=d_{\operatorname{Gr}(n-k,n)}\bigl(\mathbf{A^{\perp}},\Omega_{+}\bigl(\mathbf{B}^{\perp})\bigr)\le \delta(\mathbf{A}^{\perp},\mathbf{B}^{\perp}).$$ On the other hand, by results in [@Knyazev], we have $\delta(\mathbf{A}, \mathbf{B}) = \delta(\mathbf{A}^{\perp},\mathbf{B}^{\perp})$ and hence $$\delta(\mathbf{A}, \mathbf{B}) = d_{\operatorname{Gr}(k,n)}\bigl(\mathbf{A},\Omega_{-}(\mathbf{B})\bigr).$$ Similarly we can obtain $$\delta(\mathbf{A}, \mathbf{B}) = d_{\operatorname{Gr}(l,n)}\bigl(\mathbf{B},\Omega_{+}(\mathbf{A})\bigr).$$ Hence we have the required equalities and in Theorem \[thm1\]. Property  is obvious from and Property  follows from Lemma \[lem:infty\].

The proof of Lemma \[lem:ineq1\] provides a simple way to find a point $\mathbf{X} \in \Omega_{+}(\mathbf{A})$ that realizes the distance $d_{\operatorname{Gr}(l,n)}\bigl(\mathbf{B},\Omega_{+}(\mathbf{A})\bigr)=\delta(\mathbf{A},\mathbf{B})$. Similarly we may explicitly determine a point $\mathbf{Y} \in \Omega_{-}(\mathbf{B})$ that realizes the distance $d_{\operatorname{Gr}(k,n)}\bigl(\mathbf{A},\Omega_{-}(\mathbf{B})\bigr)=\delta(\mathbf{A},\mathbf{B})$. One might wonder whether or not Theorem \[thm1\] still holds if we replace $d_{\operatorname{Gr}(k,n)}$ by other distance functions described in Table \[tab:distances\]. The answer is yes.

\[thm:othermetrics\] Let $k \le l \le n$. Let $\mathbf{A}\in \operatorname{Gr}(k,n)$ and $\mathbf{B}\in\operatorname{Gr}(l,n)$. Then $$d^*_{\operatorname{Gr}(k,n)}\bigl(\mathbf{A}, \Omega_{-}(\mathbf{B})\bigr) =  d^*_{\operatorname{Gr}(l,n)}\bigl(\mathbf{B}, \Omega_{+}(\mathbf{A})\bigr),$$ for $* = \alpha, \beta, \kappa, \phi, \mu, \rho, \pi, \sigma$. Their common value $\delta^*(\mathbf{A},\mathbf{B})$ is given by: $$\begin{aligned}
\delta^{\alpha}(\mathbf{A}, \mathbf{B}) &=  \theta_k, &
\delta^{\beta}(\mathbf{A},\mathbf{B}) &= \Bigl(1 - \prod\nolimits_{i=1}^k\cos^2\theta_i\Bigr)^{1/2},\\
\delta^{\kappa}(\mathbf{A}, \mathbf{B}) &= \Bigl(\sum\nolimits_{i=1}^k\sin^2\theta_i\Bigr)^{1/2}, &
\delta^{\phi}(\mathbf{A}, \mathbf{B}) &= \cos^{-1}\bigl(\prod\nolimits_{i=1}^k\cos \theta_i\Bigr),\\
\delta^{\mu}(\mathbf{A}, \mathbf{B}) &= \Bigl( \log \prod\nolimits_{i=1}^k\frac{1}{\cos^2 \theta_i}\Bigr)^{1/2}, &
\delta^{\rho}(\mathbf{A}, \mathbf{B}) &= \Bigl(2\sum\nolimits_{i=1}^k\sin^2(\theta_i/2)\Bigr)^{1/2},\\
\delta^{\pi}(\mathbf{A}, \mathbf{B}) &= \sin \theta_k, &
\delta^{\sigma}(\mathbf{A}, \mathbf{B}) &= 2\sin (\theta_k/2),\end{aligned}$$ or more generally with $\min(k,l)$ in place of the index $k$ when we do not require $k \le l$.

This follows from observing that our proof of Theorem \[thm1\] only involves principal angles between $\mathbf{A}$ and $\mathbf{B}$ and the diffeomorphism between $\operatorname{Gr}(k,n)$ and $\operatorname{Gr}(n-k,n)$ remains an isometry under these distances. In particular, both and still hold with any of these distances in place of the Grassmann distance.

We will see in Section \[sec:existing\] that the projection distance $\delta^\pi$ in Theorem \[thm:othermetrics\] is equivalent to the containment gap, a measure of distance between subspaces of different dimensions originally proposed in operator theory [@Kato].

Grassmannian of subspaces of all dimensions {#sec:dinfty}
===========================================

We view the equality of $d_{\operatorname{Gr}(k,n)}\bigl(\mathbf{A},\Omega_{-}(\mathbf{B})\bigr)$ and $d_{\operatorname{Gr}(l,n)}\bigl(\mathbf{B},\Omega_{+}(\mathbf{A})\bigr)$ as the strongest evidence that their common value $\delta(\mathbf{A}, \mathbf{B})$ provides the most natural notion of distance between subspaces of different dimensions. As we pointed out earlier, $\delta$ is a distance in the sense of a distance from a point to a set, but not a distance in the sense of a metric on the set of all subspaces of all dimensions. For instance, $\delta$ does not satisfy the separation property: $\delta(\mathbf{A}, \mathbf{B}) =0$ for any $\mathbf{A} \subsetneq \mathbf{B}$. In fact, it is easy to observe the following.

\[lem:zero\] Let $\mathbf{A} \in \operatorname{Gr}(k,n)$ and $\mathbf{B} \in \operatorname{Gr}(l,n)$. Then $\delta(\mathbf{A},\mathbf{B}) = 0$ iff $\mathbf{A} \subseteq \mathbf{B}$ or $\mathbf{B} \subseteq \mathbf{A}$.

$\delta$ also does not satisfy the triangle inequality: For a line $\mathbf{L}$ not contained in a subspace $\mathbf{A}$, the triangle inequality, if true, would imply $$\begin{aligned}
\delta(\mathbf{L},\mathbf{A})&=\delta(\mathbf{L},\mathbf{A})+\delta(\mathbf{A},\mathbf{B})\ge \delta(\mathbf{L},\mathbf{B}),\\
\delta(\mathbf{L},\mathbf{B})&=\delta(\mathbf{L},\mathbf{B})+\delta(\mathbf{A},\mathbf{B})\ge \delta(\mathbf{L},\mathbf{A}),\end{aligned}$$ giving $\delta(\mathbf{L},\mathbf{A})=\delta(\mathbf{L},\mathbf{B})$ for any subspace $\mathbf{B}$, which is evidently false by Lemma \[lem:zero\] (e.g. take $\mathbf{B} = \mathbf{A} \oplus  \mathbf{L}$).

These observations also apply verbatim to all the other similarly-defined distances $\delta^*$ in Theorem \[thm:othermetrics\], i.e., none of them are metrics.

The set of all subspaces of all dimensions is parameterized by $\operatorname{Gr}(\infty, \infty)$, the *doubly infinite Grassmannian* [@FH], which may be viewed informally as the disjoint union of all $k$-dimensional subspaces[^2] over all $k \in \mathbb{N}$, $$\operatorname{Gr}(\infty, \infty)=\coprod\nolimits_{k=1}^{\infty} \operatorname{Gr}(k,\infty).$$ To define a metric between any pair of subspaces of arbitrary dimensions is to define one on $\operatorname{Gr}(\infty,\infty)$. It is easy to define metrics on $\operatorname{Gr}(\infty,\infty)$ that bear little relation to the geometry of Grassmannian but we will propose one in Section \[sec:metric\] that is consistent with $\delta$ and with $d_{\operatorname{Gr}(k,n)}$ for all $k \le n$.

We will require the formal definition of $\operatorname{Gr}(\infty, \infty)$, namely, it is the direct limit of the direct system of Grassmannians $\{ \operatorname{Gr}(k,n) : (k,n) \in \mathbb{N} \times \mathbb{N} \}$ with inclusion maps $\iota^{kl}_{nm} : \operatorname{Gr}(k,n) \to \operatorname{Gr}(l,m)$ for all $k \le l$ and $n \le m$ such that $l-k\le m-n$. For $A \in \mathbb{R}^{n \times k}$ with orthonormal columns, the embedding is given by $$\label{eq:epsilon}
\iota^{kl}_{nm} :\operatorname{Gr}(k,n) \to \operatorname{Gr}(l,m), \qquad
\operatorname{span} (A) \mapsto
\operatorname{span} \left(
\begin{bmatrix}
A & 0\\
0 & 0\\
0 &  I_{l-k} 
\end{bmatrix}\right),$$ where $I_{l-k} \in \mathbb{R}^{(l -k) \times (l -k)}$ is an identity matrix and we have $(m-n) - (l -k)$ zero rows in the middle so that the $3 \times 2$ block matrix is in $\mathbb{R}^{m \times l}$. Note that for a fixed $k$, $\iota^{kk}_{nm} $ reduces to $\iota_{nm}$ in .

Since our distance $\delta(\mathbf{A},\mathbf{B})$ is defined for subspaces $\mathbf{A}$ and $\mathbf{B}$ of all dimensions, it defines a function $\delta:\operatorname{Gr}(\infty,\infty)\times \operatorname{Gr}(\infty,\infty)\to \mathbb{R}$ that is a *premetric* on $\operatorname{Gr}(\infty,\infty)$, i.e., $\delta(\mathbf{A},\mathbf{B})\ge 0$ and $\delta(\mathbf{A},\mathbf{A})=0$ for all $\mathbf{A},\mathbf{B} \in \operatorname{Gr}(\infty,\infty)$. This in turn defines a topology $\tau $ on $\operatorname{Gr}(\infty,\infty)$ in a standard way: The $\varepsilon$-ball centered at $\mathbf{A}$ is $$B_\varepsilon(\mathbf{A})\coloneqq\{ \mathbf{X}\in \operatorname{Gr}(\infty,\infty) : \delta(\mathbf{A},\mathbf{X})< \varepsilon \},$$ and $U \subseteq \operatorname{Gr}(\infty,\infty)$ is defined to be open if for any $\mathbf{A}\in U$, there is an $\varepsilon$-ball $B_\varepsilon(\mathbf{A}) \subseteq U$. The topology $\tau$ is consistent with the usual topology of Grassmannians (but it is not the disjoint union topology). If we restrict $\tau$ to $\operatorname{Gr}(k,\infty)$, then the subspace topology is the same as the topology induced by the metric $d_{\operatorname{Gr}(k,\infty)}$ on $\operatorname{Gr}(k,\infty)$ as defined in Section \[sec:infty\]. Nevertheless this apparently natural topology on $\operatorname{Gr}(\infty,\infty)$ turns out to be a strange one.

\[prop:tau\] The topology $\tau$ on $\operatorname{Gr}(\infty,\infty)$ is non-Hausdorff and therefore non-metrizable.

$\tau $ is not Hausdorff since it is not possible to separate $\mathbf{A}\subsetneq \mathbf{B}$ by open subsets, as we saw in Lemma \[lem:zero\]. Metrizable spaces are necessarily Hausdorff.

Even though $\tau$ restricts to the metric space topology on $\operatorname{Gr}(k,\infty)$ induced by the Grassmann distance $d_{\operatorname{Gr}(k,\infty)}$ for every $k \in \mathbb{N}$, it is not itself a metric space topology. We view this as a consequence of a more general phenomenon, namely, the category $\boldsymbol{\mathsf{Met}}$ of metric spaces (objects) and continuous contractions (morphisms) has no coproduct, i.e., given a collection of metric spaces, there is in general no metric space that will behave like the disjoint union of the collection of metric spaces. To see this, take metric spaces $(X_1,d_1)$ and $(X_2,d_2)$ where $X_1 = \{ x_1\}$, $X_2 = \{x_2\}$. Suppose a coproduct $(X,d)$ of $(X_1,d_1)$ and $(X_2,d_2)$ exists. Let $Y=\{y_1,y_2\}$ and let $d_Y$ be the metric on $Y$ induced by $d_Y(y_1,y_2)=2 d(x_1,x_2)\ne 0$. Now define $\varphi_i: X_i\to Y$ by $\varphi_i(x_i)=y_i$, $i=1,2$. One sees that no morphism $\varphi:X\to Y$ in $\boldsymbol{\mathsf{Met}}$ is compatible with $\varphi_1$ and $\varphi_2$, contradicting the assumption that $X$ is the coproduct of $X_1$ and $X_2$.

If we instead look at the category of metric spaces with continuous or uniformly continuous maps as morphisms, then coproducts always exist [@Helemskii]. In Section \[sec:metric\], we will relax our requirement and construct a metric $d_{\operatorname{Gr}(\infty,\infty)}$ on $\operatorname{Gr}(\infty,\infty)$ that restricts to $d_{\operatorname{Gr}(k,\infty)}$ for all $k \in \mathbb{N}$ but without requiring that it comes from a coproduct of $\{(\operatorname{Gr}(k,\infty), d_{\operatorname{Gr}(k,\infty)}) : k \in \mathbb{N}\}$ in $\boldsymbol{\mathsf{Met}}$.

Metrics for subspaces of all dimensions {#sec:metric}
=======================================

We will describe a simple recipe for turning the distances $\delta^*$ in Theorem \[thm:othermetrics\] into metrics on $\operatorname{Gr}(\infty,\infty)$. Suppose $k \le l$ and we have $\mathbf{A} \in \operatorname{Gr}(k,n)$ and $\mathbf{B} \in \operatorname{Gr}(l,n)$. In this case there are $k$ principal angles between $\mathbf{A}$ and $\mathbf{B}$, $\theta_1,\dots, \theta_k$, as defined in . First we will set $\theta_{k+1} = \dots = \theta_l = \pi/2$. Then we take the Grassmann distance $\delta$ or any of the distances $\delta^*$ in Theorem \[thm:othermetrics\], replace the index $k$ by $l$, and call the resulting expressions $d_{\operatorname{Gr}(\infty, \infty)}(\mathbf{A}, \mathbf{B})$ (for Grassmann distance) and $d^*_{\operatorname{Gr}(\infty, \infty)}(\mathbf{A}, \mathbf{B})$ (for other distances) respectively.

When $n$ is sufficiently large, setting $\theta_{k+1},\dots,\theta_l$ all equal to $\pi/2$ is equivalent to completing $\mathbf{A}$ to an $l$ dimensional subspace of $\mathbb{R}^n$, by adding $l-k$ vectors orthonormal to the subspace $\mathbf{B}$. Hence the distance between $\mathbf{A}$ and $\mathbf{B}$ is defined by the distance function on the Grassmannian $\operatorname{Gr}(l,n)$. We show in Proposition \[prop:metric\] that these expressions will indeed define metrics on $\operatorname{Gr}(\infty,\infty)$.

Applying the above recipe to the Grassmann, chordal, and Procrustes distances yield the *Grassmann*, *chordal*, and *Procrustes metrics* on $\operatorname{Gr}(\infty,\infty)$ given in Table \[tab:metrics\].

  ------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Grassmann metric    $d_{\operatorname{Gr}(\infty, \infty)}(\mathbf{A}, \mathbf{B}) = \Bigl(\lvert k - l \rvert\pi^2/4 + \sum\nolimits_{i=1}^{\min(k,l)}\theta_i^2\Bigr)^{1/2}$
  Chordal metric      $d_{\operatorname{Gr}(\infty, \infty)}^{\kappa}(\mathbf{A}, \mathbf{B}) = \Bigl(\lvert k - l \rvert + \sum\nolimits_{i=1}^{\min(k,l)} \sin^2\theta_i\Bigr)^{1/2}$
  Procrustes metric   $d_{\operatorname{Gr}(\infty, \infty)}^{\rho}(\mathbf{A}, \mathbf{B}) =\Bigl(\lvert k - l \rvert + 2\sum\nolimits_{i=1}^{\min(k,l)}\sin ^2(\theta_i/2)\Bigr)^{1/2}$
  ------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------

Evidently the metrics in Table \[tab:metrics\] are all of the form $$\label{eq:rms}
d^*_{\operatorname{Gr}(\infty,\infty)} (\mathbf{A},\mathbf{B}) = \sqrt{\delta^*(\mathbf{A}, \mathbf{B})^2 + c_*^2 \epsilon(\mathbf{A},\mathbf{B})^2},$$ where $\epsilon(\mathbf{A},\mathbf{B}) \coloneqq \lvert \dim \mathbf{A} - \dim \mathbf{B} \rvert^{1/2}$. On the other hand, applying the above recipe to other distances in Table \[tab:distances\] yield the *Asimov*, *Binet–Cauchy*, *Fubini–Study*, *Martin*, *projection*, and *spectral metrics* on $\operatorname{Gr}(\infty,\infty)$ given by $$\label{eq:indicator}
d_{\operatorname{Gr}(\infty, \infty)}^{*}(\mathbf{A}, \mathbf{B})  \\
 =
\begin{cases}
d_{\operatorname{Gr}(k,\infty)}^* (\mathbf{A}, \mathbf{B}) & \text{if } \dim \mathbf{A} = \dim \mathbf{B} = k,\\
c_* & \text{if } \dim \mathbf{A} \ne \dim \mathbf{B},
\end{cases}$$ for $ * = \alpha, \beta, \phi, \mu, \pi, \sigma$, respectively. The constants $c_* > 0$ can be seen to be $$c = c_\alpha = \pi/2, \quad  c_\sigma = \sqrt{2}, \quad c_\mu = \infty,\quad
 c_\beta = c_\phi = c_\pi = c_\kappa = c_\rho = 1.$$ In all cases, for subspaces $\mathbf{A}$ and $\mathbf{B}$ of equal dimension $k$, these metrics on $\operatorname{Gr}(\infty,\infty)$ restrict to the corresponding ones on $\operatorname{Gr}(k,\infty)$, i.e., $$d^*_{\operatorname{Gr}(\infty, \infty)}(\mathbf{A}, \mathbf{B}) = d^*_{\operatorname{Gr}(k, \infty)}(\mathbf{A}, \mathbf{B}),$$ where the latter is as described in Corollary \[cor:infty\] and Lemma \[lem:inclusion\]. These metrics on $\operatorname{Gr}(\infty,\infty)$ are the amalgamation of two pieces of information, the distance $\delta^*(\mathbf{A},\mathbf{B})$ and the difference in dimensions $\lvert \dim \mathbf{A} - \dim \mathbf{B} \rvert$, either via a root mean square or an indicator function.

The Grassmann metric has a natural interpretation (see Proposition \[prop:prob4\]):

> *$d_{\operatorname{Gr}(\infty,\infty)} (\mathbf{A},\mathbf{B})$ is the distance from $\mathbf{B}$ to the furthest $l$-dimensional subspace that contains $\mathbf{A}$, which equals the distance from $\mathbf{A}$ to the furthest $k$-dimensional subspace contained in $\mathbf{B}$.*

The chordal metric in Table \[tab:metrics\] is equivalent to the symmetric directional distance, a metric on subspaces of different dimensions [@SWF; @WWF] popular in machine learning [@bar; @ref2a; @motion; @ref2b; @eeg; @mech; @blog; @ref2c; @econ; @network; @face; @ref2d; @text] (see Section \[sec:existing\]).

\[prop:metric\] The expressions in Table \[tab:metrics\] and are metrics on $\operatorname{Gr}(\infty,\infty)$.

It is trivial to see that the expression defined in yields a metric on $\operatorname{Gr}(\infty,\infty)$ for $ * = \alpha, \beta, \mu, \pi, \sigma, \phi$, and so we just need to check the remaining three cases that take the form in . Of the four defining properties of a metric, only the triangle inequality is not immediately clear from .

Let $k = \dim \mathbf{A}$, $l = \dim \mathbf{B}$, and $m = \dim \mathbf{C}$. We may assume <span style="font-variant:small-caps;">wlog</span> that $k\le l \le m \le n$ where $n$ is chosen sufficiently large so that $\mathbf{A}, \mathbf{B}, \mathbf{C}$ are subspaces in $\mathbb{R}^n$. Let $A \in \mathbb{R}^{n\times k}$, $B \in \mathbb{R}^{n \times l}$, $C \in \mathbb{R}^{n \times m}$ be matrices whose columns are orthonormal bases of $\mathbf{A}$, $\mathbf{B}$, $\mathbf{C}$ respectively. Consider the following $(n+m-k)\times m$ matrices: $$A'=\begin{bmatrix}
A & 0\\
0 & I_{m-k}
\end{bmatrix},\quad
B'=\begin{bmatrix}
B & 0\\
0 & 0\\
0 & I_{m-l}
\end{bmatrix},\quad
C'=\begin{bmatrix}
C\\
0
\end{bmatrix}.$$ and set $\mathbf{A}' = \operatorname{span}(A')$, $\mathbf{B}' = \operatorname{span}(B')$, $\mathbf{C}' = \operatorname{span}(C')$; note that these are just $\mathbf{A}$, $\mathbf{B}$, $\mathbf{C}$ embedded in $\operatorname{Graff}(m,n+m-k)$ via . The expressions in Table \[tab:metrics\] satisfy $$\begin{aligned}
d^*_{\operatorname{Gr}(\infty,\infty)} (\mathbf{A},\mathbf{B}) = d^*_{\operatorname{Gr}(m,n+m-k)}(\mathbf{A}',\mathbf{B}'),\\
d^*_{\operatorname{Gr}(\infty,\infty)} (\mathbf{B},\mathbf{C}) = d^*_{\operatorname{Gr}(m,n+m-k)}(\mathbf{B}',\mathbf{C}'),\\
d^*_{\operatorname{Gr}(\infty,\infty)} (\mathbf{A},\mathbf{C}) = d^*_{\operatorname{Gr}(m,n+m-k)}(\mathbf{A}',\mathbf{C}').\end{aligned}$$ Since $\mathbf{A}',\mathbf{B}',\mathbf{C}' \in \operatorname{Gr}(m,n+m-k)$, the triangle inequality for $d^*_{\operatorname{Gr}(m,n+m-k)}$ immediately yields the triangle inequality for $d^*_{\operatorname{Gr}(\infty,\infty)}$.

The proof shows that for any $\mathbf{A} \in \operatorname{Gr}(k,n)$ and $\mathbf{B} \in \operatorname{Gr}(l,n)$ where $k \le l \le n$, $$d^*_{\operatorname{Gr}(\infty,\infty)}(\mathbf{A},\mathbf{B})
=d^*_{\operatorname{Gr}(l,n+l-k)}\bigl(\iota^{k,l}_{n,n+l-k}(\mathbf{A}),\iota^{l,l}_{n,n+l-k}(\mathbf{B})\bigr).$$ The embeddings $\iota^{k,l}_{n,n+l-k}:\operatorname{Gr}(k,n)\to \operatorname{Gr}(l,n+l-k)$ and $\iota^{l,l}_{n,n+l-k}:\operatorname{Gr}(l,n)\to \operatorname{Gr}(l,n+l-k)$ are as defined in and are isometric for all $ k\le l \le n$.

\[prop:prob4\] Let $k\le l \le n/2$ and $\mathbf{A} \in \operatorname{Gr}(k,n)$, $\mathbf{B}\in \operatorname{Gr}(l,n)$. Then $$\label{eq:equal2}
\max_{\mathbf{X}\in \Omega_{+}(\mathbf{A})}d_{\operatorname{Gr}(l,n)}(\mathbf{X},\mathbf{B})  = 
\max_{\mathbf{Y} \in \Omega_{-}(\mathbf{B})} d_{\operatorname{Gr}(k,n)}(\mathbf{Y},\mathbf{A})
= d_{\operatorname{Gr}(\infty,\infty)} (\mathbf{A},\mathbf{B}),$$ i.e., $d_{\operatorname{Gr}(\infty,\infty)}$ is the distance between *furthest* subspaces.

We assume <span style="font-variant:small-caps;">wlog</span> that $\mathbf{A}\cap \mathbf{B}=\{0 \}$ by Proposition \[prop:angles\]. Since $$d_{\operatorname{Gr}(l,n)}(\mathbf{X},\mathbf{B})=\delta(\mathbf{X},\mathbf{B})=\Bigl(\sum\nolimits_{i=1}^l \theta_i(\mathbf{X},\mathbf{B})^2\Bigr)^{1/2},$$ and by Corollary \[cor:compare\], $\theta_i(\mathbf{X},\mathbf{B})\le \theta_i(\mathbf{A},\mathbf{B})$, $i =1,\dots,k$, we obtain $$d_{\operatorname{Gr}(l,n)}(\mathbf{X},\mathbf{B})\le \Bigl(\delta(\mathbf{A},\mathbf{B})^2+\sum\nolimits_{i=k+1}^l\theta_i(\mathbf{X},\mathbf{B})^2\Bigr)^{1/2}.$$ Let $(a_1,b_1),\dots, (a_k, b_k)$ be the principal vectors between $\mathbf{A}$ and $\mathbf{B}$. We extend $b_1,\dots, b_k$ to obtain an orthonormal basis $b_1,\dots, b_k,b_{k+1},\dots, b_l$ of $\mathbf{B}$. Let $\mathbf{X}\cap\mathbf{A}^\perp$ be the orthogonal complement of $\mathbf{A}$ in $\mathbf{X}$ and let $\mathbf{B}_0 \coloneqq\operatorname{span}\{b_{k+1},\dots, b_l\}$. Then $$\Bigl(\sum\nolimits_{i=k+1}^l\theta_i(\mathbf{X},\mathbf{B})^2 \Bigr)^{1/2} = \delta(\mathbf{X}\cap\mathbf{A}^\perp,\mathbf{B}_0),$$ and the last inequality becomes $$d_{\operatorname{Gr}(l,n)}(\mathbf{X},\mathbf{B}) \le  \sqrt{\delta(\mathbf{A},\mathbf{B})^2+\delta(\mathbf{X}\cap\mathbf{A}^\perp,\mathbf{B}_0)^2}.$$ If $n\ge 2l$, then there exist $l-k$ vectors $c_1,\dots,c_{l-k}$ orthogonal to $\mathbf{A}$ and $\mathbf{B}$ simultaneously. Choosing $\mathbf{X} = \operatorname{span}\{a_1,\dots,a_k,c_1,\dots,c_{l-k}\}$, we attain the required maximum: $$d_{\operatorname{Gr}(l,n)}(\mathbf{X},\mathbf{B})=\sqrt{\delta(\mathbf{A},\mathbf{B})^2+(l-k)\pi^2/4} = d_{\operatorname{Gr}(\infty,\infty)} (\mathbf{A},\mathbf{B}).$$ The second equality in follows from $d_{\operatorname{Gr}(\infty,\infty)} (\mathbf{A},\mathbf{B}) = d_{\operatorname{Gr}(\infty,\infty)} (\mathbf{B},\mathbf{A})$, given that $d_{\operatorname{Gr}(\infty,\infty)}$ is a metric by Proposition \[prop:metric\].

The existence of the metrics $d^*_{\operatorname{Gr}(\infty,\infty)}$ as defined in and does not contradict our earlier discussion about the general nonexistence of coproduct in $\boldsymbol{\mathsf{Met}}$ as these metrics do not respect continuous *contractions*. Take the Grassmann metric on $\operatorname{Gr}(\infty,\infty)$ for instance. $(\operatorname{Gr}(\infty,\infty),d_{\operatorname{Gr}(\infty,\infty)})$ is an object of the category $\boldsymbol{\mathsf{Met}}$ but it is *not* the coproduct of $\{(\operatorname{Gr}(k,\infty), d_{\operatorname{Gr}(k,\infty)} ) : k \in \mathbb{N}\}$. Indeed, let $Y = \{y_1, y_2\}$ with metric defined by $d_Y(y_1, y_2) = 1$. Consider a family of maps $f_k:\operatorname{Gr}(k,\infty)\to Y$, $$f_k(\mathbf{A})=
\begin{cases}
y_1&\text{if }k=2,\\
y_2&\text{otherwise}.
\end{cases}$$ Then $f_k$ is a continuous contraction between $\operatorname{Gr}(k,\infty)$ and $Y$. So $\{f_k :k \in \mathbb{N}\}$ is a family of morphisms in $\boldsymbol{\mathsf{Met}}$ compatible with $\{(\operatorname{Gr}(k,\infty), d_{\operatorname{Gr}(k,\infty)} ) : k \in \mathbb{N}\}$. If $(\operatorname{Gr}(\infty,\infty),d_{\operatorname{Gr}(\infty,\infty)})$ is the coproduct of this family, then there must be a continuous contraction $f:\operatorname{Gr}(\infty,\infty)\to Y$ such that $f\circ \iota_k=f_k$ with $\iota_k$ being the natural inclusion of $\operatorname{Gr}(k,\infty)$ into $\operatorname{Gr}(\infty,\infty)$. But taking $\mathbf{A}\in \operatorname{Gr}(2,\infty)$ and $\mathbf{B}\in \operatorname{Gr}(3,\infty)$, we see that $$d_{\operatorname{Gr}(\infty,\infty)}(\mathbf{A},\mathbf{B})\ge \frac{\pi}{2} > 1=d_Y\bigl(f(\mathbf{A}),f(\mathbf{B})\bigr),$$ contradicting the surmise that $f$ is a contraction. Similarly, one may show that $(\operatorname{Gr}(\infty,\infty),d_{\operatorname{Gr}(\infty,\infty)}^*)$ is not a coproduct in $\boldsymbol{\mathsf{Met}}$ for any $* = \alpha, \beta, \kappa, \mu, \pi, \rho, \sigma, \phi$.

$(\operatorname{Gr}(\infty,\infty),d_{\operatorname{Gr}(\infty,\infty)})$ is also not the coproduct of $\{(\operatorname{Gr}(k,\infty), d_{\operatorname{Gr}(k,\infty)} ) : k \in \mathbb{N}\}$ in the category of metric spaces with continuous (or uniformly continuous) maps as morphisms. The coproduct in this category is simply $\operatorname{Gr}(\infty,\infty)$ with the metric induced by the disjoint union topology, which is too fine (in the sense of topology) to be interesting. In particular, such a metric is unrelated to the distance $\delta$.

Comparison with existing works {#sec:existing}
==============================

There are two existing proposals for a distance between subspaces of different dimensions — the containment gap and the symmetric directional distance. These turn out to be special cases of our distance in Section \[sec:main\] and our metric in Section \[sec:metric\].

Let $\mathbf{A} \in \operatorname{Gr}(k,n)$ and $\mathbf{B} \in \operatorname{Gr}(l,n)$. The *containment gap* is defined as $$\gamma(\mathbf{A}, \mathbf{B}) \coloneqq \max_{a\in \mathbf{A}} \; \min_{b\in \mathbf{B}} \frac{\lVert a - b \rVert}{\lVert a \rVert}.$$ This was proposed in [@Kato pp. 197–199] and used in numerical linear algebra [@SS] for measuring separation between Krylov subspaces [@BES]. It is equivalent to our *projection distance* $\delta^\pi$ in Theorem \[thm:othermetrics\]. It was observed in [@BES p. 495] that $$\gamma(\mathbf{A}, \mathbf{B}) = \sin\bigl( \theta_k(\mathbf{A},\mathbf{Y}) \bigr)$$ where $\mathbf{Y} \in \Omega_{-}(\mathbf{B})$ is nearest to $\mathbf{A}$ in the projection distance $d^\pi_{\operatorname{Gr}(k,n)}$. By Theorem \[thm:othermetrics\], we deduce that it can also be realized as $$\gamma(\mathbf{A}, \mathbf{B}) = \sin\bigl( \theta_l(\mathbf{B},\mathbf{X}) \bigr)$$ where $\mathbf{X} \in \Omega_{+}(\mathbf{A})$ is nearest to $\mathbf{B}$ in the projection distance $d^\pi_{\operatorname{Gr}(l,n)}$, a fact about the containment gap that had not been observed before. Indeed, by Theorem \[thm:othermetrics\], we get $$\gamma(\mathbf{A}, \mathbf{B}) = \delta^\pi (\mathbf{A}, \mathbf{B})$$ for all $\mathbf{A} \in \operatorname{Gr}(k,n)$ and $\mathbf{B} \in \operatorname{Gr}(l,n)$.

The *symmetric directional distance* is defined as $$\label{eq:sdd}
d_{\Delta}(\mathbf{A},\mathbf{B})  \coloneqq \Bigl( \max(k,l) - \sum\nolimits_{i,j=1}^{k,l} (a_i^\mathsf{T} b_j)^2 \Bigr)^{1/2}$$ where $A = [a_1,\dots,a_k]$ and $B = [b_1,\dots,b_l]$ are the respective orthonormal bases. This was proposed in [@SWF; @WWF], and is widely used [@bar; @ref2a; @motion; @ref2b; @eeg; @mech; @blog; @ref2c; @econ; @network; @face; @ref2d; @text]. The definition is equivalent to our *chordal metric* $d^\kappa_{\operatorname{Gr}(\infty,\infty)}$ in Table \[tab:metrics\], $$d_{\operatorname{Gr}(\infty,\infty)}^\kappa (\mathbf{A},\mathbf{B})^2 = \lvert k - l \rvert + \sum_{i=1}^{\min(k,l)} \sin^2 \theta_i = \max(k,l) - \sum_{i,j=1}^{k,l} (a_i^\mathsf{T} b_j)^{2} =d_\Delta (\mathbf{A}, \mathbf{B})^2,$$ since $ \lvert k - l \rvert  = \max(k,l) - \min(k,l)$, and $$\sum\nolimits_{i,j=1}^{k,l} (a_i^\mathsf{T} b_j)^{2} = \lVert A^\mathsf{T} B \rVert_F^2 
= \sum\nolimits_{i=1}^{\min(k,l)}  \cos^2 \theta_i  = \min(k,l) - \sum\nolimits_{i=1}^{\min(k,l)}  \sin^2 \theta_i .$$

Geometry of $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$ {#sec:schubert}
=================================================================

Up to this point, $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$, as defined in Definition \[def:Omega\], are treated as mere subsets of $\operatorname{Gr}(l,n)$ and $\operatorname{Gr}(k,n)$ respectively. We will see that $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$ have rich geometric properties. Firstly, we will show that they are Schubert varieties, justifying their names.

\[def:Schubert\] Let $\mathbf{X}_1\subset \mathbf{X}_2 \subset \dots \subset \mathbf{X}_k$ be a fixed flag in $\mathbb{R}^n$. The *Schubert variety* $\Omega(\mathbf{X}_1, \dots, \mathbf{X}_k , n)$ is the set of $k$-planes $\mathbf{Y}$ satisfying the Schubert conditions $\dim (\mathbf{Y}\cap \mathbf{X}_i)\ge i$, $i=1,\dots, k$, i.e., $$\Omega(\mathbf{X}_1, \dots, \mathbf{X}_k , n) = \{\mathbf{Y} \in \operatorname{Gr}(k,n):  \dim (\mathbf{Y}\cap \mathbf{X}_i)\ge i, \; i=1,\dots, k \}.$$

Let $0 \eqqcolon k_0 < k_1<\cdots < k_{m+1} \coloneqq n$ be a sequence of increasing nonnegative integers. The associated *flag variety* is the set of flags satisfying the condition $\dim \mathbf{X}_i = k_i$, $i=0, 1,\dots, m+1$. We denote it by $\operatorname{Flag}(k_1,\dots, k_m, n)$, i.e., $$\{(\mathbf{X}_1,\dots,\mathbf{X}_{m}) \in \operatorname{Gr}(k_1,n) \times \dots \times \operatorname{Gr}(k_m,n) : 
 \mathbf{X}_i\subset \mathbf{X}_{i+1}, \; i =1,\dots,m \}.$$

Observe that a Schubert variety depends on a specific increasing sequence of subspaces whereas a flag variety depends only on an increasing sequence of dimensions (of subspaces). Flag varieties may be viewed as a generalization of Grassmannians since if $m=1$, then $\operatorname{Flag}(k,n) = \operatorname{Gr}(k,n)$. Like Grassmannians, $\operatorname{Flag}(k_1,\dots, k_m, n)$ is a smooth manifold and sometimes called a *flag manifold*. The parallel goes further, $\operatorname{Flag}(k_1,\dots, k_m, n) $ is a homogeneous space, $$\label{eq:flag}
\operatorname{Flag}(k_1,\dots, k_m, n) \cong \operatorname{O}(n)/\bigl(\operatorname{O}(d_1) \times \dots \times \operatorname{O}(d_{m+1})\bigr)$$ where $d_i = k_{i} - k_{i-1}$ for $i =1,\dots, m+1$, generalizing .

Let $\mathbf{A}\in \operatorname{Gr}(k,n)$ and $\mathbf{B} \in \operatorname{Gr}(l,n)$ with $k\le l$. Then $$\Omega_{+}(\mathbf{A}) = \Omega(\mathbf{A}_1, \dots, \mathbf{A}_l , n),\qquad
\Omega_{-}(\mathbf{B}) = \Omega(\mathbf{B}_1, \dots, \mathbf{B}_{k} , n),$$ are Schubert varieties in $\operatorname{Gr}(l,n)$ and $\operatorname{Gr}(k,n)$ respectively with the flags $$\begin{gathered}
\{0\} \eqqcolon \mathbf{A}_0 \subset \mathbf{A}_1\subset \dots \subset \mathbf{A}_k\coloneqq\mathbf{A}\subset \mathbf{A}_{k+1}\dots \subset \mathbf{A}_{l}, \\
\{0\} \eqqcolon \mathbf{B}_0 \subset \mathbf{B}_1 \subset  \dots \subset \mathbf{B}_{k} \coloneqq\mathbf{B}.\end{gathered}$$ where $\mathbf{A}_{k+i}$ is a subspace of $\mathbb{R}^n$ containing $\mathbf{A}$ of dimension $n-l+(k+i)$ for $1\le i\le l-k$.

The isomorphism $\operatorname{Gr}(l,n) \cong \operatorname{Gr}(n-l,n)$ (resp. $\operatorname{Gr}(k,n) \cong \operatorname{Gr}(n-k,n)$) that sends $\mathbf{X}$ to $\mathbf{X}^{\perp}$ takes $\Omega_{+}(\mathbf{A})$ to $\Omega_{-}(\mathbf{A}^{\perp})$ (resp. $\Omega_{-}(\mathbf{B})$ to $\Omega_{+}(\mathbf{B}^{\perp})$). Thus $\Omega_{+}(\mathbf{A})$ (resp. $\Omega_{-}(\mathbf{B})$) may also be viewed as Schubert varieties in $\operatorname{Gr}(n-l,n)$ (resp. $\operatorname{Gr}(n-k,n)$). More importantly, this observation implies that $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$, despite superficial difference in their definitions, are essentially the same type of objects.

\[prop:Omega\] For any $\mathbf{A} \in \operatorname{Gr}(k,n)$ and $\mathbf{B} \in \operatorname{Gr}(l,n)$, we have $$\Omega_{+}(\mathbf{A}) \cong \Omega_{-}(\mathbf{A}^{\perp}) \quad\text{and}\quad \Omega_{-}(\mathbf{B}) \cong \Omega_{+}(\mathbf{B}^{\perp}).$$

Also, $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$ are uniquely determined by $\mathbf{A}$ and $\mathbf{B}$ respectively.

\[prop:Omega1\] Let $\mathbf{A}, \mathbf{A}' \in \operatorname{Gr}(k,n)$ and $\mathbf{B},\mathbf{B}' \in \operatorname{Gr}(l,n)$. Then $$\begin{gathered}
\Omega_{+}(\mathbf{A}) =\Omega_{+}(\mathbf{A'})\quad \text{if and only if} \quad \mathbf{A} = \mathbf{A}',\\
\Omega_{-}(\mathbf{B}) =\Omega_{-}(\mathbf{B}')\quad \text{if and only if} \quad \mathbf{B} = \mathbf{B}'.\end{gathered}$$

Suppose $\Omega_{+}(\mathbf{A})=\Omega_{+}(\mathbf{A'})$. Observe that the intersection of all $l$-planes containing $\mathbf{A}$ is exactly $\mathbf{A}$ and ditto for $\mathbf{A}'$. So $$\mathbf{A} = \bigcap\nolimits_{\mathbf{X} \in\Omega_{+}(\mathbf{A})} \mathbf{X} = \bigcap\nolimits_{\mathbf{X} \in\Omega_{+}(\mathbf{A}')} \mathbf{X} = \mathbf{A}'.$$ The converse is obvious. The statement for $\Omega_{-}$ then follows from Proposition \[prop:Omega\].

This observation allows us to treat subspaces of different dimensions on the same footing by regarding them as *subsets* in the same Grassmannian. If we have a collection of subspaces of dimensions $k\le k_1 < k_2 < \dots < k_m \le l$, the injective map $\mathbf{A} \mapsto \Omega_{+}(\mathbf{A})$ takes all of them into distinct subsets of $\operatorname{Gr}(l,n)$. Alternatively, the injective map $\mathbf{B} \mapsto \Omega_{-}(\mathbf{B})$ takes all of them into distinct subsets of $\operatorname{Gr}(k,n)$.

The resemblance between $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$ in Proposition \[prop:Omega\] goes further — we may view them as ‘sub-Grassmannians’.

\[prop:OmegaGrass\] Let $k \le l \le n$ and $\mathbf{A} \in \operatorname{Gr}(k,n)$, $\mathbf{B} \in \operatorname{Gr}(l,n)$. Then $$\Omega_{+}(\mathbf{A}) \cong \operatorname{Gr}(l-k,n-k), \quad \Omega_{-}(\mathbf{B}) \cong \operatorname{Gr}(k,l),$$ isomorphic as algebraic varieties and diffeomorphic as smooth manifolds. Thus $$\dim \Omega_{+}(\mathbf{A})=(n-l)(l-k),\quad \dim \Omega_{-}(\mathbf{B}) = k(l-k).$$

The first isomorphism is the quotient map $\varphi: \Omega_{+}(\mathbf{A})\to  \operatorname{Gr}_{l-k}(\mathbb{R}^n/\mathbf{A})$, $\mathbf{X} \mapsto \mathbf{X}/\mathbf{A} \subseteq \mathbb{R}^n/\mathbf{A}$, composed with the isomorphism $ \operatorname{Gr}_{l-k}(\mathbb{R}^n/\mathbf{A}) \cong \operatorname{Gr}(l-k,n-k)$. The second isomorphism is obtained by regarding a $k$-dimensional subspace $\mathbf{Y}$ of $\mathbb{R}^n$ in $\Omega_{-}(\mathbf{B}) $ as a $k$-dimensional subspace of $\mathbf{B}$, i.e., $\Omega_{-}(\mathbf{B}) = \operatorname{Gr}_k(\mathbf{B}) \cong \operatorname{Gr}(k,l)$.

That $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$ are Grassmannians allows us to infer the following:

1.  \[top\] as topological spaces, they are compact and path-connected;

2.  as algebraic varieties, they are irreducible and nonsingular;

3.  \[diff\] as differential manifolds, they are smooth and any two points on them can be connected by a length-minimizing geodesic.

The topology in refers to the metric space topology, not Zariski topology. A consequence of compactness is that the distance $d_{\operatorname{Gr}(k,n)}\bigl(\mathbf{A},\Omega_{-}(\mathbf{B})\bigr) = d_{\operatorname{Gr}(l,n)}\bigl(\mathbf{B},\Omega_{+}(\mathbf{A})\bigr)$ can be attained by points in $\Omega_{-}(\mathbf{B})$ and $\Omega_{+}(\mathbf{A})$ respectively. We constructed these closest points explicitly when we proved Theorem \[thm1\].

Many more topological and geometric properties of $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$ follow from Proposition \[prop:OmegaGrass\] as they inherit everything that we know about Grassmannians (e.g. coordinate ring, cohomology ring, Plücker relations, etc.); in particular, $\Omega_{+}(\mathbf{A})$ and $\Omega_{-}(\mathbf{B})$ are also flag varieties.

The last property in requires a proof. The length-minimizing geodesic is not unique and so $\Omega_+(\mathbf{A})$ and $\Omega_-(\mathbf{B})$ are not *geodesically convex* [@Nicolaescu Definition 4.1.35].

Any two points in $\Omega_{-}(\mathbf{B})$ (resp. $\Omega_{+}(\mathbf{A})$) can be connected by a length-minimizing geodesic in $\operatorname{Gr}(k,n)$ (resp. $\operatorname{Gr}(l,n)$).

By Proposition \[prop:Omega\], it suffices to show that any two points in $\Omega_{-}(\mathbf{B})$ can be connected by a geodesic curve in $\Omega_{-}(\mathbf{B})$. By Proposition \[prop:OmegaGrass\], $\Omega_{-}(\mathbf{B})$ is the image of $\operatorname{Gr}(k,l)$ embedded isometrically in $\operatorname{Gr}(k,n)$. So by Lemma \[lem:infty\], for any $\mathbf{X}_1,\mathbf{X}_2 \in \operatorname{Gr}(k,l)$, $d_{\operatorname{Gr}(k,n)}(\mathbf{X}_1,\mathbf{X}_2)= d_{\operatorname{Gr}(k,l)}(\mathbf{X}_1,\mathbf{X}_2)
= d_{\Omega_{-}(\mathbf{B})}(\mathbf{X}_1,\mathbf{X}_2)$, where the last is the geodesic distance in $\Omega_{-}(\mathbf{B})$. Hence if $d_{\Omega_{-}(\mathbf{B})}(\mathbf{X}_1,\mathbf{X}_2)$ is realized by a geodesic curve $\gamma$ in $\Omega_{-}(\mathbf{B})$, then $\gamma$ must also be a geodesic curve in $\operatorname{Gr}(k,n)$.

We have represented $\operatorname{Gr}(k,n)$ as a set of *equivalence classes* of matrices but it may also be represented as a set of *actual matrices* [@Nicolaescu Example 1.2.20], namely, idempotent symmetric matrices of trace $k$: $$\operatorname{Gr}(k,n)\cong \{ P \in \mathbb{R}^{n \times n} : P^{\mathsf{T}} = P^2 = P, \; \operatorname{tr}(P)=k \}.$$ The isomorphism maps each subspace $\mathbf{A}\in \operatorname{Gr}(k,n)$ to $P_{\mathbf{A}} \in \mathbb{R}^{n \times n}$, the unique orthogonal projection onto $\mathbf{A}$, and its inverse takes an orthogonal projection $P$ to the subspace $\operatorname{im}( P) \in \operatorname{Gr}(k,n)$. $P$ is an orthogonal projection iff it is symmetric and idempotent, i.e., $P^{\mathsf{T}} = P^2 = P$. The eigenvalues of an orthogonal projection onto a subspace of dimension $k$ are $1$’s and $0$’s with multiplicities $k$ and $n-k$, so $\operatorname{tr}(P) = k$ is equivalent to $\operatorname{rank}(P) = k$, ensuring $\operatorname{im}(P)$ has dimension $k$. In this representation, $$\begin{aligned}
\Omega_{+}(\mathbf{A}) &\cong \{ P \in \mathbb{R}^{n \times n} : P^{\mathsf{T}} = P^2 = P, \; \operatorname{tr}(P)=l, \; \operatorname{im}(A) \subseteq \operatorname{im}(P) \},\\
\Omega_{-}(\mathbf{B}) &\cong \{ P \in \mathbb{R}^{n \times n} : P^{\mathsf{T}} = P^2 = P, \; \operatorname{tr}(P)=k, \; \operatorname{im}(P) \subseteq \operatorname{im}(B) \},\end{aligned}$$ allowing us to treat $\operatorname{Gr}(k,n)$, $\operatorname{Gr}(l,n)$, $\Omega_{+}(\mathbf{A})$, $\Omega_{-}(\mathbf{B})$ all as subvarieties of $\mathbb{R}^{n \times n}$.

Probability density on the Grassmannian {#sec:volume}
=======================================

We determine the relative volumes of $\Omega_{+}(\mathbf{A})$, $\Omega_{-}(\mathbf{B})$ and prove a volumetric analogue of in Theorem \[thm1\]:

> *Given $k$-dimensional subspace $\mathbf{A}$ and $l$-dimensional subspace $\mathbf{B}$ in $\mathbb{R}^n$, the probability that a randomly chosen $l$-dimensional subspace in $\mathbb{R}^n$ contains $\mathbf{A}$ equals the probability that a randomly chosen $k$-dimensional subspace in $\mathbb{R}^n$ is contained in $\mathbf{B}$.*

Every Riemannian metric on a Riemannian manifold yields a *volume density* that is consistent with the metric [@Nicolaescu Example 3.4.2]. The Riemannian metric[^3] on $\operatorname{Gr}(k,n)$ that gives us the Grassmann distance in and the geodesic in also gives a density $d\gamma_{k,n}$ on $\operatorname{Gr}(k,n)$. The volume of $\operatorname{Gr}(k,n)$ is then $$\label{eq:volume}
\operatorname{Vol}\bigl(\operatorname{Gr}(k,n)\bigr)=\int_{\operatorname{Gr}(k,n)} |d\gamma_{k,n}| =\binom{n}{k}\frac{\prod_{j=1}^{n}{\omega_j}}{\bigl(\prod_{j=1}^k\omega_j \bigr)\bigl(\prod_{j=1}^{n-k}\omega_j\bigr)},$$ where $\omega_m \coloneqq \pi^{m/2}/\Gamma(1+m/2)$, volume of the unit ball in $\mathbb{R}^m$ [@Nicolaescu Proposition 9.1.12].

The normalized density $d\mu_{k,n} \coloneqq \operatorname{Vol}\bigl(\operatorname{Gr}(k,n)\bigr)^{-1} \lvert d\gamma_{k,n}\rvert$ defines a natural *uniform probability density* on $\operatorname{Gr}(k,n)$. With respect to this, the probability of landing on $\Omega_{+}(\mathbf{A})$ in $\operatorname{Gr}(l,n)$ equals the probability of landing on $\Omega_{-}(\mathbf{B})$ in $\operatorname{Gr}(k,n)$.

\[cor:volume\] Let $k \le l \le n$ and $\mathbf{A} \in \operatorname{Gr}(k,n)$, $\mathbf{B} \in \operatorname{Gr}(l,n)$. The relative volumes of $\Omega_{+}(\mathbf{A})$ in $\operatorname{Gr}(l,n)$ and $\Omega_{-}(\mathbf{B})$ in $\operatorname{Gr}(k,n)$ are equal and their common value depends only on $k,l,n$, $$\mu_{l,n}\bigl(\Omega_{+}(\mathbf{A})\bigr) =
\mu_{k,n}\bigl(\Omega_{-}(\mathbf{B})\bigr) =
\frac{l!(n-k)!\prod_{j=l-k+1}^{l}{\omega_j}}{n!(l-k)!\prod_{j=n-k+1}^{n}\omega_j}.$$

By Proposition \[prop:OmegaGrass\], $\Omega_{+}(\mathbf{A})$ is isometric to $\operatorname{Gr}(n-l,n-k)$ and $\Omega_{-}(\mathbf{B})$ is isometric to $\operatorname{Gr}(k,l)$, so by their volumes are $$\binom{n-k}{n-l}\frac{\prod_{j=1}^{n-k}{\omega_j}}{\bigl(\prod_{j=1}^{n-l}\omega_j\bigr)\bigl(\prod_{j=1}^{l-k}\omega_j)},
\qquad
\binom{l}{k}\frac{\prod_{j=1}^{l}{\omega_j}}{\bigl(\prod_{j=1}^k\omega_j\bigr)\bigl(\prod_{j=1}^{l-k}\omega_j)}$$ respectively. Now divide by the volumes of $\operatorname{Gr}(l,n)$ and $\operatorname{Gr}(k,n)$ respectively.

By definition, relative volume depends on the volume of ambient space and the dependence on $n$ is expected, a slight departure from Theorem \[thm1\].

Conclusions
===========

We provided what we hope is a thorough study of subspace distances, a topic of wide-ranging interest. We investigated the topic from different angles and filled in the most glaring gap in our existing knowledge — defining distances and metrics for inequidimensional subspaces. We also developed simple geometric models for subspaces of all dimensions and enriched the existing differential geometric view of Grassmannians with algebraic geometric perspectives. We expect these to be of independent interest to applied and computational mathematicians. Most of the topics discussed in this article have been extended to affine subspaces in [@LWY].

Acknowledgment {#acknowledgment .unnumbered}
--------------

We are very grateful to the two anonymous referees for their invaluable suggestions, both mathematical and stylistic. We thank Sayan Mukherjee for telling us about the importance of measuring distances between inequidimensional subspaces, Frank Sottile for invaluable discussions that led to the Schubert variety approach, and Lizhen Lin, Tom Luo, Giorgio Ottaviani for helpful comments.

[1]{} P.-A. Absil, R. Mahony, and R. Sepulchre, *Optimization Algorithms on Matrix Manifolds*, Princeton University Press, Princeton, NJ, 2008.

P.-A. Absil, R. Mahony, and R. Sepulchre, “Riemannian geometry of Grassmann manifolds with a view on algorithmic computation,” *Acta Appl. Math.*, **80** (2004), no. 2, pp. 199–220.

P.-A. Absil, R. Mahony, R. Sepulchre, and P. Van Dooren, “A Grassmann–Rayleigh quotient iteration for computing invariant subspaces,” *SIAM Rev.*, **44** (2002), no. 1, pp. 57–73.

A. Ashikhmin and A. R. Calderbank, “Grassmannian packings from operator Reed–Muller codes,” *IEEE Trans. Inform. Theory*, **56** (2003), no. 11, pp. 5689–5714.

H. Bagherinia and R. Manduchi, “A theory of color barcodes,” *Proc. IEEE Int. Conf. Comput. Vis.* (ICCV), **14** (2011), pp. 806–813.

A. Barg and D. Yu. Nogin, “Bounds on Packings of Spheres in the Grassmannian Manifold,” *IEEE Trans. Inform. Theory*, **48** (2002), no. 9, pp. 2450–2454.

R. Basri, T. Hassner, and L. Zelnik-Manor, “Approximate nearest subspace search,” *IEEE Trans. Pattern Anal. Mach. Intell.*, **33** (2011), no. 2, pp. 266–278.

C. A. Beattie, M. Embree, and D. C. Sorensen, “Convergence of polynomial restart Krylov methods for eigenvalue computations,” *SIAM Rev.*, **47** (2005), no. 3, pp. 492–515.

Å. Björck and G. H. Golub, “Numerical methods for computing angles between linear subspaces,” *Math. Comp.*, **27** (1973), no. 123, pp. 579–594.

L. Balzano, R. Nowak, and B. Recht, “Online identification and tracking of subspaces from highly incomplete information,” *Annual Allerton Conf. Commun. Control Comput.*, **48** (2010), pp. 704–711.

S.-C. T. Choi, “Minimal residual methods for complex symmetric, skew symmetric, and skew Hermitian systems,” *preprint*, Report ANL/MCS-P3028-0812, Computation Institute, University of Chicago, IL, 2013.

J. H. Conway, R. H. Hardin, and N. J. A. Sloane, “Packing lines, planes, etc.: packings in Grassmannian spaces,” *Experiment. Math.*, **5** (1996), no. 2, pp. 83–159.

N. P. Da Silva and J. P. Costeira, “The normalized subspace inclusion: Robust clustering of motion subspaces,” *Proc. IEEE Int. Conf. Comput. Vis.* (ICCV), **12** (2009), pp. 1444–1450.

M. M. Deza and E. Deza, *Encyclopedia of Distances*, 2nd Ed., Springer, Heidelberg, 2013.

I. S. Dhillon, R. W. Heath, Jr., T. Strohmer, and J. A. Tropp, “Constructing packings in Grassmannian manifolds via alternating projection,” *Experiment. Math.*, **17** (2008), no. 1, pp. 9–35.

B. Draper, M. Kirby, J. Marks, T. Marrinan, and C. Peterson, “A flag representation for finite collections of subspaces of mixed dimensions,” *Linear Algebra Appl.*, **451** (2014), pp. 15–32.

A. Edelman, T. Arias, and S. T. Smith, “The geometry of algorithms with orthogonality constraints,” *SIAM J. Matrix Anal. Appl.*, **20** (1999), no. 2, pp. 303–353.

N. Figueiredo, P. Georgieva, E. W. Lang, I. M. Santos, A. R. Teixeira, and A. M. Tomé, “SSA of biomedical signals: A linear invariant systems approach,” *Stat. Interface*, **3** (2010), no. 3, pp. 345–355.

R. Fioresi and C. Hacon, “On infinite-dimensional Grassmannians and their quantum deformations,” *Rend. Sem. Mat. Univ. Padova*, **111** (2004), pp. 1–24.

G. Golub and C. Van Loan, *Matrix Computations*, 4th Ed., John Hopkins University Press, Baltimore, MD, 2013.

J. Hamm and D. D. Lee, “Grassmann discriminant analysis: A unifying view on subspace-based learning,” *Proc. Internat. Conf. Mach. Learn.* (ICML), **25** (2008), pp. 376–383.

T. F. Hansen and D. Houle, “Measuring and comparing evolvability and constraint in multivariate characters,” *J. Evolution. Biol.*, **21** (2008), no. 5, pp. 1201–1219.

G. Haro, G. Randall, and G. Sapiro, “Stratification learning: Detecting mixed density and dimensionality in high dimensional point clouds,” *Proc. Adv. Neural Inform. Process. Syst.* (NIPS), **26** (2006), pp. 553–560.

Q. He, F. Kong, and R. Yan, “Subspace-based gearbox condition monitoring by kernel principal component analysis, *Mech. Systems Signal Process.*, **21** (2007), no. 4, pp. 1755–1772.

A. Ya. Helemskii, *Lectures and Exercises on Functional Analysis*, Translations of Mathematical Monographs, **233**, AMS, Providence, RI, 2006.

R. A. Horn and C. R. Johnson, *Topics in Matrix Analysis*, Cambridge University Press, Cambridge, 1991.

D. Husemoller, *Fibre Bundles*, 3rd Ed., Graduate Texts in Mathematics, **20**, Springer, New York, NY, 1994.

T. Kato, *Perturbation Theory for Linear Operators*, Classics in Mathematics, Springer-Verlag, Berlin, 1995.

A. V. Knyazev and M. E. Argentati, “Majorization for changes in angles between subspaces, Ritz values, and graph Laplacian spectra,” *SIAM J. Matrix Anal. Appl*, **29** (2006), no. 1, pp. 15–32.

G. Lerman and T. Zhang, “Robust recovery of multiple subspaces by geometric $l_p$ minimization,” *Ann. Statist.*, **39** (2011), no. 5, pp. 2686–2715.

H. Li and A. Li, “Utilizing improved Bayesian algorithm to identify blog comment spam,” *Proc. IEEE Symp. Robot. Appl.* (ISRA), **1** (2012), pp. 423–426.

J. Liesen and Z. Strakoš, *Krylov Subspace Methods*, Oxford University Press, Oxford, 2013.

L.-H. Lim, K. S.-W. Wong, and K. Ye, “Statistical estimation and the grassmannian of affine subspaces,” *prepirint*, (2016), <http://www.stat.uchicago.edu/~lekheng/work/affine.pdf>.

D. J. Love, R. W. Heath, Jr., and T. Strohmer, “Grassmannian beamforming for multiple-input multiple-output wireless systems,” *IEEE Trans. Inform. Theory*, **49** (2003), no. 10, pp. 2735–2747.

D. Luo and H. Huang, “Video motion segmentation using new adaptive manifold denoising model,” pp. 65–72, *Proc. IEEE Conf. Computer Vis. Pattern Recognit.* (CVPR), Columbus, OH, 2014.

Y. Ma, A. Yang, H. Derksen, and R. Fossum, “Estimation of subspace arrangements with applications in modeling and segmenting mixed data,” *SIAM Rev.*, **50** (2008), no. 3, pp. 413–458. J. W. Milnor and J. D. Stasheff, *Characteristic Classes*, Annals of Mathematics Studies, **76**, Princeton University Press, Princeton, NJ, 1974.

L. I. Nicolaescu, *Lectures on the Geometry of Manifolds*, 2nd Ed., World Scientific, Hackensack, NJ, 2007.

M. Peng, D. Bu, and Y. Wang, “The measure of income mobility in vector space,” *Physics Procedia*, **3** (2010), no. 5, pp. 1725–1732.

E. Sharafuddin, N. Jiang, Y. Jin, and Z.-L. Zhang, “Know your enemy, know yourself: Block-level network behavior profiling and tracking,” *Proc. IEEE Global Telecomm. Conf.* (GLOBECOM), **53** (2010), pp. 1–6.

B. St. Thomas, L. Lin, L.-H. Lim, and S. Mukherjee, “Learning subspaces of different dimensions,” *preprint*, (2014), <http://arxiv.org/abs/1404.6841>.

G. W. Stewart and J. Sun, *Matrix Perturbation Theory*, Academic Press, Boston, MA, 1990.

T. Strohmer and R. W. Heath, Jr., “Grassmannian frames with applications to coding and communication,” *Appl. Comput. Harmon. Anal.*, **14** (2003), no. 3, pp. 257–275.

X. Sun, L. Wang, and J. Feng, “Further results on the subspace distance,” *Pattern Recognition*, **40** (2007), no. 1, pp. 328–329.

R. Vidal, Y. Ma, and S. Sastry, “Generalized principal component analysis,” *IEEE Trans. Pattern Anal. Mach. Intell.*, **27** (2005), no. 12, pp. 1945–1959.

L. Wang, X. Wang, and J. Feng, “Subspace distance analysis with application to adaptive Bayesian algorithm for face recognition,” *Pattern Recognition*, **39** (2006), no. 3, pp. 456–464.

R. Wang, S. Shan, X. Chen, and W. Gao, “Manifold-manifold distance with application to face recognition based on image set,” *Proc. IEEE Conf. Comput. Vis. Pattern Recognit.* (CVPR), **26** (2008), pp. 1–8.

Y.-C. Wong, “Differential geometry of Grassmann manifolds,” *Proc. Nat. Acad. Sci.*, **57** (1967), no. 3, pp. 589–594.

J. Yan and M. Pollefeys, “A general framework for motion segmentation: Independent, articulated, rigid, non-rigid, degenerate and non-degenerate,” pp. 94–106, *Proc. European Conf. Computer Vis.* (ECCV), Graz, Austria, 2006.

L. Zheng and D. N. C. Tse, “Communication on the Grassmann manifold: A geometric approach to the noncoherent multiple-antenna channel,” *IEEE Trans. Inform. Theory*, **48** (2002), no. 2, pp. 359–383.

G. Zuccon, L. A. Azzopardi, C. J. van Rijsbergen, “Semantic spaces: Measuring the distance between different subspaces,” pp. 225–236, P. Bruza, D. Sofge, W. Lawless, K. van Rijsbergen, M. Klusch (Eds), *Quantum Interaction*, Lecture Notes in Artificial Intelligence, **5494**, Springer-Verlag, Berlin, 2009.

[^1]: We will see in Section \[sec:dinfty\] that this could be attributed to the fact that $\boldsymbol{\mathsf{Met}}$, the category of metric spaces and continuous contractions, does not admit coproduct.

[^2]: As discussed in Section \[sec:infty\], these are independent of the dimension of their ambient space and may be viewed as an element of the infinite Grassmannian $\operatorname{Gr}(k,\infty)$.

[^3]: Discussed at length in [@AMS; @EAS]; we did not specify it since we have no use for it except implicitly.
