Skip to content

[Merged by Bors] - feat: add (m)differentiableAt_of_(m)fderiv_injective#35284

Closed
grunweg wants to merge 5 commits intoleanprover-community:masterfrom
grunweg:mdiff-of-mfderiv-inj
Closed

[Merged by Bors] - feat: add (m)differentiableAt_of_(m)fderiv_injective#35284
grunweg wants to merge 5 commits intoleanprover-community:masterfrom
grunweg:mdiff-of-mfderiv-inj

Conversation

@grunweg
Copy link
Contributor

@grunweg grunweg commented Feb 14, 2026

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.


Open in Gitpod

This lemma generalises differentiableAt_of_isInvertible_fderiv.
@grunweg grunweg added easy < 20s of review time. See the lifecycle page for guidelines. t-differential-geometry Manifolds etc t-analysis Analysis (normed *, calculus) labels Feb 14, 2026
@grunweg grunweg mentioned this pull request Feb 14, 2026
2 tasks
@github-actions
Copy link

github-actions bot commented Feb 14, 2026

PR summary 4aa0616ac5

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ differentiableAt_of_fderiv_injective
+ differentiableWithinAt_of_fderivWithin_injective
+ differentiableWithinAt_of_subsingleton
+ mdifferentiableAt_of_mfderiv_injective
+ mdifferentiableWithinAt_of_mfderivWithin_injective
+ mdifferentiableWithinAt_of_subsingleton
+ not_injective_const

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for scripts/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@grunweg grunweg removed the easy < 20s of review time. See the lifecycle page for guidelines. label Feb 14, 2026
· exact (differentiable_of_subsingleton x).differentiableWithinAt
· by_contra h'
rw [fderivWithin_zero_of_not_differentiableWithinAt h'] at hf
exact h { allEq a b := hf rfl }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth extracting a lemma "if a constant function to X is injective, then Subsingleton X"? (It is used twice.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think so. Furthermore how about we add the following higher up:

@[nontriviality]
theorem differentiableWithinAt_of_subsingleton [Subsingleton E] :
    DifferentiableWithinAt 𝕜 f s x :=
  (differentiable_of_subsingleton x).differentiableWithinAt

(actually several existing lemmas above could do with the @[nontriviality] decorator)
and then:

@[simp] lemma not_injective_const {α β : Type*} [Nontrivial α] {b : β} :
    ¬ Injective (fun _ : α ↦ b) := by
  rw [not_injective_iff]
  obtain ⟨a₁, a₂, h⟩ := exists_pair_ne α
  use a₁, a₂

(in the right file)
so that the proof here can become:

  nontriviality E
  contrapose! hf
  rw [fderivWithin_zero_of_not_differentiableWithinAt hf]
  exact not_injective_const -- Disappointing that `simp` cannot fire here but let's live with it

@grunweg
Copy link
Contributor Author

grunweg commented Feb 18, 2026

@ocfnash I have an easy differential geometry PR to review - would you like to take a look in the coming days? Thanks!

@grunweg grunweg requested a review from ocfnash February 18, 2026 08:52
Copy link
Contributor

@ocfnash ocfnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

bors d+

· exact (differentiable_of_subsingleton x).differentiableWithinAt
· by_contra h'
rw [fderivWithin_zero_of_not_differentiableWithinAt h'] at hf
exact h { allEq a b := hf rfl }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think so. Furthermore how about we add the following higher up:

@[nontriviality]
theorem differentiableWithinAt_of_subsingleton [Subsingleton E] :
    DifferentiableWithinAt 𝕜 f s x :=
  (differentiable_of_subsingleton x).differentiableWithinAt

(actually several existing lemmas above could do with the @[nontriviality] decorator)
and then:

@[simp] lemma not_injective_const {α β : Type*} [Nontrivial α] {b : β} :
    ¬ Injective (fun _ : α ↦ b) := by
  rw [not_injective_iff]
  obtain ⟨a₁, a₂, h⟩ := exists_pair_ne α
  use a₁, a₂

(in the right file)
so that the proof here can become:

  nontriviality E
  contrapose! hf
  rw [fderivWithin_zero_of_not_differentiableWithinAt hf]
  exact not_injective_const -- Disappointing that `simp` cannot fire here but let's live with it

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Feb 18, 2026

✌️ grunweg can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@mathlib-triage mathlib-triage bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Feb 18, 2026
@grunweg
Copy link
Contributor Author

grunweg commented Feb 21, 2026

Great suggestions, all addressed - let's hope CI likes these changes (on the train, so I prefer avoiding a full rebuild locally).

@grunweg
Copy link
Contributor Author

grunweg commented Feb 23, 2026

bors merge

@mathlib-triage mathlib-triage bot added the ready-to-merge This PR has been sent to bors. label Feb 23, 2026
mathlib-bors bot pushed a commit that referenced this pull request Feb 23, 2026
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.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Feb 23, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: add (m)differentiableAt_of_(m)fderiv_injective [Merged by Bors] - feat: add (m)differentiableAt_of_(m)fderiv_injective Feb 23, 2026
@mathlib-bors mathlib-bors bot closed this Feb 23, 2026
@grunweg grunweg deleted the mdiff-of-mfderiv-inj branch February 28, 2026 15:54
pfaffelh pushed a commit to pfaffelh/mathlib4 that referenced this pull request Mar 2, 2026
…unity#35284)

and versions for `(m)fderivWithin` versions. This generalises the existing lemmas `(m)differentiableAt_of_isInvertible_(m)fderiv` and friends.

Extracted from leanprover-community#35078; from the path to immersions, embeddings and submanifolds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors. t-analysis Analysis (normed *, calculus) t-differential-geometry Manifolds etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants