  We introduce a new and extensive theory of noncommutative convexity along
with a corresponding theory of noncommutative functions. We establish
noncommutative analogues of the fundamental results from classical convexity
theory, and apply these ideas to develop a noncommutative Choquet theory that
generalizes much of classical Choquet theory.
  The central objects of interest in noncommutative convexity are
noncommutative convex sets. The category of compact noncommutative sets is dual
to the category of operator systems, and there is a robust notion of extreme
point for a noncommutative convex set that is dual to Arveson's notion of
boundary representation for an operator system.
  We identify the C*-algebra of continuous noncommutative functions on a
compact noncommutative convex set as the maximal C*-algebra of the operator
system of continuous noncommutative affine functions on the set. In the
noncommutative setting, unital completely positive maps on this C*-algebra play
the role of representing measures in the classical setting.
  The continuous convex noncommutative functions determine an order on the set
of unital completely positive maps that is analogous to the classical Choquet
order on probability measures. We characterize this order in terms of the
extensions and dilations of the maps, providing a powerful new perspective on
the structure of completely positive maps on operator systems.
  Finally, we establish a noncommutative generalization of the
Choquet-Bishop-de Leeuw theorem asserting that every point in a compact
noncommutative convex set has a representing map that is supported on the
extreme boundary. In the separable case, we obtain a corresponding integral
representation theorem.
