Documentation

Mathlib.Geometry.Convex.ConvexSpace.Defs

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.

structure Convexity.StdSimplex (R : Type u) [LE R] [AddCommMonoid R] [One R] (M : Type v) :
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
    @[simp]
    theorem Convexity.StdSimplex.weights_nonneg {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} {w : StdSimplex R M} (i : M) :
    0 w.weights i
    @[simp]
    @[simp]
    theorem Convexity.StdSimplex.weights_inj {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} {f g : StdSimplex R M} :
    theorem Convexity.StdSimplex.ext {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} {f g : StdSimplex R M} :
    f.weights = g.weightsf = g

    Alias of the forward direction of Convexity.StdSimplex.weights_inj.

    theorem Convexity.StdSimplex.ext_iff {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} {f g : StdSimplex R M} :
    noncomputable def Convexity.StdSimplex.single {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} [IsStrictOrderedRing R] (x : M) :

    The point mass distribution concentrated at x.

    Equations
    Instances For
      theorem Convexity.StdSimplex.mk_single {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} [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
      noncomputable def Convexity.StdSimplex.duple {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} [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
        @[simp]
        theorem Convexity.StdSimplex.weights_duple {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} [IsStrictOrderedRing R] (x y : M) {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) :
        noncomputable def Convexity.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
          @[simp]
          theorem Convexity.StdSimplex.weights_map {R : Type u} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] {M : Type v} {N : Type w} (g : MN) (f : StdSimplex R M) :
          @[simp]
          theorem Convexity.StdSimplex.map_const {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} {N : Type u_10} [IsStrictOrderedRing R] (f : StdSimplex R M) (x : N) :
          map (fun (x_1 : M) => x) f = single x
          @[simp]
          theorem Convexity.StdSimplex.map_single {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} {N : Type u_10} [IsStrictOrderedRing R] (x : M) (f : MN) :
          map f (single x) = single (f x)
          @[simp]
          theorem Convexity.StdSimplex.map_duple {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} {N : Type u_10} [IsStrictOrderedRing R] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) (x y : M) (f : MN) :
          map f (duple x y hs ht h) = duple (f x) (f y) hs ht h
          @[simp]
          theorem Convexity.StdSimplex.map_id {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} [IsStrictOrderedRing R] (f : StdSimplex R M) :
          map id f = f
          theorem Convexity.StdSimplex.map_comp {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} {N : Type u_10} {P : Type u_11} [IsStrictOrderedRing R] (f : StdSimplex R M) (g₁ : MN) (g₂ : NP) :
          map (g₂ g₁) f = map g₂ (map g₁ f)
          theorem Convexity.StdSimplex.map_map {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} {N : Type u_10} {P : Type u_11} [IsStrictOrderedRing R] (f : StdSimplex R M) (g₁ : MN) (g₂ : NP) :
          map g₂ (map g₁ f) = map (fun (x : M) => g₂ (g₁ x)) f
          noncomputable def Convexity.StdSimplex.join {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} [IsStrictOrderedRing R] (f : StdSimplex R (StdSimplex R M)) :

          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
            @[simp]
            theorem Convexity.StdSimplex.weights_join {R : Type u} [PartialOrder R] [Semiring R] {M : Type u_9} [IsStrictOrderedRing R] (f : StdSimplex R (StdSimplex R M)) :
            f.join.weights = f.weights.sum fun (d : StdSimplex R M) (r : R) => r d.weights
            noncomputable def Convexity.StdSimplex.restrict {X : Type u_2} {K : Type u_8} [Semifield K] [LinearOrder K] [IsStrictOrderedRing K] (w : StdSimplex K X) (s : Set X) (hs : xs, w.weights x 0) :

            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
              theorem Convexity.StdSimplex.weights_restrict {X : Type u_2} {K : Type u_8} [Semifield K] [LinearOrder K] [IsStrictOrderedRing K] (w : StdSimplex K X) (s : Set X) (hs : xs, w.weights x 0) [DecidablePred fun (x : X) => x s] :
              (w.restrict s hs).weights = ((Finsupp.filter (fun (x : X) => x s) w.weights).sum fun (_x : X) (k : K) => k)⁻¹ Finsupp.filter (fun (x : X) => x s) w.weights
              @[simp]
              theorem Convexity.StdSimplex.support_weights_restrict {X : Type u_2} {K : Type u_8} [Semifield K] [LinearOrder K] [IsStrictOrderedRing K] [IsDomain K] (w : StdSimplex K X) (s : Set X) (hs : xs, w.weights x 0) [DecidablePred fun (x : X) => x s] :
              (w.restrict s hs).weights.support = {xw.weights.support | x s}
              @[simp]
              theorem Convexity.StdSimplex.restrict_singleton {X : Type u_2} {K : Type u_8} [Semifield K] [LinearOrder K] [IsStrictOrderedRing K] [IsDomain K] (w : StdSimplex K X) (x : X) (hx : x_1{x}, w.weights x_1 0) :
              class Convexity.ConvexSpace (R : Type u) (M : Type v) [inst₁ : PartialOrder R] [inst₂ : Semiring R] [inst₃ : 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
                @[deprecated Convexity.ConvexSpace.sConvexComb (since := "2026-05-04")]
                def Convexity.ConvexSpace.convexCombination {R : Type u} {M : Type v} [inst₁ : PartialOrder R] [inst₂ : Semiring R] [inst₃ : IsStrictOrderedRing R] [self : ConvexSpace R M] (f : StdSimplex R M) :
                M

                Alias of Convexity.ConvexSpace.sConvexComb.


                Take a convex combination with the given probability distribution over points.

                Equations
                Instances For
                  @[deprecated Convexity.ConvexSpace.sConvexComb_single (since := "2026-05-04")]
                  theorem Convexity.ConvexSpace.convexCombination_single {R : Type u} {M : Type v} {inst₁ : PartialOrder R} {inst₂ : Semiring R} {inst₃ : IsStrictOrderedRing R} [self : ConvexSpace R M] (x : M) :

                  Alias of Convexity.ConvexSpace.sConvexComb_single.


                  A convex combination of a single point is that point.

                  noncomputable def Convexity.iConvexComb {R : Type u_1} {M : Type u_3} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (s : StdSimplex R I) (f : IM) :
                  M

                  Take a convex combination with the given weight distribution of an indexed family of points.

                  Equations
                  Instances For
                    noncomputable def Convexity.convexCombPair {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (s t : R) (hs : 0 s) (ht : 0 t) (hst : s + t = 1) (x y : M) :
                    M

                    Take a convex combination of two points.

                    Equations
                    Instances For
                      @[deprecated Convexity.convexCombPair (since := "2026-05-15")]
                      def Convexity.convexComboPair {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (s t : R) (hs : 0 s) (ht : 0 t) (hst : s + t = 1) (x y : M) :
                      M

                      Alias of Convexity.convexCombPair.


                      Take a convex combination of two points.

                      Equations
                      Instances For
                        @[implicit_reducible]
                        noncomputable instance Convexity.StdSimplex.instConvexSpace {R : Type u_1} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] :
                        Equations
                        @[simp]
                        theorem Convexity.StdSimplex.weights_sConvexComb {R : Type u_1} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] (f : StdSimplex R (StdSimplex R I)) :
                        (sConvexComb f).weights = f.weights.sum fun (d : StdSimplex R I) (r : R) => r d.weights
                        @[simp]
                        theorem Convexity.StdSimplex.weights_iConvexComb {R : Type u_1} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] (w : StdSimplex R I) (f : IStdSimplex R I) :
                        (iConvexComb w f).weights = w.weights.sum fun (i : I) (r : R) => r (f i).weights
                        @[simp]
                        theorem Convexity.StdSimplex.weights_convexCombPair {R : Type u_1} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] (w w' : StdSimplex R I) (s t : R) (hs : 0 s) (ht : 0 t) (hst : s + t = 1) :
                        (convexCombPair s t hs ht hst w w').weights = s w.weights + t w'.weights
                        theorem Convexity.StdSimplex.map_sConvexComb {R : Type u_1} {I : Type u_6} {J : Type u_7} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] (s : StdSimplex R (StdSimplex R I)) (f : IJ) :
                        theorem Convexity.StdSimplex.convexCombPair_restrict_restrict_compl {I : Type u_6} {K : Type u_8} [Semifield K] [LinearOrder K] [IsStrictOrderedRing K] (w : StdSimplex K I) (s : Set I) (hs : xs, w.weights x 0) (hs' : xs, w.weights x 0) [DecidablePred fun (x : I) => x s] :
                        convexCombPair ((Finsupp.filter (fun (x : I) => x s) w.weights).sum fun (_x : I) (k : K) => k) ((Finsupp.filter (fun (x : I) => xs) w.weights).sum fun (_x : I) (k : K) => k) (w.restrict s hs) (w.restrict s hs') = w
                        theorem Convexity.sConvexComb_convexCombPair {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (s t : R) (hs : 0 s) (ht : 0 t) (hst : s + t = 1) (w w' : StdSimplex R M) :
                        sConvexComb (convexCombPair s t hs ht hst w w') = convexCombPair s t hs ht hst (sConvexComb w) (sConvexComb w')
                        @[reducible, inline]
                        abbrev Convexity.ConvexSpace.mk {R : Type u_1} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] {M : Type u_9} (sConvexComb : StdSimplex R MM) (single : ∀ (x : M), sConvexComb (StdSimplex.single x) = x) (assoc : ∀ (f : StdSimplex R (StdSimplex R M)), sConvexComb (StdSimplex.map sConvexComb f) = sConvexComb (Convexity.sConvexComb f)) :

                        The public constructor for ConvexSpace.

                        Equations
                        Instances For
                          structure Convexity.IsAffineMap (R : Type u_1) {M : Type u_3} {N : Type u_4} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] [ConvexSpace R N] (f : MN) :

                          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
                            theorem Convexity.IsAffineMap.comp {R : Type u_1} {M : Type u_3} {N : Type u_4} {P : Type u_5} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] [ConvexSpace R N] [ConvexSpace R P] {g : NP} (hg : IsAffineMap R g) {f : MN} (hf : IsAffineMap R f) :
                            theorem Convexity.StdSimplex.isAffineMap_map (R : Type u_1) {I : Type u_6} {J : Type u_7} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] (f : IJ) :
                            theorem Convexity.sConvexComb_map {R : Type u_1} {M : Type u_3} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (w : StdSimplex R I) (f : IM) :
                            @[simp]
                            theorem Convexity.iConvexComb_const {R : Type u_1} {M : Type u_3} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (s : StdSimplex R I) (m : M) :
                            (iConvexComb s fun (x : I) => m) = m
                            @[simp]
                            theorem Convexity.iConvexComb_single {R : Type u_1} {M : Type u_3} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (i : I) (f : IM) :
                            @[simp]
                            theorem Convexity.iConvexComb_id' {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (w : StdSimplex R M) :
                            (iConvexComb w fun (x : M) => x) = sConvexComb w
                            @[simp]
                            theorem Convexity.iConvexComb_map {R : Type u_1} {M : Type u_3} {I : Type u_6} {J : Type u_7} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (s : StdSimplex R I) (f : IJ) (g : JM) :
                            iConvexComb (StdSimplex.map f s) g = iConvexComb s fun (i : I) => g (f i)
                            theorem Convexity.iConvexComb_congr {R : Type u_1} {M : Type u_3} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {w : StdSimplex R I} {f g : IM} (hfg : ∀ (i : I), w.weights i 0f i = g i) :
                            theorem Convexity.iConvexComb_reindex {R : Type u_1} {M : Type u_3} {I : Type u_6} {J : Type u_7} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (s : StdSimplex R I) (f : I J) (g : IM) :
                            theorem Convexity.iConvexComb_assoc'' {R : Type u_1} {M : Type u_3} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {J : IType u_9} (s : StdSimplex R I) (f : (i : I) → StdSimplex R (J i)) (g : (i : I) → J iM) :
                            (iConvexComb s fun (i : I) => iConvexComb (f i) (g i)) = iConvexComb (iConvexComb s fun (i : I) => StdSimplex.map (fun (x : J i) => i, x) (f i)) (Sigma.uncurry g)

                            Flattening nested iConvexCombs.

                            See iConvexComb_assoc' and iConvexComb_assoc for non-dependent versions.

                            theorem Convexity.iConvexComb_assoc' {R : Type u_1} {M : Type u_3} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {J : Type u_9} (s : StdSimplex R I) (f : IStdSimplex R J) (g : IJM) :
                            (iConvexComb s fun (i : I) => iConvexComb (f i) (g i)) = iConvexComb (iConvexComb s fun (i : I) => StdSimplex.map (fun (x : J) => (i, x)) (f i)) (Function.uncurry g)

                            Flattening nested iConvexCombs.

                            See iConvexComb_assoc'' for a more dependent version, and iConvexComb_assoc for a less dependent one.

                            theorem Convexity.iConvexComb_assoc {R : Type u_1} {M : Type u_3} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {J : Type u_9} (s : StdSimplex R I) (f : IStdSimplex R J) (g : JM) :
                            (iConvexComb s fun (i : I) => iConvexComb (f i) g) = iConvexComb (iConvexComb s f) g

                            Flattening nested iConvexCombs.

                            See iConvexComb_assoc', iConvexComb_assoc'' for more dependent versions.

                            theorem Convexity.iConvexComb_comm {R : Type u_9} {M : Type u_10} {I : Type u_11} {J : Type u_12} [PartialOrder R] [CommSemiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (f : StdSimplex R I) (g : StdSimplex R J) (e : IJM) :
                            (iConvexComb f fun (i : I) => iConvexComb g (e i)) = iConvexComb g fun (j : J) => iConvexComb f fun (i : I) => e i j
                            theorem Convexity.IsAffineMap.map_iConvexComb {R : Type u_1} {M : Type u_3} {N : Type u_4} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] [ConvexSpace R N] {f : MN} (hf : IsAffineMap R f) (s : StdSimplex R I) (g : IM) :
                            f (iConvexComb s g) = iConvexComb s (f g)
                            theorem Convexity.map_iConvexComb {R : Type u_1} {I : Type u_6} {J : Type u_7} {K : Type u_8} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] {f : JK} (s : StdSimplex R I) (g : IStdSimplex R J) :
                            theorem Convexity.convexCombPair_def {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) (p q : M) :
                            convexCombPair s t hs ht h p q = iConvexComb (StdSimplex.duple 0 1 hs ht h) ![p, q]
                            @[simp]
                            theorem Convexity.convexCombPair_zero {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {x y : M} :
                            convexCombPair 0 1 x y = y

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

                            @[deprecated Convexity.convexCombPair_zero (since := "2026-05-15")]
                            theorem Convexity.convexComboPair_zero {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {x y : M} :
                            convexCombPair 0 1 x y = y

                            Alias of Convexity.convexCombPair_zero.


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

                            @[simp]
                            theorem Convexity.convexCombPair_one {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {x y : M} :
                            convexCombPair 1 0 x y = x

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

                            @[deprecated Convexity.convexCombPair_one (since := "2026-05-15")]
                            theorem Convexity.convexComboPair_one {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {x y : M} :
                            convexCombPair 1 0 x y = x

                            Alias of Convexity.convexCombPair_one.


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

                            @[simp]
                            theorem Convexity.convexCombPair_same {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) {x : M} :
                            convexCombPair s t hs ht h x x = x

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

                            @[deprecated Convexity.convexCombPair_same (since := "2026-05-15")]
                            theorem Convexity.convexComboPair_symm {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) {x : M} :
                            convexCombPair s t hs ht h x x = x

                            Alias of Convexity.convexCombPair_same.


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

                            theorem Convexity.convexCombPair_symm {R : Type u_1} {M : Type u_3} [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} :
                            convexCombPair s t hs ht h x y = convexCombPair t s ht hs y x
                            theorem Convexity.IsAffineMap.map_convexCombPair {R : Type u_1} {M : Type u_3} {N : Type u_4} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] [ConvexSpace R N] {f : MN} (hf : IsAffineMap R f) {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) (x y : M) :
                            f (convexCombPair s t hs ht h x y) = convexCombPair s t hs ht h (f x) (f y)
                            theorem Convexity.convexCombPair_iConvexComb_iConvexComb {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) {J₁ : Type u₁} {J₂ : Type u₂} (g₁ : StdSimplex R J₁) (g₂ : StdSimplex R J₂) (m₁ : J₁M) (m₂ : J₂M) :
                            convexCombPair s t hs ht h (iConvexComb g₁ m₁) (iConvexComb g₂ m₂) = sConvexComb (convexCombPair s t hs ht h (StdSimplex.map m₁ g₁) (StdSimplex.map m₂ g₂))

                            Flattening with the outer combination specialized to convexCombPair.

                            theorem Convexity.iConvexComb_convexCombPair {R : Type u_1} {M : Type u_3} {I : Type u_6} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] (s t : IR) (hs : ∀ (i : I), 0 s i) (ht : ∀ (i : I), 0 t i) (h : ∀ (i : I), s i + t i = 1) (f : StdSimplex R I) (m₁ m₂ : IM) :
                            (iConvexComb f fun (i : I) => convexCombPair (s i) (t i) (m₁ i) (m₂ i)) = sConvexComb (iConvexComb f fun (i : I) => StdSimplex.duple (m₁ i) (m₂ i) )

                            Flattening with the inner combination specialized to convexCombPair.

                            theorem Convexity.convexCombPair_iConvexComb_left {R : Type u_1} {M : Type u_3} {J : Type u_7} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) (g : StdSimplex R J) (e : JM) (m : M) :
                            theorem Convexity.convexCombPair_iConvexComb_right {R : Type u_1} {M : Type u_3} {J : Type u_7} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) (m : M) (g : StdSimplex R J) (e : JM) :
                            theorem Convexity.convexCombPair_convexCombPair_left_eq_sConvexComb {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) {s' t' : R} (hs' : 0 s') (ht' : 0 t') (h' : s' + t' = 1) (m₁ m₂ m₃ : M) :
                            convexCombPair s t hs ht h (convexCombPair s' t' hs' ht' h' m₁ m₂) m₃ = sConvexComb (convexCombPair s t hs ht h (StdSimplex.duple m₁ m₂ hs' ht' h') (StdSimplex.single m₃))

                            Flattening nested binary convex combination into a single convex combination.

                            theorem Convexity.convexCombPair_convexCombPair_right_eq_sConvexComb {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) {s' t' : R} (hs' : 0 s') (ht' : 0 t') (h' : s' + t' = 1) (m₁ m₂ m₃ : M) :
                            convexCombPair s t hs ht h m₁ (convexCombPair s' t' hs' ht' h' m₂ m₃) = sConvexComb (convexCombPair s t hs ht h (StdSimplex.single m₁) (StdSimplex.duple m₂ m₃ hs' ht' h'))

                            Flattening nested binary convex combination into a single convex combination.

                            theorem Convexity.convexCombPair_convexCombPair_assoc_left {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) {s' t' : R} (hs' : 0 s') (ht' : 0 t') (h' : s' + t' = 1) {s'' t'' : R} (hs'' : 0 s'') (ht'' : 0 t'') (h'' : s'' + t'' = 1) (H : t * s'' = s * t' * t'') (m₁ m₂ m₃ : M) :
                            convexCombPair s t hs ht h (convexCombPair s' t' hs' ht' h' m₁ m₂) m₃ = convexCombPair (s * s') (s * t' + t) m₁ (convexCombPair s'' t'' hs'' ht'' h'' m₂ m₃)
                            theorem Convexity.convexCombPair_convexCombPair_assoc_right {R : Type u_1} {M : Type u_3} [PartialOrder R] [Semiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) {s' t' : R} (hs' : 0 s') (ht' : 0 t') (h' : s' + t' = 1) {s'' t'' : R} (hs'' : 0 s'') (ht'' : 0 t'') (h'' : s'' + t'' = 1) (H : s * t'' = t * s' * s'') (m₁ m₂ m₃ : M) :
                            convexCombPair s t hs ht h m₁ (convexCombPair s' t' hs' ht' h' m₂ m₃) = convexCombPair (s + t * s') (t * t') (convexCombPair s'' t'' hs'' ht'' h'' m₁ m₂) m₃
                            theorem Convexity.iConvexComb_convexCombPair_comm {R : Type u_9} {M : Type u_10} {I : Type u_11} [PartialOrder R] [CommSemiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) (f : StdSimplex R I) (e₁ e₂ : IM) :
                            (iConvexComb f fun (x : I) => convexCombPair s t hs ht h (e₁ x) (e₂ x)) = convexCombPair s t hs ht h (iConvexComb f e₁) (iConvexComb f e₂)
                            theorem Convexity.iConvexComb_convexCombPair_comm_left {R : Type u_9} {M : Type u_10} {I : Type u_11} [PartialOrder R] [CommSemiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) (f : StdSimplex R I) (m : M) (e : IM) :
                            (iConvexComb f fun (x : I) => convexCombPair s t hs ht h (e x) m) = convexCombPair s t hs ht h (iConvexComb f e) m
                            theorem Convexity.iConvexComb_convexCombPair_comm_right {R : Type u_9} {M : Type u_10} {I : Type u_11} [PartialOrder R] [CommSemiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) (f : StdSimplex R I) (m : M) (e : IM) :
                            (iConvexComb f fun (x : I) => convexCombPair s t hs ht h m (e x)) = convexCombPair s t hs ht h m (iConvexComb f e)
                            theorem Convexity.isAffineMap_convexCombPair {R : Type u_9} {M : Type u_10} [PartialOrder R] [CommSemiring R] [IsStrictOrderedRing R] [ConvexSpace R M] {s t : R} (hs : 0 s) (ht : 0 t) (h : s + t = 1) (m : M) :
                            IsAffineMap R (convexCombPair s t hs ht h m)