# Maps between Rings

Magma includes functions for working with maps between multivariate polynomial rings. Let $R=K_1[x_1,\ldots,x_n]$ and $S=K_2[y_1,\ldots, y_m]$ be a polynomial rings over the fields $K_1$, $K_2$, and $f : R \to S$ a ring homomorphism.

## `PolyMapKernel(f): Map -> RngMPol`

Return the kernel of the map $f$ as an ideal in the domain $R$, i.e., the set $\{ a \in R | f(a) = 0 \}.$ This is basically the computation of the relation ideal for the polynomials defining the map and is as described in [`RelationIdeal`](elimination.md#function-dpoly-ideal-relationideal).

## `IsInImage(f, p): Map, RngMPolElt -> [ BoolElt ]`

Given a polynomial $p$ in $S$, return whether $p$ is in the image of the map $f$. The algorithm is the one described on p. 82 of [[Adams and Loustaunau, 1994](../../references.md#cite-adamsloustaunau)].

## `IsSurjective(f): Map -> [ BoolElt ]`

Return whether the map $f$ is surjective. Uses the function above to check whether each codomain variable lies in the image.

## `Extension(phi, I): Map, RngMPol -> RngMPol`

The extension of the ideal $I$ by $\phi$, where $\phi$ is a homomorphism from the generic of $I$. That is, the ideal generated by the image of $I$ under $\phi$.

## `Implicitization(phi): Map -> RngMPol`

Suppose the polynomial map $\phi: K^n \to K^m$ is a parametrization of a variety $V$, i.e., $V$ is the image of $\phi$ in $K^m$. This function constructs the ideal of $S$ corresponding to $V$. The map $\phi$ maps $(z_1, \dots, z_n) \mapsto (f_1(z_1), \dots, f_m(z_m))$ where the $z_i$ are the coordinates of $K^n$. Let $f: S \to R$ be the map of polynomial rings defined by $(y_1, \dots, y_m) \mapsto (f_1(y_1), \dots, f_m(y_m))$. Then `Implicitization(f)` is the ideal of $S$ corresponding to $V$. If $V$ is not a true variety, the function returns the smallest variety containing $V$ (the Zariski closure of $V$). The algorithm used is given on p. 97 of [[Cox *et al.*, 1996](../../references.md#cite-clo)]

## `Example: Map1 (ex-a72e07)`

We demonstrate the use of the function `Implicitization` for the variety defined by $\phi: Q[x,y] \to Q[r,u,v,w]$, $(x,y) \mapsto (x^4, x^3y, xy^3, y^4)$. This example is taken from [[Adams and Loustaunau, 1994](../../references.md#cite-adamsloustaunau), Ex. 2.5.4].

```magma
> R<x, y> := PolynomialRing(Rationals(), 2);
> S<r, u, v, w> := PolynomialRing(Rationals(), 4);
> f := hom<S -> R |x^4, x^3*y, x*y^3, y^4>;
> Implicitization(f);
Ideal of Polynomial ring of rank 4 over Rational Field
Lexicographical Order
Variables: r, u, v, w
Basis:
[
    -r^2*v + u^3,
    r*v^2 - u^2*w,
    -u*w^2 + v^3,
    -r*w + u*v
]

```
