Realizing orders as group rings

An order is a commutative ring that as an abelian group is finitely generated and free. A commutative ring is reduced if it has no non-zero nilpotent elements. In this paper we use a new tool, namely, the fact that every reduced order has a universal grading, to answer questions about realizing orders as group rings. In particular, we address the Isomorphism Problem for group rings in the case where the ring is a reduced order. We prove that any non-zero reduced order $R$ can be written as a group ring in a unique ``maximal'' way, up to isomorphism. More precisely, there exist a ring $A$ and a finite abelian group $G$, both uniquely determined up to isomorphism, such that $R\cong A[G]$ as rings, and such that if $B$ is a ring and $H$ is a group, then $R\cong B[H]$ as rings if and only if there is a finite abelian group $J$ such that $B\cong A[J]$ as rings and $J\times H\cong G$ as groups. Computing $A$ and $G$ for given $R$ can be done by means of an algorithm that is not quite polynomial-time. We also give a description of the automorphism group of $R$ in terms of $A$ and $G$.


Introduction
Consider the map ({rings}/ ∼ =) × ({groups}/ ∼ =) → ({rings}/ ∼ =) that for each ring A and each group G sends the pair of isomorphism classes of (A, G) to the isomorphism class of the group ring A[G].The Isomorphism Problem for group rings asks about the fibers of this map, i.e., given a ring R, what can one say about the pairs (A, G) with A[G] ∼ = R?There is a great deal of literature on this subject, starting with the 1940 paper by Higman [4], which solved the case where A = Z and G is a finite abelian group, and including [15,Chapter 14], [17,Chapters III and IV], [18], and the recent survey article [16] and the references therein.
The emphasis has been on results stating that the fibers of our map are often "small" in a suitable sense.For instance, it is a consequence of a theorem of May [11] that if G is an abelian group and Z[G] ∼ = Z[H] then G ∼ = H.This contrasts with the complex case, where C[G] ∼ = C[H], even as C-algebras, whenever G and H are finite abelian groups of the same order.
One can slightly refine the question by not just asking for the existence of an isomorphism from A[G] to R, but asking for the isomorphism as well.For a given non-zero ring R the object of study is thus the set of triples (A, G, φ), where A is a ring (always with 1), G is a group, and φ : A[G] → R is a ring isomorphism.This essentially comes down to considering the set where R * is the group of units of R, and A[G] → R is the natural group homomorphism.
One of the main contributions of the present paper is a new group-theoretic description of the set D(R) for an important class of rings R, namely for connected reduced orders; see below for definitions.These rings are commutative, so A is commutative and G is abelian.The case of commutative group rings has received special attention in the literature (for example [1,10,11,12,13,14]), an important tool being the abelian group µ = µ(R) = {ζ ∈ R : (∃ n ∈ Z ≥1 ) ζ n = 1} of roots of unity in a commutative ring R.
For connected reduced orders R we add a new tool, namely the universal grading of R and the abelian group Γ = Γ(R) by which it is graded.The existence of such a universal grading was recently established in [9], and it was proved there that it comes with a natural map d = d R : µ → Γ.In one of our main theorems (Theorem 6.7 below) we exhibit, for connected reduced orders R, a natural bijection D(R) Thus, the set of realizations of a connected reduced order as a group ring is parametrized by an easily defined set of homomorphisms from Γ to µ, both of which are finite abelian groups.
The theorem just stated has several striking consequences in the context of the Isomorphism Problem.For example, in Theorem 1.1 we prove that among reduced orders, group rings can only be isomorphic if they are so for obvious reasons.In Theorem 1.2 we show that each non-zero reduced order can in a unique "maximal" way be realized as a group ring.In Theorem 1.3 we establish a curious "cross-over" result.For the connected case, we describe in Theorem 1.5 the group of ring automorphisms of such a maximal group ring.
Deducing these results from our description of D(R) is surprisingly non-trivial, and has two features that may be unexpected in the context of commutative algebra.The first is the use of modules over non-commutative rings, and the second the use of techniques from number theory, taken from [7] and [9].We next give precise statements of some of our main results, along with a brief introduction to our new tool and methods.
By an order we mean a commutative ring of which the additive group is isomorphic to Z n for some n ∈ Z ≥0 .A ring element x is nilpotent if x n = 0 for some n ∈ Z >0 .We call a commutative ring reduced if it has no non-zero nilpotent elements.
Obviously, if A is a ring and I and H are groups, then the group rings A[I × H] and (A[I])[H] are isomorphic as rings.The following result expresses that, among reduced orders, group rings can only be isomorphic if they are so for this obvious reason.The proof is given in Section 8. We call a commutative ring R stark if there do not exist a ring A and a non-trivial group G such that R is isomorphic to the group ring A[G].
Theorem 1.2.Let R be a non-zero reduced order.Then there exist a stark ring A, unique up to ring isomorphism, and a finite abelian group G, unique up to group isomorphism, such that R ∼ = A[G] as rings.
Theorem 1.2 is an immediate consequence of Theorem 1.1, and we give a proof in Section 8. We note that Theorem 1.1 may be deduced from Theorem 1.2 using that group rings of finite abelian groups over reduced orders are reduced (see Proposition 5.7(i)).There are many examples showing that A and G in Theorem 1.2 need not be uniquely determined as a subring of R and a subgroup of R * , respectively (see Example 6.11).
Theorems 1.1 and 1.2 are closely related to known results about group rings of torsion abelian groups over integral domains of characteristic zero; see Corollary 5 in [1] and Theorem 8 in [14], which were proved by studying the group of torsion units in the group ring.Our new tool, namely the consideration of gradings, allows us in the case of orders to replace the condition that the base ring be a domain by the weaker condition that it be stark and reduced.
A ring element x is idempotent if x 2 = x.We call a commutative ring connected if it has precisely two idempotents, i.e., the ring is non-zero and 0 and 1 are the only idempotents.For a commutative ring R with a subring A ⊂ R and a subgroup G ⊂ R * we write A[G] = R when the natural map A[G] → R is a ring isomorphism.
If R, A, and G are as in Theorem 1.2, then A is isomorphic to a subring of R, and G is isomorphic to a subgroup of µ(R), but as we remarked, this subring and subgroup need not be uniquely determined.However, in the important special case where R is connected, there is a sense in which the set of subrings A ⊂ R that can be used and the set of subgroups G ⊂ µ(R) that can be used are entirely independent.The following "cross-over" result, which we found surprising, formulates this more precisely.
Theorem 1.3.Let R be a connected reduced order.Suppose that A and B are stark subrings of R and that G and Theorem 1.3 will follow immediately from Theorem 6.10, which is proved in Section 6 below.As can be seen in Example 6.12, we cannot drop the assumption that R be connected in Theorem 1.3.
We call a ring element x autopotent if x n+1 = x for some n ∈ Z >0 , or equivalently if it is the product of a root of unity and an idempotent that commute with each other (see Proposition 9.6.iv).
We have the following algorithmic result.All our algorithms will be deterministic.

Theorem 1.4.
There is an algorithm that, given a non-zero reduced order R, computes a stark subring This algorithm runs (a) in polynomial time when the additive group of R is generated by autopotents, and generally (b) in time n O(m) where n is the length of the input and m is the number of minimal prime ideals of R.
The proof of Theorem 1.4, and a description of the algorithm and how its input and output are given, are found in Section 9. Note that the algorithm runs in polynomial time when m is bounded by a constant.The case m = 1 is precisely the case where R is a domain, in which case one necessarily has A = R and G = 1.A notable special case for (a) is when R is the product of finitely many group rings over Z.We do not know whether there exists a polynomial-time algorithm that decides whether a given reduced order is stark.
We next discuss the new tool that we announced.A grading of a commutative ring R is a pair (∆, (R δ ) δ∈∆ ) where ∆ is an abelian group and the R δ are additive subgroups of R such that, first, for all γ, δ ∈ ∆ one has R γ • R δ ⊂ R γδ , and, second, one has δ∈∆ R δ = R in the sense that the natural map δ∈∆ R δ → R is bijective.For each commutative ring A and abelian group G the ring A[G] has a natural grading (G, (Aγ) γ∈G ).
Suppose now that R is a reduced order.Two recent results from [9] (Theorems 5.5 and 5.6 below) are of crucial importance to the present paper.The first states that R has a grading (Γ, (R γ ) γ∈Γ ) that is universal in the sense that giving a grading of R with group ∆ is equivalent to giving a group homomorphism Γ → ∆ (see Definition 5.3).The abelian group Γ = Γ(R) is finite, and by universality it is canonically defined, so that the group Aut(R) of ring automorphisms acts on it (see Remark 6.4).The second result states that, if R is also connected, then for each ζ ∈ µ there is a unique γ ∈ Γ such that ζ ∈ R γ , and we write d(ζ) = γ; this gives rise to a group homomorphism d : µ → Γ, sometimes denoted d R , which we call the degree map.
For each (A, G) ∈ D(R), the natural grading of A[G] gives rise to the grading (µ, 0 otherwise.This grading corresponds to a homomorphism f : Γ → µ.We prove in Theorem 6.7 that in the connected case this construction induces a bijection from D(R) to the set of f such that f df = f , so D(R) can be studied group-theoretically as mentioned above.
Our next result is on automorphism groups of orders.As we saw in Theorem 1.2, any non-zero reduced order R may be written as A[G], where A is a stark subring of R and G is a subgroup of µ(R), but it is only up to the action of the automorphism group Aut(R) that the pair (A, G) is unique.Thus, a natural question is how to describe the group Aut(R) in terms of A and G. Restricting to connected orders, which is the main case of interest, we show in Theorem 1.5 that this group has a somewhat curious description in terms of 2 × 2 matrices.
We write µ = µ(A) and Γ = Γ(A).There is a left action of Aut(A) on Hom(G, µ) given via the restriction Aut(A) → Aut(µ), and a right action of Aut(A) on Hom(Γ, G) induced by its action on Γ.For abelian groups M and N we will, here and elsewhere, write the group Hom(M, N ) additively, regardless of the notation used for N .Theorem 1.5.Let A be a stark connected reduced order with degree map d A : µ → Γ and let G be a finite abelian group.We equip the cartesian product of Aut(A), Hom(G, µ), Hom(Γ, G), and Aut(G) with the following multiplication: where the sum in Aut(A) is as in Lemma 7.7 and the sum in Aut(G) is taken inside End(G).For for all g ∈ G, γ ∈ Γ, and x ∈ A γ .
For the proof and additional results, we refer to Section 7.
Theorem 1.6.Let A be a stark connected reduced order with degree map d A : µ → Γ and let G be a finite abelian group.
The pairs (B, H) in Theorem 1.6 are exactly the pairs occurring in Theorem 1.3 with R = A[G].Theorem 1.6 allows one, in the connected case, to read off the set of subrings A ⊂ R and the set of subgroups G ⊂ R * that can be used in Theorem 1.2.At the end of Section 8 we show how Theorem 1.6 readily follows from Theorems 1.5 and 1.2.
Our results suggest several questions.Which other rings have a universal grading?Under what conditions is there a degree map?Once one has a degree map d : µ → Γ, are there consequences for the Isomorphism Problem for group rings, even if µ or Γ is infinite?Can we replace rings by algebras over base rings other than Z?For preliminary results in these directions, see Theorem 6.21 in [19] (cf.Theorem 5.5), and [20] (cf.Theorem 5.6).
The structure of the paper is as follows.Section 2 contains generalities on modules of finite length over rings that need not be commutative.We show in Section 3 that a morphism of abelian groups, in particular the degree map defined above, can be interpreted as a module over a certain matrix ring.This enables us, in Section 4, to apply the theorem of Krull-Remak-Schmidt to morphisms of finite abelian groups.Additionally, we introduce, for any morphism of abelian groups, an important group U * that acts on it.In Section 5 we treat generalities on graded rings and group rings.In Section 6 we apply the theory from the former sections to the degree map of a connected reduced order.It is an essential property of U * that its action on the degree map can be lifted to an action on the order (see Lemma 6.5).We prove Theorem 1.3 by showing that the pairs (A, G), (B, H), (A, H), and (B, G) are in the same orbit under the action of U * .This effectively proves Theorems 1.1 and 1.2 in the connected case.In Section 7 we prove Theorem 1.5.Here U * will make a further appearance.In Section 8 we deduce Theorems 1.1 and 1.2 by reduction to the connected case.Finally, the algorithmic Theorem 1.4 is proved in Section 9.

Modules and Decompositions
In this section we gather some results on modules, by which we mean left modules.Let R be a ring and M an R-module.We call an R-module D a divisor of M if M ∼ = D ⊕ N for some R-module N .If (M i ) i∈I is a family of submodules of M , then there is a natural map i∈I M i → M , and we write Definition 2.1.Let R be a ring and M an R-module.A decomposition of M is a pair (I, (M i ) i∈I ) where I is a set and the M i are submodules of M such that i∈I M i = M ; in this case we also call (M i ) i∈I an I-indexed decomposition of M .We call M indecomposable if M is non-zero and there do not exist non-zero R-modules D and N with M ∼ = D ⊕ N .
We abbreviate (M i ) i∈I to (M i ) i when the index set is understood.We equip Id(R) with a partial order given by e ≤ f if and only if ef = f e = e.We equip Dec(M ) with a partial order given by (D, N ) ≤ (D ′ , N ′ ) if and only if there exists a submodule The following result, which we will use to prove Theorem 1.3, is easily verified.Proposition 2.3.Let R be a ring and M an R-module.Then we have a bijection Φ : Id(End(M )) → Dec(M ) given by e → (ker(e), im(e)).If we let Aut(M ) act naturally both on Id(End(M )) by conjugation and on Dec(M ) coordinate-wise, then Φ is an isomorphism of partially ordered sets that respects the action of Aut(M ).
A module has finite length if every totally ordered set of submodules is finite, or equivalently if it is both Noetherian and Artinian.
Theorem 2.4 (Krull-Remak-Schmidt; see Theorem X.7.5 of [5]).Suppose R is a ring and M is an R-module of finite length.Then there exists a decomposition of M into finitely many indecomposable submodules, and such a decomposition is unique up to automorphisms of M and relabeling of the indices.
Remark 2.5.Let R be a ring, and let M be a non-empty set of R-modules of finite length.As a consequence of Theorem 2.4, there exists up to isomorphism exactly one R-module D that is a divisor of every M ∈ M such that every R-module that is a divisor of every M ∈ M is a divisor of D; it is called a greatest common divisor of the set M. Every such D is of finite length.We say R-modules M and N are coprime if the greatest common divisor of {M, N } is 0. Likewise, if M is a finite set of R-modules of finite length, then there exists up to isomorphism exactly one R-module L of which each M ∈ M is a divisor such that L is a divisor of each R-module of finite length of which each M ∈ M is a divisor; it is called a least common multiple of M. Every such L is of finite length.Definition 2.6.Suppose R is a ring, M is an R-module, and h ∈ End(M ).We define the R-modules Lemma 2.7 (Fitting; see Theorem X.7.3 of [5]).Suppose R is a ring, M is an R-module of finite length, and h ∈ End(M ).Then M = lim im(h) ⊕ lim ker(h), the restriction of h to lim im(h) is an automorphism, and the restriction of h to lim ker(h) is nilpotent.Lemma 2.8.Suppose R is a ring, M and N are R-modules, and f : M → N and g : N → M are morphisms.Then f restricts to morphisms i : lim im(gf ) → lim im(f g) and k : lim ker(gf ) → lim ker(f g).If M and N have finite length, then i is an isomorphism.
Proof.We have f (gf ) n (M ) = (f g) n f (M ) ⊂ (f g) n (N ) for all n ≥ 1. Hence f (lim im(gf )) ⊂ lim im(f g), so i is well-defined.As f (ker((gf for all n ≥ 1 we also get f (lim ker(gf )) ⊂ lim ker(f g), so k is well-defined.By symmetry we obtain a restriction j : lim im(f g) → lim im(gf ) of g.Under the finite length assumption both ji and ij are automorphisms by Lemma 2.7, hence i is an isomorphism.
Proposition 2.9.Suppose R is a ring, M is an R-module of finite length, and Note that under the above assumptions it immediately follows that Proof.From Theorem 2.4 it follows that A 2 ∼ = B 2 and thus B 1 and B 2 are coprime as well.By symmetry it therefore suffices to show B 1 ⊕ A 2 = M .We consider the maps as in the following commutative diagram, where ϕ : A 1 → B 1 is an isomorphism, the maps to and from M are the natural inclusions and projections, and the f i and g i are defined to make the diagram commute.
Note that id B1 = pe and id M = e 1 p 1 + e 2 p 2 , so Lemma 2.8 shows that D = lim im(g 2 f 2 ) ∼ = lim im(f 2 g 2 ), so D is a divisor of both A 1 and A 2 by Lemma 2.7.Since A 1 and A 2 are coprime, we must have that D = 0 and thus g 2 f 2 is nilpotent.We conclude that g 1 f 1 = id A1 − g 2 f 2 is an automorphism of A 1 .Hence f 1 is injective, and since A 1 is of finite length it must be an automorphism.It follows that p (ii) the set Dec S (M ) is non-empty.Suppose in addition that S is saturated and that M is of finite length, and let

Proof. (i) Apply the definition of multiplicative with
is the direct sum of those M i that are, respectively are not, in S, then (A 1 , A 2 ) is in Dec S (M ) and it is maximal by (iii).If (B 1 , B 2 ) is also maximal, then B 2 , respectively B 1 , is a direct sum of indecomposables that are, respectively are not, in S; this follows from the definition of Dec S (M ) and from (iii).Since together these decompositions give a decomposition of M into indecomposables, Theorem 2.4 implies that Because the action of Aut(M ) preserves the partial order, this orbit is conversely contained in max(Dec S (M )).
(v) By (iii) we have that A 1 and A 2 are coprime and by (iv) we have We may conclude from Proposition 2.9 that (A 1 , B 2 ), (B 1 , A 2 ) ∈ Dec S (M ).Applying (iii) again we may conclude they are maximal.

Morphisms as modules
In this section we will interpret a morphism of (finite) abelian groups as a (finite length) module, as expressed by Proposition 3.3.We will then study decompositions of this module and what this decomposition corresponds to in terms of the original morphism.This will enable us in the next section to apply the Krull-Remak-Schmidt theorem to morphisms of finite abelian groups.
We write Z 0 Z Z for the ring of lower-triangular 2 × 2 matrices with integer coefficients, Ab for the category of abelian groups, and ab for the category of finite abelian groups.The following proposition can be thought of as an explicit instance of Mitchell's embedding theorem for abelian categories.

Proposition 3.3.
There is an equivalence of categories, specified in the proof, between the category AbHom and the category Z 0 Z Z -Mod of Z 0 Z Z -modules.This equivalence restricts to an equivalence between the subcategory abHom and the subcategory of Z 0 Z Z -modules of finite length.Proof.We will define functors F : AbHom → Z 0 Z Z -Mod and G : Z 0 Z Z -Mod → AbHom such that F G and GF are naturally isomorphic to the identity functors of their respective categories.For an object f : A → B we take F (f ) to be A ⊕ B, where the Z 0 Z Z -module structure is given by For a Z 0 Z Z -module M we take G(M ) to be the morphism E 11 M → E 22 M given by multiplication with E 21 , where E ij is the 2×2 matrix having a 1 at position (i, j) and zeros elsewhere.The remainder of this proposition is a straightforward verification.Definition 3.4.Write I for the class of Z 0 Z Z -modules that correspond to isomorphisms under the equivalence of categories of Proposition 3.3.
One readily checks that the class I is multiplicative and saturated in the sense of Definition 2.10.We observe that a Z 0 Z Z -module M belongs to I if and only if its Z 0 Z Z -module structure can be extended to a Z Z Z Z -module structure.This fact will not be needed, and we omit the proof.Remark 3.5.Using the equivalence of categories of Proposition 3.3, one can translate terminology related to modules into terminology about morphisms of abelian groups.We briefly go through what is most relevant to us: (ii) For morphisms f : A → B and g : C → D of abelian groups and for r = (α, β) ∈ Hom(f, g), the image im(r) equals the restriction im(α) → im(β) of g, and the kernel ker(r) equals the restriction ker(α) → ker(β) of f .(iii) If (f i ) i∈I is a family of morphisms f i : A i → B i of abelian groups, then we write i∈I f i for the natural map i∈I A i → i∈I B i and we write f /f i for the induced map A/A i → B/B i .One verifies that i∈I f i corresponds to the direct sum of the Z 0 Z Z -modules that the f i correspond to.If f : A → B is a morphism and f i : A i → B i is a family of restrictions of f then, just as we do for modules, we will write which is a partially ordered set as in Definition 2.2.The set Dec I (f ) is the set of (f 0 , f 1 ) ∈ Dec(f ) such that f 1 is an isomorphism.
Definition 3.6.For a morphism f : A → B of abelian groups we denote the ring of morphisms from f to f in the category AbHom by End(f ), we define Prj(f ) = {e ∈ Id(End(f )) : im(e) is an isomorphism}, and we equip Prj(f ) with the partial order inherited from the partial order on Id(End(f )) from Definition 2.2.
We have the following corollary to Proposition 2.3.
Corollary 3.7.Let f : A → B be a morphism of abelian groups.Then we have an isomorphism Prj(f ) → Dec I (f ) of partially ordered sets that respects the action of Aut(f ).

The group U *
In this section we fix a morphism d : A → B of abelian groups.We will define a group U * that acts on d and study some of its properties.
for m, n ∈ Z and f, g ∈ Hom(B, A).We define the multiplicative monoid the intersection of U with the group of units of Q.
It is easy to check that Q is indeed a ring with unit element 1 = (1, 0), and that the projection map Q → Z is a ring homomorphism with kernel Hom(B, A).The inverse image of 1 equals U , and U * is a group because it is the kernel of the induced group homomorphism Q * → Z * .The following lemma is easy to verify.Lemma 4.2.We have a ring homomorphism q : Q → End(d) defined by sending 1 to the identity id d and f ∈ Hom(B, A) to (f d, df ).It restricts to a group homomorphism U * → Aut(d).
We equip Id 0 with the partial order inherited from the partial order on Id(Q) as in Definition 2.2.
Remark 4.5.From Lemma 4.2 we get a map U * → Aut(d), i.e., U * acts on d.In turn, since an isomorphism between d's induces a bijection between their Id 0 's, the group Aut(d) acts on Id 0 .However, U * acts directly on Id 0 by conjugation within Q.Although we will not need it, both of the induced maps U * → Aut(Id 0 ) are the same.
Recall the terminology im(r), ker(r), and i∈I f i from Remark 3.  Since q is a ring homomorphism, it maps idempotents to idempotents.For f ∈ Id 0 it follows from f df = f that f and d are mutually inverse when restricted to im(df ) → im(f d), respectively im(f d) → im(df ).In particular im(q(f )), which is precisely the restriction of d just mentioned, is an isomorphism.Hence Φ restricts to Id 0 → Prj(d).Moreover, the restriction of f to ker(df ) → ker(f d) is zero since f df = f , so Ψ(Φ(f )) = f .We conclude that Φ and Ψ are mutually inverse.
All constructions are functorial in d and thus Aut(d) commutes with Φ.The definition of the partial order on idempotents is completely algebraic, so the partial order is preserved by Φ, which is the restriction of a ring homomorphism.

Proof. We have
and its extension g = id d0 ⊕ g 1 ∈ Aut(d) maps (d 0 , d 1 ) to (d 0 , d −1 ).Letting r = id d − g ∈ End(d), then r(d 1 ) ⊂ d 0 and r(d 0 ) = 0, so r 2 = 0. We first construct f ∈ Hom(B, A) that maps to r under The proof of the following proposition, which can be considered a sharpening of Proposition 2.11.iv when R = Z 0 Z Z , is the main reason for considering d as a module.

Graded rings
In this section we consider gradings, which may be viewed as a generalization of group rings.In Section 6 we will use them to prove Theorem 1.3.We begin by giving the definitions as we need them, and state some results from [9].Definition 5.1 (Definition 1.1 and Lemma 7.1 in [9]).Let R be a commutative ring.A grading of R is a pair (∆, R) where ∆ is a (multiplicatively written) abelian group and R = (R δ ) δ∈∆ is a ∆-indexed decomposition of R as a Z-module, as defined in Definition 2.1, such that R γ R δ ⊂ R γδ for all γ, δ ∈ ∆.For a grading (∆, R) with R = (R δ ) δ∈∆ and a group homomorphism f : ∆ → E, we define f * (R) to be the E-indexed decomposition (S ǫ ) ǫ∈E of R defined by S ǫ = δ∈f −1 ǫ R δ ; then (E, f * (R)) is a grading of R. We turn the class of gradings of R into a category by defining a morphism (∆, R) → (E, S) to be a group homomorphism f : ∆ → E for which f * (R) = S.
Remark 5.2.Note that every non-zero commutative group ring A[G] naturally comes with a grading (G, (Ag) g ).Let R be a commutative ring.Analogously to writing i∈I M i = M for submodules M i of some R-module M when the natural map i∈I M i → M is an isomorphism, we write [9]).Let R be a commutative ring.A grading (Γ, R) of R is called universal if it is an initial object of the category of gradings of R, or equivalently if for every grading (E, S) of R there is a unique group homomorphism f : Γ → E such that f * (R) = S.If a universal grading (Γ, R) exists, then it is unique up to a unique isomorphism and we refer to it as the universal grading of R. We write Γ(R) = Γ for the group of this grading.
Remark 5.4.If R and R ′ are commutative rings that have universal gradings, then any ring isomorphism R → R ′ induces a group isomorphism Γ(R) → Γ(R ′ ), so Γ(R) behaves functorially under ring isomorphisms; in particular, the group Aut(R) of ring automorphisms of R acts in a natural way on Γ(R).
Two important results on gradings of orders from [9] are fundamental to the present paper.The first concerns the existence of a universal grading.Recall a commutative ring is reduced if it has no non-zero nilpotent elements.Theorem 5.5 (Theorem 1.3 of [9]).If R is a reduced order, then R has a universal grading and Γ(R) is finite.
The second result relates to roots of unity.Recall that a commutative ring R is connected if it has exactly two idempotents and that µ(R) is the group of roots of unity in R.
Theorem 5.6 (Theorem 1.5.iii in [9]).If R is a connected order and The proofs of these two theorems as given in [9] are of a number-theoretic nature.For algebraic arguments one may refer to [19,20].
Another useful fact is that the properties of being reduced and being connected are preserved under construction of group rings.We write nil(R) for the set of nilpotent elements of a commutative ring R.
Proposition 5.7 (Theorem 1.5 in [9]).Let A be an order and G a finite abelian group.Then: Proof.We apply the theory of gradings to the natural grading of A[G].For (i) we apply Theorem 1.5.i in [9] . The remaining equivalence follows trivially.Theorem 1.5.ii and iii in [9] prove (ii) and (iii).
Proposition 5.8.Suppose R = (∆, (R δ ) δ ) is a grading of a commutative ring R and let If S is a grading of R and there exists a morphism f : R → S, then there exists a unique morphism f ′ : R ′ → S. It equals f • i. (iv) If there exists a morphism from R ′ to a universal grading, then R ′ is universal.
Proof.Both (i) and (ii) are trivial.For (iii), clearly f • i is such a morphism.For uniqueness, it follows from the definitions that f ′ must equal f for all δ ∈ ∆ such that R δ = 0, and such δ generate ∆ ′ .For (iv), we have a map from R ′ to any other grading by passing through the universal grading, and such a map is unique by (iii).For (v), if R is universal, then so is R ′ by (ii) and (iv), and then i is a bijection since universal objects are uniquely unique.Proposition 5.9.Let S and T be orders, write R = S ×T , and let π : R → S be the natural projection.
and if the former is universal, then so is the latter.
If the first two are universal, then so is the latter.
(ii) The first statement is immediate.For universality, any grading (∆, R) of R induces, as in (i), gradings of S and of T by the same group ∆, which come from unique group homomorphisms E → ∆ and Z → ∆.One readily checks that the induced group homomorphism E × Z → ∆ is the unique morphism (E × Z, (R (ǫ,ζ) ) (ǫ,ζ) ) → (∆, R).The details are left to the reader.Definition 5.10.When R is a commutative ring, we define the set and equip it with a partial order ≤ given by (B, H) ≤ (A, G) if and only if H ⊂ G and B ⊃ A.
Note that Aut(R) naturally acts component-wise on D(R).
Lemma 5.11.Suppose R is a non-zero order.Then for each (A, G) ∈ D(R) the order of G is at most the rank of R as a Z-module, and D(R) contains a maximal element.
Proof.By definition of D(R) the elements of G are linearly independent, from which the first claim follows.We have (R, 1) ∈ D(R), so D(R) is not empty.Thus if (A, G) ∈ D(R) and #G is maximal, then (A, G) is a maximal element of D(R).
Proof.By Lemma 5.11 the group H is finite, and by Proposition 5.7.iii the multiplication map µ(B) × Example 5.13.The conclusion to Lemma 5.12 does not hold in general for non-connected orders.Let p be prime and let G = C p × C p with C p a group of order p.Then G is a 2-dimensional F p -vector space and thus there are precisely p + 1 subgroups H 0 , . . ., H p of G of order p.We have and let ∆ : G → µ(R) be the map given by g → (g, g).Now consider the elements Recall that we say a commutative ring R is stark if there do not exist a ring A and a non-trivial group G such that R is isomorphic to the group ring A[G], or equivalently for R non-zero, if # D(R) = 1.Lemma 5.14.Let R be a non-zero commutative ring and let (A, G) ∈ D(R).If (A, G) is maximal, then A is stark.When R is a connected order, the converse also holds.A, G) is maximal we have (A, G) = (B, J × G) and thus J = 1, so A is stark.For connected orders, the converse follows from Lemma 5.12.
Note that from Theorem 1.1 it follows that maximality of (A, G) ∈ D(R) for a non-zero reduced order R is equivalent to A being stark even when R is not connected.However, we have not proved this yet.

The degree map
In this section we extract from a connected reduced order R a morphism d of abelian groups.We will describe D(R) in terms of d using the theory in Section 4 and then prove Theorem 1.3.Lemma 6.1.Let R be a connected reduced order and let (Γ(R), (R γ ) γ ) be its universal grading (see Definition 5.3).Then there exists a morphism of finite abelian groups d : Proof.The group Γ(R) is finite by Theorem 5.5, and µ(R) is finite by Lemma 3.3.ii in [7].By Theorem 5.6, if ζ ∈ µ(R), then there exists a γ ∈ Γ(R) such that ζ ∈ R γ .The element γ is unique, since R γ ∩ R δ = 0 for all γ = δ.That d is a homomorphism follows from the definitions.Definition 6.2.For a connected reduced order R we call the map d = d R : µ(R) → Γ(R) from Lemma 6.1 the degree map of R.
The above definition depends on the choice of universal grading.However, the universal grading of R is uniquely unique.Moreover, the proof of Theorem 1.3 of [9], which states that a reduced order has a universal grading, exhibited an explicit canonical choice of universal grading.Thus we can confidently refer to the degree map of a connected reduced order.We now describe the degree map (ii) if we identify µ(A[G]) with µ(A) × G as in Proposition 5.7.iii, then the degree map

be the universal gradings of A and A[G] respectively and define A[G] = (Γ(A)×G, (A
By universality there exists a unique morphism of gradings ϕ : R → A[G], which by Definition 5.1 a group homomorphism Γ(A[G]) → Γ(A) × G, and we will show that it is an isomorphism.Let π : Γ(A) × G → G be the projection and ∆ = ker(πϕ).
) is a grading of A, and ϕ restricts to a morphism of gradings ϕ ′ : R A → A with ϕ = ϕ ′ × id G .With ∆ ′ = δ ∈ ∆ : R δ = 0 we have so by Proposition 5.8.v we obtain ∆ ′ × G = Γ(A[G]) = ∆ × G. Hence ∆ ′ = ∆, so R A is universal by Proposition 5.8.iv.It follows that ϕ ′ and hence ϕ is an isomorphism, proving (i).Now (ii) and (iii) follow by inspection.Proposition 6.3.iiexpresses the degree map of A[G] in terms of G and the degree map of A, but we will mainly use it in the opposite direction.Specifically, for a connected reduced order R, an element (A, G) ∈ D(R) corresponds to a certain decomposition (d A , id G ) ∈ Dec I (d) of the degree map d of R, as defined in Definition 2.10 and Definition 3.4.In Theorem 6.9 we will show it is in fact a bijective correspondence.This together with Proposition 4.8 will prove Theorem 1.3.Remark 6.4.Let R be a connected reduced order with universal grading (Γ, (R γ ) γ ) and degree map d : µ → Γ.Note that the group Aut(R) acts on the category of gradings of R.Under this action, where ψ is a morphism given by Proof.Let 1 + f, 1 + g ∈ U * and recall that their product equals so the induced action on Γ sends γ to df (γ)γ.Hence 1 + f gets sent to id Γ + df , since {γ ∈ Γ : R γ = 0} is a generating set of Γ by Proposition 5.8.v.We conclude that χ(ψ(1 as was to be shown.
For a degree map d : µ → Γ we write Id 0 (d) for the partially ordered set {f ∈ Hom(Γ, µ) : f df = f } corresponding to d, as defined in Definition 4.4.Theorem 6.7.Let R be a connected reduced order with universal grading (Γ, (R γ ) γ ) and corresponding degree map d : µ → Γ.The map Id 0 (d) → D(R) given by f → ( γ∈ker(f ) R γ , im(f )) is a well-defined isomorphism of partially ordered sets and respects the action of Aut(R) of Remark 6.4.Its inverse is the map given by (A, G) → 0 Γ(A)→µ(A) ⊕ d −1  G→d(G) .Proof.Write Φ for the map Id 0 (d) → D(R), which we first verify is well-defined.Suppose f ∈ Id 0 (d).As ker(f ) is a subgroup of Γ we have that B = γ∈ker(f ) R γ is a subring of R. Furthermore, from f df = f it follows that the restriction of d to im(f ) → im(df ) is an isomorphism, with the restriction of f to im(df ) → im(f ) as inverse, and Γ = ker(f ) ⊕ im(df ).Thus Hence Φ(f ) ∈ D(R) and Φ is well-defined.
We next construct an inverse Ψ of Φ. Suppose (A, G) ∈ D(R).By Proposition 6.3 we may factor Γ(R) and µ(R) such that d is given by d : 1 .Clearly f df = f , so Ψ is well-defined.
It follows easily from the definitions that Φ and Ψ respect the partial order and that the action of Aut(R) commutes with Φ.
Theorem 6.9.Let R be a connected reduced order with degree map d and universal grading (Γ, (R γ ) γ ).

We have an isomorphism of partially ordered sets Dec
Before we prove Theorem 6.9, we remark that the notation Γ(A) used in the theorem was already reserved for the group of the universal grading of A. However, by Proposition 6.3.iiithere is no ambiguity, as they are uniquely isomorphic.In fact, the map d| µ(A)→Γ(A) is the degree map of A.
Proof.Theorem 6.7, Proposition 4.6, and Corollary 3.7 give explicit isomorphisms of partially ordered sets D(R) → Id 0 (d) → Prj(d) → Dec I (d), from which one readily reads off that their composition and its inverse are as given in the theorem.From Lemma 6.5 it follows that the isomorphisms respect the action of U * (d)., (A, G) and (B, H) are in the same orbit of Aut(R), so A ∼ = B as rings and G ∼ = H as groups.
Theorem 1.3 is an immediate consequence of Theorem 6.10.Note that in the connected case Theorem 1.2 also follows from Theorem 6.10.In Section 8 we shall see that the same applies for Theorem 1.1.Example 6.11.Let σ be a group of order 2 and let R = Z[i][ σ ], where i 2 = −1.We will compute D(R).By Proposition 5.7.i,ii the ring R is both reduced and connected.With Γ = (Z/2Z) 2 , consider the grading (Γ, (R a,b ) (a,b) ) of R with R a,b = Zi a σ b , where although i a is not well-defined, Zi a is.Since a universal grading exists, and all R a,b are of rank 1 over Z, this must be the universal grading.Let d : µ → Γ be the degree map.It follows from Proposition 5.7.iii that µ = i, σ ∼ = Z/4Z × Z/2Z.We will first compute Dec I (d).
Suppose we have (d 0 , d 1 ) ∈ Dec I (d) with d i : µ i → Γ i as in Remark 6.8.If µ 1 = 1, then d 0 = d, and (d 0 , d 1 ) corresponds via Theorem 6.9 to the trivial element (R, 1) of D(R).Now suppose µ 1 = 1.Since d 1 is an isomorphism, the groups µ 1 and Γ 1 are isomorphic, so µ 1 is isomorphic to a direct factor of µ and of Γ.Since Z/2Z is the greatest common divisor of µ and Γ as Z-modules (in the sense of Remark 2.5), we have that 1 is a direct factor of µ isomorphic to Z/2Z.It follows that µ 1 = (−1) b σ for some b ∈ Z/2Z, and the corresponding group Γ 1 equals (0, 1) in both cases.On the other hand µ 0 = iσ a for some a ∈ (Z/2Z) since it must be a cyclic group of order 4, and Γ 0 = (1, a) .Upon inspection, all pairs (a, b) do indeed give a decomposition (d 0 , d 1 ) ∈ Dec I (d).The rings corresponding to the possible d 0 are Z[iσ a ], and the groups corresponding to d 1 are (−1) b σ .This gives Example 6.12.The conclusion to Theorem 1.3 does not hold in general for non-connected reduced orders.Let C be a non-trivial finite abelian group and consider Then A and B are stark, and

Automorphisms of group rings
In this section we will describe Aut(A[G]), for a stark connected reduced order A with degree map d and a finite abelian group G, in terms of U * (d), G, and Aut(A).
For a ring R, write Jac(R) = {x ∈ R : 1 + RxR ⊂ R * } for the Jacobson radical of R. Recall the definitions of Id 0 (d) from Definition 4.4 and Γ(A) from Definition 5.3.In this section we write Id 0 (A) for Id 0 (d) and similarly for Q, U , and U * as defined in Definition 4.1.In our context U * (A) is equal to U (A) due to the following.Lemma 7.1.Let A be a connected reduced order with degree map d : µ → Γ.Then the following are equivalent: (i) A is stark; (ii) Id 0 (A) = {0}; (iii) the ideal Hom(Γ, µ) ⊂ Q(A) consists of only nilpotent elements; (iv) Hom(Γ, µ) = Jac(Q(A)); (v) U * (A) = U (A); (vi) for all abelian groups Ω and morphisms f : Ω → µ and g : Γ → Ω, the element gdf ∈ End(Ω) is nilpotent.
Proof.We will write Q = Q(A) and similarly for U and U * .(i ⇔ ii) This follows from the bijection of Theorem 6.7.(ii ⇒ iii) Let f ∈ Hom(Γ, µ).Since the semigroup Hom(Γ, µ) with the multiplication from Q is finite by Lemma 6.1, some power of f is idempotent and thus zero.
A category C is small if the class of objects of C is a set and if for any two objects A and B of C the class Hom(A, B) is a set.A category C is preadditive (see Section 1.2 in [2]) if for any two objects A and B of C the class Hom(A, B) is an abelian group such that composition of morphisms is bilinear, i.e., for all objects A, B, and C and morphisms f, f ′ : A → B and g, g ′ : B → C we have Lemma 7.2.Let C be a preadditive small category with precisely two objects 0 and 1. Then: (i) With M ij = Hom(j, i) for i, j ∈ {0, 1} both M 00 and M 11 are rings and M 01 and M 10 are a M 00 -M 11 -bimodule and M 11 -M 00 -bimodule respectively.(ii) The product of groups is a ring with respect to the addition and multiplication implied by the matrix notation.
, and Proof.That the M ij are groups, and that the addition is compatible with the composition of morphisms, follows from the fact that C is preadditive.It is then easy to verify that the M ij are rings and modules as claimed, and that M(C) is a ring, giving (i) and (ii).Now suppose M 01 • M 10 ⊂ Jac(M 00 ).We will show that for all m ∈ M 01 and n ∈ M 10 we have nm ∈ Jac(M 11 ).Let s ∈ M 11 .Then (ms)n ∈ M 01 • M 10 ⊂ Jac(M 00 ), so 1 + msn has an inverse r ∈ M 00 .Then Hence 1 + snm has a left inverse 1 − snrm, and similarly 1 − snrm is a right inverse of 1 + snm.Thus 1 + snm ∈ M * 11 and nm ∈ Jac(M 11 ).We conclude that M 10 • M 01 ⊂ Jac(M 11 ).Consider T = Jac(M00) M01 is upper diagonal, it is invertible if its diagonal elements are.The element 1 + ar + bn is invertible because ar + bn ∈ Jac(M 00 ).So T ⊂ Jac(M(C)).Analogously B ⊂ Jac(M(C)).Thus we have a two-sided ideal J ⊂ Jac(M(C)).To see equality, note that the ring M(C)/J ∼ = (M 00 /Jac(M 00 )) × (M 11 /Jac(M 11 )) has a trivial Jacobson radical.
An element of M(C) is a unit if and only if it maps to a unit in M(C)/Jac(M(C)), hence if and only if its diagonal elements are units, proving the final statement.
Naturally, the construction M(C) can be generalized to categories C with any finite number of objects.We call M(C) the matrix ring of C. Remark 7.3.Given four abelian groups M ij with i, j ∈ {0, 1} together with compatible (i.e., associative) multiplications M ij ⊗ M jk → M ik for all i, j, k ∈ {0, 1} with appropriate unit elements, we can construct the preadditive category C with two objects 0 and 1, with Hom(j, i) = M ij , and with composition being these multiplications.In particular, if M 00 and M 11 are rings, M 01 is an M 00 -M 11 -bimodule, and M 10 is an M 11 -M 00 -bimodule, then it remains only to specify the multiplications M 01 ⊗ M 10 → M 00 and M 10 ⊗ M 01 → M 11 .
Let A be a connected reduced order and G a finite abelian group.Recall that µ(A) and Γ(A) are Q(A)-modules by Remark 4. (iii) If A is stark, then the map in (ii) restricts to an isomorphism Proof.For (i), apply Remark 7.3 and Lemma 7.2.ii.Since all multiplications are defined in terms of compositions of morphisms, the associativity conditions are trivially satisfied.Write Γ = Γ(A) and µ = µ(A).For (ii), we have by Proposition 6.3.ii that where the isomorphism is one of abelian groups.Then the map Q(A[G]) → E with respect to the latter representation given by n, p q r s → (n, p) q r n + s is an isomorphism of rings that by functoriality respects the action of Aut(A).Proposition 7.6.Let A be a stark connected reduced order and G a finite abelian group.Then the maps and actions from Remark 7.5 fit in an exact sequence where ι and π are homomorphisms such that ι(u) = (u −1 , u) and π maps each component to Aut(A[G]).
Proof.For all u, v ∈ U * (A) we have by Remark 7.5, so ι is a homomorphism.Moreover, ι is injective because it maps injectively to the first factor.By the same remark π a homomorphism.
We will now show that π is surjective.Suppose σ ∈ Aut(A[G]).By Theorem 6.10 there exists 1 + f ∈ U * (A[G]) that maps (A, G) to (σ(A), σ(G)), so without loss of generality we may assume σ(A) = A and σ(G) = G.By applying the restriction σ| A ∈ Aut(A) we may assume σ is the identity on A. Consider the map f : Γ(A)×G → µ(A[G]) given by (δ, g) → σ(g)g −1 and note that 1+f ∈ U (A[G]) gets mapped to σ.We similarly obtain the inverse of 1 ).It follows that σ is in the image of π and thus π is surjective.
Proof of Theorem 1.5.To check that M is a group it remains to verify that t 1 ds 2 + σ 1 σ 2 ∈ Aut(G).This follows from Lemma 7.1, namely t 1 ds 2 ∈ Jac(End(G)).Note that the map can be written as the composition of the homomorphism ϕ : so the groups M and Aut(A[G]) have the same (finite) cardinality, so ϑ is bijective.
8. Proofs of Theorems 1.1, 1.2, and 1.6 We will prove Theorems 1.1 and 1.2 by reducing to the connected case, where we can apply Theorem 6.10.Recall the definition of D from Definition 5.10.

Algorithms
In this section we will prove Theorem 1.4, the algorithmic counterpart to Theorem 1.2.To state our theorems rigorously, we should specify how our data are encoded.We will continue the conventions used in [3,6,7,8,9,19], the results from which are therefore compatible.They can be briefly described as follows.Integers and rationals are encoded straightforwardly.Any finitely generated free module is specified by its rank, its elements are represented by vectors, and morphisms between such modules are represented by matrices.All rings we consider are Noetherian, so each finitely generated module is a cokernel of some morphism of finitely generated free modules, and it is encoded as such.Finally, a ring structure on a finitely generated abelian group is encoded as a collection of multiplication maps, one for every generator.For matrices with integer coefficients we can do multiplication and compute (bases for) kernels and images in polynomial time as described in [6].
Theorem 9.1 (Theorem 4.1.1 in [3]).There exists a polynomial-time algorithm that, given a finite ring R and finite R-modules M 1 and M 2 , computes a greatest common divisor D of M 1 and M 2 as defined in Remark 2.5, together with injections ι Z Z there exists a polynomial-time algorithm that, given finite R-modules M 1 and M 2 , computes a greatest common divisor D of M 1 and M 2 , together with injections ι i : D → M i and a complement Proof.By Theorem 2.6.9 in [3] we may compute the exponents of M 1 and M 2 , and their least common multiple n, in polynomial time.Note that M 1 and M 2 are R/nR-modules and that replacing R by R/nR does not change the problem.Since R/nR is a finite ring, we can thus reduce to Theorem 9.1.Proposition 3.3 allows us to interpret a morphism of finite abelian groups as a finite length Z 0 Z Zmodule.Although both types of objects are represented differently, one easily deduces from the proof of Proposition 3.3 that we can change representations in polynomial time.
In the following result, Dec I (d) is as defined in Definition 2.10, Remark 3.5.iv,and Definition 3.4.
Proposition 9.3.There exists a polynomial-time algorithm that, given finite abelian groups A and B and a morphism d : A → B, computes a maximal element of Dec I (d).
Proof.By Proposition 9.2 we may compute in polynomial time a greatest common divisor D of A and B as Z-modules.Similarly we may compute a greatest common divisor E of d and id D as Z 0 Z Zmodules.We also obtain submodules d 0 and d 1 of d such that d 1 ∼ = E and d = d 0 ⊕ d 1 .We claim that (d 0 , d 1 ) is a maximal element of Dec I (d).First note that d 1 is a divisor of id D and thus must be an isomorphism.As d = d 0 ⊕ d 1 we indeed have that (d 0 , d 1 ) ∈ Dec I (d).Let (e 0 , e 1 ) ≥ (d 0 , d 1 ) be maximal in Dec I (d).Since e 1 is an isomorphism, it is isomorphic to id F for some finite abelian group F .Since e 1 is a direct summand of d, the group F is a direct summand of both A and B, so F is a divisor of their greatest common divisor D. Thus e 1 is a divisor of id D .It follows that e 1 is a divisor of E ∼ = d 1 , so (d 0 , d 1 ) = (e 0 , e 1 ) and thus (d 0 , d 1 ) is maximal, as was to be shown.
In the following result, we represent a grading (∆, (R δ ) δ∈∆ ) of an order R by a finitely generated abelian group ∆ by specifying only those subgroups R δ of R that are non-zero.This differs from the representation of gradings used in [19], which restricts to finite ∆ and specifies all subgroups R δ ; the latter representation can readily be converted to the former in polynomial time, which is all we need.

Proof. It suffices to prove that
has a minimal polynomial in K[X] dividing X n+1 − X for some n > 0. In particular x is separable, and consequently so are all elements of K.As 0 is the only separable nilpotent element, the lemma follows.
Definition 9.8 (Example 3.4 in [9]).For an order R we define a bilinear map where the sum ranges over all ring homomorphisms, of which there are only finitely many.Remark 9.9.Following Example 3.4 in [9], the map from Definition 9.8 is non-degenerate when R is reduced, i.e., x, x = 0 implies x = 0 for all x ∈ R. We have a bijective correspondence {σ : R → C} ↔ {(p, σ p ) : p ⊂ R a minimal prime ideal, σ p : R/p → C} that sends σ : R → C to (ker(σ), σ) where σ : R/ ker(σ) → C is given by the homomorphism theorem, and conversely sends (p, σ p ) to σ p composed with the projection π p : R → R/p.Thus for all x, y ∈ R we have x, y R = p⊂R π p (x), π p (y) R/p , where the sum ranges over all minimal prime ideals.Lemma 9.10.For all orders R that are generated as a group by α(R) we have R, R ⊂ Z.There exists a polynomial-time algorithm that, given an order R that is generated as a group by α(R) and x, y ∈ R, computes x, y .
Proof.Note that R is reduced by Lemma 9.7.Let X be the set of minimal primes of R. Using Theorem 1.10 in [8] we may compute X and for each p ∈ X the map R → R/p in polynomial time.Note that as a group, R/p is generated by α(R/p).Then by the formula of Remark 9.9 it suffices to prove the lemma for the ring R/p.Thus we suppose R is a domain and consequently α(R) = µ(R) ∪ {0} by Proposition 9.6.vii.For ζ, ξ ∈ µ(R) and a ring homomorphism σ : R → C we have σ(ζ) • σ(ξ) = σ(ζξ −1 ).Thus ζ, ξ R = σ : R→C σ(ζξ −1 ), which is the trace of ζξ −1 from R to Z, and hence is an integer.As R is generated as a group by µ(R), it follows that R, R ⊂ Z as well.Moreover, this shows that computing x, y R reduces to computing traces of roots of unity, which clearly can be done in polynomial time.
For a ring R, an R-module M , and a subset X ⊂ M , we write R • X for the submodule of M generated by X. Lemma 9.11.There exists a polynomial-time algorithm that, given a finite-dimensional commutative Q-algebra A and a finite set X ⊂ A, computes a Q-basis Y of the subalgebra B of A generated by X, where each element in Y is a finite (possibly vacuous) product of elements of X.
Proof.The algorithm proceeds as follows.Start with Y = {1}.Compute the set of products Z = {xy : x ∈ X, y ∈ Y } and update Y to be a maximal Q-linearly independent subset of Z ∪ Y .Repeat this until Q • Y is stable.
Suppose in some step is closed under taking products with X.Since X generates B as a Q-algebra and 1 ∈ Q • Y by the choice of initial Y , it follows that Q • Y = B. Note that #Y ≤ dim Q (B) and thus there are at most dim Q (B) steps in the algorithm.Moreover, in each step #Z ≤ #(X × Y ) is polynomially bounded in the input length, so in total there are only polynomially many multiplications.Lastly, note that in step i of the algorithm each element of Y can be written as a product of i elements from X, and therefore the encoding of every element has length proportional to at most i times that of the longest element of X. Hence the multiplications can be carried out in polynomial time.
Although it is possible to compute α(R) for a reduced order R, we cannot in general do this in polynomial time, even if R is connected.Note that for the ring R = {(a i ) i ∈ Z n : (∀i, j) a i ≡ a j mod 2}, the set {−1, 1} n = µ(R) ⊂ α(R) is exponentially large.Theorem 1.4 of [7] gives a polynomial-time algorithm that, given an order R, produces a set of generators of µ(R).Proposition 9.12.There exists a polynomial-time algorithm that, given an order R, computes a set Y ⊆ α(R) such that Z • Y = Z • α(R).
Proof.We may factor R into a product of connected orders in polynomial time using Algorithm 6.1 in [7].Combined with Proposition 9.6.viiwe may assume R is connected and α(R) = µ(R) ∪ {0}.
Apply Theorem 1.2 in [7] to compute in polynomial time a set X of generators of the group µ(R).Using Lemma 9.11 we may compute a basis Z ⊆ µ(R) for the subalgebra Q • µ(R) of R ⊗ Q as a Q-vector space.Roots of unity are homogeneous in any grading of a connected order, by Theorem 1.5 of [9].The next result shows this is also true in any orthogonal decomposition of a connected reduced order, where orthogonal means with respect to the inner product in Definition 9.8.Lemma 9.13.Let R be an orthogonal decomposition of a connected reduced order R. Then the roots of unity of R are homogeneous in R, i.e., for all ζ ∈ µ(R) there exists some M ∈ R such that ζ ∈ M .Proof.By Corollary 5.6 in [9] the element 1 ∈ R is indecomposable, i.e., for all x, y ∈ R such that x + y = 1 and x, y ≥ 0 we have x = 0 or y = 0. Since x → ζx is an isometry of R for all ζ ∈ µ(R), we conclude that all ζ ∈ µ(R) are indecomposable.Indecomposable elements are clearly homogeneous.
Lemma 9.14.Let R be a connected reduced order and R = (Γ, (R γ ) γ ) be the universal grading of R. Suppose X ⊂ µ(R) is a subset and A ⊂ R is a subring such that x∈X Ax is an orthogonal decomposition of R. Write ∆ = µ(R)/µ(A).Then the natural map g : X → ∆ is a bijection and S = (∆, (A • g −1 (δ)) δ ) is a grading of R. If also A ⊂ R 1 , then S is universal.
Proof.First we show g is a bijection.If g(x) = g(y) for x, y ∈ X, then Ax = Ay and thus x = y by orthogonality.Hence g is injective.It follows from Lemma 9.13 that µ(R) = x∈X (Ax ∩ µ(R)) = µ(A) • X, so g is surjective.It follows that S is a grading of R. Now assume A ⊂ R 1 .Let e : ∆ → Γ be induced by the degree map d : µ(R) → Γ, which is well-defined because µ(A) ⊂ ker(d) by assumption.Then e * (S) = R, and S is universal by Proposition 5.8.iv.Theorem 9.15.There exists a polynomial-time algorithm that, given a reduced order R that is generated as a group by α(R), computes the universal grading of R.
Proof.We may write R as a product of connected orders in polynomial time using Algorithm 6.1 in [7].Using Proposition 5.9.ii and Proposition 9.6.viwe may restrict ourselves to the connected case, so suppose R is connected and thus α(R) = µ(R) ∪ {0} by Proposition 9.6.vii.Let R = (Γ, (R γ ) γ ) be the universal grading of R, which is not part of the algorithm.

Theorem 1 . 1 .
Suppose A and B are reduced orders and G and H are finite abelian groups.Then the following are equivalent: (i) A[G] ∼ = B[H] as rings, (ii) there exist an order C and finite abelian groups I and J such that A ∼ = C[I] and B ∼ = C[J] as rings and I × G ∼ = J × H as groups.

Definition 2 . 2 .
For a ring R and an R-module M we define Id(R) = {e ∈ R : e 2 = e}, Dec(M ) = {(D, N ) : D, N are submodules of M with D ⊕ N = M }.
as was to be shown.Definition 2.10.Let R be a ring.A class S of R-modules is multiplicative if 0 ∈ S and for all Rmodules M , N and D with M ∼ = N ⊕ D and N , D ∈ S one has M ∈ S. We say a multiplicative class S of R-modules is saturated if for all M ∈ S and all divisors D of M one has D ∈ S. For a multiplicative class S of R-modules and an R-module M , write Dec S (M ) = {(M 1 , M 2 ) ∈ Dec(M ) : M 2 ∈ S}, where Dec(M ) is as in Definition 2.2.We equip Dec S (M ) with the partial order inherited from Dec(M ), and write max(Dec S (M )) for its set of maximal elements.Proposition 2.11.Let R be a ring, let S be a multiplicative class of R-modules, and let M and N be R-modules.Then (i) if M ∼ = N and N ∈ S, then M ∈ S;

Definition 3 . 1 .gRemark 3 . 2 .
Let C be a category.We define the category of C-morphisms, written CHom, where the objects are the morphisms of C and for objects f : A → B and g : C → D the morphisms from f to g are the pairs (α, β) ∈ Hom C (A, C) × Hom C (B, D) such that βf = gα, as in the following diagram: The composition of C-morphisms (γ, δ) : g → h and (α, β) : f → g is (γα, δβ).Let d : A → B be a morphism of abelian groups.Then the set End(d) ⊂ End(A) × End(B) of endomorphisms of d is a ring.Moreover, we have natural maps End(d) → End(A) and End(d) → End(B), turning A and B into End(d)-modules.Similarly we write Aut(d) for the group of automorphisms of d, which equals End(d) ∩ (Aut(A) × Aut(B)).

Definition 4 . 1 .
For f, g ∈ Hom(B, A), define f ⋆ g = f dg ∈ Hom(B, A), and extend ⋆ to a ring multiplication on the additive group Q

Remark 4 . 3 .
Recall from Remark 3.2 that A and B are End(d)-modules.The map q makes A and B into Q-modules in such a way that d is Q-linear.Definition 4.4.We write 5, and Prj(d) from Definition 3.6.If e ∈ End(d), we write e = (e A , e B ) with e A ∈ End(A) and e B ∈ End(B).

Proposition 4 . 6 .
The map q : Q → End(d) from Lemma 4.2 restricts to an isomorphism Id 0 (d) ∼ − → Prj(d) of partially ordered sets that respects the action of Aut(d).Its inverse is the map given by e → 0 e ⊕ im(e) −1 , where 0 e : ker(e B ) → ker(e A ) is the zero map.Proof.Write Φ : Id 0 (d) → End(d) for the restriction of q, and write Ψ : Prj(d) → Hom(B, A) for the map e → 0 e ⊕im(e) −1 .To see that Ψ is well defined, note that e and hence e A and e B are idempotents, so A = ker(e A ) ⊕ im(e A ) and likewise for B by Proposition 2.3.Let e ∈ Prj(d) and f = Ψ(e).Note that f d = e A , by considering the restriction to im(e A ) and ker(e A ) separately, and similarly df = e B and f e B = f .Hence q(f ) = e and q • Ψ = id Prj(d) .For g ∈ Hom(B, A) we have g ⋆ f = gdf = ge B .In particular f ⋆ f = f e B = f , so f ∈ Id 0 .Thus Ψ restricts to Prj(d) → Id 0 .

Lemma 6 . 5 .
which is again a universal grading of R. Thus by universality, σ induces a unique isomorphism Γ ∼ − → Γ.It follows that Aut(R) acts on Γ. Clearly Aut(R) acts on µ, and it is easy to see the following diagram commutes ., we obtain an action Aut(R) → Aut(d) of Aut(R) on d.For a degree map d : µ → Γ we define U * (d) as in Definition 4.1.Let R be a connected reduced order with universal grading (Γ, (R γ ) γ∈Γ ) and corresponding degree map d : µ → Γ.Let ϕ : U * (d) → Aut(d) be as in Lemma 4.2 and χ : Aut(R) → Aut(d) as in Remark 6.4.We then have a commutative diagram U * and the restriction d 1 of d to G → d(G) is an isomorphism.Now define f : Γ(R) → µ(R) as the product of 0 : Γ(A) → µ(A) and d −1

Remark 6 . 8 .
Recall that U * (d) was defined in Definition 4.1, and that it acts on R and hence on D(R) by Lemma 6.5.Moreover, U * (d) acts on d and hence on Dec I (d) = {(d 0 , d 1 ) : d 0 ⊕ d 1 = d and d 1 is an isomorphism} as in Remark 3.5.iv.For (d 0 , d 1 ) ∈ Dec I (d) we will write µ i and Γ i for the finite abelian groups such that d i :

Theorem 6 . 10 .
Let R be a connected reduced order with degree map d, and suppose (A, G), (B, H) ∈ D(R) are such that A and B are stark.Then A ∼ = B as rings, G ∼ = H as groups, and (A, G), (A, H), (B, G) and (B, H) are all in the same U * (d)-orbit of D(R).Proof.Let Φ : Dec I (d) → D(R) be the isomorphism of Theorem 6.9.Suppose (A, G), (B, H) ∈ D(R) are such that A and B are stark.Then (A, G) and (B, H) are maximal elements of D(R) by Lemma 5.14, and thus Φ(A, G) = (d 0 , d 1 ) and Φ(B, H) = (e 0 , e 1 ) are maximal in Dec I (d).Then by Proposition 2.11.v and Proposition 4.8 all of (d 0 , d 1 ), (d 0 , e 1 ), (e 0 , d 1 ), and (e 0 , e 1 ) are maximal and in the same U * -orbit.Since Φ(d 0 , e 1 ) = (A, H) and Φ(e 0 , d 1 ) = (B, G), and Φ respects the action of U * , the last assertion of the theorem follows.As a consequence

Proposition 7 . 4 and
Proposition 7.6 combined gives us a description of Aut(A[G]) in terms of A and G.We now prove Theorem 1.5 and describe Aut(A[G]) by less canonical means.Lemma 7.7.Let A be a stark connected reduced order.Then the group Hom(Γ(A), µ(A)) has a (right) action on the set Aut(A), which for α ∈ Aut(A) and f ∈ Hom(Γ(A), µ(A)) is given by written in terms of the matrix representation of Proposition 7.4.iii,and the homomorphism π :U * (A[G]) ⋊ Aut(A) → Aut(A[G]) from Proposition 7.6.The map π is still surjective when restricted to the image of ϕ.Namely anyu s t σ • α ∈ U * (A[G]) ⋊ Aut(A)has the same image as1 s tβ −1 σ • βα,where β is the image of u in Aut(A).Hence the map ϑ is surjective.By Proposition 7.4.iiiand Proposition 7.6, respectively, we have #

Lemma 8 . 1 .
Let S and T be orders with S non-zero, let R = S × T with projection map π : R → S, and let (A, G) ∈ D(R).Then we have (π(A), π(G)) ∈ D(S) and the restrictionG → π(G) of π is a group isomorphism.Proof.We have a natural map π(A)[G] ։ π(A)[π(G)] → S. Since S equals π(A[G]) = g∈G π(A)π(g),this map is clearly surjective.Suppose g∈G π(a g )g is in its kernel.Writing e = (1, 0) ∈ R and identifying S with S × {0}, we have π(x) = ex for all x ∈ R. By Proposition 5.7(ii) we have e ∈ A and therefore g∈G ea g g = 0 in A[G].We conclude that for all g ∈ G we have π(a g ) = ea g = 0, so the map π(A)[G] → S is an isomorphism.Then the maps π(A)[G] → π(A)[π(G)] and π(A)[π(G)] → S are isomorphisms as well.Since S = 0, this implies that the map G → π(G) is an isomorphism and that (π(A), π(G)) ∈ D(S).By Theorem 1.1 there exist an order C and finite abelian groups I and J such that A ∼ = C[I] and B ∼ = C[J] and I × G ∼ = J × H. Since both A and B are stark we conclude that I = J = 1, so G ∼ = H and A ∼ = C ∼ = B. Hence A and G are unique up to ring and group isomorphism, respectively.Proof of Theorem 1.6.We use the of Theorem 1.6.By Remark 6.4, if α ∈ Aut(A) and γ ∈ Γ then α(A γ ) = A αγ .It then follows readily from Theorem 1.5 that the orbit of A under Aut(A[G]) is A and the orbit of G under Aut(A[G]) is G. Theorem 1.6 now follows from Theorem 1.2.
Denote the discriminant det((TrQ•µ(R)/Q (xy)) x,y∈Z ) of Z • Z by ∆ Z , and similarly let ∆ µ(R) denote the discriminant of Z • µ(R).Let n = #Z = dim Q (Q • µ(R)).We have |∆ Z | ≤ n 3n/2 by Hadamard's inequality and the fact that | Tr(ζ)| ≤ n for ζ ∈ µ(R).Thus, #(Z • µ(R)/Z • Z) 2 = |∆ Z |/|∆ µ(R) | ≤ |∆ Z | ≤ n 3n/2 .In particular, log 2 #(Z • µ(R)/Z • Z) is polynomially bounded.First we set Y = Z.Then we iterate over x ∈ X and y ∈ Y and add xy toY whenever xy ∈ Z • Y .Once Z • Y stabilizes we have Z • Y = Z • µ(R)and may return Y .Each new element added to Y decreases log 2 #(Z • µ(R)/Z • Y ) by at least 1, so the cardinality of Y and the number of steps taken in the algorithm are polynomially bounded.Finally, we remark that there is a polynomial upper bound on the lengths of the encodings of the elements of Y , since each element is the product of at most #Y elements of X and an element of Z. Hence the algorithm runs in polynomial time.