Flaw in Goursat's lemma for the Cauchy integral theorem? There is a lemma due to Goursat (Sur La Definition Generale Des Fonctions Analytiques, D'Apres Cauchy, 1900) which has been used in various proofs of the Cauchy-Goursat theorem for complex integrals, over the last 120 years. It appears in some textbooks and is stated like this in Brown and Churchill's Complex Variables and Applications:

Let $f$ be analytic throughout a closed region $R$ consisting of
the points interior to a positively oriented simple closed contour $C$
together with the points on $C$ itself. For any positive number $ε$, the
region $R$ can be covered with a finite number of squares and partial
squares, indexed by $j = 1,2,...,n$, such that in each one there is a
fixed point $z_j$ for which the inequality
$$\tag{1} |\frac{f(z) − f(z_j)}{z − z_j} − f'(z_j)| < ε$$
is satisfied by all points other than $z_j$ in that square or partial square.

The Cauchy-Goursat integral theorem can be derived by other means, but this lemma was taught in my complex analysis class, and I've had trouble accepting it. I've come across a few remarks hinting at a flaw, but I can't find an exposition. So here is my shot at it.
The proof begins as follows:

To start the proof, we consider the possibility that in the covering
constructed just prior to the statement of the lemma, there is some
square or partial square in which no point $z_j$ exists such that
inequality (1) holds for all other points $z$ in it. If that subregion
is a square, we construct four smaller squares by drawing line
segments joining the midpoints of its opposite sides. If the
subregion is a partial square, we treat the whole square in the same
manner and then let the portions that lie outside of $R$ be discarded.
If in any one of these smaller subregions, no point $z_j$ exists such
that inequality (1) holds for all other points $z$ in it, we construct
still smaller squares and partial squares, etc. When this is done to
each of the original subregions that requires it, we find that after a
finite number of steps, the region $R$ can be covered with a finite
number of squares and partial squares such that the lemma is true.
To verify this, we suppose that the needed points $z_j$ do not exist after
subdividing one of the original subregions a finite number of times
and reach a contradiction. We let $σ_0$ denote that subregion if it is a
square; if it is a partial square, we let $σ_0$ denote the entire square
of which it is a part. After we subdivide $σ_0$, at least one of the four
smaller squares, denoted by $σ_1$, must contain points of $R$ but no
appropriate point $z_j$. We then subdivide $σ_1$ and continue in this
manner. It may be that after a square $σ_{k−1} (k=1,2,...)$ has been
subdivided, more than one of the four smaller squares constructed from
it can be chosen. To make a specific choice, we take $σ_k$ to be the one
lowest and then furthest to the left.

After this, the proof finds a point $z_0$ common to the nested sequence of squares, and uses the derivative at $z_0$ to establish a $\delta>0$ where $|\frac{f(z) − f(z_0)}{z − z_0} − f'(z_0)| < ε$ inside the $\delta$-ball around $z_0$. Here the proof ends on the contradiction that eventually the $σ_k$ are small enough to fall wholly inside the $\delta$-ball, resulting in a square with the needed property (1).
I don't see how this results in a necessarily finite number of squares. The problem lies at the end of the quotation:

It may be that after a square $σ_{k−1} (k=1,2,...)$ has been
subdivided, more than one of the four smaller squares constructed from
it can be chosen. To make a specific choice, we take $σ_k$ to be the one
lowest and then furthest to the left.

If the algorithm has to choose between 2 or more squares, the point $z_0$ common to the $σ_k$ is, of course, not contained in any square that wasn't chosen. Wouldn't it be necessary to repeat the algorithm starting from that square? And since descending into that square could again produce a choice between 2 or more squares, how can the algorithm be guaranteed to complete after a finite number of steps?
It seems to me this algorithm needs a global minimum $\delta$ to guarantee an end, which you don't get if the derivative is not continuous.
So to wrap up:

*

*Is the proof wrong or not?

*If the proof is wrong, is the lemma still true?

*In that case what's the correct proof?

*Otherwise how can we construct a function for which the lemma fails?

Thanks in advance.
 A: I happened to be teaching exactly this section of Brown and Churchill a couple of weeks ago, and I came up with precisely the same objection you did.
That is, I think the B&C argument successfully proves that around each point we can achieve the desired inequality after a sufficient number of subdivisions, but I don't see how to conclude from their argument that there is a uniform bound on the number of rectangle divisions.
Here's is the fix I devised.  Let's begin with a decomposition of $R$ into squares a partial squares.   To save on typing, let us agree that "square" allows the possibility of a "partial square".  I will also refer to "$\left|\frac{f(z) - f(z_j)}{z-z_j} - f'(z_j)\right|<\epsilon$ for all $z$ in some square" as "the desired property".
Assume for a contradiction that the lemma is false.  Then there must be a square for which no $z_j$ exists with the desired property.  Let $w_1$ denote any element of any "bad" square.
Subdivide every square once, whether the square is good or bad.  Because the lemma is false, there must be a subdivided square for which no $z_j$ exists with the desired property.  Let $w_2$ denote any element of any such subdivided square.
In general, we continue to subdivide every square.  After $n$ iterations of subdivision, Because we are assuming the lemma is false, there is always some subsubsub...subdivided square for which no $z_j$ has the desired property.  We pick an arbitrary $w_n$ in any such subsubsub...subdividied square.
We have thus created a sequence $w_1,w_2,...$ for which each $w_i$ lives in a "bad" subsub...subdivided square after $i$ subdivisions.
Here is the key:  $R$ is compact, so the sequence of $w_i$ must have a convergent subsequence.  I'll abuse notation and write $w_i$ for this convergent subsequence, so $\lim_{i\rightarrow \infty} w_i = w\in R$.
Now, what the Brown and Churchill proof establishes is that some sub...divided square which contains $w$ has an element $z_0$ with the desired property.  For definiteness, say it takes $k$-subdivisions.  Thus, we get some $k$-fold subsquare $S$ such that $w,z_0\in S$, and $\left| \frac{f(z) - f(z_0)}{z-z_0} - f'(z_0)\right|<\epsilon$ for all $z\in S$.  But the interior of $S$ is an open set containing $w$, so it must contain infinitely many of the $w_i$, so it contains $w_i$ of arbitrarily large index.  Let $i > k$ denote an index for which $w_i\in int(S)$.  Then the definition of $w_i$ forces it to not live in a $k$-fold subdivided square having a $z_j$ with the desired property, yet it lives in $S$ with $z_0$ having the desired property.
This contradiction shows the lemma must be true.
A: There is nothing wrong with this beautiful proof (Churchill's book still is by far the best introduction to Complex analysis ever written). Churchill is very specific about what he means by a 'bad' 'square':  "contains points of $R$ but no appropriate poits $z_j$ after any finite number of subdivisions". If there were no such 'bad' 'square', the lemma would be valid, so if you suppose it's not valid, there should be at least one 'bad' 'square'. This 'bad' 'square' should have a 'bad' sub'square' by definition and so on...
