Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168739
Image: ubuntu2004
Orthogonality of the Four Subspaces Associated with a Matrix
Prof. G. Marks
Math 311-01
St. Louis University

How can we determine if two subspaces of a given vector space are orthogonal?   Remember, to be orthogonal, every vector in one subspace must be perpendicular to every vector in the other subspace.

Here is an example.   Take two vectors in   R3.   For instance:

u=vector([1, -3, 7]) v=vector([2, 1, -2]) u; v

Now let’s find a vector perpendicular to the subspace spanned by   u   and   v,   using a familiar technique from multivariable calculus.

w=u.cross_product(v) w

Let   S = Span{u, v}   and   T = Span{w}.   How can these two subspaces of   R3   be described geometrically?

u*w; v*w

This proves that   S   and   T   are orthogonal subspaces.   Why?   Well, an arbitrary vector in   S   looks like this:

c1,c2=var('c1,c2') x=c1*u+c2*v x

An arbitrary vector in   T   looks like this:

c=var('c') y=c*w y

Now take the dot product of an arbitrary vector in   S   with an arbitrary vector in   T:

(x*y).simplify_full()

Question.   How could we have predicted this result as soon as we knew the dot products   uw   and   vw?

Let us now look at the four subspaces associated with a given matrix: the row space, column space, nullspace, and left nullspace.   Here is a sample matrix:

A=matrix(QQ, [[-1,2,6,-8,-14,3], [2,4,1,-8,5,-1], [-3,1,4,-9,-10,0], [3,-2,-1,12,-1,4], [5,7,11,-11,-19,9]]) A

And now let us get “nice” bases for the four subspaces.   (To put it more accurately, we will let SAGE get “nice” bases for us.)

CS=A.column_space() RS=A.row_space() NS=A.right_kernel() LNS=A.left_kernel()

In the following cells we ask SAGE for a description of the column space, row space, nullspace, and left nullspace of   A.

CS
RS
NS
LNS

In the following cell we will extract a basis (consisting of three vectors) for the column space of   A.   These should really be written as column vectors.   Evidently SAGE trusts that we understand this and will not be confused by the manner of display.

Basis_CS=CS.basis() C1=Basis_CS[0] C2=Basis_CS[1] C3=Basis_CS[2] C1; C2; C3

Likewise, we will define basis vectors for the left nullspace of   A.

Basis_LNS=LNS.basis() y1=Basis_LNS[0] y2=Basis_LNS[1] y1; y2

Let’s make sure that the alleged basis vectors for the left nullspace are really contained in the left nullspace:

y1*A; y2*A

Next we’ll compute several dot products.

C1*y1; C2*y1; C3*y1; C1*y2; C2*y2; C3*y2

We have just confirmed that two subspaces are orthogonal to each other.   Which two subspaces?

Now we’ll define basis vectors for our other two subspaces.

Basis_RS=RS.basis() R1=Basis_RS[0] R2=Basis_RS[1] R3=Basis_RS[2] R1; R2; R3
Basis_NS=NS.basis() x1=Basis_NS[0] x2=Basis_NS[1] x3=Basis_NS[1] x1; x2; x3

As with the left nullspace earlier, it will behoove us to verify that our alleged basis vectors for the nullspace of   A   do indeed lie in the nullspace of   A:

A*x1; A*x2; A*x3

(Note that the foregoing output should really be column vectors.)   Now we will compute several more dot products:

R1*x1; R2*x1; R3*x1; R1*x2; R2*x2; R3*x2; R1*x3; R2*x3; R3*x3

Again, we have just confirmed that two subspaces are orthogonal to each other.   Which two subspaces?

Exercise 1.   Repeat the above work for this new matrix:

C=matrix(QQ, [[-1,2,0,4,5,-3], [3,-7,2,0,1,4], [2,-5,2,4,6,1], [4,-9,2,-4,-4,7]]) C

Exercise 2.   The set of all solutions   (x, y, z, t)   to the system of equations

5 x − 4 y + 8 z + 11 t   =   0
3 x + 2 yz − 4 t   =   0
form a 2-dimensional subspace of   R4.   Find a basis for the orthogonal complement of this subspace of   R4.

Exercise 3.   The span of the vectors   (1, 3, −1, 0, 1)   and   (−2, 4, 3, 7, 5)   is a 2-dimensional subspace of   R5.   Find a basis for the orthogonal complement of this subspace of   R5.