A triangular matrix U of the form U_(i j) = {a_(i j) | for i<=j 0 | for i>j. auto right match Written explicitly, U = [a_11 | a_12 | ... | a_(1n) 0 | a_22 | ... | a_(2n) ⋮ | ⋮ | ⋱ | ⋮ 0 | 0 | ... | a_(n n)]. A matrix m can be tested to determine if it is upper triangular in the Wolfram Language using UpperTriangularMatrixQ[m].