Skip to article frontmatterSkip to article content
Tutorial

Convex and Affine Sets

Abstract

The conditions for a set to be convex and affine.

Keywords:SetsConvexAffine.

Lines Between Points

Two vectors, p_1 and p_2, drawn with respect to some basis, and the vector that joins them.

Two vectors, p1p_1 and p2p_2, drawn with respect to some basis, and the vector that joins them.

The above figure shows two vectors, p1p_1 and p2,p_2, drawn with respect to some basis, and the vector, p2p1p_2 - p_1, that joins them. Any point along the line that encompasses the vector p2p1p_2 - p_1 can be given by a vector

l=t(p2p1)+p1=(1t)p1+tp2.\begin{align*} \bm{l} &= t (p_2 - p_1) + p_1 \\ &= (1-t)p_1 + t p_2. \end{align*}

where tt is a scalar. If t  [0,1]t~\in~[0,1] then l\bm{l} can be considered to be a probabilistic mixture of the vectors p1p_1 and p2p_2.

Convex Functions

A convex function, f(X).

A convex function, f(X)f(X).

In the above figure, a function f(X)f(X) is plotted. For any two points on the graph, x1x_1 and x2x_2, it can be seen that the value f(x)f(x') is less then f(x1)f(x_1) and f(x2)f(x_2) if x1xx2x_1 \leq x' \leq x_2. This means all points between x1x_1 and x2x_2 sit below the line-segment between those points. This can be stated mathematically as

f(tx1+(1t)x2)tf(x1)+(1t)f(x2).f(tx_1 + (1-t)x_2) \leq tf(x_1) + (1-t)f(x_2).

The argument of the left hand side, tx1+(1t)x2tx_1 + (1-t)x_2, is the straight line between x1x_1 and x2x_2. The right hand side is the straight line between f(x1)f(x_1) and f(x2)f(x_2).

If the above criteria is satisfied, the function f(X)f(X) is a convex function.

Convex Sets

a) A convex set b) a non-convex set.

a) A convex set b) a non-convex set.

Let VV be a vector space over a field F\mathbb{F}. A subset SVS \subset V is convex if for all ψ,σ  S\psi, \sigma~\in~S the line segment connecting ψ \psi and σ \sigma is also in SS, as seen in Fig (a) above. Mathematically this means that

tψ+(1t)σ  S,  (ψ,σ)S,  t[0,1].t\psi + (1-t) \sigma~\in~S,~\forall~(\psi,\sigma)\in S,~~ t\in[0,1].

If a mixture of elements in the subset can lead to an element outside of the subset, as seen in fig (b) above where some points on the line segment are outside the boundary of the set, the subset is not convex.

In general, a set SS is convex if for all subsets of objects in SS, {ψ1,ψ2,,ψn}S  ψi\{ \psi_1, \psi_2, \ldots, \psi_n \} \in S~\forall~\psi_i, then

a1ψ1+a2ψ2++anψn  S,  ai0  i,  i=1nai=1.a_1 \psi_1 + a_2 \psi_2 + \ldots + a_n \psi_n~\in~S,~~ a_i \geq 0 ~\forall~i, ~ ~ \sum_{i=1}^{n} a_i = 1.

The boundary of a convex set is always a convex curve.

The convex hull of a set SVS' \subset V is the smallest convex set that contains SS'.

Affine

Let VV be a vector space over a field F\mathbb{F}. A subset SVS \subset V is affine if for every pair in the set the whole infinite line through those two points is in SS. Mathematically, this means that

tψ+(1t)σ  S,  (ψ,σ)S.t \psi + (1-t) \sigma ~\in~S, ~\forall~(\psi, \sigma)\in S.

The key difference between affine sets and convex sets is that tt does not need to be in the set [0,1][0,1] and can be negative. This means that the whole line including ψ \psi and σ \sigma is included, not just the line segment between ψ \psi and σ \sigma .

In general, a set SS is affine if for all subsets of objects in SS, {ψ1,ψ2,,ψn}S  ψi\{ \psi_1, \psi_2, \ldots, \psi_n \} \in S~\forall~\psi_i, then

a1ψ1+a2ψ2++anψn  S, i=1nai=1.a_1 \psi_1 + a_2 \psi_2 + \ldots + a_n \psi_n~\in~S, ~ \sum_{i=1}^{n} a_i = 1.

where, as before, the condition for aia_i to be positive has been removed.

Hence, convex combinations can be thought of as a weighted average of elements of the set, whilst affine combinations can be thought of as a weighted average where the weights can be negative.