We generalize convex sets to arbitrary vector spaces.
Suppose $V$ is a vector space over the real field $\R $. A set $C \subset V$ is convex if it contains the closed line segment between every pair of distinct points.
In other words, a set $C \subset V$ is convex
if
\[
\lambda x + (1-\lambda )y \in C \quad \text{for all } x, y
\in C \text{ and } \lambda \in [0,1].
\]