I have been reading Sieve theory from notes of Zeev Rudnick here:http://www.math.tau.ac.il/~rudnick/courses/sieves2015.html and I have a question on page 5 of lecture 14 here: http://www.math.tau.ac.il/~rudnick/courses/sieves2015/LargeSieve1.pdf
In the Proof of lemma 3.2 I don't understand how the author wrote: Thus, $\sum_{a (mod p) } | L(a/p)|^2 = \sum_{a (mod p)} | \sum_{ h (mod p)} e(ah /p) Z(p,h) |^2 = \sum_{h (mod p)} \sum_{ k (mod p)} Z(p,h) \overline{Z(p,k)} \sum_{ a (mod p) } e^{( a(h-p) )/p }$
Can you please help me deducing these equalities?
Since $|w|^2 = w\overline w$ for any complex number $w$, we have \begin{align*} \biggl| \sum_{ h \pmod p} e(ah /p) Z(p,h) \biggr|^2 &= \biggl( \sum_{ h \pmod p} e(ah /p) Z(p,h) \biggr) \overline{\biggl( \sum_{ h \pmod p} e(ah /p) Z(p,h) \biggr)} \\ &= \biggl( \sum_{ h \pmod p} e(ah /p) Z(p,h) \biggr) \overline{\biggl( \sum_{ k \pmod p} e(ak /p) Z(p,k) \biggr)} \\ &= \biggl( \sum_{ h \pmod p} e(ah /p) Z(p,h) \biggr) \biggl( \sum_{ k \pmod p} e(-ak /p) \overline{Z(p,k)} \biggr), \end{align*} where the second equality is valid because we can use any indexing variable we want, and useful because we want to combine those two summands within the same expression. (We also used $\overline{e(t)} = e(-t)$ for any real number $t$.) Therefore \begin{align*} \sum_{a \pmod p} \biggl| \sum_{ h \pmod p} e(ah /p) Z(p,h) \biggr|^2 &= \sum_{a \pmod p} \sum_{ h \pmod p} e(ah /p) Z(p,h) \sum_{ k \pmod p} e(-ak /p) \overline{Z(p,k)} \\ &= \sum_{ h \pmod p} \sum_{ k \pmod p} Z(p,h) \overline{Z(p,k)} \sum_{a \pmod p} e(ah /p) e(-ak /p) \end{align*} is just reordering the summations, and the result follows using $e(s)e(-t) = e(s-t)$.