# Definition:Triangular Matrix/Upper Triangular Matrix

## Definition

An upper triangular matrix is a matrix in which all the lower triangular elements are zero.

That is, all the non-zero elements are on the main diagonal or in the upper triangle:

$\mathbf U = \begin{bmatrix} a_{11} & a_{12} & a_{13} & \cdots & a_{1, n - 1} & a_{1n} \\ 0 & a_{22} & a_{23} & \cdots & a_{2, n - 1} & a_{2n} \\ 0 & 0 & a_{33} & \cdots & a_{3, n - 1} & a_{3n} \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & a_{n - 1, n - 1} & a_{n - 1, n} \\ 0 & 0 & 0 & \cdots & 0 & a_{nn} \\ \end{bmatrix}$

That is, $\mathbf U$ is upper triangular if and only if:

$\forall a_{ij} \in \mathbf U: i > j \implies a_{ij} = 0$

## Also defined as

Some sources define an upper triangular matrix only as a square matrix.

## Examples

### Example of Square Upper Triangular Matrix

This is an arbitrary example of an upper triangular square matrix:

$\begin {pmatrix} 1 & 2 & 3 & 4 \\ 0 & 5 & 6 & 7 \\ 0 & 0 & 8 & 9 \\ 0 & 0 & 0 & 10 \end {pmatrix}$

### Example of Non-Square Upper Triangular Matrix

This is an arbitrary example of an upper triangular matrix which is specifically not square:

$\begin {pmatrix} 1 & 2 & 3 & 4 \\ 0 & 5 & 6 & 7 \\ 0 & 0 & 8 & 9 \\ 0 & 0 & 0 & 10 \\ 0 & 0 & 0 & 0 \end {pmatrix}$