2.6 Adjoint Systems, Left Null Space, and Row Space
More matrix subspaces
1Reading¶
Material related to this page, as well as additional exercises, can be found in ALA Ch. 2.5.
2Learning Objectives¶
By the end of this page, you should know:
- the transpose of a matrix
- Adjoint systems
- Left Null Space
- Row Space
- the fundamental theorem of linear algebra and its implication
3Matrix Transpose¶
The transpose of an matrix is the matrix obtained by interchanging its rows and columns. Hence, if , then .
3.1Python Break!¶
Transpose of a NumPy array A
is given by A.T
. Below are examples of matrix (and vector) transposes using NumPy.
## Transpose of NumPy arrays
import numpy as np
A = np.array([[1, 2, 3],
[4, 5, 6]])
AT = A.T # Transpose of the A matrix
c = np.array([[1],
[2],
[3]]) # column vector
cT = c.T # transpose of a column vector
c1 = np.array([1, 2, 3]) # ?-vector
c1T = c1.T
print("Tranpose of \nA: \n", AT, "\nc: \n", cT, "\nc1: \n", c1T)
Tranpose of
A:
[[1 4]
[2 5]
[3 6]]
c:
[[1 2 3]]
c1:
[1 2 3]
4Adjoint System¶
This section explores the properties of the system of linear equations defined by , rather than . This adjoint system might first appear as some abstract nonsense that only mathematicians care about, but we will show that is has very practical consequences and interpretations.
At first glance, the solutions to and the solutions to its adjoint seem unrelated. We will see some very surprising connections between them that will be revisited in even greater depth later in the course.
5Row Space and Left Null Space¶
We start by introducing the last two fundamental subspaces associated with a matrix .
It is called the row space because it is the subspace of spanned by the rows of (more precisely, by the columns obtained from transposing the rows of ).
It is called the left null space of because up to taking a transpose, LNull is composed of row vectors satisfying .
5.1Python break!¶
In Example 3, we found the four fundamental subspacesthe using hand. In Python, we can use the sympy
package (it’s also straightforward to do this in numpy
) to do the same.
## Find the four fundamental subspaces of a matrix
from sympy import *
A = Matrix([[1, 5, -2, 2],
[0, 1, 2, -5],
[1, 3, -3, 7]])
print("The A matrix:\n", A)
A_Null = A.nullspace()
A_col = A.columnspace()
print("Null space of A: \n", A_Null, "\nColumn space of A: \n", A_col)
AT = A.T
A_LNull = AT.nullspace()
A_row = AT.columnspace()
print("Left Null space of A: \n", A_LNull, "\nRow space of A: \n", A_row)
The A matrix:
Matrix([[1, 5, -2, 2], [0, 1, 2, -5], [1, 3, -3, 7]])
Null space of A:
[Matrix([
[ -7],
[5/3],
[5/3],
[ 1]])]
Column space of A:
[Matrix([
[1],
[0],
[1]]), Matrix([
[5],
[1],
[3]]), Matrix([
[-2],
[ 2],
[-3]])]
Left Null space of A:
[]
Row space of A:
[Matrix([
[ 1],
[ 5],
[-2],
[ 2]]), Matrix([
[ 0],
[ 1],
[ 2],
[-5]]), Matrix([
[ 1],
[ 3],
[-3],
[ 7]])]
6The Fundamental Theorem¶
The proof of Theorem 1 can be found in pp. 114-118 of ALA. We will focus on some remarkable implications of Theorem 1 which are given below.
The statement in Theorem 2 holds true with Col Row and Null LNull.
6.1Python break!¶
We verify Theorem 2 below in Python using the fundamental subspaces we computed previously.
# Verifying Theorem-1
dim_col = len(A_col)
rank = A.rank()
dim_null = len(A_Null)
n_cols = A.shape[1] # what is A.shape[0]?
print("Rank: ", rank, ". Dimension of column space is ", dim_col, "and null space is ", dim_null,
"\nNumber of columns n is ", n_cols)
Rank: 3 . Dimension of column space is 3 and null space is 1
Number of columns n is 4