Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

dimension of quotient space

I am applying the the following theorem on dimension of quotient spaces. Let $x \neq 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.