@@ -89,19 +89,32 @@ theorem OpenPartialHomeomorph.hasDerivAt_symm (f : OpenPartialHomeomorph 𝕜
8989 HasDerivAt f.symm f'⁻¹ a :=
9090 htff'.of_local_left_inverse (f.symm.continuousAt ha) hf' (f.eventually_right_inverse ha)
9191
92+ theorem HasDerivWithinAt.tendsto_nhdsWithin_nhdsNE (h : HasDerivWithinAt f f' s x) (hf' : f' ≠ 0 ) :
93+ Tendsto f (𝓝[s \ {x}] x) (𝓝[≠] f x) :=
94+ h.hasFDerivWithinAt.tendsto_nhdsWithin_nhdsNE ⟨‖f'‖₊⁻¹, AntilipschitzWith.of_le_mul_dist
95+ fun _ _ ↦ by simp [dist_eq_norm_sub, ← sub_smul, norm_smul]; field_simp; rfl⟩
96+
9297theorem HasDerivWithinAt.eventually_ne (h : HasDerivWithinAt f f' s x) (hf' : f' ≠ 0 ) :
9398 ∀ᶠ z in 𝓝[s \ {x}] x, f z ≠ c :=
94- h.hasFDerivWithinAt.eventually_ne
95- ⟨‖f'‖⁻¹, fun z => by simp [norm_smul]; field_simp; rfl⟩
99+ h.hasFDerivWithinAt.eventually_ne ⟨‖f'‖₊⁻¹, AntilipschitzWith.of_le_mul_dist
100+ fun _ _ ↦ by simp [dist_eq_norm_sub, ← sub_smul, norm_smul]; field_simp; rfl⟩
101+
102+ theorem HasDerivWithinAt.eventually_notMem (h : HasDerivWithinAt f f' s x) (hf' : f' ≠ 0 )
103+ (t : Set F) (ht : ¬ AccPt (f x) (𝓟 t)) : ∀ᶠ z in 𝓝[s \ {x}] x, f z ∉ t :=
104+ h.hasFDerivWithinAt.eventually_notMem ⟨‖f'‖₊⁻¹, AntilipschitzWith.of_le_mul_dist
105+ fun _ _ ↦ by simp [dist_eq_norm_sub, ← sub_smul, norm_smul]; field_simp; rfl⟩ t ht
106+
107+ theorem HasDerivAt.tendsto_nhdsNE (h : HasDerivAt f f' x) (hf' : f' ≠ 0 ) :
108+ Tendsto f (𝓝[≠] x) (𝓝[≠] f x) := by
109+ simpa only [compl_eq_univ_diff] using (hasDerivWithinAt_univ.2 h).tendsto_nhdsWithin_nhdsNE hf'
96110
97111theorem HasDerivAt.eventually_ne (h : HasDerivAt f f' x) (hf' : f' ≠ 0 ) :
98112 ∀ᶠ z in 𝓝[≠] x, f z ≠ c := by
99113 simpa only [compl_eq_univ_diff] using (hasDerivWithinAt_univ.2 h).eventually_ne hf'
100114
101- theorem HasDerivAt.tendsto_nhdsNE (h : HasDerivAt f f' x) (hf' : f' ≠ 0 ) :
102- Tendsto f (𝓝[≠] x) (𝓝[≠] f x) :=
103- tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ h.continuousAt.continuousWithinAt
104- (h.eventually_ne hf')
115+ theorem HasDerivAt.eventually_notMem (h : HasDerivAt f f' x) (hf' : f' ≠ 0 )
116+ (t : Set F) (ht : ¬ AccPt (f x) (𝓟 t)) : ∀ᶠ z in 𝓝[≠] x, f z ∉ t := by
117+ simpa only [compl_eq_univ_diff] using (hasDerivWithinAt_univ.2 h).eventually_notMem hf' t ht
105118
106119/-- If a function is equal to a constant at a set of points that accumulates to `x` in `s`,
107120then its derivative within `s` at `x` equals zero,
@@ -113,13 +126,31 @@ theorem derivWithin_zero_of_frequently_const {c} (h : ∃ᶠ y in 𝓝[s \ {x}]
113126 exact hf.hasDerivWithinAt.eventually_ne h
114127 · exact derivWithin_zero_of_not_differentiableWithinAt hf
115128
129+ /-- If a function frequently (in `𝓝[s ∖ {x}] x`) takes values in a set `t` that does not
130+ accumulate at `f x`, then its derivative within `s` at `x` equals zero,
131+ either because it has derivative zero or because it isn't differentiable at this point. -/
132+ theorem derivWithin_zero_of_frequently_mem (t : Set F) (ht : ¬ AccPt (f x) (𝓟 t))
133+ (h : ∃ᶠ y in 𝓝[s \ {x}] x, f y ∈ t) : derivWithin f s x = 0 := by
134+ by_cases hf : DifferentiableWithinAt 𝕜 f s x
135+ · contrapose! h
136+ exact hf.hasDerivWithinAt.eventually_notMem h t ht
137+ · exact derivWithin_zero_of_not_differentiableWithinAt hf
138+
116139/-- If a function is equal to a constant at a set of points that accumulates to `x`,
117140then its derivative at `x` equals zero,
118141either because it has derivative zero or because it isn't differentiable at this point. -/
119142theorem deriv_zero_of_frequently_const {c} (h : ∃ᶠ y in 𝓝[≠] x, f y = c) : deriv f x = 0 := by
120143 rw [← derivWithin_univ, derivWithin_zero_of_frequently_const]
121144 rwa [← compl_eq_univ_diff]
122145
146+ /-- If a function frequently (in `𝓝[≠] x`) takes values in a set `t` that does not
147+ accumulate at `f x`, then its derivative at `x` equals zero,
148+ either because it has derivative zero or because it isn't differentiable at this point. -/
149+ theorem deriv_zero_of_frequently_mem (t : Set F) (ht : ¬ AccPt (f x) (𝓟 t))
150+ (h : ∃ᶠ y in 𝓝[≠] x, f y ∈ t) : deriv f x = 0 := by
151+ rw [← derivWithin_univ, derivWithin_zero_of_frequently_mem t ht]
152+ rwa [← compl_eq_univ_diff]
153+
123154theorem not_differentiableWithinAt_of_local_left_inverse_hasDerivWithinAt_zero {f g : 𝕜 → 𝕜} {a : 𝕜}
124155 {s t : Set 𝕜} (ha : a ∈ s) (hsu : UniqueDiffWithinAt 𝕜 s a) (hf : HasDerivWithinAt f 0 t (g a))
125156 (hst : MapsTo g s t) (hfg : f ∘ g =ᶠ[𝓝[s] a] id) : ¬DifferentiableWithinAt 𝕜 g s a := by
0 commit comments