# Hahn–Banach theorem

In functional analysis, the Hahn–Banach theorem is a central result that allows the extension of bounded linear functionals defined on a vector subspace of some vector space to the whole space. The theorem also shows that there are sufficient continuous linear functionals defined on every normed vector space in order to study the dual space. Another version of the Hahn–Banach theorem is known as the Hahn–Banach separation theorem or the hyperplane separation theorem, and has numerous uses in convex geometry.

## History

The theorem is named for the mathematicians Hans Hahn and Stefan Banach, who proved it independently in the late 1920s. The special case of the theorem for the space $C[a,b]$ of continuous functions on an interval was proved earlier (in 1912) by Eduard Helly, and a more general extension theorem, the M. Riesz extension theorem, from which the Hahn–Banach theorem can be derived, was proved in 1923 by Marcel Riesz.
The first Hahn–Banach theorem was proved by Eduard Helly in 1912 who showed that certain linear functionals defined on a subspace of a certain type of normed space ($\mathbb {C} ^{\mathbb {N} }$) had an extension of the same norm. Helly did this through the technique of first proving that a one-dimensional extension exists (where the linear functional has its domain extended by one dimension) and then using induction. In 1927, Hahn defined general Banach spaces and used Helly's technique to prove a norm-preserving version of Hahn–Banach theorem for Banach spaces (where a bounded linear functional on a subspace has a bounded linear extension of the same norm to the whole space). In 1929, Banach, who was unaware of Hahn's result, generalized it by replacing the norm-preserving version with the dominated extension version that uses sublinear functions. Whereas Helly's proof used mathematical induction, Hahn and Banach both used transfinite induction.
The Hahn–Banach theorem arose from attempts to solve infinite systems of linear equations. This is needed to solve problems such as the moment problem, whereby given all the potential moments of a function one must determine if a function having these moments exists, and, if so, find it in terms of those moments. Another such problem is the Fourier cosine series problem, whereby given all the potential Fourier cosine coefficients one must determine if a function having those coefficients exists, and, again, find it if so.
Riesz and Helly solved the problem for certain classes of spaces (such as $L^{p}([0,1])$ and $C([a,b])$) where they discovered that the existence of a solution was equivalent to the existence and continuity of certain linear functionals. In effect, they needed to solve the following problem:
    (The vector problem) Given a collection $\left(f_{i}\right)_{i\in I}$ of bounded linear functionals on a normed space $X$ and a collection of scalars $\left(c_{i}\right)_{i\in I},$ determine if there is an $x\in X$ such that $f_{i}(x)=c_{i}$ for all $i\in I.$
If $X$ happens to be a reflexive space then to solve the vector problem, it suffices to solve the following dual problem:
    (The functional problem) Given a collection $\left(x_{i}\right)_{i\in I}$ of vectors in a normed space $X$ and a collection of scalars $\left(c_{i}\right)_{i\in I},$ determine if there is a bounded linear functional $f$ on $X$ such that $f\left(x_{i}\right)=c_{i}$ for all $i\in I.$
Riesz went on to define $L^{p}([0,1])$ space ($1<p<\infty$) in 1910 and the $\ell ^{p}$ spaces in 1913. While investigating these spaces he proved a special case of the Hahn–Banach theorem. Helly also proved a special case of the Hahn–Banach theorem in 1912. In 1910, Riesz solved the functional problem for some specific spaces and in 1912, Helly solved it for a more general class of spaces. It wasn't until 1932 that Banach, in one of the first important applications of the Hahn–Banach theorem, solved the general functional problem. The following theorem states the general functional problem and characterizes its solution.
Theorem (The functional problem) — Let $\left(x_{i}\right)_{i\in I}$ be vectors in a real or complex normed space $X$ and let $\left(c_{i}\right)_{i\in I}$ be scalars also indexed by $I\neq \varnothing .$
There exists a continuous linear functional $f$ on $X$ such that $f\left(x_{i}\right)=c_{i}$ for all $i\in I$ if and only if there exists a $K>0$ such that for any choice of scalars $\left(s_{i}\right)_{i\in I}$ where all but finitely many $s_{i}$ are $0,$ the following holds: $\left|\sum _{i\in I}s_{i}c_{i}\right|\leq K\left\|\sum _{i\in I}s_{i}x_{i}\right\|.$
The Hahn–Banach theorem can be deduced from the above theorem. If $X$ is reflexive then this theorem solves the vector problem.

## Hahn–Banach theorem

A real-valued function $f:M\to \mathbb {R}$ defined on a subset $M$ of $X$ is said to be dominated (above) by a function $p:X\to \mathbb {R}$ if $f(m)\leq p(m)$ for every $m\in M.$ For this reason, the following version of the Hahn–Banach theorem is called the dominated extension theorem.
Hahn–Banach dominated extension theorem (for real linear functionals) — If $p:X\to \mathbb {R}$ is a sublinear function (such as a norm or seminorm for example) defined on a real vector space $X$ then any linear functional defined on a vector subspace of $X$ that is dominated above by $p$ has at least one linear extension to all of $X$ that is also dominated above by $p.$
Explicitly, if $p:X\to \mathbb {R}$ is a sublinear function, which by definition means that it satisfies $p(x+y)\leq p(x)+p(y)\quad {\text{ and }}\quad p(tx)=tp(x)\qquad {\text{ for all }}\;x,y\in X\;{\text{ and all real }}\;t\geq 0,$ and if $f:M\to \mathbb {R}$ is a linear functional defined on a vector subspace $M$ of $X$ such that $f(m)\leq p(m)\quad {\text{ for all }}m\in M$ then there exists a linear functional $F:X\to \mathbb {R}$ such that $F(m)=f(m)\quad {\text{ for all }}m\in M,$ $F(x)\leq p(x)\quad ~\;\,{\text{ for all }}x\in X.$ Moreover, if $p$ is a seminorm then $|F(x)|\leq p(x)$ necessarily holds for all $x\in X.$
The theorem remains true if the requirements on $p$ are relaxed to require only that $p$ be a convex function: $p(tx+(1-t)y)\leq tp(x)+(1-t)p(y)\qquad {\text{ for all }}0<t<1{\text{ and }}x,y\in X.$
A function $p:X\to \mathbb {R}$ is convex and satisfies $p(0)\leq 0$ if and only if $p(ax+by)\leq ap(x)+bp(y)$ for all vectors $x,y\in X$ and all non-negative real $a,b\geq 0$ such that $a+b\leq 1.$ Every sublinear function is a convex function. On the other hand, if $p:X\to \mathbb {R}$ is convex with $p(0)\geq 0,$ then the function defined by $p_{0}(x)\;{\stackrel {\scriptscriptstyle {\text{def}}}{=}}\;\inf _{t>0}{\frac {p(tx)}{t}}$ is positively homogeneous (because for all $x$ and $r>0$ one has $p_{0}(rx)=\inf _{t>0}{\frac {p(trx)}{t}}=r\inf _{t>0}{\frac {p(trx)}{tr}}=r\inf _{\tau >0}{\frac {p(\tau x)}{\tau }}=rp_{0}(x)$), hence, being convex, it is sublinear. It is also bounded above by $p_{0}\leq p,$ and satisfies $F\leq p_{0}$ for every linear functional $F\leq p.$ So the extension of the Hahn–Banach theorem to convex functionals does not have a much larger content than the classical one stated for sublinear functionals.
If $F:X\to \mathbb {R}$ is linear then $F\leq p$ if and only if $-p(-x)\leq F(x)\leq p(x)\quad {\text{ for all }}x\in X,$ which is the (equivalent) conclusion that some authors write instead of $F\leq p.$ It follows that if $p:X\to \mathbb {R}$ is also symmetric, meaning that $p(-x)=p(x)$ holds for all $x\in X,$ then $F\leq p$ if and only $|F|\leq p.$ Every norm is a seminorm and both are symmetric balanced sublinear functions. A sublinear function is a seminorm if and only if it is a balanced function. On a real vector space (although not on a complex vector space), a sublinear function is a seminorm if and only if it is symmetric. The identity function $\mathbb {R} \to \mathbb {R}$ on $X:=\mathbb {R}$ is an example of a sublinear function that is not a seminorm.

### For complex or real vector spaces

The dominated extension theorem for real linear functionals implies the following alternative statement of the Hahn–Banach theorem that can be applied to linear functionals on real or complex vector spaces.
Hahn–Banach theorem — Suppose $p:X\to \mathbb {R}$ a seminorm on a vector space $X$ over the field $\mathbf {K} ,$ which is either $\mathbb {R}$ or $\mathbb {C} .$ If $f:M\to \mathbf {K}$ is a linear functional on a vector subspace $M$ such that $|f(m)|\leq p(m)\quad {\text{ for all }}m\in M,$ then there exists a linear functional $F:X\to \mathbf {K}$ such that $F(m)=f(m)\quad \;{\text{ for all }}m\in M,$ $|F(x)|\leq p(x)\quad \;\,{\text{ for all }}x\in X.$
The theorem remains true if the requirements on $p$ are relaxed to require only that for all $x,y\in X$ and all scalars $a$ and $b$ satisfying $|a|+|b|\leq 1,$ $p(ax+by)\leq |a|p(x)+|b|p(y).$ This condition holds if and only if $p$ is a convex and balanced function satisfying $p(0)\leq 0,$ or equivalently, if and only if it is convex, satisfies $p(0)\leq 0,$ and $p(ux)\leq p(x)$ for all $x\in X$ and all unit length scalars $u.$
A complex-valued functional $F$ is said to be dominated by $p$ if $|F(x)|\leq p(x)$ for all $x$ in the domain of $F.$ With this terminology, the above statements of the Hahn–Banach theorem can be restated more succinctly:
    Hahn–Banach dominated extension theorem: If $p:X\to \mathbb {R}$ is a seminorm defined on a real or complex vector space $X,$ then every dominated linear functional defined on a vector subspace of $X$ has a dominated linear extension to all of $X.$ In the case where $X$ is a real vector space and $p:X\to \mathbb {R}$ is merely a convex or sublinear function, this conclusion will remain true if both instances of "dominated" (meaning $|F|\leq p$) are weakened to instead mean "dominated above" (meaning $F\leq p$).
Proof
The following observations allow the Hahn–Banach theorem for real vector spaces to be applied to (complex-valued) linear functionals on complex vector spaces.
Every linear functional $F:X\to \mathbb {C}$ on a complex vector space is completely determined by its real part $\;\operatorname {Re} F:X\to \mathbb {R} \;$ through the formula $F(x)\;=\;\operatorname {Re} F(x)-i\operatorname {Re} F(ix)\qquad {\text{ for all }}x\in X$ and moreover, if $\|\cdot \|$ is a norm on $X$ then their dual norms are equal: $\|F\|=\|\operatorname {Re} F\|.$ In particular, a linear functional on $X$ extends another one defined on $M\subseteq X$ if and only if their real parts are equal on $M$ (in other words, a linear functional $F$ extends $f$ if and only if $\operatorname {Re} F$ extends $\operatorname {Re} f$). The real part of a linear functional on $X$ is always a real-linear functional (meaning that it is linear when $X$ is considered as a real vector space) and if $R:X\to \mathbb {R}$ is a real-linear functional on a complex vector space then $x\mapsto R(x)-iR(ix)$ defines the unique linear functional on $X$ whose real part is $R.$
If $F$ is a linear functional on a (complex or real) vector space $X$ and if $p:X\to \mathbb {R}$ is a seminorm then $|F|\,\leq \,p\quad {\text{ if and only if }}\quad \operatorname {Re} F\,\leq \,p.$ Stated in simpler language, a linear functional is dominated by a seminorm $p$ if and only if its real part is dominated above by $p.$
Suppose $p:X\to \mathbb {R}$ is a seminorm on a complex vector space $X$ and let $f:M\to \mathbb {C}$ be a linear functional defined on a vector subspace $M$ of $X$ that satisfies $|f|\leq p$ on $M.$ Consider $X$ as a real vector space and apply the Hahn–Banach theorem for real vector spaces to the real-linear functional $\;\operatorname {Re} f:M\to \mathbb {R} \;$ to obtain a real-linear extension $R:X\to \mathbb {R}$ that is also dominated above by $p,$ so that it satisfies $R\leq p$ on $X$ and $R=\operatorname {Re} f$ on $M.$ The map $F:X\to \mathbb {C}$ defined by $F(x)\;=\;R(x)-iR(ix)$ is a linear functional on $X$ that extends $f$ (because their real parts agree on $M$) and satisfies $|F|\leq p$ on $X$ (because $\operatorname {Re} F\leq p$ and $p$ is a seminorm). $\blacksquare$
The proof above shows that when $p$ is a seminorm then there is a one-to-one correspondence between dominated linear extensions of $f:M\to \mathbb {C}$ and dominated real-linear extensions of $\operatorname {Re} f:M\to \mathbb {R} ;$ the proof even gives a formula for explicitly constructing a linear extension of $f$ from any given real-linear extension of its real part.
Continuity
A linear functional $F$ on a topological vector space is continuous if and only if this is true of its real part $\operatorname {Re} F;$ if the domain is a normed space then $\|F\|=\|\operatorname {Re} F\|$ (where one side is infinite if and only if the other side is infinite). Assume $X$ is a topological vector space and $p:X\to \mathbb {R}$ is sublinear function. If $p$ is a continuous sublinear function that dominates a linear functional $F$ then $F$ is necessarily continuous. Moreover, a linear functional $F$ is continuous if and only if its absolute value $|F|$ (which is a seminorm that dominates $F$) is continuous. In particular, a linear functional is continuous if and only if it is dominated by some continuous sublinear function.

### Proof

The Hahn–Banach theorem for real vector spaces ultimately follows from Helly's initial result for the special case where the linear functional is extended from $M$ to a larger vector space in which $M$ has codimension $1.$
Lemma (One–dimensional dominated extension theorem) — Let $p:X\to \mathbb {R}$ be a sublinear function on a real vector space $X,$ let $f:M\to \mathbb {R}$ a linear functional on a proper vector subspace $M\subsetneq X$ such that $f\leq p$ on $M$ (meaning $f(m)\leq p(m)$ for all $m\in M$), and let $x\in X$ be a vector not in $M$ (so $M\oplus \mathbb {R} x=\operatorname {span} \{M,x\}$). There exists a linear extension $F:M\oplus \mathbb {R} x\to \mathbb {R}$ of $f$ such that $F\leq p$ on $M\oplus \mathbb {R} x.$
Given any real number $b,$ the map $F_{b}:M\oplus \mathbb {R} x\to \mathbb {R}$ defined by $F_{b}(m+rx)=f(m)+rb$ is always a linear extension of $f$ to $M\oplus \mathbb {R} x$ but it might not satisfy $F_{b}\leq p.$ It will be shown that $b$ can always be chosen so as to guarantee that $F_{b}\leq p,$ which will complete the proof.
If $m,n\in M$ then $f(m)-f(n)=f(m-n)\leq p(m-n)=p(m+x-x-n)\leq p(m+x)+p(-x-n)$ which implies $-p(-n-x)-f(n)~\leq ~p(m+x)-f(m).$ So define $a=\sup _{n\in M}[-p(-n-x)-f(n)]\qquad {\text{ and }}\qquad c=\inf _{m\in M}[p(m+x)-f(m)]$ where $a\leq c$ are real numbers. To guarantee $F_{b}\leq p,$ it suffices that $a\leq b\leq c$ (in fact, this is also necessary) because then $b$ satisfies "the decisive inequality" $-p(-n-x)-f(n)~\leq ~b~\leq ~p(m+x)-f(m)\qquad {\text{ for all }}\;m,n\in M.$
To see that $f(m)+rb\leq p(m+rx)$ follows, assume $r\neq 0$ and substitute ${\tfrac {1}{r}}m$ in for both $m$ and $n$ to obtain $-p\left(-{\tfrac {1}{r}}m-x\right)-{\tfrac {1}{r}}f\left(m\right)~\leq ~b~\leq ~p\left({\tfrac {1}{r}}m+x\right)-{\tfrac {1}{r}}f\left(m\right).$ If $r>0$ (respectively, if $r<0$) then the right (respectively, the left) hand side equals ${\tfrac {1}{r}}\left[p(m+rx)-f(m)\right]$ so that multiplying by $r$ gives $rb\leq p(m+rx)-f(m).$ $\blacksquare$
This lemma remains true if $p:X\to \mathbb {R}$ is merely a convex function instead of a sublinear function.
The lemma above is the key step in deducing the dominated extension theorem from Zorn's lemma.
The set of all possible dominated linear extensions of $f$ are partially ordered by extension of each other, so there is a maximal extension $F.$ By the codimension-1 result, if $F$ is not defined on all of $X,$ then it can be further extended. Thus $F$ must be defined everywhere, as claimed. $\blacksquare$
When $M$ has countable codimension, then using induction and the lemma completes the proof of the Hahn–Banach theorem. The standard proof of the general case uses Zorn's lemma although the strictly weaker ultrafilter lemma (which is equivalent to the compactness theorem and to the Boolean prime ideal theorem) may be used instead. Hahn–Banach can also be proved using Tychonoff's theorem for compact Hausdorff spaces (which is also equivalent to the ultrafilter lemma)
The Mizar project has completely formalized and automatically checked the proof of the Hahn–Banach theorem in the HAHNBAN file.

## Continuous extension theorem

The Hahn–Banach theorem can be used to guarantee the existence of continuous linear extensions of continuous linear functionals.
Hahn–Banach continuous extension theorem — Every continuous linear functional $f$ defined on a vector subspace $M$ of a (real or complex) locally convex topological vector space $X$ has a continuous linear extension $F$ to all of $X.$ If in addition $X$ is a normed space, then this extension can be chosen so that its dual norm is equal to that of $f.$
In category-theoretic terms, the underlying field of the vector space is an injective object in the category of locally convex vector spaces.
On a normed (or seminormed) space, a linear extension $F$ of a bounded linear functional $f$ is said to be norm-preserving if it has the same dual norm as the original functional: $\|F\|=\|f\|.$ Because of this terminology, the second part of the above theorem is sometimes referred to as the "norm-preserving" version of the Hahn–Banach theorem. Explicitly:
Norm-preserving Hahn–Banach continuous extension theorem — Every continuous linear functional $f$ defined on a vector subspace $M$ of a (real or complex) normed space $X$ has a continuous linear extension $F$ to all of $X$ that satisfies $\|f\|=\|F\|.$

### Proof of the continuous extension theorem

The following observations allow the continuous extension theorem to be deduced from the Hahn–Banach theorem.
The absolute value of a linear functional is always a seminorm. A linear functional $F$ on a topological vector space $X$ is continuous if and only if its absolute value $|F|$ is continuous, which happens if and only if there exists a continuous seminorm $p$ on $X$ such that $|F|\leq p$ on the domain of $F.$ If $X$ is a locally convex space then this statement remains true when the linear functional $F$ is defined on a proper vector subspace of $X.$
Let $f$ be a continuous linear functional defined on a vector subspace $M$ of a locally convex topological vector space $X.$ Because $X$ is locally convex, there exists a continuous seminorm $p:X\to \mathbb {R}$ on $X$ that dominates $f$ (meaning that $|f(m)|\leq p(m)$ for all $m\in M$). By the Hahn–Banach theorem, there exists a linear extension of $f$ to $X,$ call it $F,$ that satisfies $|F|\leq p$ on $X.$ This linear functional $F$ is continuous since $|F|\leq p$ and $p$ is a continuous seminorm.
Proof for normed spaces
A linear functional $f$ on a normed space is continuous if and only if it is bounded, which means that its dual norm $\|f\|=\sup\{|f(m)|:\|m\|\leq 1,m\in \operatorname {domain} f\}$ is finite, in which case $|f(m)|\leq \|f\|\|m\|$ holds for every point $m$ in its domain. Moreover, if $c\geq 0$ is such that $|f(m)|\leq c\|m\|$ for all $m$ in the functional's domain, then necessarily $\|f\|\leq c.$ If $F$ is a linear extension of a linear functional $f$ then their dual norms always satisfy $\|f\|\leq \|F\|$
so that equality $\|f\|=\|F\|$ is equivalent to $\|F\|\leq \|f\|,$ which holds if and only if $|F(x)|\leq \|f\|\|x\|$ for every point $x$ in the extension's domain. This can be restated in terms of the function $\|f\|\,\|\cdot \|:X\to \mathbb {R}$ defined by $x\mapsto \|f\|\,\|x\|,$ which is always a seminorm:
    A linear extension of a bounded linear functional $f$ is norm-preserving if and only if the extension is dominated by the seminorm $\|f\|\,\|\cdot \|.$
Applying the Hahn–Banach theorem to $f$ with this seminorm $\|f\|\,\|\cdot \|$ thus produces a dominated linear extension whose norm is (necessarily) equal to that of $f,$ which proves the theorem:
Let $f$ be a continuous linear functional defined on a vector subspace $M$ of a normed space $X.$ Then the function $p:X\to \mathbb {R}$ defined by $p(x)=\|f\|\,\|x\|$ is a seminorm on $X$ that dominates $f,$ meaning that $|f(m)|\leq p(m)$ holds for every $m\in M.$ By the Hahn–Banach theorem, there exists a linear functional $F$ on $X$ that extends $f$ (which guarantees $\|f\|\leq \|F\|$) and that is also dominated by $p,$ meaning that $|F(x)|\leq p(x)$ for every $x\in X.$ The fact that $\|f\|$ is a real number such that $|F(x)|\leq \|f\|\|x\|$ for every $x\in X,$ guarantees $\|F\|\leq \|f\|.$ Since $\|F\|=\|f\|$ is finite, the linear functional $F$ is bounded and thus continuous.

### Non-locally convex spaces

The continuous extension theorem might fail if the topological vector space (TVS) $X$ is not locally convex. For example, for $0<p<1,$ the Lebesgue space $L^{p}([0,1])$ is a complete metrizable TVS (an F-space) that is not locally convex (in fact, its only convex open subsets are itself $L^{p}([0,1])$ and the empty set) and the only continuous linear functional on $L^{p}([0,1])$ is the constant $0$ function (Rudin 1991, §1.47). Since $L^{p}([0,1])$ is Hausdorff, every finite-dimensional vector subspace $M\subseteq L^{p}([0,1])$ is linearly homeomorphic to Euclidean space $\mathbb {R} ^{\dim M}$ or $\mathbb {C} ^{\dim M}$ (by F. Riesz's theorem) and so every non-zero linear functional $f$ on $M$ is continuous but none has a continuous linear extension to all of $L^{p}([0,1]).$ However, it is possible for a TVS $X$ to not be locally convex but nevertheless have enough continuous linear functionals that its continuous dual space $X^{*}$ separates points; for such a TVS, a continuous linear functional defined on a vector subspace might have a continuous linear extension to the whole space.
If the TVS $X$ is not locally convex then there might not exist any continuous seminorm $p:X\to \mathbb {R}$ defined on $X$ (not just on $M$) that dominates $f,$ in which case the Hahn–Banach theorem can not be applied as it was in the above proof of the continuous extension theorem. However, the proof's argument can be generalized to give a characterization of when a continuous linear functional has a continuous linear extension: If $X$ is any TVS (not necessarily locally convex), then a continuous linear functional $f$ defined on a vector subspace $M$ has a continuous linear extension $F$ to all of $X$ if and only if there exists some continuous seminorm $p$ on $X$ that dominates $f.$ Specifically, if given a continuous linear extension $F$ then $p:=|F|$ is a continuous seminorm on $X$ that dominates $f;$ and conversely, if given a continuous seminorm $p:X\to \mathbb {R}$ on $X$ that dominates $f$ then any dominated linear extension of $f$ to $X$ (the existence of which is guaranteed by the Hahn–Banach theorem) will be a continuous linear extension.

## Geometric Hahn–Banach (the Hahn–Banach separation theorems)

The key element of the Hahn–Banach theorem is fundamentally a result about the separation of two convex sets: $\{-p(-x-n)-f(n):n\in M\},$ and $\{p(m+x)-f(m):m\in M\}.$ This sort of argument appears widely in convex geometry, optimization theory, and economics. Lemmas to this end derived from the original Hahn–Banach theorem are known as the Hahn–Banach separation theorems. They are generalizations of the hyperplane separation theorem, which states that two disjoint nonempty convex subsets of a finite-dimensional space $\mathbb {R} ^{n}$ can be separated by some affine hyperplane, which is a fiber (level set) of the form $f^{-1}(s)=\{x:f(x)=s\}$ where $f\neq 0$ is a non-zero linear functional and $s$ is a scalar.
Theorem — Let $A$ and $B$ be non-empty convex subsets of a real locally convex topological vector space $X.$ If $\operatorname {Int} A\neq \varnothing$ and $B\cap \operatorname {Int} A=\varnothing$ then there exists a continuous linear functional $f$ on $X$ such that $\sup f(A)\leq \inf f(B)$ and $f(a)<\inf f(B)$ for all $a\in \operatorname {Int} A$ (such an $f$ is necessarily non-zero).
When the convex sets have additional properties, such as being open or compact for example, then the conclusion can be substantially strengthened:
Theorem — Let $A$ and $B$ be convex non-empty disjoint subsets of a real topological vector space $X.$
* If $A$ is open then $A$ and $B$ are separated by a closed hyperplane. Explicitly, this means that there exists a continuous linear map $f:X\to \mathbf {K}$ and $s\in \mathbb {R}$ such that $f(a)<s\leq f(b)$ for all $a\in A,b\in B.$ If both $A$ and $B$ are open then the right-hand side may be taken strict as well.
* If $X$ is locally convex, $A$ is compact, and $B$ closed, then $A$ and $B$ are strictly separated: there exists a continuous linear map $f:X\to \mathbf {K}$ and $s,t\in \mathbb {R}$ such that $f(a)<t<s<f(b)$ for all $a\in A,b\in B.$
If $X$ is complex (rather than real) then the same claims hold, but for the real part of $f.$
Then following important corollary is known as the Geometric Hahn–Banach theorem or Mazur's theorem (also known as Ascoli–Mazur theorem). It follows from the first bullet above and the convexity of $M.$
Theorem (Mazur) — Let $M$ be a vector subspace of the topological vector space $X$ and suppose $K$ is a non-empty convex open subset of $X$ with $K\cap M=\varnothing .$ Then there is a closed hyperplane (codimension-1 vector subspace) $N\subseteq X$ that contains $M,$ but remains disjoint from $K.$
Mazur's theorem clarifies that vector subspaces (even those that are not closed) can be characterized by linear functionals.
Corollary (Separation of a subspace and an open convex set) — Let $M$ be a vector subspace of a locally convex topological vector space $X,$ and $U$ be a non-empty open convex subset disjoint from $M.$ Then there exists a continuous linear functional $f$ on $X$ such that $f(m)=0$ for all $m\in M$ and $\operatorname {Re} f>0$ on $U.$

### Supporting hyperplanes

Since points are trivially convex, geometric Hahn–Banach implies that functionals can detect the boundary of a set. In particular, let $X$ be a real topological vector space and $A\subseteq X$ be convex with $\operatorname {Int} A\neq \varnothing .$ If $a_{0}\in A\setminus \operatorname {Int} A$ then there is a functional that is vanishing at $a_{0},$ but supported on the interior of $A.$
Call a normed space $X$ smooth if at each point $x$ in its unit ball there exists a unique closed hyperplane to the unit ball at $x.$ Köthe showed in 1983 that a normed space is smooth at a point $x$ if and only if the norm is Gateaux differentiable at that point.

### Balanced or disked neighborhoods

Let $U$ be a convex balanced neighborhood of the origin in a locally convex topological vector space $X$ and suppose $x\in X$ is not an element of $U.$ Then there exists a continuous linear functional $f$ on $X$ such that $\sup |f(U)|\leq |f(x)|.$

## Applications

The Hahn–Banach theorem is the first sign of an important philosophy in functional analysis: to understand a space, one should understand its continuous functionals.
For example, linear subspaces are characterized by functionals: if X is a normed vector space with linear subspace M (not necessarily closed) and if $z$ is an element of X not in the closure of M, then there exists a continuous linear map $f:X\to \mathbf {K}$ with $f(m)=0$ for all $m\in M,$ $f(z)=1,$ and $\|f\|=\operatorname {dist} (z,M)^{-1}.$ (To see this, note that $\operatorname {dist} (\cdot ,M)$ is a sublinear function.) Moreover, if $z$ is an element of X, then there exists a continuous linear map $f:X\to \mathbf {K}$ such that $f(z)=\|z\|$ and $\|f\|\leq 1.$ This implies that the natural injection $J$ from a normed space X into its double dual $V^{**}$ is isometric.
That last result also suggests that the Hahn–Banach theorem can often be used to locate a "nicer" topology in which to work. For example, many results in functional analysis assume that a space is Hausdorff or locally convex. However, suppose X is a topological vector space, not necessarily Hausdorff or locally convex, but with a nonempty, proper, convex, open set M. Then geometric Hahn–Banach implies that there is a hyperplane separating M from any other point. In particular, there must exist a nonzero functional on X — that is, the continuous dual space $X^{*}$ is non-trivial. Considering X with the weak topology induced by $X^{*},$ then X becomes locally convex; by the second bullet of geometric Hahn–Banach, the weak topology on this new space separates points. Thus X with this weak topology becomes Hausdorff. This sometimes allows some results from locally convex topological vector spaces to be applied to non-Hausdorff and non-locally convex spaces.

### Partial differential equations

The Hahn–Banach theorem is often useful when one wishes to apply the method of a priori estimates. Suppose that we wish to solve the linear differential equation $Pu=f$ for $u,$ with $f$ given in some Banach space X. If we have control on the size of $u$ in terms of $\|f\|_{X}$ and we can think of $u$ as a bounded linear functional on some suitable space of test functions $g,$ then we can view $f$ as a linear functional by adjunction: $(f,g)=(u,P^{*}g).$ At first, this functional is only defined on the image of $P,$ but using the Hahn–Banach theorem, we can try to extend it to the entire codomain X. The resulting functional is often defined to be a weak solution to the equation.

### Characterizing reflexive Banach spaces

Theorem — A real Banach space is reflexive if and only if every pair of non-empty disjoint closed convex subsets, one of which is bounded, can be strictly separated by a hyperplane.

### Example from Fredholm theory

To illustrate an actual application of the Hahn–Banach theorem, we will now prove a result that follows almost entirely from the Hahn–Banach theorem.
Proposition — Suppose $X$ is a Hausdorff locally convex TVS over the field $\mathbf {K}$ and $Y$ is a vector subspace of $X$ that is TVS–isomorphic to $\mathbf {K} ^{I}$ for some set $I.$ Then $Y$ is a closed and complemented vector subspace of $X.$
Since $\mathbf {K} ^{I}$ is a complete TVS so is $Y,$ and since any complete subset of a Hausdorff TVS is closed, $Y$ is a closed subset of $X.$ Let $f=\left(f_{i}\right)_{i\in I}:Y\to \mathbf {K} ^{I}$ be a TVS isomorphism, so that each $f_{i}:Y\to \mathbf {K}$ is a continuous surjective linear functional. By the Hahn–Banach theorem, we may extend each $f_{i}$ to a continuous linear functional $F_{i}:X\to \mathbf {K}$ on $X.$ Let $F:=\left(F_{i}\right)_{i\in I}:X\to \mathbf {K} ^{I}$ so $F$ is a continuous linear surjection such that its restriction to $Y$ is $F{\big \vert }_{Y}=\left(F_{i}{\big \vert }_{Y}\right)_{i\in I}=\left(f_{i}\right)_{i\in I}=f.$ Let $P:=f^{-1}\circ F:X\to Y,$ which is a continuous linear map whose restriction to $Y$ is $P{\big \vert }_{Y}=f^{-1}\circ F{\big \vert }_{Y}=f^{-1}\circ f=\mathbf {1} _{Y},$ where $\mathbb {1} _{Y}$ denotes the identity map on $Y.$ This shows that $P$ is a continuous linear projection onto $Y$ (that is, $P\circ P=P$). Thus $Y$ is complemented in $X$ and $X=Y\oplus \ker P$ in the category of TVSs. $\blacksquare$
The above result may be used to show that every closed vector subspace of $\mathbb {R} ^{\mathbb {N} }$ is complemented because any such space is either finite dimensional or else TVS–isomorphic to $\mathbb {R} ^{\mathbb {N} }.$

## Generalizations

General template
There are now many other versions of the Hahn–Banach theorem. The general template for the various versions of the Hahn–Banach theorem presented in this article is as follows:
    $p:X\to \mathbb {R}$ is a sublinear function (possibly a seminorm) on a vector space $X,$ $M$ is a vector subspace of $X$ (possibly closed), and $f$ is a linear functional on $M$ satisfying $|f|\leq p$ on $M$ (and possibly some other conditions). One then concludes that there exists a linear extension $F$ of $f$ to $X$ such that $|F|\leq p$ on $X$ (possibly with additional properties).
Theorem — If $D$ is an absorbing disk in a real or complex vector space $X$ and if $f$ be a linear functional defined on a vector subspace $M$ of $X$ such that $|f|\leq 1$ on $M\cap D,$ then there exists a linear functional $F$ on $X$ extending $f$ such that $|F|\leq 1$ on $D.$

### For seminorms

Hahn–Banach theorem for seminorms — If $p:M\to \mathbb {R}$ is a seminorm defined on a vector subspace $M$ of $X,$ and if $q:X\to \mathbb {R}$ is a seminorm on $X$ such that $p\leq q{\big \vert }_{M},$ then there exists a seminorm $P:X\to \mathbb {R}$ on $X$ such that $P{\big \vert }_{M}=p$ on $M$ and $P\leq q$ on $X.$
Let $S$ be the convex hull of $\{m\in M:p(m)\leq 1\}\cup \{x\in X:q(x)\leq 1\}.$ Because $S$ is an absorbing disk in $X,$ its Minkowski functional $P$ is a seminorm. Then $p=P$ on $M$ and $P\leq q$ on $X.$
So for example, suppose that $f$ is a bounded linear functional defined on a vector subspace $M$ of a normed space $X,$ so its the operator norm $\|f\|$ is a non-negative real number. Then the linear functional's absolute value $p:=|f|$ is a seminorm on $M$ and the map $q:X\to \mathbb {R}$ defined by $q(x)=\|f\|\,\|x\|$ is a seminorm on $X$ that satisfies $p\leq q{\big \vert }_{M}$ on $M.$ The Hahn–Banach theorem for seminorms guarantees the existence of a seminorm $P:X\to \mathbb {R}$ that is equal to $|f|$ on $M$ (since $P{\big \vert }_{M}=p=|f|$) and is bounded above by $P(x)\leq \|f\|\,\|x\|$ everywhere on $X$ (since $P\leq q$).

### Geometric separation

Hahn–Banach sandwich theorem — Let $p:X\to \mathbb {R}$ be a sublinear function on a real vector space $X,$ let $S\subseteq X$ be any subset of $X,$ and let $f:S\to \mathbb {R}$ be any map. If there exist positive real numbers $a$ and $b$ such that $0\geq \inf _{s\in S}[p(s-ax-by)-f(s)-af(x)-bf(y)]\qquad {\text{ for all }}x,y\in S,$ then there exists a linear functional $F:X\to \mathbb {R}$ on $X$ such that $F\leq p$ on $X$ and $f\leq F\leq p$ on $S.$

### Maximal dominated linear extension

Theorem (Andenaes, 1970) — Let $p:X\to \mathbb {R}$ be a sublinear function on a real vector space $X,$ let $f:M\to \mathbb {R}$ be a linear functional on a vector subspace $M$ of $X$ such that $f\leq p$ on $M,$ and let $S\subseteq X$ be any subset of $X.$ Then there exists a linear functional $F:X\to \mathbb {R}$ on $X$ that extends $f,$ satisfies $F\leq p$ on $X,$ and is (pointwise) maximal on $S$ in the following sense: if ${\widehat {F}}:X\to \mathbb {R}$ is a linear functional on $X$ that extends $f$ and satisfies ${\widehat {F}}\leq p$ on $X,$ then $F\leq {\widehat {F}}$ on $S$ implies $F={\widehat {F}}$ on $S.$
If $S=\{s\}$ is a singleton set (where $s\in X$ is some vector) and if $F:X\to \mathbb {R}$ is such a maximal dominated linear extension of $f:M\to \mathbb {R} ,$ then $F(s)=\inf _{m\in M}[f(s)+p(s-m)].$

### Vector valued Hahn–Banach

Vector–valued Hahn–Banach theorem — If $X$ and $Y$ are vector spaces over the same field and if $f:M\to Y$ is a linear map defined on a vector subspace $M$ of $X,$ then there exists a linear map $F:X\to Y$ that extends $f.$

### Invariant Hahn–Banach

A set $\Gamma$ of maps $X\to X$ is commutative (with respect to function composition $\,\circ \,$) if $F\circ G=G\circ F$ for all $F,G\in \Gamma .$ Say that a function $f$ defined on a subset $M$ of $X$ is $\Gamma$-invariant if $L(M)\subseteq M$ and $f\circ L=f$ on $M$ for every $L\in \Gamma .$
An invariant Hahn–Banach theorem — Suppose $\Gamma$ is a commutative set of continuous linear maps from a normed space $X$ into itself and let $f$ be a continuous linear functional defined some vector subspace $M$ of $X$ that is $\Gamma$-invariant, which means that $L(M)\subseteq M$ and $f\circ L=f$ on $M$ for every $L\in \Gamma .$ Then $f$ has a continuous linear extension $F$ to all of $X$ that has the same operator norm $\|f\|=\|F\|$ and is also $\Gamma$-invariant, meaning that $F\circ L=F$ on $X$ for every $L\in \Gamma .$
This theorem may be summarized:
    Every $\Gamma$-invariant continuous linear functional defined on a vector subspace of a normed space $X$ has a $\Gamma$-invariant Hahn–Banach extension to all of $X.$

### For nonlinear functions

The following theorem of Mazur–Orlicz (1953) is equivalent to the Hahn–Banach theorem.
Mazur–Orlicz theorem — Let $p:X\to \mathbb {R}$ be a sublinear function on a real or complex vector space $X,$ let $T$ be any set, and let $R:T\to \mathbb {R}$ and $v:T\to X$ be any maps. The following statements are equivalent:
* there exists a real-valued linear functional $F$ on $X$ such that $F\leq p$ on $X$ and $R\leq F\circ v$ on $T$;
* for any finite sequence $s_{1},\ldots ,s_{n}$ of $n>0$ non-negative real numbers, and any sequence $t_{1},\ldots ,t_{n}\in T$ of elements of $T,$ $\sum _{i=1}^{n}s_{i}R\left(t_{i}\right)\leq p\left(\sum _{i=1}^{n}s_{i}v\left(t_{i}\right)\right).$
The following theorem characterizes when any scalar function on $X$ (not necessarily linear) has a continuous linear extension to all of $X.$
Theorem (The extension principle) — Let $f$ a scalar-valued function on a subset $S$ of a topological vector space $X.$
Then there exists a continuous linear functional $F$ on $X$ extending $f$ if and only if there exists a continuous seminorm $p$ on $X$ such that $\left|\sum _{i=1}^{n}a_{i}f(s_{i})\right|\leq p\left(\sum _{i=1}^{n}a_{i}s_{i}\right)$ for all positive integers $n$ and all finite sequences $a_{1},\ldots ,a_{n}$ of scalars and elements $s_{1},\ldots ,s_{n}$ of $S.$

## Converse

Let X be a topological vector space. A vector subspace M of X has the extension property if any continuous linear functional on M can be extended to a continuous linear functional on X, and we say that X has the Hahn–Banach extension property (HBEP) if every vector subspace of X has the extension property.
The Hahn–Banach theorem guarantees that every Hausdorff locally convex space has the HBEP. For complete metrizable topological vector spaces there is a converse, due to Kalton: every complete metrizable TVS with the Hahn–Banach extension property is locally convex. On the other hand, a vector space X of uncountable dimension, endowed with the finest vector topology, then this is a topological vector spaces with the Hahn–Banach extension property that is neither locally convex nor metrizable.
A vector subspace M of a TVS X has the separation property if for every element of X such that $x\not \in M,$ there exists a continuous linear functional $f$ on X such that $f(x)\neq 0$ and $f(m)=0$ for all $m\in M.$ Clearly, the continuous dual space of a TVS X separates points on X if and only if $\{0\},$ has the separation property. In 1992, Kakol proved that any infinite dimensional vector space X, there exist TVS-topologies on X that do not have the HBEP despite having enough continuous linear functionals for the continuous dual space to separate points on X. However, if X is a TVS then every vector subspace of X has the extension property if and only if every vector subspace of X has the separation property.

## Relation to axiom of choice and other theorems

The proof of the Hahn–Banach theorem for real vector spaces (HB) commonly uses Zorn's lemma, which in the axiomatic framework of Zermelo–Fraenkel set theory (ZF) is equivalent to the axiom of choice (AC). It was discovered by Łoś and Ryll-Nardzewski and independently by Luxemburg that HB can be proved using the ultrafilter lemma (UL), which is equivalent (under ZF) to the Boolean prime ideal theorem (BPI). BPI is strictly weaker than the axiom of choice and it was later shown that HB is strictly weaker than BPI.
The ultrafilter lemma is equivalent (under ZF) to the Banach–Alaoglu theorem, which is another foundational theorem in functional analysis. Although the Banach–Alaoglu theorem implies HB, it is not equivalent to it (said differently, the Banach–Alaoglu theorem is strictly stronger than HB). However, HB is equivalent to a certain weakened version of the Banach–Alaoglu theorem for normed spaces. The Hahn–Banach theorem is also equivalent to the following statement:
    (∗): On every Boolean algebra B there exists a "probability charge", that is: a non-constant finitely additive map from $B$ into $[0,1].$
(BPI is equivalent to the statement that there are always non-constant probability charges which take only the values 0 and 1.)
In ZF, the Hahn–Banach theorem suffices to derive the existence of a non-Lebesgue measurable set. Moreover, the Hahn–Banach theorem implies the Banach–Tarski paradox.
For separable Banach spaces, D. K. Brown and S. G. Simpson proved that the Hahn–Banach theorem follows from WKL$_0$, a weak subsystem of second-order arithmetic that takes a form of Kőnig's lemma restricted to binary trees as an axiom. In fact, they prove that under a weak set of assumptions, the two are equivalent, an example of reverse mathematics.