[step:Record the two compactness and separation facts needed for the construction]We first record two elementary facts. Throughout the proof, $\mathbb K$ denotes the scalar field of $X$, so $\mathbb K$ is either $\mathbb R$ or $\mathbb C$, and $\mathbb N=\{1,2,3,\dots\}$.
[claim:Finite-dimensional subspaces of normed spaces are closed]
Let $(X,\|\cdot\|_X)$ be a [normed vector space](/page/Normed%20Vector%20Space) and let $M\subset X$ be finite-dimensional. Then $M$ is closed in $X$.
[/claim]
[proof]
We prove the claim by induction on $d:=\dim M$.
If $d=0$, then $M=\{0\}$, and $\{0\}$ is closed because the norm map $x\mapsto \|x\|_X$ is continuous and $\{0\}=\{x\in X:\|x\|_X=0\}$.
Assume the result holds for all subspaces of dimension at most $d-1$, and let $\dim M=d\ge 1$. Choose a subspace $N\subset M$ with $\dim N=d-1$ and choose $e\in M\setminus N$. By the induction hypothesis, $N$ is closed in $X$. Since $e\notin N$, define
\begin{align*}
\delta:=\operatorname{dist}(e,N):=\inf_{z\in N}\|e-z\|_X.
\end{align*}
Because $N$ is closed and $e\notin N$, we have $\delta>0$.
Let $(y_k)_{k=1}^{\infty}$ be a sequence in $M$ converging in $X$ to some $y\in X$. For each $k\in\mathbb N$, write uniquely
\begin{align*}
y_k=z_k+a_k e
\end{align*}
with $z_k\in N$ and $a_k\in\mathbb R$ in the real case, or $a_k\in\mathbb C$ in the complex case. For $k,l\in\mathbb N$, the vector $z_k-z_l$ lies in $N$, so by the definition of $\delta$,
\begin{align*}
\|y_k-y_l\|_X=\|(z_k-z_l)+(a_k-a_l)e\|_X\ge |a_k-a_l|\delta.
\end{align*}
Since $(y_k)_{k=1}^{\infty}$ converges, it is Cauchy in $X$, and therefore $(a_k)_{k=1}^{\infty}$ is a [Cauchy sequence](/page/Cauchy%20Sequence) in the scalar field. Let $a$ denote its scalar limit. Then
\begin{align*}
z_k=y_k-a_k e\to y-ae
\end{align*}
in $X$. Since $N$ is closed, $y-ae\in N$. Hence $y=(y-ae)+ae\in M$. Thus every sequence in $M$ that converges in the metric induced by $\|\cdot\|_X$ has its limit in $M$. Because normed vector spaces are metric spaces, the sequential characterization of closed subsets in metric spaces gives that $M$ is closed.
[/proof]
[claim:Riesz separation lemma for a closed proper subspace]
Let $(X,\|\cdot\|_X)$ be a normed [vector space](/page/Vector%20Space), let $M\subsetneq X$ be a closed linear subspace, and let $\alpha\in(0,1)$. Then there exists $u\in X$ such that $\|u\|_X=1$ and
\begin{align*}
\operatorname{dist}(u,M):=\inf_{m\in M}\|u-m\|_X>\alpha.
\end{align*}
[/claim]
[proof]
Choose $y\in X\setminus M$. Since $M$ is closed, define
\begin{align*}
d:=\operatorname{dist}(y,M)=\inf_{m\in M}\|y-m\|_X.
\end{align*}
Then $d>0$. Since $\alpha\in(0,1)$, the number $d/\alpha$ is strictly larger than $d$. By the definition of the infimum, choose $m_0\in M$ such that
\begin{align*}
d\le \|y-m_0\|_X<\frac{d}{\alpha}.
\end{align*}
Define
\begin{align*}
u:=\frac{y-m_0}{\|y-m_0\|_X}.
\end{align*}
Then $\|u\|_X=1$. For any $m\in M$, the vector $m_0+\|y-m_0\|_X m$ lies in $M$, since $M$ is a linear subspace. Hence
\begin{align*}
\|u-m\|_X=\frac{\|y-m_0-\|y-m_0\|_X m\|_X}{\|y-m_0\|_X}\ge \frac{d}{\|y-m_0\|_X}>\alpha.
\end{align*}
Taking the infimum over $m\in M$ gives $\operatorname{dist}(u,M)>\alpha$.
[/proof][/step]