Skip to content

Commit 8b62eaa

Browse files
committed
feat: add (m)differentiableAt_of_(m)fderiv_injective (#35284)
and versions for `(m)fderivWithin` versions. This generalises the existing lemmas `(m)differentiableAt_of_isInvertible_(m)fderiv` and friends. Extracted from #35078; from the path to immersions, embeddings and submanifolds.
1 parent 46279b6 commit 8b62eaa

File tree

3 files changed

+61
-22
lines changed

3 files changed

+61
-22
lines changed

Mathlib/Analysis/Calculus/FDeriv/Const.lean

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -294,22 +294,28 @@ theorem hasFDerivWithinAt_singleton (f : E → F) (x : E) :
294294
rw [accPt_iff_clusterPt, inf_principal]
295295
simp [ClusterPt]
296296

297-
@[fun_prop]
297+
@[fun_prop, nontriviality]
298298
theorem hasFDerivWithinAt_of_subsingleton [h : Subsingleton E] (f : E → F) (s : Set E) (x : E) :
299299
HasFDerivWithinAt f (0 : E →L[𝕜] F) s x := by
300300
obtain rfl | ⟨a, rfl⟩ := s.eq_empty_or_singleton_of_subsingleton
301301
· simp
302302
· exact HasFDerivWithinAt.singleton
303303

304-
@[fun_prop]
304+
@[fun_prop, nontriviality]
305305
theorem hasFDerivAt_of_subsingleton [h : Subsingleton E] (f : E → F) (x : E) :
306306
HasFDerivAt f (0 : E →L[𝕜] F) x := by
307307
rw [← hasFDerivWithinAt_univ, subsingleton_univ.eq_singleton_of_mem (mem_univ x)]
308308
exact hasFDerivWithinAt_singleton f x
309309

310+
@[nontriviality]
310311
theorem differentiable_of_subsingleton [Subsingleton E] {f : E → F} : Differentiable 𝕜 f :=
311312
fun x ↦ (hasFDerivAt_of_subsingleton f x (𝕜 := 𝕜)).differentiableAt
312313

314+
@[nontriviality]
315+
theorem differentiableWithinAt_of_subsingleton [Subsingleton E] :
316+
DifferentiableWithinAt 𝕜 f s x :=
317+
(differentiable_of_subsingleton x).differentiableWithinAt
318+
313319
@[fun_prop]
314320
theorem differentiableOn_singleton : DifferentiableOn 𝕜 f {x} :=
315321
forall_eq.2 (hasFDerivWithinAt_singleton f x).differentiableWithinAt
@@ -324,18 +330,28 @@ theorem hasFDerivAt_zero_of_eventually_const (c : F) (hf : f =ᶠ[𝓝 x] fun _
324330

325331
end Const
326332

327-
theorem differentiableWithinAt_of_isInvertible_fderivWithin
328-
(hf : (fderivWithin 𝕜 f s x).IsInvertible) : DifferentiableWithinAt 𝕜 f s x := by
329-
contrapose hf
330-
rw [fderivWithin_zero_of_not_differentiableWithinAt hf]
333+
/-- If `f : E → F` has injective differential within `s` at `x`,
334+
it is differentiable within `s` at `x`. -/
335+
lemma differentiableWithinAt_of_fderivWithin_injective (hf : Injective (fderivWithin 𝕜 f s x)) :
336+
DifferentiableWithinAt 𝕜 f s x := by
337+
nontriviality E
331338
contrapose! hf
332-
rcases ContinuousLinearMap.isInvertible_zero_iff.1 hf with ⟨hE, hF⟩
333-
exact (hasFDerivAt_of_subsingleton _ _).differentiableAt.differentiableWithinAt
339+
rw [fderivWithin_zero_of_not_differentiableWithinAt hf]
340+
exact not_injective_const
334341

335-
theorem differentiableAt_of_isInvertible_fderiv
336-
(hf : (fderiv 𝕜 f x).IsInvertible) : DifferentiableAt 𝕜 f x := by
342+
/-- If `f : E → F` has injective differential at `x`, it is differentiable at `x`. -/
343+
lemma differentiableAt_of_fderiv_injective (hf : Injective (fderiv 𝕜 f x)) :
344+
DifferentiableAt 𝕜 f x := by
337345
simp only [← differentiableWithinAt_univ, ← fderivWithin_univ] at hf ⊢
338-
exact differentiableWithinAt_of_isInvertible_fderivWithin hf
346+
exact differentiableWithinAt_of_fderivWithin_injective hf
347+
348+
theorem differentiableWithinAt_of_isInvertible_fderivWithin
349+
(hf : (fderivWithin 𝕜 f s x).IsInvertible) : DifferentiableWithinAt 𝕜 f s x :=
350+
differentiableWithinAt_of_fderivWithin_injective hf.injective
351+
352+
theorem differentiableAt_of_isInvertible_fderiv
353+
(hf : (fderiv 𝕜 f x).IsInvertible) : DifferentiableAt 𝕜 f x :=
354+
differentiableAt_of_fderiv_injective hf.injective
339355

340356
/-! ### Support of derivatives -/
341357

Mathlib/Geometry/Manifold/MFDeriv/Basic.lean

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ noncomputable section
3030
assert_not_exists tangentBundleCore
3131

3232
open scoped Topology Manifold
33-
open Set Bundle ChartedSpace
33+
open Function Set Bundle ChartedSpace
3434

3535
section DerivativesProperties
3636

@@ -543,26 +543,43 @@ theorem mfderivWithin_zero_of_not_mdifferentiableWithinAt
543543
theorem mfderiv_zero_of_not_mdifferentiableAt (h : ¬MDifferentiableAt I I' f x) :
544544
mfderiv I I' f x = 0 := by simp only [mfderiv, h, if_neg, not_false_iff]
545545

546+
@[nontriviality]
546547
theorem mdifferentiable_of_subsingleton [Subsingleton E] : MDifferentiable I I' f := by
547548
intro x
548549
have : Subsingleton H := I.injective.subsingleton
549550
have : DiscreteTopology M := discreteTopology H M
550551
simp only [mdifferentiableAt_iff, continuous_of_discreteTopology.continuousAt, true_and]
551552
exact (hasFDerivAt_of_subsingleton _ _).differentiableAt.differentiableWithinAt
552553

553-
theorem mdifferentiableWithinAt_of_isInvertible_mfderivWithin
554-
(hf : (mfderivWithin I I' f s x).IsInvertible) : MDifferentiableWithinAt I I' f s x := by
555-
contrapose hf
556-
rw [mfderivWithin_zero_of_not_mdifferentiableWithinAt hf]
554+
@[nontriviality]
555+
theorem mdifferentiableWithinAt_of_subsingleton [Subsingleton E] :
556+
MDifferentiableWithinAt I I' f s x :=
557+
(mdifferentiable_of_subsingleton x).mdifferentiableWithinAt
558+
559+
/-- If `f : M → M'` has injective differential at `x` within `s`,
560+
it is `MDifferentiable` at `x` within `s`. -/
561+
lemma mdifferentiableWithinAt_of_mfderivWithin_injective
562+
(hf : Injective (mfderivWithin I I' f s x)) :
563+
MDifferentiableWithinAt I I' f s x := by
564+
nontriviality E
565+
have : Nontrivial (TangentSpace I x) := inferInstanceAs (Nontrivial E)
557566
contrapose! hf
558-
rcases ContinuousLinearMap.isInvertible_zero_iff.1 hf with ⟨hE, hF⟩
559-
have : Subsingleton E := hE
560-
exact mdifferentiable_of_subsingleton.mdifferentiableAt.mdifferentiableWithinAt
567+
rw [mfderivWithin_zero_of_not_mdifferentiableWithinAt hf]
568+
exact not_injective_const
561569

562-
theorem mdifferentiableAt_of_isInvertible_mfderiv
563-
(hf : (mfderiv I I' f x).IsInvertible) : MDifferentiableAt I I' f x := by
570+
/-- If `f : M → M'` has injective differential at `x`, it is `MDifferentiable` at `x`. -/
571+
lemma mdifferentiableAt_of_mfderiv_injective {f : M → M'} (hf : Injective (mfderiv I I' f x)) :
572+
MDifferentiableAt I I' f x := by
564573
simp only [← mdifferentiableWithinAt_univ, ← mfderivWithin_univ] at hf ⊢
565-
exact mdifferentiableWithinAt_of_isInvertible_mfderivWithin hf
574+
exact mdifferentiableWithinAt_of_mfderivWithin_injective hf
575+
576+
theorem mdifferentiableWithinAt_of_isInvertible_mfderivWithin
577+
(hf : (mfderivWithin I I' f s x).IsInvertible) : MDifferentiableWithinAt I I' f s x :=
578+
mdifferentiableWithinAt_of_mfderivWithin_injective hf.injective
579+
580+
theorem mdifferentiableAt_of_isInvertible_mfderiv
581+
(hf : (mfderiv I I' f x).IsInvertible) : MDifferentiableAt I I' f x :=
582+
mdifferentiableAt_of_mfderiv_injective hf.injective
566583

567584
theorem HasMFDerivWithinAt.mono (h : HasMFDerivWithinAt I I' f t x f') (hst : s ⊆ t) :
568585
HasMFDerivWithinAt I I' f s x f' :=

Mathlib/Logic/Function/Basic.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ protected theorem Bijective.surjective {f : α → β} (hf : Bijective f) : Surj
8181
theorem not_injective_iff : ¬ Injective f ↔ ∃ a b, f a = f b ∧ a ≠ b := by
8282
simp only [Injective, not_forall, exists_prop]
8383

84+
@[simp] lemma not_injective_const {α β : Type*} [Nontrivial α] {b : β} :
85+
¬ Injective (fun _ : α ↦ b) := by
86+
rw [not_injective_iff]
87+
obtain ⟨a₁, a₂, h⟩ := exists_pair_ne α
88+
exact ⟨a₁, a₂, rfl, h⟩
89+
8490
/-- If the co-domain `β` of an injective function `f : α → β` has decidable equality, then
8591
the domain `α` also has decidable equality. -/
8692
protected def Injective.decidableEq [DecidableEq β] (I : Injective f) : DecidableEq α :=

0 commit comments

Comments
 (0)