[proofplan]
We show that a holomorphic function on a simply connected domain possesses a holomorphic antiderivative, from which the vanishing of every closed contour integral follows immediately. The antiderivative is constructed by integrating $f$ along piecewise-linear paths from a fixed basepoint; simple connectivity guarantees that the construction is path-independent. We verify path-independence by reducing to the case of a triangle, where Goursat's Theorem gives the result directly.
[/proofplan]
[step:Fix a basepoint and define a candidate antiderivative by integration along paths]
Fix a point $z_1 \in \Omega$. Since $\Omega$ is open and connected (a simply connected open set in $\mathbb{C}$ is connected), for each $z \in \Omega$ there exists a piecewise $C^1$ path in $\Omega$ from $z_1$ to $z$. Define
\begin{align*}
F: \Omega &\to \mathbb{C} \\
z &\mapsto \int_{\alpha_z} f(w)\, dw,
\end{align*}
where $\alpha_z$ is any piecewise $C^1$ path in $\Omega$ from $z_1$ to $z$.
[guided]
We want to construct a function $F$ whose derivative is $f$. A natural candidate is the "indefinite integral" of $f$: pick a basepoint $z_1 \in \Omega$, and for each $z \in \Omega$, integrate $f$ along some path from $z_1$ to $z$. But for $F$ to be well-defined, the integral must be independent of the choice of path. That is the content of the next step.
Fix $z_1 \in \Omega$. Since $\Omega$ is simply connected, it is in particular connected, so for every $z \in \Omega$ there exists a piecewise $C^1$ path $\alpha_z$ in $\Omega$ from $z_1$ to $z$. We define
\begin{align*}
F: \Omega &\to \mathbb{C} \\
z &\mapsto \int_{\alpha_z} f(w)\, dw.
\end{align*}
This definition is provisional until we verify path-independence.
[/guided]
[/step]
[step:Verify path-independence using simple connectivity and Goursat's Theorem]
We must show that $F$ is well-defined, i.e., that $\int_{\alpha} f(w)\, dw = \int_{\beta} f(w)\, dw$ for any two piecewise $C^1$ paths $\alpha, \beta$ in $\Omega$ from $z_1$ to $z$. Equivalently, we must show that $\oint_\sigma f(w)\, dw = 0$ for every closed piecewise $C^1$ loop $\sigma$ in $\Omega$ (take $\sigma = \alpha * \beta^{-}$, where $\beta^{-}$ denotes $\beta$ traversed in reverse).
Since $\Omega$ is simply connected, every closed loop $\sigma$ in $\Omega$ is null-homotopic. By a standard triangulation argument, a null-homotopic piecewise $C^1$ loop can be decomposed into a finite union of triangular contours $T_1, \dots, T_N$, each contained in $\Omega$, such that
\begin{align*}
\oint_\sigma f(w)\, dw = \sum_{k=1}^{N} \oint_{\partial T_k} f(w)\, dw.
\end{align*}
By [Goursat's Theorem](/theorems/???), $\oint_{\partial T_k} f(w)\, dw = 0$ for each $k$, since $f$ is holomorphic on $\Omega$ and each triangle $T_k$ with its interior lies in $\Omega$. Therefore $\oint_\sigma f(w)\, dw = 0$, and $F$ is well-defined.
[guided]
Why does simple connectivity matter? If $\Omega$ had a hole, a loop winding around the hole could not be continuously deformed to a point, and the integral around it might be nonzero (as happens with $f(z) = 1/z$ on $\mathbb{C} \setminus \{0\}$). Simple connectivity ensures every closed loop is null-homotopic, meaning it can be contracted to a point within $\Omega$.
To pass from "null-homotopic" to "integral vanishes," we use a triangulation argument: any null-homotopic piecewise $C^1$ loop $\sigma$ in $\Omega$ can be written as a sum of boundary cycles of triangles $T_1, \dots, T_N$ lying entirely in $\Omega$. Adjacent triangles share edges traversed in opposite directions, so interior edges cancel, leaving
\begin{align*}
\oint_\sigma f(w)\, dw = \sum_{k=1}^{N} \oint_{\partial T_k} f(w)\, dw.
\end{align*}
Now [Goursat's Theorem](/theorems/???) applies to each triangle: it states that if $f$ is holomorphic on an open set containing a triangle and its interior, then $\oint_{\partial T_k} f(w)\, dw = 0$. Each $T_k$ lies in $\Omega$ by construction, so every summand vanishes, giving $\oint_\sigma f(w)\, dw = 0$.
Since any two paths $\alpha, \beta$ from $z_1$ to $z$ form a closed loop $\sigma = \alpha * \beta^{-}$, we conclude $\int_\alpha f(w)\, dw = \int_\beta f(w)\, dw$, and $F$ is well-defined.
[/guided]
[/step]
[step:Show that $F$ is holomorphic with $F' = f$]
We show $F$ is complex-differentiable at every $z \in \Omega$ with $F'(z) = f(z)$. Fix $z \in \Omega$ and choose $\delta > 0$ such that $B(z, \delta) \subset \Omega$. For $h \in \mathbb{C}$ with $0 < |h| < \delta$, choose the path from $z_1$ to $z + h$ that first follows $\alpha_z$ from $z_1$ to $z$, then follows the straight-line segment $[z, z + h]$. Then
\begin{align*}
F(z + h) - F(z) = \int_{[z, z+h]} f(w)\, dw.
\end{align*}
Since $f$ is continuous at $z$, for every $\varepsilon > 0$ there exists $\delta' > 0$ (with $\delta' \le \delta$) such that $|f(w) - f(z)| < \varepsilon$ whenever $|w - z| < \delta'$. For $|h| < \delta'$, every point $w$ on the segment $[z, z+h]$ satisfies $|w - z| \le |h| < \delta'$, so
\begin{align*}
\left| \frac{F(z+h) - F(z)}{h} - f(z) \right| &= \left| \frac{1}{h} \int_{[z, z+h]} \bigl(f(w) - f(z)\bigr)\, dw \right| \\
&\le \frac{1}{|h|} \cdot |h| \cdot \sup_{w \in [z, z+h]} |f(w) - f(z)| \\
&< \varepsilon.
\end{align*}
Since $\varepsilon > 0$ was arbitrary, $F'(z) = f(z)$.
[guided]
We want to show $F'(z) = f(z)$. The idea is that $F(z+h) - F(z)$ equals the integral of $f$ along a short segment from $z$ to $z+h$, and on this short segment $f(w) \approx f(z)$ by continuity.
Fix $z \in \Omega$. Since $\Omega$ is open, choose $\delta > 0$ with $B(z, \delta) \subset \Omega$. For $0 < |h| < \delta$, the segment $[z, z+h]$ lies in $B(z, \delta) \subset \Omega$. By path-independence (established above), we may compute $F(z+h)$ by first integrating along $\alpha_z$ from $z_1$ to $z$, then along $[z, z+h]$:
\begin{align*}
F(z + h) - F(z) = \int_{[z, z+h]} f(w)\, dw.
\end{align*}
Now we estimate the difference quotient. Since $\int_{[z, z+h]} f(z)\, dw = f(z) \cdot h$ (the integral of a constant along a segment of length $|h|$ in direction $h/|h|$), we can write
\begin{align*}
\frac{F(z+h) - F(z)}{h} - f(z) = \frac{1}{h} \int_{[z, z+h]} \bigl(f(w) - f(z)\bigr)\, dw.
\end{align*}
The standard contour integral estimate gives $\left| \int_{[z,z+h]} g(w)\, dw \right| \le \text{length}([z,z+h]) \cdot \sup_{w \in [z,z+h]} |g(w)| = |h| \cdot \sup |g|$. So
\begin{align*}
\left| \frac{F(z+h) - F(z)}{h} - f(z) \right| \le \sup_{w \in [z, z+h]} |f(w) - f(z)|.
\end{align*}
Since $f$ is continuous at $z$, the right-hand side tends to $0$ as $h \to 0$. Therefore $F'(z) = f(z)$, and $F \in \mathcal{O}(\Omega)$.
[/guided]
[/step]
[step:Conclude that $\oint_\gamma f(z)\, dz = 0$ for every closed curve via the antiderivative]
Let $\gamma: [a, b] \to \Omega$ be any closed piecewise $C^1$ curve in $\Omega$, so $\gamma(a) = \gamma(b)$. Since $F$ is a holomorphic antiderivative of $f$ on $\Omega$ (i.e., $F' = f$), the fundamental theorem of contour integration gives
\begin{align*}
\oint_\gamma f(z)\, dz = \int_a^b f(\gamma(t))\, \gamma'(t)\, d\mathcal{L}^1(t) = F(\gamma(b)) - F(\gamma(a)) = 0,
\end{align*}
since $\gamma(a) = \gamma(b)$. This completes the proof.
[/step]