set of invertible diagonal matrices

Let $$\mathcal{T}$$ be the set of invertible diagonal matrices. Show that for any invertible matrix $$B$$ such that $$B\mathcal{T}B^{-1} = \mathcal{T}, B=PT$$ for some permutation matrix $$P$$ and invertible diagonal matrix $$T.$$ Here, $$AB := \{ab: a\in A, b\in B\}$$ when $$A$$ and $$B$$ are sets.

I'm not sure how to show this result, though I'm pretty sure I need to consider eigenvalues, diagonalizable matrices, and change of basis matrices. Using the definition alone, I get stuck quite easily; I only know that for any invertible diagonal matrix $$T, BTB^{-1}$$ is an invertible diagonal matrix and for any invertible diagonal matrix $$T', T' = BT''B^{-1}$$ for some invertible diagonal matrix $$T''.$$ I know how to show that if an $$n\times n$$ matrix has $$n$$ distinct eigenvalues, then it has $$n$$ distinct eigenvectors (an eigenvector can correspond to only one eigenvalue) and thus these $$n$$ eigenvectors are linearly independent, so the matrix is diagonalizable, but I'm not sure if this is useful.

Clarification: Here $$B\mathcal{T}B^{-1} := \{BTB^{-1} : T\in \mathcal{T}\}$$

• I'm a little confused with the question. Is the whole set being multiplied by $B$ and $B^{-1}$? Jun 13 at 2:55
• @GauravChandan yes. Jun 13 at 3:42

The set $$\mathcal T$$ is the set of invertible matrices that are diagonalisable with the standard basis of $$K^n$$ (where $$K$$ is your unspecified field) as (possible) basis of eigenvectors. If $$B$$ is any invertible matrix and $$T\in\mathcal T$$, then $$BTB^{-1}$$ can be viewed as a change of basis of $$T$$: it is a diagonalisable matrix with the columns of $$B$$ as (possible) basis of eigenvectors. Therefore $$B\mathcal TB^{-1}$$ is the set of invertible matrices that are diagonalisable with the columns of $$B$$ as (possible) basis of eigenvectors. You want this set to coincide with $$\mathcal T$$, in other words the set of (invertible) matrices that admit the standard basis as basis of eigenvectors should coincide with the set of those that admit the columns of $$B$$ as basis of eigenvectors.

It is not hard to see that this happens if and only if those columns of $$B$$ are obtained from the standard basis by (1) some permutation, combined with (2) some scaling (by a nonzero factor) of each basis vector. Indeed clearly these operations preserve the property of being a basis of eigenvectors of a given matrix, so the condition is sufficient. On the other hand (if $$K$$ has enough elements) there are diagonalisable matrices whose eigenspaces are all of dimension$$~1$$ (they have $$n$$ distinct eigenvalues), so the only freedom for choosing a basis of eigenvectors is permutation and scaling of the vectors. And even if you should work over a finite field with fewer elements than the size of your matrices (so that this argument cannot be applied), it is easy to see that the only bases that are eigenvectors for all diagonal matrices at once are those that are obtained by permutation and scalar multiplication from the standard basis.

Marc van Leeuwen’s answer provides the correct bird’s eye view of the problem, and explains how one could deduce the structure of $$B$$ using intuition rather than calculation. Let me provide the counterpart approach that you can also do this easily by direct calculation (the view from the ground).

Concretely, multiplying by a matrix by $$T\in \mathcal T$$ has the effect of scaling the rows (or columns) of $$B$$ by the coefficients on the diagonal of $$T$$ (depending on whether we multiply on the left or right). So the fact that $$B\mathcal T = \mathcal T B$$ corresponds to the following property:

If we multiply the columns of $$B$$ by arbitrary non-zero scalars, we can recover the original matrix $$B$$ by multiplying the resulting rows by (some other) non-zero scalars.

Now it is easy to prove that each row of $$B$$ can have at most one non-zero element: suppose for instance that $$b_{11}, b_{12}$$ are both non-zero. Then we can multiply the first column by $$1$$ and the second column by say $$-1$$ and it will be impossible to convert $$(b_{11}, -b_{12}, \ldots)$$ back into $$(b_{11}, b_{12},\ldots)$$ by rescaling the first row. (As in Marc’s answer we only really need a scalar which is different from $$0$$ or $$1$$, so the argument goes through in any field other than $$\mathbb F_2$$, where $$\mathcal T$$ has only the identity matrix so the claim would be false).

So each row of $$B$$ has at most one non-zero element. And since $$B$$ is invertible each row has exactly one non-zero element, and by a trivial counting argument (or by flipping the above calculation) every column also has exactly one non-zero element. Hence $$B$$ is just a permutation of an invertible diagonal matrix.