Salta al contenuto
Note per Studenti Orthogonal and Symmetric Matrices Report

Orthogonal and Symmetric Matrices

In questa pagina 5

This note continues Euclidean SpacesA scalar product gives vectors a length and an orthogonality relation; with it every subspace has an orthogonal complement, vectors can be projected orthogonally, and Gram-Schmidt builds orthonormal bases.Euclidean Spaces → (scalar product ⟨v,w⟩=vTw\langle v,w\rangle=v^Tw on Rn\mathbb{R}^n, norm, orthogonal projection) and uses 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 →.

1. Orthogonal matrices

Definition. A real square matrix A∈Matn×nA\in\mathrm{Mat}_{n\times n} is orthogonal if AAT=id.AA^T=\mathrm{id}. This is equivalent to: AA is invertible and A−1=ATA^{-1}=A^T.

Lemma (why the name). For A∈Matn×nA\in\mathrm{Mat}_{n\times n} the following are equivalent:

  1. AA is orthogonal;
  2. the nn rows of AA are an orthonormal basis of Rn\mathbb{R}^n;
  3. the nn columns of AA are an orthonormal basis of Rn\mathbb{R}^n.

Proof. If eie_i is the ii-th standard basis vector, AeiAe_i is the ii-th column of AA. Then ⟨Aei,Aej⟩=(Aei)T(Aej)=eiTATAej.\langle Ae_i,Ae_j\rangle=(Ae_i)^T(Ae_j)=e_i^TA^TAe_j . The vector ATAejA^TAe_j is the jj-th column of ATAA^TA, and eiT(ATAej)e_i^T(A^TAe_j) is the ii-th entry of that vector, i.e. the entry (ATA)ij(A^TA)_{ij}. Hence "the columns are orthonormal" (this scalar product equals 11 for i=ji=j and 00 for i≠ji\ne j) says exactly ATA=idA^TA=\mathrm{id}. For square matrices ATA=id  ⟺  AAT=idA^TA=\mathrm{id}\iff AA^T=\mathrm{id} (each says ATA^T is the inverse of AA), which gives (1)  ⟺  \iff(3); applying this to ATA^T gives (1)  ⟺  \iff(2) (the rows of AA are the columns of ATA^T, and ATA^T is orthogonal iff AA is). Orthonormal vectors are linearly independent, so nn of them form a basis. □\square

Remark. The matrix whose columns are an orthonormal basis is therefore orthogonal, and its inverse is obtained for free as its transpose.

2. Symmetric matrices and orthogonal diagonalization

Theorem (principal axes theorem). The following are equivalent for an n×nn\times n matrix AA:

  1. AA is symmetric (A=ATA=A^T);
  2. AA is orthogonally diagonalizable: there is an orthogonal matrix PP such that P−1APP^{-1}AP is diagonal;
  3. AA has an orthonormal eigenbasis (an eigenbasis of Rn\mathbb{R}^n that is also an orthonormal basis).

If these conditions hold, the columns of PP form an orthonormal eigenbasis, and vice versa. Note that P−1=PTP^{-1}=P^T is obtained without computing an inverse.

(For (2) the columns of PP are the eigenvectors, so here PP plays the role of the matrix of eigenvectors of the previous note; P−1AP=PTAP=DP^{-1}AP=P^TAP=D.)

The implication (1)⇒\Rightarrow(2) in particular says: a symmetric matrix is diagonalizable. The vectors of an orthonormal eigenbasis are also called the principal axes of AA. The easy parts are (2)  ⟺  \iff(3) (this is the earlier lemma "diagonalizable   ⟺  \iff eigenbasis" together with the orthogonal-matrix lemma above: the columns of PP are orthonormal) and (2)⇒\Rightarrow(1): if PTAP=DP^TAP=D then A=PDPTA=PDP^T and AT=(PDPT)T=PDTPT=PDPT=AA^T=(PDP^T)^T=PD^TP^T=PDP^T=A. The difficult direction is (1)⇒\Rightarrow(2); one proves it by showing that a symmetric real matrix has only real eigenvalues (as opposed to complex ones); its full proof is not given in these notes (see the cited reference in the course text).

The 2×22\times2 case. The characteristic polynomial of a symmetric matrix A=(abbd)A=\begin{pmatrix}a&b\\b&d\end{pmatrix} is χA(t)=(a−t)(d−t)−b2=t2−(a+d)t+ad−b2,\chi_A(t)=(a-t)(d-t)-b^2=t^2-(a+d)t+ad-b^2, with zeros λ1/2=a+d2±(a+d)24−ad+b2=a+d2±(a−d)24+b2.\lambda_{1/2}=\frac{a+d}{2}\pm\sqrt{\frac{(a+d)^2}{4}-ad+b^2}=\frac{a+d}{2}\pm\sqrt{\frac{(a-d)^2}{4}+b^2}. The expression under the root is always non-negative, so λ1/2\lambda_{1/2} are real. By contrast, the non-symmetric matrix (0−110)\begin{pmatrix}0&-1\\1&0\end{pmatrix} has the imaginary eigenvalues ±i\pm i (see 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 →).

Proposition (eigenvectors of distinct eigenvalues). Let AA be symmetric and λ≠μ\lambda\ne\mu two distinct eigenvalues with eigenvectors vv and ww respectively. Then v⊥wv\perp w.

Proof. Using A=ATA=A^T: λ⟨v,w⟩=⟨λv,w⟩=⟨Av,w⟩=(Av)Tw=vTATw=vTAw=⟨v,Aw⟩=⟨v,μw⟩=μ⟨v,w⟩.\lambda\langle v,w\rangle=\langle\lambda v,w\rangle=\langle Av,w\rangle=(Av)^Tw=v^TA^Tw=v^TAw=\langle v,Aw\rangle=\langle v,\mu w\rangle=\mu\langle v,w\rangle . Hence (λ−μ)⟨v,w⟩=0(\lambda-\mu)\langle v,w\rangle=0, and since λ≠μ\lambda\ne\mu, ⟨v,w⟩=0\langle v,w\rangle=0. □\square

So for a symmetric matrix with distinct eigenvalues the eigenvectors are automatically orthogonal; it remains only to normalize them. (For a repeated eigenvalue one orthonormalizes a basis of the eigenspace with Gram-Schmidt; vectors from different eigenspaces are orthogonal anyway.)

Example 1 (a 2×22\times2 matrix). Which of A=(1221)A=\begin{pmatrix}1&2\\2&1\end{pmatrix} and B=(0000)B=\begin{pmatrix}0&0\\0&0\end{pmatrix} is orthogonally diagonalizable? By the theorem, exactly the symmetric ones, so both are. BB is already diagonal: P=idP=\mathrm{id}, and e1,e2e_1,e_2 is an orthonormal eigenbasis. For AA: the eigenvalues are a+d2±(a−d)24+b2=1±2\frac{a+d}{2}\pm\sqrt{\frac{(a-d)^2}4+b^2}=1\pm2, i.e. 33 and −1-1.

  • A+id=(2222)A+\mathrm{id}=\begin{pmatrix}2&2\\2&2\end{pmatrix} has kernel spanned by w1=e1−e2=(1,−1)w_1=e_1-e_2=(1,-1) (eigenvalue −1-1);
  • A−3 id=(−222−2)A-3\,\mathrm{id}=\begin{pmatrix}-2&2\\2&-2\end{pmatrix} has kernel spanned by w2=e1+e2=(1,1)w_2=e_1+e_2=(1,1) (eigenvalue 33).

They are orthogonal: ⟨(1,−1),(1,1)⟩=0\langle(1,-1),(1,1)\rangle=0, but not normal. An orthonormal eigenbasis is w1∥w1∥=12(1−1),w2∥w2∥=12(11).\frac{w_1}{\|w_1\|}=\frac1{\sqrt2}\begin{pmatrix}1\\-1\end{pmatrix},\qquad\frac{w_2}{\|w_2\|}=\frac1{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix}.

Example 2 (a 3×33\times3 matrix). A=(5−42−45222−1)A=\begin{pmatrix}5&-4&2\\-4&5&2\\2&2&-1\end{pmatrix} is symmetric. Its characteristic polynomial is χA(t)=−t3+9t2+9t−81=−(t−9)(t−3)(t+3)\chi_A(t)=-t^3+9t^2+9t-81=-(t-9)(t-3)(t+3), and eigenvalues with eigenvectors are

  • λ1=9\lambda_1=9, v1=(1,−1,0)v_1=(1,-1,0);
  • λ2=3\lambda_2=3, v2=(1,1,1)v_2=(1,1,1);
  • λ3=−3\lambda_3=-3, v3=(1,1,−2)v_3=(1,1,-2).

(Check, e.g. Av3=(5−4−4, −4+5−4, 2+2+2)=(−3,−3,6)=−3v3Av_3=(5-4-4,\ -4+5-4,\ 2+2+2)=(-3,-3,6)=-3v_3.) These three vectors are orthogonal, as one sees by direct computation, or, since the eigenvalues are distinct, automatically by the proposition above. They are not normal; dividing by the norms gives an orthonormal eigenbasis:

12(1−10),13(111),16(11−2).\frac1{\sqrt2}\begin{pmatrix}1\\-1\\0\end{pmatrix},\qquad\frac1{\sqrt3}\begin{pmatrix}1\\1\\1\end{pmatrix},\qquad\frac1{\sqrt6}\begin{pmatrix}1\\1\\-2\end{pmatrix}.

With PP the matrix having these columns, PP is orthogonal and PTAP=diag(9,3,−3)P^TAP=\mathrm{diag}(9,3,-3).

3. Affine subspaces

Definition. Let VV be a vector space. An affine subspace of VV is a subset of the form v0+W:={v0+w∣w∈W}v_0+W:=\{v_0+w\mid w\in W\} for a vector v0∈Vv_0\in V and a subspace W⊆VW\subseteq V.

That is, an affine subspace is a subspace translated by a vector. Lines and planes in R3\mathbb{R}^3 not necessarily through the origin are affine subspaces. A key example: the solution set of a (not necessarily homogeneous) linear system Ax=bAx=b is an affine subspace (a particular solution plus the kernel of AA).

Lemma. Let X=v+W⊆RnX=v+W\subseteq\mathbb{R}^n be an affine subspace. If also X=v′+W′X=v'+W' with v′∈Rnv'\in\mathbb{R}^n and a subspace W′⊆RnW'\subseteq\mathbb{R}^n, then W=W′W=W' and v−v′∈Wv-v'\in W. In other words, WW is uniquely determined by XX.

Proof. Since v=v+0∈X=v′+W′v=v+0\in X=v'+W', we have v−v′∈W′v-v'\in W'; since v′∈X=v+Wv'\in X=v+W, we have v′−v∈Wv'-v\in W, hence v−v′∈Wv-v'\in W as well. Then W′=v′−v′+W′=X−v′=(v+W)−v′=W+(v−v′)⏟∈W=W,W'=v'-v'+W'=X-v'=(v+W)-v'=W+\underbrace{(v-v')}_{\in W}=W, where we used that for a subspace AA and a∈Aa\in A, a+A=Aa+A=A. □\square

So the dimension of an affine subspace is well defined: dim⁡X:=dim⁡W\dim X:=\dim W for X=v+WX=v+W.

Relative position. Let X,X′X,X' be affine subspaces with associated subspaces W,W′W,W'.

  • XX intersects X′X' if X∩X′≠∅X\cap X'\ne\emptyset;
  • XX is parallel to X′X' if W⊆W′W\subseteq W' or W′⊆WW'\subseteq W;
  • XX is skew to X′X' if W∩W′={0}W\cap W'=\{0\} and X∩X′=∅X\cap X'=\emptyset.

Example (skew lines). X=(1,3,5)+L((1,1,2))={(1+s,3+s,5+2s)}X=(1,3,5)+L\bigl((1,1,2)\bigr)=\{(1+s,3+s,5+2s)\} and X′=(4,3,6)+L((−1,−1,2))={(4−t,3−t,6+2t)}X'=(4,3,6)+L\bigl((-1,-1,2)\bigr)=\{(4-t,3-t,6+2t)\}. The vectors (1,1,2)(1,1,2) and (−1,−1,2)(-1,-1,2) are linearly independent, so the lines are not parallel. For an intersection point we need (1+s,3+s,5+2s)=(4−t,3−t,6+2t)(1+s,3+s,5+2s)=(4-t,3-t,6+2t). The first two equations give s+t=3s+t=3 and s+t=0s+t=0, which is impossible. So X∩X′=∅X\cap X'=\emptyset and the lines are skew.

3.1 Closest point to the origin

Definition. For affine subspaces X,X′⊆RnX,X'\subseteq\mathbb{R}^n, points x∈Xx\in X, x′∈X′x'\in X' realize the minimal distance of XX and X′X' if d(x,x′)≤d(y,y′)d(x,x')\le d(y,y') for all y∈Xy\in X, y′∈X′y'\in X'. We then write d(X,X′):=d(x,x′)d(X,X'):=d(x,x').

Proposition. Let X=v0+WX=v_0+W be an affine subspace of a Euclidean space VV. There is a unique vector v∈Vv\in V characterized by either of the following equivalent properties:

  1. vv is the (only) element of X∩W⊥X\cap W^\perp;
  2. vv realizes the minimal distance of the origin to XX.

It is given by v=pW⊥(v0)=v0−pW(v0),v=p_{W^\perp}(v_0)=v_0-p_W(v_0), the projection of v0v_0 onto the orthogonal complement W⊥W^\perp.

Proof. X∩W⊥X\cap W^\perp contains vv: by the projection theorem write v0=w+vv_0=w+v with uniquely determined w=pW(v0)∈Ww=p_W(v_0)\in W and v=pW⊥(v0)∈W⊥v=p_{W^\perp}(v_0)\in W^\perp. Then v=v0−w∈v0+W=Xv=v_0-w\in v_0+W=X and v∈W⊥v\in W^\perp.

X∩W⊥X\cap W^\perp contains only vv: if v′∈W⊥∩Xv'\in W^\perp\cap X, then v′=v0+w~v'=v_0+\tilde w with w~∈W\tilde w\in W, so v−v′=−w−w~∈Wv-v'=-w-\tilde w\in W; also v−v′∈W⊥v-v'\in W^\perp, hence v−v′∈W∩W⊥={0}v-v'\in W\cap W^\perp=\{0\} and v′=vv'=v.

vv realizes the minimal distance: let x∈Xx\in X be any point. Then w′:=x−v∈Ww':=x-v\in W (both xx and vv lie in v0+Wv_0+W), and ∥x∥=∥v+w′∥=⟨v+w′,v+w′⟩=⟨v,v⟩+2⟨v,w′⟩⏟0+⟨w′,w′⟩=∥v∥2+∥w′∥2≥∥v∥.\|x\|=\|v+w'\|=\sqrt{\langle v+w',v+w'\rangle}=\sqrt{\langle v,v\rangle+2\underbrace{\langle v,w'\rangle}_{0}+\langle w',w'\rangle}=\sqrt{\|v\|^2+\|w'\|^2}\ge\|v\|.

No other point does: if x∈Xx\in X has ∥x∥=∥v∥\|x\|=\|v\|, the same computation gives ∥v∥2=∥v∥2+∥w′∥2\|v\|^2=\|v\|^2+\|w'\|^2, so w′=0w'=0, i.e. x=vx=v. □\square

              W-perp
                |
   v0 = w + v   |   v0 + W  (affine subspace X, parallel to W)
          *.....*---------------
         /     /|
        /     / | v = p_{W-perp}(v0): closest point of X to O
       O-----*---> W              w = p_W(v0)

3.2 Hyperplanes

Definition. A hyperplane in Rn\mathbb{R}^n is an affine subspace H=v0+WH=v_0+W of dimension n−1n-1 (so dim⁡W=n−1\dim W=n-1). A line is a hyperplane in R2\mathbb{R}^2; a plane is a hyperplane in R3\mathbb{R}^3.

Proposition. Let a∈Rna\in\mathbb{R}^n, a≠0a\ne0, and b∈Rb\in\mathbb{R}. Then H:={x∈Rn∣⟨x,a⟩=b}H:=\{x\in\mathbb{R}^n\mid\langle x,a\rangle=b\} is a hyperplane, and its distance to the origin is d(0,H)=∣b∣∥a∥.d(0,H)=\frac{|b|}{\|a\|}.

Proof. The equation ⟨x,a⟩=b\langle x,a\rangle=b, i.e. a1x1+⋯+anxn=ba_1x_1+\dots+a_nx_n=b, is a non-homogeneous linear system whose matrix (a1 … an)(a_1\ \dots\ a_n) has rank 11 since a≠0a\ne0, so the solution set has dimension n−1n-1. The associated subspace is W={x∣⟨x,a⟩=0}W=\{x\mid\langle x,a\rangle=0\}, and H=v+WH=v+W for some vv (structure of solution sets of linear systems). Clearly a∈W⊥a\in W^\perp. Put λ:=b∥a∥2\lambda:=\frac b{\|a\|^2}; then ⟨λa,a⟩=b∥a∥2⟨a,a⟩=b,\langle\lambda a,a\rangle=\frac b{\|a\|^2}\langle a,a\rangle=b, so λa∈H\lambda a\in H; and λa∈W⊥\lambda a\in W^\perp. So λa∈H∩W⊥\lambda a\in H\cap W^\perp and by the previous proposition it is the point of HH closest to the origin: d(0,H)=∥λa∥=∣b∣∥a∥d(0,H)=\|\lambda a\|=\frac{|b|}{\|a\|}. □\square

Proposition (Hesse normal form). Let H=v0+W⊆RnH=v_0+W\subseteq\mathbb{R}^n be a hyperplane that does not contain the origin, and d=d(0,H)>0d=d(0,H)>0. Then there is a unique vector a∈Rna\in\mathbb{R}^n with

  1. ∥a∥=1\|a\|=1,
  2. a∈W⊥a\in W^\perp (a normal vector of HH),
  3. H={x∈Rn∣⟨x,a⟩=d}H=\{x\in\mathbb{R}^n\mid\langle x,a\rangle=d\}.

It is a=v∥v∥a=\frac v{\|v\|}, where vv is the unique element of H∩W⊥H\cap W^\perp (equivalently the point of HH closest to the origin). The equation ⟨x,a⟩=d\langle x,a\rangle=d is the Cartesian equation of the hyperplane.

Example. Take W=L((1,2,4),(1,1,0))⊆R3W=L\bigl((1,2,4),(1,1,0)\bigr)\subseteq\mathbb{R}^3, W⊥=L((4,−4,1))W^\perp=L\bigl((4,-4,1)\bigr) (computed in Euclidean SpacesA scalar product gives vectors a length and an orthogonality relation; with it every subspace has an orthogonal complement, vectors can be projected orthogonally, and Gram-Schmidt builds orthonormal bases.Euclidean Spaces →) and the plane H=v0+WH=v_0+W with v0=(11,11,11)v_0=(11,11,11). To find H∩W⊥H\cap W^\perp write v0=w+vv_0=w+v with w∈Ww\in W, v∈W⊥v\in W^\perp, i.e. (111111)=a(124)+b(110)+c(4−41).\begin{pmatrix}11\\11\\11\end{pmatrix}=a\begin{pmatrix}1\\2\\4\end{pmatrix}+b\begin{pmatrix}1\\1\\0\end{pmatrix}+c\begin{pmatrix}4\\-4\\1\end{pmatrix}. The coefficient matrix (11421−4401)\begin{pmatrix}1&1&4\\2&1&-4\\4&0&1\end{pmatrix} has inverse 133(−1181815−124−41)\frac1{33}\begin{pmatrix}-1&1&8\\18&15&-12\\4&-4&1\end{pmatrix} and the unique solution is (a,b,c)T=A−1v0=13(8,21,1)T.(a,b,c)^T=A^{-1}v_0=\tfrac13(8,21,1)^T . So c=13c=\frac13 (this can be double-checked as c=⟨v0,(4,−4,1)⟩⟨(4,−4,1),(4,−4,1)⟩=1133c=\frac{\langle v_0,(4,-4,1)\rangle}{\langle(4,-4,1),(4,-4,1)\rangle}=\frac{11}{33}) and v=13(4−41).v=\frac13\begin{pmatrix}4\\-4\\1\end{pmatrix}. This is the point of HH closest to the origin, at distance d=∥v∥=339=113d=\|v\|=\sqrt{\frac{33}9}=\sqrt{\frac{11}3}. The unit normal is a=v∥v∥=133(4,−4,1)a=\frac v{\|v\|}=\frac1{\sqrt{33}}(4,-4,1), and the Cartesian equation ⟨x,a⟩=d\langle x,a\rangle=d reads, multiplying by 33\sqrt{33}, 4x1−4x2+x3=114x_1-4x_2+x_3=11.

3.3 Lines in R3\mathbb{R}^3

A line L⊆R3L\subseteq\mathbb{R}^3 can be described in two ways.

Parametric (vector) equations. L=v+L(w)L=v+L(w) for vectors v,w∈R3v,w\in\mathbb{R}^3: the points are v+λwv+\lambda w, λ∈R\lambda\in\mathbb{R}; componentwise xk=vk+λwk,k=1,2,3.x_k=v_k+\lambda w_k,\qquad k=1,2,3. ww is the direction vector of the line.

Cartesian equations. A system of two equations ⟨x,a⟩=b,⟨x,a′⟩=b′\langle x,a\rangle=b,\qquad\langle x,a'\rangle=b' (i.e. a1x1+a2x2+a3x3=ba_1x_1+a_2x_2+a_3x_3=b and a1′x1+a2′x2+a3′x3=b′a_1'x_1+a_2'x_2+a_3'x_3=b'), with a,a′a,a' linearly independent. Each equation is a plane (a hyperplane in R3\mathbb{R}^3), and the line is the intersection of the two planes.

From parametric to Cartesian: eliminate the parameter λ\lambda. From Cartesian to parametric: solve the linear system.

Example (Cartesian to parametric). The equations x−y+1=0x-y+1=0, 3x−y−2z+1=03x-y-2z+1=0 define a line. Row reduction of (1−10−13−1−2−1)\begin{pmatrix}1&-1&0&-1\\3&-1&-2&-1\end{pmatrix} gives y=1+zy=1+z, x=y−1=zx=y-1=z. So L=(010)+L((111)).L=\begin{pmatrix}0\\1\\0\end{pmatrix}+L\left(\begin{pmatrix}1\\1\\1\end{pmatrix}\right).

Example (parametric to Cartesian). L=(1,0,1)+L((2,1,−1))L=(1,0,1)+L\bigl((2,1,-1)\bigr) has parametric equations x1=1+2λx_1=1+2\lambda, x2=λx_2=\lambda, x3=1−λx_3=1-\lambda. Since λ=x2\lambda=x_2, the other two read x1=1+2x2x_1=1+2x_2 and x3=1−x2x_3=1-x_2, i.e. x1−2x2=1,x2+x3=1,x_1-2x_2=1,\qquad x_2+x_3=1, or equivalently ⟨x,(1,−2,0)⟩=1\langle x,(1,-2,0)\rangle=1 and ⟨x,(0,1,1)⟩=1\langle x,(0,1,1)\rangle=1.

Planes containing a line. The planes PP containing LL (given by ⟨x,a⟩=b\langle x,a\rangle=b, ⟨x,a′⟩=b′\langle x,a'\rangle=b') are exactly those with equation ⟨x,λa+λ′a′⟩=λb+λ′b′,λ,λ′∈R with λa+λ′a′≠0.\langle x,\lambda a+\lambda'a'\rangle=\lambda b+\lambda'b',\qquad\lambda,\lambda'\in\mathbb{R}\text{ with }\lambda a+\lambda'a'\ne0 . Indeed this describes a (hyper)plane, and if x∈Lx\in L then it satisfies both given equations and so also their linear combination.

Example. L: x2=0, x3=1L:\ x_2=0,\ x_3=1, i.e. ⟨x,(0,1,0)⟩=0\langle x,(0,1,0)\rangle=0 and ⟨x,(0,0,1)⟩=1\langle x,(0,0,1)\rangle=1 (equivalently L=(0,0,1)+L((1,0,0))L=(0,0,1)+L\bigl((1,0,0)\bigr)). The planes containing LL are ⟨x,(0,λ,λ′)⟩=λ′,\langle x,(0,\lambda,\lambda')\rangle=\lambda', and the vectors (0,λ,λ′)(0,\lambda,\lambda') are precisely those orthogonal to the direction (1,0,0)(1,0,0).

Plane through LL parallel to another line. Given another line L′=v′+L(w′)L'=v'+L(w'), the line L′L' is parallel to a plane ⟨x,λa+λ′a′⟩=λb+λ′b′\langle x,\lambda a+\lambda'a'\rangle=\lambda b+\lambda'b' through LL exactly if w′⊥λa+λ′a′w'\perp\lambda a+\lambda'a'. Continuing the example, let L′: x3=2, x=yL':\ x_3=2,\ x=y, i.e. L′=(0,0,2)+L((1,1,0))L'=(0,0,2)+L\bigl((1,1,0)\bigr). We need (1,1,0)⊥(0,λ,λ′)(1,1,0)\perp(0,\lambda,\lambda'), which gives λ=0\lambda=0 with λ′\lambda' arbitrary. So the plane ⟨x,(0,0,λ′)⟩=λ′\langle x,(0,0,\lambda')\rangle=\lambda', i.e. x3=1x_3=1, contains LL and is parallel to L′L'.

4. Distance between two affine subspaces

Theorem. Let X=v+WX=v+W and X′=v′+W′X'=v'+W' be affine subspaces. Put d:=v−v′d:=v-v' and Z:=W+W′Z:=W+W', and let m:=pZ⊥(d)=d−pZ(d)m:=p_{Z^\perp}(d)=d-p_Z(d) be the orthogonal projection of dd onto Z⊥Z^\perp. For points x∈Xx\in X, x′∈X′x'\in X' the following are equivalent:

  1. x−x′=mx-x'=m;
  2. d(x,x′)=∥m∥d(x,x')=\|m\|;
  3. xx and x′x' realize the minimal distance of XX and X′X', i.e. d(x,x′)=d(X,X′)d(x,x')=d(X,X');
  4. x−x′x-x' is orthogonal to WW and to W′W' (i.e. to every w∈Ww\in W and w′∈W′w'\in W').

In particular XX intersects X′X' if and only if d∈Zd\in Z (then m=0m=0).

Proof. (1)⇒\Rightarrow(2) is obvious since d(x,x′)=∥x−x′∥d(x,x')=\|x-x'\|.

(3)  ⟺  \iff(2): write x=v+wx=v+w, x′=v′+w′x'=v'+w' with arbitrary w∈Ww\in W, w′∈W′w'\in W'. Then d(x,x′)=∥x−x′∥=∥v−v′+w−w′∥=∥d+(w−w′)∥.d(x,x')=\|x-x'\|=\|v-v'+w-w'\|=\|d+(w-w')\|. The vector w−w′w-w' is an arbitrary vector of Z=W+W′Z=W+W' (note −w′-w' also ranges over W′W'). So we seek z∈Zz\in Z with ∥d+z∥\|d+z\| minimal, i.e. the point of the affine subspace d+Zd+Z closest to the origin. By the closest-point proposition this distance is ∥pZ⊥(d)∥=∥m∥\|p_{Z^\perp}(d)\|=\|m\|, attained exactly when d+z=md+z=m. This shows (3)  ⟺  \iff(2).

(3)⇒\Rightarrow(4): if x,x′x,x' realize the minimal distance, then in particular x′x' is the point of X′X' nearest to xx. By the closest-point proposition (applied to X′−xX'-x) x′−xx'-x is orthogonal to W′W'. Exchanging the roles of XX and X′X', x−x′x-x' is orthogonal to WW.

(4)⇒\Rightarrow(1): the assumption gives x−x′∈W⊥∩W′⊥=(W+W′)⊥=Z⊥x-x'\in W^\perp\cap W'^\perp=(W+W')^\perp=Z^\perp (a vector is orthogonal to W+W′W+W' precisely if it is orthogonal to WW and to W′W', by bilinearity). From x−x′=v+w−v′−w′x-x'=v+w-v'-w' we get d=v−v′=(x−x′)⏟∈Z⊥+(w′−w)⏟∈Z.d=v-v'=\underbrace{(x-x')}_{\in Z^\perp}+\underbrace{(w'-w)}_{\in Z}. By uniqueness of the decomposition of dd as a vector in Z⊥Z^\perp plus a vector in ZZ, x−x′=pZ⊥(d)=mx-x'=p_{Z^\perp}(d)=m.

Finally X∩X′≠∅  ⟺  d(X,X′)=0  ⟺  m=0  ⟺  d∈ZX\cap X'\ne\emptyset\iff d(X,X')=0\iff m=0\iff d\in Z. □\square

Example. Consider two lines in R3\mathbb{R}^3: X=(2,−1,−3)+L((1,1,2)),X′=(−3,0,0)+L((0,2,−4)).X=(2,-1,-3)+L\bigl((1,1,2)\bigr),\qquad X'=(-3,0,0)+L\bigl((0,2,-4)\bigr). General points: x=(2+a, −1+a, −3+2a)x=(2+a,\,-1+a,\,-3+2a) and x′=(−3, 2b, −4b)x'=(-3,\,2b,\,-4b), so x−x′=(5+a, −1+a−2b, −3+2a+4b).x-x'=(5+a,\ -1+a-2b,\ -3+2a+4b). Use criterion (4): x−x′x-x' must be orthogonal to (1,1,2)(1,1,2) and to (0,2,−4)(0,2,-4): 0=(5+a)+(−1+a−2b)+2(−3+2a+4b)=−2+6a+6b,0=(5+a)+(-1+a-2b)+2(-3+2a+4b)=-2+6a+6b, 0=2(−1+a−2b)−4(−3+2a+4b)=10−6a−20b.0=2(-1+a-2b)-4(-3+2a+4b)=10-6a-20b. Adding the equations gives 8−14b=08-14b=0, i.e. b=47b=\frac47, and then a=13−b=−521a=\frac13-b=-\frac5{21}. The minimizing points are x=(3721,−2621,−7321)x=\bigl(\frac{37}{21},-\frac{26}{21},-\frac{73}{21}\bigr) and x′=(−3,87,−167)x'=\bigl(-3,\frac87,-\frac{16}7\bigr), with x−x′=2521(4,−2,−1),d(X,X′)=252121=2521.x-x'=\frac{25}{21}(4,-2,-1),\qquad d(X,X')=\frac{25}{21}\sqrt{21}=\frac{25}{\sqrt{21}} . (The lines are skew: the directions (1,1,2)(1,1,2), (0,2,−4)(0,2,-4) are independent and the distance is not 00.)

5. Summary of computational methods

Task 1. Convert a line from Cartesian to parametric form. Pick two distinct points p,qp,q satisfying the Cartesian equations; then L=p+L(p−q)L=p+L(p-q). Other choices of points give other vector equations, but the direction vectors are nonzero multiples of each other (by the uniqueness Lemma).

Task 2. Convert a line from parametric L=v+L(w)L=v+L(w) to Cartesian form. Express one coordinate in terms of the free parameter and substitute into the other coordinate equations.

Task 3. Plane through three non-collinear points p,q,r∈R3p,q,r\in\mathbb{R}^3. Write P=p+L(q−p, r−p)P=p+L(q-p,\,r-p); compute a normal vector to L(q−p,r−p)L(q-p,r-p) (i.e. a generator of its orthogonal complement) and write the corresponding Cartesian equation.

Task 4. Plane containing a line LL and a point r∉Lr\notin L. Choose two distinct points p,q∈Lp,q\in L and apply Task 3 to p,q,rp,q,r.

Task 5. Given a plane P={⟨x,a⟩=d}P=\{\langle x,a\rangle=d\}, a line L=v+L(w)⊆PL=v+L(w)\subseteq P and a point p∈Pp\in P, find the line M⊆PM\subseteq P through pp orthogonal to LL. Write M=p+L(w′)M=p+L(w') and impose w′⊥aw'\perp a and w′⊥ww'\perp w, i.e. w′∈L(a,w)⊥w'\in L(a,w)^\perp (compute as in Task C of Euclidean SpacesA scalar product gives vectors a length and an orthogonality relation; with it every subspace has an orthogonal complement, vectors can be projected orthogonally, and Gram-Schmidt builds orthonormal bases.Euclidean Spaces →).

Task 6. Cartesian equation of a plane P=v+L(w1,w2)P=v+L(w_1,w_2). Compute W=L(w1,w2)W=L(w_1,w_2) and W⊥W^\perp, choose a nonzero a∈W⊥a\in W^\perp and set d=⟨a,v⟩d=\langle a,v\rangle. The representation is not unique: another ⟨x,a′⟩=d′\langle x,a'\rangle=d' has a=λa′a=\lambda a' and d=λd′d=\lambda d' for some λ≠0\lambda\ne0.

Task 7. Are two lines parallel? In parametric form L=v+L(w)L=v+L(w), L′=v′+L(w′)L'=v'+L(w'): check whether w,w′w,w' are linearly dependent. If the lines are given by Cartesian equations convert first (Task 1).

Task 8. Are two lines skew? Check (a) w,w′w,w' linearly independent and (b) L∩L′=∅L\cap L'=\emptyset (for (b) it is often convenient to use Cartesian equations).

Task 9. Is a line L=v+L(w)L=v+L(w) parallel to a plane PP? If P=v′+L(w1′,w2′)P=v'+L(w_1',w_2'): is ww a linear combination of w1′,w2′w_1',w_2'? If P={⟨x,a⟩=d}P=\{\langle x,a\rangle=d\}: is ⟨w,a⟩=0\langle w,a\rangle=0?

Task 10. Is the line orthogonal to the plane? If P={⟨x,a⟩=d}P=\{\langle x,a\rangle=d\}: are w,aw,a linearly dependent? If P=v′+L(w1′,w2′)P=v'+L(w_1',w_2'): is ⟨w,w1′⟩=0\langle w,w_1'\rangle=0 and ⟨w,w2′⟩=0\langle w,w_2'\rangle=0?

Task 11. Distance of two affine subspaces X=v+WX=v+W, X′=v′+W′X'=v'+W' (also for points, W={0}W=\{0\}). Either:

  • apply the theorem via (1): compute Z=W+W′Z=W+W', d=v−v′d=v-v', m=pZ⊥(d)=d−pZ(d)m=p_{Z^\perp}(d)=d-p_Z(d), take general points x∈Xx\in X, x′∈X′x'\in X' and solve the linear system x−x′=mx-x'=m; or
  • apply the theorem via (4): take general points x∈Xx\in X, x′∈X′x'\in X' and solve the homogeneous linear system ⟨x−x′,w⟩=0\langle x-x',w\rangle=0, ⟨x−x′,w′⟩=0\langle x-x',w'\rangle=0, with ww running over a spanning set of WW and w′w' over a spanning set of W′W'. (This is what the example above does.)

Versione ripasso

Orthogonal matrix. AAT=idAA^T=\mathrm{id}, i.e. AA invertible with A−1=ATA^{-1}=A^T. Equivalent: the rows form an orthonormal basis of Rn\mathbb{R}^n; equivalent: the columns form an orthonormal basis. (Proof: ⟨Aei,Aej⟩=(ATA)ij\langle Ae_i,Ae_j\rangle=(A^TA)_{ij}.)

Principal axes theorem. For an n×nn\times n real matrix, equivalent:

  • AA symmetric (A=ATA=A^T);
  • AA orthogonally diagonalizable: P−1AP=PTAP=DP^{-1}AP=P^TAP=D with PP orthogonal;
  • AA has an orthonormal eigenbasis (the columns of PP).

Hard direction: symmetric ⇒\Rightarrow diagonalizable, because a symmetric real matrix has only real eigenvalues (for 2×22\times2: λ=a+d2±(a−d)24+b2\lambda=\frac{a+d}2\pm\sqrt{\frac{(a-d)^2}4+b^2}, real). In particular symmetric matrices are always diagonalizable.

  • Eigenvectors of distinct eigenvalues of a symmetric matrix are orthogonal: λ⟨v,w⟩=⟨Av,w⟩=⟨v,Aw⟩=μ⟨v,w⟩\lambda\langle v,w\rangle=\langle Av,w\rangle=\langle v,Aw\rangle=\mu\langle v,w\rangle. Method: eigenvalues, eigenvectors, orthogonalize inside each eigenspace if it has dimension >1>1, normalize.
  • Examples: (1221)\begin{pmatrix}1&2\\2&1\end{pmatrix} has orthonormal eigenbasis 12(1,−1)\frac1{\sqrt2}(1,-1) (eigenvalue −1-1), 12(1,1)\frac1{\sqrt2}(1,1) (eigenvalue 33); (5−42−45222−1)\begin{pmatrix}5&-4&2\\-4&5&2\\2&2&-1\end{pmatrix} has eigenvalues 9,3,−39,3,-3 with eigenvectors (1,−1,0),(1,1,1),(1,1,−2)(1,-1,0),(1,1,1),(1,1,-2).

Affine subspaces. v0+Wv_0+W, with WW uniquely determined (the direction space); dim⁡=dim⁡W\dim=\dim W. Solution set of Ax=bAx=b. Relative position: intersecting (X∩X′≠∅X\cap X'\ne\emptyset), parallel (W⊆W′W\subseteq W' or W′⊆WW'\subseteq W), skew (W∩W′={0}W\cap W'=\{0\} and X∩X′=∅X\cap X'=\emptyset).

Closest point to origin. For X=v0+WX=v_0+W: the unique point of X∩W⊥X\cap W^\perp, equal to v=pW⊥(v0)=v0−pW(v0)v=p_{W^\perp}(v_0)=v_0-p_W(v_0); ∥x∥2=∥v∥2+∥x−v∥2\|x\|^2=\|v\|^2+\|x-v\|^2 for x∈Xx\in X.

Hyperplanes. {x∣⟨x,a⟩=b}\{x\mid\langle x,a\rangle=b\}, a≠0a\ne0: dimension n−1n-1, distance to origin ∣b∣∥a∥\frac{|b|}{\|a\|}, closest point b∥a∥2a\frac b{\|a\|^2}a. Hesse normal form: unit a=v∥v∥a=\frac v{\|v\|}, equation ⟨x,a⟩=d\langle x,a\rangle=d with d=d(0,H)>0d=d(0,H)>0. Cartesian equation of a plane v+L(w1,w2)v+L(w_1,w_2): a∈L(w1,w2)⊥a\in L(w_1,w_2)^\perp, d=⟨a,v⟩d=\langle a,v\rangle.

Lines in R3\mathbb{R}^3. Parametric v+λwv+\lambda w; Cartesian: two plane equations. Planes through LL: ⟨x,λa+λ′a′⟩=λb+λ′b′\langle x,\lambda a+\lambda'a'\rangle=\lambda b+\lambda'b'. Parallel   ⟺  \iff directions dependent; skew   ⟺  \iff directions independent and no common point.

Distance of two affine subspaces X=v+WX=v+W, X′=v′+W′X'=v'+W': Z=W+W′Z=W+W', d=v−v′d=v-v', m=pZ⊥(d)m=p_{Z^\perp}(d); minimal distance ∥m∥\|m\|, realized exactly by x,x′x,x' with x−x′=mx-x'=m, equivalently x−x′⊥Wx-x'\perp W and x−x′⊥W′x-x'\perp W'. Intersect   ⟺  d∈Z\iff d\in Z. Method: general points x=v+∑aiwix=v+\sum a_iw_i, x′=v′+∑bjwj′x'=v'+\sum b_jw_j', impose orthogonality to all directions, solve.

Typical mistakes.

  • Calling a matrix orthogonal when the columns are orthogonal but not of norm 11.
  • Using P−1≠PTP^{-1}\neq P^T: for orthogonal PP the inverse is the transpose; not so for a general matrix of eigenvectors.
  • Forgetting to normalize eigenvectors, or to orthogonalize inside an eigenspace of dimension >1>1.
  • Expecting orthogonal eigenvectors for a non-symmetric matrix (the orthogonality needs A=ATA=A^T).
  • Lines in R3\mathbb{R}^3: calling two non-parallel lines "intersecting" without checking they actually meet (they may be skew).
  • Distance formula ∣b∣∥a∥\frac{|b|}{\|a\|}: valid for ⟨x,a⟩=b\langle x,a\rangle=b with any a≠0a\ne0; with a unit normal it is just ∣b∣|b|.

Teoria collegata