[proofplan]
We reduce the strict separation of a compact set $A$ from a closed set $B$ to the (non-strict) separation of an open set from a convex set, which is handled by the [Hahn-Banach Separation Theorem](/theorems/974). The key geometric step is to show that $\operatorname{dist}(A, B) > 0$ (using compactness of $A$ and closedness of $B$), and then to thicken $A$ by an open ball of radius $\delta > 0$ — chosen small enough so that the $\delta$-neighbourhood $A_\delta := A + B(0, \delta)$ remains disjoint from $B$. The [Hahn-Banach Separation Theorem](/theorems/974) applied to the open convex set $A_\delta$ and the closed convex set $B$ yields a separating functional, and the gap created by thickening produces the strict separation $\alpha_1 < \alpha_2$.
[/proofplan]
[step:Show that $\operatorname{dist}(A, B) > 0$ using compactness and closedness]
We claim that $\delta_0 := \inf\{\|a - b\|_X : a \in A, \, b \in B\} > 0$.
Suppose for contradiction that $\delta_0 = 0$. Then for each $n \in \mathbb{N}$, there exist $a_n \in A$ and $b_n \in B$ with $\|a_n - b_n\|_X < 1/n$. Since $A$ is compact, the sequence $(a_n)_{n=1}^\infty$ has a subsequence $(a_{n_k})_{k=1}^\infty$ converging to some $a^* \in A$. Then
\begin{align*}
\|b_{n_k} - a^*\|_X \le \|b_{n_k} - a_{n_k}\|_X + \|a_{n_k} - a^*\|_X < \frac{1}{n_k} + \|a_{n_k} - a^*\|_X \to 0 \quad \text{as } k \to \infty.
\end{align*}
Hence $b_{n_k} \to a^*$ in $X$. Since $B$ is closed, $a^* \in B$. But $a^* \in A$ as well, contradicting $A \cap B = \varnothing$. Therefore $\delta_0 > 0$.
[guided]
The strict separation requires a quantitative gap between $A$ and $B$. For two arbitrary disjoint sets, no such gap need exist — consider $A = \{(x, 0) : x > 0\}$ and $B = \{(x, 1/x) : x > 0\}$ in $\mathbb{R}^2$, which are disjoint with $\operatorname{dist}(A, B) = 0$. The hypotheses "compact" and "closed" together prevent this pathology.
Suppose $\delta_0 := \inf\{\|a - b\|_X : a \in A, \, b \in B\} = 0$. Then we can find sequences $a_n \in A$ and $b_n \in B$ with $\|a_n - b_n\|_X < 1/n$. Compactness of $A$ (here we use sequential compactness, which is equivalent to compactness in [metric spaces](/page/Metric%20Space) by the [Equivalent Characterisations of Compactness](/theorems/316)) gives a convergent subsequence $a_{n_k} \to a^* \in A$.
The triangle inequality then forces $b_{n_k} \to a^*$:
\begin{align*}
\|b_{n_k} - a^*\|_X \le \|b_{n_k} - a_{n_k}\|_X + \|a_{n_k} - a^*\|_X < \frac{1}{n_k} + \|a_{n_k} - a^*\|_X \to 0.
\end{align*}
Since $B$ is closed and $b_{n_k} \to a^*$, we get $a^* \in B$. But $a^* \in A$, so $a^* \in A \cap B$, contradicting disjointness. Hence $\delta_0 > 0$.
Note that compactness of at least one of the sets is essential. If both $A$ and $B$ are merely closed and convex, strict separation can fail: in $\ell^2(\mathbb{N})$, the sets $A = \{e_n : n \in \mathbb{N}\}$ (the standard basis vectors, which form a closed set) and $B = \{(1 + 1/n)e_n : n \in \mathbb{N}\}$ (also closed) satisfy $\operatorname{dist}(A, B) = 0$, since $\|e_n - (1 + 1/n)e_n\| = 1/n \to 0$. Neither set is compact (no subsequence of $(e_n)$ converges, since $\|e_m - e_n\| = \sqrt{2}$ for $m \neq n$).
[/guided]
[/step]
[step:Thicken $A$ to an open convex set $A_\delta$ that is still disjoint from $B$]
Fix $\delta := \delta_0 / 2 > 0$, where $\delta_0 = \operatorname{dist}(A, B)$. Define the $\delta$-thickening of $A$:
\begin{align*}
A_\delta := A + B(0, \delta) = \{a + v : a \in A, \, v \in X, \, \|v\|_X < \delta\} = \bigcup_{a \in A} B(a, \delta).
\end{align*}
**Openness.** $A_\delta = \bigcup_{a \in A} B(a, \delta)$ is a union of [open sets](/page/Open%20Set), hence open.
**Convexity.** Let $x_1 = a_1 + v_1$ and $x_2 = a_2 + v_2$ be elements of $A_\delta$, with $a_1, a_2 \in A$ and $\|v_1\|_X, \|v_2\|_X < \delta$. For $t \in (0, 1)$,
\begin{align*}
tx_1 + (1-t)x_2 = \bigl(ta_1 + (1-t)a_2\bigr) + \bigl(tv_1 + (1-t)v_2\bigr).
\end{align*}
The first term lies in $A$ by convexity of $A$. The second term satisfies $\|tv_1 + (1-t)v_2\|_X \le t\|v_1\|_X + (1-t)\|v_2\|_X < t\delta + (1-t)\delta = \delta$, so it lies in $B(0, \delta)$. Hence $tx_1 + (1-t)x_2 \in A_\delta$.
**Disjointness from $B$.** For any $x \in A_\delta$, write $x = a + v$ with $a \in A$ and $\|v\|_X < \delta$. For any $b \in B$,
\begin{align*}
\|x - b\|_X = \|a + v - b\|_X \ge \|a - b\|_X - \|v\|_X \ge \delta_0 - \delta = \delta_0 - \frac{\delta_0}{2} = \frac{\delta_0}{2} > 0.
\end{align*}
Hence $x \neq b$, so $A_\delta \cap B = \varnothing$.
[guided]
The strategy is to create a gap between $A$ and $B$ by inflating $A$ slightly. We thicken $A$ by adding an open ball of radius $\delta = \delta_0 / 2$ (half the distance between $A$ and $B$) to each point of $A$. The Minkowski sum $A_\delta = A + B(0, \delta)$ is a strictly larger set that is open, convex, and still disjoint from $B$ — but now it is open, which is exactly the hypothesis required by the [Hahn-Banach Separation Theorem](/theorems/974).
We verify the three properties:
**Openness.** Writing $A_\delta = \bigcup_{a \in A} B(a, \delta)$, this is a union of open balls, hence open. (Each $B(a, \delta)$ is open by the definition of the metric topology.)
**Convexity.** Take $x_1 = a_1 + v_1, x_2 = a_2 + v_2 \in A_\delta$ and $t \in (0,1)$. The convex combination $tx_1 + (1-t)x_2$ decomposes as $(ta_1 + (1-t)a_2) + (tv_1 + (1-t)v_2)$. The first part lies in $A$ (convexity of $A$). The second part has norm at most $t\|v_1\|_X + (1-t)\|v_2\|_X < \delta$ (the triangle inequality and convexity of the real-valued function $r \mapsto r$), so it lies in $B(0, \delta)$.
**Disjointness.** We chose $\delta = \delta_0 / 2$ precisely to maintain a buffer. Any point $x = a + v \in A_\delta$ satisfies $\|x - b\|_X \ge \|a - b\|_X - \|v\|_X > \delta_0 - \delta = \delta_0/2 > 0$ for all $b \in B$, using the reverse triangle inequality and the definition of $\delta_0$.
[/guided]
[/step]
[step:Apply the Hahn-Banach Separation Theorem to $A_\delta$ and $B$]
The set $A_\delta$ is nonempty (since $A$ is nonempty), open, and convex. The set $B$ is nonempty and convex. Moreover, $A_\delta \cap B = \varnothing$. By the [Hahn-Banach Separation Theorem](/theorems/974), there exist $f \in X^*$ and $\alpha \in \mathbb{R}$ such that
\begin{align*}
f(x) < \alpha \le f(b) \quad \text{for all } x \in A_\delta, \; b \in B.
\end{align*}
[guided]
We now apply the [Hahn-Banach Separation Theorem](/theorems/974) (theorem 974). That theorem requires two nonempty disjoint convex sets, one of which is open. We verify the hypotheses:
- $A_\delta$ is nonempty: $A \neq \varnothing$ by hypothesis, and $A \subset A_\delta$ (for any $a \in A$, we write $a = a + 0$ where $\|0\|_X = 0 < \delta$, so $a \in A_\delta$). Hence $A_\delta \neq \varnothing$.
- $A_\delta$ is open: verified in the previous step.
- $A_\delta$ is convex: verified in the previous step.
- $B$ is nonempty and convex: given by hypothesis.
- $A_\delta \cap B = \varnothing$: verified in the previous step.
The [Hahn-Banach Separation Theorem](/theorems/974) produces $f \in X^*$ and $\alpha \in \mathbb{R}$ with $f(x) < \alpha \le f(b)$ for all $x \in A_\delta$ and $b \in B$.
[/guided]
[/step]
[step:Extract the strict separation constants $\alpha_1 < \alpha_2$]
Since $A \subset A_\delta$ (every $a \in A$ can be written as $a + 0$ with $\|0\|_X = 0 < \delta$), the inequality $f(x) < \alpha$ for all $x \in A_\delta$ implies in particular
\begin{align*}
f(a) < \alpha \quad \text{for all } a \in A.
\end{align*}
Since $A$ is compact and $f \in X^*$ is continuous, the function $f|_A: A \to \mathbb{R}$ attains its supremum on $A$. Define
\begin{align*}
\alpha_1 := \max_{a \in A} f(a) = \sup_{a \in A} f(a).
\end{align*}
Since $f(a) < \alpha$ for all $a \in A$, we have $\alpha_1 < \alpha$. The separation from the previous step gives $\alpha \le f(b)$ for all $b \in B$. Setting $\alpha_2 := \alpha$, we obtain
\begin{align*}
f(a) \le \alpha_1 < \alpha_2 \le f(b) \quad \text{for all } a \in A, \; b \in B.
\end{align*}
This completes the proof.
[guided]
We must upgrade the separation $f(a) < \alpha \le f(b)$ (which has a non-strict inequality $\le$ between $\sup_A f$ and $\alpha$) to a strict gap $\alpha_1 < \alpha_2$.
**Restriction to $A$.** Since $A \subset A_\delta$, we have $f(a) < \alpha$ for every $a \in A$.
**Attainment of the supremum.** The functional $f \in X^*$ is continuous. The set $A$ is compact. By the extreme value theorem (a continuous real-valued function on a compact set attains its maximum), the supremum $\alpha_1 := \sup_{a \in A} f(a)$ is attained — that is, there exists $a^* \in A$ with $f(a^*) = \alpha_1$. In particular, $f(a) \le \alpha_1$ for all $a \in A$ (by definition of supremum), and $\alpha_1 = f(a^*) < \alpha$ (since $a^* \in A \subset A_\delta$ and $f(x) < \alpha$ for all $x \in A_\delta$).
This is the second place where compactness of $A$ is consumed. Without compactness, the supremum $\sup_{a \in A} f(a)$ need not be attained and could equal $\alpha$, collapsing the gap. For instance, if $A = \{x \in X : f(x) < \alpha\}$ (an open half-space, not compact), then $\sup_A f = \alpha$ and no strict separation is possible.
**Assembling the result.** Set $\alpha_2 := \alpha$. Then:
- $f(a) \le \alpha_1$ for all $a \in A$ (definition of $\alpha_1 = \max_A f$),
- $\alpha_1 < \alpha_2$ (since $\alpha_1 < \alpha = \alpha_2$),
- $\alpha_2 \le f(b)$ for all $b \in B$ (from the Hahn-Banach Separation Theorem).
Hence $f(a) \le \alpha_1 < \alpha_2 \le f(b)$ for all $a \in A$ and $b \in B$.
[/guided]
[/step]