When solving a linear equation system
with equations
and unknowns, the coefficient matrix has rows and
columns (). We need to answer some questions:
- If the system has fewer equations than unknowns (), are there
infinite solutions?
- If the system has more equations than unknowns (), is there
no solution?
- Does the solution exist, i.e., can we find a solution so
that
holds?
- If a solution exists, is it unique? If it is not unique, how can
we find all solutions?
- If no solution exists, can we still find the optimal approximate
solution
so that the error
is minimized?
The fundamental theorem of linear algebra can reveal the structure
of the solutions of any given linear system
, and thereby
answer all questions above.
The coefficient matrix
can be
expressed in terms of either its M-D column vectors or its
N-D row vectors
:
|
(134) |
|
(135) |
where
and
are respectively the ith row vector and jth column vector (all vectors
are assumed to be vertical):
i.e. |
(136) |
In general a function can be represented by
, where
- is the
domain
of the function, the set of all input or argument values;
- the codomain
of the function, the set into which all outputs of the function
are constrained to fall;
- the set of for all is the
image
of the function, a subset of the codomain.
The matrix can be considered as a function, a linear
transformation
, which maps an N-D
vector
in the domain of the function
into an M-D vector
in the codomain of the function.
The fundamental theorem of linear algebra
concerns the following four subspaces associated with any
matrix with rank
(i.e.,
has independent columns and rows).
- The column space (image)
of is a space spanned by its M-D column vectors
(of which are independent):
|
(137) |
which is an R-D subspace of
composed of all possible
linear combinations of its column vectors:
|
(138) |
The column space
is the image of the linear
transformation
, and the equation
is solvable if and only if
.
The dimension of the column space is the rank of
,
.
- The row space
of (the column space of ) is a space spanned by
its N-D row vectors (of which are independent):
|
(139) |
which is an R-D subspace of
composed of all possible
linear combinations of its row vectors:
|
(140) |
The row space
is the image of the linear
transformation
, and the
equation
is solvable if and only if
.
As the rows and columns in are respectively the columns
and rows in , the row space of is the column
space of , and the column space of is the row
space of :
|
(141) |
The rank
is the number of linearly independent
rows and columns of , i.e., the row space and the column
space have the same dimension, both equal to the rank of :
|
(142) |
- The null space (kernel)
of , denoted by
, is the set of all N-D
vectors that satisfy the homogeneous equation
or |
(143) |
i.e.,
|
(144) |
In particular, when
, we get
,
i.e., the origin
is in the null space.
As
for any
and
, we see that the null space
and the row space
are orthogonal to each
other,
.
The dimension of the null space is called the nullity of
:
. The
rank-nullity theorem
states the sum of the rank and the nullity of an matrix
is equal to :
rank |
(145) |
We therefore see that
and
are two mutually
exclusive and complementary subspaces of
:
|
(146) |
i.e., they are
orthogonal complement
of each other, denoted by
|
(147) |
Any N-D vector
is in either of the two
subspaces
and
.
- The null space of (left null space of ,
denoted by
, is the set of all M-D vectors
that satisfy the homogeneous equation
or |
(148) |
i.e.,
|
(149) |
As all
are orthogonal to
,
is orthogonal to the column space
:
|
(150) |
We see that
and
are two mutually exclusive and
complementary subspaces of
:
|
|
|
|
|
i.e. |
|
(151) |
Any M-D vector
is in either of the two subspaces
and
.
The four subspaces are summarized in the figure below, showing the domain
(left) and the codomain
(right) of the linear mapping
, where
-
is the particular solution that is
mapped to
, the image of
;
-
is a homogeneous solution that is
mapped to
;
-
is the complete solution that is
mapped to
.
On the other hand,
,
, and
are
respectively the particular, homogeneous and complete solutions of
.
Here we have assumed
and
, i.e., both
and
are solvable. We will also consider
the case where
later.
Based on the rank
of any matrix ,
we can determine the dimensionalities of the four associated spaces and
the existence and uniqueness of solution of the system
:
- If ,
,
then
, unique solution exists;
- If ,
,
,
then
, infinite solutions exist;
- If ,
,
,
then unique solution exists if
,
but no solution otherwise;
- If
,
,
,
then infinite solutions exist if
,
but no solution otherwise.
We now consider specifically how to find the solutions of the system
in light of the four subspaces of defined
above, through the examples below.
Example 1:
Solve the homogeneous equation system:
|
(152) |
We first convert into the rref:
The
columns in the rref containing a single 1,
called a pivot, are called the pivot columns, and the
rows containing a pivot are called the pivot rows. Here,
, i.e., is a singular matrix. The two pivot
rows
and
can
be used as the basis vectors that span the row space
:
Note that the pivot columns of the rref do not span the column space
, as the row reduction operations do not preserve the
columns of . But they indicate the corresponding columns
and
in the original
matrix can be used as the basis that spans
.
In general the bases of the row and column spaces so obtained are
not orthogonal.
The pivot rows are the independent equations in the system of
equations, and the variables corresponding to the pivot columns
(here and ) are the pivot variables. The remaining
non-pivot rows containing all zeros are not independent, and the
variables corresponding to the non-pivot rows are free variables
(here ), which can take any values.
From the rref form of the equation, we get
If we let the free variable , then we can get the two pivot
variables and , and a special homogeneous solution
as a basis vector that spans the 1-D null
space
. However, as the free variable can take any
value , the complete solution is the entire 1-D null space:
Example 2:
Solve the non-homogeneous equation with the same coefficient
matrix used in the previous example:
We use Gauss-Jordan elimination to solve this system:
The pivot rows correspond to the independent equations in the
system, i.e.,
, while the remaining non-pivot
row does not play any role as they map any to . As
is singular,
does not exist. However, we can
find the solution based on the rref of the system, which can also be
expressed in block matrix form:
or |
|
where
Solving the matrix equation above for
, we get
If we let
, we get a particular solution
, which can be expressed as a linear
combination of and that span
,
and that span
:
We see that this solution is not entirely in the row space
.
In general, this is the case for all particular solutions so obtained.
Having found both the particular solution and the
homogeneous solution , we can further find the complete
solution as the sum of and the entire
null space spanned by :
Based on different constant , we get a set of equally valid
solutions. For example, if , then we get
These solutions have the same projection onto the row space
, i.e., they have the same projections onto the two
basis vectors and that span
:
The figure below shows how the complete solution can
be obtained as the sum of a particular solution in
and the entire null space
. Here
and space
is composed of
and
,
respectively 2-D and 1-D on the left, but 1-D and 2-D on the right.
In either case, the complete solution is any particular solution
plus the entire null space, the vertical dashed line on the left,
the top dashed plane on the right. All points on the vertical line
or top satisfy the equation system, as they are have the same
projection onto the row space
.
If the right hand side is
, then the
rref of the equation becomes:
The non-pivot row is an impossible equation , indicating that
no solution exists, as
is not in the
column space spanned by
and
.
Example 3:
Find the complete solution of the following linear equation system:
This equation can be solved in the following steps:
If the right-hand side is
, then the row reduction
of the augmented matrix yields:
The equation corresponding to the last non-pivot row is , indicating
the system is not solvable (even though the coefficient matrix does not
have full rank), because
is not in the column
space.
Example 4: Consider the linear equation system with a
coefficient matrix , the transpose of used in the
previous example:
If the right-hand side is
,
indicating the system is not solvable, as this
, i.e., it is not in the column
space of or row space of .
In the two examples above, we have obtained all four subspaces associated
with this matrix with , , and , in terms of the
bases that span the subspaces:
- The row space
is an R-D subspace of
, spanned by the pivot rows of the rref of
:
- The null space
is an (N-R)-D subspace of
spanned by the independent homogeneous solutions:
Note that the basis vectors of
are indeed orthogonal to those
of
.
- The column space of is the same as the row space of ,
which is the R-D subspace of spanned by the two pivot rows of the
rref of .
- The left null space
is a (M-R)-D subspace of
spanned by the homogeneous solutions (here one solution):
Again note that the basis vectors of
are orthogonal to those
of
.
In general, here are the ways to find the bases of the four subspaces:
- The basis vectors of
are the pivot rows of the rref
of .
- The basis vectors of
are the pivot rows of the rref
of .
- The basis vectors of
are the independent homogeneous
solutions of
. To find them, reduce to the
rref, identify all free variables corresponding to non-pivot
columns, set one of them to 1 and the rest to 0, solve homogeneous
system
to find the pivot variables
to get one basis vector. Repeat the process for each of the free
variables to get all basis vectors.
- The basis vectors of
can be obtained by doing the
same as above for .
Note that while the basis of
are the pivot rows of the
rref of , as its rows are equivalent to those of ,
the pivot columns of the rref basis of
are not the basis
of
, as the columns of have been changed by the
row deduction operations and are therefore not equivalent to the
columns of the resulting rref. The columns in corresponding
to the pivot columns in the rref could be used as the basis of
.
Alternatively, the basis of
can be obtained from the rref
of , as its rows are equivalent to those of , which
are the columns of .
We further make the following observations:
- The basis vectors of each of the four subspaces are independent,
the basis vectors of
and
are orthogonal,
and
. Similarly, the basis vectors
of
and
are orthogonal, and
.
In other words, the four subspaces indeed satisfy the following orthogonal
and complementary properties:
|
(155) |
i.e., they are orthogonal complements:
.
- For
to be solvable, the constant vector
on the right-hand side must be in the column space,
. Otherwise the equation is not solvable,
even if . Similarly, for
to be
solvable, must be in the row space
.
In the examples above, both and are indeed in
their corresponding column spaces:
|
(156) |
But as
and
, the corresponding
systems have no solutions.
- All homogeneous solutions of
are in
the null space
, but in general the
particular solutions
are not necessarily in the row space
. In the example
above,
is a linear combination of the
basis vectors of
and basis vectors of
:
|
(157) |
where
|
(158) |
are the projections of onto
and
,
respectively, and
is another particular solution without
any homogeneous component that satisfies
, while
is a homogeneous solution satisfying
.
- All homogeneous solutions of
are in
the left null space
, but in general the
particular solutions
are not necessarily in the column space. In the example above,
is a linear combination of the basis vectors
of
and basis vector of
:
|
(159) |
where
is a particular
solution (without any homogeneous component) that satisfies
.
Here is a summary of the four subspaces associated with an by matrix
of rank .
, , |
dim
|
dim
|
dim
|
dim
|
solvability of
|
|
|
0 |
|
0 |
solvable,
is unique solution |
|
|
0 |
|
|
over-constrained, solvable if
|
|
|
|
|
0 |
under-constrained, solvable,
infinite solutions
|
|
|
|
|
|
solvable only if
, infinite solutions |
The figure below illustrates a specific case with and .
As
, the system can only be approximately
solved to find
, which is the projection
of onto the column space
. The error
is minimized,
is the optimal approximation. We will consider ways to obtain
this optimal approximation in the following sections.