# Predicates

The functions in this section test various properties of sparse matrices.

## `A eq B: MtrxSprs, MtrxSprs -> BoolElt`

Given sparse matrices $A$ and $B$, return `true` if and only if $A$ and $B$ are equal.

## `IsZero(A): MtrxSprs -> BoolElt`

Given an $m \times n$ sparse matrix $A$ over the ring $R$, return `true` iff $A$ is the $m \times n$ zero sparse matrix.

## `IsOne(A): MtrxSprs -> BoolElt`

Given a square $m \times m$ sparse matrix $A$ over the ring $R$, return `true` iff $A$ is the $m \times m$ identity sparse matrix.

## `IsMinusOne(A): MtrxSprs -> BoolElt`

Given a square $m \times m$ sparse matrix $A$ over the ring $R$, return `true` iff $A$ is the negation of the $m \times m$ identity sparse matrix.

## `IsScalar(A): MtrxSprs -> BoolElt`

Given a square $m \times m$ sparse matrix $A$ over the ring $R$, return `true` iff $A$ is scalar, i.e., iff $A$ is the product of some element of $R$ and the $m \times m$ identity sparse matrix.

## `IsDiagonal(A): MtrxSprs -> BoolElt`

Given a square sparse matrix $A$ over the ring $R$, return `true` iff $A$ is diagonal, i.e., iff the only non-zero entries of $A$ are on the diagonal.

## `IsSymmetric(A): MtrxSprs -> BoolElt`

Given a square sparse matrix $A$ over the ring $R$, return `true` iff $A$ is symmetric, i.e., iff $A$ equals its transpose.

## `IsUpperTriangular(A): MtrxSprs -> BoolElt`

Given a sparse matrix $A$ over the ring $R$, return `true` iff $A$ is upper triangular, i.e., iff the only non-zero entries of $A$ are on or above the diagonal.

## `IsLowerTriangular(A): MtrxSprs -> BoolElt`

Given a sparse matrix $A$ over the ring $R$, return `true` iff $A$ is lower triangular, i.e., iff the only non-zero entries of $A$ are on or below the diagonal.
