Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: update the ContDiff definition to integrate analytic functions in the hierarchy #17152

Closed
wants to merge 211 commits into from

Conversation

sgouezel
Copy link
Contributor

@sgouezel sgouezel commented Sep 26, 2024

We modify the definition of ContDiff so that the smoothness exponent belongs to WithTop (ℕ∞), where top smoothness (denoted with ω in the ContDiff scope) means analyticity (together with analyticity of all the iterated derivatives).

This will make it possible to write theorems like: consider a function which is C^2 over the reals or complexes, or analytic over a general field. Then... Many theorems in calculus hold under these assumptions (and it's the way things are written in Bourbaki), so having this possibility is a necessary improvement unless one wants to duplicate everything.

The PR is mostly not changing the API: theorems that were proved for C^n functions with n ∈ ℕ or n = ∞ are now proved for n ∈ ℕ or n = ∞ or n = ω (unless they are not true for analytic functions, but it turns out in most cases things are fine). Of course, results have to be added in the files ContDiff.Def and ContDiff.Basic to deal with analytic functions.

I know that the PR is huge and hard to review. I have tried to separate all the other results in other PRs, but once one changes the basic definition one has to fix everything downstream to get mathlib compiling, so I can not make it shorter...


Open in Gitpod

mathlib-bors bot pushed a commit that referenced this pull request Nov 27, 2024
For this, move the results needing `ContDiff` to two new files. The reason of this change is that I will import `FDeriv.Analytic` in `ContDiff.Defs` in #17152
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) label Nov 27, 2024
@mathlib4-dependent-issues-bot
Copy link
Collaborator

This PR/issue depends on:

variable [CompleteSpace 𝕜]


Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@@ -579,7 +579,7 @@ theorem _root_.DifferentiableOn.analyticOn {s : Set ℂ} {f : ℂ → E} (hd : D
differentiable on `s`. -/
protected theorem _root_.DifferentiableOn.contDiffOn {s : Set ℂ} {f : ℂ → E} {n : ℕ}
(hd : DifferentiableOn ℂ f s) (hs : IsOpen s) : ContDiffOn ℂ n f s :=
(hd.analyticOnNhd hs).contDiffOn
(hd.analyticOnNhd hs).contDiffOn hs.uniqueDiffOn
Copy link
Member

@urkud urkud Nov 27, 2024

Choose a reason for hiding this comment

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

Why AnalyticOnNhd.contDiffOn needs UniqueDiffOn now? UPD: I see that this is required for n = ω but this lemma takes n : Nat. Should it be upgraded to n : WithTop ENat?

Copy link
Contributor Author

@sgouezel sgouezel Nov 27, 2024

Choose a reason for hiding this comment

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

The assumptions in AnalyticOnNhd.contDiffOn have changed: in the previous version, it was requiring a complete space, but no unique differentiability. While the new version drops completeness, but requires unique differentiability.

Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to have the old version too? Anyway, could you please mention API changes like this one (i.e., not just ENat -> WithTop ENat) in the commit message? Also, am I right that we can upgrade this lemma from n : Nat to n : WithTop ENat for free?

Copy link
Contributor Author

@sgouezel sgouezel Nov 28, 2024

Choose a reason for hiding this comment

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

Sure, I've added back the old version, under the name AnalyticOnNhd.contDiffOn_of_completeSpace (and I've used it in CauchyIntegral.lean).

I think the new lemma already uses n : WithTop ENat.

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 28, 2024
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 29, 2024
@@ -579,7 +579,7 @@ theorem _root_.DifferentiableOn.analyticOn {s : Set ℂ} {f : ℂ → E} (hd : D
differentiable on `s`. -/
protected theorem _root_.DifferentiableOn.contDiffOn {s : Set ℂ} {f : ℂ → E} {n : ℕ}
Copy link
Member

Choose a reason for hiding this comment

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

Will it work like this?

Suggested change
protected theorem _root_.DifferentiableOn.contDiffOn {s : Set ℂ} {f : ℂ → E} {n : }
protected theorem _root_.DifferentiableOn.contDiffOn {s : Set ℂ} {f : ℂ → E} {n : WithTop ℕ +}

@urkud
Copy link
Member

urkud commented Nov 29, 2024

Otherwise LGTM. Thanks!
bors d+

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Nov 29, 2024

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

@sgouezel
Copy link
Contributor Author

bors r+
Thanks a lot for the review!

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the ready-to-merge This PR has been sent to bors. label Nov 29, 2024
mathlib-bors bot pushed a commit that referenced this pull request Nov 29, 2024
…s in the hierarchy (#17152)

We modify the definition of `ContDiff` so that the smoothness exponent belongs to `WithTop (ℕ∞)`, where top smoothness (denoted with `ω` in the `ContDiff` scope) means analyticity (together with analyticity of all the iterated derivatives).

This will make it possible to write theorems like: consider a function which is `C^2` over the reals or complexes, or analytic over a general field. Then... Many theorems in calculus hold under these assumptions (and it's the way things are written in Bourbaki), so having this possibility is a necessary improvement unless one wants to duplicate everything.

The PR is mostly not changing the API: theorems that were proved for `C^n` functions with `n ∈ ℕ or n = ∞` are now proved for `n ∈ ℕ or n = ∞ or n = ω` (unless they are not true for analytic functions, but it turns out in most cases things are fine). Of course, results have to be added in the files `ContDiff.Def` and `ContDiff.Basic` to deal with analytic functions.

I know that the PR is huge and hard to review. I have tried to separate all the other results in other PRs, but once one changes the basic definition one has to fix everything downstream to get mathlib compiling, so I can not make it shorter...



Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Nov 29, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: update the ContDiff definition to integrate analytic functions in the hierarchy [Merged by Bors] - feat: update the ContDiff definition to integrate analytic functions in the hierarchy Nov 29, 2024
@mathlib-bors mathlib-bors bot closed this Nov 29, 2024
@mathlib-bors mathlib-bors bot deleted the SG_contdiff branch November 29, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated ready-to-merge This PR has been sent to bors. t-analysis Analysis (normed *, calculus)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants