TITLE: Isomorphism between Endomorphisms of $R^n$ and $M_n(R^\mathrm{op})$
QUESTION [5 upvotes]: My professor said in class that if we consider $R^n$ as an $R$-module, we get a bijection from the $\operatorname{End}(R^n)$ to the set of $n\times n$ matrices since we can regard any such homomorphism as a linear map from the vector space defined by $R^n$ onto itself.
But what I don't get is the following, he said that this bijection is not a ring homomorphism, but there is a ring isomorphism between $\operatorname{End}(R^n)$ to $M_n(R^\mathrm{op})$ where $R^\mathrm{op}$ is the opposite ring.
I know why this is true for a trivial module $M$ over $R$ where $M = R$. However I fail to see how this is the case for $R^n$ since I can simply identify a homomorphism from $R^n$ onto itself with a matrix, can anyone explain the technical details for how the opposite ring comes into the picture?
Thanks.

REPLY [5 votes]: For any $R$ module $N$, $End(\oplus_{i=1}^n N)\cong M_n(End(N))$, where the endomorphisms are all $R$ linear.
If you consider $R^n$ as a right $R$ module then, its endomorphism ring is isomorphic to $M_n(End(R_R))=M_n(R)$ since $End(R_R)\cong R$.
But if you consider $R^n$ as a left $R$ module, then you get $M_n(End(_RR))$, and $End(_RR)\cong R^{op}$ instead of $R$.
I think you must be considering $R^n$ as a left $R$-module in class.