# Ideal Class Monoid

Let $R$ be an order in an étale algebra $A$ over ${{\Bbb Q}}$. Ideal multiplication induces the structure of commutative monoid on the set of ideal classes of $R$, which we then call *ideal class monoid* of $R$. We denote it by ${\cal I}(R)$. The unit element of ${\cal I}(R)$ is the class of any principal fractional $R$-ideal.

We have a partitioning ${\cal I}(R) = \bigsqcup_S {\cal I}_S(R)$ where the disjoint union is taken over the overorders $S$ of $R$ and ${\cal I}_S(R)$ is the subset of ${\cal I}(R)$ consisting of ideal classes with multiplicator ring $S$. The computation is then performed by first computing ${\cal W}(R)$ and then observing that for each overorder $S$ of $R$, the Picard group ${\rm Pic}(S)$ acts freely on ${\cal I}_S(R)$ with quotient space ${\cal W}_S(R)$.

## `ICM_bar(S): AlgEtQOrd -> SeqEnum`

```magma
GRH: BoolElt                    Default: false
```

Returns the ideal classes of fractional $S$-ideals having Multiplicator Ring equal to $S$. This is the same as the orbit of the action of `PicardGroup(S)` on `WKICM_bar(S)`.

## `ICM(S): AlgEtQOrd -> SeqEnum`

```magma
GRH: BoolElt                    Default: false
```

Returns the ideal class monoid of the order $S$, that is, a set of representatives for the isomorphism classes of the fractional $S$-ideals.

We also provide an abstract representation of the ideal class monoid. The abstract monoid has type `AlgEtQICM` and classes have type `AlgEtQICMElt`. An ideal class can be created via `!` starting from an overorder or a fractional ideal, and a (deterministic) representative can be recovered using `RepresentativeMap`. Each class is internally a pair consisting of a weak equivalence class and an element of the abstract representation of ${\rm Pic}(S)$.

The second method to compute the ideal class monoid of an order $R$, returns an abstract representation of ${\cal I}(R)$ with type `AlgEtQICM` together with a map to a set of representatives. Each class has type `AlgEtQICMElt`, and it is internally represented as a pair consisting of a weak equivalence class (of type `AlgEtQWECMElt`) and an element of the representation of ${\rm Pic}(S)$ (as an abstract abelian group), where $S$ is the corresponding multiplicator ring. This representation is more efficient than the previous one, since it does not need to compute in advance and store a representative for each ideal class. Ideal classes can be created using the coercion operator `!` starting from an overorder $S$ of $R$ or a fractional $S$-ideal. Ideal classes can be multiplied using the operator `*`.

## `IdealClassMonoidAbstract(R): AlgEtQOrd -> AlgEtQICM, Map`

Given an order $R$, returns the abstract ideal class monoid ${\rm icm}$ together with a map (with preimages) sending each class to a representative.

## `icm ! x: AlgEtQICM, Any -> AlgEtQICMElt`

Coerce $x$ into the abstract ideal class monoid when possible, returning an ideal class.

## `x in icm: AlgEtQICMElt, AlgEtQICM -> BoolElt`

## `Parent(x): AlgEtQICMElt -> AlgEtQICM`

## `WEClass(x): AlgEtQICMElt -> AlgEtQWECMElt`

## `PicClass(x): AlgEtQICMElt -> GrpAbElt, Map`

## `Ideal(x): AlgEtQICMElt -> AlgEtQIdl`

## `MultiplicatorRing(x): AlgEtQICMElt -> AlgEtQOrd`

## `x1 eq x2: AlgEtQICMElt, AlgEtQICMElt -> BoolElt`

## `x * y: AlgEtQICMElt, AlgEtQICMElt -> AlgEtQICMElt`

## `x ^ n: AlgEtQICMElt, RngIntElt -> AlgEtQICMElt`

## `IsOne(x): AlgEtQICMElt -> BoolElt`

## `IsInvertibleInMultiplicatorRing(x): AlgEtQICMElt -> BoolElt`

## `Order(icm): AlgEtQICM -> AlgEtQOrd`

## `RepresentativeMap(icm): AlgEtQICM -> Map`

## `icm1 eq icm2: AlgEtQICM, AlgEtQICM -> BoolElt`

## `# icm: AlgEtQICM -> RngInt`

## `Classes(icm): AlgEtQICM -> SeqEnum[AlgEtQICMElt]`

## `Representatives(icm): AlgEtQICM -> SeqEnum[AlgEtQIdl]`

## `One(icm): AlgEtQICM -> AlgEtQICMElt`

## `Random(icm): AlgEtQICM -> AlgEtQICMElt`

(More standard intrinsics.)
