The following functions deal with types or category names and general structures. A type itself has type Type.
Given any object x, return the type (or category name) of x.
Given types T and U, return whether T ISA U, i.e., whether objects of type T inherit properties of type U. For example, ISA(RngInt, Rng) is true, because the ring of integers Z is a ring.
Given a string S specifying a type return the actual type corresponding to S. This is useful when some intrinsic name hides the symbol which normally refers to the actual type.
Given any structure S, return the type of the elements of S. For example, the element type of the ring of integers Z is RngIntElt since that is the type of the integers which lie in Z.
Given structures S and T, return a covering structure C for S and T, so that S and T both embed into C. An error results if no such covering structure exists.
Given structures S and T, return whether a covering structure C for S and T exists, and if so, return such a C, so that S and T both embed into C.
> Type(3);
RngIntElt
> t := MakeType("RngIntElt");
> t;
RngIntElt
> Type(3) eq t;
true
> Z := IntegerRing();
> Type(Z);
RngInt
> ElementType(Z);
RngIntElt
> ISA(RngIntElt, RngElt);
true
> ISA(RngIntElt, GrpElt);
false
> ISA(FldRat, Fld);
true
The following give examples of when covering structures exist or do not
exist.
> Q := RationalField(); > CoveringStructure(Z, Q); Rational Field > ExistsCoveringStructure(Z, DihedralGroup(3)); false > ExistsCoveringStructure(Z, CyclotomicField(5)); true Cyclotomic Field of order 5 and degree 4 > ExistsCoveringStructure(CyclotomicField(3), CyclotomicField(5)); true Cyclotomic Field of order 15 and degree 8 > ExistsCoveringStructure(GF(2), GF(3)); false > ExistsCoveringStructure(GF(2^6), GF(2, 15)); true Finite field of size 2^30