{'fraction_non_alphanumeric': 0.07680652071686087, 'fraction_numerical': 0.015596426145566644, 'mean_word_length': 3.172098092643052, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 39, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Zeta functions of the 3-dimensional almost-Bieberbach groups

The subgroup zeta function and the normal zeta function of a finitely generated virtually nilpotent group can be expressed as finite sums of Dirichlet series admitting Euler product factorization. We compute these series except for a finite number of local factors when the group is virtually nilpotent of Hirsch length 3. We deduce that they can be meromorphically continued to the whole complex plane and that they satisfy local functional equations. The complete computation (with no exception of local factors) is presented for those groups that are also torsion-free, that is, for the 3-dimensional almost-Bieberbach groups.


Introduction
The subgroup zeta function and the normal zeta function of a finitely generated group G are, respectively, the Dirichlet series ζ G (s) = ∞ n=1 a n (G) n s and where a n (G) denotes the number of subgroups and a ⊳ n (G) the number of normal subgroups of index n. They were introduced by Grunewald, Segal, and Smith in [8] as a means to study groups of polynomial subgroup growth (PSG). Indeed, these are precisely the groups for which these series are not only formal gadgets but also define analytic functions on some right-half plane of the complex plane. A natural problem is to understand how structural information of a group of PSG is encoded into arithmetical and analytic properties of its zeta functions and vice-versa.
Lubtozky, Mann and Segal characterized the finitely generated residually finite groups of PSG: these are precisely the virtually solvable groups of finite rank [11]. On the other hand, since they were introduced, zeta functions of groups have been extensively studied only in when the group is a finitely generated torsion-free nilpotent group: a T-group. The theory for these groups is rich and continues growing. We summarize some general results and refer the reader to the survey [24] and the references therein for more information and variations of the topic. Let N be a T-group, let * ∈ { , ⊳} and let α * N denote the abscissa of convergence of ζ * N (s). Then the following holds. Remark 1.1. Properties (N1)-(N4) are, in fact, corollaries of the analogous properties established for the subring zeta function and the ideal zeta function of nilpotent Lie rings additively isomorphic to some Z h . The translation is done via the Mal'cev correspondence. The question of whether the ideal zeta function of a nilpotent Lie ring of nilpotency class > 2 satisfies local functional equations led to the introduction and investigation of the submodule zeta function; see, e.g., [17], [25], and [10]. On the other hand, it has long been known that, for instance, the ideal zeta function of the filiform nilpotent Lie ring Fil 4 fails to satisfy local functional equations; see [7,Theorem 2.39].
Regarding the computation of zeta functions, the following are classical examples.
(1) For the free abelian group Z h , it holds that ζ Z h (s) = ζ(s)ζ(s − 1) · · · ζ(s − h + 1), where ζ(s) is the Riemann zeta function. In [12,Chap. 15], there are five different proofs of this elementary fact. [8, Section 8]. A general theory and calculation of ζ ⊳ H3(OK ) (s), for K a number field and O K its ring of integers, are presented in [19] and [20]. Finding explicit formulae for the zeta functions of a T-group is in general a difficult task. A substantial list of examples is recorded in [7], and new ones have emerged more recently; see, e.g., [1], [19], [20], [26]. In [16] and [18], Rossmann developed a method for computing certain zeta functions associated with T-groups and other algebraic structures. This algorithm was implemented in [15].
This work studies and presents formulae for the zeta functions of the virtually nilpotent groups of Hirsch length 3 (see the next paragraph for a detailed description of the content). This is not the first attempt in dealing with zeta functions of groups that are not nilpotent. In [4], du Sautoy investigated zeta functions of compact p-adic analytic groups (= virtually uniform pro-p-groups) and proved that they are rational functions in p −s . Then, in [6], the authors studied zeta functions of virtually abelian groups, proving for example, that they can be meromorphically continued to the whole complex plane (this property is not shared by zeta functions of T-groups in general, as discussed in [7,Chap. 7]). The paper [22] contains general properties of zeta functions of virtually nilpotent groups that we now recall. Let G be a finitely generated virtually nilpotent group, and let N ⊳ G be a finite index normal subgroup that is a T-group. It is easy to check that The series ζ H, G (s) and ζ H,⊳ G (s) will be referred to as partial zeta functions of ζ G (s) and ζ ⊳ G (s) (with respect to N ). Each of them is an Euler product of cone integrals [22,Theorem 1], and hence it satisfies properties (N2) and (N3) above by the general theory of cone integrals developed in [5]. Property (N1) also holds with the bound h(N ) = h(G) replaced by h(G) + 1 [22,Proposition 2.12]. The partial zeta functions were computed explicitly, except for a finite number of local factors, when the group N is abelian; see [6,Section 2]. Computing the exceptional factors is, in general, more involved. The complete computation was done for the plane crystallographic groups. This is the main result in [13], and it is also summarized in [6,Section 4]. To the author's knowledge, these are the only existing examples of computations of zeta functions of infinite groups that are not nilpotent.
The article is organized as follows. In Section 2, we obtain formulae for the local factors of ζ G, G (s) and ζ N,⊳ G (s) when p ∤ [G : N ] for every virtually nilpotent group of Hirsch length 3 (see Table 1 and Table  2). This suffices to conclude that the subgroup and normal zeta functions of each of these groups extend to meromorphic functions on the whole plane (Corollary 2.8 and Corollary 2.19). We also deduce local functional equations, similar to but different from the ones presented in (N4) (Corollary 2.7 and Corollary 2.18). The arguments in this section are of a group-theoretical nature, akin to [6, Section 2]. In section 3, we review a method for expressing local zeta functions of groups in terms of p-adic integrals. This method is used later to compute local factors at primes p|[G : N ] (those not considered in Section 2). Section 4 presents the formulae for the zeta functions of the torsion-free virtually nilpotent groups of Hirsch length 3. A group like this is either a 3-dimensional Bieberbach group or a 3-dimensional almost-Bieberbach group (the fundamental group of a 3-dimensional infra-nilmanifold). Section 5 contains proofs of the formulae for the 3-dimensional Bieberbach groups. It also contains formulae for the zeta functions of a large family of Bieberbach groups with holonomy C 2 , to illustrate how involved the method for computing local factors at bad primes is, even in the case of virtually abelian groups. Finally, Section 6 contains proofs of the formulae for the 3-dimensional almost Bieberbach groups.
Notation and conventions |S| denotes the cardinality of a set S. For a group G, Z(G) denotes its center; A G means that A is a subgroup; A ⊳ G means that A is a normal subgroup; [G : A] denotes the index of A in G; N G (A) denotes the normalizer of A in G. In sums involving [G : A], only subgroups of finite index are considered. For a subset S ⊂ G, S denotes the subgroup generated by S. When G is profinite, S denotes the closed subgroup generated by S. For x, y ∈ G, we denote x y = xyx −1 and [x, y] = xyx −1 y −1 (= x y · y −1 ). For S, T ⊂ G we denote [S, T ] = [s, t]|s ∈ S, t ∈ T . We use without mentioning the fact that if G is a finitely generated profinite group, then every finite index subgroup is open, and if H and K are closed subgroups, then [H : K] is also closed; see [14].
The variable p will be reserved for prime numbers. We denote by v p : Q p → Z ∪ {∞} the usual p-adic valuation, and by | · | p = p −vp(·) the p-adic norm. ζ p (s) denotes 1 1−p −s , the local factor of the Riemann zeta function ζ(s) at p.

Local factors at good primes and meromorphic continuation
Let G be a finitely generated virtually nilpotent group, and let N ⊳ G be a finite index normal subgroup that is a T-group. For a prime p, let G p be the completion of G with respect to the family {B ⊳ G p : B ⊆ N p , [N p : B] a power of p}. For X G, we denote by X p the closure of X in G. For a subquotient X/Y of G we denote (X/Y ) p = X p /Y p . Note that N p is the pro-p completion of N , and that the inclusion G ֒→ G p induces an isomorphism G/N ∼ = G p /N p .
As noted in the introduction, to study ζ G (s), it is enough to focus on the partial zeta functions ζ H, G (s) = ζ H, H (s) for N H G. There is no loss of generality if we only consider ζ G, G (s). Similarly, to study ζ ⊳ G (s), it is enough to consider ζ H,⊳ G (s) for N H ⊳ G. The advantage is that we have ζ G, G (s) = 2.1. Counting subgroups. We begin with a general formula for the local factors of ζ G, G (s) at "good" primes.
Proof. For a subgroup U T p , we denote byŨ its pre-image in N p . We set and define maps Φ : is in a bijection with the set of complements of N p /Ũ in G p /Ũ . Since N p /Ũ is a normal Hall subgroup of G p /Ũ , there is at least one complement by the Schur-Zassenhaus Theorem, and therefore the number of complements is | Der(P, We now fix (U, V, C) ∈ V and show that The sub-groupsŨ and V are normal closed subgroups of G p , and the condition [U, U ] ⊆ V implies that the quotient U /V is abelian. Thus,Ũ /V is a finitely generated Z p -module and Z p /V is clearly the torsion submodule. We use C to giveŨ /V a structure of Z p [P ]-module. Firstly, the action by conjugation of C onŨ induces a structure of C/Ũ -module onŨ /V . Secondly, the inclusion C → G p induces an isomorphism C/Ũ ∼ = G p /N p = P . Therefore,Ũ /V becomes a Z p [P ]-module. Note that Z p /V has two structures of Z p [P ]-module: one as a subobject ofŨ /V and one as a quotient of Z p . It is easy to check that these two structures coincide. Similarly, the structure of Z p [P ]-module onŨ /Z p = U as a quotient ofŨ /V and the one as a subobject of T p are the same.
Given A Φ −1 (U, V, C), observe that (A ∩ N p )/V is a complement of Z p /V inŨ /V . We claim that this complement is P -invariant. Indeed, A ∩ N p is normal in A and in (A ∩ N p )Z p , so it is normal in AZ p = C. Therefore, (A ∩ N p )/V is C/Ũ -invariant, and hence P -invariant. Now, according to Lemma 2.2 below, the number of P -invariant complements of Fix one such complement, say B/V . Note that B is normal in C (this follows from the condition of B/V being P -invariant) and the set of those A ∈ Φ −1 (U, V, C) such that A ∩ N p = B is in a bijection with the set of complements ofŨ /B in C/B. SinceŨ /B is a normal Hall subgroup of C/B, there is at least one such complement by the Schur-Zassenhaus Theorem, and then the number of complements is | Der( To end the proof, we only need to show that | Der(P, Here we use again that p ∤ |P |. The first two equalities follow from [6,Lemma 2.4], and for the last one we use the fact that U and T are isomorphic as Λ p -modules.
The following lemma was used in the proof above.
Lemma 2.2. Let R be a ring, let M be a left R-module, and fix X R M . If there is a complement of X in M (i.e,. there is Y R M such that X + Y = M and X ∩ Y = 0), then the set of complements of X in M is in a bijection with Hom R (M/X, X). If R = Z p [P ] with p ∤ |P |, and if M/X is finitely generated and torsion-free as a Z p -module, then the set of (P -invariant) complements of X is in a bijection with Hom Zp[P ] (M/X, X).
Proof. Assume that there is a complement of X, say Y . Given any other complement K R M , we define ϕ K : Y → X as follows. If y ∈ Y , then we can write y = k + x uniquely with k ∈ K and x ∈ X. We set ϕ K (y) = x. It is clear that ϕ K ∈ Hom R (Y, X). Conversely, given ϕ ∈ Hom R (Y, X), we define K ϕ = {y − ϕ(y) : y ∈ Y }. It is easy to check that K ϕ is a complement of X, and that ϕ Kϕ = ϕ and K ϕK = K. Therefore, the set of complements of X is in a bijection with Hom R (Y, X), which in turn is in a bijection with Hom R (M/X, X) since M/X and Y are isomorphic. This proves the first part of the lemma We now show the second part, so we assume now that R = Z p [P ] with p ∤ |P | and that M/X is finitely generated and torsion-free as a Z p -module. Then M/X is a free Z p -module of finite rank, and hence it is a projective Z p [P ]-module (here we use the fact that p ∤ |P |). This implies that there is at least one complement of X; therefore, the set of complements is in a bijection with Hom Zp[P ] (M/X, X), as shown in the first part of the lemma. This completes the proof.
The following lemma will be used to calculate | Hom Λp (T p , Z p /V )| in some particular cases. Proof. Since p ∤ |P | and since Z p is finitely generated and torsion-free as a Z p -module, Z p is a projective Λ p -module. Thus, the lemma in both cases follows from the equality Hom Λp (M, Z p ) = 0, whose verification is straightforward.
We now specialize to the case when N has Hirsch length 3. Recall that given a finite subgroup F ⊂ GL 2 (Z), either F is included in SL 2 (Z), in which case F is isomorphic to one of the cyclic groups C 1 , C 2 , C 3 , C 4 , C 6 , or else there is β ∈ F of order 2 with determinant −1, in which case F is isomorphic to one of the dihedral groups Lemma 2.4. Assume that N is a T 2 -group of Hirsch length 3 (so that T ∼ = Z 2 and Z ∼ = Z). Set F := Im(P → GL(T )) and η := rank Z (C T (P )). Then the following holds.
(1) C Z (P ) = Z if and only if F ⊂ SL(T ).
Proof. Fix an ordered basis {x, y} for T . Note that [x, y] ∈ Z is non-zero. Given α ∈ P , let a b c d be the matrix of α T with respect to {x, y}. We have α · [x, y] = [ax + cy, bx + dy] = (ad − bc)[x, y]. It follows that C Z (P ) = Z if and only if F ⊂ SL(T ). It also follows that Z is naturally an F -module. We now show (2) and (3). Fix a prime p ∤ |P | and a subgroup V Λp Z p of finite index. Note that (2) and (3) hold clearly for F = C 1 . Assume next that F ∼ = D 1 and F ⊂ SL(T ). Then the generator of F has eigenvalues 1 and −1, whence the Λ-submodules T + := C T (P ) and T − := {x ∈ T : β · x = −x} have additive rank 1. It follows that η = 1. Next, since p = 2, the decomposition x = x+α·x 2 + x−α·x 2 holds in T p and yields a decomposition Assume now that C 1 = F = α ⊂ SL(T ). It holds that C T (α) = 0, and hence η = 0, since otherwise 1 would be an eigenvalue of α. However, since α ∈ SL(T ) the latter implies that α is the identity, which is not the case. Since C Z (α) = Z by (1), Lemma 2.3 implies that | Hom Λp (T p , Z p /V )| = 1 = | Hom P (T p , Z p /V )| η .
Assume finally that F ∼ = D d with d ∈ {2, 3, 4}. The intersection F ∩ SL(T ) is not the trivial group. Indeed, the product of any two elements of F is in SL(T ) and F has more than two elements. It follows from the previous case that η = 0 and | Hom Λp (T p , Z p /V )| = 1 = | Hom P (T p , Z p /V )| η . We have covered all the cases, so the proof is complete.
Theorem 2.6. Assume that N is a T 2 -group of Hirsch length 3. Let F := Im(P → GL(T )) and E = T ⋊ F , which is a plane crystallographic group. If p ∤ |P |, then ζ Gp, where η := rank Z (C T (F )), ǫ is 0 or 1 according to whether F is included in SL(T ) or not, and ζ Ep, where, in the last equality, we used Lemma 2.
, and L p (s, Proof. The formula for ζ    Proof. According to Table 1, there is a Dirichlet series Z(s) = p Z p (s) such that: (a) it has abscissa of convergence in the set { 3 2 , 2, 3}; (b) it admits a meromorphic continuation to the whole plane; (c) for any finite set of primes, say S, Z(s) and p / ∈S Z p (s) have the same abscissa of convergence; and (d) Z(s) coincides with ζ G, G (s) except for a finite number of local factors. Since an exceptional local factor ζ Gp, Gp (s) is a rational function of p −s with rational coefficients [4], it follows from (b) and (d) that ζ G,s G (s) also has a meromophic continuation to the whole plane. Moreover, ζ G, G (s) and Z(s) have the same abscissa of convergence. Indeed, by (c) and (d), it is enough to show that the abscissa of convergence of each local factor of ζ G, G (s) is strictly less than the abscissa of convergence of ζ G, G (s). Now, this follows from the fact that ζ G, G (s) is an Euler product of cone integrals [22,Theorem 1]. This important property about cone integrals was established in [5,Section 4], and it was a key point in obtaining analytic properties of global zeta functions.
To prove the last assertion of the corollary, we apply the first part to each of the partial zeta functions of ζ G (s). Table 1, we recover [8,Proposition 8.1]. See also [9] for a generalization.

2.2.
Counting normal subgroups. We begin with some preliminaries from elementary group theory. Let G be for the moment any group, and let N ⊳ G be a normal subgroup. We define inductively a series of normal subgroups γ 1 (G, N ) ⊇ γ 2 (G, N ) ⊇ . . . by setting Proof. By the Schur-Zassenhaus theorem, there is at least one complement of N in G, and they are all conjugated. We prove that there is only one by induction on c.
Assume that c = 1, and let C be a complement of N in G.
Assume now that c > 1. By the inductive hypothesis, there is a unique complement, say , so by the case c = 1, there is only one possibility for C. This completes the induction.
The final part of the lemma is clear.
Proof. Note that B := A∩N is also normal in G, and there is an identification We return to the setting introduced at the beginning of the section except that we do not assume that the nilpotency class is 2 yet. We fix an intermediate normal subgroup N H ⊳G and consider the series ζ where the series on the right is computed with respect to N ′ p ⊳ G ′ p (this holds for all p). Assume now that p ∤ |H/N |. Given This proves the first part of the lemma. Remark 2.14. We claim that if p ∤ |H/N |, then γ c+1 (H p ,

If in addition N
We now return to the case when N is a T 2 -group. Recall the notation introduced at the beginning of the section. Given V Z p of finite index, we denote by X(V ) T p the largest subgroup such that [T p , X(V )] ⊆ V . It has finite index in T p , and if V is in addition P -invariant, then X(V ) is also P -invariant. Proposition 2.12 allows us to focus only on the first partial zeta function ζ N,⊳ G (s) = B⊳G:B⊆N [N : B] −s , the other ones being of the form ζ G ′ ,⊳ N ′ (s) except for a finite number of local factors, where G ′ is a quotient of G.
The above assumptions hold if p ∤ |P |.
Proof. The proof is similar to that of [8, Lemma 6.1], so we omit it. We just point out that given U Λp T p and This uses the second assumption and Lemma 2.2. In addition, by the first assumption, Hom The first assumption is satisfied when p ∤ |P | since in this case Λ p is a maximal order of Q p [P ], and the second assumption is satisfied by Lemma 2.2.
We now specialize to the case of Hirsch length 3.
Lemma 2.16. Assume that N is a T 2 -group of Hirsch length 3. Given V Z p of finite index, the following holds: Proof. The first assertion is trivial since in this case Theorem 2.17. Assume that N is a T 2 -group of Hirsch length 3. Set F := Im(P → GL(T )) and E := T ⋊F , which is a plane crystallographic group. If p ∤ |P |, then .
Proof. This follows from Theorem 2.  Proof. The assertion about ζ N,⊳ G (s) follows by inspection of Table 2 and the same argument used in the proof of Corollary 2.8. Next, by Corollary 2.13, ζ ⊳ G (s) has the same abscissa of convergence as ζ N,⊳ G (s). To complete the proof, it is enough to show that for each intermediate normal subgroup N H ⊳ G different from N , the series ζ H,⊳ G (s) admits a meromorphic continuation to the whole plane. We use the notation from the proof of Corollary 2.13 with c = 2. Since the local factor of ζ H,⊳ G (s) at a prime p is a rational function in p −s by [4], it is enough to show that ζ N ′ ,⊳ G ′ (s) admits a meromorphic continuation to the whole plane. If N ′ = N , then we are in the same situation as in the case of ζ N G (s), so we are done. If N ′ = N , then either N ′ ∼ = Z 2 , in which case the result follows from the formulae of the normal zeta functions of the plane crystallographic groups given in [13,Chap. 6], or else N ′ ∼ = Z or N ′ = 0, in which case the result is trivial.
2.3. Remark on the local functional equations. One natural problem is to decide whether local functional equations hold for ζ G, G (s) and ζ N,⊳ G (s) when the Hirsch length of N is higher than 3. When N is abelian, this follows from the explicit formulae obtained in [6,Section 2]. In contrast to the situation of zeta functions of nilpotent groups, here the local functional equations are not uniform in p. They depend on how p ramifies in certain number fields that arise in the decomposition of Q[G/N ] into simple algebras. Propositions 2.1 and 2.15 enable us to linearize the problem when the nilpotency class is 2 (indeed, the linearization for ζ N,⊳ G (s) holds more generally by the Mal'cev correspondence). We will not go into details. Briefly, the problem can be stated as follows. Let L be a 2-step nilpotent Lie ring additively isomorphic to Z h , and let Z denote its center. Let P be a finite group acting on L by Lie ring automorphisms. We consider where the first sum runs over the P -invariant finite index subrings, and the second one only over the Pinvarian finite index ideals. Corollaries 2.7 and 2.18 imply that these series satisfy local functional equations when L has additive rank 3. In analogy with the results of [23], we might ask: Question 1. Do ζ P L (s) and ζ ⊳ P L (s) satisfy local functional equations when L is a 2-step nilpotent Lie ring of rank > 3? Does ζ P L (s) satisfy local functional equations for arbitrary rings (not necessarily nilpotent) that are additively isomorphic to some Z h ?
We return to the case when L is a 2-step nilpotent Lie ring additively isomorphic to Z 3 . It is not difficult to check, say by inspection of Table 1 and the results of [6, Section 2], that if we forget the structure of Lie ring on L (obtaining Z 3 ) and consider just ζ P Z 3 (s), then ζ P L (s) and ζ P Z 3 (s) satisfy the same local functional equations. By this, and again in analogy with (N4), we can also ask: Question 2. Let L be a ring additively isomorphic to Z h . Let P be a finite group acting on L. If ζ P L (s) satisfies local functional equations, are these equations the same as those satisfied by ζ P Z h (s)?
In a forthcoming paper, we show that Question 1 and Question 2 have positive answer for various nilpotent Lie rings of rank 4.

Local zeta functions as p-adic integrals
Let N p be a torsion-free finitely generated nilpotent pro-p group and let G p be a profinite group that includes N p as an open normal subgroup. Fix also an intermediate normal subgroup N p H p ⊳ G p . We review a method, developed in [8,Section 2] for T-groups and extended to virtually nilpotent groups in [22], to express ζ Hp, Hp (s) and ζ Hp,⊳ Gp (s) as p-adic integrals. This method is used in the next sections to calculate local factors at "bad" primes in some cases.
3.1. Expressing ζ Np (s) and ζ ⊳ Np (s) as p-adic integrals. An additional reference for this part is [12,Chap. 15], where the notation is more adapted to ours. Fix a Mal'cev basis x = (x 1 , . . . , x h ) for N p . By definition, the series of subgroups and each x ∈ N p determines a unique vector a = (a 1 , . . . , a h . Given an open subgroup B N p , we say that t ∈ T + h (Z p ) represents a good basis for B (with respect to We also see from this that We collect results from [8,Section 2] in the next lemma. The topological group T h (Z p ) ∼ = Z h(h+1)/2 p has a normalized Haar measure, which we denote by µ.
Therefore, for a complex variable s, Proof. The first part of the lemma is proved in [8, Lemma 2.5]; see also [12,Lemma 15.1.1]. We recall here the proof of (3.3). We start from the right-hand side and use (3.1) and (3.2): . . , x t h , 1 i, j h}. As an immediate consequence of formula (3.3), we obtain the following corollary.

Expressing ζ
Hp, Hp (s) and ζ Hp,⊳ Gp (s) as p-adic integrals. We begin with the following particular case, which is an immediate consequence of (3.3). Corollary 3.3. Let α 1 , . . . , α r ∈ G p such that their classes modulo N p generate G p /N p . Then It remains to consider the case H p = N p . We set F := H p /N p and denote by e its identity element. The following is fixed in the rest of this section.
-Group words w f (X 1 , . . . , X r ), f ∈ F , such that f = w f (f 1 , . . . , f r ). In the case f = f j (j = 1, . . . , r), we just set w fj = X j , and in the case f = e, we set w e = e, the empty word. -A transversal {β f : f ∈ F } to the cosets of N p in H p such that β f N p = f for all f ∈ F and β e = 1 (the identity of N p ). We denote β i := β fi (this is why we denoted the identity of F by e and not by 1). -Elements α 1 , . . . , α s ∈ G p whose classes modulo N p generate G p /N p . Assume that the first t of them (t s), α 1 , . . . , α t , generate G p modulo H p . Given A H p of finite index such that AN p = H p , the intersection A ∩ N p ⊆ N p is open and A can be written as  (1) βjnj B ⊆ B for 1 j r.

Moreover, A is a normal subgroup of G p if and only if (2), (3), and the following four conditions are satisfied. (4) B is normal in
. . , β r n r )B for 1 k t and 1 j r, whereᾱ k denotes the class of Proof. Assume first that A is a subgroup of G p . Then clearly B = A ∩ N p , so B is normal in A; in particular, (1) holds. Note that R λ (β 1 n 1 , . . . , β r n r )N p = R λ (f 1 , . . . , f r ) = e (∈ F ), and hence R λ (β 1 n 1 , . . . , β r n r ) ∈ A ∩ N p = B; thus, (2) holds. Similarly, β f n f and w f (β 1 n 1 , . . . , β r n r ) have the same image at F , and hence (3) also holds.
Conversely, assume that the conditions (1), (2), and (3) are satisfied for the collection (n f ) f ∈F \{e} . Condition (1) implies that β j n j ∈ N Hp (B), the normalizer of B in H p , and then (3) implies that β f n f ∈ N Hp (B) for all f ∈ F \ {e}. It follows that A ⊆ N Hp (B). Let A ′ /B denote the subgroup of N Hp (B)/B generated by A/B. By (3), A ′ /B is generated by the classes of β 1 n 1 , . . . , β r n r , and by (2), these generators satisfy the relations defining the presentation of F . It follows that, |A ′ /B| |F |. On the other hand, |A/B| has exactly |F | elements. Thus, A/B = A ′ /B, whence A = A ′ . We conclude that A is a subgroup of G p . This completes the proof of the first part of the lemma.
Assume now that A is a normal subgroup of G p . According to the first part of the lemma, (2) and (3) are satisfied. Note that (4) and (5) also hold since B = A ∩ N p is also normal in G p . Now, the normality of A implies that [β j n j , x i ] ∈ A, and the normality of N p that [β j n j , x i ] ∈ N p ; thus [β j n j , x i ] ∈ B = A ∩ N p , whence (6) is also satisfied. Finally, (w [ᾱ k ,fj ] (β 1 n 1 , . . . , β r n r )) −1 [α k , β j n j ] is in A since A is normal, and it is in N p since its image at G p /N p is the identity. This shows that (7) also holds.
Conversely, assume that (2) to (7) are satisfied. Note that (4) and (5) imply (1); hence, according to the first part of the lemma, A is a subgroup. They also imply that B is normal in G p . We saw in the second paragraph of the proof that A/B is generated by the classes of the elements β j n j ; thus, by (6), N p /B is included in N Gp/B (A/B). It follows that A/B is normal in H p /B. Finally, by (7), A/B is normal in G p /B, and hence A is normal in G p . This completes the proof of the lemma.
We set more notation for the next proposition. We denote by M k×h (Z p ) the set of k × h-matrices with entries in Z p .
Proof. Throughout the proof, we shall refer repeatedly to conditions (1)-(7) of Lemma 3.4. We will also use the same notation. The first part of this lemma establishes a bijection between the family F  S(B, n f1 B, . . . , n fr B) It follows (again, using formula (3.1)) that S(B, n f1 B, . . . , n fr B))  S(B, n 1 B, . . . , n r B). Note that this is the set of pairs (t, v) ∈ T h (Z p ) × M r×h (Z p ) such that (a) t ∈ M Np ; and (b) the elements n j := x vj , for j = 1, . . . , r, satisfy conditions (1) and (2) (2), (6) and (7). Clearly (b) and (c) are equivalent to (3.6) This completes the proof of the proposition.

3.3.
A method to simplify cone integrals. We end this section with an elementary observation that we will use frequently to simplify the calculation of cone integrals.
Given m, n ∈ N, we consider subsets of Z m p × Z n p obtained as follows. (i) Fix a measurable subset D 0 ⊂ Z m p and rational functions g i (T) ∈ Q p (T) = Q p (T 1 , . . . , T m ), i = 1, . . . , n, such that g i (t) ∈ Z p whenever t ∈ D 0 . (ii) Given an integer i such that 1 i n, assume that we have defined a measurable subset We define D i in one of the following two ways: (iii) We finally set D = D n ⊂ Z m p × Z n p . We say that (D 0 , g 1 (T), . . . , g n (T)) is the initial datum of definition of D and call (v 1 , . . . , v n ) the sequence of pivots. A pivot v i is said to be of type I or type II according to the way we choose to define D i .

. , T m ] be non-zero polynomials, and consider the integral
where D ⊆ Z m p ×Z n p is a measurable subset defined from a datum (D 0 , g 1 (T), . . . , g n (T)) and pivots (v 1 , . . . , v n ).

If the number of pivots of type II is r, then
Proof. The integral (3.8) can be performed as follows. We start integrating with respect to the variable v n . Note that g n (t)|k n (t, v 1 , . . . , v n−1 ) + λ n (v 1 , . . . , v n−1 )v n if and only if v n ∈ g n (t)Z p − kn(t,v1,...,vn−1) λn(t,v1,...,vn−1) , and the Haar measure of this set is |g n (t)| p . Similarly, |g i (t)| p = |k n (t, v 1 , . . . , v n−1 ) + λ n (t, v 1 , . . . , v n−1 )v n | p if and only if v n ∈ g n (t)Z * p − kn(t,v1,...,vn−1) λn(t,v1,...,vn−1) and the Haar measure of the this set is (1 − p −1 )|g n (t)| p . To sum up, after integrating with respect to v n , the integrand is multiplied by |g n (t)| p or by (1 − p −1 )|g n (t)| p according to whether v n is a pivot of type I or II, and the new domain of integration is clearly D n−1 . We next integrate with respect to v n−1 and so on. After n steps, we arrive at the desired form of the integral.

The formulae
We now present the complete formulae for the subgroup and normal zeta functions of the 3-dimensional almost-Bieberbach groups, whose definition we recall below. Proofs of these formulae will be left for the next two and last sections. For details of the next discussion, we refer to [2].
Let N be a connected and simply connected nilpotent Lie group, and let Aut(N ) be the topological group of Lie group automorphisms of N . The semi-direct product N ⋊ Aut(N ) acts on N in a canonical way by (n,α) x = nα(x), ∀x, n ∈ N , ∀α ∈ Aut(N ).
All maximal compact subgroups of Aut(N ) are conjugate. We fix one of them, say C ⊂ Aut(N ). A torsionfree uniform discrete subgroup G of N ⋊ C is called an almost-Bieberbach group (abbreviated as AB-group). Note that the quotient space G \N is a compact manifold of the same dimension as N whose fundamental group is identified with G. The dimension of G is defined as the dimension of N . When N = R n and C = O(R n ), the orthogonal group, we recover the definition of Bieberbach group. The quotient space G \R n , with the metric induced from the Euclidean space R n , is a compact flat manifold.
The AB-groups were characterized algebraically as the finitely generated torsion-free virtually nilpotent groups (cf. 4.1. The 3-dimensional Bieberbach groups and their zeta functions. There are only ten 3-dimensional Bieberbach groups up to isomorphism (cf. [27,Chap. 3]). They are listed below with their corresponding zeta functions expressed in terms of the partial zeta functions with respect to the Fitting subgroup (which is always x 1 , x 2 , x 3 ). The first six are the fundamental groups of the orientable compact flat manifolds, and the last four are the fundamental groups of the non-orientable ones. We have arranged the presentation so that ζ G G (s) appears as the first term in the formula of ζ G (s) and [G : N ] −s ζ N (s) as the last one. The same holds for ζ ⊳ G (s). (s, χ3). 1).

4.2.
The 3-dimensional almost-Bieberbach groups and their zeta functions. The 3-dimensional AB-groups with non-abelian Fitting subgroup were classified in [3]; see also [2,Chap. 7]. They are arranged into seven families according to the isomorphism type of G/Z(N ) (G is the AB-group and N the Fitting subgroup), which is one of the plane crystallographic groups p1, p2, pg, p3, p4, p6, p2gg. They are listed below with their zeta functions expressed in terms of the partial zeta functions with respect to the Fitting subgroup, which is always x 1 , x 2 , x 3 . This time the normal zeta function has been arranged so that [G : N ] −s ζ N,⊳ G (s) appears as the first term in the formula and ζ G,⊳ G (s) as the last one.

Computing the zeta functions of the 3-dimensional Bieberbach groups
We prove the formulae presented in 4.1. Throughout this section, we denote by G the Bieberbach group under consideration and by N the Fitting subgroup. We keep the notation introduced at the beginning of Section 2 except that here N is not a T2-group but rather an abelian group (and it is indeed an Z[P ]-module, where P = G/N ). Instead, we denote Z = CN (P ), E = G/Z, T = N/Z. The formula for the zeta functions of G1 are already known (see Introduction), so we focus here on the other groups. We mentioned that an intermediate subgroup N H G is again a Biebarbach group with Fitting subgroup N . Therefore, to prove the formula for ζ G, G (s), it is enough to prove the one for ζ G, G (s). The isomorphism classes of the intermediate subgroups N H G (if there is any) will be identified when computing the partial zeta functions ζ H,⊳ G (s). The following will be useful. If p ∤ |G/N |, then These follow immediately from the analysis in [6,Section 2]. When the rank of Z is 1, then E is a plane crystallographic group, and we will be able to apply the results of [13] (summarized in [6,Section 4]).
When computing local factors at primes p|[G : N ], we will sometimes use the method of p-adic integration with respect to the Mal'cev basis {x1, x2, x3}; specifically, Corollary 3.3 and Proposition 3.5. In this case, M p = M ⊳ p = T + 3 (Zp). The following lemma, whose verification is straightforward, will be used to translate the conditions defining the domains of integration into cone conditions.

and only if the following holds:
(1) t11|v1 This, of course, includes the cases G = G2 and G = B1. Here N = x1, . . . , x a+b , P ∼ = C2 is generated by the class of α, and Z = CN (P ) = xa+1, . . . , x a+b . Note that if U Z V N , then U and V are P -submodules. We first prove a series of lemmas. When working inside T or Z, we shall use additive notation.

Proof.
A subgroup A G such that AN = G must contain αn for some n ∈ N . Then (αn) 2 ∈ A. It is easy to check that (αn) 2 = x a+b + 2z for some z ∈ Z; thus x a+b + 2z ∈ B ∩ Z, where B = A ∩ N , or x a+b ∈ (B ∩ Z) + 2Z. Note that B is clearly normal, and if A is also normal, then [N, G] = x 2 1 , . . . , x 2 a is included in B by Lemma 2.11. This proves the first part of the lemma.
We now fix B N of finite index and normal in G, and assume that x a+b + 2z ∈ B ∩ Z for some z ∈ Z, which will be fixed. Let {w1, . . . , ws} ⊂ x1, . . . , xa and {z1, . . . , zt} ⊂ Z be transversals to the cosets of BZ in N and to the cosets of B ∩ Z in Z, respectively. Then {wizj : 1 i s, 1 j t} is a transversal to the cosets of B in N . A subgroup A G such that AN = G and A ∩ N = B is of the form A = B ∪ αwizj B for uniquely determined wi and zj . Now A = B ∪ αwizj B is a subgroup if and only if (αwizj) 2 ∈ B, that is x a+b z 2 j ∈ B, or x a+b + 2zj ∈ B ∩ Z in additive notation. In turn, this is equivalent to 2zj − 2z ∈ B ∩ Z, that is, zj − z ∈ ( 1 2 (B ∩ Z)) ∩ Z. Therefore, only [( To show the second part, we use additive notation inŨ /V . There is no loss of generality if we assume that U/2T is generated by the classes of x1, . . . , x d . Letxi denote the class of xi modulo V , i = 1, . . . , a. We are interested in the number of P -invariant complements of Z/V inŨ /V that contain 2x1, . . . , 2xa. One of them is B0/V , where B0 = x1, . . . ,x d , 2x d+1 , . . . , 2xa . To count how many there are, we follow the proof of Lemma 2.2. . . , 2xa − ϕ(2xa) for a uniquely determined ϕ ∈ HomP (B0/V, Z/V ) = Hom(B0/(2B0 + V ), Z/V ). The last equality uses Lemma 5.2, which is possible since clearly B0/V ∼ = T as P -modules. Given ϕ as above, we have 2xi = 2xi − 2ϕ(xi) ∈ Bϕ/V for i = 1, . . . , d. If it is also required that 2x d+1 , . . . , 2xa ∈ Bϕ/V , we need ϕ(2xi) = 0 for all i = d + 1, . . . , a. Thus, the set of P -invariant complements of Z/V inŨ /V that contain 2x1, . . . , 2xa is in a bijection with Hom(B0/(2B0 + 2x d+1 , . . . , 2xa + V ), Z/V ), that is, with Hom( We now prove (5.4) by induction on k. The case k = 0 is obvious, so we assume that k > 0. Let A k be the left-hand side and B k the right-hand side. Note that (5.3) implies that k i=0 Ai k i 2 = 0. Here k i 2 denotes the 2-binomial coefficient, which expresses the number of i-dimensional subspaces in a k-dimensional vector space over F2. On the other hand, if we replace t by −1 in the 2-binomial theorem Since Ai = Bi for i < k by the inductive hypothesis, and since k k 2 = 1, it follows that A k = B k . This completes the induction.
Lemma 5.6. Let Z1 be a free abelian group of rank b and let Z0 Z1 be a subgroup such that 2Z1 ⊆ Z0. Then Proof. By (5.3), the left-hand side of (5.6) becomes

By (5.4), the latter becomes
Finally, by using (5.5) with k = d and t = −2 −s , the last expression becomes the right-hand side of (5.6).
Proposition 5.7. The partial zeta functions of G with respect to N are as follows: Proof. The first equality below uses Lemma 5.3, the second one Lemma 5.4, and the last one Lemma 5.6.

5.5.
Computing the zeta functions of G = B3. Note that Z = x1 . One can easily check that E = G/Z is the plane crystallographic group p2mg.