Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is an example code. It answers my own question.

Sage: V = VectorSpace(GF(2),100) # example vector space

Sage: def dim_(V):
         if V.dimension() == 0:
             return 0
         else: 
             #choose a nonzero element whenever it exists, for e.g. first element after 0 vector
             return span([V[1]]).dimension() + dim(V.quotient(span([V[1]])))#.dimension()    
  Sage: def dim_(V):
  Sage: 100

Here is an example code. It answers my own question.

Sage: V = VectorSpace(GF(2),100) # example vector space

Sage: def dim_(V):
         if V.dimension() == 0:
             return 0
         else: 
             #choose a nonzero element whenever it exists, for e.g. first element after 0 vector
             return span([V[1]]).dimension() + dim(V.quotient(span([V[1]])))#.dimension()    
  Sage: def dim_(V):
  Sage: 100

Here is an example code. It answers my own question.

Sage: V = VectorSpace(GF(2),100) # example vector space

Sage: def dim_(V):
         if V.dimension() == 0:
             return 0
         else: 
             #choose a nonzero element whenever it exists, for e.g. first element after 0 vector
             return span([V[1]]).dimension() + dim(V.quotient(span([V[1]])))#.dimension()    
  Sage: dim_(V):
  Sage: 100

Here is an example code. It answers my own question.

Sage: V = VectorSpace(GF(2),100) # example vector space

Sage: def dim_(V):
         if V.dimension() == 0:
             return 0
         else: 
             #choose a nonzero element whenever it exists, for e.g. first element after 0 vector
             return span([V[1]]).dimension() + dim(V.quotient(span([V[1]])))#.dimension()    
 Sage: dim_(V):
 dim_(V): 
Sage: 100

Here is an example code. It answers my own question.

Sage: V = VectorSpace(GF(2),100) # example vector space

Sage: def dim_(V):
         if V.dimension() == 0:
             return 0
         else: 
             #choose a nonzero element whenever it exists, for e.g. first element after 0 vector
             return span([V[1]]).dimension() + dim(V.quotient(span([V[1]])))#.dimension()    
Sage: dim_(V): dim_(V) 
Sage: 100