Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit c38ab35

Browse files
committed
feat(analysis/convex/combination): The convex hull of s + t (#14160)
`convex_hull` distributes over pointwise addition of sets and commutes with pointwise scalar multiplication. Also delete `linear_map.image_convex_hull` because it duplicates `linear_map.convex_hull_image`.
1 parent cfedf1d commit c38ab35

File tree

2 files changed

+45
-25
lines changed

2 files changed

+45
-25
lines changed

src/analysis/convex/combination.lean

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ lemmas unconditional on the sum of the weights being `1`.
2424
-/
2525

2626
open set
27-
open_locale big_operators classical
27+
open_locale big_operators classical pointwise
2828

2929
universes u u'
3030
variables {R E F ι ι' : Type*} [linear_ordered_field R] [add_comm_group E] [add_comm_group F]
@@ -325,13 +325,10 @@ begin
325325
{ exact Union_subset (λ i, Union_subset convex_hull_mono), },
326326
end
327327

328-
lemma convex_hull_prod (s : set E) (t : set F) :
329-
convex_hull R (s ×ˢ t) = convex_hull R s ×ˢ convex_hull R t :=
328+
lemma mk_mem_convex_hull_prod {t : set F} {x : E} {y : F} (hx : x ∈ convex_hull R s)
329+
(hy : y ∈ convex_hull R t) :
330+
(x, y) ∈ convex_hull R (s ×ˢ t) :=
330331
begin
331-
refine set.subset.antisymm _ _,
332-
{ exact convex_hull_min (set.prod_mono (subset_convex_hull _ _) $ subset_convex_hull _ _)
333-
((convex_convex_hull _ _).prod $ convex_convex_hull _ _) },
334-
rintro ⟨x, y⟩ ⟨hx, hy⟩,
335332
rw convex_hull_eq at ⊢ hx hy,
336333
obtain ⟨ι, a, w, S, hw, hw', hS, hSp⟩ := hx,
337334
obtain ⟨κ, b, v, T, hv, hv', hT, hTp⟩ := hy,
@@ -367,6 +364,19 @@ begin
367364
rw [←finset.sum_smul, hw', one_smul] }
368365
end
369366

367+
@[simp] lemma convex_hull_prod (s : set E) (t : set F) :
368+
convex_hull R (s ×ˢ t) = convex_hull R s ×ˢ convex_hull R t :=
369+
subset.antisymm (convex_hull_min (prod_mono (subset_convex_hull _ _) $ subset_convex_hull _ _) $
370+
(convex_convex_hull _ _).prod $ convex_convex_hull _ _) $
371+
prod_subset_iff.2 $ λ x hx y, mk_mem_convex_hull_prod hx
372+
373+
lemma convex_hull_add (s t : set E) : convex_hull R (s + t) = convex_hull R s + convex_hull R t :=
374+
by simp_rw [←image2_add, ←image_prod, is_linear_map.is_linear_map_add.convex_hull_image,
375+
convex_hull_prod]
376+
377+
lemma convex_hull_sub (s t : set E) : convex_hull R (s - t) = convex_hull R s - convex_hull R t :=
378+
by simp_rw [sub_eq_add_neg, convex_hull_add, convex_hull_neg]
379+
370380
/-! ### `std_simplex` -/
371381

372382
variables (ι) [fintype ι] {f : ι → R}

src/analysis/convex/hull.lean

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ while the impact on writing code is minimal as `convex_hull 𝕜 s` is automatic
2020
-/
2121

2222
open set
23+
open_locale pointwise
2324

2425
variables {𝕜 E F : Type*}
2526

@@ -46,15 +47,24 @@ lemma subset_convex_hull : s ⊆ convex_hull 𝕜 s := (convex_hull 𝕜).le_clo
4647

4748
lemma convex_convex_hull : convex 𝕜 (convex_hull 𝕜 s) := closure_operator.closure_mem_mk₃ s
4849

49-
variables {𝕜 s} {t : set E}
50+
lemma convex_hull_eq_Inter : convex_hull 𝕜 s = ⋂ (t : set E) (hst : s ⊆ t) (ht : convex 𝕜 t), t :=
51+
rfl
52+
53+
variables {𝕜 s} {t : set E} {x : E}
54+
55+
lemma mem_convex_hull_iff : x ∈ convex_hull 𝕜 s ↔ ∀ t, s ⊆ t → convex 𝕜 t → x ∈ t :=
56+
by simp_rw [convex_hull_eq_Inter, mem_Inter]
5057

5158
lemma convex_hull_min (hst : s ⊆ t) (ht : convex 𝕜 t) : convex_hull 𝕜 s ⊆ t :=
5259
closure_operator.closure_le_mk₃_iff (show s ≤ t, from hst) ht
5360

61+
lemma convex.convex_hull_subset_iff (ht : convex 𝕜 t) : convex_hull 𝕜 s ⊆ t ↔ s ⊆ t :=
62+
⟨(subset_convex_hull _ _).trans, λ h, convex_hull_min h ht⟩
63+
5464
@[mono] lemma convex_hull_mono (hst : s ⊆ t) : convex_hull 𝕜 s ⊆ convex_hull 𝕜 t :=
5565
(convex_hull 𝕜).monotone hst
5666

57-
lemma convex.convex_hull_eq {s : set E} (hs : convex 𝕜 s) : convex_hull 𝕜 s = s :=
67+
lemma convex.convex_hull_eq (hs : convex 𝕜 s) : convex_hull 𝕜 s = s :=
5868
closure_operator.mem_mk₃_closed hs
5969

6070
@[simp] lemma convex_hull_univ : convex_hull 𝕜 (univ : set E) = univ :=
@@ -78,6 +88,10 @@ begin
7888
exact not_congr convex_hull_empty_iff,
7989
end
8090

91+
alias convex_hull_nonempty_iff ↔ _ set.nonempty.convex_hull
92+
93+
attribute [protected] set.nonempty.convex_hull
94+
8195
@[simp]
8296
lemma convex_hull_singleton {x : E} : convex_hull 𝕜 ({x} : set E) = {x} :=
8397
(convex_singleton x).convex_hull_eq
@@ -95,21 +109,6 @@ begin
95109
by { rintro (rfl : y = x), exact hx hy }⟩),
96110
end
97111

98-
lemma is_linear_map.image_convex_hull {f : E → F} (hf : is_linear_map 𝕜 f) :
99-
f '' (convex_hull 𝕜 s) = convex_hull 𝕜 (f '' s) :=
100-
begin
101-
apply set.subset.antisymm ,
102-
{ rw set.image_subset_iff,
103-
exact convex_hull_min (set.image_subset_iff.1 $ subset_convex_hull 𝕜 $ f '' s)
104-
((convex_convex_hull 𝕜 (f '' s)).is_linear_preimage hf) },
105-
{ exact convex_hull_min (set.image_subset _ $ subset_convex_hull 𝕜 s)
106-
((convex_convex_hull 𝕜 s).is_linear_image hf) }
107-
end
108-
109-
lemma linear_map.image_convex_hull (f : E →ₗ[𝕜] F) :
110-
f '' (convex_hull 𝕜 s) = convex_hull 𝕜 (f '' s) :=
111-
f.is_linear.image_convex_hull
112-
113112
lemma is_linear_map.convex_hull_image {f : E → F} (hf : is_linear_map 𝕜 f) (s : set E) :
114113
convex_hull 𝕜 (f '' s) = f '' convex_hull 𝕜 s :=
115114
set.subset.antisymm (convex_hull_min (image_subset _ (subset_convex_hull 𝕜 s)) $
@@ -125,14 +124,22 @@ f.is_linear.convex_hull_image s
125124
end add_comm_monoid
126125
end ordered_semiring
127126

127+
section ordered_comm_semiring
128+
variables [ordered_comm_semiring 𝕜] [add_comm_monoid E] [module 𝕜 E]
129+
130+
lemma convex_hull_smul (a : 𝕜) (s : set E) : convex_hull 𝕜 (a • s) = a • convex_hull 𝕜 s :=
131+
(linear_map.lsmul _ _ a).convex_hull_image _
132+
133+
end ordered_comm_semiring
134+
128135
section ordered_ring
129136
variables [ordered_ring 𝕜]
130137

131138
section add_comm_group
132139
variables [add_comm_group E] [add_comm_group F] [module 𝕜 E] [module 𝕜 F] (s : set E)
133140

134141
lemma affine_map.image_convex_hull (f : E →ᵃ[𝕜] F) :
135-
f '' (convex_hull 𝕜 s) = convex_hull 𝕜 (f '' s) :=
142+
f '' convex_hull 𝕜 s = convex_hull 𝕜 (f '' s) :=
136143
begin
137144
apply set.subset.antisymm,
138145
{ rw set.image_subset_iff,
@@ -153,6 +160,9 @@ begin
153160
exact convex_hull_subset_affine_span s,
154161
end
155162

163+
lemma convex_hull_neg (s : set E) : convex_hull 𝕜 (-s) = -convex_hull 𝕜 s :=
164+
by { simp_rw ←image_neg, exact (affine_map.image_convex_hull _ $ -1).symm }
165+
156166
end add_comm_group
157167
end ordered_ring
158168
end convex_hull

0 commit comments

Comments
 (0)