# Complex Analysis/Cauchy's theorem and Cauchy's integral formula
## The Goursat–Pringsheim lemma

Cauchy's theorem states that if $f:U\to \mathbb {C}$ is holomorphic on $U$ ($U$ a star-shaped domain; we'll make precise in the next section what that means) and $\gamma$ is a closed contour with values in $U$, then
    $\int _{\gamma }f(z)dz=0$
As a first step of proving the theorem, we will prove it in the special case where $\gamma$ is a triangle; this is the Goursat–Pringsheim lemma. Goursat had the idea first, but Pringsheim then provided the idea to use triangles (instead of squares, as Goursat had done).
Lemma 6.1 (Goursat–Pringsheim):
Let $\Delta \subset U$ be a triangle, where $f:U\to \mathbb {C}$ is holomorphic and the interior of the triangle is contained within $U$. Then we have
    $\int _{\Delta }f(z)dz=0$.
Proof:
Any triangle $\Delta$ may be divided into four small triangles of equal side length as indicated in the picture. Each of the small triangles will have half the side length of the original triangle; this is clear from the formulae one would assign to the smaller triangle if one were to make things (even more) rigorous. We shall denote the four triangles as $\alpha$, $\beta$, $\gamma$ and $\delta$. But one of the four non-negative numbers
    $\left|\int _{\alpha }f(z)dz\right|,\left|\int _{\beta }f(z)dz\right|,\left|\int _{\gamma }f(z)dz\right|,\left|\int _{\delta }f(z)dz\right|$
will have to be the largest. We then set $\Delta _{0}:=\Delta$, $\Delta _{1}$ the first of the four smaller triangles arising from $\Delta _{0}$ such that the absolute value as above is largest, and so on; ie. once $\Delta _{n}$ is defined for general $n\in \mathbb {N} _{0}$, we decompose $\Delta _{n}$ into triangles $\alpha ,\beta ,\gamma ,\delta$ as above and then define $\Delta _{n+1}$ the one of $\alpha ,\beta ,\gamma ,\delta$ where the absolute value of the four ones indicated above is largest.
In this fashion, we obtain a sequence of ever smaller triangles $(\Delta _{n})_{n\in \mathbb {N} _{0}}$. We now have the following lemma:
Lemma 6.2 (Cantor's intersection theorem):
Let $K_{1}\supseteq K_{2}\supseteq K_{3}\supseteq \cdots \supseteq K_{n}\supseteq \cdots$ be a decreasing sequence of compact sets situated in a Hausdorff topological space $(M,d)$. Then
    $\bigcap _{n\in \mathbb {N} }K_{n}\neq \varnothing$
Proof:
In a Hausdorff topological space, compact sets are closed; indeed, let $K$ be such a compact set, and assume that the neighbourhood filter of a certain $x\notin K$ is such that all its elements have nonempty intersection with $K$.
Hence, if we assume that
    $\bigcap _{n\in \mathbb {N} }K_{n}=\varnothing$
we get by deMorgan's rules, taking complements in $K_{1}$,
    $\bigcup _{n\in \mathbb {N} }(K_{1}\setminus K_{n})=K_{1}$
Hence, if we regard $K_{1}$ as a topological space with subspace topology, the sets $(K_{1}\setminus K_{n})_{n\in \mathbb {N} }$ form an open cover of $K_{1}$. By compactness of $K_{1}$, there is a finite subcover $K_{1}\setminus K_{n_{1}},\ldots ,K_{1}\setminus K_{n_{k}}$, where without loss we assume that $n_{1}<n_{2}<\cdots <n_{k}$. Due to monoticity, we then obtain that in fact, $K_{1}=K_{1}\setminus K_{n_{k}}$ and thus $K_{n_{k}}=K_{1}$, which is a contradiction.$\Box$
Thus, we can obtain a point
    $z_{0}\in \bigcap _{n\in \mathbb {N} }{\text{Conv}}(\Delta _{n})$
where ${\text{Conv}}(\Delta _{n})$ shall denote the filled triangle (i.e. the convex hull) of $\Delta _{n}$.
Now by assumption, $f$ was differentiable, in particular at $z_{0}$. Therefore, we may write
    $f(z)=f(z_{0})+f'(z_{0})(z-z_{0})+h(z)$
where $h(z)\to 0$ as $z\to 0$; indeed, we may set
    $h(z)={\frac {f(z)-f(z_{0})}{z-z_{0}}}-f'(z_{0})$
Furthermore, if we take any triangle $\Delta$ in the complex plane and form the curve integral of a polynomial over it, we get zero; indeed, every polynomial $p$ has a primitive $P$ which is formed in the obvious way, according to chapter 2; namely it's exactly the same formula as in the real case, and the differentiation formulae confirm that. We may then decompose the triangle $\Delta$ into three lines; say that $a,b,c\in \mathbb {C}$ are the corners of that triangle, then $\Delta ={\overline {a,b}}+{\overline {b,c}}+{\overline {c,a}}$ ($+$ denoting concatenation, even though we will later, when considering chains, allow for more general curves as arguments on the left and right of $\cdot +\cdot$), and we get
    ${\begin{aligned}\int _{\Delta }p(z)dz&=\int \limits _{\overline {a,b}}p(z)dz+\int \limits _{\overline {b,c}}p(z)dz+\int \limits _{\overline {c,a}}p(z)dz\\&=(P\circ \gamma )(a)-(P\circ \gamma )(b)+(P\circ \gamma )(b)-(P\circ \gamma )(c)+(P\circ \gamma )(c)-(P\circ \gamma )(a)=0\end{aligned}}$
as desired. In particular, we get
    $\int \limits _{\Delta _{n}}f(z)dz=\int \limits _{\Delta _{n}}h(z)dz$
and by the fundamental estimate
    $2^{n}||$
However, this value is actually greater than the absolute value of the original integral, since we will have
    $\int \limits _{\Delta _{n}}f(z)dz=\int \limits _{\alpha _{n}}f(z)dz+\int \limits _{\beta _{n}}f(z)dz+\int \limits _{\gamma _{n}}f(z)dz+\int \limits _{\delta _{n}}f(z)dz$
since the integrals cancel out, as indicated in the picture, and hence by the triangle inequality
    $\left|\int \limits _{\Delta _{n}}f(z)dz\right|\leq 4\left|\int \limits _{\Delta _{n+1}}f(z)dz\right|$;
then use induction to get this "greaterness" for each $n$. But this shows the theorem, since if the absolute value is less or equal than any positive value, it is zero.$\Box$

## Cauchy's theorem on starshaped domains

Now we are ready to prove Cauchy's theorem on starshaped domains. This theorem and Cauchy's integral formula (which follows from it) are the working horses of the theory; from these two we will deduce the local theory of holomorphic functions, and the global theory will then follow as well.
Definition 6.3:
Let $U\subset \mathbb {C}$ be open. $U$ is called star-shaped if and only if there exists a designated point $z_{0}\in U$ such that for all $z\in U$, the line ${\overline {z_{0},z}}$ lies completely in $U$.
Informally, $U$ will "look like a star" with center $z_{0}$.
Regarding these domains, we have the following lemma:
Lemma 6.4:
Let $f:U\to \mathbb {C}$ be holomorphic, where $U$ is star-shaped. Then $f$ will have a primitive in $U$, i.e. a holomorphic function $F:U\to \mathbb {C}$ such that $F'(z)=f(z)$ at every point $z\in U$.
Proof:
We begin by just defining
    $F(z):=\int \limits _{\overline {z_{0},z}}f(z)dz$
this will be well-defined just by the star-shapedness of $U$, i.e. $f$ must be and is defined on all of the path ${\overline {z_{0},z}}$. Our claim now is that $F$ thus defined is indeed a primitive of $f$.
Indeed, pick any fixed $z\in U$. Since $U$ is open, we find a (possibly small) radius $r>0$ such that $B_{r}(z)$ is completely contained in $U$.

## Cauchy's integral formula

Cauchy's integral formula is a formula which looks at first glance a bit strange:
Theorem 6.6:
Let $f:U\to \mathbb {C}$ be holomorphic, and suppose that $z_{0}\in U$ is a point in $U$, and $r>0$ is a radius such that ${\overline {B_{r}(z_{0})}}\subset U$. Then
    For all $z\in B_{r}(z_{0})$, we have $f(z)={\frac {1}{2\pi i}}\!\int \limits _{\partial B_{r}(0)}\!{\frac {f(w)}{w-z}}dw$,
where the closed contour $\partial B_{r}(0)$ is traversed counterclockwise, for instance using the parametrisation
    $\gamma :[0,2\pi ]\to \partial B_{r}(0),\gamma (t)=z_{0}+re^{it}$
Now this formula may seem strange at first, but considering the special case $z=z_{0}$ and inserting the definition of curve integrals, we obtain that a special case of it is actually a mean value formula:
    $f(z_{0})={\frac {1}{2\pi i}}\!\int \limits _{\partial B_{r}(0)}\!{\frac {f(w)}{w-z_{0}}}dw={\frac {1}{2\pi }}\int \limits _{0}^{2\pi }f(z_{0}+re^{it})dt$
In what follows, we shall always assume that the path $\partial B_{r}(z_{0})$ is traversed counterclockwise.
Proof:
We first note that the function
    $\Phi :[0,r]\to \mathbb {C} ,s\mapsto {\frac {1}{2\pi }}\int \limits _{0}^{2\pi }f(z_{0}+se^{it})dt$
is continuous; this follows from dominated convergence by the boundedness of $f$ on compact sets. Then we note that for any $s>0$, the above expression coincides with
    ${\frac {1}{2\pi i}}\!\int \limits _{\partial B_{s}(0)}\!{\frac {f(w)}{w-z_{0}}}dw$
Furthermore, given $r>s,t>0$, we have
    ${\frac {1}{2\pi i}}\!\int \limits _{\partial B_{s}(0)}\!{\frac {f(w)}{w-z_{0}}}dw-{\frac {1}{2\pi i}}\!\int \limits _{\partial B_{t}(0)}\!{\frac {f(w)}{w-z_{0}}}dw={\frac {1}{2\pi i}}\int _{\gamma }{\frac {f(w)}{w-z_{0}}}dw$
where $\gamma$ is the curve
    $\gamma :[0,1]\to \mathbb {C} ,\gamma (x)=(\delta _{1}\cdot \delta _{2})\cdot \delta _{3}={\begin{cases}\delta _{1}(x)\\\delta _{2}(x)\\\delta _{3}(x)\end{cases}}$
where we define
    $\delta _{1}(x):={\begin{cases}se^{{\frac {8}{3}}\pi ix}&x\leq {\frac {1}{4}}\\{\frac {x-{\frac {1}{2}}}{{\frac {1}{4}}-{\frac {1}{2}}}}se^{{\frac {2}{3}}\pi i}+{\frac {x-{\frac {1}{4}}}{{\frac {1}{2}}-{\frac {1}{4}}}}te^{{\frac {2}{3}}\pi i}&{\frac {1}{4}}\leq x\leq {\frac {1}{2}}\\te^{{\frac {2}{3}}\pi i-{\frac {8}{3}}\pi i{\biglx-{\frac {1}{2}}{\bigr )}}&{\frac {1}{2}}\leq x\leq {\frac {3}{4}}\\{\frac {x-1}{{\frac {3}{4}}-1}}\end{cases}},\quad \delta _{2}(s):={\begin{cases}\end{cases}},\quad \delta _{3}(s):={\begin{cases}\end{cases}}$
$\cdot$ denoting concatenation of curves. The curve is depicted in the following picture:
However, one finds star-shaped domains (eg. half-planes) which contain each of the cycles $\delta _{j}$ of which $\gamma$ is composed, whence, in fact
    ${\frac {1}{2\pi i}}\int _{\gamma }{\frac {f(w)}{w-z_{0}}}dw=0$
by Cauchy's theorem on star-shaped domains. Hence, $\Phi$ is constant on $(0,r]$ and by continuity and $\Phi (0)=f(z_{0})$, this constant must be exactly $f(z_{0})$.$\Box$
Remark: Using a similar construction like the curve $\gamma$ above, we in fact obtain the following much more general version of Cauchy's integral formula:
Now note that in our situation, we may differentiate under the integral sign, which gives us formulae for $f^{(n)}(z)$ (the higher derivatives) for $z$ in the respective ball. Indeed, we get
    ${\begin{aligned}f'(z)&={\frac {1}{2\pi i}}\!\int \limits _{\partial B_{r}(0)}\!{\frac {f(w)}{(w-z)^{2}}}dw\\f^{(2)}(z)&={\frac {1}{2}}{\frac {1}{2\pi i}}\!\int \limits _{\partial B_{r}(0)}\!{\frac {f(w)}{(w-z)^{2}}}dw\\f^{(3)}(z)&={\frac {1}{6}}{\frac {1}{2\pi i}}\!\int \limits _{\partial B_{r}(0)}\!{\frac {f(w)}{(w-z)^{3}}}dw\\&\vdots \\f^{(n)}(z)&={\frac {1}{n!}}{\frac {1}{2\pi i}}\!\int \limits _{\partial B_{r}(0)}\!{\frac {f(w)}{(w-z)^{n}}}dw\\&\vdots \end{aligned}}$
Later, we will deduce the very same formulae from the Taylor expansion which we will compute; in fact, all holomorphic functions are equal to their Taylor series, as we will show.