{{{id=1| 3+4 /// 7 }}} {{{id=2| M=matrix([[1,2],[3,4]]) show(M) /// }}} {{{id=3| N=matrix(3,2,[1,2,3,4,5,6]) show(N) /// }}} {{{id=4| A=matrix(2,2,[1,x,0,2]) A /// [1 x] [0 2] }}} {{{id=5| N[1,0] /// 3 }}} {{{id=6| show(parent(A)) /// }}} {{{id=7| A+M /// [ 2 x + 2] [ 3 6] }}} {{{id=8| A*M /// [3*x + 1 4*x + 2] [ 6 8] }}} {{{id=9| identity_matrix(10) /// [1 0 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0] [0 0 1 0 0 0 0 0 0 0] [0 0 0 1 0 0 0 0 0 0] [0 0 0 0 1 0 0 0 0 0] [0 0 0 0 0 1 0 0 0 0] [0 0 0 0 0 0 1 0 0 0] [0 0 0 0 0 0 0 1 0 0] [0 0 0 0 0 0 0 0 1 0] [0 0 0 0 0 0 0 0 0 1] }}} {{{id=10| zero_matrix(2,5) /// [0 0 0 0 0] [0 0 0 0 0] }}} {{{id=11| B=matrix(20,20,{(0,0):1,(3,4):-4}) show(B) /// }}} {{{id=12| A /// [1 x] [0 2] }}} {{{id=13| A[1] /// (0, 2) }}} {{{id=14| A.row(1) /// (0, 2) }}} {{{id=15| A.column(1) /// (x, 2) }}} {{{id=16| M /// [1 2] [3 4] }}} {{{id=17| M[1,1]=42 /// }}} {{{id=18| M /// [ 1 2] [ 3 42] }}} {{{id=19| H=matrix(6,6,lambda i,j: 1/(i+j+1)) H /// [ 1 1/2 1/3 1/4 1/5 1/6] [ 1/2 1/3 1/4 1/5 1/6 1/7] [ 1/3 1/4 1/5 1/6 1/7 1/8] [ 1/4 1/5 1/6 1/7 1/8 1/9] [ 1/5 1/6 1/7 1/8 1/9 1/10] [ 1/6 1/7 1/8 1/9 1/10 1/11] }}} {{{id=20| H1=matrix(6,6,lambda i,j: i+j) H1 /// [ 0 1 2 3 4 5] [ 1 2 3 4 5 6] [ 2 3 4 5 6 7] [ 3 4 5 6 7 8] [ 4 5 6 7 8 9] [ 5 6 7 8 9 10] }}} {{{id=21| b=matrix(6,1,lambda i,j: 1/(i+1)^2) b /// [ 1] [ 1/4] [ 1/9] [1/16] [1/25] [1/36] }}} {{{id=22| H^(-1)*b /// [ 71/15] [ -35] [ 140] [ -280] [ 525/2] [-462/5] }}} {{{id=23| H\b /// [ 71/15] [ -35] [ 140] [ -280] [ 525/2] [-462/5] }}} {{{id=24| H.inverse() /// [ 36 -630 3360 -7560 7560 -2772] [ -630 14700 -88200 211680 -220500 83160] [ 3360 -88200 564480 -1411200 1512000 -582120] [ -7560 211680 -1411200 3628800 -3969000 1552320] [ 7560 -220500 1512000 -3969000 4410000 -1746360] [ -2772 83160 -582120 1552320 -1746360 698544] }}} {{{id=25| H.inverse()*b /// [ 71/15] [ -35] [ 140] [ -280] [ 525/2] [-462/5] }}} {{{id=26| H.solve_right(b) /// [ 71/15] [ -35] [ 140] [ -280] [ 525/2] [-462/5] }}} {{{id=27| A=matrix([[1,2,3],[2,4,5],[0,0,1]]) A /// [1 2 3] [2 4 5] [0 0 1] }}} {{{id=28| rank(A) /// 2 }}} {{{id=29| A \ vector([1,2,0]) /// (1, 0, 0) }}} {{{id=30| A.right_kernel() /// Free module of degree 3 and rank 1 over Integer Ring Echelon basis matrix: [ 2 -1 0] }}} {{{id=31| V=QQ^5 V /// Vector space of dimension 5 over Rational Field }}} {{{id=32| v1=V([1,1,1,0,0]) v2=V([1,-1,1,0,0]) v3=V([1,0,1,0,0]) v1 /// (1, 1, 1, 0, 0) }}} {{{id=33| show(parent(v1)) /// }}} {{{id=36| /// }}} {{{id=34| U=V.subspace([v1,v2,v3]) U /// Vector space of degree 5 and dimension 2 over Rational Field Basis matrix: [1 0 1 0 0] [0 1 0 0 0] }}} {{{id=35| U.basis() /// [ (1, 0, 1, 0, 0), (0, 1, 0, 0, 0) ] }}} {{{id=37| v4=V([0,0,0,1,0]) v4 /// (0, 0, 0, 1, 0) }}} {{{id=38| v4 in U /// False }}} {{{id=39| v1 in U /// True }}} {{{id=40| W=V.subspace([V(v4)]) W /// Vector space of degree 5 and dimension 1 over Rational Field Basis matrix: [0 0 0 1 0] }}}

Ist $\mathrm{dim}(U)\leq \mathrm{dim}(V)$?

{{{id=41| U <= V /// True }}} {{{id=42| W <=U /// True }}}

$U+W$ ist der kleinste Untervektorraum von $V$, welcher $U$ und $W$ enthält.

{{{id=43| U+W /// Vector space of degree 5 and dimension 3 over Rational Field Basis matrix: [1 0 1 0 0] [0 1 0 0 0] [0 0 0 1 0] }}} {{{id=44| U.intersection(W) /// Vector space of degree 5 and dimension 0 over Rational Field Basis matrix: [] }}} {{{id=46| Qx=QQ[x] /// }}} {{{id=47| x=Qx(x) /// }}} {{{id=48| pp=[1+x+x^2,1-x+x^2,x^3-x,2+x^3] show(pp) /// }}} {{{id=49| p0=pp[0] p0 /// x^2 + x + 1 }}} {{{id=50| pp[3].coefficients() /// [2, 1] }}} {{{id=51| kv0=[p.coefficients(sparse=False) for p in pp] kv0 /// [[1, 1, 1], [1, -1, 1], [0, -1, 0, 1], [2, 0, 0, 1]] }}} {{{id=52| n=max([p.degree() for p in pp]) +1 n /// 4 }}} {{{id=53| def verlaengern(v,n): for i in range(len(v),n): v.append(0) return v /// }}} {{{id=54| kv=[verlaengern(v,n) for v in kv0] kv /// [[1, 1, 1, 0], [1, -1, 1, 0], [0, -1, 0, 1], [2, 0, 0, 1]] }}} {{{id=55| kv0 /// [[1, 1, 1, 0], [1, -1, 1, 0], [0, -1, 0, 1], [2, 0, 0, 1]] }}} {{{id=56| def linearunabhaengig(pp): n=max([p.degree() for p in pp]) +1 kv0=[p.coefficients(sparse=False) for p in pp] kv=[verlaengern(v,n) for v in kv0] r=rank(matrix(kv)) return (r==len(pp)) /// }}} {{{id=57| linearunabhaengig(pp) /// True }}} {{{id=58| g=(1..4) g /// }}} {{{id=59| g.next() /// 1 }}} {{{id=60| g.next() /// 2 }}} {{{id=61| g.next() /// 3 }}} {{{id=62| g.next() /// 4 }}} {{{id=63| g.next() /// Traceback (most recent call last): File "", line 1, in File "_sage_input_114.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zy5uZXh0KCk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/6d/rpqgvbc16j94tm0q81g0j_n40000gn/T/tmpgS6xiQ/___code___.py", line 2, in exec compile(u'g.next()' + '\n', '', 'single') File "", line 1, in StopIteration }}} {{{id=64| g=(1..4) /// }}} {{{id=65| g.next() /// 1 }}} {{{id=66| list(g) /// [2, 3, 4] }}} {{{id=67| g.next() /// Traceback (most recent call last): File "", line 1, in File "_sage_input_118.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zy5uZXh0KCk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/6d/rpqgvbc16j94tm0q81g0j_n40000gn/T/tmpoCltVl/___code___.py", line 2, in exec compile(u'g.next()' + '\n', '', 'single') File "", line 1, in StopIteration }}} {{{id=68| g=(1..4) for i in g: print i /// 1 2 3 4 }}} {{{id=69| g.next() /// Traceback (most recent call last): File "", line 1, in File "_sage_input_123.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zy5uZXh0KCk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/6d/rpqgvbc16j94tm0q81g0j_n40000gn/T/tmpbNF1zv/___code___.py", line 2, in exec compile(u'g.next()' + '\n', '', 'single') File "", line 1, in StopIteration }}} {{{id=70| nn=(1..) nn.next() /// 1 }}} {{{id=71| nn.next() /// 2 }}} {{{id=72| g=(1..4) g2=(i^2 for i in g) g2 /// at 0x16008a4b0> }}} {{{id=73| g2.next() /// 1 }}} {{{id=74| g2.next() /// 4 }}} {{{id=75| g2.next() /// 9 }}} {{{id=76| g2.next() /// 16 }}} {{{id=77| g2.next() /// Traceback (most recent call last): File "", line 1, in File "_sage_input_131.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZzIubmV4dCgp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/6d/rpqgvbc16j94tm0q81g0j_n40000gn/T/tmpD7qEOT/___code___.py", line 2, in exec compile(u'g2.next()' + '\n', '', 'single') File "", line 1, in StopIteration }}} {{{id=78| def abc(): yield 'a' yield 'b' yield 'c' /// }}} {{{id=79| g=abc() g /// }}} {{{id=80| g.next() /// 'a' }}} {{{id=81| g.next() /// 'b' }}} {{{id=82| g.next() /// 'c' }}} {{{id=83| g.next() /// Traceback (most recent call last): File "", line 1, in File "_sage_input_137.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zy5uZXh0KCk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/6d/rpqgvbc16j94tm0q81g0j_n40000gn/T/tmpNxC3M2/___code___.py", line 2, in exec compile(u'g.next()' + '\n', '', 'single') File "", line 1, in StopIteration }}} {{{id=84| g=abc() /// }}} {{{id=85| g.next() /// 'a' }}} {{{id=86| def abc(cnicht): yield 'a' yield 'b' if cnicht: return yield 'c' /// }}} {{{id=87| g=abc(True) /// }}} {{{id=88| g.next() /// 'a' }}} {{{id=89| g.next() /// 'b' }}} {{{id=90| g.next() /// Traceback (most recent call last): File "", line 1, in File "_sage_input_144.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zy5uZXh0KCk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/6d/rpqgvbc16j94tm0q81g0j_n40000gn/T/tmpv8RoDk/___code___.py", line 2, in exec compile(u'g.next()' + '\n', '', 'single') File "", line 1, in StopIteration }}} {{{id=91| g=abc(False) /// }}} {{{id=92| g=abc(False) /// }}} {{{id=93| g.next() /// 'a' }}} {{{id=94| g.next() /// 'b' }}} {{{id=95| g.next() /// 'c' }}} {{{id=96| def primzw(n=oo): p=3 while p