(* 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.

Lemma mx1_sum_delta : 1%:M = \sum_i delta_mx i i.