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 $\left\langle{x}\right\rangle$ denotes the non-Archimedean absolute value of the difference between $x$ and the closest integer to $x$, i.e.:
 * $\displaystyle \left\langle{x}\right\rangle = \inf_{z \mathop \in \Z} \left\{ {\left|{x - z}\right|}\right\}$

Since $p$ is odd, we have:

Now:
 * $\ln \dfrac {2 x + 1} {2 x - 1} > \dfrac 1 x$

for $x > 1$.

To prove this, it suffices to show that the function $f: \left[{1 \,.\,.\, \infty}\right) \to \R$ given by:
 * $f \left({x}\right) = x \ln \dfrac {2 x + 1} {2 x - 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:
 * $f'' \left({x}\right) = \dfrac {-4} {4 x^2 - 1} \left({1 - \dfrac {4 x^2 + 1} {4 x^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: