Ask Your Question
0

dimension of quotient space

asked 2023-02-14 20:16:22 +0100

Holden gravatar image

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.

edit retag flag offensive close merge delete

Comments

Homework? What have you tried so far?

John Palmieri gravatar imageJohn Palmieri ( 2023-02-14 20:49:02 +0100 )edit

@John-Palmieri, i I found the solution. Thanks. Should I close it?

Holden gravatar imageHolden ( 2023-02-14 21:29:34 +0100 )edit
1

You could post your solution, in case others are interested.

John Palmieri gravatar imageJohn Palmieri ( 2023-02-14 22:21:53 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2023-02-15 19:57:52 +0100

updated 2023-02-16 00:28:13 +0100

Another option:

sage: V = QQ^10
sage: d = 0
sage: while dim(V) > 0:
....:     for x in V:   # iterate through all elements of V
....:         if x:     # until you find a nonzero element
....:             break
....:     d += 1
....:     V = V / V.span([x])
....: 
sage: d
10
edit flag offensive delete link more

Comments

@John-Palmieri, typo: the output is 10.

Holden gravatar imageHolden ( 2023-02-15 21:49:19 +0100 )edit
1

Right, I copy-pasted and then updated the example without updating the output.

John Palmieri gravatar imageJohn Palmieri ( 2023-02-16 00:28:37 +0100 )edit
0

answered 2023-02-15 16:27:31 +0100

Holden gravatar image

updated 2023-02-15 22:33:45 +0100

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
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-02-14 20:16:22 +0100

Seen: 94 times

Last updated: Feb 16 '23