cauchy theorem over cycles homologous to zero Definitions:
$i)$ A cycle $\gamma$ is a finite sequence of continuous oriented closed paths in the complex plane. We denote $\gamma = (\gamma_1,...\gamma_n)$ where $\gamma_k$ are the closed paths of the cycle. We define $
\int\limits_\gamma  {f\left( z \right)dz = \sum\limits_{k = 1}^n {\int\limits_{\gamma _k } {f\left( z \right)dz} } } 
$.
$ii)$ The index of a point $c$ with respect to the cycle $\gamma=(\gamma_1,...\gamma_n)$ , is $I(\gamma,c) = I(\gamma_1,c)+...+I(\gamma_n,c)$. 
$iii)$ A cycle with range contained in a domain (open and connected) $U\subset \mathbb{C}$ is said to be homologous to zero with respect to U , if $I(\gamma,c)=0$ for every $c \in \mathbb{C}-U$.
Well sorry for all these definitions. But I have a question with Cauchy theorem , but involving cycles.
The classical version is this:
Cauchy theorem: If f is holomorphic on an open set D ( then $f(z)dz$ is a closed form by morera theorem) and $\gamma$ is a continuous closed path in D , that is homotopic to a point in D , then $ \int _{\gamma} f(z)dz=0 $
My question: 
$i)$ Cauchy theorem 2. If if is an analytic in a domain $U\subset \mathbb{C}$ , then: $
\int\limits_\gamma  {f\left( z \right)dz = 0} 
$ for every cycle $\gamma$ that is homologous to zero in U.
Well.. I don't know how to prove this, is likely to be very simple, but I don't know how to prove it here, because in the last case I could define an homotopy, and concluding the result, but here I can't :S
 A: Here is Artin's proof:
First we need to prove a lemma.

Lemma: Let $\gamma$ be a path in an open set $U$. There there exists a rectangular path $\eta$ with the same end points, and such that $\gamma,\eta$ are close together in $U$. In particular, $\gamma$ and $\eta$ are homologous in $U$, and for any holomorphic function $f$ on $U$ we have 
  $$
\int_{\gamma}f=\int_{\eta}f.
$$
  Definition: We say that $\gamma,\eta$ are close together if there exists a partition
  $$
a = a_0\leq a_1\leq\cdots\leq a_n=b,
$$
  and for each $i=0,\ldots, n-1$ there exists a disc $D_i$ contained in $U$ such that the images of each segment $[a_i,a_{i+1}]$ under the two paths are contained in $D_i$.

Proof of Lemma:
Suppose $\gamma$ is defined on the interval $[a,b]$. Partition the interval as $a = a_0\leq a_1\leq\cdots\leq a_n=b$ such that the image $\gamma[a_i,a_{i+1}]$ is contained in a disc $D_i$ on which $f$ has a primitive (see image).

Thus $\gamma,\eta$ are homologous since they can be deformed into each other so $\int_{\gamma}f=\int_{\eta}f$.
The lemma reduces the proof of Cauchy's theorem to $\gamma$ a rectangular closed chain. Let $\gamma_i:[a_i,a_{i+1}]\to U$ be the restriction of $\gamma$ to the smaller interval. Then the chain is $\gamma_1+\cdots+\gamma_n$ a subdivision of $\gamma$. If $\eta_i$ is obtained from $\gamma_i$ by another parametrization, we have the chain $\eta_1+\cdots+\eta_n$ which is a subdivision of $\gamma$. The chains $\gamma$ and $\eta$ do not differ from each other. If $\gamma = \sum m_i\gamma_i$ is a chain and $\{\eta_{ij}\}$ is a subdivision, we call
$$
\sum_i\sum_jm_in_{ij}
$$
a subdivision of $\gamma$. Next we need to prove the following theorem.

Theorem: Let $\gamma$ be a rectangular closed chain in $U$, and assume that $\gamma$ is homologous to $0$ in $U$; that is, $W(\gamma,\alpha)=0$ for every point $\alpha$ not in $U$. Then there exist rectangles $R_1,\ldots,R_n$ contained in $U$, such that if $\partial R_i$ is the boundary of $R_i$ oriented counterclockwise, then a subdivision of $\gamma$ is equal to 
  $$
\sum_i^nm_i\partial R_i
$$
  for some integers $m_i$. Note $W(\gamma,\alpha)=0$ is the winding number.

Proof of Theorem:
Given the rectangle chain $\gamma$, we draw all vertical and horizontal lines passing through the sides of the chain. The lines decompose the plane into rectangles, and rectangular regions extending to infinity in the vertical and horizontal directions. Let $R_i$ be one of the rectangles, and let $\alpha_i$ be a point inside $R_i$. Let $W(\gamma,\alpha_i)=m_i$. For some rectangles we have $m_i=0$, and for some, we have $m_i\neq 0$. Let $R_i,\ldots, R_N$ be the rectangles whose $m_i\neq 0$. Let $\partial R_i$ be the boundaries of these rectangles for $i=1,\ldots,N$ oriented counterclockwise.


*

*Every rectangle $R_i$ such that $m_i\neq 0$ is contained in $U$.

*Some subdivision of $\gamma$ is equal to $\sum_i^Nm\partial R_i$.


Assertion $1$. By assumption, $\alpha_i$ must be in $U$, becuase $W(\gamma,\alpha)=0$ for all $\alpha$ outside of $U$. The winding number is constant on connected sets so it is constant on the interior of $\partial R_i\subset U$ and not equal to zero. If the boundary points of $R_i$ are on $\gamma$, then it is in $U$. If not on $\gamma$, then the winding number is defined and equal to $m_i\neq 0$. Thus $R_i\subset U$.
Assertion $2$. Replace $\gamma$ by an appropriate subdivision. We can find a subdivision $\eta$ such that every curve occurring in $\eta$ is some side of a rectangle or the finite side of an infinite rectangular region. The subdivision $\eta$ is the sum of the sides taken with appropriate multiplicity. If a finite side of an infinite rectangle occurs in the subdivision, after inserting one more horizontal or vertical line, we may assume that this side is also the side of a finite rectangle. WLOG, we may assume that every side of the subdivision is also of one of the finite rectangles in the gird formed by horizontal and vertical lines.
Suppose $\eta-\sum m_i\partial R_i$ is not the $0$ chain. Then it contains some horizontal or vertical segment $\sigma$, so that we can write
$$
\eta-\sum m_i\partial R_i = m\sigma + C,
$$
where $m$ is an integer, and $C$ is a chain of vertical or horizontal segments other than $\sigma$. Then $\sigma$ is the side of a finite rectangle $R_k$. We take $\sigma$ with the orientation arising from the counterclockwise orientation of the boundary of the rectangle $R_k$. Then the closed chain
$$
C=\eta-\sum m_i\partial R_i-m\partial R_k
$$
does not contain $\sigma$. Let $\alpha_k$ be a point interior to $R_k$, and let $\alpha'$ be a point near $\sigma$ but on the opposite side from $\alpha_k$.

Since $\eta-\sum m_i\partial R_i-m\partial R_k$ does not contain $\sigma$, the points $\alpha_k$ and $\alpha'$ are connected by a line segment which does not intersect $C$. Therefore, $W(C,\alpha_k)=W(C,\alpha')$. But $W(\eta,\alpha_n)=m_k$ and $W(\partial R_i,\alpha_k)=0$ unless $i=k$ in which case $W(\partial R_k,\alpha_k)=1$. Similarly, if $\alpha'$ is inside some finite rectangle $R_j$ so $\alpha'=\alpha_j$, we have
$$
W(\partial R_k,\alpha_j)=\begin{cases}
0, & \text{if }j\neq k\\
1, & \text{if }j=k
\end{cases}
$$
If $\alpha'$ is in an infinite rectangle, then $W(\partial R_k,\alpha')=0$. Hence
\begin{alignat}{2}
W(C,\alpha_k)&=W\Bigl(\eta-\sum m_i\partial R_i-m\partial R_k,\alpha_k\Bigr) &&= m_k-m_k-m &&= -m\\
W(C,\alpha')&=W\Bigl(\eta-\sum m_i\partial R_i-m\partial R_k,\alpha'\Bigr)&&=0
\end{alignat}
Thus, $m=0$ and $\eta-\sum m_i\partial  R_i=0$. Suppose $C\neq 0$. Then 
$$
C=m\sigma+C^*
$$
where $\sigma$ is a horizontal or vertical segment, $m$ is an integer not equal to zero, and $C^*$ is a chain of vertical or horizontal segments other than $\sigma$. Then $\sigma$ is the side of a finite rectangle. We take $\sigma$ with the counterclockwise orientation of the boundary rectangle $R$. the the chain $C-m\partial R$ does not contain $\sigma$. let $\alpha$ be a point inside of $R$, and let $\alpha'$ be a point near $\sigma$ but on the opposite side from $\alpha$. Then we can join $\alpha$ to $alpha'$ by a segment which does not intersect $C-m\partial R$. By continuity and connectedness of the segment, we have
$$
W(C-m\partial R,\alpha)=W(C-m\partial R,\alpha')
$$
but $W(m\partial R,\alpha)=m$ and $W(m\partial R, \alpha')=0$. Thus $W(C,\alpha)=W(C,\alpha')=0$ so $m=0$.
By the lemma and theorem, we know that for any holomorphic function $f$ on $U$, we have 
$$
\int_{\partial R_i}f =0
$$
by Goursat's theorem. Hence, the integral of $f$ over $\gamma$ is also equal to $0$.
