Quelle Caratheodory.lean
Sprache: Lean
|
|
/-
Copyright (c) 2020 Kim Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin, Kim Morrison
-/
module
public import Mathlib.Analysis.Convex.Combination
/-!
# Carathéodory's convexity theorem
Convex hull can be regarded as a refinement of affine span. Both are closure operators but whereas
convex hull takes values in the lattice of convex subsets, affine span takes values in the much
coarser sublattice of affine subspaces.
The cost of this refinement is that one no longer has bases. However Carathéodory's convexity
theorem offers some compensation. Given a set `s` together with a point `x` in its convex hull,
Carathéodory says that one may find an affine-independent family of elements `s` whose convex hull
contains `x`. Thus the difference from the case of affine span is that the affine-independent family
depends on `x`.
In particular, in finite dimensions Carathéodory's theorem implies that the convex hull of a set `s`
in `ᵈ` is the union of the convex hulls of the `(d + 1)`-tuples in `s`.
## Main results
* `convexHull_eq_union`: Carathéodory's convexity theorem
## Implementation details
This theorem was formalized as part of the Sphere Eversion project.
## Tags
convex hull, caratheodory
-/
@[expose] public section
open Set Finset
universe u
variable { : Type*} {E : Type u} [Field ] [LinearOrder ] [IsStrictOrderedRing ]
[AddCommGroup E] [Module E]
namespace Caratheodory
/-- If `x` is in the convex hull of some finset `t` whose elements are not affine-independent,
then it is in the convex hull of a strict subset of `t`. -/
theorem mem_convexHull_erase [DecidableEq E] {t : Finset E} (h : ¬AffineIndependent ((↑) : t → E))
{x : E} (m : x ∈ convexHull (↑t : Set E)) :
∃ y : (↑t : Set E), x ∈ convexHull (↑(t.erase y) : Set E) := by
simp only [Finset.convexHull_eq, mem_ofPred_eq] at m ⊢
obtain ⟨f, fpos, fsum, rfl⟩ := m
obtain ⟨g, gcombo, gsum, gpos⟩ := exists_nontrivial_relation_sum_zero_of_not_affine_ind h
replace gpos := exists_pos_of_sum_zero_of_exists_nonzero g gsum gpos
clear h
let s := {z ∈ t | 0 < g z}
obtain ⟨i₀, mem, w⟩ : ∃ i₀ ∈ s, ∀ i ∈ s, f i₀ / g i₀ ≤ f i / g i := by
apply s.exists_min_image fun z => f z / g z
obtain ⟨x, hx, hgx⟩ : ∃ x ∈ t, 0 < g x := gpos
exact ⟨x, mem_filter.mpr ⟨hx, hgx⟩⟩
have hg : 0 < g i₀ := by
rw [mem_filter] at mem
exact mem.2
have hi₀ : i₀ ∈ t := filter_subset _ _ mem
let k : E → := fun z => f z - f i₀ / g i₀ * g z
have hk : k i₀ = 0 := by simp [k, ne_of_gt hg]
have ksum : ∑ e ∈ t.erase i₀, k e = 1 := by
calc
∑ e ∈ t.erase i₀, k e = ∑ e ∈ t, k e := by
conv_rhs => rw [← insert_erase hi₀, sum_insert (notMem_erase i₀ t), hk, zero_add]
_ = ∑ e ∈ t, (f e - f i₀ / g i₀ * g e) := rfl
_ = 1 := by rw [sum_sub_distrib, fsum, ← mul_sum, gsum, mul_zero, sub_zero]
refine ⟨⟨i₀, hi₀⟩, k, ?_, by convert ksum, ?_⟩
· simp only [k, and_imp, sub_nonneg, mem_erase, Ne]
intro e _ het
by_cases hes : e ∈ s
· have hge : 0 < g e := by
rw [mem_filter] at hes
exact hes.2
rw [← le_div_iff₀ hge]
exact w _ hes
· calc
_ ≤ 0 := by
apply mul_nonpos_of_nonneg_of_nonpos
· apply div_nonneg (fpos i₀ (mem_of_subset (filter_subset _ t) mem)) (le_of_lt hg)
· simpa only [s, mem_filter, het, true_and, not_lt] using hes
_ ≤ f e := fpos e het
· rw [Subtype.coe_mk, centerMass_eq_of_sum_1 _ id ksum]
calc
∑ e ∈ t.erase i₀, k e • e = ∑ e ∈ t, k e • e := sum_erase _ (by rw [hk, zero_smul])
_ = ∑ e ∈ t, (f e - f i₀ / g i₀ * g e) • e := rfl
_ = t.centerMass f id := by
simp only [sub_smul, mul_smul, sum_sub_distrib, ← smul_sum, gcombo, smul_zero, sub_zero,
centerMass, fsum, inv_one, one_smul, id]
end Caratheodory
variable {s : Set E}
/-- **Carathéodory's convexity theorem** -/
theorem convexHull_eq_union : convexHull s =
⋃ (t : Finset E) (_ : ↑t ⊆ s) (_ : AffineIndependent ((↑) : t → E)), convexHull ↑t := by
classical
apply Set.Subset.antisymm
· intro x hx
rw [convexHull_eq_union_convexHull_finite_subsets] at hx
simp only [mem_iUnion, exists_prop] at hx ⊢
obtain ⟨t, hts, hx⟩ := hx
induction t using Finset.strongInduction with | H t ih =>
by_cases h : AffineIndependent ((↑) : t → E)
· exact ⟨t, hts, h, hx⟩
obtain ⟨y, hy⟩ := Caratheodory.mem_convexHull_erase h hx
exact ih _ (erase_ssubset y.2) (subset_trans (by simp) hts) hy
· iterate 3 convert Set.iUnion_subset _; intro
exact convexHull_mono ‹_›
/-- A more explicit version of `convexHull_eq_union`. -/
theorem eq_pos_convex_span_of_mem_convexHull {x : E} (hx : x ∈ convexHull s) :
∃ (ι : Type u) (_ : Fintype ι),
∃ (z : ι → E) (w : ι → ), Set.range z ⊆ s ∧ AffineIndependent z ∧ (∀ i, 0 < w i) ∧
∑ i, w i = 1 ∧ ∑ i, w i • z i = x := by
rw [convexHull_eq_union] at hx
simp only [exists_prop, Set.mem_iUnion] at hx
obtain ⟨t, ht₁, ht₂, ht₃⟩ := hx
simp only [t.convexHull_eq, Set.mem_ofPred_eq] at ht₃
obtain ⟨w, hw₁, hw₂, hw₃⟩ := ht₃
let t' := {i ∈ t | w i ≠ 0}
refine ⟨t', t'.fintypeCoeSort, ((↑) : t' → E), fun i ↦ w i, ?_, ?_, ?_, ?_, ?_⟩
· rw [Subtype.range_coe_subtype]
exact Subset.trans (Finset.filter_subset _ t) ht₁
· exact ht₂.comp_embedding ⟨_, inclusion_injective (Finset.filter_subset (fun i => w i ≠ 0) t)⟩
· exact fun i =>
(hw₁ _ (Finset.mem_filter.mp i.2).1).lt_of_ne (Finset.mem_filter.mp i.property).2.symm
· rw [sum_coe_sort t' w, sum_filter_ne_zero, hw₂]
· rw [sum_coe_sort t' fun e ↦ w e • e, sum_filter_of_ne]
· rw [t.centerMass_eq_of_sum_1 id hw₂] at hw₃
exact hw₃
· intro e _ hwe contra
apply hwe
rw [contra, zero_smul]
-- the rest of this file is deprecated as of 2026-10-14
namespace Caratheodory
variable {x : E}
/-- Given a point `x` in the convex hull of a set `s`, this is a finite subset of `s` of minimum
cardinality, whose convex hull contains `x`. -/
@[deprecated "use convexHull_eq_union instead" (since := "2026-10-14")]
noncomputable def minCardFinsetOfMemConvexHull (hx : x ∈ convexHull s) : Finset E :=
Function.argminOn Finset.card { t | ↑t ⊆ s ∧ x ∈ convexHull (t : Set E) } <| by
simpa only [convexHull_eq_union_convexHull_finite_subsets s, exists_prop, mem_iUnion] using! hx
variable (hx : x ∈ convexHull s)
@[deprecated "use convexHull_eq_union instead" (since := "2026-10-14")]
theorem minCardFinsetOfMemConvexHull_subseteq : ↑(minCardFinsetOfMemConvexHull hx) ⊆ s :=
(Function.argminOn_mem _ { t : Finset E | ↑t ⊆ s ∧ x ∈ convexHull (t : Set E) } _).1
@[deprecated "use convexHull_eq_union instead" (since := "2026-10-14")]
theorem mem_minCardFinsetOfMemConvexHull :
x ∈ convexHull (minCardFinsetOfMemConvexHull hx : Set E) :=
(Function.argminOn_mem _ { t : Finset E | ↑t ⊆ s ∧ x ∈ convexHull (t : Set E) } _).2
@[deprecated "use convexHull_eq_union instead" (since := "2026-10-14")]
theorem minCardFinsetOfMemConvexHull_nonempty : (minCardFinsetOfMemConvexHull hx).Nonempty := by
rw [← Finset.coe_nonempty, ← @convexHull_nonempty_iff ]
exact ⟨x, mem_minCardFinsetOfMemConvexHull hx⟩
@[deprecated "use convexHull_eq_union instead" (since := "2026-10-14")]
theorem minCardFinsetOfMemConvexHull_card_le_card {t : Finset E} (ht₁ : ↑t ⊆ s)
(ht₂ : x ∈ convexHull (t : Set E)) : #(minCardFinsetOfMemConvexHull hx) ≤ #t :=
Function.argminOn_le _ _ (by exact ⟨ht₁, ht₂⟩)
@[deprecated "use convexHull_eq_union instead" (since := "2026-10-14")]
theorem affineIndependent_minCardFinsetOfMemConvexHull :
AffineIndependent ((↑) : minCardFinsetOfMemConvexHull hx → E) := by
have := convexHull_eq_union.subset (mem_minCardFinsetOfMemConvexHull hx)
simp only [mem_iUnion, exists_prop] at this
obtain ⟨t, hts, ht, hxt⟩ := this
exact ht.comp_embedding <| Set.embeddingOfSubset _ _ <| Finset.coe_subset.mpr
(Finset.eq_of_subset_of_card_le (Finset.coe_subset.mp hts)
(minCardFinsetOfMemConvexHull_card_le_card hx
(hts.trans (minCardFinsetOfMemConvexHull_subseteq hx)) hxt)).superset
end Caratheodory
¤ Dauer der Verarbeitung: 0.7 Sekunden
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|