# Change of Basis

Any vector space has multiple bases, so the question naturally arises: what are the relationships between bases of a vector space? In the first place, there must be the same number of elements in any basis of a vector space. Then, given two bases of a vector space, there is a way to translate vectors in terms of one basis into terms of the other; this is known as **change of basis**.

Change of basis is a technique applied to finite-dimensional vector spaces in order to rewrite vectors in terms of a different set of basis elements. It is useful for many types of matrix computations in linear algebra and can be viewed as a type of linear transformation.

## Definition

Suppose $v_1, \, v_2, \, \dots, \, v_n$ is a basis of $V$ and $u_1, \, u_2, \, \dots, \, u_n$ is another basis of $V$. Then, by the definition of basis, there is precisely one way to write each $v_k$ in terms of $u_i$'s. Specifically, there are scalars $a_{i,j}$ $($for integers $1 \le i,j \le n)$ such that

$\begin{aligned} v_1 &= a_{1,1} u_1 + a_{1,2} u_2 + \dots + a_{1,n} u_n \\ \vdots \ &\ \vdots \hspace{1cm} \vdots \hspace{1.5cm} \vdots \hspace{2.5cm} \vdots \\ v_n &= a_{n,1} u_1 + a_{n,2} u_2 + \dots + a_{n,n} u_n. \end{aligned}$

Then, there is an $n \times n$ matrix $M = (a_{i,j})_{i,j}$ that is known as the **change-of-basis matrix**. $M$ must be invertible because it must be injective (and it is square), by the definition of basis. Any vector $v = b_1 v_1 + b_2 v_2 + \dots + b_n v_n$ could then be represented in terms of the $u_i$'s by means of direct substitution:

$\begin{aligned} v &= \begin{pmatrix} v_1 & v_2 & \dots & v_n \end{pmatrix} \begin{pmatrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{pmatrix} \\ &= \begin{pmatrix} u_1 & u_2 & \dots & u_n \end{pmatrix} M \begin{pmatrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{pmatrix}. \end{aligned}$

That is, the linear transformation $T: V \to V$ defined by $T(v) = Mv$ changes the coordinates from $v_i$'s to $u_i$'s.

## Rewriting a Linear Transformation

When using coordinates (and therefore matrices) for linear transformations, it is sometimes helpful to consider a linear transformation with a different basis.

Suppose $T: V \to V$ is a linear transformation with matrix $N$ in basis $\mathcal{B}_1 = \{v_1, \, v_2, \, \dots, \, v_n\}$ and $V$ has another basis $\mathcal{B}_2 = \{u_1, \, u_2, \, \dots, \, u_n\}$. Then, if $M$ is the change-of-basis matrix for $\mathcal{B}_1$ to $\mathcal{B}_2$ as above, the linear transformation has a different matrix in basis $\mathcal{B}_2$, namely $T(u) = MNM^{-1} u.$

So, some vector $u \in V$ has a representation with basis $\mathcal{B}_2$. Then, $M^{-1}u$ is the same vector whose representation is now with basis $\mathcal{B}_1$; $NM^{-1}u$ is the application of $N$ to a vector expressed in basis $\mathcal{B}_1$, yielding the output of $T$ expressed in basis $\mathcal{B}_1$; and $MNM^{-1}$ is the output of $T$ expressed in basis $\mathcal{B}_2$.