Convert the book's strict-parameter definition to mathlib's Convex.
Convert mathlib's Convex to the book's strict-parameter definition.
The dot product with a fixed vector is linear in the left argument.
Definition 2.1.2. A set is a polyhedral convex set if it can be expressed as the
intersection of finitely many closed half-spaces in Real^n.
Equations
- IsPolyhedralConvexSet n C = ∃ (ι : Type) (x : Fintype ι) (b : ι → Fin n → ℝ) (β : ι → ℝ), C = ⋂ (i : ι), closedHalfSpaceLE n (b i) (β i)
Instances For
Definition 2.2.10. A vector sum λ₁ x₁ + ⋯ + λₘ xₘ is called a convex combination of
x₁, ..., xₘ if λ i ≥ 0 for all i and λ₁ + ⋯ + λₘ = 1.
Equations
Instances For
Theorem 2.2. A subset of Real^n is convex if and only if it contains all the
convex combinations of its elements.
Definition 2.3.10. The intersection of all convex sets containing a subset S ⊆ Real^n
is called the convex hull of S and is denoted by conv S.
Instances For
The book's convex hull definition agrees with mathlib's convexHull.
Theorem 2.3. For any S ⊆ Real^n, conv S consists of all the convex combinations
of the elements of S.
Definition 2.3.12. If {b_0, b_1, ..., b_m} is affinely independent, its convex hull is
called an m-dimensional simplex and b_0, ..., b_m are the vertices of the simplex.
Equations
Instances For
Definition 2.3.13. For an m-dimensional simplex with vertices b_0, ..., b_m,
the point λ_0 b_0 + ⋯ + λ_m b_m with λ_0 = ⋯ = λ_m = 1 / (m + 1) is called the
midpoint or barycenter of the simplex.
Equations
- simplexBarycenter n m b = Finset.centroid ℝ Finset.univ b
Instances For
Definition 2.4.10. The dimension of a convex set C is the dimension of the affine
hull of C.
Equations
- convexSetDim n C = Module.finrank ℝ ↥(affineSpan ℝ C).direction
Instances For
Any simplex contained in C has dimension at most convexSetDim n C.
Construct a simplex from a finite affinely independent subset of a convex set.
A nonempty convex set contains a simplex of dimension convexSetDim.
Theorem 2.5. The intersection of an arbitrary collection of convex cones is a convex cone.
Definition 2.5.13. It is customary to write x ≥ x' if x - x' belongs to the
non-negative orthant, i.e. if ξ_j ≥ ξ'_j for j = 1, ..., n.
Equations
- coordwiseGE n x x' = (x - x' ∈ nonNegativeOrthant n)
Instances For
A convex cone is closed under addition.
Theorem 2.6. A subset of Real^n is a convex cone if and only if it is closed under
addition and positive scalar multiplication.
Finite positive linear combinations from add-closure and positive scalar closure.
Positive scaling follows from closure under positive linear combinations.
Add-closure follows from closure under positive linear combinations.
Corollary 2.6.1. A subset of Real^n is a convex cone if and only if it contains all the
positive linear combinations of its elements, i.e. sums λ₁ x₁ + ⋯ + λ_m x_m with λ_i > 0.
A point is a positive linear combination of elements of a set.
Equations
Instances For
Positive linear combinations are closed under positive scaling.
The sum of two positive linear combinations is a positive linear combination.
Corollary 2.6.2. Let S ⊆ Real^n, and let K be the set of all positive linear
combinations of elements of S. Then K is the smallest convex cone containing S.
Definition 2.6.10. The convex cone obtained by adjoining the origin to the cone in
Corollary 2.6.2 (equivalently, Corollary 2.6.3) is called the convex cone generated by S
(or by a convex set C) and is denoted cone S.
Equations
- convexConeGenerated n S = Set.insert 0 ↑(ConvexCone.hull ℝ S)
Instances For
Elements of the nonnegative ray lie in the generated cone.
The generated cone is convex.