sagemath/sage

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`. 
 

Dependencies: #31880

New commits:

5b8cecaInternalRealInterval, RealSet: Add `_latex_` methods
69ca854RealSet._repr_: Use unicode cup sign instead of +
dbdfc06InternalRealInterval, RealSet: Remove extra whitespace in latex, add documentation
a0e3bf5Merge #31880
181b128RealSet.is_open, is_closed, closure, interior, boundary: New

Author: Matthias Koeppe

Commit: 181b128

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

7f56338PiecewiseFunction: Adjust doctests for changed RealSet repr
8cd74b5Merge #31880

Changed commit from 181b128 to 8cd74b5

comment:7

Could you also add a test:

RealSet((1, 2), (2, 3)).boundary()

Other than that, LGTM.

Changed commit from 8cd74b5 to 8fdb104

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

8fdb104RealSet.boundary: Add another doctest

Reviewer: Travis Scrimshaw

comment:9

Thank you.

comment:10

Thanks for reviewing!

Changed commit from 8fdb104 to 9d41f0e

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

9d41f0esrc/sage/sets/real_set.py: Remove unnecessary import
comment:12

(as requested in #31927 comment:8)