ConceptComplete

Matrix Operations

Matrices are the computational backbone of linear algebra. Every linear map between finite-dimensional spaces can be represented as a matrix, and matrix operations correspond to operations on linear maps.


Definitions

Definition3.1Matrix

An m×nm \times n matrix over a field FF is a rectangular array A=(aij)A = (a_{ij}) with mm rows and nn columns, where aijFa_{ij} \in F. The entry in row ii and column jj is denoted aija_{ij} or AijA_{ij} or (A)ij(A)_{ij}.

Definition3.2Matrix addition and scalar multiplication

For A,BMm×n(F)A, B \in M_{m \times n}(F) and cFc \in F:

(A+B)ij=aij+bij,(cA)ij=caij.(A + B)_{ij} = a_{ij} + b_{ij}, \quad (cA)_{ij} = c \cdot a_{ij}.

With these operations, Mm×n(F)M_{m \times n}(F) is a vector space of dimension mnmn.

Definition3.3Matrix multiplication

For AMm×n(F)A \in M_{m \times n}(F) and BMn×p(F)B \in M_{n \times p}(F), the product ABMm×p(F)AB \in M_{m \times p}(F) is defined by

(AB)ij=k=1naikbkj.(AB)_{ij} = \sum_{k=1}^{n} a_{ik} b_{kj}.

The (i,j)(i, j) entry of ABAB is the dot product of the ii-th row of AA with the jj-th column of BB.


Examples

ExampleProduct of 2 x 2 matrices

(1234)(5678)=(15+2716+2835+4736+48)=(19224350).\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} = \begin{pmatrix} 1 \cdot 5 + 2 \cdot 7 & 1 \cdot 6 + 2 \cdot 8 \\ 3 \cdot 5 + 4 \cdot 7 & 3 \cdot 6 + 4 \cdot 8 \end{pmatrix} = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}.

ExampleMatrix multiplication is not commutative

AB=(1000)(0100)=(0100),BA=(0100)(1000)=(0000).AB = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}, \quad BA = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}.

ABBAAB \neq BA. In fact, AB0AB \neq 0 but BA=0BA = 0: the product of two nonzero matrices can be zero.

ExampleMatrix-vector product

(123456)(xyz)=(x+2y+3z4x+5y+6z)=x(14)+y(25)+z(36).\begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} x + 2y + 3z \\ 4x + 5y + 6z \end{pmatrix} = x\begin{pmatrix} 1 \\ 4 \end{pmatrix} + y\begin{pmatrix} 2 \\ 5 \end{pmatrix} + z\begin{pmatrix} 3 \\ 6 \end{pmatrix}.

AxAx is a linear combination of the columns of AA with coefficients from xx. This is the column picture of matrix-vector multiplication.

ExampleIdentity matrix

The n×nn \times n identity matrix InI_n has 11's on the diagonal and 00's elsewhere: (In)ij=δij(I_n)_{ij} = \delta_{ij} (the Kronecker delta). For any AMm×n(F)A \in M_{m \times n}(F):

ImA=A=AIn.I_m A = A = A I_n.

ExampleDiagonal matrices multiply componentwise

If D1=diag(d1,,dn)D_1 = \text{diag}(d_1, \ldots, d_n) and D2=diag(e1,,en)D_2 = \text{diag}(e_1, \ldots, e_n), then

D1D2=diag(d1e1,,dnen).D_1 D_2 = \text{diag}(d_1 e_1, \ldots, d_n e_n).

Diagonal matrices always commute with each other.

ExampleMatrix powers

For a square matrix AA, Ak=AAAk timesA^k = \underbrace{A \cdot A \cdots A}_{k \text{ times}} and A0=IA^0 = I.

(1101)n=(1n01)\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}^n = \begin{pmatrix} 1 & n \\ 0 & 1 \end{pmatrix}

(proved by induction).

ExampleNilpotent matrix

N=(0100)N = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} satisfies N2=0N^2 = 0. A matrix NN with Nk=0N^k = 0 for some kk is called nilpotent. The smallest such kk is the index of nilpotency.

ExampleIdempotent matrix

P=(1000)P = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} satisfies P2=PP^2 = P. Such a matrix is called idempotent and represents a projection.

ExampleBlock multiplication

Block (partitioned) matrices can be multiplied "as if blocks were scalars," provided dimensions match:

(A11A12A21A22)(B11B12B21B22)=(A11B11+A12B21A11B12+A12B22A21B11+A22B21A21B12+A22B22).\begin{pmatrix} A_{11} & A_{12} \\ A_{21} & A_{22} \end{pmatrix}\begin{pmatrix} B_{11} & B_{12} \\ B_{21} & B_{22} \end{pmatrix} = \begin{pmatrix} A_{11}B_{11} + A_{12}B_{21} & A_{11}B_{12} + A_{12}B_{22} \\ A_{21}B_{11} + A_{22}B_{21} & A_{21}B_{12} + A_{22}B_{22} \end{pmatrix}.

ExampleOuter product

For column vectors uFmu \in F^m and vFnv \in F^n, the outer product uvTuv^T is an m×nm \times n matrix of rank at most 1:

(uvT)ij=uivj.(uv^T)_{ij} = u_i v_j.

Every rank-1 matrix has this form.

ExampleTranspose properties

For the transpose ATA^T (with (AT)ij=aji(A^T)_{ij} = a_{ji}):

  • (A+B)T=AT+BT(A + B)^T = A^T + B^T
  • (cA)T=cAT(cA)^T = cA^T
  • (AB)T=BTAT(AB)^T = B^T A^T (order reverses)
  • (AT)T=A(A^T)^T = A
ExampleMatrix product = composition of linear maps

If T:FpFnT : F^p \to F^n has matrix AA and S:FnFmS : F^n \to F^m has matrix BB, then ST:FpFmS \circ T : F^p \to F^m has matrix BABA. Matrix multiplication is composition.


Matrix representation of linear maps

Definition3.4Matrix of a linear transformation

Let T:VWT : V \to W be linear, β={v1,,vn}\beta = \{v_1, \ldots, v_n\} a basis for VV, and γ={w1,,wm}\gamma = \{w_1, \ldots, w_m\} a basis for WW. The matrix of TT with respect to β\beta and γ\gamma is the m×nm \times n matrix [T]βγ[T]_\beta^\gamma whose jj-th column is [T(vj)]γ[T(v_j)]_\gamma, the coordinate vector of T(vj)T(v_j) with respect to γ\gamma.

ExampleMatrix representation example

T:R2R3T : \mathbb{R}^2 \to \mathbb{R}^3, T(x,y)=(x+y,xy,2x)T(x, y) = (x + y, x - y, 2x), with standard bases.

T(e1)=(1,1,2)T(e_1) = (1, 1, 2) and T(e2)=(1,1,0)T(e_2) = (1, -1, 0), so [T]=(111120)[T] = \begin{pmatrix} 1 & 1 \\ 1 & -1 \\ 2 & 0 \end{pmatrix}.

RemarkChange of basis

If QQ is the change-of-basis matrix from β\beta' to β\beta and PP is the change-of-basis matrix from γ\gamma to γ\gamma', then

[T]βγ=P[T]βγQ.[T]_{\beta'}^{\gamma'} = P [T]_\beta^\gamma Q.

For a linear operator T:VVT : V \to V with two bases β\beta and β\beta' related by QQ:

[T]β=Q1[T]βQ.[T]_{\beta'} = Q^{-1} [T]_\beta Q.

Matrices related by B=Q1AQB = Q^{-1}AQ are called similar and represent the same linear operator in different bases.

RemarkLooking ahead

The question of finding the "simplest" matrix for a given linear operator (via a good choice of basis) leads to eigenvalues, diagonalization, and ultimately Jordan normal form.