---
title: "Ideal Operations"
canonical: "https://docs.magma-maths.org/v2.30-1/BasicRings/ResidueClassRings/ideal-ops.html"
source: "https://docs.magma-maths.org/v2.30-1/BasicRings/ResidueClassRings/ideal-ops.md"
part: "Basic Rings"
chapter: "Integer Residue Class Rings"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Basic Rings", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/index-basic-rings.md"}
  - {"title": "Integer Residue Class Rings", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/ResidueClassRings/index-residue-class-rings.md"}
prev: {"title": "Elements of Residue Class Rings", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/ResidueClassRings/elements.md"}
next: {"title": "The Unit Group", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/ResidueClassRings/unit-group.md"}
intrinsics:
  - {"name": "ideal", "signature": "ideal< R | a₁, ..., aᵣ >: RngIntRes, RngIntResElt, ..., RngIntResElt -> RngIntRes"}
  - {"name": "GreatestCommonDivisor", "signature": "GreatestCommonDivisor(a, b): RngIntResElt, RngIntResElt -> RngIntResElt"}
  - {"name": "Gcd", "signature": "Gcd(a, b): RngIntResElt, RngIntResElt -> RngIntResElt"}
  - {"name": "GCD", "signature": "GCD(a, b): RngIntResElt, RngIntResElt -> RngIntResElt"}
  - {"name": "GreatestCommonDivisor", "signature": "GreatestCommonDivisor(Q): [RngIntResElt] -> RngIntResElt"}
  - {"name": "Gcd", "signature": "Gcd(Q): [RngIntResElt] -> RngIntResElt"}
  - {"name": "GCD", "signature": "GCD(Q): [RngIntResElt] -> RngIntResElt"}
  - {"name": "LeastCommonMultiple", "signature": "LeastCommonMultiple(a, b): RngIntResElt, RngIntResElt -> RngIntResElt"}
  - {"name": "Lcm", "signature": "Lcm(a, b): RngIntResElt, RngIntResElt -> RngIntResElt"}
  - {"name": "LCM", "signature": "LCM(a, b): RngIntResElt, RngIntResElt -> RngIntResElt"}
  - {"name": "LeastCommonMultiple", "signature": "LeastCommonMultiple(Q): [RngIntResElt] -> RngIntResElt"}
  - {"name": "Lcm", "signature": "Lcm(Q): [RngIntResElt] -> RngIntResElt"}
  - {"name": "LCM", "signature": "LCM(Q): [RngIntResElt] -> RngIntResElt"}
  - {"name": "+", "signature": "I + J: RngIntRes, RngIntRes -> RngIntRes"}
  - {"name": "*", "signature": "I * J: RngIntRes, RngIntRes -> RngIntRes"}
  - {"name": "meet", "signature": "I meet J: RngIntRes, RngIntRes -> RngIntRes"}
  - {"name": "in", "signature": "a in I: RngIntResElt, RngIntRes -> BoolElt"}
  - {"name": "notin", "signature": "a notin I: RngIntResElt, RngIntRes -> BoolElt"}
  - {"name": "eq", "signature": "I eq J: RngIntRes, RngIntRes -> BoolElt"}
  - {"name": "ne", "signature": "I ne J: RngIntRes, RngIntRes -> BoolElt"}
  - {"name": "subset", "signature": "I subset J: RngIntRes, RngIntRes -> BoolElt"}
  - {"name": "notsubset", "signature": "I notsubset J: RngIntRes, RngIntRes -> BoolElt"}
---

# Ideal Operations

<a id="constructor-constructor-ideal-rngintres-rngintreselt-rngintreselt-rngintres"></a>
## `ideal< R | a₁, ..., aᵣ >: RngIntRes, RngIntResElt, ..., RngIntResElt -> RngIntRes`

The ideal of the residue ring $R$ generated by the greatest common divisor of the elements $a_i$ and the modulus of $R$.

<a id="function-greatestcommondivisor-rngintreselt-rngintreselt"></a>
## `GreatestCommonDivisor(a, b): RngIntResElt, RngIntResElt -> RngIntResElt`

<a id="function-gcd-rngintreselt-rngintreselt"></a>
## `Gcd(a, b): RngIntResElt, RngIntResElt -> RngIntResElt`

<a id="function-gcd-rngintreselt-rngintreselt-2"></a>
## `GCD(a, b): RngIntResElt, RngIntResElt -> RngIntResElt`

Greatest common divisor of the elements $a$ and $b$ of $R$, that is, a generator for the $R$-ideal $(a)+(b)$.

<a id="function-greatestcommondivisor-rngintreselt"></a>
## `GreatestCommonDivisor(Q): [RngIntResElt] -> RngIntResElt`

<a id="function-gcd-rngintreselt"></a>
## `Gcd(Q): [RngIntResElt] -> RngIntResElt`

<a id="function-gcd-rngintreselt-2"></a>
## `GCD(Q): [RngIntResElt] -> RngIntResElt`

Greatest common divisor of the sequence of elements $Q$, that is, a generator for the $R$-ideal generated by the elements in $Q$.

<a id="function-leastcommonmultiple-rngintreselt-rngintreselt"></a>
## `LeastCommonMultiple(a, b): RngIntResElt, RngIntResElt -> RngIntResElt`

<a id="function-lcm-rngintreselt-rngintreselt"></a>
## `Lcm(a, b): RngIntResElt, RngIntResElt -> RngIntResElt`

<a id="function-lcm-rngintreselt-rngintreselt-2"></a>
## `LCM(a, b): RngIntResElt, RngIntResElt -> RngIntResElt`

Least common multiple of the elements $a$ and $b$ of $R$, that is, a generator for the $R$-ideal $(a)\cap (b)$.

<a id="function-leastcommonmultiple-rngintreselt"></a>
## `LeastCommonMultiple(Q): [RngIntResElt] -> RngIntResElt`

<a id="function-lcm-rngintreselt"></a>
## `Lcm(Q): [RngIntResElt] -> RngIntResElt`

<a id="function-lcm-rngintreselt-2"></a>
## `LCM(Q): [RngIntResElt] -> RngIntResElt`

Least common multiple of the sequence of elements $Q$, that is, a generator for the $R$-ideal formed by the intersection of the principal ideals generated by elements of $Q$.

<a id="operation-op-plus-rngintres-rngintres"></a>
## `I + J: RngIntRes, RngIntRes -> RngIntRes`

<a id="operation-op-times-rngintres-rngintres"></a>
## `I * J: RngIntRes, RngIntRes -> RngIntRes`

<a id="operation-op-meet-rngintres-rngintres"></a>
## `I meet J: RngIntRes, RngIntRes -> RngIntRes`

<a id="operation-op-in-rngintreselt-rngintres"></a>
## `a in I: RngIntResElt, RngIntRes -> BoolElt`

<a id="operation-op-notin-rngintreselt-rngintres"></a>
## `a notin I: RngIntResElt, RngIntRes -> BoolElt`

<a id="operation-op-eq-rngintres-rngintres"></a>
## `I eq J: RngIntRes, RngIntRes -> BoolElt`

<a id="operation-op-ne-rngintres-rngintres"></a>
## `I ne J: RngIntRes, RngIntRes -> BoolElt`

<a id="operation-op-subset-rngintres-rngintres"></a>
## `I subset J: RngIntRes, RngIntRes -> BoolElt`

<a id="operation-operation-notsubset-rngintres-rngintres-boolelt"></a>
## `I notsubset J: RngIntRes, RngIntRes -> BoolElt`
