The density of polynomials of degree n$n$ over Zp${\mathbb {Z}}_p$ having exactly r$r$ roots in Qp${\mathbb {Q}}_p$

We determine the probability that a random polynomial of degree n$n$ over Zp${\mathbb {Z}}_p$ has exactly r$r$ roots in Qp${\mathbb {Q}}_p$ , and show that it is given by a rational function of p$p$ that is invariant under replacing p$p$ by 1/p$1/p$ .


INTRODUCTION
Let ( ) = + −1 −1 + ⋯ + 0 be a random polynomial having coefficients 0 , 1 , … , ∈ ℤ . In this paper, we determine the probability that has a root in ℚ , and more generally the probability that has exactly roots in ℚ . More precisely, we normalize the additive -adic Haar measure on the set of coefficients ℤ +1 such that (ℤ +1 ) = 1, and determine the density ( ) of the set of degree polynomials in ℤ [ ] having exactly roots in ℚ . We prove that this density ( ) is given by a rational function * ( , ; ) of , which satisfies the remarkable identity * ( , ; ) = * ( , ; 1∕ ) for all , , and . We also prove that if ( ) is the random variable giving the number of ℚ -roots of a random polynomial ∈ ℤ [ ] of degree , then the th moment of ( ) is independent of , provided that ⩾ 2 − 1.
Let us now more formally define the probabilities, expectations, and generating functions required to state our main results. Fix a prime and, for 0 ⩽ ⩽ , let * ( , ) ∶= * ( , ; ) denote the density of polynomials of degree over ℤ having exactly roots in ℚ . This is also the probability that a binary form of degree over ℤ has exactly roots in ℙ 1 (ℚ ). For 0 ⩽ ⩽ , set Thus ( , ) is the expected number of -sets † of ℚ -roots. For fixed , determining ( , ) for all is equivalent to determining * ( , ) for all , via the inversion formula * ( , ) = ∑ Equations (1) and (2) are equivalent to the standard observation that a probability distribution is determined by its moments; the formulation in terms of -sets (equivalently in terms of factorial moments) is most convenient for our purposes. Analogous to ( , ), let ( , ) (respectively, ( , )) denote the expected number of -sets of ℚ -roots of monic polynomials of degree over ℤ (respectively, monic polynomials of degree over ℤ that reduce to modulo ). Define the generating functions: Then we prove the following theorem. † We find it convenient to refer to a set of size as a " -set." Theorem 1. Let be a prime number and , any integers such that 0 ⩽ ⩽ . Then: (b) We have the following power series identities in two variables and : where Φ is the operator on power series that multiplies the coefficient of by −( 2 ) . We observe that  and  (for = 0, 1, 2, …) are the unique power series satisfying the relations (5) and (7) together with the requirements that  and  are ( ),  0 =  0 = 1 and  1 and  1 are + ( 2 ). This last requirement is needed, since otherwise we could replace  and  by  and  where is a constant. This uniqueness statement is easily proved by induction on and . The power series  are then uniquely determined by (6).
While we have stated all our results above in terms of the ring ℤ , the generalization to any complete discrete valuation ring with finite residue field (as considered in [3]) is immediate.

Relation to previous work
The study of the distribution of the number of zeros of random polynomials has a long and interesting history. Over the real numbers, the study goes back to at least Bloch and Pólya [2], who proved asymptotic bounds on the expected number of real zeros of polynomials of degree that have coefficients independently and uniformly distributed in {−1, 0, 1}. Further significant advances on the problem were made by Littlewood and Offord [14][15][16] for various other distributions on the coefficients. An exact formula for the expected number of real zeros of a random degree polynomial over ℝ -whose coefficients are each identically, independently, and normally distributed with mean zero -was first determined in the landmark 1943 work of Kac [11], which influenced much of the extensive work to follow. In particular, in 1974, Maslova [17,18] determined asymptotically all higher moments for the number of zeros of a random real Kac polynomial in the limit as the degree tends to infinity. For excellent surveys of the literature and further related results and references regarding the number of real zeros of random real polynomials, see the works of Dembo, Poonen, Shao, and Zeitouni [7, § 1.1] and of Nguyen and Vu [19, § 1].
The corresponding problems and methods over -adic fields were first considered by Evans [10], who determined, for suitably random families of polynomials in variables over ℤ , the expected number of common zeros in ℤ . In the case = 1, these results were taken further by Buhler, Goldstein, Moews, and Rosenberg [3], Caruso [4], Limmer [13], Shmueli [22], and Weiss [23]. These papers were concerned primarily with determining the expected number of roots for polynomials of degree over the -adics, the th factorial moments for polynomials of degree , or all moments for polynomials of degree ⩽ 3.
The current paper gives a method for computing all moments for the number of zeros of random -adic polynomials of degree in one variable for any degree . Indeed, Theorem 1, together with the uniqueness statement that follows it, enables us to explicitly compute the probabilities and moments * ( , ), ( , ), ( , ), and ( , ) for any values of , , and . We may similarly compute the analogs * ( , ) and * ( , ) of * ( , ); that is, * ( , ) (respectively, * ( , )) denotes the probability that a random monic polynomial of degree (respectively, monic polynomial reducing to modulo ) has exactly roots over ℚ (equivalently, ℤ ). Indeed, the formulas (1) and (2) continue to hold when the symbol is replaced by (respectively, ). In particular, we deduce from (2) that * ( , ), * ( , ), and * ( , ) all satisfy the same symmetry properties (3) and (4) as their unstarred counterparts.
There remain three striking aspects of our formulas in Theorem 1 that call for explanation: 1) they are all rational functions in that are independent of and are valid for all primes (including for small primes and primes | ); 2) they satisfy a symmetry ↔ 1∕ ; and 3) they stabilize for large .
Properties 1) and 2) also occurred in earlier work of the first three authors (see for example [1]). Property 1) may be related to the work of Denef and Loeser [8] (see also Pas [20]), at least for sufficiently large . Regarding Property 2), the expectations we study may be expressed as -adic integrals (see, e.g., Section 3.3), raising the interesting possibility that there might be a common explanation for the ↔ 1∕ symmetries occurring in Theorem 1(a) and the functional equations for certain zeta functions established by Denef and Meuser [9], who count the number of zeros of a homogeneous polynomial mod , and by du Sautoy and Lubotzky [21], who count finite index subgroups of a nilpotent group. Finally, regarding Property 3), there is the interesting possibility that the independence of established in Theorem 1(c) might fit into the framework of representation stability as initiated in the work of Church, Ellenberg and Farb [5]. We believe it is an exciting problem to understand these phenomena and their potential relations with the aforementioned works.

Examples
We illustrate some particularly interesting cases of Theorem 1.

1.2.1
The expected number of roots of a random -adic polynomial By definition, the quantities ( , 1), ( , 1), and ( , 1) represent the expected number of roots over ℚ of a random polynomial over ℤ of degree , a random monic polynomial over ℤ of degree , and a random monic polynomial over ℤ of degree reducing to (mod ), respectively.
This recovers, in particular, the aforementioned results of Caruso [4] and Kulkarni and Lerario [12] on the values of ( , 1), and of Shmueli [22] on ( , 1), who obtained them via quite different methods (though their methods are related to those used by Kac [11] cited above).
There is no difficulty in extending these calculations to larger values of .
By the analog of (4) for * and * , we may obtain the values of * from those of * by substituting 1∕ for .

1.2.6
Large limits We note that ( , ), ( , ), * ( , ), and * ( , ) are rational functions in whose numerators and denominators have the same degree. Hence, for fixed , , and , we may compute the limits of these functions as tends to infinity. Meanwhile, ( , ) and * ( , ) are rational functions in whose denominator has higher degree than the numerator in most cases. Thus, a correction factor of a power of is needed to make the limit finite and non-zero. We have the following proposition.

A general conjecture
Theorem 1(a) naturally leads us to formulate a much more general conjecture. Namely, we conjecture that the density of polynomials of degree over ℤ cutting out étale extensions of ℚ of degree in which has any given splitting type is a rational function of satisfying the identities (3) and (4).
Recall that a splitting type of degree is a tuple = ( 1 1 2 2 ⋯ ), where the and are positive integers satisfying ∑ = . We allow repeats in the list of symbols , but the order in which they appear does not matter. To make it clear when two splitting types are the same, we could, for example, order the pairs ( , ) lexicographically. Exponents = 1 may be omitted.
For an étale extension ∕ℚ of degree , we define the symbol ( , ) to be the splitting type , are primes in having residue field degrees 1 , 2 , … , , respectively. We say that has splitting type in if ( , ) = .
We then make the following conjecture.
We have proven that Conjecture 1.2 holds in the quadratic and cubic cases. For example, Note again that the numerators and denominators are all palindromic, and thus these expressions satisfy (14). Analogous formulas hold for the ( , ; ) and ( , ; ), and these satisfy (15). In particular, these formulas hold for all , including = 2 and = 3. Theorem 1(a) may also be viewed as a special case of Conjecture 1.2, since the density * ( , ; ) of polynomials of degree over ℤ having exactly roots over ℚ is simply the sum of the densities ( , ; ) over all splitting types having exactly 1's (and similarly with , in place of ); thus, if the equalities (14) and (15) hold for all ( , ; ), then they will also hold for * ( , ) and ( , ) (and similarly with , in place of ), implying Theorem 1(a).

Methods and organization of the paper
In Section 2, we explain some preliminaries needed for the proof of Theorem 1, regarding counts of polynomials in [ ] having given factorization types, power series identities involving these counts, resultants of polynomials over ℤ , and explicit forms of Hensel's lemma for polynomial factorization.
In Section 3, we then turn to the proof of Theorem 1. We first explain how Theorem 1(b) easily implies Theorem 1(a). To prove Theorem 1(b), we begin by writing the ( , ) in terms of the ( ′ , ′ ) for ′ ⩽ and ′ ⩽ . This involves considering how a monic polynomial over ℤ factors mod and showing that the random variables given by the number of ℤ -roots above each -root are independent. The answers may be expressed in terms of the generating functions  and  as which may be expressed more succinctly in the form (5). We then explain how to write the ( , ) in terms of the ( ′ , ) for ′ ⩽ . This is proved by making substitutions of the form ← , and analyzing the valuations of the resulting coefficients; the relation we obtain is expressed succinctly in the form (7). These two types of relations allow us then to recursively solve for the ( , ) and ( , ). We then write the ( , ) in terms of the ( , ) and ( , ), using another related independence result, and the relations we thereby obtain are expressed succinctly in the form (6), completing the proof of Theorem 1(b). As previously noted, Theorem 1(b) gives a way to compute the power series  ,  , and  for each . However, it does not seem to give any way of showing that these are in fact polynomials for all . In establishing Theorem 1(c), we thus use a different technique to prove the stabilization result for the ( , ), or equivalently, that  is a polynomial of degree at most 2 . We could also give a similar proof of the corresponding result for the ( , ), but there is no need, since it follows from that for the ( , ), using either (4) or (16).
Once we have shown that  and  are polynomials of degree at most 2 , the same result for  then follows by (6). This is not sufficient to prove the stabilization result for the ( , ), since the definition of  involves additional factors. However, a variant of the ideas used to show that  is a polynomial also show that  (1) =  ( ), and from this we deduce the stabilization result for the ( , ).
Finally, in Section 4, we prove the asymptotic results contained in § 1.2.6.

Counts involving splitting types of polynomials over
We will require expressions for the number of monic polynomials in [ ] that factor as a product of irreducible polynomials with given degrees and multiplicities. These counts, and the corresponding probabilities for a random polynomial to have given factorization types, are collected in this subsection.
We say that a monic polynomial in [ ] of degree has splitting type ( 1 In general, for = ( 1 Since there are monic polynomials of degree in [ ], the probability that a degree monic polynomial ∈ [ ] has splitting type , for ∈ ( ), is ∕ . This is evidently a rational function of .

Power series identities involving
We now establish some power series identities involving the counts defined in the previous section.

Let
for , ⩾ 1 be indeterminates. For a splitting type ∈ ( ) of degree , let Polynomials in the will be weighted by setting wt( ) = . We set 0 = 1, and for ⩾ 1 define so that every monomial in has weight . We set 0 = 1 for all ⩾ 1.
Proof. We must show that when the right-hand side is multiplied out, the coefficient of is . The coefficient of is a sum of monomials in the of weight . Each such product has the form for some ∈ ( ), and the number of times each monomial occurs is . □ By specializing the , we obtain the following corollary.

Corollary 2.2. We have the following identity in ℤ[[ ]]
: Proof. In (18) Proof. In (18)   Our reason to consider resultants is the following. , and the matrix of partial derivatives of the with respect to the and is precisely the Sylvester matrix whose determinant is Res( , g).
We next consider case (b), and assume that ( ) = , and let be the ( + + 1) × ( + + 1) matrix of partial derivatives of the with respect to the and . Since + = , the last row consists of 0's except for the final entry which is 1. Expanding the determinant by the last row, we again obtain Res( , g The following variant will be used to handle polynomials ∈ ℤ [ ] whose leading coefficient is not a unit.

Lemma 2.9. For ⩾ , the multiplication map
is a measure-preserving bijection.

Independence lemmas
Finally, we may phrase Lemmas 2.8 and 2.9 as statements regarding the independence of suitable random variables.

Conditional expectations
The expectations ( , ) and ( , ) were defined in the introduction. To help evaluate them, we make the following additional definitions.

3.2.2
Writing the ( , ) in terms of the ( , ) The aim of this subsection is to prove (5), the first part of Theorem 1(b).
where ( , , ) is the expected number of -sets of ℚ -roots of as ∈ ℤ [ ] runs over polynomials of degree with reduced degree . This expectation does not change if we restrict to whose reduction mod is monic. Equation (6) now follows from (31) and the following lemma.

3.2.4
Writing the ( , ) in terms of the ( , ) The aim of this section is to prove (7), the third and last part of Theorem 1(b). Fixing , we put ∶= ( , ) and ∶= ( , ). In the following lemma, we express in terms of for ⩽ . Lemma 3.5. We have Proof. Recall that is the expected value of the random variable distributed as the number of -sets of ℤ -roots of ∈ . All such roots must lie in ℤ , and thus correspond to ℤ -roots of ( ). To each ∈ , we associate a pair of integers ( , ) with 0 ⩽ ⩽ ⩽ as follows. Consider ( ), and let be the largest integer such that | ( ), so that 1 ⩽ ⩽ . Let be the reduced degree of − ( ). Then either 0 ⩽ < < , or = = .
Given the values of and , the conditional expected value of is , independent of , by Corollary 2.11. Hence Proof of (7). Taking Equation (33) for and − 1 and subtracting gives Now taking Equation (34) for and − 1 and again subtracting yields and this indeed asserts the equality of the coefficient of on both sides of (7). □ We have completed the proof of Theorem 1(b). We were motivated to find the neater formulation in Theorem 1(b) by the desire to prove the ↔ 1∕ symmetries.

Proof of Theorem 1(c)
Consider a random polynomial of degree in ℤ [ ]. Let˜( , ) be the expected number of -sets of roots in ℤ . Conditioning on the reduced degree and applying Corollary 2.11 shows that This rearranges to give˜( In other words,˜( , ) is a weighted average of the ( , ) for ⩽ . We now show that ( , ) and˜( , ) are equal and independent of , provided that ⩾ 2 . Therefore,˜( Similarly, we have The following lemma now proves the first part of Theorem 1(c), namely, that  ( ) is a polynomial of degree at most 2 . Proof. By (36) and (37) it suffices to show that for each fixed g in split , the values of the inner integrals ∫ ℎ∈ℤ [ ] − | Res(g, ℎ)| ℎ and ∫ ℎ∈ − | Res(g, ℎ)| ℎ are equal and independent of for ⩾ 2 . Our argument is quite general, in that we only use that g is monic, not that it is split. We assume that ⩾ 2 , and write each ℎ ∈ ℤ [ ] − uniquely as ℎ = g + with ∈ ℤ [ ] −2 and ∈ . This sets up a bijection ( , ) ↦ ℎ = g + from ℤ [ ] −2 × to ℤ [ ] − (using here that − ⩾ ). Now using Res(g, ℎ) = Res(g, ), and the fact that our By (31), we have lim →∞ ( , ) = lim →∞ ( , , ). Either directly from the definitions, or as a special case of (32), we have ( , , ) = ( , ). Therefore, The analog of (2) for * shows that for ⩽ − 2, we have lim →∞ ( +1 2 ) * ( , ) = 1 ! .
The reader may recognize this as the answer to the derangements problem, that is, the probability that a random permutation on letters has no fixed point. This is the case because, by Lemma 4.1, monic polynomials without ℚ -roots correspond, in the large limit, to permutations without fixed points. Similarly, the limit lim →∞ * ( , ) = (1∕ !) ∑ − =0 (−1) ∕ ! is equal to the probability that a random permutation on letters has exactly fixed points.

A C K N O W L E D G E M E N T S
We thank the CMI-HIMR Summer School in Computational Number Theory held at the University of Bristol in June 2019, where this work began. We also thank Xavier Caruso for kindly sharing with us an earlier draft of his paper [4], and Jordan Ellenberg, Hendrik Lenstra, Steffen Müller, Bjorn Poonen, Lazar Radičević, Arul Shankar, and Jaap Top for many helpful conversations.
The first author was supported by a Simons Investigator Grant and NSF grant DMS-1001828. The second author was supported by the Heilbronn Institute for Mathematical Research. The fourth author was supported in part by DFG-Grant MU 4110/1-1.
We thank the referees for a careful reading of our paper, and for providing the additional references at the end of Section 1.1.

J O U R N A L I N F O R M AT I O N
The Proceedings of the London Mathematical Society is wholly owned and managed by the London Mathematical Society, a not-for-profit Charity registered with the UK Charity Commission. All surplus income from its publishing programme is used to support mathematicians and mathematics research in the form of research grants, conference grants, prizes, initiatives for early career researchers and the promotion of mathematics.