({{, (RefLink[LowerTriangularMatrixQ, paclet:ref/LowerTriangularMatrixQ])[m] 
gives (RefLink[True, paclet:ref/True]) if m is lower triangular, and (RefLink[False, paclet:ref/False]) otherwise.}, {, (RefLink[LowerTriangularMatrixQ, paclet:ref/LowerTriangularMatrixQ])[m,k]
gives (RefLink[True, paclet:ref/True]) if m is lower triangular starting down from the k(^th) diagonal, and (RefLink[False, paclet:ref/False]) otherwise.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[LowerTriangularMatrixQ, paclet:ref/LowerTriangularMatrixQ])[m,k] works even if m is not a square matrix.

In (RefLink[LowerTriangularMatrixQ, paclet:ref/LowerTriangularMatrixQ])[m,k], positive k refers to superdiagonals above the main diagonal and negative k refers to subdiagonals below the main diagonal.

(RefLink[LowerTriangularMatrixQ, paclet:ref/LowerTriangularMatrixQ]) works with (RefLink[SparseArray, paclet:ref/SparseArray]) and (RefLink[StructuredArray, paclet:ref/StructuredArray]) objects.

The following option can be given:

For approximate matrices, the option (RefLink[Tolerance, paclet:ref/Tolerance])->t can be used to indicate that all entries (RefLink[Abs, paclet:ref/Abs])[(Subscript[m, ij])]≤t are taken to be zero.

OpenersPrimaryExamplesSection(Spacer1)Examples  (22)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Test if a matrix is lower triangular:

MatrixForm[{{a,0,0},{b,c,0},{d,e,f}}]

LowerTriangularMatrixQ[%]

LowerTriangularMatrixQ[{{1,2,3},{4,5,6},{7,8,9}}]

Test if a matrix is lower triangular starting from the first superdiagonal:

MatrixForm[{{1,2,0},{3,4,5},{6,7,8}}]

LowerTriangularMatrixQ[%,1]

Test if a matrix is lower triangular starting from the first subdiagonal:

MatrixForm[{{0,0,0},{1,0,0},{2,3,0}}]

LowerTriangularMatrixQ[%,-1]

OpenersExampleSection1(Spacer1)Scope  (7)

Test if a real machine-number matrix is lower triangular:

LowerTriangularMatrixQ[N[{{1,0,0},{2,3,0},{4,5,6}}]]

A complex matrix:

LowerTriangularMatrixQ[{{1.+I,0,0},{2-I,3 I,0},{4,5I,6}}]

An exact matrix:

LowerTriangularMatrixQ[{{1,(Sqrt[2])},{Pi,1/2}}]

An arbitrary-precision matrix:

LowerTriangularMatrixQ[N[{{1,0},{Pi,1/2}},20]]

Test a sparse matrix:

mat=SparseArray[{{1,1}->2,{2,1}->1,{3,2}->5},{3,3}]

LowerTriangularMatrixQ[mat]

Test whether a structured matrix is upper triangular:

mat=SymmetrizedArray[{{1,1}->2,{2,1}->1},{2,2},Symmetric[All]]

LowerTriangularMatrixQ[mat]

Test a symbolic matrix:

LowerTriangularMatrixQ[{{a,b},{c,d}}]

The matrix is lower triangular when b=0:

LowerTriangularMatrixQ[{{a,b},{c,d}}/.b->0]

Test rectangular upper-triangular matrices:

(mat23={{1,0,0},{2,3,0}})//MatrixForm

LowerTriangularMatrixQ[mat23]

(mat32={{1,0},{2,3},{4,5}})//MatrixForm

LowerTriangularMatrixQ[mat32]

Test if matrices have nonzero entries starting from a particular superdiagonal:

LowerTriangularMatrixQ[{{a,b,c},{d,e,f},{g,h,i}},1]

LowerTriangularMatrixQ[{{a,b,c},{d,e,f},{g,h,i}},2]

Test if matrices have nonzero entries starting from a particular subdiagonal:

LowerTriangularMatrixQ[{{0,0,0},{1,0,0},{2,3,0}},-1]

LowerTriangularMatrixQ[{{0,0,0},{1,0,0},{2,3,0}},-2]

The following matrix is lower triangular but not with respect to the first subdiagonal:

MatrixForm[{{1,0,0},{0,2,0},{4,0,3}}]

LowerTriangularMatrixQ[%,-1]

OpenersExampleSection2(Spacer1)Options  (1)

OpenersExampleSubsection0(Spacer1)Tolerance  (1)

This matrix is not lower triangular:

m={{1.,10^-12,0},{2.,3.,10^-13},{4.,5.,6.}};
LowerTriangularMatrixQ[m]

Add the (RefLink[Tolerance, paclet:ref/Tolerance]) option to consider numbers smaller than (10^(-12)) to be zero:

LowerTriangularMatrixQ[m,Tolerance->10^-12]

OpenersExampleSection3(Spacer1)Applications  (2)

(RefLink[LUDecomposition, paclet:ref/LUDecomposition]) decomposes a matrix as a product of upper- and lower-triangular matrices, returned as a triple {lu,perm,cond}:

{lu,perm,cond}=LUDecomposition[{{10,1,4},{2,1,6},{1,8,6}}];

Form the canonical matrices l and u from the composite matrix lu:

l=LowerTriangularize[lu,-1] + IdentityMatrix[3];
u=UpperTriangularize[lu];

Display the three matrices:

MatrixForm/@{lu,l,u}

Verify that l and u are lower and upper triangular, respectively:

{LowerTriangularMatrixQ[l],UpperTriangularMatrixQ[u]}

Reconstruct the original matrix as a permutation of the product of l and u:

Permute[l.u,perm]

(RefLink[JordanDecomposition, paclet:ref/JordanDecomposition]) relates any matrix to an upper-triangular matrix via a similarity transformation m==s.j.(Inverse[s]):

m={{1,0,0,0},{0,1,0,0},{1,-1,1,0},{1,-1,1,1}};
{s,j}=JordanDecomposition[m];

Visualize the three matrices:

MatrixForm/@{m,j,s}

Verify that the Jordan matrix is upper triangular and similar to the original matrix:

{UpperTriangularMatrixQ[j],m==s.j.Inverse[s]}

The matrix m is diagonalizable iff its Jordan matrix j is also lower triangular:

{LowerTriangularMatrixQ[j],DiagonalizableMatrixQ[m]}

OpenersExampleSection4(Spacer1)Properties & Relations  (9)

(RefLink[LowerTriangularMatrixQ, paclet:ref/LowerTriangularMatrixQ]) returns (RefLink[False, paclet:ref/False]) for inputs that are not matrices:

LowerTriangularMatrixQ[1]

LowerTriangularMatrixQ[{}]

Matrices of dimensions {n,0} are lower triangular:

LowerTriangularMatrixQ[{{},{}}]

(RefLink[LowerTriangularize, paclet:ref/LowerTriangularize]) returns matrices that are (RefLink[LowerTriangularMatrixQ, paclet:ref/LowerTriangularMatrixQ]):

LowerTriangularMatrixQ[LowerTriangularize[{{a,b},{c,d}}]]

The inverse of a lower-triangular matrix is lower triangular:

mat=LowerTriangularize[RandomInteger[{1,10},{5,5}]];

LowerTriangularMatrixQ[Inverse[mat]]

This extends to arbitrary powers and functions:

LowerTriangularMatrixQ[MatrixPower[mat,n]]

LowerTriangularMatrixQ[MatrixFunction[f,mat]]

The product of two (or more) lower-triangular matrices is lower triangular:

m1=LowerTriangularize[RandomReal[1.,{5,5}]];
m2=LowerTriangularize[RandomReal[1.,{5,5}]];

LowerTriangularMatrixQ[m1.m2]

The determinant of a triangular matrix equals the product of the diagonal entries:

m=LowerTriangularize[RandomReal[1.,{5,5}]];

LowerTriangularMatrixQ[m]

Det[m]==Apply[Times,Diagonal[m]]

Eigenvalues of a triangular matrix equal its diagonal elements:

m=LowerTriangularize[RandomReal[1.,{5,5}]];

LowerTriangularMatrixQ[m]

Eigenvalues[m]==Reverse@Sort@Diagonal[m]

(RefLink[LowerTriangularMatrixQ, paclet:ref/LowerTriangularMatrixQ])[m,0] is equivalent to (RefLink[LowerTriangularMatrixQ, paclet:ref/LowerTriangularMatrixQ])[m]:

{LowerTriangularMatrixQ[{{1,0},{0,2}}],LowerTriangularMatrixQ[{{1,0},{0,2}},0]}

{LowerTriangularMatrixQ[{{1,3},{4,2}}],LowerTriangularMatrixQ[{{1,3},{4,2}},0]}

A matrix is lower triangular starting at diagonal k iff its transpose is upper triangular starting at diagonal -k:

k=RandomInteger[{-2,2}];
m=LowerTriangularize[RandomReal[1.,{5,5}],k];

LowerTriangularMatrixQ[m,k]==UpperTriangularMatrixQ[Transpose[m],-k]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[LowerTriangularize, paclet:ref/LowerTriangularize])  ▪  (RefLink[UpperTriangularMatrixQ, paclet:ref/UpperTriangularMatrixQ])  ▪  (RefLink[DiagonalMatrixQ, paclet:ref/DiagonalMatrixQ])  ▪  (RefLink[Band, paclet:ref/Band])  ▪  (RefLink[LUDecomposition, paclet:ref/LUDecomposition])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Vectors and Matrices, paclet:tutorial/VectorsAndMatrices])}, {▪(RefLinkPlain[Constructing Matrices, paclet:tutorial/ConstructingMatrices])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Matrix Predicates, paclet:guide/MatrixPredicates])}})}})