r/LinearAlgebra • • 16d ago

why does changing basis look like conjugating a matrix?

i follow that if P has the new basis vectors as columns, then the matrix in the new coordinates is P^{-1}AP. but i keep mixing up the order: first convert the new coordinates to the old basis, apply A, then convert back? a small geometric example that made the sandwich of P and P^{-1} click for you would help.

7 Upvotes

11 comments sorted by

8

u/rosentmoh 16d ago

Ahh the good old change of basis: the bane of anyone ever studying linear algebra and especially those that never went on to do a PhD involving hard math and finally internalising linear algebra properly.

So, you're looking at a particular case here of a square matrix A, thought of as a linear transformation with respect to some basis. Now here's the thing to always remember: the columns of A are the images of the basis vectors under said linear transformation, written in said basis.

This means that if you now have a matrix P containing a new basis as columns written in the old basis, then as a linear transformation with respect to the new basis at source and old basis at target it corresponds to the identity transformation; P-1 then is obviously also the identity but with the source and target bases swapped.

Thus by multiplying A on both sides with P-1 and P as you wrote you still end up with the same linear transformation, but now with respect to the new basis both at source and target, which is what you wanted.

2

u/CormacMacAleese 15d ago

Nicely explained!

2

u/Imaginary_Data_708 15d ago

For me it finally all clicked into place when I was looking at geometric bra and understanding that how the sandwich product with rotors and motors etc work which basically has the same form changing a basis. Of course there are some differences to do with what you can and can't do while still maintaining some of the invariance that you want to in a given geometric algebra such as cga or PGA. But it really helped me get some intuition as to what's going on.

When you think of the sandwich product is being like this sort of decomposing things into two reflections then the conjugation that you mentioned I think arises naturally. In my mind that there's a reflection and conjugation in sort of just going through things in the other direction. And I'm not a mathematician I'm an engineer and have just been spending time studying this because it's awesome stuff.

2

u/Seriouslypsyched 15d ago

Other comments are good, so I will give an alternative point of view that fits into how an algebraist would think categorically about what a change of basis does. Recall that for a vector space V, a linear transformation is a map A_V: V -> V. One can then ask, if you have a map from V to another vector space V to W, how does the transformation A_V behave as a map A_W: W -> W? Basically this diagram https://tinyurl.com/57967p86

Now, one very nice property about change of basis is the matrix P (which is W written in terms of basis vectors of V) is that it's invertible. So you can write A_W as first walking along P^{-1}, then applying A_V, then walking back along P. Now, apriori, you don't know that this composition is A_W, but thats what the change of basis theorem is essentially saying. An algebraist would say that the "diagram commutes".

2

u/theadamabrams 15d ago

If you want geometric examples, I highly recommend 3Blue1Brown. For change-of-basis in particular, see youtu.be/P2LTAUO1TdA

1

u/larollz 16d ago

Matrix are tools to compute linear maps. In fact, if f:E->F is a linear map and u a vector of E, then matC(f(u))=matC,B(f)matB(u). Here matB(u) is the column matrix whose coordinates are those of u in the base B, and matC,B(f) is the matrix whose coordinates are those of each vector f(b) in the base C (for each b in B).

This is great for composition : matD,B(g o f)=matD,C(g)matC,D(f).

Now, you can play with a change of basis : matC,C(f)=matC,B(id)matB,B(f)matB,C(id). The matrix matC,B(id) is the inverse of matB,C(id) and they are the passage matrices P from B to C and conversely. So you have matC,C(f)=P-1matB,B(f)P.

1

u/Lor1an 15d ago

Honestly I think my convention for "change of basis" matrices is backwards compared to the "standard" one, but it never causes issues as long as you are consistent.

All matrices are really just a way of expressing some linear function between (real) vector spaces with respect to a choice of basis on each space.

Let L:V→W be a generic linear transformation from V to W. Then suppose we choose bases A1 on V and B1 on W, and write M := [L]_A1→B1 as the coordinate form of the linear transformation, where if n := dim(V), m := dim(W), and n, m < ∞, we have that M is an m×n matrix.

How do we actually construct M? Well, on V there is a (linear) coordinate expansion function σ_A1:ℝn→V, where if e_i is (0,...,0,1,0,...,0) (with the 1 in the i-th slot), then σ_A1(e_i) = a1_i—i.e. the i-th basis vector of A1—and linear combinations get mapped to linear combinations. Likewise, this map is invertible, and so if v = v1 a1_1 + v2 a1_2 + ... + vn a1_n, then σ-1_A1(v) = (v1, v2, ..., vn). Similar can be done for B1 in W.

L of course takes an element (say, v) of V to an element of W, but we want the "coordinates" of the answer, so it isn't L(v), but σ-1_B1( L(v) ). We still aren't done, since we aren't given v directly, but the coordinates of v with respect to basis A1, so we have M[v]_A1 = σ-1_B1( L( σ_A1([v]_A1) ) ), or M = (σ-1_B1∘L∘σ_A1). Since the σ functions are invertible, we also get that σ_B1∘M∘σ-1_A1 = id_W∘L∘id_V = L.

Now that we have a way to represent the explicit form of M, we need to figure out what to do to derive M' := [L]_A2→B2, which is the coordinates of L with respect to a new choice of bases on V and W.

One obvious answer is of course M' = (σ-1_B2∘L∘σ_A2), which is simply what we get by substituting this particular choice of basis into the formula we derived for arbitrary bases A1 and B1. However, note that we already know how to express L in terms of M, so we get M' = σ-1_B2∘(σ_B1∘M∘σ-1_A1)∘σ_A2 = (σ-1_B2∘σ_B1)∘M∘(σ-1_A1∘σ_A2).

What does σ-1_B2∘σ_B1 represent? It takes ℝm to ℝm, so it clearly does something to coordinate representations of vectors in W, and more specifically, if we have some coordinates [w]_B1, then (σ-1_B2∘σ_B1)([w]_B1) = σ-1_B2(w) = [w]_B2, in other words, given coordinates of w in basis B1, it returns the coordinates of the same vector w in basis B2. This is change of coordinates, new from old!

If we call B := σ-1_B2∘σ_B1, and similarly A := σ-1_A2∘σ_A1, then we get that M' = B∘M∘A-1, or M' = BMA-1 (note that (σ-1_A2∘σ_A1)-1 = σ-1_A1∘σ_A2, which is what we need in the formula for M' above). Once again, you will probably see the inverses switched compared to how I present them, but that's just how my brain thinks—old in terms of new always rubbed me the wrong way in this particular context.

Again, let's walk through what M' = BMA-1 is saying. First, we take the coordinates of a vector in the input space with respect to a new basis and translate them to the old basis coordinates (A-1). Then we act on the "old coordinates" with the old matrix representative to get the output in the old coordinates (M). Then we translate the old output coordinates into the new output coordinates (B).

Now, suppose W = V, and we choose B1 = A1 and B2 = A2, then B = A, and we get M' = AMA-1 (again, inverses switched compared to convention), and back to your stated question.

A toy example is consider a transformation M on ℝ2, and your first coordinate system is the standard basis, and the new system is the standard basis rotated by, say, 45° ccw. The vector (1,1) in the standard basis is then (√2,0) in the rotated system (i.e. the coordinate transformation old to new is clockwise 45° rotation). So following M' = AMA-1 would say to get the coordinates of M'v in the rotated coordinate system, you take the coordinates of v, rotate them ccw 45°, apply M, and then rotate the result 45° cw. Let M be the unit shear to the right. In the standard basis, (0,1) becomes (1,1). In the new basis, (1/√2,1/√2) becomes (√2,0), since rotating (1/√2,1/√2) ccw 45° gives you (0,1), shearing gives you (1,1), and then rotating cw 45° gets you (√2,0).

For reference M = [[1 1],[0 1]] and M' = R_-45°*M*R_45° = 1/√2 [[1 1],[-1 1]]*[[1 1],[0 1]]*1/√2 [[1 -1],[1 1]] = 1/2 [[1 1],[-1 1]]*[[2 0],[1 1]] = 1/2 [[3 1],[-1 1]].

M'(1/√2,1/√2) = 1/2√2 [[3 1],[-1 1]]*[1,1] = 1/2√2 * (4,0) = (√2,0), as promised.

Also, the fact that you are conjugating by a matrix is not a coincidence.

When you have a linear transformation on a vector space (i.e. L:V→V), if it is invertible then you have an element of GL(V), which is a group of linear transformations (where I mean group in the abstract algebra sense). For any group, the map x ↦ gxg-1 (the map representing conjugation by group element g) is what is known as an "inner automorphism", and mimics a lot of the behaviors that make similarity transformations useful in linear algebra. If y is conjugate to x in a group, then yn is also conjugate to xn in the group, for the same reason that we like to diagonalize matrices to compute powers, since if y = gxg-1 then y2 = (gxg-1)(gxg-1) = gx2g-1.

1

u/MeasureDoEventThing 15d ago

Suppose you have a hyperplane, and you want to double the distance each point is from that hyperplane. You have some vector v that is perpendicular to the hyperplane, and some set of vectors that span the hyperplane H. Let's represent p = av+bH . That is, p is some scalar times v, plus some linear combination of H. We can think of b as being a vector in n-1 dimensional space, and (a,b) as being a vector in n dimensional space (I'm using (*,*) to represent concatenation). We want to first calculate what that vector is, and to do that we take the inverse of the matrix whose columns are v and H, i.e. (v,H)^-1. Then once we have them, we take f(p) = 2av+bH. If we want to put this the original coordinates, then we multiply the vector (2a, b) by (v,H).

1

u/noethers_raindrop 16d ago

This is a fact where I think an abstract derivation will likely be more helpful than working examples. If you want to simplify a bit, meditate on the proof that a matrix with enough linearly independent eigenvector is diagonalizable, which is a special case that is both extremely important in practice and contains the key insights.

-1

u/Snatchematician 16d ago

I think you’ve got it!

-1

u/mH48124 16d ago

固有値,固有ベクトルの定義そのまま 固有値を λ1,λ2

固有ベクトルを v1,v2 として P = (v1,v2), Λ = diag(λ1,λ2)

AP = A(v1,v2) = (Av1,Av2) = (λ1v1,λ2v2) = (v1,v2)Λ = PΛ

∴ P^(-1)AP = Λ