\chapter{Meromorphic functions}
\label{ch:meromorphic_fn}
\section{The second nicest functions on earth}
If holomorphic functions are like polynomials,
then \emph{meromorphic} functions are like rational functions.
Basically, a meromorphic function is a function of the form
$ \frac{A(z)}{B(z)} $
where $A , B \colon  U \to \CC$ are holomorphic and $B$ is not zero.
The most important example of a meromorphic function is $\frac 1z$.

We are going to see that meromorphic functions behave
like ``almost-holomorphic'' functions.
Specifically, a meromorphic function $A/B$ will be holomorphic at all points
except the zeros of $B$ (called \emph{poles}).
By the identity theorem, there cannot be too many zeros of $B$!
So meromorphic functions can be thought of as ``almost holomorphic''
(like $\frac 1z$, which is holomorphic everywhere but the origin).
We saw that
\[ \frac{1}{2\pi i} \oint_{\gamma} \frac 1z \; dz =  1 \]
for $\gamma(t) = e^{it}$ the unit circle.
We will extend our results on contours to such situations.

It turns out that, instead of just getting $\oint_\gamma f(z) \; dz = 0$
like we did in the holomorphic case,
the contour integrals will actually be used to
\emph{count the number of poles} inside the loop $\gamma$.
It's ridiculous, I know.

\section{Meromorphic functions}
\prototype{$\frac 1z$, with a pole of order $1$ and residue $1$ at $z=0$.}

Let $U$ be an open subset of $\CC$ again.
\begin{definition}
	A function $f \colon U \to \CC$ is \vocab{meromorphic}
	if there exists holomorphic functions $A, B \colon U \to \CC$
	with $B$ not identically zero in any open neighborhood,
	and $f(z) = A(z)/B(z)$ whenever $B(z) \neq 0$.
\end{definition}
Let's see how this function $f$ behaves.
If $z \in U$ has $B(z) \neq 0$,
then in some small open neighborhood the function $B$ isn't zero
at all, and thus $A/B$ is in fact \emph{holomorphic};
thus $f$ is holomorphic at $z$.
(Concrete example: $\frac 1z$ is holomorphic
in any disk not containing $0$.)

On the other hand, suppose $p \in U$ has $B(p) = 0$: without loss of generality, $p=0$
to ease notation.
By using the Taylor series at $p=0$ we can put
\[ B(z) = c_k z^k + c_{k+1} z^{k+1} + \cdots \]
with $c_k \neq 0$
(certainly some coefficient is nonzero since $B$ is not identically zero!).
Then we can write
\[ \frac{1}{B(z)} = \frac{1}{z^k} \cdot \frac{1}{c_k + c_{k+1}z + \cdots}. \]
But the fraction on the right is a
holomorphic function in this open neighborhood!
So all that's happened is that we have an extra $z^{-k}$ kicking around.

%We want to consider functions $f$ defined on all points in $U$
%except for a set of ``isolated'' singularities;
%for example, something like \[ \frac{1}{z(z+1)(z^2+1)} \] which is defined
%for all $z$ other than $z=0$, $z=-1$ and $z=i$.
%Or even \[ \frac{1}{\sin(2\pi z)}, \] which is defined at every $z$ which is \emph{not} an integer.
%% Even though there's infinitely many points, they are not really that close together.

This gives us an equivalent way of viewing meromorphic functions:

\begin{definition}
	Let $f \colon U \to \CC$ as usual.
	A \vocab{meromorphic} function is a function which is holomorphic on $U$
	except at an isolated set $S$ of points
	(meaning it is holomorphic as a function $U \setminus S \to \CC$).
	For each $p \in S$, called a \vocab{pole} of $f$,
	the function $f$ is further required to admit a \vocab{Laurent series}, meaning that
	\[
		f(z) =
		\frac{c_{-m}}{(z-p)^m}
		+ \frac{c_{-m+1}}{(z-p)^{m-1}}
		+ \dots
		+ \frac{c_{-1}}{z-p} + c_0 + c_1 (z-p) + \dots
	\]
	for all $z$ in some open neighborhood of $p$, other than $z = p$.
	Here $m$ is a positive integer, and $c_{-m} \neq 0$.
\end{definition}
Note that the trailing end \emph{must} terminate.
By ``isolated set'', I mean that we can draw
open neighborhoods around each pole in $S$,
in such a way that no two open neighborhoods intersect.

\begin{example}
	[Example of a meromorphic function]
	Consider the function \[ \frac{z+1}{\sin z}. \]
	It is meromorphic, because it is holomorphic everywhere except at the zeros of $\sin z$.
	At each of these points we can put a Laurent series: for example at $z=0$ we have
	\begin{align*}
		\frac{z+1}{\sin z}
		&= (z+1) \cdot \frac{1}{z - \frac{z^3}{3!} + \frac{z^5}{5!} - \dotsb} \\
		&= \frac 1z \cdot \frac{z+1}{1 - \left(%
			\frac{z^2}{3!} - \frac{z^4}{5!} + \frac{z^6}{7!} - \dotsb \right)} \\
		&= \frac 1z \cdot (z+1) \sum_{k \ge 0} \left( %
			\frac{z^2}{3!}-\frac{z^4}{5!}+\frac{z^6}{7!}-\dotsb \right)^k.
	\end{align*}
	If we expand out the horrible sum (which I won't do),
	then you get $\frac 1z$ times a perfectly
	fine Taylor series, i.e.\ a Laurent series.
\end{example}

\begin{abuse}
	We'll often say something like
	``consider the function $f \colon \CC \to \CC$
	by $z \mapsto \frac 1z$''.
	Of course this isn't completely correct,
	because $f$ doesn't have a value at $z=0$.
	If I was going to be completely rigorous
	I would just set $f(0) = 2015$ or something and move on
	with life, but for all intents
	let's just think of it as ``undefined at $z=0$''.

	Why don't I just write $g \colon \CC \setminus \{0\} \to \CC$?
	The reason I have to do this is that it's still important
	for $f$ to remember it's ``trying'' to be holomorphic on $\CC$,
	even if isn't assigned a value at $z=0$.
	As a function $\CC \setminus \{0\} \to \CC$ the function $\frac 1z$ is actually holomorphic.
\end{abuse}

\begin{remark}
	I have shown that any function $A(z)/B(z)$
	has this characterization with poles,
	but an important result is
	that the converse is true too:
	if $f \colon U \setminus S \to \CC$ is holomorphic for some isolated set $S$,
	and moreover $f$ admits a Laurent series at each point in $S$,
	then $f$ can be written as a rational quotient of holomorphic functions.
	I won't prove this here, but it is good to be aware of.
\end{remark}

\begin{definition}
	Let $p$ be a pole of a meromorphic function $f$, with Laurent series
	\[
		f(z) =
		\frac{c_{-m}}{(z-p)^m}
		+ \frac{c_{-m+1}}{(z-p)^{m-1}}
		+ \dots
		+ \frac{c_{-1}}{z-p} + c_0 + c_1 (z-p) + \dots.
	\]
	The integer $m$ is called the \vocab{order} of the pole.
	A pole of order $1$ is called a \vocab{simple pole}.

	We also give the coefficient $c_{-1}$ a name, the \vocab{residue} of $f$ at $p$,
	which we write $\Res(f;p)$.
\end{definition}

The order of a pole tells you how ``bad'' the pole is.
The order of a pole is the ``opposite'' concept of the \vocab{multiplicity} of a \vocab{zero}.
If $f$ has a pole at zero, then its Laurent series near $z=0$ might look something like
\[ f(z) = \frac{1}{z^5} + \frac{8}{z^3} - \frac{2}{z^2} + \frac{4}{z} + 9 - 3z + 8z^2 + \dotsb \]
and so $f$ has a pole of order five.
By analogy, if $g$ has a zero at $z=0$, it might look something like
\[ g(z) = 3z^3 + 2z^4 + 9z^5 + \dotsb \]
and so $g$ has a zero of multiplicity three.
These orders are additive: $f(z) g(z)$ still has a pole of order $5-3=2$,
but $f(z)g(z)^2$ is completely patched now, and in fact has a \vocab{simple zero} now
(that is, a zero of degree $1$).

\begin{exercise}
	Convince yourself that orders are additive as described above.
	(This is obvious once you understand that you
	are multiplying Taylor/Laurent series.)
\end{exercise}

Metaphorically, poles can be thought of as ``negative zeros''.


We can now give many more examples.
\begin{example}
	[Examples of meromorphic functions]
	\listhack
	\begin{enumerate}[(a)]
		\ii Any holomorphic function is a meromorphic function which happens to have no poles.
		Stupid, yes.
		\ii The function $\CC \to \CC$ by $z \mapsto 100z\inv$ for $z \neq 0$
		but undefined at zero is a meromorphic function.
		Its only pole is at zero, which has order $1$ and residue $100$.
		\ii The function $\CC \to \CC$ by $z \mapsto z^{-3} + z^2 + z^9$ is also a meromorphic function.
		Its only pole is at zero, and it has order $3$, and residue $0$.
		\ii The function $\CC \to \CC$ by $z \mapsto \frac{e^z}{z^2}$ is meromorphic,
		with the Laurent series at $z=0$ given by
		\[
			\frac{e^z}{z^2}
			= \frac{1}{z^2} + \frac{1}{z} + \frac{1}{2} + \frac{z}{6} + \frac{z^2}{24} + \frac{z^3}{120}
			+ \dotsb.
		\]
		Hence the pole $z=0$ has order $2$ and residue $1$.
	\end{enumerate}
\end{example}

\begin{example}
	[A rational meromorphic function]
	Consider the function $\CC \to \CC$ given by
	\begin{align*}
		z &\mapsto \frac{z^4+1}{z^2-1} = z^2 + 1 + \frac{2}{(z-1)(z+1)} \\
		&= z^2 + 1 + \frac1{z-1} \cdot \frac{1}{1+\frac{z-1}{2}} \\
		&= \frac{1}{z-1} + \frac32 + \frac94(z-1) + \frac{7}{8}(z-1)^2 - \dots
	\end{align*}
	It has a pole of order $1$ and residue $1$ at $z=1$.
	(It also has a pole of order $1$ at $z=-1$; you are invited to compute the residue.)
\end{example}
\begin{example}
	[Function with infinitely many poles]
	The function $\CC \to \CC$ by \[ z \mapsto \frac{1}{\sin(z)} \]
	has infinitely many poles: the numbers $z = \pi k$, where $k$ is an integer.
	Let's compute the Laurent series at just $z=0$:
	\begin{align*}
		\frac{1}{\sin(z)}
		&= \frac{1}{\frac{z}{1!} - \frac{z^3}{3!} + \frac{z^5}{5!} - \dotsb} \\
		% &= \frac{1/z}{\frac{1}{1!} - \frac{z^2}{3!} + \frac{z^4}{5!} - \dotsb} \\
		&= \frac 1z \cdot \frac{1}{1 - \left( \frac{z^2}{3!} - \frac{z^4}{5!} + \dotsb \right)} \\
		&= \frac 1z \sum_{k \ge 0} \left( \frac{z^2}{3!} - \frac{z^4}{5!} + \dotsb \right)^k.
	\end{align*}
	which is a Laurent series, though I have no clue what the coefficients are.
	You can at least see the residue; the constant term of that huge sum is $1$,
	so the residue is $1$.
	Also, the pole has order $1$.
\end{example}
\begin{example}[A function that is not meromorphic]
	Consider the function
	\[ z \mapsto \frac{1}{\sin(1/z)}. \]
	It is a holomorphic function on
	\[ U = \CC \setminus \{ 0 \} \setminus S \]
	where we define $S = \{ \frac{1}{\pi k} \mid k \in \ZZ \setminus \{ 0 \} \}$.
	Similar to $z \mapsto \frac{1}{\sin(z)}$,
	each point in the set $S$ has a pole of order $1$.

	However, at $z = 0$, the function admits no Laurent series --- if it were, there would be a
	neighborhood around $z = 0$ where the function is defined, but there is no such set.

	However, $f$ is meromorphic on $\CC \setminus \{ 0 \}$ --- the set $S$ is isolated, but $S \cup
	\{ 0 \}$ is not isolated.
\end{example}


The Laurent series, if it exists, is unique (as you might have guessed),
and by our result on holomorphic functions it is actually valid for \emph{any}
disk centered at $p$ (minus the point $p$).
The part $\frac{c_{-1}}{z-p} + \dots + \frac{c_{-m}}{(z-p)^m}$ is called the \vocab{principal part},
and the rest of the series $c_0 + c_1(z-p) + \dotsb$ is called the \vocab{analytic part}.



\section{Winding numbers and the residue theorem}
Recall that for a counterclockwise circle $\gamma$ and a point $p$ inside it, we had
\[
	\oint_{\gamma} (z-p)^m \; dz =
	\begin{cases}
		0 & m \neq -1 \\
		2\pi i & m = -1
	\end{cases}
\]
where $m$ is an integer.
One can extend this result to in fact show that $\oint_\gamma (z-p)^m \; dz = 0$
for \emph{any} loop $\gamma$, where $m \neq -1$.
So we associate a special name for the nonzero value at $m=-1$.
\begin{definition}
	For a point $p \in \CC$ and a loop $\gamma$ not passing through it,
	we define the \vocab{winding number}, denoted $\Wind(\gamma, p)$, by
	\[
		\Wind(\gamma, p) = \frac{1}{2\pi i} \oint_{\gamma} \frac{1}{z-p} \; dz
	\]
\end{definition}
For example, by our previous results we see that if $\gamma$ is a circle, we have
\[
	\Wind(\text{circle}, p)
	=
	\begin{cases}
		1 & \text{$p$ inside the circle} \\
		0 & \text{$p$ outside the circle}.
	\end{cases}
\]
If you've read the chapter on fundamental groups, then this is just the fundamental group
associated to $\CC \setminus \{p\}$.
In particular, the winding number is always an integer.
(Essentially, it uses the complex logarithm to track how the argument of the function changes.
The details are more complicated, so we omit them here).
In the simplest case the winding numbers are either $0$ or $1$.
\begin{definition}
	We say a loop $\gamma$ is \vocab{regular} if $\Wind(\gamma, p) = 1$
	for all points $p$ in the interior of $\gamma$ (for example,
	if $\gamma$ is a counterclockwise circle).
\end{definition}

With all these ingredients we get a stunning generalization of the Cauchy-Goursat theorem:
\begin{theorem}
	[Cauchy's residue theorem]
	Let $f \colon \Omega \to \CC$ be meromorphic, where $\Omega$ is simply connected.
	Then for any loop $\gamma$ not passing through any of its poles, we have
	\[
		\frac{1}{2\pi i} \oint_{\gamma} f(z) \; dz
		= \sum_{\text{pole $p$}} \Wind(\gamma, p) \Res(f; p).
	\]
	In particular, if $\gamma$ is regular then the contour integral
	is the sum of all the residues, in the form
	\[
		\frac{1}{2\pi i} \oint_{\gamma} f(z) \; dz
		= \sum_{\substack{\text{pole $p$} \\ \text{inside $\gamma$}}}  \Res(f; p).
	\]
\end{theorem}
\begin{ques}
	Verify that this result coincides
	with what you expect when you integrate $\oint_\gamma cz\inv \; dz$
	for $\gamma$ a counter-clockwise circle.
\end{ques}

The proof from here is not really too impressive -- the ``work'' was already
done in our statements about the winding number.
\begin{proof}
	Let the poles with nonzero winding number be $p_1, \dots, p_k$
	(the others do not affect the sum).\footnote{To show
		that there must be finitely many such poles: recall that all our contours $\gamma \colon [a,b] \to \CC$
		are in fact bounded, so there is some big closed disk $D$ which contains all of $\gamma$.
		The poles outside $D$ thus have winding number zero.
		Now we cannot have infinitely many poles inside the disk $D$, for $D$ is compact and the
		set of poles is a closed and isolated set!}
	Then we can write $f$ in the form
	\[
		f(z) = g(z) + \sum_{i=1}^k P_i\left( \frac{1}{z-p_i} \right)
	\]
	where $P_i\left( \frac{1}{z-p_i} \right)$ is the principal part of the pole $p_i$.
	(For example, if $f(z) = \frac{z^3-z+1}{z(z+1)}$ we would write $f(z) = (z-1) + \frac1z - \frac1{1+z}$.)

	The point of doing so is that the function $g$ is holomorphic (we've removed all the ``bad'' parts), so
	\[ \oint_{\gamma} g(z) \; dz = 0 \]
	by Cauchy-Goursat.

	On the other hand, if $P_i(x) = c_1x + c_2x^2 + \dots + c_d x^d$ then
	\begin{align*}
		\oint_{\gamma} P_i\left( \frac{1}{z-p_i} \right) \; dz
		&=
		\oint_{\gamma} c_1 \cdot \left( \frac{1}{z-p_i} \right) \; dz
		+ \oint_{\gamma} c_2 \cdot \left( \frac{1}{z-p_i} \right)^2 \; dz
		+ \dots \\
		&= c_1 \cdot \Wind(\gamma, p_i) + 0 + 0 + \dots \\
		&= \Wind(\gamma, p_i) \Res(f; p_i).
	\end{align*}
	which gives the conclusion.
\end{proof}

\begin{remark}[Intuition behind Cauchy's integral formula]
	\label{remark:cauchy_integral_intuition}
	% from complex_analysis --- Serge Lang, proof using power series
	In the setting of \Cref{thm:cauchy_integral_formula},
	note that if $f$ is meromorphic in the disk $D$, we can compute the Laurent series of $f$ at the
	point $a$:
	\[
		f(z) =
		\frac{c_{-m}}{(z-a)^m}
		+ \frac{c_{-m+1}}{(z-a)^{m-1}}
		+ \dots
		+ \frac{c_{-1}}{z-a} + c_0 + c_1 (z-a) + \cdots
	\]

	By the residue theorem, integrating $f(z)$ around the boundary of $D$
	results in the $c_{-1}$ coefficient in the Laurent series:
	\[
		\frac{1}{2\pi i} \oint_\gamma f(z) \; dz = \Res(f; a) = c_{-1}.
	\]
	Of course, this is useless --- $f$ is holomorphic at $a$, so $c_{-1} = 0$.
	We want to compute $c_0 = f(a)$ instead.

	Nevertheless, the trick is that \emph{we can manipulate the function $f$} in order to move the
	coefficient we want to compute to the coefficient corresponding to $(z-a)^{-1}$.
	How are we going to do that? By dividing by $z-a$, of course!

	So, $\frac{f(z)}{z-a}$ is meromorphic in the disk $D$, with Laurent series expansion around $a$
	being
	\[
		\frac{f(z)}{z-a} =
		\frac{c_{-m}}{(z-a)^{m+1}}
		+ \frac{c_{-m+1}}{(z-a)^{m}}
		+ \dots
		+ \frac{c_{-1}}{(z-a)^2} + \frac{c_0}{z-a} + c_1 + c_2 (z-a) + \cdots
	\]
	Because $\frac{f(z)}{z-a}$ has no other poles in $D$ except at $a$,
	the residue theorem immediately tells us the integral
	$\frac{1}{2\pi i} \oint_\gamma \frac{f(z)}{z-a} \; dz$ equals $\Res(\frac{f(z)}{z-a}; a)$,
	which equals $c_0$ looking at the Laurent series above.
\end{remark}

\section{Argument principle}
One tricky application is as follows.
Given a polynomial $P(x) = (x-a_1)^{e_1}(x-a_2)^{e_2}\dots(x-a_n)^{e_n}$, you might know that we have
\[ \frac{P'(x)}{P(x)} = \frac{e_1}{x-a_1} + \frac{e_2}{x-a_2} + \dots + \frac{e_n}{x-a_n}. \]
The quantity $P'/P$ is called the \vocab{logarithmic derivative}, as it is the derivative of $\log P$.
This trick allows us to convert zeros of $P$ into poles of $P'/P$ with order $1$;
moreover the residues of these poles are the multiplicities of the roots.

In an analogous fashion, we can obtain a similar result for any meromorphic function $f$.
\begin{proposition}
	[The logarithmic derivative]
	Let $f \colon U \to \CC$ be a meromorphic function.
	Then the logarithmic derivative $f'/f$ is meromorphic as a function from $U$ to $\CC$;
	its only poles are:
	\begin{enumerate}[(i)]
		\ii A pole at each zero of $f$ whose residue is the multiplicity, and
		\ii A pole at each pole of $f$ whose residue is the negative of the pole's order.
	\end{enumerate}
\end{proposition}
Again, you can almost think of a pole as a zero of negative multiplicity.
This spirit is exemplified below.
\begin{proof}
	Dead easy with Laurent series.
	Let $a$ be a zero/pole of $f$, and WLOG set $a=0$ for convenience.
	We take the Laurent series at zero to get
	\[ f(z) = c_k z^k + c_{k+1} z^{k+1} + \dots \] % chktex 25
	where $k < 0$ if $0$ is a pole and $k > 0$ if $0$ is a zero.
	Taking the derivative gives
	\[ f'(z) = kc_k z^{k-1} + (k+1)c_{k+1}z^{k} + \dots. \]
	Now look at $f'/f$; with some computation, it equals
	\[
		\frac{f'(z)}{f(z)}
		= \frac 1z \frac{kc_k + (k+1)c_{k+1}z + \dots}{c_k + c_{k+1}z + \dots}.
	\]
	So we get a simple pole at $z=0$, with residue $k$.
\end{proof}

Using this trick you can determine the number of zeros and poles inside a regular closed curve,
using the so-called Argument Principle.\footnote{So-called because the \emph{argument} of a complex
number $z$ is the angle formed by the real axis and the vector representing $z$, not because you
need to use any argument. If $z \in \CC$ is interpreted as a point in $\RR^2$,
the argument of $z$ is the same as $\theta(z)$ defined in \Cref{ex:angle_form}.}

\begin{theorem}
	[Argument principle]
	\label{thm:arg_principle}
	Let $\gamma$ be a regular curve.
	Suppose $f \colon U \to \CC$ is meromorphic inside and on $\gamma$, and
	none of its zeros or poles lie on $\gamma$.
	Then
	\[
		\frac{1}{2\pi i} \oint_\gamma \frac{f'}{f} \; dz
		= \frac{1}{2\pi i} \oint_{f \circ \gamma} \frac{1}{z} \; dz
		= Z - P
	\]
	where $Z$ is the number of zeros inside $\gamma$ (counted with multiplicity)
	and $P$ is the number of poles inside $\gamma$ (again with multiplicity).
\end{theorem}
\begin{proof}
	Immediate by applying Cauchy's residue theorem alongside the preceding proposition.
	In fact you can generalize to any curve $\gamma$ via the winding number:
	the integral is
	\[ \frac{1}{2\pi i} \oint_\gamma \frac{f'}{f} \; dz
		= \sum_{\text{zero $z$}} \Wind(\gamma,z)
		- \sum_{\text{pole $p$}} \Wind(\gamma,p) \]
	where the sums are with multiplicity.
\end{proof}

Thus the Argument Principle allows one to count zeros and poles inside any region of choice.

Computers can use this to get information on functions whose values can be computed but whose behavior as a whole
is hard to understand.
Suppose you have a holomorphic function $f$, and you want to understand where its zeros are.
Then just start picking various circles $\gamma$.
Even with machine rounding error, the integral will be close enough to the true integer value that
we can decide how many zeros are in any given circle.
Numerical evidence for the Riemann Hypothesis (concerning the zeros of the Riemann zeta function)
can be obtained in this way.

\section{Digression: the Argument Principle viewed geometrically}

There is another, more geometric, way to understand the Argument Principle.

Assume a function $f$ is holomorphic on a connected open set $U$ containing $0$,
and possibly has a zero or a
pole at $0$. Let $\gamma \colon [0, 2 \pi] \to U$ be some curve contained in $U$, such that $0$ is
not in the image of the curve.

Let $a = \gamma(0)$ be the starting point of $\gamma$, and $b = \gamma(2 \pi)$ be the ending
point of $\gamma$.

We all know that $z \mapsto \log z$ is not an actual function --- even ignoring the singularity
at $0$, it has a branch cut (we will formally handle this in \Cref{ch:complex_log}).

Nevertheless, if we close our eyes and shuffle some symbols around, we get:
\begin{align*}
	\frac{1}{2 \pi i} \oint_\gamma \frac{f'(z)}{f(z)} \; dz
	&= \frac{1}{2 \pi i} \oint_\gamma \frac{d}{dz} \log f(z) \; dz \\
	&= \frac{1}{2 \pi i} \oint_\gamma d (\log f(z)) \\
	&= \frac{1}{2 \pi i} \cdot (\log f(b) - \log f(a)).
\end{align*}
Miraculously, everything seems to cancel out so nicely! This is not a coincidence.

Now, if $\gamma$ is a circle, then $a = b$, so the formula above seemingly states that the
integral will be $0$?
Fortunately for us, no --- $\log$ is in fact not a function.

So, does the formula above mean anything?
It does! While we won't prove this rigorously, the point is that:
\begin{moral}
	If we let a point $p$ smoothly move from $a$ to $b$, and let $\log f(p)$ follow the value,
	then $\log f(b) - \log f(a)$ represents the change in value of $\log f(p)$.
\end{moral}

In the notation of \Cref{sec:lifting_thm},
we have the mouse moves along $\gamma$ from $a$ to $b$, the first robot moves along $f \circ \gamma$
from $f(a)$ to $f(b)$, and the second robot moves from $\log f(a)$ to $\log f(b)$.

If we forget about the mouse for a moment, note that:
\begin{moral}
	The quantity $\frac{1}{2 \pi i} \oint_\gamma \frac{f'(z)}{f(z)} \; dz$ is equal to
	the number of times the \emph{first} robot winds around the origin.
\end{moral}
That is, $\Wind(f \circ \gamma, 0)$. (This is essentially obvious to see, because of all the work we
have done to prove $\oint d \log z = \oint \frac{1}{z} \; dz$ equals the winding number.)

Finally, if we look at some simple examples like $z^3$:
\begin{center}
\begin{asy}
	cplane();
	guide zp, zp3;
	pair fz(int d){
		return exp((I+0.05)*d*2*pi/360)*1.2;
	}
	for(int d=0; d<=270; d+=45){
		pair z=fz(d);
		zp=zp..z;
		zp3=zp3..z^3;
		dot(zp, red);
		dot(zp3, blue);
	}
	draw(zp, red);
	draw(zp3, blue);

	label("$z_0^{\phantom{3}}$", fz(0), align=S, red);
	label("$z_1$", fz(45), align=SW, red);
	label("$z_6$", fz(45*6), align=E, red);
	label("$z_0^3$", fz(0)^3, align=S, blue);
	label("$z_1^3$", fz(45)^3, align=NW, blue);
	label("$z_6^3$", fz(45*6)^3, align=W, blue);
\end{asy}
\end{center}
We can immediately see the relation between the winding number and the multiplicity of a zero:
\begin{moral}
	If $z$ moves around the origin in a circle once, then $z^n$ moves around the origin in a circle
	$n$ times.
\end{moral}
$z^{-n}$ is not much different --- it moves around the origin in a circle $n$ times, just in the
opposite direction.

Piecing all these pieces together, we get the Argument Principle --- the logarithmic derivative can
be used to count the multiplicity of the roots and the order of the poles.

\section{Philosophy: why are holomorphic functions so nice?}
All the fun we've had with holomorphic and meromorphic functions comes down to the fact that
complex differentiability is such a strong requirement.
It's a small miracle that $\CC$, which \emph{a priori} looks only like $\RR^2$,
is in fact a field.
Moreover, $\RR^2$ has the nice property that one can draw nontrivial loops
(it's also true for real functions that $\int_a^a f \; dx = 0$, but this is not so interesting!),
and this makes the theory much more interesting.

As another piece of intuition from Siu\footnote{Harvard professor.}:
If you try to get (left) differentiable functions over \emph{quaternions},
you find yourself with just linear functions.


\section\problemhead
% Looman-Menchoff theorem?

\begin{problem}
	[Fundamental theorem of algebra]
	Prove that if $f$ is a nonzero polynomial of degree $n$
	then it has $n$ roots.
\end{problem}

\begin{dproblem}
	[Rouch\'e's theorem]
	Let $f, g \colon U \to \CC$ be holomorphic functions,
	where $U$ contains the unit disk.
	Suppose that $\left\lvert f(z) \right\rvert > \left\lvert g(z) \right\rvert$
	for all $z$ on the unit circle.
	Prove that $f$ and $f+g$ have the same number of zeros
	which lie strictly inside the unit circle (counting multiplicities).
\end{dproblem}

\begin{problem}
	[Wedge contour]
	\onechili
	For each odd integer $n \ge 3$, evaluate the improper integral
	\[ \int_0^\infty \frac{1}{1+x^{n}} \; dx. \]
	\begin{hint}
		This is called a ``wedge contour''.
		Try to integrate over a wedge shape
		consisting of a sector of a circle of radius $r$,
		with central angle $\frac{2\pi}{n}$.
		Take the limit as $r \to \infty$ then.
	\end{hint}
	\begin{sol}
		See \url{https://math.stackexchange.com/q/242514/229197},
		which does it with $2019$ replaced by $3$.
	\end{sol}
\end{problem}

\begin{problem}
	[Another contour]
	\twochili
	Prove that the integral
	\[ \int_{-\infty}^{\infty} \frac{\cos x}{x^2+1} \; dx \]
	converges and determine its value.
	\begin{hint}
		It's $\lim_{a \to \infty} \int_{-a}^{a} \frac{\cos x}{x^2+1} \; dx$.
		For each $a$, construct a semicircle.
	\end{hint}
	% semicircle integral
	% \quad \text{ and } \quad
	% \int_{-\infty}^{\infty} \frac{\sin x}{x^2+1} \; dx
\end{problem}

\begin{sproblem}
	\onechili
	Let $f \colon U \to \CC$ be a nonconstant holomorphic function.
	\begin{enumerate}[(a)]
		\ii (Open mapping theorem)
		Prove that $f\im(U)$ is open in $\CC$.\footnote{Thus
			the image of \emph{any}
			open set $V \subseteq U$ is open in $\CC$
			(by repeating the proof for the restriction of $f$ to $V$).}
		\ii (Maximum modulus principle)
		Show that $\left\lvert f \right\rvert$
		cannot have a maximum over $U$.
		That is, show that for any $z \in U$,
		there is some $z' \in U$ such that
		$\left\lvert f(z) \right\rvert < \left\lvert f(z') \right\rvert$.
	\end{enumerate}
	% https://en.wikipedia.org/wiki/Open_mapping_theorem_(complex_analysis)
\end{sproblem}
