A necessary and sufficient condition for diagonal matrix Excuse me? Why is it necessary and sufficient for a diagonal matrix to be both an upper triangular matrix and a lower triangular matrix?

A necessary and sufficient condition for diagonal matrix Excuse me? Why is it necessary and sufficient for a diagonal matrix to be both an upper triangular matrix and a lower triangular matrix?

Diagonal matrix: AIJ = 0 when I is not equal to j
Upper triangle: AIJ = 0 when I is greater than j
Lower triangular matrix: AIJ = 0 when I is less than j
So if it is diagonal, it obviously satisfies the latter two conditions
On the contrary, if the latter two conditions are satisfied at the same time, AIJ = 0 is diagonal as long as I is not equal to J