[proofplan]
We decompose the integrand as $f(z)/(z-a) = f(a)/(z-a) + g(z)$, where $g(z) := (f(z) - f(a))/(z-a)$ has a removable singularity at $z = a$ and extends to a holomorphic function on $\Omega$. The integral of $f(a)/(z-a)$ over $\gamma$ yields $2\pi i \cdot n(\gamma, a) \cdot f(a)$ by the definition of winding number. The integral of $g$ over $\gamma$ vanishes by the homological Cauchy theorem, since $g$ is holomorphic on $\Omega$ and $\gamma$ is null-homologous in $\Omega$. Combining gives the formula.
[/proofplan]
[step:Define $g$ by removing the apparent singularity of the difference quotient at $z = a$]
For fixed $a \in \Omega \setminus \operatorname{im}(\gamma)$, define
\begin{align*}
g: \Omega &\to \mathbb{C} \\
z &\mapsto \begin{cases} \dfrac{f(z) - f(a)}{z - a} & \text{if } z \neq a, \\ f'(a) & \text{if } z = a. \end{cases}
\end{align*}
Since $f$ is holomorphic on $\Omega$, the limit $\lim_{z \to a} (f(z) - f(a))/(z - a) = f'(a)$ exists by definition of the complex derivative. The singularity at $z = a$ is therefore removable, and $g$ is holomorphic on all of $\Omega$ by the [Riemann Removable Singularity Theorem](/theorems/???).
[guided]
The strategy is to split $f(z)/(z-a)$ into two pieces whose integrals we can evaluate separately. Writing
\begin{align*}
\frac{f(z)}{z - a} = \frac{f(a)}{z - a} + \frac{f(z) - f(a)}{z - a} = \frac{f(a)}{z - a} + g(z),
\end{align*}
the first term $f(a)/(z-a)$ is a scalar multiple of the kernel whose integral defines the winding number. The second term $g(z)$ is the remainder we need to show integrates to zero.
For $g$ to be holomorphic on $\Omega$ (which is what will allow us to apply Cauchy's theorem to it), we need the apparent singularity at $z = a$ to be removable. Define
\begin{align*}
g: \Omega &\to \mathbb{C} \\
z &\mapsto \begin{cases} \dfrac{f(z) - f(a)}{z - a} & \text{if } z \neq a, \\ f'(a) & \text{if } z = a. \end{cases}
\end{align*}
Why is $g$ holomorphic on $\Omega$? Away from $a$, it is a quotient of holomorphic functions with non-vanishing denominator. At $z = a$, we verify continuity: $\lim_{z \to a} g(z) = \lim_{z \to a} (f(z) - f(a))/(z-a) = f'(a) = g(a)$, where the limit equals $f'(a)$ by definition of the complex derivative. Since $g$ is continuous on $\Omega$ and holomorphic on $\Omega \setminus \{a\}$, the [Riemann Removable Singularity Theorem](/theorems/???) (whose hypotheses are satisfied: $g$ is bounded near $a$ since it has a finite limit there) gives that $g$ is holomorphic on all of $\Omega$.
[/guided]
[/step]
[step:Apply the homological Cauchy theorem to $g$ to show $\oint_\gamma g(z)\, dz = 0$]
The function $g: \Omega \to \mathbb{C}$ is holomorphic on $\Omega$, and by hypothesis $n(\gamma, z_0) = 0$ for all $z_0 \in \mathbb{C} \setminus \Omega$. These are precisely the hypotheses of [Cauchy's Theorem for Null-Homologous Cycles](/theorems/???), which states: if $\Omega \subset \mathbb{C}$ is open, $\varphi: \Omega \to \mathbb{C}$ is holomorphic, and $\gamma$ is a piecewise $C^1$ cycle in $\Omega$ satisfying $n(\gamma, z_0) = 0$ for all $z_0 \notin \Omega$, then $\oint_\gamma \varphi(z)\, dz = 0$.
We verify the hypotheses for $\varphi := g$:
- $\Omega$ is open (given).
- $g$ is holomorphic on $\Omega$ (established in the previous step).
- $\gamma$ is a piecewise $C^1$ closed curve in $\Omega$ (given) with $n(\gamma, z_0) = 0$ for all $z_0 \in \mathbb{C} \setminus \Omega$ (given).
Therefore $\oint_\gamma g(z)\, dz = 0$.
[guided]
This is where the homological hypothesis on $\gamma$ is consumed. The condition "$n(\gamma, z_0) = 0$ for all $z_0 \notin \Omega$" means that $\gamma$ is null-homologous in $\Omega$ — it does not wind around any point outside $\Omega$. This is the precise condition under which Cauchy's theorem guarantees that the integral of any holomorphic function on $\Omega$ over $\gamma$ vanishes.
We apply [Cauchy's Theorem for Null-Homologous Cycles](/theorems/???). The theorem requires:
1. $\Omega \subset \mathbb{C}$ is open — given in the theorem statement.
2. The integrand is holomorphic on $\Omega$ — we take $\varphi := g$, which is holomorphic on $\Omega$ (the removable singularity at $a$ was filled in the previous step, so $g$ is holomorphic on all of $\Omega$, not merely $\Omega \setminus \{a\}$).
3. $\gamma$ is a piecewise $C^1$ cycle in $\Omega$ — given.
4. $n(\gamma, z_0) = 0$ for all $z_0 \in \mathbb{C} \setminus \Omega$ — given.
All hypotheses are satisfied. The conclusion is $\oint_\gamma g(z)\, dz = 0$.
Why could we not apply the simpler Cauchy theorem for simply connected domains? Because $\Omega$ is not assumed simply connected. The homological version is the correct tool: it works for arbitrary open sets $\Omega$, requiring only the null-homologous condition on $\gamma$.
[/guided]
[/step]
[step:Combine via the winding number definition to obtain the formula]
Decomposing the integrand and integrating term by term over $\gamma$:
\begin{align*}
\frac{1}{2\pi i} \oint_\gamma \frac{f(z)}{z - a}\, dz &= \frac{1}{2\pi i} \oint_\gamma \left( \frac{f(a)}{z - a} + g(z) \right) dz \\
&= f(a) \cdot \frac{1}{2\pi i} \oint_\gamma \frac{dz}{z - a} + \frac{1}{2\pi i} \oint_\gamma g(z)\, dz.
\end{align*}
By the definition of the winding number, $\frac{1}{2\pi i} \oint_\gamma \frac{dz}{z - a} = n(\gamma, a)$. By the previous step, $\oint_\gamma g(z)\, dz = 0$. Therefore:
\begin{align*}
\frac{1}{2\pi i} \oint_\gamma \frac{f(z)}{z - a}\, dz &= n(\gamma, a) \cdot f(a) + 0 = n(\gamma, a) \cdot f(a).
\end{align*}
This is the desired identity.
[guided]
We now assemble the two ingredients. The decomposition $f(z)/(z-a) = f(a)/(z-a) + g(z)$ is valid for all $z \in \operatorname{im}(\gamma)$ since $a \notin \operatorname{im}(\gamma)$ (so $z \neq a$ on the curve, and the formula $g(z) = (f(z) - f(a))/(z-a)$ applies). Integrating:
\begin{align*}
\frac{1}{2\pi i} \oint_\gamma \frac{f(z)}{z - a}\, dz &= \frac{1}{2\pi i} \oint_\gamma \frac{f(a)}{z - a}\, dz + \frac{1}{2\pi i} \oint_\gamma g(z)\, dz.
\end{align*}
The first integral: Since $f(a)$ is a constant (independent of $z$), it factors out of the integral. The remaining integral $\frac{1}{2\pi i} \oint_\gamma \frac{dz}{z-a}$ is exactly the definition of the winding number $n(\gamma, a)$.
The second integral: vanishes by the homological Cauchy theorem applied to $g$, as established in the previous step.
Combining:
\begin{align*}
\frac{1}{2\pi i} \oint_\gamma \frac{f(z)}{z - a}\, dz = n(\gamma, a) \cdot f(a) + 0 = n(\gamma, a) \cdot f(a).
\end{align*}
This completes the proof of the General Cauchy Integral Formula. The argument uses only two facts: the definition of winding number and the homological Cauchy theorem applied to the holomorphic function $g$ obtained by removing the singularity of the difference quotient.
[/guided]
[/step]