I am applying the the following theorem on dimension of quotient spaces. Let x≠0 be an element of a vector space V over a field K. Then
dim(V)=dim(Span(x))+dim(V/Span(x)).
How can I write a Sage code to compute dim(V) by recursively using this formula where you choose a nonzero element x until dim(V/Span(x)) is 1?
dim(V) = dim(Span(x1)) + dim(V/Span(x1))
= dim(Span(x1)) + [ dim(Span(x2)) + dim((V/Span(x1))/Span(x2)) ]
= ...
= dim(Span(x1)) + dim(Span(x2)) + ... + dim(Span(xn))
= 1 + 1 + .... + n
= n
Thanks.