Tutorials › Linear Algebra › The Sum of Two Subspaces

Vector Spaces and Subspaces · Tutorial 295 of 1000

The Sum of Two Subspaces

Learn to describe sums of subspaces concretely, find decompositions, and determine whether those decompositions are unique.

Intermediate 9 min read

What You'll Learn

  • Define the sum of two subspaces in a common vector space.
  • Describe vectors in a sum by adding one vector from each subspace.
  • Compute sums in polynomial and matrix spaces.
  • Check whether a proposed vector belongs to a sum.
  • Determine when every vector in the sum has a unique decomposition.

Combining Two Subspaces

Two subspaces of the same vector space may contribute different kinds of vectors. To combine them, take one vector from each and add the pair. The resulting collection is called their sum. It contains the vectors from both subspaces, but it can also contain vectors that belong to neither one individually. Computing a sum therefore means describing all possible additions, not merely listing the vectors already in the two subspaces.

Throughout this tutorial, the vector spaces and subspaces are over \(\mathbb{R}\), and \(U\) and \(W\) are subspaces of a common vector space \(V\). In particular, the addition and subtraction of vectors take place in \(V\). A representation of \(\mathbf{x}\) as \(\mathbf{u}+\mathbf{w}\) records the pair \((\mathbf{u},\mathbf{w})\), with \(\mathbf{u}\in U\) and \(\mathbf{w}\in W\). Such a representation need not be unique.

Definition: The sum of two subspaces \(U\) and \(W\) is the set $$ U+W=\{\mathbf{u}+\mathbf{w}:\mathbf{u}\in U,\ \mathbf{w}\in W\}. $$ Thus \(\mathbf{x}\in U+W\) exactly when there are vectors \(\mathbf{u}\in U\) and \(\mathbf{w}\in W\) such that \(\mathbf{x}=\mathbf{u}+\mathbf{w}\).

This definition gives a direct membership test: to show that a vector is in \(U+W\), exhibit a suitable pair; to show that it is not, show that no such pair can produce it. In concrete spaces, the subspaces are often described using coordinates, polynomial coefficients, or matrix entries. Matching those entries translates the definition into equations.

Basic Properties of the Sum

Theorem: For subspaces \(U,W\) of a vector space \(V\), \(U\subseteq U+W\), \(W\subseteq U+W\), and \(U+W=W+U\).

Proof. Since \(W\) is a subspace, it contains \(\mathbf{0}\). For every \(\mathbf{u}\in U\), we have \(\mathbf{u}=\mathbf{u}+\mathbf{0}\) with \(\mathbf{0}\in W\), so \(\mathbf{u}\in U+W\). This proves \(U\subseteq U+W\). Likewise, for every \(\mathbf{w}\in W\), \(\mathbf{w}=\mathbf{0}+\mathbf{w}\) with \(\mathbf{0}\in U\), so \(W\subseteq U+W\). Finally, if \(\mathbf{x}\in U+W\), then \(\mathbf{x}=\mathbf{u}+\mathbf{w}\) for some \(\mathbf{u}\in U,\mathbf{w}\in W\). Vector addition is commutative, so \(\mathbf{x}=\mathbf{w}+\mathbf{u}\in W+U\). This gives \(U+W\subseteq W+U\); reversing the roles of \(U\) and \(W\) gives \(W+U\subseteq U+W\). Therefore \(U+W=W+U\). \(\square\)

The sum is not generally the same as the union \(U\cup W\). The union collects vectors that are already in at least one subspace. The sum also includes additions using one vector from each. This distinction is visible in the examples below.

Computing a Sum in a Polynomial Space

Worked Example: A Sum That Gives All Polynomials of Degree at Most Two

In the real polynomial space \(P_2(\mathbb{R})\), let \(U=\{a+bx:a,b\in\mathbb{R}\}\) and \(W=\{c(x^2+x):c\in\mathbb{R}\}\). Find \(U+W\), and determine whether the decomposition of each polynomial in the sum is unique.

A general element of \(U\) is \(a+bx\), and a general element of \(W\) is \(c(x^2+x)\). Adding them gives

$$ (a+bx)+c(x^2+x)=a+(b+c)x+cx^2. $$

Every result of this addition has degree at most two, so \(U+W\subseteq P_2(\mathbb{R})\). For the reverse inclusion, take any \(p(x)=\alpha+\beta x+\gamma x^2\in P_2(\mathbb{R})\). Choose \(a=\alpha\), \(c=\gamma\), and \(b=\beta-\gamma\). Then

$$ (a+bx)+c(x^2+x) =\alpha+(\beta-\gamma)x+\gamma(x^2+x) =\alpha+\beta x+\gamma x^2 =p(x). $$

Thus every polynomial in \(P_2(\mathbb{R})\) is in the sum, and \(U+W=P_2(\mathbb{R})\). The coefficient choices are forced: matching the \(x^2\) coefficient gives \(c=\gamma\); matching the \(x\) coefficient gives \(b+c=\beta\), hence \(b=\beta-\gamma\); and matching the constant coefficient gives \(a=\alpha\). Therefore each polynomial has exactly one such decomposition.

Check: for \(p(x)=3+5x+2x^2\), the choices are \(a=3\), \(c=2\), and \(b=3\). Indeed, \((3+3x)+2(x^2+x)=3+5x+2x^2\).

Coefficient matching is a general way to compute sums in polynomial spaces: write an arbitrary element of each subspace, add the expressions, and compare the result with a general target polynomial. The constraints on the resulting coefficients determine which targets are possible. If those equations also force the choices from the two subspaces, the decomposition is unique.

When Is a Decomposition Unique?

Theorem: Let \(U,W\) be subspaces of a vector space \(V\). Every vector in \(U+W\) has exactly one representation \(\mathbf{x}=\mathbf{u}+\mathbf{w}\), with \(\mathbf{u}\in U\) and \(\mathbf{w}\in W\), if and only if \(U\cap W=\{\mathbf{0}\}\).

Proof. First suppose every vector in \(U+W\) has exactly one such representation. If \(\mathbf{z}\in U\cap W\), then \(\mathbf{z}\in U\) and \(\mathbf{z}\in W\), so \(\mathbf{z}=\mathbf{z}+\mathbf{0}\) and \(\mathbf{z}=\mathbf{0}+\mathbf{z}\) are both representations of \(\mathbf{z}\) as a sum of a vector from \(U\) and a vector from \(W\). Uniqueness forces the ordered pairs to be equal, so \(\mathbf{z}=\mathbf{0}\). As \(\mathbf{0}\) belongs to both subspaces, \(U\cap W=\{\mathbf{0}\}\). Conversely, suppose \(U\cap W=\{\mathbf{0}\}\), and suppose \(\mathbf{x}=\mathbf{u}_1+\mathbf{w}_1=\mathbf{u}_2+\mathbf{w}_2\), where \(\mathbf{u}_1,\mathbf{u}_2\in U\) and \(\mathbf{w}_1,\mathbf{w}_2\in W\). Subtracting gives \(\mathbf{u}_1-\mathbf{u}_2=\mathbf{w}_2-\mathbf{w}_1\). The left side belongs to \(U\), because \(U\) is a subspace, and the right side belongs to \(W\), because \(W\) is a subspace. Their common value therefore lies in \(U\cap W\), so it is \(\mathbf{0}\). Hence \(\mathbf{u}_1=\mathbf{u}_2\) and \(\mathbf{w}_1=\mathbf{w}_2\). The representation is unique. \(\square\)

The condition concerns the intersection, not whether the two subspaces are different. If they share a nonzero vector, that vector can be assigned to either part of a sum, producing more than one representation. If their only common vector is zero, the theorem shows that such ambiguity cannot occur.

Computing a Sum in a Matrix Space

Worked Example: Two Matrix Subspaces with Overlap

In \(M_{2\times2}(\mathbb{R})\), let \(U=\left\{\begin{bmatrix}a&b\\0&0\end{bmatrix}:a,b\in\mathbb{R}\right\}\) and \(W=\left\{\begin{bmatrix}0&c\\0&d\end{bmatrix}:c,d\in\mathbb{R}\right\}\). Describe \(U+W\), and examine whether its representations are unique.

Adding general elements gives

$$ \begin{bmatrix}a&b\\0&0\end{bmatrix} + \begin{bmatrix}0&c\\0&d\end{bmatrix} = \begin{bmatrix}a&b+c\\0&d\end{bmatrix}. $$

Every matrix in the sum has a zero entry in row 2, column 1. Conversely, for any matrix \(\begin{bmatrix}r&s\\0&t\end{bmatrix}\), choose \(a=r\), \(b=s\), \(c=0\), and \(d=t\). The displayed addition then gives exactly that matrix. Therefore

$$ U+W= \left\{ \begin{bmatrix}r&s\\0&t\end{bmatrix}:r,s,t\in\mathbb{R} \right\}. $$

For a specific target, take \(\begin{bmatrix}3&7\\0&-2\end{bmatrix}\). One decomposition is

$$ \begin{bmatrix}3&4\\0&0\end{bmatrix} + \begin{bmatrix}0&3\\0&-2\end{bmatrix} = \begin{bmatrix}3&4+3\\0&-2\end{bmatrix} = \begin{bmatrix}3&7\\0&-2\end{bmatrix}. $$

There is also a different decomposition: \(\begin{bmatrix}3&5\\0&0\end{bmatrix}+\begin{bmatrix}0&2\\0&-2\end{bmatrix}=\begin{bmatrix}3&7\\0&-2\end{bmatrix}\). Indeed, their overlap contains nonzero matrices of the form \(\begin{bmatrix}0&q\\0&0\end{bmatrix}\). For example, \(\begin{bmatrix}0&1\\0&0\end{bmatrix}\) belongs to both \(U\) and \(W\). The uniqueness theorem therefore predicts the ambiguity seen in these decompositions.

Worked Example: Splitting a Matrix into Symmetric and Skew-Symmetric Parts

In \(M_{2\times2}(\mathbb{R})\), let \(U\) be the subspace of symmetric matrices, satisfying \(\mathbf{S}^{\top}=\mathbf{S}\), and let \(W\) be the subspace of skew-symmetric matrices, satisfying \(\mathbf{K}^{\top}=-\mathbf{K}\). Decompose \(\mathbf{A}=\begin{bmatrix}2&5\\-1&4\end{bmatrix}\) as \(\mathbf{S}+\mathbf{K}\), with \(\mathbf{S}\in U\) and \(\mathbf{K}\in W\).

For any real \(2\times2\) matrix \(\mathbf{A}\), set \(\mathbf{S}=\tfrac12(\mathbf{A}+\mathbf{A}^{\top})\) and \(\mathbf{K}=\tfrac12(\mathbf{A}-\mathbf{A}^{\top})\). Since \((\mathbf{A}^{\top})^{\top}=\mathbf{A}\), we have \(\mathbf{S}^{\top}=\mathbf{S}\) and \(\mathbf{K}^{\top}=-\mathbf{K}\). Also, adding the formulas gives \(\mathbf{S}+\mathbf{K}=\mathbf{A}\). For the specified matrix,

$$ \mathbf{S} =\frac12\left( \begin{bmatrix}2&5\\-1&4\end{bmatrix} + \begin{bmatrix}2&-1\\5&4\end{bmatrix} \right) = \frac12\begin{bmatrix}4&4\\4&8\end{bmatrix} = \begin{bmatrix}2&2\\2&4\end{bmatrix}, $$
$$ \mathbf{K} =\frac12\left( \begin{bmatrix}2&5\\-1&4\end{bmatrix} - \begin{bmatrix}2&-1\\5&4\end{bmatrix} \right) = \frac12\begin{bmatrix}0&6\\-6&0\end{bmatrix} = \begin{bmatrix}0&3\\-3&0\end{bmatrix}. $$

Check: \(\mathbf{S}^{\top}=\begin{bmatrix}2&2\\2&4\end{bmatrix}=\mathbf{S}\) and \(\mathbf{K}^{\top}=\begin{bmatrix}0&-3\\3&0\end{bmatrix}=-\mathbf{K}\). Their sum is \(\begin{bmatrix}2+0&2+3\\2-3&4+0\end{bmatrix}=\begin{bmatrix}2&5\\-1&4\end{bmatrix}=\mathbf{A}\).

The decomposition is unique: a matrix that is both symmetric and skew-symmetric satisfies \(\mathbf{X}^{\top}=\mathbf{X}\) and \(\mathbf{X}^{\top}=-\mathbf{X}\), hence \(2\mathbf{X}=\mathbf{O}\). Over \(\mathbb{R}\), this implies \(\mathbf{X}=\mathbf{O}\), so the intersection of these subspaces contains only the zero matrix.

Common Pitfall: Replacing the Sum with the Union

Consider the subspaces \(U=\{(a,0):a\in\mathbb{R}\}\) and \(W=\{(0,b):b\in\mathbb{R}\}\) of \(\mathbb{R}^2\). A mistaken calculation is \(U+W=U\cup W\): it treats the sum as if it only collected vectors already on one of the two axes. But \((1,1)\) belongs to neither axis, while

$$ (1,1)=(1,0)+(0,1),\qquad (1,0)\in U,\quad (0,1)\in W. $$

Thus \((1,1)\in U+W\) but \((1,1)\notin U\cup W\), so the claimed equality is false. In fact, every \((r,s)\in\mathbb{R}^2\) can be written as \((r,0)+(0,s)\), giving \(U+W=\mathbb{R}^2\). The correction is to use the definition: choose a general vector from each subspace, add them, and determine all vectors that can result.

When computing any sum, keep track of both parts of the definition. First show that every sum of allowed vectors has the stated form. Then show that every vector of the stated form can be obtained by choosing vectors from \(U\) and \(W\). If uniqueness matters, examine the intersection \(U\cap W\): the theorem gives exactly the condition needed.

Check Your Understanding

Use the definition of \(U+W\) to answer each question, and check proposed decompositions by carrying out the addition.

  1. In \(P_2(\mathbb{R})\), take \(U=\{a+bx:a,b\in\mathbb{R}\}\) and \(W=\{cx^2:c\in\mathbb{R}\}\). What is \(U+W\), and is each decomposition unique?
  2. For the matrix subspaces in the first matrix example, can \(\begin{bmatrix}1&2\\1&0\end{bmatrix}\) belong to \(U+W\)? Explain using its entries.
  3. Give a nonzero matrix in the intersection of the two matrix subspaces with overlap, and use it to explain why a decomposition can fail to be unique.
  4. Why does \(U\cap W=\{\mathbf{0}\}\) guarantee that two representations of the same vector as \(\mathbf{u}+\mathbf{w}\) must agree part by part?
  5. For the two coordinate-axis subspaces of \(\mathbb{R}^2\), give a vector in \(U+W\) that is not in \(U\cup W\), and write it as a sum.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon