ZmodnZ( n ) F
ZmodpZ( p ) F
ZmodpZNC( p ) F
ZmodnZ returns a ring R isomorphic to the residue class ring of the
integers modulo the positive integer n.
The element corresponding to the residue class of the integer i in this
ring can be obtained by i \* One( R ), and a representative of the
residue class corresponding to the element x Î R can be computed by
Int( x ).
ZmodnZ( n ) is equivalent to Integers mod n.
ZmodpZ does the same if the argument p is a prime integer,
additionally the result is a field.
ZmodpZNC omits the check whether p is a prime.
Each ring returned by these functions contains the whole family of its elements if n is not a prime, and is embedded into the family of finite field elements of characteristic n if n is a prime.
ZmodnZObj( Fam, i ) O
creates an object in the residue class family Fam whose coset is represented by integer i.
gap> r:= ZmodnZ(15); (Integers mod 15) gap> fam:=ElementsFamily(FamilyObj(r));; gap> a:= ZmodnZObj(fam,9); ZmodnZObj( 9, 15 ) gap> a+a; ZmodnZObj( 3, 15 ) gap> Int(a+a); 3
IsZmodnZObj( obj ) C
IsZmodnZObjNonprime( obj ) C
IsZmodpZObj( obj ) C
IsZmodpZObjSmall( obj ) C
IsZmodpZObjLarge( obj ) C
The elements in the rings Z / n Z are in the category IsZmodnZObj.
If n is a prime then the elements are of course also in the category
IsFFE (see IsFFE), otherwise they are in IsZmodnZObjNonprime.
IsZmodpZObj is an abbreviation of IsZmodnZObj and IsFFE. This
category is the disjoint union of IsZmodpZObjSmall and
IsZmodpZObjLarge, the former containing all elements with n at most
MAXSIZE_GF_INTERNAL.
The reasons to distinguish the prime case from the nonprime case are
IsZmodnZObjNonprime have an external representation
(namely the residue in the range [ 0, 1, ... n-1 ]),
IsZmodnZObjNonprimeFamily
(note that for prime n, the family must be an IsFFEFamily).
The reasons to distinguish the small and the large case are that for small n the elements must be compatible with the internal representation of finite field elements, whereas we are free to define comparison as comparison of residues for large n.
Note that we cannot claim that every finite field element of degree 1
is in IsZmodnZObj, since finite field elements in internal
representation may not know that they lie in the prime field.
The residue class rings are rings, thus all operations for rings (see Chapter Rings) apply. See also Chapters Finite fields and Number theory.
GAP 4 manual