Salta al contenuto
Note per Studenti Euclidean Spaces Report

Euclidean Spaces

In questa pagina 4

A real vector space only records addition and scalar multiplication. Rn\mathbb{R}^n has another important piece of structure: the distance between points and the property of vectors being orthogonal to each other. This note abstracts that structure.

1. The scalar product on Rn\mathbb{R}^n

Definition. The scalar product of v,w∈Rnv,w\in\mathbb{R}^n is

⟨v,w⟩:=vT id w=vTw=v1w1+⋯+vnwn.\langle v,w\rangle:=v^T\,\mathrm{id}\,w=v^Tw=v_1w_1+\dots+v_nw_n .

(Not to be confused with the scalar multiple of a vector, which is again a vector.)

Example. The scalar product can be positive, zero or negative. With v=(12)v=\begin{pmatrix}1\\2\end{pmatrix}:

⟨(12),(−22)⟩=−2+4=2,⟨(12),(−21)⟩=−2+2=0,⟨(12),(−20)⟩=−2.\left\langle\begin{pmatrix}1\\2\end{pmatrix},\begin{pmatrix}-2\\2\end{pmatrix}\right\rangle=-2+4=2,\quad\left\langle\begin{pmatrix}1\\2\end{pmatrix},\begin{pmatrix}-2\\1\end{pmatrix}\right\rangle=-2+2=0,\quad\left\langle\begin{pmatrix}1\\2\end{pmatrix},\begin{pmatrix}-2\\0\end{pmatrix}\right\rangle=-2 .

However, for every v∈Rnv\in\mathbb{R}^n

⟨v,v⟩=∑i=1nvi2 ≥0,(1)\langle v,v\rangle=\sum_{i=1}^nv_i^2\ \ge 0, \tag{1}

so the scalar product of a vector with itself is non-negative, and

∥v∥:=⟨v,v⟩=v12+⋯+vn2\|v\|:=\sqrt{\langle v,v\rangle}=\sqrt{v_1^2+\dots+v_n^2}

is a well-defined real number, the norm of vv.

Lemma 1. The norm ∥v∥\|v\| is the length of the segment from the origin to vv. For v,w∈R2v,w\in\mathbb{R}^2, ∥v−w∥2=∥v∥2+∥w∥2−2∥v∥ ∥w∥cos⁡θ,\|v-w\|^2=\|v\|^2+\|w\|^2-2\|v\|\,\|w\|\cos\theta, where θ\theta is the angle between vv and ww.

Proof. The formula for the norm follows by repeatedly applying the Pythagorean theorem. For n=3n=3, the segment from O=(0,0,0)O=(0,0,0) to (v1,v2,0)(v_1,v_2,0) has length v12+v22\sqrt{v_1^2+v_2^2}; the segment from OO to v=(v1,v2,v3)v=(v_1,v_2,v_3) is the hypotenuse of a right triangle with legs of length v12+v22\sqrt{v_1^2+v_2^2} and ∣v3∣|v_3|, hence has length (v12+v22)2+v32=v12+v22+v32\sqrt{(\sqrt{v_1^2+v_2^2})^2+v_3^2}=\sqrt{v_1^2+v_2^2+v_3^2}. The formula for ∥v−w∥2\|v-w\|^2 is a reformulation of the law of cosines in the triangle with sides vv, ww, v−wv-w. □\square

        v - w
   v  <-------- w          triangle with vertices O, v, w:
    \         /            sides ||v||, ||w||, ||v-w||,
     \       /             angle theta at O between v and w
 ||v|| \  th  / ||w||
         \   /
          \ /
           O

Scalar product with respect to a matrix. For A∈Matn×nA\in\mathrm{Mat}_{n\times n} define

⟨⋅,⋅⟩A:Rn×Rn→R,⟨v,w⟩A:=vTAw.\langle\cdot,\cdot\rangle_A:\mathbb{R}^n\times\mathbb{R}^n\to\mathbb{R},\qquad \langle v,w\rangle_A:=v^TAw .

Here vTv^T is a row vector (1×n1\times n), so vTAwv^TAw is a 1×11\times1 matrix, i.e. a real number.

Lemma 2 (fundamental properties of the scalar product).

  • Bilinearity: for fixed ww, the maps v↦⟨v,w⟩v\mapsto\langle v,w\rangle and v↦⟨w,v⟩v\mapsto\langle w,v\rangle are linear; e.g. ⟨rv+r′v′,w⟩=r⟨v,w⟩+r′⟨v′,w⟩\langle rv+r'v',w\rangle=r\langle v,w\rangle+r'\langle v',w\rangle for r,r′∈Rr,r'\in\mathbb{R}, v,v′∈Rnv,v'\in\mathbb{R}^n.
  • Symmetry: ⟨v,w⟩=⟨w,v⟩\langle v,w\rangle=\langle w,v\rangle.

Proof. w↦vTww\mapsto v^Tw is linear (it is multiplication of a vector by a fixed matrix); linearity in the other argument is similar or follows from symmetry. For symmetry use (vTw)T=wT(vT)T=wTv(v^Tw)^T=w^T(v^T)^T=w^Tv, and note that a 1×11\times1 matrix equals its transpose: the left side is ⟨v,w⟩\langle v,w\rangle, the right side is ⟨w,v⟩\langle w,v\rangle. □\square

Angle formula. Using bilinearity and symmetry,

∥v−w∥2=⟨v−w,v−w⟩=⟨v,v⟩−⟨v,w⟩−⟨w,v⟩+⟨w,w⟩=∥v∥2+∥w∥2−2⟨v,w⟩.\|v-w\|^2=\langle v-w,v-w\rangle=\langle v,v\rangle-\langle v,w\rangle-\langle w,v\rangle+\langle w,w\rangle=\|v\|^2+\|w\|^2-2\langle v,w\rangle .

Comparing with the law of cosines (Lemma 1) we get

⟨v,w⟩=∥v∥ ∥w∥cos⁡θ.\langle v,w\rangle=\|v\|\,\|w\|\cos\theta .

The factor cos⁡θ\cos\theta vanishes precisely when θ=±π2\theta=\pm\frac{\pi}{2} (±90∘\pm90^\circ). So ⟨v,w⟩=0\langle v,w\rangle=0 if the angle between vv and ww is 90∘90^\circ, which motivates:

Definition. Two vectors v,w∈Rnv,w\in\mathbb{R}^n are orthogonal if ⟨v,w⟩=∑i=1nviwi=0\langle v,w\rangle=\sum_{i=1}^nv_iw_i=0.

2. Positive definite matrices

Definition and Lemma. If AA is a symmetric n×nn\times n matrix (A=ATA=A^T), then ⟨v,w⟩A=vTAw\langle v,w\rangle_A=v^TAw is bilinear and symmetric, i.e. Lemma 2 holds verbatim for ⟨ , ⟩A\langle\ ,\ \rangle_A (the standard scalar product is the case A=idnA=\mathrm{id}_n).

(Symmetry: ⟨v,w⟩A=(vTAw)T=wTATv=wTAv=⟨w,v⟩A\langle v,w\rangle_A=(v^TAw)^T=w^TA^Tv=w^TAv=\langle w,v\rangle_A.)

Example (Minkowski form). For A=(100001000010000−1)A=\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&-1\end{pmatrix} we get Aw=(w1,w2,w3,−w4)TAw=(w_1,w_2,w_3,-w_4)^T and

⟨v,w⟩A=vTAw=v1w1+v2w2+v3w3−v4w4.\langle v,w\rangle_A=v^TAw=v_1w_1+v_2w_2+v_3w_3-v_4w_4 .

This is the basis of Minkowski space of special relativity, R3,1\mathbb{R}^{3,1} (3 space coordinates, 1 time coordinate). The standard basis vectors e1,…,e4e_1,\dots,e_4 are orthogonal to each other, but ⟨e4,e4⟩A=−1\langle e_4,e_4\rangle_A=-1 whereas ⟨ek,ek⟩A=1\langle e_k,e_k\rangle_A=1 for the other three: the form distinguishes the last direction from the others.

Definition. A symmetric matrix AA is

  • positive definite if ⟨v,v⟩A>0\langle v,v\rangle_A>0 for all v∈Rnv\in\mathbb{R}^n, v≠0v\ne0. Then we define the norm with respect to AA: ∥v∥A:=⟨v,v⟩A\|v\|_A:=\sqrt{\langle v,v\rangle_A};
  • negative definite if ⟨v,v⟩A<0\langle v,v\rangle_A<0 for all v≠0v\ne0;
  • indefinite if there exist v,wv,w with ⟨v,v⟩A>0\langle v,v\rangle_A>0 and ⟨w,w⟩A<0\langle w,w\rangle_A<0.

idn\mathrm{id}_n is positive definite by (1). The Minkowski matrix is indefinite: ⟨e1,e1⟩A=1>0\langle e_1,e_1\rangle_A=1>0 and ⟨e4,e4⟩A=−1<0\langle e_4,e_4\rangle_A=-1<0.

The following criterion tests positive definiteness without examining all vectors. For a square matrix AA the principal submatrix of size rr is A(r)=(aij)1≤i,j≤rA^{(r)}=(a_{ij})_{1\le i,j\le r}, i.e. the first rr rows and columns of AA.

Proposition (criterion). Let AA be a symmetric n×nn\times n matrix. The following are equivalent:

  1. the bilinear form ⟨ , ⟩A\langle\ ,\ \rangle_A is positive definite;
  2. AA is positive definite;
  3. det⁡(A(r))>0\det\bigl(A^{(r)}\bigr)>0 for all 1≤r≤n1\le r\le n.

In particular a positive definite matrix has det⁡A>0\det A>0, hence is invertible. (A proof of the criterion requires the methods of Section 3 and is not given here.)

Example. Let A=(12t258t814)A=\begin{pmatrix}1&2&t\\2&5&8\\t&8&14\end{pmatrix}, t∈Rt\in\mathbb{R}. We have det⁡A(1)=1>0\det A^{(1)}=1>0 and det⁡A(2)=det⁡(1225)=1>0\det A^{(2)}=\det\begin{pmatrix}1&2\\2&5\end{pmatrix}=1>0, and

det⁡A=det⁡A(3)=−5t2+32t−50.\det A=\det A^{(3)}=-5t^2+32t-50 .

For t=3t=3 this equals −45+96−50=1>0-45+96-50=1>0, so AA is positive definite. For t=4t=4 it equals −80+128−50=−2<0-80+128-50=-2<0, so AA is not positive definite; in fact it is indefinite (a negative determinant means an odd number of negative eigenvalues, and an eigenvector ww for a negative eigenvalue μ\mu has ⟨w,w⟩A=μ∥w∥2<0\langle w,w\rangle_A=\mu\|w\|^2<0, while ⟨e1,e1⟩A=1>0\langle e_1,e_1\rangle_A=1>0).

Application in analysis. For a twice differentiable f:R2→Rf:\mathbb{R}^2\to\mathbb{R} one considers the Hessian matrix of second partial derivatives. For f(x,y)=x2+y2f(x,y)=x^2+y^2 it is (2002)\begin{pmatrix}2&0\\0&2\end{pmatrix}, positive definite; for g(x,y)=x2−y2g(x,y)=x^2-y^2 it is (200−2)\begin{pmatrix}2&0\\0&-2\end{pmatrix}, indefinite. In analysis one proves that, at a point where both first partial derivatives vanish, positive definiteness of the Hessian implies a local minimum. So ff has a local minimum at (0,0)(0,0) (moving in any direction increases ff), but gg does not: gg has a saddle point at (0,0)(0,0), increasing in the xx-direction and decreasing in the yy-direction.

3. Euclidean spaces

Definition. A Euclidean vector space is a real vector space VV together with a map ⟨ , ⟩:V×V→R\langle\ ,\ \rangle:V\times V\to\mathbb{R} that is

  • bilinear (⟨v,⋅⟩\langle v,\cdot\rangle and ⟨⋅,v⟩:V→R\langle\cdot,v\rangle:V\to\mathbb{R} are linear for every v∈Vv\in V),
  • symmetric (⟨v,w⟩=⟨w,v⟩\langle v,w\rangle=\langle w,v\rangle),
  • positive definite (⟨v,v⟩>0\langle v,v\rangle>0 for every v≠0v\ne0).

The map is also called the scalar product on VV. Vectors v,wv,w are orthogonal, written v⊥wv\perp w, if ⟨v,w⟩=0\langle v,w\rangle=0. The norm is ∥v∥:=⟨v,v⟩ (≥0)\|v\|:=\sqrt{\langle v,v\rangle}\ (\ge0) and the distance between v,wv,w is d(v,w):=∥v−w∥d(v,w):=\|v-w\|.

Examples.

  1. Rn\mathbb{R}^n with the standard scalar product is a Euclidean space. More generally, for a symmetric positive definite matrix AA, Rn\mathbb{R}^n with ⟨ , ⟩A\langle\ ,\ \rangle_A is a Euclidean space. This abstract definition turns the key properties of Rn\mathbb{R}^n with its scalar product into a definition, just as a vector space abstracts the key properties of Rn\mathbb{R}^n.
  2. If (V,⟨ , ⟩)(V,\langle\ ,\ \rangle) is Euclidean, so is every subspace of VV. In particular every subspace of Rn\mathbb{R}^n (e.g. any plane in R3\mathbb{R}^3) is a Euclidean space.
  3. The vector space C=C([−1,1])C=C([-1,1]) of continuous functions f:[−1,1]→Rf:[-1,1]\to\mathbb{R} with ⟨f,g⟩:=∫−11f(x)g(x) dx\langle f,g\rangle:=\int_{-1}^{1}f(x)g(x)\,dx is an (infinite-dimensional) Euclidean space, of fundamental importance in analysis. Bilinearity and symmetry come from elementary properties of the integral.
  4. On V=RnV=\mathbb{R}^n, ⟨v,w⟩:=v1w1+⋯+vn−1wn−1−vnwn\langle v,w\rangle:=v_1w_1+\dots+v_{n-1}w_{n-1}-v_nw_n is bilinear and symmetric but not positive definite, hence not a scalar product.

Proposition. Let (V,⟨ , ⟩)(V,\langle\ ,\ \rangle) be Euclidean, v∈Vv\in V, r∈Rr\in\mathbb{R}. Then (1) ∥v∥≥0\|v\|\ge0; (2) ∥v∥=0  ⟺  v=0\|v\|=0\iff v=0; (3) ∥rv∥=∣r∣ ∥v∥\|rv\|=|r|\,\|v\|.

Proof. (1) and (3) are immediate (∥rv∥2=⟨rv,rv⟩=r2⟨v,v⟩\|rv\|^2=\langle rv,rv\rangle=r^2\langle v,v\rangle). (2) holds because ⟨ , ⟩\langle\ ,\ \rangle is positive definite. □\square

Throughout the rest of this note (V,⟨ , ⟩)(V,\langle\ ,\ \rangle) is a Euclidean vector space.

Lemma 3 (one direction). Let e∈Ve\in V with ∥e∥=1\|e\|=1 and let v∈Vv\in V. Then v~:=v−⟨v,e⟩ e\tilde v:=v-\langle v,e\rangle\,e is orthogonal to ee, and v=v~+⟨v,e⟩ e(2)v=\tilde v+\langle v,e\rangle\,e \tag{2} expresses vv as the sum of a scalar multiple of ee and a vector orthogonal to ee.

Proof. By bilinearity: ⟨v~,e⟩=⟨v−⟨v,e⟩e, e⟩=⟨v,e⟩−⟨v,e⟩⟨e,e⟩⏟1=0.\langle\tilde v,e\rangle=\langle v-\langle v,e\rangle e,\,e\rangle=\langle v,e\rangle-\langle v,e\rangle\underbrace{\langle e,e\rangle}_{1}=0 . Equation (2) is obvious from the definition of v~\tilde v. □\square

3.1 Orthogonal complement

Definition and Lemma. The orthogonal complement of a subset M⊆VM\subseteq V is M⊥:={v∈V∣⟨v,m⟩=0 for all m∈M}.M^\perp:=\{v\in V\mid\langle v,m\rangle=0\text{ for all }m\in M\}. It is a subspace of VV. For a subspace WW, W∩W⊥={0}.(3)W\cap W^\perp=\{0\}. \tag{3}

(Equation (3) says that the zero vector is the only element of WW orthogonal to all of WW; it follows from positive definiteness, specifically Proposition (2): if w∈W∩W⊥w\in W\cap W^\perp, then ⟨w,w⟩=0\langle w,w\rangle=0, so w=0w=0. Colloquially, when WW gets larger, W⊥W^\perp gets smaller; Corollary 2 below makes this precise.)

Example. Let W=L((1,2,4),(1,1,0))⊆R3W=L\bigl((1,2,4),(1,1,0)\bigr)\subseteq\mathbb{R}^3. A vector x=(x1,x2,x3)x=(x_1,x_2,x_3) is orthogonal to WW iff it is orthogonal to v1=(1,2,4)v_1=(1,2,4) and v2=(1,1,0)v_2=(1,1,0) (by linearity of ⟨x,⋅⟩\langle x,\cdot\rangle):

x⊥v1  ⟺  x1+2x2+4x3=0,x⊥v2  ⟺  x1+x2=0.x\perp v_1\iff x_1+2x_2+4x_3=0,\qquad x\perp v_2\iff x_1+x_2=0 .

Solving the homogeneous system (124110)⇝(1240−1−4)⇝(124014)\begin{pmatrix}1&2&4\\1&1&0\end{pmatrix}\rightsquigarrow\begin{pmatrix}1&2&4\\0&-1&-4\end{pmatrix}\rightsquigarrow\begin{pmatrix}1&2&4\\0&1&4\end{pmatrix} shows that x3x_3 is free, x2=−4x3x_2=-4x_3, x1=4x3x_1=4x_3, so W⊥=L((4,−4,1)).W^\perp=L\bigl((4,-4,1)\bigr).

3.2 Orthonormal systems and orthogonal projection

Definition. A family v1,…,vnv_1,\dots,v_n is an orthonormal system if ∥vi∥=1\|v_i\|=1 (i.e. ⟨vi,vi⟩=1\langle v_i,v_i\rangle=1) for all ii, and vi⊥vjv_i\perp v_j (i.e. ⟨vi,vj⟩=0\langle v_i,v_j\rangle=0) for all i≠ji\ne j. If in addition they form a basis of VV, it is an orthonormal basis. The standard basis of Rn\mathbb{R}^n is an orthonormal basis for the standard scalar product. A system with only the orthogonality condition is an orthogonal system.

Theorem (orthogonal projection). Let u1,…,unu_1,\dots,u_n be an orthonormal system and U=L(u1,…,un)⊆VU=L(u_1,\dots,u_n)\subseteq V. Then there is a unique linear map p:V→Up:V\to U, the orthogonal projection onto UU, such that

  1. p(u)=up(u)=u for all u∈Uu\in U;
  2. p(v)−v∈U⊥p(v)-v\in U^\perp for all v∈Vv\in V.

In particular every v∈Vv\in V can be written as v=p(v)⏟∈U+(v−p(v))⏟∈U⊥,v=\underbrace{p(v)}_{\in U}+\underbrace{(v-p(v))}_{\in U^\perp}, and this is the unique way to write vv as a sum of a vector in UU and a vector in U⊥U^\perp. The map is p(v)=∑k=1n⟨v,uk⟩ uk.(4)p(v)=\sum_{k=1}^n\langle v,u_k\rangle\,u_k . \tag{4} More generally, if u1,…,unu_1,\dots,u_n is an orthogonal system (not necessarily normalized, all uk≠0u_k\ne0), then p(v)=∑k=1n⟨v,uk⟩⟨uk,uk⟩ uk(5)p(v)=\sum_{k=1}^n\frac{\langle v,u_k\rangle}{\langle u_k,u_k\rangle}\,u_k \tag{5} is the orthogonal projection onto U=L(u1,…,un)U=L(u_1,\dots,u_n).

          v
         /|
        / |  v - p(v)  (in U-perp)
       /  |
  ----O---p(v)-------   U  (a plane or line through O)

Example. In R3\mathbb{R}^3 take u1=(1,0,0)u_1=(1,0,0), u2=(0,1,0)u_2=(0,1,0), an orthonormal system. Then UU is the xyxy-plane and U⊥=L((0,0,1))U^\perp=L\bigl((0,0,1)\bigr) is the zz-axis. The projection sends v=(x,y,z)v=(x,y,z) to p(v)=⟨v,u1⟩u1+⟨v,u2⟩u2=xu1+yu2=(x,y,0)p(v)=\langle v,u_1\rangle u_1+\langle v,u_2\rangle u_2=xu_1+yu_2=(x,y,0).

Proof. The map pp of (4) is linear because ⟨⋅,uk⟩\langle\cdot,u_k\rangle is linear. It satisfies (1) and (2): one checks this using that the uku_k form an orthonormal system, exactly as in Lemma 3 (e.g. ⟨p(v)−v,ul⟩=∑k⟨v,uk⟩⟨uk,ul⟩−⟨v,ul⟩=⟨v,ul⟩−⟨v,ul⟩=0\langle p(v)-v,u_l\rangle=\sum_k\langle v,u_k\rangle\langle u_k,u_l\rangle-\langle v,u_l\rangle=\langle v,u_l\rangle-\langle v,u_l\rangle=0 for each ll, hence p(v)−v⊥Up(v)-v\perp U).

Uniqueness of pp. If q:V→Uq:V\to U is another map with (1) and (2), then for all v∈Vv\in V and u∈Uu\in U ⟨p(v)−q(v),u⟩=⟨(p(v)−v)−(q(v)−v)⏟∈U⊥,u⟩=0.\langle p(v)-q(v),u\rangle=\bigl\langle\underbrace{(p(v)-v)-(q(v)-v)}_{\in U^\perp},u\bigr\rangle=0 . Since q(v),p(v)∈Uq(v),p(v)\in U, the vector p(v)−q(v)p(v)-q(v) lies in UU; taking u=p(v)−q(v)u=p(v)-q(v) shows it is orthogonal to itself, so it is zero by (3). Hence p=qp=q.

Uniqueness of the decomposition. v=p(v)+(v−p(v))v=p(v)+(v-p(v)) is such a representation. If v=u′+u′′v=u'+u'' with u′∈Uu'\in U, u′′∈U⊥u''\in U^\perp is another, then u:=p(v)−u′=u′′−(v−p(v))u:=p(v)-u'=u''-(v-p(v)) lies in UU (left side) and in U⊥U^\perp (right side), so u=0u=0 by (3); thus u′=p(v)u'=p(v) and u′′=v−p(v)u''=v-p(v).

Formula (5). For an orthogonal system uku_k, apply (4) to the orthonormal system uk/∥uk∥u_k/\|u_k\|: ⟨v,uk⟩∥uk∥2uk\frac{\langle v,u_k\rangle}{\|u_k\|^2}u_k. □\square

Corollary 1 (coordinates in an orthonormal basis). If u1,…,unu_1,\dots,u_n is an orthonormal system that spans VV, then

  • for every v∈Vv\in V v=∑k=1n⟨v,uk⟩ uk;(6)v=\sum_{k=1}^n\langle v,u_k\rangle\,u_k ; \tag{6}
  • the vectors are necessarily linearly independent, i.e. an orthonormal basis.

Proof. Apply the theorem with U=VU=V: then p=idp=\mathrm{id} and (4) gives (6). For independence suppose 0=∑kakuk0=\sum_ka_ku_k and apply ⟨⋅,ul⟩\langle\cdot,u_l\rangle (any 1≤l≤n1\le l\le n): 0=⟨0,ul⟩=∑kak⟨uk,ul⟩=al,0=\langle0,u_l\rangle=\sum_ka_k\langle u_k,u_l\rangle=a_l, since all terms with k≠lk\ne l vanish and ⟨ul,ul⟩=1\langle u_l,u_l\rangle=1. □\square

Example. For the standard basis of Rn\mathbb{R}^n and v=(v1,…,vn)v=(v_1,\dots,v_n) we have ⟨ei,v⟩=vi\langle e_i,v\rangle=v_i, and (6) is the usual expansion v=v1e1+⋯+vnenv=v_1e_1+\dots+v_ne_n. In general (6) is a convenient way of computing the coordinates of a vector with respect to an orthonormal basis: no linear system has to be solved, just scalar products.

Corollary 2. If U⊆VU\subseteq V is a subspace of a finite-dimensional Euclidean space, then dim⁡U⊥=dim⁡V−dim⁡UandU=(U⊥)⊥.\dim U^\perp=\dim V-\dim U\qquad\text{and}\qquad U=(U^\perp)^\perp .

Proof sketch. By the theorem every vv decomposes uniquely as u+u′u+u' with u∈Uu\in U, u′∈U⊥u'\in U^\perp, and U∩U⊥={0}U\cap U^\perp=\{0\}: so V=U⊕U⊥V=U\oplus U^\perp and the dimension formula follows. Every u∈Uu\in U is orthogonal to all of U⊥U^\perp, so U⊆(U⊥)⊥U\subseteq(U^\perp)^\perp, and both have dimension dim⁡V−dim⁡U⊥=dim⁡U\dim V-\dim U^\perp=\dim U, hence they agree. □\square

3.3 Gram-Schmidt orthogonalization

Proposition (Gram-Schmidt). Let v1,…,vrv_1,\dots,v_r be linearly independent vectors in a Euclidean space. Define inductively

w1:=1∥v1∥v1(normalization)w2′:=v2−⟨v2,w1⟩w1(orthogonalization w.r.t. L(w1))w2:=1∥w2′∥w2′(normalization)  ⋮wr′:=vr−∑k=1r−1⟨vr,wk⟩wk(orthogonalization w.r.t. L(w1,…,wr−1))wr:=1∥wr′∥wr′(normalization)\begin{aligned} w_1&:=\frac1{\|v_1\|}v_1&&\text{(normalization)}\\ w_2'&:=v_2-\langle v_2,w_1\rangle w_1&&\text{(orthogonalization w.r.t. }L(w_1)\text{)}\\ w_2&:=\frac1{\|w_2'\|}w_2'&&\text{(normalization)}\\ &\ \ \vdots\\ w_r'&:=v_r-\sum_{k=1}^{r-1}\langle v_r,w_k\rangle w_k&&\text{(orthogonalization w.r.t. }L(w_1,\dots,w_{r-1})\text{)}\\ w_r&:=\frac1{\|w_r'\|}w_r'&&\text{(normalization)} \end{aligned}

Then w1,…,wrw_1,\dots,w_r is an orthonormal system and L(v1,…,vr)=L(w1,…,wr)L(v_1,\dots,v_r)=L(w_1,\dots,w_r). In particular, if the viv_i form a basis, so do the wiw_i (an orthonormal basis). Hence every finite-dimensional Euclidean space has an orthonormal basis.

Proof. In each step wr′w_r' is constructed to be orthogonal to w1,…,wr−1w_1,\dots,w_{r-1} (it is vrv_r minus its orthogonal projection (4) onto L(w1,…,wr−1)L(w_1,\dots,w_{r-1})). Dividing by the norm makes ∥wr∥=1\|w_r\|=1; this is possible since wr′≠0w_r'\ne0 (otherwise vrv_r would be a combination of w1,…,wr−1w_1,\dots,w_{r-1}, hence of v1,…,vr−1v_1,\dots,v_{r-1}, contradicting linear independence), so ∥wr′∥>0\|w_r'\|>0 by positive definiteness. At each step L(v1,…,vk)=L(w1,…,wk)L(v_1,\dots,v_k)=L(w_1,\dots,w_k) because wkw_k is a combination of vkv_k and w1,…,wk−1w_1,\dots,w_{k-1} with nonzero coefficient on vkv_k. □\square

Example. Standard scalar product on R2\mathbb{R}^2, v1=(11)v_1=\begin{pmatrix}1\\1\end{pmatrix}, v2=(21)v_2=\begin{pmatrix}2\\1\end{pmatrix} (a basis of R2\mathbb{R}^2):

w1=12(11),w2′=v2−⟨v2,w1⟩w1=(21)−32⋅12(11)=12(1−1),w2=12(1−1).w_1=\frac1{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix},\qquad w_2'=v_2-\langle v_2,w_1\rangle w_1=\begin{pmatrix}2\\1\end{pmatrix}-\frac{3}{\sqrt2}\cdot\frac1{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix}=\frac12\begin{pmatrix}1\\-1\end{pmatrix},\qquad w_2=\frac1{\sqrt2}\begin{pmatrix}1\\-1\end{pmatrix}.

Geometrically w2′w_2' is the vector on the line {v2+aw1}\{v_2+aw_1\} that is orthogonal to w1w_1.

Corollary 3. For a subspace UU of a finite-dimensional Euclidean space VV there are two unique linear maps, the orthogonal projections pU:V→Up_U:V\to U and pU⊥:V→U⊥p_{U^\perp}:V\to U^\perp, such that every v∈Vv\in V satisfies v=pU(v)+pU⊥(v).(7)v=p_U(v)+p_{U^\perp}(v). \tag{7}

Proof. UU has an orthonormal basis (Gram-Schmidt), so the theorem gives pUp_U. Define pU⊥(v):=v−pU(v)p_{U^\perp}(v):=v-p_U(v); then (7) holds and pU⊥(v)∈U⊥p_{U^\perp}(v)\in U^\perp by the theorem; uniqueness of the decomposition is part of the theorem. □\square

4. Worked examples and computational methods

Task A: orthonormal basis of a subspace U⊆RnU\subseteq\mathbb{R}^n. Compute any basis of UU, then apply Gram-Schmidt.

Task B: orthogonal projection pU(x)p_U(x) of x∈Rnx\in\mathbb{R}^n. Compute an orthonormal (or just orthogonal) basis u1,…,uku_1,\dots,u_k of UU (Task A) and use (4) (or (5)): pU(x)=∑i⟨x,ui⟩uip_U(x)=\sum_i\langle x,u_i\rangle u_i. Alternatively compute U⊥U^\perp (Task C), then pU⊥(x)p_{U^\perp}(x) and pU(x)=x−pU⊥(x)p_U(x)=x-p_{U^\perp}(x); this may be easier when dim⁡U>dim⁡U⊥\dim U>\dim U^\perp.

Task C: orthogonal complement of U⊆RnU\subseteq\mathbb{R}^n. Take a basis u1,…,uku_1,\dots,u_k of UU and solve the homogeneous system ⟨x,u1⟩=0,…,⟨x,uk⟩=0\langle x,u_1\rangle=0,\dots,\langle x,u_k\rangle=0; equivalently, form the matrix whose rows are u1,…,uku_1,\dots,u_k and compute its kernel.

Example 1 (Legendre polynomials). Let V=P≤2={at2+bt+c}V=\mathbb{P}_{\le2}=\{at^2+bt+c\} with ⟨p,q⟩=∫−11p(x)q(x) dx\langle p,q\rangle=\int_{-1}^1p(x)q(x)\,dx, and the basis e1=1e_1=1, e2=te_2=t, e3=t2e_3=t^2. Scalar products:

⟨e1,e1⟩=∫−111 dt=2,⟨e1,e2⟩=0,⟨e1,e3⟩=23,⟨e2,e2⟩=23,⟨e2,e3⟩=0,⟨e3,e3⟩=25,\langle e_1,e_1\rangle=\int_{-1}^1 1\,dt=2,\quad\langle e_1,e_2\rangle=0,\quad\langle e_1,e_3\rangle=\tfrac23,\quad\langle e_2,e_2\rangle=\tfrac23,\quad\langle e_2,e_3\rangle=0,\quad\langle e_3,e_3\rangle=\tfrac25 ,

(the others follow by symmetry). Gram-Schmidt:

w1=e1∥e1∥=12,w2′=e2−⟨e2,w1⟩w1=t,w2=t2/3=32 t,w_1=\frac{e_1}{\|e_1\|}=\frac1{\sqrt2},\qquad w_2'=e_2-\langle e_2,w_1\rangle w_1=t,\qquad w_2=\frac{t}{\sqrt{2/3}}=\sqrt{\tfrac32}\,t,

w3′=e3−⟨e3,w1⟩w1−⟨e3,w2⟩w2=t2−13,∥w3′∥2=∫−11(t2−13)2dt=845,w_3'=e_3-\langle e_3,w_1\rangle w_1-\langle e_3,w_2\rangle w_2=t^2-\tfrac13,\qquad\|w_3'\|^2=\int_{-1}^1\Bigl(t^2-\tfrac13\Bigr)^2dt=\tfrac8{45},

w3=w3′∥w3′∥=104 (3t2−1).w_3=\frac{w_3'}{\|w_3'\|}=\frac{\sqrt{10}}4\,(3t^2-1).

So (12,32 t,104(3t2−1))\bigl(\frac1{\sqrt2},\sqrt{\frac32}\,t,\frac{\sqrt{10}}4(3t^2-1)\bigr) is an orthonormal basis; such polynomials are called Legendre polynomials.

Example 2 (projection onto a plane in R3\mathbb{R}^3). U={x−y+3z=0}⊆R3U=\{x-y+3z=0\}\subseteq\mathbb{R}^3, t=(0,1,5)t=(0,1,5).

Basis of UU. With free parameters y=ay=a, z=bz=b: x=a−3bx=a-3b, so U={(a−3b,a,b)}=L((1,1,0),(−3,0,1))U=\{(a-3b,a,b)\}=L\bigl((1,1,0),(-3,0,1)\bigr).

Complement. The equation says U=L((1,−1,3))⊥U=L\bigl((1,-1,3)\bigr)^\perp, hence by Corollary 2, U⊥=L((1,−1,3))U^\perp=L\bigl((1,-1,3)\bigr) and dim⁡U⊥=1=3−2\dim U^\perp=1=3-2.

Projection via Gram-Schmidt. v1=(1,1,0)v_1=(1,1,0), and v2′=v2−⟨v2,v1⟩⟨v1,v1⟩v1=(−3,0,1)+32(1,1,0)=(−32,32,1)v_2'=v_2-\frac{\langle v_2,v_1\rangle}{\langle v_1,v_1\rangle}v_1=(-3,0,1)+\frac32(1,1,0)=\bigl(-\frac32,\frac32,1\bigr) (orthogonal to v1v_1). Then by (5), with ⟨t,v1⟩=1\langle t,v_1\rangle=1, ⟨v1,v1⟩=2\langle v_1,v_1\rangle=2, ⟨t,v2′⟩=32+5=132\langle t,v_2'\rangle=\frac32+5=\frac{13}2, ⟨v2′,v2′⟩=94+94+1=112\langle v_2',v_2'\rangle=\frac94+\frac94+1=\frac{11}2:

tU=12(1,1,0)+1311(−32,32,1)=(−1411,2511,1311).t_U=\frac12(1,1,0)+\frac{13}{11}\Bigl(-\frac32,\frac32,1\Bigr)=\Bigl(-\frac{14}{11},\frac{25}{11},\frac{13}{11}\Bigr).

Check: tU⊥=t−tU=1411(1,−1,3)∈U⊥t_{U^\perp}=t-t_U=\frac{14}{11}(1,-1,3)\in U^\perp.

Example 3 (projection in R4\mathbb{R}^4). W={x−t=0, y+z−t=0}⊆R4W=\{x-t=0,\ y+z-t=0\}\subseteq\mathbb{R}^4 (coordinates x,y,z,tx,y,z,t), u=(1,5,1,6)u=(1,5,1,6).

Basis of WW. x=tx=t, y=t−zy=t-z; with z=az=a, t=bt=b we get (b,b−a,a,b)=a(0,−1,1,0)+b(1,1,0,1)(b,b-a,a,b)=a(0,-1,1,0)+b(1,1,0,1). So v1=(0,−1,1,0)v_1=(0,-1,1,0), v2=(1,1,0,1)v_2=(1,1,0,1).

Complement. Impose ⟨x,v1⟩=0\langle x,v_1\rangle=0, ⟨x,v2⟩=0\langle x,v_2\rangle=0: −y+z=0-y+z=0, x+y+t=0x+y+t=0. With x=ax=a, y=by=b: z=bz=b, t=−a−bt=-a-b, so W⊥=L((1,0,0,−1),(0,1,1,−1))W^\perp=L\bigl((1,0,0,-1),(0,1,1,-1)\bigr).

Projection. Orthogonalize: ⟨v2,v1⟩=−1\langle v_2,v_1\rangle=-1, so v2′=v2−−12v1=(1,12,12,1)v_2'=v_2-\frac{-1}{2}v_1=\bigl(1,\frac12,\frac12,1\bigr); to avoid fractions take w2=2v2′=(2,1,1,2)w_2=2v_2'=(2,1,1,2), still orthogonal to v1v_1. By (5): ⟨u,v1⟩=−4\langle u,v_1\rangle=-4, ⟨v1,v1⟩=2\langle v_1,v_1\rangle=2, ⟨u,w2⟩=20\langle u,w_2\rangle=20, ⟨w2,w2⟩=10\langle w_2,w_2\rangle=10, so

pW(u)=−42v1+2010w2=−2(0,−1,1,0)+2(2,1,1,2)=(4,4,0,4).p_W(u)=\frac{-4}{2}v_1+\frac{20}{10}w_2=-2(0,-1,1,0)+2(2,1,1,2)=(4,4,0,4).

Check: u−pW(u)=(−3,1,1,2)u-p_W(u)=(-3,1,1,2) is orthogonal to v1v_1 (−1+1=0-1+1=0) and to v2v_2 (−3+1+2=0-3+1+2=0).

See also Orthogonal and Symmetric MatricesOrthogonal matrices have orthonormal rows and columns, symmetric matrices are exactly those with an orthonormal eigenbasis, and affine subspaces (lines, planes, hyperplanes) are studied with orthogonal projections to compute distances.Orthogonal and Symmetric Matrices → and Eigenvalues and EigenvectorsAn eigenvector of a square matrix is a nonzero vector that the matrix only rescales; eigenvalues are the roots of the characteristic polynomial, and a matrix is diagonalizable exactly when the eigenspaces together have dimension n.Eigenvalues and Eigenvectors →.

Versione ripasso

Scalar product on Rn\mathbb{R}^n. ⟨v,w⟩=vTw=∑viwi\langle v,w\rangle=v^Tw=\sum v_iw_i. Bilinear, symmetric, ⟨v,v⟩=∑vi2≥0\langle v,v\rangle=\sum v_i^2\ge0. Norm ∥v∥=⟨v,v⟩\|v\|=\sqrt{\langle v,v\rangle}. ∥v−w∥2=∥v∥2+∥w∥2−2⟨v,w⟩\|v-w\|^2=\|v\|^2+\|w\|^2-2\langle v,w\rangle, so ⟨v,w⟩=∥v∥ ∥w∥cos⁡θ\langle v,w\rangle=\|v\|\,\|w\|\cos\theta. Orthogonal: ⟨v,w⟩=0\langle v,w\rangle=0.

Matrix scalar product. For symmetric AA: ⟨v,w⟩A=vTAw\langle v,w\rangle_A=v^TAw is bilinear and symmetric. AA is positive definite if ⟨v,v⟩A>0\langle v,v\rangle_A>0 for all v≠0v\ne0 (negative definite: <0<0; indefinite: both signs occur). Criterion: AA is positive definite   ⟺  det⁡A(r)>0\iff\det A^{(r)}>0 for all r=1,…,nr=1,\dots,n, where A(r)A^{(r)} is the top-left r×rr\times r block. Positive definite ⇒det⁡A>0⇒A\Rightarrow\det A>0\Rightarrow A invertible. Example: diag(1,1,1,−1)\mathrm{diag}(1,1,1,-1) (Minkowski) is indefinite; Hessian of x2+y2x^2+y^2 is positive definite (local minimum), of x2−y2x^2-y^2 indefinite (saddle).

Euclidean space. Vector space with bilinear, symmetric, positive definite ⟨ , ⟩\langle\ ,\ \rangle. Norm, distance d(v,w)=∥v−w∥d(v,w)=\|v-w\|, ∥rv∥=∣r∣∥v∥\|rv\|=|r|\|v\|, ∥v∥=0  ⟺  v=0\|v\|=0\iff v=0. Examples: (Rn,⟨ , ⟩A)(\mathbb{R}^n,\langle\ ,\ \rangle_A) with AA symmetric positive definite; subspaces; continuous functions on [−1,1][-1,1] with ∫fg\int fg. Not a scalar product: v1w1+⋯+vn−1wn−1−vnwnv_1w_1+\dots+v_{n-1}w_{n-1}-v_nw_n.

Orthogonal complement. M⊥={v∣⟨v,m⟩=0 ∀m∈M}M^\perp=\{v\mid\langle v,m\rangle=0\ \forall m\in M\} is a subspace; W∩W⊥={0}W\cap W^\perp=\{0\} (positive definiteness); dim⁡U⊥=dim⁡V−dim⁡U\dim U^\perp=\dim V-\dim U and (U⊥)⊥=U(U^\perp)^\perp=U. To compute U⊥U^\perp in Rn\mathbb{R}^n: solve ⟨x,ui⟩=0\langle x,u_i\rangle=0 for a basis uiu_i of UU (kernel of the matrix with rows uiu_i).

Orthogonal projection.

  • Orthonormal u1,…,uku_1,\dots,u_k spanning UU: pU(v)=∑k⟨v,uk⟩ukp_U(v)=\sum_k\langle v,u_k\rangle u_k. Orthogonal (not normalized): pU(v)=∑k⟨v,uk⟩⟨uk,uk⟩ukp_U(v)=\sum_k\frac{\langle v,u_k\rangle}{\langle u_k,u_k\rangle}u_k.
  • v=pU(v)+pU⊥(v)v=p_U(v)+p_{U^\perp}(v), uniquely; pU⊥(v)=v−pU(v)p_{U^\perp}(v)=v-p_U(v).
  • Orthonormal basis ⇒\Rightarrow coordinates v=∑⟨v,uk⟩ukv=\sum\langle v,u_k\rangle u_k (no linear system). An orthonormal system is automatically independent.

Gram-Schmidt. For independent v1,…,vrv_1,\dots,v_r: wr′=vr−∑k<r⟨vr,wk⟩wkw_r'=v_r-\sum_{k<r}\langle v_r,w_k\rangle w_k, wr=wr′/∥wr′∥w_r=w_r'/\|w_r'\|; same span at each step. Hence every finite-dimensional Euclidean space has an orthonormal basis. Example: (1,1),(2,1)↦12(1,1),12(1,−1)(1,1),(2,1)\mapsto\frac1{\sqrt2}(1,1),\frac1{\sqrt2}(1,-1). Polynomials of degree ≤2\le2 with ∫−11\int_{-1}^1: 12, 32t, 104(3t2−1)\frac1{\sqrt2},\ \sqrt{\frac32}t,\ \frac{\sqrt{10}}4(3t^2-1).

Typical mistakes.

  • Using the formula ∑⟨v,uk⟩uk\sum\langle v,u_k\rangle u_k with vectors that are orthogonal but not normalized (the denominators ⟨uk,uk⟩\langle u_k,u_k\rangle are then needed).
  • Applying Gram-Schmidt to dependent vectors (wr′=0w_r'=0 appears), or forgetting to normalize at the end.
  • Computing ⟨v,w⟩A\langle v,w\rangle_A with a non-symmetric AA and assuming symmetry; or declaring AA positive definite from only det⁡A>0\det A>0 (all leading principal minors are needed).
  • Expecting dim⁡U⊥=dim⁡U\dim U^\perp=\dim U (the correct relation is dim⁡U+dim⁡U⊥=dim⁡V\dim U+\dim U^\perp=\dim V).

Teoria collegata