gap> x:=Indeterminate(Integers,"x"); x gap> x^2; x^2 gap> f:=3*x^2 - 2*x -8; 3*x^2-2*x-8 gap> g:=(1/2)*x; 1/2*x gap> f/(x-2); 3*x+4 gap> f/(x-4); (3*x^2-2*x-8)/(x-4) gap> f^2; 9*x^4-12*x^3-44*x^2+32*x+64 gap> f^2 mod (x^2 + x +1); 85*x+96 gap> f^2/(x-1); (9*x^4-12*x^3-44*x^2+32*x+64)/(x-1) gap> IsPolynomial(f); true gap> IsPolynomial(f/2); true gap> f; 3*x^2-2*x-8 gap> IsPolynomial(f+8); true gap> IsPolynomial((f+8)/x); true gap> IsPolynomial((f+8)/x^2); false gap> F := FreeGroup( "a", "b" );; gap> F; gap> a; Variable: 'a' must have a value gap> # These names are not variables, but just display figures. gap> # you have to assign actual names to the gap> # generators gap> a := F.1;; b := F.2;; # assign variables gap> a; a gap> b; b gap> # but compare and note possibility of confusion. gap> r:=F.1;s:=F.2; a b gap> r;s; a b gap> G:=F/[a^2,b^2,(a*b)^2]; gap> Size(G); 4 gap> Elements(G); [ , a, b, a*b ] gap> # when working interactively, AssignGeneratorVariables gap> # may be helpful. gap> # Note that a is not known as an element of G.... gap> a; a gap> a in F; true gap> a in G; false gap> # its is a display courtesy that let's G use the same labels; gap> G.1; a gap> G.1 in G; true gap> a = G.1; false gap> # the automatic assign brings danger, since it may effectively gap> # gloss over true distinctions. 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; a gap> a in F; false gap> a in G; true