Documentation

Mathlib.LinearAlgebra.ConvexSpace

Convex spaces #

This file defines convex spaces as an algebraic structure supporting finite convex combinations.

Main definitions #

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 #

structure StdSimplex (R : Type u) [LE R] [AddCommMonoid R] [One R] (M : Type v) extends M →₀ R :
Type (max u v)

A finitely supported probability distribution over elements of M with coefficients in R. The weights are non-negative and sum to 1.

Instances For
    theorem StdSimplex.ext {R : Type u} [PartialOrder R] [Semiring R] {M : Type v} {f g : StdSimplex R M} (h : f.weights = g.weights) :
    f = g
    theorem StdSimplex.ext_iff {R : Type u} [PartialOrder R] [Semiring R] {M : Type v} {f g : StdSimplex R M} :
    def StdSimplex.single {R : Type u} [PartialOrder R] [Semiring R] {M : Type v} [IsStrictOrderedRing R] (x : M) :

    The point mass distribution concentrated at x.

    Equations
    Instances For
      @[simp]
      theorem StdSimplex.mk_single {R : Type u} [PartialOrder R] [Semiring R] {M : Type v} [IsStrictOrderedRing R] (x : M) {nonneg : 0 Finsupp.single x 1} {total : ((Finsupp.single x 1).sum fun (x : M) (r : R) => r) = 1} :
      { weights := Finsupp.single x 1, nonneg := nonneg, total := total } = single x
      def StdSimplex.duple {R : Type u} [PartialOrder R] [Semiring R] {M : Type v} [IsStrictOrderedRing R] (x y : M) {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) :

      A probability distribution with weight s on x and weight t on y.

      Equations
      Instances For
        def StdSimplex.map {R : Type u} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] {M : Type v} {N : Type w} (g : MN) (f : StdSimplex R M) :

        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
        Instances For

          Join operation for standard simplices (monadic join). Given a distribution over distributions, flattens it to a single distribution.

          Equations
          Instances For
            class ConvexSpace (R : Type u) (M : Type v) [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] :
            Type (max u v)

            A set equipped with an operation of finite convex combinations, where the coefficients must be non-negative and sum to 1.

            Instances
              def convexComboPair {R : Type u_1} {M : Type u_2} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (s t : R) (hs : 0 s) (ht : 0 t) (h : s + t = 1) (x y : M) :
              M

              Take a convex combination of two points.

              Equations
              Instances For
                theorem convexComboPair_zero {R : Type u_2} {M : Type u_1} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {x y : M} :
                convexComboPair 0 1 x y = y

                A binary convex combination with weight 0 on the first point returns the second point.

                theorem convexComboPair_one {R : Type u_2} {M : Type u_1} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {x y : M} :
                convexComboPair 1 0 x y = x

                A binary convex combination with weight 1 on the first point returns the first point.

                theorem convexComboPair_same {R : Type u_1} {M : Type u_2} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) {x : M} :
                convexComboPair s t hs ht h x x = x

                A convex combination of a point with itself is that point.