# Changing Coefficient Ring

The `ChangeRing` function enables the changing of the coefficient ring of a polynomial ring or ideal.

## `ChangeRing(I, S): RngMPol, Rng -> RngMPol`

Given an ideal $I$ of a polynomial ring $P=R[x_1, \ldots, x_n]$ of rank $n$ with coefficient ring $R$, together with a ring $S$, construct the ideal $J$ of the polynomial ring $Q=S[x_1, \ldots, x_n]$ obtained by coercing the coefficients of the elements of the basis of $I$ into $S$. It is necessary that all elements of the old coefficient ring $R$ can be automatically coerced into the new coefficient ring $S$. If $R$ and $S$ are fields and $R$ is known to be a subfield of $S$ and the current basis of $I$ is a Gröbner basis, then the basis of $J$ is marked automatically to be a Gröbner basis of $J$.

## `Example: Change Ring (ex-d2d66e)`

It is better to find the Gröbner basis of an ideal over the smallest subfield possible (e.g. ${\mathbb{Q}}$), then use [`ChangeRing`](#function-gb-changering) to create the equivalent ideal over a splitting field to find the variety.

```magma
> P<x, y, z, t, u> := PolynomialRing(RationalField(), 5);
> I := ideal<P |
>     x + y + z + t + u,
>     x*y + y*z + z*t + t*u + u*x,
>     x*y*z + y*z*t + z*t*u + t*u*x + u*x*y,
>     x*y*z*t + y*z*t*u + z*t*u*x + t*u*x*y + u*x*y*z,
>     x*y*z*t*u - 1>;
> Groebner(I);
> K<W> := CyclotomicField(5);
> J := ChangeRing(I, K);
> V := Variety(J);
> #V;
70

```
