# Localized Rings and Their Ideals

We recall the definition of localization. All rings considered are commutative, with multiplicative identity 1. Let $R$ be a ring, and let $U \subset R$ be a *multiplicatively closed subset.* That is,

\[1 \in U \;\text{ and }\; u, v \in U \;\Rightarrow \; u\cdot v \in U.\]

Consider the equivalence relation on $R\times U$ defined by setting

\[(r,u)\sim (r', u') \;\text{ iff }\; v(r u'-u r')=0 \;{\text{ for some }}\; v\in U.\]

Write $\frac{r}{u}$ for the equivalence class of $(r, u)$ and $R[U^{-1}]$ for the set of all equivalence classes. Mimicking the standard arithmetic for fractions, $R[U^{-1}]$ can be made into a ring. This ring is called the *localization of $R$ at $U$*. It comes equipped with the natural ring homomorphism

\[\iota : R\to R[U^{-1}],\; r \mapsto \frac{r}{1}.\]

Given an $R$-module $M$, the analogous construction yields an $R[U^{-1}]$-module $M[U^{-1}]$ which is called the *localization of $M$ at $U$*. See the section on modules.

Our focus in this section is on localizing multivariate polynomial rings and their quotients. The starting point for this is to provide functionality for handling (several types of) multiplicatively closed subsets of multivariate polynomial rings. Given such a polynomial ring `R`

and a multiplicatively closed subset `U`

of `R`

whose type is supported by OSCAR, entering `localization(R, U)`

creates the localization of `R`

at `U`

. Given a quotient `RQ`

of `R`

, with projection map `p`

: `R`

$\to$ `RQ`

, and given a multiplicatively closed subset `U`

of `R`

, entering `localization(RQ, U)`

creates the localization of `RQ`

at `p(U)`

: Since every multiplicatively closed subset of `RQ`

is of type `p(U)`

for some `U`

, there is no need to support an extra type for multiplicatively closed subsets of quotients.

Most functions described here rely on the computation of standard bases. Recall that OSCAR supports standard bases for multivariate polynomial rings over fields (exact fields supported by OSCAR) and for multivariate polynomial rings over the integers.

## Types

The OSCAR types discussed in this section are all parametrized. To simplify the presentation, details on the parameters are omitted.

All types for multiplicatively closed subsets of rings belong to the abstract type `AbsMultSet`

. For multiplicatively closed subsets of multivariate polynomial rings, there are the abstract subtype `AbsPolyMultSet`

and its concrete descendants `MPolyComplementOfKPointIdeal`

, `MPolyComplementOfPrimeIdeal`

, and `MPolyPowersOfElement`

.

The general abstract type for localizations of rings is `AbsLocalizedRing`

. For localizations of multivariate polynomial rings, there is the concrete subtype `MPolyLocalizedRing`

. For localizations of quotients of multivariate polynomial rings, there is the concrete subtype `MPolyQuoLocalizedRing`

.

## Constructors

### Multiplicatively Closed Subsets

In accordance with the above mentioned types, we have the following constructors for multiplicatively closed subsets of multivariate polynomial rings.

`complement_of_point_ideal`

— Method`complement_of_point_ideal(R::MPolyRing, a::Vector)`

Given a polynomial ring $R$, say $R = K[x_1,\dots, x_n]$, and given a vector $a = (a_1, \dots, a_n)$ of $n$ elements of $K$, return the multiplicatively closed subset $R\setminus m$, where $m$ is the maximal ideal

\[m = \langle x_1-a_1,\dots, x_n-a_n\rangle \subset R.\]

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> U = complement_of_point_ideal(R, [0, 0 ,0])
complement of maximal ideal corresponding to point with coordinates fmpq[0, 0, 0]
```

`complement_of_prime_ideal`

— Method`complement_of_prime_ideal(P::MPolyIdeal; check::Bool=false)`

Given a prime ideal $P$ of a polynomial ring $R$, say, return the multiplicatively closed subset $R\setminus P.$

If `check`

is set to `true`

, the function checks whether $P$ is indeed a prime ideal.

This may take some time.

**Examples**

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> P = ideal(R, [x])
ideal(x)
julia> U = complement_of_prime_ideal(P)
complement of ideal(x)
```

`powers_of_element`

— Method`powers_of_element(f::MPolyElem)`

Given an element `f`

of a polynomial ring, return the multiplicatively closed subset of the polynomial ring which is formed by the powers of `f`

.

**Examples**

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> f = x
x
julia> U = powers_of_element(f)
powers of fmpq_mpoly[x]
```

It is also possible to build products of multiplicatively closed sets already given:

`product`

— Method`product(T::AbsMPolyMultSet, U::AbsMPolyMultSet)`

Return the product of the multiplicative subsets `T`

and `U`

.

Alternatively, write `T*U`

.

**Examples**

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> T = complement_of_point_ideal(R, [0, 0 ,0])
complement of maximal ideal corresponding to point with coordinates fmpq[0, 0, 0]
julia> f = x
x
julia> U = powers_of_element(f)
powers of fmpq_mpoly[x]
julia> S = product(T, U)
product of the multiplicative sets [complement of maximal ideal corresponding to point with coordinates fmpq[0, 0, 0], powers of fmpq_mpoly[x]]
```

Containment in multiplicatively closed subsets can be checked via the `in`

function:

`in`

— Method`in(f::MPolyElem, U::AbsMPolyMultSet)`

Return `true`

if `f`

is contained in `U`

, `false`

otherwise.

**Examples**

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> S = complement_of_point_ideal(R, [0, 0 ,0])
complement of maximal ideal corresponding to point with coordinates fmpq[0, 0, 0]
julia> y in S
false
julia> P = ideal(R, [x])
ideal(x)
julia> T = complement_of_prime_ideal(P)
complement of ideal(x)
julia> y in T
true
julia> U = powers_of_element(x)
powers of fmpq_mpoly[x]
julia> x^3 in U
true
julia> (1+y)*x^2 in product(S, U)
true
```

### Localized Rings

`localization`

— Method`localization(R::MPolyRing, U::AbsMPolyMultSet)`

Return the localization of `R`

at `U`

, together with the localization map.

**Examples**

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> P = ideal(R, [x])
ideal(x)
julia> U = complement_of_prime_ideal(P)
complement of ideal(x)
julia> Rloc, iota = localization(R, U);
julia> Rloc
localization of Multivariate Polynomial Ring in x, y, z over Rational Field at the complement of ideal(x)
julia> iota
Map with following data
Domain:
=======
Multivariate Polynomial Ring in x, y, z over Rational Field
Codomain:
=========
localization of Multivariate Polynomial Ring in x, y, z over Rational Field at the complement of ideal(x)
```

`localization`

— Method`localization(RQ::MPolyQuo, U::AbsMPolyMultSet)`

Given a quotient `RQ`

of a multivariate polynomial ring `R`

with projection map `p : R -> RQ`

, say, and given a multiplicatively closed subset `U`

of `R`

, return the localization of `RQ`

at `p(U)`

, together with the localization map.

**Examples**

```
julia> T, t = PolynomialRing(QQ, "t");
julia> K, a = NumberField(2*t^2-1, "a");
julia> R, (x, y) = PolynomialRing(K, ["x", "y"]);
julia> I = ideal(R, [2*x^2-y^3, 2*x^2-y^5])
ideal(2*x^2 - y^3, 2*x^2 - y^5)
julia> P = ideal(R, [y-1, x-a])
ideal(y - 1, x - a)
julia> U = complement_of_prime_ideal(P)
complement of ideal(y - 1, x - a)
julia> RQ, _ = quo(R, I);
julia> RQL, iota = localization(RQ, U);
julia> RQL
Localization of Quotient of Multivariate Polynomial Ring in x, y over Number field over Rational Field with defining polynomial 2*t^2 - 1 by ideal(2*x^2 - y^3, 2*x^2 - y^5) at the multiplicative set complement of ideal(y - 1, x - a)
julia> iota
Map from
Quotient of Multivariate Polynomial Ring in x, y over Number field over Rational Field with defining polynomial 2*t^2 - 1 by ideal(2*x^2 - y^3, 2*x^2 - y^5) to Localization of Quotient of Multivariate Polynomial Ring in x, y over Number field over Rational Field with defining polynomial 2*t^2 - 1 by ideal(2*x^2 - y^3, 2*x^2 - y^5) at the multiplicative set complement of ideal(y - 1, x - a) defined by a julia-function
```

## Data associated to Localized Rings

If `Rloc`

is the localization of a multivariate polynomial ring `R`

at a multiplicatively closed subset `U`

of `R`

, then

`base_ring(Rloc)`

refers to`R`

, and`inverted_set(Rloc)`

to`U`

.

If `RQ`

is a quotient of a multivariate polynomial ring `R`

, `p`

: `R`

$\to$ `RQ`

is the projection map, `U`

is a multiplicatively closed subset of `R`

, and `RQL`

is the localization of `RQ`

at `p(U)`

, then

`base_ring(RQL)`

refers to`R`

, and`inverted_set(RQL)`

to`U`

.

This reflects the way of creating localizations of quotients of multivariate polynomial rings in OSCAR.

##### Examples

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> P = ideal(R, [x])
ideal(x)
julia> U = complement_of_prime_ideal(P)
complement of ideal(x)
julia> Rloc, _ = localization(U);
julia> R === base_ring(Rloc)
true
julia> U === inverted_set(Rloc)
true
```

```
julia> T, t = PolynomialRing(QQ, "t");
julia> K, a = NumberField(2*t^2-1, "a");
julia> R, (x, y) = PolynomialRing(K, ["x", "y"]);
julia> I = ideal(R, [2*x^2-y^3, 2*x^2-y^5])
ideal(2*x^2 - y^3, 2*x^2 - y^5)
julia> P = ideal(R, [y-1, x-a])
ideal(y - 1, x - a)
julia> U = complement_of_prime_ideal(P)
complement of ideal(y - 1, x - a)
julia> RQ, _ = quo(R, I);
julia> RQL, _ = localization(RQ, U);
julia> R == base_ring(RQL)
true
julia> U == inverted_set(RQL)
true
```

## Elements of Localized Rings

### Types

The general abstract type for elements of localizations of rings is `AbsLocalizedRingElem`

. For elements of localizations of multivariate polynomial rings, there is the concrete subtype `MPolyLocalizedRingElem`

. For elements of localizations of quotients of multivariate polynomial rings, there is the concrete subtype `MPolyQuoLocalizedRingElem`

.

### Creating Elements of Localized Rings

If `Rloc`

is the localization of a multivariate polynomial ring `R`

at a multiplicatively closed subset `U`

of `R`

, then elements of `Rloc`

are created as (fractions of) images of elements of `R`

under the localization map or by coercing (pairs of) elements of `R`

into fractions.

If `RQ`

is a quotient of a multivariate polynomial ring `R`

, `p`

: `R`

$\to$ `RQ`

is the projection map, `U`

is a multiplicatively closed subset of `R`

, and `RQL`

is the localization of `RQ`

at `p(U)`

, then elements of `RQL`

are created similarly, starting from elements of `R`

.

##### Examples

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> P = ideal(R, [x])
ideal(x)
julia> U = complement_of_prime_ideal(P)
complement of ideal(x)
julia> Rloc, iota = localization(U);
julia> iota(x)
x
julia> Rloc(x)
x
julia> f = iota(y)/iota(z)
y/z
julia> g = Rloc(y, z)
y/z
julia> X, Y, Z = Rloc.(gens(R));
julia> h = Y/Z
y/z
julia> f == g == h
true
julia> f+g
2*y/z
julia> f*g
y^2/z^2
```

```
julia> T, t = PolynomialRing(QQ, "t");
julia> K, a = NumberField(2*t^2-1, "a");
julia> R, (x, y) = PolynomialRing(K, ["x", "y"]);
julia> I = ideal(R, [2*x^2-y^3, 2*x^2-y^5])
ideal(2*x^2 - y^3, 2*x^2 - y^5)
julia> P = ideal(R, [y-1, x-a])
ideal(y - 1, x - a)
julia> U = complement_of_prime_ideal(P)
complement of ideal(y - 1, x - a)
julia> RQ, p = quo(R, I);
julia> RQL, iota = Localization(RQ, U);
julia> phi = compose(p, iota);
julia> phi(x)
x
julia> RQL(x)
x
julia> f = phi(x)/phi(y)
x/y
julia> g = RQL(x, y)
x/y
julia> X, Y = gens(RQL);
julia> h = X/Y
x/y
julia> f == g == h
true
julia> f+g
2*x/y
julia> f*g
x^2/y^2
```

### Data Associated to Elements of Localized Rings

If `Rloc`

is a localization of a multivariate polynomial ring `R`

, and `f`

is an element of `Rloc`

, internally represented by a pair `(r, u)`

of elements of `R`

, then

`parent(f)`

refers to`Rloc`

,`numerator(f)`

to`r`

, and`denominator(f)`

to`u`

.

If `RQL`

is a localization of a quotient `RQ`

of a multivariate polynomial ring `R`

, and `f`

is an element of `RQL`

, internally represented by a pair `(r, u)`

of elements of `R`

, then

`parent(f)`

refers to`RQL`

,`numerator(f)`

to the image of`r`

in`RQ`

, and`denominator(f)`

to the image of`u`

in`RQ`

.

That is, the behaviour of the functions `numerator`

and `denominator`

reflects the mathematical viewpoint of representing `f`

by pairs of elements of `RQ`

and not the internal representation of `f`

as pairs of elements of `R`

.

##### Examples

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> P = ideal(R, [x])
ideal(x)
julia> U = complement_of_prime_ideal(P)
complement of ideal(x)
julia> Rloc, iota = localization(U);
julia> f = iota(x)/iota(y)
x/y
julia> parent(f)
localization of Multivariate Polynomial Ring in x, y, z over Rational Field at the complement of ideal(x)
julia> g = iota(y)/iota(z)
y/z
julia> r = numerator(f*g)
x
julia> u = denominator(f*g)
z
julia> typeof(r) == typeof(u) <: MPolyElem
true
```

```
julia> T, t = PolynomialRing(QQ, "t");
julia> K, a = NumberField(2*t^2-1, "a");
julia> R, (x, y) = PolynomialRing(K, ["x", "y"]);
julia> I = ideal(R, [2*x^2-y^3, 2*x^2-y^5])
ideal(2*x^2 - y^3, 2*x^2 - y^5)
julia> P = ideal(R, [y-1, x-a])
ideal(y - 1, x - a)
julia> U = complement_of_prime_ideal(P)
complement of ideal(y - 1, x - a)
julia> RQ, p = quo(R, I);
julia> RQL, iota = Localization(RQ, U);
julia> phi = compose(p, iota);
julia> f = phi(x)
x
julia> parent(f)
Localization of Quotient of Multivariate Polynomial Ring in x, y over Number field over Rational Field with defining polynomial 2*t^2 - 1 by ideal(2*x^2 - y^3, 2*x^2 - y^5) at the multiplicative set complement of ideal(y - 1, x - a)
julia> g = f/phi(y)
x/y
julia> r = numerator(f*g)
x^2
julia> u = denominator(f*g)
y
julia> typeof(r) == typeof(u) <: MPolyQuoElem
true
```

### Tests on Elements of Localized Rings

`is_unit`

— Method`is_unit(f::MPolyLocalizedRingElem)`

Return `true`

, if `f`

is a unit of `parent(f)`

, `false`

otherwise.

**Examples**

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> P = ideal(R, [x])
ideal(x)
julia> U = complement_of_prime_ideal(P)
complement of ideal(x)
julia> Rloc, iota = localization(U);
julia> is_unit(iota(x))
false
julia> is_unit(iota(y))
true
```

`is_unit`

— Method`is_unit(f::MPolyQuoLocalizedRingElem)`

Return `true`

, if `f`

is a unit of `parent(f)`

, `true`

otherwise.

**Examples**

```
julia> T, t = PolynomialRing(QQ, "t");
julia> K, a = NumberField(2*t^2-1, "a");
julia> R, (x, y) = PolynomialRing(K, ["x", "y"]);
julia> I = ideal(R, [2*x^2-y^3, 2*x^2-y^5])
ideal(2*x^2 - y^3, 2*x^2 - y^5)
julia> P = ideal(R, [y-1, x-a])
ideal(y - 1, x - a)
julia> U = complement_of_prime_ideal(P)
complement of ideal(y - 1, x - a)
julia> RQ, p = quo(R, I);
julia> RQL, iota = Localization(RQ, U);
julia> is_unit(iota(p(x)))
true
```

## Homomorphisms from Localized Rings

The general abstract type for ring homomorphisms starting from localized rings is `AbsLocalizedRingHom`

. For ring homomorphisms starting from localizations of multivariate polynomial rings, there is the concrete subtype `MPolyLocalizedRingHom`

. For ring homomorphisms starting from quotients of multivariate polynomial rings, there is the concrete subtype `MPolyQuoLocalizedRingHom`

. We describe the construction of such homomorphisms. Let

`R`

be a multivariate polynomial ring`U`

be a multiplicatively closed subset of`R`

,`RQ = R/I`

be a quotient of`R`

with projection map`p`

:`R`

$\to$`RQ`

,`Rloc`

(`RQL`

) be the localization of`R`

at`U`

(of`RQ`

at`p(U)`

), and`S`

be another ring.

Then, to give a ring homomorphism `PHI`

from `Rloc`

to `S`

(from`RQL`

to `S`

) is the same as to give a ring homomorphism `phi`

from `R`

to `S`

which sends elements of `U`

to units in `S`

(and elements of `I`

to zero). That is, `PHI`

is determined by composing it with the localization map `R`

$\to$ `Rloc`

(by composing it with the composition of the localization map `RQ`

$\to$ `RQL`

and the projection map `R`

$\to$ `RQ`

). The constructors below take this into account.

`hom`

— Method`hom(Rloc::MPolyLocalizedRing, S::Ring, phi::Map)`

Given a localized ring `Rloc`

of type `MPolyLocalizedRing`

, say `Rloc`

is the localization of a multivariate polynomial ring `R`

at the multiplicatively closed subset `U`

of `R`

, and given a homomorphism `phi`

from `R`

to `S`

sending elements of `U`

to units in `S`

, return the homomorphism from `Rloc`

to `S`

whose composition with the localization map is `phi`

.

`hom(Rloc::MPolyLocalizedRing, S::Ring, V::Vector)`

Given a localized ring `Rloc`

as above, and given a vector `V`

of `nvars`

elements of `S`

, let `phi`

be the homomorphism from `R`

to `S`

which is determined by the entries of `V`

as the images of the generators of `R`

, and proceed as above.

`hom(RQL::MPolyQuoLocalizedRing, S::Ring, phi::Map)`

Given a localized ring `RQL`

of type `MPolyQuoLocalizedRing`

, say `RQL`

is the localization of a quotient ring `RQ`

of a multivariate polynomial ring `R`

at the multiplicatively closed subset `U`

of `R`

, and given a homomorphism `phi`

from `R`

to `S`

sending elements of `U`

to units in `S`

and elements of the modulus of `RQ`

to zero, return the homomorphism from `Rloc`

to `S`

whose composition with the localization map `RQ -> RQL`

and the projection map `R -> RQ`

is `phi`

.

`hom(RQL::MPolyQuoLocalizedRing, S::Ring, V::Vector)`

Given a localized ring `RQL`

as above, and given a vector `V`

of `nvars`

elements of `S`

, let `phi`

be the homomorphism from `R`

to `S`

which is determined by the entries of `V`

as the images of the generators of `R`

, and proceed as above.

Except from the case where the type of `U`

is `<: MPolyPowersOfElement`

, the condition on `phi`

requiring that elements of `U`

are send to units in `S`

is not checked by the `hom`

constructor.

**Examples**

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> I = ideal(R, [y-x^2, z-x^3]);
julia> RQ, p = quo(R, I);
julia> UR = complement_of_point_ideal(R, [0, 0, 0]);
julia> RQL, _ = localization(RQ, UR);
julia> T, (t,) = PolynomialRing(QQ, ["t"]);
julia> UT = complement_of_point_ideal(T, [0]);
julia> TL, _ = localization(T, UT);
julia> PHI = hom(RQL, TL, TL.([t, t^2, t^3]));
julia> PSI = hom(TL, RQL, RQL.([x]));
julia> PHI(RQL(z))
t^3
julia> PSI(TL(t))
x
```

Given a ring homomorphism `PHI`

from `Rloc`

to `S`

(from `RQL`

to `S`

), `domain(PHI)`

and `codomain(PHI)`

refer to `Rloc`

and `S`

(`RQL`

and `S`

), respectively. The corresponding homomorphism `phi`

from `R`

to `S`

is recovered as follows:

`restricted_map`

— Method```
restricted_map(PHI::MPolyLocalizedRingHom)
restricted_map(PHI::MPolyQuoLocalizedRingHom)
```

Given a ring homomorphism `PHI`

starting from a localized multivariate polynomial ring (a localized quotient of a multivariate polynomial ring), return the composition of `PHI`

with the localization map (with the composition of the localization map and the projection map).

**Examples**

```
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> I = ideal(R, [y-x^2, z-x^3]);
julia> RQ, p = quo(R, I);
julia> UR = complement_of_point_ideal(R, [0, 0, 0]);
julia> RQL, _ = localization(RQ, UR);
julia> T, (t,) = PolynomialRing(QQ, ["t"]);
julia> UT = complement_of_point_ideal(T, [0]);
julia> TL, _ = localization(T, UT);
julia> PHI = hom(RQL, TL, TL.([t, t^2, t^3]));
julia> PSI = hom(TL, RQL, RQL.([x]));
julia> phi = restricted_map(PHI)
Map with following data
Domain:
=======
Multivariate Polynomial Ring in x, y, z over Rational Field
Codomain:
=========
localization of Multivariate Polynomial Ring in t over Rational Field at the complement of maximal ideal corresponding to point with coordinates fmpq[0]
julia> psi = restricted_map(PSI)
Map with following data
Domain:
=======
Multivariate Polynomial Ring in t over Rational Field
Codomain:
=========
Localization of Quotient of Multivariate Polynomial Ring in x, y, z over Rational Field by ideal(-x^2 + y, -x^3 + z) at the multiplicative set complement of maximal ideal corresponding to point with coordinates fmpq[0, 0, 0]
```

## Ideals in Localized Rings

### Types

The general abstract type for ideals in localized rings is `AbsLocalizedIdeal`

. For ideals in localizations of multivariate polynomial rings, there is the concrete subtype `MPolyLocalizedIdeal`

. For ideals in localizations of quotients of multivariate polynomial rings, there is the concrete subtype `MPolyQuoLocalizedIdeal`

.

### Constructors

Given a localization `Rloc`

of a multivariate polynomial ring `R`

, and given a vector `V`

of elements of `Rloc`

(of `R`

), the ideal of `Rloc`

which is generated by (the images) of the entries of `V`

is created by entering `ideal(Rloc, V)`

. The construction of ideals in localizations of quotients of multivariate polynomial rings is similar..

##### Examples

```
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"]);
julia> f = x^3+y^4
x^3 + y^4
julia> V = [derivative(f, i) for i=1:2]
2-element Vector{fmpq_mpoly}:
3*x^2
4*y^3
julia> U = complement_of_point_ideal(R, [0, 0]);
julia> Rloc, _ = localization(R, U);
julia> MI = ideal(Rloc, V)
ideal in localization of Multivariate Polynomial Ring in x, y over Rational Field at the complement of maximal ideal corresponding to point with coordinates fmpq[0, 0] generated by [3*x^2, 4*y^3]
```

### Data Associated to Ideals

If `I`

is an ideal of a localized multivariate polynomial ring `Rloc`

, then

`base_ring(I)`

refers to`Rloc`

,`gens(I)`

to the generators of`I`

,`ngens(I)`

to the number of these generators, and`gen(I, k)`

as well as`I[k]`

to the`k`

-th such generator.

Similarly, if `I`

is an ideal of a localized quotient of a multivariate polynomial ring.

### Operations on Ideals

If `I`

, `J`

are ideals of a localized multivariate polynomial ring `Rloc`

, then

`I^k`

refers to the`k`

-th power of`I`

,`I+J`

,`I*J`

, and`intersect(I, J)`

to the sum, product, and intersection of`I`

and`J`

, and`quotient(I, J)`

as well as`I:J`

to the ideal quotient of`I`

by`J`

.

Similarly, if `I`

and `J`

are ideals of a localized quotient of a multivariate polynomial ring.

### Tests on Ideals

The usual tests `f in J`

, `issubset(I, J)`

, and `I == J`

are available.

### Saturation

If $Rloc$ is the localization of a multivariate polynomial ring $R$ at a multiplicative subset $U$ of $R$, then the ideal theory of $Rloc$ is a simplified version of the ideal theory of $R$ (see, for instance, David Eisenbud (1995)). In particular, each ideal $I$ of $Rloc$ is the extension $J\cdot Rloc$ of an ideal $J$ of $R$. The ideal

\[\{f\in R \mid uf\in J \text{ for some } u\in U\}\]

is independent of the choice of $J$ and is the largest ideal of $R$ which extends to $I$. It is, thus, the contraction of $I$ to $R$, that is, the preimage of $I$ under the localization map. We call this ideal the *saturation of $I$ over $R$*. In OSCAR, it is obtained by entering `saturated_ideal(I)`

.

If $RQL$ is the localization of a quotient $RQ$ of a multivariate polynomial ring $R$, and $I$ is an ideal of $RQL$, then the return value of `saturated_ideal(I)`

is the preimage of the saturation of $I$ over $RQ$ under the projection map $R \to RQ$ (and not the saturation of $I$ over $RQ$ itself).

`saturated_ideal`

— Method`saturated_ideal(I::MPolyLocalizedIdeal)`

Given an ideal `I`

of a localization, say, `Rloc`

of a multivariate polynomial ring, say, `R`

, return the saturation of `I`

over `R`

. That is, return the largest ideal of `R`

whose extension to `Rloc`

is `I`

. This is the preimage of `I`

under the localization map.

`saturated_ideal(I::MPolyQuoLocalizedIdeal)`

Given an ideal `I`

of a localization, say, `RQL`

of a quotient, say, `RQ`

of a multivariate polynomial ring, say, `R`

, return the preimage of the saturation of `I`

over `RQ`

under the projection map `R -> RQ`

.

**Examples**

```
julia> R, (x,) = PolynomialRing(QQ, ["x"]);
julia> U = powers_of_element(x)
powers of fmpq_mpoly[x]
julia> Rloc, iota = localization(R, U);
julia> I = ideal(Rloc, [x+x^2])
ideal in localization of Multivariate Polynomial Ring in x over Rational Field at the powers of fmpq_mpoly[x] generated by [x^2 + x]
julia> SI = saturated_ideal(I)
ideal(x + 1)
julia> base_ring(SI)
Multivariate Polynomial Ring in x over Rational Field
julia> U = complement_of_point_ideal(R, [0])
complement of maximal ideal corresponding to point with coordinates fmpq[0]
julia> Rloc, iota = localization(R, U);
julia> I = ideal(Rloc, [x+x^2])
ideal in localization of Multivariate Polynomial Ring in x over Rational Field at the complement of maximal ideal corresponding to point with coordinates fmpq[0] generated by [x^2 + x]
julia> saturated_ideal(I)
ideal(x)
```