Pólya-Vinogradov Inequality

Theorem
Let $p$ be a positive prime number.

Then:
 * $\forall m, n \in \N: \displaystyle \left|{\sum_{k=m}^{m+n} \left({\frac k p}\right)}\right| < \sqrt p \ \ln p$

Proof
Start with the following manipulations:

The expression:
 * $\displaystyle\sum_{k=0}^{p-1} \left({\frac k p}\right) e^{-2 \pi i a t/p}$

is a Gauss sum, and has magnitude $\sqrt{p}$.

Hence:

Here $\langle x \rangle$ denotes the non-Archimedean absolute value of the difference between $x$ and the closest integer to $x$, i.e.:
 * $\langle x \rangle = \inf_{z \in {\bf Z}} \{|x-z|\}$

Since $p$ is odd, we have:

Now $\displaystyle \ln \frac{2x+1}{2x-1} > \frac 1 x$ for $x > 1$.

To prove this, it suffices to show that the function $f: [1 .. \infty) \to \R$ given by:
 * $\displaystyle f(x) = x \ln \frac{2x+1}{2x-1}$

is decreasing and approaches $1$ as $x \to \infty$.

To prove the latter statement, substitute $v = 1/x$ and take the limit as $v \to 0$ using L'Hospital's Rule.

To prove the former statement, it will suffice to show that $f'$ is less than zero on the interval $[1 .. \infty)$.

But $f'(x) \to 0$ as $x \to \infty$ and $f'$ is increasing on $[1 ..\infty)$, since $\displaystyle f''(x) = \frac{-4}{4 x^2-1} \left({1-\frac{4x^2+1}{4x^2-1}}\right) > 0$ for $x > 1$, so $f'$ is less than zero for $x > 1$.

With this in hand, we have: