The areas / V22. Affine, Euclidean and convex geometry
Mathlib.Geometry.Convex.ConvexSpace.Defs
130 declarations and 6 deprecated aliases. Mathlib docs · Source
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.
theorem Convexity.StdSimplex.equivIcc.congr_simp E1 #
∀ {R' : Type u_8} [inst : Ring R'] [inst_1 : PartialOrder R'] [inst_2 : IsStrictOrderedRing R'],
Convexity.StdSimplex.equivIcc = Convexity.StdSimplex.equivIcc
theorem Convexity.convexCombPair.congr_simp E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] (s s_1 : R) (e_s : s = s_1) (t t_1 : R) (e_t : t = t_1) (hs : 0 ≤ s) (ht : 0 ≤ t)
(hst : s + t = 1) (x x_1 : X),
x = x_1 →
∀ (y y_1 : X), y = y_1 → Convexity.convexCombPair s t hs ht hst x y = Convexity.convexCombPair s_1 t_1 ⋯ ⋯ ⋯ x_1 y_1
theorem Convexity.StdSimplex.duple.congr_simp E1 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
(x x_1 : X),
x = x_1 →
∀ (y y_1 : X),
y = y_1 →
∀ {s s_1 : R} (e_s : s = s_1) {t t_1 : R} (e_t : t = t_1) (hs : 0 ≤ s) (ht : 0 ≤ t) (h : s + t = 1),
Convexity.StdSimplex.duple x y hs ht h = Convexity.StdSimplex.duple x_1 y_1 ⋯ ⋯ ⋯
def Convexity.StdSimplex.ctorIdx E1 #
{R : Type u} →
{inst : LE R} → {inst_1 : AddCommMonoid R} → {inst_2 : One R} → {X : Type v} → Convexity.StdSimplex R X → ℕ
def Convexity.ConvexSpace.ctorIdx E1 #
{R : Type u} →
{X : Type v} →
{inst₁ : PartialOrder R} → {inst₂ : Semiring R} → {inst₃ : IsStrictOrderedRing R} → Convexity.ConvexSpace R X → ℕ
theorem Convexity.StdSimplex.mk.congr_simp E1 #
∀ {R : Type u} [inst : LE R] [inst_1 : AddCommMonoid R] [inst_2 : One R] {X : Type v} (weights weights_1 : X →₀ R)
(e_weights : weights = weights_1) (nonneg : 0 ≤ weights) (total : (weights.sum fun x r ↦ r) = 1),
{ weights := weights, nonneg := nonneg, total := total } = { weights := weights_1, nonneg := ⋯, total := ⋯ }
theorem Convexity.StdSimplex.join.congr_simp E1 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
(f f_1 : Convexity.StdSimplex R (Convexity.StdSimplex R X)), f = f_1 → f.join = f_1.join
theorem Convexity.StdSimplex.map.congr_simp E1 #
∀ {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R] {X : Type v} {Y : Type w}
(g g_1 : X → Y),
g = g_1 →
∀ (f f_1 : Convexity.StdSimplex R X), f = f_1 → Convexity.StdSimplex.map g f = Convexity.StdSimplex.map g_1 f_1
theorem Convexity.StdSimplex.mk.injEq E0 #
∀ {R : Type u} [inst : LE R] [inst_1 : AddCommMonoid R] [inst_2 : One R] {X : Type v} (weights : X →₀ R)
(nonneg : 0 ≤ weights) (total : (weights.sum fun x r ↦ r) = 1) (weights_1 : X →₀ R) (nonneg_1 : 0 ≤ weights_1)
(total_1 : (weights_1.sum fun x r ↦ r) = 1),
({ weights := weights, nonneg := nonneg, total := total } =
{ weights := weights_1, nonneg := nonneg_1, total := total_1 }) =
(weights = weights_1)
theorem Convexity.StdSimplex.mk.inj E1 #
∀ {R : Type u} {inst : LE R} {inst_1 : AddCommMonoid R} {inst_2 : One R} {X : Type v} {weights : X →₀ R}
{nonneg : 0 ≤ weights} {total : (weights.sum fun x r ↦ r) = 1} {weights_1 : X →₀ R} {nonneg_1 : 0 ≤ weights_1}
{total_1 : (weights_1.sum fun x r ↦ r) = 1},
{ weights := weights, nonneg := nonneg, total := total } =
{ weights := weights_1, nonneg := nonneg_1, total := total_1 } →
weights = weights_1
theorem Convexity.StdSimplex.single.congr_simp E1 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
(x x_1 : X), x = x_1 → Convexity.StdSimplex.single x = Convexity.StdSimplex.single x_1
theorem Convexity.StdSimplex.restrict.congr_simp E1 #
∀ {X : Type u_2} {K : Type u_7} [inst : DivisionSemiring K] [inst_1 : LinearOrder K] [inst_2 : IsStrictOrderedRing K]
(w w_1 : Convexity.StdSimplex K X) (e_w : w = w_1) (s s_1 : Set X) (e_s : s = s_1) (hs : ∃ x ∈ s, w.weights x ≠ 0),
w.restrict s hs = w_1.restrict s_1 ⋯
structure Convexity.StdSimplex E1 #
(R : Type u) → [LE R] → [AddCommMonoid R] → [One R] → Type v → Type (max u v)
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.
abbrev Convexity.StdSimplex.weights E1 #
{R : Type u} →
[inst : LE R] → [inst_1 : AddCommMonoid R] → [inst_2 : One R] → {X : Type v} → Convexity.StdSimplex R X → X →₀ R
The weights of an element of the standard simplexas aFinsupp`.
ctor Convexity.StdSimplex.mk E0 #
{R : Type u} →
[inst : LE R] →
[inst_1 : AddCommMonoid R] →
[inst_2 : One R] →
{X : Type v} → (weights : X →₀ R) → 0 ≤ weights → (weights.sum fun x r ↦ r) = 1 → Convexity.StdSimplex R X
theorem Convexity.StdSimplex.nonneg E0 #
∀ {R : Type u} [inst : LE R] [inst_1 : AddCommMonoid R] [inst_2 : One R] {X : Type v} (self : Convexity.StdSimplex R X),
0 ≤ self.weights
All weights are non-negative.
theorem Convexity.StdSimplex.total E0 #
∀ {R : Type u} [inst : LE R] [inst_1 : AddCommMonoid R] [inst_2 : One R] {X : Type v} (self : Convexity.StdSimplex R X),
(self.sum fun x r ↦ r) = 1
The weights sum to 1.
theorem Convexity.StdSimplex.weights_nonneg E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] {w : Convexity.StdSimplex R X} (i : X),
0 ≤ w.weights i
theorem Convexity.StdSimplex.weights_ne_zero E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [Nontrivial R]
(w : Convexity.StdSimplex R X), w.weights ≠ 0
theorem Convexity.StdSimplex.weights_pos E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [Nontrivial R]
(w : Convexity.StdSimplex R X), 0 < w.weights
theorem Convexity.StdSimplex.support_weights_nonempty E1 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [Nontrivial R]
(w : Convexity.StdSimplex R X), w.support.Nonempty
theorem Convexity.StdSimplex.nonempty E1 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [Nontrivial R]
(w : Convexity.StdSimplex R X), Nonempty X
theorem Convexity.StdSimplex.weights_inj E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] {f g : Convexity.StdSimplex R X},
f.weights = g.weights ↔ f = g
theorem Convexity.StdSimplex.ext_iff E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] {f g : Convexity.StdSimplex R X},
f = g ↔ f.weights = g.weights
theorem Convexity.StdSimplex.ext E1 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] {f g : Convexity.StdSimplex R X},
f.weights = g.weights → f = g
Alias of the forward direction of Convexity.StdSimplex.weights_inj.
theorem Convexity.StdSimplex.total_of_fintype E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : Fintype X]
(w : Convexity.StdSimplex R X), ∑ i, w.weights i = 1
theorem Convexity.StdSimplex.total_fin_two E0 #
∀ {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] (w : Convexity.StdSimplex R (Fin 2)),
w.weights 0 + w.weights 1 = 1
theorem Convexity.StdSimplex.range_toFun_comp_weights E1 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : Fintype X],
(Set.range fun t ↦ ⇑t.weights) = (⋂ i, {s | 0 ≤ s i}) ∩ {s | ∑ i, s i = 1}
theorem Convexity.StdSimplex.weights_apply_eq_one E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [Subsingleton X]
(s : Convexity.StdSimplex R X) (m : X), s.weights m = 1
instance Convexity.StdSimplex.instSubsingleton E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [Subsingleton X],
Subsingleton (Convexity.StdSimplex R X)
def Convexity.StdSimplex.single E1 #
{X : Type u_2} →
{R : Type u} →
[inst : PartialOrder R] → [inst_1 : Semiring R] → [IsStrictOrderedRing R] → X → Convexity.StdSimplex R X
The point mass distribution concentrated at x.
theorem Convexity.StdSimplex.weights_single E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R] (x : X),
(Convexity.StdSimplex.single x).weights = fun₀ | x => 1
theorem Convexity.StdSimplex.mk_single E1 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R] (x : X)
{nonneg : 0 ≤ fun₀ | x => 1} {total : ((fun₀ | x => 1).sum fun x r ↦ r) = 1},
{ weights := fun₀ | x => 1, nonneg := nonneg, total := total } = Convexity.StdSimplex.single x
theorem Convexity.StdSimplex.support_weights_eq_singleton E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] {w : Convexity.StdSimplex R X} {x : X}
[inst_2 : IsStrictOrderedRing R], w.support = {x} ↔ w = Convexity.StdSimplex.single x
theorem Convexity.StdSimplex.single_injective E1 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R],
Function.Injective Convexity.StdSimplex.single
theorem Convexity.StdSimplex.weights_apply_le_one E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [IsStrictOrderedRing R]
(s : Convexity.StdSimplex R X) (m : X), s.weights m ≤ 1
instance Convexity.StdSimplex.instInhabited E0 #
{X : Type u_2} →
{R : Type u} →
[inst : PartialOrder R] →
[inst_1 : Semiring R] → [IsStrictOrderedRing R] → [Inhabited X] → Inhabited (Convexity.StdSimplex R X)
instance Convexity.StdSimplex.instNonempty E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [IsStrictOrderedRing R] [Nonempty X],
Nonempty (Convexity.StdSimplex R X)
instance Convexity.StdSimplex.instNontrivial E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [IsStrictOrderedRing R] [Nontrivial X],
Nontrivial (Convexity.StdSimplex R X)
instance Convexity.StdSimplex.instUnique E0 #
{X : Type u_2} →
{R : Type u} →
[inst : PartialOrder R] →
[inst_1 : Semiring R] → [IsStrictOrderedRing R] → [Unique X] → Unique (Convexity.StdSimplex R X)
def Convexity.StdSimplex.duple E1 #
{X : Type u_2} →
{R : Type u} →
[inst : PartialOrder R] →
[inst_1 : Semiring R] →
[IsStrictOrderedRing R] → X → X → {s t : R} → 0 ≤ s → 0 ≤ t → s + t = 1 → Convexity.StdSimplex R X
A probability distribution with weight s on x and weight t on y.
theorem Convexity.StdSimplex.weights_duple E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R] (x y : X)
{s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t) (h : s + t = 1),
(Convexity.StdSimplex.duple x y hs ht h).weights = (fun₀ | x => s) + fun₀ | y => t
def Convexity.StdSimplex.map E3 #
{R : Type u} →
[inst : PartialOrder R] →
[inst_1 : Semiring R] →
[IsStrictOrderedRing R] →
{X : Type v} → {Y : Type w} → (X → Y) → Convexity.StdSimplex R X → Convexity.StdSimplex R Y
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.
theorem Convexity.StdSimplex.weights_map E0 #
∀ {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R] {X : Type v} {Y : Type w}
(g : X → Y) (f : Convexity.StdSimplex R X), (Convexity.StdSimplex.map g f).weights = Finsupp.mapDomain g f.weights
theorem Convexity.StdSimplex.map_const E0 #
∀ {X : Type u_2} {Y : Type u_3} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] (f : Convexity.StdSimplex R X) (x : Y),
Convexity.StdSimplex.map (fun x_1 ↦ x) f = Convexity.StdSimplex.single x
theorem Convexity.StdSimplex.map_single E0 #
∀ {X : Type u_2} {Y : Type u_3} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] (x : X) (f : X → Y),
Convexity.StdSimplex.map f (Convexity.StdSimplex.single x) = Convexity.StdSimplex.single (f x)
theorem Convexity.StdSimplex.map_duple E0 #
∀ {X : Type u_2} {Y : Type u_3} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t) (h : s + t = 1) (x y : X) (f : X → Y),
Convexity.StdSimplex.map f (Convexity.StdSimplex.duple x y hs ht h) = Convexity.StdSimplex.duple (f x) (f y) hs ht h
theorem Convexity.StdSimplex.map_id E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
(f : Convexity.StdSimplex R X), Convexity.StdSimplex.map id f = f
theorem Convexity.StdSimplex.map_id' E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R],
Convexity.StdSimplex.map id = id
theorem Convexity.StdSimplex.map_comp E0 #
∀ {X : Type u_2} {Y : Type u_3} {Z : Type u_4} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] (f : Convexity.StdSimplex R X) (g₁ : X → Y) (g₂ : Y → Z),
Convexity.StdSimplex.map (g₂ ∘ g₁) f = Convexity.StdSimplex.map g₂ (Convexity.StdSimplex.map g₁ f)
theorem Convexity.StdSimplex.map_comp' E0 #
∀ {X : Type u_2} {Y : Type u_3} {Z : Type u_4} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] (g₁ : X → Y) (g₂ : Y → Z),
Convexity.StdSimplex.map (g₂ ∘ g₁) = Convexity.StdSimplex.map g₂ ∘ Convexity.StdSimplex.map g₁
theorem Convexity.StdSimplex.map_map E0 #
∀ {X : Type u_2} {Y : Type u_3} {Z : Type u_4} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] (f : Convexity.StdSimplex R X) (g₁ : X → Y) (g₂ : Y → Z),
Convexity.StdSimplex.map g₂ (Convexity.StdSimplex.map g₁ f) = Convexity.StdSimplex.map (fun x ↦ g₂ (g₁ x)) f
theorem Convexity.StdSimplex.mem_range_map_iff E0 #
∀ {X : Type u_2} {Y : Type u_3} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] (f : X → Y) (s : Convexity.StdSimplex R Y),
s ∈ Set.range (Convexity.StdSimplex.map f) ↔ ∀ x ∉ Set.range f, s.weights x = 0
def Convexity.StdSimplex.equivIcc E1 #
{R' : Type u_8} →
[inst : Ring R'] →
[inst_1 : PartialOrder R'] → [IsStrictOrderedRing R'] → Convexity.StdSimplex R' (Fin 2) ≃ ↑(Set.Icc 0 1)
The bijection between the one dimensional standard simplex
and the interval [0, 1].
theorem Convexity.StdSimplex.equivIcc_symm_apply E0 #
∀ {R' : Type u_8} [inst : Ring R'] [inst_1 : PartialOrder R'] [inst_2 : IsStrictOrderedRing R'] (t : ↑(Set.Icc 0 1)),
Convexity.StdSimplex.equivIcc.symm t = Convexity.StdSimplex.duple 0 1 ⋯ ⋯ ⋯
theorem Convexity.StdSimplex.equivIcc_apply_coe E0 #
∀ {R' : Type u_8} [inst : Ring R'] [inst_1 : PartialOrder R'] [inst_2 : IsStrictOrderedRing R']
(s : Convexity.StdSimplex R' (Fin 2)), ↑(Convexity.StdSimplex.equivIcc s) = s.weights 1
theorem Convexity.StdSimplex.equivIcc_single_zero E0 #
∀ {R' : Type u_8} [inst : Ring R'] [inst_1 : PartialOrder R'] [inst_2 : IsStrictOrderedRing R'],
Convexity.StdSimplex.equivIcc (Convexity.StdSimplex.single 0) = 0
theorem Convexity.StdSimplex.equivIcc_single_one E0 #
∀ {R' : Type u_8} [inst : Ring R'] [inst_1 : PartialOrder R'] [inst_2 : IsStrictOrderedRing R'],
Convexity.StdSimplex.equivIcc (Convexity.StdSimplex.single 1) = 1
theorem Convexity.StdSimplex.equivIcc_symm_zero E0 #
∀ {R' : Type u_8} [inst : Ring R'] [inst_1 : PartialOrder R'] [inst_2 : IsStrictOrderedRing R'],
Convexity.StdSimplex.equivIcc.symm 0 = Convexity.StdSimplex.single 0
theorem Convexity.StdSimplex.equivIcc_symm_one E0 #
∀ {R' : Type u_8} [inst : Ring R'] [inst_1 : PartialOrder R'] [inst_2 : IsStrictOrderedRing R'],
Convexity.StdSimplex.equivIcc.symm 1 = Convexity.StdSimplex.single 1
def Convexity.StdSimplex.join E1 #
{X : Type u_2} →
{R : Type u} →
[inst : PartialOrder R] →
[inst_1 : Semiring R] →
[IsStrictOrderedRing R] → Convexity.StdSimplex R (Convexity.StdSimplex R X) → Convexity.StdSimplex R X
Join operation for standard simplices (monadic join). Given a distribution over distributions, flattens it to a single distribution.
Use ConvexSpace.sConvexComb instead.
theorem Convexity.StdSimplex.weights_join E0 #
∀ {X : Type u_2} {R : Type u} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
(f : Convexity.StdSimplex R (Convexity.StdSimplex R X)), f.join.weights = f.sum fun d r ↦ r • d.weights
def Convexity.StdSimplex.restrict E1 #
{X : Type u_2} →
{K : Type u_7} →
[inst : DivisionSemiring K] →
[inst_1 : LinearOrder K] →
[IsStrictOrderedRing K] →
(w : Convexity.StdSimplex K X) → (s : Set X) → (∃ x ∈ s, w.weights x ≠ 0) → Convexity.StdSimplex K X
Project an element of the standard simplex to a lower-dimensional standard simplex, assuming at least one non-zero weight subsists.
theorem Convexity.StdSimplex.weights_restrict E1 #
∀ {X : Type u_2} {K : Type u_7} [inst : DivisionSemiring K] [inst_1 : LinearOrder K] [inst_2 : IsStrictOrderedRing K]
(w : Convexity.StdSimplex K X) (s : Set X) (hs : ∃ x ∈ s, w.weights x ≠ 0) [inst_3 : DecidablePred fun x ↦ x ∈ s],
(w.restrict s hs).weights =
((Finsupp.filter (fun x ↦ x ∈ s) w.weights).sum fun _x k ↦ k)⁻¹ • Finsupp.filter (fun x ↦ x ∈ s) w.weights
theorem Convexity.StdSimplex.support_weights_restrict E0 #
∀ {X : Type u_2} {K : Type u_7} [inst : DivisionSemiring K] [inst_1 : LinearOrder K] [inst_2 : IsStrictOrderedRing K]
(w : Convexity.StdSimplex K X) (s : Set X) (hs : ∃ x ∈ s, w.weights x ≠ 0) [inst_3 : DecidablePred fun x ↦ x ∈ s],
(w.restrict s hs).support = {x ∈ w.support | x ∈ s}
theorem Convexity.StdSimplex.restrict_singleton E0 #
∀ {X : Type u_2} {K : Type u_7} [inst : DivisionSemiring K] [inst_1 : LinearOrder K] [inst_2 : IsStrictOrderedRing K]
(w : Convexity.StdSimplex K X) (x : X) (hx : ∃ x_1 ∈ {x}, w.weights x_1 ≠ 0),
w.restrict {x} hx = Convexity.StdSimplex.single x
class Convexity.ConvexSpace E1 #
(R : Type u) →
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.
ctor Convexity.ConvexSpace.mk' E0 #
{R : Type u} →
{X : Type v} →
[inst₁ : PartialOrder R] →
[inst₂ : Semiring R] →
[inst₃ : IsStrictOrderedRing R] →
(sConvexComb : Convexity.StdSimplex R X → X) →
(∀ (x : X), sConvexComb (Convexity.StdSimplex.single x) = x) →
(∀ (f : Convexity.StdSimplex R (Convexity.StdSimplex R X)),
sConvexComb (Convexity.StdSimplex.map sConvexComb f) = sConvexComb f.join) →
Convexity.ConvexSpace R X
Use mk instead.
abbrev Convexity.ConvexSpace.sConvexComb E1 #
{R : Type u} →
{X : Type v} →
[inst₁ : PartialOrder R] →
[inst₂ : Semiring R] →
[inst₃ : IsStrictOrderedRing R] → [self : Convexity.ConvexSpace R X] → Convexity.StdSimplex R X → X
Take a convex combination with the given probability distribution over points.
theorem Convexity.ConvexSpace.sConvexComb_single E0 #
∀ {R : Type u} {X : Type v} {inst₁ : PartialOrder R} {inst₂ : Semiring R} {inst₃ : IsStrictOrderedRing R}
[self : Convexity.ConvexSpace R X] (x : X), Convexity.sConvexComb (Convexity.StdSimplex.single x) = x
A convex combination of a single point is that point.
theorem Convexity.ConvexSpace.assoc E1 #
∀ {R : Type u} {X : Type v} {inst₁ : PartialOrder R} {inst₂ : Semiring R} {inst₃ : IsStrictOrderedRing R}
[self : Convexity.ConvexSpace R X] (f : Convexity.StdSimplex R (Convexity.StdSimplex R X)),
Convexity.sConvexComb (Convexity.StdSimplex.map Convexity.sConvexComb f) = Convexity.sConvexComb f.join
Associativity of convex combination (monadic join law).
Use sConvexComb_sConvexComb instead.
def Convexity.iConvexComb E3 #
{R : Type u_1} →
{X : Type u_2} →
{I : Type u_5} →
[inst : PartialOrder R] →
[inst_1 : Semiring R] →
[inst_2 : IsStrictOrderedRing R] → [Convexity.ConvexSpace R X] → Convexity.StdSimplex R I → (I → X) → X
Take a convex combination with the given weight distribution of an indexed family of points.
def Convexity.convexCombPair E3 #
{R : Type u_1} →
{X : Type u_2} →
[inst : PartialOrder R] →
[inst_1 : Semiring R] →
[inst_2 : IsStrictOrderedRing R] →
[Convexity.ConvexSpace R X] → (s t : R) → 0 ≤ s → 0 ≤ t → s + t = 1 → X → X → X
Take a convex combination of two points.
instance Convexity.StdSimplex.instConvexSpace E0 #
{R : Type u_1} →
{I : Type u_5} →
[inst : PartialOrder R] →
[inst_1 : Semiring R] → [inst_2 : IsStrictOrderedRing R] → Convexity.ConvexSpace R (Convexity.StdSimplex R I)
theorem Convexity.StdSimplex.weights_sConvexComb E0 #
∀ {R : Type u_1} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
(f : Convexity.StdSimplex R (Convexity.StdSimplex R I)),
(Convexity.sConvexComb f).weights = f.sum fun d r ↦ r • d.weights
theorem Convexity.StdSimplex.weights_iConvexComb E0 #
∀ {R : Type u_1} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
(w : Convexity.StdSimplex R I) (f : I → Convexity.StdSimplex R I),
(Convexity.iConvexComb w f).weights = w.sum fun i r ↦ r • (f i).weights
theorem Convexity.StdSimplex.weights_convexCombPair E0 #
∀ {R : Type u_1} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
(w w' : Convexity.StdSimplex R I) (s t : R) (hs : 0 ≤ s) (ht : 0 ≤ t) (hst : s + t = 1),
(Convexity.convexCombPair s t hs ht hst w w').weights = s • w.weights + t • w'.weights
theorem Convexity.StdSimplex.map_sConvexComb E0 #
∀ {R : Type u_1} {I : Type u_5} {J : Type u_6} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] (s : Convexity.StdSimplex R (Convexity.StdSimplex R I)) (f : I → J),
Convexity.StdSimplex.map f (Convexity.sConvexComb s) =
Convexity.sConvexComb (Convexity.StdSimplex.map (Convexity.StdSimplex.map f) s)
theorem Convexity.StdSimplex.iConvexComb_single E0 #
∀ {R : Type u_1} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
(x : Convexity.StdSimplex R I), Convexity.iConvexComb x Convexity.StdSimplex.single = x
theorem Convexity.StdSimplex.convexCombPair_restrict_restrict_compl E1 #
∀ {I : Type u_5} {K : Type u_7} [inst : DivisionSemiring K] [inst_1 : LinearOrder K] [inst_2 : IsStrictOrderedRing K]
(w : Convexity.StdSimplex K I) (s : Set I) (hs : ∃ x ∈ s, w.weights x ≠ 0) (hs' : ∃ x ∈ sᶜ, w.weights x ≠ 0)
[inst_3 : DecidablePred fun x ↦ x ∈ s],
Convexity.convexCombPair ((Finsupp.filter (fun x ↦ x ∈ s) w.weights).sum fun _x k ↦ k)
((Finsupp.filter (fun x ↦ x ∉ s) w.weights).sum fun _x k ↦ k) ⋯ ⋯ ⋯ (w.restrict s hs) (w.restrict sᶜ hs') =
w
theorem Convexity.sConvexComb_sConvexComb E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] (f : Convexity.StdSimplex R (Convexity.StdSimplex R X)),
Convexity.sConvexComb (Convexity.sConvexComb f) =
Convexity.sConvexComb (Convexity.StdSimplex.map Convexity.sConvexComb f)
theorem Convexity.sConvexComb_convexCombPair E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] (s t : R) (hs : 0 ≤ s) (ht : 0 ≤ t) (hst : s + t = 1)
(w w' : Convexity.StdSimplex R X),
Convexity.sConvexComb (Convexity.convexCombPair s t hs ht hst w w') =
Convexity.convexCombPair s t hs ht hst (Convexity.sConvexComb w) (Convexity.sConvexComb w')
abbrev Convexity.ConvexSpace.mk E1 #
{R : Type u_1} →
[inst : PartialOrder R] →
[inst_1 : Semiring R] →
[inst_2 : IsStrictOrderedRing R] →
{X : Type u_8} →
(sConvexComb : Convexity.StdSimplex R X → X) →
(∀ (x : X), sConvexComb (Convexity.StdSimplex.single x) = x) →
(∀ (f : Convexity.StdSimplex R (Convexity.StdSimplex R X)),
sConvexComb (Convexity.StdSimplex.map sConvexComb f) = sConvexComb (Convexity.sConvexComb f)) →
Convexity.ConvexSpace R X
The public constructor for ConvexSpace.
structure Convexity.IsAffineMap E1 #
(R : Type u_1) →
{X : Type u_2} →
{Y : Type u_3} →
[inst : PartialOrder R] →
[inst_1 : Semiring R] →
[inst_2 : IsStrictOrderedRing R] → [Convexity.ConvexSpace R X] → [Convexity.ConvexSpace R Y] → (X → Y) → Prop
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.
ctor Convexity.IsAffineMap.mk E0 #
∀ {R : Type u_1} {X : Type u_2} {Y : Type u_3} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] [inst_4 : Convexity.ConvexSpace R Y]
{f : X → Y},
(∀ (s : Convexity.StdSimplex R X),
f (Convexity.sConvexComb s) = Convexity.sConvexComb (Convexity.StdSimplex.map f s)) →
Convexity.IsAffineMap R f
theorem Convexity.IsAffineMap.map_sConvexComb E0 #
∀ {R : Type u_1} {X : Type u_2} {Y : Type u_3} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] [inst_4 : Convexity.ConvexSpace R Y]
{f : X → Y},
Convexity.IsAffineMap R f →
∀ (s : Convexity.StdSimplex R X), f (Convexity.sConvexComb s) = Convexity.sConvexComb (Convexity.StdSimplex.map f s)
theorem Convexity.IsAffineMap.id E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X], Convexity.IsAffineMap R id
theorem Convexity.IsAffineMap.comp E1 #
∀ {R : Type u_1} {X : Type u_2} {Y : Type u_3} {Z : Type u_4} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] [inst_4 : Convexity.ConvexSpace R Y]
[inst_5 : Convexity.ConvexSpace R Z] {g : Y → Z},
Convexity.IsAffineMap R g → ∀ {f : X → Y}, Convexity.IsAffineMap R f → Convexity.IsAffineMap R (g ∘ f)
theorem Convexity.IsAffineMap.const E1 #
∀ {R : Type u_1} {X : Type u_2} {Y : Type u_3} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] [inst_4 : Convexity.ConvexSpace R Y] (x : Y),
Convexity.IsAffineMap R fun x_1 ↦ x
theorem Convexity.StdSimplex.isAffineMap_map E1 #
∀ (R : Type u_1) {I : Type u_5} {J : Type u_6} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] (f : I → J), Convexity.IsAffineMap R (Convexity.StdSimplex.map f)
theorem Convexity.sConvexComb_map E1 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] (w : Convexity.StdSimplex R I) (f : I → X),
Convexity.sConvexComb (Convexity.StdSimplex.map f w) = Convexity.iConvexComb w f
theorem Convexity.iConvexComb_const E0 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] (s : Convexity.StdSimplex R I) (m : X),
(Convexity.iConvexComb s fun x ↦ m) = m
theorem Convexity.iConvexComb_single E0 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] (i : I) (f : I → X),
Convexity.iConvexComb (Convexity.StdSimplex.single i) f = f i
theorem Convexity.iConvexComb_id E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] (w : Convexity.StdSimplex R X),
Convexity.iConvexComb w id = Convexity.sConvexComb w
theorem Convexity.iConvexComb_id' E0 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] (w : Convexity.StdSimplex R X),
(Convexity.iConvexComb w fun x ↦ x) = Convexity.sConvexComb w
theorem Convexity.iConvexComb_map E0 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} {J : Type u_6} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] (s : Convexity.StdSimplex R I) (f : I → J)
(g : J → X), Convexity.iConvexComb (Convexity.StdSimplex.map f s) g = Convexity.iConvexComb s fun i ↦ g (f i)
theorem Convexity.iConvexComb_congr E1 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] {w w' : Convexity.StdSimplex R I} {f g : I → X},
w = w' → (∀ (i : I), w.weights i ≠ 0 → f i = g i) → Convexity.iConvexComb w f = Convexity.iConvexComb w' g
theorem Convexity.iConvexComb_reindex E1 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} {J : Type u_6} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] (s : Convexity.StdSimplex R I) (f : I ≃ J)
(g : I → X), Convexity.iConvexComb s g = Convexity.iConvexComb (Convexity.StdSimplex.map (⇑f) s) (g ∘ ⇑f.symm)
theorem Convexity.iConvexComb_assoc'' E1 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] {J : I → Type u_8}
(s : Convexity.StdSimplex R I) (f : (i : I) → Convexity.StdSimplex R (J i)) (g : (i : I) → J i → X),
(Convexity.iConvexComb s fun i ↦ Convexity.iConvexComb (f i) (g i)) =
Convexity.iConvexComb (Convexity.iConvexComb s fun i ↦ Convexity.StdSimplex.map (fun x ↦ ⟨i, x⟩) (f i))
(Sigma.uncurry g)
Flattening nested iConvexCombs.
See iConvexComb_assoc' and iConvexComb_assoc for non-dependent versions.
theorem Convexity.iConvexComb_assoc' E1 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] {J : Type u_8} (s : Convexity.StdSimplex R I)
(f : I → Convexity.StdSimplex R J) (g : I → J → X),
(Convexity.iConvexComb s fun i ↦ Convexity.iConvexComb (f i) (g i)) =
Convexity.iConvexComb (Convexity.iConvexComb s fun i ↦ Convexity.StdSimplex.map (fun x ↦ (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 E1 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] {J : Type u_8} (s : Convexity.StdSimplex R I)
(f : I → Convexity.StdSimplex R J) (g : J → X),
(Convexity.iConvexComb s fun i ↦ Convexity.iConvexComb (f i) g) = Convexity.iConvexComb (Convexity.iConvexComb s f) g
Flattening nested iConvexCombs.
See iConvexComb_assoc', iConvexComb_assoc'' for more dependent versions.
class Convexity.IsConvexCombComm E1 #
(R : Type u_8) →
(S : Type u_9) →
(X : Type u_10) →
[inst : PartialOrder R] →
[inst_1 : Semiring R] →
[inst_2 : IsStrictOrderedRing R] →
[inst_3 : PartialOrder S] →
[inst_4 : Semiring S] →
[inst_5 : IsStrictOrderedRing S] → [Convexity.ConvexSpace R X] → [Convexity.ConvexSpace S X] → Prop
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.
ctor Convexity.IsConvexCombComm.mk E0 #
∀ {R : Type u_8} {S : Type u_9} {X : Type u_10} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : PartialOrder S] [inst_4 : Semiring S] [inst_5 : IsStrictOrderedRing S]
[inst_6 : Convexity.ConvexSpace R X] [inst_7 : Convexity.ConvexSpace S X],
(∀ {n : ℕ} (f : Convexity.StdSimplex R (Fin n → X)) (g : Convexity.StdSimplex S (Fin n)),
(Convexity.iConvexComb f fun e ↦ Convexity.iConvexComb g e) =
Convexity.iConvexComb g fun i ↦ Convexity.iConvexComb f fun x ↦ x i) →
Convexity.IsConvexCombComm R S X
theorem Convexity.IsConvexCombComm.iConvexComb_comm' E1 #
∀ {R : Type u_8} {S : Type u_9} {X : Type u_10} {inst : PartialOrder R} {inst_1 : Semiring R}
{inst_2 : IsStrictOrderedRing R} {inst_3 : PartialOrder S} {inst_4 : Semiring S} {inst_5 : IsStrictOrderedRing S}
{inst_6 : Convexity.ConvexSpace R X} {inst_7 : Convexity.ConvexSpace S X} [self : Convexity.IsConvexCombComm R S X]
{n : ℕ} (f : Convexity.StdSimplex R (Fin n → X)) (g : Convexity.StdSimplex S (Fin n)),
(Convexity.iConvexComb f fun e ↦ Convexity.iConvexComb g e) =
Convexity.iConvexComb g fun i ↦ Convexity.iConvexComb f fun x ↦ x i
R-convex combinations commute with S-convex combinations of Fin n-indexed families.
This is stated for Fin n so that the class does not depend on an extra universe parameter.
Use Convexity.iConvexComb_comm instead, which works for arbitrary index types.
theorem Convexity.iConvexComb_comm E1 #
∀ {R : Type u_8} {S : Type u_9} {X : Type u_10} {I : Type u_11} {J : Type u_12} [inst : PartialOrder R]
[inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R] [inst_3 : PartialOrder S] [inst_4 : Semiring S]
[inst_5 : IsStrictOrderedRing S] [inst_6 : Convexity.ConvexSpace R X] [inst_7 : Convexity.ConvexSpace S X]
[Convexity.IsConvexCombComm R S X] (f : Convexity.StdSimplex R I) (g : Convexity.StdSimplex S J) (e : I → J → X),
(Convexity.iConvexComb f fun i ↦ Convexity.iConvexComb g (e i)) =
Convexity.iConvexComb g fun j ↦ Convexity.iConvexComb f fun i ↦ e i j
R-convex combinations commute with S-convex combinations.
theorem Convexity.IsConvexCombComm.symm E1 #
∀ (R : Type u_8) (S : Type u_9) (X : Type u_10) [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : PartialOrder S] [inst_4 : Semiring S] [inst_5 : IsStrictOrderedRing S]
[inst_6 : Convexity.ConvexSpace R X] [inst_7 : Convexity.ConvexSpace S X] [Convexity.IsConvexCombComm R S X],
Convexity.IsConvexCombComm S R X
Commutativity of convex combinations is a symmetric relation.
This is not an instance as it would cause loops.
instance Convexity.IsConvexCombComm.instSelf E0 #
∀ {R : Type u_8} {X : Type u_9} [inst : PartialOrder R] [inst_1 : CommSemiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X], Convexity.IsConvexCombComm R R X
When R is commutative, so are its convex combinations.
theorem Convexity.IsAffineMap.map_iConvexComb E0 #
∀ {R : Type u_1} {X : Type u_2} {Y : Type u_3} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] [inst_4 : Convexity.ConvexSpace R Y]
{f : X → Y},
Convexity.IsAffineMap R f →
∀ (s : Convexity.StdSimplex R I) (g : I → X), f (Convexity.iConvexComb s g) = Convexity.iConvexComb s (f ∘ g)
theorem Convexity.map_iConvexComb E0 #
∀ {R : Type u_1} {I : Type u_5} {J : Type u_6} {K : Type u_7} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] {f : J → K} (s : Convexity.StdSimplex R I) (g : I → Convexity.StdSimplex R J),
Convexity.StdSimplex.map f (Convexity.iConvexComb s g) = Convexity.iConvexComb s (Convexity.StdSimplex.map f ∘ g)
theorem Convexity.sConvexComb_map_iConvexComb E0 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] (f : I → X)
(s : Convexity.StdSimplex R (Convexity.StdSimplex R I)),
Convexity.sConvexComb (Convexity.StdSimplex.map (fun s ↦ Convexity.iConvexComb s f) s) =
Convexity.iConvexComb (Convexity.sConvexComb s) f
theorem Convexity.convexCombPair_def E0 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t) (h : s + t = 1) (p q : X),
Convexity.convexCombPair s t hs ht h p q = Convexity.iConvexComb (Convexity.StdSimplex.duple 0 1 hs ht h) ![p, q]
theorem Convexity.convexCombPair_zero E0 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {x y : X}, Convexity.convexCombPair 0 1 ⋯ ⋯ ⋯ x y = y
A binary convex combination with weight 0 on the first point returns the second point.
theorem Convexity.convexCombPair_one E0 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {x y : X}, Convexity.convexCombPair 1 0 ⋯ ⋯ ⋯ x y = x
A binary convex combination with weight 1 on the first point returns the first point.
theorem Convexity.convexCombPair_same E0 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t) (h : s + t = 1) {x : X},
Convexity.convexCombPair s t hs ht h x x = x
A convex combination of a point with itself is that point.
theorem Convexity.convexCombPair_symm E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t) (h : s + t = 1) {x y : X},
Convexity.convexCombPair s t hs ht h x y = Convexity.convexCombPair t s ht hs ⋯ y x
theorem Convexity.IsAffineMap.map_convexCombPair E0 #
∀ {R : Type u_1} {X : Type u_2} {Y : Type u_3} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] [inst_4 : Convexity.ConvexSpace R Y]
{f : X → Y},
Convexity.IsAffineMap R f →
∀ {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t) (h : s + t = 1) (x y : X),
f (Convexity.convexCombPair s t hs ht h x y) = Convexity.convexCombPair s t hs ht h (f x) (f y)
theorem Convexity.convexCombPair_iConvexComb_iConvexComb E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t) (h : s + t = 1) {J₁ : Type u₁} {J₂ : Type u₂}
(g₁ : Convexity.StdSimplex R J₁) (g₂ : Convexity.StdSimplex R J₂) (m₁ : J₁ → X) (m₂ : J₂ → X),
Convexity.convexCombPair s t hs ht h (Convexity.iConvexComb g₁ m₁) (Convexity.iConvexComb g₂ m₂) =
Convexity.sConvexComb
(Convexity.convexCombPair s t hs ht h (Convexity.StdSimplex.map m₁ g₁) (Convexity.StdSimplex.map m₂ g₂))
Flattening with the outer combination specialized to convexCombPair.
theorem Convexity.iConvexComb_convexCombPair E1 #
∀ {R : Type u_1} {X : Type u_2} {I : Type u_5} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] (s t : I → R) (hs : ∀ (i : I), 0 ≤ s i)
(ht : ∀ (i : I), 0 ≤ t i) (h : ∀ (i : I), s i + t i = 1) (f : Convexity.StdSimplex R I) (m₁ m₂ : I → X),
(Convexity.iConvexComb f fun i ↦ Convexity.convexCombPair (s i) (t i) ⋯ ⋯ ⋯ (m₁ i) (m₂ i)) =
Convexity.sConvexComb (Convexity.iConvexComb f fun i ↦ Convexity.StdSimplex.duple (m₁ i) (m₂ i) ⋯ ⋯ ⋯)
Flattening with the inner combination specialized to convexCombPair.
theorem Convexity.convexCombPair_iConvexComb_left E1 #
∀ {R : Type u_1} {X : Type u_2} {J : Type u_6} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t)
(h : s + t = 1) (g : Convexity.StdSimplex R J) (e : J → X) (m : X),
Convexity.convexCombPair s t hs ht h (Convexity.iConvexComb g e) m =
Convexity.sConvexComb
(Convexity.convexCombPair s t hs ht h (Convexity.StdSimplex.map e g) (Convexity.StdSimplex.single m))
theorem Convexity.convexCombPair_iConvexComb_right E1 #
∀ {R : Type u_1} {X : Type u_2} {J : Type u_6} [inst : PartialOrder R] [inst_1 : Semiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t)
(h : s + t = 1) (m : X) (g : Convexity.StdSimplex R J) (e : J → X),
Convexity.convexCombPair s t hs ht h m (Convexity.iConvexComb g e) =
Convexity.sConvexComb
(Convexity.convexCombPair s t hs ht h (Convexity.StdSimplex.single m) (Convexity.StdSimplex.map e g))
theorem Convexity.convexCombPair_convexCombPair_left_eq_sConvexComb E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {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₃ : X),
Convexity.convexCombPair s t hs ht h (Convexity.convexCombPair s' t' hs' ht' h' m₁ m₂) m₃ =
Convexity.sConvexComb
(Convexity.convexCombPair s t hs ht h (Convexity.StdSimplex.duple m₁ m₂ hs' ht' h')
(Convexity.StdSimplex.single m₃))
Flattening nested binary convex combination into a single convex combination.
theorem Convexity.convexCombPair_convexCombPair_right_eq_sConvexComb E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {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₃ : X),
Convexity.convexCombPair s t hs ht h m₁ (Convexity.convexCombPair s' t' hs' ht' h' m₂ m₃) =
Convexity.sConvexComb
(Convexity.convexCombPair s t hs ht h (Convexity.StdSimplex.single m₁)
(Convexity.StdSimplex.duple m₂ m₃ hs' ht' h'))
Flattening nested binary convex combination into a single convex combination.
theorem Convexity.convexCombPair_convexCombPair_assoc_left E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {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),
t * s'' = s * t' * t'' →
∀ (m₁ m₂ m₃ : X),
Convexity.convexCombPair s t hs ht h (Convexity.convexCombPair s' t' hs' ht' h' m₁ m₂) m₃ =
Convexity.convexCombPair (s * s') (s * t' + t) ⋯ ⋯ ⋯ m₁ (Convexity.convexCombPair s'' t'' hs'' ht'' h'' m₂ m₃)
theorem Convexity.convexCombPair_convexCombPair_assoc_right E1 #
∀ {R : Type u_1} {X : Type u_2} [inst : PartialOrder R] [inst_1 : Semiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {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),
s * t'' = t * s' * s'' →
∀ (m₁ m₂ m₃ : X),
Convexity.convexCombPair s t hs ht h m₁ (Convexity.convexCombPair s' t' hs' ht' h' m₂ m₃) =
Convexity.convexCombPair (s + t * s') (t * t') ⋯ ⋯ ⋯ (Convexity.convexCombPair s'' t'' hs'' ht'' h'' m₁ m₂) m₃
theorem Convexity.iConvexComb_convexCombPair_comm E1 #
∀ {R : Type u_8} {X : Type u_9} {I : Type u_10} [inst : PartialOrder R] [inst_1 : CommSemiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t)
(h : s + t = 1) (f : Convexity.StdSimplex R I) (e₁ e₂ : I → X),
(Convexity.iConvexComb f fun x ↦ Convexity.convexCombPair s t hs ht h (e₁ x) (e₂ x)) =
Convexity.convexCombPair s t hs ht h (Convexity.iConvexComb f e₁) (Convexity.iConvexComb f e₂)
theorem Convexity.iConvexComb_convexCombPair_comm_left E1 #
∀ {R : Type u_8} {X : Type u_9} {I : Type u_10} [inst : PartialOrder R] [inst_1 : CommSemiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t)
(h : s + t = 1) (f : Convexity.StdSimplex R I) (m : X) (e : I → X),
(Convexity.iConvexComb f fun x ↦ Convexity.convexCombPair s t hs ht h (e x) m) =
Convexity.convexCombPair s t hs ht h (Convexity.iConvexComb f e) m
theorem Convexity.iConvexComb_convexCombPair_comm_right E1 #
∀ {R : Type u_8} {X : Type u_9} {I : Type u_10} [inst : PartialOrder R] [inst_1 : CommSemiring R]
[inst_2 : IsStrictOrderedRing R] [inst_3 : Convexity.ConvexSpace R X] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t)
(h : s + t = 1) (f : Convexity.StdSimplex R I) (m : X) (e : I → X),
(Convexity.iConvexComb f fun x ↦ Convexity.convexCombPair s t hs ht h m (e x)) =
Convexity.convexCombPair s t hs ht h m (Convexity.iConvexComb f e)
theorem Convexity.isAffineMap_convexCombPair E1 #
∀ {R : Type u_8} {X : Type u_9} [inst : PartialOrder R] [inst_1 : CommSemiring R] [inst_2 : IsStrictOrderedRing R]
[inst_3 : Convexity.ConvexSpace R X] {s t : R} (hs : 0 ≤ s) (ht : 0 ≤ t) (h : s + t = 1) (m : X),
Convexity.IsAffineMap R (Convexity.convexCombPair s t hs ht h m)
def Mathlib.Meta.Positivity.evalStdSimplexWeights E1 #
Mathlib.Meta.Positivity.PositivityExt
Extension for the positivity tactic: the weights of a StdSimplex are always nonnegative
(in the sense of 0 ≤ w.weights),
and even positive (in the sense of 0 < w.weights, not ∀ i, 0 < w.weights i) when R is
nontrivial.
This handles w.weights; see evalStdSimplexWeightsApply for the applied w.weights i.
def Mathlib.Meta.Positivity.evalStdSimplexWeightsApply E1 #
Mathlib.Meta.Positivity.PositivityExt
Extension for the positivity tactic: the weights of a StdSimplex are always nonnegative.
This handles w.weights i; see evalStdSimplexWeights for the unapplied w.weights.
Deprecated aliases
| Name | New name | Since |
|---|---|---|
Convexity.ConvexSpace.convexCombination | Convexity.ConvexSpace.sConvexComb | 2026-05-04 |
Convexity.ConvexSpace.convexCombination_single | Convexity.ConvexSpace.sConvexComb_single | 2026-05-04 |
Convexity.convexComboPair | Convexity.convexCombPair | 2026-05-15 |
Convexity.convexComboPair_one | Convexity.convexCombPair_one | 2026-05-15 |
Convexity.convexComboPair_symm | Convexity.convexCombPair_same | 2026-05-15 |
Convexity.convexComboPair_zero | Convexity.convexCombPair_zero | 2026-05-15 |