︠23789134-f3f3-4d2d-aee7-ca93c5bca7fai︠ %html
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:
︡a8cbf0fe-2e02-4d66-a171-d478257e56a6︡{"html": "\n\n \n \n\n\n\n\n\nHow can we determine if two subspaces of a given vector space are\northogonal? Remember, to be orthogonal, every vector\nin one subspace must be perpendicular to every vector in the\nother subspace.\n
\n\n\nHere is an example. Take two vectors in \nR3. For instance:\n
\n"}︡ ︠e7c8b8b1-6e02-47b6-8578-bc1da1a7d104︠ u=vector([1, -3, 7]) v=vector([2, 1, -2]) u; v ︡b25f430e-9f8f-4f6d-a245-ae751033b5c4︡︡ ︠9e57d987-1fd0-402d-b18d-439151582caei︠ %htmlNow let’s find a vector perpendicular to the subspace spanned by u and v, using a familiar technique from multivariable calculus.
︡305dd32d-0097-4c3c-a155-cc58f30fce99︡{"html": "\n\nNow let’s find a vector perpendicular to the subspace spanned\nby u and v, using\na familiar technique from multivariable calculus.\n
\n"}︡ ︠5c955206-b11c-4119-8fbc-4cd6822cb668︠ w=u.cross_product(v) w ︡be958f3a-1b39-44cc-8aa9-156127c59784︡︡ ︠6c8a997c-2968-41e4-8cb6-8d21f63d35b2i︠ %htmlLet S = Span{u, v} and T = Span{w}. How can these two subspaces of R3 be described geometrically?
︡597ea41c-8023-4174-8b3e-b434a2c0301e︡{"html": "\n\nLet S = Span{u, v} and \nT = Span{w}. How can these two subspaces of\n R3 be described geometrically?\n
\n"}︡ ︠ed117602-f0b7-4257-abd0-f1a9d3f2b940︠ u*w; v*w ︡d44f5dc9-b837-4574-a8a6-079f88dc4cd9︡︡ ︠5cb5be30-726e-4768-98c4-03a31ea3bb6bi︠ %htmlThis proves that S and T are orthogonal subspaces. Why? Well, an arbitrary vector in S looks like this:
︡d9c2cebc-e8c9-42ef-8c31-3f3d0b9a251e︡{"html": "\n\nThis proves that S and T\n are orthogonal subspaces. Why? Well, an\narbitrary vector in S looks like this:\n
\n"}︡ ︠afdc3a54-97da-461f-923c-4f626afc527c︠ c1,c2=var('c1,c2') x=c1*u+c2*v x ︡4debf35a-6b78-4b66-9040-e007898fe7dd︡︡ ︠8903b9a1-ef09-4688-94aa-9634119f1893i︠ %htmlAn arbitrary vector in T looks like this:
︡3a11b110-51f8-432e-9290-478fc8e12d37︡{"html": "\n\nAn arbitrary vector in T looks like this:\n
\n"}︡ ︠51dedfc8-4f3e-4a0d-a2f8-4b6161d6906f︠ c=var('c') y=c*w y ︡75b4f3fa-8b56-48f7-9351-af6183bc8d98︡︡ ︠ea792300-3b98-49a4-ab1e-824e9cae996ci︠ %htmlNow take the dot product of an arbitrary vector in S with an arbitrary vector in T:
︡180987cb-97f1-4949-af74-0914a0ef7f58︡{"html": "\n\nNow take the dot product of an arbitrary vector in S\n with an arbitrary vector in T:\n
\n"}︡ ︠cece986f-6e43-4288-a8f0-510a263fe923︠ (x*y).simplify_full() ︡32f26119-c7f9-4165-9920-0cb41631f802︡︡ ︠5efd7aa7-61ba-4fd3-a089-ff97bf6d6062i︠ %htmlQuestion. How could we have predicted this result as soon as we knew the dot products u ⋅ w and v ⋅ w?
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:
︡96c4d705-ee08-4b9b-b74e-f00783bcced3︡{"html": "\n\nQuestion. How could we have predicted this result\nas soon as we knew the dot products u ⋅\nw and v ⋅ w?\n
\n\n\nLet us now look at the four subspaces associated with a given matrix:\nthe row space, column space, nullspace, and left nullspace. \nHere is a sample matrix:\n
\n"}︡ ︠6376e3f0-5ee6-42d0-87b1-8397d542243f︠ 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 ︡74067966-80ce-41fd-8f0e-c51937a8afb8︡︡ ︠84f95cb7-e617-49b7-8b28-b3a669680ba4i︠ %htmlAnd now let us get “nice” bases for the four subspaces. (To put it more accurately, we will let SAGE get “nice” bases for us.)
︡913be589-9171-4772-a601-45945261e482︡{"html": "\n\nAnd now let us get “nice” bases for the four subspaces.\n (To put it more accurately, we will let SAGE get\n“nice” bases for us.)\n
\n"}︡ ︠c27a54ea-975e-4fc9-b2a2-54ff603303fa︠ CS=A.column_space() RS=A.row_space() NS=A.right_kernel() LNS=A.left_kernel() ︡30dc009c-6a7b-48b5-b934-1f7c0a0bd8af︡︡ ︠ed727db2-1fe3-4604-a9af-55720d396009i︠ %htmlIn the following cells we ask SAGE for a description of the column space, row space, nullspace, and left nullspace of A.
︡77786182-0d1e-4a3f-a257-f75ccfbd9016︡{"html": "\n\nIn the following cells we ask SAGE for a description of the column\nspace, row space, nullspace, and left nullspace of A.\n
\n"}︡ ︠14c01249-2162-402c-bc81-0090fb246d47︠ CS ︡2f14887f-62d4-48ad-bc2f-51f884e28d50︡︡ ︠d32b712f-5627-4592-be3a-97e07ef17973︠ RS ︡012ae31b-1806-489b-bde5-3178a10d66c2︡︡ ︠c63072bf-2db8-4d9c-9a0d-516cd30cbd35︠ NS ︡64365d6a-d5db-41a8-9e3b-2ec29d4d6a9c︡︡ ︠f713b4de-5e9a-464e-a409-981fbee6442a︠ LNS ︡7f69f223-95cd-4023-81c4-72d5c2b73463︡︡ ︠5e2ddc65-20ce-4a04-a03f-85b40da97fbdi︠ %htmlIn 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.
︡6393e9c6-8812-4ca3-af96-1e06dce97871︡{"html": "\n\nIn the following cell we will extract a basis (consisting of three\nvectors) for the column space of A. These\nshould really be written as column vectors. Evidently SAGE\ntrusts that we understand this and will not be confused by the\nmanner of display.\n
\n"}︡ ︠b3b7131d-7bc6-49c7-af46-2ef7346b99e8︠ Basis_CS=CS.basis() C1=Basis_CS[0] C2=Basis_CS[1] C3=Basis_CS[2] C1; C2; C3 ︡c123214a-a33a-4669-94a6-fde806deebb2︡︡ ︠ed974583-774b-44f3-8864-f979b9a2ce78i︠ %htmlLikewise, we will define basis vectors for the left nullspace of A.
︡2ede1a67-18d3-42b5-96aa-388d7eb5c96d︡{"html": "\n\nLikewise, we will define basis vectors for the left nullspace of\n A.\n
\n"}︡ ︠cf501315-cdec-436d-b4e2-82b73e38a02a︠ Basis_LNS=LNS.basis() y1=Basis_LNS[0] y2=Basis_LNS[1] y1; y2 ︡fcd0d6ca-cf40-42f4-bb24-e56a19b63275︡︡ ︠80baec79-d947-475c-8db9-979806eab58bi︠ %htmlLet’s make sure that the alleged basis vectors for the left nullspace are really contained in the left nullspace:
︡1a66c549-5bdc-49a5-965b-36e7dc72b358︡{"html": "\n\nLet’s make sure that the alleged basis vectors for the left\nnullspace are really contained in the left nullspace:\n
\n"}︡ ︠40734976-920f-4a3b-9bbd-9481d552eb30︠ y1*A; y2*A ︡4d21251d-4e8f-47f0-9746-04ecdcd9224e︡︡ ︠201a3d6a-239a-4e2a-9103-3d31b6c3b4d2i︠ %htmlNext we’ll compute several dot products.
︡43f483d7-9a72-42c4-968b-9eacf70f7d40︡{"html": "\n\nNext we’ll compute several dot products.\n
\n"}︡ ︠c45defd4-fdad-41a3-90a1-8757fb89a3e7︠ C1*y1; C2*y1; C3*y1; C1*y2; C2*y2; C3*y2 ︡3cea2d18-d5b0-4698-b886-a4515da11a8d︡︡ ︠1f19ce7a-2a8e-40c2-8c60-a564c9f8d34ci︠ %htmlWe 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.
︡395d24af-93ec-47b8-aa16-08ee0cb2f0ed︡{"html": "\n\nWe have just confirmed that two subspaces are orthogonal to each\nother. Which two subspaces?\n
\n\n\nNow we’ll define basis vectors for our other two subspaces.\n
\n"}︡ ︠c81245a1-dd15-4d84-9c38-30e535d7ab36︠ Basis_RS=RS.basis() R1=Basis_RS[0] R2=Basis_RS[1] R3=Basis_RS[2] R1; R2; R3 ︡730d3bfa-6dcd-45b4-84af-2b2c33cb3aa3︡︡ ︠6f498304-2f7c-49a9-a4c9-a12fba00cb57︠ Basis_NS=NS.basis() x1=Basis_NS[0] x2=Basis_NS[1] x3=Basis_NS[1] x1; x2; x3 ︡924f5b14-24cb-470c-823d-fb424505ced9︡︡ ︠f2433565-c546-4f4c-9aa1-d3211f7e31aci︠ %htmlAs 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:
︡5441b974-6c41-4493-8e96-7a29cdd07ddc︡{"html": "\n\nAs with the left nullspace earlier, it will behoove us to verify\nthat our alleged basis vectors for the nullspace of A\n do indeed lie in the nullspace of A:\n
\n"}︡ ︠426d89e3-983e-4942-a308-a198d8ef64d5︠ A*x1; A*x2; A*x3 ︡c7074d38-2157-4ca3-b4d1-e1d05f597b3c︡︡ ︠eeae7917-fc05-4cfb-9a00-f47b6e4fd2f5i︠ %html(Note that the foregoing output should really be column vectors.) Now we will compute several more dot products:
︡1c74e382-e14e-4afd-9385-dd415716e370︡{"html": "\n\n(Note that the foregoing output should really be column vectors.)\n Now we will compute several more dot products:\n
\n"}︡ ︠9af9c92c-d201-4f9c-a831-3f943ae9187d︠ R1*x1; R2*x1; R3*x1; R1*x2; R2*x2; R3*x2; R1*x3; R2*x3; R3*x3 ︡0716d715-28c2-45bc-8836-1e8b4bd5f84a︡︡ ︠594cb4c4-4330-4a1d-bef5-25f1ecab29dbi︠ %htmlAgain, 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:
︡98692245-b1d1-4f4a-9e40-a530e662a96f︡{"html": "\n\nAgain, we have just confirmed that two subspaces are orthogonal to\neach other. Which two subspaces?\n
\n\n\nExercise 1. Repeat the above work for this new matrix:\n
\n"}︡ ︠ad82feb8-2912-41d6-af36-aa91e9086bea︠ 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 ︡dfd01a79-729e-46b7-8b00-4416acd5f236︡︡ ︠e7f47779-33bd-4c60-8f06-624579d3e7c5i︠ %htmlExercise 2. The set of all solutions (x, y, z, t) to the system of equations
\nExercise 2. The set of all solutions \n(x, y, z, t) to the system of\nequations\n\n
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.
︡e946d8de-9d7a-40e6-9c26-8292b5364b52︡{"html": "\n\nExercise 3. The span of the vectors (1, 3,\n−1, 0, 1) and (−2, 4, 3, 7, 5) \nis a 2-dimensional subspace of R5. \nFind a basis for the orthogonal complement of this subspace of\n R5.\n
\n"}︡