Canonical matrix_countRingType (R : countRingType) n :=
[countRingType of 'M[R]_n.+1].
Canonical matrix_finLmodType (R : finRingType) m n :=
[finLmodType R of 'M[R]_(m, n)].
Canonical matrix_finRingType (R : finRingType) n' :=
Eval hnf in [finRingType of 'M[R]_n'.+1].
Canonical matrix_finLalgType (R : finRingType) n' :=
[finLalgType R of 'M[R]_n'.+1].
(* Parametricity over the algebra structure. *)
Section MapRingMatrix.
Variables (aR rR : ringType) (f : {rmorphism aR -> rR}).
Local Notation "A ^f" := (map_mx f A) : ring_scope.
Section FixedSize.
Variables m n p : nat.
Implicit Type A : 'M[aR]_(m, n).

Lemma map_mxZ a A : (a *: A)^f = f a *: A^f.