
Section 12: Polynomial Rings
gap> f:=FreeGroup("a","b");
gap> AssignGeneratorVariables(f);
#I Assigned the global variables [ a, b ]
gap> r:=[a^2,b^4,a^b/(a*b^2)];
[ a^2, b^4, b^-1*a*b^-1*a^-1 ]
gap> g:=f/r;
gap> AssignGeneratorVariables(g);
#I Global variable `a' is already defined and will be overwritten
#I Global variable `b' is already defined and will be overwritten
#I Assigned the global variables [ a, b ]
gap> a^2;
a^2
gap> a^4;
a^4
gap> a^2=Identity of g;
Syntax error: ; expected
a^2=Identity of g;
^
gap> a^2=Identity(g);
true
gap> StructureDescription(g);
"D8"
gap> r1:= Integers mod 7;
GF(7)
gap> p1:= PolynomialRing(r1);
GF(7)[x_1]
gap> x:= X(r1, "x");
x
gap> Factors(x^2-2);
[ x+Z(7), x+Z(7)^4 ]
gap> x:= X(Integers mod 8, "x");
x
gap> Factors(x^2-2);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 2nd choice method found for `Factors' on 2 arguments called from
Factors( DefaultRing( [ r ] ), r ) called from
( ) called from read-eval-loop
Entering break read-eval-print loop ...
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> quit;
gap> x:= X(Integers mod 5, "x");
x
gap> Factors(x^2-2);
[ x^2+Z(5)^3 ]
gap> x:= X(Integers mod 11, "x");
x
gap> Factors(x^2-2);
[ x^2+Z(11)^6 ]
gap> x:= X(Rationals, "x");
x
gap> Factors(x^2-2);
[ x^2-2 ]
gap> Factors(x^2-1);
[ x-1, x+1 ]
gap> Int(Z(11));
2
gap> Int(Z(11)^5);
10
gap> IsIrreducible(x^2-1);
false
gap> x:= X(Integer mod 3, "x");
Variable: 'Integer' must have a value
gap> x:= X(Integers mod 3, "x");
x
gap> Factors(x^2-1);
[ x+Z(3)^0, x-Z(3)^0 ]
gap> x:= X(Integers mod 5, "x");
x
gap> Factors(x^2-1);
[ x+Z(5)^0, x-Z(5)^0 ]
gap> Factors(x^4-1);
[ x+Z(5)^0, x+Z(5), x-Z(5)^0, x+Z(5)^3 ]
gap> x:= X(Integers mod 7, "x");
x
gap> Factors(x^6-1);
[ x+Z(7)^0, x+Z(7), x+Z(7)^2, x-Z(7)^0, x+Z(7)^4, x+Z(7)^5 ]
gap> x:= X(Integers mod 11, "x");
x
gap> Factors(x^10-1);
[ x+Z(11)^0, x+Z(11), x+Z(11)^2, x+Z(11)^3, x+Z(11)^4, x-Z(11)^0, x+Z(11)^6,
x+Z(11)^7, x+Z(11)^8, x+Z(11)^9 ]
gap> x:= X(Integers mod 3, "x");
x
gap> IsIrreducible(x^3 + 2*x^2 +1);
true
gap> IsIrreducible(x^4 + x^3+x^2 +1);
true
gap> x:= X(Rationals, "x");
x
gap> IsIrreducible(x^4 + x^3+x^2 +1);
true
gap> IsIrreducible(x^3 + 2*x^2 +1);
true
gap> x:= X(Rationals, "x");
x
gap> Factors(x^6-1);
[ x-1, x+1, x^2-x+1, x^2+x+1 ]
gap> Factors(x^8-1);
[ x-1, x+1, x^2+1, x^4+1 ]
gap> Factors(x^12-1);
[ x-1, x+1, x^2-x+1, x^2+1, x^2+x+1, x^4-x^2+1 ]
gap> Factors(x^20-1);
[ x-1, x+1, x^2+1, x^4-x^3+x^2-x+1, x^4+x^3+x^2+x+1, x^8-x^6+x^4-x^2+1 ]
gap> Factors(x^30-1);
[ x-1, x+1, x^2-x+1, x^2+x+1, x^4-x^3+x^2-x+1, x^4+x^3+x^2+x+1,
x^8-x^7+x^5-x^4+x^3-x+1, x^8+x^7-x^5-x^4-x^3+x+1 ]
gap> Factors(x^40-1);
[ x-1, x+1, x^2+1, x^4-x^3+x^2-x+1, x^4+1, x^4+x^3+x^2+x+1, x^8-x^6+x^4-x^2+1,
x^16-x^12+x^8-x^4+1 ]
gap> Factors(x^50-1);
[ x-1, x+1, x^4-x^3+x^2-x+1, x^4+x^3+x^2+x+1, x^20-x^15+x^10-x^5+1,
x^20+x^15+x^10+x^5+1 ]
gap> Factors(x^105-1);
[ x-1, x^2+x+1, x^4+x^3+x^2+x+1, x^6+x^5+x^4+x^3+x^2+x+1, x^8-x^7+x^5-x^4+x^3-x+1,
x^12-x^11+x^9-x^8+x^6-x^4+x^3-x+1,
x^24-x^23+x^19-x^18+x^17-x^16+x^14-x^13+x^12-x^11+x^10-x^8+x^7-x^6+x^5-x+1,
x^48+x^47+x^46-x^43-x^42-2*x^41-x^40-x^39+x^36+x^35+x^34+x^33+x^32+x^31-x^28-x^2\
6-x^24-x^22-x^20+x^17+x^16+x^15+x^14+x^13+x^12-x^9-x^8-2*x^7-x^6-x^5+x^2+x+1 ]
Section 13: Vector Spaces
gap> V:=GF(3)^2; ( GF(3)^2 ) gap> Elements(V); [ [ 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0 ], [ 0*Z(3), Z(3) ], [ Z(3)^0, 0*Z(3) ], [ Z(3)^0, Z(3)^0 ], [ Z(3)^0, Z(3) ], [ Z(3), 0*Z(3) ], [ Z(3), Z(3)^0 ], [ Z(3), Z(3) ] ] gap> Display(Elements(V)); . . . 1 . 2 1 . 1 1 1 2 2 . 2 1 2 2 gap> d:=Subspaces(V,1); Subspaces( ( GF(3)^2 ), 1 ) gap> e:=Elements(d);; gap> Display(Elements(e)); [ VectorSpace( GF(3), [ [ 0*Z(3), Z(3)^0 ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, 0*Z(3) ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, Z(3)^0 ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, Z(3) ] ] ) ] gap> e; [, , , ] gap> Display(Elements(e[1])); . . . 1 . 2 gap> Display(Elements(e[2])); . . 1 . 2 . gap> Display(Elements(e[3])); . . 1 1 2 2 gap> Display(Elements(e[4])); . . 1 2 2 1 gap> Size(Subspaces(V,1)); 4 gap> V:=GF(3)^3; ( GF(3)^3 ) gap> d:=Subspaces(V,1); Subspaces( ( GF(3)^3 ), 1 ) gap> Size(Subspaces(V,1)); 13 gap> e:=Elements(d);; gap> Display(Elements(e)); [ VectorSpace( GF(3), [ [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] ), VectorSpace( GF(3), [ [ 0*Z(3), Z(3)^0, 0*Z(3) ] ] ), VectorSpace( GF(3), [ [ 0*Z(3), Z(3)^0, Z(3)^0 ] ] ), VectorSpace( GF(3), [ [ 0*Z(3), Z(3)^0, Z(3) ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, 0*Z(3), 0*Z(3) ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, 0*Z(3), Z(3)^0 ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, 0*Z(3), Z(3) ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, Z(3)^0, 0*Z(3) ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, Z(3)^0, Z(3)^0 ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, Z(3)^0, Z(3) ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, Z(3), 0*Z(3) ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, Z(3), Z(3)^0 ] ] ), VectorSpace( GF(3), [ [ Z(3)^0, Z(3), Z(3) ] ] ) ] gap> Display(Elements(e[1])); . . . . . 1 . . 2 gap> Display(Elements(e[2])); . . . . 1 . . 2 . gap> Display(Elements(e[3])); . . . . 1 1 . 2 2 gap> Display(Elements(e[4])); . . . . 1 2 . 2 1 gap> Display(Elements(e[5])); . . . 1 . . 2 . . gap> Display(Elements(e[6])); . . . 1 . 1 2 . 2 gap> Display(Elements(e[7])); . . . 1 . 2 2 . 1 gap> Display(Elements(e[8])); . . . 1 1 . 2 2 . gap> Display(Elements(e[9])); . . . 1 1 1 2 2 2 gap> Display(Elements(e[10])); . . . 1 1 2 2 2 1 gap> Display(Elements(e[11])); . . . 1 2 . 2 1 . gap> Display(Elements(e[12])); . . . 1 2 1 2 1 2 gap> Display(Elements(e[13])); . . . 1 2 2 2 1 1 gap> Size(Subspaces(GF(2)^3,1)); 7 gap> Size(Subspaces(GF(3)^3,1)); 13 gap> Size(Subspaces(GF(5)^3,1)); 31 gap> Size(Subspaces(GF(7)^3,1)); 57 gap> Size(Subspaces(GF(11)^3,1)); 133 gap> (11^3-1); 1330 gap> 7^3-1; 342 gap> (p^3-1)/(p-1); Variable: 'p' must have a value gap> V; ( GF(3)^3 ) gap> Size(Subspaces(V,2)); 13 gap> d:=Subspaces(V,2); Subspaces( ( GF(3)^3 ), 2 ) gap> e:=Elements(d); [ , , , , , , , , , , , , ] gap> Display(Elements(e[1])); . . . . . 1 . . 2 . 1 . . 1 1 . 1 2 . 2 . . 2 1 . 2 2 gap> Display(Elements(e[11])); . . . . 1 2 . 2 1 1 . . 1 1 2 1 2 1 2 . . 2 1 2 2 2 1 gap> Size(Subspaces(GF(5)^3,2)); 31 gap> Size(Subspaces(GF(7)^3,2)); 57 gap> Size(Subspaces(GF(11)^3,2)); 133
Section 14: Finite Fields
gap> F:= GF(2^4); GF(2^4) gap> Elements(F); [ 0*Z(2), Z(2)^0, Z(2^2), Z(2^2)^2, Z(2^4), Z(2^4)^2, Z(2^4)^3, Z(2^4)^4, Z(2^4)^6, Z(2^4)^7, Z(2^4)^8, Z(2^4)^9, Z(2^4)^11, Z(2^4)^12, Z(2^4)^13, Z(2^4)^14 ] gap> Elements(GF(2^2)^2); [ [ 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2)^0 ], [ 0*Z(2), Z(2^2) ], [ 0*Z(2), Z(2^2)^2 ], [ Z(2)^0, 0*Z(2) ], [ Z(2)^0, Z(2)^0 ], [ Z(2)^0, Z(2^2) ], [ Z(2)^0, Z(2^2)^2 ], [ Z(2^2), 0*Z(2) ], [ Z(2^2), Z(2)^0 ], [ Z(2^2), Z(2^2) ], [ Z(2^2), Z(2^2)^2 ], [ Z(2^2)^2, 0*Z(2) ], [ Z(2^2)^2, Z(2)^0 ], [ Z(2^2)^2, Z(2^2) ], [ Z(2^2)^2, Z(2^2)^2 ] ] gap> Z(2^4); Z(2^4) gap> Z(2^2)^2; Z(2^2)^2 gap> Z(2^2)^2 = Z(2^4); false gap> Order(Z(2^4)); 15 gap> Order(Z(2^2)^2); 3 gap> Order(Z(3^2)); 8 gap> Order(Z(3)^2); 1 gap> Order(Z(5^2)); 24 gap> Order(Z(5)^2); 2 gap> Elements( Ring([Z(2^4)])); [ 0*Z(2), Z(2)^0, Z(2^2), Z(2^2)^2, Z(2^4), Z(2^4)^2, Z(2^4)^3, Z(2^4)^4, Z(2^4)^6, Z(2^4)^7, Z(2^4)^8, Z(2^4)^9, Z(2^4)^11, Z(2^4)^12, Z(2^4)^13, Z(2^4)^14 ] gap> Elements( Ring([Z(2^2)^2])); [ 0*Z(2), Z(2)^0, Z(2^2), Z(2^2)^2 ] gap> Z(2^4)^10; Z(2^2)^2 gap> Z(2^4)^15; Z(2)^0 gap> Z(2^4)^5; Z(2^2) gap> DegreeFFE(Z(2^4)); 4 gap> DegreeFFE(Z(2^4)^3); 4 gap> DegreeFFE(Z(2^4)^2); 4 gap> x:= X(GF(2), "x"); x gap> f:= x^4+x+1; x^4+x+Z(2)^0 gap> Factors(f); [ x^4+x+Z(2)^0 ] gap> F:= AlgebraicExtension(GF(2), f);Back to Home Pagegap> Elements(F); Error, no method found! For debugging hints type ?Recovery from NoMethodFound Error, no 3rd choice method found for `PrimitiveRoot' on 1 arguments called from PrimitiveRoot( F ) called from Basis( V ) called from AsSSortedList( coll ) called from ( ) called from read-eval-loop Entering break read-eval-print loop ... you can 'quit;' to quit to outer loop, or you can 'return;' to continue brk> quit; gap> a:= RootOfDefiningPolynomial(F); (a) gap> a^2; (a^2) gap> a^5; (a+a^2)
This PREP workshop is made possible by the NSF grant DUE: 0341481