# Convex analysis

Convex analysis is the branch of mathematics devoted to the study of properties of convex functions and convex sets, often with applications in convex minimization, a subdomain of optimization theory.

## Convex sets

A subset $C\subseteq X$ of some vector space $X$ is convex if it satisfies any of the following equivalent conditions:
* If $0\leq r\leq 1$ is real and $x,y\in C$ then $rx+(1-r)y\in C.$
* If $0<r<1$ is real and $x,y\in C$ with $x\neq y,$ then $rx+(1-r)y\in C.$
Throughout, $f:X\to [-\infty ,\infty ]$ will be a map valued in the extended real numbers $[-\infty ,\infty ]=\mathbb {R} \cup \{\pm \infty \}$ with a domain $\operatorname {domain} f=X$ that is a convex subset of some vector space. The map $f:X\to [-\infty ,\infty ]$ is a convex function if
| $f(rx+(1-r)y)\leq rf(x)+(1-r)f(y)$ | (Convexity ≤) |
holds for any real $0<r<1$ and any $x,y\in X$ with $x\neq y.$ If this remains true of $f$ when the defining inequality (Convexity ≤) is replaced by the strict inequality
| $f(rx+(1-r)y)<rf(x)+(1-r)f(y)$ | (Convexity <) |
then $f$ is called strictly convex.
Convex functions are related to convex sets. Specifically, the function $f$ is convex if and only if its epigraph
| $\operatorname {epi} f:=\left\{(x,r)\in X\times \mathbb {R} ~:~f(x)\leq r\right\}$ | (Epigraph def.) |
is a convex set. The epigraphs of extended real-valued functions play a role in convex analysis that is analogous to the role played by graphs of real-valued function in real analysis. Specifically, the epigraph of an extended real-valued function provides geometric intuition that can be used to help formula or prove conjectures.
The domain of a function $f:X\to [-\infty ,\infty ]$ is denoted by $\operatorname {domain} f$ while its effective domain is the set
| $\operatorname {dom} f:=\{x\in X~:~f(x)<\infty \}.$ | (dom f def.) |
The function $f:X\to [-\infty ,\infty ]$ is called proper if $\operatorname {dom} f\neq \varnothing$ and $f(x)>-\infty$ for all $x\in \operatorname {domain} f.$ Alternatively, this means that there exists some $x$ in the domain of $f$ at which $f(x)\in \mathbb {R}$ and $f$ is also never equal to $-\infty .$ In words, a function is proper if its domain is not empty, it never takes on the value $-\infty ,$ and it also is not identically equal to $+\infty .$ If $f:\mathbb {R} ^{n}\to [-\infty ,\infty ]$ is a proper convex function then there exist some vector $b\in \mathbb {R} ^{n}$ and some $r\in \mathbb {R}$ such that
    $f(x)\geq x\cdot b-r$ for every $x$
where $x\cdot b$ denotes the dot product of these vectors.

## Convex conjugate

The convex conjugate of an extended real-valued function $f:X\to [-\infty ,\infty ]$ (not necessarily convex) is the function $f^{*}:X^{*}\to [-\infty ,\infty ]$ from the (continuous) dual space $X^{*}$ of $X,$ and
    $f^{*}\left(x^{*}\right)=\sup _{z\in X}\left\{\left\langle x^{*},z\right\rangle -f(z)\right\}$
where the brackets $\left\langle \cdot ,\cdot \right\rangle$ denote the canonical duality $\left\langle x^{*},z\right\rangle :=x^{*}(z).$ The biconjugate of $f$ is the map $f^{**}=\left(f^{*}\right)^{*}:X\to [-\infty ,\infty ]$ defined by $f^{**}(x):=\sup _{z^{*}\in X^{*}}\left\{\left\langle x,z^{*}\right\rangle -f\left(z^{*}\right)\right\}$ for every $x\in X.$ If $\operatorname {Func} (X;Y)$ denotes the set of $Y$-valued functions on $X,$ then the map $\operatorname {Func} (X;[-\infty ,\infty ])\to \operatorname {Func} \left(X^{*};[-\infty ,\infty ]\right)$ defined by $f\mapsto f^{*}$ is called the Legendre-Fenchel transform.

### Subdifferential set and the Fenchel-Young inequality

If $f:X\to [-\infty ,\infty ]$ and $x\in X$ then the subdifferential set is
    ${\begin{alignedat}{4}\partial f(x):&=\left\{x^{*}\in X^{*}~:~f(z)\geq f(x)+\left\langle x^{*},z-x\right\rangle {\text{ for all }}z\in X\right\}&&({\text{“}}z\in X{\text{''}}{\text{ can be replaced with: }}{\text{“}}z\in X{\text{ such that }}z\neq x{\text{''}})\\&=\left\{x^{*}\in X^{*}~:~\left\langle x^{*},x\right\rangle -f(x)\geq \left\langle x^{*},z\right\rangle -f(z){\text{ for all }}z\in X\right\}&&\\&=\left\{x^{*}\in X^{*}~:~\left\langle x^{*},x\right\rangle -f(x)\geq \sup _{z\in X}\left\langle x^{*},z\right\rangle -f(z)\right\}&&{\text{ The right hand side is }}f^{*}\left(x^{*}\right)\\&=\left\{x^{*}\in X^{*}~:~\left\langle x^{*},x\right\rangle -f(x)=f^{*}\left(x^{*}\right)\right\}&&{\text{ Taking }}z:=x{\text{ in the }}\sup{\text{ gives the inequality }}\leq .\\\end{alignedat}}$
For example, in the important special case where $f=\|\cdot \|$ is a norm on $X$, it can be shown that if $0\neq x\in X$ then this definition reduces down to:
    $\partial f(x)=\left\{x^{*}\in X^{*}~:~\left\langle x^{*},x\right\rangle =\|x\|{\text{ and }}\left\|x^{*}\right\|=1\right\}$ and $\partial f(0)=\left\{x^{*}\in X^{*}~:~\left\|x^{*}\right\|\leq 1\right\}.$
For any $x\in X$ and $x^{*}\in X^{*},$ $f(x)+f^{*}\left(x^{*}\right)\geq \left\langle x^{*},x\right\rangle ,$ which is called the Fenchel-Young inequality. This inequality is an equality (i.e. $f(x)+f^{*}\left(x^{*}\right)=\left\langle x^{*},x\right\rangle$) if and only if $x^{*}\in \partial f(x).$ It is in this way that the subdifferential set $\partial f(x)$ is directly related to the convex conjugate $f^{*}\left(x^{*}\right).$

### Biconjugate

The biconjugate of a function $f:X\to [-\infty ,\infty ]$ is the conjugate of the conjugate, typically written as $f^{**}:X\to [-\infty ,\infty ].$ The biconjugate is useful for showing when strong or weak duality hold (via the perturbation function).
For any $x\in X,$ the inequality $f^{**}(x)\leq f(x)$ follows from the Fenchel–Young inequality. For proper functions, $f=f^{**}$ if and only if $f$ is convex and lower semi-continuous by Fenchel–Moreau theorem.

## Convex minimization

A convex minimization (primal) problem is one of the form
    find $\inf _{x\in M}f(x)$ when given a convex function $f:X\to [-\infty ,\infty ]$ and a convex subset $M\subseteq X.$

### Dual problem

In optimization theory, the duality principle states that optimization problems may be viewed from either of two perspectives, the primal problem or the dual problem.
In general given two dual pairs separated locally convex spaces $\left(X,X^{*}\right)$ and $\left(Y,Y^{*}\right).$ Then given the function $f:X\to [-\infty ,\infty ],$ we can define the primal problem as finding $x$ such that
    $\inf _{x\in X}f(x).$
If there are constraint conditions, these can be built into the function $f$ by letting $f=f+I_{\mathrm {constraints} }$ where $I$ is the indicator function. Then let $F:X\times Y\to [-\infty ,\infty ]$ be a perturbation function such that $F(x,0)=f(x).$
The dual problem with respect to the chosen perturbation function is given by
    $\sup _{y^{*}\in Y^{*}}-F^{*}\left(0,y^{*}\right)$
where $F^{*}$ is the convex conjugate in both variables of $F.$
The duality gap is the difference of the right and left hand sides of the inequality
    $\sup _{y^{*}\in Y^{*}}-F^{*}\left(0,y^{*}\right)\leq \inf _{x\in X}F(x,0).$
This principle is the same as weak duality. If the two sides are equal to each other, then the problem is said to satisfy strong duality.
There are many conditions for strong duality to hold such as:
* $F=F^{**}$ where $F$ is the perturbation function relating the primal and dual problems and $F^{**}$ is the biconjugate of $F$;
* the primal problem is a linear optimization problem;
* Slater's condition for a convex optimization problem.

#### Lagrange duality

For a convex minimization problem with inequality constraints,
          $\min_{x}f(x)$ subject to $g_{i}(x)\leq 0$ for $i=1,\ldots ,m.$
the Lagrangian dual problem is
          $\sup_{u}\inf_{x}L(x,u)$ subject to $u_{i}(x)\geq 0$ for $i=1,\ldots ,m.$
where the objective function $L(x,u)$ is the Lagrange dual function defined as follows:
    $L(x,u)=f(x)+\sum _{j=1}^{m}u_{j}g_{j}(x)$