The number of D4-fields ordered by conductor

We consider families of quartic number fields whose normal closures over Q have Galois group isomorphic to D4, the symmetries of a square. To any such field L, one can associate the Artin conductor of the corresponding 2-dimensional irreducible Galois representation with image D4. We determine the asymptotic number of such D4-quartic fields ordered by conductor, and compute the leading term explicitly as a mass formula, verifying heuristics of Kedlaya and Wood. Additionally, we are able to impose any local splitting conditions at any finite number of primes (sometimes, at an infinite number of primes), and as a consequence, we also compute the asymptotic number of order 4 elements in class groups and narrow class groups of quadratic fields ordered by discriminant. Traditionally, there have been two approaches to counting quartic fields, using arithmetic invariant theory in combination with geometry-of-number techniques, and applying Kummer theory together with L-function methods. Both of these strategies fall short in the case of D4-quartic fields ordered by conductor since counting quartic fields containing a quadratic subfield with large discriminant is difficult. However, when ordering by conductor, we utilize additional algebraic structure arising from the outer automorphism of D4 combined with both approaches mentioned above to obtain exact asymptotics.


Introduction
The main purpose of this article is to determine the asymptotic number of quartic dihedral fields with bounded conductor. If L denotes a quartic field whose normal closure M over Q has Galois group Gal(M/Q) isomorphic to the group of symmetries of a square, we refer to L as a D 4 -quartic field. Furthermore, there is a unique (up to conjugacy) irreducible 2-dimensional Galois representation ρ M : Gal(Q/Q) → GL 2 (C) that factors through Gal(M/Q) ∼ = D 4 . We define the conductor of L to be equal to the Artin conductor of ρ M (see [7,). Understanding the distribution of number fields with fixed signature and Galois group is a fundamental question in number theory with several significant applications. For example, the inverse Galois problem follows from understanding the main terms for the asymptotic number of field extensions of each fixed degree and Galois closure over a given base field. Furthermore, if the results are refined enough to determine the asymptotic number of field extensions satisfying certain local specifications, then another application of counting number fields is towards understanding the distribution of torsion in class groups of number fields of fixed degree, i.e., to proving cases of the Cohen-Lenstra heuristics [11] as well as the extensions given by Gerth [17], Cohen-Martinet [12], and Malle [24].
There are heuristics (see Conjecture 1.2 of [8]) for the order of growth for the number of field extensions of each fixed degree and Galois closure over a given base field when the extensions are bounded by their (norms of the relative) discriminants, due to Linnik, Malle, and Türkelli. Linnik predicted that the number N Sn (X) of S n -degree n number fields with discriminant bounded by X satisfies N Sn (X) ∼ c n X, for some constant c n as X → ∞. Additionally, the heuristics of Malle [23] imply that the proportion of degree-n fields with Galois closure S n amongst all degree-n fields is expected to be 100% only when n is a prime. Cohen-Diaz y Diaz-Olivier [9] verified a case of the strong Malle conjecture in the quartic dihedral case by proving that the number of D 4 -quartic fields with discriminant bounded by X is asymptotically equal to cX, where c ≈ .052326.
Cohen-Diaz y Diaz-Olivier [9] prove their result by determining the asymptotic number of quadratic extensions of quadratic fields ordered by discriminant, a 100% of which are D 4 -quartic fields. They show that the number of totally real D 4 -quartic fields with absolute discriminant bounded by X is asymptotically equal to cX, where Our results imply that the number of totally real D 4 -quartic fields with conductor bounded by X is asymptotically equal to a similar sum: However, the methods to prove (1) and (2) vastly differ. When ordering by discriminant, only the summation terms in (1) indexed by quadratic fields K of small discriminant contribute to the main term of the asymptotics. However, when ordering by conductor, quadratic fields K in every range of the discriminant contribute to the main term. In particular, we must evaluate the contribution coming from quadratic extensions L of quadratic fields K where Nm L/K (Disc(L/K)) is small relative to the discriminant of K. As a consequence, the analytic methods used by [9] are insufficient in our case.
In addition to proving that (2) holds, we establish an explicit formula for the main term of the asymptotic: Theorem 2. We have the following: In conjunction with (2) (and the anologous statements for the non totally real splitting types), Theorem 2 implies Theorem 1. We are also able to determine refined asymptotics for families of D 4 -quartic fields with certain prescribed local specifications, but to describe these results, we must first introduce some notation.
We say that Σ = (Σ v ) v is a collection of local specifications, if for each place v of Q, Σ v contains pairs (L v , K v ) consisting of anétale algebra L v of Q v of degree 4 along with a quadratic subalgebra K v . We say that such a collection Σ is acceptable if for all but finitely many primes p, the set Σ p contains all pairs (L p , K p ) with conductor indivisible by p 2 . Here, the conductor C of such a pair is equal to C(L p , K p ) := Disc(L p )/ Disc(K p ), and we also let C p denote the p-part of C. Such a collection Σ is said to be complete, if for each place v and each splitting type ς, the set Σ v contains either all or none of the pairs (L v , K v ) having splitting type ς. If L(Σ) denotes all D 4 -quartic fields L such that L ⊗ Q v ∈ Σ v for all v, and N D4 (Σ, X) denotes the number of isomorphism classes of D 4 -quartic fields in L(Σ) whose conductor is bounded by X, we then have: Theorem 3. If Σ = (Σ v ) v is an acceptable and complete collection of local specifications such that Σ 2 contains every degree 4étale algebra of Q 2 containing a quadratic subalgebra, then where for all v, Aut(L v , K v ) consists of the automorphisms of L v which send K v to itself.
In previous results of Gauss, Davenport-Heilbronn [14] and Bhargava [2,4], the constant c n of the main term of the asymptotic number of S n -degree n number fields (for n ≤ 5) can also be explicitly given as a mass formula, i.e., the constants c n take the form of an Euler product of local masses. In [3], Bhargava predicted the constants c n for all n, explicitly describing them in terms of Euler products of local masses derived from the heuristic assumption that the completions of S n -degree n number fields at different places behave independently of one another. The constant determined in Theorem 3 is completely analogous to the constants c n,Σ predicted in Equation 4.2 of [3]. However, the analogous product of local masses for D 4 -quartic fields ordered by discriminant is not equal to the constant c computed in [9]; in other words, the analogue of Theorem 3 when ordering by discriminant is false! The existence of mass formulae when ordering by invariants other than the discriminant has been studied by Kedlaya [20], Wood [29], and Johnson [18], building on work of Mäki [22]. However, the question remains: Question 4. Let G denote a finite group, and let C be a virtual conductor 1 for G. A G-number field K is a normal field extension of Q with Galois group Gal(K/Q) = G. Does the product of local C-masses for the weighted number of G-étale algebras of Q p over all places p predict the asymptotic number of G-number fields ordered by C?
This question for abelian G has been studied extensively by Wood in [31], in which a sufficient condition for answering Question 4 in the affirmative is given for C. For non-abelian G, the only conductors C for which both the main term and the constant have been explicitly obtained correspond to discriminant functions (see [14,2,4,6]). On the other hand, we show that the result of [9] in which D 4 -quartic fields are ordered by their discriminants gives a negative answer to Question 4 (see Equation 11); however, Theorem 3 gives an affirmative answer when ordering D 4 -fields by their (2-dimensional) conductors. Moreover, Theorem 3 is the first non-abelian case that answers Question 4 for a conductor C that does not arise as a discriminant function. Overall, the choice of invariant appears to be a subtle issue when determining asymptotics for families of G-number fields.
Theorem 3 allows us to compute the asymptotic number of order 4 elements in class groups and narrow class groups of quadratic fields ordered by discriminant. Such elements in the class groups of a quadratic field K determine D 4 -quartic fields L whose normal closures over Q contain K as the fixed field of C 4 . We obtain the following theorem by determining asymptotics for the acceptable collection of D 4 -quartic fields that arise in this manner, even when we restrict the set of quadratic fields by imposing local specifications at a finite set of primes. We remark that it is crucial for the below result that we order D 4 -quartic fields by conductor and furthermore, that we can impose acceptable local specifications at infinitely many primes.
Theorem 5. For a quadratic field K, let Cl 2 k (K) (resp. Cl + 2 k (K)) denote the 2 k -torsion subgroup in its ideal class group Cl(K) (resp. narrow class group Cl + (K)). Let K denote a family of quadratic fields with prescribed splitting types at a finite set S consisting of odd primes. We then have: (# Cl + 4 (K) − # Cl + 2 (K)) ∼ Here, m Cl (p) is determined in terms of the prescribed splitting type for p ∈ S: if p ramifies, and m Cl (p) := p 2p + 2 otherwise.
The above result is a generalization of work of Fouvry-Klüners [16] that is derived from their own previous results [15] completely verifying Gerth's extension [17] of the Cohen-Lenstra heuristics to the 4-rank of the narrow class group of quadratic fields. In [15], Fouvry-Klüners compute all moments for the 4-ranks of narrow class groups of quadratic fields ordered by discriminant. In conjuction with those results, Theorem 5 gives evidence towards the belief that the 4-ranks and the sizes of 2-torsion subgroups in class groups and narrow class groups of quadratic fields behave independently (see Remark 9.6).
As a byproduct of the methods used to obtain (2), we also prove a refinement of Theorem 2 that allows for imposing local specifications at a finite number of primes. Theorem 6. Let K denote a set of quadratic fields with prescribed splitting types at a finite set S of odd primes. We then have: where m(p) is determined in terms of the prescribed splitting type for p ∈ S: if p is ramified.
We next summarize the arguments for proving the main results. First, to establish Theorem 2, we use the fact that for a quadratic field K, L(1,K/Q) L(2,K/Q) can be written as a product of infinite sums simply using Möbius inversion: where χ K is the quadratic character associated to K. The proof then relies on the following observation: weighting this product by Disc(K) −1 , the main contribution when summing over quadratic fields K with bounded discriminant as in (2) comes from certain diagonal terms of the right hand side of (3), i.e., terms where mn is a square. For each K, the sum of these diagonal terms is expressible as an Euler product (see Equation 21), which then yields Theorem 2.
If we were to instead weight the product in (3) by Disc(K) −2 when summing over all quadratic fields K as in (1), then the non-diagonal terms are no longer negligible. It is these terms that cause the constant c to fail Question 4; in fact, we show that the sum over quadratic fields with discriminant bounded by X of the diagonal terms in the right hand side of (3) weighted by Disc(K) −2 is asymptotically equal to 3 · 11 2 2 6 · 17 · p 1 + 1 which is equal to the mass formula predicted for the number of D 4 -quartic fields of bounded discriminant (see Theorem 5.4). Before discussing the proof of Theorem 1, we describe the differences in obtaining (2) and (1) as in Corollary 1.2 of [9]. Because of the convergence of K Disc(K) −2 when K runs over all quadratic fields, the main contribution to the sum in (1) comes from the terms indexed by K with Disc(K) < X 1/2 , i.e., quadratic fields with small discriminant relative to X. However, this is not the case for the sum in (2); furthermore, the combination of Kummer theory and L-function methods utilized in [9] to prove (1) can only be used to determine the asymptotic number of D 4 -quartic fields with conductor bounded by X whose quadratic subfield has small discriminant relative to X (see Theorem 4.3). Additionally, adapting the geometry-of-numbers techniques of [2] in combination with Wood's parametrization of quartic rings with a quadratic subring [30] is also limited to counting D 4 -quartic fields whose quadratic subfields have small discriminant.
Nevertheless, we obtain Theorem 1 and subsequently (2) by employing algebraic properties of the conductor C(L) of a D 4 -quartic field L, namely that it is invariant under the outer automorphism φ of D 4 . More precisely, φ acts on the Galois group of the normal closure M over Q of L, and the fixed field of φ(Gal(M/L)) is another D 4 -quartic field φ(L) in M which is not isomorphic to L. The conductors of L and φ(L) coincide (even though their discriminants do not). Moreover, we relate the discriminants of K and φ(K) using the central inertia of L (see Definition 2.3). We prove (see Proposition 2.6) and we use this phenomenon to obtain N (r2) D4 (X) from the asymptotic number of D 4 -quartic fields ordered by conductor whose quadratic subfield has small discriminant by employing a simple sieve.
The proof of Theorem 1 does ultimately rely on both the analytic techniques of [9] used to count D 4quartic fields by discriminant as well as the geometry-of-numbers methods used to count S 4 -fields as in [2]. Either can be used to obtain asymptotics for D 4 -quartic fields of bounded conductor whose quadratic subfield has small discriminant, but the sieve used to determine the asymptotics of N (r2) D4 (X) from counting such D 4 -quartic fields requires two ingredients: first, uniform error estimates on the number of such D 4quartic fields having large central inertia, and second, asymptotics for the number of such D 4 -quartic fields with prescribed ramification conditions. We are able to obtain the former using analytic methods and the latter using geometry-of-numbers techniques. This method of proof allows us to count D 4 -quartic fields with prescribed splitting and ramification conditions yielding Theorems 3 and 5. Additionally, Theorem 3 in conjunction with Theorem 4.3 and p-adic density computations (see Proposition 6.7) implies Theorem 6.
The analytic methods used to prove (2) show up frequently when studying asymptotics for the number of extensions of a family of number fields of fixed degree, including when determining Malle's conjecture for D 4 -octic fields ordered by discriminant, computing the asymptotic number of S 3 -fields ordered by the radical of its discriminant, or calculating the asymptotic number of octic fields with Galois group equal to the quaternion group ordered by its (2-dimensional) Artin conductor. Additionally, in order to attack number field asymptotics for larger Galois groups as in the case of S 6 -sextic fields, utilizing algebraic inputs such as an outer automorphism in order to transfer problems of great analytic difficulty to ones that can be approached using standard methods will be crucial. This paper is organized as follows. First, we summarize basic arithmetic properties of D 4 -quartic fields and their invariants in Section 2, including a table of the splitting behavior of primes in D 4 -quartic fields depending on their inertia and decomposition group. We explicitly relate the conductors and quadratic discriminants of D 4 -quartic fields L and φ(L). Next in Section 3, we further develop the method of [3,20,29] and simultaneously obtain heuristics for families of D 4 -quartic fields ordered in multiple different ways. We begin counting D 4 -quartic fields with bounded invariants in Section 4. Using the analytic methods of [9], we obtain asymptotics for the number of such fields with small quadratic discriminant in terms of a sum of ratios of L-values. By isolating the diagonal terms, we prove Theorem 2 in Section 5. In Section 6, we recall Wood's parametrization of quartic rings with a quadratic subrings and adapt it to obtain a modified parametrization of D 4 -quartic fields in terms of certain integral orbits of a coregular representation V for a non-reductive group G. We study the p-adic properties of this representation, including those arising from the outer automorphism φ. We then use geometry-of-numbers methods in Section 7 to count integral orbits of G on V having bounded invariants. Using the results and methods from Sections 4, 6, and 7, we obtain crucial uniformity estimates in Section 8 that will be necessary to carry out the various requisite sieves. Finally, in Section 9, we prove the main theorems by using the analytic results of Sections 4, 7, and 8, in conjunction with the algebraic properties of the outer automorphism φ proved in Sections 2 and 6.

General properties of D 4 -quartic fields
Recall that D 4 denotes the order-8 group of symmetries of a square, and a D 4 -quartic field is a degree-4 field extension of Q whose normal closure has Galois group D 4 over Q. We let σ denote a 90 • -rotation of a square and τ denote a reflection of a square so that The group D 4 has nontrivial center Z(D 4 ) = {1, σ 2 }.

Automorphisms of D 4 and the Galois theory of D 4 -quartics
We first describe important group-theoretic properties of D 4 as well as their applications to D 4 -quartics via Galois theory. Recall that the inner automorphism group D 4 /Z(D 4 ) is isomorphic to the Klein four group V 4 , but the full automorphism group is isomorphic to D 4 (see pgs. 83-85 of [27]). The non-trivial outer automorphism φ of D 4 has order 4 and can be described explicitly by Let L 1 be a D 4 -quartic, and denote its normal closure by M so that Gal(M/Q) = D 4 . Below, we describe a subfield diagram of M corresponding to the subgroup lattice of D 4 : Here, a subgroup G of D 4 and a subfield Definition 2.1. If L 1 is a D 4 -quartic with Galois closure M over Q, then we denote by φ(L 1 ) the quartic subfield of M fixed by φ(Gal(M/L 1 )). If K 1 denotes the quadratic subfield of L 1 , then we denote by φ(K 1 ) the quadratic subfield of M fixed by φ(Gal(M/K 1 )).

Arithmetic of D 4 -quartics
We now describe the splitting behavior of primes in D 4 -octic fields M and their subfields. Definition 2.2. If F is a number field, then the splitting type ς p (F ) at p of F satisfies Similarly, if R is a ring, then the splitting type ς p (R) at p is equal to (f e1 1 f e2 2 . . .) if and only if Let D p denote the decomposition group of p in Gal(M/Q), and let I p denote the inertia subgroup of D p . For an arbitrary prime p, we determine the splitting type of M and all of its subfields using the notation described in (5) depending on the choices for D p and I p in the table below.  We briefly recall how to compute the above table. 2 First, any subgroup can potentially be a decomposition group D p . However, since all decomposition groups are only defined upto conjugacy, in Table 1, we only enumerate conjugacy classes of subgroups. On the other hand, the inertia group I p must be a normal subgroup of D p such that D p /I p is cyclic of order prime to p. Moreover, if I p I p is the second ramification group (which, by definition, is trivial if and only if the ramification is tame), then I p /I p must be a product of cyclic groups of order p. When the Galois group is equal to D 4 , this allows us to fully enumerate the possibilities for pairs I p D p .
To compute the entries of Table 1, let K ≤ L ≤ M be a tower of number fields with M normal over K . Let G = Gal(M/K ) and let H = Gal(M/L ). Let p be a prime of K and let D p be a decomposition group of p (defined up to conjugation) and let I p D p be the corresponding inertia group. Then the primes above p in L are in one-to-one correspondence with the orbits of D p on H\G. For a given D p -orbit, the ramification index e of the prime it corresponds to is the size of an I p -orbit therein and the inertia degree f is the number of such suborbits. (Note all such suborbits have the same size since I p is normal in D p .) To compute all the values in Table 1, we have an example script available at https://github.com/khwilson/D4Counting.
In Table 1, the first group consists of unramified splitting types, the second and third groups consist of tamely ramified splitting types, and the fourth group consists of wildly ramified splitting types. In particular, the splitting type of an odd prime p must appear in the first three groups of Table 1. We distinguish between the tamely ramified splitting types depending on whether the center σ 2 of D 4 is contained in I p .
Note that if M and K are as in (5), the extension M/K is ramified at a prime p if and only if (L 1 , K 1 ) has central inertia at p.
By analogy, we define splitting types at ∞. If K is any quadratic field and L is any quartic field, we write

Invariants of D 4 -quartics
Next, we compare the Artin conductor of a D 4 -quartic L 1 to the discriminant of L 1 as well as the products of the discriminants of certain subfields of the normal closure of L 1 . Additionally, we define two fundamental invariants and a slightly refined conductor that partially recovers the splitting type of L 1 at ∞.
If Gal(Q/Q) denotes the absolute Galois group of Q, and M is the normal closure of L 1 as in (5), then there is a (unique up to conjugacy) irreducible 2-dimensional Galois representation Proposition 2.4. Let L 1 denote a D 4 -quartic with normal closure M , and let K 1 be its quadratic subfield. We then have: Proof. The proposition will follow from the fact that the representation Ind Since σ swaps the two basis elements of V 1 while τ and σ 2 act trivially, V 1 can be identified with Ind D4 τ,σ 2 1.
Furthermore, one can see that V 2 is irreducible, and it is well-known that there is a unique irreducible 2-dimensional representation of D 4 . Now, if M is the normal closure of L 1 as in (5) and ρ denotes the Galois representation constructed by composing Ind D4 τ 1 with Gal(Q/Q) Gal(M/Q), then its Artin conductor satisfies Cond(ρ) = | Disc(L 1 )|.
Definition 2.5. The (signed) conductor C(L 1 ) of a D 4 -quartic L 1 whose quadratic subfield is denoted by K 1 is defined as From the definition of the conductor and Proposition 2.4, it follows immediately that two D 4 -quartics L 1 and L 2 with the same normal closure M have the same conductor. Furthermore, if L 1 has no central inertia, then C(L 1 ) = Disc(K 1 ) · Disc(φ(K 1 )). More precisely, if L is a number field and p is a prime number, let Disc p (L) denote the p-part of the discriminant, and let C p (L) be the p-part of the conductor. We then have: Proposition 2.6. If L 1 is a D 4 -quartic with quadratic subfield K 1 , then for all odd primes p: Proof. We refer to the notation described in (5), where φ(K 1 ) = K 2 . Table 1 shows that if I p = σ 2 , then Disc p (K 2 ) = Nm K1 (Disc p (L 1 /K 1 )). Thus, C p (L 1 ) = Disc p (K 1 ) · Disc p (K 2 ). However, when I p = σ 2 , Table  1 implies that Disc p (K 1 ) = Disc p (K 2 ) = 1, but Nm K1 (Disc p (L 1 /K 1 )) = Nm K2 (Disc p (L 2 /K 2 )) = p 2 . Thus, we have that C p (L 1 ) = p 2 · Disc p (K 1 ) · Disc p (K 2 ).
We are now ready to define the two fundamental invariants of a D 4 -quartic.
Definition 2.7. If L 1 is a D 4 -quartic with quadratic subfield K 1 , define the fundamental invariants of L 1 : Remark 2.8. For a D 4 -quartic L 1 , there is a global restriction on the integers q(L 1 ) and d(L 1 ), namely that they are each congruent to 0 or 1 mod 4. Both of these are due to (a generalization of) Stickelberger's Theorem, though we note that |q(L 1 )| = | Nm K1 (Disc(L 1 /K 1 ))| requires carefully dealing with infinite places of relative discriminants. See [25] for details.
Proposition 2.4 can be reformulated as for a D 4 -quartic L 1 and L 2 = φ(L 1 ) as in (5). Define and for a prime p, let J p (L 1 ) denote the p-part of J(L 1 ). Proposition 2.6 determines that for an odd prime p, J p (L 1 ) is equal to p 2 if and only if the inertia group I p at p is equal to σ 2 ⊂ D 4 . Note that it is always true that J(L 1 ) = J(φ(L 1 )). Furthermore, it will not be necessary in what follows to compute J 2 ; it will be enough that J 2 is absolutely bounded.

Heuristics for counting D 4 -quartics by conductor
In [3], Bhargava developed heuristics for the asymptotics of the number of S n -fields of degree n ordered by discriminant. The framework used to formulate these heuristics was expanded by Kedlaya [20] for families of Galois representations ordered by their Artin conductor. Additionally, Wood [29] predicted asymptotics (including mass formulae for the constants) for fixed-degree families of number fields whose normal closures have a fixed Galois group when such fields are ordered by invariants including the conductor. In this section, we adapt their heuristics to the family of D 4 -quartics ordered by our two fundamental invariants, q and d (see Definition 2.7). We recover the predictions in [29] for the number of D 4 -quartics ordered either by conductor or discriminant, and we additionally verify that the conjectured mass formula when ordering by discriminant is not equal to the constant c determined by Cohen-Diaz y Diaz-Olivier in [9].

The expected number of D 4 -quartics with fixed fundamental invariants
Let v be a place of Q, and let K v ⊂ L v beétale algebras of Q v of degrees 2 and 4, respectively. When v corresponds to a finite prime p (resp. infinity), we say that such a pair (L v , K v ) is compatible with a pair of integers (q, d) if the p-parts (resp. signs) of Nm Kv (Disc(L v /K v )), the norm in Q v of the relative discriminant of L v over K v , and Disc(K v ), the discriminant of K v , agree with the p-parts (resp. signs) of q and d, respectively. Note that when q > 0, d can be positive or negative; however, when q < 0, d must be positive, otherwise no such compatible pairs (L ∞ , K ∞ ) exist. Given a place v of Q and integers q and d, let where Aut(L v , K v ) is the group of automorphisms of L v that restrict to endomorphisms of the subalgebra K v . The following result evaluates E v (q, d) for all places v.
Proposition 3.1. We have: (1) If q and d are nonzero, then E ∞ (q, d) = 1/4 when at least one of q or d is positive.
(3) The values of E 2 (q, d) are given below. Proof. The proof is by direct computation. For p = ∞, the result is immediate. For p odd, we note that as there is no wild ramification, the computation of q and d depend only on the Galois, decomposition, and inertia groups of the component fields of K v and L v . However, it turns out this enumeration depends only on whether p ≡ 1 (mod 4). Explicitly, for odd primes p, Kummer theory implies that the quadratic extensions of a p-adic field K are in one-to-one correspondence with the nontrivial square classes K × /(K × ) 2 . Combined with Hensel's Lemma, we conclude that for each odd prime p, there are exactly three possible quadratic extensions of any p-adic field K corresponding to adjoining the square root of u, π, and uπ, where u is a (lift of a) quadratic nonresidue in O K and π is a uniformizer.
For odd primes, this implies that there are up to 3 × 3 = 9 possible quartic fields L v which could be extensions of K v . However, many of these fields are actually isomorphic as fields over Q p . The number of possible isomorphism classes (and their associated automorphisms, decomposition groups, and inertia groups) turns out to only depend on the value of p mod 4.
Explicitly, the unramified quadratic extension K 0 of Q p has three quadratic extensions, one of which is Q p ( √ u ) where u is a quadratic nonresidue in K 0 is unramified and has Galois group C 4 . Another is field with decomposition group equalt to the inertia group the group that fixes K 0 . The final extension is Q p ( √ u p) is ramified and has Galois group C 4 and decomposition group equal to the inertia group C 2 ≤ C 4 . This leaves 2 × 2 = 4 possible quartic extensions of Q p . Hensel's Lemma directly implies that the possible fields are given by , and Q p ( 4 √ −8p). If p ≡ 1 (mod 4) then x 4 − 1 has four distinct roots in the residue field F p of Z p and these are distinct fields, each with Galois group, decomposition group, and inertia group C 4 . On the other hand, when p ≡ 3 (mod 4), x 4 − 1 has two solutions, and none of these fields are Galois and thus are D 4 fields. The fields Q p ( 4 √ x) and Q p ( 4 √ −4x) are isomorphic. The decomposition group is all of D 4 and the inertia group the rotation subgroup σ 2 .
At p = 2, the number of quartic extensions of Q p is much larger, and wild ramification makes the computation of q and d much more complicated. However, a database of local fields, e.g., [21,19], can be used. The details of the computation can be found at http://github.com/khwilson/D4Counting.
The framework in [3,29] depends on the basic heuristic assumption that for a family of number fields of fixed degree and fixed associated Galois group, the completions at different places behave independently of one another. This implies that the expected number of such number fields having given invariants is equal to the infinite product over all places v of Q of the weighted number of local extensions of Q v that are compatible with those invariants. More precisely: denotes the expected number of isomorphism classes of D 4 -quartics with fundamental invariants equal to q and d, we assume The extra factor of 1 2 above arises from two issues: (1) there is a global restriction on the invariants q and d (see Remark 2.8), which occurs 1 4 of the time, and is not taken into account by the local masses, and (2) the product of the local masses E v (q, d) determines the expected weighted number of D 4 -quartics with invariants q and d, where a D 4 -quartic L is weighted by # Aut(L) −1 = 1 2 .

Predictions for the global distribution of D 4 -quartics using double Dirichlet series
To determine the asymptotics of E(q, d), we study the behavior of the double Dirichlet series which converges absolutely for s, t > 1. Since there are three possible sign configurations for the pair of integers (q, d), the archimedean contribution to ξ(s, t) is exactly 3/4. Additionally, 2·E(q, d) is multiplicative with respect to both q and d, and so it follows from Proposition 3.1 that ξ(s, t) can be expressed as Define the correction factor at 2 to be We can rewrite ξ(s, t) as Therefore, the function ξ(s, t) is holomorphic in the region t > 1 2 , s > 1 3 aside from poles at the lines s = 1 and t = 1.

Heuristics
We now consider families of D 4 -quartics under different orderings. If X and Y be positive real numbers going to infinity, let E q,d (X, Y ) denote the expected number of isomorphism classes of D 4 -quartics L such that |q(L)| < X and |d(L)| < Y , i.e.
Then, by computing the residue of ξ(s, t) at (1, 1), we obtain the heuristic Here, the correction factor ξ 2 (1, 1) = 1. Note that this heuristic only relies on the Assumption 3.2. If we were to take (8) as a definition, then we have completely verified the main term (9), and we can additionally obtain a power-saving.
Heuristics for the family of D 4 -quartics ordered by conductor Next, we consider the family of D 4 -quartics ordered by conductor. Let E C (X) denote the expected number of isomorphism classes of D 4 -quartics L such that |C(L)| < X. If we let E(C) denote the expected number of D 4 -quartics with conductor C, then we have since C(L) = q(L)d(L). The function ξ(s, s) has a double pole at 1 and, by computing its residue, we obtain The correction factor at 2 is again ξ 2 (1, 1) = 1.

Heuristics for the family of D 4 -quartics ordered by discriminant
Finally, we consider the family of D 4 -quartics ordered by discriminant. Let E Disc (X) denote the expected number of isomorphism classes of D 4 -quartics L such that | Disc(L)| < X. If we let E(Disc) denote the expected number of D 4 -quartics L with discriminant equal to Disc, then we have The function ξ(s, 2s) has a simple pole at 1 and, by computing the residue, we obtain In this case, the correction factor at 2 is ξ 2 (1, 2) = 11 2 /(17 · 2 3 ).
Cohen-Diaz y Diaz-Olivier showed in Proposition 6.2 of [9] that the number of D 4 -quartics having discriminant bounded by X is ∼ cX where c ≈ 0.052, whereas the constant on the right hand side of (11) is ≈ 0.406. This implies that when ordering D 4 -quartics by discriminant, the completions of such fields at different primes do not behave independently of one another in the sense of [3], and so Assumption 3.2 is false.

Counting D -quartics using analytic methods
In this section, we obtain asymptotics for the number of D 4 -quartics, ordered by conductor, whose quadratic subfield has small discriminant, following the methods of Cohen-Diaz y Diaz-Olivier [9] where similar asymptotics for the number of such D 4 -quartics ordered by discriminant are determined. By refining their arguments, we are able to count D 4 -quartics of bounded conductor whose quadratic subfields have small discriminant and satisfy a prescribed set of splitting conditions at a finite number of primes. We begin with a few definitions before giving the precise statement of the main theorem of the section.
If L is a D 4 -quartic and K denotes its (unique) quadratic subfield, then C(L, K) = C(L).
We refine the notion of a collection of local specifications described in the introduction.
)} be the set of all pairs consisting of a possible splitting type for a place v in a D 4 -quartic L and a consistent splitting type at v for its quadratic subfield K. We refer to a collection Σ = Definition 4.2. A set of local specifications Σ = (Σ v ) v is stable if for every prime p and every quadratic splitting type ς p (equal to either (11), (2), or (1 2 )), the set Σ p either contains all possible pairs ( * , ς p ) or none of them.
Similarly, let K(Σ) denote the set of quadratic subfields of L(Σ). Note that when Σ is stable, the set L(Σ) consists of all D 4 -quartics that are quadratic extensions of all the fields in K(Σ).
For a set of local specifications Σ, let N C (Σ; X, Y ) be the number of isomorphism classes of D 4 -quartics L ∈ L(Σ) such that |C(L)| < X and |d(L)| < Y . Additionally, set N C (X, Y ) := N C (Σ full ; X, Y ). In this section, we compute asymptotics for N C (Σ; X, X β ) when Σ is stable and β < 2/3. More precisely, our goal is to prove the following theorem: Theorem 4.3. Let Σ be a stable set of local specifications. Then, for every β < 2/3, we have We do so by first demonstrating that the number of quadratic extensions of quadratic number fields that are not D 4 -quartic fields is negligible, thus we can compute N C (Σ; X, X β ) in terms of these towers of quadratic extensions. In [9], the authors define a Dirichlet series for each quadratic field K whose residue at s = 1 is shown to be equal to the number of quadratic extensions of K. We then carry out a smooth count for the quartic fields in L(Σ) that are quadratic extensions of K and subsequently obtain the theorem by summing over all K ∈ K(Σ).

Quadratic extensions of quadratic number fields
If L is a quadratic extension of a quadratic field K, then L is either a D 4 -quartic or it is Galois with Gal(L/Q) = C 4 or V 4 . In the following lemma, we prove a bound for the number of pairs (L, K) having bounded conductor, where L is a Galois quartic field and K is a quadratic subfield of L having small discriminant.
Lemma 4.4. Let β < 1 be fixed. The number of pairs of (L, K), where L is a Galois quartic field, K is a quadratic subfield of L, the conductor C(L, K) < X, and | Disc(K)| < X β is bounded by O (X (1+β)/2+ ).
Proof. Let (L, K) be a pair satisfying the conditions of the lemma. By the relative discriminant formula, we have It is known from §2.4 and §2.5 of [10] that the number of Galois quartic fields whose discriminant have absolute value less than X is bounded by O (X 1/2+ ). The lemma follows immediately.
For stable Σ, we can thus prove Theorem 4.3 by counting the number of quadratic extensions over quadratic fields in K(Σ) whose relative discriminants have bounded norm. To this end, we consider the Dirichlet series Φ K,2 (s) = Φ K,2 (C 2 , s) defined in [9] for any number field K as where r 2 (K) denotes the number of pairs of complex embeddings of K, c runs over all integral ideals of K dividing 2, χ runs over all quadratic characters of the ray class group modulo c 2 , and L K (s, χ) is the L-function of K for χ. It is also proven in Corollary 1.2 of [9] that the rightmost pole of Φ K,2 (s) is at s = 1 with residue given by We can then obtain "smooth counts" of the number of quadratic extensions of quadratic fields K: Lemma 4.5. Let ϕ be a smooth compactly supported function ϕ : R ≥0 → R ≥0 . If K is quadratic, then where ω(d) denotes the number of prime divisors of d, and Vol(ϕ) denotes ϕ(t)dt.
Proof. Letφ denote the Mellin transform of ϕ. By Mellin inversion, we see that the left hand side of the above equation is equal to Shifting the line of integration to Re(s) = 1/2 + , we pick up the main term from the pole at 1 sincẽ ϕ(1) = Vol(ϕ). The error term follows by using the convexity bound of O (| Disc(K)| 1/4+ ) near s = 1/2 at each of the O 2 ω(Disc(K)) L-functions used to define Φ K,2 (s).
The next lemma, whose proof is very similar to that of Lemma 4.5, gives a bound when imposing ramification on the quadratic extensions of a fixed quadratic field K and will only be used in §8: Lemma 4.6. If K is a quadratic field and f is a squarefree product of prime ideals in K, then the number of quadratic extensions L over K such that Nm K (Disc(L/K)) < X and every prime dividing f ramifies in L is bounded by Proof. We can (and do) assume that f is odd. Since an upper bound for the number of quadratic extensions of K can be obtained with a smooth sum, we proceed as in the proof of Lemma 4.5. The only difference is that we use, instead of Φ K,2 (s), the Dirichlet series Φ K,2,f (s) corresponding to extensions L of K that are ramified at every prime dividing f: where the notation is as in the definition of Φ K,2 (s). Since the residue of Φ K,2,f (s) at 1, its rightmost pole, is L(1, K/Q)/ Nm(f), the lemma follows from an argument identical to the proof of Lemma 4.5.

Proof of Theorem 4.3
We are now ready to prove the main result of this section. From Lemma 4.4, it follows that we may estimate N C (Σ; X, X β ) by counting quadratic extensions L of quadratic fields K. Let The factor of 1/2 in the right hand side of (14) is to account for the fact that a D 4 -quartics L and its conjugate L both contribute to the inner sum, while the left hand side of (14) counts D 4 -quartics up to conjugacy. For > 0, choose ϕ ± to be smooth compactly supported functions such that ϕ ± − χ [0,1] takes values in R ± and such that Vol(ϕ ± ) = 1 ± . Lemma 4.5 together with (13) implies that In the above equation, the left hand side corresponding to ϕ + (resp. ϕ − ) is an upper bound (resp. lower bound) for N C (Σ; X, X β ). Meanwhile the error term on the right hand side is bounded by O (X 1 2 + 3β 4 + ) which, when β < 2/3, is bounded by o(X). Therefore, Theorem 4.3 follows by letting tend to 0. 2 Remark 4.7. We note that standard analytic methods (namely, Perron's formula in conjunction with hybrid (sub)convexity bounds on the growth of Hecke L-functions in the critical strip) yield a power saving in the error bound in Theorem 4.3. However, we do not include the arguments since they will not be necessary for the results of this paper.

Mass formulae for families of D 4 -quartics
We now turn to the proof of Theorem 2. In the previous section, the constant in the asymptotic number of D 4 -quartics with bounded conductor whose quadratic subfield has small discriminant was determined as a sum of L-values. In §5.1 and §5.2, we prove an identity relating the constant in Theorem 4.3 to an Euler product matching the predicted mass formula described in §3.3 by proving that the main contribution of the sum in the right hand side of Theorem 4.3 comes from certain diagonal terms. Finally, in §5.3, we study the family of D 4 -quartics ordered by discriminant, and we prove an interesting identity between the analogous diagonal terms and the heuristic predicted by (11).

Isolating the diagonal terms in Theorem 4.3
We first prove a lemma that will be used in bounding the non-diagonal terms when we calculate the sum of L-values that appear in Theorem 4.3 in terms of a weighted Möbius sum.
where · · denotes the Legendre symbol. Proof. The m-sum is absolutely convergent, so we will focus on the n and the D-sums. Interchanging the n and D-sums yields We will now apply a simple squarefree sieve to complete the D-sum and then use the Pólya-Vinogradov inequality to finish the estimate. In particular, we can rewrite (15) as Thus, (15) is bounded by The last equality follows from the fact that for sufficiently small, 1 2 The lemma then follows from the absolute convergence of m − 3 2 .
The next result is the key input in obtaining the mass formula. Using Lemma 5.1, we rewrite the sum of L-values appearing in Theorem 4.3 in terms of a weighted Möbius sum that we will later show is equal to an Euler product. When ordering D 4 -quartics by discriminant, there is no known analogue to Proposition 5.2.
Proposition 5.2. We have: Proof. Let χ K denote the quadratic character associated with K by class field theory so that we have n . From the absolutely convergent Euler product, it is straightforward to see that L(2, K/Q) > (ζ(4)/ζ(2)) 2 > 0, and hence 1/L(2, K/Q) is uniformly bounded independent of K. Using partial summation and the Pólya-Vinogradov inequality, for any > 0 we get Thus, we can conclude that Using (17), the left hand sides of (16) are equal to In either case, the sum of the O terms is itself O (1), and so we focus on the remaining term. Using the absolute convergence of the Euler product of L(2, K/Q) −1 , we have The key observation we make is that the main contribution to the right hand side of (19) comes from the "diagonal" terms, i.e., when mn is a square. By pulling out these terms, we may rewrite (19) as Substituting (20) back into (18) implies that the left hand sides of (16) are equal to By Lemma 5.1, Noting that the remaining term does not depend on , we obtain the proposition.

Proof of Theorem 2
We now turn to the proof of Theorem 2. From the identity we immediately obtain: Decomposing the right hand sides of (22) into sums over squarefree integers in a fixed congruence class mod 4, we obtain that the left hand sides of (22) are equal to Consider the limit Using Perron's formula, for (σ) > 0, we can rewrite the right hand side of (24) as The Euler product, for σ > 0, is equal to Hence, moving the σ contour to the left of (σ) = 0 and using the Cauchy integral formula, we get 3 The main term in the right hand side of (25) simplifies to This, in particular, shows that we can rewrite the limit in (24) as Carrying out the analogous computation for each term in both equations of (23) yields Theorem 2.
It follows from the heuristics of §3.3 that the family of D 4 -quartics L satisfying |d(L)| ≤ |C(L)| 2/3 satisfies the mass formula (10) when such fields are ordered by their conductors. In §6-8, we prove a refinement of Theorem 5.3 by adapting the arguments in [2] in conjunction with the analytic techniques used in Section 4.

Diagonal terms for the family of D 4 -quartics ordered by discriminant
We would like to conclude this section by considering asymptotics for the analogous "diagonal terms" that arise when counting the number of D 4 -quartics having bounded discriminants. Let N Disc (X) denote the number of isomorphism classes of D 4 -quartics L with |Disc(L)| < X. By Corollary 1.4 of [9] (or following the proof of Theorem 4.3 with discriminant in place of conductor), we have Applying the reasoning in the proof of Proposition 5.2, we obtain that combining Equation (19) and (26) implies We replace the product of sums with simply the "diagonal" terms (i.e., the terms where mn is a square). 3 One can in fact obtain a better error term, but it is unnecessary for establishing the results of the current article.
Theorem 5.4. We have the following: Proof. This follows from an argument analogous to the proof of Theorem 2.
The right hand side of (27) agrees exactly with the heuristic in (11)! The non-diagonal terms, as in §5.2, again give an error term of O(X). In the case when D 4 -quartics were ordered by conductor, this error term was negligible compared to the main term of X log X. This time, however, the main term of X does not automatically dominate the error term. In fact, the comparison of the constant c ≈ 0.0523 from [9] and the constant ≈ 0.406 on the right hand side of (27) implies that the non-diagonal terms do make a non-negligible contribution.

Parameterizing D 4 -quartics via pairs of ternary quadratic forms
We next give a proof using geometry-of-numbers techniques in conjunction with arithmetic invariant theory methods for determining asymptotics on the number of D 4 -quartics with |q| < X and |d| X. We obtain worse error estimates in this second proof, but we are able to prove more refined statements for a wider class of collections of local specifications. We begin with a parametrization of D 4 -quartics via certain pairs of ternary quadratic forms, following Bhargava [1] and Wood [30]. In §6.1, we describe the arithmetic invariant theory for orbits of such pairs of ternary quadratic forms and compare it to the invariants defined in Definitions 2.7 and 2.5 for the corresponding D 4 -quartics. We additionally define splitting types, and we compute the p-adic densities for pairs of ternary quadratic forms corresponding to D 4 -quartics with fixed splitting type at p. These results allow us to employ geometry-of-numbers methods carried out in Section 7 to count the relevant orbits parametrizing D 4 -quartics with |q| < X and |d| X.
In [1], Bhargava proved that isomorphism classes of pairs (Q, C), where Q is a quartic ring and C is a cubic resolvent ring of Q are in bijection with GL 2 (Z) × SL 3 (Z)-orbits on Z 2 ⊗ Sym 2 (Z 3 ), the space of pairs of integral ternary quadratic forms. If Q is a maximal quartic ring, then it has a unique cubic resolvent ring, so this bijection (when restricted to maximal rings) can be viewed as a parametrization of quartic fields. We write a pair of ternary quadratic forms as a pair of symmetric 3 × 3 matrices (A, B) whose diagonal entries are integers and nondiagonal entries are half-integers. The group GL 2 × SL 3 acts on pairs of ternary quadratic forms as follows: (g 2 , g 3 ) · (A, B) = (g 3 Ag t 3 , g 3 Bg t 3 ) · g t 2 . For quartic rings Q containing a quadratic subring, Wood [30] gives a more specialized bijection: For any ring R, let V (R) ⊂ R 2 ⊗ Sym 2 (R 3 ) denote the space of pairs of ternary quadratic forms (A, B) satisfying • Q is a quartic ring over R, • C is a cubic resolvent of Q with map ϕ : Q → C, and • T ⊂ Q is a primitive quadratic subalgebra such that ϕ(T ) = 0.
In order to obtain a parametrization of maximal orders in D 4 -quartics, we first make a few definitions.
and we define the subgroup G(Z) ⊂ G (Z) to be the set of pairs (g 2 , g 3 ) ∈ G (Z) such that Moreover, for any ring R, we analogously define the space V (R) and the group G(R). We have the following proposition: There is a bijection between (isomorphism classes of) D 4 -quartics and maximal generic G(Z)-orbits on V (Z).
Proof. Recall that every D 4 quartic field L has a unique maximal order and that maximal order has a unique cubic resolvent ring as well as a unique primitive quadratic subalgebra. Thus, there is exactly one G (Z) orbit in V (Z) corresponding to L by Theorem 6.1 The above discussion shows that each generic, maximal G (Z) orbit in V (Z) contains an element of V (Z). Moreover, if (A , B ) = (g 2 , g 3 ) · (A, B) for some (A, B) ∈ V (Z) and (g 2 , g 3 ) ∈ G (Z) then B 11 = g 2,22 = 1 and thus (g 2 , g 3 ) ∈ G(Z). Since we only make a claim about maximal orders, this completes the proof.

Invariant theory
We next discuss the invariant theory for the action of G on V . The action of G(C) ∩ SL 3 (C) on V (C) turns out to have ring of invariants freely generated by 3 elements. We can describe these invariants in terms of the cubic resolvent of (A, B), i.e., the binary cubic form det(Ax + By). It is straightforward to check that if (A, B) is as in (28) Additionally, if π : V (R) → U (R) denotes the resolvent map (A, B) → 4 det(Ax + By), then for (g 2 , g 3 ) ∈ G(R), π((g 2 , g 3 ) · (A, B)) = g 2 · π(A, B).
The coefficients b, c, and d of the binary cubic form π(A, B) are the invariants for the action of G(C)∩SL 3 (C) on V (C). Therefore, the ring of invariants for the action of all of G(C) on V (C) is the same as the ring of invariants for the action of N 1 (C) on U (C). The latter ring is freely generated by two elements d and q, which can be associated to an element of V as follows: Proof. Let (A, B) be as in (28) with resolvent f (x, y) = bx 2 y + cxy 2 + dy 3 , and assume that d(A, B) and q(A, B) are nonzero. As described in Section 3 of [1], one can describe the multiplicative structure on a (normal) Z-basis of Q using the matrix coefficients of (A, B). Indeed, if 1, α 1 , α 2 , α 3 is a Z-basis for Q, we can write its multiplication table as The proposition follows.
We slightly generalize the notion of conductor given in the introduction forétale quartic algebras over R. For a pair (Q, T ), where Q is aétale quartic algebra over R and T is a primitive quadratic subalgebra of Q, we set C(Q, T ) := Disc(Q)/ Disc(T ). The following lemma will be useful in obtaining a bound on the number of G(Z)-orbits that correspond to non-maximal D 4 -quartic orders in Section 8. Lemma 6.6. Let p be an odd prime. If (A, B) ∈ V (Z p ) corresponds to a non-maximal quartic order Q contained in a degree 4étale extension L p of Q p and a quartic subalgebra T contained in a quadratic subextension K p of L p , then Proof. Since the index of Q in the maximal order of L is a multiple of p, it follows that the discriminant of (A, B) differs from the discriminant of L by a factor of at least p 2 . Since C(A, B) = Disc(A, B)/ Disc(T ) and C(L p , K p ) = Disc(L p )/ Disc(K p ), the lemma follows unless Disc(T )/ Disc(K p ) is divisible by p, or equivalently, unless T is not maximal in the ring of integers of K p . Assume that T is not maximal in the ring of integers of K p , and thus has discriminant divisible by p 2 . We know from Proposition 6.5 that − Disc(T ) is the discriminant of the quadratic form a 22 y 2 + a 23 yz + a 33 z 2 corresponding to A. Hence, either A is a multiple of p or, after a change of variables, we may assume that p 2 | a 22 and p | a 23 . In the first case, the pair of rings (Q 1 , T 1 ) corresponding to (A/p, B) ∈ V (Z) are over-orders of Q and T such that p 4 | C(Q, T )/C(Q 1 , T 1 ). In the second case, the argument is similar: we use the pair (A 2 , B 2 ) obtained by multiplying the third row and column of A and B by p, and dividing A by p 2 , which yield a pair (Q 2 , T 2 ) of over-orders of (Q, T ) such that p 2 | C(Q, T )/C(Q 1 , T 1 ). The lemma follows.

Splitting types of pairs of ternary quadratic forms
Let p be a fixed prime. We say that a pair (A, B) ∈ V (F p ) is nondegenerate if the zero sets in P 2 (F p ) of the two ternary quadratic forms corresponding to A and B intersect at four points counted with multiplicity. For nondegenerate elements (A, B) ∈ V (F p ) such that A is nonzero, we define the quartic splitting type at p to be , where the f i 's are the degrees over F p of the field of definition of these points, and the e i 's are their multiplicities. Furthermore, recall that the top row and column of A is 0, and so in the notation of (28), A corresponds to a quadratic form g(y, z) = a 22 y 2 + a 23 yz + a 33 z 2 . We define the quadratic splitting type ς p (A, B) of (A, B) to be (11) if g(x, y) has two distinct roots in P 1 (F p ), to be (2) if g(x, y) has a pair of conjugate roots defined over a quadratic extension of F p , and (1 2 ) if g(x, y) has a double root. We then say that the pair (ς p (A, B), ς p (A, B)) is the splitting type of (A, B) at p.
If (A, B) is an element in V (Z) or V (Z p ), we define the splitting type of (A, B) at p to be the splitting type of the reduction modulo p of (A, B), assuming it is nondegenerate. Let Q be the quartic ring corresponding to (A, B), and let T denote the quadratic subring of Q arising from Theorem 6.1. It follows from §4.1 of [1], that the quartic splitting type of (A, B) is equal to the splitting type of Q. We have seen that the quadratic subring T of Q corresponding to the pair (A, B) is the quadratic ring whose discriminant is the same as that of the binary quadratic form corresponding to A. Hence, the quadratic splitting type of (A, B) is the same as the splitting type of T .
Given a pair (L p , K p ) of extensions of Q p , whose rings of integers correspond to a pair (A, B) ∈ V (Z p ), we define ς p (L p , K p ) to equal the splitting type of (A, B). Additionally, there are four possible splitting types ς = (ς ∞ , ς ∞ ) at ∞ for an element in V (R) having nonzero discriminant. The invariants (d, q) of an element v ∈ V (R) (ς) are constrained in the following way: We denote the set of elements in V (R) having splitting type ς by V (R) (ς) and set V (Z) (ς) = V (Z) ∩ V (R) (ς) .
Proposition 6.7 computes the p-adic splitting densities in V . However, it is possible to extract densities that are more refined. From the splitting types with central inertia in Table 1, it is evident that the splitting type of a D 4 -quartic L at a prime p is not enough to determine the decomposition groups of L at p. However, if v ∈ V (Z) corresponds to O L , then the G(Z p )-orbit of v in V (Z p ) determines O L ⊗Z p , and hence determines the decomposition groups of L at p. In the following lemma, we compute some of these more refined densities.
If p is an odd prime with splitting type ((1 2 1 2 ), (11)) (resp. ((2 2 ), (2))) in a D 4 -quartic L with quadratic subfield K, then there are two possibilities for the splitting type (ς p (φ(L)), ς p (φ(K))) of φ(L) at p (see Definition 2.1), namely ((1111), (11)) (resp. ( (22), (11))) or ( (22), (2)). Let M (11) p (ς p , ς p ) (resp. M (2) p (ς p , ς p )) denote the subset of elements (A, B) ∈ M p (ς p , ς p ) corresponding to (Q, T ) under Theorem 6.1 such that φ(Frac(T )) has splitting type (11) (resp. (2)) at p. Lemma 6.8. Let p be an odd prime and let (ς p , ς p ) be one of ((1 2 1 2 ), (11)) or ((2 2 ), (2)). Then with the notation of the previous paragraph, Proof. We prove the lemma only for the splitting type ((1 2 1 2 ), (11)), since the proof is very similar for ((2 2 ), (2)). Let (A, B) ∈ V (Z p ) be a maximal element, corresponding to a degree 4étale Z p -algebra Q and a quadratic subalgebra T , and let L (respectively, K) denote the fraction field of Q (respectively, T ). Assume that the splitting type of (A, B) is ((1 2 1 2 ), (11)), and let f (x, y) = 4 det(Ax + By) denote the cubic resolvent polynomial of (A, B). Then the x 3 -coefficient of f is 0, and dividing f by y yields a binary quadratic form. A direct computation, in conjunction with Propositions 2.6 and 6.5 imply that we have Disc p (f (x, y)/y)/p 2 = Disc p (φ(K)), where Disc p means the p-part of the discriminant and hence, sign issues don't arise. Since the two possible decomposition groups for the splitting type ((1 2 1 2 ), (11)) are determined by the splitting behaviour of p at φ(K) (see Table 1), it follows that the relative densities of these decomposition groups can be computed by computing the relative densities of the different possible splitting behaviours of p in the quadratic order whose discriminant is Disc p (f (x, y)/y)/p 2 . Since p is odd, from the discussion surrounding (31), it follows that we may assume (A, B) satisfies Consider the pair (A, B 1 ), where the B 1 is obtained from B by dividing the b 22 , b 23 , and b 33 by p. Let f 1 denote the cubic resolvent form of (A, B 1 ). By a direct computation and applying (32), the discriminant of f 1 (x, y)/y is exactly the same as the discriminant of φ(K). Hence the decomposition group of L is determined by the splitting of p in f 1 (x, y)/y. Since (A, B) was assumed to be maximal, it follows that p does not divide the discriminant of f 1 (x, y)/y, since, by Table 1, for the splitting types under consideration, φ(K) is unramified at p. It is a direct computation to check that the density of elements (A, B 1 ) such that f 1 (x, y)/y has splitting type (11) (resp. (2)) is exactly 1/2, yielding the lemma.
Let M p denote the set of elements (A, B) ∈ V (Z p ) that are maximal at p, and let U p denote the set of elements (A, B) in M p that do not have central inertia, i.e., the splitting type of any (A, B) ∈ U p at p is not equal to ((1 4 ), (1 2 )), ((1 2 1 2 ), (11)), or ((2 2 ), (2)). Summing the values obtained in Proposition 6.7 we can compute the density of M p . To determine the density of U p , we add up the values of the first 9 rows. Theorem 6.9. We have 7 Counting D 4 -quartics using geometry-of-numbers methods In the previous section, we defined an injective map from D 4 -quartics to G(Z)-orbits on V (Z) and determined generators d and q for the ring of invariants for the action of G on V . In this section, our goal is to count generic G(Z)-orbits on V (Z) having bounded invariants.
Recall that an element v ∈ V (Z) is said to be generic if v corresponds to an order in a D 4 -quartic, and the subset of elements in V (Z) with infinite splitting type ς is denoted by by V (Z) (ς) . For any G(Z)-invariant set L ⊂ V (Z) and for any δ > 0, let N (δ) q (L; X, Y ) denote the number of generic G(Z)-orbits v on L such that X < |q(v)| ≤ (1 + δ)X and Y < |d(v)| ≤ (1 + δ)Y . Our goal in this section is to prove the following theorem: Theorem 7.1. Let X and Y be positive real numbers going to infinity such that Y (log Y ) 2 = o(X). Then we have where τ ς = 8 when ς = ((1111), (11)) or ς = ( (22), (11)) and τ ς = 4 otherwise.
To do so, we study the fundamental domain for the action of the non-reductive group G(Z) on V (R). We then compute the volume of a cover of this fundamental set after cutting of the cusps in terms of an Euler product of local densities.

Construction of fundamental domains
In this section, our goal is to construct a finite cover for a fundamental domain for the action of G(Z) on V (R). As a first step, we describe the G(R)-orbits on V (R), and the sizes of the stabilizers in G(R) of elements in each orbit. Before we do so, it will be convenient to introduce the following group and space: The subgroup G red (R) of G(R) acts on V red (R), where G red (R) consists of elements (g 2 , g 3 ) ∈ GL 2 (R) × SL 3 (R) such that Proposition 7.2. The orbits for the action of G(R) on the set of elements in V (R) having nonzero invariants q and d corresond to a pair ofétale algebras (L ∞ , K ∞ ) with splitting types and invariants as follows: (1) When q > 0 and d > 0, there are two orbits, one with splitting type ((1111), (11)) and one with splitting type ((22), (11)); (2) When q < 0 and d > 0, there is one orbit with splitting type ((112), (11)); (3) When q > 0 and d < 0, there is one orbit has splitting type ( (22), (2)).
The respective sizes of the stabilizers in G(R) of elements in these orbits are 8 in the first case, and 4 in the second and third cases, and we denote these stabilizer quantities by τ ς (L ∞ , K ∞ ).
Proof. We start with a few observations. First note that G(R)-orbits on V (R) having fixed invariants d and q are in bijection with G red (R)-orbits on V red (R) having invariants q and d. This is because (A, B) ∈ V (R) is G(R)-equivalent to some (A red , B red ) ∈ V red (R). Futhermore, if two elements in V red (R) are G(R)-equivalent via some g ∈ G(R), then g must in fact belong to G red (R). This latter fact also implies that the stabilizer in G(R) of any element in V red (R) is contained in G red (R). Also note that G red (R)-orbits on V red (R) having nonzero invariants d and q are in bijection with G red (R)-orbits on V red (R) having invariants q/|q| and d/|d|. Indeed, if (A, B) ∈ V red (R) has invariants q and d, then dividing A by |d| and dividing the lower 2 × 2submatrix of B by |q|/|d| yields the necessary bijection. Moreover, a direct computation shows that the stabilizers in G red (R) of these two elements are the same. Therefore, it suffices to prove the proposition in the case when q and d are ±1.
Consider the case q = d = 1. Let (A, B) ∈ V red (R) have such invariants. By replacing (A, B) with a G red (R)-translate, we transform it as follows: first, we ensure that a 22 = a 33 = 0; next, we subtract an appropriate multiple of A from B to ensure that its off-diagonal entries are 0; finally, we use an element of SL 2 (R) ⊂ G red (R) to ensure that |b 22 | = |b 33 |. From the fact that q = d = 1, it follows that we have transformed (A, B) into the form where b 22 and b 33 are either both positive or both negative. It is a direct computation to check that (A, B) has splitting type ( (22), (11)) in the former case and ((1111), (11)) in the latter case. Furthermore, the stabilizer in G red (R) of (A, B) in either case is seen to consist of the following eight elements.
This concludes the proof of the first item in Proposition 7.2. We omit the proofs of the other two items since they are very similar.
Recall that the set of elements in V (R) with infinite splitting type ς is denoted by V (R) (ς) . Given a splitting type ς, let (A ς , B ς ) ∈ V (R) (ς) ∩ V red (R) be an element whose invariants have absolute value 1. By multiplying A ς by |d| and multiplying the bottom 2 × 2 submatrix of B by |q|/|d|, we obtain an element with invariants q and d, for any pair (q, d) ∈ R 2 having the appropriate signs. We thus obtain the following result which follows immediately from Proposition 7.2. Note that the set of such pairs (A, B) is bounded (since q and d are) and semialgebraic (indeed, they are defined by linear conditions.) Proposition 7.3. Fix an infinite splitting type ς. There exists a fundamental set R (ς) for the action of G(R) on V (R) (ς) such that R (ς) contains one element (A, B) having invariants q and d for any (q, d) ∈ R 2 having the appropriate signs. Moreover, R (ς) may be constructed so that the element (A, B) ∈ R (ς) having invariants q and d is such that the coefficients of A are bounded by O δ (|d| 1/2 ) and the coefficients of B are bounded by O δ (|q| 1/2 |d| −1/2 ).
Let F be a fundamental domain for the action of G(Z) on G(R). We may assume that F is contained in the Siegel domain S = S 1 S 2 , where We have F = F 2 F 1 , where F 1 ⊂ S 1 and F 2 = S 2 . From an argument identical to that in [5, §2.1], it follows that F · R (ς) is a cover of a fundamental domain for the action of G(Z) on V (R) (ς) , where the G(Z)-orbit of v is represented m(v) times. Here m(v) is given by Every element in V (R) is fixed by the element (Id, g 3 ) ∈ G(Z), where g 3 is the diagonal 3 × 3 matrix whose diagonal entries are 1, −1, and −1. Conversely, every nontrivial element γ ∈ G(Z) not equal to (Id, g 3 ) ∈ G(Z), acts nontrivially on V (R). Hence the set of points in V (R) fixed by γ has lower dimension and thus has measure 0. Since there are only countable many elements in G(Z), it follows that the set of elements in V (R) that have a stabilizer in G(Z) of size greater than 2 has measure 0. We thus obtain the following theorem.

Averaging and cutting off the cusp
Let L ⊂ V (R) (ς) be a G(Z)-invariant lattice, and denote the set of generic elements in L by L gen . Given a subset W of V (R) and a constant δ > 0, we denote the set of elements w ∈ W with X ≤ |q(w)| < (1 + δ)X and Y ≤ |d(w)| < (1 + δ)Y by W XY . Since the stabilizer in G(Z) of a generic element in V (Z) has size 2, Theorem 7.4 implies that we have XY satisfy the bounds We now pick the following bounded open nonempty subset G 0 of G red (R): where G 1 is a bounded open nonempty SO 2 (R)-invariant subset of SL 2 (R). The reason for the choice of the range of n is that the coefficients of every element in G 0 ·R (ς) XY satisfy the bounds (37). Write the fundamental domain F in (36) as F 2 F 1 g. Using coordinates from (35), we write an element in F 1 as (n, m 3 , t, θ). In these coordinates, is a Haar-measure on G red (R). The proof of the following lemma follows the argument in the proof of [5, Theorem 2.5].
Proof. For every g ∈ G red (R), the set g·R (ς) is a fundamental set for the action of G(R) on V (R) ς . Therefore, averaging (36), with R (ς) replaced with g · R (ς) , over g ∈ G 0 , we obtain XY ∩ L gen }dg.
Pick v ∈ L gen , and let v 0 ∈ R (ς) denote the unique element that is G(R)-equivalent to v. Since G red (R) · R (ς) is contained in V red (R), and there exists at most one element in F −1 2 , such that γ 2 · v ∈ V red (R), it follows that the set S v of elements γ ∈ G red (R) such that γ · v 0 ∈ F −1 2 v is finite. Therefore, we have Since we have the lemma follows.
In the next lemma we show that F 2 gG 0 · R (ς) XY has no integral generic points if t is too large. XY ∩ V (Z). We claim that such an (A, B) is not generic. Indeed, the the conic in P 2 cut out by A consists of a pair of lines, each of which is defined over Q. Therefore, the intersection points of the conics corresponding to A and B are defined over a degree-2 extension of Q, and so (A, B) cannot correspond to a D 4 field. The lemma thus follows.
We let F = F 2 F 1 ⊂ F consist of all elements g 2 g 1 with g 2 ∈ F 2 and g 1 = (n, m 3 , t, θ), where t ≤ CY 1/4 for the C in the proof of the above lemma. For any lattice L of V (Z), define We use the following result of Davenport [13] to estimate N * q (L; X, Y ): Proposition 7.7. Let R be a bounded, semi-algebraic multiset in R n having maximum multiplicity m, and that is defined by at most k polynomial inequalities each having degree at most . Then the number of integral lattice points (counted with multiplicity) contained in the region R is where Vol(R) denotes the greatest d-dimensional volume of any projection of R onto a coordinate subspace obtained by equating n − d coordinates to zero, where d takes all values from 1 to n − 1. The implied constant in the second summand depends only on n, m, k, and .
In fact, the proof of the above proposition implies that we may replace Vol(R) by the maximum of the d-dimensional volumes of the projections of any unipotent translate of R. Now, for g ∈ F 1 , the set gG 0 · R (ς) XY is a bounded set contained in V red (R). Hence, the b 12 -and b 13coefficients of elements in F 2 gG 0 · R (ς) XY must lie in [0, 2). They can only be integral when they are 0 or 1. Therefore, every integral point in F 2 gG 0 · R (ς) XY lies on one of four hyperplanes in V (R): the hyperplanes corresponding to (b 12 , b 13 ) = (0, 0), (0, 1), (1, 0), and (1, 1). Moreover, these hyperplanes are unipotent translates of each other, in fact, by the elements in F 2 with m 1 , m 2 ∈ {0, 1/2}. It follows that the four hyperplane sections have the same volume, and Proposition 7.7 applied to them yields the same error estimates. Therefore, we have where Vol L is computed with Euclidean measure normalized so that L has covolume 1, and The quantity MP(g) denotes the maximal volume of the projections of gG 0 · R (ς) XY onto its coordinatehyperplanes. Every element (A, B) in R (ς) is such that the coefficients of A are bounded by Y 1/2 and the coefficients of B are bounded by X 1/2 /Y 1/2 . By construction of G 0 , the same is true for every element in G 0 · R (ς) . Then the error integral is easily bounded: as long as Y X, the maximum projection is on to the coordinate subspace obtained by setting b 22 to 0 since the ranges of the other coordinates are 1 for every value of g ∈ F 1 . Therefore, for g = (0, 0, t, 0), we have We therefore have since Vol(G 0 ) is easily seen to be X 1/2 /Y . We next have the following bound on the number of non-generic G(Z)-orbits on V (Z).
Proposition 7.8. We have Proof. If v ∈ V (Z) is not generic, then there exists unramified splitting types ς = (ς p , ς p ) p for all primes p such that (ς p (v), ς p (v)) = (ς p , ς p ) for all primes p. Given any unramified splitting type, there exists a constant c < 1 such that the density of elements in V (Z p ) that do not have splitting type (ς p , ς p ) is bounded above by c. From (41), we therefore obtain for any fixed integer M : where the second estimate follows since the ratios of volumes in the first line is XY . Note that by assumption, we have X 1/2 Y 3/2 log Y = o(XY ). Therefore, by letting M tend to infinity, we obtain the result.
From (39), (40) and Proposition 7.8, we see that if X and Y go to infinity such that Y (log Y ) 2 = o(X), then To compute the volumes of G 0 · R (ς) XY , we have the following result, which follows immediately from a Jacobian change of variables computation. Proposition 7.9. Let dv i be the standard Euclidean measures on V red (R), let dh denote the Haar-measure on G red (R) obtained from theN AN decomposition of SL 2 (R), and pick the measure dd dq on R (ς) . We have a natural map G red (R) × R (ς) → V red (R). Then the Jacobian change of variables is 1/16, i.e., for any measurable function ϕ on V red (R), we have v∈G red (R)·R (ς) ϕ(v)dv = 1 16 r∈R (ς) h∈G red (R) ϕ(g · r)dh dd(r) dq(r).
Therefore, we obtain the following theorem from which Theorem 7.1 follows immediately.
Theorem 7.10. Let L denote a finite union of G(Z)-invariant lattice in V (R) (ς) . Then, for positive real numbers X, Y going to infinity such that Y (log Y ) 2 = o(X), we have where L p denotes the closure of L in V (Z p ), the volumes of sets in V (Z p ) are taken with respect to the usual Euclidean measure, and τ ς are as in Theorem 7.1.
Proof. The set R (ς) XY contains exactly one point with invariants q and d, for every X ≤ q < (1 + δ)X and XY is δ 2 XY The theorem now follows from (41) and Proposition 7.9 since the volume of F 1 under the measure dh is ζ(2), and Vol L differs from normal Euclidean measure by a factor of p Vol(L p ).

Uniformity estimates and sieving to D 4 -quartics
In order to use our results from §4-5, and §6-7 to prove our main theorems, we will employ simple sieves. In this section, we start by collecting the requisite tail estimates. First, we need a bound on the number of D 4 -quartics having central inertia at some large prime, which is established in §8.1. On the other hand, we obtain an estimate on the number of G(Z)-orbits on V (Z) that are non-maximal at some large prime in §8.2. It is interesting to note that the results in §7 are not strong enough for these estimates, and so we employ techniques from §4.

Bounding the number of D 4 -quartics with large central inertia
We start with a preliminary lemma bounding the number of D 4 -quartics with fixed conductor. Proof. Let L be a D 4 -quartic with conductor N , and let K be the quadratic subfield of L. Then the discriminant of K divides N . Hence the number of choices for K is bounded by twice the number of divisors of N . Given a fixed quadratic field K whose discriminant D divides N , the number of D 4 -quartics of conductor N whose quadratic subfield is K is bounded by 4 · # Cl 2 (K) times the number of squarefree ideals dividing 4N (see §3 of [9]). But 4 · # Cl 2 (K) D and the number of divisors of 4N is ε N ε . Combining these estimates yields the lemma.
Next, we prove the required estimate on D 4 -quartics having specified central inertia by combining the previous lemma with Lemma 4.6.
Proposition 8.2. Let X and Y be integers such that X ≥ Y . Then the number of D 4 -quartics L such that X ≤ q(L) < 2X, Y ≤ d(L) < 2Y , and L has central inertia every prime dividing a positive squarefree integer n is bounded by O (XY /n 2− ).
Proof. We consider two ranges of n. We fix a large positive real number M (any M > 16 will suffice). When n ≥ X 1/M , we have n ≥ (XY ) 1/2M . The number of possible conductors for a D 4 -quartics L satisfying the conditions of the proposition is bounded by O(XY /n 2 ), since the conductor is bounded by 4XY and is divisible by n 2 . Hence, from Lemma 8.1, it follows that the number of such fields L is bounded by O ((XY ) 1+ /n 2 ) = O (XY /n 2− ).
For n ≤ X 1/M , we see from Lemma 4.6 that the number of D 4 -quartics satisfying the conditions of the proposition and having splitting type ((1 2 1 2 ), (11)) or ((2 2 ), (2)) at every prime dividing n is bounded by By §3 of [28], the sum above is Y and so the total displayed quantity is bounded by O(XY /n 2− ). Similarly, the number of D 4 -quartics satisfying the conditions of the proposition and having splitting type ((1 4 ), (1 2 )) at every prime dividing n is bounded by If Y ≥ n M , the sum of L-values is bounded by O(Y /n) by arguments identical to those in §3 of [28], yielding a total bound of O(XY /n 2− ). When instead Y < n M , the classical bound of O (Disc(K) ) on L(1, K/Q) yields the proposition.

Bounding the number of non-maximal G(Z)-orbits on V (Z)
For a fixed prime p, let W p denote the set of generic elements in V (Z) that correspond to nonmaximal orders in D 4 -quartics. Our next goal is to prove a uniform tail estimate for the number of G(Z)-orbits on W p having bounded invariants. We start with the following lemmas. Proof. From Lemma 4.5, we see that for X ≥ Y (in fact for Y X 3− ), the number of D 4 -quartics with invariants q and d less than X and Y , respectively, is bounded by which is O(XY ) by the results in §3 of [28].
When X < Y , we bound the number of D 4 -quartics L by instead bounding the number of fields φ(L) (see Definition 2.1). To do so, it suffices to show that, when X < Y the number of fields L with X < q(L) < 2X and Y < d(L) < 2Y is O(XY ) since 2 −m converges. But recall from (7) that J(L)d(φ(L)) = q(L). Then under this assumption, Y · J(L) < q(φ(L)) < 2Y · J(L) X J(L) < d(φ(L)) < 2X J(L) .
By Proposition 8.2, since Y · J(L) ≥ Y > X ≥ X/J(L), we have that the number of such D 4 quartics φ(L) in this range with J(φ(L)) = J(L) = n is O (XY /n 2− ), so it suffices to sum O ε (XY /n 2− ) over all valid n. Since 1/n 2− over integers n converges, thus completing the proof.
We now prove the following uniform bound on the number of G(Z)-orbits on W p , the set of generic elements in V (Z) that are not maximal at p.
Proof. Note that since this is an asymptotic statement as p grows, we may assume that p is sufficiently large, and in particular that p is odd. An element v ∈ W p gives a quartic ring Q whose field of fractions L is a D 4 -quartic. Let i(v) denote C(v)/C(L), the ratio of the conductors of v and L. From Lemma 6.6, it follows that i(v) is divisible by p 2 . From Lemma 8.3, it follows that the number of possible fields L that occur this way is bounded by O(XY /i(v) 1− ). Next, note that the index of Q in the ring of integers of L divides i(v). The methods of [26] imply that the number of suborders of index k = p ei i of a maximal quartic ring is bounded by j(k) := p Therefore, it follows that the number of G(Z)-orbits on W p satisfying the conditions of the proposition is bounded by where m runs over all integers divisible by p 2 . Using the multiplicativity of j and d, the expression (43) is easily seen to be X/p 2− and the proposition follows.

Proof of the main theorems
In this section, we conclude the proof of the generalization of Theorem 5.3 that allows for imposing certain local specifications (see Theorem 9.3). First, we define p-adic densities and determine the number ofétale algebras along with their automorphism groups for each splitting type. As a byproduct of the two asymptotics obtained for N C (Σ; X, X 1/2 ) by Theorem 4.3 and in §9.2, we prove Theorem 6. Theorems 1 and 3 are proved in §9.3. First, we obtain asymptotics for N C (Σ; X, Y ) when Y > X 1/2 from counting D 4 -quartics φ(L) with conductor bounded by X and small quadratic discriminant, where L ∈ L(Σ). We then prove Theorem 3 after employing a bound that follows from the analytic methods in Section 4 and 5. Finally, in §9.4 we prove a refinement of Theorem 5, which follows from Theorem 3 in conjunction with the p-adic volumes determined in Proposition 6.7.

Acceptable local specifications, densities, and automorphism groups
Recall that for a collection of local specifications Σ, L(Σ) is the set of D 4 -quartics L such that the pair consisting of the splitting type of L and the splitting type of K, its quadratic subfield at a prime p (respectively, at ∞) is contained in Σ p for all p (respectively, in Σ ∞ ). A set Σ of local specifications (and the corresponding family L(Σ)) is said to be acceptable if for all but finitely many primes p, the set Σ p contains all unramified splitting types and tamely ramified splitting types without central inertia. (In the notation of (5), Σ p contains exactly the pairs (ς p (L 1 ), ς p (K 1 )) contained in the first two groups in Table 1.) Recall that for a prime p and a splitting type (ς p , ς p ), we computed the density µ(M p (ς p , ς p )) in Proposition 6.7. We define the density µ(Σ p ) to be the sum of the values of µ(M p (ς p , ς p )) over (ς p , ς p ) ∈ Σ p , and define the density of µ(Σ ∞ ) to be the sum of 1 τς over all ς ∈ Σ ∞ . The stabilizer quantities τ ς are defined in Theorem 7.1, and we list them below for convenience.
Next, we determine the automorphism groups ofétale quartic algebras over Q p sending a quadratic subalgebra to itself for odd primes p.
Lemma 9.2. Let p be an odd prime. The automorphism group of a pair (L, K), where K is a quadraticétale algebra over Q p , and L is a quadraticétale algebra over K, is determined by the splitting type of (L, K), and is listed in the following table: Above, when we write (a, b) for the number of (isomorphism classes of )étale algebras over Q p , the first coordinate indicates the quantity for primes of the form 4k + 1 and the second coordinate for primes of the form 4k + 3. Additionally, there are two distinct isomorphism classes ofétale algebras with splitting type (1 2 1 2 ) : in the table, we distinguish them by letting (1 2 1 2 ) refer to the sum of two isomorphic ramified quadratic extensions of Q p and letting (1 2 1 2 ) refer to the sum of two non-isomorphic ramified quadratic extensions of Q p .
Proof. The above lemma can be verified case by case using [21] in conjunction with the fact that determining the possibleétale algebras for a given splitting type depends only on the congruence class of p mod 4.

A refinement of Theorem 5.3 and the proof of Theorem 6
For positive real numbers X and Y , let N (δ) q (Σ; X, Y ) be as in Section 7. We have the following theorem, giving another proof that the heuristics of (9) holds for certain ranges of X and Y . Theorem 9.3. Let Σ be an acceptable set of local specifications. For positive real numbers X and Y such that Y (log Y ) 2 = o(X), we have Proof. By Proposition 6.3, it suffices to obtain asymptotics for the number of generic G(Z)-orbits (A, B) on V (Z) such that (A, B) is maximal and the splitting type of (A, B) at each place belongs to Σ. The number of generic G(Z)-orbits on V (Z) satisfying any finite set of congruence conditions has been estimated in Theorem 7.10. Theorem 9.3 then follows from Theorem 7.10 and the uniformity estimates in Propositions 8.2 and 8.4 by means of a simple sieve. We omit the details since they are very similar to those in the proof of Theorem 9.4.
As a consequence of the main terms obtained in Theorems 4.3 and 9.3, we may now prove Theorem 6. It is interesting to note that the proof of Theorem 6 is much more involved than that of Theorem 2. In particular, it is not obvious that the arguments in Section 5 can be refined to directly allow for imposing acceptable sets of local specifications.
This concludes the proof of Theorem 6. 2

The proofs of Theorems 1 and 3
We next obtain asymptotics for N (δ) q (Σ; X, Y ) when Y X. Recall that the outer automorphism φ of D 4 provides a non-isomorphic D 4 -quartic φ(L) for each D 4 -quartic L, and the fields L and φ(L) have the same conductor but (possibly) different invariants. Proposition 2.6 can be used to compute the invariants of φ(L) in terms of the invariants of L. Note that if d(L) > q(L), then d(φ(L)) < q(φ(L)). Hence, for a collection of local specifications Σ, we may relate counts of D 4 -quartics with d > q to counts of D 4 -quartics with d < q.
Theorem 9.4. Let Σ be an acceptable collection of local specifications that is very stable at 2. Let X and Y be positive real numbers such that X(log X) 2 = o(Y ). Then we have Proof. For a prime p and an integer a ≥ 1, let V(p, a) denote the set of D 4 -quartics L such that J p (L) = p a . Recall that J(L) is defined in (7), and an odd prime p | J(L) if only if p 2 L if and only if L has splitting type ((2 2 ), (2)), or ((1 2 1 2 ), (11)). Let V p denote the union of V(p, a) over all a ≥ 1, and for any integer n ≥ 1, let L(Σ) (n) denote the set of fields L in L(Σ) such that J(L) = n. One can check that L(Σ) (n) is defined by an acceptable collection Σ (n) of local specifications that is very stable at 2, i.e., L(Σ (n) ) = L(Σ) (n) . Using (7) and the fact that J(L) = J(φ(L)), we have N (δ) q (φ(Σ (n) ); Y n, X/n).
For a fixed integer M , we use Theorem 9.3 to evaluate N (δ) q (φ(Σ) (n) ; Y n, X/n) for n ≤ M and Proposition 8.2 to bound N (δ) q (φ(Σ) (n) ; Y n, X/n) for n > M . Altogether, we obtain Lemma 9.5. The number of D 4 -quartics L such that |C(L)| ≤ X and X(log X) −3 ≤ |d(L)| ≤ X(log X) 3 is bounded by O(X log log X).
Proof. The number of D 4 -quartics satisfying the conditions of the lemma can be estimated as a sum of ratios of L-values from Theorem 4.3. This sum can be bounded, using Proposition 5.2, by yielding the lemma.

The proof of Theorem 5
We end this article with the proof and a discussion of Theorem 5. Let K ∈ K be a quadratic field, and for each p ∈ S, let ς denote the prescribed splitting type at p for K. Since finite abelian groups are isomorphic to their duals, we see that # Cl(K) [4] − # Cl(K) [2], the number of elements in Cl(K) having exact order 4, is equal to twice the number of index-4 subgroups of Cl(K) whose quotients are cyclic. By class field theory, such index-4 subgroups of Cl(K) are in bijection with isomorphism classes of unramified extensions M of K with Gal(M/K) = C 4 . Such an extension M is Galois over Q with Galois group D 4 . Conversely, if M is an octic D 4 -quartic whose splitting type at every prime p lies in the first two quadrants of Table 1, then M is unramified over K, its quadratic subfield fixed by C 4 ⊂ D 4 . Furthermore, it is straightforward to check from Table 1 that under these conditions, M is unramified over K.
Now we define three collections of local specifications Σ (i) corresponding to the three cases in Theorem 5. First, let K ( * ) be the subset of K ∈ K with ς ∞ (K) = (11) when * = a or c, and ς ∞ (K) = (2) when * = b, and define