Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://halgebra.math.msu.su/practicum/practicum-book.pdf
Äàòà èçìåíåíèÿ: Wed Dec 2 09:43:06 2015
Äàòà èíäåêñèðîâàíèÿ: Sat Apr 9 23:14:44 2016
Êîäèðîâêà:
. .

. . , . .

Sage



. 2011




, 2010­2011 . . . . - . . . 3- . , . . , (, , , ) (, , , ) . , , . Sage. , (, , , ), . . , . Sage, , , . , . 5 , . . ( ), . , , . . . , . . , 2011




1 Sage 1.1 1.2 Sage . . . . . . . . . . 1.3 . 1.4 . 1.5 . . . . . . . . . . . . . 1.6 . . . . . . . 1.7 . . . . . . . . . . . . . . . 1.8 . . . . 4 4 5 5 8 9 12 13 13 15 15 17 19 20 21 21 24 26 27 31 31 35 41 41 45 45 46 48 48 49 50

Sage . . . ...... ...... ...... ...... ...... ......

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

2 2.1 . . . . . . . . . . . 2.2 . . . . . . . . . . 2.3 . . . . . . . . . . . . . . . . . . 2.4 . . . . . . . . . . . . . . . . . . . . . 3 3.1 . . . . . . . . . 3.2 3.3 . . . . . . . 3.4 . . . . . . . . . .

... ... ... ...

.... .... .... ....

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

4 4.1 . . . . . . . . . . . 4.2 4.3 . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5.1 . 5.2 . . . . . . . 5.3 5.4 . . . . . . . . 5.5 . . . . . . 5.6 . . . . . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

3


1

Sage
1.1 Sage

Sage (http://sagemath.org) . 2005 , Sage . Sage 200 , . . . Sage GNU Public License; . Magma, Maple, Mathematica MATLAB. , -. , , . ( , C, C++, Fortran, Python) . Sage , GAP, Pari, Singular Maxima. Sage 80 , . , Sage, , , . Sage Python ( ), /++. : , ( Magma, Maple, Mathematica, MATLAB, GP/PARI, GAP, Macaulay 2 . .), Sage . Python . . Python - , . . , , , , , .., Sage. Python . . 4


Python , , , , . . , Sage Python', . . Python http://python.org.

1.2

Sage

Sage Linux- . Sage: 1) ( Linux, OS X, Solaris). 2) () ( Linux, OS X, Solaris). 3) - Live CD, Linux Sage. Sage, . Sage. 4) Sage Windows , Sage Windows , Linux (, VirtualBox). 5) online- Sage http://sagenb.org. Sage , . (, ). Sage : (notebook): Sage . Sage , . online- Sage. : Sage . . , Sage, c Sage . Sage Python'. http://sagenb.org, . Sage .

1.3

.

Sage Python. Python', http://docs.python.org.

5


Sage ( ). , sage:, , . . Sage . Shift + Enter. Enter. = , . C , , , , . (, ) , del: sage: a = sage: a 5 sage: a = sage: a hello sage: del sage: a NameError: 5

"hello"

a name 'a' is not defined

() NameError, a "hello". Sage , , , . . ==, !=, <=, >=, < > , . , Python' : sage: True sage: False sage: True sage: True sage: False sage: True 2 == 2 2 == 3 2<3 a == 5 a != 5 2 <= a < 7

, True False . Python . . +, -, * / Sage , ^ ** // . % . # , . sage: 2+2*2 6 sage: 10/4 6


5/2 sage: 8 sage: 8 sage: 1 sage: 2 sage: True sage: 38

2**3 2^3 10 % 3 10//4

# # ^ ** ( Python') # # ( Python')

4 * (10 // 4) + 10 % 4 == 10 3^2*4 + 2%5

, . Sage Python. , Sage, , Python', , . , ^ Python' , Sage ** , ^ . (, ). , ; . , : sage: a = 5; b = a + 3; c = b^2; c 64 : sage: 2 + \ ... 3 5 Python . , , , . . : sage: sage: a = 5/3 # a type(a) 'sage.rings.rational.Rational'> a = 'hello' # a - type(a) 'str'>

, C Python': . "hello". , , . 7


, . : \". , .

1.4



Sage (list), . . : sage: v = [1, "hello", 2/3, sin(x^3)] sage: v [1, 'hello', 2/3, sin(x^3)] , : sage: v[0] 1 sage: v[3] sin(x^3) range : sage: w = range(2,10) sage: w [2, 3, 4, 5, 6, 7, 8, 9] : sage: len(v) # 4 sage: v[1:3] # [2/3, sin(x^3)] sage: v[-1] # sin(x^3) sage: 2/3 in v # True sage: 2/3 not in v False sage: v.append(1.5) # sage: v [1, 'hello', 2/3, sin(x^3), 1.50000000000000] sage: del v[1] # sage: v [1, 2/3, sin(x^3), 1.50000000000000] sage: w [2, 3, 4, 5, 6, 7, 8, 9] sage: max(w), min(w) 9, 2 sage: v+w # [1, 2/3, sin(x^3), 1.50000000000000, 2, 3, 4,

1 2

5, 6, 7, 8, 9]

sort : 8


sage: sage: sage: [1, 1,

u = [9, 3, 9, 1, 6, 1, 1] u.sort() u 1, 3, 6, 9, 9]

(tuples) . : sage: t = (10, 20, 30) sage: t[1] 20 , , . , . , Python : sage: a, b = 1, 2 sage: a, b = b, a sage: a, b (2, 1) # #

, . (dictionary). : , . . . : sage: d = {'hi':-2, 3/8:pi, e:pi} # sage: d['hi'] -2 sage: d[e] pi sage: 123 in d # False sage: d[123] = 4.5 # sage: del d[3/8] # sage: d {'hi':-2, e:pi, 123:4.5} C (set) .

1.5



: sage: sqrt(3.4) 1.84390889145858 sage: sin(5.135) -0.912021158525540 sage: sin(pi/3) 1/2*sqrt(3) 9


, , . , n, numerical_approx: sage: exp(2) e^2 sage: n(exp(2)) 7.38905609893065 sage: sqrt(pi).numerical_approx() 1.77245385090552 53 . digits prec : sage: n(sin(10), digits=5) -0.54402 sage: n(sin(10), digits=10) -0.5440211109 sage: numerical_approx(pi, prec=200) 3.1415926535897932384626433832795028841971693993751058209749 Sage def: sage: def is_even(n): # ? ... return n%2 == 0 ... sage: is_even(2) True sage: is_even(3) False , . , Python' ( ). Python' : , , . . Python' . : sage: ... sage: True sage: True sage: False def is_divisible_by(number, divisor = 2): return number%divisor == 0 is_divisible_by(6, 2) is_divisible_by(6) is_divisible_by(6, 5)

: sage: is_divisible_by(6, divisor=5) False sage: is_divisible_by(divisor=2, number=6) True 10


Python' . : sage: def f(x, y, *args): ... print args sage: f(1, 2, 3, 4, 5) [3, 4, 5] Python' : , . .: sage: s = sin sage: s(pi/2) 1 . , . , , 0, . sage: def compare (x, y): ... return int(y - x) sage: sage: sage: [8, 7, u = [1, 2, 6, 7, 8, 3, 2] u.sort(compare) u 6, 4, 2, 2, 1]

, compare , Sage int, Integer. y-x Integer, compare int. -, lambda: sage: sage: sage: [9, 7, u = [1, 9, 2, 4, 3, 3, 7] u.sort(lambda x, y: int(y - x)) u 4, 3, 3, 2, 1]

- . map reduce. map () (): sage: seq = [x, y, x^2, y^2, 1] sage: map(sin, seq) [sin(x), sin(y), sin(x^2), sin(y^2), sin(1)] reduce , () . .

11


sage: reduce(lambda x,y: x+y, [1,2,3,4], 0) # 10 sage: reduce(lambda x,y: x*y, [1,2,3,4], 1) # 24 sage: reduce(lambda x,y: x+y,['h','e','l','l','o'],'') # 'hello' , : sage: product([1,2,3,4]) 10 sage: sum([1,2,3,4]) 24 sage: "-".join(['h','e','l','l','o']) 'hello'

1.6



if . ( Python') : sage: if x < 0: ... y = -x ... else: ... y=x Python ( switch C). elif : sage: ... ... ... ... ... ... ... if z == 1: print elif z == print elif z == print else: print

"One" 2: "Two" 3: "Three" "Many"

, and, or not: sage: x = 61 sage: if x > 1 and not is_prime(x): ... print "x is composite" , bool: sage: bool (e^pi < pi^e) False , e pi Sage. e^pi < pi^e sage.symbolic.expression.Expression .

12


1.7


while.

Python' : sage: i = 0 sage: while i < 3: ... print i ... i += 1 0 1 2

. , Python' ++, +=. for. for (, , , ). , , C++ Java for (int i = 0; i < 3; ++i) ..., Python' : sage: for i in range(3): ... print i 0 1 2 # [0, 1, 2]



: sage: for i in range(1,6,2): ... print i 1 3 5 Sage list: , . sage: for in 'abcde': ... print a b c d e break continue .

1.8



Sage . - , :

13


sage: tan? Type: Definition: Docstring: ...

tan( [noargspec] ) The tangent function

: sage: a = 'hello' sage: a? . Sage (tab completion): Tab. , ta + Tab, Sage tachyon, tan, tanh, taylor. dir. Sage , .

14


2


2.1

Sage, , ( ) . , Sage : sage: f = z^2 + 2*z + 1 Traceback (click to the left of this block for traceback) ... NameError: name 'z' is not defined z - (, ), . , z^2 + 2*z + 1 , , z Expression. var: sage: var('z') z sage: f = z^2 + 2*z + 1; f z^2 + 2*z + 1 sage: var('n xx yy zz') (n, xx, yy, zz) sage: f = xx^n + yy^n + zz^n; f xx^n + yy^n + zz^n sage: type(f) < type 'sage.symbolic.expression.Expression' > sage: parent(f) Symbolic Ring . , sin, ln . ., , . Sage x, var: sage: diff (cos(x^3)) -3*x^2*sin(x^3) #

15


sage: diff (cos(x^3), x, -9*x^4*cos(x^3) - 6*x*si sage: integral(sin(x), x -cos(x) sage: integral(sin(x), x 2

2) # n(x^3) ) # , 0, pi) #

: . factor expand: sage: x^2 sage: (x expand((x-1)*(x-2)) # 3*x + 2 factor(x^2 - 2*x + 1) # 1)^2

operator operands : sage: var('x y') (x, y) sage: f=x^2+2*x+1 sage: g=f.operator() sage: g sage:g(1,3) # 1 3 4 sage: f.operands() # [x^2, 2*x, 1] sage: reduce(f.operator(),f.operands(),0) # x^2 + 2*x + 1 solve : sage: sage: [x == sage: sage: [[x == sage: (x, y, sage: sage: [[x == x = var('x') solve(x^2 - 5*x + 6, x) 3, x == 2] x, y = var('x, y') solve([x+y==6, x-y==4], x, y) 5, y == 1]] var('x,y,z,a') z, a) eqns = [x + z == y, 2*a*x - y == 2*a^2, y - 2*z == 2] solve(eqns, x, y, z) a + 1, y == 2*a, z == a - 1]]

var . , Sage : sage: y = var('y', domain='real'); y.conjugate() # y sage: y = var('y', domain='positive'); y.abs() # y A L TEX-: 16


sage: var('aij', latex_name="a_{i,j}") ai,j restore : sage: var('QQ RR') (QQ, RR) sage: QQ QQ sage: restore('QQ') sage: QQ Rational Field

2.2



, , . . ( ) (, ), . Sage: ZZ IntegerRing() ( ); Zmod(n) IntegerModRing(n) ( ); QQ RationalField() ( ); AA AlgebraicRealField() ( ); RR RealField() ( ); CC ComplexField() ( ). (, . .) Sage. , , . : sage: RationalField() Rational Field sage: QQ Rational Field sage: 1/2 in QQ True sage: 1.2 in QQ True sage: pi in QQ False sage: pi in RR True sage: sqrt(2) in QQ False sage: sqrt(2) in CC True 17


: sage: Finite # sage: Finite sage: 5-adic sage: True GF(3) # Field of size 3 , GF(27, 'a') Field in a of size 3^3 Zp(5) # 5- Ring with capped relative precision 20 sqrt(3) in QQbar #

: sage: R = IntegerModRing(51) sage: M = MatrixSpace(R,3,3) # # 3x3

3 â 4, MatrixSpace(R,3,4). , MatrixSpace(R,3) MatrixSpace(R,3,3). 0 1 : sage: [0 0 [0 0 [0 0 sage: [1 0 [0 1 [0 0 sage: [5 0 [0 5 [0 0 M(0) 0] 0] 0] M(1) 0] 0] 1] 5*M(1) 0] 0] 5] PRR

: PRQ . sage: PRQ. = PolynomialRing(QQ) sage: PRR. = PolynomialRing(RR)

, , : sage: t^2 sage: (z factor(t^2-2) 2 factor(z^2-2) 1.41421356237310) * (z + 1.41421356237310)

97 : sage: sage: sage: sage: True R x f f = = = in PolynomialRing(GF(97),'x') R.gen() x^2 + 7 R

18


: sage: R = PolynomialRing(GF(97),'x') sage: x = R.gen() sage: S = R.quotient(x^3 + 7, 'a') sage: a = S.gen() sage: S Univariate Quotient Polynomial Ring in a over Finite Field of size 97 with modulus x^3 + 7 sage: S.is_field() True sage: a in S True sage: x in S # x S True sage: S.polynomial_ring() Univariate Polynomial Ring in x over Finite Field of size 97 sage: S.modulus() x^3 + 7 sage: S.degree() 3 , : sage: sage: sage: sage: (x^14 R = PolynomialRing(GF(97),'x') x = R.gen() f = x^7+1 (f^3).quo_rem(x^7-1) + 4*x^7 + 7, 8)

. sage: sage: Free sage: x^3 + y*x^2 z*x^2 R. R Algebra on (x+y+z)^3 x^2*y + x^ + y*x*y + + z*x*y + = FreeAlgebra(QQ,3) 3 generators (x, y, z) over Rational Field # 2*z + x*y*x + x*y^2 + x*y*z + x*z*x + x*z*y + x*z^2 + y*x*z + y^2*x + y^3 + y^2*z + y*z*x + y*z*y + y*z^2 + z*x*z + z*y*x + z*y^2 + z*y*z + z^2*x + z^2*y + z^3

2.3



1. simplify, . simplify_exp, simplify_factorial, simplify_log, simplify_radical, simplify_rational simplify_trig. 2. sum product . 3. plot. 4. , Sage f(x=g), f g , x ? x=g? 5. , is_ (, is_field ). Sage - , .

19


2.4



1. , , . 2. , , , . 3. mgcd, . (: gcd , reduce). 4. gcd xgcd, . 5. , . diff integrate . 6. ( Z[i]) x2 + 1. , - . , . a = 40 + i b = 3 - i 20 + 9i 11 + 2i. , Z -n n . n 7. n 1000, Z[i]/ n , , .

8. , . 9. is_field, is_maximal, is_radical . ., factor_is_field(f), factor_is_domain(f) factor_has_nilpotents(f), () f , ( ) f , .

20


3


3.1

matrix ( Matrix). ( ) . : sage: A = matrix(3) # 3x3 sage: B = matrix(3,4) # 3x4 sage: C = matrix([[1,2,3],[3,2,1],[1,1,1]]) # . : sage: v1 = vector([1,1,-4]) sage: v2 = vector([2,3,4]) sage: A = matrix([v1, v2]) sage: A [1, 1,-4] [2, 3, 4] , : sage: AZ = matrix(ZZ, [[2,0], [0,1]]) sage: AQ = matrix(QQ, [[2,0], [0,1]]) sage: AR = matrix(RR, [[2,0], [0,1]]) , . -: sage: m sage: m [ 1 1/2 [1/2 1/3 [1/3 1/4 = matrix(3, 3, lambda i,j: 1/(i+j+1)) 1/3] 1/4] 1/5]

: sage: R = PolynomialRing(QQ, 9, 'x') sage: A = matrix(R, 3, 3, R.gens()); A [x0 x1 x2] 21


[x3 x4 x5] [x6 x7 x8] sage: det(A) -x2*x4*x6 + x1*x5*x6 + x2*x3*x7 - x0*x5*x7 - x1*x3*x8 + x0*x4*x8 . sage: A = matrix([[1,2,3],[3,2,1],[1,1,1]]) sage: w = vector([1,1,-4]) sage: w*A # - (0, 0, 0) sage: A*w # - (-9, 1, -2) + *. , -1. , , determinant ( det), trace, rank . . , , 51: sage: R = IntegerModRing(51) sage: M = MatrixSpace(R, 3, 3) sage: A = M([1,2,3, 4,5,6, 7,8,9]) sage: A^1000*A^1007 [ 3 3 3] [18 0 33] [33 48 12] sage: A^2007 # [ 3 3 3] [18 0 33] [33 48 12] rows() columns(): sage: sage: ... sage: [1 1 [0 1 [0 0 [0 0 sage: [(1, (0, sage: [(1, (1, M = MatrixSpace(GF(2),4,8) A = M([1,1,0,0, 1,1,1,1, 0,1,0,0, 0,0,1,0, 1,1,0,1, 0,0,1,1, A 0 0 1 1 1 1] 0 0 1 0 1 1] 1 0 1 1 0 1] 1 1 1 1 1 0] A.rows() 1, 0, 0, 1, 1, 1, 1), (0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1), (0, 0, 1, 1, A.columns() 0, 0, 0), (1, 1, 0, 0), (0, 0, 1, 1 1, 1, 1), (1, 0, 1, 1), (1, 1, 0, 1

1,0,1,1, 1,1,1,0])

1, 0, 1, 1), 1, 1, 1, 0)] ), (0, 0, 0, 1), ), (1, 1, 1, 0)]

: sage: A = matrix(3,3,range(1, 10)) sage: A[2,0] = 0 # 22


sage: sage: [1 2 [0 0 [0 8

A[1] = vector([0,0,0]) # 2- A 3] 0] 9]

Sage kernel , , {w | wA = 0}. right_kernel. , right_kernel . sage: kernel(A) Free module of degree 3 and rank 1 over Integer Ring Echelon basis matrix: [ 1 1 -4] AX = Y : sage: Y sage: X sage: X (-2, 1, sage: A (0, -4, = vector([0, -4, -1]) = A.solve_right(Y) 0) *X -1)

#

solve_right \. Sage A \ Y A.solve_right(Y). sage: A \ Y (-2, 1, 0) , , . , Sage : sage: A.solve_right(w) Traceback (most recent call last): ... ValueError: matrix equation has no solutions , A.solve_left(Y) X A = Y . : sage: M = MatrixSpace(RationalField(), 2, 3) sage: A = M([1,2,3, 4,5,6]) sage: A [1 2 3] [4 5 6] sage: A.echelon_form() # [ 1 0 -1] [ 0 1 2] : sage: A = matrix([[0, 4], [-1, 0]]) sage: A.eigenvalues() [-2*I, 2*I] 23


sage: sage: [(4, (-2,

B = matrix([[1, 3], [3, 1]]) B.right_eigenvectors() [(1, 1)], 1), [(1, -1)], 1)]

( , , ). , : sage: R. = ZZ[] sage: M = MatrixSpace(R,2)([[a,1], [a,a+1]]) sage: M [ a 1] [ a a + 1] sage: f = M.charpoly() sage: f x^2 + (-2*a - 1)*x + a^2 sage: f.parent() Univariate Polynomial Ring in x over Univariate Polynomial Ring in a over Integer Ring sage: M.trace() # 2*a + 1 sage: M.det() # a^2 charpoly , ( x): sage: sage: sage: Z^2 + R. = PolynomialRing(ZZ,2) A = MatrixSpace(R,2)([u,v,u^2,v^2]) f = A.charpoly('Z'); f (-v^2 - u)*Z - u^2*v + u*v^2

Sage sparse. ( ), . : sage: sage: sage: sage: M # A E = MatrixSpace(QQ, 50, 100, sparse=True) : = M.random_element(density=0.05) = A.echelon_form()

3.2



. , Sage . sage: V = VectorSpace(GF(2),8) sage: S1 = V.subspace([V([1,1,0,0,0,0,0,0]),V([1,0,0,0,0,1,1,0])]) sage: # , 24


sage: s1 Vector space of degree 8 and dimension 2 over Finite Field of size 2 Basis matrix: [1 0 0 0 0 1 1 0] [0 1 0 0 0 1 1 0] sage: S1.basis() [ (1, 0, 0, 0, 0, 1, 1, 0), (0, 1, 0, 0, 0, 1, 1, 0) ] sage: S1.dimension() 2 : sage: S2 = V.subspace([V([1,1,1,1,0,0,0,0]),V([1,1,0,0,0,1,0,1])]) sage: S1+S2 Vector space of degree 8 and dimension 4 over Finite Field of size 2 Basis matrix: [1 0 0 0 0 0 1 1] [0 1 0 0 0 0 1 1] [0 0 1 1 0 0 0 0] [0 0 0 0 0 1 0 1] sage: S1.intersection(S2) Vector space of degree 8 and dimension 0 over Finite Field of size 2 Basis matrix: [] . 3 â 3: sage: M = MatrixSpace(QQ,3) sage: M Full MatrixSpace of 3 by 3 dense matrices over Rational Field : sage: sage: 9 sage: [0 1 [0 0 [0 0 B = M.basis() len(B) B[1] # ! 0] 0] 0]

, : sage: [0 1 [3 4 [6 7 A = M(range(9)); A 2] 5] 8]

: 25


sage: V = VectorSpace(GF(2),8) sage: A = M([1,1,0,0, 1,1,1,1, 0,1,0,0, 1,0,1,1, ... 0,0,1,0, 1,1,0,1, 0,0,1,1, 1,1,1,0]) sage: rows=A.rows() sage: S = V.subspace(rows) sage: S Vector space of degree 8 and dimension 4 over Finite Field of size 2 Basis matrix: [1 0 0 0 0 1 0 0] [0 1 0 0 1 0 1 1] [0 0 1 0 1 1 0 1] [0 0 0 1 0 0 1 1] sage: A.echelon_form() [1 0 0 0 0 1 0 0] [0 1 0 0 1 0 1 1] [0 0 1 0 1 1 0 1] [0 0 0 1 0 0 1 1] , S Sage .

3.3


1. (1 + )x1 + x2 + x3 = 1, x + (1 + )x2 + x3 = , 1 x1 + x2 + (1 + )x3 = 2 ;

. 2. (-1, 6, 4, 7, -2), (-2, 3, 0, 5, -2), (-3, 6, 5, 6, -5) (1, 1, 2, 1, -1), (0, -2, 0, -1, -5), (2, 0, 2, 1, -3) . 3. , (1, -1, 1, -1, 1), (1, 1, 0, 0, 3), (3, 1, 1, -1, 7) . 4. R
4

U = (1, 1, 1, 1), (-1, -2, 0, 1) ,

V = (-1, -1, 1, -1), (2, 2, 0, 1) .

, R4 = U V , (4, 2, 4, 4) U V . 5. 5x2 + x2 + x2 + 4x1 x2 - 2x1 x3 - 2x2 x 1 2 3 ? ?
3

6. A (f1 , . . . , fn ), A , (e1 , . . . , en ) A 0 1 -1 1 -1 2 -1 1 -1 1 1 0. -1 1 0 1 26


4 -2 2 4 -1. 7. 4 -2 4 2



3.4


1. , : x 1 0 ... 0 1 1 1 ... 1 0 . . . 0 x1 x2 . .. .. 1 2 2 . . . 2 . . . . . . 2! x . x . . . 1 2 3 . . . 3 . .. .. .. 2 . ) , ) . . . 0 . . , ) . . . . . . 0 ... 0 . . . . . . .. .. ... . . . 1 . . x1 x2 . . . xn 2 1 2 3 ... n xn ... ... x x n! 2!

) ) ). . 2. , xn xn+1 . . . x2n-2 x2n-1 x1 x2 . . .. .. .. x2 . x3 . . . . . . A= . B= . .. .. . . . . x2 . . xn+1 xn xn+1 x1 x2 . . . xn-1 xn 3. A = (aij ) m â n, B = (bij ) A B a11 B a12 B . . . a1n B . . . . . AB = . . . . am1 B am2 B . . . amn B x1 , . . . , x
2n-1

-

... ...

xn xn+1 . . .
1

.

. . . x2n-

r â s.

mr â ns. , . ? 4. ( .) : x11 x21 . . . xn x
i,j 1

x12 x22 . . . xn
2

. . . x1n . . . x2n 1 .= .. . x12 . . . x . . . . . xnn

1,n-1

x11 x12 x21 x22 . . . x11 x12 xn1 xn2

x x

12 22

x x . . .

13 23

... .. . ...

x x

1,n-1 2,n-1

x x

1n 2n

. . . x1,n-1 x1n xn,n-1 xnn

,

x12 x13 xn2 xn3

. . n.

5. ( .) M

P = {p1 < . . . < pk } Q = {q1 < . . . < qk } 1 n. P = {p
k+1

< . . . < pn } Q = {q 27

k+1

< . . . < qn }


. MP,Q M , P Q. , : det (M
-1

)P

,Q

= sgn( ) det M

Q,P

(det M )-1 ,

Sn , (i) = pi (j ) = qj . . k = 1 k = n? 6. M = (xij ) N = (yij B x1i x2i Bij = . . . x
ni

) y11 y21 . . . y
n1

n. . . . y1,j . . . y2,j . . . . . . . . . yn,j y y y . . . y1n . . . y2n . . . . . . . . . . ynn

-1 -1

1,j +1 2,j +1

. . .
-1 n,j +1

, det B = (det M ) (det N ) 7. A = (aij )
n-1

.

1 .

) , pf A aij , A, , det A = (pf A)2 . pf A . . ) , . 8. - H M4 (R). , . :
2 2 2 2 (x2 + x2 + x2 + x2 )(y1 + y2 + y3 + y4 ) = 1 2 3 4

= (x1 y1 + x2 y2 + x3 y3 + x4 y4 )2 + (x1 y2 - x2 y1 - x3 y4 + x4 y3 )2 + +(x1 y3 + x2 y4 - x3 y1 - x4 y2 )2 + (x1 y4 - x2 y3 + x3 y2 - x4 y1 )2 . 9. , , , . (: .) 10. , , . (: .) 11. , . 12. , v1 , . . . , vn ( ) x1 , . . . , xn , v1 , . . . , vn .
1

A, ?

28


13. a1 1 00 -1 a2 1 0 (a1 a2 . . . an ) = 0 -1 a3 1 ............... 0 0 00 n, (a1 a2 . . . an ) = a1 + (a2 a3 . . . an ) a2 + 1
1 a3 +...+
1

. . . ... .

. . . . .

.0 0 .0 0 .0 0. .......... . -1 an

.
1 1 an-1 + a n

.. .

14. . , ( , - ). 15. , . 16. , . 17. . (: .) 18. , . 19. , - . 20. , v L, v L. 21. n 100 , A = ( (i, j )) n â n (2)(3) . . . (n), . A = ( (i, j ))? 22. , , . 23. , . , , . - , . 24. , R , () . 25. , , R. 26. , , ) 29


) - . 27. , , . 28. , A Mn (C) Ak , k , . (: jordan_form .)

30


4


4.1

Sage ( ) , . . ( ) . , ZZ, QQ, RR, CC, Zmod(n), GF(p), GF(p^n, 'x'). : sage: R = PolynomialRing(QQ, 't') sage: R Univariate Polynomial Ring in t over Rational Field sage: S = QQ['t'] sage: S == R True sage: R3 = PolynomialRing(GF(5),3,'z') # 3 - sage: R3 Multivariate Polynomial Ring in z0, z1, z2 over Finite Field of size 5 sage: S3 = GF(5)['z0, z1, z2'] Multivariate Polynomial Ring in z0, z1, z2 over Finite Field of size 5 sage: R3 == S3 True Q[t] F5 [z0 , z1 , z2 ] Sage, t zi , . Sage (, , , t2 + 1). sage: t^2 + 1 Traceback (click to the left of this block for traceback) ... NameError: name 't' is not defined sage: t = R.0 # sage: t^2 + 1 t^2 + 1 sage: w = R3.gens() # sage: w[0]*w[1] + w[2] z[0]*z[1] + z[2] 31


, Sage, , . , Sage , Python. Sage, . . : sage: R3. = PolynomialRing(QQ) sage: R3. = QQ['x,y,z'] sage: R3. = QQ[] , Python, preparse: sage: preparse('R3. = QQ[]') R3 = QQ['x,y,z']; (x,y,z,) = R3._first_ngens(3) sage: preparse('x = R3.0') x = R3.gen(0) : sage: sage: sage: sage: R, t = QQ['t'].objgen() t = QQ['t'].gen() R, t = objgen(QQ['t']) t = gen(QQ['t'])

: sage: t^2 + sage: True sage: sage: 4*t^14 sage: sage: t^6 + sage: sage: 7*t^16 poly = (t+1) * (t+2); poly 3*t + 2 poly in R

f = 2*t^7 + 3*t^2 - 15/19 f^2 + 12*t^9 - 60/19*t^7 + 9*t^4 - 90/19*t^2 + 225/361 # cyclo = R.cyclotomic_polynomial(7); cyclo t^5 + t^4 + t^3 + t^2 + t + 1 g = 7 * cyclo * t^5 * (t^5 + 10*t + 2) g + 7*t^15 + 7*t^14 + 7*t^13 + 77*t^12 + 91*t^11 + 91*t^10 + 84*t^9 + 84*t^8 + 84*t^7 + 84*t^6 + 14*t^5 sage: F = factor(g); F (7) * t^5 * (t^5 + 10*t + 2) * (t^6 + t^5 + t^4 + t^3 + t^2 + t + 1) sage: F.unit() # 7 sage: list(F) # [(t, 5), (t^5 + 10*t + 2, 1), (t^6 + t^5 + t^4 + t^3 + t^2 + t + 1, 1)]

:

32


sage: sage: sage: (x sage: sage: ... sage: (-9)

x = PolynomialRing(RationalField(), 'x').gen() f = (x^3 - 1)^2 - (x^2-1)^2 f.factor() 1)^2 * x^2 * (x^2 + 2*x + 2) x, y = PolynomialRing(RationalField(), 2, ['x','y']).gens() f = 9*y^6 - 9*x^2*y^5 - 18*x^3*y^4 - 9*x^5*y^4\ + 9*x^6*y^2 + 9*x^7*y^3 + 18*x^8*y^2 - 9*x^11 f.factor() * (x^5 - y^2) * (x^6 - 2*x^3*y^2 - x^2*y^3 + y^4)

Sage . , cyclotomic_polynomial factor, , PARI. factor Singular. F97 [x]/(x3 + 7). , , x2011 (mod x3 + 7). x a: sage: R = PolynomialRing(GF(97),'x') sage: x = R.gen() sage: S = R.quotient(x^3 + 7, 'a') # sage: a = S.gen() sage: S Univariate Quotient Polynomial Ring in a over Finite Field of size 97 with modulus x^3 + 7 sage: a^2011 2*a : sage: sage: x-1 sage: sage: sage: sage: x^2 + sage: sage: x^5 + sage: sage: x^4 + x = PolynomialRing(QQ, 'x').gen() gcd (x^3-1, x^2-1) R3. = PolynomialRing(QQ, 3) f = 3*x^2*(x+y) g = 9*x*(y^2 - x^2) f.gcd(g) x*y x = PolynomialRing(GF(2), 'x').gen() f = (x^3 - x + 1)*(x + x^2); f x^4 + x^3 + x g = (x^3 - x + 1)*(x + 1) f.gcd(g) x^3 + x^2 + 1

, Sage : sage: x = QQ['x'].0 sage: f = x^3 + 1; g = x^2 - 17 sage: h = f/g; h (x^3 + 1)/(x^2 - 17) sage: h.parent() # , h Fraction Field of Univariate Polynomial Ring in x over Rational Field

33


: sage: R. = PowerSeriesRing(GF(7)); R # Power Series Ring in T over Finite Field of size 7 sage: f = T + 3*T^2 + T^3 + O(T^4) sage: f^3 T^3 + 2*T^4 + 2*T^5 + O(T^6) sage: 1/f T^-1 + 4 + T + O(T^2) sage: parent(1/f) Laurent Series Ring in T over Finite Field of size 7 sage: R. = LaurentSeriesRing(QQ); R # Laurent Series Ring in x over Rational Field sage: 1/(1-x) + O(x^10) 1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + O(x^10) : sage: GF(7)[['T']] Power Series Ring in T over Finite Field of size 7 , Sage , ( ): sage: sage: sage: False sage: False sage: x sage: x^2 sage: sage: sage: True sage: True sage: True R. = PolynomialRing(QQ) S. = PolynomialRing(QQ) x == y R == S R(y) # y x

R(y^2 - 17) 17 R = PolynomialRing(QQ, "x") T = PolynomialRing(QQ, "x") R == T R is T R.0 == T.0
n k k=0 bk x

, f (x) = m ak xk g (x) = k=0 (m + n) â (m + n): am am-1 0 am ··· ··· 0 ··· Res(f (x), g (x)) := bn bn-1 0 bn ··· ··· 0 ··· · · · · · · · · · · · · · · · · · · · · · · · · ··· ··· ··· ··· b0 b1 ··· ··· · · · · ·· ·· ·· ·· 0 b0 ··· ··· a0 a1 ··· ··· ··· ··· ··· ··· 0 a0 ··· ··· ··· ··· ··· ··· · · · · · · · · · · · · · · · · · · · · · · · · 0 0 ··· a0 0 0 ··· b0

34


, . , Res(f , g ) = (x - y ),
f (x)=0,g (y )=0

f g . Sage resultant: sage: sage: sage: sage: 0 R. = QQ[] f = x^3 - 1 g = x^2 - 1 f.resultant(g)

. . (, ) Sage Singular. sage: R1 = PolynomialRing(GF(5),3,'z'); R1 Multivariate Polynomial Ring in z0, z1, z2 over Finite Field of size 5 sage: R2. = QQ[] sage: f = (x^3 + 2*y^2*x)^2 sage: g = x^2*y^2 sage: f.gcd(g) x^2 Sage . , dict. , . : sage: R. = QQ[] sage: f = x^2*y + y^3 sage: f.dict() {(0, 3): 1, (2, 1): 1} sage: list(f) [(1, x^2*y), (1, y^3)] sage: d = {(1,2):3, (4,5):6} sage: R(d) 6*x^4*y^5 + 3*x*y^2

4.2



, [1, 3, 12, 13, 11, 10]. ( , ) , . , , (f , g ) Q[x, y ]. (f,g) R ( ideal([f,g]) ideal(f,g)): 35


sage: sage: Ideal Ring

R. = QQ[] I = (f, g)*R; I (x^6 + 4*x^4*y^2 + 4*x^2*y^4, x^2*y^2) of Multivariate Polynomial in x, y over Rational Field

F [x1 , . . . , xn ] F . , () . , . , , , 1. m1 2. 1 m2 = mm
1

mm2 m, m1 , m2 ;

m m.

(lex), (deglex) (degrevlex): x
a1 1

. . . xan n

deg rev lex

xb1 . . . xbn n 1



ai , bn , . . . , b

1

lex

bi , an , . . . , a

1

.

F [x] ( ). , . , f , lm f , lc f . 1. G I F [x1 , . . . , xn ] , I = (G) f I g G, , lm g | lm f . , G , lm G (lm I ). G I , f G: f , lm g g G, f g , , . . F [x1 , . . . , xn ]/I . , f I , f G . ( , , ). : I1 = (F ) I2 = (G), G I2 . I1 I2 , F I2 , , G . , . , . 36


, I1 I2 I2 I1 : , . f g . S- S (f , g ) = lc g lm g lm f f - lc f g. (lm f , lm g ) (lm f , lm g )

, f g , , , . : G (G) , S- G G . : S- , , . Sage ( , ): sage: B = I.groebner_basis(); B [x^6, x^2*y^2] : G I F [x1 , . . . , xn ] x1 x2 . . . xn , GF [x1 , . . . , xk ] I F [x1 , . . . , xk ]. : , . . , x6 , y . , ( , I ­ ). , : sage: x^2 in I False . 1. x4 + x3 - x - 1 = 0, x3 + 2x2 + 2x + 1 = 0, 6 x + x5 + x2 + 2 x + 1 = 0 x. , . , F [x] F [x]. , F [x] . , : sage: R. = PolynomialRing(QQ, 'x') sage: I = (x^4+x^3-x-1, x^3+2*x^2+2*x+1, x^6+x^5+x^2+2*x+1)*R; I Principal ideal (x^3 + 2*x^2 + 2*x + 1) of Univariate Polynomial Ring in x over Rational Field 37


Sage , groebner_basis. 2. x2 - 3xy - y 2 + 5x - 7y + 1 = 0, 3x2 + xy + 7x + 3y = 0, 3 x + 5 x2 + x + 3 y 2 - 1 = 0 . , x, y -1 1 = 0. , . : sage: R. = PolynomialRing(QQ, 2, 'x y') sage: I = (x^2 - 3*x*y - y^2 + 5*x - 7*y + 1, ... 3*x^2 + x*y + 7*x + 3*y, ... x^3 + 5*x^2 + x + 3*y^2 - 1) * R sage: I.groebner_basis() [1] . , , : x2 + 1 = 0 R. 3. I = (x2 + y 2 + z 2 , x + y - z , y + z 2 ) x > y > z . S- . z 4 + z 3 + z 2 . , . 4. ab = c2 + c, a2 = a + bc, ac = b2 + b. (a > b > c): sage: sage: sage: [c^3 a*c R. = QQ[] I = (a*b - c^2 - c, a^2 - a - b*c, a*c - b^2 - b) * R I.groebner_basis() + c^2, a^2 - a, a*b - c^2 - c, b^2 - c^2 + b - c, c^2 - c, b*c]

, , c. , I Q[c] Q[c]. . , c 0 -1. , b c. : (0, 0, 0); (1, 0, 0); (0, -1, 0); (0, 0, -1). . , , . (, F4 F5). . , , cyclicN. cyclic4: 38


sage: R. = PolynomialRing(QQ, 4, 'abcd', order='lex') sage: I = (a+b+c+d, a*b+a*d+b*c+c*d, a*b*c+a*b*d+a*c*d+b*c*d, \ a*b*c*d-1)*R sage: I Ideal (a + b + c + d, a*b + a*d + b*c + c*d, a*b*c + a*b*d + a*c*d + b*c*d, a*b*c*d - 1) of Multivariate Polynomial Ring in a, b, c, d over Rational Field , cyclicN N N 1 N , ( ) N . sage: B = I.groebner_basis(); B [a + b + c + d, b^2 + 2*b*d + d^2, b*c - b*d + c^2*d^4 + c*d - 2*d^2, b*d^4 - b + d^5 - d, c^3*d^2 + c^2*d^3 - c - d, c^2*d^6 - c^2*d^2 - d^4 + 1] , Sage , : sage: B.parent() Category of sequences in Multivariate Polynomial Ring in x, y over Rational Field sage: B.universe() Multivariate Polynomial Ring in x, y over Rational Field sage: B[1] = x Traceback (most recent call last): ... ValueError: object is immutable; please change a copy instead. , . Sage . . , Sage (cyclic, katsura ..), . Katsura-6 degrevlex: sage: from sage.rings.polynomial.toy_buchberger import * sage: # sage: P. = \ PolynomialRing(GF(32003), 10, order="degrevlex") sage: I = sage.rings.ideal.Katsura(P,6) sage: g1 = buchberger(I) sage: g2 = buchberger_improved(I) sage: g3 = I.groebner_basis() :

39


sage: Ideal(g1).basis_is_groebner() True sage: Ideal(g2).basis_is_groebner() True sage: Ideal(g3).basis_is_groebner() True , , : sage: Ideal(g1) == Ideal(g2) == Ideal(g3) True get_verbose() >= 1, Sage : sage: sage: sage: sage: Ideal 2*a*b in a, sage: set_verbose(1) P. = PolynomialRing(GF(127),3) I = sage.rings.ideal.Katsura(P) I (a + 2*b + 2*c - 1, a^2 + 2*b^2 + 2*c^2 - a, + 2*b*c - b) of Multivariate Polynomial Ring b, c over Finite Field of size 127 G = I.groebner_basis()

15 . , 3 . . , : sage: R. = QQ[] sage: f = (x^3 + 2*y^2*x)^2 sage: g = x^2*y^2 sage: I = (f, g)*R sage: I.primary_decomposition() [Ideal (x^2) of Multivariate Polynomial Ring in x, y over Rational Field, Ideal (y^2, x^6) of Multivariate Polynomial Ring in x, y over Rational Field] sage: I.associated_primes() [Ideal (x) of Multivariate Polynomial Ring in x, y over Rational Field, Ideal (y, x) of Multivariate Polynomial Ring in x, y over Rational Field] sage: a,b,c = QQ['a,b,c'].gens() sage: X,Y = GF(7)['X,Y'].gens() sage: I = ideal(a, b^2, b^3+c^3) sage: J = ideal(X^10 + Y^10) sage: I.minimal_associated_primes () [Ideal (c, b, a) of Multivariate Polynomial Ring in a, b, c over Rational Field] sage: J.minimal_associated_primes () [Ideal (Y^4 + 3*X*Y^3 + 4*X^2*Y^2 + 4*X^3*Y + X^4) of Multivariate 40


Polynomial Ring in X, Y Ideal (Y^4 + 4*X*Y^3 + Polynomial Ring in X, Y Ideal (Y^2 + X^2) of M Finite Field of size 7]

over Finite 4*X^2*Y^2 + over Finite ultivariate

Field of size 7, 3*X^3*Y + X^4) of Multivariate Field of size 7, Polynomial Ring in X, Y over

4.3


1. t4 + t2 + 1, t4 - t2 - 2t - 1 t3 - 1.

t3

2. f (t) = t3 + 2t2 - t - 2, g (t) = t3 - 2t2 - t + 2 h(t) = - t2 - 4t + 4 u(t), v (t) w(t), , (f , g , h) = uf + v g + wh. 3. t11 - t10 + 2t8 - 4t7 + 3t5 - 3t4 + t3 + 3t2 - t - 1 ( ). 4. t4 + t3 + t + 2 F3 [x]. 5. t3 + 2t2 + 4t + 1 F5 [x]. 6. a, t4 - 14t3 + 61t2 + 84t + a . 7. , t3 - t + 2 t2 + t + 2 . 8. , t4 - 4t3 + (2 - )t2 + 2t - 2 . 9. Z7 f (x) f (0) = 1, f (1) = 0 f (k ) = k k . 29. y z + x2 + z = 0, xy z + xz - y 3 = 0, xz + y 2 = 0. 30. x2 + z 2 y + y z = 0, y 2 - z x + x = 0, xy + z 2 - 1 = 0.

4.4



1. , . , . 2. , Q . 41


3. , k - n . 4. , , . 5. f 1 , . . . , n . h, , h(1 , . . . , n ) = f . 6. sk = xk + . . . + xk n 1 n,
k

.

1 22 sk = 32 . . . (k - 1) k k s s k = 1 k! s
1 2 k -1

1
1

0 1 1 .. . k k
-3 -2

2 . . . k k 1 s
1 -2 -1

... 0 0 .. .00 .. .00 . .. .. . .. . .. . 1 1 . . . 2 1

0 2 s1 .. . sk sk
-3 -2

s3 . . .
k -1

s2 . . . s s
k -2 k -1

sk

... 0 0 .. .0 0 .. .0 0 .. .. .. . . . . .. . s1 k - 1 . . . s2 s1

7. , f , g Q[x] ) Q[x]/(f ) Q[x]/(g ). ) Q[x]/(f ) Q[x]/(g ). 8. , R, x1 , . . . , xn , , () . 9. resultant, () . 10. f R[x] f = (x - a1 ) . . . (x - an ) C. f ai . sk = j ak B = (si+j -2 ) j n â n. sk aj , f , B f , . , B f , B ( ) f . , .

42


11. I(V(x5 -2x4 +2x2 -x, x5 -x4 -2x3 + 2x2 + x - 1)). , radical ( ). ? 12. , S- . 13. , . 14. , , . 15. , , (, , ). 16. , d, d 22 . (xn+1 - y z n-1 w, xy n-1 - z n , xn z - y n w) degrevlex c x > y > z > w. n, n2 + 2. 17. I = (x5 + y 4 + z 3 - 1, x3 + y 2 + z 2 - 1), lex degrevlex x > y > z . , degrevlex- . I = (x5 + y 4 + z 3 - 1, x3 + y 3 + z 2 - 1) ( ). lex-? ? , . 18. I = (x4 - y z 2 w, xy 2 - z 3 , x3 z - y 3 w), lex- degrevlex- , degrevlex- , lex. 19. t2 + x2 + y 2 + z 2 = 0, t2 + 2x2 - xy - z 2 = 0, t + y 3 - z 3 = 0. t . 20. : x = 3u + 3uv 2 - u3 , y = 3v + 3u2 v - v 3 , z = 3u2 - 3v 2 . V , . . 21. 9 : , , , . , , , , ? ?

43


22. : . 23. , . a, b, c . , la , lb lc , . g (a, la , lb , lc ) . la = 2, lb = 3 lc = 6. ? 24. f , , f 2 , f . . , > 0 f , , |Supp(f 2 )| < |Supp(f )|, |Supp(f )| ­ .

44


5


5.1

Sage , (, SUn (Fq )), , ( , ). Sage, , GAP (Groups, Algorithms, and Programming, . http://www.gap-system.org). (, , . .). Sn . . Sage . Sage . . = (1 3)(2 5 4) : : "(1,3)(2,5,4)"; : [(1,3), (2,5,4)]. Sn SymmetricGroup(n). , , : sage: G = SymmetricGroup(5) sage: sigma = G("(1,3)(2,5,4)") sage: rho = G([(1,4), (2,5)]) sage: rho(4) 1 sage: rho^-1 * sigma * rho (1,5,2)(3,4) : sage: sigma = G("(1,3)(2,5,4)") sage: sigma.order() 6 sage: sigma.sign() -1 , Sage ( /sage/devel/sage/sage/groups/perm_gps/permgroup_named.py): 45


SymmetricGroup(n): Sn ; CyclicPermutationGroup(n): Zn ; AlternatingGroup(n): An ( ); DihedralGroup(n): Dn ; KleinFourGroup(): V4 ( 4). Sn PermutationGroup, : sage: G = PermutationGroup(['(3,4)', '(1,2,3)(4,5)']) sage: G Permutation Group with generators [(3,4), (1,2,3)(4,5)] sage: g = G.gen(1); g # (1,2,3)(4,5) sage: g*g (1,3,2) sage: G.order() 120 sage: G.is_abelian() False sage: G.center() Permutation Group with generators [()] sage: G.random_element() # (1,5,3)(2,4) sage: print latex(G) # LaTeX \langle (3,4), (1,2,3)(4,5) \rangle : sage: H = DihedralGroup(6) sage: H.is_abelian() False sage: H.order() 12 sage: H.list() # [(), (2,6)(3,5), (1,2)(3,6)(4,5), (1,2,3,4,5,6), (1,3)(4,6), (1,3,5)(2,4,6), (1,4)(2,3)(5,6), (1,4)(2,5)(3,6), (1,5)(2,4), (1,5,3)(2,6,4), (1,6,5,4,3,2), (1,6)(2,5)(3,4)] sage: H.cayley_table() # sage: H.center().list() show(H.cayley_graph()) .

5.2



S5 : sage: sage: sage: sage: [(), G = SymmetricGroup(5) sigma = G("(1,2,3)(4,5)") H = G.subgroup([sigma]) H.list() (4,5), (1,2,3), (1,2,3)(4,5), (1,3,2), (1,3,2)(4,5)] 46


20 : sage: n = sage: CN sage: for ... 20 = CyclicPermutationGroup(n) g in CN: print g.order(), g

is_normal() , : sage: sage: sage: sage: sage: sage: True A4 = AlternatingGroup(4) r1 = A4("(1,2)(3,4)") r2 = A4("(1,3)(2,4)") r3 = A4("(1,4)(2,3)") V4 = A4.subgroup([r1,r2,r3]) V4.is_normal(A4)

A4 /V4 : sage: A4.quotient(V4) A4 A5 : sage: AlternatingGroup(5).is_simple() True sage: AlternatingGroup(4).is_simple() False S4 : sage: S4 = SymmetricGroup(4) sage: S4.normal_subgroups() [Permutation Group with generat Permutation Group with generat Permutation Group with generat Permutation Group with generat

ors ors ors ors

[()], [(1,3)(2,4), (1,4)(2,3)], [(2,4,3), (1,3)(2,4), (1,4)(2,3)], [(1,2), (1,2,3,4)]]

. , , 2- S8 , 27 = 128 : sage: G = SymmetricGroup(8) sage: subgroups = G.conjugacy_classes_subgroups() sage: S = [H for H in subgroups if order(H) == 2^7][0] : sage: S = G.sylow_subgroup(2)

47


5.3



: sage: G = PermutationGroup(['(1,2,3)', '(1,2)(3,4)', '(1,7)']) sage: CG = G.conjugacy_classes_representatives() sage: gamma = CG[2] sage: CG; gamma [(), (1,2), (1,2)(3,4), (1,2,3), (1,2,3)(4,7), (1,2,3,4), (1,2,3,4,7)] (1,2)(3,4) S4 : sage: G = SymmetricGroup(5) sage: group_order = G.order() sage: reps = G.conjugacy_classes_representatives() sage: class_sizes = [group_order/G.centralizer(g).order() for g in reps] sage: class_sizes [1, 10, 15, 20, 20, 30, 24] sage: sum(class_sizes) 120 H ­ G g G, g H g -1 , H . G.conjugacy_classes_subgroups() G ( , g H g -1 g ). sage: sage: sage: sage: K = DihedralGroup(12) sg = K.conjugacy_classes_subgroups() sg sg[1].list()

5.4



Sage: sage: MS = MatrixSpace(GF(7), 2) # 2x2 sage: gens = [MS([[1,0],[-1,1]]),MS([[1,1],[0,1]])] # sage: G = MatrixGroup(gens) # sage: G.conjugacy_class_representatives() [ [1 0] [0 1], [0 1] [6 1], ... [6 0] [0 6] ] sage: G = Sp(4,GF(7)) # sage: G Symplectic Group of rank 2 over Finite Field of size 7 sage: G.random_element() [5 5 5 1] 48


[0 2 6 3] [5 0 1 0] [4 6 3 4] sage: G.order() 276595200 sage: G = SL(2, GF(5)) sage: G.center() Matrix group over Finite Field of size 5 with 1 generators: [[[4, 0], [0, 4]]] , Sage : sage: G = PSL(2, 5); G # Permutation Group with generators [(3,5)(4,6), (1,2,5)(3,4,6)] sage: G.center() Permutation Group with generators [()] : sage: F = AbelianGroup(5, [5,5,7,8,9], names='abcde') Multiplicative Abelian Group isomorphic to C5 x C5 x C7 x C8 x C9 sage: (a, b, c, d, e) = F.gens() sage: d * b^2 * c^3 b^2*c^3*d sage: F = AbelianGroup(3,[2]*3); F Multiplicative Abelian Group isomorphic to C2 x C2 x C2 sage: H = AbelianGroup([2,3], names="xy"); H Multiplicative Abelian Group isomorphic to C2 x C3 sage: AbelianGroup(5) # 5 Multiplicative Abelian Group isomorphic to Z x Z x Z x Z x Z sage: AbelianGroup(5).order() +Infinity

5.5



1. GLn (C) , Q8 Dn . 2. n Sage : Zn , n = 2, n = 4, n = pk , n = 2pk , p ­ . 3. A4 , S4 A5 . , . 4. 7 168. 5. SL2 (Z3 ). 6. A4 , A5 , S5 , S6 . S5 S ? 7. , 2- S4 D4 . 49
6


8. , 2- SL2 (Z3 ) . 9. , A5 , (254) (12345). 10. SL2 (Z5 ) . ?

5.6



1. Sage . . ? 2. A4 , S4 , Q8 D5 . 3. , p p-. 4. , , Zm1 . . . Zms Zn1 . . . Znt . 5. , . 6. , m1 , . . . , ms Zm1 . . . Zms . 7. , m1 , . . . , ms Zm1 . . . Zms Zd1 . . . Zdr , d1 | d2 | . . . | dr . 8. A x1 , . . . , xn , B y1 , . . . , yk , x1 y1 . . . =M. . . x
n

,

yk

M . , M A/B . 9. A x1 , x2 , x3 B , x1 + x2 + 4x3 2x1 - x2 + 2x3 , (x1 + 2x3 ) + B . 10. A x1 , x2 , x3 B , 2x1 + x2 - 50x3 4x1 + 5x2 + 60x3 , 32x1 + 31x2 + B . 11. S7 , (123) (14567)? 12. , . 13. Sage 12 . 14. , 18. 15. , 100, .

50


16. , 2000. ? 17. 2 â 2 â 2 . . , , . . n â n â n. 18. , n â n 1, 2, . . . , n , ; ; ( , ); . 19. , , , , . 20. .

51



[1] . . . . .: , 2003. [2] . . . // .: , 2002. [3] . , . , . '. , . // .: , 2000. [4] // . . . . .: , 2009. [5] . . . ( 3- ) // .: , 2001. [6] . . . . // ., , 1988. [7] . . , . . . // , 2005. [8] . , . . // .: , 1999. [9] . . . // ., ­ -, 2007. [10] . . . // .: , 2001. [11] Th. Becker, V. Weispfenning. Groebner Bases Commutative Algebra. Springer, New York, 1993. A Computational Approach To

[12] D. Cox, J. Little, D. O'Shea. Using Algebraic Geometry // Springer-Verlag, 2004. [13] M. Creuzer, L. Robbiano. Computational Commutative Algebra (in two parts) // SpringerVerlag, 2001, 2005. [14] G.-M. Greuel, G. Pfister, and H. Schoenemann. Singular 3.0. A Computer Algebra System for Polynomial Computations. Center for Computer Algebra, University of Kaiserslautern (2005). http://www.singular.uni-kl.de. [15] D. Krob, S. Legros. Alg` ebre g´ ´ enerale et lin´ eaire. Introduction au calcul symbolique et aux math´ ematiques exp´ entales. Vuibert, Paris, 1999. erim [16] D. Joyner, W. Stein. Sage Installation Guide. http://www.sagemath.org/doc/inst/inst.html [17] D. Joyner. Constructions in Sage. http://www.sagemath.org/doc/const/const.html [18] W. Stein. The Sage Tutorial. http://www.sagemath.org/doc/tut/tut.html [19] W. Stein. Sage Reference Manual. http://www.sagemath.org/doc/ref/ref.html [20] W. Stein. Sage Developer's Guide. http://www.sagemath.org/doc/prog/prog.html 52


[21] W. Stein et al., Sage Mathematics Software (Version 4.3). The Sage Development Team, 2009, http://www.sagemath.org.

53