The necessary and sufficient conditions for a complex function to have primitive function In many textbooks on complex analysis, there is a theorem about when a complex function have a primitive function.
In fact, for a continuous function
$$f\colon D\to\mathbb C,\qquad D\subset\mathbb C\,\,\text{a domain},$$
the following three statements are equivalent:
(a) $f$ has a primitive.
(b) The integral of $f$ over any closed curve in $D$ vanishes.
(c) The integral of $f$ over any curve in $D$ depends only on the beginning
and end points of the curve.
Here the curves mean piecewise smooth curves or more generally, rectifiable curves.
My question: changing the condition any closed curve (in the second item) to any simple closed curve, whether the conclusion still holds?
Imitating the proof on the Freitag'book maybe we can prove that if the integral along any closed polygon curve $\gamma$ (not simple polygon curve, the edges can intersect) is zero:
$$\int_\gamma f(z)dz=0,$$
then $f(z)$ has a primitive in $D$.
Another question: Is it true that a closed polygon curve(may not simple curve) divides plane into finite parts.
If we can prove that a closed polygon curve(may not simple curve) divides a plane into finite parts, then we can deduce that if the integral of $f$ over any simple polygon curves in $D$ vanishes, then $f$ has a primitive.
 A: Let us begin with some preparations.

*

*An abstract line segment in $D$ is any pair $[z,z']$ of distinct points $z,z' \in D$ such that the geometric line segment $L(z,z') = \{ z + t(z'-z) \mid t \in [0,1]\}$ is contained in $D$. For each $w \in L(z,z')$ there exists a unique $t(w) \in [0,1]$ such that $w = z + t(w)(z'-z)$. We write $w \le w'$ and $w < w'$ if $t(w) \le t(w')$ and $t(w) < t(w')$, respectively.
Each linear parameterization $\delta$ of $[z,z']$ (i.e. each curve $\delta : [a,b] \to D$ given by $\delta(t) = z + \frac{t-a}{b-a} (z'-z)$) produces an integral $\int_\delta f(z)dz)$. Obviously we have $\int_\delta f(z)dz) = \int_{\bar \delta} f(z)dz)$ for any two such linear parameterizations $\delta, \bar \delta$. This common value will be denoted by $\int_{[z,z']} f(z)dz$.


*An abstract polygon curve in $D$ is a tupel $\zeta = [z_0,\ldots,z_n]$ of points in $D$ such that all $[z_{i-1},z_i]$, $i=1,\ldots, n$, are abstract line segments in $D$. We write $l(\zeta) = n$ and define $L_i = L(z_{i-1},z_i)$, $i = 1,\ldots,n$. Moreover we define $\int_\zeta f(z)dz = \sum_{i=1}^n  \int_{[z_{i-1},z_i]} f(z)dz$.
Next we define $\zeta = [z_0,\ldots,z_n] \triangleleft \eta = [w_0,\ldots,w_{n+1}]$ if $\eta$ is obtained from $\zeta$ by inserting after some position $i < n$ any point $z \in L_{i+1} \setminus \{z_i, z_{i+1}\}$. Thus $\eta = [z_0,\ldots,z_i,z,z_{i+1},\ldots, z_n]$. The relation $\triangleleft$ generates an equivalence relation $\equiv$ on the set of abstract polygon curves in $D$. Each equivalence class contains a representive $\zeta$ with minimal $l(\zeta)$. It is easy to see that this $\zeta$ is uniquely determined, but we shall not need this fact. Clearly, if $\zeta \equiv \zeta'$, then $\int_\zeta f(z)dz = \int_{\zeta'} f(z)dz$.
$\zeta$ is called closed if $z_n = z_0$.  In this case let us consider the intersections $L_{(i,j)} = L_i \cap L_j$ with $1 \le i < j \le n$. A non-empty intersection is either a small intersection, which means that $L_{(i,j)}$ contains only one point, or a big intersection, which means that $L_{(i,j)}$ contains more than one point in which case $L_{(i,j)}$ is a geometric line segment. The intersections $\Lambda_i = L_{(i,i+1)}$ with $i = 1,\ldots,n-1$ and $\Lambda_n = L_{(1,n)}$ are non-empty since $z_i \in \Lambda_i$. As the trivial intersections of $\zeta$ we denote the $\Lambda_i$ which are small intersections.
A closed $\zeta$ is called simple if each non-empty intersection is a trivial intersection.


*A polygon curve in $D$ is any curve $\gamma : [a, b] \to D$ for which there exists  partition $a = t_0 < t_1 < \ldots < t_n = b$ such that $\gamma \mid_{[t_{i-1},t_i]}$ is a linear parameterization of $[z_{i-1},z_i]$, where $z_j = \gamma(t_j)$.  Clearly $\int_\gamma f(z)dz = \int_{[z_0,\ldots,z_n]} f(z)dz$. The tuple $[z_0,\ldots,z_n]$ is an abstract polygon curve in $D$; it is called a polygonization of $\gamma$. There are infinitely many such polygonizations, but any two polygonizations are equivalent in the above sense.
We know that if the integral of $f$ along any closed polygon curve $\gamma$ in $D$ is zero, then $f(z)$ has a primitive in $D$.
Now assume that we only know that the integral of $f$ along any simple closed polygon curve $\gamma$ in $D$ is zero. By the above considerations this is equivalent to $\int_{[z_0,\ldots,z_n]} f(z)dz = 0$ for each simple closed abstract polygon curve $[z_0,\ldots,z_n]$ in $D$.
We want to show that $\int_\gamma f(z)dz = 0$ for each closed polygon curve $\gamma : [a, b] \to D$. This is equivalent to showing that $\int_{[z_0,\ldots,z_n]} f(z)dz = 0$ for each closed abstract polygon curve $[z_0,\ldots,z_n]$ in $D$.
It suffices to consider closed abstract polygon curves of the following special type:

*

*If $L_{(i,j)}$ is a small intersection, then the unique intersection point $z \in L_{(i,j)}$ is one of the points $z_{i-1}, z_i$ and one of the points $z_{j-1}, z_j$.


*If $L_{(i,j)}$ is a big intersection, then $L_{(i,j)} = L_i = L_j$.
In fact, each closed abstract polygon curve $\zeta$ is equivalent to such a special one which can be constructed as follows:
For each small intersection $L_{(i,j)}$ insert $z$ between $z_{i-1}$ and $z_i$ if $z \ne z_{i-1}, z_i$ and between $z_{j-1}$ and $z_j$ if $z \ne z_{j-1}, z_j$.
For each big intersection $L_{(i,j)}$ is a geometric line segment $L(z,z')$. Since $L_{(i,j)} \subset L_i$, we may assume w.lo.g. that $z_{i-1} \le z  < z' \le z_i$. If $z_{i-1} < z$, insert $z$ after $z_{i-1}$, and if $z' < z_i$, insert $z'$ before $z_{i}$. This leads to the insertion at most two points between $z_{i-1}$ and $z_i$. Similarly, using $L_{(i,j)} \subset L_j$, we insert at most two points between $z_{j-1}$ and $z_j$.
It remains to prove that $\int_\zeta f(z)dz = 0$ for each special closed abstract polygon curve $\zeta$ in $D$. This will be done by induction on $l(\zeta)$.
Note that $l(\zeta) = 1$ is impossible because a single line segment cannot give a closed curve.
Thus the base case is $n = 2$. Then $\int_{[z_1,z_2]} f(z)dz = \int_{[z_1,z_0]} f(z)dz = - \int_{[z_0,z_1]} f(z)dz$, thus $\int_{[z_0,z_1,z_2]} f(z)dz = 0$.
Assume that $\int_{[z_0,\ldots,z_m]} f(z)dz = 0$ for all special closed abstract polygon curves with $m < n$.
Consider a special closed abstract polygon curve $\zeta = [z_0,\ldots,z_n]$ in $D$.
If $\zeta$ is simple closed, we are done. So let us consider a special closed abstract polygon curve which is not simple. In that case there exists an index pair $(i,j)$ such that $2 \le j - i \le n-1$ and $z_i = z_j$. Let $\zeta'$ denote the special closed abstract polygonal curve obtained from $\zeta$ by removing the entries at positions $i +1,\ldots, j$ and $\zeta'' = [z_i,\ldots,z_j$ which is also a special closed abstract polygonal curve. Clearly  $\int_\zeta f(z)dz = \int_{\zeta'} f(z)dz + \int_{\zeta'} f(z)dz $. Both summmands are zero because  $l(\zeta'), l(\zeta'') < n$.
