Theorem DLDS. Dependency in Linearly Dependent Sets.
Suppose that is a set of vectors. Then is a linearly dependent set if and only if there is an index such that is a linear combination of the vectors
.linear_dependence()
produces relations of linear dependence for linearly dependent sets. Here is how we would employ this method in Example RSC5. The optional argument zeros='right'
will produce results consistent with our work here, you can also experiment with zeros='left'
(which is the default).xxxxxxxxxx
V = QQ^5
v1 = vector(QQ, [1, 2, -1, 3, 2])
v2 = vector(QQ, [2, 1, 3, 1, 2])
v3 = vector(QQ, [0, -7, 6, -11, -2])
v4 = vector(QQ, [4, 1, 2, 1, 6])
R = [v1, v2, v3, v4]
L = V.linear_dependence(R, zeros='right')
L[0]
xxxxxxxxxx
-4*v1 + 0*v2 +(-1)*v3 +1*v4
xxxxxxxxxx
V.span(R) == V.span([v1, v2, v4])
L
has just one element (maybe with len(L)
), but realize that any multiple of the vector L[0]
is also a relation of linear dependence on R
, most of which are nontrivial. Notice that we have verified the final conclusion of Example RSC5 with a comparison of two spans..linear_dependence()
method a real workout in the next Sage subsection (Sage COV) — this is just a quick introduction..remove()
method for lists. Ready? Here we go.xxxxxxxxxx
V = QQ^4
v1 = vector(QQ, [ 1, 2, 0, -1])
v2 = vector(QQ, [ 4, 8, 0, -4])
v3 = vector(QQ, [ 0, -1, 2, 2])
v4 = vector(QQ, [-1, 3, -3, 4])
v5 = vector(QQ, [ 0, 9, -4, 8])
v6 = vector(QQ, [ 7, -13, 12, -31])
v7 = vector(QQ, [-9, 7, -8, 37])
S = [v1, v2, v3, v4, v5, v6, v7]
W = V.span(S)
D = V.linear_dependence(S, zeros='right')
D
xxxxxxxxxx
D[0]
xxxxxxxxxx
S.remove(v2)
W == V.span(S)
xxxxxxxxxx
D[1]
xxxxxxxxxx
S.remove(v5)
W == V.span(S)
xxxxxxxxxx
D[2]
xxxxxxxxxx
S.remove(v6)
W == V.span(S)
xxxxxxxxxx
D[3]
xxxxxxxxxx
S.remove(v7)
W == V.span(S)
xxxxxxxxxx
S
xxxxxxxxxx
S == [v1, v3, v4]
S
begins with all seven original vectors, and slowly gets whittled down to just the list [v1, v3, v4]
. If you experiment with the above commands, be sure to return to the start and work your way through in order, or the results will not be right.D
, is itself a linearly independent set (but within a very different vector space). Is that too weird?xxxxxxxxxx
U = QQ^7
U.linear_dependence(D) == []
xxxxxxxxxx
V = QQ^4
v1 = vector(QQ, [1,1,2,1])
v2 = vector(QQ, [2,2,4,2])
v3 = vector(QQ, [2,0,-1,1])
v4 = vector(QQ, [7,1,-1,4])
v5 = vector(QQ, [0,2,5,1])
S = [v1, v2, v3, v4, v5]
A = column_matrix(S)
T = [A.column(p) for p in A.pivots()]
T
xxxxxxxxxx
V.linear_dependence(T) == []
xxxxxxxxxx
V.span(S) == V.span(T)
T
with the single line that mirrors the construction of the set .pivot()
matrix method, which necessarily must compute the reduced row-echelon form. The final two compute cells verify both conclusions of the theorem.xxxxxxxxxx
V = QQ^4
v1 = vector(QQ, [2,1,3,2])
v2 = vector(QQ, [-1,1,0,1])
v3 = vector(QQ, [-8,-1,-9,-4])
v4 = vector(QQ, [3,1,-1,-2])
v5 = vector(QQ, [-10,-1,-1,4])
y = 6*v1 - 7*v2 + v3 +6*v4 + 2*v5
y
xxxxxxxxxx
R = [v1, v2, v3, v4, v5]
X = V.span(R)
y in X
xxxxxxxxxx
A = column_matrix(R)
P = [A.column(p) for p in A.pivots()]
W = V.span(P)
W == X
xxxxxxxxxx
y in W
xxxxxxxxxx
coeff = column_matrix(P)
coeff.solve_right(y)
xxxxxxxxxx
coeff.right_kernel()
xxxxxxxxxx
V.linear_dependence(P) == []
coeff
and the linear independence of P
— both individually imply that the solution to the system of equations (just prior) is unique. Sage produces its own linearly independent spanning set for each span, as we see whenever we inquire about a span.xxxxxxxxxx
X
X
and solve the appropriate system of equations to see how to write y
as a linear combination of these three vectors? Once you have done that, check your answer by hand and think about how using Sage could have been overkill for this question.