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

Refine category of RealSet #31877

Closed
mkoeppe opened this issue May 29, 2021 · 26 comments
Closed

Refine category of RealSet #31877

mkoeppe opened this issue May 29, 2021 · 26 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented May 29, 2021

we should put it in a suitable subcategory of TopologicalSpaces.

Depends on #31880

CC: @mjungmath @egourgoulhon @tscrim

Component: categories

Author: Matthias Koeppe

Branch/Commit: 5b0f85d

Reviewer: Travis Scrimshaw

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

@mkoeppe mkoeppe added this to the sage-9.4 milestone May 29, 2021
@mjungmath
Copy link

comment:1

Possibly a good idea to consider: #30832 comment:6.

@mkoeppe
Copy link
Member Author

mkoeppe commented May 29, 2021

Branch: u/mkoeppe/refine_category_of_realset

@mkoeppe
Copy link
Member Author

mkoeppe commented May 29, 2021

New commits:

4b09685RealSet: Put it in a suitable subcategory of TopologicalSpaces()

@mkoeppe
Copy link
Member Author

mkoeppe commented May 29, 2021

Commit: 4b09685

@mkoeppe
Copy link
Member Author

mkoeppe commented May 29, 2021

Author: Matthias Koeppe

@mjungmath
Copy link

comment:4

I personally don't like adding RealSet to TopologicalSpaces. Imo the difference between RealSet and OpenInterval should be exactly that: seeing them as sets or manifolds (i.e. top. spaces).

Then a forgetful functor would also make more sense.

@mkoeppe
Copy link
Member Author

mkoeppe commented May 30, 2021

comment:5

A RealSet instance is a union of finitely many (possibly degenerate) intervals, so it is always a topological subspace of the real line, but not always a manifold. It would belong to the category of manifolds with corners of mixed dimension, but I think it's a long way until we have implemented that.

@tscrim
Copy link
Collaborator

tscrim commented May 30, 2021

comment:6

I think this is good. As Matthias said, they are naturally topological spaces from the subspace topology. The only question I have is why is ambient() a @staticmethod? I feel like it should be a normal method because the ambient space is associated with the instance rather than as a constructor function (cf. open_closed).

@mjungmath I don't understand what you mean by forgetful functor. These are parents, and have nothing to do with functors. For example, there is a forgetful functor from Rings -> Sets, and applying that functor to ZZ still obtains ZZ. It still has all of the behavior of an object in Sets, but there is no reason to actually forget about the ring structure.

@tscrim
Copy link
Collaborator

tscrim commented May 30, 2021

Reviewer: Travis Scrimshaw

@mkoeppe
Copy link
Member Author

mkoeppe commented May 30, 2021

comment:8

Replying to @tscrim:

The only question I have is why is ambient() a @staticmethod? I feel like it should be a normal method

OK, I'll make this change.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 30, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

46eed0eRealSet.ambient: Change to a normal method

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 30, 2021

Changed commit from 4b09685 to 46eed0e

@mkoeppe
Copy link
Member Author

mkoeppe commented May 30, 2021

comment:10

Replying to @tscrim:

I don't understand what you mean by forgetful functor. These are parents, and have nothing to do with functors. For example, there is a forgetful functor from Rings -> Sets, and applying that functor to ZZ still obtains ZZ. It still has all of the behavior of an object in Sets, but there is no reason to actually forget about the ring structure.

I think the idea would be that after applying the functor to the parent, asking for example for the homset would give a different answer.

@tscrim
Copy link
Collaborator

tscrim commented May 31, 2021

comment:11

Replying to @mkoeppe:

Replying to @tscrim:

I don't understand what you mean by forgetful functor. These are parents, and have nothing to do with functors. For example, there is a forgetful functor from Rings -> Sets, and applying that functor to ZZ still obtains ZZ. It still has all of the behavior of an object in Sets, but there is no reason to actually forget about the ring structure.

I think the idea would be that after applying the functor to the parent, asking for example for the homset would give a different answer.

IMO, it is better to pass that category information to the homset construction (which you can do) if you want to consider morphisms in a weaker category. This way you have less proliferation of "equal" parents and dealing with elements that maybe shouldn't have the additional structure. In this example, should you be able to add two integers that are in the ZZ as a Sets object? Plus, the category you want for the morphisms is a property of the morphism, not the parent.

@tscrim
Copy link
Collaborator

tscrim commented May 31, 2021

comment:12

Thanks for the change.

@mkoeppe
Copy link
Member Author

mkoeppe commented May 31, 2021

comment:13

Thanks!

@mjungmath
Copy link

comment:14

Replying to @tscrim:

I think this is good. As Matthias said, they are naturally topological spaces from the subspace topology.

Just because it comes with a natural topology doesn't mean it is the topology the user wants.

If you argument like that, every set must be seen in the category of topological spaces, because every set is endowed with a topology.

@mjungmath I don't understand what you mean by forgetful functor. These are parents, and have nothing to do with functors. For example, there is a forgetful functor from Rings -> Sets, and applying that functor to ZZ still obtains ZZ. It still has all of the behavior of an object in Sets, but there is no reason to actually forget about the ring structure.

IMO, it is better to pass that category information to the homset construction (which you can do) if you want to consider morphisms in a weaker category. This way you have less proliferation of "equal" parents and dealing with elements that maybe shouldn't have the additional structure. In this example, should you be able to add two integers that are in the ZZ as a Sets object? Plus, the category you want for the morphisms is a property of the morphism, not the parent.

Then I don't understand why we even have a forgetful functor if it technically just represents the identity functor...

@mjungmath
Copy link

comment:15

But I agree, for structures like rings, groups etc. this approach makes total sense. Though, I still don't understand why ForgetfulFunctor was introduced in the first place.

But for manifolds, things are slightly different. It would be good to have a functor that forgets about the topological structure, for example to impose another one. Like I said, I don't like the idea of enforcing a preferred topology on a set if we see it just as set (what we clearly do with RealSet as the name indicates).

@mkoeppe
Copy link
Member Author

mkoeppe commented May 31, 2021

comment:16

Replying to @mjungmath:

Replying to @tscrim:

I think this is good. As Matthias said, they are naturally topological spaces from the subspace topology.

Just because it comes with a natural topology doesn't mean it is the topology the user wants.

RealSet provides constructors for certain subsets of the reals. The "set" of real numbers comes with a distinguished topology, which is reflected by the names of the RealSet constructors for intervals such as open, closed.

In #31881 (RealSet: Extend constructors so that they can build manifold objects) I plan to add a category keyword argument. Then also the rather specialized use case that a subset of the real numbers is to be treated merely as a set can be achieved by passing category=Sets() to the constructors.

@mjungmath
Copy link

comment:17

Replying to @mkoeppe:

RealSet provides constructors for certain subsets of the reals. The "set" of real numbers comes with a distinguished topology, which is reflected by the names of the RealSet constructors for intervals such as open, closed.

Good point!

In #31881 (RealSet: Extend constructors so that they can build manifold objects) I plan to add a category keyword argument. Then also the rather specialized use case that a subset of the real numbers is to be treated merely as a set can be achieved by passing category=Sets() to the constructors.

+1

@tscrim
Copy link
Collaborator

tscrim commented May 31, 2021

comment:18

Just because it acts as the identity on parents, doesn't mean it is the identity functor. Be very careful with confusing abstract and concrete mathematics. If I said ZZ the set is the same as ZZ the ring, would you agree or disagree? Or would you be like Bill Clinton and state "That depends on what the definition of 'is' is."? The forgetful functor does carry some information, and that is the category you obtain at the end. It could also be used as a base class when you do have some more canonical implementations, but currently it doesn't seem to be used.

By being in the category of topological spaces, you are stating there is a preferred topology. This is akin to the WithBasis category saying there is a distinguished basis. This is why TopologicalSpaces is constructed as a functor construction category.

For the manifold code, while it is dynamic, each manifold is not meant to be treated as something that can change. So if you go from differentiable to topological, you either are actually constructing a different object because the maximal atlas is different or it has the same maximal atlas and you still require the maps to be differentiable. We just may not have provided enough information yet to see that difference.

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 19, 2021

Dependencies: #31880

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 19, 2021

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

5b8cecaInternalRealInterval, RealSet: Add `_latex_` methods
69ca854RealSet._repr_: Use unicode cup sign instead of +
dbdfc06InternalRealInterval, RealSet: Remove extra whitespace in latex, add documentation
7f56338PiecewiseFunction: Adjust doctests for changed RealSet repr
8abdc8bsrc/sage/functions/piecewise.py: Add coding header
5b0f85dMerge #31880

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 19, 2021

Changed commit from 46eed0e to 5b0f85d

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 19, 2021

comment:21

Merged to resolve merge conflict

@vbraun
Copy link
Member

vbraun commented Jun 29, 2021

Changed branch from u/mkoeppe/refine_category_of_realset to 5b0f85d

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

4 participants