Section StructuralLinear.
Canonical diag_mx_additive n := Additive (@diag_mx_is_linear n).
Canonical diag_mx_linear n := Linear (@diag_mx_is_linear n).

Lemma diag_mxP n (A : 'M[R]_n) :
reflect (exists d : 'rV_n, A = diag_mx d) (is_diag_mx A).