         }
     }
     
-    var inverse: Matrix<n, n, R>? {
+    public var isInvertible: Bool {
+        return determinant.isInvertible
+    }
+    
+    public var inverse: Matrix<n, n, R>? {
         switch rows {
         case 0: return .identity
         case 1: return self[0, 0].inverse.flatMap{ Matrix($0) }

        return DPermutation.allPermutations(ofLength: rows).sum { s in
            let e = R(from: s.signature)
            let term = (0 ..< rows).multiply { i in self[i, s[i]] }
            print("\t", e, term)
            return e * term
        }
    }
}

public extension Matrix where n == m, n == _1 {
    var asScalar: R {
        return self[0, 0]
    }
}

public extension Matrix where n == m, n: StaticSizeType, R: EuclideanRing {
    var determinant: R {
        switch rows {
        case 0: return .identity
        case 1: return self[0, 0]

        fatalError("matrix-inverse not yet supported for a general ring.")
    }
    
    public func pow(_ n: 𝐙) -> SquareMatrix<n, R> {
        assert(n >= 0)
        return (0 ..< n).reduce(.identity){ (res, _) in self * res }
