# Midconvexity for finite sets

## Abstract

Let X be a finite subset of a real vector space. We study Jensen-type convexity on subsets of X. In particular for subsets of X, we introduce the definition of X-midconvex sets. We show that such a notion corresponds well to the classical notion of a convex set. Moreover, we prove that a function X-midconvex set is a midconvex hull of all its extremal points. Other analogues of some classical results are also given. At the end we present an algorithmic approach to finding the midconvex hull of a given set.

MSC:26A51, 26B25.

## 1 Introduction

Thanks to the growing role of computers, one can recently notice an increasing interest in discrete (finite) sets in many parts of mathematics. In particular, one has to mention the recent development of convexity on subsets of ${\mathbb{Z}}^{N}$.

Therefore, there appears a natural need to introduce and develop (mid-)convexity on finite sets. Since we are going to study finite subsets of a real vector space, we may restrict ourselves to finite subsets of ${\mathbb{R}}^{N}$. Since the middle point of an interval is one of the most important geometrical notions, we start our investigations with the simplest and earliest version of convexity-midconvexity.

The main difference between our approach and that of  is that we restrict our considerations to X, that is, we treat X as a space. Hence, our notions have relative character since we study convexity on the subsets of X. One can say that we investigate midconvexity on a restricted domain.

Now, we briefly describe the contents of the paper. First of all, we propose a proper definition of a midconvex set for finite sets. By ‘proper’ we mean here that we are looking for the notion which has possibly many properties analogous to those of convex sets in ${\mathbb{R}}^{N}$. We consider two different definitions of midconvexity. The first one, which is intuitively very similar to the classical definition, occurs to have weak properties. The other one, which we call function midconvexity, at a first glance seems a little bit artificial, but it corresponds well to the classical definition. It is based on the observation that in ${\mathbb{R}}^{N}$ a closed set V is convex if and only if it is the preimage of the set $\left(-\mathrm{\infty },0\right]$ for some convex function $f:{\mathbb{R}}^{N}\to \mathbb{R}$.

Next, we study the properties of function midconvexity. In particular in Section 3, we prove an analogue of the theorem stating that a compact convex set in ${\mathbb{R}}^{N}$ is the convex hull of its extremal points. We introduce also the notion of a convex function on a finite domain. We prove that the maximum of such a convex function is achieved at an extreme point of its domain.

## 2 Midconvexity on finite sets

In the whole paper, we assume that X is a finite subset of ${\mathbb{R}}^{N}$. By ${\mathbb{N}}_{0}$ we denote the set of nonnegative integers and by ${\mathbb{R}}_{+}$ the set of nonnegative real numbers. We adapt the classical definitions of a midconvex set and a midconvex function to our setting .

Definition 2.1 We say that $W\subset X$ is X-midconvex if

$\mathrm{\forall }v,w\in W:\frac{v+w}{2}\in X\phantom{\rule{1em}{0ex}}⇒\phantom{\rule{1em}{0ex}}\frac{v+w}{2}\in W.$

Evidently, X and a singleton are X-midconvex sets. It is also obvious that the intersection of X-midconvex sets is X-midconvex.

Definition 2.2 We say that a function $f:W\to \mathbb{R}$, where $W\subset X$, is X-midconvex (shortly midconvex) if W is X-midconvex and

$\mathrm{\forall }v,w\in W:\frac{v+w}{2}\in W\phantom{\rule{1em}{0ex}}⇒\phantom{\rule{1em}{0ex}}f\left(\frac{v+w}{2}\right)\le \frac{f\left(v\right)+f\left(w\right)}{2}.$

We will need some of their properties with respect to the following definition of a midconvex set.

Proposition 2.3 Let$W\subset X$be an X-midconvex set, let$c>0$and let$f:W\to \mathbb{R}$, $g:W\to \mathbb{R}$be X-midconvex functions. Then$max\left(f,g\right)$and cf are X-midconvex functions.

Proof It is obvious that cf is X-midconvex. We show that $max\left(f,g\right)$ is X-midconvex. Consider arbitrary $u,v\in W$ such that $\frac{u+v}{2}\in W$. Then we have

$f\left(\frac{u+v}{2}\right)\le \frac{f\left(u\right)+f\left(v\right)}{2}$

and

$g\left(\frac{u+v}{2}\right)\le \frac{g\left(u\right)+g\left(v\right)}{2}.$

Whence we obtain

$\begin{array}{rcl}max\left(f\left(\frac{u+v}{2}\right),g\left(\frac{u+v}{2}\right)\right)& \le & max\left(\frac{f\left(u\right)+f\left(v\right)}{2},\frac{g\left(u\right)+g\left(v\right)}{2}\right)\\ \le & \frac{1}{2}\left(max\left(f\left(u\right),g\left(u\right)\right)+max\left(f\left(v\right),g\left(v\right)\right)\right).\end{array}$

□

To explain the unintuitive behavior of X-midconvexity, we need the notion of a discrete interval (for $m\in {\mathbb{N}}_{0}$):

${\left[a,b\right]}_{m}:=\left\{\frac{k}{m}a+\left(1-\frac{k}{m}\right)b:k\in \left\{0,\dots ,m\right\}\right\}.$

One could expect that if W is X-midconvex and $a,b\in W$ are such that ${\left[a,b\right]}_{m}\subset X$, then ${\left[a,b\right]}_{m}\subset W$. It occurs that this is not the case.

Example 2.4 Let $N=1$, $X=\left\{0,1,2,3\right\}$ and $W=\left\{0,3\right\}$. Then W is X-midconvex and $0,3\in W$, but ${\left[0,3\right]}_{3}=X\not\subset W$.

Therefore, we need another definition of a midconvex set.

Let us present the idea which, in our opinion, leads to the ‘right’ definition. The observation that a closed set $A\subset {\mathbb{R}}^{N}$ is convex if and only if there exists a convex function $f:{\mathbb{R}}^{N}\to \mathbb{R}$ such that $A=\left\{x\in {\mathbb{R}}^{N}:f\left(x\right)\le 0\right\}$ (the part ‘if’ of the statement is obvious; for the converse, take as f the distance from A) leads us to the following definition.

Definition 2.5 We say that $W\subset X$ is function X-midconvex (shortly X-fmidconvex) if there exists an X-midconvex function $f:X\to \mathbb{R}$ such that

$W=\left\{x\in X:f\left(x\right)\le 0\right\}.$

Clearly, $f:X\to \mathbb{R}$, $f\equiv 0$ is X-midconvex. Hence, X is X-fmidconvex.

Observation 2.6 Every X-fmidconvex set is X-midconvex.

Proof Let W be X-fmidconvex. Then $W:=\left\{x\in X:f\left(x\right)\le 0\right\}$ for a certain X-midconvex function $f:X\to \mathbb{R}$. Consider arbitrary ${x}_{1},{x}_{2}\in W$ such that $\frac{{x}_{1}+{x}_{2}}{2}\in X$. Then we have

$f\left(\frac{{x}_{1}+{x}_{2}}{2}\right)\le \frac{f\left({x}_{1}\right)+f\left({x}_{2}\right)}{2}\le 0.$

Hence $\frac{{x}_{1}+{x}_{2}}{2}\in W$. □

As one could expect, the implication converse to Observation 2.6 does not hold. To notice this (see Example 2.8), we will need the following result, which shows that fmidconvexity resembles classical convexity.

Theorem 2.7 Let W be X-fmidconvex. Then

$\mathrm{\forall }a,b\in W,\mathrm{\forall }m\in {\mathbb{N}}_{0}:{\left[a,b\right]}_{m}\subset X\phantom{\rule{1em}{0ex}}⇒\phantom{\rule{1em}{0ex}}{\left[a,b\right]}_{m}\subset W.$

Proof The proof follows a similar approach from .

Since W is X-fmidconvex, there exists a midconvex function $f:X\to \mathbb{R}$ such that $W=\left\{x\in X:f\left(x\right)\le 0\right\}$. Suppose, for the proof by contradiction, that there exist $a,b\in W$, $m\in \mathbb{N}$, such that ${\left[a,b\right]}_{m}\subset X$ but ${\left[a,b\right]}_{m}\not\subset W$. It means that there exists a $k\in \left\{0,\dots ,m\right\}$ such that

${x}_{k}:=\frac{k}{m}a+\left(1-\frac{k}{m}\right)b\notin W,$

i.e., that $f\left({x}_{k}\right)>0$. Then

$C:=maxf{|}_{{\left[a,b\right]}_{m}}>0.$

Let $l\in \left\{0,\dots ,m\right\}$ be chosen such that $f\left({x}_{l}\right)=C$. Two cases can occur.

1. 1.

$l\le \frac{m}{2}$. Then ${x}_{2l}\in {\left[a,b\right]}_{m}$, and we obtain that

$\begin{array}{rcl}C& =& f\left({x}_{l}\right)=f\left(\frac{l}{m}a+\left(1-\frac{l}{m}\right)b\right)=f\left(\frac{\frac{2l}{m}a+\left(1-\frac{2l}{m}\right)b+b}{2}\right)\\ \le & \frac{f\left(\frac{2l}{m}a+\left(1-\frac{2l}{m}\right)b\right)+f\left(b\right)}{2}=\frac{f\left(\frac{2l}{m}a+\left(1-\frac{2l}{m}\right)b\right)}{2}=\frac{f\left({x}_{2l}\right)}{2}.\end{array}$

Whence we have $f\left({x}_{2l}\right)\ge 2C>C$, a contradiction.

1. 2.

$l>\frac{m}{2}$. Then ${x}_{2l-m}\in {\left[a,b\right]}_{m}$, and by reasoning analogous to case 1, we obtain a contradiction.

□

Now, we show that the implication converse to that from Observation 2.6 does not hold.

Example 2.8 We continue considerations from Example 2.4. Let $N=1$, $m=3$, $X=\left\{0,1,2,3\right\}$, $W=\left\{0,3\right\}$. Then ${\left[0,3\right]}_{m}=X$, and hence ${\left[0,3\right]}_{3}\not\subset W$. W is an X-midconvex set which is not X-fmidconvex. It shows also that an analogue of Theorem 2.7 for X-midconvex set does not hold.

Proposition 2.9 Let${W}_{2}\subset {W}_{1}\subset X$and let${W}_{1}$be X-fmidconvex and${W}_{2}$be${W}_{1}$-fmidconvex. Then${W}_{2}$is X-fmidconvex.

Proof There exist midconvex functions ${f}_{1}:X\to \mathbb{R}$, ${f}_{2}:{W}_{1}\to \mathbb{R}$ such that ${W}_{1}={f}_{1}^{-1}\left(\left(-\mathrm{\infty },0\right]\right)$ and ${W}_{2}={f}_{2}^{-1}\left(\left(-\mathrm{\infty },0\right]\right)$. Multiplying any of those functions by a positive real number, we do not destroy the above property. Therefore, we may assume that

$\underset{x\in {W}_{1}}{max}{f}_{2}\left(x\right)\le \frac{1}{2}\underset{x\in X\setminus {W}_{1}}{min}{f}_{1}\left(x\right).$
(1)

We define a function $f:X\to {\mathbb{R}}_{+}$ as follows:

Evidently, ${f}^{-1}\left(\left(-\mathrm{\infty },0\right]\right)={W}_{2}$. We have to prove yet that f is X-midconvex. Consider arbitrary ${x}_{1},{x}_{2}\in X$ such that $\frac{{x}_{1}+{x}_{2}}{2}\in X$. We distinguish five cases.

1o. ${x}_{1},{x}_{2}\in X\setminus {W}_{1}$, $\frac{{x}_{1}+{x}_{2}}{2}\in X\setminus {W}_{1}$. Then we have

$f\left(\frac{{x}_{1}+{x}_{2}}{2}\right)={f}_{1}\left(\frac{{x}_{1}+{x}_{2}}{2}\right)\le \frac{{f}_{1}\left({x}_{1}\right)+{f}_{1}\left({x}_{2}\right)}{2}=\frac{f\left({x}_{1}\right)+f\left({x}_{2}\right)}{2}.$

2o. ${x}_{1},{x}_{2}\in X\setminus {W}_{1}$, $\frac{{x}_{1}+{x}_{2}}{2}\in {W}_{1}$. Making use of (1), we get

$f\left(\frac{{x}_{1}+{x}_{2}}{2}\right)={f}_{2}\left(\frac{{x}_{1}+{x}_{2}}{2}\right)\le \frac{{f}_{1}\left(x\right)}{2}\le \frac{{f}_{1}\left({x}_{1}\right)+{f}_{1}\left({x}_{2}\right)}{2}=\frac{f\left({x}_{1}\right)+f\left({x}_{2}\right)}{2}.$

3o. ${x}_{1},{x}_{2}\in {W}_{1}$. By Observation 2.6, ${W}_{1}$ is X-midconvex and therefore $\frac{{x}_{1}+{x}_{2}}{2}\in {W}_{1}$. As a consequence, we have

$f\left(\frac{{x}_{1}+{x}_{2}}{2}\right)={f}_{2}\left(\frac{{x}_{1}+{x}_{2}}{2}\right)\le \frac{{f}_{2}\left({x}_{1}\right)+{f}_{2}\left({x}_{2}\right)}{2}=\frac{f\left({x}_{1}\right)+f\left({x}_{2}\right)}{2}.$

4o. ${x}_{1}\in X\setminus {W}_{1}$, ${x}_{2}\in {W}_{1}$, $\frac{{x}_{1}+{x}_{2}}{2}\in X\setminus {W}_{1}$. Then we have

$\begin{array}{rcl}f\left(\frac{{x}_{1}+{x}_{2}}{2}\right)& =& {f}_{1}\left(\frac{{x}_{1}+{x}_{2}}{2}\right)\le \frac{{f}_{1}\left({x}_{1}\right)+{f}_{1}\left({x}_{2}\right)}{2}\\ =& \frac{{f}_{1}\left({x}_{1}\right)}{2}=\frac{f\left({x}_{1}\right)}{2}=\frac{f\left({x}_{1}\right)+f\left({x}_{2}\right)}{2}.\end{array}$

5o. ${x}_{1}\in X\setminus {W}_{1}$, ${x}_{2}\in {W}_{1}$, $\frac{{x}_{1}+{x}_{2}}{2}\in {W}_{1}$. Applying (1), we get

$\begin{array}{rcl}f\left(\frac{{x}_{1}+{x}_{2}}{2}\right)& =& {f}_{2}\left(\frac{{x}_{1}+{x}_{2}}{2}\right)\le \frac{{f}_{1}\left({x}_{1}\right)}{2}\\ \le & \frac{{f}_{1}\left({x}_{1}\right)+{f}_{2}\left({x}_{2}\right)}{2}=\frac{f\left({x}_{1}\right)+f\left({x}_{2}\right)}{2}.\end{array}$

We have proved that f is X-midconvex. □

Now, we define an X-fmidconvex hull of a given set $A\subset X$. We begin with important remarks.

Proposition 2.10 Let${W}_{1}$, ${W}_{2}$be X-fmidconvex subsets of X. Then${W}_{1}\cap {W}_{2}$is X-fmidconvex.

Proof There exist midconvex functions ${f}_{1}:X\to \mathbb{R}$, ${f}_{2}:X\to \mathbb{R}$ such that ${W}_{1}={f}_{1}^{-1}\left(\left(-\mathrm{\infty },0\right]\right)$ and ${W}_{2}={f}_{2}^{-1}\left(\left(-\mathrm{\infty },0\right]\right)$. We define the function $f:X\to {\mathbb{R}}_{+}$ as follows:

By Proposition 2.3 f is X-midconvex. Furthermore, ${f}^{-1}\left(\left(-\mathrm{\infty },0\right]\right)={W}_{1}\cap {W}_{2}$. This finishes the proof. □

Proposition 2.11 Let${X}_{1}\subset {\mathbb{R}}^{{N}_{1}}$, ${X}_{2}\subset {\mathbb{R}}^{{N}_{2}}$be finite sets and let${W}_{1}\subset X$be${X}_{1}$-fmidconvex and${W}_{2}\subset {X}_{2}$be${X}_{2}$-fmidconvex. Then${W}_{1}×{W}_{2}$is$\left({X}_{1}×{X}_{2}\right)$-fmidconvex.

Proof There exist an ${X}_{1}$-midconvex function ${f}_{1}:{X}_{1}\to \mathbb{R}$ and an ${X}_{2}$-midconvex function ${f}_{2}:{X}_{2}\to \mathbb{R}$ such that We define the function $f:{X}_{1}×{X}_{2}\to \mathbb{R}$ as follows:

We are going to show that f is $\left({X}_{1}×{X}_{2}\right)$-midconvex and that

$\left\{\left(x,y\right)\in {X}_{1}×{X}_{2}:f\left(x,y\right)\le 0\right\}={W}_{1}×{W}_{2}.$

Consider arbitrary $\left({x}_{1},{x}_{2}\right),\left({y}_{1},{y}_{2}\right)\in {X}_{1}×{X}_{2}$ and assume that $\frac{\left({x}_{1},{x}_{2}\right)+\left({y}_{1},{y}_{2}\right)}{2}\in {X}_{1}×{X}_{2}$. Then $\frac{{x}_{1}+{y}_{1}}{2}\in {X}_{1}$, $\frac{{x}_{2}+{y}_{2}}{2}\in {X}_{2}$ and Whence we obtain

$\begin{array}{rcl}f\left(\frac{\left({x}_{1},{x}_{2}\right)+\left({y}_{1},{y}_{2}\right)}{2}\right)& =& max\left({f}_{1}\left(\frac{{x}_{1}+{y}_{1}}{2}\right),{f}_{2}\left(\frac{{x}_{2}+{y}_{2}}{2}\right)\right)\\ \le & max\left(\frac{{f}_{1}\left({x}_{1}\right)+{f}_{1}\left({y}_{1}\right)}{2},\frac{{f}_{2}\left({x}_{2}\right)+{f}_{2}\left({y}_{2}\right)}{2}\right)\\ \le & \frac{max\left({f}_{1}\left({x}_{1}\right),{f}_{2}\left({x}_{2}\right)\right)+max\left({f}_{1}\left({y}_{1}\right),{f}_{2}\left({y}_{2}\right)\right)}{2}\\ =& \frac{f\left({x}_{1},{x}_{2}\right)+f\left({y}_{1},{y}_{2}\right)}{2}.\end{array}$

It means that f is $\left({X}_{1}×{X}_{2}\right)$-midconvex. Furthermore, we have

$\begin{array}{rcl}\left\{\left(x,y\right)\in {X}_{1}×{X}_{2}:f\left(x,y\right)\le 0\right\}& =& \left\{\left(x,y\right)\in {X}_{1}×{X}_{2}:max\left({f}_{1}\left(x\right),{f}_{2}\left(y\right)\right)\le 0\right\}\\ =& \left\{\left(x,y\right)\in {X}_{1}×{X}_{2}:{f}_{1}\left(x\right)\le 0,{f}_{2}\left(y\right)\le 0\right\}\\ =& {W}_{1}×{W}_{2}.\end{array}$

□

We are going to define now an X-midconvex hull and an X-fmidconvex hull of a given set $A\subset X$. We follow the classical definition of a midconvex hull .

Definition 2.12 Let $A\subset X$.

The intersection of all X-midconvex sets containing A is called an X-midconvex hull of A and is denoted by ${mconv}_{X}\left(A\right)$.

The intersection of all X-fmidconvex sets containing A is called an X-fmidconvex hull of A and is denoted by ${fmconv}_{X}\left(A\right)$.

One can directly verify that ${mconv}_{X}\left(A\right)$ is X-midconvex. By Proposition 2.10, we obtain that the intersection of a finite family of X-fmidconvex sets is X-fmidconvex, and consequently, by the finiteness of X, we obtain that ${fmconv}_{X}\left(A\right)$ is X-fmidconvex. Consequently, the X-fmidconvex hull of A is the smallest X-fmidconvex set containing A.

The example below illustrates Definition 2.12 and shows that an X-midconvex hull and an X-fmidconvex hull of a given set are, in general, different.

Example 2.13 Let $N=2$, $X=\left\{\left(-1,0\right),\left(0,0\right),\left(0,1\right),\left(0,2\right),\left(1,-1\right),\left(1,0\right),\left(1,1\right),\left(2,1\right)\right\}$ (see Figure 1). Clearly, $W:=\left\{\left(-1,0\right),\left(0,2\right),\left(1,-1\right),\left(2,1\right)\right\}$ is X-midconvex. Hence, ${mconv}_{X}\left(W\right)=W$. One can show (it follows directly from the results of the next section) that ${fmconv}_{X}\left(W\right)=X$.

## 3 Extremal points

We begin with the definition of an extremal point.

Definition 3.1 Let $W\subset {\mathbb{R}}^{N}$. A point $a\in W$ is called an extremal point of W if

$\mathrm{\forall }u,v\in W:\frac{u+v}{2}=a\phantom{\rule{1em}{0ex}}⇒\phantom{\rule{1em}{0ex}}u=v=a.$

We denote the set of all extremal points of W by extW. As we know , by the Krein-Milman theorem, a compact convex set in ${\mathbb{R}}^{N}$ is the convex hull of its extremal points. However, its analogue does not hold for X-midconvexity-just consider $X=\left\{0,1,2,3\right\}$ which is not the X-midconvex hull of the set $W=\left\{0,3\right\}$ of its extremal points.

In this section, we prove a version of the classical Krein-Milman theorem for function midconvexity. We begin with the following observation.

Observation 3.2 If$W\subset {\mathbb{R}}^{N}$is nonempty and finite, then the$extW\ne \mathrm{\varnothing }$.

Proof Take a convex hull of W in ${\mathbb{R}}^{N}$. It is nonempty, convex and compact (because W is finite). Therefore,  it has an extremal point. □

We will need the notion of index.

Definition 3.3 Let $W\subset X$. We say that a sequence $\left({x}_{0},\dots ,{x}_{n}\right)\subset W$ is a J-chain of length n in W if either $n=0$ or $n\ge 1$ and

(2)

We call ${x}_{0}$ the beginning and ${x}_{n}$ the end of the J-chain.

Condition (2) means that ${x}_{k}$ is the middle of ${x}_{k-1}$ and a certain point in W (or, in another words, that the symmetric point to ${x}_{k-1}$ with respect to ${x}_{k}$ belongs to W).

Proposition 3.4 Let$\mathrm{\varnothing }\ne W\subset X$. Then for each$x\in W$, there exists a J-chain in W beginning in extW and ending at x.

Proof Fix arbitrarily $x\in W$ and denote by Z the set of points z of W such that there exists a J-chain in W beginning at z and ending at x. Obviously $x\in Z$, and hence $Z\ne \mathrm{\varnothing }$. By Observation 3.2, there exists $z\in extZ$. Let $\left({y}_{0},\dots ,{y}_{n}\right)$, ${y}_{0}=z$, ${y}_{n}=x$, be the J-chain with beginning at z and end at x.

We show that $z\in extW$. Suppose, for an indirect proof, that $z\notin extW$. Since $z\in W$, there exist $v,w\in W$, $v\ne w$ such that $z=\left(v+w\right)/2$. Clearly, $\left(v,{y}_{0},\dots ,{y}_{n}\right)$ and $\left(w,{y}_{0},\dots ,{y}_{n}\right)$ are J-chains starting at v and w, respectively, and with end at x. This implies that $v,w\in Z$, which contradicts the assumption that $z\in extZ$. □

Let $W\subset X$ be nonempty. By Observation 3.2, $extW\ne \mathrm{\varnothing }$. For $x\in W$ by ${i}_{W}\left(x\right)$, we denote the length of the shortest J-chain in W beginning in extW and ending at x. It follows from Proposition 3.4 that such a J-chain exists.

We also put

${i}_{W}:=\underset{x\in W}{sup}{i}_{W}\left(x\right).$

${i}_{W}\left(x\right)$ is called the index of x and ${i}_{W}$-the index of W.

Remark 3.5 It follows from the proof of Proposition 3.4 that if ${i}_{W}\left(x\right)=n$, where $n\in \mathbb{N}$, then there exists an element $\overline{x}\in W$ such that ${i}_{W}\left(\overline{x}\right)=n-1$. Therefore, if ${i}_{W}=n$, $n\in {\mathbb{N}}_{0}$, then for each $m\in \left\{0,\dots ,n\right\}$, we can find $x\in W$ such that ${i}_{W}\left(x\right)=m$. Hence, the set of indices of elements of W coincides with the set $\left\{0,\dots ,n\right\}$.

One can easily notice that ${i}_{W}\left(x\right)=0$ if and only if $x\in extW$.

We illustrate the above notations by a simple example.

Example 3.6 Let $N=2$, $W=X=\left\{\left(-1,-1\right),\left(-1,0\right),\left(-1,1\right),\left(0,0\right),\left(1,-1\right),\left(1,0\right),\left(1,1\right)\right\}$. One can easily notice (see Figure 2) that

$extX=\left\{\left(-1,-1\right),\left(-1,1\right),\left(1,-1\right),\left(1,1\right)\right\}.$

We have Proposition 3.7 We assume that$\mathrm{\varnothing }\ne W\subset X$. Then

${i}_{W}\le card\left(W\right)-card\left(extW\right).$

Proof

Let

Clearly, the sequence ${\left\{{W}_{k}\right\}}_{k\in {\mathbb{N}}_{0}}$ is ascending. Since W is finite, there exists a $k\in {\mathbb{N}}_{0}$ such that ${W}_{k}={W}_{k+1}$. Let k be the smallest integer with this property. Then

${W}_{0}⊊{W}_{1}⊊\cdots ⊊{W}_{k},$

and hence

$card\left({W}_{k}\right)\ge card\left({W}_{0}\right)+k=card\left(extW\right)+k,$

which implies that

$k\le card\left({W}_{k}\right)-card\left(extW\right).$

We are going to show that ${W}_{k}=W$, which will complete the proof. Suppose that this is not the case. Let $P:=W\setminus {W}_{k}$. Let p be an extremal point of P. We will prove that p is an extremal point of W. Suppose that it is not the case. Then there exist $q,r\in W$, $q\ne r$ such that

$p=\frac{q+r}{2}.$

Since p is an extremal point of P either $q\notin P$ or $r\notin P$. Assume that $q\notin P$. Then $q\in {W}_{k}$ and since $p+\left(p-q\right)=r\in W$, we obtain that $p\in {W}_{k+1}$. Hence, ${W}_{k+1}\ne {W}_{k}$, a contradiction. Thus p is an extremal point of W and hence $p\in {W}_{0}\subset {W}_{k}$, a contradiction. We have proved that ${W}_{k}=W$. □

Now, we prove the main result of this section.

Theorem 3.8 Let$\mathrm{\varnothing }\ne W\subset X$be an X-fmidconvex set. Then

$W={fmconv}_{X}\left(extW\right).$

Proof

Evidently, we have

${fmconv}_{X}\left(extW\right)\subset W.$

Suppose that

$W\setminus {fmconv}_{X}\left(extW\right)\ne \mathrm{\varnothing }.$
(3)

There exists a midconvex function $f:X\to {\mathbb{R}}_{+}$ such that

${f}^{-1}\left(\left(-\mathrm{\infty },0\right]\right)={fmconv}_{X}\left(extW\right).$

If follows from this equality and (3) that

$C:=max\left\{f\left(x\right):x\in W\right\}>0.$

Let $a\in W$ be such that $f\left(a\right)=C$ and that

${i}_{W}\left(a\right)=min\left\{{i}_{W}\left(x\right):x\in W,f\left(x\right)=C\right\}.$

By Propositions 3.4 and 3.7, there exists a finite J-chain in W starting in extW and ending at a. Let $\left({a}_{0},\dots ,{a}_{n}\right)$ be the shortest J-chain with these properties. Then $n\ge 1$, $2a-{a}_{n-1}\in W$ and since ${i}_{W}\left({a}_{n-1}\right)=n-1$, we have that $f\left({a}_{n-1}\right). By midconvexity of f, we obtain

$\begin{array}{rcl}C& =& f\left(a\right)=f\left(\frac{{a}_{n-1}+\left(2a-{a}_{n-1}\right)}{2}\right)\\ \le & \frac{f\left({a}_{n-1}\right)+f\left(2{a}_{n}-{a}_{n-1}\right)}{2}\le \frac{f\left({a}_{n-1}\right)}{2}+\frac{C}{2}

Theorem 3.9 Let$\mathrm{\varnothing }\ne W\subset X$. If$f:W\to \mathbb{R}$is X-midconvex, then the maximum of f is achieved at an extreme point of W.

Proof

Consider the case when

$W\setminus extW\ne \mathrm{\varnothing }$

and denote

$C:=max\left\{f\left(x\right):x\in W\right\}.$

For an indirect proof, suppose that

Since ${i}_{W}\left(x\right)=0$ iff $x\in extW$, we have then

$min\left\{{i}_{W}\left(x\right):f\left(x\right)=C\right\}>0.$

We can find an $a\in W\setminus extW$ such that

$f\left(a\right)=C\phantom{\rule{1em}{0ex}}\text{and}\phantom{\rule{1em}{0ex}}{i}_{W}\left(a\right)=min\left\{{i}_{W}\left(x\right):f\left(x\right)=C\right\}.$

We choose the shortest J-chain $\left({a}_{0},\dots ,{a}_{n}=a\right)$ in W starting in extW and ending at a. Then $2a-{a}_{n-1}\in W$ and since ${i}_{W}\left({a}_{n-1}\right)=n-1$, we have that $f\left({a}_{n-1}\right). By midconvexity of f, we obtain now

$\begin{array}{rcl}C& =& f\left(a\right)=f\left(\frac{{a}_{n-1}+\left(2a-{a}_{n-1}\right)}{2}\right)\\ \le & \frac{f\left({a}_{n-1}\right)+f\left(2{a}_{n}-{a}_{n-1}\right)}{2}\le \frac{f\left({a}_{n-1}\right)}{2}+\frac{C}{2}

## 4 Construction of X-fmidconvex hull

There is a problem to find a convenient procedure to determinate an X-fmidconvex hull for a given set $W\subset X$. In this section, we present an algorithm for finding ${fmconv}_{X}\left(W\right)$, which can be easily implemented in high level programming languages.

Proposition 4.1 Let$\mathrm{\varnothing }\ne W\subset X$and$\overline{x}\in X$. The following conditions are equivalent:

1. 1.

$\overline{x}\notin {fmconv}_{X}\left(W\right)$,

2. 2.

there exists an X-midconvex function$f:X\to \mathbb{R}$such that$f{|}_{W}\equiv 0$and$f\left(\overline{x}\right)=1$.

Proof Observe first that multiplying a midconvex function by a positive real number, we do not destroy midconvexity.

We show that (2) (1). Let $f:X\to \mathbb{R}$ be an X-midconvex function such that $f{|}_{W}\equiv 0$ and $f\left(\overline{x}\right)=1$. We put

${W}_{1}:=\left\{x\in X:f\left(x\right)\le 0\right\}.$

Then $W\subset {W}_{1}$, $\overline{x}\notin {W}_{1}$ and ${W}_{1}$ is X-fmidconvex. By Proposition 2.10 we obtain that ${W}_{1}\cap {fmconv}_{X}\left(W\right)$ is X-fmidconvex. It follows from Definition 2.12 that ${fmconv}_{X}\left(W\right)\subset {W}_{1}$. Thus $\overline{x}\notin {fmconv}_{X}\left(W\right)$.

For the proof of the converse implication, assume that $\overline{x}\notin {fmconv}_{X}\left(W\right)$. As we have noticed directly after Definition 2.12 ${fmconv}_{X}\left(W\right)$ is X-fmidconvex. Hence, there exists an X-midconvex function $g:X\to \mathbb{R}$ such that

${fmconv}_{X}\left(W\right)=\left\{x\in X:g\left(x\right)\le 0\right\}.$

Then $g\left(\overline{x}\right)>0$. We put By Proposition 2.3 f is X-midconvex. Furthermore, we have

and $f\left(\overline{x}\right)=1$. □

Two examples of X-fmidconvex hull are presented in Figure 3. X consists of all dots, W consists of big black dots, an X-fmidconvex hull of W is represented by big dots. Notice that $extW=W$.

Proposition 4.1 gives the way to determine ${fmconv}_{X}\left(A\right)$. Namely, by condition (2) we can eliminate from X, step by step, elements of the set $X\setminus {fmconv}_{X}\left(A\right)$.

To encode the result included in Proposition 4.1, we introduce some additional notations. Let $X=\left\{{x}_{1},\dots ,{x}_{n}\right\}$. Let $W\subset X$ be fixed. Without loss of generality, we may assume that the elements $\left\{{x}_{1},\dots ,{x}_{n}\right\}$ are ordered in such a way that

$\left\{{x}_{1},\dots ,{x}_{n-cardW}\right\}=X\setminus W\phantom{\rule{1em}{0ex}}\text{and}\phantom{\rule{1em}{0ex}}\left\{{x}_{n-cardW+1},\dots ,{x}_{n}\right\}=W.$
(4)

We denote

Observe that $m:=cardK\left(X\right)$ is finite as $m\le {n}^{2}$.

Let us now fix $v\in X$. We want to check if there exists an X-midconvex function $f:X\to \mathbb{R}$ such that $f{|}_{W}\equiv 0$ and $f\left(v\right)=1$.

Such a function f has to fulfill the following condition:

(5)

We enumerate the elements of $K\left(X\right)$ and write $K\left(X\right)$ in the form

$K\left(X\right)={\left\{\left({y}^{k},{z}^{k}\right)\right\}}_{k\in \left\{1,\dots ,m\right\}}.$

Proposition 4.2 Let$f:X\to \mathbb{R}$, and let$y:={\left[f\left({x}_{1}\right),\dots ,f\left({x}_{n}\right)\right]}^{T}$. We put

${A}_{f}:={\left[{a}_{ij}\right]}_{i=1,\dots ,m;j=1,\dots ,n}\in {M}_{m×n},$

where

${a}_{ij}=\left\{\begin{array}{cc}1,\hfill & \mathit{\text{if}}\phantom{\rule{0.25em}{0ex}}{x}_{j}=\frac{{y}^{i}+{z}^{i}}{2},\hfill \\ -\frac{1}{2},\hfill & \mathit{\text{if}}\phantom{\rule{0.25em}{0ex}}{x}_{j}={y}^{i}\phantom{\rule{0.25em}{0ex}}\mathit{\text{or}}\phantom{\rule{0.25em}{0ex}}{x}_{j}={z}^{i},\hfill \\ 0,\hfill & \mathit{\text{otherwise}},\hfill \end{array}$

and$\left({y}^{i},{z}^{i}\right)\in K\left(X\right)$, $i\in \left\{1,\dots ,m\right\}$.

Then f is midconvex iff

${A}_{f}y\le {\mathbf{0}}_{m},$
(6)

where${\mathbf{0}}_{m}$denotes zero in${\mathbb{R}}^{m}$ (we will often omit the subscript m and write 0).

Proof Observe that the system of inequalities (5) is equivalent to the following one:

$\left\{\begin{array}{c}f\left(\frac{{y}^{1}+{z}^{1}}{2}\right)-\frac{1}{2}f\left({y}^{1}\right)-\frac{1}{2}f\left({z}^{1}\right)\le 0,\hfill \\ ⋮\hfill \\ f\left(\frac{{y}^{m}+{z}^{m}}{2}\right)-\frac{1}{2}f\left({y}^{m}\right)-\frac{1}{2}f\left({z}^{m}\right)\le 0\hfill \end{array}$
(7)

for all $\left({y}^{i},{z}^{i}\right)\in K\left(X\right)$, $i\in \left\{1,\dots ,m\right\}$.

Let us now fix $i\in \left\{1,\dots ,m\right\}$ and consider the inequality corresponding to the i th element of $K\left(X\right)$ (the i th inequality of system (7))

$f\left(\frac{{y}^{i}+{z}^{i}}{2}\right)-\frac{1}{2}f\left({y}^{i}\right)-\frac{1}{2}f\left({z}^{i}\right)\le 0.$

It is equivalent to the following one:

$\left[{a}_{i1},\dots ,{a}_{in}\right]\left[\begin{array}{c}f\left({x}_{1}\right)\\ ⋮\\ f\left({x}_{n}\right)\end{array}\right]\le 0,$

where ${\left[{a}_{ij}\right]}_{j=1,\dots ,n}$ is the i th row of the matrix ${A}_{f}$. This finishes the proof. □

Remark 4.3 To save time and memory in practical implementation, in Proposition 4.2 we take into account only one of the pairs $\left(y,z\right)$ and $\left(z,y\right)$, since the inequalities $f\left(\frac{y+z}{2}\right)\le \frac{f\left(y\right)+f\left(z\right)}{2}$ and $f\left(\frac{z+y}{2}\right)\le \frac{f\left(z\right)+f\left(y\right)}{2}$ are equivalent.

Proposition 4.4 Let$f:X\to \mathbb{R}$be such that$f{|}_{W}\equiv 0$. Let${A}_{f}$be a matrix defined in Proposition 4.2. We put

${A}_{W}:={\left[{A}_{f}\right]}_{i=1,\dots ,m;j=1,\dots ,n-cardW},\phantom{\rule{2em}{0ex}}{y}_{W}:={\left[f\left({x}_{1}\right),\dots ,f\left({x}_{n-cardW}\right)\right]}^{T}.$

Then the following conditions are equivalent:

1. 1.

f is midconvex,

2. 2.

${A}_{W}{y}_{W}\le \mathbf{0}$.

Proof Let ${A}_{f}={\left[{A}_{f}^{i}\right]}_{i=1,\dots ,n}$, where ${A}_{f}^{i}$ denotes the i th column of the matrix ${A}_{f}$. Then the matrix ${A}_{f}$ can be represented as the following block matrix:

${A}_{f}=\left[{A}_{W}B\right],$

where $B:={\left[{A}_{f}^{i}\right]}_{i=n-cardW+1,\dots ,n}\in {M}_{m×cardW}$.

Now, we use condition (4). By the condition $f{|}_{W}\equiv 0$, we have that $f\left({x}_{i}\right)=0$ for ${x}_{i}\in X$, $i\in \left\{n-cardW+1,\dots ,n\right\}$. Thus

$y={\left[f\left({x}_{1}\right),\dots ,f\left({x}_{n-cardW}\right),0,\dots ,0\right]}^{T},$

which can be written as the following block vector:

$y=\left[\begin{array}{c}{y}_{W}\\ {\mathbf{0}}_{cardW}\end{array}\right].$

By Proposition 4.2, f is midconvex iff ${A}_{f}y\le \mathbf{0}$, which is equivalent in our situation to the following inequality:

$\left[{A}_{W}B\right]\left[\begin{array}{c}{y}_{W}\\ {\mathbf{0}}_{cardW}\end{array}\right]\le {\mathbf{0}}_{m}.$

The above inequality is equivalent to the following one:

${A}_{W}{y}_{W}+B{\mathbf{0}}_{cardW}\le {\mathbf{0}}_{m}.$

This completes the proof since $B{\mathbf{0}}_{cardW}={\mathbf{0}}_{m}$. □

We illustrate the above considerations by a simple example.

Example 4.5 Let $N=1$, $X=\left\{0,1,2,3,4\right\}$, $W=\left\{0,3\right\}$. Then $K\left(X\right)=\left\{\left(0,2\right),\left(1,3\right),\left(2,0\right),\left(3,1\right)\right\}$. In this case, the system of linear inequalities (6) contains the following objects: If we additionally want to consider only functions such that $f{|}_{W}\equiv 0$, we have to remove the two last columns and consider the solutions of ${A}_{W}{y}_{W}\le \mathbf{0}$ for ${y}_{W}={\left[f\left(1\right),f\left(2\right),f\left(4\right)\right]}^{T}$ and

${A}_{W}=\left[\begin{array}{ccc}1& -1/2& 0\\ -1/2& 1& 0\\ 1& -1/2& 0\\ -1/2& 1& 0\end{array}\right]\in {M}_{4×3}.$

Making use of Remark 4.3, we may replace the matrix ${A}_{W}$ by

${A}_{W}=\left[\begin{array}{ccc}1& -1/2& 0\\ -1/2& 1& 0\end{array}\right]\in {M}_{2×3}.$

Further discussion of this example can be found in Example 4.6.

The main question is still unanswered: Does there exist an X-midconvex function $f:X\to \mathbb{R}$ such that $f{|}_{W}\equiv 0$ and $f\left(v\right)=1$? To answer this question we use linear programming (shortly LP), which is an efficient technique for finding a solution of optimization problems: to minimize or maximize a linear objective function subject to linear equality/inequality constrains . It can be expressed in a canonical form:

where y represents the vector of variables (to be determined). In our case $b=\mathbf{0}$. The system of inequalities $Ax\le b$ denotes the constraints which specify a convex polygon, over which the objective function is to be optimized.

We still need to ‘insert’ additional information that $f\left(v\right)=1$ (which is equivalent to $f\left(v\right)>0$, as we can divide f by $f\left(v\right)$). In other words, we ask if we can find a function satisfying the previously defined systems of inequalities and such that $f\left(v\right)>0$. To do this, we put $c:={\left[0,\dots ,\underset{i}{\underset{⏟}{1}},\dots ,0\right]}^{T}$, where $i\in \left\{1,\dots ,n\right\}$ is such that $v={x}_{i}$, ${x}_{i}\in X$ (according to (4)), and find a solution to the system of inequalities defined above.

Now, we are ready to present a full algorithm for finding an X-fmidconvex hull of $W\subset X$: Example 4.6

We will continue the discussion of Example 4.5. By the previous considerations, we have the following LP problem:

Firstly, we check if 1 is in the X-fmidconvex hull of the set W. We put $c={\left[1,0,0\right]}^{T}$. It is easy to get the following solution: $f\left(1\right)=0$, $f\left(2\right)=0$ and $f\left(4\right)=a$, $a\in \mathbb{R}$, $a\ge 0$ (this means that $f\left(4\right)$ can be arbitrary, e.g., $f\left(4\right)=0$) this solution is bounded, so $1\in {fmconv}_{X}\left(W\right)$. The same consideration shows that also $2\in {fmconv}_{X}\left(W\right)$. On the contrary, for 4 the value $f\left(4\right)$ is unbounded so $4\notin {fmconv}_{X}\left(W\right)$. Finally, we obtain that ${fmconv}_{X}\left(W\right)=\left\{0,1,2,3\right\}$.

There are many methods for solving LP (checking whether a solution exists is just as difficult as finding a solution): simplex algorithm of Dantzig , criss-cross algorithm , projective algorithm of Karmarkar , etc.

However, the method for finding an X-fmidconvex hull presented in this section is not sufficiently efficient in practice because for each point of investigated space X, we solve LP. Moreover, if we use a classical simplex method, we can perform really badly since the worst-case complexity of the simplex method has exponential time.

Sample implementation of the algorithm described in this section with nice graphical interface prepared in Java programming language is available at http://www.ii.uj.edu.pl/~misztalk.

## References

1. Murota K 10. In Discrete Convex Analysis. SIAM, Philadelphia; 2003.

2. Jarczyk W, Laczkovich M: Convexity on Abelian groups. J. Convex Anal. 2009, 16: 33–48.

3. Van de Vel M 50. In Theory of Convex Structures. North-Holland, Amsterdam; 1993.

4. Kuczma M, Gilányi A: An Introduction to the Theory of Functional Equations and Inequalities: Cauchy’s Equation and Jensen’s Inequality. PWN, Warsaw; 2009.

5. Tabor J, Tabor J: Generalized approximate midconvexity. Control Cybern. 2009, 38(3):655–669.

6. Rockafellar R 28. In Convex Analysis. Princeton University Press, Princeton; 1997.

7. Luenberger DG, Ye Y 36. In Linear and Nonlinear Programming. Springer, Berlin; 2008.

8. Dantzig GB: Maximization of a Linear Function of Variables Subject to Linear Inequalities. Wiley, New York; 1951:339–347.

9. Fukuda K, Terlaky T: Criss-cross methods: a fresh view on pivot algorithms. Math. Program. 1997, 79: 369–395.

10. Adler I, Resende M, Veiga G, Karmarkar N: An implementation of Karmarkar’s algorithm for linear programming. Math. Program. 1989, 44: 297–335. 10.1007/BF01587095

## Acknowledgements

The first author was supported by National Centre of Science (Poland) Grant No. 2011/01/B/ST6/01887.

## Author information

Authors

### Corresponding author

Correspondence to Krzysztof Misztal.

### Competing interests

The authors declare that they have no competing interests.

### Authors’ contributions

JaT carried out the conception studies, participated in the theorems proving and drafted the manuscript. JóT participated in its design and coordination. KM performed the algorithm implementation and description. All authors read and approved the final manuscript.

## Authors’ original submitted files for images

Below are the links to the authors’ original submitted files for images.

## Rights and permissions

Reprints and Permissions

Tabor, J., Tabor, J. & Misztal, K. Midconvexity for finite sets. J Inequal Appl 2013, 42 (2013). https://doi.org/10.1186/1029-242X-2013-42 