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

Commit c7dd27d

Browse files
committed
split(analysis/convex/jensen): split Jensen's inequalities off analysis.convex.function (#9445)
1 parent d9ed073 commit c7dd27d

File tree

3 files changed

+128
-102
lines changed

3 files changed

+128
-102
lines changed

src/analysis/convex/function.lean

Lines changed: 4 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ Copyright (c) 2019 Alexander Bentkamp. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Alexander Bentkamp, François Dupuis
55
-/
6-
import analysis.convex.combination
7-
import data.real.basic
6+
import analysis.convex.basic
87
import algebra.module.ordered
8+
import tactic.field_simp
9+
import tactic.linarith
10+
import tactic.ring
911

1012
/-!
1113
# Convex and concave functions
@@ -24,7 +26,6 @@ a convex set.
2426
* `concave_on 𝕜 s f`: The function `f` is concave on `s` with scalars `𝕜`.
2527
* `strict_convex_on 𝕜 s f`: The function `f` is strictly convex on `s` with scalars `𝕜`.
2628
* `strict_concave_on 𝕜 s f`: The function `f` is strictly concave on `s` with scalars `𝕜`.
27-
* `convex_on.map_center_mass_le` `convex_on.map_sum_le`: Convex Jensen's inequality.
2829
-/
2930

3031
open finset linear_map set
@@ -502,101 +503,3 @@ lemma concave_on_iff_div {f : E → β} :
502503
end has_scalar
503504
end ordered_add_comm_monoid
504505
end linear_ordered_field
505-
506-
507-
508-
509-
510-
511-
512-
/-! ### Jensen's inequality -/
513-
514-
section jensen
515-
variables [linear_ordered_field 𝕜] [add_comm_group E] [ordered_add_comm_group β] [module 𝕜 E]
516-
[module 𝕜 β] [ordered_smul 𝕜 β] {s : set E} {f : E → β} {t : finset ι} {w : ι → 𝕜} {p : ι → E}
517-
518-
/-- Convex **Jensen's inequality**, `finset.center_mass` version. -/
519-
lemma convex_on.map_center_mass_le (hf : convex_on 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i)
520-
(h₁ : 0 < ∑ i in t, w i) (hmem : ∀ i ∈ t, p i ∈ s) :
521-
f (t.center_mass w p) ≤ t.center_mass w (f ∘ p) :=
522-
begin
523-
have hmem' : ∀ i ∈ t, (p i, (f ∘ p) i) ∈ {p : E × β | p.1 ∈ s ∧ f p.1 ≤ p.2},
524-
from λ i hi, ⟨hmem i hi, le_rfl⟩,
525-
convert (hf.convex_epigraph.center_mass_mem h₀ h₁ hmem').2;
526-
simp only [center_mass, function.comp, prod.smul_fst, prod.fst_sum,
527-
prod.smul_snd, prod.snd_sum],
528-
end
529-
530-
/-- Concave **Jensen's inequality**, `finset.center_mass` version. -/
531-
lemma concave_on.le_map_center_mass (hf : concave_on 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i)
532-
(h₁ : 0 < ∑ i in t, w i) (hmem : ∀ i ∈ t, p i ∈ s) :
533-
t.center_mass w (f ∘ p) ≤ f (t.center_mass w p) :=
534-
@convex_on.map_center_mass_le 𝕜 E (order_dual β) _ _ _ _ _ _ _ _ _ _ _ _ hf h₀ h₁ hmem
535-
536-
/-- Convex **Jensen's inequality**, `finset.sum` version. -/
537-
lemma convex_on.map_sum_le (hf : convex_on 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i) (h₁ : ∑ i in t, w i = 1)
538-
(hmem : ∀ i ∈ t, p i ∈ s) :
539-
f (∑ i in t, w i • p i) ≤ ∑ i in t, w i • f (p i) :=
540-
by simpa only [center_mass, h₁, inv_one, one_smul]
541-
using hf.map_center_mass_le h₀ (h₁.symm ▸ zero_lt_one) hmem
542-
543-
/-- Concave **Jensen's inequality**, `finset.sum` version. -/
544-
lemma concave_on.le_map_sum (hf : concave_on 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i) (h₁ : ∑ i in t, w i = 1)
545-
(hmem : ∀ i ∈ t, p i ∈ s) :
546-
∑ i in t, w i • f (p i) ≤ f (∑ i in t, w i • p i) :=
547-
@convex_on.map_sum_le 𝕜 E (order_dual β) _ _ _ _ _ _ _ _ _ _ _ _ hf h₀ h₁ hmem
548-
549-
end jensen
550-
551-
/-! ### Maximum principle -/
552-
553-
section maximum_principle
554-
variables [linear_ordered_field 𝕜] [add_comm_group E] [linear_ordered_add_comm_group β]
555-
[module 𝕜 E] [module 𝕜 β] [ordered_smul 𝕜 β] {s : set E} {f : E → β} {t : finset ι} {w : ι → 𝕜}
556-
{p : ι → E}
557-
558-
/-- If a function `f` is convex on `s`, then the value it takes at some center of mass of points of
559-
`s` is less than the value it takes on one of those points. -/
560-
lemma convex_on.exists_ge_of_center_mass (h : convex_on 𝕜 s f)
561-
(hw₀ : ∀ i ∈ t, 0 ≤ w i) (hw₁ : 0 < ∑ i in t, w i) (hp : ∀ i ∈ t, p i ∈ s) :
562-
∃ i ∈ t, f (t.center_mass w p) ≤ f (p i) :=
563-
begin
564-
set y := t.center_mass w p,
565-
suffices h : ∃ i ∈ t.filter (λ i, w i ≠ 0), w i • f y ≤ w i • (f ∘ p) i,
566-
{ obtain ⟨i, hi, hfi⟩ := h,
567-
rw mem_filter at hi,
568-
exact ⟨i, hi.1, (smul_le_smul_iff_of_pos $ (hw₀ i hi.1).lt_of_ne hi.2.symm).1 hfi⟩ },
569-
have hw' : (0 : 𝕜) < ∑ i in filter (λ i, w i ≠ 0) t, w i := by rwa sum_filter_ne_zero,
570-
refine exists_le_of_sum_le (nonempty_of_sum_ne_zero hw'.ne') _,
571-
rw [←sum_smul, ←smul_le_smul_iff_of_pos (inv_pos.2 hw'), inv_smul_smul' hw'.ne',
572-
←finset.center_mass, finset.center_mass_filter_ne_zero],
573-
exact h.map_center_mass_le hw₀ hw₁ hp,
574-
apply_instance,
575-
end
576-
577-
/-- If a function `f` is concave on `s`, then the value it takes at some center of mass of points of
578-
`s` is greater than the value it takes on one of those points. -/
579-
lemma concave_on.exists_le_of_center_mass (h : concave_on 𝕜 s f)
580-
(hw₀ : ∀ i ∈ t, 0 ≤ w i) (hw₁ : 0 < ∑ i in t, w i) (hp : ∀ i ∈ t, p i ∈ s) :
581-
∃ i ∈ t, f (p i) ≤ f (t.center_mass w p) :=
582-
@convex_on.exists_ge_of_center_mass 𝕜 E (order_dual β) _ _ _ _ _ _ _ _ _ _ _ _ h hw₀ hw₁ hp
583-
584-
/-- Maximum principle for convex functions. If a function `f` is convex on the convex hull of `s`,
585-
then the eventual maximum of `f` on `convex_hull 𝕜 s` lies in `s`. -/
586-
lemma convex_on.exists_ge_of_mem_convex_hull (hf : convex_on 𝕜 (convex_hull 𝕜 s) f) {x}
587-
(hx : x ∈ convex_hull 𝕜 s) : ∃ y ∈ s, f x ≤ f y :=
588-
begin
589-
rw _root_.convex_hull_eq at hx,
590-
obtain ⟨α, t, w, p, hw₀, hw₁, hp, rfl⟩ := hx,
591-
rcases hf.exists_ge_of_center_mass hw₀ (hw₁.symm ▸ zero_lt_one)
592-
(λ i hi, subset_convex_hull 𝕜 s (hp i hi)) with ⟨i, hit, Hi⟩,
593-
exact ⟨p i, hp i hit, Hi⟩
594-
end
595-
596-
/-- Minimum principle for concave functions. If a function `f` is concave on the convex hull of `s`,
597-
then the eventual minimum of `f` on `convex_hull 𝕜 s` lies in `s`. -/
598-
lemma concave_on.exists_le_of_mem_convex_hull (hf : concave_on 𝕜 (convex_hull 𝕜 s) f) {x}
599-
(hx : x ∈ convex_hull 𝕜 s) : ∃ y ∈ s, f y ≤ f x :=
600-
@convex_on.exists_ge_of_mem_convex_hull 𝕜 E (order_dual β) _ _ _ _ _ _ _ _ hf _ hx
601-
602-
end maximum_principle

src/analysis/convex/jensen.lean

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/-
2+
Copyright (c) 2019 Alexander Bentkamp. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Alexander Bentkamp, Yury Kudriashov
5+
-/
6+
import analysis.convex.combination
7+
import analysis.convex.function
8+
9+
/-!
10+
# Jensen's inequality and maximum principle for convex functions
11+
12+
In this file, we prove the finite Jensen inequality and the finite maximum principle for convex
13+
functions. The integral versions are to be found in `analysis.convex.integral`.
14+
15+
## Main declarations
16+
17+
Jensen's inequalities:
18+
* `convex_on.map_center_mass_le`, `convex_on.map_sum_le`: Convex Jensen's inequality. The image of a
19+
convex combination of points under a convex function is less than the convex combination of the
20+
images.
21+
* `concave_on.le_map_center_mass`, `concave_on.le_map_sum`: Concave Jensen's inequality.
22+
23+
As corollaries, we get:
24+
* `convex_on.exists_ge_of_mem_convex_hull `: Maximum principle for convex functions.
25+
* `concave_on.exists_le_of_mem_convex_hull`: Minimum principle for concave functions.
26+
-/
27+
28+
open finset linear_map set
29+
open_locale big_operators classical convex pointwise
30+
31+
variables {𝕜 E F β ι : Type*}
32+
33+
/-! ### Jensen's inequality -/
34+
35+
section jensen
36+
variables [linear_ordered_field 𝕜] [add_comm_group E] [ordered_add_comm_group β] [module 𝕜 E]
37+
[module 𝕜 β] [ordered_smul 𝕜 β] {s : set E} {f : E → β} {t : finset ι} {w : ι → 𝕜} {p : ι → E}
38+
39+
/-- Convex **Jensen's inequality**, `finset.center_mass` version. -/
40+
lemma convex_on.map_center_mass_le (hf : convex_on 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i)
41+
(h₁ : 0 < ∑ i in t, w i) (hmem : ∀ i ∈ t, p i ∈ s) :
42+
f (t.center_mass w p) ≤ t.center_mass w (f ∘ p) :=
43+
begin
44+
have hmem' : ∀ i ∈ t, (p i, (f ∘ p) i) ∈ {p : E × β | p.1 ∈ s ∧ f p.1 ≤ p.2},
45+
from λ i hi, ⟨hmem i hi, le_rfl⟩,
46+
convert (hf.convex_epigraph.center_mass_mem h₀ h₁ hmem').2;
47+
simp only [center_mass, function.comp, prod.smul_fst, prod.fst_sum,
48+
prod.smul_snd, prod.snd_sum],
49+
end
50+
51+
/-- Concave **Jensen's inequality**, `finset.center_mass` version. -/
52+
lemma concave_on.le_map_center_mass (hf : concave_on 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i)
53+
(h₁ : 0 < ∑ i in t, w i) (hmem : ∀ i ∈ t, p i ∈ s) :
54+
t.center_mass w (f ∘ p) ≤ f (t.center_mass w p) :=
55+
@convex_on.map_center_mass_le 𝕜 E (order_dual β) _ _ _ _ _ _ _ _ _ _ _ _ hf h₀ h₁ hmem
56+
57+
/-- Convex **Jensen's inequality**, `finset.sum` version. -/
58+
lemma convex_on.map_sum_le (hf : convex_on 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i) (h₁ : ∑ i in t, w i = 1)
59+
(hmem : ∀ i ∈ t, p i ∈ s) :
60+
f (∑ i in t, w i • p i) ≤ ∑ i in t, w i • f (p i) :=
61+
by simpa only [center_mass, h₁, inv_one, one_smul]
62+
using hf.map_center_mass_le h₀ (h₁.symm ▸ zero_lt_one) hmem
63+
64+
/-- Concave **Jensen's inequality**, `finset.sum` version. -/
65+
lemma concave_on.le_map_sum (hf : concave_on 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i) (h₁ : ∑ i in t, w i = 1)
66+
(hmem : ∀ i ∈ t, p i ∈ s) :
67+
∑ i in t, w i • f (p i) ≤ f (∑ i in t, w i • p i) :=
68+
@convex_on.map_sum_le 𝕜 E (order_dual β) _ _ _ _ _ _ _ _ _ _ _ _ hf h₀ h₁ hmem
69+
70+
end jensen
71+
72+
/-! ### Maximum principle -/
73+
74+
section maximum_principle
75+
variables [linear_ordered_field 𝕜] [add_comm_group E] [linear_ordered_add_comm_group β]
76+
[module 𝕜 E] [module 𝕜 β] [ordered_smul 𝕜 β] {s : set E} {f : E → β} {t : finset ι} {w : ι → 𝕜}
77+
{p : ι → E}
78+
79+
/-- If a function `f` is convex on `s`, then the value it takes at some center of mass of points of
80+
`s` is less than the value it takes on one of those points. -/
81+
lemma convex_on.exists_ge_of_center_mass (h : convex_on 𝕜 s f)
82+
(hw₀ : ∀ i ∈ t, 0 ≤ w i) (hw₁ : 0 < ∑ i in t, w i) (hp : ∀ i ∈ t, p i ∈ s) :
83+
∃ i ∈ t, f (t.center_mass w p) ≤ f (p i) :=
84+
begin
85+
set y := t.center_mass w p,
86+
suffices h : ∃ i ∈ t.filter (λ i, w i ≠ 0), w i • f y ≤ w i • (f ∘ p) i,
87+
{ obtain ⟨i, hi, hfi⟩ := h,
88+
rw mem_filter at hi,
89+
exact ⟨i, hi.1, (smul_le_smul_iff_of_pos $ (hw₀ i hi.1).lt_of_ne hi.2.symm).1 hfi⟩ },
90+
have hw' : (0 : 𝕜) < ∑ i in filter (λ i, w i ≠ 0) t, w i := by rwa sum_filter_ne_zero,
91+
refine exists_le_of_sum_le (nonempty_of_sum_ne_zero hw'.ne') _,
92+
rw [←sum_smul, ←smul_le_smul_iff_of_pos (inv_pos.2 hw'), inv_smul_smul' hw'.ne',
93+
←finset.center_mass, finset.center_mass_filter_ne_zero],
94+
exact h.map_center_mass_le hw₀ hw₁ hp,
95+
apply_instance,
96+
end
97+
98+
/-- If a function `f` is concave on `s`, then the value it takes at some center of mass of points of
99+
`s` is greater than the value it takes on one of those points. -/
100+
lemma concave_on.exists_le_of_center_mass (h : concave_on 𝕜 s f)
101+
(hw₀ : ∀ i ∈ t, 0 ≤ w i) (hw₁ : 0 < ∑ i in t, w i) (hp : ∀ i ∈ t, p i ∈ s) :
102+
∃ i ∈ t, f (p i) ≤ f (t.center_mass w p) :=
103+
@convex_on.exists_ge_of_center_mass 𝕜 E (order_dual β) _ _ _ _ _ _ _ _ _ _ _ _ h hw₀ hw₁ hp
104+
105+
/-- Maximum principle for convex functions. If a function `f` is convex on the convex hull of `s`,
106+
then the eventual maximum of `f` on `convex_hull 𝕜 s` lies in `s`. -/
107+
lemma convex_on.exists_ge_of_mem_convex_hull (hf : convex_on 𝕜 (convex_hull 𝕜 s) f) {x}
108+
(hx : x ∈ convex_hull 𝕜 s) : ∃ y ∈ s, f x ≤ f y :=
109+
begin
110+
rw _root_.convex_hull_eq at hx,
111+
obtain ⟨α, t, w, p, hw₀, hw₁, hp, rfl⟩ := hx,
112+
rcases hf.exists_ge_of_center_mass hw₀ (hw₁.symm ▸ zero_lt_one)
113+
(λ i hi, subset_convex_hull 𝕜 s (hp i hi)) with ⟨i, hit, Hi⟩,
114+
exact ⟨p i, hp i hit, Hi⟩
115+
end
116+
117+
/-- Minimum principle for concave functions. If a function `f` is concave on the convex hull of `s`,
118+
then the eventual minimum of `f` on `convex_hull 𝕜 s` lies in `s`. -/
119+
lemma concave_on.exists_le_of_mem_convex_hull (hf : concave_on 𝕜 (convex_hull 𝕜 s) f) {x}
120+
(hx : x ∈ convex_hull 𝕜 s) : ∃ y ∈ s, f y ≤ f x :=
121+
@convex_on.exists_ge_of_mem_convex_hull 𝕜 E (order_dual β) _ _ _ _ _ _ _ _ hf _ hx
122+
123+
end maximum_principle

src/analysis/convex/topology.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Alexander Bentkamp, Yury Kudriashov
55
-/
6-
import analysis.convex.function
6+
import analysis.convex.jensen
77
import analysis.normed_space.finite_dimension
88
import topology.path_connected
99
import topology.algebra.affine

0 commit comments

Comments
 (0)