A heuristic for the density of solutions to Diophantine equations

You are on the way to redeveloping the singular series, which does indeed give the correct asymptotic for integral solutions to many flavors of Diophantine equation -- they key words here are "Hardy-Littlewood method" or "circle method," which you can read about in any text on analytic number theory, such as the book of Iwaniec and Kowalski.

Loosely speaking -- when the number of variables is very large relative to the degree of the equation, the singular series is known to give you the right asymptotic. When the number of variables is somewhat large relative to the degree of the equation, it is expected to give the right asymptotic but there are no proofs outside very special cases.


In 1989, Manin and his collaborators formed a series of conjectures on the asymptotic behaviour of the number of solutions to diophantine equations. Let $X\subset \mathbb{P}^n$ be a fano variety (that is $-K_X$ is ample) under its anticanonical embedding, and let $H$ be the associated height function. Then it is expected that there exists a zariski open subset $U \subset X$ such that the number of rational points of height less than $B$ (e.g. the number of solutions in an expanding ball or box) is asymptotic to $c_X B(\log B)^{r_X},$ as $B \to \infty$ for some constants $c_X$ and $r_X$.

This result is true in some cases, for example complete intersections with many variables and small degree via the circle method, quadratic forms, toric varieties, flag varieties and also for some del Pezzo surfaces. But there are counter-examples showing that it is not true for all fano varieties (namely one expects $r_X=\textrm{rank } \textrm{Pic}(X)-1$, but this is not true in general).

At any rate, Peyre formed a conjecture on the leading constant $c_X$ which occurs in the asymptotic formula. It is very close to what you describe. One defines a measure on the set of adelic points on $X$, and then the leading constant is essentially the volume of the closure of $X(\mathbb{Q})$ inside the adeles. This is really an adelic integral and not a real integral, but for suitable varieties (namely those which satisfy weak approximation), the local factors at the primes come out as the $c_p$ in the way you describe. In general though one needs to introduce convergence factors to insure that the product over the $c_p$ converges. These come from an Artin L-function associated to the Picard group.

There are however some extra factors $\alpha$ and $\beta$ present in the constant, related to the position of the anticanonical divisor in the effective cone and the Brauer group of $X$. For conics with a rational point, we have $\alpha=1/2$ and $\beta =1$. This might explain your missing factor of two.

Papers:

J. Franke, Y. I. Manin and Y. Tschinkel, Rational Points of Bounded Height on Fano Varieties. Invent. Math. 95, 421--435 (1989).

E. Peyre, Hauteurs et measures de Tamagawa sur les variétiés de Fano. Duke Math. J., 79(1), 101--218 (1995).


Searching including the key phrases "Hardy-Littlewood circle method" and "singular series", as suggested by the other answers, turned up some interesting references which shed light on the question and why I obtained the results I did for the cases mentioned. As the question is already quite long and would become rather unmanageable to add this as a large update, I'm adding it as an answer here.

The product $\prod_pc_p$ is indeed called the singular series and $\int\Vert\nabla f\Vert^{-1}\,d\sigma$ is the singular integral. The product does asymptotically give the number of solutions subject to hypotheses and/or conditions on $f$, generally seeming to work better when the number of variables is large relative to the degree. For quadratic forms, the paper A new form of the circle method, and its application to quadratic forms by D.R. Heath Brown (Journal für die reine und angewandte Mathematik, 1996. Preprint available here) gives expressions for the asymptotic density which show why I obtained the results I did for Pythagorean triples and quadruples mentioned in the question. For a quadratic form $f$ in $n$ variables, they show the following.

  • For $n\ge5$, expression (2) for the asymptotic density given in the question is correct, so the heuristic works! (Theorem 5 of the D.R. Heath Brown paper).
  • For $n=4$ and the determinant of $f$ not a perfect square, you should multiply the terms $c_p$ by $1-\chi(p)p^{-1}$ and the overall expression by $L(1,\chi)$ (Theorem 6 of the paper). Here, the character $\chi$ is the Jacobi symbol $\left({\rm det}(f)\over\ast\right)$. Leaving out these terms will give a product which is not unconditionally convergent, as happened for Pythagorean quadruples.
  • For $n=4$ and the determinant of $f$ a perfect square, the product $\prod_pc_p$ will diverge to infinity (assuming that there are solutions in every $p$-adic field, so $c_p\not=0$). Instead, $c_p$ should be multiplied by $1-p^{-1}$ and the overall density by $\log\Vert x\Vert$ (Theorem 7 of the paper).
  • For $n=3$ then expression (2) given in the question works after multiplying by a factor of $\frac12$ (Theorem 8 and Corollary 2 of the paper)! This is why I was out by a factor of 2 for Pythagorean triples. The D.R. Heath Brown paper has the following to say on this.

    ...It therefore remains to understand the appearance of the factor $\frac12$ in the case $n=3$, which can be thought of as corresponding to a Tamagawa number of 2. In the proof of Theorem 8 this factor arises from the residue at s = 0 of $$\zeta(2s+1)\frac{P^s}{s}.$$

I'm not very familiar with Tamagawa numbers and am not yet sure whether this is the same as the factor $\alpha=\frac12$ mentioned in Daniel's answer or how it comes into the heuristic derivation.