A homomorphism `f : M --> N` is represented as a matrix from the generators of M to the generators of N.

One homomorphism `F : M --> R` is `x |--> y, y |--> x^2` (this is multiplication by the fraction `y/x`). We write this in the following way.

Notice that as is usual in Macaulay2, the target comes before the source.

Macaulay2 also does not check that the homomorphism is well defined (i.e. the relations of the source map into the relations of the target). Use isWellDefined to check. This generally requires a GrÃ¶bner basis computation (which is performed automatically, if it is required and has not already been done).

The image of `F` lies in the submodule `M` of `R^1`. Suppose we wish to define this new map `G : M --> M`. How does one do this?

Now we use // to lift `F : M --> R^1` along `inc : M --> R^1`, to obtain a map `G : M --> M`, such that `inc * G == F`.

Let's make sure that this map `G` is well defined.

i1 : R = QQ[x,y]/(y^2-x^3); |

i2 : M = module ideal(x,y) o2 = image | x y | 1 o2 : R-module, submodule of R |

i3 : F = map(R^1,M,matrix{{y,x^2}}) o3 = | y x2 | o3 : Matrix |

Macaulay2 doesn't display the source and target, unless they are both free modules. Use target and source to get them. The matrix routine recovers the matrix of free modules between the generators of the source and target.

i4 : source F o4 = image | x y | 1 o4 : R-module, submodule of R |

i5 : target F == R^1 o5 = true |

i6 : matrix F o6 = | y x2 | 1 2 o6 : Matrix R <--- R |

i7 : isWellDefined F o7 = true |

i8 : isIsomorphism F o8 = false |

To obtain the map `M --> M`, we use Matrix // Matrix. In order to do this, we need the inclusion map of `M` into `R^1`.

i9 : inc = inducedMap(R^1, M) o9 = | x y | o9 : Matrix |

i10 : G = F // inc o10 = {1} | 0 x | {1} | 1 0 | o10 : Matrix |

i11 : target G == M and source G == M o11 = true |

i12 : inc * G == F o12 = true |

i13 : isWellDefined G o13 = true |

i14 : isIsomorphism G o14 = false |

i15 : prune coker G o15 = cokernel | y x | 1 o15 : R-module, quotient of R |

i16 : kernel G == 0 o16 = true |

- isWellDefined(Matrix) -- whether a map is well defined
- isIsomorphism(Matrix) -- whether a map is an isomorphism
- isInjective(Matrix) -- whether a map is injective
- isSurjective(Matrix) -- whether a map is surjective
- kernel(Matrix) -- kernel of a matrix
- cokernel(Matrix) -- cokernel of a map of modules, graded modules, or chaincomplexes
- Matrix // Matrix -- factor a map through another