RealSet: add methods closure, interior, boundary, is_open, is_closed
mkoeppe opened this issue · 18 comments
The intervals in a RealSet already have these methods.
It would also be nice to be able to compute closure and interior relative to a given larger RealSet.
sage: RealSet((1, 2)).closure(relative_to=RealSet((0, 2)) # wishful thinking
[1, 2)
One could also imagine that these should be methods of the real fields (such as RR) considered as a members of the category TopologicalSpaces.
Depends on #31880
CC: @rwst @vbraun @pjbruin @tscrim @mjungmath @yuan-zhou
Component: basic arithmetic
Author: Matthias Koeppe
Branch/Commit: 9d41f0e
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/21243
Description changed:
---
+++
@@ -7,4 +7,5 @@
[1, 2)
```
+One could also imagine that these should be methods of the real fields (such as RR) considered as a members of the category `TopologicalSpaces`.
New commits:
5b8ceca | InternalRealInterval, RealSet: Add `_latex_` methods |
69ca854 | RealSet._repr_: Use unicode cup sign instead of + |
dbdfc06 | InternalRealInterval, RealSet: Remove extra whitespace in latex, add documentation |
a0e3bf5 | Merge #31880 |
181b128 | RealSet.is_open, is_closed, closure, interior, boundary: New |
Author: Matthias Koeppe
Could you also add a test:
RealSet((1, 2), (2, 3)).boundary()
Other than that, LGTM.
Branch pushed to git repo; I updated commit sha1. New commits:
8fdb104 | RealSet.boundary: Add another doctest |
Reviewer: Travis Scrimshaw
Thank you.
Thanks for reviewing!
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
9d41f0e | src/sage/sets/real_set.py: Remove unnecessary import |
(as requested in #31927 comment:8)
Changed branch from u/mkoeppe/realset__add_methods_closure__interior__boundary__is_open__is_closed to 9d41f0e