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

Commit 547d67f

Browse files
urkudsgouezel
andcommitted
feat(analysis/{analytic,calculus}): an analytic function is strictly differentiable (#5878)
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
1 parent 44fd23d commit 547d67f

File tree

5 files changed

+180
-5
lines changed

5 files changed

+180
-5
lines changed

src/analysis/analytic/basic.lean

Lines changed: 108 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ variables {𝕜 : Type*} [nondiscrete_normed_field 𝕜]
7373
{F : Type*} [normed_group F] [normed_space 𝕜 F]
7474
{G : Type*} [normed_group G] [normed_space 𝕜 G]
7575

76-
open_locale topological_space classical big_operators nnreal
76+
open_locale topological_space classical big_operators nnreal filter
7777
open set filter asymptotics
7878

7979
/-! ### The radius of a formal multilinear series -/
@@ -170,6 +170,12 @@ lemma norm_mul_pow_le_of_lt_radius (p : formal_multilinear_series 𝕜 E F) {r :
170170
let ⟨a, ha, C, hC, h⟩ := p.norm_mul_pow_le_mul_pow_of_lt_radius h
171171
in ⟨C, hC, λ n, (h n).trans $ mul_le_of_le_one_right hC.lt.le (pow_le_one _ ha.1.le ha.2.le)⟩
172172

173+
/-- For `r` strictly smaller than the radius of `p`, then `∥pₙ∥ rⁿ` is bounded. -/
174+
lemma norm_le_div_pow_of_pos_of_lt_radius (p : formal_multilinear_series 𝕜 E F) {r : ℝ≥0}
175+
(h0 : 0 < r) (h : (r : ennreal) < p.radius) : ∃ C > 0, ∀ n, ∥p n∥ ≤ C / r ^ n :=
176+
let ⟨C, hC, hp⟩ := p.norm_mul_pow_le_of_lt_radius h in
177+
⟨C, hC, λ n, iff.mpr (le_div_iff (pow_pos h0 _)) (hp n)⟩
178+
173179
/-- For `r` strictly smaller than the radius of `p`, then `∥pₙ∥ rⁿ` is bounded. -/
174180
lemma nnnorm_mul_pow_le_of_lt_radius (p : formal_multilinear_series 𝕜 E F) {r : ℝ≥0}
175181
(h : (r : ennreal) < p.radius) : ∃ C > 0, ∀ n, nnnorm (p n) * r^n ≤ C :=
@@ -244,6 +250,12 @@ lemma has_fpower_series_on_ball.analytic_at (hf : has_fpower_series_on_ball f p
244250
analytic_at 𝕜 f x :=
245251
hf.has_fpower_series_at.analytic_at
246252

253+
lemma has_fpower_series_on_ball.has_sum_sub (hf : has_fpower_series_on_ball f p x r) {y : E}
254+
(hy : y ∈ emetric.ball x r) :
255+
has_sum (λ n : ℕ, p n (λ i, y - x)) (f y) :=
256+
have y - x ∈ emetric.ball (0 : E) r, by simpa [edist_eq_coe_nnnorm_sub] using hy,
257+
by simpa only [add_sub_cancel'_right] using hf.has_sum this
258+
247259
lemma has_fpower_series_on_ball.radius_pos (hf : has_fpower_series_on_ball f p x r) :
248260
0 < p.radius :=
249261
lt_of_lt_of_le hf.r_pos hf.r_le
@@ -257,6 +269,12 @@ lemma has_fpower_series_on_ball.mono
257269
has_fpower_series_on_ball f p x r' :=
258270
⟨le_trans hr hf.1, r'_pos, λ y hy, hf.has_sum (emetric.ball_subset_ball hr hy)⟩
259271

272+
protected lemma has_fpower_series_at.eventually (hf : has_fpower_series_at f p x) :
273+
∀ᶠ r : ennreal in 𝓝[Ioi 0] 0, has_fpower_series_on_ball f p x r :=
274+
let ⟨r, hr⟩ := hf in
275+
mem_sets_of_superset (Ioo_mem_nhds_within_Ioi (left_mem_Ico.2 hr.r_pos)) $
276+
λ r' hr', hr.mono hr'.1 hr'.2.le
277+
260278
lemma has_fpower_series_on_ball.add
261279
(hf : has_fpower_series_on_ball f pf x r) (hg : has_fpower_series_on_ball g pg x r) :
262280
has_fpower_series_on_ball (f + g) (pf + pg) x r :=
@@ -268,10 +286,8 @@ lemma has_fpower_series_at.add
268286
(hf : has_fpower_series_at f pf x) (hg : has_fpower_series_at g pg x) :
269287
has_fpower_series_at (f + g) (pf + pg) x :=
270288
begin
271-
rcases hf with ⟨rf, hrf⟩,
272-
rcases hg with ⟨rg, hrg⟩,
273-
have P : 0 < min rf rg, by simp [hrf.r_pos, hrg.r_pos],
274-
exact ⟨min rf rg, (hrf.mono P (min_le_left _ _)).add (hrg.mono P (min_le_right _ _))⟩
289+
rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩,
290+
exact ⟨r, hr.1.add hr.2
275291
end
276292

277293
lemma analytic_at.add (hf : analytic_at 𝕜 f x) (hg : analytic_at 𝕜 g x) :
@@ -389,6 +405,93 @@ begin
389405
simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n
390406
end
391407

408+
-- hack to speed up simp when dealing with complicated types
409+
local attribute [-instance] unique.subsingleton pi.subsingleton
410+
411+
/-- If `f` has formal power series `∑ n, pₙ` on a ball of radius `r`, then for `y, z` in any smaller
412+
ball, the norm of the difference `f y - f z - p 1 (λ _, y - z)` is bounded above by
413+
`C * (max ∥y - x∥ ∥z - x∥) * ∥y - z∥`. This lemma formulates this property using `is_O` and
414+
`filter.principal` on `E × E`. -/
415+
lemma has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal
416+
(hf : has_fpower_series_on_ball f p x r) (hr : r' < r) :
417+
is_O (λ y : E × E, f y.1 - f y.2 - (p 1 (λ _, y.1 - y.2)))
418+
(λ y, ∥y - (x, x)∥ * ∥y.1 - y.2∥) (𝓟 $ emetric.ball (x, x) r') :=
419+
begin
420+
lift r' to ℝ≥0 using ne_top_of_lt hr,
421+
rcases (zero_le r').eq_or_lt with rfl|hr'0, { simp },
422+
obtain ⟨a, ha, C, hC : 0 < C, hp⟩ :
423+
∃ (a ∈ Ioo (0 : ℝ) 1) (C > 0), ∀ (n : ℕ), ∥p n∥ * ↑r' ^ n ≤ C * a ^ n,
424+
from p.norm_mul_pow_le_mul_pow_of_lt_radius (hr.trans_le hf.r_le),
425+
simp only [← le_div_iff (pow_pos (nnreal.coe_pos.2 hr'0) _)] at hp,
426+
set L : E × E → ℝ := λ y,
427+
(C * (a / r') ^ 2) * (∥y - (x, x)∥ * ∥y.1 - y.2∥) * (a / (1 - a) ^ 2 + 2 / (1 - a)),
428+
have hL : ∀ y ∈ emetric.ball (x, x) r',
429+
∥f y.1 - f y.2 - (p 1 (λ _, y.1 - y.2))∥ ≤ L y,
430+
{ intros y hy',
431+
have hy : y ∈ (emetric.ball x r).prod (emetric.ball x r),
432+
{ rw [emetric.ball_prod_same], exact emetric.ball_subset_ball hr.le hy' },
433+
set A : ℕ → F := λ n, p n (λ _, y.1 - x) - p n (λ _, y.2 - x),
434+
have hA : has_sum (λ n, A (n + 2)) (f y.1 - f y.2 - (p 1 (λ _, y.1 - y.2))),
435+
{ convert (has_sum_nat_add_iff' 2).2 ((hf.has_sum_sub hy.1).sub (hf.has_sum_sub hy.2)),
436+
rw [finset.sum_range_succ, finset.sum_range_one, hf.coeff_zero, hf.coeff_zero, sub_self,
437+
add_zero, ← subsingleton.pi_single_eq (0 : fin 1) (y.1 - x), pi.single,
438+
← subsingleton.pi_single_eq (0 : fin 1) (y.2 - x), pi.single, ← (p 1).map_sub, ← pi.single,
439+
subsingleton.pi_single_eq, sub_sub_sub_cancel_right] },
440+
rw [emetric.mem_ball, edist_eq_coe_nnnorm_sub, ennreal.coe_lt_coe] at hy',
441+
set B : ℕ → ℝ := λ n,
442+
(C * (a / r') ^ 2) * (∥y - (x, x)∥ * ∥y.1 - y.2∥) * ((n + 2) * a ^ n),
443+
have hAB : ∀ n, ∥A (n + 2)∥ ≤ B n := λ n,
444+
calc ∥A (n + 2)∥ ≤ ∥p (n + 2)∥ * ↑(n + 2) * ∥y - (x, x)∥ ^ (n + 1) * ∥y.1 - y.2∥ :
445+
by simpa [fintype.card_fin, pi_norm_const, prod.norm_def, pi.sub_def, prod.fst_sub,
446+
prod.snd_sub, sub_sub_sub_cancel_right]
447+
using (p $ n + 2).norm_image_sub_le (λ _, y.1 - x) (λ _, y.2 - x)
448+
... = ∥p (n + 2)∥ * ∥y - (x, x)∥ ^ n * (↑(n + 2) * ∥y - (x, x)∥ * ∥y.1 - y.2∥) :
449+
by { rw [pow_succ ∥y - (x, x)∥], ac_refl }
450+
... ≤ (C * a ^ (n + 2) / r' ^ (n + 2)) * r' ^ n * (↑(n + 2) * ∥y - (x, x)∥ * ∥y.1 - y.2∥) :
451+
by apply_rules [mul_le_mul_of_nonneg_right, mul_le_mul, hp, pow_le_pow_of_le_left,
452+
hy'.le, norm_nonneg, pow_nonneg, div_nonneg, mul_nonneg, nat.cast_nonneg,
453+
hC.le, r'.coe_nonneg, ha.1.le]
454+
... = B n :
455+
by { field_simp [B, pow_succ, hr'0.ne'], simp [mul_assoc, mul_comm, mul_left_comm] },
456+
have hBL : has_sum B (L y),
457+
{ apply has_sum.mul_left,
458+
simp only [add_mul],
459+
have : ∥a∥ < 1, by simp only [real.norm_eq_abs, abs_of_pos ha.1, ha.2],
460+
convert (has_sum_coe_mul_geometric_of_norm_lt_1 this).add
461+
((has_sum_geometric_of_norm_lt_1 this).mul_left 2) },
462+
exact hA.norm_le_of_bounded hBL hAB },
463+
suffices : is_O L (λ y, ∥y - (x, x)∥ * ∥y.1 - y.2∥) (𝓟 (emetric.ball (x, x) r')),
464+
{ refine (is_O.of_bound 1 (eventually_principal.2 $ λ y hy, _)).trans this,
465+
rw one_mul,
466+
exact (hL y hy).trans (le_abs_self _) },
467+
simp_rw [L, mul_right_comm _ (_ * _)],
468+
exact (is_O_refl _ _).const_mul_left _,
469+
end
470+
471+
/-- If `f` has formal power series `∑ n, pₙ` on a ball of radius `r`, then for `y, z` in any smaller
472+
ball, the norm of the difference `f y - f z - p 1 (λ _, y - z)` is bounded above by
473+
`C * (max ∥y - x∥ ∥z - x∥) * ∥y - z∥`. -/
474+
lemma has_fpower_series_on_ball.image_sub_sub_deriv_le
475+
(hf : has_fpower_series_on_ball f p x r) (hr : r' < r) :
476+
∃ C, ∀ (y z ∈ emetric.ball x r'),
477+
∥f y - f z - (p 1 (λ _, y - z))∥ ≤ C * (max ∥y - x∥ ∥z - x∥) * ∥y - z∥ :=
478+
by simpa only [is_O_principal, mul_assoc, normed_field.norm_mul, norm_norm, prod.forall,
479+
emetric.mem_ball, prod.edist_eq, max_lt_iff, and_imp]
480+
using hf.is_O_image_sub_image_sub_deriv_principal hr
481+
482+
/-- If `f` has formal power series `∑ n, pₙ` at `x`, then
483+
`f y - f z - p 1 (λ _, y - z) = O(∥(y, z) - (x, x)∥ * ∥y - z∥)` as `(y, z) → (x, x)`.
484+
In particular, `f` is strictly differentiable at `x`. -/
485+
lemma has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub (hf : has_fpower_series_at f p x) :
486+
is_O (λ y : E × E, f y.1 - f y.2 - (p 1 (λ _, y.1 - y.2)))
487+
(λ y, ∥y - (x, x)∥ * ∥y.1 - y.2∥) (𝓝 (x, x)) :=
488+
begin
489+
rcases hf with ⟨r, hf⟩,
490+
rcases ennreal.lt_iff_exists_nnreal_btwn.1 hf.r_pos with ⟨r', r'0, h⟩,
491+
refine (hf.is_O_image_sub_image_sub_deriv_principal h).mono _,
492+
exact le_principal_iff.2 (emetric.ball_mem_nhds _ r'0)
493+
end
494+
392495
/-- If a function admits a power series expansion at `x`, then it is the uniform limit of the
393496
partial sums of this power series on strict subdisks of the disk of convergence, i.e., `f (x + y)`
394497
is the uniform limit of `p.partial_sum n y` there. -/

src/analysis/asymptotics.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,14 @@ begin
725725
(eventually_nhds_within_iff.2 $ eventually_of_forall $ λ c hc, h hc x)
726726
end
727727

728+
@[simp] lemma is_O_with_principal {s : set α} :
729+
is_O_with c f g (𝓟 s) ↔ ∀ x ∈ s, ∥f x∥ ≤ c * ∥g x∥ :=
730+
iff.rfl
731+
732+
lemma is_O_principal {s : set α} :
733+
is_O f g (𝓟 s) ↔ ∃ c, ∀ x ∈ s, ∥f x∥ ≤ c * ∥g x∥ :=
734+
iff.rfl
735+
728736
theorem is_O_with_const_one (c : E) (l : filter α) : is_O_with ∥c∥ (λ x : α, c) (λ x, (1 : 𝕜)) l :=
729737
begin
730738
refine (is_O_with_const_const c _ l).congr_const _,

src/analysis/calculus/deriv.lean

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,24 @@ e.has_deriv_within_at.deriv_within hxs
545545

546546
end linear_map
547547

548+
section analytic
549+
550+
variables {p : formal_multilinear_series 𝕜 𝕜 F} {r : ennreal}
551+
552+
lemma has_fpower_series_at.has_strict_deriv_at (h : has_fpower_series_at f p x) :
553+
has_strict_deriv_at f (p 1 (λ _, 1)) x :=
554+
h.has_strict_fderiv_at.has_strict_deriv_at
555+
556+
lemma has_fpower_series_at.has_deriv_at (h : has_fpower_series_at f p x) :
557+
has_deriv_at f (p 1 (λ _, 1)) x :=
558+
h.has_strict_deriv_at.has_deriv_at
559+
560+
lemma has_fpower_series_at.deriv (h : has_fpower_series_at f p x) :
561+
deriv f x = p 1 (λ _, 1) :=
562+
h.has_deriv_at.deriv
563+
564+
end analytic
565+
548566
section add
549567
/-! ### Derivative of the sum of two functions -/
550568

src/analysis/calculus/fderiv.lean

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov
66
import analysis.calculus.tangent_cone
77
import analysis.normed_space.units
88
import analysis.asymptotic_equivalent
9+
import analysis.analytic.basic
910

1011
/-!
1112
# The Fréchet derivative
@@ -910,6 +911,45 @@ h.differentiable.differentiable_on
910911

911912
end continuous_linear_map
912913

914+
section analytic
915+
916+
variables {p : formal_multilinear_series 𝕜 E F} {r : ennreal}
917+
918+
lemma has_fpower_series_at.has_strict_fderiv_at (h : has_fpower_series_at f p x) :
919+
has_strict_fderiv_at f (continuous_multilinear_curry_fin1 𝕜 E F (p 1)) x :=
920+
begin
921+
refine h.is_O_image_sub_norm_mul_norm_sub.trans_is_o (is_o.of_norm_right _),
922+
refine is_o_iff_exists_eq_mul.2 ⟨λ y, ∥y - (x, x)∥, _, eventually_eq.rfl⟩,
923+
refine (continuous_id.sub continuous_const).norm.tendsto' _ _ _,
924+
rw [_root_.id, sub_self, norm_zero]
925+
end
926+
927+
lemma has_fpower_series_at.has_fderiv_at (h : has_fpower_series_at f p x) :
928+
has_fderiv_at f (continuous_multilinear_curry_fin1 𝕜 E F (p 1)) x :=
929+
h.has_strict_fderiv_at.has_fderiv_at
930+
931+
lemma has_fpower_series_at.differentiable_at (h : has_fpower_series_at f p x) :
932+
differentiable_at 𝕜 f x :=
933+
h.has_fderiv_at.differentiable_at
934+
935+
lemma analytic_at.differentiable_at : analytic_at 𝕜 f x → differentiable_at 𝕜 f x
936+
| ⟨p, hp⟩ := hp.differentiable_at
937+
938+
lemma analytic_at.differentiable_within_at (h : analytic_at 𝕜 f x) :
939+
differentiable_within_at 𝕜 f s x :=
940+
h.differentiable_at.differentiable_within_at
941+
942+
lemma has_fpower_series_at.fderiv (h : has_fpower_series_at f p x) :
943+
fderiv 𝕜 f x = continuous_multilinear_curry_fin1 𝕜 E F (p 1) :=
944+
h.has_fderiv_at.fderiv
945+
946+
lemma has_fpower_series_on_ball.differentiable_on [complete_space F]
947+
(h : has_fpower_series_on_ball f p x r) :
948+
differentiable_on 𝕜 f (emetric.ball x r) :=
949+
λ y hy, (h.analytic_at_of_mem hy).differentiable_within_at
950+
951+
end analytic
952+
913953
section composition
914954
/-!
915955
### Derivative of the composition of two functions

src/data/pi.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ instance has_mul [∀ i, has_mul $ f i] :
4545
has_div (Π i : I, f i) :=
4646
⟨λ f g i, f i / g i⟩
4747
@[simp, to_additive] lemma div_apply [Π i, has_div $ f i] : (x / y) i = x i / y i := rfl
48+
@[to_additive] lemma div_def [Π i, has_div $ f i] : x / y = λ i, x i / y i := rfl
4849

4950
section
5051

@@ -70,3 +71,8 @@ function.update_injective _ i
7071

7172
end
7273
end pi
74+
75+
lemma subsingleton.pi_single_eq {α : Type*} [decidable_eq I] [subsingleton I] [has_zero α]
76+
(i : I) (x : α) :
77+
pi.single i x = λ _, x :=
78+
funext $ λ j, by rw [subsingleton.elim j i, pi.single_eq_same]

0 commit comments

Comments
 (0)