# Ideals and Quotient Rings

The following entries describe the operations on ideals in a *commutative ring* $R$. Certain operations on left and right ideals in non-commutative rings will be described in the Chapters for the corresponding rings.

## Defining Ideals and Quotient Rings

### `ideal< R | a₁, ..., aᵣ >: Rng, RngElt, ..., RngElt -> RngIdl`

Given a ring $R$ and elements $a_1, \ldots, a_r$ of $R$, create the ideal $I$ of $R$ generated by $a_1, \ldots, a_r$.

### `quo< R | aᵣ, ..., aᵣ >: Rng, RngElt, ..., RngElt -> Rng`

Given a ring $R$ and elements $a_1, \ldots, a_r$ of $R$, construct the quotient ring $Q = R/I$, where $I$ is the ideal of $R$ generated by $a_1, \ldots, a_r$.

### `R / I: Rng, RngIdl -> Rng`

Given a ring $R$ and an ideal $I$ of $R$, construct the quotient ring $Q = R/I$, as well as the canonical map $R\rightarrow R/I$.

Note, however, that there can be pitfalls with this, particularly if the first argument is itself interpreted as an ideal, when instead the result could be interpreted as something like the `ColonIdeal`.

For instance:

```{.magma
> Z := Integers();
> I := ideal<Z|1>; // ideal of Z
> Z/I; // ideal quotient, similar to ColonIdeal
Integer Ring
> quo<Z|I>; // quotient of ring by ideal
Residue class ring of integers modulo 1

```

In fact, ${\mathbb{Z}}/I$ is computing the (fractional) ideal $J$ such that $JI={\mathbb{Z}}$. The technical reason for this is that both ${\mathbb{Z}}$ and $I$ are of type `RngInt`, and there is no specific `RngIntIdl` type as with order of number fields (where there are `RngOrd` and `RngOrdIdl`).

On the other hand, for instance for univariate polynomial rings where again there is no specific type for ideals, the `/` operator acts as the ring/ideal quotient (while `ColonIdeal` does not exist for this type, though it does for the multivariate polynomial ring type `RngMPol`).

```{.magma
> Zx<x> := PolynomialRing(Rationals());
> I := ideal<Zx|x>;
> Type(Zx),Type(I);
RngUPol RngUPol
> Zx/I; // same as quo<Zx|I>
Univariate Quotient Polynomial Algebra in over Rational Field
> Type(Zx/I);
RngUPolRes

```

### `PowerIdeal(R): Rng -> PowIdl`

The set of ideals of $R$. This is the parent of all ideals of $R$.

## Arithmetic Operations on Ideals

### `I + J: RngIdl, RngIdl -> RngIdl`

The sum of the ideals $I$ and $J$ of the ring $R$. This ideal consists of elements $a+b$, with $a\in I$ and $b\in J$. If $I$ is generated by $\{a_1, \ldots, a_k\}$ and $J$ is generated by $\{b_1, \ldots, b_m\}$, then $I+J$ is generated by $\{a_1, \ldots, a_k, b_1, \ldots, b_m\}$.

### `I * J: RngIdl, RngIdl -> RngIdl`

The product of the ideals $I$ and $J$ of the ring $R$. This is the ideal generated by elements $a\cdot b$, with $a\in I$ and $b\in J$, and it consists of elements $a_1b_1+\cdots+a_nb_n$, with $a_i\in I$ and $b_j\in J$.

### `I meet J: RngIdl, RngIdl -> RngIdl`

The intersection of the ideals $I$ and $J$ of the ring $R$.

## Boolean Operators on Ideals

Throughout this subsection $I$ and $J$ are ideals belonging to the same integer ring $R$, while $a$ is an element of $R$.

### `a in I: RngElt, RngIdl -> BoolElt`

Returns `true` if and only if the element $a$ is a member of the ideal $I$.

### `a notin I: RngElt, RngIdl -> BoolElt`

Returns `true` if and only if the element $a$ is not a member of the ideal $I$.

### `I eq J: RngIdl, RngIdl -> BoolElt`

Returns `true` if and only if the ideals $I$ and $J$ are equal.

### `I ne J: RngIdl, RngIdl -> BoolElt`

Returns `true` if and only if the ideals $I$ and $J$ are distinct.

### `I subset J: RngIdl, RngIdl -> BoolElt`

Returns `true` if and only if the ideal $I$ is contained in the ideal $J$.

### `I notsubset J: RngIdl, RngIdl -> BoolElt`

Returns `true` if and only if the ideal $I$ is not contained in the ideal $J$.
