Unit 6, lesson 30

Orthogonal Complements and the Four Subspaces

What the orthogonal complement of a subspace is, why the null space is the complement of the row space and the left null space the complement of the column space, and how complementary dimensions give orthogonal decompositions.

  • Video 30
  • Projections and Orthogonal Complements

A matrix can send a nonzero input to the zero vector. Each entry of AxA\mathbf{x} is the dot product of one row of AA with x\mathbf{x}, so an input that comes out as zero has zero dot product with every row of AA. This lesson turns that observation into exact statements about all four fundamental subspaces, keeping the input space Rn\mathbb{R}^n and the output space Rm\mathbb{R}^m of an m×nm \times n matrix apart, and shows how their dimensions fit together. Throughout, a tuple such as (1,0,1)(1, 0, 1) stands for a column vector, and all vectors are real with the ordinary dot product.

Key terms

Orthogonal complement

Definition Let WW be a subspace of Rn\mathbb{R}^n. The orthogonal complement of WW, written W⊥W^{\perp} and read ”WW perp”, is the set of vectors in the same space Rn\mathbb{R}^n that have zero dot product with every vector of WW,

W⊥={v∈Rn∣v⋅w=0for every w∈W}.\begin{aligned} W^{\perp} = \{\mathbf{v} \in \mathbb{R}^n \mid {} & \mathbf{v} \cdot \mathbf{w} = 0 \\[0.4em] & \text{for every } \mathbf{w} \in W\}. \end{aligned}

It is a subspace of Rn\mathbb{R}^n, because it contains 0\mathbf{0} and (av+bz)⋅w=a(v⋅w)+b(z⋅w)(a\mathbf{v} + b\mathbf{z}) \cdot \mathbf{w} = a(\mathbf{v} \cdot \mathbf{w}) + b(\mathbf{z} \cdot \mathbf{w}), which is 00 when v\mathbf{v} and z\mathbf{z} lie in W⊥W^{\perp}. If w1,…,wk\mathbf{w}_1, \dots, \mathbf{w}_k span WW, then v\mathbf{v} lies in W⊥W^{\perp} exactly when v⋅wi=0\mathbf{v} \cdot \mathbf{w}_i = 0 for each i=1,…,ki = 1, \dots, k, since a dot product with a combination of the wi\mathbf{w}_i is the same combination of zeros. The only vector in both WW and W⊥W^{\perp} is 0\mathbf{0}, because such a vector satisfies ∥v∥2=v⋅v=0\lVert \mathbf{v} \rVert^2 = \mathbf{v} \cdot \mathbf{v} = 0. At the extremes, {0}⊥=Rn\{\mathbf{0}\}^{\perp} = \mathbb{R}^n and (Rn)⊥={0}(\mathbb{R}^n)^{\perp} = \{\mathbf{0}\}.

In plain words A vector belongs to W⊥W^{\perp} when it is perpendicular to all of WW at once. You never have to test infinitely many vectors, only a spanning list, but every vector in that list has to pass.

Example In R3\mathbb{R}^3 let WW be the plane spanned by c1=(1,0,1)\mathbf{c}_1 = (1, 0, 1) and c2=(0,1,1)\mathbf{c}_2 = (0, 1, 1), which is the plane z=x+yz = x + y. A vector v=(v1,v2,v3)\mathbf{v} = (v_1, v_2, v_3) lies in W⊥W^{\perp} exactly when

v⋅c1=v1+v3=0,v⋅c2=v2+v3=0.\begin{aligned} \mathbf{v} \cdot \mathbf{c}_1 &= v_1 + v_3 = 0, \\[0.4em] \mathbf{v} \cdot \mathbf{c}_2 &= v_2 + v_3 = 0. \end{aligned}

Setting v3=tv_3 = t gives v1=v2=−tv_1 = v_2 = -t, so W⊥W^{\perp} is the line spanned by n=(−1,−1,1)\mathbf{n} = (-1, -1, 1). Testing a single combination is not enough. The vector (1,−1,0)(1, -1, 0) has zero dot product with c1+c2=(1,1,2)\mathbf{c}_1 + \mathbf{c}_2 = (1, 1, 2), but its dot products with c1\mathbf{c}_1 and c2\mathbf{c}_2 are 11 and −1-1, so it is not in W⊥W^{\perp}.

Null space as the complement of the row space

Definition Let AA be a real m×nm \times n matrix, a map from Rn\mathbb{R}^n to Rm\mathbb{R}^m. Each row has nn entries and, written as a column, is a vector of Rn\mathbb{R}^n. The row space Row⁡A\operatorname{Row} A is the span of these vectors, which equals Col⁡A⊤\operatorname{Col} A^{\top}, so it lies in the input space Rn\mathbb{R}^n, and so does Null⁡A={x∈Rn∣Ax=0}\operatorname{Null} A = \{\mathbf{x} \in \mathbb{R}^n \mid A\mathbf{x} = \mathbf{0}\}. These two subspaces are orthogonal complements,

Null⁡A=(Row⁡A)⊥.\operatorname{Null} A = (\operatorname{Row} A)^{\perp}.

The reason is that entry ii of AxA\mathbf{x} is the dot product of row ii with x\mathbf{x}. So Ax=0A\mathbf{x} = \mathbf{0} holds exactly when x\mathbf{x} is perpendicular to every row, which is the same as being perpendicular to their span. The identity holds for every real matrix, square or not, whether or not its rows are independent.

In plain words Each equation of the system Ax=0A\mathbf{x} = \mathbf{0} says that x\mathbf{x} is perpendicular to one row. Solving the system finds every vector perpendicular to all the rows.

Example Let

A=[101011].A = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \end{bmatrix}.

The system Ax=0A\mathbf{x} = \mathbf{0} reads x1+x3=0x_1 + x_3 = 0 and x2+x3=0x_2 + x_3 = 0, the same equations as in the previous example, so Null⁡A\operatorname{Null} A is the line in R3\mathbb{R}^3 spanned by n=(−1,−1,1)\mathbf{n} = (-1, -1, 1). The row space is the plane spanned by (1,0,1)(1, 0, 1) and (0,1,1)(0, 1, 1), and n\mathbf{n} is perpendicular to both rows. For the 3×23 \times 2 matrix C=A⊤C = A^{\top} the rows (1,0)(1, 0), (0,1)(0, 1) and (1,1)(1, 1) are vectors of R2\mathbb{R}^2 and already span it, so Null⁡C=(R2)⊥={0}\operatorname{Null} C = (\mathbb{R}^2)^{\perp} = \{\mathbf{0}\}. Having three rows does not make them vectors of R3\mathbb{R}^3, because the ambient space is set by the number of entries in each row.

Left null space as the complement of the column space

Definition The left null space of a real m×nm \times n matrix AA is

Null⁡A⊤={y∈Rm∣A⊤y=0}.\operatorname{Null} A^{\top} = \{\mathbf{y} \in \mathbb{R}^m \mid A^{\top}\mathbf{y} = \mathbf{0}\}.

The name comes from the equivalent equation y⊤A=0⊤\mathbf{y}^{\top}A = \mathbf{0}^{\top}, where y⊤\mathbf{y}^{\top} multiplies AA from the left, but the vectors y\mathbf{y} are still columns in the output space Rm\mathbb{R}^m. The rows of A⊤A^{\top} are the columns of AA, so the previous result applied to A⊤A^{\top} gives

Null⁡A⊤=(Col⁡A)⊥,\operatorname{Null} A^{\top} = (\operatorname{Col} A)^{\perp},

an identity between two subspaces of Rm\mathbb{R}^m. If b=Ax\mathbf{b} = A\mathbf{x} and y\mathbf{y} is in Null⁡A⊤\operatorname{Null} A^{\top}, then y⋅b=y⊤Ax=0\mathbf{y} \cdot \mathbf{b} = \mathbf{y}^{\top}A\mathbf{x} = 0. So every vector of the left null space gives a linear condition that each attainable output satisfies.

In plain words The left null space holds the directions of the output space that are perpendicular to every possible output. A target with a nonzero dot product against one of them cannot be reached.

Example For the matrix

C=[100111],C = \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{bmatrix},

the columns (1,0,1)(1, 0, 1) and (0,1,1)(0, 1, 1) span the plane z=x+yz = x + y in R3\mathbb{R}^3. The system C⊤y=0C^{\top}\mathbf{y} = \mathbf{0} reads y1+y3=0y_1 + y_3 = 0 and y2+y3=0y_2 + y_3 = 0, so Null⁡C⊤\operatorname{Null} C^{\top} is the line spanned by n=(−1,−1,1)\mathbf{n} = (-1, -1, 1). The target (1,1,2)(1, 1, 2) passes the test, since its dot product with n\mathbf{n} is −1−1+2=0-1 - 1 + 2 = 0, and indeed CC sends (1,1)(1, 1) to it. The target (1,1,0)(1, 1, 0) fails, since its dot product with n\mathbf{n} is −2-2, so Cx=(1,1,0)C\mathbf{x} = (1, 1, 0) has no solution.

Complementary dimensions

Definition Let AA be a real m×nm \times n matrix of rank rr. The row space and the column space both have dimension rr. Rank-nullity for AA gives dim⁡Null⁡A=n−r\dim \operatorname{Null} A = n - r, and rank-nullity for A⊤A^{\top}, which also has rank rr, gives dim⁡Null⁡A⊤=m−r\dim \operatorname{Null} A^{\top} = m - r. Hence

dim⁡Row⁡A+dim⁡Null⁡A=n,dim⁡Col⁡A+dim⁡Null⁡A⊤=m.\begin{aligned} \dim \operatorname{Row} A + \dim \operatorname{Null} A &= n, \\[0.4em] \dim \operatorname{Col} A + \dim \operatorname{Null} A^{\top} &= m. \end{aligned}

The first count takes place in the input space and the second in the output space. For a square matrix both totals are nn, but the subspaces involved still differ in general, because Row⁡A\operatorname{Row} A and Col⁡A\operatorname{Col} A need not be equal. More generally, every subspace WW of Rn\mathbb{R}^n satisfies

dim⁡W+dim⁡W⊥=n.\dim W + \dim W^{\perp} = n.

For W={0}W = \{\mathbf{0}\} this reads 0+n=n0 + n = n. Otherwise, write a basis of WW with kk vectors as the rows of a k×nk \times n matrix MM. Its rank is kk, its null space is W⊥W^{\perp} by the previous result, and rank-nullity gives dim⁡W⊥=n−k\dim W^{\perp} = n - k.

In plain words A subspace and its orthogonal complement share no nonzero direction, and together they account for every dimension of the space. The input space splits its nn dimensions between the row space and the null space, and the output space splits its mm dimensions between the column space and the left null space.

Example The 3×23 \times 2 matrix CC above has rank 22. In its input space R2\mathbb{R}^2 the count is 2+0=22 + 0 = 2, with row space all of R2\mathbb{R}^2 and null space {0}\{\mathbf{0}\}. In its output space R3\mathbb{R}^3 the count is 2+1=32 + 1 = 3, the column plane plus the normal line. For A=C⊤A = C^{\top} the rank is still 22, but the roles of the spaces swap. Its input space R3\mathbb{R}^3 holds a row plane and a null line, 2+1=32 + 1 = 3, and its output space R2\mathbb{R}^2 is the whole column space, with left null space {0}\{\mathbf{0}\} and count 2+0=22 + 0 = 2.

Orthogonal decomposition of a space

Definition Let WW be a subspace of Rn\mathbb{R}^n. Every v\mathbf{v} in Rn\mathbb{R}^n can be written in exactly one way as

v=w+z\mathbf{v} = \mathbf{w} + \mathbf{z}

with w\mathbf{w} in WW and z\mathbf{z} in W⊥W^{\perp}, and the two pieces are perpendicular. This is written Rn=W⊕W⊥\mathbb{R}^n = W \oplus W^{\perp} and called an orthogonal direct sum. For existence, put a basis of WW and a basis of W⊥W^{\perp} together. A combination of the first list that cancels a combination of the second gives a vector in W∩W⊥={0}W \cap W^{\perp} = \{\mathbf{0}\}, so both combinations are zero and all their coefficients vanish. The joined list is therefore independent, and by the dimension count it has nn vectors, so it is a basis of Rn\mathbb{R}^n. For uniqueness, the difference of two such decompositions gives a vector in W∩W⊥W \cap W^{\perp}, which is 0\mathbf{0}. Applied to a real m×nm \times n matrix AA,

Rn=Row⁡A⊕Null⁡A,Rm=Col⁡A⊕Null⁡A⊤.\begin{aligned} \mathbb{R}^n &= \operatorname{Row} A \oplus \operatorname{Null} A, \\[0.4em] \mathbb{R}^m &= \operatorname{Col} A \oplus \operatorname{Null} A^{\top}. \end{aligned}

It also follows that (W⊥)⊥=W(W^{\perp})^{\perp} = W, because every vector of WW is perpendicular to all of W⊥W^{\perp}, so WW lies inside (W⊥)⊥(W^{\perp})^{\perp}, and both subspaces have dimension n−dim⁡W⊥n - \dim W^{\perp}. In particular Col⁡A=(Null⁡A⊤)⊥\operatorname{Col} A = (\operatorname{Null} A^{\top})^{\perp}, so Ax=bA\mathbf{x} = \mathbf{b} has a solution exactly when b\mathbf{b} is perpendicular to every vector of the left null space.

In plain words Every input splits into a row space part, which alone determines AxA\mathbf{x}, and a null space part, which AA sends to zero. Every vector of the output space splits into a reachable part in the column space and a part perpendicular to all outputs.

Example Take AA with rows (1,0,1)(1, 0, 1) and (0,1,1)(0, 1, 1) and the input x=(2,1,0)\mathbf{x} = (2, 1, 0). The null space is the line through n=(−1,−1,1)\mathbf{n} = (-1, -1, 1), and projecting x\mathbf{x} onto it gives the coefficient (n⋅x)/(n⋅n)=−3/3=−1(\mathbf{n} \cdot \mathbf{x}) / (\mathbf{n} \cdot \mathbf{n}) = -3/3 = -1. So the null space part is −n-\mathbf{n} and

[210]=[101]+[11−1].\begin{bmatrix} 2 \\ 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} + \begin{bmatrix} 1 \\ 1 \\ -1 \end{bmatrix}.

The first piece is the first row of AA, the two pieces have dot product 1+0−1=01 + 0 - 1 = 0, and both x\mathbf{x} and its row space part are sent to (2,1)(2, 1), while the null space part is sent to (0,0)(0, 0). In the output space of C=A⊤C = A^{\top} the target (1,1,0)(1, 1, 0) splits the same way into (13,13,23)(\tfrac13, \tfrac13, \tfrac23), which satisfies z=x+yz = x + y, plus (23,23,−23)=−23n(\tfrac23, \tfrac23, -\tfrac23) = -\tfrac23\mathbf{n}.

Check yourself

  1. Let WW be the plane in R3\mathbb{R}^3 spanned by u1=(1,1,0)\mathbf{u}_1 = (1, 1, 0) and u2=(0,1,1)\mathbf{u}_2 = (0, 1, 1). A student says that v=(2,−1,0)\mathbf{v} = (2, -1, 0) lies in W⊥W^{\perp} because it is perpendicular to u1+u2\mathbf{u}_1 + \mathbf{u}_2. Is that right? Find W⊥W^{\perp}.
Show the answer

The claim is wrong. The sum is (1,2,1)(1, 2, 1) and its dot product with v\mathbf{v} is 2−2+0=02 - 2 + 0 = 0, but v⋅u1=1\mathbf{v} \cdot \mathbf{u}_1 = 1 and v⋅u2=−1\mathbf{v} \cdot \mathbf{u}_2 = -1. These two nonzero dot products cancel in the sum, so v\mathbf{v} is not perpendicular to the whole plane. A vector (v1,v2,v3)(v_1, v_2, v_3) lies in W⊥W^{\perp} exactly when v1+v2=0v_1 + v_2 = 0 and v2+v3=0v_2 + v_3 = 0, so W⊥W^{\perp} is the line spanned by (1,−1,1)(1, -1, 1). Its dimension is 1=3−21 = 3 - 2, as the dimension count requires.

  1. Find a basis of the null space of the matrix below, check that it is perpendicular to the rows, and give the dimension of each of the four fundamental subspaces.
A=[120001]A = \begin{bmatrix} 1 & 2 & 0 \\ 0 & 0 & 1 \end{bmatrix}
Show the answer

The system Ax=0A\mathbf{x} = \mathbf{0} reads x1+2x2=0x_1 + 2x_2 = 0 and x3=0x_3 = 0, so Null⁡A\operatorname{Null} A is spanned by (−2,1,0)(-2, 1, 0). Its dot products with the rows are −2+2+0=0-2 + 2 + 0 = 0 and 0+0+0=00 + 0 + 0 = 0. The rank is 22. In the input space R3\mathbb{R}^3 the row space has dimension 22 and the null space dimension 11, and 2+1=32 + 1 = 3. In the output space R2\mathbb{R}^2 the column space has dimension 22, so it is all of R2\mathbb{R}^2, and the left null space is {0}\{\mathbf{0}\} with dimension 00, and 2+0=22 + 0 = 2.

  1. Let BB be the 3×23 \times 2 matrix with columns (1,2,0)(1, 2, 0) and (0,1,1)(0, 1, 1). Find its left null space, and use it to decide for which kk the system Bx=(1,k,3)B\mathbf{x} = (1, k, 3) has a solution.
Show the answer

The left null space solves B⊤y=0B^{\top}\mathbf{y} = \mathbf{0}, that is y1+2y2=0y_1 + 2y_2 = 0 and y2+y3=0y_2 + y_3 = 0. Setting y2=ty_2 = t gives y=t(−2,1,−1)\mathbf{y} = t(-2, 1, -1), a line in R3\mathbb{R}^3, which matches m−r=3−2=1m - r = 3 - 2 = 1. A solution requires (−2,1,−1)⋅(1,k,3)=−2+k−3=0(-2, 1, -1) \cdot (1, k, 3) = -2 + k - 3 = 0, so k=5k = 5. Because the column space is exactly the orthogonal complement of the left null space, this condition is also sufficient, and indeed 1⋅(1,2,0)+3⋅(0,1,1)=(1,5,3)1 \cdot (1, 2, 0) + 3 \cdot (0, 1, 1) = (1, 5, 3).

How this lesson connects