# Proof that triagonal matrices with distinct diagonal elements are similar

I'm trying to prove that if $A,B$ are triangular matrices with distinct elements along their main diagonals then the matrices are similar. I have been interpreting this to mean that the elements along $A$'s main diagonal are all distinct and possibly also distinct from the element's along $B$'s main diagonal, and vice versa, although the instructions on this point are not perfectly clear.

In any case, I have done the following:

Since $A$ is triangular its eigenvalues are its diagonal elements, each of which has algebraic and therefore geometric multiplicity 1 and is therefore diagonalizable; likewise for matrix $B$. Suppose $A\sim D$ and $B\sim D'$.

If I could prove that all diagonal matrices of distinct diagonal elements are similar to all other such matrices then the proof would be complete. I've been trying unsuccessfully to prove this, perhaps because it's false, but my attempt so far has been to try to find an invertible $U$ such that $D' = UDU^{-1}$, and I've been trying to think about it a column at a time. For the $i$th column I want $v_{i}$ such that $Dv_{i} = d'_{i}e_{i}$ where $d'_{i}$ is the $i$th eigenvalue of $D'$ and $e_{i}$ is the $i$th elementary vector. But this implies $v_{i} = (d'_{i}/d_{i})e_{i}$ where $d_{i}$ is the $i$th eigenvalue of $D$, if $d_{i}\ne 0$. If $d_{i}=0$ then I'll worry about that later.

When I form the matrix $U = [(d'_{1}/d_{1})e_{1} |... |(d'_{n}/d_{n})e_{n}]$ and check the similarity equation it doesn't hold and instead gets me $A = UAU^{-1}$.

Should I even be approaching this question in this way, trying to prove that diagonal matrices of distinct diagonal elements are similar?

In the tentative you did above, you have to be careful in which basis you write the vectors: I claim that the $v_i$ such that $Dv_i=d'_ie_i$ is exactly $e_i$, that's probably not what you want. You might be able to write down a basis consisting of eigenvectors of both matrices, but their eigenvalues are going to be distinct: as above, $d_ie_i=De_i$ (by direct computation), but also you want $De_i=d'_ie_i$. That's possible if and only if $d_ie_i=d'_ie_i$, i.e. $d_i=d'_i$.