# upper triangular and diagonal

If $A$ is real, upper triangular $n\times n$ matrix such that $AA^t=A^tA$. Then show that $A$ is diagonal.

We know that every upper triangular, symmetric matrix is diagonal. But I have problem to show that $A=A^t$ from the given condition. How would we show that?

Let $A = \begin{bmatrix}v_1 & v_2 & \cdots & v_n\end{bmatrix}$ and $A^T = \begin{bmatrix}h_1 & h_2 & \cdots & h_n\end{bmatrix}$.

Then, $AA^T = \begin{bmatrix} h_1 \cdot h_1 & h_1 \cdot h_2 & \cdots & h_1 \cdot h_n\\ h_2 \cdot h_1 & h_2 \cdot h_2 & \cdots & h_2 \cdot h_n\\ \vdots & \vdots & & \vdots\\ h_n \cdot h_1 & h_n \cdot h_2 & \cdots & h_n \cdot v_n\\ \end{bmatrix}$ and $A^TA = \begin{bmatrix} v_1 \cdot v_1 & v_1 \cdot v_2 & \cdots & v_1 \cdot v_n\\ v_2 \cdot v_1 & v_2 \cdot v_2 & \cdots & v_2 \cdot v_n\\ \vdots & \vdots & & \vdots\\ v_n \cdot v_1 & v_n \cdot v_2 & \cdots & v_n \cdot v_n\\ \end{bmatrix}$.

Comparing them gives $\|h_1\|=\|v_1\|$ and so on.

Since $\|h_1\|=\|v_1\|$, we have $a_{11}^2 + a_{12}^2 + \cdots a_{n2}^2 = a_{11}^2$.

Since the entries are real, the only component of the first row which can be non-zero is $a_{11}$.

Rinse and repeat to prove that the elements on the diagonal are the only elements which can be non-zero.

Let A be: $$\left[ \begin{array}{ccc} a_{11} & a_{12} & \cdots & a_{1n}\\ 0&a_{22} & \cdots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & a_{nn} \end{array} \right]$$ Then A^T will be a lower triangular matrix such as : $$\left[ \begin{array}{ccc} a_{11} & 0 & \cdots & 0\\ a_{12}&a_{22} & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots \\ a_{1n} & a_{2n} & \cdots & a_{nn} \end{array} \right]$$ Then AA^T=A^TA only if A is diagonal.