es

To enhance pedagogical effectiveness, the treatment of the dot product is presented in several distinct sections

Dot product

Metric

Geometrical interpretation

Duality

Projection

Solvability

 

Orthogonality


Of all the angles that vectors can make with each other, the two most important angles are when the vectors are aligned with each other, and when the vectors are at right-angles to each other. Recall formula (9) from dot product section gives the angle θ between two vectors via cos θ:

\[ \cos\theta = \frac{\mathbf{u} \bullet \mathbf{v}}{\| \mathbf{u} \| \cdot \| \mathbf{v} \|} . \]
For vectors at right-angles θ = π/2 = 90°, so cos θ = 0, and hence nonzero vectors are at right-angles only when the dot product uv = 0. We give a special name to vectors at right-angles.
Two vectors u and v in ℝn are termed orthogonal or perpendicular if their dot product uv = 0. This situation is abbreviated with a special symbol: uv. By convention, the zero vector 0 is orthogonal to all other vectors.
The term ‘orthogonal’ derives from the Greek for ‘right-angled’. Often the requirement that the orthogonal vectors are nonzero is explicitly made, but beware that sometimes the requirement may be implicit in the problem.    
Example 29: We give some examples of orthogonal vectors from ℝn for n = 2, 3, 4. On the plane ℝ², the following vectors are orthogonal: u = (2, 1) and v = (2, −4).

The standard unit vectors i = (1, 0, 0), j = (0, 1, 0), and k = (0, 0, 1) are orthogonal; \[ \mathbf{i} \bullet \mathbf{j} = 0, \quad \mathbf{i} \bullet \mathbf{k} = 0, \quad \mathbf{k} \bullet \mathbf{j} = 0. \]

We randomly generate two vectors

u1 = Flatten[RandomInteger[{-5, 5}, {1, 4}]]
{3, -4, -3, 3}
u2 = Flatten[RandomInteger[{-1, 7}, {1, 4}]]
{-1, 3, 2, 7}
\[ \mathbf{u}_1 = \left( 3, -4, -3, 3 \right) , \qquad \mathbf{u}_2 = \left( -1, 3, 2, 7 \right) \] Their dot product is
Dot[u1, u2]
0
Therefore, these two vectors are orthogonal.    ■
End of Example 29
ar1 = Graphics[{Blue, Thickness[0.01], Arrow[{{0, 0}, {Sqrt[3]/2, 1/2}}]}]; ar2 = Graphics[{Blue, Thickness[0.01], Arrow[{{0, 0}, {-1/4, Sqrt[3]/4}}]}]; arx = Graphics[{Black, Thick, Arrow[{{-0.4, 0}, {1, 0}}]}]; ary = Graphics[{Black, Thick, Arrow[{{0.0, -0.1}, {0, 0.6}}]}]; txt = Graphics[{Black, Text[Style["u", FontSize -> 18, Bold], {0.7, 0.5}], Text[Style["v", FontSize -> 18, Bold], {-0.34, 0.4}], Text[Style["O", FontSize -> 18, Bold], {-0.1, -0.1}]}]; Show[arx, ary, ar1, ar2, txt]
Figure 1: Two orthogonal vectors

Sets of orthogonal vectors

A collection of nonzero vectors where each pair of distinct vectors is perpendicular, meaning their dot product is zero, is called orthogonal. If, in addition to being orthogonal, each vector in the set has a magnitude (or norm) of 1, then the set is called orthonormal.
If {u₁, u₂, … , um} is an orthogonal set of vectors, then
\[ \left\{ \frac{\mathbf{u}_1}{\| \mathbf{u}_1 \|} , \ \frac{\mathbf{u}_2}{\| \mathbf{u}_2 \|} , \ \ldots , \frac{\mathbf{u}_m}{\| \mathbf{u}_m \|} \right\} \]
is an orthonormal set.

The standard coordinate vectors in 𝔽n always form an orthonormal set. For instance, in ℝ³ vectors

\[ \mathbf{e}_1 = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} , \quad \mathbf{e}_2 = \begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix} , \quad \mathbf{e}_3 = \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} , \]
are orthogonal because
\[ \mathbf{e}_1 \bullet \mathbf{e}_2 = \mathbf{e}_1 \bullet \mathbf{e}_3 = \mathbf{e}_2 \bullet \mathbf{e}_3 = 0 . \]
Since eiei = 1 for all i i = 1, 2, 3, this shows that set {e₁, e₂, e₃} is orthonormal.    
Example 30: Let us consider the following set of three vectors \[ \alpha = \left\{ \mathbf{u}_1 , \ \mathbf{u}_2 , \ \mathbf{u}_3 \right\} , \] where \[ \mathbf{u}_1 = \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} , \quad \mathbf{u}_2 = \begin{pmatrix} 1 \\ -2 \\ 1 \end{pmatrix} , \quad \mathbf{u}_3 = \begin{pmatrix} -4 \\ -1 \\ 2 \end{pmatrix} . \] Using Mathematica, we verify that the set is orthogonal.
u1 = {1, 2, 3}; u2 = {1, -2, 1}; u3 = {-4, -1, 2}; u1.u2
0
u1.u3
0
Dot[u2, u3]
0
Norms of these vectors are \[ \| \mathbf{u}_1 \| = \sqrt{14} , \quad \| \mathbf{u}_2 \| = \sqrt{6} , \quad \| \mathbf{u}_3 \| = \sqrt{21} . \]
Norm[u1]
Sqrt[14]
Norm[u2]
Sqrt[6]
Norm[u3]
Sqrt[21]
Therefore, these vectors in set α are not orthonormal. To make this set to be orthonormal, we divide each vector by corresponding norm: \[ \beta = \left\{ \frac{1}{\sqrt{14}} \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} , \ \frac{1}{\sqrt{6}} \begin{pmatrix} 1 \\ -2 \\ 1 \end{pmatrix} , \ \frac{1}{\sqrt{21}} \begin{pmatrix} -4 \\ -1 \\ 2 \end{pmatrix} \right\} . \] Ser β is orthonormal.    ■
End of Example 30
A nice property enjoyed by orthogonal sets is that they are automatically linearly independent.
Theorem 7: An orthogonal set is linearly independent. Therefore, it is a basis for its span.
Let α = {u₁, u₂, … , un} be an orthogonal set. We need to show that the equation \[ c_1 \mathbf{u}_1 + c_2 \mathbf{u}_2 + \cdots + c_n \mathbf{u}_n = \mathbf{0} \] has only the trivial solution c₁ = c₂ = ⋯ = cn = 0. Taking the dot product of both sides of this equation with u₁ gives \begin{align*} 0 = \mathbf{u}_1 \bullet \mathbf{0} &= \mathbf{u}_1 \bullet \left( c_1 \mathbf{u}_1 + c_2 \mathbf{u}_2 + \cdots + c_n \mathbf{u}_n \right) \\ &= c_1 \left( \mathbf{u}_1 \bullet \mathbf{u}_1 \right) = c_1 \| \mathbf{u}_1 \|^2 \end{align*} because u₁ • uj = 0 for j > 1. Since u₁ ≠ 0, its norm is a positive number, so c₁ = 0. Similarly, taking the dot product with uj shows that each cj = 0, as desired.
   
Example 31: Consider the set \[ S = \left\{ \mathbf{v}_1 , \mathbf{v}_2 , \mathbf{v}_3 \right\} = \left\{ \begin{pmatrix} 1 \\ 1 \\ 0 \end{pmatrix} , \begin{pmatrix} 1 \\ -1 \\ 0 \end{pmatrix} , \begin{pmatrix} 0 \\ 0 \\ 5 \end{pmatrix} \right\} . \] Check that these three vectors are orthogonal:
  • v₁ • v₂ = 1 · 1 + 1 · (−1) + 0 · 0 = 0;
  • v₁ • v₃ = 1 · 0 + 1 · 0 + 0 · 5 = 0;
  • v₂ • v₃ = 1 · 0 + (−1) · 0 + 0 · 5 = 0.
So the set is orthogonal, but not orthonormal because
  • v₁∥ = √2;
          v1 = {1, 1, 0}; Norm[v1]
          Sqrt[2]
  • v₂∥ = √2;
          v2 = {1, -1, 0}; Norm[v2]
          Sqrt[2]
  • v₃∥ = 5.
          v3 = {0, 0, 5}; Norm[v3]
          5
Now we show that these vectors are linearly independent. Suppose we have a linear combination \[ c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2 + c_3 \mathbf{v}_3 = 0. \] Take dot product with v₁: \[ \mathbf{v}_1 \bullet \left( c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2 + c_3 \mathbf{v}_3 \right) = c_1 \| \mathbf{v}_1 \|^2 = c_1 \cdot 2 = 0 . \] This forces c₁ = 0.

Similarly, dotting with v₂ and v₃ gives c₂ = 0 and c₃ = 0. Thus, set S is linearly independent.    ■

End of Example 31

The next couple of innocuous looking theorems are vital keys to important results in subsequent chapters.

Theorem 8: There is no nonzero vector orthogonal to all n standard unit vectors in ℝn.
Let u = (u₁, u₂, … , uₙ) be a vector in ℝn that is orthogonal to all n standard unit vectors. Since every standard vector ei = (0, 0, … , 1, 0, …, 0) has only one non zero entry in position i, we get
  • 0 = ue₁ = (u₁, u₂, … , un) • (1, 0, … , 0) = u₁,
  • 0 = ue₂ = (u₁, u₂, … , un) • (0, 1, 0, … , 0) = u₂,
  • and so on
  • 0 = uen = (u₁, u₂, … , un) • (0, 0, … , 0, 1) = un.
Since u₁ = u₂ = ⋯ = un = 0, the only vector that is orthogonal to all the standard unit vectors is u = 0, the zero vector.
   
Example 32: Let \[ \mathbf{x} = \begin{pmatrix} a \\ b \\ c \\ d \end{pmatrix} \] be an arbitrary vector in ℝ4×1 ≌ ℝ4. The standard unit vectors are \[ \mathbf{e}_1 = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \end{pmatrix} , \ \mathbf{e}_2 = \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0 \end{pmatrix} , \ \mathbf{e}_3 = \begin{pmatrix} 0 \\ 0 \\ 1 \\ 0 \end{pmatrix} , \ \mathbf{e}_4 = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 1 \end{pmatrix} . \] Suppose x is orthogonal to all of them.

Compute the dot products:

  • xe₁ = 𝑎,
  • xe₂ = b,
  • xe₃ = c,
  • xe₄ = d,
If x is orthogonal to each ei, then all of these must be zero: \[ a = 0, \quad b=0, \quad c =0 , \quad d = 0 . \] Therefore, the only vector orthogonal to all four standard basis vectors is the zero vector.

We also give a matrix version of Theorem 8.

The standard unit vectors e₁, e₂, … , eₙ form the columns of the identity matrix Iₙ. The condition that vector x is orthogonal to every vector ei means that \[ \mathbf{e}_i \bullet \mathbf{x} = \mathbf{e}_i^{\mathrm T} \mathbf{x} = 0 \qquad \forall i. \] However, the vector of all these dot products is exactly the matrix product \[ \mathbf{I}_n \mathbf{x} = 0 . \] Since Ix = x, we conclude x = 0.

The matrix form is important because

  • The standard basis vectors are the columns of Iₙ.
  • Their transposes are the rows of Iₙ.
  • Orthogonality to each ei is equivalent to saying every row of Iₙ annihilates x.
  • However, the rows of Iₙ simply extract the coordinates of x.
  • So all coordinates must be zero.
This is exactly the matrix equation Ix = 0, whose only solution is the zero vector.    ■
End of Example 32
Theorem 9: In a set of orthogonal unit vectors in ℝn, there can be no more than n vectors in the set.
Let { v₁, v₂, … , vk } be a set of orthogonal unit vectors in ℝn. By “orthogonal” we mean that for all ij, \[ \mathbf{v}_i \bullet \mathbf{v}_j = 0, \] and by “unit” we mean \[ \| \mathbf{v}_i\| = 1\quad \mathrm{for\ all\ }i. \]

We first show that such a set is linearly independent. Consider a linear combination \[ \alpha_1 \mathbf{v}_1 + \alpha_2 \mathbf{v}_2 + \cdots +\alpha_k \mathbf{v}_k = 0, \] where α₁, α₂, … , αk ∈ ℝ. We will show that all αi = 0.

Take the dot product of both sides with vj, for some fixed j ∈ [1..k] = { 1, 2, … k }: \[ \left( \alpha _1 \mathbf{v}_1 +\dots +\alpha _k \mathbf{v}_k\right) \bullet \mathbf{v}_j = 0\bullet \mathbf{v}_j =0. \] Using linearity of the dot product, this becomes \[ \alpha _1 (\mathbf{v}_1 \bullet \mathbf{v}_j ) + \dots +\alpha _k (\mathbf{v}_k\bullet \mathbf{v}_j ) = 0. \] By orthogonality, vivj = 0 whenever ij, and vjvj = ∥ vj ∥² = 1. Hence all terms vanish except the i = j term: \[ \alpha _j(v_j\cdot v_j)=\alpha _j\cdot 1=\alpha _j. \] Therefore, \[ \alpha _j = 0. \] Since j was arbitrary, this shows that α₁ = α₂ = ⋯ = αk = 0. Thus, the set { v₁, v₂, … , vk } is linearly independent.

Now recall the fundamental fact from linear algebra: in ℝn, any linearly independent set can have at most n vectors. Equivalently, the maximum size of a linearly independent set in ℝn is n, the dimension of the space.

Since { v₁, v₂, … , vk } is linearly independent in ℝn, we must have \[ k\leq n. \] This completes the proof.

   
Example 33: Suppose someone claims they have four orthogonal unit vectors in ℝ³: \[ \mathbf{u}_1,\; \mathbf{u}_2,\; \mathbf{u}_3,\; \mathbf{u}_4\in \mathbb{R}^{3\times 1} \cong \mathbb{R}^{3} . \] Each ui satisfies:
  • ui∥ = 1     for i = 1, 2, 3, 4;
  • uiuj = 0     for all ij.
Let’s assemble these vectors as columns of a matrix: \[ \mathbf{U}=\left( \begin{matrix}|&|&|&| \\ \mathbf{u}_1&\mathbf{u}_2&\mathbf{u}_3&\mathbf{u}_4 \\ |&|&|&|\end{matrix}\right) . \] So U is a 3 × 4 matrix.

Orthogonality + unit length gives a key identity. Because the columns are orthonormal, we must have: \[ \mathbf{U}^{\mathrm T} \mathbf{U}= \mathbf{I}_4. \] But here is the contradiction:

  • UTU is a 4 × 4 matrix.
  • The rank of UTU equals the rank of U.
  • But U is a 3 × 4 matrix, so its rank is at most 3.
Thus: \[ \operatorname{rank} (U^TU)\leq 3. \] However, I₄ has rank 4. This is impossible. Therefore, there cannot exist four mutually orthogonal unit vectors in ℝ4. The maximum is three, which is exactly the dimension.

Why this supports Theorem 9? The same argument works in general:

  • If you had k orthogonal unit vectors in ℝn×1 ≌ ℝn, the matrix U with those vectors as columns would satisfy \[ \mathbf{U}^{\mathrm T}\mathbf{U}=\mathbf{I}_k . \]
  • But rank(U) ≤ n, so rank(UTU) ≤ n.
  • Since rank(Ik) = k, we must have kn.
u = {u1, u2, u3}; e1 = {1, 0, 0}; e2 = {0, 1, 0}; e3 = {0, 0, 1}; Solve[{Dot[u, e1] == 0, Dot[u, e3] == 0, Dot[u, e2] == 0}, {u1, u2, u3}]
{{u1 -> 0, u2 -> 0, u3 -> 0}}
Thus, you can never have more than n orthogonal unit vectors in ℝn.

Theorem 9 (Geometric meaning): In ℝn, you cannot fit more than n mutually perpendicular directions. Each orthogonal unit vector represents a new, independent direction in the space.

Let’s visualize this dimension by dimension.

In ℝ²: Only 2 orthogonal unit vectors are possible. Geometrically:

  • The first unit vector picks a direction (say, pointing east).
  • The second must be perpendicular to it (pointing north).
  • There is no third direction in the plane that is perpendicular to both east and north.
Any third vector must lie in the plane, so it must have some component along one of the first two directions. Thus it cannot be perpendicular to both.

So in ℝ², the maximum is 2.

In ℝ³: Only 3 orthogonal unit vectors are possible. Think of the familiar axes:

  • x-axis or x₁,
  • y-axis or x₂,
  • z-axis or x₃.
These are three mutually perpendicular directions. Now imagine trying to add a fourth unit vector that is perpendicular to all three axes.

Geometrically, this is impossible:
  • Any vector in ℝ³ must have some component along at least one of the three axes.
  • If it had zero component along all three axes, it would be the zero vector.
  • But the zero vector is not a unit vector.
So in ℝ³, the maximum is 3.

Generalizing to ℝn ≌ ℝn×1 ≌ ℝ1×n.

Each orthogonal unit vector you add forces the next one to lie in a smaller and smaller “remaining” space. Here’s the geometric picture:

  1. The first vector picks a direction in ℝn. The remaining space is an (n-1)-dimensional hyperplane perpendicular to it.
  2. The second vector must lie in that (n-1)-dimensional hyperplane. The remaining space becomes (n-2)-dimensional.
  3. The third vector must lie in that (n-2)-dimensional space. The remaining space becomes (n-3)-dimensional.
Continue this process:
  • After choosing k orthogonal unit vectors, the remaining space has dimension n-k.
  • Once k=n, the remaining space has dimension 0.
  • There is no room for an (n+1)-st perpendicular direction.
This is the geometric heart of the theorem.

A simple geometric analogy. Imagine trying to place arrows so that each one points in a direction completely independent of the others:

  • In 2D, you can place 2 such arrows.
  • In 3D, you can place 3.
  • In 4D, you can place 4.
  • In n-dimensions, you can place n vectors.
  • After that, there is literally no new direction left that is perpendicular to all the previous ones.

    Orthogonal unit vectors behave like coordinate axes. Each new orthogonal direction consumes one dimension. After n mutually perpendicular directions, no new direction remains.

    We generate k random vectors in ℝn, orthonormalize them, and check the rank.

    n = 5; (* ambient dimension *) k = 7; (* attempt to create 7 orthogonal unit vectors *) SeedRandom[1234]; vecs = RandomReal[{-1, 1}, {k, n}]; orthoset = Orthogonalize[vecs]; (* Gram–Schmidt *) Length[orthoset] MatrixRank[orthoset]
    Mathematica automatically drops dependent vectors: you cannot get more than n orthogonal directions in ℝn.

    Let U be the n × k matrix whose columns are the vectors ui. The Gram matrix (Gramian) is \[ \mathbf{G}=\mathbf{U}^{\top }\mathbf{U}. \] If the vectors are orthonormal, then G = Ik. However, \[ \operatorname{rank} (G)=\operatorname{rank} (U)\leq n. \] Since rank(Ik) = k, we must have kn. Mathematica demonstration:

    n = 4; k = 6; SeedRandom[2024]; vecs = RandomReal[{-1, 1}, {n, k}]; U = Orthogonalize[vecs, Method -> "GramSchmidt"] // Transpose; G = Transpose[U].U; {MatrixRank[U], MatrixRank[G], G}
    Interpretation:
    • MatrixRank[U] returns 4.
    • MatrixRank[G] returns 4, even though G is 6 × 6.
    • The Gram matrix cannot be full rank unless kn.
    This is the matrix‑theoretic heart of the theorem.

    When the set of vectors is orthogonal but not orthonormal, orthogonality alone does not force unit length. However, the same dimension bound applies: you still cannot exceed n vectors.    ■

    End of Example 33
Corollary 1: If ℝn = span{v₁, v₂, … , vm}, then x from ℝn is zero vector if and only if xvj = 0 for each j = 1,2, … , m.
Let v₁, v₂, … , vm ∈ ℝn be such that \[ \mathbb{R}^{n} = \operatorname{span} \left\{ \mathbf{v}_1, \mathbf{v}_2, \dots , \mathbf{v}_m \right\} . \] Then for any x ∈ ℝn, \[ \mathbf{x}=0\quad \Longleftrightarrow \quad \mathbf{x} \bullet \mathbf{v}_j=0 \quad \mathrm{\ for\ each\ }j=1,2,\dots ,m. \]

Proof:    ( ⟹ )    If x = 0, then for each j, \[ \mathbf{x} \bullet \mathbf{v}_j = 0 \qquad j = 1, 2, \ldots , m, \] so the forward implication is immediate.

( ⟸ ) Now assume \[ \mathbf{x} \bullet \mathbf{v}_j =0\quad \mathrm{for\ all\ }j=1,\dots ,m. \] We must show x = 0.

Let y ∈ ℝn be arbitrary. Since ℝn = span{v₁, v₂, … , vm}, there exist scalars α₁, α₂, … , αm such that \[ \mathbf{y}=\alpha_1 \mathbf{v}_1 +\alpha_2 \mathbf{v}_2 +\cdots +\alpha_m \mathbf{v}_m. \] Using bilinearity of the dot product, we compute \[ \mathbf{x} \bullet \mathbf{y}=\mathbf{x} \bullet \left( \alpha_1 \mathbf{v}_1 +\cdots +\alpha_m \mathbf{v}_m \right) = \alpha_1 \left( \mathbf{x}\bullet \mathbf{v}_1 \right) +\cdots +\alpha_m \left( \mathbf{x}\bullet \mathbf{v}_m\right) . \] By assumption, each xvj = 0, so every term on the right-hand side is zero; hence, \[ \mathbf{x} \bullet \mathbf{y} =0 \quad \mathrm{for\ all\ }\mathbf{y}\in \mathbb{R}^{n} . \] In particular, taking y = x, we obtain \[ \mathbf{x} \bullet \mathbf{x} = 0. \] But in ℝn, xx = ∥x∥², and ∥x∥² = 0 if and only if x = 0. Therefore, x = 0.

Combining both directions, we conclude \[ \mathbf{x}=0\quad \Longleftrightarrow \quad \mathbf{x} \bullet \mathbf{v}_j = 0\mathrm{\ for\ all\ }j=1,\ldots ,m. \]

   
Example 34: This example consists of three parts:
  • A 3‑dimensional example (non‑orthogonal spanning set)
  • An example where the spanning set has more than n vectors
  • A geometric visualization showing why a vector orthogonal to a spanning set must be zero
Each example is self‑contained.

1. A 3‑Dimensional Example (Non‑Orthogonal Spanning Set)

Let \[ \mathbf{v}_1 =\left( \begin{matrix}1\\ 0\\ 1\end{matrix}\right) ,\quad \mathbf{v}_2 =\left( \begin{matrix}1\\ 1\\ 0\end{matrix}\right) ,\quad \mathbf{v}_3 =\left( \begin{matrix}0\\ 1\\ 1\end{matrix}\right) . \] These are not orthogonal, but the matrix \[ \left( \begin{matrix}1&1&0\\ 0&1&1\\ 1&0&1\end{matrix}\right) \] has determinant 2 ≠ 0, so they span ℝ³.

Corollary 1 says: If xvj = 0 for all j, then x = 0.

Mathematica code

* Non-orthogonal spanning set in R^3 *) v1 = {1, 0, 1}; v2 = {1, 1, 0}; v3 = {0, 1, 1}; (* Symbolic vector *) x = {x1, x2, x3}; (* Dot products *) dots = {x.v1, x.v2, x.v3} (* Solve x·vj = 0 for all j *) sol = Solve[dots == {0, 0, 0}, {x1, x2, x3}] (* Substitute solution *) x /. sol (* Non-orthogonal spanning set in R^3 *) v1 = {1, 0, 1}; v2 = {1, 1, 0}; v3 = {0, 1, 1}; (* Symbolic vector *) x = {x1, x2, x3}; (* Dot products *) dots = {x.v1, x.v2, x.v3} (* Solve x·vj = 0 for all j *) sol = Solve[dots == {0, 0, 0}, {x1, x2, x3}] (* Substitute solution *) x /. sol
{x1 + x3, x1 + x2, x2 + x3}
{{x1 -> 0, x2 -> 0, x3 -> 0}}

2. A Spanning Set With More Than n Vectors. Let’s work in ℝ³ again, but now use four vectors: \[ \mathbf{v}_1 =\left( \begin{matrix}1\\ 0\\ 0\end{matrix}\right) ,\quad \mathbf{v}_2 =\left( \begin{matrix}0\\ 1\\ 0\end{matrix}\right) ,\quad \mathbf{v}_3 =\left( \begin{matrix}0\\ 0\\ 1\end{matrix}\right) ,\quad \mathbf{v}_4 =\left( \begin{matrix}1\\ 1\\ 1\end{matrix}\right) . \] These clearly span ℝ&sip3; (the first three already do).

Corollary 1 still applies: If xvj = 0 for all four vectors, then x = 0.

Mathematica code

(* A spanning set with more than n vectors *) v1 = {1, 0, 0}; v2 = {0, 1, 0}; v3 = {0, 0, 1}; v4 = {1, 1, 1}; x = {x1, x2, x3}; dots = {x.v1, x.v2, x.v3, x.v4} sol = Solve[dots == {0, 0, 0, 0}, {x1, x2, x3}] x /. sol
{x1, x2, x3, x1 + x2 + x3}
{{x1 -> 0, x2 -> 0, x3 -> 0}}
{{0, 0, 0}}
Even with more than n vectors, the only vector orthogonal to all of them is still the zero vector.

3. Geometric Visualization in ℝ². Let’s visualize the 2D example from earlier: \[ \mathbf{v}_1 =\left( \begin{matrix}1\\ 0\end{matrix}\right) ,\quad \mathbf{v}_2 =\left( \begin{matrix}1\\ 1\end{matrix}\right) . \] We will:

  • Plot the spanning vectors.
  • Plot the lines xv₁ = 0 and xv₂ = 0.
  • Show that their intersection is only the origin.
Mathematica code
(* Vectors in R^2 *) v1 = {1, 0}; v2 = {1, 1}; (* Lines x·v1 = 0 and x·v2 = 0 *) line1 = ImplicitRegion[x1 == 0, {{x1, -2, 2}, {x2, -2, 2}}]; line2 = ImplicitRegion[x1 + x2 == 0, {{x1, -2, 2}, {x2, -2, 2}}]; Show[ RegionPlot[line1, PlotStyle -> LightBlue], RegionPlot[line2, PlotStyle -> LightGreen], Graphics[ { Thick, Blue, Arrow[{{0, 0}, v2}], Black, PointSize[Large], Point[{0, 0}] } ], PlotRange -> {{-2, 2}, {-2, 2}}, Axes -> True, AxesLabel -> {"x1", "x2"}, AspectRatio -> 1 ]
Figure 33.1: The line with normal vector

This plot shows:
  • The blue and green regions are the sets of points orthogonal to v_1 and v_2.
  • Their intersection is only the origin.
  • This visually confirms Corollary 1.
The following function, written in Mathematica
  • Accepts a list of vectors \{ v_1,\dots ,v_m\}
  • Forms symbolic variables for a vector x\in \mathbb{R^{\mathnormal{n}}}
  • Computes all dot products x\cdot v_j
  • Solves the system x\cdot v_j=0
  • Returns True if the only solution is x=0, and False otherwise
  • Also returns the solution itself for inspection
Clear[TestCorollary1] TestCorollary1[vectors_List] := Module[ {n, vars, dots, sol, zeroSol}, (* Dimension of ambient space *) n = Length[First[vectors]]; (* Fresh symbolic variables for x *) vars = Array[Unique["x"], n]; (* Dot products x·v_j *) dots = (vars.#) & /@ vectors; (* Solve x·v_j == 0 for all j *) sol = Solve[dots == ConstantArray[0, Length[vectors]], vars, Reals]; (* The expected zero solution *) zeroSol = {Thread[vars -> ConstantArray[0, n]]}; <| "DotProducts" -> dots, "Solution" -> sol, "Corollary1Holds" -> (sol === zeroSol) |> ]
Application of this function to example 1:
v1 = {1, 0, 1}; v2 = {1, 1, 0}; v3 = {0, 1, 1}; TestCorollary1[{v1, v2, v3}]
<|"DotProducts" -> {x27[1] + x27[3], x27[1] + x27[2], x27[2] + x27[3]}, "Solution" -> {{x27[1] -> 0, x27[2] -> 0, x27[3] -> 0}}, "Corollary1Holds" -> True|>
In case of example 2, we get
v1 = {1, 0, 0}; v2 = {0, 1, 0}; v3 = {0, 0, 1}; v4 = {1, 1, 1}; TestCorollary1[{v1, v2, v3, v4}]
<|"DotProducts" -> {x28[1], x28[2], x28[3], x28[1] + x28[2] + x28[3]}, "Solution" -> {{x28[1] -> 0, x28[2] -> 0, x28[3] -> 0}}, "Corollary1Holds" -> True|>
Finally, we test this function for dsata of example3:
v1 = {1, 0, 0}; v2 = {0, 1, 0}; TestCorollary1[{v1, v2}]
<|"DotProducts" -> {x29[1], x29[2]}, "Solution" -> {{x29[1] -> 0, x29[2] -> 0}}, "Corollary1Holds" -> False|>
   ■
End of Example 34
Theorem 10 (Pythagorean): For any orthogonal set of vectors {u₁, u₂, … , un}, we have \[ \| \mathbf{u}_1 + \cdots + \mathbf{u}_n \|^2 = \| \mathbf{u}_1 \|^2 + \cdots + \| \mathbf{u}_n \|^2 . \]
Proof by induction. For n = 2, we have \[ \| \mathbf{u} + \mathbf{v} \|^2 = \left( \mathbf{u} + \mathbf{v} \right) \bullet \left( \mathbf{u} + \mathbf{v} \right) = \| \mathbf{u} \|^2 + 2 \left( \mathbf{u} \bullet \mathbf{v} \right) + \| \mathbf{v} \|^2 . \] If uv, then we get the Pythagorean Theorem.

Assuming that the statement is true up to n − 1, we consider the general case. The sum of first orthogonal vectors we denote by v = u₁ + u₂ + ⋯ + un-1. Then the sum of n vectors is written as sum of two vectors: \[ \mathbf{u}_1 + \cdots + \mathbf{u}_{n-1} + \mathbf{u}_n = \mathbf{v} + \mathbf{u}_n . \] However, the Pythagorean Theorem has been established for two terms.

   
Example 35: Consider the orthogonal set \[ \mathbf{u}_1 =\left( \begin{matrix}3\\ 0\\ 0\end{matrix}\right) ,\quad \mathbf{u}_2 =\left( \begin{matrix}0\\ 4\\ 0\end{matrix}\right) ,\quad \mathbf{u}_3 =\left( \begin{matrix}0\\ 0\\ 12\end{matrix}\right) . \] Step 1: Check orthogonality Compute dot products:
  • u₁ • u₂ = 0;
  • u₁ • u₃ = 0;
  • u₂ • u₃ = 0.
So the set is orthogonal.

Step 2: Compute the norm of the sum. First compute the sum: \[ \mathbf{u}_1 +\mathbf{u}_2 +\mathbf{u}_3 =\left( \begin{matrix}3\\ 4\\ 12\end{matrix}\right) . \] Now compute its squared norm: \[ \| \mathbf{u}_1 +\mathbf{u}_2 +\mathbf{u}_3 \| ^2 = 3^2+4^2+12^2=9+16+144 = 169. \]

Step 3: Compute the sum of the individual squared norms \[ \| \mathbf{u}_1\| ^2 =3^2 =9,\qquad \| \mathbf{u}_2\| ^2 =4^2 =16,\qquad \| \mathbf{u}_3\| ^2 =12^2 =144. \] Add them: \[ \| \mathbf{u}_1\| ^2 +\| \mathbf{u}_2\| ^2 +\| \mathbf{u}_3\| ^2 =9+16+144=169. \]

Step 4: Compare both sides. \[ \| \mathbf{u}_1 +\mathbf{u}_2 +\mathbf{u}_3\| ^2 =169\quad \mathrm{and}\quad \| \mathbf{u}_1\|^2 +\| \mathbf{u}_2\|^2 +\| \mathbf{u}_3\|^2 =169. \] They match exactly, confirming the theorem.

Why this works? Because the vectors are orthogonal, all cross‑terms vanish when expanding the squared norm: \begin{align*} &\| \mathbf{u}_1 +\mathbf{u}_2 +\mathbf{u}_3\|^2 = \left( \mathbf{u}_1 +\mathbf{u}_2 +\mathbf{u}_3\right) \bullet \left( \mathbf{u}_1 +\mathbf{u}_2 +\mathbf{u}_3 \right) \\ &=\| \mathbf{u}_1\|^2 +\| \mathbf{u}_2\|^2 +\| \mathbf{u}_3\|^2\quad \mathrm{(all\ dot\ products\ }\mathbf{u}_i \bullet \mathbf{u}_j =0\mathrm{\ for\ }i\neq j). \end{align*} This is the higher‑dimensional version of the familiar Pythagorean theorem.

Geometrically:

  • u₁ lies along the x‑axis
  • u₂ lies along the y‑axis
  • u₃ lies along the z‑axis.
Each one of vectors points in a direction perpendicular to the others.

Step 1: Visualize the sum as a diagonal. If you place these vectors tail‑to‑tail, they form three perpendicular edges of a rectangular box (a rectangular parallelepiped).

Now imagine walking: 3 units along the x‑axis, then 4 units along the y‑axis, then 12 units along the z‑axis. The resulting displacement vector is \[ \mathbf{u}_1 +\mathbf{u}_2 +\mathbf{u}_3 =\left( \begin{matrix}3\\ 4\\ 12\end{matrix}\right) . \] This is the space diagonal of the rectangular box.

Step 2: Apply the Pythagorean theorem twice because the edges are perpendicular, the diagonal length can be computed using Pythagoras:

First in the base (x–y plane): \[ \mathrm{base\ diagonal}^{2} = 3^2+4^2=25. \] Then in 3D: \[ \| \mathbf{u}_1 +\mathbf{u}_2 +\mathbf{u}_3\|^2=(\mathrm{base\ diagonal})^2+12^2=25+144=169. \]

Step 3: Compare with the sum of squared lengths \[ \| \mathbf{u}_1\|^2 =9,\quad \| \mathbf{u}_2\|^2 =16,\quad \| \mathbf{u}_3\|^2 =144. \] Add them: \[ 9+16+144=169. \] Exactly the same.

Geometric Insight Each vector contributes a “leg” of a right angle:

u₁ is perpendicular to u₂, both are perpendicular to u₃.

So the sum vector is the hypotenuse of a right triangle in 3D (or more precisely, the diagonal of a rectangular box). Because all angles between the vectors are right angles, no cross‑terms appear—only the squared lengths matter. This is the geometric heart of Theorem 10.    ■

End of Example 35

The following result provides explicit formula for determination of coefficients in linear combination with respect to the orthogonal sets of vectors.

Theorem 11 (Fourier expansion): Let α = {v₁, v₂, … , vn} be an orthogonal set of vectors. For any y from span of the set α, we have \[ \mathbf{y} = \frac{\mathbf{y} \bullet \mathbf{v}_1}{\| \mathbf{v}_1 \|^2}\,\mathbf{v}_1 + \frac{\mathbf{y} \bullet \mathbf{v}_2}{\| \mathbf{v}_2 \|^2}\,\mathbf{v}_1 + \cdots + \frac{\mathbf{y} \bullet \mathbf{v}_1}{\| \mathbf{v}_n \|^2}\,\mathbf{v}_n . \]
Let y = cv₁ + cv₂ + ⋯ + cnvn. Taking the dot product of both sides of this equation with arbitrary set vector vj, we get \[ \mathbf{v}_j \bullet \mathbf{y} = c_j \left( \mathbf{v}_j \bullet \mathbf{v}_j \right) \] since the dot product of vj with any other set vector vi is zero for ij.
   
Example 36: Take the orthogonal set \[ \mathbf{v}_1 =\left( \begin{matrix}3\\ 0\\ 0\end{matrix}\right) ,\quad \mathbf{v}_2 =\left( \begin{matrix}0\\ 4\\ 0\end{matrix}\right) ,\quad \mathbf{v}_3 =\left( \begin{matrix}0\\ 0\\ 12\end{matrix}\right) . \] These are clearly orthogonal (all dot products are zero). Let’s choose a vector y from their span. For example: \[ \mathbf{y} =\left( \begin{matrix}6\\ 8\\ 24\end{matrix}\right) . \] Notice that y is actually \[ \mathbf{y} =2\mathbf{v}_1 +2\mathbf{v}_2 +2\mathbf{v}_3, \] but we will recover this representation using the theorem.

Step 1: Compute the coefficients \( \displaystyle \quad \frac{\mathbf{y} \bullet \mathbf{v}_i}{\| \mathbf{v}_i\|^2} . \quad \) For v₁: \[ \mathbf{y} \bullet \mathbf{v}_1 = 6\cdot 3=18,\qquad \| \mathbf{v}_1\|^2=3^2 =9, \] and \[ \frac{\mathbf{y} \bullet \mathbf{v}_1}{\| \mathbf{v}_1\|^2} =\frac{18}{9} =2. \] For v₂: \[ \mathbf{y}\bullet \mathbf{v}_2 =8\cdot 4=32,\qquad \| \mathbf{v}_2\|^2 =4^2 =16 , \] and \[ \frac{\mathbf{y}\bullet \mathbf{v}_2}{\| \mathbf{v}_2\|^2} =\frac{32}{16}=2. \] For v₃: \[ \mathbf{y} \bullet \mathbf{v}_3 =24\cdot 12 =288,\qquad \| \mathbf{v}_3\|^2 =12^2 =144 , \] and \[ \frac{\mathbf{y} \bullet \mathbf{v}_3}{\| \mathbf{v}_3\|^2} =\frac{288}{144}=2. \]

Step 2: Reconstruct y using the theorem: \[ \mathbf{y} =2\mathbf{v}_1 +2\mathbf{v}_2 +2\mathbf{v}_3 = 2\left( \begin{matrix}3\\ 0\\ 0\end{matrix}\right) +2\left( \begin{matrix}0\\ 4\\ 0\end{matrix}\right) +2\left( \begin{matrix}0\\ 0\\ 12\end{matrix}\right) . \] Compute the sum: \[ \mathbf{y} =\left( \begin{matrix}6\\ 8\\ 24\end{matrix}\right) , \] which matches the original vector exactly.

Why this example supports the theorem?

  • The vectors v₁, v₂, v₃ form an orthogonal basis for their span.
  • The theorem says that any vector in that span can be decomposed into components along each vi.
  • The coefficient of each vi is exactly the projection of y onto vi.
  • Because the set is orthogonal, these projections add cleanly with no cross‑terms.
This is the finite‑dimensional analogue of Fourier series: each coefficient is an inner product (which is dot product in our case) divided by a norm squared.    ■
End of Example 36

Normal vectors and equations of a plane

This section uses the dot product to find equations of a plane in 3D and then in a general case. The key is to write points in the plane as all those at right-angles to a certain direction. This direction is perpendicular to the required plane, and is called a normal. Let’s start with an example of the idea in 2D.    
Example 37: Suppose we want to find an equation of the line that is perpendicular to the vector (2, −1) and passes through the origin.

Recall that orthogonal vectors have their dot product equals to zero. Thus, the position vector x of every point in the line satisfies the dot product x • (2, −1) = 0. For x = (x, y), we get 2xy = 0, so the equation of the line is 2xy = 0.

line = Graphics[{Blue, Thickness[0.02], Line[{{-0.5, -1}, {0.5, 1}}]}]; nomal = Graphics[{Red, Thickness[0.02], Arrowheads[0.14], Arrow[{{0, 0}, {1, -0.5}}]}]; arx = Graphics[{Black, Thick, Arrow[{{-0.5, 0}, {1, 0}}]}]; ary = Graphics[{Black, Thick, Arrow[{{0.0, -1}, {0, 1}}]}]; txt = Graphics[{Black, Text[Style["y", FontSize -> 18, Italic], {-0.1, 0.95}], Text[Style["x", FontSize -> 18, Italic], {0.95, 0.1}], Text[Style["O", FontSize -> 18, Bold], {-0.1, 0.1}], Text[Style["(2, -1)", FontSize -> 18, Bold], {0.85, -0.3}]}]; Show[txt, arx, ary, line, nomal]
Figure 3.1: The line with normal vector

Another problem:    Now we consider a similar problem but asking to find the equation of the line that passes through the point (0, 0.7) instead of the origin. Then it has the displacement vector x − (0, 0.7) that must be orthogonal to (2, −1), as illustrated in the figure below. That is, the equation of the line is (x, y − 0.7) • (2, −1) = 0. Evaluating the dot product gives 0.7 + 2xy = 0.

Dot[{x, y-0.7}, {2, -1}]
0.7 + 2 x - y

line = Graphics[{Blue, Thickness[0.01], Line[{{-0.5, -1}, {0.5, 1}}]}]; nomal = Graphics[{Red, Thickness[0.02], Arrowheads[0.14], Arrow[{{-0.5, 0.25}, {1, -0.5}}]}]; arx = Graphics[{Black, Thick, Arrow[{{-1.2, 0}, {1, 0}}]}]; ary = Graphics[{Black, Thick, Arrow[{{0.0, -1}, {0, 1}}]}]; txt = Graphics[{Black, Text[Style["y", FontSize -> 18, Italic], {-0.1, 0.95}], Text[Style["x", FontSize -> 18, Italic], {0.95, 0.1}], Text[Style["O", FontSize -> 18, Bold], {-0.15, -0.1}], Text[Style["(2, -1)", FontSize -> 18, Bold], {0.85, -0.22}]}]; line2 = Graphics[{Blue, Thickness[0.02], Line[{{-0.5 - 0.7, -1}, {0.5 - 0.7, 1}}]}]; Show[txt, arx, ary, line, nomal, line2]
Figure 3.2: The shited line with the normal vector

   ■
End of Example 37

Now we are going to find the equation of plane in ℝ³ that goes through a given point P and is perpendicular to a given vector n, called a normal vector. Suppose that x(x, y, z) points to the plane, and we know the position of point P(x₀, y₀, z₀) and the normal vector n(𝑎, b, c). Identifying vector x with the point X on the plane, we claim that \( \displaystyle \quad \vec{PX} \quad \) is perpendicular to the normal vector. Taking the dot product, we obtain the required equation of the plane:

\[ \vec{PX} \bullet \mathbf{n} = 0 \quad \iff \quad a\left( x - x_0 \right) + b \left( y - y_0 \right) + c \left( z - z_0 \right) = 0 . \]
Equivalently,
\[ a\,x + b\,y + c\,z = d = a\,x_0 + b\,y_0 + c\,z_0 . \]
p0 = {1, 2, 1}; n = {2, -1, 3}; v1 = Normalize[NullSpace[{n}][[1]]]; v2 = Normalize[NullSpace[{n}][[2]]]; Show[ ParametricPlot3D[p0 + u v1 + v v2, {u, -7, 7}, {v, -7, 7}, PlotStyle -> Opacity[0.7, LightBlue], Mesh -> None], Graphics3D[{Red, Thickness[0.01], Arrowheads[0.05], Arrow[{p0, p0 + n*1.5}]}], Axes -> True, AxesLabel -> {"x", "y", "z"}, Boxed -> False]
Figure 2: The plane with normal vector

   
Example 38: Let’s define the plane P ⊂ ℝ4 by the two spanning vectors \[ \mathbf{v}_1 =(1,\, 1,\, 0,\, 0),\qquad \mathbf{v}_2=(0,\, 1,\, 1,\, 0). \] This is a 2‑dimensional subspace of ℝ4. A parametric description is \[ P=\left\{ \, s\, \mathbf{v}_1 +t\, \mathbf{v}_2 \ : \ s,t\in \mathbb{R}\, \right\} . \] Explicitly: \[ (s,t)\mapsto (s,\; s+t,\; t,\; 0). \]

2. Mathematica Code: Define the plane

v1 = {1, 1, 0, 0}; v2 = {0, 1, 1, 0}; param[s_, t_] := s v1 + t v2 v1 = {1, 1, 0, 0}; v2 = {0, 1, 1, 0}; param[s_, t_] := s v1 + t v2
Check linear independence:
MatrixRank[{v1, v2}]
2

3. Normal vectors in ℝ4. A normal vector n satisfies \[ {\bf n} \bullet \mathbf{v}_1 = 0,\qquad {\bf n} \bullet \mathbf{v}_2 =0. \] Solve for all normals:

Solve[ {n1, n2, n3, n4}.v1 == 0 && {n1, n2, n3, n4}.v2 == 0, {n1, n2, n3, n4} ]
{{n1 -> -n2, n3 -> -n2}}
You get a 2‑dimensional family (−n₂, n₂, −n₂, n₄) of normals (as expected, since the orthogonal complement of a plane in ℝ4 is also a plane).

4. Projection of a point in ℝ4 onto the plane. Let x ∈ ℝ4 ≌ ℝ4×1. The projection onto the plane spanned by v₁, v₂ is \[ \mathrm{proj}_{\mathrm P}(\mathbf{x}) = \mathbf{V}\left( \mathbf{V}^{\mathrm T}\mathbf{V}\right)^{-1}\mathbf{V}^{\mathrm T}\mathbf{x}, \] where V = [v₁, v₂]. Mathematica code:

V = Transpose[{v1, v2}]; (* 4×2 matrix *) proj[x_] := V . Inverse[Transpose[V].V] . Transpose[V] . x
Test with a random point:
x = RandomReal[{-2, 2}, 4]; proj[x]
{-0.438136, 1.75232, -0.493711, 1.60346}
{0.456588, 0.8576, 0.401013, 0.}
Verify orthogonality of the error:
(x - proj[x]).v1
1.11022*10^-16
(x - proj[x]).v2
1.11022*10^-16
Both outputs are 0 (up to numerical precision).

5. 3D Visualization of a 4D Plane (Shadow Projection).

We cannot visualize a 4D plane directly, but we can project it into 3D by dropping the 4th coordinate. Define a 3D shadow:

shadow[s_, t_] := Most[param[s, t]] (* drops last coordinate *)
Plot the shadow:
Plot3D[ Evaluate[shadow[s, t]], {s, -2, 2}, {t, -2, 2}, Mesh -> None, PlotStyle -> Directive[Opacity[0.2], Blue], AxesLabel -> {"x1", "x2", "x3"}, PlotRange -> All ]
Figure 37.1: The shadow plot

This shows the projection of the 4D plane into ℝ³.

6. Interactive Manipulation. You can move a point in ℝ4 and see its projection onto the plane (in 3D shadow form):

Manipulate[ Module[{pt4, proj4, pt3, proj3}, pt4 = {a, b, c, d}; proj4 = proj[pt4]; pt3 = Most[pt4]; proj3 = Most[proj4]; Graphics3D[ { Blue, Opacity[0.4], InfinitePlane[shadow[s, t] /. {s -> 0, t -> 0}, {shadow[1, 0], shadow[0, 1]}], Red, PointSize[Large], Point[pt3], Green, PointSize[Large], Point[proj3], Black, Thick, Arrow[{pt3, proj3}] }, Axes -> True, PlotRange -> 3 ] ], {{a, 1}, -2, 2}, {{b, 1}, -2, 2}, {{c, 1}, -2, 2}, {{d, 1}, -2, 2} ]
This gives a geometric feeling for how a 4D plane behaves.

7. A 4D rotation mapping this plane to a coordinate plane. Objective: map span{v₁, v₂} to span{e₁, e₂}.

  1. Build an orthonormal basis of ℝ4 whose first two vectors span the plane.
  2. Use it as a change‑of‑basis matrix.
(* Step 1: orthonormal basis with first two spanning the plane *) planeBasis = Orthogonalize[{v1, v2}]; (* Extend to full ON basis of R^4 *) stdBasis = IdentityMatrix[4]; fullBasis = Orthogonalize[Join[planeBasis, stdBasis]]; (* Columns of Q form an ON basis; first two span the plane *) Q = Transpose[fullBasis]; (* 4×4 orthogonal matrix *) (* Rotation that sends our plane to the span of e1,e2 *) RtoCoord = Transpose[Q]; (* because Q maps coord basis -> our basis *) (* Check: images of v1,v2 lie in the e1–e2 plane *) {RtoCoord . v1, RtoCoord . v2}
{{Sqrt[2], 0, 0, 0, 0, 0}, {1/Sqrt[2], Sqrt[2/3] + 1/Sqrt[6], 0, 0, 0, 0}}
Now span{v₁, v₂} is rotated onto the standard (x₁, x₂)-plane.

8. Package‑style functions for arbitrary planes in ℝn. Below is a compact “toolkit” you can drop into a notebook. It constructs an orthogonal matrix R that rotate an arbitrary basis of the plane into the standard basis achieving the following steps:

  1. Compute an orthonormal basis of the plane.
  2. Extend it to an orthonormal basis of ℝn without disturbing the first block.
  3. Form the orthogonal matrix whose rows are this basis.
ClearAll[PlaneProjector, PlaneReflection, PlaneRotationToCoord]; PlaneProjector[vecs : {__List}] := Module[{V}, V = Transpose[vecs]; (* n×k matrix *) V . Inverse[Transpose[V].V] . Transpose[V] ]; PlaneReflection[vecs : {__List}] := Module[{P, n}, n = Length[First[vecs]]; P = PlaneProjector[vecs]; 2 P - IdentityMatrix[n] ]; PlaneRotationToCoord[vecs : {__List}] := Module[ {planeBasis, n, k, P, complementBasis, fullBasis, tol}, tol = 10^-10; planeBasis = Orthogonalize[vecs]; (* k × n, orthonormal rows *) {k, n} = {Length[planeBasis], Length[First[vecs]]}; (* Projector onto span(planeBasis) in R^n *) P = Transpose[planeBasis].planeBasis; (* n × n *) (* Build orthonormal complement without disturbing planeBasis *) complementBasis = Orthogonalize @ Select[ IdentityMatrix[n], Norm[# - P.#] > tol & ]; fullBasis = Join[planeBasis, complementBasis]; (* n × n, orthonormal rows *) fullBasis ];
Example usage in ℝ4:
v1 = {1., 1., 0., 0.}; v2 = {0., 1., 1., 0.}; vecs = {v1, v2}; P = PlaneProjector[vecs]; Rref = PlaneReflection[vecs]; R = PlaneRotationToCoord[vecs]; R . v1 R . v2
{1.41421, 0., 1., 1., 0., 0.}
{0.707107, 1.22474, 0., 1., 1., 0.}
   ■
End of Example 38

Orthogonal Complement

If W is a subspace of vector space V over field of real numbers, the orthogonal complement of W is W = {xV | xw = 0 for all w from W}.
Here are some basic properties of the orthogonal complement.
Theorem 12: Let V be a vector space space over ℝ, and let W be a subspace of V. Then
  1. The orthogonal complement, W, is a subspace of V.
  2. WW = {0}
  3. If UW, then WU.
  4. If V is finite dimensional, then dim(W) + dim(W) = dim(V), and V = WW.
  5. If V is finite dimensional, then W⊥⊥ = W.
  1. To show that W is a subspace, we must check the following three properties:
    1. Non-emptiness (contains the zero vector).

      For any wW, \[ \langle \mathbf{0}, \mathbf{w}\rangle = \mathbf{0} \bullet \mathbf{w} = 0, \] so 0W.

    2. Closed under addition.

      Let u, vW. Then for any wW, \[ \left( \mathbf{u} + \mathbf{v} \right) \bullet \mathbf{w} = \mathbf{u} \bullet \mathbf{w} + \mathbf{v} \bullet \mathbf{w} \] Since u, vW, we have uw = 0 and vw = 0. Hence, \[ \left( \mathbf{u} + \mathbf{v} \right) \bullet \mathbf{w} =0+0=0 \quad \forall \mathbf{w}\in W, \] so u + vW.

    3. Closed under scalar multiplication.

      Let vW and α ∈ ℝ. For any wW, \[ (\alpha \mathbf{v} ) \bullet \mathbf{w} =\alpha \, \mathbf{v} \bullet \mathbf{w} . \] Since vW, vw = 0, so \[ \left( \alpha \mathbf{v} \right) \bullet \mathbf{w} = \alpha \left( \mathbf{v} \bullet \mathbf{w} \right) = \alpha \cdot 0=0 \] for all wW. Thus, α vW. Having verified these three properties, we conclude that W is a subspace of V.

    4. Note that if xWW, then xx = 0 and hence x = 0.
    5. Assume U is a subset of W. Let vW. By definition, this means \[ \mathbf{v} \bullet \mathbf{w} = 0\quad \mathrm{for\ all\ }\mathbf{w}\in W. \] Since UW, every uU is also an element of W. Therefore, for any uU, \[ \mathbf{v} \bullet \mathbf{u} =0, \] because u is a particular case of wW. Thus, v is orthogonal to every vector in U, so vU. Since vW was arbitrary, we have shown \[ W^{\perp }\subset U^{\perp }. \]
    6. Now suppose that V is n dimensional and W is m dimensional. Let {e₁, e₂, … , em} be a basis of W. Then xW if and only if xej = 0 for j = 1, 2, … , m. Let A be the n-by-m matrix with columns e₁, e₂, … , em. We know there is positive definite Hermitian matrix P such that xy = yPx, so xej = 0 for j = 1, 2, … , m. Hence, xW if and only if APx = 0, so W is the null space of AP. Since A has rank m, and P is nonsingular, the m × n matrix AP also has rank m, and thus the null space of AP has dimension nm. This, combined with (2), establishes (4).
    7. First note that WW⊥⊥. Then from (4), we have dim(W⊥⊥) = n − dim(W) = n − (nm) = m = dim(W), so W = W⊥⊥.
   
Example 39: We’ll work in ℝ4 with a concrete subspace generated by two vectors \[ \mathbf{v}_1 = (1, 1, 0, 0) \qquad \mbox{and} \qquad \mathbf{v}_2 = (0, 1, 1, 0) . \] Let W = span{ v₁, v₂ } ⊂ ℝ4 ≌ ℝ4×1. Its orthogonal complement is denoted by W.
v1 = {1, 1, 0, 0}; v2 = {0, 1, 1, 0}; vecs = {v1, v2}; (* Orthogonal projector onto W *) P = Transpose[vecs].Inverse[vecs.Transpose[vecs]].vecs; (* Orthogonal complement projector *) Pperp = IdentityMatrix[4] - P; (* Basis for W and W⊥ *) Wbasis = Orthogonalize[vecs]; WperpBasis = Orthogonalize[NullSpace[Wbasis]];
  1. W and W are subspaces of ℝ4 because any linear combination of two vectors from either W or W is an elemet of W or W, respectively

    If x, yW, then for all wW: \[ \langle \mathbf{x} +\mathbf{y}, \mathbf{w}\rangle =\langle \mathbf{x}, \mathbf{w} \rangle +\langle \mathbf{y}, \mathbf{w}\rangle = 0, \] and \[ \left( \alpha \mathbf{x} \right) \bullet \mathbf{w} = \alpha \left( \mathbf{x} \bullet \mathbf{w} \right) = 0. \] Thus, W is closed under addition and scalar multiplication. Mathematica verification

          x = WperpBasis[[1]];
         y = WperpBasis[[2]];
         (* Check orthogonality to W *)
          {x.v1, x.v2, y.v1, y.v2}
          (* Check closure: x+y and 3x are still orthogonal to W *)
          {(x+y).v1, (x+y).v2, (3 x).v1, (3 x).v2}
    All results return 0, confirming subspace closure.
  2. WW = {0}
         (* Solve x ∈ W and x ∈ W⊥ *)
          sol = Solve[ { a v1 + b v2 == c WperpBasis[[1]] + d WperpBasis[[2]] }, {a, b, c, d} ]
          (* Extract the vector *)
          x = a v1 + b v2 /. sol[[1]]
         {0,0,0,0}
  3. If UW, then WU.

    Let’s choose: \[ U=\mathrm{span}\{ \mathbf{v}_1\} \subset W. \] If xW, then x is orthogonal to all of W, hence to all of UW.

         u1 = v1;
          (* Check that every basis vector of W⊥ is orthogonal to u1 *)
          WperpBasis.u1
         {0,0}.
  4. If V is finite dimensional, then dim(W) + dim(W) = dim(V), and V = WW.

    In finite dimensions: \[ \dim (W)+\dim (W^{\perp })=\dim (V) \] and \[ V=W\oplus W^{\perp }. \]

         {Length[Wbasis], Length[WperpBasis], 4}
         {2, 2, 4}
    Now check direct sum:
         (* Check that Wbasis ∪ WperpBasis is an orthonormal basis of R^4 *)
          Orthogonalize[Join[Wbasis, WperpBasis]] // MatrixForm
    You get the identity matrix (up to signs), confirming a full orthonormal basis.
  5. If V is finite dimensional, then W⊥⊥ = W.
         WperpperpBasis = Orthogonalize[NullSpace[WperpBasis]];
          (* Compare spans *)
          RowReduce[Join[Wbasis, -WperpperpBasis]]
    You will see the zero matrix, meaning the two sets of vectors span the same subspace.
Each part of Theorem 12 is verified:    ■
End of Example 39

For a one-dimensional subspace U of ℝn, that is, a line through the origin, the orthogonal complement U is an (n − 1)-dimensional subspace. An (n − 1)-dimensional subspace of an n-dimensional space is called a hyperplane. If we fix a nonzero vector a in an n-dimensional space, then the equation ax = 0 defines a hyperplane through the origin.

 

  1. Which pair of the following three vectors are orthogonal to each other?
    = 3i - 2j + k,    = −2i + 4j + 5k,    = i _ 3j − 2k. \[ (a) \ \mathbf{x}, \mathbf{y} , \quad (b)\ \mathbf{y}, \mathbf{z} , \quad (c)\ \mbox{ no pair}. \]
  2. Find the scalar number λ such that vectors a = 2i + 3j + 4k and b = 5i + λj − 3k are at right-angles.
  3. Prove Corollary 1.

 

  1. Anton, Howard (2005), Elementary Linear Algebra (Applications Version) (9th ed.), Wiley International
  2. Beezer, R., A First Course in Linear Algebra, 2015.
  3. Beezer, R., A Second Course in Linear Algebra, 2013.
  4. Fitzpatrick, S., Orthogonal sets of vectors, Linear Algebra.