Consider the subspace spanned by these five vectors. We will make these vectors the rows of a matrix and row-reduce to see a basis for the space (subspace, or row space, take your pick). This is an application of Theorem BRS.
︡3a7e23fd-9181-4dac-a260-bd445b989388︡
︠7c2fa43a-2cba-4e95-aacb-b79fbfa58380︠
A = matrix(S)
A
︡c0de0723-250d-4ff7-a593-15aa46aeb224︡
︠2e40c57f-8949-4748-aea2-1b7c6c20ae2d︠
A.rref()
︡25c759dd-867d-4fe2-a8cc-be83aefdf9c2︡
︠7f837dc4-b5a2-4291-a52e-1dca079f5891︠
%auto
%html(hide=True)
Sage does this semi-automatically, tossing zero rows for us.
︡b0033710-bc55-4f8f-a0d1-efeaae23e7c7︡
︠8789bc0c-cb91-418a-a088-277021f45eb1︠
W = span(S)
B = W.basis()
B
︡549ed4ae-06a9-48b2-a2cb-ae22f44f89d4︡
︠b394168b-582f-42aa-a4d7-0852b56f5f92︠
%auto
%html(hide=True)
Demonstration1.
Construct a random vector, w, in this subspace by choosing scalars for a linear combination of the vectors we used to build W as a span originally.
Then use the three basis vectors in B to recreate the vector w. Question: how many ways can you do this? By Theorem VRRB there should always be exactly one way to create w using a linear combination of a basis of W.
︡446d8840-3996-48b0-a30e-a06031691b9a︡
︠dde4a6cf-7f80-461b-a64c-5edcf0e5af03︠
w = *v1 + *v2 + *v3 + *v4 + *v5
w
︡ad181cfe-b6e4-4645-a2b9-f07cc7dac8ac︡
︠c49ddb9c-9528-499c-aeb7-8a707474f3ca︠
w in W
︡f9e96b50-8f5a-47f3-a3ef-a692617e6613︡
︠00cfa2bf-33e9-4e58-a297-14eb64cd2344︠
*B[0] + *B[1] + *B[2]
︡65425f40-e84c-4122-aa5b-16ff264f4729︡
︠b8f0a4ff-5e79-4b9c-ad31-95894b09a40d︠
%auto
%html(hide=True)
︡2beb15a2-3b38-426f-a14b-0204954fd958︡
︠d83b451f-74ab-4cd2-ace6-8e9832d82b18︠
v = random_vector(ZZ, 10, x=-9, y=9)
v
︡3e17a5cb-440f-40dc-a29b-9192ad585736︡
︠f651ef6a-bbfb-4af8-a722-2b3cde936ea9︠
%auto
%html(hide=True)
Demonstration2.
By Theorem CNMB, the columns of the matrix are a basis of \(\mathbb{C}^{10}\text{.}\) So the vector v should be a linear combination of the columns of the matrix. Verify this fact in three ways.
First, the old-fashioned way, thus exposing Theorem NMUS.
Then, the modern way, with an inverse, since a nonsingular matrix is invertible, thus exposing Theorem SNCM.
The Sage way: first create a space with a user basis.
︡b8f296c6-53ad-45ab-ac1d-a1720cea310e︡
︠bc7ae01b-76f1-435c-af1d-ccf4e00ca4eb︠
X = (QQ^10).subspace_with_basis(M.columns())
X
︡298946a5-21c2-4307-aff9-dc5c04c0074f︡
︠369b0e2a-44b0-47e0-aee0-7ccd9c16c2d0︠
%auto
%html(hide=True)
Sage still carries an echelonized basis, in addition to the user-installed basis.
Build a random vector of size \(3\) and find our ways to express the vector as a (unique) linear combination of the basis vectors. Which method is most efficient?
The Sage way. Create a space with a “user basis” and ask for a coordinatization, thus exposing Theorem VRRB.
︡0d893431-3bdb-48db-a5d5-0d17d1957a2a︡
︠0278bbdf-c0aa-4c27-a785-c83df0e95637︠
X = (QQ^3).subspace_with_basis(Q.columns())
X.coordinates(v)
︡13a8c549-41af-4b62-a3da-893c72d6b3df︡
︠be257fbb-80c2-4f89-a2b6-c40f182efe1c︠
%auto
%html(hide=True)
Finally, exploiting the orthonormal basis, and computing scalars for the linear combination with an inner product, thus exposing Theorem COB. (Sage's .inner_product() does not conjugate the entries of either vector, so we use the more careful .hermitian_inner_product() vector method instead.)