feat(Geometry/Manifold): add MfldCat, the category of C^n manifolds#38223
feat(Geometry/Manifold): add MfldCat, the category of C^n manifolds#38223Deicyde wants to merge 20 commits intoleanprover-community:masterfrom
MfldCat, the category of C^n manifolds#38223Conversation
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR. Thank you again for joining our community. |
MfldCat, the category of C^n manifolds
PR summary 9ee33d6428Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
…e for ContinuousMap.
| [instTop : TopologicalSpace carrier] | ||
| [instCharted : ChartedSpace H carrier] | ||
| [instManifold : IsManifold I n carrier] | ||
|
|
There was a problem hiding this comment.
I had to translate carrier to M for manifold in my head. What is the rationale for not staying with the usual notational choice?
There was a problem hiding this comment.
From what I can tell, carrier seems to be the standard choice across all of the Category Theory codebase. Whenever a category is wrapping an existing type, that type is called carrier.
I agree M would be a more natural name for this field. If another reviewer agrees, I'm happy to change it.
There was a problem hiding this comment.
I think carrier as a name is fine - it is standard, and shouldn't appear much in later code anyway since we set up a coercion to Type (i.e. instead of M.carrier or M.M with the rename you should be able to just write M).
| /-- The category of `C^n` 𝕜-manifolds. -/ | ||
| -- Note: Copied from `PFunctor`, but do we need seperate universe levels here? Seems perverse. | ||
| @[pp_with_univ, nolint checkUnivs] | ||
| structure MfldCat (𝕜 : Type u₁) [NontriviallyNormedField 𝕜] (n : WithTop ℕ∞) where | ||
| /-- The object in `MfldCat` associated to a type equipped with the appropriate typeclasses. -/ | ||
| of :: | ||
| /-- The underlying type. -/ | ||
| carrier : Type u₂ | ||
| /-- The model normed space. -/ | ||
| E : Type u₃ | ||
| /-- The chart space. -/ | ||
| H : Type u₄ | ||
| [instNAG : NormedAddCommGroup E] | ||
| [instNS : NormedSpace 𝕜 E] | ||
| [instTopH : TopologicalSpace H] | ||
| /-- The model with corners. -/ | ||
| I : ModelWithCorners 𝕜 E H |
There was a problem hiding this comment.
How about splitting this into two structures? The first one, let's call it ModelWithCorners.MfldCat, would have E, H and I as parameters. This would give a natural way to consider e.g. the category of manifolds of dimension n without boundary.
The second one would be equivalent to the one you currently have: It would take E, H and I as fields and a term of ModelWithCorners.MfldCat I.
There was a problem hiding this comment.
Do we have any reason to ever consider the category of manifolds of some fixed dimension? The only thing I can see that it has going for it is that it has coproducts whereas MfldCat doesn't, but that alone doesn't make it interesting
There was a problem hiding this comment.
Certainly the category of manifolds without boundary is relevant. We can of course alternatively take the subcategory defined by something like BoundarylessManifold, but the model with corners will satisfy worse definitional properties.
Generally, it is easy to combine unbundled structures into bundled ones, but going the other way always requires a refactor. So we should check now if we later need the unbundled version.
There was a problem hiding this comment.
Using a subcategory defined by things like BoundarylessManifold seems more natural to me - we will have to do that anyway if we want to talk about boundaryless manifolds of non-fixed dimension, there are plenty of boundaryless manifolds on non-boundaryless models (e.g. the interior of any manifold with boundary), and we already have some well-behavedness results like that BoundarylessManifold is invariant under isomorphism
peabrainiac
left a comment
There was a problem hiding this comment.
I left a few smaller comments - my main takeaway aside from those is that this PR contains a lot more boilerplate API (e.g. Hom as a type synonym instead of working with ContMDiffMap directly) than my earlier version here, but this is probably a good thing because my code was based on an earlier version of TopCat and there are likely good reasons why those changes have been made to the design of TopCat since.
Thanks for your work on this, getting this category into mathlib is indeed long overdue.
| open CategoryTheory | ||
| open scoped Manifold | ||
|
|
||
| universe u₁ u₂ u₃ u₄ |
There was a problem hiding this comment.
Aside from the point on Zulip that I would prefer just two universe levels, one for the field and one for the other types - if you put u₁ last, you can do e.g. MfldCat.{u₂, u₃, u₄} ℝ n where currently you would have to write MfldCat.{0, u₂, u₃, u₄} ℝ n.
There was a problem hiding this comment.
I changed it to two universe levels. I'm more confident in this choice now that you and Kevin seem to support it.
| public import Mathlib.Topology.Category.TopCat.Basic | ||
|
|
||
| /-! | ||
| # Category instance for smooth manifolds |
There was a problem hiding this comment.
I think "The category of MfldCat here. I see Mathlib.Topology.Category.TopCat.Basic was also named in this way though, so I guess it would be fine to stick with it for consistency?
The "smooth" should probably go though, since we define categories for all smoothness degrees here.
There was a problem hiding this comment.
I agree, "The Category of C^n Manifolds" is a much nicer title. I'm going to change it and see if any other reviewer objects.
We define
MfldCat 𝕜 n: the category ofC^nmanifolds over a field𝕜, following the pattern ofTopCatinMathlib.Topology.Category.TopCat.Basic. We also implementHasForget₂ (MfldCat 𝕜 n) TopCat—the forgetful functor into the category of topological spaces. For more discussion see the Zulip thread: #PR reviews > #38223 The Category of C^n ManifoldsAlso added:
ContMDiffMap.id_apply,.coe_idand.coe_compwhich are comparable toContinuousMapAPI.Future work
Manifold.Topology.Category.TopCat.MonoidalM ↦ TM,F ↦ F.tangentMapfromMfldCat (n+1) 𝕜toMfldCat n 𝕜feat(Geometry/Manifold): The Tangent Functor onMfldCat#38270FGModuleCat 𝕜 ⥤ MfldCat 𝕜 nsending a finite-dimensional𝕜-vector space to the manifold modeled on itself. Left asTODO.FGModuleCat 𝕜as an enriched category overMfldCat n 𝕜. The smooth functors can be realized as endofunctors on the enriched category. This is the main motivation for this construction.