### Contour Integration I: Cauchy and Morera's Integral Theorems

We're interested to find out if there exists an integral form of the Cauchy-Riemann equations. On one hand, this sounds absurd -- this is asking if there's an "integral form" of complex differentiability. On the other, the Cauchy-Riemann equations are just partial differential equations.

The standard relationship between differential and integral formulations of things is Stoke's theorem -- the theorem that tells you that adding things on a lot of tiny curves gives you a thing on a big curve. So let's see what a complex integral on a tiny square looks like.
Observe that the integral on AB is (using the midpoint as the partition tag) is $\varepsilon$ times the midpoint of $f(A)f(B)$, while the integral on CD is $-\varepsilon$ times the midpoint of $f(C)f(D)$. The sum of these is $\varepsilon$ times the line connecting these midpoints (the red arrow in the diagram below). Similarly, the sum of the other two parts of the integral is $i$ times the blue arrow in the diagram below.
Because a holomorphic function preserves squares and their orientation, these cancel out, and the integral gives zero. One can then use Green's theorem to show that the integral of a holomorphic (on $D$) function $f$ on the closed curve $\partial D$ is zero. (If you wanted to be completely formal, the equivalent would be to just apply Green's theorem and note that the local integral is zero, which is what the geometry above shows).

$$\oint_\gamma f(z)dz=0$$
Alternatively, one may write, for a simply-connected region $D$: if $f$ is holomorphic on $D$, the integral of $f$ on all closed curves contained in $D$ is zero. This is known as Cauchy's Integral theorem (or the Cauchy-Goursat theorem).

One also immediately sees that the converse holds -- if the function weren't holomorphic, the blue arrow would not be a right-angle rotation of the red one, and you could construct closed curves on which this cancellation doesn't occur. This converse -- if the integral of a continuous function $f$ on all closed curves contained in an open region $D$ are zero, then $f$ is holomorphic -- is called Morera's Integral theorem.

(The "openness" requirement in Morera's theorem is important because we want to ensure the integral is an actual global property -- that it's across some amount of "space".)

Think about how surprising this is for a moment.
• Cauchy's theorem tells us that for a simply-connected region, existence of a derivative implies existence of a primitive
• Morera's theorem tells us that for a continuous function, existence of a primitive implies existence of a derivative.
Morera's theorem does not show that a holomorphic function is infinitely-differentiable. Do you see why?