# Matrix ring

In abstract algebra, a matrix ring is a set of matrices with entries in a ring R that form a ring under matrix addition and matrix multiplication. The set of all n × n matrices with entries in R is a matrix ring denoted M$_n$(R) (alternative notations: Mat$_n$(R) and R$^{n×n}$). Some sets of infinite matrices form infinite matrix rings. A subring of a matrix ring is again a matrix ring. Over a rng, one can form matrix rngs.
When R is a commutative ring, the matrix ring M$_n$(R) is an associative algebra over R, and may be called a matrix algebra. In this setting, if M is a matrix and r is in R, then the matrix rM is the matrix M with each of its entries multiplied by r.

## Examples

* The set of all n × n square matrices over R, denoted M$_n$(R). This is sometimes called the "full ring of n-by-n matrices".
* The set of all upper triangular matrices over R.
* The set of all lower triangular matrices over R.
* The set of all diagonal matrices over R. This subalgebra of M$_n$(R) is isomorphic to the direct product of n copies of R.
* For any index set I, the ring of endomorphisms of the right R-module M=⨁$_{i∈I}$R{\textstyle M=\bigoplus _{i\in I}R} is isomorphic to the ring $\mathbb {CFM} _{I}(R)$ of column finite matrices whose entries are indexed by I × I and whose columns each contain only finitely many nonzero entries. The ring of endomorphisms of M considered as a left R-module is isomorphic to the ring $\mathbb {RFM} _{I}(R)$ of row finite matrices.
* If R is a Banach algebra, then the condition of row or column finiteness in the previous point can be relaxed. With the norm in place, absolutely convergent series can be used instead of finite sums. For example, the matrices whose column sums are absolutely convergent sequences form a ring. Analogously of course, the matrices whose row sums are absolutely convergent series also form a ring. This idea can be used to represent operators on Hilbert spaces, for example.
* The intersection of the row-finite and column-finite matrix rings forms a ring $\mathbb {RCFM} _{I}(R)$.
* If R is commutative, then M$_n$(R) has a structure of a *-algebra over R, where the involution * on M$_n$(R) is matrix transposition.
* If A is a C*-algebra, then M$_n$(A) is another C*-algebra. If A is non-unital, then M$_n$(A) is also non-unital. By the Gelfand–Naimark theorem, there exists a Hilbert space H and an isometric *-isomorphism from A to a norm-closed subalgebra of the algebra B(H) of continuous operators; this identifies M$_n$(A) with a subalgebra of B(H$^{⊕n}$). For simplicity, if we further suppose that H is separable and A $\subseteq$ B(H) is a unital C*-algebra, we can break up A into a matrix ring over a smaller C*-algebra. One can do so by fixing a projection p and hence its orthogonal projection 1 − p; one can identify A with (pAppA(1−p)(1−p)Ap(1−p)A(1−p)){\textstyle {\begin{pmatrix}pAp&pA(1-p)\\(1-p)Ap&(1-p)A(1-p)\end{pmatrix}}}, where matrix multiplication works as intended because of the orthogonality of the projections. In order to identify A with a matrix ring over a C*-algebra, we require that p and 1 − p have the same "rank"; more precisely, we need that p and 1 − p are Murray–von Neumann equivalent, i.e., there exists a partial isometry u such that p = uu* and 1 − p = u*u. One can easily generalize this to matrices of larger sizes.
* Complex matrix algebras M$_n$(C) are, up to isomorphism, the only finite-dimensional simple associative algebras over the field C of complex numbers. Prior to the invention of matrix algebras, Hamilton in 1853 introduced a ring, whose elements he called biquaternions and modern authors would call tensors in C ⊗$_R$ H, that was later shown to be isomorphic to M$_2$(C). One basis of M$_2$(C) consists of the four matrix units (matrices with one 1 and all other entries 0); another basis is given by the identity matrix and the three Pauli matrices.
* A matrix ring over a field is a Frobenius algebra, with Frobenius form given by the trace of the product: σ(A, B) = tr(AB).

## Structure

* The matrix ring M$_n$(R) can be identified with the ring of endomorphisms of the free right R-module of rank n; that is, M$_n$(R) ≅ End$_R$(R$^n$). Matrix multiplication corresponds to composition of endomorphisms.
* The ring M$_n$(D) over a division ring D is an Artinian simple ring, a special type of semisimple ring. The rings $\mathbb {CFM} _{I}(D)$ and $\mathbb {RFM} _{I}(D)$ are not simple and not Artinian if the set I is infinite, but they are still full linear rings.
* The Artin–Wedderburn theorem states that every semisimple ring is isomorphic to a finite direct product ∏$_{i=1}$$^r$M$_{ni}$⁡(D$_i$){\textstyle \prod _{i=1}^{r}\operatorname {M} _{n_{i}}(D_{i})}, for some nonnegative integer r, positive integers n$_i$, and division rings D$_i$.
* When we view M$_n$(C) as the ring of linear endomorphisms of C$^n$, those matrices which vanish on a given subspace V form a left ideal. Conversely, for a given left ideal I of M$_n$(C) the intersection of null spaces of all matrices in I gives a subspace of C$^n$. Under this construction, the left ideals of M$_n$(C) are in bijection with the subspaces of C$^n$.
* There is a bijection between the two-sided ideals of M$_n$(R) and the two-sided ideals of R. Namely, for each ideal I of R, the set of all n × n matrices with entries in I is an ideal of M$_n$(R), and each ideal of M$_n$(R) arises in this way. This implies that M$_n$(R) is simple if and only if R is simple. For n ≥ 2, not every left ideal or right ideal of M$_n$(R) arises by the previous construction from a left ideal or a right ideal in R. For example, the set of matrices whose columns with indices 2 through n are all zero forms a left ideal in M$_n$(R).
* The previous ideal correspondence actually arises from the fact that the rings R and M$_n$(R) are Morita equivalent. Roughly speaking, this means that the category of left R-modules and the category of left M$_n$(R)-modules are very similar. Because of this, there is a natural bijective correspondence between the isomorphism classes of left R-modules and left M$_n$(R)-modules, and between the isomorphism classes of left ideals of R and left ideals of M$_n$(R). Identical statements hold for right modules and right ideals. Through Morita equivalence, M$_n$(R) inherits any Morita-invariant properties of R, such as being simple, Artinian, Noetherian, prime.

## Properties

* If S is a subring of R, then M$_n$(S) is a subring of M$_n$(R). For example, M$_n$(Z) is a subring of M$_n$(Q).
* The matrix ring M$_n$(R) is commutative if and only if n = 0, R = 0, or R is commutative and n = 1. In fact, this is true also for the subring of upper triangular matrices. Here is an example showing two upper triangular 2 × 2 matrices that do not commute, assuming 1 ≠ 0 in R:
       ${\begin{bmatrix}1&0\\0&0\end{bmatrix}}{\begin{bmatrix}1&1\\0&0\end{bmatrix}}={\begin{bmatrix}1&1\\0&0\end{bmatrix}}$
    and
       ${\begin{bmatrix}1&1\\0&0\end{bmatrix}}{\begin{bmatrix}1&0\\0&0\end{bmatrix}}={\begin{bmatrix}1&0\\0&0\end{bmatrix}}.$
* For n ≥ 2, the matrix ring M$_n$(R) over a nonzero ring has zero divisors and nilpotent elements; the same holds for the ring of upper triangular matrices. An example in 2 × 2 matrices would be
       ${\begin{bmatrix}0&1\\0&0\end{bmatrix}}{\begin{bmatrix}0&1\\0&0\end{bmatrix}}={\begin{bmatrix}0&0\\0&0\end{bmatrix}}.$
* The center of M$_n$(R) consists of the scalar multiples of the identity matrix, I$_n$, in which the scalar belongs to the center of R.
* The unit group of M$_n$(R), consisting of the invertible matrices under multiplication, is denoted GL$_n$(R).
* If F is a field, then for any two matrices A and B in M$_n$(F), the equality AB = I$_n$ implies BA = I$_n$. This is not true for every ring R though. A ring R whose matrix rings all have the mentioned property is known as a stably finite ring (Lam 1999, p. 5).

## Matrix semiring

In fact, R needs to be only a semiring for M$_n$(R) to be defined. In this case, M$_n$(R) is a semiring, called the matrix semiring. Similarly, if R is a commutative semiring, then M$_n$(R) is a matrix semialgebra.
For example, if R is the Boolean semiring (the two-element Boolean algebra R = {0, 1} with 1 + 1 = 1), then M$_n$(R) is the semiring of binary relations on an n-element set with union as addition, composition of relations as multiplication, the empty relation (zero matrix) as the zero, and the identity relation (identity matrix) as the unity.