Existence of complex branch for real exponents I've recently encountered a problem regarding complex branches that made me feel like there is something fundamental about branches I do not understand:
The problem
Let $G$ be an open subset of $\mathbb{C}$ and $z_1,z_2,...z_m \in \mathbb C \setminus G$ be distinct points such that there are real numbers $a_1,a_2,...a_m$ satisfying:
$$\sum_{j=1}^ma_jInd_\gamma(z_j)=0$$
for every closed path $\gamma \subset G$.
Show that there is a holomorphic branch of $(z-z_1)^{a_1}(z-z_2)^{a_2}...(z-z_m)^{a_m}$ in $G$.
My confusion
The basic idea behind the statement of the problem seems intuitively obvious to me, but I've had great difficulty expressing a solution rigurously, which makes me believe there's something fundamental I'm missing here.
My approach was to try and utilize a theorem that states $logf$ has a holomorphic branch in $G$ if and only if $$\int_\gamma \frac{f'}{f}dz=0$$
for every closed path $\gamma \subset G$.
However, the only sensible way I can think of to define $f$ is by $f=\exp[\sum_{j=1}^{m}a_jlog(z-z_j)]$
Obviously if the exponent is holomorphic, so is $f$, but how can it be shown that it is indeed holomorphic? Induction does not work because the separate $log(z-z_j)$ may not exist on their own, even though their weighted sum does.
It is also quite simple to show that $f$ as defined in the problem satisfies the conditions of the theorem, and hence the sum of logarithms in the above exponent is indeed holomorphic.. but that presumes that $f$ exists (and is holomorphic) in the first place.
Can $f$ be defined in some other way that makes this all fall into place?
 A: I think it should be possible to prove an even stronger statement than the one stated in the question. Suppose that, instead of assuming that $\sum_j a_j {\rm \ Ind}_{\gamma} (z_j) = 0$ for all closed loops $\gamma \subset G$, we merely assume that 
$$ \sum_j a_j {\rm \ Ind}_{\gamma} (z_j) \in \mathbb Z$$
for all closed loops $\gamma \subset G$. With this weaker assumption, I think it should still be possible to prove that $ \prod_{j = 1}^m (z - z_j)^{a_j}$ has a holomorphic branch in $G$.

Before we start addressing this question, we shall prove some useful lemmas.
Lemma 1: Suppose $f$ is a holomorphic function on an open set $U$ such that $\oint_\gamma f(z')dz' = 0$ for all closed contours $\gamma \subset U$. Then the function
$$F(z) = \int_{\gamma_{c \to z}} f(z') dz'$$
is well-defined and holomorphic in $U$, with derivative $F'(z) = f(z)$. (Here, $c$ is an arbitrary fixed point in $U$, and for every $z\in U$, $\gamma_{c \to z }$ denotes any path from $c$ to $z$ in $U$; the "well-defined" part of the statement is that the value of the integral in this definition does not depend on the choice of path $\gamma_{c \to z}$, as long as this path is contained within $U$.)
Proof: The well-definedness follows immediately from the fact that the difference between two paths $c \to z$ is a closed contour, on which the integral wanishes.
For holomorphicity, pick any $w \in U$, and pick any open ball $U_w \subset U$ of $w$. On this open ball, we can write
$$ F(z) = \int_{[w \to z]} f(z') dz' + F(w)$$
where $[w \to z]$ denotes the straight line segment from $w$ to $z$. Hence, for any $z \in U_w \setminus \{ w \}$,
$$  \frac{F(z) - F(w)}{z - w} - f(w) = \frac{1}{z - w} \int_{[w \to z]} \left( f(z') - f(w) \right) dz' $$
which tends to zero as $z$ tends to $w$, by the continuity of $f(z')$ at $w$.
Lemma 1a: Suppose $f$ is a holomorphic function on an open set $U$, such that $\oint_\gamma f(z') dz' \in 2\pi i \mathbb Z$ for all closed contours $\gamma \subset U$. Then the function
$$ g(z) = \exp\left( \int_{\gamma_{c \to z} }f(z') dz' \right)$$
is well-defined and holomorphic in $U$. (Again, for every $z \in U$, $\gamma_{c \to z}$ denotes any path from $c$ to $z$ that is contained within $U$.)
Proof: The well-definedness follows from the fact that if $\gamma_{c \to z}$ and $\gamma'_{c \to z}$ are two paths from $c$ to $z$, contained within $U$, then
$$ \exp \left( \oint_{\gamma'_{c \to z}} f(z') dz' \right) = \exp \left( \oint_{\gamma_{c \to z}} f(z') dz' + 2\pi i n\right) = \exp \left( \oint_{\gamma_{c \to z}} f(z') dz' \right). $$
To prove holomorphicity, pick any $w \in U$, and pick an open ball $U_w \subset U$ of $w$. Fix any path $\gamma_{c \to w}$, and consider the function $F : U_w \to \mathbb C$ defined by
$$ F(z) = \int_{\gamma_{w \to z}} f(z') dz' + k_c,$$
where $k_c = \int_{\gamma_{c \to w}} f(z') dz'$ with $\gamma_{c \to w}$ being our chosen fixed path, and where $\gamma_{w \to z}$ denotes any path from $w$ to $z$ within $U_w$. $F(z)$ is well-defined and holomorphic on the open ball $U_w$ by virtue of Lemma 1, since for any closed loop $\gamma \subset U_w$, we have $\oint_\gamma f(z') dz' = 0$ because the open ball $U_w$ is simply-connected.
Since $g(z) = \exp(F(z))$ on $U_w$, it follows that $g(z)$ is also holomorphic on $U_w$. As our choice of $w$ was arbitrary, this proves that $g(z)$ is holomorphic everywhere in $U$.
Lemma 2: For any $z_0 \in \mathbb C$, and for any path $\gamma_{a \to b} \subset \mathbb C \setminus \{ z_0 \}$ from $a$ to $b$, we have
$$ \exp\left(\int _{\gamma_{a \to b}} \frac{1}{z' - z_0} dz'\right) = \frac{b - z_0}{a - z_0}.$$
[Really, this lemma is saying that $\int _{\gamma_{a \to b}} \frac{1}{z' - z_0} dz' = \log(b - z_0) - \log(a - z_0)$.  But I have deliberately avoided writing it this way so that we don't have to worry about ambiguities in defining logarithms.] 
Proof:
We first prove this statement for the special case where $\gamma_{a \to b}$ is contained inside some simply-connected subset $U$ of $\mathbb C \setminus \{ z_0 \}$. In this special case, Lemma 1 tells us that the function
$$ F(z) = \int_{\gamma_{a \to z}} \frac{1}{z' - z_0} dz'$$
is well-defined on $U$ (i.e. the integral in this definition does not depend on the choice of the path $\gamma_{a \to z}$ from $a$ to $z$, as long as this path $\gamma_{a \to z}$ is contained within our simply-connected open neighbourhood $U$). Lemma 1 also tells us that $$F'(z) = \frac{1}{z - z_0}.$$ By the product rule for differentiation, we have
$$ \frac{d}{dz} \left( \frac{\exp(F(z))}{z - z_0}\right) = 0$$
on $U$. Therefore, $ \exp(F(z))$ is a constant multiple of $z - z_0$. We can identify the value of the constant as $1/(a - z_0)$ from the fact that $\exp(F(a)) = 1$. Thus
$$ \exp(F(z)) = \frac{z - z_0}{a - z_0}$$
for all $z \in U$, and the result follows by taking $z = b$.
For the general case, we cover $\mathbb C \setminus \{ z_0 \}$ with the two simply-connected open sets $$U = \mathbb C \setminus [z_0 -\infty, z_0], \ \  \ \ \ V = \mathbb C \setminus [z_0, z_0 + \infty],$$ where $[z_0 - \infty, z_0]$ (resp. $[z_0, z_0 + \infty]$) denote the left-pointing (resp. right-pointing) straight horizontal half-lines originating at $z_0$.
Any path $\gamma_{a \to b} \subset \mathbb C \setminus \{ z_0 \} $, can be broken down into finitely many segments,
$$ \gamma_{a \to c_1}, \ \gamma_{c_1 \to c_2}, \ \dots, \ \gamma_{c_{n-1} \to b},$$
where each segment $\gamma_{c_{i} \to c_{i+1}}$ is either wholly contained in $U$ or is wholly contained in $V$. (The fact that we can find finitely many such segments is a consequence of  $\gamma_{a \to b}$ being compact.)
By the special case, we have
$$ \exp \left( \int_{\gamma_{c_i \to c_{i+1}}} \frac{1}{z' - z_0}dz'\right) = \frac{c_{i+1} - z_0}{c_i - z_0},$$
for each segment $\gamma_{c_i \to c_{i+1}}$, and hence
$$  \exp \left( \int_{\gamma_{a, b}} \frac{1}{z' - z_0}dz'\right) = \frac{c_1 - z_0}{a - z_0}. \frac{c_2 - z_0}{c_1 - z_0}. \dots .\frac{b - z_0}{c_{n-1} - z_0} = \frac{b - z_0}{a - z_0} $$

Proof of main result: By definition,
$$ \prod_{j=1}^m (z - z_j)^{a_j} = \exp \left( \sum_{j=1}^m a_j \log (z - z_j)  \right). $$
So to prove that $\prod_{j=1}^m (z - z_j)^{a_j}$ has a holomorphic branch on our open set $G \subset \mathbb C \setminus \{ z_1, \dots, z_n \}$, we must prove that there exists a 
holomorphic function $g(z)$, defined on the whole of $G$, such that for any $w \in G$, there exists an open neighbourhood $U_w \subset  G$ and holomorphic functions $u_{w, j}(z)$ defined on $U_w$ (for $j \in \{ 1, \dots m \}$) such that 
$$ g(z) = \exp \left( \sum_{j=1}^m a_j u_{w, j}(z) \right) $$
for all $z \in U_w$, and such that
$$ \exp(u_{w,j}(z)) = z - z_j$$
for all $z \in U_w$ and for all $j \in \{1, \dots m \}$.
[Effectively, the function $u_{w,j}(z)$ is a local representative of $\log(z - z_j)$ in the neighbourhood $U_w$ of $w$.]
To construct such a $g(z)$, we observe that for any closed contour $\gamma \subset G$, we have
$$ \oint_\gamma  \sum_{j=1}^m \frac{a_j}{z' - z_j} dz' = 2\pi i\sum_{j=1}^m a_j {\rm \ Ind}_{\gamma}(z_j) \in 2\pi i \mathbb N.$$
This observation enables us to define the function $g : G \to \mathbb C$ using the expression,
$$ g(z) = \exp \left( \int_{\gamma_{c \to z}} \sum_{j=1}^m \frac{a_j}{z' - z_j} dz' + \sum_{j = 1}^m a_j  k_{c,j} \right).$$
Here, $c$ is some arbitrary fixed point in $G$, and for each $j$, $k_{c,j}$ is a constant such that $$\exp(k_{c, j}) = c - z_j.$$ Meanwhile, $\gamma_{c \to z}$ denotes any path in $G$ from $c $ to $z$. By Lemma 1a, the integral in this definition only depends on the choice of $\gamma_{c \to z}$ up to additive shifts of $2\pi i$, ensuring that $g(z)$ is well-defined in $G$. Lemma 1a also tells us that the function $g(z)$ defined in this way is holomorphic in $G$.
Now pick any $w \in G$, and pick a path $\gamma_{c\to w} \subset G$ from $c$ to $w$. Let $U_w$ be an open ball around $w$. Because $U_w$ is simply-connected, we have $$\oint_\gamma \frac{1}{z' - z_j} dz'= 0$$ for all $j$ and for all closed contours $\gamma \in U_w$. So it makes sense to define functions $u_{w, j} : U_w \to \mathbb C$ using the expression,
$$ u_{w, j} (z) = \int_{\gamma_{w \to z}} \frac{1}{z' - z_j} dz' + k_{w, j}.$$ 
Here, the constants $k_{w, j}$ are defined by the formula
$$ k_{w, j} = k_{c, j} + \int_{\gamma_{c \to w}} \frac{1}{z' - z_j} dz', $$
where $\gamma_{c \to w}$ is the path in $G$ from $c$ to $w$ that we have fixed.  Meanwhile, in the definition of $u_{w,j}(z)$,  $\gamma_{w \to z}$ denotes any path in $U_w$ from $w$ to $z$; Lemma 1 ensures that the integral in the definition does not depend on the precise choice of path, and that the function $u_{w, j}(z)$ defined in this way is holomorphic in $U_w$.
It is clear from the definitions that
$$ g(z) = \exp \left( \sum_{j = 1}^m a_j u_{w, j}(z) \right)$$
for all $z \in U_w$. Applying  Lemma 2 to the definition of $k_{w, j}$ gives $$\exp(k_{w, j}) = w - z_j$$ for each $j$, and by applying Lemma 2 once more, this time to the definition of $u_{w,j}(z)$, we learn that
$$ \exp(u_{w, j}(z)) = z - z_j$$
for all $z \in U_w$ and for all $j$. So $g(z)$ and the $u_{w, j}(z)$'s obey all the desired properties on $U_w$. Since the choice of $w$ was arbitrary, the proof is complete.
