Separation from a closed convex cone (source code)

= Separation from a closed convex cone

For a <closed convex cone> $C$ in a finite-dimensional real <inner product> space and $z\notin C$, there exists $y$ with $\langle y,z\rangle<0$ and $\langle y,c\rangle\geq0$ for all $c\in C$. Here is a direct proof. A nearest point $c_0\in C$ exists by <compactness> after restricting to a sufficiently large ball. Differentiating squared distance along the segment towards $c\in C$ gives $\langle c_0-z,c-c_0\rangle\geq0$. Using $c=0$ and $c=2c_0$ shows $\langle c_0-z,c_0\rangle=0$. Set $y=c_0-z\ne0$: then $\langle y,c\rangle\geq0$ and $\langle y,z\rangle=-\|y\|^2<0$. This is a conic form of the <Hahn-Banach separation theorem>.