I'm trying to prove below extension of Hahn-Banach theorem.
Let $X$ be a vector space, $f: X \to \mathbb R \cup \{+\infty\}$ convex, $A$ an affine subspace of $X$, and $g : A \to \mathbb R$ affine such that $g \le f$ on $A$. Assume that $\operatorname{aint} (\operatorname{dom} f) \cap A \neq \emptyset$. Then there is an affine extension $\hat g : X \to \mathbb R$ of $g$ such that $\hat g \le f$. If, moreover, $X$ is a n.v.s., $g$ continuous on $A$, and $f$ continuous at some point in $\operatorname{dom} f$, then $\hat g$ is continuous.
Here $\operatorname{aint} (A)$ is the algebraic interior of $A$ and $\operatorname{dom} f := \{x\in X \mid f(x) \in \mathbb R\}$.
Could you have a check on my attempt?
Proof: We need the following lemmas:
Lemma 1: Let $X$ be a vector space and $A$ an affine subspace of $X$. Let $f,g: A \to \mathbb R$ be affine maps. There is $a \in X$ and a vector subspace $V$ of $X$ such that $a+V = A$. We define $f', g':V \to \mathbb R$ by $f' (x) := f(x+a)-f(a)$ and $g'(x) := g(x+a)-g(a)$. Then $f',g'$ are linear. If $f \le g$, then $f' = g'$.
Lemma 2: Let $X$ be a vector space, $f:X \to \mathbb R \cup \{+\infty\}$ convex, and $g:X \to \mathbb R \cup \{-\infty\}$ concave. Assume that $$g \le f \quad \text{and} \quad \operatorname{aint} ( \operatorname{dom} f) \cap \operatorname{dom} g \neq \emptyset. $$ Then there is an affine function $h:X \to \mathbb R$ such that $g \le h \le f$. If, moreover, $X$ is a t.v.s. and $f$ continuous at some point in $\operatorname{dom} f$, then $h$ is continuous.
There are $a \in X$ and a vector subspace $V$ of $X$ such that $A = V + a$.
- We define $g' : V \to \mathbb R$ by $g' (v) := g(v+a)-g(a)$. Then $g'$ is linear and thus concave.
- We define $g'': X \to \mathbb R$ by $$ g''(x) = \begin{cases} g'(x) &\text{if} \quad x \in V \\ -\infty &\text{otherwise}. \end{cases} $$ Then $g''$ is concave.
- We define $f':X \to \mathbb R\cup\{+\infty\}$ by $f'(x) := f(x+a)-f(a)$. Then $f'$ is convex. Clearly, $g'_{\restriction V} \le f'_{\restriction V}$.
By Lemma 1, there is an affine map $h:X \to \mathbb R$ such that $g'' \le h \le f'$. We define a map $h' :X \to \mathbb R$ by $h'(x) := h(x)-h(0)$. Then $h'$ is linear. Because $g' \le h_{\restriction V}$, their induced linear maps on $V$ are equal by Lemma 2, i.e., $g' = h'_{\restriction V}$. Then $h'_{\restriction V} \le h_{\restriction V}$ and thus $h' \le h$.
By Hahn-Banach theorem, there is a linear extension $\hat g:X \to \mathbb R$ of $g'$ such that $\hat g \le h'$. It follows that $\hat g \le h \le f'$. We define $\bar g: X \to \mathbb R$ by $\bar g(x) := \hat g (x-a) + g(a)$. Then $\bar g$ is an affine extension of $g$ and $\bar g \le f$. The continuity of $\bar g$ easily follows.