EFFICIENT ALGORITHMS FOR FINITE Z -ALGEBRAS

. For a finite Z -algebra R , i.e., for a Z -algebra which is a finitely generated Z -module, we assume that R is explicitly given by a system of Z -module generators G , its relation module Syz( G ), and the structure constants of the multiplication in R . In this setting we develop and analyze efficient algorithms for computing essential information about R . First we provide polynomial time algorithms for solving linear systems of equations over R and for basic ideal-theoretic operations in R . Then we develop ZPP (zero-error probabilitic polynomial time) algorithms to compute the nilradical and the maximal ideals of 0-dimensional affine algebras K [ x 1 , . . . , x n ] /I with K = Q or K = F p . The task of finding the associated primes of a finite Z -algebra R is reduced to these cases and solved in ZPPIF (ZPP plus one integer factorization). With the same complexity, we calculate the connected components of the set of minimal associated primes minPrimes( R ) and then the primitive idempotents of R . Finally, we prove that knowing an explicit representation of R is polynomial time equivalent to knowing a strong Gr¨obner basis of an ideal I such that R = Z [ x 1 , . . . , x n ] /I .


Introduction
Computing the radical and the primary decomposition of an ideal, the associated primes and the primitive idempotents of an algebra, or the connected components of its spectrum, are among the hardest tasks in Computer Algebra.For a finitely generated algebra R = K[x 1 , . . ., x n ]/I over a field K with an ideal I that is given by its generators, the usual solutions of these tasks involve computing Gröbner bases and factoring multivariate polynomials over extension fields of K (see for instance [9], [15], [17], [21], [22], [23]).
The difficulty of the problem increases further when we consider algebras over the integers, i.e., algebras of the form R = Z[x 1 , . . ., x n ]/I with an ideal I given by a system of generators.In this case we will also have to factor (potentially large) integers, as already the example R = Z/nZ shows.Since the 1970s, various approaches have been taken to tackle these tasks, starting with the case of an algebra R which is a finitely generated Z-module (see [2], [4], [30], [27]).At the core of most of these algorithms lies the calculation of strong Gröbner bases for ideals in Z[x 1 , . . ., x n ] which tends to be quite demanding.It is also possible to apply more general algorithms for associative, not necessarily commutative algebras here (see [10], [11], [28]), but we can expect the efficiency of such very general methods to be usually even lower than the ones for commutative algebras.
The situation changes substantially when a Z-algebra R is explicitly given, i.e. a Zalgebra for which we know a system of generators G = (g 0 , . . ., g n ) of its additive group, a system of generators of the Z-linear relation module Syz Z (G) ⊆ Z n+1 , and the structure constants c ijk ∈ Z such that g i • g j = n k=0 c ijk g k for i, j = 0, . . ., n.To define algebras by their module generators and relations, as well as their structure constants, is a very classical approach, followed for instance by Bourbaki in [7], Ch.III, §1, Sect.7. Knowing the structure constants is equivalent to knowing the multiplication matrices of an algebra.In particular, when the algebra is defined over a field, this point of view is one of the key methods to study 0-dimensional affine algebras and to solve 0-dimensional polynomial systems (see for instance [8] and [23]).
In a recent paper [20], we encountered explicitly given Z-algebras in a different way: when a non-commutative algebra is given by representing its left and right multiplications via endomorphisms, one can efficiently compute a ring of scalars.As a result, the ring of scalars is an explicitly given, finite commutative Z-algebra.For further examination of the original rings, it is necessary to find algorithms that perform some of the operations mentioned above on the ring of scalars.In [20] we formulated a few of those algorithms using the calculation of strong Gröbner bases.Here we avoid Gröbner bases and provide precise worst-case complexity bounds which are almost polynomial time.
Thus the main task tackled in this paper can be described as follows: assume that a finite Z-algebra R is given explicitly, i.e., by generators, relations, and structure constants.Develop algorithms for computing their nilradical, associated primes and maximal ideals, primitive idempotents and connected components of Spec(R) with the lowest possible worst-case complexity.More precisely, we shall show that all these tasks can be solved in ZPPIF, i.e., in zero-error probabilistic polynomial time plus possibly one integer factorization.
Let us discuss the contents of the paper in more detail.Throughout we work with an explicitly given finite Z-algebra R defined as above.In Section 2 we start by using the well-known facts that the Smith and Hermite normal forms of an integer matrix can be calculated in polynomial time (see [19], [24], [31], [32]), in order to construct a polynomial time algorithm for solving linear systems of equations over R (see Proposition 2.6).Based on this algorithm we perform various operations with ideals in R efficiently, for instance ideal intersections (see Proposition 2.9).Moreover, we are able to compute preimages under the isomorphism given by the Chinese Remainder Theorem (see Proposition 2.10).
In Section 3 we prepare later applications to Z-algebras by reconsidering and reanalyzing some algorithms for 0-dimensional algebras over a field K.In order to compute the nilradical of an explicitly given K-algebra R, we need to calculate the factorization of univariate polynomials over K.The currently best algorithms have polynomial time complexity (P) in the case K = Q and zero-error probabilistic polynomial time complexity (ZPP) in the case of a prime field F p .Using such polynomial factorization algorithms, Algorithm 3.3 then determines the nilradical of R with these time complexities (P resp.ZPP).
Next we want to compute the primary decomposition of the zero ideal of R. In the case K = F p , we apply the method of Frobenius spaces (see [23], Alg.5.2.7) and get an algorithm in ZPP (see Algorithm 3.6).In the case K = Q, we can use the method of [23], Alg.5.4.2 and get an algorithm in P. Altogether, by applying the primary decomposition algorithms to R/ Rad(0), we are able to find the maximal ideals of R in P and ZPP for K = Q and K = F p , respectively (see Corollary 3.8).
In Section 4 we then use the ideas of [27] to compute the associated primes of an explicitly given finite Z-algebra R (see Algorithm 4.2).The method is to distinguish between the prime ideals which contain an integer prime number and those which don't.In both cases the computation is reduced to the setting of the preceding section, i.e., to computations of 0-dimensional algebras over fields.Since the determination of associated primes may involve the factorization of an integer, the best time complexity we can achieve here is ZPPIF, i.e., ZPP plus one integer factorization.More precisely, the integer which has to be factored is the torsion exponent of the additive group of R.
In Section 5 we treat the next topics, namely the computation of the primitive idempotents of an explicitly given finite Z-algebra R and the connected components of its prime spectrum.It turns out that it is advisable to solve the latter task first.More precisely, since R may have infinitely many prime ideals, we compute the connected components of the set of minimal associated primes minPrimes(R) in Algorithm 5.6.This algorithm uses the results of the preceding section, whence its worst-case time complexity is in ZPPIF.Finally, we calculate the primitive idempotents of R in Algorithm 5.8 by lifting them from the primitive idempontents of R/ Rad(0).This lifting process is performed using Algorithm 5.1.Once again the worst-case time complexity is in ZPPIF.
In the last section we connect the method of using an explicit representation of R to the more traditional method of calculating a strong Gröbner basis, when R is given as R = P/I with P = Z[x 1 , . . ., x n ] and an ideal I in P whose generators are known.Starting with an explicitly given finite Z-algebra R, we can compute in polynomial time a strong Gröbner basis of a defining ideal I of R (see Corollary 6.5).For this direction we use a generalization of the Buchberger-Möller Algorithm (see Algorithm 6.3).Conversely, starting with a strong Gröbner basis of I, we can calculate an explicit representation of R in polynomial time (see Algorithm 6.7).For this direction, we use a generalization of Macaulay's Basis Theorem to finite Z-algebras (see Proposition 6.6).
For the notation and basic definitions we adhere to conventions in [21] and [22].All algorithms in this paper were implemented in the computer algebra system ApCoCoA (see [3]) and are available from the authors upon request.These implementations were used to calculate the examples given in the various sections.

Polynomial Time Computations in Finite Z-Algebras
Let R be a finite Z-algebra, i.e., a Z-algebra which is a finitely generated Z-module.We denote the additive group of R by R + .In this section we collect operations in R which can be computed in polynomial time if a presentation of R is given as below.
Remark 2.1.(Explicitly Given Z-Algebras) Subsequently we assume that a Z-algebra R is given by the following information.(a) A set of generators G = {g 0 , . . ., g n } of the Z-module R + , together with a matrix A = (a ℓk ) ∈ Mat m,n+1 (Z) whose rows generate the syzygy module Syz Z (G) of G. (b) Structure constants c ijk such that g i g j = n k=0 c ijk g k for i, j = 0, . . ., n.
Notice that we can assume that g 0 = 1, and encode this information as an ideal x n ] such that R ∼ = P/I.If R is given as above, we call it an explicitly given Z-algebra.
The bit complexity of the matrix A in (a) which defines the Z-module structure of R + is given by β = (n + 1)m log 2 (∥A∥) with ∥A∥ = max{|a ℓk |}.The bit complexity of the entire input defining the Z-algebra R is then given by γ = ((n + 1) 3 + (n + 1)m) log 2 (M ) with M = max{|a ℓk |, |c ijk |}.
In this section we collect computations in R which can be performed in polynomial time in β or γ, respectively.More precisely, we will use the following complexity classes.It is useful to bring the Z-module presentation of R + into a normal form.
Z) be the matrix whose rows are given by the generators of Syz(G).Then there exist unimodular transformation matrices S ∈ Mat m,m (Z) and T ∈ Mat n+1,n+1 (Z) such that and k i divides k j for i < j.This matrix is called the Smith normal form of A. It yields the following isomorphism: The numbers r and k 1 , . . ., k u are uniquely determined by R + .We call r the rank and k 1 , . . ., k u the invariant factors of R + .The largest invariant factor k u is the exponent of the torsion subgroup of R + .We call it the torsion exponent τ of R + .
In the following we shall show that certain algorithms run in polynomial time by reducing them to the following computations.
Remark 2.4.(Complexity of Integer Linear Algebra Operations) (a) The Smith and the Hermite normal form of a matrix A ∈ Mat m,n (Z) can be computed in polynomial time, as first shown by Kannan and Bachem [19] in 1979.Currently, the fastest deterministic algorithm for computing the Smith normal form is the one developed by Storjohann [31].Note that in contrast to [19] this algorithm does not produce the unimodular transformation matrices.(b) Solving linear systems of equations over the integers can be reduced to computing a Smith normal form together with the unimodular transformation matrices (see for instance [24]).If the linear system is of the form Ax = b where A ∈ Mat m,n (Z) and b ∈ Mat n,1 (Z), then generators of the solution space can be computed in polynomial time in n, m, ∥A∥, ∥b∥ and the rank of A.Here ∥A∥ denotes the maximal absolute value of the entries of A. A concrete complexity bound is given in [32], Theorem 19.(c) Computing the intersection of free submodules of Z n can be achieved by computing a basis of the solution space of an appropriate linear system of equations.The problem therefore reduces to (b).
Since the Smith normal form can be computed in polynomial time, it follows that the bit complexity of the torsion exponent of R is bounded by a polynomial in β.Below we give a concrete complexity bound.Lemma 2.5.Let R be an explicitly given finite Z-algebra.Then the bit complexity of the torsion exponent τ is bounded by n log 2 (n ∥A∥).
Proof.The product of the invariant factors of R + is given by the gcd of all maximal rank minors of A. The torsion exponent is therefore bounded by the absolute value of a non-zero maximal rank minor of A. Hadamard's inequality then yields τ ≤ n n/2 ∥A∥, which means the bit complexity of τ is bounded by n log 2 (n ∥A∥).Solving a linear system of equations over R can be reduced to solving a linear system over the integers.Proposition 2.6.(Solving Systems of Linear Equations over R) Let R be an explicitly given finite Z-algebra and f 1 , . . ., f p ∈ R. For k = 1, . . ., p, we write Let y 1 , . . ., y p be further indeterminates.Consider the following homogeneous linear equation over R.
Let e 0 , . . ., e n ∈ Z n+1 be the standard basis vectors.For the following system of homogeneous linear equations in the indeterminates z ki and w j over Z, let L be the projection of the solution space onto the z-coordinates.Then the following conditions are equivalent.
Proof.The tuple (h 1 , . . ., h p ) is a solution of (i) if and only if This is the case if and only if there exist α 1 , . . ., α m ∈ Z such that the left hand side is equal to m j=1 n i=1 α j a ij g i .The claim then follows by rewriting the products g i g j using the structure constants of R and applying the canonical isomorphism R ∼ = Z n+1 / Syz(G).
Let us illustrate this proposition with an example.
Example 2.7.Let R be the finite Z-algebra generated by G = {g 1 , g 2 , g 3 }, where Syz(G) = ⟨(3, 0, 0), (−1, 0, 4)⟩, and where the multiplication in R is commutative and given by g 2 1 = 3g 1 , g 1 g 3 = 2g 2 , g 2 2 = g 1 + g 2 , and g i g j = 0 for all other combinations.Consider the homogeneous linear equation (2g To compute generators of the solution space L ⊆ R 3 , we follow Proposition 2.6 and substitute x i by h i .Using the structure constants, we then replace products g i g j by Z-linear combinations of the generators and obtain the system of equations By substituting g i with e i and taking into account the generators of Syz(G), we obtain a system of linear equations over Z which is given by the following matrix.  0 0 0 3 0 0 6 0 0 3 −1 4 0 0 2 0 2 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 4

 
After projecting onto the first nine components of its solution space we obtain for example the tuple (0, 0, 0, 1, 0, 1, 0, 0, −1) ∈ Z 9 which corresponds to the tuple (0, The whole solution space in R 3 is generated by this tuple together with seven further tuples.
Proposition 2.6 yields the following complexity bound for solving linear equations.
Corollary 2.8.Let R be an explicitly given finite Z-algebra.Generators of the solution space of a linear equation over R as in Proposition 2.6 can be computed in polynomial time in the bit complexity of the input which is given by γ (for R) and by p(n + 1) log 2 (M ) where M = max{b kj } (for the elements f 1 , . . ., f p ).
Proof.The coefficients in the system of equations (ii) in Proposition 2.6 are b kj , c ijℓ and a ij .The claim therefore follows immediately from Remark 2.4.b.
The next proposition collects elementary operations in an explicitly given finite Z-algebra which can be performed in polynomial time.
Proposition 2.9.(Elementary Ideal-Theoretic Operations) Let R be an explicitly given finite Z-algebra, and let J = ⟨f 1 , . . ., f k ⟩ as well as J ′ = ⟨h 1 , . . ., h ℓ ⟩ be ideals in R. We assume that the elements f i , h j ∈ R are given as elements in Z[g 0 , . . ., g n ] and that the bit complexity of these sets of polynomials is given by δ J and δ J ′ , respectively.
(a) The rank and the invariant factors of R + can be computed in polynomial time in β.(b) Let G = {g 0 , . . ., g n } be the set of residue classes in R/J of the elements of G. Then generators of Syz Z (G) can be computed in polynomial time in γ + δ J .(c) We can decide whether J ⊆ J ′ in polynomial time in γ + δ J + δ J ′ .(d) We can decide whether J = ⟨1⟩ in polynomial time in γ + δ J .(e) Generators of the intersection J ∩ J ′ can be computed in polynomial time in γ + δ J + δ J ′ .Proof.To prove (a), let A = (a ij ) ∈ Mat n+1,m (Z) be the matrix whose rows are given by the generators of Syz Z (G).The rank and the invariant factors of R + can be determined from the Smith normal form of A, which can be computed in polynomial time by Remark 2.4.
Next we show (b).Using the structure constants, we can rewrite the f i as linear combinations b i0 g 0 + • • • + b in g n of the generators of R + .This means that we obtain integer tuples v 1 , . . ., v r ∈ Z n+1 with v i = (b i0 , . . ., b in ) such that v 1 , . . ., v r together with the generators of Syz Z (G) generate Syz Z (G).
Using (b), we can compute presentations

This proves (c).
To show (d), we use part (b) to compute a presentation R/J ∼ = Z n+1 / Syz Z (G).We can then apply (a) and compute the rank and the invariant factors of R/J in polynomial time.Notice that we have J = ⟨1⟩ if and only if the rank of R/J is zero and all invariant factors are equal to one.
For the proof of (e), we let Generators of Syz R (M ) can be computed in polynomial time by solving an appropriate linear system of equations over R using Proposition 2.6.The first non-zero coordinates of the generators then generate J ∩ J ′ by [21], Proposition 3.2.3.
The following algorithm will come in handy when we compute the primitive idempotents of a finite Z-algebra.Algorithm 2.10.(The Chinese Remainder Preimage Algorithm) Let R be an explicitly given finite Z-algebra.In particular, we assume that R + is generated by G = {g 0 , . . ., g n } with g 0 = 1.Let J 1 , . . ., J s be pairwise comaximal ideals in R, and assume that J 1 ∩ • • • ∩ J s = ⟨0⟩.Given i ∈ {1, . . ., s}, consider the following sequence of instructions.
(3) Let {w 1 , . . ., w ℓ } ⊆ Z n+1 be a Z-basis of V i .Compute a solution (c i ) ∈ Z k+ℓ of the linear system of equations in the indeterminates y 1 , . . ., y k+ℓ given by This is a polynomial time algorithm which computes an element f ∈ R such that f is mapped to the i-th canonical basis vector e i under the canonical Z-linear map Proof.The tuple h satisfies h ∈ j̸ =i V j and h−(1, 0, . . ., 0) ∈ V i .This shows that the residue class of h in Z n+1 / Syz Z (G) is mapped to e i under the canonical map ψ : It is generated as a Z-module by the elements of G = (1, x2 , x, ȳ), and Syz Z (G) is generated by (0, 0, 0, 2), (0, 3, 3, 0).Consider the ideals J 1 = ⟨ȳ 2 , x + 1, 2ȳ⟩ and J 2 = ⟨x 2 , 3x, ȳ⟩ in R.
Our goal is to compute f ∈ R such that f is mapped to e 2 under the canonical Z-linear map R → R/J 1 × R/J 2 .

Computing the Maximal Ideals of a 0-Dimensional K-Algebra
In this section we assume that K is either the field of rational numbers Q or a finite field F p .
Our goal is to study the complexity of computing the maximal components of a 0-dimensional K-algebra R which is explicitly given in the following sense.
Definition 3.1.A 0-dimensional K-algebra R is explicitly given if it is given by a K-vector space basis B = {b 1 , . . ., b n } and structure constants c ijk such that b i b j = n k=1 c ijk b k for all i, j = 1, . . ., n.
Note that a 0-dimensional K-algebra as in this definition can equivalently be given by a basis together with multiplication matrices.The crucial step in computing the maximal ideals of R is the factorization of univariate polynomials over K.
i .This means it requires only a polynomial number of bit operations measured in the input size.
For univariate polynomials over finite fields, the situation is slightly more complicated.A deterministic algorithm for factoring polynomials over finite fields was presented by Berlekamp in [5].Its running time for factoring a polynomial f ∈ F p is polynomial in p and deg(f ).But this is not polynomial in the bit complexity of the input which is given by (1 + deg(f )) log 2 (p).In 1970 Berlekamp published a Las Vegas algorithm [6] for the problem which has polynomial running time in the input.Since then many new and faster algorithms were developed, see e.g.[16].But it is still unknown whether the factorization can be performed in deterministic polynomial time.It was shown by Evdokimov [12] that under the generalized Riemann hypothesis (GRH) the problem can be solved in subexponential time.Furthermore, there have been efforts to drop the GHR assumption (see [18]).In addition, there exist deterministic polynomial time algorithms [14,29] for many special classes of polynomials over finite fields.Indeed, it is conjectured that the set of polynomials which do not satisfy any of the conditions in [29] is empty.
(5) Replace J with J + ⟨g i (b i )⟩. ( 6) Using the structure constants, rewrite g i (b i ) and try to obtain a representation of some b j ∈ B as a linear combination of the remaining elements.If such linear combinations exist remove those elements b j from B and update the structure constants to obtain an explicit presentation of R/J.(7) If deg(g i (z)) = dim K (R/J), return the ideal J together with the explicit presentation of R/J and stop.(8) Return the ideal J together with the explicit presentation of R/J and stop.This is an algorithm which computes the nilradical Rad(0) of R together with an explicit presentation of R/ Rad(0).If K = Q, or if K is a finite prime field, then it has polynomial running time.In particular, the bit complexity of the explicit representation of R/ Rad(0) is polynomially bounded by the bit complexity of the input.
Proof.The correctness of this algorithm is shown in [23] Algorithm 5.4.2.It remains to prove that it runs in polynomial time.The minimal polynomial in step (3) can be computed using [23], Algorithm 1.1.8.It involves finding linear dependencies among the elements 1 + J, b i + J, . . ., b d i + J where d = dim K (R/J).Using the structure constants, we rewrite b j i for j = 2, . . ., d as linear combinations of the elements of B. The linear dependencies can then clearly be found in polynomial time.The squarefree part of g i (z) in step (4) can also be computed in polynomial time (see [17] Section 14.6).
The bit complexity of the presentation of R/ Rad(0) is polynomially bounded by the bit complexity of the input, since during each iteration the bit complexity of the structure constants obtained in step ( 6) is polynomially bounded by the bit complexity of the structure constants of the previous iteration.
The following example illustrates how this algorithm can be applied.
we only obtain the trivial relation given by 0 = 0. Thus B is not updated and dim Having computed the nilradical of R, we can then obtain its maximal ideals as follows.
In the case K = Q, we can use Algorithm 7.2 in [25].It has polynomial running time in the bit complexity of the input.For K = F p , we can only hope for an algorithm in ZPP since we need to factor univariate polynomials over F p .In the more general case of associative algebras over finite fields, the complexity of computing their structure, i.e., their simple components was studied in [13], [28], and [11].But let us take advantage of the fact that we are in the commutative case and analyze the complexity of the algorithm presented in [23], which was inspired by [15].In contrast to the methods cited above it has the advantage of being well-suited for an actual implementation.
of R, i.e., the fixed-point space of R with respect to ϕ p , is called the Frobenius space of R.
In [23], Algorithm 5.2.7, it is explained how one can calculate the Frobenius space of a 0-dimensional F p -algebra.Based on this result, we obtain the following algorithm.Algorithm 3.6.(Primary Decomposition in Characteristic p) Let R be an explicitly given 0-dimensional F p -algebra.In particular, we assume that B = {b 1 , . . ., b n } is a K-vector space basis of R. Consider the following sequence of instructions.
with a 1 , . . ., a u ∈ F p .(6) For i = 1, . . ., u, let J i = J + ⟨f − a j ⟩.Compute the dimension d i of Frob p (R/J i ) and append the pair (J i , d i ) to L. This is an algorithm which calculates the list of primary components of the zero ideal of R. It is in ZPP.
Proof.The correctness of this algorithm is shown in [23], Algorithm 5.2.11.In particular, it is proved there that t = d 1 + • • • + d u throughout the course of this algorithm.Therefore the number of iterations of steps ( 3)-( 6) is bounded by s which in turn is bounded by the vector space dimension n of R. Algorithm 5.2.7 in step (4) involves computing a basis for the kernel of a matrix over K and can therefore be done in polynomial time.As discussed in the proof of Algorithm 3.3, the minimal polynomial in step (5) can also be computed in polynomial time.Computing its factorization is in ZPP by Remark 3.2.
The following example shows this algorithm at work.
The ideal J is contained in p 3 , p 4 , p 5 , and p 6 .(9) The minimal associated prime ideals of R are given by p 1 and p 2 .

Computing Primitive Idempotents
In this section our goal is to compute the primitive idempotents of an explicitly given finite Z-algebra R. We describe a variant of the method presented in Section 4 of [20] and analyze its complexity.We will use the fact that the idempotents modulo a nilpotent ideal can be lifted.The following algorithm is based on Lemma 3.2.1 in [10].
Algorithm 5.1.(Lifting Idempotents) Let R be an explicitly given finite Z-algebra, and let Rad(0) ⊆ R be its nilradical.Let e ∈ R be such that e 2 ≡ e mod Rad(0).Consider the following instructions. ( ) If (c 0 , . . ., c n ) ∈ Syz Z (G), return f and stop.Otherwise set h = f and continue with step (2).This is an algorithm which computes an idempotent f ∈ R such that f ≡ e mod Rad(0).Furthermore, if e is a primitive idempotent modulo Rad(0), then f is a primitive idempotent in R.
Proof.The algorithm terminates since Rad(0) is a nilpotent ideal.To prove the correctness, we show that if h is an idempotent modulo Rad(0) 2 k , then f is an idempotent modulo Rad(0) 2 k+1 .By assumption, we have h 2 −h ∈ Rad(0) 2 k , and therefore h 2 r −hr = (h 2 −h)r = r 2 ∈ Rad(0) 2 k+1 .Then we get and f ≡ h mod Rad(0) 2 k .Now assume that e mod Rad(0) is a primitive idempotent and that f = e ′ + e ′′ can be written as the sum of two orthogonal idempotents.Then we have e ′ ∈ Rad(0) or e ′′ ∈ Rad(0), since e is primitive.But Rad(0) consists only of nilpotent elements.Therefore e ′ or e ′′ has to be zero.
Let us apply this algorithm to an example.
our assumption.Hence we have the equality Ker(φ) = ⟨U ⟩ and φ induces the inverse of the desired isomorphism.
Given a strong Gröbner basis of an ideal I as above, an explicit representation of P/I can now be obtained as follows.
Corollary 6.8.(Computing an Explicit Representation) Let I be an ideal in P such that P/I is a finite Z-algebra, let σ be a term ordering on T n , and let G be a minimal strong σ-Gröbner basis of I. Consider the following instructions.
(1) Compute the set {t 1 , . . ., t k } = T n \ L, where the set L equals {m ∈ LM σ (I) | LC σ (m) = 1}.(2) Apply Algorithm 6.7 to compute generators of a submodule V ⊆ Z k such that P/I ∼ = Z k /V .(3) For i, j = 1, . . ., k, use the Division Algorithm with respect to G to compute the normal form NF σ,I (t i t j ) = k ℓ=1 c ijℓ t ℓ with c ijℓ ∈ Z. (4) Return the residue classes of t 1 , . . ., t k in P/I, the generators of V , and the coefficients c ijℓ for i, j, ℓ = 1, . . ., k.This is an algorithm which computes an explicit representation of P/I in polynomial time in the bit complexity of the input G.
Proof.The residue classes of t 1 , . . ., t k generate P/I as a Z-module by Proposition 6.6.Algorithm 6.7 then correctly computes V such that P/I ∼ = Z k /V .Finally, we check that NF σ,I (t i t j ) is of the form given in step (4).Let s be a term not contained in {t 1 , . . ., t k }.Suppose that NF σ,I (t i t j ) contains a monomial ds with d ∈ Z. Then we have ds / ∈ LM σ (I), and in particular s / ∈ L, a contradiction.The time complexity of each step is clearly polynomial.
In conclusion, we can see that an explicit representation of a finite Z-algebra R as in Remark 2.1 is equivalent to knowing a strong Gröbner basis of an ideal I in P = Z[x 1 , . . ., x n ] such that R = P/I.Traditionally, many of the algorithms presented in this paper were executed using the calculation of a strong Gröbner basis.However, as there is no polynomial time bound for a suitable version of Buchberger's Algorithm, the complexity bounds shown here would be impossible if R were only given via R = P/I.As explicit representations of the type described in Remark 2.1 occur in many contexts (see for instance [20]), we hope that the algorithms and complexity bounds developed here may prove useful.

Definition 2 .
2. (Polynomial Time Complexity Classes) Consider an algorithm which takes a tuple of integers as input.(a) The algorithm is in the complexity class P (polynomial time) if its running time is bounded by a polynomial expression in the bit complexity of the input.(b) The algorithm is in the complexity class ZPP (zero-error probabilistic polynomial time) if it is a Las Vegas algorithm which has polynomial running time in the bit complexity of the input.(c) The algorithm is in the complexity class ZPPIF (zero-error probabilistic polynomial time plus integer factorization) if, except for the factorization of one integer, the algorithm is in ZPP and the bit size of the integer to be factored is bounded by a polynomial expression in the bit complexity of the input.

z
ki b kj c ijℓ e ℓ − m j=1 n i=0 w j a ij e i = 0 (ii)

Remark 3 . 2 .
In 1982 Lenstra et al. [26] published a deterministic algorithm for factoring univariate polynomials in Q[x].The running time of their algorithm is polynomial in deg(f ) and log(|f |), where for a polynomial f

Example 3 . 4 .
Consider the zero-dimensional Q-algebra R with basis {1, b 1 , b 2 , b 3 } and multiplication given by b

Definition 3 . 5 .
Let R be a 0-dimensional F p -algebra.(a) The map ϕ p : R −→ R defined by a → a p is an F p -linear ring endomorphism of R. It is called the Frobenius endomorphism of R. (b) The F p -vector subspace Frob p

( 1 ) 3 ) 5 )
Form the multiplication matrix M B (ϕ p ) of the Frobenius endomorphism of R, and compute the number s = n − rank(M B (ϕ p ) − I n ) of primary components of the zero ideal of R. If s = 1 then return ⟨0⟩ and stop.(2)Let L be the list consisting of the pair (⟨0⟩, s).Repeat steps (3)-(6) until the second component of all pairs in L is 1.Then return the tuple consisting of all first components of the pairs in L and stop.(Choose the first pair (J, t) in L for which t > 1 and remove it from L. (4) Using Algorithm 5.2.7 in[23], compute the Frobenius space of R/J.Choose a nonconstant element f in it.(Calculate the minimal polynomial of the element f and factor it in the form µ f