Skip to content

[Merged by Bors] - feat: extend smoothness category of manifolds with corners to include analytic manifolds#19696

Closed
sgouezel wants to merge 17 commits intomasterfrom
SG_smoothmanifold
Closed

[Merged by Bors] - feat: extend smoothness category of manifolds with corners to include analytic manifolds#19696
sgouezel wants to merge 17 commits intomasterfrom
SG_smoothmanifold

Conversation

@sgouezel
Copy link
Copy Markdown
Contributor

@sgouezel sgouezel commented Dec 2, 2024

Now that ContDiff includes smoothness exponents up to analytic functions, we can do the same for manifolds. The PR renames SmoothManifoldWithCorners to IsManifold, and includes an additional smoothness exponent (ranging from 0 to infinity and omega). The docstring of IsManifold emphasizes that this allows (but does not mandate) corners or boundaries.

The file SmoothManifoldWithCorners itself is not renamed, to avoid confusing git, and will be renamed in a follow-up PR.

The current version of the PR also allows an additional smoothness exponent in the algebraic classes like ContMDiffMul or LieGroup. For all of these, we add a bunch of instances to deduce low smoothness from high smoothness versions (for example, LieGroup I 2 G is found by typeclass inference from LieGroup I ∞ G).

This change makes it possible to do things with the correct assumptions. For instance, the tangent bundle is a fiber bundle assuming only that the manifold is C^1 (but we have instances saying that it is C^∞ if the manifold is C^∞, analytic if the manifold is analytic).

Normally, I should have properly deprecated everything but instances.

TODO in follow-up PRs:

  • rename SmoothManifoldWithCorners.lean to IsManifold.lean
  • deprecate the whole file Manifold.Analytic.lean

Open in Gitpod

@sgouezel sgouezel added WIP Work in progress t-differential-geometry Manifolds etc labels Dec 2, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 2, 2024

PR summary 6d9ca2fe6a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ AnalyticManifold.isManifold
+ Bundle.ContinuousLinearMap.vectorPrebundle.isContMDiff
+ Bundle.Prod.contMDiffVectorBundle
+ Bundle.TotalSpace.isManifold
+ Bundle.Trivial.contMDiffVectorBundle
+ ContDiffSupportedOn
+ ContMDiffAdd
+ ContMDiffAddMonoidMorphism
+ ContMDiffFiberwiseLinear.hasGroupoid
+ ContMDiffFiberwiseLinear.locality_aux₁
+ ContMDiffFiberwiseLinear.locality_aux₂
+ ContMDiffFunction.evalAt
+ ContMDiffInv₀
+ ContMDiffInv₀.of_le
+ ContMDiffMonoidMorphism
+ ContMDiffMul
+ ContMDiffMul.of_le
+ ContMDiffMul.prod
+ ContMDiffRing
+ ContMDiffVectorBundle
+ ContMDiffVectorBundle.continuousLinearMap
+ ContMDiffVectorBundle.of_le
+ ContMDiffVectorBundle.pullback
+ EuclideanSpace.instIsManifoldSphere
+ IsManifold
+ IsManifold.locallyRingedSpace
+ IsManifold.mk'
+ LieGroup.of_le
+ PartialHomeomorph.isManifold_singleton
+ PointedContMDiffMap
+ TangentBundle.contMDiffVectorBundle
+ Topology.IsOpenEmbedding.isManifold_singleton
+ _root_.ENat.LEInfty
+ contDiffWithinAt_localInvariantProp_of_le
+ contMDiffAt_infty
+ contMDiffCoordChange
+ contMDiffCoordChange_apply
+ contMDiffFiberwiseLinear
+ contMDiffOn_contMDiffCoordChange
+ contMDiffOn_infty
+ contMDiffVectorBundle
+ contMDiffWithinAt_infty
+ contMDiff_infty
+ continuousMul_of_contMDiffMul
+ hasContinuousInv₀_of_hasContMDiffInv₀
+ instContMDiffAddSelf
+ instContMDiffVectorBundle
+ instIsManifoldIcc
+ instIsManifoldTransDiffeomorph
+ instNormedSpaceLieAddGroup
+ instance (n : ℕ) : IsManifold (𝓡 n) ω (sphere (0 : EuclideanSpace ℝ (Fin (n + 1))) 1)
+ instance (n : ℕ) : LEInfty (n : WithTop ℕ∞) := ⟨mod_cast le_top⟩
+ instance (n : ℕ) [n.AtLeastTwo] : LEInfty (no_index (OfNat.ofNat n) : WithTop ℕ∞)
+ instance (priority := 100) ContMDiffRing.toContMDiffMul (I : ModelWithCorners 𝕜 E H) (R : Type*)
+ instance (priority := 100) ContMDiffRing.toLieAddGroup (I : ModelWithCorners 𝕜 E H) (R : Type*)
+ instance (priority := 100) instFieldContMDiffRing
+ instance : ContMDiffVectorBundle 0 F E IB := by
+ instance : ContinuousMapClass (ContMDiffMonoidMorphism I I' n G G') G G'
+ instance : FunLike (ContDiffSupportedOn 𝕜 E F n s) E F
+ instance : FunLike (ContMDiffMonoidMorphism I I' n G G') G G'
+ instance : Inhabited (ContMDiffMonoidMorphism I I' n G G')
+ instance : IsManifold (𝓡 1) ω Circle
+ instance : IsManifold I 0 M := by
+ instance : IsManifold I n s
+ instance : IsManifold 𝓘(ℂ) ω ℍ
+ instance : IsManifold 𝓘(𝕜, R) n Rˣ
+ instance : LEInfty (0 : WithTop ℕ∞) := inferInstanceAs (LEInfty ((0 : ℕ) : WithTop ℕ∞))
+ instance : LEInfty (1 : WithTop ℕ∞) := inferInstanceAs (LEInfty ((1 : ℕ) : WithTop ℕ∞))
+ instance : LieGroup (𝓡 1) ω Circle
+ instance : LieGroup 𝓘(𝕜, R) n Rˣ
+ instance : MonoidHomClass (ContMDiffMonoidMorphism I I' n G G') G G'
+ instance : One (ContMDiffMonoidMorphism I I' n G G')
+ instance [ContMDiffInv₀ I 2 G] : ContMDiffInv₀ I 1 G
+ instance [ContMDiffMul I 2 G] : ContMDiffMul I 1 G
+ instance [ContMDiffVectorBundle 2 F E IB] : ContMDiffVectorBundle 1 F E IB
+ instance [ContinuousMul G] : ContMDiffMul I 0 G := by
+ instance [HasContinuousInv₀ G] : ContMDiffInv₀ I 0 G := by
+ instance [IsManifold I 2 M] :
+ instance [IsManifold I ω M] :
+ instance [LieGroup I 2 G] : LieGroup I 1 G
+ instance [TopologicalGroup G] : LieGroup I 0 G := by
+ instance [h : IsManifold I 2 M] :
+ instance [h : IsManifold I ∞ M] :
+ instance {a : WithTop ℕ∞} [ContMDiffInv₀ I ω G] : ContMDiffInv₀ I a G
+ instance {a : WithTop ℕ∞} [ContMDiffInv₀ I ∞ G] [h : ENat.LEInfty a] : ContMDiffInv₀ I a G
+ instance {a : WithTop ℕ∞} [ContMDiffMul I ω G] : ContMDiffMul I a G
+ instance {a : WithTop ℕ∞} [ContMDiffMul I ∞ G] [h : ENat.LEInfty a] : ContMDiffMul I a G
+ instance {a : WithTop ℕ∞} [ContMDiffVectorBundle ω F E IB] : ContMDiffVectorBundle a F E IB
+ instance {a : WithTop ℕ∞} [ContMDiffVectorBundle ∞ F E IB] [h : ENat.LEInfty a] :
+ instance {a : WithTop ℕ∞} [IsManifold I ω M] :
+ instance {a : WithTop ℕ∞} [IsManifold I ∞ M] [h : LEInfty a] :
+ instance {a : WithTop ℕ∞} [LieGroup I ω G] : LieGroup I a G
+ instance {a : WithTop ℕ∞} [LieGroup I ∞ G] [h : ENat.LEInfty a] : LieGroup I a G
+ instance {n : WithTop ℕ∞} : IsManifold (𝓡∂ 1) n (Icc (0 : ℝ) 1) := by
+ instance {𝕜 : Type*} [NontriviallyNormedField 𝕜] {n : WithTop ℕ∞}
+ instance {𝕜 : Type*} [NontriviallyNormedField 𝕜] {n : WithTop ℕ∞} : ContMDiffInv₀ 𝓘(𝕜) n 𝕜
+ intIsManifoldModelSpace
+ isManifold_of_contDiffOn
+ maximalAtlas_subset_of_le
+ mem_contMDiffFiberwiseLinear_iff
+ mk_contMDiffCoordChange
+ of_le
+ tangentBundleCore.isContMDiff
+ topologicalSemiring_of_contMDiffRing
++ IsContMDiff
++-- IsSmooth
+-- smoothVectorBundle
- AnalyticManifold.smoothManifoldWithCorners
- Bundle.Prod.smoothVectorBundle
- Bundle.TotalSpace.smoothManifoldWithCorners
- Bundle.Trivial.smoothVectorBundle
- EuclideanSpace.instSmoothManifoldWithCornersSphere
- Icc_smoothManifoldWithCorners
- SmoothFiberwiseLinear.hasGroupoid
- SmoothMul.prod
- SmoothSupportedOn
- SmoothVectorBundle.continuousLinearMap
- SmoothVectorBundle.pullback
- hasSmoothAddSelf
- instance (n : ℕ) :
- instance (priority := 100) SmoothRing.toLieAddGroup (I : ModelWithCorners 𝕜 E H) (R : Type*)
- instance (priority := 100) SmoothRing.toSmoothMul (I : ModelWithCorners 𝕜 E H) (R : Type*)
- instance (priority := 100) fieldSmoothRing {𝕜 : Type*} [NontriviallyNormedField 𝕜] :
- instance : ContinuousMapClass (SmoothMonoidMorphism I I' G G') G G'
- instance : FunLike (SmoothMonoidMorphism I I' G G') G G'
- instance : FunLike (SmoothSupportedOn 𝕜 E F n s) E F
- instance : Inhabited (SmoothMonoidMorphism I I' G G')
- instance : LieGroup (𝓡 1) Circle
- instance : LieGroup 𝓘(𝕜, R) Rˣ
- instance : MonoidHomClass (SmoothMonoidMorphism I I' G G') G G'
- instance : One (SmoothMonoidMorphism I I' G G')
- instance : SmoothManifoldWithCorners (𝓡 1) Circle
- instance : SmoothManifoldWithCorners (𝓡∂ 1) (Icc (0 : ℝ) 1) := by infer_instance
- instance : SmoothManifoldWithCorners I s
- instance : SmoothManifoldWithCorners 𝓘(ℂ) ℍ
- instance : SmoothManifoldWithCorners 𝓘(𝕜, R) Rˣ
- instance {𝕜 : Type*} [NontriviallyNormedField 𝕜] : SmoothInv₀ 𝓘(𝕜) 𝕜
- instance {𝕜 : Type*} [NontriviallyNormedField 𝕜] {H : Type*} [TopologicalSpace H] {E : Type*}
- model_space_smooth
- normedSpaceLieAddGroup
- smoothManifoldWithCorners_transDiffeomorph

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 script/declarations_diff.sh contains some details about this script.


Decrease in tech debt: (relative, absolute) = (4.00, 0.00)
Current number Change Type
4878 -4 exceptions for the docPrime linter

Current commit 6d9ca2fe6a
Reference commit dd2e6e36fc

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).

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Dec 2, 2024
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Dec 3, 2024

About naming: how about IsManifoldWithCorners? I agree ContDiff is superfluous, given the exponent as an explicit parameter.

Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

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

This change means the following paragraph is also obsolete --- right? Can you take a pass over the module doc-string to ensure the implementation notes are up to date?

We concentrate on C^∞ manifolds: all the definitions work equally well for C^n manifolds, but later on it is a pain to carry all over the smoothness parameter, especially when one wants to deal with C^k functions as there would be additional conditions k ≤ n everywhere. Since one deals almost all the time with C^∞ (or analytic) manifolds, this seems to be a reasonable choice that one could revisit later if needed. C^k manifolds are still available, but they should be called using [HasGroupoid](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Geometry/Manifold/ChartedSpace.html#HasGroupoid) M (contDiffGroupoid k I) where I is the model with corners.

@sgouezel
Copy link
Copy Markdown
Contributor Author

sgouezel commented Dec 3, 2024

Yes, I will need to pass over all docs to adjust it to the new setting. I'll do that once people agree on what they want in the Zulip discussion.

Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

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

Three small comments; I have to turn to other things now.

Can you add deprecations for the old names, please? Thanks for doing this refactor!

@sgouezel
Copy link
Copy Markdown
Contributor Author

sgouezel commented Dec 4, 2024

I'll add the deprecations once everything has been sorted out in the Zulip discussion: no need to do the same work two or three times...

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Dec 4, 2024
Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

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

I've reviewed everything once, except for

  • Geometry/Manifold/Algebra/Monoid.lean
  • Geometry/Manifold/Algebra/SmoothFunctions.lean
  • Geometry/Manifold/AnalyticManifold.lean
  • Geometry/Manifold/ContMDiff/Defs.lean
  • Geometry/Manifold/SmoothManifoldWithCorners.lean

Mostly very minor comments. This PR is so cross-cutting that also doc-strings and lemma names can go stale: because you generalise things to C^n where appropriate, I think some more things should be called "contDiffThing" and not "smoothThing".
I didn't read the file changing it yet, but "smoothMaximalAtlas" is another such example.

I'm repeating myself, but let me say it again anyway: thanks for attempting this monumental feat. It's only natural that there are lots of little details that can go stale.

I've reviewed this diff "from the bottom", so if something is confusing, you may want to read the comments in opposite order.

(hf : ContMDiffWithinAt (J.prod I) I' n (Function.uncurry f) (t ×ˢ u) (x₀, g x₀))
(hg : ContMDiffWithinAt J I m g t x₀) (hx₀ : x₀ ∈ t)
(hu : MapsTo g t u) (hmn : m + 1 ≤ n) (h'u : UniqueMDiffOn I u) :
haveI : IsManifold I 1 M := .of_le (le_trans le_add_self hmn)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These are annoying, but perhaps that's the price of such a major refactoring. It need not block in this, in any case.

@sgouezel sgouezel force-pushed the SG_smoothmanifold branch 2 times, most recently from 457a78f to c07cf67 Compare December 8, 2024 10:24
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Dec 8, 2024
@sgouezel sgouezel removed the WIP Work in progress label Dec 8, 2024
mathlib-bors bot pushed a commit that referenced this pull request Dec 9, 2024
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Dec 9, 2024
@mathlib4-dependent-issues-bot
Copy link
Copy Markdown
Collaborator

@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Dec 9, 2024

As I also wrote on zulip: I can review the rest of the PR/re-review it on (probably) Tuesday or Wednesday. Review help is very welcome, though.

@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 Dec 10, 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 Dec 10, 2024
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Dec 19, 2024

Remaining steps

  • address all comments
  • I trust you that you added deprecations correctly. (Please double-check if there are any issues with namespacing - i.e., search of you modified any lines with namespace.)
  • audit the remaining occurrences of the word "smooth", if it should be "C^n" instead. I just did most of this; checking the VectorBundle directory should be sufficient for my taste.

This PR is a huge one, but I think this is close to landing!

@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 Dec 21, 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 Dec 28, 2024
@sgouezel
Copy link
Copy Markdown
Contributor Author

sgouezel commented Jan 1, 2025

Thanks for fixing directly some files, and for the thorough review!

I think I have taken into account all your comments.

I wouldn't rename the files SmoothFunctions to CnFunctions, because one can interpret Smooth in a loose sense, as functions with some regularity. In any case, this shouldn't be done in this PR, because PRs renaming and changing content at the same time tend to confuse git.

I have switched to C^n instead of smooth in many places, notably in ContMDiff.Product, and in the VectorBundle directory. You can see the last few commits to see the changes.

@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 Jan 4, 2025
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Jan 9, 2025

Thanks for the last changes. I think this has waited for long enough and is ready to go. If we find non-ideal uses of the word "smooth", these can be fixed in future PRs. I'll try to merge master, then maintainer merge this. Thanks for your sustained patience!

@grunweg grunweg removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 9, 2025
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Jan 9, 2025

Mathlib builds; I just pushed a last commit updating the deprecation dates to today. I think this is good to go.
maintainer merge

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 9, 2025

🚀 Pull request has been placed on the maintainer queue by grunweg.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jan 9, 2025
@fpvandoorn
Copy link
Copy Markdown
Member

This looks really good!

Maybe the file SmoothFunctions should also be updated in a follow-up PR.

Thanks!

bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Jan 9, 2025
mathlib-bors bot pushed a commit that referenced this pull request Jan 9, 2025
… analytic manifolds (#19696)

Now that `ContDiff` includes smoothness exponents up to analytic functions, we can do the same for manifolds. The PR renames `SmoothManifoldWithCorners` to `IsManifold`, and includes an additional smoothness exponent (ranging from 0 to infinity and omega). The docstring of `IsManifold` emphasizes that this allows (but does not mandate) corners or boundaries.

The file `SmoothManifoldWithCorners` itself is not renamed, to avoid confusing git, and will be renamed in a follow-up PR.

The current version of the PR also allows an additional smoothness exponent in the algebraic classes like `ContMDiffMul` or `LieGroup`. For all of these, we add a bunch of instances to deduce low smoothness from high smoothness versions (for example, `LieGroup I 2 G` is found by typeclass inference from `LieGroup I ∞ G`).

This change makes it possible to do things with the correct assumptions. For instance, the tangent bundle is a fiber bundle assuming only that the manifold is `C^1` (but we have instances saying that it is `C^∞` if the manifold is `C^∞`, analytic if the manifold is analytic).

Normally, I should have properly deprecated everything but instances. 

TODO in follow-up PRs:
* rename `SmoothManifoldWithCorners.lean` to `IsManifold.lean`
* deprecate the whole file `Manifold.Analytic.lean`



Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
@fpvandoorn
Copy link
Copy Markdown
Member

(I see that this rename has been discussed before, I don't feel strongly, but I think it might be nice for discoverability if you already know the Mathlib name of the concept it's about.)

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 9, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: extend smoothness category of manifolds with corners to include analytic manifolds [Merged by Bors] - feat: extend smoothness category of manifolds with corners to include analytic manifolds Jan 9, 2025
@mathlib-bors mathlib-bors bot closed this Jan 9, 2025
@mathlib-bors mathlib-bors bot deleted the SG_smoothmanifold branch January 9, 2025 15:44
mathlib-bors bot pushed a commit that referenced this pull request Jan 10, 2025
…nifold.lean (#20611)

Follow-up to #19696; split into a separate PR to not confuse git.
grunweg added a commit that referenced this pull request Jan 11, 2025
…nifold.lean (#20611)

Follow-up to #19696; split into a separate PR to not confuse git.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. ready-to-merge This PR has been sent to bors. t-differential-geometry Manifolds etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants