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 : ΞΉ) :
    f x ∈ Set.Icc 0 1

    All values of a function f ∈ stdSimplex π•œ ΞΉ belong to [0, 1].

    theorem stdSimplex_subset_Icc (π•œ : Type u_2) {ΞΉ : Type u_1} [Semiring π•œ] [PartialOrder π•œ] [Fintype ΞΉ] [IsOrderedAddMonoid π•œ] :
    stdSimplex π•œ ΞΉ βŠ† Set.Icc 0 1

    stdSimplex π•œ ΞΉ is a subset of the unit cube

    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_apply_coe (π•œ : Type u_1) [Ring π•œ] [PartialOrder π•œ] [IsOrderedRing π•œ] (f : ↑(stdSimplex π•œ (Fin 2))) :
      ↑((stdSimplexEquivIcc π•œ) f) = ↑f 1
      @[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_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.

      theorem isClosed_stdSimplex (π•œ : Type u_1) (ΞΉ : Type u_2) [Fintype ΞΉ] [TopologicalSpace π•œ] [Semiring π•œ] [PartialOrder π•œ] [OrderClosedTopology π•œ] [ContinuousAdd π•œ] :
      IsClosed (stdSimplex π•œ ΞΉ)

      stdSimplex π•œ ΞΉ is closed.

      theorem isCompact_stdSimplex (π•œ : Type u_1) (ΞΉ : Type u_2) [Fintype ΞΉ] [TopologicalSpace π•œ] [Semiring π•œ] [PartialOrder π•œ] [OrderClosedTopology π•œ] [ContinuousAdd π•œ] [CompactIccSpace π•œ] [IsOrderedAddMonoid π•œ] :
      IsCompact (stdSimplex π•œ ΞΉ)

      stdSimplex π•œ ΞΉ is compact.

      instance stdSimplex.instCompactSpace_coe (π•œ : Type u_1) (ΞΉ : Type u_2) [Fintype ΞΉ] [TopologicalSpace π•œ] [Semiring π•œ] [PartialOrder π•œ] [OrderClosedTopology π•œ] [ContinuousAdd π•œ] [CompactIccSpace π•œ] [IsOrderedAddMonoid π•œ] :
      CompactSpace ↑(stdSimplex π•œ ΞΉ)

      Every vector in stdSimplex π•œ ΞΉ has max-norm at most 1.

      stdSimplex ℝ ΞΉ is bounded.

      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]

        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]

        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.

        @[implicit_reducible]
        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) :
            @[implicit_reducible]
            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) :
              ↑barycenter x = (↑(Fintype.card 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).