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 , the vector space of all real matrices.
Matrices as vectors
The operations are ordinary matrix addition and scalar multiplication:
These operations keep the size fixed. If and are both , then every linear combination
is again an matrix.
Definition
Matrix span
If are matrices, then
This is a subspace of 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 to be the matrix with 1 in the
(i,j) position and 0 everywhere else.
For example, a basis of is
Every matrix decomposes uniquely as
Theorem
Dimension of full matrix space
The space has basis
and therefore
The number mn is not mysterious. It is the number of independent entry
positions in an matrix.
Upper triangular matrices
Some matrix subspaces are defined by forcing certain entries to be zero.
Definition
Upper triangular matrix subspace
Let be the set of all upper triangular matrices:
Only entries on or above the diagonal are free. Therefore a basis is given by the matrix units with .
For , a basis is
Thus
In general,
Skew-symmetric matrices
Another important subspace is defined by an equation involving transpose.
Definition
Skew-symmetric matrices
A square matrix is skew-symmetric if
Let be the set of all skew-symmetric real matrices.
The diagonal entries of a skew-symmetric matrix must be zero, because implies . Entries above the diagonal determine the entries below the diagonal with opposite sign.
For , every skew-symmetric matrix has the form
So a basis of is
and
In general,
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,
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 matrices
Let be the set of symmetric matrices. A general element has the form
Therefore
The three matrices
span .
They are linearly independent because
forces , , and by comparing entries. Thus they form a basis and
Problem-solving routine
When a problem asks for a basis of a matrix subspace:
- write a general matrix in the subspace;
- identify the free parameters;
- split the matrix into one parameter times one fixed matrix, plus another parameter times another fixed matrix, and so on;
- use the fixed matrices as a candidate basis;
- 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
has dimension 9, but has dimension 6 and
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 only makes sense when the matrices have the same size.
Quick checks
Quick check
What is the dimension of ?
Count independent entry positions.
Solution
Answer
Quick check
Why does every skew-symmetric matrix have zero diagonal entries?
Use the equation at the (i,i) entry.
Solution
Answer
Exercises
Quick check
Find a basis and dimension for the subspace of diagonal 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.