TITLE: Does Weyl's Inequality prove equidistribution?
QUESTION [13 upvotes]: Let $f(n) = \theta n^d + a_{d-1} n^{d-1} + \cdots a_1 n + a_0$ be a polynomial with real coefficients, and $\theta$ irrational. Let $S_N = \sum_{n=1}^N e^{2 \pi i f(n)}$. Weyl's Equidistribution theorem for polynomials is equivalent to the claim that $S_N/N \to 0$ as $N \to \infty$. You can read a nice proof of this theorem on Terry Tao's blog (see Corollary's 5 and 6). I had thought that Weyl's Inequality was supposed to be a more precise version of this bound. However, I can't actually figure out how to get Weyl's Inequality to imply the required claim!
Specifically, let $p/q$ be a rational number in lowest terms with $|\theta - p/q| \leq 1/q^2$. Weyl's Inequality is the bound:
$$S_N/N \leq 100 \left( \log N \right)^{d/2^d} \left( \frac{1}{q} + \frac{1}{N} + \frac{q}{N^d} \right)^{1/(2^d-1)}$$
Here are I am quoting from Timothy Gowers' notes. (UPDATE: George Lowther, below, suggests that Gowers may have a typo.) Wikipedia has a softer version, with more freedom in choosing parameters; I think my question applies to both versions.
Now, suppose that the convergents $p_i/q_i$ of $\theta$ grow so fast that $q_{i+1} > e^{(d+1) q_i}$. 
And take $N \approx e^{q_i}$. I get that, for any choice of $q$ with $|\theta - p/q| < 1/q^2$, either $1/q > 1/\log N$ or $q/N^d > 1$. This gives infinitely many $N$'s for which the right hand bound is useless (greater than $1$). So it seems that Weyl's inequality does not prove $S_N/N \to 0$.
Am I missing something?
The motivation for this question was my attempt to answer this question over at math.SE. So any useful comments you have on that question would be appreciated as well.

REPLY [2 votes]: This response is in answer to David's further question about whether it is possible to bound the rate at which SN/N tends to zero, as he was wanting to use Weyl's inequality to do.
This is not possible, even in the case d=2 and f(n)=θn2. (for d=1 it is not hard to show that SN is bounded so $S_N/N=O(N^{-1})$).
Set
$$
S_N(\theta)=\sum_{n=1}^Ne^{2\pi i\theta n^2}
$$
in the following. Given any function h: ℕ → ℝ+ with liminfnh(n) = 0, I show that there are irrational θ with
$$
\begin{array}{}\displaystyle\sup_N\vert S_N(\theta)/(h(N)N)\vert=\infty.&&(*)\end{array}
$$
[Note: The following is a much simpler argument than the original version]. I'll use the Baire category theorem to find counterexamples

For any countable collection An of open dense subsets of ℝ, the intersection A = ∩nAn is dense in ℝ.

In particular, any such A is nonempty. We can say more than this; if S is a countable subset of the reals then $A\setminus S=\left(\bigcap_nA_n\right)\cap\left(\bigcap_{s\in S}\mathbb{R}\setminus\{s\}\right)$ is an intersection of dense open sets, so is dense. In particular, A will contain a dense set of irrational values.
To construct counterexamples then, it is only necessary to show that the set of all θ at which the sequence diverges to infinity is an intersection of countably many open sets, and show that it contains a dense set of rational numbers. The Baire category theorem implies that it will also diverge at a dense set of irrationals.
In fact, for any sequence xn(θ) depending continuously on a real parameter θ, the set of values of θ for which it diverges to infinity is an intersection of countably many open sets
$$
\{\theta\colon\sup_n\vert x_n(\theta)\vert=\infty\}=\bigcap_n\bigcup_m\{\theta\colon\vert x_m(\theta)\vert>n\\}.
$$
So, we only need to find a dense set of rational numbers at which (*) holds.

Let θ = a/b for integers a,b with b > 0. Setting $x=S_b(\theta)/b$ then $S_N(\theta)/N\to x$ as $N\to\infty$.

Proof:
If m ≡ n (mod b) then θm2 - θn2 is an integer, and $e^{2\pi i\theta m^2}=e^{2\pi i \theta n^2}$. So $n\mapsto e^{2\pi i\theta n^2}$ has period b, giving
$$
S_{bN}(\theta)=\sum_{j=0}^{N-1}\sum_{k=1}^{b}e^{2\pi i\theta(jb+k)^2}=N\sum_{k=1}^be^{2\pi i\theta k^2}.
$$
So, SbN(θ) = NSb(θ). Now, any N can be written as N = bM + R for some R < b. Then, $\vert S_N-MS_b\vert\le R$ and, dividing by N gives $\vert S_N/N-S_b/b\vert\to0$ as N goes to infinity.
As |SN(θ)/(h(N)N)| ∼ |x|/h(N) → ∞ whenever x is nonzero, the following shows that (*) holds whenever θ is of the form a/p for an odd prime p not dividing a. Such rationals are dense, so the existence of irrational θ for which (*) holds follows from the Baire category theorem.

Let θ = a/p for integers a,p with p an odd prime not dividing a. Then $x=S_p(\theta)/p$ is nonzero.

Proof:
Note that $u=e^{2\pi i a/p}$ is a primitive p'th root of unity with minimal polynomial $X^{p-1}+X^{p-2}+\cdots+X+1$ over the rationals. Then, all proper subsets of $\{1,u,u^2,\ldots,u^{p-1}\}$ are linearly independent over the rationals and
$$
S_p(\theta)=\sum_{k=1}^{p}u^{k^2}=1+2\sum_{k=1}^{(p-1)/2}u^{k^2}
$$
is nonzero.
In fact as pointed out by David below, Sp is a Gauss sum and has size √p.