Would you please help me solve Exercise 4.2(b) on page 20 of the online document Characters. I repeat that exercise here:
Let $p$ be a prime, $p \equiv 1$ (mod $4$), and let $\mathcal N$ be a set of $Z$ residue classes modulo $p$. Suppose that $\left( \frac{m - n}p \right) = 1$ whenever $m \in \mathcal N, n \in \mathcal N$, and $m \ne n$. Show that $Z < \sqrt p$.
$\left( \frac \cdot p \right)$ is the Legendre symbol.
The document is a supplement to An Introduction to the Theory of Numbers by Niven, Zuckerman, and Montgomery.
I am trying to use the result of the previous part of the exercise: $$\sum_{m \in \mathcal N} \sum_{n \in \mathcal N} \left( \frac{m - n}p \right) = \frac1{\sqrt p} \sum_{a=1}^p \left( \frac a p \right) \left| \sum_{n \in \mathcal N} e^{2\pi ian/p} \right| ^2. \tag a$$ The left side simplifies to $$\sum_{m \in \mathcal N} \sum_{n \in \mathcal N} \left( \frac{m - n}p \right) = \sum_{\substack{m, n \in \mathcal N \\ m \ne n}} 1 = Z^2 - Z = Z(Z - 1)$$ because there are $Z$ ways to choose $m$, and $Z$ ways to choose $n$, which gives $Z^2$ total ordered pairs $(m, n)$ less the $Z$ pairs for which $m = n$. The right side, with more work, simplifies to the same expression. In other words, all I did was to verify (a) for the special case of Exercise 4.2(b), but that does not help me prove that $Z < \sqrt p$.
If I can prove that the right side of (a) is less than either $p - Z$, $(Z - 1) \sqrt p$, or $Z\sqrt p - Z^2/\sqrt p$, I am done.