Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: update the ContDiff definition to integrate analytic functions in the hierarchy #17152

Closed
wants to merge 211 commits into from
Closed
Show file tree
Hide file tree
Changes from 156 commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
db801b9
start splitting files
sgouezel Aug 26, 2024
43df049
add missing file
sgouezel Aug 26, 2024
272ee48
header
sgouezel Aug 26, 2024
bac313f
progress
sgouezel Aug 26, 2024
dcbe956
revert
sgouezel Aug 26, 2024
1bb6a0e
start expanding API
sgouezel Aug 26, 2024
58cbcfb
adjust definition of HasFPowerSeriesWithin
sgouezel Aug 27, 2024
69862c0
progress
sgouezel Aug 27, 2024
bb67015
progress
sgouezel Aug 27, 2024
a77deb8
add
sgouezel Aug 28, 2024
075c7ee
fix
sgouezel Aug 28, 2024
e85243b
progress
sgouezel Aug 28, 2024
755ab2a
missing lemma
sgouezel Aug 28, 2024
81848c7
move parts to another file
sgouezel Aug 28, 2024
be5b7b6
start cleaning up
sgouezel Aug 29, 2024
e68b886
progress
sgouezel Aug 29, 2024
bb3c204
progress
sgouezel Aug 29, 2024
2b2b41f
progress
sgouezel Aug 30, 2024
5f9d668
move to right file
sgouezel Aug 30, 2024
623ec01
Merge remote-tracking branch 'origin/master' into SG_contdiff
sgouezel Aug 30, 2024
5792b81
change definition, start proving composition without completeness
sgouezel Aug 30, 2024
ea4edb5
start new proof
sgouezel Sep 6, 2024
7c9f513
complete new lemma
sgouezel Sep 7, 2024
21dc6e0
progress
sgouezel Sep 7, 2024
550a657
fix composition proof
sgouezel Sep 7, 2024
7b32913
move
sgouezel Sep 7, 2024
0fbe3bd
fix
sgouezel Sep 7, 2024
ab67210
progress
sgouezel Sep 7, 2024
38234a8
more API
sgouezel Sep 8, 2024
ddce1e8
progress
sgouezel Sep 8, 2024
0f3d8da
oops
sgouezel Sep 8, 2024
bab22c6
progress
sgouezel Sep 8, 2024
d58ee8f
merge master
sgouezel Sep 8, 2024
3c9dbbd
complete fix of first file
sgouezel Sep 8, 2024
9aa8705
start fixing new file
sgouezel Sep 8, 2024
8a10811
fix
sgouezel Sep 9, 2024
0ee2500
fix
sgouezel Sep 9, 2024
9160a8c
save
sgouezel Sep 9, 2024
75e12c2
progress
sgouezel Sep 10, 2024
fcd39b0
finish adapting API
sgouezel Sep 10, 2024
3741713
staging
sgouezel Sep 10, 2024
1479b53
fix
sgouezel Sep 10, 2024
52505a2
revert partly
sgouezel Sep 11, 2024
db2ebac
fix
sgouezel Sep 11, 2024
f081995
progress
sgouezel Sep 11, 2024
4ffc527
more analytic functions
sgouezel Sep 11, 2024
e3e20d0
progress
sgouezel Sep 11, 2024
23df720
analyticity in pi spaces
sgouezel Sep 12, 2024
b502129
Merge remote-tracking branch 'origin/master' into SG_contdiff
sgouezel Sep 12, 2024
60395a6
more API
sgouezel Sep 12, 2024
686ca02
delete, move
sgouezel Sep 12, 2024
6b72615
rename
sgouezel Sep 12, 2024
468a7fc
try merging master
sgouezel Sep 12, 2024
d0dc0ba
fix
sgouezel Sep 12, 2024
c1cb4ee
fix
sgouezel Sep 12, 2024
63f1bff
fix merge
sgouezel Sep 12, 2024
43b2677
fix merge
sgouezel Sep 12, 2024
437d547
fix
sgouezel Sep 12, 2024
b438e59
prove that linear maps into multilinear maps are analytic
sgouezel Sep 12, 2024
7c810d2
Merge remote-tracking branch 'origin/master' into SG_contdiff
sgouezel Sep 12, 2024
8baf155
merge master
sgouezel Sep 12, 2024
eaa0e60
fix merge
sgouezel Sep 12, 2024
7a384a8
cleanup
sgouezel Sep 13, 2024
47d0ee1
expand API
sgouezel Sep 13, 2024
3f6cb58
cleanup
sgouezel Sep 13, 2024
9aac586
fix
sgouezel Sep 13, 2024
47b15b8
progress
sgouezel Sep 13, 2024
a13ddd9
staging
sgouezel Sep 13, 2024
159fe7e
progress
sgouezel Sep 13, 2024
d0abe95
missing basic lemma
sgouezel Sep 13, 2024
4baab7f
add
sgouezel Sep 13, 2024
b5f16d1
compute derivative of linear to multilinear map
sgouezel Sep 13, 2024
b8da5c7
new simp lemma
sgouezel Sep 13, 2024
1f03f54
progress
sgouezel Sep 13, 2024
1d7ab28
progress
sgouezel Sep 14, 2024
58ad96d
progress
sgouezel Sep 14, 2024
5419abf
complete proof
sgouezel Sep 15, 2024
cf199c0
Merge remote-tracking branch 'origin/master' into SG_contdiff
sgouezel Sep 15, 2024
c57d4d5
fix
sgouezel Sep 15, 2024
8a4e3f1
move to right files
sgouezel Sep 15, 2024
8bc2575
cleanup
sgouezel Sep 15, 2024
68c3d16
merge master
sgouezel Sep 15, 2024
f7daff1
fix
sgouezel Sep 15, 2024
1481fb7
fix merge
sgouezel Sep 15, 2024
a5129a8
merge master
sgouezel Sep 16, 2024
dae5849
fix merge
sgouezel Sep 16, 2024
538cf00
cleanup notation
sgouezel Sep 16, 2024
98c5c33
go on fixing
sgouezel Sep 16, 2024
10cd480
progress
sgouezel Sep 16, 2024
7d6cc62
merge master
sgouezel Sep 16, 2024
50b8385
fix
sgouezel Sep 16, 2024
1b1d694
still more API
sgouezel Sep 17, 2024
b9bd3bd
fix
sgouezel Sep 17, 2024
925e405
fix file
sgouezel Sep 17, 2024
46d9823
fix
sgouezel Sep 17, 2024
550d737
progress
sgouezel Sep 17, 2024
02c5ee5
merge master
sgouezel Sep 18, 2024
a78a557
fix
sgouezel Sep 18, 2024
7a1041a
lint
sgouezel Sep 18, 2024
4b7e504
progress
sgouezel Sep 18, 2024
01a519b
progress
sgouezel Sep 19, 2024
61d8d21
fix
sgouezel Sep 19, 2024
12ac33e
prg
sgouezel Sep 19, 2024
17dfeb2
progress
sgouezel Sep 19, 2024
152cf52
fix
sgouezel Sep 19, 2024
31bf937
refactor
sgouezel Sep 20, 2024
573a485
progress
sgouezel Sep 20, 2024
f4fa47f
complete fixes
sgouezel Sep 20, 2024
f27adee
reorganize, cherry pick
sgouezel Sep 20, 2024
a8d9e1b
merge master
sgouezel Sep 20, 2024
be10470
fix merge
sgouezel Sep 20, 2024
b72293b
missing file
sgouezel Sep 20, 2024
6a19871
refix
sgouezel Sep 20, 2024
ab2b9f8
fix import
sgouezel Sep 20, 2024
58f90a7
start rebasing
sgouezel Sep 22, 2024
9b260b4
add results on analyticity of inv
sgouezel Sep 22, 2024
2609c02
merge
sgouezel Sep 22, 2024
d28cd16
fix merge
sgouezel Sep 22, 2024
f65fad1
fix merge
sgouezel Sep 22, 2024
3192494
missing lemma
sgouezel Sep 22, 2024
aa285d4
analyticity wrt restrictScalars
sgouezel Sep 22, 2024
5726c89
prgroess
sgouezel Sep 22, 2024
44f57b3
missing lemma on sums on sigma spaces
sgouezel Sep 23, 2024
4184bd5
fix
sgouezel Sep 23, 2024
3ba5ab3
progress
sgouezel Sep 23, 2024
fd0ea46
progress
sgouezel Sep 24, 2024
2d8c0a5
more
sgouezel Sep 24, 2024
8700069
fix
sgouezel Sep 25, 2024
584f7b4
lint
sgouezel Sep 25, 2024
bcef338
move to namespace
sgouezel Sep 25, 2024
1636d5f
statement in terms of fderiv
sgouezel Sep 25, 2024
fafe8d9
primed variant
sgouezel Sep 25, 2024
4c33985
fix file
sgouezel Sep 25, 2024
07915c7
move around
sgouezel Sep 25, 2024
4299704
comment out a few theorems
sgouezel Sep 25, 2024
a242b04
register analyticity of exp earlier
sgouezel Sep 25, 2024
1841fae
progress
sgouezel Sep 25, 2024
9951b67
progress
sgouezel Sep 25, 2024
6e3f229
fix many files
sgouezel Sep 25, 2024
ffe75ff
more cleanup
sgouezel Sep 25, 2024
d75f754
fix
sgouezel Sep 25, 2024
ab70d3c
final fix
sgouezel Sep 25, 2024
1460cd4
lint
sgouezel Sep 25, 2024
968a536
merge master
sgouezel Sep 25, 2024
354d186
move, lint
sgouezel Sep 26, 2024
2e25354
fix
sgouezel Sep 26, 2024
c0a4f11
fix archive
sgouezel Sep 26, 2024
f09a229
fix funprop test
sgouezel Sep 26, 2024
1ee4e55
fix
sgouezel Sep 26, 2024
7a52c3b
rename to follow otherPR
sgouezel Sep 26, 2024
a1e9baa
merge master
sgouezel Sep 26, 2024
d4fb493
fix
sgouezel Sep 26, 2024
70193db
missing lemma
sgouezel Sep 26, 2024
c167ce3
fix
sgouezel Sep 26, 2024
f093b6a
fix
sgouezel Sep 26, 2024
3126b8c
fix
sgouezel Sep 26, 2024
2b47afc
merge master
sgouezel Sep 28, 2024
65bedb6
change whitespace to rebuild
sgouezel Sep 28, 2024
67b0d0c
merge master
sgouezel Oct 4, 2024
322839c
fix merge
sgouezel Oct 4, 2024
284b273
merge master
sgouezel Oct 4, 2024
85d45a4
fix
sgouezel Oct 4, 2024
6a0bc44
merge master
sgouezel Oct 21, 2024
fd10197
fix
sgouezel Oct 21, 2024
1ba953e
fix
sgouezel Oct 21, 2024
03546c8
fix
sgouezel Oct 21, 2024
475cfcc
merge master
sgouezel Nov 4, 2024
9c8639e
start fixing
sgouezel Nov 5, 2024
1bd7a02
fix
sgouezel Nov 5, 2024
3ddf7da
fix
sgouezel Nov 5, 2024
6517226
fix
sgouezel Nov 5, 2024
e56e2b8
fix
sgouezel Nov 5, 2024
39fa17e
Merge remote-tracking branch 'origin/master' into SG_contdiff
sgouezel Nov 6, 2024
492ed0b
merge master
sgouezel Nov 6, 2024
e39a8ad
merge master
sgouezel Nov 11, 2024
6516304
fix
sgouezel Nov 11, 2024
3a7396c
merge
sgouezel Nov 11, 2024
fdcee36
fix
sgouezel Nov 11, 2024
d8c67f0
fixes
sgouezel Nov 11, 2024
9c75507
merge master
sgouezel Nov 20, 2024
6a7ef98
fix
sgouezel Nov 20, 2024
06d268e
progress
sgouezel Nov 20, 2024
6cead70
fix
sgouezel Nov 20, 2024
5bdf284
mod_cast instead of by exact_mod_cast
sgouezel Nov 20, 2024
7882d68
try to cherry pick
sgouezel Nov 21, 2024
9fdfe72
cleanup
sgouezel Nov 21, 2024
94cf606
fix
sgouezel Nov 22, 2024
48676b3
missing file
sgouezel Nov 22, 2024
a9d53e3
fix
sgouezel Nov 22, 2024
86373a0
fix
sgouezel Nov 22, 2024
00fb360
fix
sgouezel Nov 22, 2024
1875a11
merge master
sgouezel Nov 22, 2024
daff70a
merge other branch
sgouezel Nov 22, 2024
d8f5ed2
fix
sgouezel Nov 22, 2024
c6e8f7c
fix
sgouezel Nov 22, 2024
b513d89
imports
sgouezel Nov 22, 2024
ff4a30c
merge master
sgouezel Nov 25, 2024
859f473
fix
sgouezel Nov 25, 2024
8471b92
fix
sgouezel Nov 25, 2024
8001cd6
fix
sgouezel Nov 25, 2024
5ddea0e
fix
sgouezel Nov 25, 2024
21079c1
fix
sgouezel Nov 25, 2024
00ca05a
fix
sgouezel Nov 27, 2024
b431ccf
fix
sgouezel Nov 27, 2024
a29bf9a
fix
sgouezel Nov 27, 2024
ff213c8
fix
sgouezel Nov 27, 2024
500c65a
fix
sgouezel Nov 27, 2024
04edc7d
add deprecations
sgouezel Nov 27, 2024
9746d96
fix
sgouezel Nov 28, 2024
d6c2acb
Merge branch 'master' into SG_contdiff
urkud Nov 29, 2024
e1e71a3
stronger conclusions
sgouezel Nov 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Archive/Hairer.lean
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ noncomputable section
open Metric Set MeasureTheory
open MvPolynomial hiding support
open Function hiding eval
open scoped ContDiff

variable {ι : Type*} [Fintype ι]

Expand Down Expand Up @@ -110,7 +111,7 @@ lemma inj_L : Injective (L ι) :=
apply subset_closure

lemma hairer (N : ℕ) (ι : Type*) [Fintype ι] :
∃ (ρ : EuclideanSpace ℝ ι → ℝ), tsupport ρ ⊆ closedBall 0 1 ∧ ContDiff ℝ ρ ∧
∃ (ρ : EuclideanSpace ℝ ι → ℝ), tsupport ρ ⊆ closedBall 0 1 ∧ ContDiff ℝ ρ ∧
∀ (p : MvPolynomial ι ℝ), p.totalDegree ≤ N →
∫ x : EuclideanSpace ℝ ι, eval x p • ρ x = eval 0 p := by
have := (inj_L ι).comp (restrictTotalDegree ι ℝ N).injective_subtype
Expand Down
2 changes: 2 additions & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Basic
import Mathlib.Analysis.Calculus.ContDiff.Bounds
import Mathlib.Analysis.Calculus.ContDiff.Defs
import Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries
import Mathlib.Analysis.Calculus.ContDiff.FaaDiBruno
import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension
import Mathlib.Analysis.Calculus.ContDiff.RCLike
import Mathlib.Analysis.Calculus.Darboux
Expand All @@ -1001,6 +1002,7 @@ import Mathlib.Analysis.Calculus.DiffContOnCl
import Mathlib.Analysis.Calculus.Dslope
import Mathlib.Analysis.Calculus.FDeriv.Add
import Mathlib.Analysis.Calculus.FDeriv.Analytic
import Mathlib.Analysis.Calculus.FDeriv.AnalyticIt
import Mathlib.Analysis.Calculus.FDeriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Bilinear
import Mathlib.Analysis.Calculus.FDeriv.Comp
Expand Down
108 changes: 98 additions & 10 deletions Mathlib/Analysis/Analytic/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,18 @@ theorem le_mul_pow_of_radius_pos (p : FormalMultilinearSeries 𝕜 E F) (h : 0 <
rw [inv_pow, ← div_eq_mul_inv]
exact hCp n

lemma radius_le_of_le {𝕜' E' F' : Type*}
[NontriviallyNormedField 𝕜'] [NormedAddCommGroup E'] [NormedSpace 𝕜' E']
[NormedAddCommGroup F'] [NormedSpace 𝕜' F']
{p : FormalMultilinearSeries 𝕜 E F} {q : FormalMultilinearSeries 𝕜' E' F'}
(h : ∀ n, ‖p n‖ ≤ ‖q n‖) : q.radius ≤ p.radius := by
apply le_of_forall_nnreal_lt (fun r hr ↦ ?_)
rcases norm_mul_pow_le_of_lt_radius _ hr with ⟨C, -, hC⟩
apply le_radius_of_bound _ C (fun n ↦ ?_)
apply le_trans _ (hC n)
gcongr
exact h n

/-- The radius of the sum of two formal series is at least the minimum of their two radii. -/
theorem min_radius_le_radius_add (p q : FormalMultilinearSeries 𝕜 E F) :
min p.radius q.radius ≤ (p + q).radius := by
Expand Down Expand Up @@ -478,6 +490,16 @@ lemma HasFPowerSeriesWithinOnBall.congr {f g : E → F} {p : FormalMultilinearSe
refine ⟨hy, ?_⟩
simpa [edist_eq_coe_nnnorm_sub] using h'y

/-- Variant of `HasFPowerSeriesWithinOnBall.congr` where one does not separate the congruence
property between `s` and `x`, requesting it instead of `insert x s`. -/
lemma HasFPowerSeriesWithinOnBall.congr' {f g : E → F} {p : FormalMultilinearSeries 𝕜 E F}
{s : Set E} {x : E} {r : ℝ≥0∞} (h : HasFPowerSeriesWithinOnBall f p s x r)
(h' : EqOn g f (insert x s ∩ EMetric.ball x r)) :
HasFPowerSeriesWithinOnBall g p s x r := by
refine ⟨h.r_le, h.r_pos, fun {y} hy h'y ↦ ?_⟩
convert h.hasSum hy h'y using 1
exact h' ⟨hy, by simpa [edist_eq_coe_nnnorm_sub] using h'y⟩

lemma HasFPowerSeriesWithinAt.congr {f g : E → F} {p : FormalMultilinearSeries 𝕜 E F} {s : Set E}
{x : E} (h : HasFPowerSeriesWithinAt f p s x) (h' : g =ᶠ[𝓝[s] x] f) (h'' : g x = f x) :
HasFPowerSeriesWithinAt g p s x := by
Expand Down Expand Up @@ -581,6 +603,39 @@ lemma HasFPowerSeriesAt.hasFPowerSeriesWithinAt (hf : HasFPowerSeriesAt f p x) :
rw [← hasFPowerSeriesWithinAt_univ] at hf
apply hf.mono (subset_univ _)

theorem HasFPowerSeriesWithinAt.mono_of_mem {f : E → F} {p : FormalMultilinearSeries 𝕜 E F}
{s t : Set E} {x : E} (h : HasFPowerSeriesWithinAt f p s x) (hst : s ∈ 𝓝[t] x) :
HasFPowerSeriesWithinAt f p t x := by
rcases h with ⟨r, hr⟩
rcases EMetric.mem_nhdsWithin_iff.1 hst with ⟨r', r'_pos, hr'⟩
refine ⟨min r r', ?_⟩
have Z := hr.of_le (by simp [r'_pos, hr.r_pos]) (min_le_left r r')
refine ⟨Z.r_le, Z.r_pos, fun {y} hy h'y ↦ ?_⟩
apply Z.hasSum ?_ h'y
simp only [mem_insert_iff, add_right_eq_self] at hy
rcases hy with rfl | hy
· simp
apply mem_insert_of_mem _ (hr' ?_)
simp only [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, sub_zero, lt_min_iff, mem_inter_iff,
add_sub_cancel_left, hy, and_true] at h'y ⊢
exact h'y.2

@[simp] lemma hasFPowerSeriesWithinOnBall_insert_self {f : E → F}
{p : FormalMultilinearSeries 𝕜 E F} {s : Set E} {x : E} {r : ℝ≥0∞} :
HasFPowerSeriesWithinOnBall f p (insert x s) x r ↔ HasFPowerSeriesWithinOnBall f p s x r := by
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;>
exact ⟨h.r_le, h.r_pos, fun {y} ↦ by simpa only [insert_idem] using h.hasSum (y := y)⟩

@[simp] theorem hasFPowerSeriesAt_insert {f : E → F} {p : FormalMultilinearSeries 𝕜 E F}
{s : Set E} {x y : E} :
HasFPowerSeriesWithinAt f p (insert y s) x ↔ HasFPowerSeriesWithinAt f p s x := by
rcases eq_or_ne x y with rfl | hy
· simp [HasFPowerSeriesWithinAt]
· refine ⟨fun h ↦ h.mono (subset_insert _ _), fun h ↦ ?_⟩
apply HasFPowerSeriesWithinAt.mono_of_mem h
rw [nhdsWithin_insert_of_ne hy]
exact self_mem_nhdsWithin

theorem HasFPowerSeriesWithinOnBall.coeff_zero (hf : HasFPowerSeriesWithinOnBall f pf s x r)
(v : Fin 0 → E) : pf 0 v = f x := by
have v_eq : v = fun i => 0 := Subsingleton.elim _ _
Expand Down Expand Up @@ -697,28 +752,53 @@ theorem analyticOnNhd_congr (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOnNhd
@[deprecated (since := "2024-09-26")]
alias analyticOn_congr := analyticOnNhd_congr

theorem AnalyticWithinAt.mono_of_mem {f : E → F} {s t : Set E} {x : E}
(h : AnalyticWithinAt 𝕜 f s x) (hst : s ∈ 𝓝[t] x) : AnalyticWithinAt 𝕜 f t x := by
rcases h with ⟨p, hp⟩
exact ⟨p, hp.mono_of_mem hst⟩

lemma AnalyticOn.mono {f : E → F} {s t : Set E} (h : AnalyticOn 𝕜 f t)
(hs : s ⊆ t) : AnalyticOn 𝕜 f s :=
fun _ m ↦ (h _ (hs m)).mono hs

@[deprecated (since := "2024-09-26")]
alias AnalyticWithinOn.mono := AnalyticOn.mono

@[simp] theorem analyticWithinAt_insert {f : E → F} {s : Set E} {x y : E} :
AnalyticWithinAt 𝕜 f (insert y s) x ↔ AnalyticWithinAt 𝕜 f s x := by
simp [AnalyticWithinAt]

/-!
### Composition with linear maps
-/

/-- If a function `f` has a power series `p` on a ball within a set and `g` is linear,
then `g ∘ f` has the power series `g ∘ p` on the same ball. -/
theorem ContinuousLinearMap.comp_hasFPowerSeriesWithinOnBall (g : F →L[𝕜] G)
(h : HasFPowerSeriesWithinOnBall f p s x r) :
HasFPowerSeriesWithinOnBall (g ∘ f) (g.compFormalMultilinearSeries p) s x r where
r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _)
r_pos := h.r_pos
hasSum := fun hy h'y => by
simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply,
ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using
g.hasSum (h.hasSum hy h'y)

/-- If a function `f` has a power series `p` on a ball and `g` is linear, then `g ∘ f` has the
power series `g ∘ p` on the same ball. -/
theorem ContinuousLinearMap.comp_hasFPowerSeriesOnBall (g : F →L[𝕜] G)
(h : HasFPowerSeriesOnBall f p x r) :
HasFPowerSeriesOnBall (g ∘ f) (g.compFormalMultilinearSeries p) x r :=
{ r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _)
r_pos := h.r_pos
hasSum := fun hy => by
simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply,
ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using
g.hasSum (h.hasSum hy) }
HasFPowerSeriesOnBall (g ∘ f) (g.compFormalMultilinearSeries p) x r := by
rw [← hasFPowerSeriesWithinOnBall_univ] at h ⊢
exact g.comp_hasFPowerSeriesWithinOnBall h

/-- If a function `f` is analytic on a set `s` and `g` is linear, then `g ∘ f` is analytic
on `s`. -/
theorem ContinuousLinearMap.comp_analyticOn {s : Set E} (g : F →L[𝕜] G) (h : AnalyticOn 𝕜 f s) :
AnalyticOn 𝕜 (g ∘ f) s := by
rintro x hx
rcases h x hx with ⟨p, r, hp⟩
exact ⟨g.compFormalMultilinearSeries p, r, g.comp_hasFPowerSeriesWithinOnBall hp⟩

/-- If a function `f` is analytic on a set `s` and `g` is linear, then `g ∘ f` is analytic
on `s`. -/
Expand All @@ -729,9 +809,6 @@ theorem ContinuousLinearMap.comp_analyticOnNhd
rcases h x hx with ⟨p, r, hp⟩
exact ⟨g.compFormalMultilinearSeries p, r, g.comp_hasFPowerSeriesOnBall hp⟩

@[deprecated (since := "2024-09-26")]
alias ContinuousLinearMap.comp_analyticOn := ContinuousLinearMap.comp_analyticOnNhd

/-!
### Relation between analytic function and the partial sums of its power series
-/
Expand All @@ -747,6 +824,13 @@ theorem HasFPowerSeriesOnBall.tendsto_partialSum
Tendsto (fun n => p.partialSum n y) atTop (𝓝 (f (x + y))) :=
(hf.hasSum hy).tendsto_sum_nat

theorem HasFPowerSeriesAt.tendsto_partialSum
(hf : HasFPowerSeriesAt f p x) :
∀ᶠ y in 𝓝 0, Tendsto (fun n => p.partialSum n y) atTop (𝓝 (f (x + y))) := by
rcases hf with ⟨r, hr⟩
filter_upwards [EMetric.ball_mem_nhds (0 : E) hr.r_pos] with y hy
exact hr.tendsto_partialSum hy

open Finset in
/-- If a function admits a power series expansion within a ball, then the partial sums
`p.partialSum n z` converge to `f (x + y)` as `n → ∞` and `z → y`. Note that `x + z` doesn't need
Expand Down Expand Up @@ -1228,6 +1312,10 @@ protected theorem FormalMultilinearSeries.hasFPowerSeriesOnBall [CompleteSpace F
rw [zero_add]
exact p.hasSum hy }

theorem HasFPowerSeriesWithinOnBall.sum (h : HasFPowerSeriesWithinOnBall f p s x r) {y : E}
(h'y : x + y ∈ insert x s) (hy : y ∈ EMetric.ball (0 : E) r) : f (x + y) = p.sum y :=
(h.hasSum h'y hy).tsum_eq.symm

theorem HasFPowerSeriesOnBall.sum (h : HasFPowerSeriesOnBall f p x r) {y : E}
(hy : y ∈ EMetric.ball (0 : E) r) : f (x + y) = p.sum y :=
(h.hasSum hy).tsum_eq.symm
Expand Down
78 changes: 57 additions & 21 deletions Mathlib/Analysis/Analytic/ChangeOrigin.lean
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ def derivSeries : FormalMultilinearSeries 𝕜 E (E →L[𝕜] F) :=
(continuousMultilinearCurryFin1 𝕜 E F : (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F)
|>.compFormalMultilinearSeries (p.changeOriginSeries 1)

theorem radius_le_radius_derivSeries : p.radius ≤ p.derivSeries.radius := by
apply (p.le_changeOriginSeries_radius 1).trans (radius_le_of_le (fun n ↦ ?_))
apply (ContinuousLinearMap.norm_compContinuousMultilinearMap_le _ _).trans
apply mul_le_of_le_one_left (norm_nonneg _)
exact ContinuousLinearMap.opNorm_le_bound _ zero_le_one (by simp)

end

-- From this point on, assume that the space is complete, to make sure that series that converge
Expand Down Expand Up @@ -284,39 +290,69 @@ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries 𝕜 E F) (rp : p.r

end FormalMultilinearSeries


section

variable [CompleteSpace F] {f : E → F} {p : FormalMultilinearSeries 𝕜 E F} {x y : E} {r : ℝ≥0∞}
variable [CompleteSpace F] {f : E → F} {p : FormalMultilinearSeries 𝕜 E F} {s : Set E}
{x y : E} {r : ℝ≥0∞}

/-- If a function admits a power series expansion `p` within a set `s` on a ball `B (x, r)`, then
it also admits a power series on any subball of this ball (even with a different center provided
it belongs to `s`), given by `p.changeOrigin`. -/
theorem HasFPowerSeriesWithinOnBall.changeOrigin (hf : HasFPowerSeriesWithinOnBall f p s x r)
(h : (‖y‖₊ : ℝ≥0∞) < r) (hy : x + y ∈ insert x s) :
HasFPowerSeriesWithinOnBall f (p.changeOrigin y) s (x + y) (r - ‖y‖₊) where
r_le := by
apply le_trans _ p.changeOrigin_radius
exact tsub_le_tsub hf.r_le le_rfl
r_pos := by simp [h]
hasSum := fun {z} h'z hz => by
have : f (x + y + z) =
FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by
rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz
rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum]
· have : insert (x + y) s ⊆ insert (x + y) (insert x s) := by
apply insert_subset_insert (subset_insert _ _)
rw [insert_eq_of_mem hy] at this
apply this
simpa [add_assoc] using h'z
refine mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt ?_ hz)
exact mod_cast nnnorm_add_le y z
rw [this]
apply (p.changeOrigin y).hasSum
refine EMetric.ball_subset_ball (le_trans ?_ p.changeOrigin_radius) hz
exact tsub_le_tsub hf.r_le le_rfl

/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a
power series on any subball of this ball (even with a different center), given by `p.changeOrigin`.
-/
theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r)
(h : (‖y‖₊ : ℝ≥0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - ‖y‖₊) :=
{ r_le := by
apply le_trans _ p.changeOrigin_radius
exact tsub_le_tsub hf.r_le le_rfl
r_pos := by simp [h]
hasSum := fun {z} hz => by
have : f (x + y + z) =
FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by
rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz
rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum]
refine mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt ?_ hz)
exact mod_cast nnnorm_add_le y z
rw [this]
apply (p.changeOrigin y).hasSum
refine EMetric.ball_subset_ball (le_trans ?_ p.changeOrigin_radius) hz
exact tsub_le_tsub hf.r_le le_rfl }
(h : (‖y‖₊ : ℝ≥0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - ‖y‖₊) := by
rw [← hasFPowerSeriesWithinOnBall_univ] at hf ⊢
exact hf.changeOrigin h (by simp)

/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then
it is analytic at every point of this ball. -/
theorem HasFPowerSeriesWithinOnBall.analyticWithinAt_of_mem
(hf : HasFPowerSeriesWithinOnBall f p s x r)
(h : y ∈ insert x s ∩ EMetric.ball x r) : AnalyticWithinAt 𝕜 f s y := by
have : (‖y - x‖₊ : ℝ≥0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h.2
have := hf.changeOrigin this (by simpa using h.1)
rw [add_sub_cancel] at this
exact this.analyticWithinAt

/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then
it is analytic at every point of this ball. -/
theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r)
(h : y ∈ EMetric.ball x r) : AnalyticAt 𝕜 f y := by
have : (‖y - x‖₊ : ℝ≥0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h
have := hf.changeOrigin this
rw [add_sub_cancel] at this
exact this.analyticAt
rw [← hasFPowerSeriesWithinOnBall_univ] at hf
rw [← analyticWithinAt_univ]
exact hf.analyticWithinAt_of_mem (by simpa using h)

theorem HasFPowerSeriesWithinOnBall.analyticOn (hf : HasFPowerSeriesWithinOnBall f p s x r) :
AnalyticOn 𝕜 f (insert x s ∩ EMetric.ball x r) :=
fun _ hy ↦ ((analyticWithinAt_insert (y := x)).2 (hf.analyticWithinAt_of_mem hy)).mono
inter_subset_left

theorem HasFPowerSeriesOnBall.analyticOnNhd (hf : HasFPowerSeriesOnBall f p x r) :
AnalyticOnNhd 𝕜 f (EMetric.ball x r) :=
Expand Down
Loading
Loading