# Weak Classes

Let $R$ be an order and $I$ and $J$ be fractional $R$-ideals in an étale algebra $A$ over ${{\Bbb Q}}$. Then the following statements are equivalent:

**(a)**
$I_{{\frak p}} \simeq J_{{\frak p}}$ as $R_{{\frak p}}$-modules for every maximal ideal ${\frak p}$ of $R$.

**(b)**
$I_p \simeq J_p$ as $R_p$-modules for every rational prime $p$.

**(c)**
$1 \in (I:J)(J:I)$.

**(d)**
$I$ and $J$ have the same multiplicator ring, say $S$, and $(I:J)$ is an invertible fractional $S$-ideal.

**(e)**
$I$ and $J$ have the same multiplicator ring, say $S$, and $(J:I)$ is an invertible fractional $S$-ideal. If the previous conditions hold, one says that $I$ and $J$ are *weakly equivalent*. This is an equivalence relation.

Note that if $I$ is an order, then $J$ is weakly equivalent to $I$ if and only if $J$ is an invertible $I$-ideal. If both $I$ and $J$ are orders then they are weakly equivalent if and only if they are equal. In the literature, the same notion sometimes goes under the name *local isomorphism*.

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

```magma
Method: MonStgElt                    Default: "Auto"
```

Returns representatives of all the weak equivalence classes $I$ of $S$ satisfying $(I:I)=S$. The parameter `Method` (default `"Auto"`) determines if we should use the `"IntermediateIdeals"` routine or the `"LowIndexProcess"`, which is potentially much slower but more memory efficient.

## `WeakEquivalenceClassesWithPrescribedMultiplicatorRing(S): AlgEtQOrd -> SeqEnum[AlgEtQIdl]`

Given an order $S$, returns representatives $I$ of all weak equivalence classes of fractional $S$-ideals with $(I:I)=S$.

We also provide an abstract representation of the weak equivalence class monoid. In this representation the monoid has type `AlgEtQWECM` and classes have type `AlgEtQWECMElt`. Classes can be created via the coercion operator `!`, multiplied with `*` (and exponentiated with `^`), and a representative can be recovered using the `RepresentativeMap`. Additional helpers include `IsOne`, `IsIdempotent`, and `Localization`.

Let $R$ be an order in an étale algebra over ${{\Bbb Q}}$. Then ideal multiplication induces a commutative monoid structure on the set of weak equivalence classes of fractional $R$-ideals called the *weak equivalence class monoid* of $R$. This commutative monoid, which we denote by ${\cal W}(R)$, is finite and has unit element given by the class of $R$.

Since the multiplicator ring is an invariant of the weak equivalence class of a fractional $R$-ideal, we have a partitioning ${\cal W}(R) = \bigsqcup_S {\cal W}_S(R)$, where the disjoint union is taken over the overorders $S$ of $R$ and ${\cal W}_S(R)$ is the subset of ${\cal W}(R)$ consisting of the weak equivalence classes of fractional $R$-ideals with multiplicator ring $S$.

Let $S$ be an overorder of $R$. If $S$ is Gorenstein then ${\cal W}_S(R)$ consists only of the class defined by $S$. If $S$ has Cohen-Macaulay type $2$ and ${\frak p}$ is a prime of $S$, then each fractional $R$-ideal $I$ with multiplicator ring $S$ satisfies either $I_{\frak p} \simeq S_{\frak p}$ or $I_{\frak p} \simeq S^t_{\frak p}$. The second possibility occurs precisely when $S$ has Cohen-Macaulay type $2$ at the primes ${\frak p}$. This classification results provide a very efficient method to compute ${\cal W}_S(R)$ for orders $S$ with Cohen-Macaulay type $\leq 2$. For the general case, an algorithm that includes a more expensive enumeration step is provided.

## `WeakEquivalenceClassMonoid(E): AlgEtQOrd -> SeqEnum[AlgEtQIdl]`

## `WKICM(E): AlgEtQOrd -> SeqEnum`

```magma
Method: MonStgElt                    Default: "Auto"
```

Computes the weak equivalence class monoid of $E$. The parameter `Method` (default `"Auto"`) determines if we should use the `"IntermediateIdeals"` routine or the `"LowIndexProcess"`, which is potentially much slower but more memory efficient.

The second method to compute ${\cal W}(R)$ returns an abstract representation of the monoid together with a map giving representatives. The monoid is of type `AlgEtQWECM` and each class is of type `AlgEtQWECMElt`. Classes can be created by feeding to the operator `!` a fractional $S$-ideal, when $S$ is an overorder of $R$, or an overorder of $R$ itself. Whenever a class is created a representative is stored in an attribute. This representative can be changed using the intrinsic `SetRepresentative`. Classes can be multiplied using the operator `*`. Whenever two classes are multiplied, the result is stored in the attribute `MultiplicationTable` of the monoid.

## `WeakEquivalenceClassMonoidAbstract(R): AlgEtQOrd -> AlgEtQWECM, Map`

Given an order $R$, returns the abstract weak equivalence class monoid $W$ of $R$ together with a map (with preimages) sending each class to a representative.

## `W ! x: AlgEtQWECM, Any -> AlgEtQWECMElt`

Coerce $x$ into the monoid $W$, when possible, returning a class.

## `x in W: AlgEtQWECMElt, AlgEtQWECM -> BoolElt`

Returns whether the class $x$ belongs to the monoid $W$.

## `Parent(x): AlgEtQWECMElt -> AlgEtQWECM`

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

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

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

## `SetRepresentative(x, J): AlgEtQWECMElt, AlgEtQIdl`

Change the stored representative of the class $x$ to the weakly equivalent ideal $J$.

## `MultiplicationTable(W): AlgEtQWECM -> Assoc`

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

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

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

## `IsIdempotent(x): AlgEtQWECMElt -> BoolElt`

## `Order(W): AlgEtQWECM -> AlgEtQOrd`

## `Array(W): AlgEtQWECM -> Assoc`

## `RepresentativeMap(W): AlgEtQWECM -> Map`

## `W1 eq W2: AlgEtQWECM, AlgEtQWECM -> BoolElt`

## `# W: AlgEtQWECM -> RngInt`

## `Classes(W): AlgEtQWECM -> SeqEnum[AlgEtQWECMElt]`

## `Representatives(W): AlgEtQWECM -> SeqEnum[AlgEtQIdl]`

## `One(W): AlgEtQWECM -> AlgEtQWECMElt`

## `Random(W): AlgEtQWECM -> AlgEtQWECMElt`

## `Idempotents(W): AlgEtQWECM -> SeqEnum[AlgEtQWECMElt]`

## `Localization(W, P): AlgEtQWECM, AlgEtQIdl -> AlgEtQWECM`

## `IsGeneratingSet(W, seq): AlgEtQWECM, SeqEnum[AlgEtQWECMElt] -> BoolElt`

## `IsGeneratingSet(W, seq): AlgEtQWECM, SeqEnum[AlgEtQIdl] -> BoolElt`

(More standard intrinsics.)

## `Example: Weak Equivalence Classes (ex-628357)`

```magma
> _<x> := PolynomialRing(Integers());
> f := (x^4+16)*(x^4+81);
> A := EtaleAlgebra(f);
> E := EquationOrder(A);
> w := WKICM_bar(E);
> #w;
1
> // Optionally compute full monoid
> W := WKICM(E);
> #W;

```
