[proofplan]
We subtract the principal parts of the Laurent series at each singularity $z_j$ to obtain a function $g$ holomorphic on all of $U$. Cauchy's theorem on the simply connected domain $U$ kills $\int_\gamma g \, dz$. For each principal part, the terms $(z - z_j)^n$ with $n \leq -2$ have antiderivatives on $\mathbb{C} \setminus \{z_j\}$ and integrate to zero over closed paths. The surviving $c_{-1}^{(j)}/(z - z_j)$ terms are evaluated via the [Winding Number Integral Formula](/theorems/351).
[/proofplan]
[step:Subtract principal parts to isolate a holomorphic function on $U$]
For each $j = 1, \ldots, k$, let
\begin{align*}
f(z) = \sum_{n=-N_j}^{\infty} c_n^{(j)} (z - z_j)^n
\end{align*}
be the [Laurent series expansion](/theorems/350) of $f$ near $z_j$. Define the principal part at $z_j$:
\begin{align*}
P_j(z) = \sum_{n=-N_j}^{-1} c_n^{(j)} (z - z_j)^n.
\end{align*}
Each $P_j$ is holomorphic on $\mathbb{C} \setminus \{z_j\}$. The function $g = f - \sum_{j=1}^k P_j$ is holomorphic on $U \setminus \{z_1, \ldots, z_k\}$, and at each $z_j$ the Laurent expansion of $g$ has no negative-power terms (the principal part has been subtracted), so $z_j$ is a removable singularity. Therefore $g$ extends to a holomorphic function on $U$.
[/step]
[step:Apply Cauchy's theorem to $g$ on the simply connected domain $U$]
Since $U$ is simply connected and $g$ is holomorphic on $U$, [Cauchy's theorem for simply connected domains](/theorems/344) gives
\begin{align*}
\int_\gamma g(z) \, dz = 0.
\end{align*}
Therefore
\begin{align*}
\int_\gamma f(z) \, dz = \sum_{j=1}^k \int_\gamma P_j(z) \, dz.
\end{align*}
[/step]
[step:Evaluate each principal part integral using the winding number formula]
For each $j$, consider $\int_\gamma P_j(z) \, dz$. The terms $(z - z_j)^n$ with $n \leq -2$ have antiderivatives on $\mathbb{C} \setminus \{z_j\}$: namely $(z - z_j)^{n+1}/(n+1)$, which is holomorphic on $\mathbb{C} \setminus \{z_j\}$. Since $\gamma$ is a closed path in $\mathbb{C} \setminus \{z_j\}$, these integrals vanish by the Fundamental Theorem of Contour Integration. The only surviving term is $n = -1$:
\begin{align*}
\int_\gamma P_j(z) \, dz = c_{-1}^{(j)} \int_\gamma \frac{dz}{z - z_j}.
\end{align*}
By the [Winding Number Integral Formula](/theorems/351), $\int_\gamma \frac{dz}{z - z_j} = 2\pi i \, I(\gamma, z_j)$. Since $c_{-1}^{(j)} = \operatorname{Res}(f, z_j)$:
\begin{align*}
\int_\gamma P_j(z) \, dz = 2\pi i \, I(\gamma, z_j) \, \operatorname{Res}(f, z_j).
\end{align*}
[guided]
Why do the terms $(z - z_j)^n$ with $n \leq -2$ integrate to zero? The function $(z - z_j)^{n+1}/(n+1)$ is well-defined and holomorphic on $\mathbb{C} \setminus \{z_j\}$ for $n \leq -2$ (since $n + 1 \leq -1 \neq 0$).
The Fundamental Theorem of Contour Integration states that if $F$ is an antiderivative of $h$ on a domain, then $\int_\gamma h \, dz = F(\gamma(b)) - F(\gamma(a)) = 0$ for any closed path $\gamma$.
The term $n = -1$ is different:
$1/(z - z_j)$ does not have an antiderivative on $\mathbb{C} \setminus \{z_j\}$ (its "antiderivative" $\log(z - z_j)$ is multi-valued).
This is precisely what the winding number captures: the integral $\int_\gamma \frac{dz}{z - z_j} = 2\pi i \, I(\gamma, z_j)$ measures the multi-valuedness of $\log(z - z_j)$ along $\gamma$.
[/guided]
[/step]
[step:Sum over all singularities to obtain the residue formula]
Summing over $j = 1, \ldots, k$:
\begin{align*}
\int_\gamma f(z) \, dz = \sum_{j=1}^k 2\pi i \, I(\gamma, z_j) \, \operatorname{Res}(f, z_j),
\end{align*}
and dividing by $2\pi i$:
\begin{align*}
\frac{1}{2\pi i} \int_\gamma f(z) \, dz = \sum_{j=1}^k I(\gamma, z_j) \, \operatorname{Res}(f, z_j).
\end{align*}
[/step]