Let XX be a (typically over R\mathbb{R}). A set Ω⊂X\Omega\subset X is convex if for all x,y∈Ωx,y\in\Omega and all λ∈[0,1]\lambda\in[0,1] we have

λx+(1−λ)y∈Ω.\lambda x+(1-\lambda)y\in \Omega.

Context. Equivalently, Ω\Omega is convex iff it contains every joining any two of its points. Convexity is the core geometric notion underlying convex analysis and optimization.

Examples
  • Any affine subspace of Rn\mathbb{R}^n (e.g., a line or plane) is convex.
  • Any ball {x:∥x−x0∥≤r}\{x:\|x-x_0\|\le r\} in a normed space is convex.
  • A halfspace {x∈Rn:⟨a,x⟩≤b}\{x\in\mathbb{R}^n:\langle a,x\rangle\le b\} is convex.
  • The annulus {x∈R2:1<∥x∥<2}\{x\in\mathbb{R}^2:1<\|x\|<2\} is not convex: a segment between two points may pass through the "hole."