Convex spaces #
This file defines convex spaces as an algebraic structure supporting finite convex combinations.
Main definitions #
Convexity.StdSimplex R X: A finitely supported probability distribution over elements ofXwith 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 X: A typeclass for spacesXequipped with an operationConvexity.sConvexComb : StdSimplex R X → Xsatisfying monadic laws.Convexity.iConvexComb: Indexed convex combination operator.Convexity.convexCombPair: Binary convex combinations of two points.Convexity.IsConvexCombComm R S X: A typeclass for theR-convex andS-convex space structures onXto commute.
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.
The space of nonnegative functions X → R which take finitely many non-zero values summing
to 1.
One can interpret this as the standard simplex in R^⊕X (R^X for finite X), with the embedding
being the map weights : StdSimplex R X → R^⊕X.
Note in particular that, in the common case where X := M is a R-module, StdSimplex R M is NOT
the standard simplex in M. Indeed, the notion of a standard simplex depends on a choice of basis,
and M isn't given one.
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
Equations
Equations
- Convexity.StdSimplex.instUnique = { toInhabited := Convexity.StdSimplex.instInhabited, uniq := ⋯ }
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 : Y, the weight is the sum of weights of all m : X with g m = n.
Equations
- Convexity.StdSimplex.map g f = { weights := Finsupp.mapDomain g f.weights, nonneg := ⋯, total := ⋯ }
Instances For
The bijection between the one dimensional standard simplex
and the interval [0, 1].
Equations
- One or more equations did not get rendered due to their size.
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 X) : X
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 X)) : 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.
Note that this generalises the notion of affine maps between affine spaces.
See AffineMap.isAffineMap for one direction.
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.
IsConvexCombComm R S X indicates that the R-convex and S-convex space structures on X
commute, namely for R-convex combinations to be S-affine.
This is the convex space analogue of SMulCommClass.
- iConvexComb_comm' {n : ℕ} (f : StdSimplex R (Fin n → X)) (g : StdSimplex S (Fin n)) : (iConvexComb f fun (e : Fin n → X) => iConvexComb g e) = iConvexComb g fun (i : Fin n) => iConvexComb f fun (x : Fin n → X) => x i
R-convex combinations commute withS-convex combinations ofFin n-indexed families.This is stated for
Fin nso that the class does not depend on an extra universe parameter. UseConvexity.iConvexComb_comminstead, which works for arbitrary index types.
Instances
R-convex combinations commute with S-convex combinations.
Commutativity of convex combinations is a symmetric relation.
This is not an instance as it would cause loops.
When R is commutative, so are its convex combinations.
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.