Tutorials › Linear Algebra › Testing Invariance with a Basis

Invariant Subspaces and Cayley-Hamilton · Tutorial 567 of 1000

Testing Invariance with a Basis

Use basis vectors and matrix columns to decide whether a subspace is invariant under a linear map.

Advanced 10 min read

What You'll Learn

  • State the basis test for invariance and prove both directions.
  • Form the matrix whose columns are the images of a subspace basis.
  • Check invariance by solving for coordinates in the given basis.
  • Express the test as the matrix equation \(\mathbf{A}\mathbf{Q}=\mathbf{Q}\mathbf{C}\).
  • Identify common errors when testing invariance with a nonstandard basis.

Testing Invariance One Basis Vector at a Time

A subspace may contain many vectors, so checking individually that every vector stays in it under a linear map would usually be impractical. A basis gives a finite test: it is enough to check the images of the basis vectors. The reason is linearity: every vector in the subspace is a linear combination of those basis vectors, and the image of that combination is the same combination of their images.

Let \(V\) be a vector space over a field \(\mathbb{F}\), where \(\mathbb{F}\) is \(\mathbb{R}\) or \(\mathbb{C}\), and let \(T:V\to V\) be linear. A subspace \(W\) of \(V\) is a subset containing \(\mathbf{0}\) and closed under addition and scalar multiplication. A basis \((\mathbf{w}_1,\dots,\mathbf{w}_k)\) of \(W\) is an ordered list that is linearly independent and spans \(W\): every \(\mathbf{w}\in W\) has a unique expression as a linear combination of the basis vectors.

Definition: A subspace \(W\) is invariant under \(T\) if \(T(\mathbf{w})\in W\) for every \(\mathbf{w}\in W\), or equivalently, if \(T(W)\subseteq W\). This means vectors in \(W\) are mapped into \(W\); it does not require that every vector of \(W\) be the image of a vector in \(W\).
Theorem (Basis test for invariance): Let \(W\) be a subspace of \(V\) with basis \((\mathbf{w}_1,\dots,\mathbf{w}_k)\), and let \(T:V\to V\) be linear. Then \(W\) is invariant under \(T\) if and only if \(T(\mathbf{w}_i)\in W\) for every \(i=1,\dots,k\).

Proof. Suppose first that \(W\) is invariant. Each basis vector \(\mathbf{w}_i\) belongs to \(W\), so the definition of invariance gives \(T(\mathbf{w}_i)\in W\) for every \(i\). Conversely, suppose that every \(T(\mathbf{w}_i)\) belongs to \(W\). Any \(\mathbf{w}\in W\) can be written as \(\mathbf{w}=\sum_{i=1}^{k}c_i\mathbf{w}_i\) for scalars \(c_i\). By linearity, \(T(\mathbf{w})=\sum_{i=1}^{k}c_iT(\mathbf{w}_i)\). Each summand is a scalar multiple of a vector in \(W\), and \(W\) is closed under addition, so \(T(\mathbf{w})\in W\). Thus \(W\) is invariant. If \(k=0\), then \(W=\{\mathbf{0}\}\); linearity gives \(T(\mathbf{0})=\mathbf{0}\), so \(W\) is invariant and the condition on basis vectors is vacuous. \(\square\)

Encoding the Test with Matrix Columns

For a subspace of \(\mathbb{R}^n\), write its basis vectors as columns of a matrix \(\mathbf{Q}=\begin{bmatrix}\mathbf{w}_1&\cdots&\mathbf{w}_k\end{bmatrix}\). If the linear map is represented in standard coordinates by \(\mathbf{A}\in\mathbb{R}^{n\times n}\), then the \(i\)th column of \(\mathbf{A}\mathbf{Q}\) is \(\mathbf{A}\mathbf{w}_i=T(\mathbf{w}_i)\). The basis test therefore asks whether every column of \(\mathbf{A}\mathbf{Q}\) is a linear combination of the columns of \(\mathbf{Q}\).

Matrix form of the basis test: Suppose \(k\geq 1\), the columns of \(\mathbf{Q}\in\mathbb{R}^{n\times k}\) form a basis of \(W\), and \(\mathbf{A}\in\mathbb{R}^{n\times n}\) represents \(T\). Then \(W\) is invariant under \(T\) if and only if there is a matrix \(\mathbf{C}\in\mathbb{R}^{k\times k}\) such that \(\mathbf{A}\mathbf{Q}=\mathbf{Q}\mathbf{C}\). The \(i\)th column of \(\mathbf{C}\) contains the coordinates of \(T(\mathbf{w}_i)\) in the given basis of \(W\).

Proof. If \(W\) is invariant, each \(T(\mathbf{w}_i)\) belongs to \(W\), so it has a coordinate column \(\mathbf{c}_i\in\mathbb{R}^k\) satisfying \(\mathbf{A}\mathbf{w}_i=\mathbf{Q}\mathbf{c}_i\). Form \(\mathbf{C}\) by putting \(\mathbf{c}_1,\dots,\mathbf{c}_k\) in its columns. The \(i\)th columns of \(\mathbf{A}\mathbf{Q}\) and \(\mathbf{Q}\mathbf{C}\) are then both \(\mathbf{A}\mathbf{w}_i=\mathbf{Q}\mathbf{c}_i\), so \(\mathbf{A}\mathbf{Q}=\mathbf{Q}\mathbf{C}\). Conversely, if this matrix equation holds, its \(i\)th column says \(T(\mathbf{w}_i)=\mathbf{Q}\mathbf{c}_i\) for the \(i\)th column \(\mathbf{c}_i\) of \(\mathbf{C}\). This is a linear combination of the basis columns, hence belongs to \(W\). The basis test proves that \(W\) is invariant. The coordinates are unique because the columns of \(\mathbf{Q}\) form a basis. \(\square\)

In practice, one may solve \(\mathbf{Q}\mathbf{c}=\mathbf{A}\mathbf{w}_i\) separately for each \(i\). A solution exists exactly when that image is in the span of the basis vectors. If it exists, independence of the basis vectors makes the solution unique. The resulting coordinate columns assemble into \(\mathbf{C}\). In particular, do not confuse \(\mathbf{A}\), which uses standard-coordinate input vectors, with \(\mathbf{C}\), which records how the basis vectors of \(W\) map in their own coordinates.

Worked Example: A Nonstandard Basis of an Invariant Subspace

Let \(T:\mathbb{R}^3\to\mathbb{R}^3\) be represented by \(\mathbf{A}=\begin{bmatrix}2&0&-1\\3&0&2\\1&0&3\end{bmatrix}\), and let \(W\) have basis \(\mathbf{w}_1=(1,1,0)^\top\), \(\mathbf{w}_2=(0,1,1)^\top\). Test whether \(W\) is invariant.

Put the basis vectors in the columns of \(\mathbf{Q}\), then multiply to obtain the images:

$$ \mathbf{Q}=\begin{bmatrix}1&0\\1&1\\0&1\end{bmatrix}, \qquad \mathbf{A}\mathbf{Q} = \begin{bmatrix}2&0&-1\\3&0&2\\1&0&3\end{bmatrix} \begin{bmatrix}1&0\\1&1\\0&1\end{bmatrix} = \begin{bmatrix}2&-1\\3&2\\1&3\end{bmatrix}. $$

The first image is \((2,3,1)^\top\). A vector \(\alpha\mathbf{w}_1+\beta\mathbf{w}_2\) has coordinates \((\alpha,\alpha+\beta,\beta)^\top\). Taking \(\alpha=2\), \(\beta=1\) gives \((2,3,1)^\top\), so \(T(\mathbf{w}_1)=2\mathbf{w}_1+\mathbf{w}_2\). The second image is \((-1,2,3)^\top\); taking \(\alpha=-1\), \(\beta=3\) gives \((-1,2,3)^\top\), so \(T(\mathbf{w}_2)=-\mathbf{w}_1+3\mathbf{w}_2\). Both images belong to \(W\), and the basis test shows \(W\) is invariant.

The coordinate columns give \(\mathbf{C}=\begin{bmatrix}2&-1\\1&3\end{bmatrix}\). Multiplying back checks the matrix equation:

$$ \mathbf{Q}\mathbf{C} = \begin{bmatrix}1&0\\1&1\\0&1\end{bmatrix} \begin{bmatrix}2&-1\\1&3\end{bmatrix} = \begin{bmatrix}2&-1\\3&2\\1&3\end{bmatrix} =\mathbf{A}\mathbf{Q}. $$

Worked Example: One Basis Vector Fails the Test

Let \(\mathbf{A}=\begin{bmatrix}1&0&0\\0&2&0\\0&0&3\end{bmatrix}\) and let \(W\) have basis \(\mathbf{w}_1=(1,1,0)^\top\), \(\mathbf{w}_2=(0,0,1)^\top\). Test invariance.

With \(\mathbf{Q}=\begin{bmatrix}1&0\\1&0\\0&1\end{bmatrix}\), the images are \(\mathbf{A}\mathbf{w}_1=(1,2,0)^\top\) and \(\mathbf{A}\mathbf{w}_2=(0,0,3)^\top\). The second image is \(3\mathbf{w}_2\), so it belongs to \(W\). For the first image, suppose \(\alpha\mathbf{w}_1+\beta\mathbf{w}_2=(1,2,0)^\top\). Comparing coordinates requires \(\alpha=1\) from the first coordinate and \(\alpha=2\) from the second, which is impossible. Thus \(T(\mathbf{w}_1)\notin W\), and \(W\) is not invariant.

The matrix calculation gives the same result: \(\mathbf{A}\mathbf{Q}=\begin{bmatrix}1&0\\2&0\\0&3\end{bmatrix}\). Its first column is not in the span of the columns of \(\mathbf{Q}\), while its second column is \(3\mathbf{w}_2\). A single failing basis image is enough to disprove invariance.

Recognizing the Test in Standard Coordinates

When \(W\) is a coordinate subspace, the matrix-column test can be read directly from selected entries. For example, in \(\mathbb{R}^3\), let \(W=\operatorname{span}\{\mathbf{e}_1,\mathbf{e}_2\}\), the plane whose third coordinate is zero. Its basis matrix is \(\mathbf{Q}=\begin{bmatrix}1&0\\0&1\\0&0\end{bmatrix}\). For invariance, the first two columns of \(\mathbf{A}\) must have third coordinate zero, since those columns are \(T(\mathbf{e}_1)\) and \(T(\mathbf{e}_2)\). There is no restriction from the third column: \(\mathbf{e}_3\) is not a basis vector of this subspace.

Worked Example: Testing a Coordinate Plane

Let \(\mathbf{A}=\begin{bmatrix}1&2&0\\3&4&5\\0&0&6\end{bmatrix}\), and test invariance of \(W=\operatorname{span}\{\mathbf{e}_1,\mathbf{e}_2\}\).

The two basis images are the first two columns of \(\mathbf{A}\): \(T(\mathbf{e}_1)=(1,3,0)^\top=\mathbf{e}_1+3\mathbf{e}_2\) and \(T(\mathbf{e}_2)=(2,4,0)^\top=2\mathbf{e}_1+4\mathbf{e}_2\). Both lie in \(W\), so \(W\) is invariant. In matrix form,

$$ \mathbf{A}\mathbf{Q} = \begin{bmatrix}1&2\\3&4\\0&0\end{bmatrix} = \begin{bmatrix}1&0\\0&1\\0&0\end{bmatrix} \begin{bmatrix}1&2\\3&4\end{bmatrix} =\mathbf{Q}\mathbf{C}. $$

Multiplying \(\mathbf{Q}\mathbf{C}\) gives columns \((1,3,0)^\top\) and \((2,4,0)^\top\), which verifies the two computed images. The third column of \(\mathbf{A}\), \((0,5,6)^\top\), does not affect this test because it is the image of \(\mathbf{e}_3\), which is outside the chosen basis list.

Testing a Parameter-Dependent Subspace

The same method handles a subspace whose basis depends on a parameter. In a one-dimensional subspace, the image of its single basis vector must be a scalar multiple of that vector. The scalar may depend on the parameter; it need not be fixed in advance.

Worked Example: Values of a Parameter That Give Invariance

Let \(T:\mathbb{R}^2\to\mathbb{R}^2\) have matrix \(\mathbf{A}=\begin{bmatrix}1&1\\0&2\end{bmatrix}\), and let \(W_t=\operatorname{span}\{(1,t)^\top\}\). Find the real values of \(t\) for which \(W_t\) is invariant.

The vector \((1,t)^\top\) is nonzero for every real \(t\), so it is a basis of \(W_t\). Its image is \(\mathbf{A}(1,t)^\top=(1+t,2t)^\top\). For this to lie in \(W_t\), there must be a scalar \(c\) such that \((1+t,2t)^\top=c(1,t)^\top\). Comparing coordinates gives \(c=1+t\) and \(2t=ct\). Substitution yields \(2t=(1+t)t\), or \(t(1-t)=0\). Thus the only possibilities are \(t=0\) and \(t=1\).

Check both values. At \(t=0\), the basis vector is \((1,0)^\top\), and its image is \((1,0)^\top\), so \(W_0\) is invariant. At \(t=1\), the basis vector is \((1,1)^\top\), and its image is \((2,2)^\top=2(1,1)^\top\), so \(W_1\) is invariant. These substitutions verify both solutions.

Common Pitfall: Requiring Each Basis Vector to Stay on Its Own Line

Invariance of \(W\) requires \(T(\mathbf{w}_i)\) to remain somewhere in \(W\), not necessarily on the line spanned by \(\mathbf{w}_i\). In the first example, a mistaken test might reject invariance because \(T(\mathbf{w}_1)=2\mathbf{w}_1+\mathbf{w}_2\) is not a scalar multiple of \(\mathbf{w}_1\). That calculation tests whether the line spanned by \(\mathbf{w}_1\) is invariant, which is a different question. The correction is to test membership in the full subspace: \(2\mathbf{w}_1+\mathbf{w}_2\in W\), and \(T(\mathbf{w}_2)=-\mathbf{w}_1+3\mathbf{w}_2\in W\), so the whole two-dimensional subspace is invariant.

A second useful check is to make sure the columns being tested are the images of the chosen basis vectors. For a nonstandard basis matrix \(\mathbf{Q}\), those columns are in \(\mathbf{A}\mathbf{Q}\), not generally in \(\mathbf{A}\) itself. The matrix \(\mathbf{A}\) acts on standard-coordinate columns; multiplying by \(\mathbf{Q}\) supplies the actual basis vectors as inputs.

Check Your Understanding

Use the basis test in each question. When you find coordinate coefficients, verify them by multiplying the basis matrix by the coefficient column.

  1. Let \(\mathbf{A}=\begin{bmatrix}2&0\\0&3\end{bmatrix}\) and \(W=\operatorname{span}\{(1,1)^\top\}\). Is \(W\) invariant?
  2. For \(\mathbf{A}=\begin{bmatrix}1&0&0\\0&1&0\\1&0&2\end{bmatrix}\), test whether \(\operatorname{span}\{\mathbf{e}_1,\mathbf{e}_2\}\) is invariant.
  3. Suppose \(T(\mathbf{w}_1)=2\mathbf{w}_1-\mathbf{w}_2\) and \(T(\mathbf{w}_2)=\mathbf{w}_1+4\mathbf{w}_2\). What is the coordinate matrix \(\mathbf{C}\) on this basis, and what does it imply about the span of the two vectors?
  4. Explain why checking that the image of one basis vector belongs to \(W\) is not enough to establish invariance when the basis has more than one vector.
  5. For which real \(t\) is \(\operatorname{span}\{(1,t)^\top\}\) invariant under \(\begin{bmatrix}2&0\\1&1\end{bmatrix}\)?

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