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

Commit 25f60b4

Browse files
committed
feat(analysis/calculus/cont_diff): extra lemmas about cont_diff_within_at (#15309)
* Also some lemmas about `fderiv_within` and `nhds_within`. * From the sphere eversion project
1 parent 51f76d0 commit 25f60b4

File tree

3 files changed

+97
-7
lines changed

3 files changed

+97
-7
lines changed

src/analysis/calculus/cont_diff.lean

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,12 @@ lemma cont_diff_within_at.congr_of_eventually_eq
452452
⟨{x ∈ u | f₁ x = f x}, filter.inter_mem hu (mem_nhds_within_insert.2 ⟨hx, h₁⟩), p,
453453
(H.mono (sep_subset _ _)).congr (λ _, and.right)⟩
454454

455+
lemma cont_diff_within_at.congr_of_eventually_eq_insert
456+
(h : cont_diff_within_at 𝕜 n f s x) (h₁ : f₁ =ᶠ[𝓝[insert x s] x] f) :
457+
cont_diff_within_at 𝕜 n f₁ s x :=
458+
h.congr_of_eventually_eq (nhds_within_mono x (subset_insert x s) h₁)
459+
(mem_of_mem_nhds_within (mem_insert x s) h₁ : _)
460+
455461
lemma cont_diff_within_at.congr_of_eventually_eq'
456462
(h : cont_diff_within_at 𝕜 n f s x) (h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : x ∈ s) :
457463
cont_diff_within_at 𝕜 n f₁ s x :=
@@ -569,6 +575,38 @@ begin
569575
rw [snoc_last, init_snoc] } } } }
570576
end
571577

578+
/-- One direction of `cont_diff_within_at_succ_iff_has_fderiv_within_at`, but where all derivatives
579+
are taken within the same set. -/
580+
lemma cont_diff_within_at.has_fderiv_within_at_nhds {n : ℕ}
581+
(hf : cont_diff_within_at 𝕜 (n + 1 : ℕ) f s x) :
582+
∃ u ∈ 𝓝[insert x s] x, u ⊆ insert x s ∧ ∃ f' : E → E →L[𝕜] F,
583+
(∀ x ∈ u, has_fderiv_within_at f (f' x) s x) ∧ cont_diff_within_at 𝕜 n f' s x :=
584+
begin
585+
obtain ⟨u, hu, f', huf', hf'⟩ := cont_diff_within_at_succ_iff_has_fderiv_within_at.mp hf,
586+
obtain ⟨w, hw, hxw, hwu⟩ := mem_nhds_within.mp hu,
587+
rw [inter_comm] at hwu,
588+
refine ⟨insert x s ∩ w, inter_mem_nhds_within _ (hw.mem_nhds hxw), inter_subset_left _ _,
589+
f', λ y hy, _, _⟩,
590+
{ refine ((huf' y $ hwu hy).mono hwu).mono_of_mem _,
591+
refine mem_of_superset _ (inter_subset_inter_left _ (subset_insert _ _)),
592+
refine inter_mem_nhds_within _ (hw.mem_nhds hy.2) },
593+
{ exact hf'.mono_of_mem (nhds_within_mono _ (subset_insert _ _) hu) }
594+
end
595+
596+
/-- A version of `cont_diff_within_at_succ_iff_has_fderiv_within_at` where all derivatives
597+
are taken within the same set. This lemma assumes `x ∈ s`. -/
598+
lemma cont_diff_within_at_succ_iff_has_fderiv_within_at_of_mem {n : ℕ} (hx : x ∈ s) :
599+
cont_diff_within_at 𝕜 (n + 1 : ℕ) f s x
600+
↔ ∃ u ∈ 𝓝[s] x, u ⊆ s ∧ ∃ f' : E → E →L[𝕜] F,
601+
(∀ x ∈ u, has_fderiv_within_at f (f' x) s x) ∧ cont_diff_within_at 𝕜 n f' s x :=
602+
begin
603+
split,
604+
{ intro hf, simpa only [insert_eq_of_mem hx] using hf.has_fderiv_within_at_nhds },
605+
rw [cont_diff_within_at_succ_iff_has_fderiv_within_at, insert_eq_of_mem hx],
606+
rintro ⟨u, hu, hus, f', huf', hf'⟩,
607+
exact ⟨u, hu, f', λ y hy, (huf' y hy).mono hus, hf'.mono hus⟩
608+
end
609+
572610
/-! ### Smooth functions within a set -/
573611

574612
variable (𝕜)
@@ -1093,6 +1131,31 @@ lemma cont_diff_on.continuous_on_fderiv_of_open
10931131
continuous_on (λ x, fderiv 𝕜 f x) s :=
10941132
((cont_diff_on_succ_iff_fderiv_of_open hs).1 (h.of_le hn)).2.continuous_on
10951133

1134+
lemma cont_diff_within_at.fderiv_within'
1135+
(hf : cont_diff_within_at 𝕜 n f s x) (hs : ∀ᶠ y in 𝓝[insert x s] x, unique_diff_within_at 𝕜 s y)
1136+
(hmn : m + 1 ≤ n) :
1137+
cont_diff_within_at 𝕜 m (fderiv_within 𝕜 f s) s x :=
1138+
begin
1139+
have : ∀ k : ℕ, (k + 1 : with_top ℕ) ≤ n → cont_diff_within_at 𝕜 k (fderiv_within 𝕜 f s) s x,
1140+
{ intros k hkn,
1141+
obtain ⟨v, hv, -, f', hvf', hf'⟩ := (hf.of_le hkn).has_fderiv_within_at_nhds,
1142+
apply hf'.congr_of_eventually_eq_insert,
1143+
filter_upwards [hv, hs],
1144+
exact λ y hy h2y, (hvf' y hy).fderiv_within h2y },
1145+
induction m using with_top.rec_top_coe,
1146+
{ obtain rfl := eq_top_iff.mpr hmn,
1147+
rw [cont_diff_within_at_top],
1148+
exact λ m, this m le_top },
1149+
exact this m hmn
1150+
end
1151+
1152+
lemma cont_diff_within_at.fderiv_within
1153+
(hf : cont_diff_within_at 𝕜 n f s x) (hs : unique_diff_on 𝕜 s)
1154+
(hmn : (m + 1 : with_top ℕ) ≤ n) (hxs : x ∈ s) :
1155+
cont_diff_within_at 𝕜 m (fderiv_within 𝕜 f s) s x :=
1156+
hf.fderiv_within' (by { rw [insert_eq_of_mem hxs], exact eventually_of_mem self_mem_nhds_within hs})
1157+
hmn
1158+
10961159
/-- If a function is at least `C^1`, its bundled derivative (mapping `(x, v)` to `Df(x) v`) is
10971160
continuous. -/
10981161
lemma cont_diff_on.continuous_on_fderiv_within_apply

src/analysis/calculus/fderiv.lean

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,13 @@ theorem has_fderiv_at_filter.mono (h : has_fderiv_at_filter f f' x L₂) (hst :
319319
has_fderiv_at_filter f f' x L₁ :=
320320
h.mono hst
321321

322+
theorem has_fderiv_within_at.mono_of_mem (h : has_fderiv_within_at f f' t x) (hst : t ∈ 𝓝[s] x) :
323+
has_fderiv_within_at f f' s x :=
324+
h.mono $ nhds_within_le_iff.mpr hst
325+
322326
theorem has_fderiv_within_at.mono (h : has_fderiv_within_at f f' t x) (hst : s ⊆ t) :
323327
has_fderiv_within_at f f' s x :=
324-
h.mono (nhds_within_mono _ hst)
328+
h.mono $ nhds_within_mono _ hst
325329

326330
theorem has_fderiv_at.has_fderiv_at_filter (h : has_fderiv_at f f' x) (hL : L ≤ 𝓝 x) :
327331
has_fderiv_at_filter f f' x L :=
@@ -795,6 +799,11 @@ else
795799
by rw [fderiv_within_zero_of_not_differentiable_within_at h,
796800
fderiv_within_zero_of_not_differentiable_within_at h']
797801

802+
lemma filter.eventually_eq.fderiv_within_eq_nhds (hs : unique_diff_within_at 𝕜 s x)
803+
(hL : f₁ =ᶠ[𝓝 x] f) :
804+
fderiv_within 𝕜 f₁ s x = fderiv_within 𝕜 f s x :=
805+
(show f₁ =ᶠ[𝓝[s] x] f, from nhds_within_le_nhds hL).fderiv_within_eq hs (mem_of_mem_nhds hL : _)
806+
798807
lemma fderiv_within_congr (hs : unique_diff_within_at 𝕜 s x)
799808
(hL : ∀y∈s, f₁ y = f y) (hx : f₁ x = f x) :
800809
fderiv_within 𝕜 f₁ s x = fderiv_within 𝕜 f s x :=
@@ -1104,6 +1113,21 @@ lemma fderiv_within.comp {g : F → G} {t : set F}
11041113
fderiv_within 𝕜 (g ∘ f) s x = (fderiv_within 𝕜 g t (f x)).comp (fderiv_within 𝕜 f s x) :=
11051114
(hg.has_fderiv_within_at.comp x (hf.has_fderiv_within_at) h).fderiv_within hxs
11061115

1116+
/-- Ternary version of `fderiv_within.comp`, with equality assumptions of basepoints added, in
1117+
order to apply more easily as a rewrite from right-to-left. -/
1118+
lemma fderiv_within.comp₃ {g' : G → G'} {g : F → G} {t : set F} {u : set G} {y : F} {y' : G}
1119+
(hg' : differentiable_within_at 𝕜 g' u y') (hg : differentiable_within_at 𝕜 g t y)
1120+
(hf : differentiable_within_at 𝕜 f s x)
1121+
(h2g : maps_to g t u) (h2f : maps_to f s t)
1122+
(h3g : g y = y') (h3f : f x = y) (hxs : unique_diff_within_at 𝕜 s x) :
1123+
fderiv_within 𝕜 (g' ∘ g ∘ f) s x = (fderiv_within 𝕜 g' u y').comp
1124+
((fderiv_within 𝕜 g t y).comp (fderiv_within 𝕜 f s x)) :=
1125+
begin
1126+
substs h3g h3f,
1127+
exact (hg'.has_fderiv_within_at.comp x
1128+
(hg.has_fderiv_within_at.comp x (hf.has_fderiv_within_at) h2f) $ h2g.comp h2f).fderiv_within hxs
1129+
end
1130+
11071131
lemma fderiv.comp {g : F → G}
11081132
(hg : differentiable_at 𝕜 g (f x)) (hf : differentiable_at 𝕜 f x) :
11091133
fderiv 𝕜 (g ∘ f) x = (fderiv 𝕜 g (f x)).comp (fderiv 𝕜 f x) :=

src/topology/continuous_on.lean

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ begin
118118
{ refine λ h u, eventually_congr (h.mono $ λ x h, _), rw [h] }
119119
end
120120

121+
lemma nhds_within_le_iff {s t : set α} {x : α} : 𝓝[s] x ≤ 𝓝[t] x ↔ t ∈ 𝓝[s] x :=
122+
begin
123+
simp_rw [filter.le_def, mem_nhds_within_iff_eventually],
124+
split,
125+
{ exact λ h, (h t $ eventually_of_forall (λ x, id)).mono (λ x, id) },
126+
{ exact λ h u hu, (h.and hu).mono (λ x hx h, hx.2 $ hx.1 h) }
127+
end
128+
121129
lemma preimage_nhds_within_coinduced' {π : α → β} {s : set β} {t : set α} {a : α}
122130
(h : a ∈ t) (ht : is_open t)
123131
(hs : s ∈ @nhds β (topological_space.coinduced (λ x : t, π x) subtype.topological_space) (π a)) :
@@ -182,12 +190,7 @@ nhds_within_restrict' s (is_open.mem_nhds h₁ h₀)
182190

183191
theorem nhds_within_le_of_mem {a : α} {s t : set α} (h : s ∈ 𝓝[t] a) :
184192
𝓝[t] a ≤ 𝓝[s] a :=
185-
begin
186-
rcases mem_nhds_within.1 h with ⟨u, u_open, au, uts⟩,
187-
have : 𝓝[t] a = 𝓝[t ∩ u] a := nhds_within_restrict _ au u_open,
188-
rw [this, inter_comm],
189-
exact nhds_within_mono _ uts
190-
end
193+
nhds_within_le_iff.mpr h
191194

192195
theorem nhds_within_le_nhds {a : α} {s : set α} : 𝓝[s] a ≤ 𝓝 a :=
193196
by { rw ← nhds_within_univ, apply nhds_within_le_of_mem, exact univ_mem }

0 commit comments

Comments
 (0)