Convex spaces #
This file defines convex spaces as an algebraic structure supporting finite convex combinations.
Main definitions #
StdSimplex R M: A finitely supported probability distribution over elements ofMwith coefficients inR. The weights are non-negative and sum to 1.StdSimplex.map: Map a function over the support of a standard simplex.StdSimplex.join: Monadic join operation for standard simplices.ConvexSpace R M: A typeclass for spacesMequipped with an operationconvexCombination : StdSimplex R M → Msatisfying monadic laws.convexComboPair: Binary convex combinations of two points.
Design #
The design follows a monadic structure where StdSimplex R forms a monad and convexCombination
is a monadic algebra. This eliminates the need for explicit extensionality axioms and resolves
universe issues with indexed families.
TODO #
- Show that an
AffineSpaceis aConvexSpace. - Show that
lineMapagrees withconvexComboPairwhere defined. - Show the usual associativity law for binary convex combinations follows from the
assocaxiom.
A finitely supported probability distribution over elements of M with coefficients in R.
The weights are non-negative and sum to 1.
- toFun : M → R
All weights are non-negative.
The weights sum to 1.
Instances For
The point mass distribution concentrated at x.
Equations
- StdSimplex.single x = { weights := Finsupp.single x 1, nonneg := ⋯, total := ⋯ }
Instances For
A probability distribution with weight s on x and weight t on y.
Equations
- StdSimplex.duple x y hs ht h = { weights := Finsupp.single x s + Finsupp.single y t, nonneg := ⋯, total := ⋯ }
Instances For
Map a function over the support of a standard simplex. For each n : N, the weight is the sum of weights of all m : M with g m = n.
Equations
- StdSimplex.map g f = { weights := Finsupp.mapDomain g f.weights, nonneg := ⋯, total := ⋯ }
Instances For
Join operation for standard simplices (monadic join). Given a distribution over distributions, flattens it to a single distribution.
Equations
Instances For
A set equipped with an operation of finite convex combinations, where the coefficients must be non-negative and sum to 1.
- convexCombination (f : StdSimplex R M) : M
Take a convex combination with the given probability distribution over points.
- assoc (f : StdSimplex R (StdSimplex R M)) : convexCombination (StdSimplex.map convexCombination f) = convexCombination f.join
Associativity of convex combination (monadic join law).
A convex combination of a single point is that point.
Instances
Take a convex combination of two points.
Equations
- convexComboPair s t hs ht h x y = ConvexSpace.convexCombination (StdSimplex.duple x y hs ht h)