Evanalysis
6.7Estimated reading time: 9 min

6.7 Matrix subspaces, basis, and dimension

Extend span, basis, and dimension from column-vector subspaces to matrix subspaces such as all matrices, upper triangular matrices, and skew-symmetric matrices.

Course contents

MATH1030: Linear algebra I

Linear algebra notes.

So far, most basis and dimension examples have used column vectors. But the same ideas apply to matrices because matrices can be added and scaled. A matrix can be a "vector" inside a vector space whose elements are matrices.

This note explains how to read basis and dimension for subspaces of Mm,n(R)M_{m,n}(R), the vector space of all real m×nm \times n matrices.

Matrices as vectors

The operations are ordinary matrix addition and scalar multiplication:

A+B,αA.A+B,\qquad \alpha A.

These operations keep the size fixed. If AA and BB are both m×nm \times n, then every linear combination

αA+βB\alpha A+\beta B

is again an m×nm \times n matrix.

Definition

Matrix span

If A1,,AqA_1,\dots,A_q are m×nm \times n matrices, then

Span{A1,,Aq}={c1A1++cqAq:c1,,cqR}.\operatorname{Span}\{A_1,\dots,A_q\} = \{c_1A_1+\cdots+c_qA_q : c_1,\dots,c_q\in R\}.

This is a subspace of Mm,n(R)M_{m,n}(R) for the same reason that the span of vectors is a subspace: sums and scalar multiples of linear combinations remain linear combinations.

The standard matrix units

For each position (i,j), define EijE_{ij} to be the matrix with 1 in the (i,j) position and 0 everywhere else.

For example, a basis of M2,2(R)M_{2,2}(R) is

E11=[1000],E12=[0100],E21=[0010],E22=[0001].E_{11}= \begin{bmatrix}1&0\\0&0\end{bmatrix}, \quad E_{12}= \begin{bmatrix}0&1\\0&0\end{bmatrix}, \quad E_{21}= \begin{bmatrix}0&0\\1&0\end{bmatrix}, \quad E_{22}= \begin{bmatrix}0&0\\0&1\end{bmatrix}.

Every 2×22 \times 2 matrix decomposes uniquely as

[abcd]=aE11+bE12+cE21+dE22.\begin{bmatrix}a&b\\c&d\end{bmatrix} =aE_{11}+bE_{12}+cE_{21}+dE_{22}.

Theorem

Dimension of full matrix space

The space Mm,n(R)M_{m,n}(R) has basis

{Eij:1im, 1jn}\{E_{ij}:1\le i\le m,\ 1\le j\le n\}

and therefore

dimMm,n(R)=mn.\dim M_{m,n}(R)=mn.

The number mn is not mysterious. It is the number of independent entry positions in an m×nm \times n matrix.

Upper triangular matrices

Some matrix subspaces are defined by forcing certain entries to be zero.

Definition

Upper triangular matrix subspace

Let UTn(R)UT_n(R) be the set of all n×nn \times n upper triangular matrices:

UTn(R)={A=[aij]Mn,n(R):aij=0 whenever i>j}.UT_n(R)=\{A=[a_{ij}]\in M_{n,n}(R): a_{ij}=0\text{ whenever }i>j\}.

Only entries on or above the diagonal are free. Therefore a basis is given by the matrix units EijE_{ij} with iji\le j.

For UT3(R)UT_3(R), a basis is

E11,E12,E13,E22,E23,E33.E_{11},E_{12},E_{13},E_{22},E_{23},E_{33}.

Thus

dimUT3(R)=6.\dim UT_3(R)=6.

In general,

dimUTn(R)=1+2++n=n(n+1)2.\dim UT_n(R)=1+2+\cdots+n=\frac{n(n+1)}2.

Skew-symmetric matrices

Another important subspace is defined by an equation involving transpose.

Definition

Skew-symmetric matrices

A square matrix AA is skew-symmetric if

AT=A.A^T=-A.

Let Skewn(R)Skew_n(R) be the set of all n×nn \times n skew-symmetric real matrices.

The diagonal entries of a skew-symmetric matrix must be zero, because aii=aiia_{ii}=-a_{ii} implies aii=0a_{ii}=0. Entries above the diagonal determine the entries below the diagonal with opposite sign.

For n=3n=3, every skew-symmetric matrix has the form

[0aba0cbc0].\begin{bmatrix} 0&a&b\\ -a&0&c\\ -b&-c&0 \end{bmatrix}.

So a basis of Skew3(R)Skew_3(R) is

E12E21,E13E31,E23E32,E_{12}-E_{21},\qquad E_{13}-E_{31},\qquad E_{23}-E_{32},

and

dimSkew3(R)=3.\dim Skew_3(R)=3.

In general,

dimSkewn(R)=n(n1)2.\dim Skew_n(R)=\frac{n(n-1)}2.

A dictionary between matrices and long column vectors

One reason matrix subspaces behave like vector subspaces is that a matrix can be turned into a long column vector by stacking its columns. For example,

[abcd][acbd].\begin{bmatrix} a&b\\ c&d \end{bmatrix} \quad\longleftrightarrow\quad \begin{bmatrix} a\\c\\b\\d \end{bmatrix}.

This conversion is only a bookkeeping device, but it explains why the same linear-combination, independence, basis, and dimension theorems transfer to matrix spaces. Linear relations among matrices become linear relations among their stacked coordinate vectors.

Worked example: symmetric 2×22 \times 2 matrices

Let Sym2(R)Sym_2(R) be the set of symmetric 2×22 \times 2 matrices. A general element has the form

[abbc].\begin{bmatrix} a&b\\ b&c \end{bmatrix}.

Therefore

[abbc]=a[1000]+b[0110]+c[0001].\begin{bmatrix} a&b\\ b&c \end{bmatrix} = a\begin{bmatrix}1&0\\0&0\end{bmatrix} +b\begin{bmatrix}0&1\\1&0\end{bmatrix} +c\begin{bmatrix}0&0\\0&1\end{bmatrix}.

The three matrices

[1000],[0110],[0001]\begin{bmatrix}1&0\\0&0\end{bmatrix}, \qquad \begin{bmatrix}0&1\\1&0\end{bmatrix}, \qquad \begin{bmatrix}0&0\\0&1\end{bmatrix}

span Sym2(R)Sym_2(R).

They are linearly independent because

α[1000]+β[0110]+γ[0001]=[0000]\alpha\begin{bmatrix}1&0\\0&0\end{bmatrix} +\beta\begin{bmatrix}0&1\\1&0\end{bmatrix} +\gamma\begin{bmatrix}0&0\\0&1\end{bmatrix} = \begin{bmatrix}0&0\\0&0\end{bmatrix}

forces α=0\alpha=0, β=0\beta=0, and γ=0\gamma=0 by comparing entries. Thus they form a basis and

dimSym2(R)=3.\dim Sym_2(R)=3.

Problem-solving routine

When a problem asks for a basis of a matrix subspace:

  1. write a general matrix in the subspace;
  2. identify the free parameters;
  3. split the matrix into one parameter times one fixed matrix, plus another parameter times another fixed matrix, and so on;
  4. use the fixed matrices as a candidate basis;
  5. check independence by comparing entries.

This is the matrix-space version of parameterizing a solution set and reading off the direction vectors.

Common mistakes

Common mistake

Counting all entries when some entries are constrained

M3,3(R)M_{3,3}(R) has dimension 9, but UT3(R)UT_3(R) has dimension 6 and Skew3(R)Skew_3(R) has dimension 3. The dimension counts free parameters, not merely the size of the matrix.

Common mistake

Forgetting that matrices in a linear combination must have the same size

Matrix addition is entrywise. Therefore a span such as Span{A1,A2}\operatorname{Span}\{A_1,A_2\} only makes sense when the matrices have the same size.

Quick checks

Quick check

What is the dimension of M2,3(R)M_{2,3}(R)?

Count independent entry positions.

Solution

Answer

Quick check

Why does every skew-symmetric matrix have zero diagonal entries?

Use the equation AT=AA^T=-A at the (i,i) entry.

Solution

Answer

Exercises

Quick check

Find a basis and dimension for the subspace of diagonal 3×33 \times 3 matrices.

Write a general diagonal matrix first.

Solution

Guided solution

Read this first

This note uses 6.5 Basis and dimension and 3.2 Transpose and special matrices.

Section mastery checkpoint

Answer each question correctly to complete this section checkpoint. Correct progress: 0%.

Skills: matrix-space, basis, dimension

Fill in the blank: the dimension of the full matrix space M2,2M_{2,2} is ____.

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Skills: skew-symmetric-matrix, matrix-subspace, dimension

What is the dimension of the subspace of 3 x 3 skew-symmetric matrices?

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Key terms in this unit