MIT 18.701 — Lecture 9

Inner Products, Orthonormality

Recall from vector algebra that the dot product tells us a lot about the lengths of vectors and angles between vectors.

Fact (Vector Algebra). For any x⃗,y⃗∈Rn\vec{x}, \vec{y} \in \mathbb{R}^n, with angle θ\theta between them, we have x⃗⋅y⃗=∣x⃗∣⋅∣y⃗∣⋅cos⁡θ\vec{x} \cdot \vec{y} = |\vec{x}| \cdot |\vec{y}| \cdot \cos \theta.

Let's generalize this in 18.701 terms.

§ Inner Products in Rn\mathbb{R}^n

Definition (Dot / Inner Product). For vectors x,y∈Rnx, y \in \mathbb{R}^n, we say their dot / inner product is ⟨x,y⟩:=x⊤y∈R\langle x, y \rangle := x^{\top}y \in \mathbb{R}.

Definition (Length / Norm / Distance). For a vector x∈Rnx \in \mathbb{R}^n, the length / norm of xx is ∣x∣:=⟨x,x⟩|x| := \sqrt{\langle x, x \rangle}. Furthermore, the distance between x,y∈Rnx, y \in \mathbb{R}^n is said to be ∣x−y∣|x - y|.

Note that, for now, we are working only over Rn\mathbb{R}^n. We don't want to say (1i)\left(\begin{smallmatrix} 1 \\ i \end{smallmatrix}\right) has length 00, for example—and some fields don't even have a well-defined square root!

Remark. There's also something called an outer product defined by x⊗y:=xy⊤∈Rn×nx \otimes y := x y^{\top} \in \mathbb{R}^{n \times n}.

Theorem. (Cauchy-Schwarz) For all x,y∈Rnx, y \in \mathbb{R}^n, we have ∣⟨x,y⟩∣≤∣x∣⋅∣y∣|\langle x, y \rangle | \leq |x| \cdot |y|.

Proof: The inequality ∣x+λy∣2≥0|x + \lambda y|^2 \geq 0 holds for all λ∈R\lambda \in \mathbb{R}. Expanding this, we have:

0≤∣x+λy∣2=⟨x+λy,x+λy⟩=∣x∣2+2⟨x,y⟩λ+∣y∣2λ2.0 \leq |x + \lambda y|^2 = \langle x + \lambda y, x + \lambda y \rangle = |x|^2 + 2\langle x, y \rangle \lambda + |y|^2 \lambda^2.

The RHS of the above is a quadratic in λ\lambda that is nonnegative everywhere, so its discriminant is nonpositive:

0≥discriminant=(2⟨x,y⟩)2−4(∣x∣2)(∣y∣2)=4(⟨x,y⟩2−∣x∣2∣y∣2).0 \geq \text{discriminant} = \left ( 2 \langle x, y \rangle \right ) ^2 - 4 \left ( |x|^2 \right ) \left ( |y|^2 \right ) = 4 ( \langle x, y\rangle^2 - |x|^2 |y|^2).

The above is just the statement of Cauchy-Schwarz.   ■\blacksquare

Definition (Angle). The angle between x,y∈Rnx, y \in \mathbb{R}^n is cos⁡−1(⟨x,y⟩∣x∣⋅∣y∣)\cos^{-1}\left(\frac{\langle x, y \rangle}{|x| \cdot |y|}\right) (which is well-defined by Cauchy-Schwarz).

§ Orthonormal Bases and Matrices

Definition (Orthogonal). Vectors xx and yy are orthogonal if ⟨x,y⟩=0\langle x, y \rangle = 0, meaning the angle between them is 90∘90^{\circ}.

Definition (Orthogonal / Orthonormal Bases). A basis of Rn\mathbb{R}^n is orthogonal if all vectors in the basis are pairwise orthogonal. A basis of Rn\mathbb{R}^n is orthonormal if it is orthogonal and all vectors in the basis have unit length.

Theorem. (Orthogonal   ⟹  \implies Independent) Any set of nonzero pairwise orthogonal vectors {a1,…,ak}⊆Rn\{a_1, \dots, a_k \} \subseteq \mathbb{R}^n must be linearly independent. In particular, nn nonzero pairwise orthogonal vectors of Rn\mathbb{R}^n must form a basis.

Proof: Given any linear dependence of {a1,…,ak}\{a_1, \dots, a_k\}, we may write:

c1a1+⋯+ckak=0   ⟹   ⟨ai,c1a1+⋯+ckak⟩=0 for all i=1,2,…,k.c_1a_1 + \dots + c_k a_k = 0 ~ \implies ~ \langle a_i, c_1 a_1 + \dots + c_k a_k \rangle = 0 \text{ for all } i = 1, 2, \dots, k.

But ⟨ai,c1a1+⋯+ckak⟩=ci∣ai∣2\langle a_i, c_1 a_1 + \dots + c_k a_k \rangle = c_i |a_i|^2 and ∣ai∣≠0|a_i| \neq 0, so ci=0c_i = 0 for all ii.   ■\blacksquare

Definition (Orthogonal Matrices). A matrix A∈Rn×nA \in \mathbb{R}^{n \times n} is orthogonal if ⟨Ax,Ay⟩=⟨x,y⟩\langle Ax, Ay \rangle = \langle x, y \rangle for all x,y∈Rnx, y \in \mathbb{R}^n.

In other words, an orthogonal matrix is a matrix that preserves the dot product.

Theorem. (Properties of Orthogonal Matrices) For any A∈Rn×nA \in \mathbb{R}^{n \times n}, the following are equivalent:

  1. The matrix AA is orthogonal.

  2. For all x∈Rnx \in \mathbb{R}^n, we have ∣Ax∣=∣x∣|Ax| = |x|.

  3. We have A⊤A=InA^{\top}A = I_n.

  4. The columns of AA form an orthonormal basis.

  5. The rows of AA form an orthonormal basis.

Proof: We just have to show a bunch of implications.

And that's good enough.   ■\blacksquare

§ Orthogonal Groups

Definition (Orthogonal Group). The orthogonal group is On(R):={A∈Rn×n∣A⊤A=In}O_n(\mathbb{R}) := \{A \in \mathbb{R}^{n \times n} \mid A^{\top} A = I_n \}.

Definition (Special Orthogonal Group). The special orthogonal group is SOn(R):={M∈On(R)∣det⁡M=1}SO_n(\mathbb{R}) := \{M \in O_n(\mathbb{R}) \mid \det M = 1\}.

Note that for all M∈On(R)M \in O_n(\mathbb{R}), the condition M⊤M=InM^{\top}M = I_n implies det⁡M=±1\det M = \pm 1. So in fact [On(R):SOn(R)]=2[O_n(\mathbb{R}): SO_n(\mathbb{R})] = 2.

For small nn, what do the orthogonal groups look like?

Example. Evidently O1(R)≅{[1],[−1]}O_1(\mathbb{R}) \cong \{ \left[\begin{smallmatrix} 1 \end{smallmatrix}\right] , \left[\begin{smallmatrix} -1 \end{smallmatrix}\right] \}, and SO1(R)≅{[1]}SO_1(\mathbb{R}) \cong \{\left[\begin{smallmatrix} 1 \end{smallmatrix}\right] \}.

Example. By inspection, for n=2n = 2, we can describe the elements of O2O_2 and SO2SO_2 as rotations and reflections:

O2(R)={[cos⁡θ−sin⁡θsin⁡θcos⁡θ],[cos⁡θsin⁡θsin⁡θ−cos⁡θ]:θ∈[0,2π)} and SO2(R)={[cos⁡θ−sin⁡θsin⁡θcos⁡θ]:θ∈[0,2π)}.O_2(\mathbb{R}) = \left \{ \left[\begin{smallmatrix} \cos \theta & - \sin \theta \\ \sin \theta & \cos \theta \end{smallmatrix}\right], \left[\begin{smallmatrix} \cos \theta & \sin \theta \\ \sin \theta & - \cos \theta \end{smallmatrix}\right] : \theta \in [0, 2\pi) \right \} \text{ and } SO_2(\mathbb{R}) = \left \{ \left[\begin{smallmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{smallmatrix}\right]: \theta \in [0, 2\pi) \right \}.

Notice that SO2(R)SO_2(\mathbb{R}) is just the group of rotation matrices. Meanwhile, O2(R)O_2(\mathbb{R}) includes rotations about the origin or reflections about lines through the origin.

Important!  Composing reflections and rotations always yields either a pure reflection or pure rotation!

Example. For any odd nn and any A∈SOn(R)A \in SO_n(\mathbb{R}), we have:

det⁡(A−In)= det⁡(A−AA⊤)= det⁡(A)det⁡(In−A⊤)    by factoring= det⁡(In−A⊤)    since det⁡(A)=1= det⁡((In−A)⊤)= det⁡(In−A)    since det⁡(M⊤)=det⁡(M) for any M= (−1)n⋅det⁡(A−In)\begin{align*}\det (A - I_n) = \ & \det (A - AA^{\top}) \\ = \ & \det (A) \det (I_n - A^{\top}) ~~~ \text{ by factoring} \\ = \ & \det (I_n - A^{\top}) ~~~ \text{ since } \det(A) = 1\\ = \ & \det ((I_n - A)^{\top}) \\ = \ & \det (I_n - A) ~~~ \text{ since } \det(M^{\top}) = \det(M) \text{ for any } M \\ = \ & (-1)^n \cdot \det(A - I_n)\end{align*}

But when nn is odd, the above means det⁡(A−In)=0\det (A - I_n) = 0, meaning AA has an eigenvector vv with eigenvalue 11. In the particular case of n=3n = 3, if we rewrite AA using an orthonormal basis containing v=e1v = e_1, we must have:

Ae1=e1   ⟹   A=[1000♡♡0♡♡].Ae_1 = e_1 ~ \implies ~ A = \left[\begin{smallmatrix} 1 & 0 & 0 \\ 0 & \heartsuit & \heartsuit \\ 0 & \heartsuit & \heartsuit \end{smallmatrix}\right].

Note that the top entries of AA must be zero because the columns of AA must be orthonormal. And the submatrix of ♡\heartsuits is in SO2(R)SO_2(\mathbb{R}). So any transformation A∈SO3(R)A \in SO_3(\mathbb{R}) may be understood as a planar rotation about an axis vv.

Example. It turns out that elements of SO4(R)SO_4(\mathbb{R}) (in appropriate coordinates) look like the composition of rotations in two separate two-dimensional subspaces.