Recall the global Cauchy theorem/formula:
Let $U$ be open and $\Gamma\subset U$ a cycle. If $\Gamma$ is homologous to zero in $U$, then for all $f:U\to\Bbb C$ holomorphic and $w\in U\setminus\Gamma$ holds $$n(\Gamma,w)f(w)=\frac1{2\pi i}\int_\Gamma\frac{f(z)}{z-w}\mathrm dz.$$
Note that "cycle" means two things in the book I'm following (Falko Lorenz's "Funktionentheorie"): initially, it was defined as a chain (finite formal $\Bbb Z$-sum) of closed integration paths (and that's how it's usually defined in formulations of the global Cauchy theorem), then the definition was expanded to mean a closed chain of integration paths, i.e. one with trivial boundary. It's not hard to see that any closed chain $\Gamma$ can be rejigged into a chain of closed paths $\Gamma'$ such that $\int_\Gamma f=\int_{\Gamma'}f$ for all $f$ (e.g. if $\Gamma=\gamma+\overline\gamma$, where $\overline\gamma$ is the reverse path, then we might take $\Gamma'=\gamma*\overline\gamma$), so it doesn't really matter which definition is used.
I am trying to understand the proof of the following proposition
Theorem: Let $U$ be open and $K\subset U$ compact and non-empty. There exists a cycle $\Gamma\subset U\setminus K$ such that for all $f:U\to\Bbb C$ hoolomorphic and $w\in K$ holds $$f(w)=\frac1{2\pi i}\int_\Gamma\frac{f(z)}{z-w}\mathrm dz,$$ i.e. there is a cycle in $U\setminus K$ such that the Cauchy formula holds for it on $K$.
This is a weaker version of the statement that we can always find a cycle $\Gamma\subset U\setminus K$ that is homologous to zero in $U$ and winds around $K$ once (a proof can be found e.g. here, on page 160).
The proof of the above theorem runs roughly as follows
Pave the plane with $\varepsilon(\Bbb Z+i\Bbb Z)$ and let $Q_1,\dots,Q_n$ be the finitely many squares of the lattice intersecting $K$; by making $\varepsilon$ small enough we can ensure that $Q_i$ are all contained in $U$. Let $$\delta_i=\gamma_{i1}+\gamma_{i2}+\gamma_{i3}+\gamma_{i4}$$ be the positively oriented boundary of $Q_i$, let $\Lambda=\sum_i\delta_i$, and let $\Gamma$ be the sum of those sides $\gamma_j$ that belong to only one $Q_i$, then $\Gamma$ is a cycle in $U\setminus K$ and $\int_\Gamma f=\int_\Lambda f$ for all $f\in H(U)$. We then show that the formula holds for $z\in K$ not lying on $\Lambda$ and extend it to all of $K$ by continuity, since both sides of the identity are analytic.
I am trying to understand the highlighted part, namely why $\Gamma$ is a cycle (in either sense of the word) and why it must be contained in $U\setminus K$ (if a side of $Q_i$ does not belong to any other square, why should it not intersect $K$?). Both statements make intuitive sense to me, however I can't prove them formally.
If there are alternative proofs/expositions of this theorem or its aforementioned stronger version, I'd be interested in seeing them.
Addendum: I have since found out that this result appears in most books that prove Runge's theorem (a notable example being Rudin's "Real & Complex Analysis", Theorem 13.5), with pretty much exactly the same proof.
Addendum: To the people saying the summary of the proof I posted must be wrong, I'm posting the proof from Rudin's RCA, which is exactly the same.