MAINT: add assertions of upper triangular matrix invariants