Matrix

Basis
Last updated: Tags: Linear Algebra

Whenever you need to store, transform, or transmit structured data — a grayscale image, a system of prices, the forces acting on a structure — you are almost certainly using a matrix. Matrices are the computational workhorse of linear algebra: they make abstract ideas concrete and give you something you can actually calculate with.

What is a matrix?

An m×nm \times n matrix over a field FF is a rectangular array with mm rows and nn columns whose entries come from FF. You write it as:

A=(a11a12a1na21a22a2nam1am2amn)A = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix}

The entry in row ii and column jj is called aija_{ij}, or equivalently (A)ij(A)_{ij}. The pair (m,n)(m, n) is the shape (or dimensions) of the matrix. When m=nm = n the matrix is called a square matrix of order nn.

Two matrices are equal if and only if they have the same shape and every corresponding entry is equal.

Special cases: vectors as matrices

A column vector is an m×1m \times 1 matrix — a single column of mm entries. A row vector is a 1×n1 \times n matrix — a single row of nn entries. You have already seen column vectors as elements of FmF^m in the prerequisite on vector spaces; a matrix is just a side-by-side arrangement of several such columns (or, if you prefer, a stacked arrangement of several rows).

Adding matrices and scaling them

Matrix addition is defined entry-wise. If AA and BB are both m×nm \times n matrices then their sum A+BA + B is the m×nm \times n matrix with

(A+B)ij=aij+bij.(A + B)_{ij} = a_{ij} + b_{ij}.

You simply add corresponding entries. If AA and BB have different shapes, their sum is not defined.

Scalar multiplication by cFc \in F scales every entry:

(cA)ij=caij.(cA)_{ij} = c \cdot a_{ij}.

These two operations are exactly the pointwise operations you would perform on the individual entries, extended to the whole array simultaneously.

The vector space of matrices

Because addition and scalar multiplication act entry-by-entry, the set of all m×nm \times n matrices over FF — written Mm,n(F)M_{m,n}(F) — inherits the full structure of a vector space. The zero matrix OO (all entries equal to zero) plays the role of the zero vector, and every axiom (associativity, distributivity, etc.) follows immediately from the corresponding axiom in FF.

This means you can do everything to matrices that you can do to vectors: take linear combinations, talk about linear independence, span, and bases. In fact, the mnmn matrices EijE_{ij} that have a 11 in position (i,j)(i,j) and zeros everywhere else form a basis of Mm,n(F)M_{m,n}(F), so dimMm,n(F)=mn\dim M_{m,n}(F) = mn.

The transpose

The transpose of a matrix AMm,n(F)A \in M_{m,n}(F) is the matrix AMn,m(F)A^\top \in M_{n,m}(F) whose (i,j)(i,j) entry is

(A)ij=aji.(A^\top)_{ij} = a_{ji}.

In plain language: you flip the matrix across its main diagonal, turning rows into columns and columns into rows. For example:

(123456)=(142536).\begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}^\top = \begin{pmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{pmatrix}.

Transposition satisfies (A)=A(A^\top)^\top = A and (A+B)=A+B(A + B)^\top = A^\top + B^\top. A square matrix with A=AA^\top = A is called symmetric.

The identity matrix

The identity matrix InI_n is the square n×nn \times n matrix with 11s on the main diagonal and 00s everywhere else:

In=(100010001).I_n = \begin{pmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{pmatrix}.

Its entry at position (i,j)(i,j) is the Kronecker delta δij\delta_{ij}, which equals 11 if i=ji = j and 00 otherwise. When you multiply any conformable matrix by InI_n, the matrix is unchanged — the identity matrix acts as the multiplicative identity for matrix multiplication, which is developed in Linear Map.

Matrices as encodings of linear maps

A matrix is not just a storage format. As you will see in Linear Map, every matrix AMm,n(F)A \in M_{m,n}(F) encodes a specific linear function from FnF^n to FmF^m, and every linear function between finite-dimensional spaces can be written as a matrix once you fix bases. This connection is the reason matrices are so central to linear algebra.

Summary

  • An m×nm \times n matrix over FF is a rectangular array of entries aijFa_{ij} \in F.
  • Column vectors and row vectors are the special cases m×1m \times 1 and 1×n1 \times n.
  • Matrix addition and scalar multiplication work entry-wise; together they make Mm,n(F)M_{m,n}(F) a vector space of dimension mnmn.
  • The transpose AA^\top swaps rows and columns: (A)ij=aji(A^\top)_{ij} = a_{ji}.
  • The identity matrix InI_n has 11s on the diagonal and acts as a multiplicative identity.
  • Matrices encode linear maps — the connection is made precise in Linear Map.