  The data of a physical experiment can be represented as a presheaf of
probability distributions. A striking feature of quantum theory is that those
probability distributions obtained in quantum mechanical experiments do not
always admit a joint probability distribution, a celebrated observation due to
Bell. Such distributions are called contextual. Simplicial distributions are
combinatorial models that extend presheaves of probability distributions by
elevating sets of measurements and outcomes to spaces. Contextuality can be
defined in this generalized setting. This paper introduces the notion of convex
categories to study simplicial distributions from a categorical perspective.
Simplicial distributions can be given the structure of a convex monoid, a
convex category with a single object, when the outcome space has the structure
of a group. We describe contextuality as a monoid-theoretic notion by
introducing a weak version of invertibility for monoids. Our main result is
that a simplicial distribution is noncontextual if and only if it is weakly
invertible. Similarly, strong contextuality and contextual fraction can be
characterized in terms of invertibility in monoids. Finally, we show that
simplicial homotopy can be used to detect extremal simplicial distributions
refining the earlier methods based on Cech cohomology and the cohomology of
groups.
