An inner product on a vector space V V V over F F F (where F = R F = \mathbb{R} F = R or C \mathbb{C} C ) is a Function ⟨ ⋅ , ⋅ ⟩ : V × V → F \langle \cdot, \cdot \rangle : V \times V \to F ⟨ ⋅ , ⋅ ⟩ : V × V → F satisfying:
Conjugate symmetry : ⟨ u , v ⟩ = ⟨ v , u ⟩ ‾ \langle \mathbf{u}, \mathbf{v} \rangle = \overline{\langle \mathbf{v}, \mathbf{u} \rangle} ⟨ u , v ⟩ = ⟨ v , u ⟩ Linearity in the first argument : ⟨ α u + β w , v ⟩ = α ⟨ u , v ⟩ + β ⟨ w , v ⟩ \langle \alpha\mathbf{u} + \beta\mathbf{w}, \mathbf{v} \rangle = \alpha\langle \mathbf{u}, \mathbf{v} \rangle + \beta\langle \mathbf{w}, \mathbf{v} \rangle ⟨ α u + β w , v ⟩ = α ⟨ u , v ⟩ + β ⟨ w , v ⟩ Positive definiteness : ⟨ v , v ⟩ ≥ 0 \langle \mathbf{v}, \mathbf{v} \rangle \geq 0 ⟨ v , v ⟩ ≥ 0 with equality iff v = 0 \mathbf{v} = \mathbf{0} v = 0 A vector space equipped with an inner product is called an inner product space .
Example. The standard inner product on R n \mathbb{R}^n R n is ⟨ x , y ⟩ = ∑ i = 1 n x i y i \langle \mathbf{x}, \mathbf{y} \rangle = \sum_{i=1}^n x_i y_i ⟨ x , y ⟩ = ∑ i = 1 n x i y i . On C n \mathbb{C}^n C n ⟨ x , y ⟩ = ∑ i = 1 n x i y i ‾ \langle \mathbf{x}, \mathbf{y} \rangle = \sum_{i=1}^n x_i \overline{y_i} ⟨ x , y ⟩ = ∑ i = 1 n x i y i .
Example. On C [ a , b ] C[a,b] C [ a , b ] The L 2 L^2 L 2 inner product is ⟨ f , g ⟩ = ∫ a b f ( x ) g ( x ) d x \langle f, g \rangle = \int_a^b f(x)g(x)\,dx ⟨ f , g ⟩ = ∫ a b f ( x ) g ( x ) d x .
Every inner product induces a norm :
∥ v ∥ = ⟨ v , v ⟩ \lVert \mathbf{v} \rVert = \sqrt{\langle \mathbf{v}, \mathbf{v} \rangle} ∥ v ∥ = ⟨ v , v ⟩
Theorem 7.1 (Cauchy—Schwarz Inequality). For all u , v ∈ V \mathbf{u}, \mathbf{v} \in V u , v ∈ V
∣ ⟨ u , v ⟩ ∣ ≤ ∥ u ∥ ∥ v ∥ \lvert\langle \mathbf{u}, \mathbf{v} \rangle\rvert \leq \lVert \mathbf{u} \rVert \, \lVert \mathbf{v} \rVert ∣⟨ u , v ⟩∣ ≤ ∥ u ∥ ∥ v ∥
With equality if and only if u \mathbf{u} u and v \mathbf{v} v are linearly dependent.
Proof. If v = 0 \mathbf{v} = \mathbf{0} v = 0 Both sides are 0 and the result holds. Assume v ≠ 0 \mathbf{v} \neq \mathbf{0} v = 0 . For any t ∈ R t \in \mathbb{R} t ∈ R (or C \mathbb{C} C ), positive definiteness gives
0 ≤ ⟨ u − t v , u − t v ⟩ = ⟨ u , u ⟩ − t ⟨ v , u ⟩ − t ‾ ⟨ u , v ⟩ + ∣ t ∣ 2 ⟨ v , v ⟩ 0 \leq \langle \mathbf{u} - t\mathbf{v}, \mathbf{u} - t\mathbf{v} \rangle = \langle \mathbf{u}, \mathbf{u} \rangle - t\langle \mathbf{v}, \mathbf{u} \rangle - \overline{t}\langle \mathbf{u}, \mathbf{v} \rangle + \lvert t \rvert^2 \langle \mathbf{v}, \mathbf{v} \rangle 0 ≤ ⟨ u − t v , u − t v ⟩ = ⟨ u , u ⟩ − t ⟨ v , u ⟩ − t ⟨ u , v ⟩ + ∣ t ∣ 2 ⟨ v , v ⟩
Set t = ⟨ u , v ⟩ ⟨ v , v ⟩ t = \frac{\langle \mathbf{u}, \mathbf{v} \rangle}{\langle \mathbf{v}, \mathbf{v} \rangle} t = ⟨ v , v ⟩ ⟨ u , v ⟩ (the value that minimises the right side):
0 ≤ ∥ u ∥ 2 − ∣ ⟨ u , v ⟩ ∣ 2 ∥ v ∥ 2 0 \leq \lVert \mathbf{u} \rVert^2 - \frac{\lvert\langle \mathbf{u}, \mathbf{v} \rangle\rvert^2}{\lVert \mathbf{v} \rVert^2} 0 ≤ ∥ u ∥ 2 − ∥ v ∥ 2 ∣⟨ u , v ⟩ ∣ 2
Rearranging: ∣ ⟨ u , v ⟩ ∣ 2 ≤ ∥ u ∥ 2 ∥ v ∥ 2 \lvert\langle \mathbf{u}, \mathbf{v} \rangle\rvert^2 \leq \lVert \mathbf{u} \rVert^2 \lVert \mathbf{v} \rVert^2 ∣⟨ u , v ⟩ ∣ 2 ≤ ∥ u ∥ 2 ∥ v ∥ 2 . Taking square roots gives the result. Equality holds iff u − t v = 0 \mathbf{u} - t\mathbf{v} = \mathbf{0} u − t v = 0 I.e., u \mathbf{u} u and v \mathbf{v} v are linearly dependent. ■ \blacksquare ■
Theorem 7.2 (Triangle Inequality).
∥ u + v ∥ ≤ ∥ u ∥ + ∥ v ∥ \lVert \mathbf{u} + \mathbf{v} \rVert \leq \lVert \mathbf{u} \rVert + \lVert \mathbf{v} \rVert ∥ u + v ∥ ≤ ∥ u ∥ + ∥ v ∥
Proof.
∥ u + v ∥ 2 = ⟨ u + v , u + v ⟩ = ∥ u ∥ 2 + 2 R e ⟨ u , v ⟩ + ∥ v ∥ 2 \lVert \mathbf{u} + \mathbf{v} \rVert^2 = \langle \mathbf{u} + \mathbf{v}, \mathbf{u} + \mathbf{v} \rangle = \lVert \mathbf{u} \rVert^2 + 2\,\mathrm{Re}\langle \mathbf{u}, \mathbf{v} \rangle + \lVert \mathbf{v} \rVert^2 ∥ u + v ∥ 2 = ⟨ u + v , u + v ⟩ = ∥ u ∥ 2 + 2 Re ⟨ u , v ⟩ + ∥ v ∥ 2
By Cauchy—Schwarz, R e ⟨ u , v ⟩ ≤ ∣ ⟨ u , v ⟩ ∣ ≤ ∥ u ∥ ∥ v ∥ \mathrm{Re}\langle \mathbf{u}, \mathbf{v} \rangle \leq \lvert\langle \mathbf{u}, \mathbf{v} \rangle\rvert \leq \lVert \mathbf{u} \rVert \lVert \mathbf{v} \rVert Re ⟨ u , v ⟩ ≤ ∣⟨ u , v ⟩∣ ≤ ∥ u ∥ ∥ v ∥ So
∥ u + v ∥ 2 ≤ ∥ u ∥ 2 + 2 ∥ u ∥ ∥ v ∥ + ∥ v ∥ 2 = ( ∥ u ∥ + ∥ v ∥ ) 2 \lVert \mathbf{u} + \mathbf{v} \rVert^2 \leq \lVert \mathbf{u} \rVert^2 + 2\lVert \mathbf{u} \rVert \lVert \mathbf{v} \rVert + \lVert \mathbf{v} \rVert^2 = (\lVert \mathbf{u} \rVert + \lVert \mathbf{v} \rVert)^2 ∥ u + v ∥ 2 ≤ ∥ u ∥ 2 + 2 ∥ u ∥ ∥ v ∥ + ∥ v ∥ 2 = (∥ u ∥ + ∥ v ∥ ) 2
Taking square roots gives the result. ■ \blacksquare ■
Two vectors u , v \mathbf{u}, \mathbf{v} u , v are orthogonal if ⟨ u , v ⟩ = 0 \langle \mathbf{u}, \mathbf{v} \rangle = 0 ⟨ u , v ⟩ = 0 . We write u ⊥ v \mathbf{u} \perp \mathbf{v} u ⊥ v .
An orthonormal set { e 1 , … , e k } \{e_1, \ldots, e_k\} { e 1 , … , e k } satisfies ⟨ e i , e j ⟩ = δ i j \langle e_i, e_j \rangle = \delta_{ij} ⟨ e i , e j ⟩ = δ ij .
Theorem 7.3 (Pythagorean Theorem). If u ⊥ v \mathbf{u} \perp \mathbf{v} u ⊥ v Then
∥ u + v ∥ 2 = ∥ u ∥ 2 + ∥ v ∥ 2 \lVert \mathbf{u} + \mathbf{v} \rVert^2 = \lVert \mathbf{u} \rVert^2 + \lVert \mathbf{v} \rVert^2 ∥ u + v ∥ 2 = ∥ u ∥ 2 + ∥ v ∥ 2
Proof. ∥ u + v ∥ 2 = ∥ u ∥ 2 + 2 ⟨ u , v ⟩ + ∥ v ∥ 2 = ∥ u ∥ 2 + ∥ v ∥ 2 \lVert \mathbf{u} + \mathbf{v} \rVert^2 = \lVert \mathbf{u} \rVert^2 + 2\langle \mathbf{u}, \mathbf{v} \rangle + \lVert \mathbf{v} \rVert^2 = \lVert \mathbf{u} \rVert^2 + \lVert \mathbf{v} \rVert^2 ∥ u + v ∥ 2 = ∥ u ∥ 2 + 2 ⟨ u , v ⟩ + ∥ v ∥ 2 = ∥ u ∥ 2 + ∥ v ∥ 2 . ■ \blacksquare ■
Proposition 7.4. Every orthonormal set is linearly independent.
Proof. If ∑ i = 1 k α i e i = 0 \sum_{i=1}^k \alpha_i e_i = \mathbf{0} ∑ i = 1 k α i e i = 0 Then taking the inner product with e j e_j e j : α j = ⟨ ∑ α i e i , e j ⟩ = ⟨ 0 , e j ⟩ = 0 \alpha_j = \langle \sum \alpha_i e_i, e_j \rangle = \langle \mathbf{0}, e_j \rangle = 0 α j = ⟨ ∑ α i e i , e j ⟩ = ⟨ 0 , e j ⟩ = 0 for each j j j . ■ \blacksquare ■
The Gram—Schmidt process converts a linearly independent set { v 1 , … , v n } \{\mathbf{v}_1, \ldots, \mathbf{v}_n\} { v 1 , … , v n } into an orthonormal set { e 1 , … , e n } \{e_1, \ldots, e_n\} { e 1 , … , e n } :
u 1 = v 1 , e 1 = u 1 ∥ u 1 ∥ \mathbf{u}_1 = \mathbf{v}_1, \quad e_1 = \frac{\mathbf{u}_1}{\lVert \mathbf{u}_1 \rVert} u 1 = v 1 , e 1 = ∥ u 1 ∥ u 1
u k = v k − ∑ i = 1 k − 1 ⟨ v k , e i ⟩ e i , e k = u k ∥ u k ∥ \mathbf{u}_k = \mathbf{v}_k - \sum_{i=1}^{k-1} \langle \mathbf{v}_k, e_i \rangle e_i, \quad e_k = \frac{\mathbf{u}_k}{\lVert \mathbf{u}_k \rVert} u k = v k − ∑ i = 1 k − 1 ⟨ v k , e i ⟩ e i , e k = ∥ u k ∥ u k
Proposition 7.5. At each step, s p a n { e 1 , … , e k } = s p a n { v 1 , … , v k } \mathrm{span}\{e_1, \ldots, e_k\} = \mathrm{span}\{\mathbf{v}_1, \ldots, \mathbf{v}_k\} span { e 1 , … , e k } = span { v 1 , … , v k } .
Proof. By construction, u k \mathbf{u}_k u k is v k \mathbf{v}_k v k minus its projection onto s p a n { e 1 , … , e k − 1 } = s p a n { v 1 , … , v k − 1 } \mathrm{span}\{e_1, \ldots, e_{k-1}\} = \mathrm{span}\{\mathbf{v}_1, \ldots, \mathbf{v}_{k-1}\} span { e 1 , … , e k − 1 } = span { v 1 , … , v k − 1 } . So u k ∈ s p a n { v 1 , … , v k } \mathbf{u}_k \in \mathrm{span}\{\mathbf{v}_1, \ldots, \mathbf{v}_k\} u k ∈ span { v 1 , … , v k } and v k = u k + ∑ i = 1 k − 1 ⟨ v k , e i ⟩ e i ∈ s p a n { u 1 , … , u k } \mathbf{v}_k = \mathbf{u}_k + \sum_{i=1}^{k-1}\langle \mathbf{v}_k, e_i \rangle e_i \in \mathrm{span}\{\mathbf{u}_1, \ldots, \mathbf{u}_k\} v k = u k + ∑ i = 1 k − 1 ⟨ v k , e i ⟩ e i ∈ span { u 1 , … , u k } . Since each e i e_i e i is a scalar multiple of u i \mathbf{u}_i u i The spans coincide. ■ \blacksquare ■
The orthogonal projection of v \mathbf{v} v onto a subspace W W W with orthonormal basis { e 1 , … , e k } \{e_1, \ldots, e_k\} { e 1 , … , e k } is
p r o j W ( v ) = ∑ i = 1 k ⟨ v , e i ⟩ e i \mathrm{proj_W}(\mathbf{v}) = \sum_{i=1}^k \langle \mathbf{v}, e_i \rangle e_i pro j W ( v ) = ∑ i = 1 k ⟨ v , e i ⟩ e i
Theorem 7.6 (Best Approximation). Among all vectors in W W W The orthogonal projection p r o j W ( v ) \mathrm{proj_W}(\mathbf{v}) pro j W ( v ) minimises the distance to v \mathbf{v} v :
∥ v − p r o j W ( v ) ∥ ≤ ∥ v − w ∥ f o r a l l w ∈ W \lVert \mathbf{v} - \mathrm{proj_W}(\mathbf{v}) \rVert \leq \lVert \mathbf{v} - \mathbf{w} \rVert \quad \mathrm{for}~all~ \mathbf{w} \in W ∥ v − pro j W ( v )∥ ≤ ∥ v − w ∥ for a l l w ∈ W
Proof. For any w ∈ W \mathbf{w} \in W w ∈ W Write v − w = ( v − p r o j W ( v ) ) + ( p r o j W ( v ) − w ) \mathbf{v} - \mathbf{w} = (\mathbf{v} - \mathrm{proj_W}(\mathbf{v})) + (\mathrm{proj_W}(\mathbf{v}) - \mathbf{w}) v − w = ( v − pro j W ( v )) + ( pro j W ( v ) − w ) . The first term is orthogonal to W W W (hence to the second term, which lies in W W W ), so by the Pythagorean theorem:
∥ v − w ∥ 2 = ∥ v − p r o j W ( v ) ∥ 2 + ∥ p r o j W ( v ) − w ∥ 2 ≥ ∥ v − p r o j W ( v ) ∥ 2 \lVert \mathbf{v} - \mathbf{w} \rVert^2 = \lVert \mathbf{v} - \mathrm{proj_W}(\mathbf{v}) \rVert^2 + \lVert \mathrm{proj_W}(\mathbf{v}) - \mathbf{w} \rVert^2 \geq \lVert \mathbf{v} - \mathrm{proj_W}(\mathbf{v}) \rVert^2 ∥ v − w ∥ 2 = ∥ v − pro j W ( v ) ∥ 2 + ∥ pro j W ( v ) − w ∥ 2 ≥ ∥ v − pro j W ( v ) ∥ 2
With equality iff w = p r o j W ( v ) \mathbf{w} = \mathrm{proj_W}(\mathbf{v}) w = pro j W ( v ) . ■ \blacksquare ■
A fundamental application of orthogonal projection is fitting functions to data. Given a subspace W W W of an inner product space V V V and a target v ∈ V \mathbf{v} \in V v ∈ V The best approximation in W W W Is the orthogonal projection p r o j W ( v ) \mathrm{proj_W}(\mathbf{v}) pro j W ( v ) .
Problem. Apply the Gram—Schmidt process to v 1 = ( 1 , 1 , 0 ) \mathbf{v}_1 = (1, 1, 0) v 1 = ( 1 , 1 , 0 ) v 2 = ( 1 , 0 , 1 ) \mathbf{v}_2 = (1, 0, 1) v 2 = ( 1 , 0 , 1 ) , v 3 = ( 0 , 1 , 1 ) \mathbf{v}_3 = (0, 1, 1) v 3 = ( 0 , 1 , 1 ) in R 3 \mathbb{R}^3 R 3 with the standard inner Product.
Solution u 1 = v 1 = ( 1 , 1 , 0 ) \mathbf{u}_1 = \mathbf{v}_1 = (1, 1, 0) u 1 = v 1 = ( 1 , 1 , 0 ) , ∥ u 1 ∥ = 2 \lVert \mathbf{u}_1 \rVert = \sqrt{2} ∥ u 1 ∥ = 2 , e 1 = 1 2 ( 1 , 1 , 0 ) e_1 = \frac{1}{\sqrt{2}}(1, 1, 0) e 1 = 2 1 ( 1 , 1 , 0 ) .
u 2 = v 2 − ⟨ v 2 , e 1 ⟩ e 1 = ( 1 , 0 , 1 ) − 1 2 ⋅ 1 2 ( 1 , 1 , 0 ) = ( 1 , 0 , 1 ) − 1 2 ( 1 , 1 , 0 ) = ( 1 2 , − 1 2 , 1 ) \mathbf{u}_2 = \mathbf{v}_2 - \langle \mathbf{v}_2, e_1 \rangle e_1 = (1, 0, 1) - \frac{1}{\sqrt{2}} \cdot \frac{1}{\sqrt{2}}(1, 1, 0) = (1, 0, 1) - \frac{1}{2}(1, 1, 0) = (\frac{1}{2}, -\frac{1}{2}, 1) u 2 = v 2 − ⟨ v 2 , e 1 ⟩ e 1 = ( 1 , 0 , 1 ) − 2 1 ⋅ 2 1 ( 1 , 1 , 0 ) = ( 1 , 0 , 1 ) − 2 1 ( 1 , 1 , 0 ) = ( 2 1 , − 2 1 , 1 )
∥ u 2 ∥ = 1 / 4 + 1 / 4 + 1 = 3 / 2 \lVert \mathbf{u}_2 \rVert = \sqrt{1/4 + 1/4 + 1} = \sqrt{3/2} ∥ u 2 ∥ = 1/4 + 1/4 + 1 = 3/2 , e 2 = 1 3 / 2 ( 1 2 , − 1 2 , 1 ) = 1 6 ( 1 , − 1 , 2 ) e_2 = \frac{1}{\sqrt{3/2}}(\frac{1}{2}, -\frac{1}{2}, 1) = \frac{1}{\sqrt{6}}(1, -1, 2) e 2 = 3/2 1 ( 2 1 , − 2 1 , 1 ) = 6 1 ( 1 , − 1 , 2 ) .
u 3 = v 3 − ⟨ v 3 , e 1 ⟩ e 1 − ⟨ v 3 , e 2 ⟩ e 2 \mathbf{u}_3 = \mathbf{v}_3 - \langle \mathbf{v}_3, e_1 \rangle e_1 - \langle \mathbf{v}_3, e_2 \rangle e_2 u 3 = v 3 − ⟨ v 3 , e 1 ⟩ e 1 − ⟨ v 3 , e 2 ⟩ e 2
⟨ v 3 , e 1 ⟩ = 1 2 ( 0 + 1 + 0 ) = 1 2 \langle \mathbf{v}_3, e_1 \rangle = \frac{1}{\sqrt{2}}(0 + 1 + 0) = \frac{1}{\sqrt{2}} ⟨ v 3 , e 1 ⟩ = 2 1 ( 0 + 1 + 0 ) = 2 1
⟨ v 3 , e 2 ⟩ = 1 6 ( 0 − 1 + 2 ) = 1 6 \langle \mathbf{v}_3, e_2 \rangle = \frac{1}{\sqrt{6}}(0 - 1 + 2) = \frac{1}{\sqrt{6}} ⟨ v 3 , e 2 ⟩ = 6 1 ( 0 − 1 + 2 ) = 6 1
u 3 = ( 0 , 1 , 1 ) − 1 2 ⋅ 1 2 ( 1 , 1 , 0 ) − 1 6 ⋅ 1 6 ( 1 , − 1 , 2 ) = ( 0 , 1 , 1 ) − 1 2 ( 1 , 1 , 0 ) − 1 6 ( 1 , − 1 , 2 ) \mathbf{u}_3 = (0, 1, 1) - \frac{1}{\sqrt{2}} \cdot \frac{1}{\sqrt{2}}(1, 1, 0) - \frac{1}{\sqrt{6}} \cdot \frac{1}{\sqrt{6}}(1, -1, 2) = (0, 1, 1) - \frac{1}{2}(1, 1, 0) - \frac{1}{6}(1, -1, 2) u 3 = ( 0 , 1 , 1 ) − 2 1 ⋅ 2 1 ( 1 , 1 , 0 ) − 6 1 ⋅ 6 1 ( 1 , − 1 , 2 ) = ( 0 , 1 , 1 ) − 2 1 ( 1 , 1 , 0 ) − 6 1 ( 1 , − 1 , 2 )
= ( − 1 2 − 1 6 , 1 − 1 2 + 1 6 , 1 − 1 3 ) = ( − 2 3 , 2 3 , 2 3 ) = (-\frac{1}{2} - \frac{1}{6}, 1 - \frac{1}{2} + \frac{1}{6}, 1 - \frac{1}{3}) = (-\frac{2}{3}, \frac{2}{3}, \frac{2}{3}) = ( − 2 1 − 6 1 , 1 − 2 1 + 6 1 , 1 − 3 1 ) = ( − 3 2 , 3 2 , 3 2 )
∥ u 3 ∥ = 4 / 9 + 4 / 9 + 4 / 9 = 4 / 3 = 2 / 3 \lVert \mathbf{u}_3 \rVert = \sqrt{4/9 + 4/9 + 4/9} = \sqrt{4/3} = 2/\sqrt{3} ∥ u 3 ∥ = 4/9 + 4/9 + 4/9 = 4/3 = 2/ 3 , e 3 = 3 2 ( − 2 3 , 2 3 , 2 3 ) = 1 3 ( − 1 , 1 , 1 ) e_3 = \frac{\sqrt{3}}{2}(-\frac{2}{3}, \frac{2}{3}, \frac{2}{3}) = \frac{1}{\sqrt{3}}(-1, 1, 1) e 3 = 2 3 ( − 3 2 , 3 2 , 3 2 ) = 3 1 ( − 1 , 1 , 1 ) .
Verification: ⟨ e 1 , e 2 ⟩ = 1 12 ( 1 − 1 + 0 ) = 0 \langle e_1, e_2 \rangle = \frac{1}{\sqrt{12}}(1 - 1 + 0) = 0 ⟨ e 1 , e 2 ⟩ = 12 1 ( 1 − 1 + 0 ) = 0 . ✓ \checkmark ✓ ⟨ e 1 , e 3 ⟩ = 1 6 ( − 1 + 1 + 0 ) = 0 \langle e_1, e_3 \rangle = \frac{1}{\sqrt{6}}(-1 + 1 + 0) = 0 ⟨ e 1 , e 3 ⟩ = 6 1 ( − 1 + 1 + 0 ) = 0 . ✓ \checkmark ✓ ⟨ e 2 , e 3 ⟩ = 1 18 ( − 1 − 1 + 2 ) = 0 \langle e_2, e_3 \rangle = \frac{1}{\sqrt{18}}(-1 - 1 + 2) = 0 ⟨ e 2 , e 3 ⟩ = 18 1 ( − 1 − 1 + 2 ) = 0 . ✓ \checkmark ✓
The orthonormal basis is { 1 2 ( 1 , 1 , 0 ) , 1 6 ( 1 , − 1 , 2 ) , 1 3 ( − 1 , 1 , 1 ) } \left\{\frac{1}{\sqrt{2}}(1,1,0),\ \frac{1}{\sqrt{6}}(1,-1,2),\ \frac{1}{\sqrt{3}}(-1,1,1)\right\} { 2 1 ( 1 , 1 , 0 ) , 6 1 ( 1 , − 1 , 2 ) , 3 1 ( − 1 , 1 , 1 ) } . ■ \blacksquare ■
Caution
the input vectors are Linearly dependent, one of the u k \mathbf{u}_k u k will be the zero vector, and the process will fail (attempting to divide by zero in the normalisation step).
Problem. Find the orthogonal projection of v = ( 3 , − 1 , 2 ) \mathbf{v} = (3, -1, 2) v = ( 3 , − 1 , 2 ) onto the plane W W W spanned by ( 1 , 0 , 1 ) (1, 0, 1) ( 1 , 0 , 1 ) and ( 0 , 1 , 1 ) (0, 1, 1) ( 0 , 1 , 1 ) in R 3 \mathbb{R}^3 R 3 with the standard inner product. Also find the distance from v \mathbf{v} v to W W W .
Solution First, apply Gram—Schmidt to obtain an orthonormal basis for W W W .
u 1 = ( 1 , 0 , 1 ) \mathbf{u}_1 = (1, 0, 1) u 1 = ( 1 , 0 , 1 ) , ∥ u 1 ∥ = 2 \lVert \mathbf{u}_1 \rVert = \sqrt{2} ∥ u 1 ∥ = 2 , e 1 = 1 2 ( 1 , 0 , 1 ) e_1 = \frac{1}{\sqrt{2}}(1, 0, 1) e 1 = 2 1 ( 1 , 0 , 1 ) .
u 2 = ( 0 , 1 , 1 ) − ⟨ ( 0 , 1 , 1 ) , e 1 ⟩ e 1 = ( 0 , 1 , 1 ) − 1 2 ⋅ 1 2 ( 1 , 0 , 1 ) = ( 0 , 1 , 1 ) − 1 2 ( 1 , 0 , 1 ) = ( − 1 2 , 1 , 1 2 ) \mathbf{u}_2 = (0, 1, 1) - \langle (0,1,1), e_1 \rangle e_1 = (0, 1, 1) - \frac{1}{\sqrt{2}} \cdot \frac{1}{\sqrt{2}}(1, 0, 1) = (0, 1, 1) - \frac{1}{2}(1, 0, 1) = (-\frac{1}{2}, 1, \frac{1}{2}) u 2 = ( 0 , 1 , 1 ) − ⟨( 0 , 1 , 1 ) , e 1 ⟩ e 1 = ( 0 , 1 , 1 ) − 2 1 ⋅ 2 1 ( 1 , 0 , 1 ) = ( 0 , 1 , 1 ) − 2 1 ( 1 , 0 , 1 ) = ( − 2 1 , 1 , 2 1 ) .
∥ u 2 ∥ = 1 / 4 + 1 + 1 / 4 = 3 / 2 \lVert \mathbf{u}_2 \rVert = \sqrt{1/4 + 1 + 1/4} = \sqrt{3/2} ∥ u 2 ∥ = 1/4 + 1 + 1/4 = 3/2 , e 2 = 1 6 ( − 1 , 2 , 1 ) e_2 = \frac{1}{\sqrt{6}}(-1, 2, 1) e 2 = 6 1 ( − 1 , 2 , 1 ) .
Now compute the projection:
⟨ v , e 1 ⟩ = 1 2 ( 3 + 0 + 2 ) = 5 2 \langle \mathbf{v}, e_1 \rangle = \frac{1}{\sqrt{2}}(3 + 0 + 2) = \frac{5}{\sqrt{2}} ⟨ v , e 1 ⟩ = 2 1 ( 3 + 0 + 2 ) = 2 5
⟨ v , e 2 ⟩ = 1 6 ( − 3 − 2 + 2 ) = − 3 6 \langle \mathbf{v}, e_2 \rangle = \frac{1}{\sqrt{6}}(-3 - 2 + 2) = \frac{-3}{\sqrt{6}} ⟨ v , e 2 ⟩ = 6 1 ( − 3 − 2 + 2 ) = 6 − 3
p r o j W ( v ) = 5 2 ⋅ 1 2 ( 1 , 0 , 1 ) + − 3 6 ⋅ 1 6 ( − 1 , 2 , 1 ) \mathrm{proj_W}(\mathbf{v}) = \frac{5}{\sqrt{2}} \cdot \frac{1}{\sqrt{2}}(1, 0, 1) + \frac{-3}{\sqrt{6}} \cdot \frac{1}{\sqrt{6}}(-1, 2, 1) pro j W ( v ) = 2 5 ⋅ 2 1 ( 1 , 0 , 1 ) + 6 − 3 ⋅ 6 1 ( − 1 , 2 , 1 )
= 5 2 ( 1 , 0 , 1 ) + − 3 6 ( − 1 , 2 , 1 ) = ( 5 2 , 0 , 5 2 ) + ( 1 2 , − 1 , − 1 2 ) = ( 3 , − 1 , 2 ) = \frac{5}{2}(1, 0, 1) + \frac{-3}{6}(-1, 2, 1) = (\frac{5}{2}, 0, \frac{5}{2}) + (\frac{1}{2}, -1, -\frac{1}{2}) = (3, -1, 2) = 2 5 ( 1 , 0 , 1 ) + 6 − 3 ( − 1 , 2 , 1 ) = ( 2 5 , 0 , 2 5 ) + ( 2 1 , − 1 , − 2 1 ) = ( 3 , − 1 , 2 )
The residual is v − p r o j W ( v ) = ( 0 , 0 , 0 ) \mathbf{v} - \mathrm{proj_W}(\mathbf{v}) = (0, 0, 0) v − pro j W ( v ) = ( 0 , 0 , 0 ) So the distance is 0. This means v ∈ W \mathbf{v} \in W v ∈ W itself. Indeed, v = 3 ( 1 , 0 , 1 ) − ( 0 , 1 , 1 ) ∈ s p a n { ( 1 , 0 , 1 ) , ( 0 , 1 , 1 ) } \mathbf{v} = 3(1, 0, 1) - (0, 1, 1) \in \mathrm{span}\{(1,0,1), (0,1,1)\} v = 3 ( 1 , 0 , 1 ) − ( 0 , 1 , 1 ) ∈ span {( 1 , 0 , 1 ) , ( 0 , 1 , 1 )} . ■ \blacksquare ■
Problem. Find the constant function c c c (i.e., the best approximation by a degree-0 polynomial) That minimises ∫ 0 1 ( e x − c ) 2 d x \int_0^1 (e^x - c)^2\,dx ∫ 0 1 ( e x − c ) 2 d x .
Solution We want the orthogonal projection of f ( x ) = e x f(x) = e^x f ( x ) = e x onto the subspace W = s p a n { 1 } W = \mathrm{span}\{1\} W = span { 1 } in the L 2 [ 0 , 1 ] L^2[0,1] L 2 [ 0 , 1 ] inner product space. The orthonormal basis for W W W is e 1 = 1 e_1 = 1 e 1 = 1 (since ∥ 1 ∥ 2 = ∫ 0 1 1 d x = 1 \lVert 1 \rVert^2 = \int_0^1 1\,dx = 1 ∥ 1 ∥ 2 = ∫ 0 1 1 d x = 1 ).
p r o j W ( f ) = ⟨ f , 1 ⟩ ⋅ 1 = ( ∫ 0 1 e x d x ) ⋅ 1 = ( e − 1 ) ⋅ 1 \mathrm{proj_W}(f) = \langle f, 1 \rangle \cdot 1 = \left(\int_0^1 e^x\,dx\right) \cdot 1 = (e - 1) \cdot 1 pro j W ( f ) = ⟨ f , 1 ⟩ ⋅ 1 = ( ∫ 0 1 e x d x ) ⋅ 1 = ( e − 1 ) ⋅ 1
So the best constant approximation is c = e − 1 ≈ 1.718 c = e - 1 \approx 1.718 c = e − 1 ≈ 1.718 .
Verification: The error is e x − ( e − 1 ) e^x - (e-1) e x − ( e − 1 ) . Expanding e x e^x e x as a Taylor series around x = 1 / 2 x = 1/2 x = 1/2 : The constant term is e 1 / 2 ≈ 1.649 e^{1/2} \approx 1.649 e 1/2 ≈ 1.649 But our answer e − 1 ≈ 1.718 e - 1 \approx 1.718 e − 1 ≈ 1.718 is the L 2 L^2 L 2 -optimal constant, not the Taylor approximation. The two optimisation criteria differ. ■ \blacksquare ■
An inner product generalises the familiar dot product to abstract vector spaces, including function spaces. It gives you two crucial pieces of information: the length of a vector (via the induced norm) and the angle between vectors (via the inner product value). Without an inner product, you can measure linear structure but not geometric structure.
The Cauchy-Schwarz inequality is the foundation: it says the “correlation” between two vectors is bounded by their lengths, just as the cosine of an angle is bounded between negative one and one. Orthogonal projection is the geometric operation of finding the closest point in a subspace, which generalises the idea of “shadow” from physical light to arbitrary dimensions. The Gram-Schmidt process is the systematic way to build an orthonormal basis, analogous to aligning coordinate axes with the principal directions of your data. In function spaces like L 2 L^2 L 2 , the inner product measures how similar two functions are, which is the basis of Fourier analysis and signal processing.
The Cauchy—Schwarz inequality is not the triangle inequality. Cauchy—Schwarz bounds the inner product by the product of norms; the triangle inequality bounds the norm of a sum by the sum of norms. They are related (the triangle inequality follows from Cauchy—Schwarz) but distinct.Gram—Schmidt is numerically unstable. For floating-point computation, modified Gram—Schmidt or Householder reflections are preferred.Orthogonal projection decomposes v \mathbf{v} v uniquely. v = p r o j W ( v ) + v ⊥ \mathbf{v} = \mathrm{proj_W}(\mathbf{v}) + \mathbf{v}^\perp v = pro j W ( v ) + v ⊥ where v ⊥ ∈ W ⊥ \mathbf{v}^\perp \in W^\perp v ⊥ ∈ W ⊥ . This decomposition is unique and is called the orthogonal decomposition . A[7_Inner Product Spaces] --> B[Key Concepts]
A --> D[Practical Applications]
B --> E[Fundamental definitions]
D --> G[Real-world usage]
Eigenvalues and Eigenvectors : The spectral theorem for symmetric matrices guarantees an orthonormal eigenbasis, which is an inner product space concept.Vectors and Vector Spaces : Inner product spaces are vector spaces equipped with an inner product that generalises the dot product.Singular Value Decomposition : The SVD decomposes a matrix using orthonormal bases derived from inner products on A T A A^T A A T A and A A T AA^T A A T .