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

Forgetful Functors for Manifold Objects #31241

Open
mjungmath opened this issue Jan 14, 2021 · 30 comments
Open

Forgetful Functors for Manifold Objects #31241

mjungmath opened this issue Jan 14, 2021 · 30 comments

Comments

@mjungmath
Copy link

It would be nice to allow forgetful functors for manifolds. In particular:

  • differentiable manifolds -> topological manifolds
  • (Pseudo-)Riemannian manifolds -> differentiable manifolds (not a category yet)
  • topological manifolds -> sets (?)

and probably even more. The last point, if getting to work somehow, might also be useful and/or should be seen in view of #30832.

At the moment, we have the following behavior (which could be seen as a bug):

sage: from sage.categories.functor import ForgetfulFunctor
sage: from sage.categories.manifolds import Manifolds
sage: F = ForgetfulFunctor(Manifolds(RR).Differentiable(), Manifolds(RR).Topological())
sage: M = Manifold(2, 'M')
sage: F(M)
2-dimensional differentiable manifold M

Depends on #31247

CC: @tscrim @egourgoulhon @mkoeppe

Component: manifolds

Issue created by migration from https://trac.sagemath.org/ticket/31241

@mjungmath mjungmath added this to the sage-9.3 milestone Jan 14, 2021
@mjungmath

This comment has been minimized.

@mjungmath

This comment has been minimized.

@mjungmath

This comment has been minimized.

@mjungmath

This comment has been minimized.

@mjungmath

This comment has been minimized.

@mjungmath mjungmath changed the title Forgetful Functors for Manifolds Forgetful Functors for Manifold Objects Jan 14, 2021
@mjungmath

This comment has been minimized.

@tscrim
Copy link
Collaborator

tscrim commented Jan 15, 2021

comment:9

I am a little hesitant to call it a bug because it still has that structure once it goes through the functor. The problem is the mutability and that you can make it leave the corresponding category. Now you could implement something specific that handles an instance of Manifold. Although I feel that getting something of this level of generality would be hard. I think you are probably better off implementing a mechanism in the Manifold class itself.

@mjungmath
Copy link
Author

comment:10

Replying to @tscrim:

I am a little hesitant to call it a bug because it still has that structure once it goes through the functor. The problem is the mutability and that you can make it leave the corresponding category. Now you could implement something specific that handles an instance of Manifold. Although I feel that getting something of this level of generality would be hard. I think you are probably better off implementing a mechanism in the Manifold class itself.

Agreed. Calling that, one could make a function in OpenInterval returning an element of RealSet. But wait, the forgetful functor to sets works differently, right?

The approach I had in mind is as simple as that: new instance of the desired kind and copy charts. Where do you think may problems occour?

@mjungmath
Copy link
Author

comment:11

The forgetful functor seems not to work properly anyway. Opened another ticket #31247.

@mjungmath
Copy link
Author

Dependencies: #31247

@tscrim
Copy link
Collaborator

tscrim commented Jan 17, 2021

comment:13

Replying to @mjungmath:

Replying to @tscrim:

I am a little hesitant to call it a bug because it still has that structure once it goes through the functor. The problem is the mutability and that you can make it leave the corresponding category. Now you could implement something specific that handles an instance of Manifold. Although I feel that getting something of this level of generality would be hard. I think you are probably better off implementing a mechanism in the Manifold class itself.

Agreed. Calling that, one could make a function in OpenInterval returning an element of RealSet. But wait, the forgetful functor to sets works differently, right?

The approach I had in mind is as simple as that: new instance of the desired kind and copy charts. Where do you think may problems occour?

Something you could do is implement the corresponding _call_ in the appropriate subcategories of Manifolds to handle the corresponding transferring of data. Although this probably would be a lot easier once there is a way to copy manifolds and reconstruct them, which I still need to do as part of the pickling fix... There is just a lot of data that needs to be carefully preserved and constructed ideally using the construction methods already in place. That is where bugs will likely occur. There are many ways to implement this that have various pros and cons, you just need to decide on which one you want.

@mjungmath
Copy link
Author

comment:14

Replying to @tscrim:

Something you could do is implement the corresponding _call_ in the appropriate subcategories of Manifolds to handle the corresponding transferring of data.

Won't work at the current stage. See #31247.

@mjungmath
Copy link
Author

comment:15

Okay, if I recall correctly, #31247 is not a bug, just simply not realistic. Instead, we can overwrite __call__ (double underscore!) for the special case of manifolds.

@mkoeppe
Copy link
Contributor

mkoeppe commented Feb 13, 2021

comment:16

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Feb 13, 2021
@mjungmath
Copy link
Author

comment:17

Replying to @tscrim:

Something you could do is implement the corresponding _call_ in the appropriate subcategories of Manifolds to handle the corresponding transferring of data. Although this probably would be a lot easier once there is a way to copy manifolds and reconstruct them, which I still need to do as part of the pickling fix... There is just a lot of data that needs to be carefully preserved and constructed ideally using the construction methods already in place. That is where bugs will likely occur. There are many ways to implement this that have various pros and cons, you just need to decide on which one you want.

Foremost charts, transition maps and their domains need to be copied since they encode the manifold's topology. I don't think that more data are necessary, except for the name and the dimension.

Is there a ticket devoted to pickling of manifolds yet?

@mkoeppe
Copy link
Contributor

mkoeppe commented May 31, 2021

comment:18

See also: discussion in #31877 comment:10

@mjungmath
Copy link
Author

comment:19

Replying to @mkoeppe:

See also: discussion in #31877 comment:10

I tend to say that things are different for manifold objects. Sometimes you really want to work in a genuine weaker structure, for example to impose new charts that have continuous transition maps instead of differentiable ones.

@mjungmath
Copy link
Author

comment:20

I think you can boil it down to the following. In contrast to rings like ZZ or QQ, where elements are immutable objects, manifold objects can dynamically be extended. Now, the extension highly depends on the context (topological, differentiable, semi-Riemannian).

@tscrim
Copy link
Collaborator

tscrim commented Jun 1, 2021

comment:21

As I mentioned in #31877, the manifold is not as special as you want it to be. It can be provided more information, but it is not something that is mutable. Subsequently, you have genuinely different objects for topological and differentiable on the same underlying set if you have different maximal atlases. Applying the forgetful functor, you would have the same maximal atlas, which means the differentiable structure would still be there.

@mjungmath
Copy link
Author

comment:22

Replying to @tscrim:

As I mentioned in #31877, the manifold is not as special as you want it to be. It can be provided more information, but it is not something that is mutable. Subsequently, you have genuinely different objects for topological and differentiable on the same underlying set if you have different maximal atlases. Applying the forgetful functor, you would have the same maximal atlas, which means the differentiable structure would still be there.

Sure, starting with a differential manifold and applying the forgetful functor to it, a new instance must be constructed, particularly an instance of TopologicalManifold. It should come with the "same" charts (different instances of course). Then you can add new charts dynamically, e.g. continuous but not differentiable, to the implementation. This is where the dynamical nature of manifolds comes into play.

That is at least how I would think the forgetful functor might be used in this case.

@mjungmath
Copy link
Author

comment:23

And I didn't say the manifold itself was mutable. I said its objects were.

@tscrim
Copy link
Collaborator

tscrim commented Jun 2, 2021

comment:24

You are confusing the notion of mutable and dynamic and forgetting that a manifold is defined by its objects (e.g., charts). If you have a differentiable manifold M and apply the forgetful functor to it, you get the same manifold M back with the same maximal atlas. If you then "add" something that makes it not a differentiable manifold, then you actually have a different manifold because you have a different maximal atlas. So you are actually creating a copy with some of the initial information the same, but you then give information that your copy is different than what you started with. Having initial information is a programming concept, not a mathematical one.

@mjungmath
Copy link
Author

comment:25

Replying to @tscrim:

You are confusing the notion of mutable and dynamic and forgetting that a manifold is defined by its objects (e.g., charts). If you have a differentiable manifold M and apply the forgetful functor to it, you get the same manifold M back with the same maximal atlas. If you then "add" something that makes it not a differentiable manifold, then you actually have a different manifold because you have a different maximal atlas. So you are actually creating a copy with some of the initial information the same, but you then give information that your copy is different than what you started with. Having initial information is a programming concept, not a mathematical one.

Mathematically this is wrong. As soon as you apply the forgetful functor from differentiable manifolds to topological manifolds, the maximal atlas changes accordingly. In particular, the maximal atlas now consists of all charts that are continuously compatible w.r.t. to all charts in the differentiable structure.

That is exactly the punchline: adding a non-compatible chart (in the differentiable sense) which is still countinously compatible would corrupt the differentiable structure, but keep the maximal atlas of the topological manifold intact.

@tscrim
Copy link
Collaborator

tscrim commented Jun 2, 2021

comment:26

Replying to @mjungmath:

Replying to @tscrim:

You are confusing the notion of mutable and dynamic and forgetting that a manifold is defined by its objects (e.g., charts). If you have a differentiable manifold M and apply the forgetful functor to it, you get the same manifold M back with the same maximal atlas. If you then "add" something that makes it not a differentiable manifold, then you actually have a different manifold because you have a different maximal atlas. So you are actually creating a copy with some of the initial information the same, but you then give information that your copy is different than what you started with. Having initial information is a programming concept, not a mathematical one.

Mathematically this is wrong. As soon as you apply the forgetful functor from differentiable manifolds to topological manifolds, the maximal atlas changes accordingly. In particular, the maximal atlas now consists of all charts that are continuously compatible w.r.t. to all charts in the differentiable structure.

You're wrong. Otherwise the category of differentiable manifolds is not a subcategory of topological manifolds. So there would be no forgetful functor. Alternatively, you have a covering of your manifold by charts with maps to open subsets of Rn that are diffeomorphic. The fact this is a covering forces any other chart to also be a diffeomorphism by the transition functions. Your maximal atlas cannot change under the forgetful functor.

That is exactly the punchline: adding a non-compatible chart (in the differentiable sense) which is still countinously compatible would corrupt the differentiable structure, but keep the maximal atlas of the topological manifold intact.

Which gives you a new distinct mathematical object. You cannot add information to the manifold by the forgetful functor. In the implementation here, you are not adding or changing the information, only "discovering" more.

@mjungmath
Copy link
Author

comment:27

Replying to @tscrim:

You're wrong. Otherwise the category of differentiable manifolds is not a subcategory of topological manifolds. So there would be no forgetful functor.

Why not? The differentiable structure is a subset of the maximal topological atlas, and the maximal atlas is uniquely determined by the differentiable structure, so I don't see any problems here.

In any case, it would be nice to copy a differentiable manifold in terms of a topological manifold. The forgetful functor would do the job in the mathematical sense.

@tscrim
Copy link
Collaborator

tscrim commented Jun 2, 2021

comment:28

Replying to @mjungmath:

Replying to @tscrim:

You're wrong. Otherwise the category of differentiable manifolds is not a subcategory of topological manifolds. So there would be no forgetful functor.

Why not? The differentiable structure is a subset of the maximal topological atlas, and the maximal atlas is uniquely determined by the differentiable structure, so I don't see any problems here.

Because you have a genuinely different manifold when your maximal atlas changes. This is not the result of applying the forgetful functor as an embedding of subcategories.

You also have to be careful that this is up to equality, not isomorphism. For example, there are infinitely many smooth structures you can place upon R4, so they are not equivalent (i.e., diffeomorphic) in the category of smooth manifolds. However, applying the forgetful functor to each of these do not result in the same (in the equality sense) copy of R4, but they are all isomorphic (now here homeomorphic) in the category of topological manifolds.

For a very concrete example of the above, the above is analogous to the groups C4 and C2 x C2. They are equivalent as sets (i.e., same cardinality) but not as groups.

In any case, it would be nice to copy a differentiable manifold in terms of a topological manifold. The forgetful functor would do the job in the mathematical sense.

See above. It is mathematically wrong to not obtain a differentiable manifold from the forgetful functor if you want differentiable manifolds to be a subcategory of topological manifolds. I don't see how the category of differentiable manifolds is not a subcategory of topological manifolds (in the mathematical sense of a subcategory). If you want to call this the forgetful functor, you need to prove to me that the maximal atlas actually changes.

@mjungmath
Copy link
Author

comment:29

Replying to @tscrim:

Because you have a genuinely different manifold when your maximal atlas changes. This is not the result of applying the forgetful functor as an embedding of subcategories.

Okay, I think we can see it as follows. A topological manifold comes equipped with a maximal topological atlas. This atlas contains all information about the topology and local Euclideanness.

To impose a differentiable structure, we add an additional atlas, namely the maximal differentiable atlas. So in a way, we can say that a differentiable manifold is endowed with two atlases. However, it turns out that the topological atlas is not needed because it can be recovered from the differentiable atlas.

Now, when we apply the forgetful functor, we simply forget about the differentiable atlas, and what remains is the maximal topological atlas.

So you were right when you said "the atlas does not change". I suppose I was just extremely sloppy here. Does that resolve some things?

@tscrim
Copy link
Collaborator

tscrim commented Jun 3, 2021

comment:30

Ye. Thus what you really want is a way to create a copy of the current data, but with the category changed. This is similar to the change_ring() method of matrices.

@mjungmath
Copy link
Author

comment:31

Replying to @tscrim:

Ye. Thus what you really want is a way to create a copy of the current data, but with the category changed. This is similar to the change_ring() method of matrices.

Mh. Not really, right? A differentiable manifold is an instance of DifferentiableManifold. If we want to work with that manifold in terms of a topological manifold, we must turn (or rather copy) it into an instance of TopologicalManifold. Changing the category or a structure attribute alone wouldn't do the job, no?

@tscrim
Copy link
Collaborator

tscrim commented Jun 3, 2021

comment:32

Yea, perhaps I was a little imprecise. I meant change the necessary information in the copy.

@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 14, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 1, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Aug 31, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.8, sage-9.9 Jan 7, 2023
@mkoeppe mkoeppe modified the milestones: sage-10.0, sage-10.1 Apr 30, 2023
@mkoeppe mkoeppe removed this from the sage-10.1 milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants