[Next] [Prev] [Right] [Left] [Up] [Index] [Root]
Mappings

Mappings

This section provides an overview of the ideas behind mappings, including homomorphisms and partial mappings.

Mappings in Magma imitate the mathematical idea of a mapping. Each mapping is specified as being from one algebraic structure to another, with a rule for calculating the image of any given element of the domain. The image will be an element of the codomain.

Mappings are returned by many standard Magma intrinsics, such as OrbitAction(G, T). Several constructors, such as quo, return mappings as one of their return values.

Mappings can be defined by the user too, using a map constructor, hom constructor, or pmap (partial map) constructor. The syntax of a map constructor is

map< A -> B | MAP RULE >

and it evaluates to a mapping from the domain A to the codomain B. The other two constructors have the same general syntax except that they begin with hom< or pmap< . The MAPPING RULE can be given in several ways, which are partly dependent upon what type of mapping is being constructed. See Maps, Homomorphisms, Partial Mappings.

Given an element x of A and a mapping m from A to B, the image of x may be calculated as

x@a

or as

a(x)

whichever is preferred.

The composition of mappings m: A to B and n: B to C is m*n.

The functions Domain(m) and Codomain(m) return the domain and codomain of m.

Example

> R16:=RealField(16)
> trigmap:=map< R16 -> R16 | x :-> x-Sin(x) >;

The natural homomorphism from S6 to S6/A6: > S6 := Sym(6); A6 := Alt(6); > Q, natural := quo< S6 | A6 >; > print natural; Mapping from: GrpPerm: S6 to GrpPerm: Q > print natural(S6!(5, 4)); (1, 2)

A bijection between the integers modulo 4 and the finite field of 4 elements, by explicitly giving the image of each domain element. > Z4 := Integers(4); > F4<w> := FiniteField(4); > m := map< Z4 -> F4 | <0, 0>, <1, 1>, <2, w>, <3, w^2> >; > print 2@m; w

An isomorphism defined by giving the images of the generators of the domain. > G<x, y> := Group<x, y | x^2 = y^3, x^4 = 1 >; > SL2Z<a, b> := sub< GeneralLinearGroup(2, Integers()) | > [0, -1, 1, 0], [0, -1, 1, 1] >; > f := hom< G -> SL2Z | x -> a, y -> b >;

The partial map from F9 onto Z/8Z defined by taking the multiplicative order of the field element (impossible for the zero element). > F<z> := FiniteField(9); > Zm := IntegerRing(8); > o := pmap< F -> Zm | x :-> Order(x) >; > print [ <x, o(x)> : x in F | x ne 0 ]; [ <1, 1>, <z, 0>, <z^2, 4>, <z^3, 0>, <2, 2>, <z^5, 0>, <z^6, 4>, <z^7, 0> ]

Subscreens
[Next] [Prev] [Right] [Left] [Up] [Index] [Root]