(* Right scaling associativity requires a commutative ring *)

(* Specifications: *)
Lemma rowE m n i (A : 'M_(m, n)) : row i A = delta_mx 0 i *m A.
Lemma row_mul m n p (i : 'I_m) A (B : 'M_(n, p)) :
row i (A *m B) = row i A *m B.
Lemma mul_delta_mx_cond m n p (j1 j2 : 'I_n) (i1 : 'I_m) (k2 : 'I_p) :
delta_mx i1 j1 *m delta_mx j2 k2 = delta_mx i1 k2 *+ (j1 == j2).
Lemma mul_delta_mx m n p (j : 'I_n) (i : 'I_m) (k : 'I_p) :
delta_mx i j *m delta_mx j k = delta_mx i k.
Lemma mul_mx_diag m n (A : 'M_(m, n)) d :
A *m diag_mx d = \matrix_(i, j) (A i j * d 0 j).
Lemma mulmx_diag n (d e : 'rV_n) :
diag_mx d *m diag_mx e = diag_mx (\row_j (d 0 j * e 0 j)).
Lemma scalar_mxM n a b : (a * b)%:M = a%:M *m b%:M :> 'M_n.
Lemma mul_col_perm m n p s (A : 'M_(m, n)) (B : 'M_(n, p)) :
col_perm s A *m B = A *m row_perm s^-1 B.
Lemma mul_row_perm m n p s (A : 'M_(m, n)) (B : 'M_(n, p)) :
A *m row_perm s B = col_perm s^-1 A *m B.
Lemma xcolE m n j1 j2 (A : 'M_(m, n)) : xcol j1 j2 A = A *m tperm_mx j1 j2.
Lemma is_perm_mx_tr n (A : 'M_n) : is_perm_mx A^T = is_perm_mx A.
Lemma is_perm_mxMr n (A B : 'M_n) :
is_perm_mx B -> is_perm_mx (A *m B) = is_perm_mx A.