An object is convex if any point lying directly between two points of the object is also in the object. For example, a solid cube is convex, but anything that is hollow or has a dent in it is not convex.
In mathematics, convexity can be defined for subsets of any real or complex vector space. Such a subset C is said to be convex if, for all x and y in C and all t in the interval [0,1], the point tx + (1-t)y is in C.
The convex subsets of R (the set of real numbers) are simply the intervals of R. Some examples of convex subsets of Euclidean 3-space are the Archimedean solids and the Platonic solids. The Kepler solids are examples of non-convex sets.
The intersection of any collection of convex sets is itself convex, so the convex subsets of a (real or complex) vector space form a complete lattice. This also means that any subset A of the vector space is contained within a smallest convex set (called the convex hull of A), namely the intersection of all convex sets containing A.
A real-valued function f defined on an interval (or on any convex set) is called convex if for any two points x and y in its domain and any t in [0,1], we have
- f(tx + (1-t)y) ≤ t f(x) + (1-t) f(y).
A convex function defined on some interval is continuous on the whole interval and differentiable at all but at most countably many points. A twice differentiable function is convex on an interval if and only if its second derivative is non-negative there.