(* Scalar matrix : a diagonal matrix with a constant on the diagonal *)
Section ScalarMx.
Variable n : nat.
Fact scalar_mx_key : unit. Proof. by []. Qed.
Definition scalar_mx x : 'M[R]_n :=
\matrix[scalar_mx_key]_(i , j) (x *+ (i == j)).
Notation "x %:M" := (scalar_mx x) : ring_scope.

(* Specifications: *)
Lemma diag_const_mx a : diag_mx (const_mx a) = a%:M :> 'M_n.
Lemma mx1_sum_delta : 1%:M = \sum_i delta_mx i i.
Lemma scalar_mx_is_scalar a : is_scalar_mx a%:M.
Fact mulmx_key : unit. Proof. by []. Qed.