Skip to content

Commit fd465e8

Browse files
urkudpfaffelh
authored andcommitted
chore(FDeriv/Const): generalize to a TVS (leanprover-community#34833)
Proofs about `fderiv`/`fderivWithin` were changed to avoid extra typeclass assumptions. Also replace one `simp only` with `simp`, since the default `simp` set works here.
1 parent 1fc62de commit fd465e8

1 file changed

Lines changed: 16 additions & 20 deletions

File tree

Mathlib/Analysis/Calculus/FDeriv/Const.lean

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ derivative, differentiable, Fréchet, calculus
2222

2323
public section
2424

25-
open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal ENNReal
25+
open Asymptotics Function Filter Set Metric
26+
open scoped Topology NNReal ENNReal
2627

2728
noncomputable section
2829

2930
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]
30-
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
31-
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
31+
variable {E : Type*} [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E]
32+
variable {F : Type*} [AddCommGroup F] [Module 𝕜 F] [TopologicalSpace F]
3233

3334
variable {f : E → F} {x : E} {s : Set E}
3435

@@ -37,8 +38,7 @@ section Const
3738
@[fun_prop]
3839
theorem hasStrictFDerivAt_const (c : F) (x : E) :
3940
HasStrictFDerivAt (fun _ => c) (0 : E →L[𝕜] F) x :=
40-
.of_isLittleOTVS <| (IsLittleOTVS.zero _ _).congr_left fun _ => by
41-
simp only [zero_apply, sub_self, Pi.zero_apply]
41+
.of_isLittleOTVS <| (IsLittleOTVS.zero _ _).congr_left fun _ => by simp
4242

4343
@[fun_prop]
4444
theorem hasStrictFDerivAt_zero (x : E) :
@@ -62,8 +62,7 @@ theorem hasStrictFDerivAt_ofNat (n : ℕ) [OfNat F n] (x : E) :
6262

6363
theorem hasFDerivAtFilter_const (c : F) (x : E) (L : Filter E) :
6464
HasFDerivAtFilter (fun _ => c) (0 : E →L[𝕜] F) x L :=
65-
.of_isLittleOTVS <| (IsLittleOTVS.zero _ _).congr_left fun _ => by
66-
simp only [zero_apply, sub_self, Pi.zero_apply]
65+
.of_isLittleOTVS <| (IsLittleOTVS.zero _ _).congr_left fun _ => by simp
6766

6867
theorem hasFDerivAtFilter_zero (x : E) (L : Filter E) :
6968
HasFDerivAtFilter (0 : E → F) (0 : E →L[𝕜] F) x L := hasFDerivAtFilter_const _ _ _
@@ -214,8 +213,8 @@ theorem fderivWithin_intCast [IntCast F] (z : ℤ) : fderivWithin 𝕜 (z : E
214213
theorem fderivWithin_ofNat (n : ℕ) [OfNat F n] : fderivWithin 𝕜 (ofNat(n) : E → F) s = 0 :=
215214
fderivWithin_const _
216215

217-
theorem fderiv_const_apply (c : F) : fderiv 𝕜 (fun _ => c) x = 0 :=
218-
(hasFDerivAt_const c x).fderiv
216+
theorem fderiv_const_apply (c : F) : fderiv 𝕜 (fun _ => c) x = 0 := by
217+
rw [fderiv, fderivWithin_const_apply]
219218

220219
@[simp]
221220
theorem fderiv_fun_const (c : F) : fderiv 𝕜 (fun _ : E => c) = 0 := by
@@ -291,8 +290,9 @@ theorem differentiableOn_ofNat (n : ℕ) [OfNat F n] :
291290
@[fun_prop]
292291
theorem hasFDerivWithinAt_singleton (f : E → F) (x : E) :
293292
HasFDerivWithinAt f (0 : E →L[𝕜] F) {x} x := by
294-
simp only [HasFDerivWithinAt, nhdsWithin_singleton, hasFDerivAtFilter_iff_isLittleO,
295-
isLittleO_pure, ContinuousLinearMap.zero_apply, sub_self]
293+
refine .of_not_accPt ?_
294+
rw [accPt_iff_clusterPt, inf_principal]
295+
simp [ClusterPt]
296296

297297
@[fun_prop]
298298
theorem hasFDerivWithinAt_of_subsingleton [h : Subsingleton E] (f : E → F) (s : Set E) (x : E) :
@@ -331,23 +331,18 @@ theorem differentiableWithinAt_of_isInvertible_fderivWithin
331331
contrapose hf
332332
rw [fderivWithin_zero_of_not_differentiableWithinAt hf]
333333
contrapose! hf
334-
rcases isInvertible_zero_iff.1 hf with ⟨hE, hF⟩
334+
rcases ContinuousLinearMap.isInvertible_zero_iff.1 hf with ⟨hE, hF⟩
335335
exact (hasFDerivAt_of_subsingleton _ _).differentiableAt.differentiableWithinAt
336336

337337
theorem differentiableAt_of_isInvertible_fderiv
338338
(hf : (fderiv 𝕜 f x).IsInvertible) : DifferentiableAt 𝕜 f x := by
339339
simp only [← differentiableWithinAt_univ, ← fderivWithin_univ] at hf ⊢
340340
exact differentiableWithinAt_of_isInvertible_fderivWithin hf
341341

342-
343342
/-! ### Support of derivatives -/
344343

345344
section Support
346-
347-
open Function
348-
349-
variable (𝕜 : Type*) {E F : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E]
350-
[NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] {f : E → F} {x : E}
345+
variable (𝕜)
351346

352347
theorem HasStrictFDerivAt.of_notMem_tsupport (h : x ∉ tsupport f) :
353348
HasStrictFDerivAt f (0 : E →L[𝕜] F) x := by
@@ -362,8 +357,9 @@ theorem HasFDerivWithinAt.of_notMem_tsupport {s : Set E} {x : E} (h : x ∉ tsup
362357
HasFDerivWithinAt f (0 : E →L[𝕜] F) s x :=
363358
(HasFDerivAt.of_notMem_tsupport 𝕜 h).hasFDerivWithinAt
364359

365-
theorem fderiv_of_notMem_tsupport (h : x ∉ tsupport f) : fderiv 𝕜 f x = 0 :=
366-
(HasFDerivAt.of_notMem_tsupport 𝕜 h).fderiv
360+
theorem fderiv_of_notMem_tsupport (h : x ∉ tsupport f) : fderiv 𝕜 f x = 0 := by
361+
rw [notMem_tsupport_iff_eventuallyEq] at h
362+
simp [h.fderiv_eq]
367363

368364
theorem support_fderiv_subset : support (fderiv 𝕜 f) ⊆ tsupport f := fun x ↦ by
369365
rw [← not_imp_not, notMem_support]

0 commit comments

Comments
 (0)