How to prove Hahn-Banach separation theorem for $X^*\times \mathbb{R}$ version? The following theorem is taken from Behrend's M-Structure and Banach-Stone Theorem, page $3.$

Theorem $0.1$: Let $X$ be Banach space and $K_1,K_2$ be nonempty convex subsets of $X^*\times \mathbb{R}$ ($X^*$ is provided with weak$^*$-topology).
Suppose that $K_1\cap K_2=\emptyset$ and that $K_1$ is closed and $K_2$ is compact. 
Then there exists $x\in X, a,r\in\mathbb{R}$ such that 
  $$p_1(x)+aa_1<r<p_2(x)+aa_2$$
  for all $(p_1,a_1)\in K_1$ and $(p_2,a_2)\in K_2.$
Note that $r>0$ if $(0,0)\in K_1$ and that $a>0$ if there exist $p\in X^*$ and $a_1,a_2\in\mathbb{R}$ such that $a_1<a_2, (p,a_1)\in K_1$ and $(p,a_2)\in K_2.$

Behrend stated that the theorem above follows from the following two facts: 
$(1)$ (Hahn-Banach separation theorem) Every nonempty compact convex set in a locally convex Hausdorff space can be strictly separated from every disjoint nonempty closed convex set. 
$(2)$ Continuous linear functionals on $(X^*,\text{weak}^*\text{-topology})$ are just the evaluation at the points of $X.$
...................................................................................................................................................................
The following is my attempt:
Clearly $X^*\times \mathbb{R}$ is locally convex.
Since $K_1$ is a closed convex set while $K_2$ is a compact convex set, by Hahn-Banach separation theorem, there exist scalars $r,s$ and a continuous linear functional $x^*$ on $X^*\times\mathbb{R}$ such that 
$$x^*(p_1,a_1)<r<s<x^*(p_2,a_2)$$
for all $(p_1,a_1)\in K_1$ and $(p_2,a_2)\in K_2.$
However, I do not know how to proceed from here. 
Any hint would be appreciated. 
 A: From here it is important to know that the dual of $X^*\times\mathbb R$ (with $X^*$ given the weak$^*$-topology) is $X\times\mathbb R$, with the pairing
$$(x,\alpha)(p,\beta)=p(x)+\alpha\beta.$$
Indeed, for each $x\in X$ and $\alpha\in\mathbb R$, the map
$$(p,\beta)\mapsto p(x)+\alpha\beta$$
from $X^*\times\mathbb R$ to $\mathbb R$ is continuous and linear, so $X\times\mathbb R\subset(X^*\times\mathbb R)^*$.
If $f\in(X^*\times\mathbb R)^*$, then the map $p\mapsto f(p,0)$ is weak$^*$-continuous, hence there is some $x\in X$ such that $f(p,0)=p(x)$ for all $p\in X^*$.  Since $\beta\mapsto f(0,\beta)$ is linear, there is some $\alpha\in\mathbb R$ such that $f(0,\beta)=\alpha\beta$ for all $\beta\in\mathbb R$.  By linearity, we have $f(p,\beta)=p(x)+\alpha\beta$ for all $(p,\beta)\in X^*\times\mathbb R$.  Thus $(X^*\times\mathbb R)^*=X\times\mathbb R$.
Thus, the linear functional you obtain from the Hahn-Banach theorem is of the form $(p,\beta)\mapsto p(x)+\alpha\beta$ for some $\alpha\in\mathbb R$, $x\in X$, and you obtain 
$$p_1(x)+\alpha\beta_1<r<s<p_2(x)+\alpha\beta_2$$
for all $(p_1,\beta_1)\in K_1$ and $(p_2,\beta_2)\in K_2$.  From here, it should be just be routine work to check the statements in the last paragraph. If you have any trouble with that, let me know and I will edit/expand.
