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

Connect RealSet to sage.manifolds #30832

Closed
mkoeppe opened this issue Oct 26, 2020 · 30 comments
Closed

Connect RealSet to sage.manifolds #30832

mkoeppe opened this issue Oct 26, 2020 · 30 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 26, 2020

Instances of RealSet that are finite unions of open intervals should be connected in some way to sage.manifolds, in particular to OpenInterval and RealLine (which are both in the global namespace).

In this ticket, we add functionality to initialize a RealSet from instances of OpenInterval and RealLine, as well as from their topological closures (#31644)

Depends on #31644
Depends on #31877

CC: @mjungmath @egourgoulhon @tscrim

Component: manifolds

Author: Matthias Koeppe

Branch/Commit: 81b43f4

Reviewer: Michael Jung

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

@mkoeppe mkoeppe added this to the sage-9.3 milestone Oct 26, 2020
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 13, 2021

comment:2

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
@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 29, 2021

Dependencies: #31644

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 29, 2021

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 29, 2021

Author: Matthias Koeppe

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 29, 2021

Last 10 new commits:

e7f7a7dMerge #31764
9259a2cMerge #31798
ac53984src/sage/manifolds/subsets/__init__.py: New
21739desrc/sage/manifolds/subset.py: Simplify code, make pyflakes happy
6bbd4aesrc/sage/manifolds/subset.py: Add coding header
2d7fda7src/sage/manifolds/subset.py: Simplify code more to make pyflakes happy
8d3ad85Merge #31764
60505b0Merge #31798
9dd9f90Merge #31644
fb33c0fRealSet: Allow initialization from RealLine and OpenInterval instances and OpenInterval closures

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 29, 2021

Commit: fb33c0f

@mjungmath
Copy link

comment:6

Restricted to open intervals (not closures), this is nothing but the forgetful functor from manifolds into sets. Perhaps it is a good idea to add this functor somehow?

Other than that it looks good! Let's wait for the patchbot.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 29, 2021

comment:7

... or rather from manifolds to topological spaces (see #31877).

Do we have forgetful functors anywhere already?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 30, 2021

comment:8

We may also want to consider

  • adding a method RealSet.as_manifold_subset
  • extending the RealSet constructors (default constructor and RealSet.open etc.) so that they can build manifold objects; for example if structure or name is passed; then perhaps the global bindings RealLine and OpenInterval can be deprecated.

@mjungmath
Copy link

comment:9

Notice that RealSet supports unions of intervals whereas OpenInterval does not.

@mjungmath
Copy link

comment:10

Moreover, you represented closed or clopen intervals by a topological closure, which is fine for now. But as soon as we have manifolds with boundary, we probably want them to be represented by those objects/instances instead (or as well).

@mjungmath
Copy link

comment:11

LGTM

@mjungmath
Copy link

Reviewer: Michael Jung

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 30, 2021

comment:12

Replying to @mjungmath:

Notice that RealSet supports unions of intervals whereas OpenInterval does not.

Yes, it does. You can initialize a RealSet using several OpenInterval instances, and it will take the union.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 30, 2021

comment:13

Thanks for the review!

@mjungmath
Copy link

comment:14

Replying to @mkoeppe:

Replying to @mjungmath:

Notice that RealSet supports unions of intervals whereas OpenInterval does not.

Yes, it does. You can initialize a RealSet using several OpenInterval instances, and it will take the union.

That is not what I mean. There are no unions of OpenInterval on the manifold level yet. This is, for example, important for a potential RealSet.as_manifold_subset.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 30, 2021

comment:15

Replying to @mjungmath:

There are no unions of OpenInterval on the manifold level yet. This is, for example, important for a potential RealSet.as_manifold_subset.

If you create OpenInterval instances with the same ambient_interval set, then you can take unions.

sage: I02 = OpenInterval(0, 2, ambient_interval=RealLine())
sage: I13 = OpenInterval(1, 3, ambient_interval=RealLine())
sage: I02.union(I13)
Open subset (0, 2)_union_(1, 3) of the Real number line R

@mjungmath
Copy link

comment:16

Right, but

sage: I02 = OpenInterval(0, 2, ambient_interval=RealLine())
sage: I13 = OpenInterval(1, 3, ambient_interval=RealLine())
sage: U = I02.union(I13)
sage: RealSet(U)

won't work, no?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 30, 2021

comment:17

Good catch...

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 30, 2021

comment:18

Folllow up in #31878.

@tscrim
Copy link
Collaborator

tscrim commented May 30, 2021

comment:19

Replying to @mkoeppe:

... or rather from manifolds to topological spaces (see #31877).

Do we have forgetful functors anywhere already?

categories.functor.ForgetfulFunctor

@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. Last 10 new commits:

fd4506aMerge #31732
7fed9efMerge #31736
c4acd09Merge tag '9.4.beta2' into t/31763/manifoldsubset__new_methods_declare_subset__declare_superset
2ba18abMerge #31763
0e9e5cdMerge #31732
a96f736Merge #31736
582b58dMerge #31763
2113f78Merge #31764
9abc617Merge #31798
785aed0Merge #31644

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 19, 2021

Changed commit from fb33c0f to 785aed0

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 19, 2021

comment:21

Trivial merge with updated dependency

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 19, 2021

Changed dependencies from #31644 to #31644, #31877

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 19, 2021

Changed commit from 785aed0 to 81b43f4

@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:

4b09685RealSet: Put it in a suitable subcategory of TopologicalSpaces()
46eed0eRealSet.ambient: Change to a normal method
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
81b43f4Merge branch 't/31877/refine_category_of_realset' into t/30832/connect_realset_to_sage_manifolds

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 19, 2021

comment:24

Another trivial merge to remove a merge conflict

@vbraun
Copy link
Member

vbraun commented Jul 1, 2021

Changed branch from u/mkoeppe/connect_realset_to_sage_manifolds to 81b43f4

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