OUTLINE

Introduction
The setting: a vector space over a field with a partial order
A Convex set is the same as an order-convex set
A convex function defined in terms of a convex set
A convex function in terms of order-convexity
Convex sets and convex functions in machine learning

Convex Optimization
Software Libraries

SUMMARY: We define a convex set in a general framework of a vector space over a field with a partial order, and we show how the general notion is related to the usual notion of a convex set. Then we define a convex function in terms of that general notion of a convex set, and we show a standard convex optimization result is true in this general setting. Finally, we mention how convex sets and convex functions are used in machine learning.

Introduction
Convex sets are thought of as subsets of $\mathbb{R}^{n}$, with $n$ a nonnegative integer, and convex functions as real-valued functions on convex subsets of $\mathbb{R}^{n}$. For instance, see this paper, p. 11 and this one. We'll show you that convex sets and convex functions can be seen in a more general framework.
The setting: a vector space over a field with a partial order
To give you a hint of where we're going, we'll start by defining an $\textbf{order-convex}$ subset $S$ of any set $X$ with a reflexive and transitive order $\leq$ as a set such that for all $x,y$ in $S$ and any $z$ in $X$, $x\leq z\leq y$ implies $z$ is in $S$, and let $V$ be an...