[step:Construct local Hartogs figures near each boundary point of $K$ and extend $f$ locally]Fix a point $p \in \partial K$ (the topological boundary of $K$ in $\Omega$). Since $K$ is compact and $\Omega$ is open, there exists a polydisc $\mathbb{D}^n(p, \rho) \subset \Omega$ centred at $p$. Because $p$ is a boundary point of $K$, every neighbourhood of $p$ meets $\Omega \setminus K$. Since $n \geq 2$, we may construct a Hartogs figure $H(\varepsilon) \subset \mathbb{D}^n(p, \rho)$ for sufficiently small $\varepsilon > 0$: specifically, define
\begin{align*}
H(\varepsilon) := \{z \in \mathbb{D}^n(p, \rho) : |z_1 - p_1| > \rho - \varepsilon\} \cup \{z \in \mathbb{D}^n(p, \rho) : |(z_2 - p_2, \dots, z_n - p_n)| < \varepsilon\}.
\end{align*}
By choosing $\varepsilon$ small enough, we arrange that $H(\varepsilon) \subset \Omega \setminus K$ in a neighbourhood of $p$ (since $K$ has empty interior locally after shrinking, and the shell part of the Hartogs figure avoids $K$ near $p$). The restriction $f|_{H(\varepsilon)}$ is holomorphic, and by the [Hartogs Extension Theorem](/theorems/3401) applied to $\mathbb{D}^n(p, \rho)$, there exists a unique $F_p \in \mathcal{O}(\mathbb{D}^n(p, \rho))$ extending $f|_{H(\varepsilon)}$.
More precisely: since $K$ is compact and $p \in \partial K$, after a possible linear change of coordinates and shrinking $\rho$, the compact set $K \cap \overline{\mathbb{D}^n(p, \rho)}$ is contained in a proper compact subset of the polydisc. The function $f$ is holomorphic on $\mathbb{D}^n(p, \rho) \setminus K$, and the complement of $K$ in $\mathbb{D}^n(p, \rho)$ contains a Hartogs figure whose envelope is the full polydisc. By the [Hartogs Extension Theorem](/theorems/3401), $f$ extends to all of $\mathbb{D}^n(p, \rho)$.[/step]