Convex combinations #
This file defines convex combinations of points in a vector space.
Main declarations #
Finset.centerMass
: Center of mass of a finite family of points.
Implementation notes #
We divide by the sum of the weights in the definition of Finset.centerMass
because of the way
mathematical arguments go: one doesn't change weights, but merely adds some. This also makes a few
lemmas unconditional on the sum of the weights being 1
.
Center of mass of a finite collection of points with prescribed weights.
Note that we require neither 0 ≤ w i
nor ∑ w = 1
.
Instances For
A convex combination of two centers of mass is a center of mass as well. This version deals with two different index types.
A convex combination of two centers of mass is a center of mass as well. This version works if two centers of mass share the set of original points.
The center of mass of a finite subset of a convex set belongs to the set provided that all weights are non-negative, and the total weight is positive.
A version of Convex.sum_mem
for finsum
s. If s
is a convex set, w : ι → R
is a family of
nonnegative weights with sum one and z : ι → E
is a family of elements of a module over R
such
that z i ∈ s
whenever w i ≠ 0
, then the sum ∑ᶠ i, w i • z i
belongs to s
. See also
PartitionOfUnity.finsum_smul_mem_convex
.
A version of Finset.centerMass_mem_convexHull
for when the weights are nonpositive.
A refinement of Finset.centerMass_mem_convexHull
when the indexed family is a Finset
of
the space.
A version of Finset.centerMass_mem_convexHull
for when the weights are nonpositive.
The centroid can be regarded as a center of mass.
Convex hull of s
is equal to the set of all centers of masses of Finset
s t
, z '' t ⊆ s
.
For universe reasons, you shouldn't use this lemma to prove that a given center of mass belongs
to the convex hull. Use convexity of the convex hull instead.
Universe polymorphic version of the reverse implication of mem_convexHull_iff_exists_fintype
.
The convex hull of s
is equal to the set of centers of masses of finite families of points in
s
.
For universe reasons, you shouldn't use this lemma to prove that a given center of mass belongs
to the convex hull. Use mem_convexHull_of_exists_fintype
of the convex hull instead.
This is a version of Finset.mem_convexHull
stated without Finset.centerMass
.
A weak version of Carathéodory's theorem.
convexHull
is an additive monoid morphism under pointwise addition.
Equations
- convexHullAddMonoidHom R E = { toFun := ⇑(convexHull R), map_zero' := ⋯, map_add' := ⋯ }
Instances For
stdSimplex 𝕜 ι
is the convex hull of the canonical basis in ι → 𝕜
.
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.
All values of a function f ∈ stdSimplex 𝕜 ι
belong to [0, 1]
.
The convex hull of an affine basis is the intersection of the half-spaces defined by the corresponding barycentric coordinates.
Two simplices glue nicely if the union of their vertices is affine independent.
Two simplices glue nicely if the union of their vertices is affine independent.
Note that AffineIndependent.convexHull_inter
should be more versatile in most use cases.