Documentation

Mathlib.Analysis.Convex.StdSimplex

The standard simplex #

In this file, given an ordered semiring ๐•œ and a finite type ฮน, we define stdSimplex : Set (ฮน โ†’ ๐•œ) as the set of vectors with non-negative coordinates with total sum 1.

When f : X โ†’ Y is a map between finite types, we define the map stdSimplex.map f : stdSimplex ๐•œ X โ†’ stdSimplex ๐•œ Y.

def stdSimplex (๐•œ : Type u_2) (ฮน : Type u_1) [Semiring ๐•œ] [PartialOrder ๐•œ] [Fintype ฮน] :
Set (ฮน โ†’ ๐•œ)

The standard simplex in the space of functions ฮน โ†’ ๐•œ is the set of vectors with non-negative coordinates with total sum 1. This is the free object in the category of convex spaces.

Equations
Instances For
    theorem stdSimplex_eq_inter (๐•œ : Type u_2) (ฮน : Type u_1) [Semiring ๐•œ] [PartialOrder ๐•œ] [Fintype ฮน] :
    stdSimplex ๐•œ ฮน = (โ‹‚ (x : ฮน), {f : ฮน โ†’ ๐•œ | 0 โ‰ค f x}) โˆฉ {f : ฮน โ†’ ๐•œ | โˆ‘ x : ฮน, f x = 1}
    theorem convex_stdSimplex (๐•œ : Type u_2) (ฮน : Type u_1) [Semiring ๐•œ] [PartialOrder ๐•œ] [Fintype ฮน] [IsOrderedRing ๐•œ] :
    Convex ๐•œ (stdSimplex ๐•œ ฮน)
    theorem stdSimplex_of_subsingleton (๐•œ : Type u_2) (ฮน : Type u_1) [Semiring ๐•œ] [PartialOrder ๐•œ] [Fintype ฮน] [Subsingleton ๐•œ] :
    stdSimplex ๐•œ ฮน = Set.univ
    theorem stdSimplex_of_isEmpty_index (๐•œ : Type u_2) (ฮน : Type u_1) [Semiring ๐•œ] [PartialOrder ๐•œ] [Fintype ฮน] [IsEmpty ฮน] [Nontrivial ๐•œ] :
    stdSimplex ๐•œ ฮน = โˆ…

    The standard simplex in the zero-dimensional space is empty.

    theorem stdSimplex_unique (๐•œ : Type u_2) (ฮน : Type u_1) [Semiring ๐•œ] [PartialOrder ๐•œ] [Fintype ฮน] [ZeroLEOneClass ๐•œ] [Nonempty ฮน] [Subsingleton ฮน] :
    stdSimplex ๐•œ ฮน = {fun (x : ฮน) => 1}
    theorem mem_Icc_of_mem_stdSimplex {๐•œ : Type u_2} {ฮน : Type u_1} [Semiring ๐•œ] [PartialOrder ๐•œ] [Fintype ฮน] [IsOrderedAddMonoid ๐•œ] {f : ฮน โ†’ ๐•œ} (hf : f โˆˆ stdSimplex ๐•œ ฮน) (x : ฮน) :

    All values of a function f โˆˆ stdSimplex ๐•œ ฮน belong to [0, 1].

    theorem single_mem_stdSimplex (๐•œ : Type u_2) {ฮน : Type u_1} [Semiring ๐•œ] [PartialOrder ๐•œ] [Fintype ฮน] [DecidableEq ฮน] [ZeroLEOneClass ๐•œ] (i : ฮน) :
    Pi.single i 1 โˆˆ stdSimplex ๐•œ ฮน
    theorem ite_eq_mem_stdSimplex (๐•œ : Type u_2) {ฮน : Type u_1} [Semiring ๐•œ] [PartialOrder ๐•œ] [Fintype ฮน] [DecidableEq ฮน] [ZeroLEOneClass ๐•œ] (i : ฮน) :
    (fun (x : ฮน) => if i = x then 1 else 0) โˆˆ stdSimplex ๐•œ ฮน
    theorem segment_single_subset_stdSimplex (๐•œ : Type u_2) {ฮน : Type u_1} [Semiring ๐•œ] [PartialOrder ๐•œ] [Fintype ฮน] [DecidableEq ฮน] [ZeroLEOneClass ๐•œ] [IsOrderedRing ๐•œ] (i j : ฮน) :
    segment ๐•œ (Pi.single i 1) (Pi.single j 1) โІ stdSimplex ๐•œ ฮน

    The edges are contained in the simplex.

    theorem stdSimplex_fin_two (๐•œ : Type u_2) [Semiring ๐•œ] [PartialOrder ๐•œ] [ZeroLEOneClass ๐•œ] [IsOrderedRing ๐•œ] :
    stdSimplex ๐•œ (Fin 2) = segment ๐•œ (Pi.single 0 1) (Pi.single 1 1)
    def stdSimplexEquivIcc (๐•œ : Type u_1) [Ring ๐•œ] [PartialOrder ๐•œ] [IsOrderedRing ๐•œ] :
    โ†‘(stdSimplex ๐•œ (Fin 2)) โ‰ƒ โ†‘(Set.Icc 0 1)

    The standard one-dimensional simplex in Fin 2 โ†’ ๐•œ is equivalent to the unit interval. This bijection sends the zeroth vertex Pi.single 0 1 to 0 and the first vertex Pi.single 1 1 to 1.

    Equations
    Instances For
      @[simp]
      theorem stdSimplexEquivIcc_symm_apply_coe (๐•œ : Type u_1) [Ring ๐•œ] [PartialOrder ๐•œ] [IsOrderedRing ๐•œ] (x : โ†‘(Set.Icc 0 1)) :
      โ†‘((stdSimplexEquivIcc ๐•œ).symm x) = ![1 - โ†‘x, โ†‘x]
      @[simp]
      theorem stdSimplexEquivIcc_apply_coe (๐•œ : Type u_1) [Ring ๐•œ] [PartialOrder ๐•œ] [IsOrderedRing ๐•œ] (f : โ†‘(stdSimplex ๐•œ (Fin 2))) :
      โ†‘((stdSimplexEquivIcc ๐•œ) f) = โ†‘f 1
      @[simp]
      theorem stdSimplexEquivIcc_zero (๐•œ : Type u_1) [Ring ๐•œ] [PartialOrder ๐•œ] [IsOrderedRing ๐•œ] :
      (stdSimplexEquivIcc ๐•œ) โŸจPi.single 0 1, โ‹ฏโŸฉ = 0
      @[simp]
      theorem stdSimplexEquivIcc_one (๐•œ : Type u_1) [Ring ๐•œ] [PartialOrder ๐•œ] [IsOrderedRing ๐•œ] :
      (stdSimplexEquivIcc ๐•œ) โŸจPi.single 1 1, โ‹ฏโŸฉ = 1
      theorem convexHull_basis_eq_stdSimplex (R : Type u_1) (ฮน : Type u_2) [Field R] [LinearOrder R] [IsStrictOrderedRing R] [Fintype ฮน] [DecidableEq ฮน] :
      (convexHull R) (Set.range fun (i j : ฮน) => if i = j then 1 else 0) = stdSimplex R ฮน

      stdSimplex ๐•œ ฮน is the convex hull of the canonical basis in ฮน โ†’ ๐•œ.

      theorem convexHull_rangle_single_eq_stdSimplex (R : Type u_1) (ฮน : Type u_2) [Field R] [LinearOrder R] [IsStrictOrderedRing R] [Fintype ฮน] [DecidableEq ฮน] :
      (convexHull R) (Set.range fun (i : ฮน) => Pi.single i 1) = stdSimplex R ฮน

      stdSimplex ๐•œ ฮน is the convex hull of the points Pi.single i 1 for i : ฮน.

      theorem Set.Finite.convexHull_eq_image {R : Type u_1} [Field R] [LinearOrder R] [IsStrictOrderedRing R] {E : Type u_3} [AddCommGroup E] [Module R E] {s : Set E} (hs : s.Finite) :
      (convexHull R) s = โ‡‘(โˆ‘ x : โ†‘s, (LinearMap.proj x).smulRight โ†‘x) '' stdSimplex R โ†‘s

      The convex hull of a finite set is the image of the standard simplex in s โ†’ โ„ under the linear map sending each function w to โˆ‘ x โˆˆ s, w x โ€ข x.

      Since we have no sums over finite sets, we use sum over @Finset.univ _ hs.fintype. The map is defined in terms of operations on (s โ†’ โ„) โ†’โ‚—[โ„] โ„ so that later we will not need to prove that this map is linear.

      Every vector in stdSimplex ๐•œ ฮน has max-norm at most 1.

      theorem bounded_stdSimplex (ฮน : Type u_1) [Fintype ฮน] :

      stdSimplex โ„ ฮน is bounded.

      theorem isClosed_stdSimplex (ฮน : Type u_1) [Fintype ฮน] :

      stdSimplex โ„ ฮน is closed.

      theorem isCompact_stdSimplex (ฮน : Type u_1) [Fintype ฮน] :

      stdSimplex โ„ ฮน is compact.

      instance stdSimplex.instCompactSpace_coe (ฮน : Type u_1) [Fintype ฮน] :
      theorem isPathConnected_stdSimplex (ฮน : Type u_1) [Fintype ฮน] [Nonempty ฮน] :

      stdSimplex โ„ ฮน is path connected.

      The standard one-dimensional simplex in โ„ยฒ = Fin 2 โ†’ โ„ is homeomorphic to the unit interval.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem stdSimplexHomeomorphUnitInterval_symm_apply_coe (x : โ†‘(Set.Icc 0 1)) :
        โ†‘(stdSimplexHomeomorphUnitInterval.symm x) = ![1 - โ†‘x, โ†‘x]

        Diameter of a Standard Simplex (sup metric) #

        theorem diam_stdSimplex_le {ฮน : Type u_1} [Fintype ฮน] :

        The (sup metric) diameter of a standard simplex is less than or equal to 1.

        @[simp]
        theorem diam_stdSimplex_of_subsingleton {ฮน : Type u_1} [Fintype ฮน] [Subsingleton ฮน] :

        The (sup metric) diameter of a standard simplex indexed by a subsingleton is 0.

        @[simp]
        theorem diam_stdSimplex {ฮน : Type u_1} [Fintype ฮน] [Nontrivial ฮน] :

        The (sup metric) diameter of a standard simplex indexed by a nontrivial index is 1.

        instance stdSimplex.instFunLikeElemForall {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] :
        FunLike (โ†‘(stdSimplex S X)) X S
        Equations
        theorem stdSimplex.ext {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] {s t : โ†‘(stdSimplex S X)} (h : โ‡‘s = โ‡‘t) :
        s = t
        theorem stdSimplex.ext_iff {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] {s t : โ†‘(stdSimplex S X)} :
        s = t โ†” โ‡‘s = โ‡‘t
        @[simp]
        theorem stdSimplex.zero_le {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] (s : โ†‘(stdSimplex S X)) (x : X) :
        0 โ‰ค s x
        @[simp]
        theorem stdSimplex.sum_eq_one {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] (s : โ†‘(stdSimplex S X)) :
        โˆ‘ x : X, s x = 1
        theorem stdSimplex.add_eq_one {S : Type u_1} [Semiring S] [PartialOrder S] (s : โ†‘(stdSimplex S (Fin 2))) :
        s 0 + s 1 = 1
        @[simp]
        theorem stdSimplex.le_one {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] [IsOrderedRing S] (s : โ†‘(stdSimplex S X)) (x : X) :
        s x โ‰ค 1
        theorem stdSimplex.image_linearMap {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} {Y : Type u_3} [Fintype X] [Fintype Y] [IsOrderedRing S] (f : X โ†’ Y) :
        noncomputable def stdSimplex.map {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} {Y : Type u_3} [Fintype X] [Fintype Y] [IsOrderedRing S] (f : X โ†’ Y) (s : โ†‘(stdSimplex S X)) :
        โ†‘(stdSimplex S Y)

        The map stdSimplex S X โ†’ stdSimplex S Y that is induced by a map f : X โ†’ Y.

        Equations
        Instances For
          @[simp]
          theorem stdSimplex.map_coe {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} {Y : Type u_3} [Fintype X] [Fintype Y] [IsOrderedRing S] (f : X โ†’ Y) (s : โ†‘(stdSimplex S X)) :
          โ‡‘(map f s) = (FunOnFinite.linearMap S S f) โ‡‘s
          @[simp]
          theorem stdSimplex.map_id_apply {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] [IsOrderedRing S] (x : โ†‘(stdSimplex S X)) :
          map id x = x
          theorem stdSimplex.map_comp_apply {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} {Y : Type u_3} {Z : Type u_4} [Fintype X] [Fintype Y] [Fintype Z] [IsOrderedRing S] (f : X โ†’ Y) (g : Y โ†’ Z) (x : โ†‘(stdSimplex S X)) :
          map g (map f x) = map (g โˆ˜ f) x
          @[reducible, inline]
          abbrev stdSimplex.vertex {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] [IsOrderedRing S] [DecidableEq X] (x : X) :
          โ†‘(stdSimplex S X)

          The vertex corresponding to x : X in stdSimplex S X.

          Equations
          Instances For
            @[simp]
            theorem stdSimplex.vertex_coe {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] [IsOrderedRing S] [DecidableEq X] (x : X) :
            โ‡‘(vertex x) = Pi.single x 1
            @[simp]
            theorem stdSimplex.map_vertex {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} {Y : Type u_3} [Fintype X] [Fintype Y] [IsOrderedRing S] [DecidableEq X] [DecidableEq Y] (f : X โ†’ Y) (x : X) :
            map f (vertex x) = vertex (f x)
            theorem stdSimplex.continuous_map {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} {Y : Type u_3} [Fintype X] [Fintype Y] [IsOrderedRing S] [TopologicalSpace S] [IsTopologicalSemiring S] (f : X โ†’ Y) :
            instance stdSimplex.instUniqueElemForall {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] [IsOrderedRing S] [Unique X] :
            Unique โ†‘(stdSimplex S X)
            Equations
            @[simp]
            theorem stdSimplex.eq_one_of_unique {S : Type u_1} [Semiring S] [PartialOrder S] {X : Type u_2} [Fintype X] [IsOrderedRing S] [Unique X] (s : โ†‘(stdSimplex S X)) (x : X) :
            s x = 1

            Barycenter of a Standard Simplex #

            def stdSimplex.barycenter {X : Type u_2} [Fintype X] {๐•œ : Type u_5} [Field ๐•œ] [LinearOrder ๐•œ] [IsStrictOrderedRing ๐•œ] [Nonempty X] :
            โ†‘(stdSimplex ๐•œ X)

            The barycenter of a standard simplex is the center of mass of the set of vertices (equally weighted).

            Equations
            Instances For
              @[simp]
              theorem stdSimplex.barycenter_apply {X : Type u_2} [Fintype X] {๐•œ : Type u_5} [Field ๐•œ] [LinearOrder ๐•œ] [IsStrictOrderedRing ๐•œ] [Nonempty X] (x : X) :

              The barycenter of a standard simplex has coordinates (Fintype.card X)โปยน at each index.

              theorem stdSimplex.barycenter_eq_centerMass {X : Type u_2} [Fintype X] {๐•œ : Type u_5} [Field ๐•œ] [LinearOrder ๐•œ] [IsStrictOrderedRing ๐•œ] [Nonempty X] [DecidableEq X] :
              โ†‘barycenter = Finset.univ.centerMass (fun (x : X) => 1) fun (i : X) => Pi.single i 1

              The barycenter equals the (equal weight) center of mass of vertices (Finset.centerMass).