Convex spaces #
This file defines convex spaces as an algebraic structure supporting finite convex combinations.
Main definitions #
Convexity.StdSimplex R M: A finitely supported probability distribution over elements ofMwith coefficients inR. The weights are non-negative and sum to 1.Convexity.StdSimplex.map: Map a function over the support of a standard simplex.Convexity.ConvexSpace R M: A typeclass for spacesMequipped with an operationConvexity.sConvexComb : StdSimplex R M → Msatisfying monadic laws.Convexity.iConvexComb: Indexed convex combination operator.Convexity.convexCombPair: 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.
A finitely supported probability distribution over elements of M with coefficients in R.
The weights are non-negative and sum to 1.
The weights of the
StdSimplexas aFinsupp.All weights are non-negative.
The weights sum to 1.
Instances For
Alias of the forward direction of Convexity.StdSimplex.weights_inj.
The point mass distribution concentrated at x.
Equations
- Convexity.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
- Convexity.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
- Convexity.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.
Use ConvexSpace.sConvexComb instead.
Equations
Instances For
Project an element of the standard simplex to a lower-dimensional standard simplex, assuming at least one non-zero weight subsists.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A set equipped with an operation of finite convex combinations, where the coefficients must be non-negative and sum to 1.
- mk' :: (
- sConvexComb (f : StdSimplex R M) : M
Take a convex combination with the given probability distribution over points.
A convex combination of a single point is that point.
- assoc (f : StdSimplex R (StdSimplex R M)) : sConvexComb (StdSimplex.map sConvexComb f) = sConvexComb f.join
Associativity of convex combination (monadic join law).
Use
sConvexComb_sConvexCombinstead. - )
Instances
Alias of Convexity.ConvexSpace.sConvexComb.
Take a convex combination with the given probability distribution over points.
Instances For
Alias of Convexity.ConvexSpace.sConvexComb_single.
A convex combination of a single point is that point.
Take a convex combination with the given weight distribution of an indexed family of points.
Equations
Instances For
Take a convex combination of two points.
Equations
- Convexity.convexCombPair s t hs ht hst x y = Convexity.sConvexComb (Convexity.StdSimplex.duple x y hs ht hst)
Instances For
Alias of Convexity.convexCombPair.
Take a convex combination of two points.
Equations
Instances For
Equations
- Convexity.StdSimplex.instConvexSpace = { sConvexComb := fun (σ : Convexity.StdSimplex R (Convexity.StdSimplex R I)) => σ.join, sConvexComb_single := ⋯, assoc := ⋯ }
The public constructor for ConvexSpace.
Equations
- Convexity.ConvexSpace.mk sConvexComb single assoc = { sConvexComb := sConvexComb, sConvexComb_single := single, assoc := assoc }
Instances For
A map between convex spaces is affine if it preserves convex combinations.
TODO: Show that this generalises affine maps between affine spaces, see AffineMap.
Instances For
Flattening nested iConvexCombs.
See iConvexComb_assoc' and iConvexComb_assoc for non-dependent versions.
Flattening nested iConvexCombs.
See iConvexComb_assoc'' for a more dependent version, and iConvexComb_assoc
for a less dependent one.
Flattening nested iConvexCombs.
See iConvexComb_assoc', iConvexComb_assoc'' for more dependent versions.
A binary convex combination with weight 0 on the first point returns the second point.
Alias of Convexity.convexCombPair_zero.
A binary convex combination with weight 0 on the first point returns the second point.
A binary convex combination with weight 1 on the first point returns the first point.
Alias of Convexity.convexCombPair_one.
A binary convex combination with weight 1 on the first point returns the first point.
A convex combination of a point with itself is that point.
Alias of Convexity.convexCombPair_same.
A convex combination of a point with itself is that point.
Flattening with the outer combination specialized to convexCombPair.
Flattening with the inner combination specialized to convexCombPair.
Flattening nested binary convex combination into a single convex combination.
Flattening nested binary convex combination into a single convex combination.