Skip to content

Commit a7411a8

Browse files
committed
refactor(TangentCone): use AccPt (#24227)
- weaken assumptions in `zero_mem_tangentCone` from `(𝓝[s \ {x}] x).NeBot` to `x ∈ closure s`; - change assumptions here and there from `(𝓝[s \ {x}] x).NeBot` to `AccPt x (π“Ÿ s)`; - prove `uniqueDiffWithinAt_iff_accPt`.
1 parent cb0f568 commit a7411a8

File tree

14 files changed

+182
-162
lines changed

14 files changed

+182
-162
lines changed

β€ŽMathlib/Analysis/Calculus/Deriv/Add.leanβ€Ž

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ nonrec theorem HasDerivAt.add (hf : HasDerivAt f f' x) (hg : HasDerivAt g g' x)
5555
theorem derivWithin_add (hf : DifferentiableWithinAt π•œ f s x)
5656
(hg : DifferentiableWithinAt π•œ g s x) :
5757
derivWithin (fun y => f y + g y) s x = derivWithin f s x + derivWithin g s x := by
58-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
59-
Β· exact (hf.hasDerivWithinAt.add hg.hasDerivWithinAt).derivWithin hxs
60-
Β· simp [derivWithin_zero_of_isolated hxs]
58+
by_cases hsx : UniqueDiffWithinAt π•œ s x
59+
Β· exact (hf.hasDerivWithinAt.add hg.hasDerivWithinAt).derivWithin hsx
60+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
6161

6262
@[simp]
6363
theorem deriv_add (hf : DifferentiableAt π•œ f x) (hg : DifferentiableAt π•œ g x) :
@@ -191,9 +191,9 @@ theorem HasDerivAt.sum (h : βˆ€ i ∈ u, HasDerivAt (A i) (A' i) x) :
191191

192192
theorem derivWithin_sum (h : βˆ€ i ∈ u, DifferentiableWithinAt π•œ (A i) s x) :
193193
derivWithin (fun y => βˆ‘ i ∈ u, A i y) s x = βˆ‘ i ∈ u, derivWithin (A i) s x := by
194-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
195-
Β· exact (HasDerivWithinAt.sum fun i hi => (h i hi).hasDerivWithinAt).derivWithin hxs
196-
Β· simp [derivWithin_zero_of_isolated hxs]
194+
by_cases hsx : UniqueDiffWithinAt π•œ s x
195+
Β· exact (HasDerivWithinAt.sum fun i hi => (h i hi).hasDerivWithinAt).derivWithin hsx
196+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
197197

198198
@[simp]
199199
theorem deriv_sum (h : βˆ€ i ∈ u, DifferentiableAt π•œ (A i) x) :
@@ -220,9 +220,9 @@ nonrec theorem HasStrictDerivAt.neg (h : HasStrictDerivAt f f' x) :
220220
HasStrictDerivAt (fun x => -f x) (-f') x := by simpa using h.neg.hasStrictDerivAt
221221

222222
theorem derivWithin.neg : derivWithin (fun y => -f y) s x = -derivWithin f s x := by
223-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
224-
Β· simp only [derivWithin, fderivWithin_neg hxs, ContinuousLinearMap.neg_apply]
225-
Β· simp [derivWithin_zero_of_isolated hxs]
223+
by_cases hsx : UniqueDiffWithinAt π•œ s x
224+
Β· simp only [derivWithin, fderivWithin_neg hsx, ContinuousLinearMap.neg_apply]
225+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
226226

227227
theorem deriv.neg : deriv (fun y => -f y) x = -deriv f x := by
228228
simp only [deriv, fderiv_neg, ContinuousLinearMap.neg_apply]
@@ -310,9 +310,7 @@ theorem HasStrictDerivAt.sub (hf : HasStrictDerivAt f f' x) (hg : HasStrictDeriv
310310
theorem derivWithin_sub (hf : DifferentiableWithinAt π•œ f s x)
311311
(hg : DifferentiableWithinAt π•œ g s x) :
312312
derivWithin (fun y => f y - g y) s x = derivWithin f s x - derivWithin g s x := by
313-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
314-
Β· exact (hf.hasDerivWithinAt.sub hg.hasDerivWithinAt).derivWithin hxs
315-
Β· simp [derivWithin_zero_of_isolated hxs]
313+
simp only [sub_eq_add_neg, derivWithin_add hf hg.neg, derivWithin.neg]
316314

317315
@[simp]
318316
theorem deriv_sub (hf : DifferentiableAt π•œ f x) (hg : DifferentiableAt π•œ g x) :
@@ -374,9 +372,7 @@ nonrec theorem HasDerivAt.const_sub (c : F) (hf : HasDerivAt f f' x) :
374372

375373
theorem derivWithin_const_sub (c : F) :
376374
derivWithin (fun y => c - f y) s x = -derivWithin f s x := by
377-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
378-
Β· simp [derivWithin, fderivWithin_const_sub hxs]
379-
Β· simp [derivWithin_zero_of_isolated hxs]
375+
simp [sub_eq_add_neg, derivWithin.neg]
380376

381377
theorem deriv_const_sub (c : F) : deriv (fun y => c - f y) x = -deriv f x := by
382378
simp only [← derivWithin_univ, derivWithin_const_sub]

β€ŽMathlib/Analysis/Calculus/Deriv/Basic.leanβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,15 @@ variable {x : π•œ}
230230
variable {s t : Set π•œ}
231231
variable {L L₁ Lβ‚‚ : Filter π•œ}
232232

233+
theorem derivWithin_zero_of_not_accPt (h : Β¬AccPt x (π“Ÿ s)) : derivWithin f s x = 0 := by
234+
rw [derivWithin, fderivWithin_zero_of_not_accPt h, ContinuousLinearMap.zero_apply]
235+
236+
theorem derivWithin_zero_of_not_uniqueDiffWithinAt (h : Β¬UniqueDiffWithinAt π•œ s x) :
237+
derivWithin f s x = 0 :=
238+
derivWithin_zero_of_not_accPt <| mt AccPt.uniqueDiffWithinAt h
239+
240+
set_option linter.deprecated false in
241+
@[deprecated derivWithin_zero_of_not_accPt (since := "2025-04-20")]
233242
theorem derivWithin_zero_of_isolated (h : 𝓝[s \ {x}] x = βŠ₯) : derivWithin f s x = 0 := by
234243
rw [derivWithin, fderivWithin_zero_of_isolated h, ContinuousLinearMap.zero_apply]
235244

β€ŽMathlib/Analysis/Calculus/Deriv/Comp.leanβ€Ž

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ theorem HasDerivAt.scomp_hasDerivWithinAt_of_eq (hg : HasDerivAt g₁ g₁' y)
129129
theorem derivWithin.scomp (hg : DifferentiableWithinAt π•œ' g₁ t' (h x))
130130
(hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s t') :
131131
derivWithin (g₁ ∘ h) s x = derivWithin h s x β€’ derivWithin g₁ t' (h x) := by
132-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
133-
Β· exact (HasDerivWithinAt.scomp x hg.hasDerivWithinAt hh.hasDerivWithinAt hs).derivWithin hxs
134-
Β· simp [derivWithin_zero_of_isolated hxs]
132+
by_cases hsx : UniqueDiffWithinAt π•œ s x
133+
Β· exact (HasDerivWithinAt.scomp x hg.hasDerivWithinAt hh.hasDerivWithinAt hs).derivWithin hsx
134+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
135135

136136
theorem derivWithin.scomp_of_eq (hg : DifferentiableWithinAt π•œ' g₁ t' y)
137137
(hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s t')
@@ -269,9 +269,9 @@ theorem HasDerivAt.comp_hasDerivWithinAt_of_eq (hhβ‚‚ : HasDerivAt hβ‚‚ hβ‚‚' y)
269269
theorem derivWithin_comp (hhβ‚‚ : DifferentiableWithinAt π•œ' hβ‚‚ s' (h x))
270270
(hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s s') :
271271
derivWithin (hβ‚‚ ∘ h) s x = derivWithin hβ‚‚ s' (h x) * derivWithin h s x := by
272-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
273-
Β· exact (hhβ‚‚.hasDerivWithinAt.comp x hh.hasDerivWithinAt hs).derivWithin hxs
274-
Β· simp [derivWithin_zero_of_isolated hxs]
272+
by_cases hsx : UniqueDiffWithinAt π•œ s x
273+
Β· exact (hhβ‚‚.hasDerivWithinAt.comp x hh.hasDerivWithinAt hs).derivWithin hsx
274+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
275275

276276
@[deprecated (since := "2024-10-31")] alias derivWithin.comp := derivWithin_comp
277277

@@ -379,9 +379,9 @@ theorem HasStrictFDerivAt.comp_hasStrictDerivAt_of_eq (hl : HasStrictFDerivAt l
379379
theorem fderivWithin_comp_derivWithin {t : Set F} (hl : DifferentiableWithinAt π•œ l t (f x))
380380
(hf : DifferentiableWithinAt π•œ f s x) (hs : MapsTo f s t) :
381381
derivWithin (l ∘ f) s x = (fderivWithin π•œ l t (f x) : F β†’ E) (derivWithin f s x) := by
382-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
383-
Β· exact (hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf.hasDerivWithinAt hs).derivWithin hxs
384-
Β· simp [derivWithin_zero_of_isolated hxs]
382+
by_cases hsx : UniqueDiffWithinAt π•œ s x
383+
Β· exact (hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf.hasDerivWithinAt hs).derivWithin hsx
384+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
385385

386386
@[deprecated (since := "2024-10-31")]
387387
alias fderivWithin.comp_derivWithin := fderivWithin_comp_derivWithin

β€ŽMathlib/Analysis/Calculus/Deriv/Inv.leanβ€Ž

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ theorem HasDerivAt.inv (hc : HasDerivAt c c' x) (hx : c x β‰  0) :
108108

109109
theorem derivWithin_inv' (hc : DifferentiableWithinAt π•œ c s x) (hx : c x β‰  0) :
110110
derivWithin (fun x => (c x)⁻¹) s x = -derivWithin c s x / c x ^ 2 := by
111-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
112-
Β· exact (hc.hasDerivWithinAt.inv hx).derivWithin hxs
113-
Β· simp [derivWithin_zero_of_isolated hxs]
111+
by_cases hsx : UniqueDiffWithinAt π•œ s x
112+
Β· exact (hc.hasDerivWithinAt.inv hx).derivWithin hsx
113+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
114114

115115
@[simp]
116116
theorem deriv_inv'' (hc : DifferentiableAt π•œ c x) (hx : c x β‰  0) :
@@ -167,9 +167,9 @@ theorem derivWithin_div (hc : DifferentiableWithinAt π•œ c s x) (hd : Different
167167
(hx : d x β‰  0) :
168168
derivWithin (fun x => c x / d x) s x =
169169
(derivWithin c s x * d x - c x * derivWithin d s x) / d x ^ 2 := by
170-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
171-
Β· exact (hc.hasDerivWithinAt.div hd.hasDerivWithinAt hx).derivWithin hxs
172-
Β· simp [derivWithin_zero_of_isolated hxs]
170+
by_cases hsx : UniqueDiffWithinAt π•œ s x
171+
Β· exact (hc.hasDerivWithinAt.div hd.hasDerivWithinAt hx).derivWithin hsx
172+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
173173

174174
@[simp]
175175
theorem deriv_div (hc : DifferentiableAt π•œ c x) (hd : DifferentiableAt π•œ d x) (hx : d x β‰  0) :

β€ŽMathlib/Analysis/Calculus/Deriv/Mul.leanβ€Ž

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ theorem derivWithin_of_bilinear
6565
(hu : DifferentiableWithinAt π•œ u s x) (hv : DifferentiableWithinAt π•œ v s x) :
6666
derivWithin (fun y => B (u y) (v y)) s x =
6767
B (u x) (derivWithin v s x) + B (derivWithin u s x) (v x) := by
68-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
69-
Β· exact (B.hasDerivWithinAt_of_bilinear hu.hasDerivWithinAt hv.hasDerivWithinAt).derivWithin hxs
70-
Β· simp [derivWithin_zero_of_isolated hxs]
68+
by_cases hsx : UniqueDiffWithinAt π•œ s x
69+
Β· exact (B.hasDerivWithinAt_of_bilinear hu.hasDerivWithinAt hv.hasDerivWithinAt).derivWithin hsx
70+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
7171

7272
theorem deriv_of_bilinear (hu : DifferentiableAt π•œ u x) (hv : DifferentiableAt π•œ v x) :
7373
deriv (fun y => B (u y) (v y)) x = B (u x) (deriv v x) + B (deriv u x) (v x) :=
@@ -99,9 +99,9 @@ nonrec theorem HasStrictDerivAt.smul (hc : HasStrictDerivAt c c' x) (hf : HasStr
9999
theorem derivWithin_smul (hc : DifferentiableWithinAt π•œ c s x)
100100
(hf : DifferentiableWithinAt π•œ f s x) :
101101
derivWithin (fun y => c y β€’ f y) s x = c x β€’ derivWithin f s x + derivWithin c s x β€’ f x := by
102-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
103-
Β· exact (hc.hasDerivWithinAt.smul hf.hasDerivWithinAt).derivWithin hxs
104-
Β· simp [derivWithin_zero_of_isolated hxs]
102+
by_cases hsx : UniqueDiffWithinAt π•œ s x
103+
Β· exact (hc.hasDerivWithinAt.smul hf.hasDerivWithinAt).derivWithin hsx
104+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
105105

106106
theorem deriv_smul (hc : DifferentiableAt π•œ c x) (hf : DifferentiableAt π•œ f x) :
107107
deriv (fun y => c y β€’ f y) x = c x β€’ deriv f x + deriv c x β€’ f x :=
@@ -124,9 +124,9 @@ theorem HasDerivAt.smul_const (hc : HasDerivAt c c' x) (f : F) :
124124

125125
theorem derivWithin_smul_const (hc : DifferentiableWithinAt π•œ c s x) (f : F) :
126126
derivWithin (fun y => c y β€’ f) s x = derivWithin c s x β€’ f := by
127-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
128-
Β· exact (hc.hasDerivWithinAt.smul_const f).derivWithin hxs
129-
Β· simp [derivWithin_zero_of_isolated hxs]
127+
by_cases hsx : UniqueDiffWithinAt π•œ s x
128+
Β· exact (hc.hasDerivWithinAt.smul_const f).derivWithin hsx
129+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
130130

131131
theorem deriv_smul_const (hc : DifferentiableAt π•œ c x) (f : F) :
132132
deriv (fun y => c y β€’ f) x = deriv c x β€’ f :=
@@ -156,9 +156,9 @@ nonrec theorem HasDerivAt.const_smul (c : R) (hf : HasDerivAt f f' x) :
156156

157157
theorem derivWithin_const_smul (c : R) (hf : DifferentiableWithinAt π•œ f s x) :
158158
derivWithin (fun y => c β€’ f y) s x = c β€’ derivWithin f s x := by
159-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
160-
Β· exact (hf.hasDerivWithinAt.const_smul c).derivWithin hxs
161-
Β· simp [derivWithin_zero_of_isolated hxs]
159+
by_cases hsx : UniqueDiffWithinAt π•œ s x
160+
Β· exact (hf.hasDerivWithinAt.const_smul c).derivWithin hsx
161+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
162162

163163
theorem deriv_const_smul (c : R) (hf : DifferentiableAt π•œ f x) :
164164
deriv (fun y => c β€’ f y) x = c β€’ deriv f x :=
@@ -213,9 +213,9 @@ theorem HasStrictDerivAt.mul (hc : HasStrictDerivAt c c' x) (hd : HasStrictDeriv
213213
theorem derivWithin_mul (hc : DifferentiableWithinAt π•œ c s x)
214214
(hd : DifferentiableWithinAt π•œ d s x) :
215215
derivWithin (fun y => c y * d y) s x = derivWithin c s x * d x + c x * derivWithin d s x := by
216-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
217-
Β· exact (hc.hasDerivWithinAt.mul hd.hasDerivWithinAt).derivWithin hxs
218-
Β· simp [derivWithin_zero_of_isolated hxs]
216+
by_cases hsx : UniqueDiffWithinAt π•œ s x
217+
Β· exact (hc.hasDerivWithinAt.mul hd.hasDerivWithinAt).derivWithin hsx
218+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
219219

220220
@[simp]
221221
theorem deriv_mul (hc : DifferentiableAt π•œ c x) (hd : DifferentiableAt π•œ d x) :
@@ -242,9 +242,9 @@ theorem HasStrictDerivAt.mul_const (hc : HasStrictDerivAt c c' x) (d : 𝔸) :
242242

243243
theorem derivWithin_mul_const (hc : DifferentiableWithinAt π•œ c s x) (d : 𝔸) :
244244
derivWithin (fun y => c y * d) s x = derivWithin c s x * d := by
245-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
246-
Β· exact (hc.hasDerivWithinAt.mul_const d).derivWithin hxs
247-
Β· simp [derivWithin_zero_of_isolated hxs]
245+
by_cases hsx : UniqueDiffWithinAt π•œ s x
246+
Β· exact (hc.hasDerivWithinAt.mul_const d).derivWithin hsx
247+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
248248

249249
lemma derivWithin_mul_const_field (u : π•œ') :
250250
derivWithin (fun y => v y * u) s x = derivWithin v s x * u := by
@@ -291,9 +291,9 @@ theorem HasStrictDerivAt.const_mul (c : 𝔸) (hd : HasStrictDerivAt d d' x) :
291291

292292
theorem derivWithin_const_mul (c : 𝔸) (hd : DifferentiableWithinAt π•œ d s x) :
293293
derivWithin (fun y => c * d y) s x = c * derivWithin d s x := by
294-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
295-
Β· exact (hd.hasDerivWithinAt.const_mul c).derivWithin hxs
296-
Β· simp [derivWithin_zero_of_isolated hxs]
294+
by_cases hsx : UniqueDiffWithinAt π•œ s x
295+
Β· exact (hd.hasDerivWithinAt.const_mul c).derivWithin hsx
296+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
297297

298298
lemma derivWithin_const_mul_field (u : π•œ') :
299299
derivWithin (fun y => u * v y) s x = u * derivWithin v s x := by
@@ -343,9 +343,9 @@ theorem derivWithin_finset_prod
343343
(hf : βˆ€ i ∈ u, DifferentiableWithinAt π•œ (f i) s x) :
344344
derivWithin (∏ i ∈ u, f i ·) s x =
345345
βˆ‘ i ∈ u, (∏ j ∈ u.erase i, f j x) β€’ derivWithin (f i) s x := by
346-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
347-
Β· exact (HasDerivWithinAt.finset_prod fun i hi ↦ (hf i hi).hasDerivWithinAt).derivWithin hxs
348-
Β· simp [derivWithin_zero_of_isolated hxs]
346+
by_cases hsx : UniqueDiffWithinAt π•œ s x
347+
Β· exact (HasDerivWithinAt.finset_prod fun i hi ↦ (hf i hi).hasDerivWithinAt).derivWithin hsx
348+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
349349

350350
end HasDeriv
351351

@@ -454,9 +454,9 @@ theorem derivWithin_clm_comp (hc : DifferentiableWithinAt π•œ c s x)
454454
(hd : DifferentiableWithinAt π•œ d s x) :
455455
derivWithin (fun y => (c y).comp (d y)) s x =
456456
(derivWithin c s x).comp (d x) + (c x).comp (derivWithin d s x) := by
457-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
458-
Β· exact (hc.hasDerivWithinAt.clm_comp hd.hasDerivWithinAt).derivWithin hxs
459-
Β· simp [derivWithin_zero_of_isolated hxs]
457+
by_cases hsx : UniqueDiffWithinAt π•œ s x
458+
Β· exact (hc.hasDerivWithinAt.clm_comp hd.hasDerivWithinAt).derivWithin hsx
459+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
460460

461461
theorem deriv_clm_comp (hc : DifferentiableAt π•œ c x) (hd : DifferentiableAt π•œ d x) :
462462
deriv (fun y => (c y).comp (d y)) x = (deriv c x).comp (d x) + (c x).comp (deriv d x) :=
@@ -484,9 +484,9 @@ theorem HasDerivAt.clm_apply (hc : HasDerivAt c c' x) (hu : HasDerivAt u u' x) :
484484
theorem derivWithin_clm_apply (hc : DifferentiableWithinAt π•œ c s x)
485485
(hu : DifferentiableWithinAt π•œ u s x) :
486486
derivWithin (fun y => (c y) (u y)) s x = derivWithin c s x (u x) + c x (derivWithin u s x) := by
487-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
488-
Β· exact (hc.hasDerivWithinAt.clm_apply hu.hasDerivWithinAt).derivWithin hxs
489-
Β· simp [derivWithin_zero_of_isolated hxs]
487+
by_cases hsx : UniqueDiffWithinAt π•œ s x
488+
Β· exact (hc.hasDerivWithinAt.clm_apply hu.hasDerivWithinAt).derivWithin hsx
489+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
490490

491491
theorem deriv_clm_apply (hc : DifferentiableAt π•œ c x) (hu : DifferentiableAt π•œ u x) :
492492
deriv (fun y => (c y) (u y)) x = deriv c x (u x) + c x (deriv u x) :=

β€ŽMathlib/Analysis/Calculus/Deriv/Pow.leanβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ theorem HasDerivAt.pow (hc : HasDerivAt c c' x) :
7878

7979
theorem derivWithin_pow' (hc : DifferentiableWithinAt π•œ c s x) :
8080
derivWithin (fun x => c x ^ n) s x = (n : π•œ) * c x ^ (n - 1) * derivWithin c s x := by
81-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
82-
Β· exact (hc.hasDerivWithinAt.pow n).derivWithin hxs
83-
Β· simp [derivWithin_zero_of_isolated hxs]
81+
by_cases hsx : UniqueDiffWithinAt π•œ s x
82+
Β· exact (hc.hasDerivWithinAt.pow n).derivWithin hsx
83+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
8484

8585
@[simp]
8686
theorem deriv_pow'' (hc : DifferentiableAt π•œ c x) :

β€ŽMathlib/Analysis/Calculus/Deriv/Prod.leanβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ theorem hasDerivWithinAt_pi :
9292

9393
theorem derivWithin_pi (h : βˆ€ i, DifferentiableWithinAt π•œ (fun x => Ο† x i) s x) :
9494
derivWithin Ο† s x = fun i => derivWithin (fun x => Ο† x i) s x := by
95-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
96-
Β· exact (hasDerivWithinAt_pi.2 fun i => (h i).hasDerivWithinAt).derivWithin hxs
97-
Β· simp only [derivWithin_zero_of_isolated hxs, Pi.zero_def]
95+
by_cases hsx : UniqueDiffWithinAt π•œ s x
96+
Β· exact (hasDerivWithinAt_pi.2 fun i => (h i).hasDerivWithinAt).derivWithin hsx
97+
Β· simp only [derivWithin_zero_of_not_uniqueDiffWithinAt hsx, Pi.zero_def]
9898

9999
theorem deriv_pi (h : βˆ€ i, DifferentiableAt π•œ (fun x => Ο† x i) x) :
100100
deriv Ο† x = fun i => deriv (fun x => Ο† x i) x :=

β€ŽMathlib/Analysis/Calculus/Deriv/Slope.leanβ€Ž

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,14 @@ theorem range_derivWithin_subset_closure_span_image
9191
(f : π•œ β†’ F) {s t : Set π•œ} (h : s βŠ† closure (s ∩ t)) :
9292
range (derivWithin f s) βŠ† closure (Submodule.span π•œ (f '' t)) := by
9393
rintro - ⟨x, rfl⟩
94-
rcases eq_or_neBot (𝓝[s \ {x}] x) with H|H
95-
Β· simpa [derivWithin_zero_of_isolated H] using subset_closure (zero_mem _)
94+
by_cases H : UniqueDiffWithinAt π•œ s x; swap
95+
Β· simpa [derivWithin_zero_of_not_uniqueDiffWithinAt H] using subset_closure (zero_mem _)
9696
by_cases H' : DifferentiableWithinAt π•œ f s x; swap
9797
Β· rw [derivWithin_zero_of_not_differentiableWithinAt H']
9898
exact subset_closure (zero_mem _)
9999
have I : (𝓝[(s ∩ t) \ {x}] x).NeBot := by
100-
rw [← mem_closure_iff_nhdsWithin_neBot] at H ⊒
101-
have A : closure (s \ {x}) βŠ† closure (closure (s ∩ t) \ {x}) :=
102-
closure_mono (diff_subset_diff_left h)
103-
have B : closure (s ∩ t) \ {x} βŠ† closure ((s ∩ t) \ {x}) := by
104-
convert closure_diff; exact closure_singleton.symm
105-
simpa using A.trans (closure_mono B) H
100+
rw [← accPt_principal_iff_nhdsWithin, ← uniqueDiffWithinAt_iff_accPt]
101+
exact H.mono_closure h
106102
have : Tendsto (slope f x) (𝓝[(s ∩ t) \ {x}] x) (𝓝 (derivWithin f s x)) := by
107103
apply Tendsto.mono_left (hasDerivWithinAt_iff_tendsto_slope.1 H'.hasDerivWithinAt)
108104
rw [inter_comm, inter_diff_assoc]

β€ŽMathlib/Analysis/Calculus/Deriv/Star.leanβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ protected nonrec theorem HasStrictDerivAt.star (h : HasStrictDerivAt f f' x) :
4343

4444
protected theorem derivWithin.star :
4545
derivWithin (fun y => star (f y)) s x = star (derivWithin f s x) := by
46-
rcases uniqueDiffWithinAt_or_nhdsWithin_eq_bot s x with hxs | hxs
46+
by_cases hxs : UniqueDiffWithinAt π•œ s x
4747
Β· exact DFunLike.congr_fun (fderivWithin_star hxs) _
48-
Β· simp [derivWithin_zero_of_isolated hxs]
48+
Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hxs]
4949

5050
protected theorem deriv.star : deriv (fun y => star (f y)) x = star (deriv f x) :=
5151
DFunLike.congr_fun fderiv_star _

0 commit comments

Comments
Β (0)