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

Commit 89b0cfb

Browse files
committed
refactor(analysis/convex/basic): generalize convexity to vector spaces (#9058)
`convex` and `convex_hull` are currently only defined in real vector spaces. This generalizes ℝ to arbitrary ordered_semirings in definitions and abstracts it away to the correct generality in lemmas. It also generalizes the space from `add_comm_group` to `add_comm_monoid` where possible.
1 parent f536b4f commit 89b0cfb

19 files changed

+721
-519
lines changed

src/analysis/calculus/darboux.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ let ⟨c, cmem, hc⟩ := exists_has_deriv_within_at_eq_of_gt_of_lt hab (λ x hx,
7373
in ⟨c, cmem, neg_injective hc⟩
7474

7575
/-- **Darboux's theorem**: the image of a convex set under `f'` is a convex set. -/
76-
theorem convex_image_has_deriv_at {s : set ℝ} (hs : convex s)
76+
theorem convex_image_has_deriv_at {s : set ℝ} (hs : convex s)
7777
(hf : ∀ x ∈ s, has_deriv_at f (f' x) x) :
78-
convex (f' '' s) :=
78+
convex (f' '' s) :=
7979
begin
80-
refine real.convex_iff_ord_connected.2 ⟨_⟩,
80+
refine ord_connected.convex ⟨_⟩,
8181
rintros _ ⟨a, ha, rfl⟩ _ ⟨b, hb, rfl⟩ m ⟨hma, hmb⟩,
8282
cases eq_or_lt_of_le hma with hma hma,
8383
by exact hma ▸ mem_image_of_mem f' ha,
@@ -98,7 +98,7 @@ end
9898

9999
/-- If the derivative of a function is never equal to `m`, then either
100100
it is always greater than `m`, or it is always less than `m`. -/
101-
theorem deriv_forall_lt_or_forall_gt_of_forall_ne {s : set ℝ} (hs : convex s)
101+
theorem deriv_forall_lt_or_forall_gt_of_forall_ne {s : set ℝ} (hs : convex s)
102102
(hf : ∀ x ∈ s, has_deriv_at f (f' x) x) {m : ℝ} (hf' : ∀ x ∈ s, f' x ≠ m) :
103103
(∀ x ∈ s, f' x < m) ∨ (∀ x ∈ s, m < f' x) :=
104104
begin

src/analysis/calculus/extend_deriv.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ local attribute [mono] prod_mono
3131
derivative converges to a limit `f'` at a point on the boundary, then `f` is differentiable there
3232
with derivative `f'`. -/
3333
theorem has_fderiv_at_boundary_of_tendsto_fderiv {f : E → F} {s : set E} {x : E} {f' : E →L[ℝ] F}
34-
(f_diff : differentiable_on ℝ f s) (s_conv : convex s) (s_open : is_open s)
34+
(f_diff : differentiable_on ℝ f s) (s_conv : convex s) (s_open : is_open s)
3535
(f_cont : ∀y ∈ closure s, continuous_within_at f s y)
3636
(h : tendsto (λy, fderiv ℝ f y) (𝓝[s] x) (𝓝 f')) :
3737
has_fderiv_within_at f f' (closure s) x :=
@@ -63,7 +63,7 @@ begin
6363
have key : ∀ p : E × E, p ∈ (B ∩ s).prod (B ∩ s) → ∥f p.2 - f p.1 - (f' p.2 - f' p.1)∥
6464
≤ ε * ∥p.2 - p.1∥,
6565
{ rintros ⟨u, v⟩ ⟨u_in, v_in⟩,
66-
have conv : convex (B ∩ s) := (convex_ball _ _).inter s_conv,
66+
have conv : convex (B ∩ s) := (convex_ball _ _).inter s_conv,
6767
have diff : differentiable_on ℝ f (B ∩ s) := f_diff.mono (inter_subset_right _ _),
6868
have bound : ∀ z ∈ (B ∩ s), ∥fderiv_within ℝ f (B ∩ s) z - f'∥ ≤ ε,
6969
{ intros z z_in,
@@ -111,7 +111,7 @@ begin
111111
let t := Ioo a b,
112112
have ts : t ⊆ s := subset.trans Ioo_subset_Ioc_self sab,
113113
have t_diff : differentiable_on ℝ f t := f_diff.mono ts,
114-
have t_conv : convex t := convex_Ioo a b,
114+
have t_conv : convex t := convex_Ioo a b,
115115
have t_open : is_open t := is_open_Ioo,
116116
have t_closure : closure t = Icc a b := closure_Ioo ab,
117117
have t_cont : ∀y ∈ closure t, continuous_within_at f t y,
@@ -148,7 +148,7 @@ begin
148148
let t := Ioo b a,
149149
have ts : t ⊆ s := subset.trans Ioo_subset_Ico_self sab,
150150
have t_diff : differentiable_on ℝ f t := f_diff.mono ts,
151-
have t_conv : convex t := convex_Ioo b a,
151+
have t_conv : convex t := convex_Ioo b a,
152152
have t_open : is_open t := is_open_Ioo,
153153
have t_closure : closure t = Icc b a := closure_Ioo ba,
154154
have t_cont : ∀y ∈ closure t, continuous_within_at f t y,

src/analysis/calculus/fderiv_symmetric.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ open_locale topological_space
5252

5353
variables {E F : Type*} [normed_group E] [normed_space ℝ E]
5454
[normed_group F] [normed_space ℝ F]
55-
{s : set E} (s_conv : convex s)
55+
{s : set E} (s_conv : convex s)
5656
{f : E → F} {f' : E → (E →L[ℝ] F)} {f'' : E →L[ℝ] (E →L[ℝ] F)}
5757
(hf : ∀ x ∈ interior s, has_fderiv_at f (f' x) x)
5858
{x : E} (xs : x ∈ s) (hx : has_fderiv_within_at f' f'' (interior s) x)
@@ -283,7 +283,7 @@ omit s_conv xs hx hf
283283
/-- If a function is differentiable inside a convex set with nonempty interior, and has a second
284284
derivative at a point of this convex set, then this second derivative is symmetric. -/
285285
theorem convex.second_derivative_within_at_symmetric
286-
{s : set E} (s_conv : convex s) (hne : (interior s).nonempty)
286+
{s : set E} (s_conv : convex s) (hne : (interior s).nonempty)
287287
{f : E → F} {f' : E → (E →L[ℝ] F)} {f'' : E →L[ℝ] (E →L[ℝ] F)}
288288
(hf : ∀ x ∈ interior s, has_fderiv_at f (f' x) x)
289289
{x : E} (xs : x ∈ s) (hx : has_fderiv_within_at f' f'' (interior s) x) (v w : E) :

src/analysis/calculus/mean_value.lean

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

src/analysis/calculus/tangent_cone.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ unique_diff_on.pi _ _ _ _ $ λ i _, h i
368368

369369
/-- In a real vector space, a convex set with nonempty interior is a set of unique
370370
differentiability. -/
371-
theorem unique_diff_on_convex {s : set G} (conv : convex s) (hs : (interior s).nonempty) :
371+
theorem unique_diff_on_convex {s : set G} (conv : convex s) (hs : (interior s).nonempty) :
372372
unique_diff_on ℝ s :=
373373
begin
374374
assume x xs,

src/analysis/calculus/times_cont_diff.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,7 +2734,7 @@ and `∥p x 1∥₊ < K`, then `f` is `K`-Lipschitz in a neighborhood of `x` wit
27342734
lemma has_ftaylor_series_up_to_on.exists_lipschitz_on_with_of_nnnorm_lt {E F : Type*}
27352735
[normed_group E] [normed_space ℝ E] [normed_group F] [normed_space ℝ F] {f : E → F}
27362736
{p : E → formal_multilinear_series ℝ E F} {s : set E} {x : E}
2737-
(hf : has_ftaylor_series_up_to_on 1 f p (insert x s)) (hs : convex s) (K : ℝ≥0)
2737+
(hf : has_ftaylor_series_up_to_on 1 f p (insert x s)) (hs : convex s) (K : ℝ≥0)
27382738
(hK : ∥p x 1∥₊ < K) :
27392739
∃ t ∈ 𝓝[s] x, lipschitz_on_with K f t :=
27402740
begin
@@ -2754,15 +2754,15 @@ then `f` is Lipschitz in a neighborhood of `x` within `s`. -/
27542754
lemma has_ftaylor_series_up_to_on.exists_lipschitz_on_with {E F : Type*}
27552755
[normed_group E] [normed_space ℝ E] [normed_group F] [normed_space ℝ F] {f : E → F}
27562756
{p : E → formal_multilinear_series ℝ E F} {s : set E} {x : E}
2757-
(hf : has_ftaylor_series_up_to_on 1 f p (insert x s)) (hs : convex s) :
2757+
(hf : has_ftaylor_series_up_to_on 1 f p (insert x s)) (hs : convex s) :
27582758
∃ K (t ∈ 𝓝[s] x), lipschitz_on_with K f t :=
27592759
(no_top _).imp $ hf.exists_lipschitz_on_with_of_nnnorm_lt hs
27602760

27612761
/-- If `f` is `C^1` within a conves set `s` at `x`, then it is Lipschitz on a neighborhood of `x`
27622762
within `s`. -/
27632763
lemma times_cont_diff_within_at.exists_lipschitz_on_with {E F : Type*} [normed_group E]
27642764
[normed_space ℝ E] [normed_group F] [normed_space ℝ F] {f : E → F} {s : set E}
2765-
{x : E} (hf : times_cont_diff_within_at ℝ 1 f s x) (hs : convex s) :
2765+
{x : E} (hf : times_cont_diff_within_at ℝ 1 f s x) (hs : convex s) :
27662766
∃ (K : ℝ≥0) (t ∈ 𝓝[s] x), lipschitz_on_with K f t :=
27672767
begin
27682768
rcases hf 1 le_rfl with ⟨t, hst, p, hp⟩,

0 commit comments

Comments
 (0)