Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
ManifoldSubset.closure: New
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Apr 30, 2021
1 parent 426e087 commit 72294f0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion src/sage/manifolds/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,5 +1173,24 @@ def union(self, other, name=None, latex_name=None):
res._open_covers.append(oc)
return res

#### End of construction of new sets from self
def closure(self, name=None, latex_name=None):
r"""
Return the topological closure of ``self`` as a subset of the manifold.
EXAMPLES::
sage: M = Manifold(2, 'R^2', structure='topological')
sage: c_cart.<x,y> = M.chart() # Cartesian coordinates on R^2
sage: M.closure() is M
True
sage: D = M.open_subset('D', coord_def={c_cart: x^2+y^2<1}); D
Open subset D of the 2-dimensional topological manifold R^2
sage: cl_D = D.closure(); cl_D
Topological closure cl_D of the Open subset D of the 2-dimensional topological manifold R^2
"""
if self.manifold().is_subset(self):
return self
from .subsets.closure import ClosureOfManifoldSubset
return ClosureOfManifoldSubset(self, name=name, latex_name=latex_name)

#### End of construction of new sets from self
2 changes: 1 addition & 1 deletion src/sage/manifolds/subsets/closure.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ def _repr_(self):
TESTS::
"""
return "Topological closure {} of the {}".format(self._name, self._submanifold)
return "Topological closure {} of the {}".format(self._name, self._subset)

0 comments on commit 72294f0

Please sign in to comment.