Skip to content

Distance between two affine subspaces

Theorem 7.59 (Related exercises: Exercise 7.23)

Let \(X = v+ W\), \(X' = v' + W'\) be two affine subspaces. Let us write \(d := v-v'\) and \(Z := W + W'\) (Definition 3.36). Let

\[ m := p_{Z^\bot}(d) = d - p_Z(d) \]

be the orthogonal projection of \(d\) onto \(Z^\bot\) (Corollary 7.34).

For two points \(x \in X\) and \(x' \in X'\) the following are equivalent:

  1. \(x - x' = m\).

  2. \(d(x,x') = |\hspace{-0.5mm}| {m} |\hspace{-0.5mm}|\).

  3. \(x\) and \(x'\) realize the minimal distance of \(X\) and \(X'\), i.e., \(d(x, x') = d(X, X')\).

  4. The vector \(x - x'\) is orthogonal to \(W\) and to \(W'\) (i.e., \(x-x'\) is orthogonal to any \(w \in W\), \(w' \in W'\)).

In particular, \(X\) intersects \(X'\) if and only if \(d \in Z\).

Proof. Here is a picture of the geometric ideas in the proof. For simplicity of the picture, we choose \(v' = 0\), so that \(X' = W'\) and \(d = v\).

image

1. \(\Rightarrow\) 2. is obvious since \(d(x,x') = |\hspace{-0.5mm}| {x-x'} |\hspace{-0.5mm}|\).

We next prove the equivalence 3. \(\Leftrightarrow\) 2.. We write a point \(x \in X\) as \(x = v + w\) with an arbitrary vector \(w \in W\). Likewise, \(x' = v' + w'\). We then have

\[ d(x,x') = |\hspace{-0.5mm}| {x-x'} |\hspace{-0.5mm}| = |\hspace{-0.5mm}| {v-v' + w-w'} |\hspace{-0.5mm}| = |\hspace{-0.5mm}| {d + w-w'} |\hspace{-0.5mm}|. \]

The vector \(w-w'\) is an arbitrary vector in the sum \(Z = W + W'\) (notice that for any \(w' \in W'\), also \(-w' \in W'\)).

Therefore, we are seeking the point \(z \in Z = W + W'\) such that \(|\hspace{-0.5mm}| {d+z} |\hspace{-0.5mm}|\) is minimal. This is just the distance of the affine subspace \(d + Z\) to the origin. According to Proposition 7.45, this distance is given by \(|\hspace{-0.5mm}| {m} |\hspace{-0.5mm}| = |\hspace{-0.5mm}| {p_{Z^\bot}(d)} |\hspace{-0.5mm}| = |\hspace{-0.5mm}| {d - p_Z(d)} |\hspace{-0.5mm}|\), and \(m\) is the unique vector in \(Z\) realizing that minimal distance. This shows the equivalence of 3. and 2..

3. \(\Rightarrow\) 4.: let \(x \in X\) and \(x' \in X'\) be two points realizing that minimal distance: \(d(x,x') = |\hspace{-0.5mm}| {m} |\hspace{-0.5mm}|\). In particular, this means that \(x' \in X'\) is the point realizing the minimal distance to \(x\). Again by Proposition 7.45, \(x'-x\) is therefore orthogonal to \(W'\). Switching the role of \(X\) and \(X'\) we obtain similarly that \(x-x'\) is orthogonal to \(W\).

4. \(\Rightarrow\) 1.: Our assumption means that

\[ x - x' \in W^\bot \cap W'^\bot = (W + W')^\bot = Z^\bot. \]

To see the latter equality note that some vector is orthogonal to \(W + W'\) precisely if it is orthogonal to \(W\) and to \(W'\), by the bilinearity of \({\left \langle -, - \right \rangle}\). We use this remark as follows: from

\[ x - x' = v+w - v' - w' \]

we get

\[ \begin{align*} d = v-v' & = \underbrace{x-x'}_{\in Z^\bot} + \underbrace{w' - w}_{\in Z}. \end{align*} \]

By the unicity of the representation of \(d\) as a sum of a vector in \(Z^\bot\) and one in \(Z\), this means that \(x-x' = p_{Z^\bot}(d) = m\). ◻

Example 7.60

We consider the two lines in \({\bf R}^3\)

\[ \begin{align*} X & = (2,-1,3) + L(1,1,-2) = v + W\\ X' & = (-3,0,0) + L(0,2,4) = v' + W'. \end{align*} \]

The general vectors of \(X\) and \(X'\) are of the following form, for \(a, b \in {\bf R}\).

\[ \begin{align*} x &= (2,-1,3) + a(1,1,-2) & = (2+a,-1+a,3-2a) \\ x'& = (-3,0,0) + b(0,2,4) & = (-3,2b,4b) \\ x-x' & & = (5+a,-1+a-2b,3-2a-4b) \end{align*} \]

We compute the minimal distance of \(X\) and \(X'\) by considering the condition \(x - x' \bot (1,1,-2)\) and \(x - x' \bot (0,2,4)\). This gives the following homogeneous linear system

\[ \begin{align*} 0 & = (5+a)+(-1+a-2b)-2(3-2a-4b) & = -2+6a+6b \\ 0 & = 2(-1+a-2b)+4(3-2a-4b) & = 10-6a -20 b.\\ \end{align*} \]

This can be solved to \(b = \frac 47\) and \(a = - \frac 5 {21}\). The points \(x\) and \(x'\) and their distance is then readily computed.