Pólya-Vinogradov Inequality

Theorem
Let $p$ be a positive odd prime.

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

where $\left({\dfrac k p}\right)$ is the Legendre symbol.

Proof
Start with the following manipulations:

The expression:
 * $\displaystyle\sum_{k \mathop = 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.:
 * $\displaystyle \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: \left[{1 \,.\,.\, \infty}\right) \to \R$ given by:
 * $\displaystyle f \left({x}\right) = 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 $\left[{1 \,.\,.\, \infty}\right)$.

Now we have that:
 * $\displaystyle f'' \left({x}\right) = \frac{-4}{4 x^2-1} \left({1-\frac{4x^2+1}{4x^2-1}}\right) > 0$ for $x > 1$

So $f'$ is increasing on $\left[{1 \,.\,.\, \infty}\right)$.

But $f' \left({x}\right) \to 0$ as $x \to \infty$.

So $f'$ is less than zero for $x > 1$.

With this in hand, we have: