\documentclass[a4paper]{article}

\def\npart{IB}

\def\ntitle{Complex Analysis}
\def\nlecturer{G.\ P.\ Paternain}

\def\nterm{Lent}
\def\nyear{2018}

\input{header}

\newcommand*{\D}{\mathcal{D}}
\DeclareMathOperator*{\res}{Res}
\DeclareMathOperator*{\ord}{ord}

\begin{document}

\input{titlepage}

\tableofcontents

\section{Basic notions}

Some preliminary notations/definitions:

\begin{notation}\leavevmode
  \begin{itemize}
  \item \(D(a, r)\) is the open disc of radius \(r > 0\) and centred at \(a \in \C\).
  \item \(U \subseteq \C\) is open if for any \(a \in U\), there exists \(\varepsilon > 0\) such that \(D(a, \varepsilon) \subseteq U\).
  \item A \emph{curve} is a continuous map from a closed interval \(\varphi: [a, b] \to \C\). It is continuously differentiable, i.e.\ \(C^1\), if \(\varphi'\) exists and is continuous on \([a, b]\).
  \item An open set \(U \subseteq \C\) is \emph{path-connected} if for every \(z, w \in U\) there exists a curve \(\varphi: [0, 1] \to U\) with endpoints \(z, w\).
  \end{itemize}
\end{notation}

\begin{definition}[Domain]\index{domain}
  A \emph{domain} is an non-empty path-connected open subset of \(\C\).
\end{definition}

\subsection{Complex differentiation}

The goal of this course is to study functions \(f: U \to \C\) where \(U \subseteq \C\) is open or is a domain. Given such an \(f\), we may write
\[
  f(x + iy) = u(x, y) + iv(x, y)
\]
where \(u, v: U \to \R\) are the real and imaginary part of \(f\). Here we use \((x, y) \in \R^2\) to denote the coordinates of \(a + bi \in \C\).

\begin{definition}[Differentiable, holomorphic]\index{complex differentiable}\index{holomorphic}\leavevmode
  \begin{enumerate}
  \item \(f: U \to \C\) is \emph{differentiable} at \(w \in U\) if the limit
    \[
      f'(w) = \lim_{z \to w} \frac{f(z) - f(w)}{z - w}
    \]
    exists. \(f'(w)\) is called the \emph{derivative} of \(f\) at \(w\).
  \item \(f\) is \emph{holomorphic} at \(w\) if there exists \(\varepsilon > 0\) such that \(f\) is differentiable at all points of \(D(w, \varepsilon)\). \(f\) is holomorphic on \(U\) if it is differentiable at all \(w \in U\). Equivalent, \(f\) is holomorphic at at all \(w \in U\).
  \end{enumerate}
\end{definition}

\begin{remark}\leavevmode
  \begin{enumerate}
  \item There is an alternative term \emph{analytic}. In actuality, it is the same as holomorphic for complex functions. However, it comes with a flavour associated with the Taylor expansion and sometimes defined in terms of such. Later in the course we will prove that the definitions are equivalent.
  \item Complex differentiation follows the same rules as real differentiation. For example, sums of differentiable functions are differentiable, product, quotient, chain rules etc also hold.
  \end{enumerate}
\end{remark}

\begin{definition}[Entire]\index{entire}
  An \emph{entire} function is a holomorphic function \(f: \C \to \C\).
\end{definition}

\begin{eg}\leavevmode
  \begin{enumerate}
  \item Polynomials are entire functions.
  \item If \(p(z)\) and \(q(z)\) are polynomials with \(q(z)\) not identically zero, then \(\frac{p}{q}\) is holomorphic on \(\C \setminus \{\text{zeros of } q\}\).
  \end{enumerate}
\end{eg}

In IB Analysis II we studied function from \(\R^n\) to \(\R^m\) and their differentiability. Indeed a complex function \(\C \to \C\) can be view as a function \(\R^2 \to \R^2\) so how does complex differentiability relates to differentiablitiy in \(\R^2\)? It turns out that in addition to satisfy the differentiability on \(\R^2\), the function has to satisfy a particular partial differential equation.

Recall that \(u\) is differentiable at \((c, d) \in U\) if there exists \((\lambda, \mu) \in \R^2\) such that
\[
  \frac{u(x, y) - u(c, d) - (\lambda(x - c) + \mu(y -d))}{\sqrt{(x - c)^2 + (y - d)^2}} \to 0
\]
as \((x, y) \to (c, d)\). In this case \(\D u(c, d) = (\lambda, \mu)\) is the derivative of \(u\) at \((c, d)\). If this holds then \(\lambda = u_x(c, d)\) and \(\mu = u_y(c, d)\), the partial derivatives of \(u\) at \((c, d)\).

\begin{theorem}[Cauchy-Riemann equations]\index{Cauchy-Riemann equations}
  \(f: U \to \C\) is differentiable at \(w = c + id \in U\) if and only if the functions \(u\) and \(v\) are differentiable at \((c, d)\) and
  \begin{align*}
    u_x(c, d) &= v_y(c, d) \\
    u_y(c, d) &= -v_x(c, d)
  \end{align*}
  in which case
  \[
    f'(w) = u_x(c, d) + iv_x(c, d).
  \]
\end{theorem}

\begin{proof}
  From the definition, \(f\) will be differentiable at \(w\) with derivative \(f'(w) = p + iq\) if and only if
  \[
    \lim_{z \to w} \frac{f(z) - f(w) - f'(w)(z - w)}{|z - w|} = 0
  \]
  or equivalently, splitting into real and imaginary parts,
  \begin{align*}
    \lim_{(x, y) \to (c, d)} \frac{u(x, y) - u(c, d) - (p(x - c) - q(y - d))}{\sqrt{(x - c)^2 + (y - d)^2}} &= 0 \\
    \lim_{(x, y) \to (c, d)} \frac{v(x, y) - v(c, d) - (q(x - c) + p(y - d))}{\sqrt{(x - c)^2 + (y - d)^2}} &= 0
  \end{align*}
  since \(f'(w)(z - w) = (p(x - c) - q(y - d)) + i(q(x - c) + p(y - d))\). So \(f\) is differentiable at \(w\) with derivative \(f'(w) = p + iq\) if and only if \(u\) and \(v\) are differentiable at \((c, d)\) with
  \begin{align*}
    \D u(c, d) &= (p, -q) \\
    \D v(c, d) &= (q, p)
  \end{align*}
  hence the result.
\end{proof}

\begin{eg}
  Let \(f(z) = \conj z\). Then \(f(x + iy) = x - iy\), \(u(x, y) = x, v(x, y) = -y\). We have
  \[
    u_x = 1 \neq -1 = v_y
  \]
  so \(f\) is not differentiable anywhere in \(\C\).
\end{eg}

\begin{remark}\leavevmode
  \begin{enumerate}
  \item We could have discovered Cauchy-Riemann as follows: let \(z = w + h\) where \(h \in \R\). Then
    \[
      f'(w) = \lim_{h \to 0} \frac{f(w + h) - f(w)}{h} = u_x(c, d) + iv_x(c, d).
    \]
    Let \(z = w + ih\), we get
    \[
      f'(w) = \lim_{h \to 0} \frac{f(w + ih) - f(w)}{h} = v_y(c, d) - iu_y(c, d).
    \]
    As \(f\) is assumed to be differentiable, these two must agree.
  \item Later on we'll see that if \(f\) is holomorphic, so is \(f'\). This will imply right away that all partial derivatives of \(u\) and \(v\) exist and are continuous, i.e.\ \(C^\infty\). Thus
    \begin{align*}
      u_{xx} &= v_{yx} \\
      u_{yy} &= -v_{xy}
    \end{align*}
    By symmetry of second derivatives, we get that \(u\) satisfies the Laplace equation
    \[
      u_{xx} + u_{yy} = 0.
    \]
    Hence \(f\) is holomorphic implies that the real and imaginary parts are harmonic functions.
  \end{enumerate}
\end{remark}

\begin{corollary}
  Let \(f = u + iv: U \to \C\). Suppose the functions \(u\) and \(v\) have continuous partial derivatives everywhere in \(U\) and satisfy Cauchy-Riemann equations. Then \(f\) is holomorphic in \(U\).
\end{corollary}

\begin{proof}
  From IB Analysis II, \(u\) and \(v\) are differentiable. The result follows from the previous theorem.
\end{proof}

\begin{corollary}
  Let \(f: D \to \C\) be holomorphic on a domain \(D\) and suppose \(f'(z) = 0\) for all \(z \in D\). Then \(f\) is constant on \(D\).
\end{corollary}

\begin{proof}
  Follows from the analogous result for differentiable functions on a path-connected subset of \(\R^2\) (Mean Value Inequality from IB Analysis II).
\end{proof}

\subsection{Power series}

Recall that

\begin{theorem}[Radius of convergence]\index{radius of convergence}
  Let \(c_n\) be a sequence of complex numbers. Then there exists a unique \(R \in [0, \infty]\), the \emph{radius of convergence} of the series, such that
  \[
    \sum_{n = 0}^\infty c_n(z - a)^n,\, z, a \in \C
  \]
  converges absolutely if \(|z - a| < R\) and diverges if \(|z - a| > R\). If \(0 < r < R\) then the series converges uniformly on \(\{|z - a| \leq r\}\). The radius of convergence is given by
  \[
    R = \sup\{r \geq 0: |c_n|r^n \to 0\}.
  \]
\end{theorem}

\begin{theorem}
  Let \(f(z) = \sum_{n = 0}^\infty c_n(z - a)^n\) be a complex power series with radius of convergence \(R > 0\). Then
  \begin{enumerate}
  \item \(f\) is holomorphic on \(D(a, R)\),
  \item its derivative is given by the series \(\sum_{n = 1}^\infty nc_n(z - a)^{n - 1}\), which also has radius of convergence \(R\),
  \item \(f\) has derivatives of all orders on \(D(a, R)\) and \(f^{(n)}(a) = n!c_n\),
  \item if \(f\) vanishes identically on some disc \(D(a, \varepsilon)\) then \(c_n = 0\) for all \(n\).
  \end{enumerate}
\end{theorem}

\begin{proof}
  wlog assume \(a = 0\). Claim that \(\sum_{n = 1}^\infty nc_nz^{n - 1}\) has radius of convergence \(R\).

  \begin{proof}
    \(|nc_n| \geq |c_n|\) so its radius of convergence \(R'\) is at most \(R\).

    Suppose \(0 \leq r < R\) and pick \(\rho \in (r, R)\). Then \(\sum |c_n|\rho^n\) converges and
    \[
      \frac{n|c_n|r^{n - 1}}{|c_n|\rho^n} = \frac{n}{r}\underbrace{\left(\frac{r}{\rho}\right)^n}_{< 1} \to 0
    \]
    so by comparison test \(\sum nc_nr^{n - 1}\) converges and hence \(R' = R\).
  \end{proof}

  To show the derivative is of the desired form we shall do something clever. Consider the continous function
  \[
    h_n(z, w) = \sum_{j = 0}^{n - 1} z^j w^{n - 1 - j} =
    \begin{cases}
      \frac{z^n - w^n}{z - w} & \text{if } z \neq w \\
      nw^{n - 1} & \text{if } z = w
    \end{cases}
  \]
  for \(n \geq 1\). Consider the series
  \begin{equation}
    \label{eqn:hzw}
    \sum_{n = 1}^\infty c_nh_n(z, w).
    \tag{\(\ast\)}
  \end{equation}
  Claim that for every \(r < R\), \eqref{eqn:hzw} converges uniformly on the set \(\{(z, w): |z|, |w| \leq r\}\).

  \begin{proof}
    \(|c_nh_n(z, w)| \leq |c_n|nr^{n - 1} = M_n\). Since we know \(\sum M_n < \infty\), by Weierstrass M-test \eqref{eqn:hzw} converges uniformly.
  \end{proof}

  Thus it converges to a continuous function \(g(z, w)\). By definition
  \[
    g(z, w) =
    \begin{cases}
      \sum_{n = 1}^\infty c_n \frac{z^n - w^n}{z - w} = \frac{f(z) - f(w)}{z - w} & \text{if } z \neq w \\
      \sum_{n = 1}^\infty c_nnw^{n - 1} & \text{if } z = w
    \end{cases}
  \]
  As \(g\) is continuous, fixing \(w\) and letting \(z \to w\) we get
  \[
    \lim_{z \to w} \frac{f(z) - f(w)}{z - w} = \sum_{n = 1}^\infty nc_nw^{n - 1}.
  \]
  So \(f'(w)\) exists and equals to \(g(w, w)\) as desired. This proves (1) and (2). (3) follows by induction on \(n\). Finally if \(f\) vanishes identically on a disc about \(a\) then \(f^{(n)} = 0\) for all \(n\) and by (3) \(c_n = 0\) for all \(n\).
\end{proof}

\begin{proposition}[Weierstrass M-test]
  Let \(f_n\) be a sequence of functions such that \(|f_n(x)| \leq M_n\) for all \(x \in A\). If \(\sum M_n < \infty\) then \(\sum f_n(x)\) converges uniformly on \(A\).
\end{proposition}

\begin{proof}
  Exercise.
\end{proof}

\begin{definition}[Exponential]\index{exponential}
  The \emph{complex exponential} function is defined as
  \[
    e^z = \exp(z) = \sum_{n = 0}^\infty \frac{z^n}{n!}.
  \]
\end{definition}

\begin{proposition}\leavevmode
  \begin{enumerate}
  \item \(e^z\) is an entire function and \((e^z)' = e^z\).
  \item For all \(z, w \in \C\), \(e^{z + w} = e^ze^w\) and \(e^z \neq 0\).
  \item If \(z = x+ iy\), \(e^z = e^x (\cos y + i \sin y)\).
  \item \(\exp(z) = 1\) if and only if \(z \in 2\pi i \Z\).
  \item If \(w \in \C\), there exists \(z \in \C\) such that \(e^z = w\) if and only if \(w \neq 0\).
  \end{enumerate}
\end{proposition}

\begin{proof}
  Similar to the proof in IA Analysis I.
\end{proof}

We also define
\begin{align*}
  \cos z &= \frac{e^{iz} + e^{-iz}}{2} \\
  \sin z &= \frac{e^{iz} - e^{-iz}}{2i} \\
  \cosh z &= \frac{e^z + e^{-z}}{2} \\
  \sinh z &= \frac{e^z - e^{-z}}{2}
\end{align*}

\begin{definition}[Logarithm]\index{logarithm}
  If \(z \in \C\), we say that \(w \in \C\) is a \emph{logarithm} of \(z\) if \(\exp(w) = z\).
\end{definition}

From above we know \(z\) has a logarithm if and only if \(z \neq 0\). However, unlike in the real case, \(z\) would have an infinite number of logarithms, all different by an integer multiplier of \(2\pi\).

\begin{definition}[Branch of logarithm]
  Let \(U \subseteq \C\setminus \{0\}\) be open. We say that a continuous function \(\lambda: U \to \C\) is a \emph{branch of logarithm} if \(e^{\lambda(z)} = z\).
\end{definition}

\begin{remark}
  Any branch of logarithm is in fact automatically holomorphic:
  \begin{align*}
    \frac{\lambda(z) - \lambda(w)}{z - w}
    &= \frac{\lambda(z) - \lambda(w)}{e^{\lambda(z)} - e^{\lambda(w)}} \\
    \intertext{Let \(\lambda(w) = k, \lambda(z) = k + h\). Due to continuity of \(\lambda\), \(\lambda(z) - \lambda(w) = h \to 0\) so}
    &= \frac{h}{e^{k + h} - e^k} \\
    &\to \frac{1}{e^k} \\
    &= \frac{1}{w}
  \end{align*}
  as \(z \to w\). Thus \(\lambda\) is holomorphic and \(\lambda'(z) = \frac{1}{z}\).

  %the argument would have given differential exists for inverse function. If we know the invere was continuous. ONe can describe the inverse function theorem (with the argumentabove the continuity of the inverse is needed.
\end{remark}

One useful choice of branch is
\begin{definition}[Principal branch of logarithm]\index{principal branch of logarithm}
  Let \(U = \C \setminus \{x \in \R: x\leq 0\}\). The \emph{principal branch of logarithm} is the function
  \begin{align*}
    \log: U &\to \C \\
    z &\mapsto \log |z| + i \arg(z)
  \end{align*}
  where \(\arg(z)\) takes the unique argument of \(z\) in the interval \((-\pi, \pi)\).
\end{definition}

Check that this is indeed a branch of logarithm: the projection onto \(S^1\) \(\C \setminus \{0\} \to S^1, z \mapsto z/|z|\) is continuous and maps \(U\) to \(S^1 \setminus \{-1\}\). \((-\pi, \pi) \to S^1 \setminus \{-1\}, \theta \mapsto e^{i\theta}\) is a homeomorphism so has a continuous inverse. Thus \(z \mapsto \arg(z)\) is continuous. Also
\[
  \exp(\log z) = e^{i \log |z|}(\cos \arg(z) + i \sin \arg(z)) = z.
\]

\begin{proposition}\leavevmode
  \begin{enumerate}
  \item \(\log z\) is holomorphic on \(U\) with derivative \(\frac{1}{z}\).
  \item If \(|z| < 1\) then
    \[
      \log(1 + z) = \sum_{n = 1}^\infty \frac{(-1)^{n - 1}z^n}{n}.
    \]
  \end{enumerate}
\end{proposition}

\begin{proof}\leavevmode
  \begin{enumerate}
  \item See remarks above.
  \item Note that
    \begin{align*}
      \frac{d \log(1 + z)}{dz}
      &= \frac{1}{1 + z} \\
      \frac{d}{dz} \sum_{n = 1}^\infty \frac{(-1)^{n - 1}z^n}{n}
      &= \sum_{n = 1}^\infty (-1)^{n - 1}z^{n -1}
        = \frac{1}{1 + z}
    \end{align*}
    Thus their difference is constant. Now set \(z = 0\).
  \end{enumerate}
\end{proof}

\begin{remark}
  There is no way to extend \(\log z\) to a holomorphic (or even just continuous) function on \(\C \setminus \{0\}\) since
  \begin{align*}
    \lim_{\theta \to -\pi} \log e^{i\theta} &= -i\pi \\
    \lim_{\theta \to \pi} \log e^{i\theta} &= i\pi \\
  \end{align*}
  Later on we will see that there is no branch of logarithm on \(\C \setminus \{0\}\).
\end{remark}

We can also define fractional/complex powers by the formula
\[
  z^\alpha = \exp (\alpha \log z)
\]
for \(z \in U\). See example sheet.

\subsection{Conformal maps}

Let \(f: U \to \C\) be a holomorphic function on an open set \(U\) and suppose \(w \in U\) and \(f'(w) \neq 0\). In this section we study the property of \(f\) in neighbourhoods of \(w\). Take two \(C^1\)-curves \(\gamma_i: [0, 1] \to U\), \(i = 1, 2\) such that \(\gamma_i(0) = w, \gamma_i'(0) \neq 0\). Define the angle between \(\gamma_1, \gamma_2\) to be
\[
  \operatorname{angle}(\gamma_1, \gamma_2) = \arg(\gamma_1'(0)) - \arg(\gamma_2'(0)).
\]
Here \(\arg(z) = \theta \in [0, 2\pi)\) for \(z = re^{i\theta}\). Consider the images \(\delta_i(t) = f(\gamma_i(t))\). The new angle is
\[
  \operatorname{angle}(\delta_1, \delta_2) = \arg((f \compose \gamma_1)'(0)) - \arg((f \compose \gamma_2)'(0)).
\]
Now recall that
\[
  \arg(z) - \arg(w) = \arg(\frac{z}{w})
\]
so
\[
  \frac{(f \compose \gamma_1)'(0)}{(f \compose \gamma_2)'(0)}
  = \frac{f'(w)\gamma_1'(0)}{f'(w)\gamma_2'(0)}
  = \frac{\gamma_1'(0)}{\gamma_2'(0)}
\]
since \(f'(w) \neq 0\). Thus \(f\) preserves angles at \(w\). We say \(f\) is \emph{conformal}\index{conformal} at \(w\) in this case.

\begin{definition}[Conformal equivalence]\index{conformal equivalence}
  If \(f: D \to \C\) is holomorphic on a domain \(D\) with \(f' \neq 0\) everywhere and \(f\) injective, we say \(f\) is a \emph{conformal equivalence}.
\end{definition}

\begin{eg}\leavevmode
  \begin{enumerate}
  \item Möbius maps \(f(z) = \frac{az + b}{cz + d}\) where \(ad - bc \neq 0\). It is a bijection from \(\C \cup \{\infty\}\) to itself. It maps circles/lines to circles/lines.
  \item \(z \mapsto z^n\), \(\{z \in \C\setminus\{0\}: 0 < \arg z < \pi/n\} \to \{z \in \C: \Im z > 0\}\). The inverse, \(z^{1/n}\) using the principal branch, is also a conformal map.
  \item \(\exp\) maps conformally the strip \(\{z \in \C: \Im(z) \in (-\pi, \pi)\}\) to \(\C \setminus \{z \leq 0\}\), with inverse \(\log z\) with principal branch cut.
  \end{enumerate}
\end{eg}

We will just state an important theorem here which will not be proven in this course:

\begin{theorem}[Riemann mapping theorem]
  Let \(D \subseteq \C\) be any domain bounded by a simple closed curve. Then there exists a conformal equivalence \(D \to D(0, 1)\) between \(D\) and \(D(0, 1)\).

  More generally, this holds for any simply connected domain which is not all \(\C\).
\end{theorem}

\section{Complex Integration I}

\subsection{Integration along curves}

Let \(f: [a, b] \to \C\) be a continuous map, then its integral is simply the sum of the integral of the real and imaginary part:
\[
  \int_a^b f(t) dt = \int_a^b \Re f(t) dt + i \int_a^b \Im f(t) dt.
\]

\begin{proposition}
  \label{prop:absolute value integral inequality}
  \[
    \left| \int_a^b f(t) dt \right| \leq (b - a) \sup_{t \in [a, b]} |f(t)|
  \]
  with equality if and only if \(f\) is constant.
\end{proposition}

\begin{proof}
  Let \(\theta = \arg \int_a^b f(t)d(t)\) and let \(M = \sup_{t \in [a, b]} |f(t)|\). Clearly
  \[
    \int_a^b f(t) dt = \left| \int_a^b f(t) dt\right| e^{i\theta}
  \]
  so
  \begin{align*}
    \left|\int_a^b f(t)dt\right| &= e^{-i\theta} \int_a^b f(t) dt \\
                                 &= \int_a^b e^{-i\theta}f(t)dt \\
                                 &= \int_a^b \Re(e^{-i\theta}f(t)) dt \\
                                 &\leq \int_a^b|f(t)|dt \\
                                 &\leq M(b - a)
  \end{align*}
  If the equality holds then \(|f(t)| = M\) is constant by the last inequality, and it follows from the second last inequality that \(\arg f(t) = \theta\) so \(f\) is constant.
\end{proof}

If \(\gamma: [a, b] \to \C\) is a \(C^1\) curve, we can define its length as follow. Write \(\gamma(t) = x(t) + iy(t)\) and define the length to be
\[
  \int_a^b |\gamma'(t)|dt = \int_a^b \sqrt{x'(t) + y'(t)} dt.
\]

\begin{definition}[Simple curve]
  We say \(\gamma\) is \emph{simple} if \(\gamma(t_1) \neq \gamma(t_2)\) unless \(t_1 = t_2\) or \(\{t_1, t_2\} = \{a, b\}\).
\end{definition}

\begin{definition}[Integration along a curve]\index{integration along a cruve}
  Suppose \(f: U \to \C\) is continuous with \(U \subseteq \C\) an open subset. Let \(\gamma: [a, b] \to U\) be a \(C^1\) curve. The \emph{integral of \(f\) along \(\gamma\)} is
  \[
    \int_\gamma f(z)dz = \int_a^b f(\gamma(t))\gamma'(t) dt.
  \]
\end{definition}

Some basic properties:
\begin{enumerate}
\item linearity:
  \[
    \int_\gamma (c_1f_1(z) + c_2f_2(z))dz = c_1 \int_\gamma f_1(z) dz + c_2 \int_\gamma f_2(z) dz.
  \]
\item additivity: if \(a < a' < b\),
  \[
    \int_\gamma f(z)dz = \int_{\gamma|_{[a, a']}} f(z) dz + \int_{\gamma|_{[a', b]}} f(z)dz.
  \]
\item inverse path: define the inverse path of \(\gamma\) to be
  \begin{align*}
    -\gamma: [-b, -a] &\to U \\
    t &\mapsto \gamma(-t)
  \end{align*}
  then
  \[
    \int_{-\gamma} f(z)dz = -\int_\gamma f(z)dz.
  \]
\item independence of reparameterisation: if \(\phi: [a', b'] \to [a, b]\) is \(C^1\) and \(\phi(a') = a, \phi(b') = b\), then let \(\delta = \gamma \compose \phi: [a', b'] \to U\), we have
  \[
    \int_\gamma f(z) dz = \int_\delta f(z)dz.
  \]
\end{enumerate}
All except the last one is trivial. A quick check
\begin{align*}
  \int_\delta f(z)dz &= \int_{a'}^{b'} f(\delta(t))\delta'(t) dt \\
                     &= \int_{a'}^{b'} f(\gamma(\phi(t))) \gamma'(\phi(t)) \phi'(t) dt \\
                     &= \int_a^b f(\gamma(s))\gamma'(s) ds \\
                     &= \int_{\gamma}^{ } f(z) dz
\end{align*}

In reality, we may encounter curves that are not \(C^1\), for example along the sides of a square. However, they are made of pieces of \(C^1\) curves. In a sense that will be address by the definition below, this is the worst case we will encounter in this course.

\begin{definition}[Piecewise \(C^1\)]
 Let \(\gamma: [a, b] \to \C\) be a continuous curve. Suppose we have
\[
  a = a_0 < a_1 < \dots < a_n = b
\]
such that \(\gamma|_{[a_{i - 1}, a_i]}\) is \(C^1\) for \(1 \leq i \leq n\). Then we say that \(\gamma\) is \emph{piecewise differentiable} or \emph{piecewise \(C^1\)}.
\end{definition}

Then we define
\[
  \int_\gamma f(z) dz = \sum_{i = 1}^n \int_{\gamma_i} f(z)dz.
\]

\begin{eg}\leavevmode
  \begin{enumerate}
  \item \(f(z) = z^n\) where \(n \in \Z\). Form now on define the \emph{punctured complex plane} to be \(\C^* = \C \setminus \{0\}\). Let \(U = \C^*\). Let
    \begin{align*}
      \gamma: [0, 2\pi] &\to U \\
      t &\mapsto e^{it}
    \end{align*}
    which is a circle around the origin. Then
    \[
      \int_\gamma f(z) dz =
      \int_0^{2\pi} e^{int}ie^{it} dt
      = i\int_0^{2\pi} e^{i(n + 1)t} dt
      =
      \begin{cases}
        2\pi i & \text{if } n = -1 \\
        0 & \text{otherwise}
      \end{cases}
    \]
    In the case \(n = -1\) \(f\) is not defined at \(0\), which is encircled by the closed path.
  \item \(f(z) = z^2\). \(\gamma = \gamma_1 + \gamma_2\) where
    \begin{align*}
      \gamma_1: [-R, R] &\to \C \\
      t &\mapsto t \\
      \gamma_2:[0, 1] &\to \C \\
      t &\mapsto Re^{i\pi t}
    \end{align*}
    Then
    \begin{align*}
      &\phantom{=} \int_\gamma f(z)dz \\
      &= \int_{\gamma_1} f(z)dz + \int_{\gamma_2} f(z) dz \\
      &= \int_{-R}^R t^2dt + \int_0^1 R^2e^{2\pi it}i\pi Re^{i\pi t} dt \\
      &= \frac{2R^3}{3} - \frac{2R^3}{3} \\
      &= 0
    \end{align*}
  \end{enumerate}
\end{eg}

In general, for a holomorphic function, if the closed path does not include a pole of the function then the integral along the curve is \(0\).

\begin{proposition}
  For any continuous \(f: U \to \C\) and any curve \(\gamma: [a, b] \to U\),
  \[
    \left| \int_\gamma f(z)dz \right| \leq \ell(\gamma) \cdot \sup_\gamma|f|
  \]
  where \(\sup_\gamma |f| = \sup_{t \in [a, b]} |f(\gamma(t))|\).
\end{proposition}

\begin{proof}
  wlog assume \(\gamma\) is \(C^1\),
  \begin{align*}
    \left| \int_\gamma f(z)dz \right| &= \left| \int_a^bf(\gamma(t))\gamma'(t)dt \right| \\
                                      &\leq \int_a^b |f(\gamma(t))||\gamma'(t)| dt \\
                                      &\leq \sup_\gamma|f| \int_a^b |\gamma'(t)| dt \\
                                      &= \sup_\gamma|f| \cdot \ell(f)
  \end{align*}
\end{proof}

\begin{theorem}[Fundamental Theorem of Calculus]\index{Fundamental Theorem of Calculus}
  Suppose \(f: U \to \C\) is continuous and suppose there exists \(F(z)\) such that for all \(z \in U\), \(F'(z) = f(z)\). Then for any curve \(\gamma: [a, b] \to U\), we have
  \[
    \int_\gamma f(z) dz = F(\gamma(b)) - F(\gamma(a)).
  \]
\end{theorem}

\begin{note}
  \(F\) is called an \emph{anti-derivative} of \(f\) on \(U\).
\end{note}

\begin{proof}
  \begin{align*}
    \int_\gamma f(z)dz
    &= \int_a^b f(\gamma(t))\gamma'(t) dt \\
    &= \int_a^b (F \compose \gamma)'(t) dt \\
    &= F(\gamma(b)) - F(\gamma(a))
  \end{align*}
\end{proof}

\begin{corollary}
  If \(\gamma\) is closed (\(\gamma(b) = \gamma(a)\)) and \(f\) is continuous and has an anti-derivative \(F\) on  \(U\), then
  \[
    \int_\gamma f(z)dz = 0.
  \]
\end{corollary}

\begin{eg}
  Consider \(f(z) = z^n\) where \(n \in \Z\) defined on \(\C^*\). If \(n \neq -1\),
  \[
    f(z) = \frac{d}{dz} \left( \frac{z^{n + 1}}{n + 1} \right)
  \]
  so the integral along any closed curve is \(0\).

  However, if \(n = -1\) we do not have an anti-derivative on all \(\C^*\) and we computed last time
  \[
    \int_\gamma \frac{dz}{z} = 2\pi i.
  \]
  This is because we can't define \(\log\) as an anti-derivative of \(\frac{1}{z}\) on all \(\C^*\).
\end{eg}

Now we prove a converse to the corollary:

\begin{proposition}
  \label{prop:existence of anti-derivative}
  Let \(U \subseteq \C\) be a domain. If \(f: U \to \C\) is continuous and \(\int_\gamma f(z)dz = 0\) for all closed curves \(\gamma\) on \(U\), then \(f\) has an anti-derivative \(F\) on \(U\), i.e.\ there exists \(F\) such that \(F' = f\).
\end{proposition}

\begin{proof}
  Given that \(U\) is path-connected, the immediate choice of \(F\) coming to mind is
  \[
    F(w) = \int_{\gamma_w} f(z)dz
  \]
  where \(\gamma_w: [0, 1] \to U\) is a path from a fixed point \(a_0\) to \(w\). Note that \(F\) is \emph{independent} of the choice of \(\gamma_w\) precisely because of the hypothesis.

  Now claim that \(F\) is holomorphic and \(F' = f\). Since \(U\) is open, there exists \(r > 0\) such that \(D(w, r) \subseteq U\). Let \(h\) be such that \(|h| < r\) and let \(\delta_h\) be the radial path from \(w\) to \(w + h\). Note that \(\delta_n \subseteq D(w, r)\). Let \(\gamma = \gamma_w \cdot \delta_h \cdot (-\gamma_{w + h})\) where \(\cdot\) denotes path concatenation. Then
  \[
    0 = \int_\gamma f(z) dz = F(w) + \int_{\delta_h} f(z)dz - F(w + h).
  \]
  Now
  \begin{align*}
    \left| \frac{F(w + h) - F(w)}{h} - f(w) \right|
    &= \frac{1}{|h|} \left| \int_{\delta_h} (f(z) - f(w)) dz \right| \\
    &\leq \frac{\ell(\delta_h)}{|h|} \sup_{z \in \delta_h} |f(z) - f(w)| \\
    &\to 1 \cdot 0
  \end{align*}
  as \(h \to 0\) since \(f\) is continuous.
\end{proof}

This proposition, or the proof thereof contains an idea that can be applied to more general circumstances. We first define

\begin{definition}[Star-shaped domain]\index{domain!star-shaped}
  A domain \(U\) is \emph{star-shaped} (or called a star domain) if there exists \(p \in U\) such that for all \(a \in U\), the straight segment from \(a\) to \(p\) is contained in \(U\).
\end{definition}

We thus have
\[
  \text{disc} \implies \text{convex} \implies \text{star-shape} \implies \text{domain}.
\]

\begin{corollary}\label{cor:anti-derivative}
  If \(U\) is star-shaped, \(f: U \to \C\) is continuous and \(\int_\gamma f(z)dz = 0\) for all triangles \(\gamma \subseteq U\) then \(f\) has an anti-derivative on \(U\).
\end{corollary}

A triangle is, as one might infer, the region bounded by a closed curve made of three straight line segments.

\begin{proof}
  Let \(a_0 = a\) and \(\delta_w\) and \(\delta_{w + h}\) be straight line segments in the previous proof.
\end{proof}

\subsection{Cauchy's Theorem, weak version}

\begin{theorem}[Cauchy's Theorem for triangles]\index{Cauchy's theorem}
  \label{thm:weak Cauchy}
  Let \(U\) be a domain and \(T\) be a triangle contained in \(U\). If \(f: U \to \C\) is holomorphic, then
  \[
    \int_{\p T} f(z)dz = 0.
  \]
\end{theorem}

\begin{proof}
  Let \(y = |\int_{\p T} f(z)dz|\), \(\ell = \ell(\p T)\). Let \(T = T^0 = T_1 \cup \dots \cup T_4\) be a subdivision into 4 equal triangles all with the same orientation. Then
  \[
    \int_{\p T} f(z)dz = \sum_{i = 1}^4 \int_{\p T_i} f(z)dz
  \]
  since internal lines cancel in pair. Thus there exists \(i\) such that
  \[
    \left| \int_{\p T_i} f(z)dz \right| \geq \frac{y}{4}.
  \]
  Let \(T^1 = T_i\) for this \(i\) and repeat. We produce a sequence
  \[
    T^0, T^1, \dots
  \]
  such that
  \[
    \left| \int_{\p T^i} f(z)dz \right| \geq \frac{y}{4^i}
  \]
  and
  \[
    \ell(\p T^i) = \frac{\ell}{2^i}.
  \]
  Now as \(T\) is compact, the \(T^i\) are closed nested sets, they have non-empty intersection, i.e.\ there exists
  \[
    z_0 \in \bigcap_{i = 0}^\infty T^i.
  \]
  As \(f\) is differentiable at \(z_0\), given \(\varepsilon > 0\), there exists \(\delta > 0\) such that \(|w - z_0| < \delta\) implies
  \[
    |f(w) - f(z_0) - (w - z_0) f'(z_0)| < \varepsilon |w - z_0|.
  \]
  Pick \(n\) such that \(T^n \subseteq D(z_0, \delta)\). Then
  \begin{align*}
    \frac{y}{4^n} &\leq \left| \int_{\p T^n} f(z)dz \right| \\
                  &= \left| \int_{\p T^n} (f(z) - \underbrace{f(z_0) - (z - z_0)f'(z_0)}_{\text{has anti-derivative so } = 0}) dz \right| \\
                  &\leq \ell(\p T^n) \varepsilon \sup_{z \in \p T^n} |z - z_0| \\
                  &\leq \frac{\varepsilon \ell^2}{4^n}.
  \end{align*}
  Thus \(y \leq \ell^2 \varepsilon\). Since \(\varepsilon\) is arbitrary, \(y = 0\).
\end{proof}

\begin{corollary}[Convex Cauchy]
  Let \(f\) be a holomorphic function on a star-domain \(U\). Then
  \[
    \int_\gamma f(z)dz = 0
  \]
  for all closed curves in \(U\).
\end{corollary}

\begin{proof}
  By the previous theorem, \(\int_{\p T} f(z)dz = 0\) for all triangles \(T \subseteq U\). By \Cref{cor:anti-derivative}, \(f\) has an anti-derivative \(F\) on \(U\). Then the Fundamental Theorem of Calculus says
  \[
    \int_\gamma f(z)dz = 0
  \]
  for all closed paths \(\gamma\) in \(U\).
\end{proof}

Actually, we can prove the same result even if \(f\) is not assumed to be holomorphic on finitely many points:

\begin{proposition}
  \label{prop:Cauchy with holes}
  Let \(U\) be a star-domain and \(S \subseteq U\) be a finite set. Let \(f: U \to \C\) be continuous on \(U\) and holomorphic on \(U \setminus S\). Then the conclusion of the convex Cauchy theorem still holds.
\end{proposition}

\begin{proof}
  It suffices to prove that the integral along a triangle is zero for all triangles in \(U\). Subdivide a triangle \(T\) into \(4^n\) equal triangles as before. Let \(M = \sup_T |f|\). Let \(T' \subseteq T\) be a subtriangle. If \(T' \cap S = \emptyset\) then the integral is zero by \nameref{thm:weak Cauchy}. Otherwise, for any \(T'\),
  \[
    \left| \int_{\p T'} f(z)dz \right| \leq \ell(\p T') M 2^{-n}
  \]
  so
  \begin{align*}
    \left| \int_{\p T} f(z)dz \right|
    &= \left|\sum_{T'} \int_{\p T'} f(z) dz \right| \\
    &\leq \sum_{T'}\left| \int_{\p T'} f(z)dz \right| \\
    &\leq 6|S|\ell M 2^{-n}
  \end{align*}
  where the last line is because a point can belong to at most \(6\) triangles. Let \(n \to \infty\) gives the result.
\end{proof}

In fact, we will later prove that \(f\) is also holomorphic on \(S\).

\subsection{Cauchy Integral Formula, weak version}

\begin{theorem}[Cauchy integral formula for a disc]\index{Cauchy integral formula}
  \label{thm:Cauchy integral formula}
  Let \(D = D(a, r)\) be a disc and \(f: D \to \C\) holomorphic. For every \(w \in D\) and \(\rho\) with \(|w - a| < \rho < r\),
  \[
    f(w) = \frac{1}{2\pi i} \int_{|z - a| = \rho} \frac{f(z)}{z - w} dz.
  \]
\end{theorem}

This is a surprising result as the value of a holomorphic function inside a disc is completely determined by its value on the boundary.

\begin{proof}
  Consider the function
  \[
    g(z) =
    \begin{cases}
      \frac{f(z) - f(w)}{z - w} & \text{if } z \neq w \\
      f'(w) & \text{if } z = w
    \end{cases}
  \]

Then \(g\) is continuous on \(D\) and holomorphic on \(D \setminus \{w\}\). Thus by the previous result
\[
  \int_{|z - a| = \rho} g(z)dz = 0.
\]
It would be easy if the path is a circle around \(w\) but unfortuntely it isn't. Instead,
\begin{align}
  \int_{|z - a| = \rho} \frac{f(z)}{z - w} dz
  &= \int_{|z - a| = \rho} \frac{f(w)}{z - w} dz \\
  &= \sum_{n = 0}^\infty \int_{|z - a| = \rho} \frac{f(w)(w - a)^n}{(z - a)^{n + 1}} dz \\
  &= \int_{|z - a| = \rho} \frac{f(w)}{z - a} dz \\
  &= 2\pi i f(w)
\end{align}
where (3) is justified by using the example of \(z^n\) before and (2) is justified by the geometric series
\[
  \frac{1}{z - w}
  = \frac{1}{(z - a)\left( 1- \frac{w - a}{z - a} \right)}
  = \sum_{n = 0}^\infty \frac{(w - a)^n}{(z - a)^{n + 1}}
\]
which converge uniformly as a function of \(z\) on \(|z - a| = \rho\), as well as the following easy lemma:

\begin{lemma}
  If \(f_n: U \to \C\) and \(f: U \to \C\) are continuous and \(\gamma: [a, b] \to U\) is a curve such that \(f_n \to f\) uniformly on \(\gamma([a, b])\), then
  \[
    \int_\gamma f_n(z)dz \to \int_\gamma f(z) dz.
  \]
\end{lemma}

\begin{proof}
  Let \(M_n = \sup_\gamma |f_n - f|\). By uniform convergence \(\lim_{n \to \infty} M_n = 0\). Hence
  \[
    \left| \int_\gamma f_n(z) dz - \int_\gamma f(z) dz \right|
    \leq M_n \ell(\gamma) \to 0
  \]
  as \(n \to \infty\).
\end{proof}
\end{proof}

\begin{corollary}[Mean-value property]\index{mean-value Property}
  \label{cor:mean-value property}
  If \(f: D(w, R) \to \C\) is holomorphic, then for every \(0 < r < R\),
  \[
    f(w) = \int_0^1 f(w + re^{2\pi it})dt.
  \]
\end{corollary}

\begin{proof}
  Take \(w = a\) in the previous theorem and parameterise the circle of integration as \(\gamma(t) = w + re^{2\pi it}, t \in [0, 1]\).
\end{proof}

\subsection{Application of Cauchy Integration Formula}

\begin{theorem}[Liouville]\index{Liouville's theorem}
  \label{thm:Liouville}
  Every bounded entire function is constant.
\end{theorem}

\begin{proof}
  Suppose \(f: \C \to \C\) is entire such that \(|f| \leq M\) and let \(w \in \C\). Then if \(R > |w|\),
  \begin{align*}
    |f(w) - f(0)|
    &=\frac{1}{2\pi}\left| \int_{|z| = R} f(z) \left( \frac{1}{z - w} - \frac{1}{z} \right) dz \right| \\
    &= \frac{1}{2\pi} \left| \int_{|z| = R} \frac{wf(z)}{z(z - w)} dz \right| \\
    &\leq \frac{1}{2\pi}\frac{2\pi R|w|M}{R(R - |w|)} \\
    &\to 0
  \end{align*}
  as \(R \to \infty\).
\end{proof}

\begin{theorem}[Fundamental Theorem of Algebra]\index{Fundamental Theorem of Algebra}
  Every non-constant polynomial with complex coefficients has a complex root.
\end{theorem}

\begin{proof}
  Let \(p(z) = z^n + c_{n - 1}z^{n - 1} + \dots + c_0\) be a polynomial of degree \(n > 0\). Then \(|p(z)| \to \infty\) as \(z \to \infty\), so there exists \(R > 0\) such that \(|p(z)| > 1\) for all \(|z| > R\).

  Now consider \(f(z) = \frac{1}{p(z)}\). If \(p\) does not have a zero then \(f\) is an entire function. Moreover, since \(f\) is bounded on \(\{z: |z| \leq R\}\) by continuity and \(|f(z)| < 1\) if \(|z| > R\). By \nameref{thm:Liouville} \(f\) is constant. Absurd.
\end{proof}

\begin{theorem}[Local maximum principle]\index{maximum principle!local}
  \label{thm:local maximum principle}
  Let \(f: D(a, r) \to \C\) be holomorphic. If for every \(z \in D(a, r)\), \(|f(z)| \leq |f(a)|\) then \(f\) is constant.
\end{theorem}

Thus on a open domain \(U\), if the function \(f\) extends analytically to the boundary \(\p U\) then the maximum can only be achieved on the boundary \(U\), unless \(f\) is constant.

\begin{proof}
  By \nameref{cor:mean-value property} we have for \(0 < \rho < r\),
  \[
    |f(a)|
    = \left| \int_0^1 f(a + \rho e^{2\pi it}) dt \right|
    \leq \sup_{|z - a| = \rho} |f(z)|
    \leq |f(a)|
  \]
  Hence equality holds, and by \Cref{prop:absolute value integral inequality} \(|f(z)| = |f(a)|\) for all \(z\) on \(|z - a| = \rho\). Since \(\rho\) is arbitrary, \(|f(z)| = |f(a)|\) for all \(z \in D(a, r)\). Thus \(f\) is constant (see example sheet 1).
\end{proof}

\begin{theorem}[Taylor expansion]\index{Taylor expansion}
  \label{thm:Taylor}
  Let \(f: D(a, r) \to \C\) be holomorphic. Then \(f\) has a convergent power series on \(D(a, r)\):
  \[
    f(z) = \sum_{n = 0}^\infty c_n (z - a)^n
  \]
  where
  \[
    c_n = \frac{f^{(n)}(a)}{n!} = \frac{1}{2\pi i} \int_{|z - a| = \rho} \frac{f(z)}{(z - a)^{n + 1}} dz
  \]
  for any \(0 < \rho < r\).
\end{theorem}

An immediate corollary is that holomorphic functions are analytic. The converse is trivial so the two terms are semantically synonymous, although the choice of terminology may enunciate your standing point: the term ``holomorphic'' is preferred in pure mathematics, while ``analytic'' is used more often in applied mathematics.

\begin{proof}
  If \(|w - a| < \rho < r\) then by \nameref{thm:Cauchy integral formula}
  \begin{align*}
    f(w) &= \frac{1}{2\pi i} \int_{|z - a| = \rho} \frac{f(z)}{z - w} dz \\
         &= \frac{1}{2\pi i} \int_{|z - a| = \rho} \sum_{n = 0}^\infty \frac{(w - a)^n}{(z - a)^{n + 1}} dz \\
         &= \sum_{n = 0}^\infty \underbrace{\left( \frac{1}{2\pi i} \int_{|z - a| = \rho} \frac{f(z)}{(z - a)^{n + 1}} dz \right)}_{c_n} (w - a)^n
  \end{align*}
\end{proof}

\begin{corollary}
  If \(f\) is holomorphic in \(U\) then its derivatives of all orders exist and are holomorphic.
\end{corollary}

\begin{proof}
  Taylor expansion plus theory on power series.
\end{proof}

The next theorem is a converse to Cauchy:

\begin{corollary}[Morera]\index{Morera's theorem}
  \label{cor:Morera}
  Let \(U\) be a domain and \(f: U \to \C\) continuous. If \(\int_\gamma f(z) dz = 0\) for every closed paths in \(U\), then \(f\) is holomorphic in \(U\).
\end{corollary}

\begin{proof}
  By \Cref{prop:existence of anti-derivative}, \(f\) has an anti-derivative \(F\). \(F\) is holomorphic and \(F' = f\) so \(f\) is holomorphic on \(U\).
\end{proof}

This gives us something we promised a while ago in \Cref{prop:Cauchy with holes}: we see that \(f\) ends up being holomorphic also on \(S\).

\begin{proposition}[Cauchy integral formula for derivatives]\index{Cauchy integral formula!for derivatives}
  \label{prop:Cauchy integral formula for derivatives}
  Use the same notation as in \nameref{thm:Taylor}, we have
  \[
    f^{(n)}(w) = \frac{n!}{2\pi i} \int_{|z - a| = \rho} \frac{f(z)}{(z - w)^{n + 1}} dz.
  \]
\end{proposition}

\begin{proof}
\[
  \frac{d}{dz} \left( \frac{f(z)}{z - w} \right)
  = \frac{f'(z)}{z - w} - \frac{f(z)}{(z - w)^2}
\]
Now integrate over \(|z - a| = \rho\), since anti-derivative of \(\frac{d}{dz} \frac{f(z)}{z - w}\) exists,
\[
  0 = \int_{|z - a| = \rho}  \frac{d}{dz} \left( \frac{f(z)}{z - w} \right)dz
  = \int_{|z - a| = \rho} \frac{f'(z)}{z - w} dz - \int_{|z - a| = \rho} \frac{f(z)}{(z - w)^2} dz
\]
Now apply \nameref{thm:Cauchy integral formula} to the first term. Inductively, we derive
\[
  f^{(n)}(w) = \frac{n!}{2\pi i} \int_{|z - a| = \rho} \frac{f(z)}{(z - w)^{n + 1}} dz.
\]
\end{proof}

Note the subtlety between this and Taylor's theorem: Taylor's theorem gives us the coefficient of the power series expansion around \(z\) (which holds trivially at \(z\)) while Cauchy integral formula tells us the value of derivatives of any order at a point in the disc.

\subsection{Uniform limits of holomorphic functions}

We want to construct new holomorphic functions from old ones. Recall in IB Analysis II uniform limit theorem tells us that the uniform limit of continuous functions is continuous. We are going to adopt the same idea except one catch: continuity is a local property so if we can produce a cover on each element of which a given sequence of functions converges uniformly, then the resulting function by patching everything together is continuous on the entire space. This is a weaker requirement than uniform convergence and indeed sometimes this is the best that we can do, illustrated by the example below.

\begin{definition}[Locally uniform convergence]\index{locally uniform convergence}
  Let \(U\) be an open domain and \(f_n: U \to \C\) be a sequence of functions. We say that \(\{f_n\}\) is \emph{locally uniformly convergent} in \(U\) if for any \(a \in U\) there exists \(r > 0\) such that \(D(a, r) \subseteq U\) on which \(\{f_n\}\) is uniformly convergent.
\end{definition}

\begin{eg}
  Let \(U = D(0, 1)\) and \(f_n(z) = \frac{1}{1 - z^n}\). Note that \(f_n \to 1\) pointwise as \(n \to \infty\). It is not uniformly convergent on \(D(0, 1)\) but it is locally uniformly convergent. In fact it is uniformly convergent on any \(|z| \leq \rho < 1\).
\end{eg}

\begin{proposition}
  A sequence of functions \(f_n: U \to \C\) is locally uniformly convergent if and only if it converges uniformly on all compact subsets of \(U\).
\end{proposition}

\begin{proof}
  If \(f_n \to f\) uniformly on all compact subsets, then given \(a \in U\) and \(r > 0\) such that \(\cl{D(a, r)} \subseteq U\), then \(f_n \to f\) uniformly on \(D(a, r)\), hence \(f_n \to f\) locally uniformly.

  Conversely, if \(f_n \to f\) locally uniformly on \(U\), let \(K \subseteq U\) be a compact set. For each \(a \in K\) there exists \(D(a, r) \subseteq U\) on which \(f_n \to f\) uniformly. As \(K\) is compact, there exists a finite set \(S \subseteq U\) such that \(K \subseteq \bigcup_{a \in S} D(a, r)\). Hence \(f_n \to f\) converges uniformly on \(K\).
\end{proof}

\begin{theorem}
  Let \(\{f_n\}\) be a sequence of holomorphic functions on \(U\) which is locally uniformly convergent. Then the limit function \(f\) is holomorphic and the sequence \(\{f_n'\}\) converges locally uniformly to \(f'\) on \(U\).
\end{theorem}

This is a generalisation of the corresponding statements about power series.

\begin{proof}
  The key here is to use the following characterisation of holomorphicity: a function is holomorphic on a domain if and only if its integral along any closed path vanishes (if given by \nameref{cor:Morera}, only if given by \nameref{thm:weak Cauchy}).

  Let \(D = D(a, r) \subseteq U\) be any disc. Then by \nameref{thm:weak Cauchy}, for any closed curve \(\gamma\) in \(D\), \(\int_\gamma f_n(z) dz = 0\). Now \(f_n \to f\) uniformly on \(\gamma\) since \(\gamma([a, b])\) is compact. Since \(f\) is continuous,
  \[
    0 = \int_\gamma f_n(z) dz \to \int_\gamma f(z) dz = 0
  \]
  so by \nameref{cor:Morera} \(f\) is holomorphic on \(D\).

  Next, by \nameref{prop:Cauchy integral formula for derivatives} for any \(w \in D(a, r/2)\),
  \[
    |f'(w) - f_n'(w)|
    = \frac{1}{2\pi} \left| \int_{|z - a| = r} \frac{f(z) - f_n(z)}{(z - w)^2} \right|
    \leq \frac{2\pi r}{2\pi} \frac{\sup_{|z - a| = r} |f(z) - f_n(z)|}{r^2/4}.
  \]
  Since \(f_n \to f\) uniformly on \(|z - a| = r\) we see that \(f_n' \to f'\) uniformly on \(D(a, r/2)\). Done.
\end{proof}

\begin{eg}[Riemann zeta function]
  The Riemann zeta function is the map
  \[
    \zeta(s) = \sum_{n = 1}^\infty \frac{1}{n^s}.
  \]
  To find where the function is defined, i.e.\ the series is convergent,
  \[
    |n^s| = |e^{s \log n}| = n^{\Re(s)}
  \]
  so if \(\Re(s) > 1\) the series is absolutely convergent. Moreover, if \(\Re(s) \geq \sigma > 1\), by comparison test with \(\sum \frac{1}{n^\sigma}\) we have uniform convergence on \(\{s: \Re(s) \geq \sigma\}\). Thus by the previous theorem \(\zeta(s)\) defines a holomorphic function on \(\Re(s) > 1\).
\end{eg}

\subsection{Zeros of holomorphic functions}

Consider \(f: D(w, R) \to \C\) holomorphic and write \(f\) as a power series
\[
  f(z) = \sum_{n = 0}^\infty c_n(z - w)^n.
\]
If \(f\) is not identically zero then not all \(c_n\)'s are zero. Let
\[
  m = \min\{n \in \Z, n \geq 0: c_n \neq 0\}.
\]
Then
\[
  f(z) = (z - w)^m g(z)
\]
where \(g(z) = \sum_{n = m}^\infty c_n(z - w)^{n - m}\) is holomorphic on \(D(w, R)\) and \(g(w) \neq 0\). If \(m > 0\) we say that \(f\) has a \emph{zero of order \(m\)}\index{order of zero} at \(z = w\). Clearly \(m\) is the least \(n\) such that \(f^{(n)}(w) \neq 0\).

\begin{theorem}[Principle of isolated zeros]\index{principle of isolated zeros}
  \label{thm:principle of isolated zeros}
  Let \(f: D(w, R) \to \C\) be holomorphic and not identically zero. Then there exists \(0 < r \leq R\) such that \(f(z) \neq 0\) for \(0 < |z - w| < r\).
\end{theorem}

\begin{proof}
  Suppose \(f(w) \neq 0\) then by continuity there exists \(r > 0\) such that \(f(z) \neq 0\) for \(z \in D(w, r)\).

  Otherwise, \(f\) has a zero of some order \(m > 0\) at \(z = w\). Hence \(f(z) = (z - w)^mg(z)\) where \(g\) is holomorphic and \(g(w) \neq 0\). Hence there exist \(r > 0\) such that \(g\) is non-zero on \(D(w, r)\) and then \(f(z) \neq 0\) for \(0 < |z - w| < r\).
\end{proof}

\subsection{Analytic continuation}

The section discusses some results coming from the interplay of holomorphic functions and general topology.

\begin{theorem}[Uniqueness of analytic continuation]\index{analytic continuation}
  Let \(D' \subseteq D\) be domains and \(f: D' \to \C\) analytic. Then there is at most one analytic function \(g: D \to \C\) such that \(g(z) = f(z)\) for \(z \in D'\).
\end{theorem}

\begin{proof}
  This is really an exercise in connectedness. Let \(g_1, g_2: D \to \C\) be analytic continuations of \(f\). Then \(h = g_1 - g_2: D \to \C\) is analytic and \(h(z) = 0\) on \(D'\). We'll prove that \(h = 0\) on \(D\). Let
  \begin{align*}
    D_0 &= \{w \in D: h \text{ is identically zero on some open disc } D(w, r)\} \\
    D_1 &= \{w \in D: h^{(n)}(w) \neq 0 \text{ for some } n \geq 0\}
  \end{align*}
  We saw last time that \(D = D_0 \cup D_1, D_0 \cap D_1 = \emptyset\). Moreover, \(D_0\) and \(D_1\) are open. But \(D_0 \supseteq D'\) so is non-zero. By (path-)connectedness of \(D\), \(D_0 = D\).
\end{proof}

\begin{corollary}[Identity principle]\index{identity principle}
  Let \(f, g: D \to \C\) be analytic functions on a domain. If
  \[
    S = \{z \in D: f(z) = g(z)\}
  \]
  contains a non-isolated point then \(f = g\) on \(D\).
\end{corollary}

\begin{proof}
  Let \(w\) be such a non-isolated point. \(f - g\) is holomorphic in \(D\) and vanishes on \(S\) so it has a non-isolated zero. Thus by \Cref{thm:principle of isolated zeros} \(f - g\) vanishes on an open disc with centre \(w\) and by the previous theorem \(f = g\) on \(D\).
\end{proof}

\begin{remark}
  Given \(f: D' \to \C\) analytic and \(D \supseteq D'\), extending \(f\) could be a tough problem if not impossible.
\end{remark}

\begin{eg}\leavevmode
  \begin{enumerate}
  \item \(f(z) = \sum_{n = 0}^\infty z^n\) defines an analytic function on \(D(0, 1)\) and extends to \(\frac{1}{1 - z}\) on \(\C \setminus \{1\}\).
  \item \(\sum_{n = 1}^\infty z^{n!}\) defines an analytic function on \(D(0, 1)\) but cannot be extended analytically to a domain larger than \(D(0, 1)\). \(|z| = 1\) is called the \emph{natural boundary}. See example sheet 2.
  \item \(\zeta(s) = \sum_{n = 1}^\infty \frac{1}{n^s}\) defines an analytic function in \(\{s: \Re s > 1\}\) and has an analytic continuation to \(\C \setminus \{1\}\) but it takes effort to prove!
  \end{enumerate}
\end{eg}

\begin{corollary}[Global maximum principle]\index{maximum principle!global}
  Let \(U \subseteq \C\) be a bounded domain. Let \(\cl U\) be the closure of \(U\) and \(f: \cl U \to \C\) continuous and holomorphic in \(U\). Then \(|f|\) attains a maximum on \(\cl U \setminus U\).
\end{corollary}

\begin{proof}
  Recall that if \(U\) is bounded then \(\cl U\) is bounded and closed so \(|f|\) attains a maximum on \(\cl U\). Suppose the maximum is achieved at \(a \in U\). Then \Cref{thm:local maximum principle} says that \(f\) is constant on \(D(a, r)\) for some \(r > 0\). Thus \(f\) is constant on \(U\) and hence on \(\cl U\).
\end{proof}

\section{Complex Integration II}

In this section we are going to prove the general form of Cauchy's theorem, by formalising ``number of loops'' of a path around a point (which is as an aside, easy to do for \(C^1\) curves but difficult in the continuous case), and subsequently observe the interplay between holomorphic functions and the global topology.

\subsection{Winding number}

Suppose \(\gamma: [a, b] \to \C\) is a closed curve (which is assumed to be \(C^1\) in this course) and \(w \in \C\) which is not in \(\gamma([a, b])\). We would like to make sense of the intuitive notion ``number of times \(\gamma\) winds around \(w\)''.

\begin{definition}[Choice of argument]\index{choice of argument}
  A continuous \emph{choice of argument} on \(\gamma\) is a continuous map \(\theta: [a, b] \to \R\) such that \(\gamma(t) = w + r(t)e^{i\theta(t)}\) for \(t \in [a, b]\), where \(r(t) = |\gamma(t) - w| > 0\).
\end{definition}

\begin{definition}[Winding number/index]\index{winding number}\index{index}
  We define
  \[
    I(\gamma, w) = \frac{\theta(b) - \theta(a)}{2\pi}
  \]
  to be the \emph{index} of \(\gamma\) with respect to \(w\) or the \emph{winding number} of \(\gamma\) with respect to \(w\).
\end{definition}

We first show it is well-defined. If \(\theta\) and \(\theta'\) both satisfy the equation in the definition above and are both continuous, then their difference is a continuous function with values in \(2\pi\Z\), so it is constant. Hence if such \(\theta\) exists \(I(\gamma, w)\) is well-defined.

Next we show that a choice of argument does exist:

\begin{lemma}
  Let \(\gamma: [a, b] \to \C \setminus \{w\}\) be a closed curve. Then there exists \(\theta: [a, b] \to \R\) continuous (in fact piecewise \(C^1\)) such that
  \[
    \gamma(t) = w + r(t) e^{i\theta(t)}
  \]
  for all \(t \in [a, b]\) where \(r(t) = |\gamma(t) - w|\).
\end{lemma}

\begin{proof}
  Wlog assume \(\gamma\) is \(C^1\). Define
  \[
    h(t) = \int_a^t \frac{\gamma'(s)}{\gamma(s) - w} ds.
  \]
  From IA Analysis I \(h'(t) = \frac{\gamma'(t)}{\gamma(t) - w}\) so
  \[
    \frac{d}{dt} \left( (\gamma(t) - w) e^{-h(t)} \right)
    = \gamma'(t)e^{-h(t)} + (\gamma(t) - w)e^{-h(t)}(-h'(t))
    =0
  \]
  so \(\gamma(t) = w + (\gamma(a) - w)e^{h(t)}\) so if we set \(\theta(t) = \arg (\gamma(a) - w) + \Im h(t)\) then it is \(C^1\).
\end{proof}

\begin{remark}
  A continuous \(\theta\) exists assuming only \(\gamma\) is continuous (but it is a bit harder).
\end{remark}

\begin{lemma}
  Let \(\gamma: [a, b] \to \C \setminus \{w\}\) be a closed curve. Then
  \[
    I(\gamma, w) = \frac{1}{2\pi i} \int_\gamma \frac{dz}{z - w}.
  \]
\end{lemma}

\begin{proof}
  Write \(\gamma(t) = w + r(t)e^{i\theta(t)}\). Then
  \begin{align*}
    \int_\gamma \frac{dz}{z - w}
    &= \int_a^b \frac{\gamma'(t)}{\gamma(t) - w} dt \\
    &= \int_a^b (\frac{r'}{r} + i\theta') dt \\
    &= \log r(t) + i\theta(t) \big|_a^b \\
    &= i(\theta(b) - \theta(a)) \\
    &= 2\pi i I(\gamma, w)
  \end{align*}
\end{proof}

\begin{lemma}\leavevmode
  \begin{enumerate}
  \item \(I(\gamma, w)\) is constant on each path-component of \(\C \setminus \gamma([a, b])\).
  \item If \(w\) is in the unique unbounded component of \(\C \setminus \gamma([a, b])\) then \(I(\gamma,w) = 0\).
  \end{enumerate}
\end{lemma}

\begin{proof}
  We know \(I(\gamma, \cdot): \C \setminus \gamma([a, b]) \to \Z\) takes value in \(\Z\) which is a discrete space so we would like to show it is continuous, which then implies that \(I(\gamma, \cdot)\) is constant on each path-connected component.

  Take \(D(w, r)\) such that \(\cl{D(w, r)} \subseteq \C \setminus \gamma([a, b])\). Then for all \(h \in D(w, r)\),
  \begin{align*}
    |I(\gamma, w + h) - I(\gamma, w)|
    &= \frac{1}{2\pi} \left| \int_\gamma\left( \frac{1}{z - w- h} - \frac{1}{z - w} \right) dz \right| \\
    &= \frac{1}{2\pi} \left| \int_\gamma \frac{h}{(z - w - h)(z - w)} dz \right| \\
    &= \frac{|h|}{2\pi} \left| \int_\gamma \frac{dz}{(z - w - h)(z - w)} \right| \\
    &\leq \frac{|h|}{2\pi} \ell M \\
    &\to 0
  \end{align*}
  as \(h \to 0\) where \(M = \sup \frac{1}{|z - w - h||z - w|}\) exists by continuity on a compact set.

  For the second part, let
  \[
    w \in \{z \in \C: |z| > 2 \max_{u \in \gamma([a, b])} |u|\}.
  \]
  Then
  \[
    |I(\gamma, w)|
    = \frac{1}{2\pi} \left| \int_\gamma \frac{dz}{z - w} \right|
    \leq \frac{1}{2\pi} \frac{\ell}{|w|/2} \to 0
  \]
  as \(|w| \to \infty\).
\end{proof}

\subsection{General form of Cauchy's theorem}

The winding number \(I(\gamma, w)\) can be seen as a function taking two arguments. We have shown that \(I\) is continuous with resepct to \(w\). What if we perturb \(\gamma\) a little bit? Hopefully the winding number should also be continuous in this case. It turns out to be true, and an immediate corollary of which is that we can generalise Cauchy's theorem to a much larger class of closed curves. But before that, we have to define what it means for one curve to change continuously to another.

\begin{definition}[Homotopy]\index{homotopy}
  Let \(\phi, \psi: [a, b] \to U\) be two piecewise \(C^1\) closed paths. A \emph{homotopy} from \(\phi\) to \(\psi\) is a map \(F: [0, 1] \times [a, b] \to U\) such that
  \begin{itemize}
  \item \(F\) is continuous,
  \item \(F|_{\{0\} \times [a, b]} = \phi, F|_{\{1\} \times [a, b]} = \psi\),
  \item for all \(s \in [0, 1]\), \(F_s(t) = F(s, t): [a, b] \to U\) is a closed piecewise \(C^1\) curve.
  \end{itemize}
\end{definition}

Equipped with this definition, we can now make rigorous the notion of simple-connectedness, without resorting to some sloppy definition using ``absence of a hole''.

\begin{definition}[Simply connected]\index{simply connected}
  A domain \(U\) is \emph{simply connected} if every piecewise \(C^1\) closed path is homotopic to a constant path.
\end{definition}

\begin{eg}
  A star-domain is simply-connected. Suppose \(p \in U\) is such that for all \(w \in U\) the straight segment from \(p\) to \(w\) lies in \(U\). Given a path \(\gamma\),
  \[
    F(s, t) = s \gamma(t) + (1 - s)p
  \]
  is a homotopy.
\end{eg}

\begin{definition}[Elementary deformation]\index{elementary deformation}
  Let \(\phi, \psi: [0, 1] \to U\) be closed piecewise \(C^1\) curves. We say that \(\psi\) is an \emph{elementary deformation} of \(\phi\) if there exists \(0 = x_0 < x_1 < \dots < x_n = 1\) and convex open sets \(C_1, \dots, C_n\) in \(U\) such that for all \(t \in [x_{i - 1}, x_i]\), \(\phi(t), \psi(t) \in C_i\).
\end{definition}

Next up is a key technical proposition:

\begin{proposition}
  If \(\phi\) and \(\psi\) are homotopic closed paths in the domain \(U\), then there are \(\phi = \phi_0, \phi_1, \dots, \phi_N = \psi\) such that \(\phi_{t + 1}\) is an elementary deformation of \(\phi_t\).
\end{proposition}

This says that given two homotopic paths, we can find finitely many intermediate paths, each of which is an elementary deformation of the previous one. Elementary deformation localises paths to convex open sets on which convex Cauchy's theorem applies, ergo allowing us to deduce the general Cauchy's theorem.

\begin{proof}
  This is an exercise in uniform continuity. Let \(F\) be the homotopy between \(\phi\) and \(\psi\). \(\im F\) is a compact set and \(\C \setminus U\) is closed so
  \[
    \operatorname{dist}(\im F, \C \setminus U) = \varepsilon > 0.
  \]
  For this \(\varepsilon\), \(D(F(s, t), \varepsilon) \subseteq U\) for all \((s, t)\). Since \(F\) is uniformly continuous, there exists \(\delta > 0\) such that
  \begin{equation}
    \label{eqn:uniform continuity}
    \norm{(s', t') - (s, t)} < \delta \implies |F(s', t') - F(s, t)| < \varepsilon.
    \tag{\(\ast\)}
  \end{equation}
  Pick \(n\) such that \(\frac{1 + (b - a)}{n} < \delta\) and let \(x_j = a + \frac{b - a}{n}j\) for \(0 \leq j \leq n\). Let
  \[
    \phi_i = F|_{\{\frac{i}{n}\} \times [a, b]}
  \]
  and
  \[
    C_{ij} = D(F(\frac{i}{n}, x_j), \varepsilon) \subseteq U.
  \]
  By \eqref{eqn:uniform continuity} we check that if \(s \in [\frac{i - 1}{n}, \frac{i}{n}], t \in [x_{j - 1}, x_j]\) then \(F(s, t) \subseteq C_{ij}\). Then \(\phi_i\) is an elementary deformation of \(\phi_{i - 1}\).
\end{proof}

\begin{theorem}[Homotopy form of Cauchy's theorem]\index{Cauchy's theorem}
  \label{thm:homotopic Cauchy}
  Let \(f: U \to \C\) be holomorphic on a domain \(U\). If \(\phi\) and \(\psi\) are homotopic closed paths, then
  \[
    \int_\phi f(z) dz = \int_\psi f(z) dz.
  \]

  In particular if \(\phi\) is homotopic to a constant then
  \[
    \int_\phi f(z) dz = 0.
  \]
\end{theorem}

\begin{proof}
  Suppose first \(\psi\) is an elementary deformation of \(\phi\). Let \(\phi_i = \phi|_{[x_{i - 1}, x_i]}, \psi_i = \psi|_{[x_{i - 1}, x_i]} \subseteq C_i\) where \(C_i \subseteq U\) is convex. Let \(\gamma_i\) be the straight segment connecting \(\phi(x_i)\) to \(\psi(x_i)\), which is contained in \(C_i\) by convexity. Now the concatenation
  \[
    \phi_i \cdot \gamma_i \cdot (-\psi_i) \cdot (-\gamma_{i - 1})
  \]
  lies in \(C_i\) and by convex Cauchy, the integral along this closed path vanishes.

  Sum over \(1 \leq i \leq n\), we see that integrals over the \(\gamma_i\)'s cancel and thus
  \[
    \int_\phi f(z) dz = \int_\psi f(z) dz.
  \]
  Now invoke the technical proposition.
\end{proof}

Again this hightlights an idea that has been used throughout this course: complex analysis alone, i.e.\ the study of holomorphic functions gives local results. By using topological machinaries such as connectedness, compactness and in this section, homotopy, one can then extend them to global results.

\begin{corollary}
  Let \(U\) be a simply connected domain and \(f: U \to \C\) holomorphic. Then
  \[
    \int_\gamma f(z)dz = 0
  \]
  for all closed paths \(\gamma\) in \(U\).
\end{corollary}

\begin{proof}
  Trivial.
\end{proof}

\begin{remark}
  Let \(\phi, \psi: [a, b] \to U\) be two closed homotopic curves in a domain \(U\). If we take \(w \in \C \setminus U\), then the function \(\frac{1}{z - w}\) is holomorphic in \(U\) and by \nameref{thm:homotopic Cauchy}, \(I(\phi, w) = I(\psi, w)\).
\end{remark}

\section{Laurent expansion, Singularities and the Residue theorem}

\subsection{Laurent expansion}

\begin{theorem}
  Let \(f\) be a holomorphic function on an annulus
  \[
    A = \{z \in \C: r < |z - a| < R\}
  \]
  where \(0 \leq r < R \leq \infty\). Then
  \begin{enumerate}
  \item \(f\) has a unique convergent expansion in \(A\) of the form
    \begin{equation}
      \label{eqn:Laurent}
      f(z) = \sum_{n = -\infty}^\infty c_n(z - a)^n,
      \tag{\(\ast\)}
    \end{equation}
  \item for any \(\rho \in (r, R)\), the coefficient \(c_n\) is given by
    \[
      c_n = \frac{1}{2\pi i} \int_{|z - a| = \rho} \frac{f(z)}{(z - a)^{n + 1}} dz,
    \]
  \item if \(r < \rho' \leq \rho < R\), then the series converges uniformly on the set
    \[
      \{z \in \C: \rho' \leq |z - a| \leq \rho\}
    \]
    and thus locally uniformly on \(A\).
  \end{enumerate}
\end{theorem}

\begin{proof}
  As in the proof of Cauchy integral formula, consider the function
  \[
    g(z) =
    \begin{cases}
      \frac{f(z) - f(w)}{z - w} & \text{if } z \neq w \\
      f'(w) & \text{if } z = w
    \end{cases}
  \]
  \(g\) is holomorphic on \(A\) by a corollary of \nameref{cor:Morera}. Choose
  \[
    r < \rho_2 < |w - a| < \rho_1 < R
  \]
  and consider circles
  \begin{align*}
    C_1: |z - a| &= \rho_1 \\
    C_2: |z - a| &= \rho_2
  \end{align*}
  which are homotopic on \(A\). By \nameref{thm:homotopic Cauchy},
  \[
    \int_{C_1} g(z) dz = \int_{C_2} g(z) dz
  \]
  so
  \[
    \int_{C_1} \frac{f(z)}{z - w} dz - f(w) \underbrace{\int_{C_2} \frac{dz}{z - w}}_{2\pi i I(C_1, w) = 2\pi i}
    = \int_{C_2} \frac{f(z)}{z - w} dz - f(w) \underbrace{\int_{C_2} \frac{dz}{z - w}}_{2\pi i I(C_2, w) = 0}
  \]
  so
  \[
    f(w)
    = \frac{1}{2\pi i} \left( \int_{C_1} \frac{f(z)}{z - w} dz - \int_{C_2} \frac{f(z)}{z - w} dz \right)
    = f_1(w) + f_2(w).
  \]

  To deal with \(f_1\), we proceed exactly as in the proof of the Taylor series:
  \[
    \frac{1}{z - w}
    = \sum_{n = 0}^\infty \frac{(w - a)^n}{(z - a)^{n + 1}}
  \]
  uniformly as \(\left| \frac{w - a}{z - a} \right| < 1\). Thus use uniform convergence to get
  \[
    f_1(w) = \sum_{n = 0}^\infty c_n(w - a)^n
  \]
  where
  \[
    c_n = \frac{1}{2\pi i} \int_{C_1} \frac{f(z)}{(z - a)^{n + 1}} dz.
  \]
  To deal with \(f_2\) we use the same trick with the role of \(z\) and \(w\) reversed:
  \[
    -\frac{1}{z - w}
    = \frac{1/(w - a)}{1 - \frac{z - a}{w - a}}
    = \sum_{m = 1}^\infty \frac{(z - a)^{m - 1}}{(w - a)^m}
  \]
  uniformly for \(z \in C_2\) as \(\left| \frac{z - a}{w - a} \right| < 1\). Thus
  \[
    f_2(w) = \sum_{m = 1}^\infty d_m (w - a)^{-m}
  \]
  where
  \[
    d_m = \frac{1}{2\pi i} \int_{C_2} \frac{f(z)}{(z - a)^{-m + 1}} dz.
  \]
  Write \(n = -m\), we get \eqref{eqn:Laurent}.

  Suppose we have
  \[
    f(z) = \sum_{n = -\infty}^\infty c_n(z - a)^n
  \]
  on \(A\) and let \(r < \rho' \leq \rho < R\), then \(\sum_{n = 0}^\infty c_n(z - a)^n\) must have radius of convergence \(\geq r\), so converges uniformly on \(|z - a| \leq \rho\). Likewise set \(u = (z - a)^{-1}\), then \(\sum_{n = 1}^\infty c_{-n}u^n\) must have radius of convergence \(\geq \frac{1}{R}\), so converges uniformly on \(|u| \leq \frac{1}{R}\), hence \eqref{eqn:Laurent} converges uniformly in \(\rho' \leq |z - a| \leq \rho\).

  By uniform convergence of \eqref{eqn:Laurent}, we can integrate term-by-term over every closed curve in \(A\), so
  \[
    \int_{|z - a| = \rho} \frac{f(z)}{(z - a)^{m + 1}} dz
    = \sum_{n = -\infty}^\infty \int_{|z - a| = \rho} (z - a)^{n - m - 1} dz
    = 2\pi i c_m
  \]
  so this implies also that the expansion is unique and completes the proof.
\end{proof}

\subsection{Isolated singularities}

\begin{definition}[Isolated singularity]\index{isolated singularity}
  \(f\) has an \emph{isolated singularity} at \(a\) if \(f: D(a, R) \setminus \{a\} \to \C\) is holomorphic.
\end{definition}

For such a function, we know we can write it in Laurent expansion
\[
  f(z) = \sum_{n = -\infty}^\infty c_n(z - a)^n.
\]
There are three cases:

\begin{definition}[Removable singularity, pole \& essential singularity]\index{removable singularity}\index{pole}\index{essential singularity}\leavevmode
  \begin{enumerate}
  \item \(c_n = 0\) for all \(n < 0\). In this case we just get a power series which converges on all \(D(a, R)\) and defines an analytic function on \(D(a, R)\). We say that \(f\) has a \emph{removable singularity} at \(a\).
  \item There exists \(k > 0\) such that \(c_{-k} \neq 0\) but \(c_n = 0\) for all \(n < -k\). We say that \(f\) has a \emph{pole} of order \(k\) at \(z = a\).
  \item \(c_n \neq 0\) for infinitely many negative \(n\). We say that \(f\) has an \emph{essential singularity} at \(z = a\).
  \end{enumerate}
\end{definition}

\begin{eg}\leavevmode
  \begin{enumerate}
  \item \(f(z) = \frac{\sin z}{z}\) has a removable singularity at \(0\). To see this, expand \(\sin z\) in Taylor series as usual, and get a (Laurent) series by dividing by \(z\). As Luarent series is unique, this is the series representation.
  \item \(\frac{e^z}{z^{100}}\) and \(\frac{1}{z^9}\) have a pole at \(0\), by the same argument as above but replace ``power series'' by ``Laurent series''.
  \item \(e^{1/z}\) has an essential singularity at \(0\).
  \end{enumerate}
\end{eg}

In IID Riemann Surfaces we will learn that poles correpsond to normal points of a holomorphic function defined on a Riemann surface, and it is only the essential singularities that stand out.

\begin{proposition}
  \(f\) has a removable singularity at \(z = a\) if and only if
  \[
    \lim_{z \to a} (z - a)f(z) = 0.
  \]
\end{proposition}

\begin{proof}\leavevmode
  \begin{itemize}
  \item \(\implies\): Write
    \[
      (z - a)f(z) = \sum_{n = 0}^\infty c_n(z - a)^{n + 1}
    \]
    so it vanishes as \(z = a\).
  \item \(\impliedby\): Consider
    \[
      g(z) =
      \begin{cases}
        (z - a)^2f(z) & \text{if } z \neq a \\
        0 & \text{if } z = a
      \end{cases}
    \]
    We see that \(g\) is holomorphic and \(g'(a) = 0\) so
    \[
      g(z) = \sum_{n = 2}^\infty c_n(z -a)^n
    \]
    so
    \[
      f(z) = \sum_{n = 0}^\infty c_{n + 2}(z - a)^n
    \]
    and hence \(f\) has a removable singularity at \(z = a\).
  \end{itemize}
\end{proof}

\begin{proposition}
  \(f\) has a pole at \(z = a\) if and only if \(|f(z)| \to \infty\) as \(z \to a\). Moreover, TFAE
  \begin{enumerate}
  \item \(f\) has a pole of order \(k\) at \(z = a\),
  \item \(f(z) = (z - a)^{-k}g(z)\) where \(g: D(a, R) \to \C\) is holomorphic and \(g(a) \neq 0\).
  \item \(f(z) = \frac{1}{h(z)}\) where \(h\) is holomorphic at \(z = a\) with \(a\) a zero of order \(k\).
  \end{enumerate}
\end{proposition}

\begin{proof}\leavevmode
  \begin{itemize}
  \item \(1 \implies 2\): Using Laurent expansion for \(f\) and multiply by \((z - a)^k\), we get a power series with non-zero constant term defining \(g\).
  \item \(2 \implies 1\): The Laurent series for \(f\) is obtained by \((z - a)^{-k}\) times the Taylor series for \(g\).
  \item \(2 \Longleftrightarrow 3\): \(g\) is holomorphic at \(z = a\) with \(g(a) \neq 0\) if and only if \(\frac{1}{g}\) is holomorphic at \(z = a\).
  \end{itemize}

  Finally suppose \(f\) has a pole at \(z = a\). Then by 2 \(|f| \to \infty\) as \(z \to a\). Conversely if \(|f| \to \infty\) as \(z \to a\), then for some \(r > 0\), \(f\) is non-zero for \(0 < |z - a| < r\). Therefore \(\frac{1}{f}\) is holomorphic for \(0 < |z - a| < r\) and \(\frac{1}{f} \to 0\) as \(z \to a\). By the previous proposition \(\frac{1}{f}\) has a removable singularity at \(z = a\). Thus there is a holomorphic \(h\) on \(D(a, r)\) with \(\frac{1}{h} = f\) for \(0 < |z - a| < r\). As \(\frac{1}{f} \to 0\) as \(z \to a\), \(h\) has a zero at \(z = a\).
\end{proof}

\begin{corollary}
  \(f\) has an essential singularity at \(z = a\) if and only \(|f|\) has no limit (in \([0, \infty]\)) as \(z \to a\).
\end{corollary}

\begin{proof}
  Direct consequence of the previous two propositions.
\end{proof}

Actually we can say a bit more about how ``wild'' an essential singuarlity can be:

\begin{theorem}[Casorati-Weierstrass]\index{Casorati-Weierstrass theorem}
  Let \(f: D(a, R) \setminus \{a\} \to \C\) be holomorphic with an essential singularity at \(z = a\). Then for any \(w \in \C\) and \(r > 0, \varepsilon > 0\), there exists \(z\) such that \(0 < |z - a| < r\) and \(|f(z) - w| < \varepsilon\).
\end{theorem}

\begin{proof}
  See example sheet. A long hint: if there eixsts \(\varepsilon > 0, r > 0\) such that
  \[
    f(D(a, r) \setminus \{0\}) \subseteq \C \setminus D(w, \varepsilon),
  \]
  consider \(g(z) = \frac{1}{f(z) - w}\). We have \(|g(z)| < \frac{1}{\varepsilon}\). As it is bounded it must have a removable singularity at \(a\), so does \(f\). Absurd.
\end{proof}

With Laurent series defined and shown to be unique and uniformly continuous, we can integrate a holomorphic function term-by-term. Just as before, along a closed paths, only the \(\frac{1}{z - a}\) term survives. We thus define

\begin{definition}[Residue]\index{residue}
  Let \(f: D(a, R) \setminus \{a\} \to \C\) be holomorphic with Laurent expansion \(\sum_{n = -\infty}^\infty c_n(z - a)^n\). The \emph{residue} of \(f\) at \(z = a\) is
  \[
    \res_{z = a} f = c_{-1}.
  \]
\end{definition}

\begin{definition}[Principal part]\index{principal part}
  The \emph{principal part} of \(f\) at \(z = a\) is the series
  \[
    \sum_{n = -\infty}^{-1} c_n(z - a)^n
  \]
  holomorphic in \(\C \setminus \{a\}\).
\end{definition}

\begin{definition}[Meromorphic]\index{meromorphic}
  If \(D\) is a domain and \(S \subseteq D\) is a set of isolated points in \(D\), then a holomorphic function \(f: D \setminus S \to \C\) with at worst poles at \(D\) is called \emph{meromorphic}.
\end{definition}

\begin{remark}
  As hinted before, a meromorphic function \(f: D \setminus S \to \C\) can be extended to a holomorphic function \(f: D \to \C_\infty = \C \cup \{\infty\}\), sending poles to \(\infty\), between Riemann surfaces.
\end{remark}

\begin{proposition}
  If \(\gamma\) is a closed curve in \(D(a, R) \setminus \{a\}\) and \(f: D(a, r) \setminus \{a\} \to \C\) holomorphic then
  \[
    \int_\gamma f(z) dz = 2\pi i I(\gamma, a) \res_{z = a} f.
  \]
\end{proposition}

\begin{proof}
  Using uniform convergence of the Laurent expansion, we can integrate term-by-term and thus reduce the problem of computing \(\int_\gamma (z - a)^n dz\). Since \(\frac{(z - a)^{n + 1}}{n + 1}\) is an anti-derivative of \((z - a)^n\) for \(n \neq -1\), the only term that survives is
  \[
    c_{-1} \int_\gamma \frac{dz}{z - a} = 2\pi i I(\gamma, a) \res_{z = a} f.
  \]
\end{proof}

\begin{theorem}[Cauchy's residue theorem]\index{Cauchy's residue theorem}
  \label{thm:residue}
  Let \(U\) be a simply connected domain and \(\{z_i\}_{i = 1}^k\) be a finite set of points in \(U\). Let \(f: U \setminus \{z_i\}_{i = 1}^k \to \C\) be holomorphic and let \(\gamma\) be a closed curve not passing through the \(z_i\)'s. Then
  \[
    \int_\gamma f(z)dz = 2\pi i \sum_{i = 1}^k I(\gamma, z_i) \res_{z = z_i} f.
  \]
\end{theorem}

\begin{proof}
  The idea is to write the Laurent expansion at a singular point as the sum of the ``problematic part'', i.e.\ the principal part, and the ``good part'', i.e.\ the power series part, and apply the previous proposition and Cauchy's theorem respectively.

  At \(z_i\), \(f(z) = \sum_{n = -\infty}^\infty c_n^i (z - z_i)^n\) with principal part \(g_i(z) = \sum_{n = -\infty}^{-1} c_n^i(z - z_i)^n\). Recall that \(g_i\) defines a holomorphic function on \(\C \setminus \{z_i\}\) and hence on \(U \setminus \{z_i\}\). Thus \(f - \sum_{i = 1}^kg_i\) is holomorphic in \(U \setminus \{z_i\}_{i = 1}^k\) with \emph{removable} singularties at \(z_i\). Thus by \nameref{thm:homotopic Cauchy},
  \[
    \int_\gamma (f(z) - \sum_{i = 1}^k g_i(z)) dz = 0.
  \]
  By the proposition above,
  \[
    \int_\gamma g_i(z) dz = 2\pi i I(\gamma, z_i) \res_{z = z_i} g_i = 2\pi i I(\gamma, z_i) \res_{z = z_i} f.
  \]
\end{proof}

\subsection{Application and techniques of integration}

In this section we will discuss how to actually use \nameref{thm:residue} to compute integrals, which often involve simple geometric curves such as semicircles and rectangles. We will also solve some trickey real integral by clever use of \nameref{thm:residue}.

Firstly, the following observations are useful for computing residues:
\begin{enumerate}
\item if \(f\) has a simple pole (i.e.\ order \(1\)) at \(z = a\) then the Laurent expansion is \(f(z) = \frac{c_{-1}}{z - a} + c_0 + \cdots\) so
  \[
    \res_{z = a}f = \lim_{z \to a} (z - a)f(z).
  \]
\item if \(f = \frac{g}{h}\) where \(g\) and \(h\) are holomorphic at \(z = a\), \(g(a) \neq 0\) and \(h\) has a simple zero at \(a\), then
  \[
    \res_{z = a} f
    = \lim_{z \to a} \frac{(z - a)g(z)}{h(z)}
    =  \frac{g(a)}{h'(a)}.
  \]
\item if \(f(z) = (z - a)^{-k}g(z)\) with \(g\) holomorphic, then
  \[
    \res_{z = a}f
    = \text{ coefficient of } (z - a)^{k - 1} \text{ in the Taylor series of } g
    = \frac{g^{(k - 1)}(a)}{(k - 1)!}.
  \]
\end{enumerate}

The main ``skill'' is to choose the right integrand and the right path. Somes lemma also help us deform paths into more amenable forms.

\begin{eg}
  Consider
  \[
    \int_{-\infty}^\infty \frac{\cos x}{1 + x + x^2} dx.
  \]
  Let \(f(z) = \frac{e^{iz}}{1 + z + z^2}\) and \(\gamma = \gamma_R + \gamma_0\) where \(\gamma_R\) is the semicircle in the upper half plane around the origin of radius \(R\). \(f\) has a simple pole at \(w = e^{2\pi i/3}\) with index \(I(\gamma, w) = 1\). By \nameref{thm:residue},
  \begin{align*}
    \int_{\gamma_R} f(z) dz = 2\pi i \res_{z = w} f,
  \end{align*}
  where the residue can be computed using rules from last time.

  Let \(z = Re^{it}\) where \(t \in [0, 2\pi]\). Then
  \begin{align*}
    \left| \int_{\gamma_R} f(z) dz \right|
    &= \left| \int_0^\pi f(Re^{it})Rie^{it} dt \right| \\
    &\leq R \int_0^\pi |f(Re^{it})| dt \\
    &= R \int_0^\pi \frac{\overbrace{|e^{-R\sin t}|}^{\leq 1}}{\underbrace{|1 + Re^{it} + R^2e^{2it}|}_{\geq R^2 - R - 1}} dt \\
    &\leq \frac{R\pi}{R^2 - R - 1} \\
    &\to 0
  \end{align*}
  as \(R \to \infty\). Therefore
  \[
    \int_{-\infty}^\infty \frac{\cos x}{1 + x + x^2} dx = \Re (2\pi i \res_{z = w} f) = \frac{2\pi}{\sqrt 3} \cos \frac{1}{2} e^{-\sqrt 3/2}.
  \]
\end{eg}

The key idea is that the integral along the semicircle \(\gamma_R\) vanishes as \(R \to \infty\).

\begin{lemma}
  Let \(f\) be a holomorphic function on \(D(a, r) \setminus \{a\}\) with a simple pole at \(a\). If \(0 < \varepsilon < r\) and let \(\gamma_\varepsilon: [\alpha, \beta] \to \C, t \mapsto a + \varepsilon e^{it}\). Then
  \[
    \lim_{\varepsilon \to 0} \int_{\gamma_\varepsilon} f(z) dz = (\beta - \alpha) i \res_{z = a} f.
  \]
\end{lemma}

This allows us to ``jump'' over a pole.

\begin{proof}
  As \(f\) has a simple pole, write
  \[
    f(z) = \frac{c}{z - a} + g(z)
  \]
  where \(g(z)\) is holomorphic on \(D(a, r)\). Thus \(c = \res_{z = a} f\). Then
  \[
    \left| \int_{\gamma_\varepsilon} g(z) dz \right| \leq (\beta - \alpha) \varepsilon \sup_{z \in \gamma_\varepsilon} |g(z)| \to 0
  \]
  as \(\varepsilon \to 0\) since \(g\) is bounded on a neighbourhood of \(a\) by continuity. Then
  \[
    \int_{\gamma_\varepsilon} \frac{c}{z - a} dz = c \int_\alpha^\beta \frac{i\varepsilon e^{it}}{\varepsilon e^{it}} dt = (\beta - \alpha)ic.
  \]
\end{proof}

\begin{lemma}[Jordan]\index{Jordan's lemma}
  \label{lem:Jordan}
  If \(f\) is holomorphic on \(\{|z| > 0\}\) and \(zf(z)\) is bounded for large \(|z|\), then for all \(\alpha > 0\),
  \[
    \int_{\gamma_R} f(z)e^{i\alpha z} dz \to 0
  \]
  as \(R \to \infty\) where \(\gamma_R(t) = Re^{it}, t \in [0, \pi]\).
\end{lemma}

This comes very handy when one computes Fourier transforms. Also this makes our first example almost trivial.

\begin{proof}
  We know \(|f(z)| \leq \frac{c}{|z|}\) for large \(|z|\). Observe that on \([0, \frac{\pi}{2}]\) the function \(\frac{\sin t}{t}\) is decreasing. Thus \(\sin t \geq \frac{2t}{\pi}\) for \(t \in [0, \frac{\pi}{2}]\). Then on the path \(z = Re^{it}\),
  \[
    |e^{i\alpha z}| = e^{-R\alpha\sin t} \leq
    \begin{cases}
      e^{\frac{-R\alpha 2t}{\pi}} & 0 \leq t \leq \frac{\pi}{2} \\
      e^{\frac{-R\alpha 2t'}{\pi}} & 0 \leq t' = \pi - t \leq \frac{\pi}{2} \\
    \end{cases}
  \]
so
\begin{align*}
  \left| \int_0^{\pi/2} e^{i\alpha R e^{it}} f(Re^{it}) iRe^{it} dt \right|
  &\leq \int_0^{\pi/2} e^{-\frac{2Rt\alpha}{\pi}}c dt \\
  &= \frac{c\pi}{2R \alpha} (1 - e^{-R \alpha}) \\
  &\to 0
\end{align*}
as \(R \to \infty\).
\end{proof}

\begin{eg}
  Consider
  \[
    \int_0^\infty \frac{\sin x}{x} dx.
  \]
  Let \(f(z) = \frac{e^{iz}}{z}\). A naïve choice of semicircular path would pass through the pole at \(z = 0\). Instead consider the semicircular path with a cutout \(\gamma_\varepsilon\) at the origin. This path contains no singularity so has integral zero. By \nameref{lem:Jordan}, \(\int_{\gamma_R} f(z) dz \to 0\) as \(R \to \infty\). Also by the previous lemma,
  \[
    \int_{\gamma_\varepsilon} f(z) dz \to - \pi i \res_{z = 0} f = -\pi i.
  \]
  Putting everything together,
  \[
    \int_0^\infty \frac{\sin x}{x} dx = \frac{\pi}{2}.
  \]
\end{eg}

\begin{eg}
  Consider
  \[
    I = \int_0^{\pi/2} \frac{dt}{1 + \sin^2 t}.
  \]
  Note \(I = \frac{1}{4} \int_0^{2\pi} \frac{dt}{1 + \sin^2 t}\). On the unit circle \(z = e^{it}\),
  \[
    \sin t = \frac{e^{it} - e^{-it}}{2i} = \frac{z - \frac{1}{z}}{2i}.
  \]
  Thus
  \begin{align*}
    I
    &= \frac{1}{4} \int_{|z| = 1} \frac{dz}{(1 + \frac{(z - 1/z)^2}{-4})iz} \\
    &= i \int_{|z| = 1} \underbrace{\frac{z}{z^4 - 6z^2 + 1}}_f dz \\
    &= 2\pi i \cdot i (\res_{z = 1 - \sqrt 2} f + \res_{z = -1 + \sqrt 2} f) \\
    &= \frac{\pi\sqrt 2}{4}
  \end{align*}
\end{eg}

\section{The Argument principle, Local degree, Open mapping theorem \& Rouché's theorem}

We will use \nameref{thm:residue} to develop a better understanding of holomorphic functions.

\begin{proposition}
  Let \(f\) have a zero (pole, respectively) of order \(k\) at \(z = a\). Then \(\frac{f'(z)}{f(z)}\) has a simple pole at \(z = a\) with residue \(k\) (\(-k\), respectively).
\end{proposition}

\begin{proof}
  If \(f\) has a zero of order \(k\) at \(z = a\), then
  \[
    f(z) = (z - a)^k g(z)
  \]
  where \(g(z)\) is holomorphic and non-zero at \(z = a\). Then
  \[
    \frac{f'(z)}{f(z)} = \frac{k}{z - a} + \frac{g'(z)}{g(z)}.
  \]
  Hence the result. The pole case is similar.
\end{proof}

\begin{theorem}[Argument principle]\index{argument principle}
  \label{thm:argument principle}
  Let \(U\) be a simply connected domain and suppose \(f\) is meromorphic on \(U\) with finitely many zeros \(\{z_1, \dots, z_k\}\) and poles \(\{w_1, \dots, w_\ell\}\). Let \(\gamma\) be a closed curve in \(U\) such that \(z_i, w_j \notin \gamma\). Then
  \[
    \frac{1}{2\pi i} \int_\gamma \frac{f'(z)}{f(z)} dz
    = \sum_{i = 1}^k I(\gamma, z_i) \ord_{z_i}(f)
    - \sum_{j = 1}^\ell I(\gamma, w_j) \ord_{w_j}(f)
  \]
  where \(\ord_{z_i} f\) and \(\ord_{w_j} f\) denote the order of the zeros and poles.
\end{theorem}

\begin{proof}
  Apply \nameref{thm:residue} to \(\frac{f'}{f}\). If \(f\) has no zero or pole at \(z\) then \(\frac{f'}{f}\) has no singularity at \(z\). Otherwise apply the previous proposition.
\end{proof}

\begin{remark}
  Let \(\Gamma = f \compose \gamma\), then \(0 \notin \Gamma\). If we perform the substitution \(w = f(z)\) in the above integral we get
  \[
    \frac{1}{2\pi i} \int_\Gamma \frac{dw}{w} = I(\Gamma, 0).
  \]
\end{remark}

\begin{definition}[Bounded domain]\index{bounded domain}
  Let \(U\) be a domain and \(\gamma\) a closed curve in \(U\). The curve \(\gamma\) \emph{bounds} a domain \(D\) if \(I(\gamma, w) = 1\) for all \(w \in D\) and \(I(\gamma, w) = 0\) for all \(w \notin D \cup \gamma\).
\end{definition}

As a side note, we have the famous theorem (which we will definitely not prove) which gives a precise definition of the ``interior'' of a closed curve:

\begin{theorem}[Jordan curve theorem]
  Every simple closed curve admits an orientation such that it bounds a domain provided \(U\) is simply connected.
\end{theorem}

If \(\gamma\) bounds \(D\), then we get
\[
  I(\Gamma, 0) = N - P
\]
where
\begin{align*}
  N &= \#\text{zeros of \(f\) in \(D\) counted with multiplicity} \\
  P &= \#\text{poles of \(f\) in \(D\) counted with multiplicity}
\end{align*}

\begin{definition}[Local degree]\index{local degree}
  If \(f\) is non-constant and holomorphic at \(z = a\) and \(b = f(a)\), we say that the \emph{local degree} of \(f\) at \(z = a\) is the order of zero of \(f(z) - b\) at \(z = a\). We denote it by \(\deg_a f\), which is a positive integer.
\end{definition}

\begin{proposition}
  The local degree of \(f\) at \(z = a\) equals to \(I(f \compose \gamma, f(a))\) for any circle \(\gamma(t) = a + re^{2\pi it}, t \in [0, 1]\) of sufficiently small radius.
\end{proposition}

\begin{proof}
  Given the previous discussion, just apply \nameref{thm:argument principle} to \(f(z) - f(a)\). As it has isolated zeros it is non-zero for \(0 < |z - a| \leq r\) if \(r\) is sufficiently small.
\end{proof}

\begin{theorem}[Local mapping degree]\index{local mapping degree}
  \label{thm:local mapping degree}
  Let \(f: D \to \C\) be holomorphic and non-constant with local degree \(\deg_a f = d > 0\). Then if \(r > 0\) is sufficiently small then there exists \(\varepsilon > 0\) such that for every \(w\) with \(0 < |w - f(a)| \leq \varepsilon\), the equation
  \[
    f(z) = w
  \]
  has exactly \(d\) distinct roots in \(D(a, r)\).
\end{theorem}

Thus degree is indeed a local property. Consequently in Riemann surfaces, any holomorphic function has a local model \(z \mapsto z^d\).

\begin{proof}
  Let \(b = f(a)\) and let \(r > 0\) be such that \(f(z) - b\) and \(f'(z)\) are both non-zero for \(0 < |z - a| \leq r\). Let \(\gamma\) be the circle of centre \(z = a\) and radius \(r\). Then \(\Gamma = f \compose \gamma\) is a closed curve missing \(b\). Choose \(\varepsilon > 0\) such that \(D(b, \varepsilon)\) does not intersect \(\Gamma\). Then if \(w \in D(b, \varepsilon)\), the number of zeros counted with multiplicity of \(f(z) - w\) in \(D(a, r)\) equals to \(I(\Gamma, w)\) by \nameref{thm:argument principle}. But \(I(\Gamma, w) = I(\Gamma, b) = d\). Since \(r\) is chosen so that \(f'\) is non-zero on \(D(a, r) \setminus \{a\}\), the zeros are all simple.
\end{proof}

\begin{corollary}[Open mapping theorem]\index{open mapping theorem}
  \label{cor:open mapping theorem}
  A non-constant holomorphic function \(f: U \to \C\) maps open sets to open sets.
\end{corollary}

\begin{proof}
  Let \(V \subseteq U\) be open. Need to prove that given \(a \in V\), there is a disc around \(f(a)\) inside \(f(V)\). But by \nameref{thm:local mapping degree}, we can choose \(r, \varepsilon > 0\) such that \(D(a, r) \subseteq V\) and \(D(f(a), \varepsilon) \subseteq f(V)\).
\end{proof}

\begin{remark}
  This gives the inverse function theorem: if \(f'(a) \neq 0\) then \(\deg_a f = 1\), and \nameref{thm:local mapping degree} says that there is a local inverse \(g\) and \nameref{cor:open mapping theorem} implies that \(g\) is continuous. Moreover, \(g\) is holomorphic by the argument in the proof of differentiability of power series, which is the same as in IA Analysis I.
\end{remark}

\begin{theorem}[Rouché]\index{Rouché's theorem}
  \label{thm:Rouche}
  Let \(\gamma\) bound a domain \(D\) and let \(f\) and \(g\) be holomorphic in \(U \supseteq D\). If \(|f| > |g|\) on \(\gamma\), then \(f\) and \(f + g\) have the same number of zeros in \(D\) counted with multiplicity.
\end{theorem}

\begin{proof}
  Let \(h = f + g\). Note that by hypothesis \(f\) and \(h\) have no zeros on \(\gamma\). Consider \(F = h/f\) which is defined on \(\gamma\). Observe that \(|h - f| < |f|\) on \(\gamma\) so \(|F - 1| < 1\) on \(\gamma\). Then \(\Gamma = F \compose \gamma\) lies inside \(D(1, 1)\). \(0\) is in the unbounded component of \(\C \setminus \im \Gamma\) so \(I(\Gamma, 0) = 0\). Thus
  \begin{align*}
    0
    &= \frac{1}{2\pi i} \int_\gamma \frac{F'(z)}{F(z)} dz \\
    &= \frac{1}{2\pi i} \int_\gamma \frac{h'}{h} - \frac{f'}{f} dz \\
    &= I(h \compose \gamma, 0) - I(f \compose \gamma, 0) \\
    &= \#\text{zeros of } h - \#\text{zeros of } f
  \end{align*}
  where the last line is by \nameref{thm:argument principle}.
\end{proof}

\begin{eg}
  Let \(p(z) = \underbrace{z^4}_f + \underbrace{5z + 3}_g\). On \(|z| = 2\),
  \begin{align*}
    |f| &= |z^4| = 16 \\
    |g| &= |6z + 3| \leq 6|z| + 3 = 15
  \end{align*}
  so \(|f| > |g|\). Thus by \nameref{thm:Rouche}, \(p\) has \(4\) zeros inside \(|z| < 2\). Now consider \(p(z) = \underbrace{z^4 + 3}_g + \underbrace{6z}_f\) on \(|z| = 1\), verify that
  \begin{align*}
    |f| &= |6z| = 6 \\
    |g| &= |z^4 + 3| \leq |z^4| + 3 = 4
  \end{align*}
  so \(p\) has 1 root inside \(|z| < 1\). Thus we conclude that \(p\) has 3 roots in \(1 \leq |z| < 2\) and 1 root in \(|z| < 1\).
\end{eg}

\printindex

\iffalse
past lecture notes:
T. Scholl, K. Carne

Book
Ahlfors, Complex Analysis
\fi

\end{document}


\section{Background}
\label{sec:background}
%
In this section, we define as our target language an extension of the
simply-typed $\lambda$-calculus (STLC) (\autoref{sec:stlc}).
%
We then define partial equivalence of STLC programs
(\autoref{sec:peq}).

\subsection{A subject functional language}
\label{sec:stlc}
\begin{figure}[t]
  % structural types,
  \begin{minipage}{0.36\linewidth}
    \begin{align*} %
      \sigma \rightarrow &\ \unitty\ |\ \basety\ |\ X \\
      | &\ \sigma \rightarrow \sigma \\
      | &\ \sigma \times \sigma \\
      | &\ \sigma + \sigma \\
      | &\ \mu X. \sigma
    \end{align*}
    \caption{The space of structural types, $\types$.
      %
      Metavariable $\sigma$ ranges over $\types$ and $X$ ranges over
      least-fixed point variables.} %
    \label{fig:types}
  \end{minipage}
  \qquad
  % expressions,
  \begin{minipage}{0.55\linewidth}
    \begin{align*}
      % expression is the unit,
      e \rightarrow &\ \unit\
                      % a constant,
                      |\ c\
                      % or a variable,
                      |\ x\
                      % or a base operation or predicate,
                      |\ e_0 \oplus e_1 |\ e_0 \otimes e_1 \\
      % or an abstraction,
      | &\ \abs{ x }{ \sigma }{ e } \
      % or an application,
          | \ e_0\ e_1 \\
      % or a pairing,
      | &\ \pair{e_0}{e_1} \
      % or a let-expression,
          |\ \letexp{x}{\sigma_x }{y}{\sigma_y }{e_0}{e_1} \\
      % or an injection or a match,
      | &\ \injl\ e\ |\ \injr\ e\ \\
      | &\ \matchexp{e_0}{x}{\sigma_x}{e_1}{y}{\sigma_y}{e_2} \\
      % or a fix
      | &\ \fix{f}{\sigma}{e}
    \end{align*}
    \caption{The space of program expressions, $\expr$.
      %
      Metavariable $e$ ranges over $\expr$, %
      $c$ ranges over $\consts$, %
      $x$, $y$ and $f$, range over $\vars$, %
      $\oplus$ ranges over base operations,
      $\otimes$ ranges over base predicates, and
      $\sigma$ ranges over structural types. } %
    \label{fig:exprs}
  \end{minipage}
  \qquad
\end{figure}

% define base types:
\paragraph{Structural types}
%
A structural type defines the structure of values.
%
The space of types is defined in \autoref{fig:types}.
%
A type is the unit, the base type, a type variable, a function type, a
sum of types, a product of types, or a least-fixed point of a type.
%
A type $\sigma$ is well-formed if each type variable $X$ occurs only
as a component of a type of the form $\mu X. \sigma'$ that itself is a
component of $\sigma$.
%
The unit type, base type, and space of type variables are
\emph{atomic} structural types.

% define expression syntax:
\paragraph{Expressions}
% define spaces,
\autoref{fig:exprs} defines a space of expressions over spaces of
constants $\consts$ and variables $\vars$.
% define construction of expressions,
An expression is the unit, a constant, a variable, a base operation or
predicate over expressions, an abstraction, an application, a pair, a
\cc{let}-binding, a left injection, a right injection, a match, or a
fixpoint.
%
For each $e \in \expr$, the \emph{free-variables} of $e$ are denoted
$\freevars(e)$.

% define semantics:
\paragraph{Semantics}
%
A value is the unit, a constant, an abstraction, a pair of values, a
left-injection of a value, or a right-injection of a value;
%
the space of values is denoted $\values$.
%
For each base operation $\oplus$, there is a semantic function
$\interp{\oplus} : \consts \times \consts \to \consts$.
%
The space of Boolean values is
$\bools = \elts{ \injl\ \cc{()}, \injr\ \cc{()}}$;
%
for each base predicate $\oplus$, there is a semantic function
$\interp{\otimes} : \consts \times \consts \to \bools$.

\begin{figure}
  \centering
  \begin{gather*}
    % unit,
  \inference[ UNIT ]{ }{ \unit \evalsto \unit }
  % evaluate const:
  \inference[ CONST ]{ }{ c \evalsto c }
  % evaluate binary operations:
  \inference[ OP ]{ %
    e_0 \evalsto c_0 & %
    e_1 \evalsto c_1 }{ %
    e_0 \oplus e_1 \evalsto c_0 \interp{\oplus} c_1 }
  % evaluate binary pred:
  \inference[ PRED ]{ %
    e_0 \evalsto c_0 & %
    e_1 \evalsto c_1 }{ %
    e_0 \otimes e_1 \evalsto c_0 \interp{\otimes} c_1 } \\
  % abstraction,
  \inference[ ABS ]{ }{ \abs{ x }{ \sigma }{ e } \evalsto %
    \abs{ x }{ \sigma }{ e } \abs{x}{\sigma}{e} }
  % application,
  \inference[ APP ]{ %
    e_0 \evalsto \abs{x}{\sigma}{e_0'} & %
    e_1 \evalsto v_1 &
    \replace{ e_0' }{ x }{ v_1 } \evalsto v }{ %
    e_0\ e_1 \evalsto v } \\
  % pair,
  \inference[ PAIR ]{ %
    % evaluate components,
    e_0 \evalsto v_0 & e_1 \evalsto v_1 }{ %
    % pair them up to get final result
    \pair{ e_0 }{ e_1 } \evalsto (v_0, v_1) }
  % let,
  \inference[ LET ]{
    % evaluate bound expression,
    e_0 \evalsto (v_0^l, v_0^r) &
    % evaluate result with values replaced
    \replace{ e_1 }{ x, y }{ v_0^l, v_1^r } \evalsto v_1 }{ %
    \letexp{x}{\sigma_x}{y}{\sigma_y}{e_0}{e_1} \evalsto v_1 } \\
  % inject left,
  \inference[ INJL ]{ e \evalsto v }{ %
    \injl\ e \evalsto \injl\ v }
  % match left injection,
  \inference[ MATCHL ]{
    % evaluate target exp to a left injection,
    e_0 \evalsto \injl\ v_0 & %
    \replace{ e_1 }{ x }{ v_0 } \evalsto v_1 }{ %
    \matchexp{ e_0 }{ x }{\sigma_x}{ e_1 }{ y }{\sigma_y}{ e_2 } \evalsto v_1 } \\
  % inject right,
  \inference[ INJR ]{ e \evalsto v }{ \injr\ e \evalsto \injr\ v }
  % match right injection,
  \inference[ MATCHR ]{
    % evaluate target exp to a left injection,
    e_0 \evalsto \injr\ v_0 &
    \replace{ e_2 }{ y }{ v_0 } \evalsto v_2 }{ %
    \matchexp{ e_0 }{ x }{ \sigma_x }{ e_1 }{ y }{ \sigma_y }{ e_2 } \evalsto v_2 }
  % fix:
  \inference[ FIX ]{ \replace{e}{ f }{ \fix{ f }{\sigma}{ e } } \evalsto v } %
  { \fix{ f }{\sigma}{ e } \evalsto v }
  \end{gather*}
  \caption{The natural semantics of expressions.
    %
    Metavariable $e$ ranges over $\expr$, %
    $c$ ranges over $\consts$, %
    $\oplus$ ranges over base operations and predicates, %
    $x$, $y$, and $f$ range over $\vars$, and
    $\sigma$ ranges over structual types.}
  \label{fig:nat-sem}
\end{figure}
%
For each $e \in \expr$ and $v \in \values$, the fact that $e$
\emph{evaluates} to $v$ is denoted $e \evalsto v$.
%
The evaluation relation is a natural (i.e., \emph{big-step})
semantics, defined inductively by inference rules given in
\autoref{fig:nat-sem}.

% standard defns for logic:
\paragraph{Logic}
% define theory:
\sys infers types that relate evaluations of expressions using
formulas in formal logic.
%
Let the space of \emph{refinement values} be
$\fovals = \consts \union \elts{ \injl\ \unit, \injr\ \unit }$.
%
Let the \emph{refinement theory} $\mathcal{T}$ be a logical theory
with equality with a vocabularly whose constants are the program
constants, $\injl\ \unit$, and $\injr\ \unit$, and whose binary
functions are the space of binary operators.
%
Each model of $\mathcal{T}$ is isomorphic to the domain $\fovals$ and
the semantic functions $\interp{\oplus}$ for each binary operation and
predicate $\oplus$.
%
For practical languages modeled by $\expr$, $\mathcal{T}$ may be,
e.g., the quantifier-free fragment of the theory of linear arithmetic,
where $\consts$ is the space of integers, $\injl\ \unit$ and
$\injr\ \unit$ model true and false, the space of binary operators
contains plus, and the space of base predicates contains the
less-than-or-equal comparitor.

% define spaces of formulas:
For each space of logical variables $X$, the space of $\mathcal{T}$
formulas over $X$ is denoted $\formulas{ X }$.
%
For each formula $\varphi \in \formulas{X}$, the set of variables that
occur in $\varphi$ (i.e., the \emph{vocabulary} of $\varphi$) is
denoted $\vocab(\varphi)$.
% define models, satisfaction, entailment
For formulas $\varphi_0, \ldots, \varphi_n, \varphi \in \formulas{X}$,
the fact that $\varphi_0, \ldots, \varphi_n$ \emph{entail} $\varphi$
is denoted $\varphi_0, \ldots, \varphi_n \entails \varphi$.
%
There is a formula $\true \in \formulas{\emptyset}$ such that each
sequence of formulas entails $\true$.

% Define replacement and substitution:
For all vectors of variables $X = [ x_0, \ldots, x_n ]$ and
$Y = [ y_0, \ldots, y_n ]$, the $\mathcal{T}$ formula constraining the
equality of each element in $X$ with its corresponding element in $Y$,
i.e., the formula $\bigland_{0 \leq i \leq n} x_i = y_i$, is denoted
$X = Y$.
%
The repeated replacement of variables $\varphi[ y_0 / x_0 \ldots y_{n}
/ x_{n} ]$ is denoted $\replace{\varphi}{Y}{X}$.
%
For each formula $\varphi$ defined over free variables $X$,
$\replace{\varphi}{X}{Y}$ is denoted alternatively as $\varphi[Y]$.
%
The number of free variables in formula $\varphi$ is denoted
$\degreeof(\varphi)$.

\subsection{Constrained Horn Clauses}
\label{sec:chcs}

\subsubsection{Structure}
% definition of CHC
A Constrained Horn Clause is a body, consisting of a conjunctive set
of uninterpreted relational predicates and a constraint, and a head
relational predicate.
%
Relational predicates are predicate symbols paired with a map from
each symbol to its arity.
%
\begin{defn}
  \label{defn:rel-preds}
  For each space of symbols $\mathcal{R}$ and function $a: \mathcal{R}
  \to \nats$, $(\mathcal{R}, a)$ is a space of \emph{relational
    predicates}.
\end{defn}
%
The space of all relational predicates is denoted $\relpreds$.
%
For each space of relational predicates $\mathcal{R} \in \relpreds$,
we denote the predicate symbols and arity of $\mathcal{R}$ as
$\relsof{\mathcal{R}}$ and $\arityof{\mathcal{R}}$, respectively.
%
For relational predicates $\mathcal{R} \in \relpreds$ and symbol $R$,
we denote $R \in \relsof{ \mathcal{R} }$ alternatively as $R \in
\mathcal{R}$.
%
All definitions introduced in this section are given over a fixed,
arbitrary set of relational-predicate symbols $\mathcal{R}$.

% define applications of relational predicates:
An application of a relational predicate is a relational-predicate
symbol $R$ paired with a sequence of variables of length equal to the
arity of $R$.
%
\begin{defn}
  \label{defn:pred-apps}
  For $R \in \mathcal{R}$ and sequence of variables $Y \in X^{*}$ such
  that $|Y| = \arityof{\mathcal{R}}(R)$, $(R, Y)$ is an
  \emph{application}.
\end{defn}
%
The space of applications is denoted $\apps{\mathcal{R}}$.
%
For each application $A \in \apps{\mathcal{R}}$, the predicate symbol
and argument sequence of $A$ are denoted $\relof{A}$ and $\argsof{A}$
respectively.

% define CHC:
A Constrained Horn Clause is a body of applications, a constraint, and
a head application.
%
\begin{defn}
  \label{defn:chcs-structure}
  For $\mathcal{A} \subseteq \apps{\mathcal{R}}$ and %
  $\varphi \in \formulas{X}$, $\mathcal{B} = (\mathcal{A}, \varphi)$
  is a \emph{clause body}.
  %
  For $H \in \apps{\mathcal{R}}$, $(\mathcal{B}, H)$ is a
  \emph{Constrained Horn Clause}.
\end{defn}
% define space of bodies:
The space of clause bodies is denoted $\bodies{ \mathcal{R} } =
\pset(\apps{\mathcal{R}}) \times \formulas{X}$.
%
For each $\mathcal{B} \in \bodies{ \mathcal{R} }$, the constraint of
$\mathcal{B}$ is denoted $\ctrof{ \mathcal{B} }$.
% define space, projection:
The space of Constrained Horn Clauses is denoted $\chc{ \mathcal{R} }
= \bodies{ \mathcal{R} } \times \apps{ \mathcal{R} }$.
%
For each clause $\mathcal{C} \in \chc{\mathcal{R}}$, the body and head
of $\mathcal{C}$ are denoted $\bodyof{ \mathcal{C} }$ and $\headof{
  \mathcal{C} }$, respectively.
% define siblings:
For each $\mathcal{S} \subseteq \chc{ \mathcal{R} }$, $\mathcal{C} \in
\mathcal{S}$, and all applications $A_0, A_1 \in \appsof{ \bodyof{
    \mathcal{C} } }$, $\relof{A_0}$ and $\relof{A_1}$ are
\emph{siblings} in $\mathcal{S}$.

% give conditions on normalization:
Let $\mathcal{S} \subseteq \chc{ \mathcal{R} }$ that is recursion-free
be such that there is exactly one relational predicate $\queryof{
  \mathcal{S} }$ that is the dependency of no relational predicate.
%
Then $\mathcal{S}$ is a \emph{normalized} recursion-free system.
%
For the remainder of this paper, we consider only normalized
recursion-free sets of CHCs, and denote the space of such sets as
$\chcs{ \mathcal{R} }$.

\subsubsection{Solutions}
\label{sec:chc-solns}
%
A solution to a CHC system $\mathcal{S}$ is an interpretation of each
relational predicate $R$ of arity $n$ as a formula over $n$ free
variables such that for each clause $\mathcal{C} \in \mathcal{S}$, the
conjunction of interpretations of all relational predicates in the
body of $\mathcal{C}$ and the constraint of $\mathcal{C}$ entail the
interpretation of the head of $\mathcal{C}$.
%
Let a map from each $R \in \relsof{ \mathcal{R} }$ to a formula over
an ordered vector of $\arityof{ \mathcal{R} }(R)$ free variables be an
\emph{interpretation} of $\mathcal{R}$;
%
let the space of interpretations of $\mathcal{R}$ be denoted
$\interps{ \mathcal{R} }$.
%
\begin{defn}
  \label{defn:chc-soln}
  For $\mathcal{B} \in \bodies{ \mathcal{R} }$ and $H \in \apps{
    \mathcal{R} }$, %
  let $\sigma \in \interps{ \mathcal{R} }$ be such that for each $R
  \in \mathcal{R}$, $\arityof{\mathcal{R}}(R) = \degreeof{\sigma(R)}$
  and %
  %
  \[ \elts{ \sigma(\relof{ A })[ \argsof{ A } ] }_{ A \in \appsof{
      \mathcal{B} } }, %
  \ctrof{ \mathcal{B} } \entails %
  \sigma( \relof{H} )[ \argsof{ H } ]
  \]
  Then $\sigma$ is a \emph{solution} of $(\mathcal{B}, H)$.
\end{defn}
% define partial solution
For $\mathcal{S} \in \chcs{ \mathcal{R} }$, if %
\textbf{(1)} for each $\mathcal{C} \in \mathcal{S}$, $\sigma$ is a
solution of $\mathcal{C}$ and %
\textbf{(2)} $\sigma(\queryof{ \mathcal{S} }) \entails \false$, then
$\sigma$ is a \emph{solution} of $\mathcal{S}$.
%
The space of solutions of $\mathcal{S}$ is denoted $\solutions{
  \mathcal{S} }$.

% introduce solver:
A procedure that, given a recursion-free system $\mathcal{S}$ returns
either a solution of $\mathcal{S}$ or a value that denotes that
$\mathcal{S}$ has no solution is a CHC \emph{solver}.
%
\sys is defined as using a CHC solver, named $\solvechc$.

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "p"
%%% End: