Skip to content

Commit 58f4dfc

Browse files
committed
feat: differentiable_of_subsingleton (leanprover-community#34831)
and move a lemma to a better location. From the path towards immersions, submanifolds and the regular value theorem.
1 parent adc580b commit 58f4dfc

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

Mathlib/Analysis/Calculus/FDeriv/Basic.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ protected theorem HasFDerivWithinAt.empty : HasFDerivWithinAt f f' ∅ x := by
270270
protected theorem DifferentiableWithinAt.empty : DifferentiableWithinAt 𝕜 f ∅ x :=
271271
0, .empty⟩
272272

273+
@[fun_prop]
274+
theorem differentiableOn_empty : DifferentiableOn 𝕜 f ∅ := fun _ => False.elim
275+
273276
theorem HasFDerivWithinAt.of_finite [T1Space E] (h : s.Finite) : HasFDerivWithinAt f f' s x := by
274277
induction s, h using Set.Finite.induction_on with
275278
| empty => exact .empty

Mathlib/Analysis/Calculus/FDeriv/Const.lean

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,23 @@ theorem hasFDerivWithinAt_singleton (f : E → F) (x : E) :
294294
simp only [HasFDerivWithinAt, nhdsWithin_singleton, hasFDerivAtFilter_iff_isLittleO,
295295
isLittleO_pure, ContinuousLinearMap.zero_apply, sub_self]
296296

297+
@[fun_prop]
298+
theorem hasFDerivWithinAt_of_subsingleton [h : Subsingleton E] (f : E → F) (s : Set E) (x : E) :
299+
HasFDerivWithinAt f (0 : E →L[𝕜] F) s x := by
300+
by_cases hs : s = ∅
301+
· simp [hs]
302+
· obtain ⟨a, rfl⟩ := exists_eq_singleton_iff_nonempty_subsingleton (s := s)|>.mpr
303+
by rwa [nonempty_iff_ne_empty], subsingleton_of_subsingleton⟩
304+
exact HasFDerivWithinAt.singleton
305+
297306
@[fun_prop]
298307
theorem hasFDerivAt_of_subsingleton [h : Subsingleton E] (f : E → F) (x : E) :
299308
HasFDerivAt f (0 : E →L[𝕜] F) x := by
300309
rw [← hasFDerivWithinAt_univ, subsingleton_univ.eq_singleton_of_mem (mem_univ x)]
301310
exact hasFDerivWithinAt_singleton f x
302311

303-
@[fun_prop]
304-
theorem differentiableOn_empty : DifferentiableOn 𝕜 f ∅ := fun _ => False.elim
312+
theorem differentiable_of_subsingleton [Subsingleton E] {f : E → F} : Differentiable 𝕜 f :=
313+
fun x ↦ (hasFDerivAt_of_subsingleton f x (𝕜 := 𝕜)).differentiableAt
305314

306315
@[fun_prop]
307316
theorem differentiableOn_singleton : DifferentiableOn 𝕜 f {x} :=

0 commit comments

Comments
 (0)