Exercise 5.4.3. Fill in the gaps marked (why?) in Lemma 5.4.6. (Hint: for the first identity, use the identities $|z|^2 = z\overline{z}, \overline{e_n} = e_{-n}$, and $e_ne_m = e_{n+m}$.)
For the first part, I found that $F_N = \sum_{n=1}^{N-1}\frac1n (\overline{e_n} + e_n)$, using $\overline{e_n} = e_{-n}$, but I am not sure how this can be transformed into $\frac1N |\sum_{n=0}^{N-1} e_n|^2$.
For the second part, I understand that $\sum_{n=0}^{N-1} e_n= \frac{1-e_N}{1-e_1} = \frac{e_N - e_0}{e_1 - e_0}$, but I don't understand why this is equal to $\frac{e^{\pi i (N-1)x \sin(\pi N x)}}{\sin(\pi x)}$. I also do not know why $\frac1N |\frac{e^{\pi i (N-1)x \sin(\pi N x)}}{\sin(\pi x)}|^2 = \frac{\sin(\pi N x)^2}{N\sin(\pi x)^2}$.
I appreciate if you give some help.


Recall that $|z|^2 = z\bar z$ for any complex number $z$.
For the first, write : $$ \frac 1N\left|\sum_{n=0}^{N-1} e_n\right|^2 = \frac 1N\left(\sum_{n=0}^{N-1} e_n\right)\overline{\left(\sum_{m=0}^{N-1} e_m\right)} = \frac 1N\left(\sum_{n=0}^{N-1} e_n\right)\left(\sum_{n=0}^{N-1} \overline{e_m}\right)$$
because I took the $\overline{\cdot}$ inside the summation. Then I just expand the product by distributivity. Next, I use $\overline{e_m} = e_{-m}$.
$$= \frac 1N \sum_{m,n = 0}^{N-1} e_{-m}e_n = \frac 1N\sum_{m,n = 0}^{N-1} e_{n-m} = \frac 1N\sum_{k \in \mathbb N} \left[\sum_{m,n = 0 \to N-1 \\ \ \ \ n-m = k}e_k\right]$$
The last , in words is this : the $e_k$ which appear in the summation, are those $k$, for which we can find $m,n \in \{0,...,N-1\}$ such that $n-m =k$. For each such $k$, $e_k$ appears as many times in the summation, as there are pairs $m,n$ for which $n-m = k$.
Now, all we are left to see is this : It is clear that only those from $1-N$ to $N-1$ will get covered. How many times will one $e_k$ come?
Let us take an example. If $N=6$ and $k = -3$, then $-3 = 0-3=1-4=2-5$, so there are three ways of doing this , and $6 - |-3| = 3$.
Similarly, given any $k \in \{-(N-1),...,(N-1)\}$, there are exactly $N - |k|$ ways of writing $k = m-n$ for $m,n \in \{0,...,N-1\}$. If $k$ were positive, for example, then these ways would be $k-0,k+1-1,...,N-1 - (N-1-k)$.
Therefore, we get : $$ \frac 1N\sum_{k \in \mathbb N} \left[\sum_{m,n = 0 \to N-1 \\ \ \ \ n-m = k}e_k\right] = \frac 1N \sum_{k = 1-N}^{N-1} (N - |k|)e_k = \frac 1N\sum_{k=-N}^N (N - |k|)e_k $$
where the $k=N,-N$ terms are zero, so we just put them in the summation to get the author's expression (so my earlier rant about $F_N , F_{N-1}$ was wrong).
Finally, taking the $\frac 1N$ inside , and using $\frac{N - |k|}{N} = 1 - \frac{|k|}{N}$ gives the result.
For the second part, we have $\frac{e_N - 1}{e_1- 1}$. We need a formula here, one that is easy to verify from Euler's formula : $\frac{e^{ti} - e^{-t i}}{2i} = \sin(t)$ for any real $t$.
So we do this : $$ e_1 -1 = e^{2 \pi i x} - 1 = e^{\pi ix}(e^{\pi ix} - e^{-\pi ix}) = 2ie^{\pi ix} \sin (\pi x) $$
For the numerator, we do : $$ e^{2 \pi i N x} - 1 = e^{\pi i Nx}(e^{\pi i N x} - e^{-\pi i n x}) = 2i e^{\pi i N x} \sin(\pi Nx) $$
Divide and conclude.
For the squaring part, observe that $|e^{2 \pi i t x}| = 1$ for any real $t$. Keeping this in mind, just squaring the expression $\frac 1N \frac{e^{\pi i (N-1)x} \sin( \pi Nx)}{\sin(\pi x)}$ and applying the modulus gives the result, since $|e^{2 \pi i (N-1)x}| = 1$, and the $\sin$ terms are real.