While working through my Complex Analysis text, I encountered the following problem:
If $f$ is entire and $\Gamma$ is any contour, then for each $\epsilon > 0$ there exists a polynomial $P(z)$ such that $$|f(z)-P(z)|<\epsilon\quad\text{for all } z \text{ on } \Gamma.\tag{*}$$ Assuming this fact, prove that if $f$ is entire, then $\int_\Gamma f(z)=0$ for all closed contours $\Gamma$.
This theorem is fairly obvious, but I seem to have come up with a flawed proof, and I am unable to find the error in it. My proof is as follows:
Let $\epsilon > 0$ be given, and let $P(z)$ be any polynomial such that $(*)$ is satisfied.
Then, using that $\int_\Gamma P(z) = 0$ for any polynomial $P$ and closed contour $\Gamma$,
$$\begin{align}
\left| \int_\Gamma f(z)\,dz\right| &= \left| \int_\Gamma f(z)\,dz - \int_\Gamma P(z)\,dz\right|\tag{$1$: Adding zero integral}\\
&=\left| \int_\Gamma [f(z)-P(z)]\,dz\right| \tag{$2$: Combining Integrals}\\
&\le\int_\Gamma \left| f(z)-P(z)\right|\,dz \tag{$3$: Triangle Inequality}\\
&\lt\int_\Gamma \epsilon \;dz \tag{$4$: $|f(z)-P(z)|<\epsilon$}\\
& = 0 \tag{$5$: $\epsilon$ is constant polynomial}\\
\end{align}$$
Clearly something is wrong with this since $| \cdot | > 0$, but I can't tell what went wrong.
Would anyone mind pointing out the flawed line number(s)?
Thank you.
In step 3, you should have $|dz|$ instead of $dz$.