Magma has a special type for a homomorphism between two R-modules. The type of such a homomorphism is ModMPolHom. In general, functions such as Morphism return a homomorphism of type ModMPolHom, while the boundary maps of complexes are also of type ModMPolHom (see the function FreeResolution).
A homomorphism f: M -> N is represented by a matrix A. There are two ways in which A can be defined:
When M and N are graded - that is, generated by elements homogeneous with respect to the ambient column weightings and with a relation module that is also generated by homogeneous elements - all homomorphisms as non-graded modules are still allowed. However there are functions to test if a given homomorphism preserves the gradings on the domain and codomain up to a constant degree shift. See IsHomogeneous and Degree below.
Presentation: BoolElt Default: true
Given R-modules M and N and an m x n matrix A over R, construct the homomorphism f:M -> N (with type ModMPolHom) defined by A.By default, A is assumed to be a presentation matrix (see the comments above), in which case m and n must equal the degrees of the presentation modules of M and N, respectively. Alternatively, setting the parameter Presentation to {false} specifies that A is an ambient matrix; in this case, m and n must equal the degrees of M and N, respectively.
Given a module homomorphism f:M -> N, return the domain M.
Given a module homomorphism f:M -> N, return the codomain N.
Given a module homomorphism f:M -> N, return the presentation matrix AP of f as an m x n matrix corresponding to the presentation modules of M and N, respectively. This presentation matrix is always well-defined and computed, even if f is constructed via an ambient matrix.
Given a module homomorphism f:M -> N, return the ambient matrix AA of f as an m x n corresponding to the ambient modules of M and N, respectively. If M and N are reduced (as commonly happens), this will be the same as the presentation matrix above. But if M and N are not reduced and f is constructed via a presentation matrix, then an error may result (since it may be impossible to give a matrix over the base ring R which gives the mapping for the ambient modules).
Given a module homomorphism f:M -> N and an element v of M, return the image of v under f, as an element of N.
Given a module homomorphism f:M -> N and an integer i, return the element of N corresponding to the i-th row of the ambient matrix of f.
Given a module homomorphism f:M -> N, return the image of f as a submodule of N (which will be reduced iff N is).
Given a module homomorphism f:M -> N, return the kernel of f as a submodule of M (which will be reduced iff M is).
Given a module homomorphism f:M -> N, return the cokernel of f as a quotient module of N (which will be reduced iff N is).
Given a module homomorphism f:M -> N, return whether f is the zero map. Note that f may be the zero map even if the presentation or ambient matrices of f are non-zero.
Given a module homomorphism f:M -> N, return whether f is injective (whether the kernel of f is the zero module).
Given a module homomorphism f:M -> N, return whether f is surjective (whether the image of f equals N).
Given a module homomorphism f:M -> N, return whether f is bijective (injective and surjective).
Given a module homomorphism f:M -> N, where M and N are graded modules, return whether f is homogeneous of some degree d; that is, whether for every pure degree element v∈M, f(v)=0 or Degree(f(v)) equals Degree(v) + d.
Given a module homomorphism f:M -> N, return the degree of f, which is the maximum d such that an element of M of degree e is mapped via f to zero or an element of degree e + d. If f is homogeneous, then the `maximum' concept is unnecessary, since the degree will be consistent for all elements of M (see the previous function).
> R<x,y> := PolynomialRing(RationalField(), 2, "grevlex"); > F := EModule(R, 3); > // get a submodule M1 generated by a single non-zero element of F > M1 := sub<F|[x^2,y^2,x*y]>; > // and a second submodule M2 containing M1 > M2 := sub<F|[x,0,y],[0,y,0]>; > incl_hm := Homomorphism(M1,M2,IdentityMatrix(R,3) : > Presentation := false); > incl_hm; Module homomorphism (3 by 3) Ambient matrix: [1 0 0] [0 1 0] [0 0 1]Now the corresponding presentation matrix of the inclusion map is the obvious one coming from the expression of the natural generator of M1 in terms of the two natural generators of M2
> PresentationMatrix(incl_hm); [y x] > // check homogeneity of incl_hm > IsHomogeneous(incl_hm); true > Degree(incl_hm); 0