I have some problem with the understanding of the following theorem from rudin:
Theorem $11.7$: If $f \in C(T)$ and if $Hf$ is defined on the closed unit disc $\bar U$ by
$$(Hf)(re^{i\theta})=\begin{cases}f(e^{i\theta})& r=1\\ P[f](re^{i\theta})& 0\le r<1 \end{cases} ,$$
then $Hf \in C(\bar U)$.
Now recall that $T=$Unit circle and $U=$ unit disc and $f\in L^1(T)$ then
$$P[f](re^{i\theta})=\frac{1}{2\pi} \int_{-\pi}^{\pi}P_r(\theta -t)f(t)dt$$
where $\displaystyle P_r(t)=\sum_{-\infty}^{\infty}r^{|n|}e^{int},~$ for $0\le r<1,~t \in \mathbb R$. Now proof of the above theorem given as:

Now I am not able to figure out one thing:
$(a)$ How did they get equation in $(5)$ by using $(4)$ for $r \neq 1?$ That is, how to derive $(Hg)(re^{i\theta})=\displaystyle \sum_{n=-N}^{N} c_nr^{|n|}e^{in\theta}~$ from $~g(e^{i\theta}) = \displaystyle \sum_{n=-N}^{N} c_n e^{in\theta}~$ and using $(1)?$
Can you please help me to understand this? Thank you.
The proof of $Hg \in C(\overline U)$, from (4) onwards, is only for a trigonometric polynomial (i.e. a finite linear combination of the functions $e^{in\theta}$). At the end of the proof Rudin shows that this is true for every $f \in C(\overline U)$